-
+
+
/* foreach($pwd as $dir ){
$path .= '/'.$dir;
echo ''.$dir.'';
} ?> */ ?>
-
+
-
-
+
-
-
+
/*if(count($pwd) > 1){
echo '
-
@@ -66,10 +66,10 @@
-+ -+- + -- -+Please Read the reading text at the reading write!-writing the reading text at the reading write writing the reading text at the reading write!-+ +-Please Read the reading text at the reading write!+writing the reading text at the reading write writing the reading text at the reading write!+- -+Please Read the reading text at the reading write!-writing the reading text at the reading write writing the reading text at the reading write!-+ +-Please Read the reading text at the reading write!+writing the reading text at the reading write writing the reading text at the reading write!+
-
-
- type -
- size -
- date -
- name -
-
+
- type +
- size +
- date +
- name +
-
-
- type -
- size -
- date -
- name -
-
+
- type +
- size +
- date +
- name +
+- - - - - - + + + + - @@ -307,9 +307,14 @@ $(['A', 'B']).each(function(k, letter) { var url = '/upload/'; $('#file_upload_' + letter).fileupload({ + singleFileUploads: false, add: function (e, data) { + FM.setTabActive(FM['TAB_'+letter]); + var tab = FM.getTabLetter(FM.CURRENT_TAB); var file_relocation = FM['TAB_'+tab+'_CURRENT_PATH']; + + $('#file_upload_' + letter).fileupload("option", "url", url + '?dir=' + file_relocation); acc = $('Initializing+'); @@ -320,18 +325,39 @@ url: url, dataType: 'json', done: function (e, data) { - /*$.each(data.result.files, function (index, file) { - $(acc).append($('').text(file.name + ' uploaded.')); - });*/ + var msg = ''; + $.each(data.result.files, function (index, file) { + if ('undefined' != typeof file.error) { + msg += '' + file.name + ': ' + file.error + '
'; + } + }); + + if (msg != '') { + var tpl = Tpl.get('popup_alert', 'FM'); + tpl.set(':TEXT', msg); + FM.popupOpen(tpl.finalize()); + } + //console.log(e); + //console.log(data); }, fail: function(e, data) { + var msg = ''; $.each(data.result.files, function (index, file) { - $(acc).append($('').text(file.name + ' failed to upload.')); + if ('undefined' != typeof file.error) { + msg += '' + file.name + ': ' + file.error + '
'; + } }); - show_msg = true; + + if (msg != '') { + var tpl = Tpl.get('popup_alert', 'FM'); + tpl.set(':TEXT', msg); + FM.popupOpen(tpl.finalize()); + } + //console.log(e); + //console.log(data); }, always: function(e, data) { - if (show_msg) { + /*if (show_msg) { clearTimeout(window.ht_fd); var info = $('.warning-box.inform').clone(true); $(info).attr('id', 'file-upload-msg'); @@ -346,7 +372,7 @@ window.ht_fd = setTimeout(function() { $('#file-upload-msg').fadeOut(); }, 3000); - } + }*/ var tab = FM.getTabLetter(FM.CURRENT_TAB); var box = FM['TAB_' + tab]; @@ -371,7 +397,99 @@ .prop('disabled', !$.support.fileInput) .parent().addClass($.support.fileInput ? undefined : 'disabled'); }); + + $.widget("shift.selectable", $.ui.selectable, { + options: {}, // required + previousIndex: -1, // additional attribute to store previous selection index + currentIndex: -1, // additional attribute to store current selection index + _create: function() { // required + var self = this; + + $.ui.selectable.prototype._create.call(this); // default implementation + + // here is our addition, we are catching "selecting" event with shift key + $(this.element).on('selectableselecting', function(event, ui){ + self.currentIndex = $(ui.selecting.tagName, event.target).index(ui.selecting); + if(event.shiftKey && self.previousIndex > -1) { + $(ui.selecting.tagName, event.target).slice(Math.min(self.previousIndex, self.currentIndex), 1 + Math.max(self.previousIndex, self.currentIndex)).addClass('ui-selected'); + self.previousIndex = -1; + } else { + self.previousIndex = self.currentIndex; + } + }); + }, + destroy: function() { // required, default implementation + $.ui.selectable.prototype.destroy.call(this); + }, + _setOption: function() { // required, default implementation + $.ui.selectable.prototype._setOption.apply(this, arguments); + } + }); + + + var checkIfArchive = function(item) {console.log(item); + var item = $(item).hasClass('dir') ? item : $(item).parents('.dir'); + var tab = FM.getTabLetter(FM.CURRENT_TAB); + var src = $(item).find('.source').val(); + src = $.parseJSON(src); + var tab = FM.getTabLetter(FM.CURRENT_TAB); + if (FM.itemIsArchieve(src)) { + $('.menu-'+tab+' .extract-btn').show(); + } + else { + $('.menu-'+tab+' .extract-btn').hide(); + } + } + + + $(".listing-left").selectable({ + selected: function (event, ui) { + FM.setTabActive(FM.TAB_A, 'skip_highlights'); + $(".listing-left .selected").each(function(i, o) { + if (!$(o).hasClass('ui-selected')) { + $(o).removeClass('selected'); + } + }); + $(ui.selected).addClass('selected'); + checkIfArchive(ui.selected); + $(".listing-left .ui-selected").addClass('selected'); + }, + unselected: function (event, ui) { + $(".listing-left .selected").each(function(i, o) { + if (!$(o).hasClass('ui-selected')) { + $(o).removeClass('selected'); + } + }); + FM.setTabActive(FM.TAB_A, 'skip_highlights'); + $(ui.unselected).removeClass('selected'); + } + }); + $(".listing-right").selectable({ + selected: function (event, ui) { + $(".listing-left .selected").each(function(i, o) { + if (!$(o).hasClass('ui-selected')) { + $(o).removeClass('selected'); + } + }); + FM.setTabActive(FM.TAB_B, 'skip_highlights'); + $(ui.selected).addClass('selected'); + checkIfArchive(ui.selected); + $(".listing-left .ui-selected").addClass('selected'); + }, + unselected: function (event, ui) { + $(".listing-left .selected").each(function(i, o) { + if (!$(o).hasClass('ui-selected')) { + $(o).removeClass('selected'); + } + }); + FM.setTabActive(FM.TAB_B, 'skip_highlights'); + $(ui.unselected).removeClass('selected'); + } + }); + + });