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 () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles 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; // Icons var faFolder = 'fa-folder'; var faFolderOpen = 'fa-folder-open'; var faSharedFolder = 'fa-hdd-o'; var faReadOnly = 'fa-eye'; var faRename = 'fa-pencil'; 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 $folderIcon = $('', { "class": faFolder + " fa 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 + " fa cp-app-drive-icon-folder"}); //var $folderOpenedIcon = $('', {src: "/customize/images/icons/folderOpen.svg", "class": "folder icon"}); var $folderOpenedEmptyIcon = $folderOpenedIcon.clone(); var $sharedFolderIcon = $('', {"class": faSharedFolder + " fa cp-app-drive-icon-folder"}); //var $sharedFolderOpenedIcon = $sharedFolderIcon.clone(); //var $upIcon = $('', {"class": "fa fa-arrow-circle-up"}); var $unsortedIcon = $('', {"class": "fa fa-files-o"}); var $templateIcon = $('', {"class": "fa fa-cubes"}); 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 = $('