{"version":3,"sources":["kendo.filebrowser.js"],"names":["f","define","$","undefined","bindDragEventWrappers","element","onDragEnter","onDragLeave","hideInterval","lastDrag","on","NS","Date","setInterval","sinceLastDrag","clearInterval","concatPaths","path","name","match","sizeFormatter","value","suffix","Math","round","fieldName","fields","descriptor","isPlainObject","from","field","offsetTop","FileBrowser","SearchBox","kendo","window","Widget","ui","proxy","extend","placeholderSupported","support","placeholder","browser","isFunction","trimSlashesRegExp","CHANGE","APPLY","ERROR","CLICK","SEARCHBOXNS","NAMEFIELD","SIZEFIELD","TYPEFIELD","DEFAULTSORTORDER","dir","EMPTYTILE","template","TOOLBARTMPL","data","schemas","filebrowser","items","model","id","size","type","transports","RemoteTransport","init","options","fn","call","this","_call","read","create","destroy","update","msie","version","height","that","addClass","_deleteClick","_addClick","_directoryKeyDown","_directoryBlur","_dataSource","refresh","messages","uploadFile","orderBy","orderByName","orderBySize","directoryNotFound","emptyFolder","deleteFile","invalidFileType","overwriteFile","dropFilesHere","search","transport","fileTypes","events","dataSource","unbind","_errorHandler","add","list","toolbar","off","selected","_selectedItem","fileUrl","get","replace","format","encodeURIComponent","listView","select","length","getByUid","attr","_toolbar","arrangeBy","text","showUpload","uploadUrl","showCreate","showDelete","appendTo","find","kendoUpload","multiple","localization","async","saveUrl","autoUpload","upload","_fileUpload","error","e","_error","xhr","XMLHttpRequest","status","end","kendoDropDownList","dataTextField","dataValueField","change","searchBox","kendoSearchBox","label","_attachDropzoneEvents","document","documentElement","_dropEnter","_dropLeave","_scrollHandler","_positionDropzone","_removeDropzone","offset","css","width","clientWidth","clientHeight","lineHeight","removeClass","top","left","item","message","_showMessage","remove","createDirectory","_getFieldName","reader","file","filterRegExp","RegExp","split","join","fileName","files","fileSize","fileNameField","sizeField","test","_createFile","one","_insertFileToList","_override","set","response","pushUpdate","_tiles","filter","preventDefault","_findFile","idx","result","typeField","nameField","toLowerCase","index","view","i","insert","lastDirectoryIdx","_nameDirectory","uid","edit","scrollTop","offsetHeight","setTimeout","_nameExists","keyCode","currentTarget","blur","save","candidate","directoryNames","indexOf","push","inArray","sort","operator","_content","_dblClick","ListView","layout","flex","direction","wrap","_itemTmpl","editTemplate","_editTmpl","selectable","autoBind","dataBinding","parent","action","progress","content","dataBound","append","_listViewChange","folder","li","hasClass","breadcrumbs","trigger","schema","typeSortOrder","nameSortOrder","DataSource","bind","_navigation","navigation","kendoBreadcrumb","editable","gap","statusText","hasChanges","cancelChanges","html","_path","_wrapper","_keydown","_updateValue","wrapper","_click","_focus","_blur","val","_toggleLabel","toggle","hide","parents","style","insertBefore","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,qBACH,iBACA,qBACA,eACA,oBACDD,IACL,WA0pBE,MA3oBC,UAAUE,EAAGC,GAwDV,QAASC,GAAsBC,EAASC,EAAaC,GACjD,GAAIC,GAAcC,CAClBJ,GAAQK,GAAG,YAAcC,EAAI,WACzBL,IACAG,EAAW,GAAIG,MACVJ,IACDA,EAAeK,YAAY,WACvB,GAAIC,GAAgB,GAAIF,MAASH,CAC7BK,GAAgB,MAChBP,IACAQ,cAAcP,GACdA,EAAe,OAEpB,QAERE,GAAG,WAAaC,EAAI,WACnBF,EAAW,GAAIG,QAavB,QAASI,GAAYC,EAAMC,GAIvB,MAHID,KAASd,GAAcc,EAAKE,MAAM,SAClCF,GAAQA,GAAQ,IAAM,KAEnBA,EAAOC,EAElB,QAASE,GAAcC,GACnB,IAAKA,EACD,MAAO,EAEX,IAAIC,GAAS,QAWb,OAVID,IAAS,YACTC,EAAS,MACTD,GAAS,YACFA,GAAS,SAChBC,EAAS,MACTD,GAAS,SACFA,GAAS,OAChBC,EAAS,MACTD,GAAS,MAENE,KAAKC,MAAc,IAARH,GAAe,IAAMC,EAE3C,QAASG,GAAUC,EAAQR,GACvB,GAAIS,GAAaD,EAAOR,EACxB,OAAIU,GAAcD,GACPA,EAAWE,MAAQF,EAAWG,OAASZ,E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AAKiF,MAAQsH,EAAQ5I,KAAK,WAE9B/G,MAAO,SAAUA,GACb,GAAI6D,GAAOT,IACX,OAAIpD,KAAUlB,GACV+E,EAAKZ,QAAQjD,MAAQA,EACrB6D,EAAK7E,QAAQ+Q,IAAI/P,GACjB6D,EAAKmM,eACL,GAEGnM,EAAKZ,QAAQjD,SAG5Ba,EAAMG,GAAGsP,OAAO3P,GAChBE,EAAMG,GAAGsP,OAAO1P,IAClBE,OAAOD,MAAM0P,QACRzP,OAAOD,OACE,kBAAVjC,SAAwBA,OAAO4R,IAAM5R,OAAS,SAAU6R,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.filebrowser.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.filebrowser', [\n 'kendo.listview',\n 'kendo.dropdownlist',\n 'kendo.upload',\n 'kendo.breadcrumb'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'filebrowser',\n name: 'FileBrowser',\n category: 'web',\n description: '',\n hidden: true,\n depends: [\n 'selectable',\n 'listview',\n 'dropdownlist',\n 'upload',\n 'breadcrumb'\n ]\n };\n (function ($, undefined) {\n var kendo = window.kendo, Widget = kendo.ui.Widget, isPlainObject = $.isPlainObject, proxy = $.proxy, extend = $.extend, placeholderSupported = kendo.support.placeholder, browser = kendo.support.browser, isFunction = kendo.isFunction, trimSlashesRegExp = /(^\\/|\\/$)/g, CHANGE = 'change', APPLY = 'apply', ERROR = 'error', CLICK = 'click', NS = '.kendoFileBrowser', SEARCHBOXNS = '.kendoSearchBox', NAMEFIELD = 'name', SIZEFIELD = 'size', TYPEFIELD = 'type', DEFAULTSORTORDER = {\n field: TYPEFIELD,\n dir: 'asc'\n }, EMPTYTILE = kendo.template('
${text}
'), TOOLBARTMPL = '
' + '# if (showCreate) { #' + '' + '# } #' + '# if (showUpload) { # ' + '
' + '#=messages.uploadFile#
' + '# } #' + '# if (showDelete) { #' + '' + '# } #' + '
' + '' + '
' + '' + '' + '
';\n extend(true, kendo.data, {\n schemas: {\n 'filebrowser': {\n data: function (data) {\n return data.items || data || [];\n },\n model: {\n id: 'name',\n fields: {\n name: 'name',\n size: 'size',\n type: 'type'\n }\n }\n }\n }\n });\n extend(true, kendo.data, {\n transports: {\n 'filebrowser': kendo.data.RemoteTransport.extend({\n init: function (options) {\n kendo.data.RemoteTransport.fn.init.call(this, $.extend(true, {}, this.options, options));\n },\n _call: function (type, options) {\n options.data = $.extend({}, options.data, { path: this.options.path() });\n if (isFunction(this.options[type])) {\n this.options[type].call(this, options);\n } else {\n kendo.data.RemoteTransport.fn[type].call(this, options);\n }\n },\n read: function (options) {\n this._call('read', options);\n },\n create: function (options) {\n this._call('create', options);\n },\n destroy: function (options) {\n this._call('destroy', options);\n },\n update: function () {\n },\n options: {\n read: { type: 'POST' },\n update: { type: 'POST' },\n create: { type: 'POST' },\n destroy: { type: 'POST' }\n }\n })\n }\n });\n function bindDragEventWrappers(element, onDragEnter, onDragLeave) {\n var hideInterval, lastDrag;\n element.on('dragenter' + NS, function () {\n onDragEnter();\n lastDrag = new Date();\n if (!hideInterval) {\n hideInterval = setInterval(function () {\n var sinceLastDrag = new Date() - lastDrag;\n if (sinceLastDrag > 100) {\n onDragLeave();\n clearInterval(hideInterval);\n hideInterval = null;\n }\n }, 100);\n }\n }).on('dragover' + NS, function () {\n lastDrag = new Date();\n });\n }\n var offsetTop;\n if (browser.msie && browser.version < 8) {\n offsetTop = function (element) {\n return element.offsetTop;\n };\n } else {\n offsetTop = function (element) {\n return element.offsetTop - $(element).height();\n };\n }\n function concatPaths(path, name) {\n if (path === undefined || !path.match(/\\/$/)) {\n path = (path || '') + '/';\n }\n return path + name;\n }\n function sizeFormatter(value) {\n if (!value) {\n return '';\n }\n var suffix = ' bytes';\n if (value >= 1073741824) {\n suffix = ' GB';\n value /= 1073741824;\n } else if (value >= 1048576) {\n suffix = ' MB';\n value /= 1048576;\n } else if (value >= 1024) {\n suffix = ' KB';\n value /= 1024;\n }\n return Math.round(value * 100) / 100 + suffix;\n }\n function fieldName(fields, name) {\n var descriptor = fields[name];\n if (isPlainObject(descriptor)) {\n return descriptor.from || descriptor.field || name;\n }\n return descriptor;\n }\n var FileBrowser = Widget.extend({\n init: function (element, options) {\n var that = this;\n options = options || {};\n Widget.fn.init.call(that, element, options);\n that.element.addClass('k-filebrowser');\n that.element.on(CLICK + NS, '.k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-i-close)', proxy(that._deleteClick, that)).on(CLICK + NS, '.k-filebrowser-toolbar button:not(.k-state-disabled):has(.k-i-folder-add)', proxy(that._addClick, that)).on('keydown' + NS, '.k-listview-item.k-state-selected input', proxy(that._directoryKeyDown, that)).on('blur' + NS, '.k-listview-item.k-state-selected input', proxy(that._directoryBlur, that));\n that._dataSource();\n that.refresh();\n that.path(that.options.path);\n },\n options: {\n name: 'FileBrowser',\n messages: {\n uploadFile: 'Upload',\n orderBy: 'Arrange by',\n orderByName: 'Name',\n orderBySize: 'Size',\n directoryNotFound: 'A directory with this name was not found.',\n emptyFolder: 'Empty Folder',\n deleteFile: 'Are you sure you want to delete \"{0}\"?',\n invalidFileType: 'The selected file \"{0}\" is not valid. Supported file types are {1}.',\n overwriteFile: 'A file with name \"{0}\" already exists in the current directory. Do you want to overwrite it?',\n dropFilesHere: 'drop file here to upload',\n search: 'Search'\n },\n transport: {},\n path: '/',\n fileTypes: '*.*'\n },\n events: [\n ERROR,\n CHANGE,\n APPLY\n ],\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(that);\n that.dataSource.unbind(ERROR, that._errorHandler);\n that.element.add(that.list).add(that.toolbar).off(NS);\n kendo.destroy(that.element);\n },\n value: function () {\n var that = this, selected = that._selectedItem(), path, fileUrl = that.options.transport.fileUrl;\n if (selected && selected.get(TYPEFIELD) === 'f') {\n path = concatPaths(that.path(), selected.get(NAMEFIELD)).replace(trimSlashesRegExp, '');\n if (fileUrl) {\n path = isFunction(fileUrl) ? fileUrl(path) : kendo.format(fileUrl, encodeURIComponent(path));\n }\n return path;\n }\n },\n _selectedItem: function () {\n var listView = this.listView, selected = listView.select();\n if (selected.length) {\n return this.dataSource.getByUid(selected.attr(kendo.attr('uid')));\n }\n },\n _toolbar: function () {\n var that = this, template = kendo.template(TOOLBARTMPL), messages = that.options.messages, arrangeBy = [\n {\n text: messages.orderByName,\n value: 'name'\n },\n {\n text: messages.orderBySize,\n value: 'size'\n }\n ];\n that.toolbar = $(template({\n messages: messages,\n showUpload: that.options.transport.uploadUrl,\n showCreate: that.options.transport.create,\n showDelete: that.options.transport.destroy\n })).appendTo(that.element).find('.k-upload input').kendoUpload({\n multiple: false,\n localization: { dropFilesHere: messages.dropFilesHere },\n async: {\n saveUrl: that.options.transport.uploadUrl,\n autoUpload: true\n },\n upload: proxy(that._fileUpload, that),\n error: function (e) {\n that._error({\n xhr: e.XMLHttpRequest,\n status: 'error'\n });\n }\n }).end();\n that.upload = that.toolbar.find('.k-upload input').data('kendoUpload');\n that.arrangeBy = that.toolbar.find('.k-tiles-arrange select').kendoDropDownList({\n dataSource: arrangeBy,\n dataTextField: 'text',\n dataValueField: 'value',\n change: function () {\n that.orderBy(this.value());\n }\n }).data('kendoDropDownList');\n that.searchBox = that.toolbar.find('input[data-role=\\'searchbox\\']').kendoSearchBox({\n label: that.options.messages.search,\n change: function () {\n that.search(this.value());\n }\n }).data('kendoSearchBox');\n that._attachDropzoneEvents();\n },\n _attachDropzoneEvents: function () {\n var that = this;\n if (that.options.transport.uploadUrl) {\n bindDragEventWrappers($(document.documentElement), $.proxy(that._dropEnter, that), $.proxy(that._dropLeave, that));\n that._scrollHandler = proxy(that._positionDropzone, that);\n }\n },\n _dropEnter: function () {\n this._positionDropzone();\n $(document).on('scroll' + NS, this._scrollHandler);\n },\n _dropLeave: function () {\n this._removeDropzone();\n $(document).off('scroll' + NS, this._scrollHandler);\n },\n _positionDropzone: function () {\n var that = this, element = that.element, offset = element.offset();\n that.toolbar.find('.k-dropzone').addClass('k-filebrowser-dropzone').offset(offset).css({\n width: element[0].clientWidth,\n height: element[0].clientHeight,\n lineHeight: element[0].clientHeight + 'px'\n });\n },\n _removeDropzone: function () {\n this.toolbar.find('.k-dropzone').removeClass('k-filebrowser-dropzone').css({\n width: '',\n height: '',\n lineHeight: '',\n top: '',\n left: ''\n });\n },\n _deleteClick: function () {\n var that = this, item = that.listView.select(), message = kendo.format(that.options.messages.deleteFile, item.find('.k-file-name').text());\n if (item.length && that._showMessage(message, 'confirm')) {\n that.listView.remove(item);\n }\n },\n _addClick: function () {\n this.createDirectory();\n },\n _getFieldName: function (name) {\n return fieldName(this.dataSource.reader.model.fields, name);\n },\n _fileUpload: function (e) {\n var that = this, options = that.options, fileTypes = options.fileTypes, filterRegExp = new RegExp(('(' + fileTypes.split(',').join(')|(') + ')').replace(/\\*\\./g, '.*.'), 'i'), fileName = e.files[0].name, fileSize = e.files[0].size, fileNameField = NAMEFIELD, sizeField = SIZEFIELD, file;\n if (filterRegExp.test(fileName)) {\n e.data = { path: that.path() };\n file = that._createFile(fileName, fileSize);\n if (!file) {\n e.preventDefault();\n } else {\n that.upload.one('success', function (e) {\n var model = that._insertFileToList(file);\n if (model._override) {\n model.set(fileNameField, e.response[that._getFieldName(fileNameField)]);\n model.set(sizeField, e.response[that._getFieldName(sizeField)]);\n that.listView.dataSource.pushUpdate(model);\n }\n that._tiles = that.listView.items().filter('[' + kendo.attr('type') + '=f]');\n });\n }\n } else {\n e.preventDefault();\n that._showMessage(kendo.format(options.messages.invalidFileType, fileName, fileTypes));\n }\n },\n _findFile: function (name) {\n var data = this.dataSource.data(), idx, result, typeField = TYPEFIELD, nameField = NAMEFIELD, length;\n name = name.toLowerCase();\n for (idx = 0, length = data.length; idx < length; idx++) {\n if (data[idx].get(typeField) === 'f' && data[idx].get(nameField).toLowerCase() === name) {\n result = data[idx];\n break;\n }\n }\n return result;\n },\n _createFile: function (fileName, fileSize) {\n var that = this, model = {}, typeField = TYPEFIELD, file = that._findFile(fileName);\n if (file) {\n if (!that._showMessage(kendo.format(that.options.messages.overwriteFile, fileName), 'confirm')) {\n return null;\n } else {\n file._override = true;\n return file;\n }\n }\n model[typeField] = 'f';\n model[NAMEFIELD] = fileName;\n model[SIZEFIELD] = fileSize;\n return model;\n },\n _insertFileToList: function (model) {\n var index;\n if (model._override) {\n return model;\n }\n var dataSource = this.dataSource;\n var view = dataSource.view();\n for (var i = 0, length = view.length; i < length; i++) {\n if (view[i].get(TYPEFIELD) === 'f') {\n index = i;\n break;\n }\n }\n return dataSource.insert(++index, model);\n },\n createDirectory: function () {\n var that = this, idx, length, lastDirectoryIdx = 0, typeField = TYPEFIELD, nameField = NAMEFIELD, view = that.dataSource.data(), name = that._nameDirectory(), model = new that.dataSource.reader.model();\n for (idx = 0, length = view.length; idx < length; idx++) {\n if (view[idx].get(typeField) === 'd') {\n lastDirectoryIdx = idx;\n }\n }\n model.set(typeField, 'd');\n model.set(nameField, name);\n that.listView.one('dataBound', function () {\n var selected = that.listView.items().filter('[' + kendo.attr('uid') + '=' + model.uid + ']');\n if (selected.length) {\n this.edit(selected);\n }\n this.element.scrollTop(selected.attr('offsetTop') - this.element[0].offsetHeight);\n setTimeout(function () {\n that.listView.element.find('.k-edit-item input').select();\n });\n }).one('save', function (e) {\n var value = e.model.get(nameField);\n if (!value) {\n e.model.set(nameField, name);\n } else {\n e.model.set(nameField, that._nameExists(value, model.uid) ? that._nameDirectory() : value);\n }\n });\n that.dataSource.insert(++lastDirectoryIdx, model);\n },\n _directoryKeyDown: function (e) {\n if (e.keyCode == 13) {\n e.currentTarget.blur();\n }\n },\n _directoryBlur: function () {\n this.listView.save();\n },\n _nameExists: function (name, uid) {\n var data = this.dataSource.data(), typeField = TYPEFIELD, nameField = NAMEFIELD, idx, length;\n for (idx = 0, length = data.length; idx < length; idx++) {\n if (data[idx].get(typeField) === 'd' && data[idx].get(nameField).toLowerCase() === name.toLowerCase() && data[idx].uid !== uid) {\n return true;\n }\n }\n return false;\n },\n _nameDirectory: function () {\n var name = 'New folder', data = this.dataSource.data(), directoryNames = [], typeField = TYPEFIELD, nameField = NAMEFIELD, candidate, idx, length;\n for (idx = 0, length = data.length; idx < length; idx++) {\n if (data[idx].get(typeField) === 'd' && data[idx].get(nameField).toLowerCase().indexOf(name.toLowerCase()) > -1) {\n directoryNames.push(data[idx].get(nameField));\n }\n }\n if ($.inArray(name, directoryNames) > -1) {\n idx = 2;\n do {\n candidate = name + ' (' + idx + ')';\n idx++;\n } while ($.inArray(candidate, directoryNames) > -1);\n name = candidate;\n }\n return name;\n },\n orderBy: function (field) {\n this.dataSource.sort([\n {\n field: TYPEFIELD,\n dir: 'asc'\n },\n {\n field: field,\n dir: 'asc'\n }\n ]);\n },\n search: function (name) {\n this.dataSource.filter({\n field: NAMEFIELD,\n operator: 'contains',\n value: name\n });\n },\n _content: function () {\n var that = this;\n that.list = $('
').appendTo(that.element).on('dblclick' + NS, '.k-listview-item', proxy(that._dblClick, that));\n that.listView = new kendo.ui.ListView(that.list, {\n layout: 'flex',\n flex: {\n direction: 'row',\n wrap: 'wrap'\n },\n dataSource: that.dataSource,\n template: that._itemTmpl(),\n editTemplate: that._editTmpl(),\n selectable: true,\n autoBind: false,\n dataBinding: function (e) {\n that.toolbar.find('.k-i-close').parent().addClass('k-state-disabled');\n if (e.action === 'remove' || e.action === 'sync') {\n e.preventDefault();\n kendo.ui.progress(that.listView.content, false);\n }\n },\n dataBound: function () {\n if (that.dataSource.view().length) {\n that._tiles = this.items().filter('[' + kendo.attr('type') + '=f]');\n } else {\n this.content.append(EMPTYTILE({ text: that.options.messages.emptyFolder }));\n }\n },\n change: proxy(that._listViewChange, that)\n });\n },\n _dblClick: function (e) {\n var that = this, li = $(e.currentTarget);\n if (li.hasClass('k-edit-item')) {\n that._directoryBlur();\n }\n if (li.filter('[' + kendo.attr('type') + '=d]').length) {\n var folder = that.dataSource.getByUid(li.attr(kendo.attr('uid')));\n if (folder) {\n that.path(concatPaths(that.path(), folder.get(NAMEFIELD)));\n that.breadcrumbs.value('/' + that.path());\n }\n } else if (li.filter('[' + kendo.attr('type') + '=f]').length) {\n that.trigger(APPLY);\n }\n },\n _listViewChange: function () {\n var selected = this._selectedItem();\n if (selected) {\n this.toolbar.find('.k-i-close').parent().removeClass('k-state-disabled');\n this.trigger(CHANGE, { selected: selected });\n }\n },\n _dataSource: function () {\n var that = this, options = that.options, transport = options.transport, typeSortOrder = extend({}, DEFAULTSORTORDER), nameSortOrder = {\n field: NAMEFIELD,\n dir: 'asc'\n }, schema, dataSource = {\n type: transport.type || 'filebrowser',\n sort: [\n typeSortOrder,\n nameSortOrder\n ]\n };\n if (isPlainObject(transport)) {\n transport.path = proxy(that.path, that);\n dataSource.transport = transport;\n }\n if (isPlainObject(options.schema)) {\n dataSource.schema = options.schema;\n } else if (transport.type && isPlainObject(kendo.data.schemas[transport.type])) {\n schema = kendo.data.schemas[transport.type];\n }\n if (that.dataSource && that._errorHandler) {\n that.dataSource.unbind(ERROR, that._errorHandler);\n } else {\n that._errorHandler = proxy(that._error, that);\n }\n that.dataSource = kendo.data.DataSource.create(dataSource).bind(ERROR, that._errorHandler);\n },\n _navigation: function () {\n var that = this, navigation = $('
').appendTo(this.element);\n that.breadcrumbs = navigation.find('nav:first').kendoBreadcrumb({\n editable: true,\n gap: 50,\n value: that.options.path || '/',\n change: function () {\n that.path(this.value());\n }\n }).data('kendoBreadcrumb');\n },\n _error: function (e) {\n var that = this, status;\n if (!that.trigger(ERROR, e)) {\n status = e.xhr.status;\n if (e.status == 'error') {\n if (status == '404') {\n that._showMessage(that.options.messages.directoryNotFound);\n } else if (status != '0') {\n that._showMessage('Error! The requested URL returned ' + status + ' - ' + e.xhr.statusText);\n }\n } else if (status == 'timeout') {\n that._showMessage('Error! Server timeout.');\n }\n var dataSource = that.dataSource;\n if (dataSource.hasChanges()) {\n dataSource.cancelChanges();\n }\n }\n },\n _showMessage: function (message, type) {\n return window[type || 'alert'](message);\n },\n refresh: function () {\n var that = this;\n that._navigation();\n that._toolbar();\n that._content();\n },\n _editTmpl: function () {\n var html = '
';\n html += '#if(' + TYPEFIELD + ' == \"d\") { #';\n html += '
';\n html += '#}else{#';\n html += '
';\n html += '#}#';\n html += '#if(' + TYPEFIELD + ' == \"d\") { #';\n html += '';\n html += '#}#';\n html += '
';\n return proxy(kendo.template(html), { sizeFormatter: sizeFormatter });\n },\n _itemTmpl: function () {\n var html = '
';\n html += '#if(' + TYPEFIELD + ' == \"d\") { #';\n html += '
';\n html += '#}else{#';\n html += '
';\n html += '#}#';\n html += '${' + NAMEFIELD + '}';\n html += '#if(' + TYPEFIELD + ' == \"f\") { # ${this.sizeFormatter(' + SIZEFIELD + ')} #}#';\n html += '
';\n return proxy(kendo.template(html), { sizeFormatter: sizeFormatter });\n },\n path: function (value) {\n var that = this, path = that._path || '';\n if (value !== undefined) {\n that._path = value.replace(trimSlashesRegExp, '') + '/';\n that.dataSource.read({ path: that._path });\n return;\n }\n if (path) {\n path = path.replace(trimSlashesRegExp, '');\n }\n return path === '/' || path === '' ? '' : path + '/';\n }\n });\n var SearchBox = Widget.extend({\n init: function (element, options) {\n var that = this;\n options = options || {};\n Widget.fn.init.call(that, element, options);\n if (placeholderSupported) {\n that.element.attr('placeholder', that.options.label);\n }\n that._wrapper();\n that.element.on('keydown' + SEARCHBOXNS, proxy(that._keydown, that)).on('change' + SEARCHBOXNS, proxy(that._updateValue, that));\n that.wrapper.on(CLICK + SEARCHBOXNS, 'a', proxy(that._click, that));\n if (!placeholderSupported) {\n that.element.on('focus' + SEARCHBOXNS, proxy(that._focus, that)).on('blur' + SEARCHBOXNS, proxy(that._blur, that));\n }\n },\n options: {\n name: 'SearchBox',\n label: 'Search',\n value: ''\n },\n events: [CHANGE],\n destroy: function () {\n var that = this;\n that.wrapper.add(that.element).add(that.label).off(SEARCHBOXNS);\n Widget.fn.destroy.call(that);\n },\n _keydown: function (e) {\n if (e.keyCode === 13) {\n this._updateValue();\n }\n },\n _click: function (e) {\n e.preventDefault();\n this._updateValue();\n },\n _updateValue: function () {\n var that = this, value = that.element.val();\n if (value !== that.value()) {\n that.value(value);\n that.trigger(CHANGE);\n }\n },\n _blur: function () {\n this._updateValue();\n this._toggleLabel();\n },\n _toggleLabel: function () {\n if (!placeholderSupported) {\n this.label.toggle(!this.element.val());\n }\n },\n _focus: function () {\n this.label.hide();\n },\n _wrapper: function () {\n var element = this.element, wrapper = element.parents('.k-search-wrap');\n element[0].style.width = '';\n element.addClass('k-input');\n if (!wrapper.length) {\n wrapper = element.wrap($('
')).parent();\n if (!placeholderSupported) {\n $('').insertBefore(element);\n }\n $('').appendTo(wrapper);\n }\n this.wrapper = wrapper;\n this.label = wrapper.find('>label');\n },\n value: function (value) {\n var that = this;\n if (value !== undefined) {\n that.options.value = value;\n that.element.val(value);\n that._toggleLabel();\n return;\n }\n return that.options.value;\n }\n });\n kendo.ui.plugin(FileBrowser);\n kendo.ui.plugin(SearchBox);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}