define([ 'jquery', '/common/toolbar3.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', '/bower_components/nthen/index.js', '/common/sframe-common.js', '/common/common-realtime.js', '/common/hyperscript.js', '/common/proxy-manager.js', '/customize/application_config.js', '/bower_components/chainpad-listmap/chainpad-listmap.js', '/customize/messages.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', 'less!/drive/app-drive.less', ], function ( $, Toolbar, JSONSortify, Util, Hash, UIElements, UI, Constants, Feedback, nThen, SFCommon, CommonRealtime, h, ProxyManager, AppConfig, Listmap, Messages) { var APP = window.APP = { editable: false, mobile: function () { if (window.matchMedia) { return !window.matchMedia('(any-pointer:fine)').matches; } else { return $('body').width() <= 600; } }, isMac: navigator.platform === "MacIntel", }; 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 faRename = 'fa-pencil'; var faColor = 'cptools-palette'; var faTrash = 'fa-trash'; var faDelete = 'fa-eraser'; var faProperties = 'fa-database'; var faTags = 'fa-hashtag'; 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 $emptyTrashIcon = $('