/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.listview.min","./kendo.dropdownlist.min","./kendo.upload.min"],function(){!function(e,t){function a(e,t,a){var n,o;e.on("dragenter"+b,function(){t(),o=new Date,n||(n=setInterval(function(){var e=new Date-o;e>100&&(a(),clearInterval(n),n=null)},100))}).on("dragover"+b,function(){o=new Date})}function n(e,a){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+a}function o(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}var r,i,s,l,d=window.kendo,c=d.ui.Widget,u=e.isPlainObject,p=e.proxy,f=e.extend,h=d.support.placeholder,m=d.support.browser,v=e.isFunction,g=/(^\/|\/$)/g,k="change",_="apply",w="error",y="click",b=".kendoImageBrowser",S=".kendoBreadcrumbs",x=".kendoSearchBox",T="name",B="size",C="type",D={field:C,dir:"asc"},F=d.template('
  • ${text}
  • '),z='
    # if (showUpload) { #
    #=messages.uploadFile#
    # } ## if (showCreate) { ## } ## if (showDelete) { # # } #
    ').appendTo(this.element);t.breadcrumbs=a.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=a.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,a=this;a.trigger(w,e)||(t=e.xhr.status,"error"==e.status?"404"==t?a._showMessage(a.options.messages.directoryNotFound):"0"!=t&&a._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&a._showMessage("Error! Server timeout."))},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_loadImage:function(t){var a=this,n=e(t),o=a.dataSource.getByUid(n.attr(d.attr("uid"))),r=o.get(T),i=a.options.transport.thumbnailUrl,s=e("",{alt:r}),l="?";s.hide().on("load"+b,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),n.find(".k-loading").after(s),v(i)?i=i(a.path(),encodeURIComponent(r)):(i.indexOf("?")>=0&&(l="&"),i=i+l+"path="+a.path()+encodeURIComponent(r)),s.attr("src",i),t.loaded=!0},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var a=e.list.outerHeight(),n=e.list.scrollTop(),o=n+a;e._tiles.each(function(){var a=r(this),i=a+this.offsetHeight;return(a>=n&&o>a||i>=n&&o>i)&&e._loadImage(this),a>o?!1:t}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_editTmpl:function(){var e='
  • ',e+="#if("+C+' == "d") { #',e+='
    ',e+="#}else{#",e+='
    ',e+="#}#",e+="#if("+C+' == "d") { #',e+='',e+="#}#",e+="
  • ",p(d.template(e),{sizeFormatter:o})},_itemTmpl:function(){var e=this,t='
  • ',t+="#if("+C+' == "d") { #',t+='
    ',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'
    ':'
    ',t+="#}#",t+="${"+T+"}",t+="#if("+C+' == "f") { # ${this.sizeFormatter('+B+")} #}#",t+="
  • ",p(d.template(t),{sizeFormatter:o})},path:function(e){var a=this,n=a._path||"";return e!==t?(a._path=e.replace(g,"")+"/",a.dataSource.read({path:a._path}),t):(n&&(n=n.replace(g,"")),"/"===n||""===n?"":n+"/")}}),s=c.extend({init:function(e,t){var a=this;t=t||{},c.fn.init.call(a,e,t),h&&a.element.attr("placeholder",a.options.label),a._wrapper(),a.element.on("keydown"+x,p(a._keydown,a)).on("change"+x,p(a._updateValue,a)),a.wrapper.on(y+x,"a",p(a._click,a)),h||a.element.on("focus"+x,p(a._focus,a)).on("blur"+x,p(a._blur,a))},options:{name:"SearchBox",label:"Search",value:""},events:[k],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(x),c.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(k))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){h||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,a=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),a.length||(a=t.wrap(e('
    ')).parent(),h||e('").insertBefore(t),e('').appendTo(a)),this.wrapper=a,this.label=a.find(">label")},value:function(e){var a=this;return e!==t?(a.options.value=e,a.element.val(e),a._toggleLabel(),t):a.options.value}}),l=c.extend({init:function(e,t){var a=this;t=t||{},c.fn.init.call(a,e,t),a._wrapper(),a.wrapper.on("focus"+S,"input",p(a._focus,a)).on("blur"+S,"input",p(a._blur,a)).on("keydown"+S,"input",p(a._keydown,a)).on(y+S,"a.k-i-arrow-n:first",p(a._rootClick,a)).on(y+S,"a:not(.k-i-arrow-n)",p(a._click,a)),a.value(a.options.value)},options:{name:"Breadcrumbs",gap:50},events:[k],destroy:function(){var e=this;c.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(S)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(k))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").andSelf()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,a=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(a)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,a=this.element,n=a.parents(".k-breadcrumbs");a[0].style.width="",a.addClass("k-input"),n.length||(n=a.wrap(e('
    ')).parent()),t=n.find(".k-breadcrumbs-wrap"),t.length||(t=e('
    ').appendTo(n)),this.wrapper=n,this.overlay=t},refresh:function(){var a,n,o,r,i="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),a=s.split("/"),o=0,r=a.length;r>o;o++)n=a[o],n&&(i||(i+='root'),i+=''+a[o]+"",i+='>');this.overlay.empty().append(e(i)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,a=this,n=a.wrapper,o=n.width()-a.options.gap,r=a.overlay.find("a");r.each(function(a){t=e(this),t.parent().width()>o&&(a==r.length-1?t.width(o):t.prev().andSelf().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value},_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),d.ui.plugin(i),d.ui.plugin(l),d.ui.plugin(s)}(window.kendo.jQuery)});