define([ 'jquery', '/api/config', '/common/toolbar.js', 'json.sortify', '/common/common-util.js', '/common/common-hash.js', '/common/common-ui-elements.js', '/common/common-interface.js', '/common/common-constants.js', '/common/common-feedback.js', '/common/inner/share.js', '/common/inner/access.js', '/common/inner/properties.js', '/bower_components/nthen/index.js', '/common/hyperscript.js', '/common/proxy-manager.js', '/customize/application_config.js', '/customize/messages.js', ], function ( $, ApiConfig, Toolbar, JSONSortify, Util, Hash, UIElements, UI, Constants, Feedback, Share, Access, Properties, nThen, h, ProxyManager, AppConfig, Messages) { var APP = window.APP = { editable: false, online: true, mobile: function () { if (window.matchMedia) { return !window.matchMedia('(any-pointer:fine)').matches; } else { return $('body').width() <= 600; } }, isMac: navigator.platform === "MacIntel", allowFolderUpload: File.prototype.hasOwnProperty("webkitRelativePath"), }; var stringify = function (obj) { return JSONSortify(obj); }; var E_OVER_LIMIT = 'E_OVER_LIMIT'; var ROOT = "root"; var ROOT_NAME = Messages.fm_rootName; var SEARCH = "search"; var SEARCH_NAME = Messages.fm_searchName; var TRASH = "trash"; var TRASH_NAME = Messages.fm_trashName; var FILES_DATA = Constants.storageKey; var FILES_DATA_NAME = Messages.fm_filesDataName; var TEMPLATE = "template"; var TEMPLATE_NAME = Messages.fm_templateName; var RECENT = "recent"; var RECENT_NAME = Messages.fm_recentPadsName; var OWNED = "owned"; var OWNED_NAME = Messages.fm_ownedPadsName; var TAGS = "tags"; var TAGS_NAME = Messages.fm_tagsName; var SHARED_FOLDER = 'sf'; var SHARED_FOLDER_NAME = Messages.fm_sharedFolderName; // Icons var faFolder = 'cptools-folder'; var faFolderOpen = 'cptools-folder-open'; var faSharedFolder = 'cptools-shared-folder'; var faSharedFolderOpen = 'cptools-shared-folder-open'; var faExpandAll = 'fa-plus-square-o'; var faCollapseAll = 'fa-minus-square-o'; var faShared = 'fa-shhare-alt'; var faReadOnly = 'fa-eye'; var faPreview = 'fa-eye'; var faOpenInCode = 'cptools-code'; var faRename = 'fa-pencil'; var faColor = 'cptools-palette'; var faTrash = 'fa-trash'; var faCopy = 'fa-files-o'; var faDelete = 'cptools-destroy'; var faAccess = 'fa-unlock-alt'; var faProperties = 'fa-info-circle'; var faTags = 'fa-hashtag'; var faUploadFiles = 'cptools-file-upload'; var faUploadFolder = 'cptools-folder-upload'; var faEmpty = 'fa-trash-o'; var faRestore = 'fa-repeat'; var faShowParent = 'fa-location-arrow'; var faDownload = 'fa-download'; var $folderIcon = $('', { "class": faFolder + " cptools cp-app-drive-icon-folder cp-app-drive-content-icon" }); //var $folderIcon = $('', {src: "/customize/images/icons/folder.svg", "class": "folder icon"}); var $folderEmptyIcon = $folderIcon.clone(); var $folderOpenedIcon = $('', {"class": faFolderOpen + " cptools cp-app-drive-icon-folder"}); //var $folderOpenedIcon = $('', {src: "/customize/images/icons/folderOpen.svg", "class": "folder icon"}); var $folderOpenedEmptyIcon = $folderOpenedIcon.clone(); var $sharedFolderIcon = $('', {"class": faSharedFolder + " cptools cp-app-drive-icon-folder"}); var $sharedFolderOpenedIcon = $('', {"class": faSharedFolderOpen + " cptools cp-app-drive-icon-folder"}); //var $upIcon = $('', {"class": "fa fa-arrow-circle-up"}); var $unsortedIcon = $('', {"class": "fa fa-files-o"}); var $templateIcon = $('', {"class": "cptools cptools-template"}); var $recentIcon = $('', {"class": "fa fa-clock-o"}); var $trashIcon = $('', {"class": "fa " + faTrash}); var $trashEmptyIcon = $('', {"class": "fa fa-trash-o"}); //var $collapseIcon = $('', {"class": "fa fa-minus-square-o cp-app-drive-icon-expcol"}); var $expandIcon = $('', {"class": "fa fa-plus-square-o cp-app-drive-icon-expcol"}); var $listIcon = $('