// requires DropZone ª toMarkdown if (typeof window.jQuery === 'undefined') { throw new Error('yavsc-remote-fs script requires jQuery'); } if (typeof XMLHttpRequest === 'undefined') { throw new Error('yavsc-remote-fs script requires XMLHttpRequest'); } (function ($) { 'use strict'; $.widget('psc.yarfs', { options: { fsnurl: '/api/fs' }, root: null, rmDialog: null, mvDialog: null, flist: null, selection: [], dirBar: null, destination: null, rootDisplay: null, setRoot: function(sub) { this.root = sub; if (!this.root) this.rootDisplay.addClass('hidden'); else { this.rootDisplay.removeClass('hidden'); this.rootDisplay.html('from ' + this.root + ''); } }, openDir: function (sub) { var _this = this; this.setRoot(sub); var owner = this.element.data('owner'); this.selection = []; this.dirBar.empty(); $('') .click(function () { _this.openDir(null); }) .appendTo(this.dirBar); var npath = null if (_this.root) { var dnames = _this.root.split('/'); $.each(dnames, function () { var part = this; if (npath == null) npath = part; else npath = npath + '/' + part; $(''); mdCnt.append(mdHeader); var mdBody = $(''); mdBody.append('

You´re about to remove these files :

'); this.flist = $(''); mdBody.append(this.flist); mdCnt.append(mdBody); var rmcBtn = $('').click(function () { _this.RemoveSelectedFiles(); }); var mdFooter = $(''); mdFooter.append(rmcBtn); mdFooter.append(''); mdCnt.append(mdFooter); md.append(mdCnt); this.rmDialog.appendTo(this.element); }, onDestinationChanged: function (newDest) { this.destination = $(newDest).val(); }, createMvDialog: function () { var _this = this; this.mvDialog = $(''); this.mvDialog.addClass('modal'); this.mvDialog.addClass('fade'); var md = $('
'); md.addClass('modal-dialog'); var mdCnt = $(''); mdCnt.addClass('modal-content'); var mdHeader = $(''); mdHeader.append(''); mdHeader.append(''); mdCnt.append(mdHeader); var mdBody = $(''); mdBody.append('

You´re about to move these files :

'); this.flist = $(''); mdBody.append(this.flist); var inputDest = $('').on('change', function() { _this.onDestinationChanged(this); }); this.rootDisplay = $('

'); this.rootDisplay.addClass('hidden'); mdBody.append(this.rootDisplay); var rp = $('

to the folowing sub-directory

'); mdBody.append(rp); inputDest.appendTo(mdBody); mdCnt.append(mdBody); var moveBtn = $('').click(function () { _this.moveSelectedFiles(); }); var mdFooter = $(''); mdFooter.append(moveBtn); mdFooter.append(''); mdCnt.append(mdFooter); md.append(mdCnt); this.mvDialog.append(md); this.mvDialog.appendTo(this.element); }, _create: function () { var $view = this.element; var _this = this; this.dirBar = $('
'); this.dirBar.appendTo($view); this.ftable = $('') .css('border-spacing', '6px') .css('border-collapse', 'separate'); var btnRm = $('').click(function () { _this.askForRemoval(); }); var btnMv = $('').click(function () { _this.askForMoving(); }); var tr = $(''); _this.ftable.append(tr); tr.append($('').append(btnRm).append(btnMv)).append(''); _this.ftable.appendTo($view); $('
Logs
').appendTo($view); this.createRmDialog(); this.createMvDialog(); this.openDir($view.data('path')); } }); })(window.jQuery);
NomTailleModification