Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix splitter sizing, node insertion on descending sorting mode, remov…
Browse files Browse the repository at this point in the history
…e unused variables

Last booter compiler
  • Loading branch information
cdujeu committed Oct 2, 2015
1 parent 1c11b19 commit b0ab2f1
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 44 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer_boot.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/core/http/PydioApi.js
Expand Up @@ -126,7 +126,7 @@ var PydioApi = (function () {
if (window.pydio && pydio.Parameters.get('SERVER_PREFIX_URI')) {
PydioApi._libUrl = pydio.Parameters.get('SERVER_PREFIX_URI');
}
var path = PydioApi._libUrl ? PydioApi._libUrl + '/' + fileName : fileName;
//var path = (PydioApi._libUrl?PydioApi._libUrl+'/'+fileName:fileName);

/*if(window.jQuery && window.jQuery.ajax){
jQuery.ajax(path,
Expand Down
Expand Up @@ -45,8 +45,6 @@ var ResourcesManager = (function () {
*/

ResourcesManager.prototype.addJSResource = function addJSResource(fileName, className) {
var autoload = arguments[2] === undefined ? false : arguments[2];

if (!this.resources.js) {
this.resources.js = [];
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/es6/http/PydioApi.es6
Expand Up @@ -110,7 +110,7 @@ class PydioApi{
if(window.pydio && pydio.Parameters.get('SERVER_PREFIX_URI')){
PydioApi._libUrl = pydio.Parameters.get('SERVER_PREFIX_URI');
}
var path = (PydioApi._libUrl?PydioApi._libUrl+'/'+fileName:fileName);
//var path = (PydioApi._libUrl?PydioApi._libUrl+'/'+fileName:fileName);

/*if(window.jQuery && window.jQuery.ajax){
jQuery.ajax(path,
Expand Down
Expand Up @@ -35,7 +35,7 @@ class ResourcesManager{
* @param fileName String
* @param className String
*/
addJSResource(fileName, className, autoload=false){
addJSResource(fileName, className){
if(!this.resources.js){
this.resources.js = [];
}
Expand Down
Expand Up @@ -281,9 +281,6 @@ Class.create("AbstractEditor" , {
* @param title String
*/
updateTitle : function(title){
if(title != ""){
//title = " - " + title;
}
if(this.filenameSpan) {
this.filenameSpan.update(title);
}
Expand Down
Expand Up @@ -175,11 +175,11 @@ Class.create("AjxpPane", {
"use strict";
if(!$(this.options.bindSizeTo.width.id) || !this.htmlElement) return;
var min = this.options.bindSizeTo.width.min;
if(Object.isString(min) && min.indexOf("%") != false) min = this.htmlElement.parentNode.getWidth() * min / 100;
if(Object.isString(min) && min.indexOf("%") !== false) min = this.htmlElement.parentNode.getWidth() * min / 100;
var w = Math.max($(this.options.bindSizeTo.width.id).getWidth() + this.options.bindSizeTo.width.offset, min);
if(this.options.bindSizeTo.width.max) {
var max = this.options.bindSizeTo.width.max;
if(Object.isString(max) && max.indexOf("%") != false) max = this.htmlElement.parentNode.getWidth() * max / 100;
if(Object.isString(max) && max.indexOf("%") !== false) max = this.htmlElement.parentNode.getWidth() * max / 100;
w = Math.min(max, w);
}
if(this.options.bindSizeTo.width.checkSiblings){
Expand Down
Expand Up @@ -106,7 +106,6 @@ Class.create("AjxpUsersCompleter", Ajax.Autocompleter, {
afterUpdateElement: function(element, selectedLi){
if(listElement){

var id = Math.random();
var label = selectedLi.getAttribute("data-label");
var entryId = selectedLi.getAttribute("data-entry_id");
if(selectedLi.getAttribute("data-temporary") && pref && ! label.startsWith(pref)){
Expand Down
13 changes: 8 additions & 5 deletions core/src/plugins/gui.ajax/res/js/ui/prototype/class.FilesList.js
Expand Up @@ -1373,13 +1373,17 @@ Class.create("FilesList", SelectableElements, {
sortCache.sort(sortFunction);
for(var i=0;i<sortCache.length;i++){
if(sortCache[i].element == newItem){
if(i == 0) $(newItem.parentNode).insert({top:newItem});
else {
if(sortCache[i-1].element.ajxpNode.getPath() == newItem.ajxpNode.getPath()){
if(i == 0) {
$(newItem.parentNode).insert({top: newItem});
}else if (i == sortCache.length -1){
$(newItem.parentNode).insert({bottom: newItem});
} else {
var otherIndex = (descending ? i+1 : i-1);
if(sortCache[otherIndex].element.ajxpNode.getPath() == newItem.ajxpNode.getPath()){
$(newItem.parentNode).remove(newItem);
break;
}
sortCache[i-1].element.insert({after:newItem});
sortCache[otherIndex].element.insert({after:newItem});
}
break;
}
Expand Down Expand Up @@ -1589,7 +1593,6 @@ Class.create("FilesList", SelectableElements, {
};
}
var pos = posSpan.cumulativeOffset();
var text = span.innerHTML;
if(!item.ajxpNode){
item.ajxpNode = $(item.id).ajxpNode;
}
Expand Down
Expand Up @@ -313,7 +313,6 @@ Class.create("FoldersTree", AjxpPane, {
scrollTop = this.treeContainer.scrollTop;

var pos = item.cumulativeOffset();
var text = span.innerHTML;
var edit = new Element('input', {value:item.ajxpNode.getLabel('text'), id:'editbox'}).setStyle({
zIndex:5000,
position:'absolute',
Expand Down
Expand Up @@ -535,13 +535,14 @@ Class.create("HeaderResizer", {
* @param message String
*/
log : function(message){
return;
/*
if(window.console){
console.log(message);
}else if($('info_panel')){
$('info_panel').insert('<div>'+message+'</div>');
$('info_panel').scrollTop = $('info_panel').scrollHeight;
}
*/
}

});
Expand Up @@ -57,7 +57,7 @@ Class.create("LocationBar", {
this.initCurrentPath();
this.element.insert(locDiv);
locDiv.insert(this.currentPath);
var inputDims = this.currentPath.getDimensions();
this.currentPath.getDimensions();
this.currentPath.hide();
this.label = new Element('div', {className:'location_bar_label'}).update("/test");
this.label.setStyle({
Expand Down
4 changes: 0 additions & 4 deletions core/src/plugins/gui.ajax/res/js/vendor/leightbox/lightbox.js
Expand Up @@ -163,10 +163,6 @@ function displayLightBoxById(id, overlayStyle, overlayClass)
if(overlayClass) valid.overlayClass = overlayClass;
valid.activate();
currentLightBox = valid;
if(id != 'copymove_div')
{

}
}

function hideLightBox(onFormSubmit)
Expand Down
19 changes: 8 additions & 11 deletions core/src/plugins/gui.ajax/res/js/vendor/prototype/splitter.js
Expand Up @@ -115,12 +115,10 @@ Class.create("Splitter", AjxpPane, {
if(!this.initBorderB) this.initBorderB = 0;

this.splitbar = new Element('div', {unselectable:'on'});
var zIndex = (this.options.invisibleBar?parseInt(this.group.getStyle('zIndex'))+1:'inherit') || '10000';
this.splitbar.addClassName(this.options.splitbarClass).setStyle({
position:'absolute',
cursor:this.options.cursor,
fontSize:'1px'/*,
zIndex:zIndex*/
fontSize:'1px'
});
this.paneA.insert({after:this.splitbar});

Expand All @@ -131,16 +129,17 @@ Class.create("Splitter", AjxpPane, {

this.initCaches();

this.paneA._init = (this.options.initA==true?parseInt(this.options.getAdjust(this.paneA)):this.options.initA) || 0;
this.paneB._init = (this.options.initB==true?parseInt(this.options.getAdjust(this.paneB)):this.options.initB) || 0;
this.paneA._init = (this.options.initA===true?parseInt(this.options.getAdjust(this.paneA)):this.options.initA) || 0;
this.paneB._init = (this.options.initB===true?parseInt(this.options.getAdjust(this.paneB)):this.options.initB) || 0;
var startB;
if(this.paneB._init){
this.paneB.setStyle(this.makeStyleObject(this.options.adjust, this.paneB._init));
startB = this.group[this.options.offsetAdjust] - this.group._borderAdjust-this.splitbar._adjust - this.paneB._init;
}
if(this.paneA._init){
this.paneA.setStyle(this.makeStyleObject(this.options.adjust, this.paneA._init));
}
//Event.observe(window,"resize", function(e){this.resizeGroup(e, null, true);}.bind(this));
this.resizeGroup(null, this.paneB._init || this.paneA._init || Math.round((this.group[this.options.offsetAdjust]-this.group._borderAdjust-this.splitbar._adjust)/2));
this.resizeGroup(null, startB || this.paneA._init || Math.round((this.group[this.options.offsetAdjust]-this.group._borderAdjust-this.splitbar._adjust)/2));

this.userLoggedObs = function(){
var sizePref = this.getUserPreference("size");
Expand Down Expand Up @@ -246,7 +245,7 @@ Class.create("Splitter", AjxpPane, {
subMenu:false,
subMenuUpdateImage:false,
callback: function(){
var state = oThis.toggleFolding(foldingValue == "B" ? oThis.paneB : oThis.paneA);
oThis.toggleFolding(foldingValue == "B" ? oThis.paneB : oThis.paneA);
},
listeners : {
init:function(){
Expand Down Expand Up @@ -279,7 +278,7 @@ Class.create("Splitter", AjxpPane, {
subMenu:false,
subMenuUpdateImage:false,
callback: function(){
var state = oThis.toggleFolding(foldingValue == "B" ? oThis.paneB : oThis.paneA);
oThis.toggleFolding(foldingValue == "B" ? oThis.paneB : oThis.paneA);
oThis.getFoldingAction().enable();
},
listeners : {
Expand Down Expand Up @@ -585,8 +584,6 @@ Class.create("Splitter", AjxpPane, {
np = Math.max(minPaneA+this.paneA._padAdjust, this.group._adjust - (this.paneB._max||9999), minSize,
Math.min(np, this.paneA._max||9999, this.group._adjust - this.splitbar._adjust -
Math.max(minPaneB + this.paneB._padAdjust, minSize)));
var optNameSet = this.options.set;
var optNameAdjust = this.options.adjust;
if(!np) np = this.paneA._init;
this.splitbar.setStyle(this.makeStyleObject(this.options.set, (np + this.splitbar._reAdjust) +'px'));
var borderAdjA = 0;
Expand Down
Expand Up @@ -440,7 +440,6 @@ Autocompleter.Local = Class.create(Autocompleter.Base, {
var ret = []; // Beginning matches
var partial = []; // Inside matches
var entry = instance.getToken();
var count = 0;

for (var i = 0; i < instance.options.array.length &&
ret.length < instance.options.choices ; i++) {
Expand Down Expand Up @@ -874,9 +873,9 @@ Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(opt
options[name] = expr;
};
fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' :
options.cancelLink == options.cancelButton == false ? false : undefined)));
options.cancelLink == options.cancelButton === false ? false : undefined)));
fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' :
options.okLink == options.okButton == false ? false : undefined)));
options.okLink == options.okButton === false ? false : undefined)));
fallback('highlightColor', options.highlightcolor);
fallback('highlightEndColor', options.highlightendcolor);
};
Expand Down
6 changes: 1 addition & 5 deletions core/src/plugins/gui.ajax/res/js/vendor/webfx/xtree.js
Expand Up @@ -109,7 +109,7 @@ var webFXTreeHandler = {
blur : function (oItem) { if(this.all[oItem.id.replace('-anchor','')]) this.all[oItem.id.replace('-anchor','')].blur();},
setFocus : function (bFocus){ this.hasFocus = bFocus;},
keydown : function (oItem, e) { return this.all[oItem.id].keydown(e.keyCode); },
linkKeyPress : function(oItem, e){if(!this.hasFocus || e.keyCode == 9) return false;return true;},
linkKeyPress : function(oItem, e){return !(!this.hasFocus || e.keyCode == 9)},
cookies : new WebFXCookie(),
insertHTMLBeforeEnd : function (oElement, sHTML) {
if(!oElement) return;
Expand Down Expand Up @@ -182,7 +182,6 @@ function WebFXTreeBufferTreeChange(){

WebFXTreeAbstractNode.prototype.add = function (node, bNoIdent) {
node.parentNode = this;
var url = node.parentNode.url;
if(node.parentNode.inZip) node.inZip = true;
else{
if(webFXTreeConfig.zipRegexp.test(node.text) !== false){
Expand Down Expand Up @@ -604,13 +603,10 @@ WebFXTreeItem.prototype.updateIcon = function(icon, openIcon){

WebFXTreeItem.prototype.remove = function() {
if(!$(this.id+'-plus')) return;
var iconSrc = $(this.id + '-plus').src;
var parentNode = this.parentNode;
var prevSibling = this.getPreviousSibling(true);
var nextSibling = this.getNextSibling(true);
var folder = this.parentNode.folder;
var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true;
//this.getPreviousSibling().focus();
this._remove();
Droppables.remove($(this.id));
if(webFXTreeHandler.contextMenu) webFXTreeHandler.contextMenu.removeElements('#'+this.id);
Expand Down

0 comments on commit b0ab2f1

Please sign in to comment.