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

Commit

Permalink
Chasing JS implicit variable declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 11, 2014
1 parent 1031d8b commit 666c6ad
Show file tree
Hide file tree
Showing 38 changed files with 105 additions and 96 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/access.ajxp_conf/class.ConfigEditor.js
Expand Up @@ -295,7 +295,7 @@ Class.create("ConfigEditor",{
driverDef.set('description', XPathGetSingleNodeText(driver, "@description"));
driverDef.set('name', driverName);
var driverParamsArray = new Array();
for(j=0;j<driverParams.length;j++){
for(var j=0;j<driverParams.length;j++){
var paramNode = driverParams[j];
if(this.currentCreateRepoType == "template" && paramNode.getAttribute('no_templates') == 'true'){
continue;
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/access.jsapi/class.JsSourceViewer.js
Expand Up @@ -137,6 +137,7 @@ Class.create("JsSourceViewer", AjxpPane, {

applyPointer : function(){
if(!this.pendingPointer) return;
var cursor;
if(this.pendingPointerType == "MemberName"){
cursor = this.codeMirror.getSearchCursor(this.pendingPointer+':', false, false);
if(cursor.findNext()){
Expand Down
8 changes: 4 additions & 4 deletions core/src/plugins/access.jsapi/class.LocalAPINodeProvider.js
Expand Up @@ -282,7 +282,7 @@ Class.create("LocalAPINodeProvider", {
}
if(docs[memberKey].keywords["var"]){
var vDoc = docs[memberKey].keywords["var"];
vType = vDoc.split(" ")[0];
var vType = vDoc.split(" ")[0];
vDesc = vDoc.substring(vType.length + 1);
crtLabel = '<span class="jsapi_jdoc_var">'+vType+'</span> ' + crtLabel.replace("<span", '<span title="'+vDesc.replace(/"/g, '\'')+'"');
}
Expand All @@ -291,9 +291,9 @@ Class.create("LocalAPINodeProvider", {
var newArgs = $A();
$A(meta.get("argumentNames")).each(function(arg){
if(docs[memberKey].keywords["param"][arg]){
pValue = docs[memberKey].keywords["param"][arg];
pType = (pValue.split(" ").length?pValue.split(" ")[0].strip():'');
pDesc = pValue.substring(pType.length+1).replace(/"/g, '\'');
var pValue = docs[memberKey].keywords["param"][arg];
var pType = (pValue.split(" ").length?pValue.split(" ")[0].strip():'');
var pDesc = pValue.substring(pType.length+1).replace(/"/g, '\'');
arg = '<span class="jsapi_jdoc_param">'+pType+'</span> <span title="'+pDesc+'">'+arg+'</span>';
}
newArgs.push(arg);
Expand Down
Expand Up @@ -196,7 +196,7 @@ Class.create("SQLEditor", {
});
//addTable.select('td[edit="false"]').invoke('remove');
addTable.select('td[new="false"]')[0].setStyle({width:'40px'});
addRow = addTable.select('tbody tr')[0];
var addRow = addTable.select('tbody tr')[0];
var addButton = new Element('input', {type:'button', value:'Add', className:'dialogButton'});
var submitDiv = new Element('div', {className:'dialogButtons'}).insert(addButton);
var submitRow = new Element('tr').insert(new Element('td', {colspan:"9"}).insert(submitDiv));
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/action.share/qrcode.js
Expand Up @@ -162,7 +162,7 @@ var QRCode;

if (/android/i.test(sAgent)) { // android
android = true;
aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);

if (aMat && aMat[1]) {
android = parseFloat(aMat[1]);
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/authfront.cas/class.CAS_LoginForm.js
Expand Up @@ -50,12 +50,12 @@ Class.create("CAS_LoginForm", {

var login_session_span = '<span class="icon-chevron-right"></span><span style=" font-size: 16px;">' + auth_pyd_msg + '</span>';

objallforms = $("all_forms");
var objallforms = $("all_forms");
if(!objallforms.down("#enableredirecttocas")){
objallforms.insert({top:login_via_cas_form});
}
$$("div.dialogContent").first().setStyle("padding-top: 17% !important");
obj_loginform = $("login_form");
var obj_loginform = $("login_form");
if(!obj_loginform.down(("#span_to_modify_login_form_with_cas"))){
obj_loginform.insert({top:login_session_span});
obj_loginform.insert({top:cas_session_a_tag});
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/authfront.otp/class.OTP_LoginForm.js
Expand Up @@ -26,7 +26,7 @@ Class.create("OTP_LoginForm", {
// string
var otpEnabled = '<span id="add_otp_notion" style=" font-size: 16px;"> * OTP enabled</span>';

obj_loginform = $("login_form");
var obj_loginform = $("login_form");
if(!obj_loginform.down(("#add_otp_notion"))){
obj_loginform.insert({bottom:otpEnabled});
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.browser/class.BrowserOpener.js
Expand Up @@ -66,7 +66,7 @@ Class.create("BrowserOpener", AbstractEditor, {
connexion.onComplete = function(transp){
var url = transp.responseText;
if(this.editorOptions.context.__className == 'Modal'){
myRef = window.open(url, "Pydio Bookmark", "location=yes,menubar=yes,resizable=yes,scrollbars=yea,toolbar=yes,status=yes");
window.open(url, "Pydio Bookmark", "location=yes,menubar=yes,resizable=yes,scrollbars=yea,toolbar=yes,status=yes");
hideLightBox();
}else{
this.element.fire("editor:updateTitle", url);
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.codepress/class.CodePressEditor.js
Expand Up @@ -84,7 +84,7 @@ Class.create("CodePressEditor", TextEditor, {
}.bind(this);

this.textarea.id = 'cpCode_cp';
code = new CodePress(this.textarea, contentObserver);
var code = new CodePress(this.textarea, contentObserver);
this.cpCodeObject = code;
this.textarea.parentNode.insertBefore(code, this.textarea);
this.contentMainContainer = this.textarea.parentNode;
Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/editor.diaporama/class.Diaporama.js
Expand Up @@ -376,7 +376,7 @@ Class.create("Diaporama", AbstractEditor, {

if (ort>4)
{
tmp=height;
var tmp=height;
height=width;
width=tmp;
}
Expand Down Expand Up @@ -637,8 +637,8 @@ Class.create("Diaporama", AbstractEditor, {
},

computeFitToScreenFactor: function(){
zoomFactor1 = parseInt(this.imgContainer.getHeight() / this.crtHeight * 100);
zoomFactor2 = parseInt(this.imgContainer.getWidth() / this.crtWidth * 100);
var zoomFactor1 = parseInt(this.imgContainer.getHeight() / this.crtHeight * 100);
var zoomFactor2 = parseInt(this.imgContainer.getWidth() / this.crtWidth * 100);
var zoomFactor = Math.min(zoomFactor1, zoomFactor2)-1;
zoomFactor = Math.max(this._minZoom, zoomFactor);
zoomFactor = Math.min(this._maxZoom, zoomFactor);
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/editor.eml/class.EmlViewer.js
Expand Up @@ -68,7 +68,7 @@ Class.create("EmlViewer", AbstractEditor, {
this.parseXmlStructure(transp);
this.updateTitle(getBaseName(fileName));
}.bind(this);
connexion2 = new Connexion();
var connexion2 = new Connexion();
connexion2.addParameter('get_action', 'eml_get_bodies');
connexion2.addParameter('file', fileName);
connexion2.onComplete = function(transp){
Expand Down Expand Up @@ -122,7 +122,7 @@ Class.create("EmlViewer", AbstractEditor, {
if(user.canWrite()) this.treeSelector.appendFilterValue(activeRepository, "&lt;"+MessageHash[372]+"&gt;", 'top');
this.treeSelector.setFilterSelectedIndex(0);
this.treeSelector.setFilterChangeCallback(function(e){
externalRepo = this.filterSelector.getValue();
var externalRepo = this.filterSelector.getValue();
var nodeProvider = new RemoteNodeProvider();
nodeProvider.initProvider({tmp_repository_id:externalRepo});
this.resetAjxpRootNode(new AjxpNode("/", false, MessageHash[373], "folder.png", nodeProvider));
Expand Down
1 change: 0 additions & 1 deletion core/src/plugins/editor.eml/emlViewer.css
Expand Up @@ -92,5 +92,4 @@ div#treeSelectorCpContainer{
background-color: white;
top: 156px;
box-shadow: 1px 1px 4px #BBB;
}
}
2 changes: 1 addition & 1 deletion core/src/plugins/editor.imagick/class.IMagickPreviewer.js
Expand Up @@ -99,7 +99,7 @@ Class.create("IMagickPreviewer", Diaporama, {
src:IMagickPreviewer.prototype.getThumbnailSource(ajxpNode)
});
img.resizePreviewElement = function(dimensionObject){
ratio = img.ratio;
var ratio = img.ratio;
if(!ratio) {
var fakeIm = new Image();
fakeIm.onload = function(){
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/ajxp_utils.js
Expand Up @@ -23,14 +23,12 @@ function getBaseName(fileName)
if(fileName == null) return null;
var separator = "/";
if(fileName.indexOf("\\") != -1) separator = "\\";
baseName = fileName.substr(fileName.lastIndexOf(separator)+1, fileName.length);
return baseName;
return fileName.substr(fileName.lastIndexOf(separator)+1, fileName.length);
}

function getRepName(fileName)
{
repName = fileName.substr(0, fileName.lastIndexOf("/"));
return repName;
return fileName.substr(0, fileName.lastIndexOf("/"));
}

function getAjxpMimeType(item){
Expand Down Expand Up @@ -275,6 +273,7 @@ function fitRectangleToDimension(rectDim, targetDim){
var defaultMarginTop = (targetDim.marginTop?targetDim.marginTop:(targetDim.margin?targetDim.margin:0));
var defaultMarginBottom = (targetDim.marginBottom?targetDim.marginBottom:(targetDim.margin?targetDim.margin:0));
//var defaultMargin = targetDim.margin || 0;
var tW, tH, mT, mB;
if(rectDim.width >= rectDim.height)
{
tW = targetDim.width;
Expand All @@ -297,7 +296,7 @@ function fitRectangleToDimension(rectDim, targetDim){
mT = defaultMarginTop;
mB = defaultMarginBottom;
}
return styleObj = {width:tW+'px', height:tH+'px', marginTop:mT+'px', marginBottom:mB+'px'};
return {width:tW+'px', height:tH+'px', marginTop:mT+'px', marginBottom:mB+'px'};
}

function fitHeightToBottom(element, parentElement, addMarginBottom, listen, minOffsetTop)
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.Action.js
Expand Up @@ -716,7 +716,7 @@ Class.create("Action", {
// case differ
accessKey = displayString.charAt(keyPos);
}
returnString = displayString.substring(0,displayString.indexOf(accessKey));
var returnString = displayString.substring(0,displayString.indexOf(accessKey));
returnString += '<u>'+accessKey+'</u>';
returnString += displayString.substring(displayString.indexOf(accessKey)+1, displayString.length);
return returnString;
Expand All @@ -739,7 +739,7 @@ Class.create("Action", {
attributesToObject: function(object, node){
Object.keys(object).each(function(key){
if(node.getAttribute(key)){
value = node.getAttribute(key);
var value = node.getAttribute(key);
if(value == 'true') value = true;
else if(value == 'false') value = false;
if(key == 'allowedMimes'){
Expand Down
Expand Up @@ -345,6 +345,7 @@ Class.create("ActionsManager", {
(copy && (!this.defaultActions.get('ctrldragndrop')||this.getDefaultAction('ctrldragndrop').deny))){
return;
}
var fileNames;
if(fileName == null) fileNames = this._dataModel.getFileNames();
else fileNames = [fileName];
if(destNodeName != null)
Expand Down Expand Up @@ -592,7 +593,7 @@ Class.create("ActionsManager", {
{
if(childs[i].getAttribute("secure_token")){
var regex = new RegExp('.*?[&\\?]' + 'minisite_session' + '=(.*?)&.*');
val = window.ajxpServerAccessPath.replace(regex, "$1");
var val = window.ajxpServerAccessPath.replace(regex, "$1");
var minisite_session = ( val == window.ajxpServerAccessPath ? false : val );

Connexion.SECURE_TOKEN = childs[i].getAttribute("secure_token");
Expand Down
Expand Up @@ -461,7 +461,7 @@ Class.create("ActionsToolbar", AjxpPane, {
if(!submenuItem.src || !action.options.subMenuUpdateImage) return;
var images = button.select('img[id="'+action.options.name +'_button_icon"]');
if(!images.length) return;
icSize = 22;
var icSize = 22;
if(this.options.stylesImgSizes && this.style && this.options.stylesImgSizes[this.style]){
icSize = this.options.stylesImgSizes[this.style];
}
Expand Down
14 changes: 7 additions & 7 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.Ajaxplorer.js
Expand Up @@ -637,9 +637,9 @@ Class.create("Ajaxplorer", {
document.observeOnce("ajaxplorer:registry_part_loaded", function(event){
if(event.memo != "user/repositories") return;
this.logXmlUser(this._registry, true);
repId = this.user.getActiveRepository();
repList = this.user.getRepositoriesList();
document.fire("ajaxplorer:repository_list_refreshed", {list:repList,active:repId});
document.fire("ajaxplorer:repository_list_refreshed", {
list:this.user.getRepositoriesList(),
active:this.user.getActiveRepository()});
}.bind(this));
this.loadXmlRegistry(false, "user/repositories");
},
Expand Down Expand Up @@ -1080,9 +1080,9 @@ Class.create("Ajaxplorer", {
connexion.onComplete = function(transport){
if(transport.responseText){
var result = transport.responseText.evalScripts();
MessageHash = result[0];
for(var key in MessageHash){
MessageHash[key] = MessageHash[key].replace("\\n", "\n");
window.MessageHash = result[0];
for(var key in window.MessageHash){
window.MessageHash[key] = window.MessageHash[key].replace("\\n", "\n");
}
this.updateI18nTags();
if(this.guiActions){
Expand Down Expand Up @@ -1357,7 +1357,7 @@ Class.create("Ajaxplorer", {
});
var shiftKey = e['shiftKey'];
var foundFocus = false;
for(i=0; i<objects.length;i++)
for(var i=0; i<objects.length;i++)
{
if(objects[i].hasFocus)
{
Expand Down
Expand Up @@ -109,7 +109,7 @@ Class.create("AjxpAutocompleter", Autocompleter.Base, {
}
var responseText = '<ul>';
dirs.each(function(dir){
value = token.substring(0, token.lastIndexOf("/")+1);
var value = token.substring(0, token.lastIndexOf("/")+1);
responseText += '<li>'+value+dir+'</li>';
});
responseText += '</ul>';
Expand Down
Expand Up @@ -541,7 +541,7 @@ Class.create("AjxpDataModel", {
return false;
}
var names = $A([]);
for(i=0;i<allItems.length;i++)
for(var i=0;i<allItems.length;i++)
{
names.push(getBaseName(allItems[i].getPath()));
}
Expand Down
19 changes: 10 additions & 9 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.AjxpDraggable.js
Expand Up @@ -22,7 +22,7 @@
// TO ADD GLOBALLY
var timerClearObserver = {
onEnd:function(){
if(WebFXtimer) clearTimeout(WebFXtimer);
if(window.WebFXtimer) clearTimeout(window.WebFXtimer);
}
} ;
document.observe("ajaxplorer:loaded", function(){
Expand All @@ -33,14 +33,14 @@ document.observe("ajaxplorer:loaded", function(){
}
}});
});
var AllAjxpDraggables = $A([]);
window.AllAjxpDraggables = $A([]);
var AllAjxpDroppables = $A([]);
Event.observe(window, "unload", function(){
Draggables.removeObserver(timerClearObserver);
AllAjxpDraggables.each(function(el){
window.AllAjxpDraggables.each(function(el){
el.destroy();
});
AllAjxpDroppables.each(function(el){
window.AllAjxpDroppables.each(function(el){
Droppables.remove(el);
});
});
Expand Down Expand Up @@ -70,7 +70,7 @@ Class.create("AjxpDraggable", Draggable, {
this.options.delay = (Prototype.Browser.IE?350:200);
this.component = component;
this.componentType = componentType;
AllAjxpDraggables.push(this);
window.AllAjxpDraggables.push(this);
},

/**
Expand All @@ -93,6 +93,7 @@ Class.create("AjxpDraggable", Draggable, {
if(Event.isLeftClick(event)) {
// abort on form elements, fixes a Firefox issue
var src = Event.element(event);
var tag_name;
if((tag_name = src.tagName.toUpperCase()) && (
tag_name=='INPUT' ||
tag_name=='SELECT' ||
Expand Down Expand Up @@ -417,7 +418,7 @@ var AjxpDroppables = {
if(draggable.ajxpNode){
srcName = draggable.ajxpNode.getPath();
}
if(WebFXtimer) clearTimeout(WebFXtimer);
if(window.WebFXtimer) clearTimeout(window.WebFXtimer);
var nodeId = null;
if(droppable.id && webFXTreeHandler.all[droppable.id]){
nodeId = droppable.id;
Expand All @@ -434,7 +435,7 @@ var AjxpDroppables = {
},
onHover:function(draggable, droppable, event)
{
if(WebFXtimer) clearTimeout(WebFXtimer);
if(window.WebFXtimer) clearTimeout(window.WebFXtimer);
if(droppable.id && webFXTreeHandler.all[droppable.id])
{
var container = droppable.up('div.show_first_level');
Expand All @@ -443,15 +444,15 @@ var AjxpDroppables = {
container.addClassName("reset_show_first_level");
}
var jsString = "javascript:";
WebFXtimer = window.setTimeout(function(){
window.WebFXtimer = window.setTimeout(function(){
var node = webFXTreeHandler.all[droppable.id];
if(node && node.folder && !node.open) node.expand();
}, 500);
}
},
onOut:function(droppable)
{
if(WebFXtimer) clearTimeout(WebFXtimer);
if(window.WebFXtimer) clearTimeout(window.WebFXtimer);
var container = droppable.up('div.reset_show_first_level');
if(container) container.addClassName("show_first_level");
}
Expand Down

0 comments on commit 666c6ad

Please sign in to comment.