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

Commit

Permalink
Keep on chasing JS codestyle errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 11, 2014
1 parent c3e771d commit 0668c98
Show file tree
Hide file tree
Showing 48 changed files with 367 additions and 329 deletions.
13 changes: 5 additions & 8 deletions core/src/plugins/access.ajxp_conf/class.ConfigEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Class.create("ConfigEditor",{
dragged.ajxp_dropped = true;
dropped.insert(dragged);
dragged.setStyle({top:0,left:0});
var action = "edit";
var sub_action;
if(dragged.hasClassName('user_role')){
dragged.removeClassName('user_role');
Expand Down Expand Up @@ -234,8 +233,7 @@ Class.create("ConfigEditor",{
parameters.set('new_pwd', pass.value);
this.submitForm("edit_user", 'create_user', parameters, null);
login.value = pass.value = passConf.value = '';
return;


},

encodePassword : function(password){
Expand Down Expand Up @@ -294,7 +292,7 @@ Class.create("ConfigEditor",{
driverDef.set('label', driverLabel);
driverDef.set('description', XPathGetSingleNodeText(driver, "@description"));
driverDef.set('name', driverName);
var driverParamsArray = new Array();
var driverParamsArray = $A();
for(var j=0;j<driverParams.length;j++){
var paramNode = driverParams[j];
if(this.currentCreateRepoType == "template" && paramNode.getAttribute('no_templates') == 'true'){
Expand Down Expand Up @@ -369,12 +367,12 @@ Class.create("ConfigEditor",{
this.createDriverForm(dName, (this.currentCreateRepoType == "template"?true:false) );
}
if(dName != "0"){
var height = 130 + this.driverForm.getHeight() + (Prototype.Browser.IE?15:0);
height = 130 + this.driverForm.getHeight() + (Prototype.Browser.IE?15:0);
var addscroll = false;
if(height > 425) {
height=425;
addscroll = true;
};
}
}
new Effect.Morph(this.driverForm.up('div'),{
style:'height:'+height + 'px' + (addscroll?'overflow-x:scroll':'overflow-x:auto;'),
Expand Down Expand Up @@ -535,15 +533,14 @@ Class.create("ConfigEditor",{


parseXmlMessage: function(xmlResponse){
if(xmlResponse == null || xmlResponse.documentElement == null) return;
if(xmlResponse == null || xmlResponse.documentElement == null) return false;
var childs = xmlResponse.documentElement.childNodes;
var repList = false;

for(var i=0; i<childs.length;i++)
{
if(childs[i].nodeName == "update_checkboxes")
{
var userId = childs[i].getAttribute('user_id');
var repositoryId = childs[i].getAttribute('repository_id');
var read = childs[i].getAttribute('read');
var write = childs[i].getAttribute('write');
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/access.fs/fsActions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@
var fileNames = $A(userSelection.getFileNames());
var connexion = new Connexion();
connexion.addParameter('get_action', 'restore');
connexion.addParameter('dir', userSelection.getCurrentRep());
connexion.addParameter('dir', userSelection.getCurrentNode().getPath());
connexion.onComplete = function(transport){
ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
};
Expand Down
8 changes: 2 additions & 6 deletions core/src/plugins/access.jsapi/class.JsSourceViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ Class.create("JsSourceViewer", AjxpPane, {
},

/**
* Test
* @return nothing
* @return void
*/
empty : function(){
this.setContent('');
Expand All @@ -82,7 +81,6 @@ Class.create("JsSourceViewer", AjxpPane, {
if(!contextNode) {
contextNode = userSelection.getContextNode();
}
var path = contextNode.getPath();
var objectNode = contextNode;
if(contextNode.isLeaf() && !contextNode.getMetadata().get("API_OBJECT_NODE")){
var metadata = contextNode.getMetadata();
Expand Down Expand Up @@ -147,7 +145,6 @@ Class.create("JsSourceViewer", AjxpPane, {
cursor = this.codeMirror.getSearchCursor(this.pendingPointer+' :', false, false);
if(cursor.findNext()){
cursor.select();
return;
}
}else{
cursor = this.codeMirror.getSearchCursor(".create('" + this.pendingPointer+"'", false, false);
Expand All @@ -158,8 +155,7 @@ Class.create("JsSourceViewer", AjxpPane, {
cursor = this.codeMirror.getSearchCursor('.create("' + this.pendingPointer+'"', false, false);
if(cursor.findNext()){
this.codeMirror.jumpToLine(cursor.position().line);
return;
}
}
}
},

Expand Down
11 changes: 6 additions & 5 deletions core/src/plugins/access.jsapi/class.LocalAPINodeProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ Class.create("LocalAPINodeProvider", {
var children = [];
var levelIcon = "folder.png";
if(path == "/"){
var levelIcon = "jsapi_images/package.png";
levelIcon = "jsapi_images/package.png";
children = ["Classes", "Interfaces"];
}else if(path == "/Classes" || path == "/Interfaces"){
var levelIcon = (path=="/Classes"?"jsapi_images/class.png":"jsapi_images/interface.png");
levelIcon = (path=="/Classes"?"jsapi_images/class.png":"jsapi_images/interface.png");
$$OO_ObjectsRegistry[(path=="/Classes"?'classes':'interfaces')].each(function(pair){
children.push(pair.key);
});
children.sort();
}else if(node.getMetadata().get("API_CLASS") || node.getMetadata().get("API_INTERFACE")){
var api_class = node.getMetadata().get("API_CLASS");
var api_interface = node.getMetadata().get("API_INTERFACE");
var levelIcon = "jsapi_images/method.png";
levelIcon = "jsapi_images/method.png";
var ooObject = $$OO_ObjectsRegistry[(api_class?'classes':'interfaces')].get((api_class?api_class:api_interface));
var proto = ooObject.prototype;
var properties = $A();
Expand Down Expand Up @@ -114,10 +114,11 @@ Class.create("LocalAPINodeProvider", {
for(var key in proto){
if(key.indexOf("_") === 0) continue;
if(key == "constructor") continue;
var child;
if(typeof proto[key] == 'function'){
var args = proto[key].argumentNames();
var label = '<span class="jsapi_member">'+key+'</span>' + "(" + args.join(", ") + ")";
var child = {
child = {
PATH : key,
LABEL:label,
ICON:'jsapi_images/method.png',
Expand All @@ -142,7 +143,7 @@ Class.create("LocalAPINodeProvider", {
methods.push(child);
}
}else{
var child = {
child = {
PATH : key,
LABEL:'<span class="jsapi_member">'+key+'</span>',
ICON:'jsapi_images/property.png',
Expand Down
10 changes: 4 additions & 6 deletions core/src/plugins/access.mysql/resources/js/class.SQLEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@ Class.create("SQLEditor", {
style:'cursor:pointer;'
});
activator.insert({before:deleteCol});
var row;
templateTable.observe('click', function(e){
if(e.findElement('img') && e.findElement('img').hasClassName('enableRow')){
var row = e.findElement('tr');
row = e.findElement('tr');
if(row.getAttribute('enabled') && row.getAttribute('enabled') == "true"){
row.select('input', 'textarea', 'select').invoke('disable');
row.setAttribute('enabled', 'false');
Expand All @@ -244,12 +245,11 @@ Class.create("SQLEditor", {
}
Event.stop(e);
}else if(e.findElement('img') && e.findElement('img').hasClassName('deleteRow')){
var row = e.findElement('tr');
row = e.findElement('tr');
var origName = '';
row.select('input').each(function(input){
if(input.name.search('field_origname') > -1){
origName = input.value;
return;
}
});
if(origName != ''){
Expand Down Expand Up @@ -322,12 +322,10 @@ Class.create("SQLEditor", {
},

createFieldSet:function(legend, content){
var fSet = new Element('fieldset').insert(new Element('legend').update(legend)).insert(content);
return fSet;
return new Element('fieldset').insert(new Element('legend').update(legend)).insert(content);
},

parseXml : function(transport){
//alert(transport.responseText);
this.changeModifiedStatus(false);
this.removeOnLoad();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Class.create("SQLSearchEngine", SearchEngine, {
params.set('get_action', 'set_query');
params.set('query', query);
connexion.setParameters(params);
var res = connexion.sendSync();
connexion.sendSync();
var path = "/ajxpmysqldriver_searchresults";
ajaxplorer.updateContextData(new AjxpNode(path));
},
Expand Down
3 changes: 1 addition & 2 deletions core/src/plugins/action.cart/class.CartManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Class.create("CartManager", FetchedResultPane, {
var form = $('download_form');
form.action = window.ajxpServerAccessPath;
form.secure_token.value = Connexion.SECURE_TOKEN;
var gAction;
form.select("input").each(function(input){
if(input.name!='get_action' && input.name!='secure_token') input.remove();
if(input.name == 'get_action') input.value = 'search-cart-download';
Expand Down Expand Up @@ -195,7 +194,7 @@ Class.create("CartManager", FetchedResultPane, {
/**
* Can be overriden by the children.
* @param ajxpOptions
* @returns {AjxpDataModel}
* @returns AjxpDataModel
*/
initDataModel: function(ajxpOptions){

Expand Down
7 changes: 4 additions & 3 deletions core/src/plugins/action.share/class.ShareCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,9 @@ Class.create("ShareCenter", {
values[name] = element;
chooser.insert(new Element('option', {value:element}).update(label));
});
var read;
if(linkRightsToTemplates && values["unique_preview_file"] && values["unique_preview_download"]){
var read = oForm.down("#simple_right_read");
read = oForm.down("#simple_right_read");
var download = oForm.down("#simple_right_download");
var observer = function(){
if(!read.checked && !download.checked){
Expand All @@ -623,7 +624,7 @@ Class.create("ShareCenter", {
download.observe("click", observer);

}else if(noEditorsFound){
var read = oForm.down("#simple_right_read");
read = oForm.down("#simple_right_read");
read.checked = false;
read.disabled = true;
read.next("label").insert(" (no preview for this file)");
Expand Down Expand Up @@ -1036,7 +1037,7 @@ Class.create("ShareCenter", {
}
conn.onComplete = function(transport){
ajaxplorer.actionBar.parseXmlMessage(transport.responseXML);
}
};
conn.sendAsync();
}
}.bind(this));
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.mailer/class.AjxpMailer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Class.create("AjxpMailer", {
var loginLabel = el.down("span.user_entry_label").innerHTML;
this.selectedLoginToSpan(
loginLabel,
el.getAttribute("data-entry_id") || selectedLi.readAttribute('data-group') ,
el.getAttribute("data-entry_id") || el.getAttribute('data-group') ,
el.hasClassName("complete_group_entry")
);
}.bind(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@
class AJXP_NotificationCenter extends AJXP_Plugin
{
/**
* @var AJXP_NotificationCenter
* @var String
*/
private static $instance;
private $userId;
/**
* @var AJXP_FeedStore|bool
*/
private $eventStore = false;
/**
* @var bool|AJXP_MessageExchanger
*/
private $msgExchanger = false;

public function init($options)
{
Expand Down Expand Up @@ -373,7 +368,7 @@ public function loadUserAlerts($actionName, $httpVars, $fileVars)
}
// Replace PATH
$nodeToSend->real_path = $path;
$url = parse_url($nodeToSend->getUrl());
//$url = parse_url($nodeToSend->getUrl());
//$nodeToSend->setUrl($url["scheme"]."://".$url["host"]."/alert_".$index);
$index ++;
AJXP_XMLWriter::renderAjxpNode($nodeToSend);
Expand Down
19 changes: 19 additions & 0 deletions core/src/plugins/editor.ajxp_datagrid/class.AjxpDataGridEditor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/
Class.create("AjxpDataGridEditor", AbstractEditor, {

_dataSource:null,
Expand Down
20 changes: 11 additions & 9 deletions core/src/plugins/editor.ajxp_repository/class.RepositoryEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,15 @@ Class.create("RepositoryEditor", AbstractEditor, {
var metaTabBody = this.metaPane.down('.tabpanes');
metaTabHead.update("");
metaTabBody.update("");
var id, i;
var data = XPathSelectSingleNode(xmlData, 'admin_data/repository/param[@name="META_SOURCES"]');
if(data && data.firstChild && data.firstChild.nodeValue){
var metaSourcesData = data.firstChild.nodeValue.evalJSON();
for(var plugId in metaSourcesData){
var metaLabel = XPathSelectSingleNode(xmlData, 'admin_data/metasources/meta[@id="'+plugId+'"]/@label').nodeValue;
var metaDefNodes = XPathSelectNodes(xmlData, 'admin_data/metasources/meta[@id="'+plugId+'"]/param');

var id = this.repositoryId+"-meta-"+plugId.replace(".", "-");
id = this.repositoryId+"-meta-"+plugId.replace(".", "-");
var title = new Element('li',{tabIndex:0, "data-PaneID":id}).update(metaLabel);
var accordionContent = new Element("div", {className:"tabPane", id:id, style:"padding-bottom: 10px;"});
var form = new Element("div", {className:'meta_form_container'});
Expand All @@ -274,7 +275,7 @@ Class.create("RepositoryEditor", AbstractEditor, {
var insertSave = false;
if(metaDefNodes.length){
var driverParamsHash = $A([]);
for(var i=0;i<metaDefNodes.length;i++){
for(i=0;i<metaDefNodes.length;i++){
driverParamsHash.push(this.formManager.parameterNodeToHash(metaDefNodes[i]));
}
var paramsValues = new Hash(metaSourcesData[plugId]);
Expand Down Expand Up @@ -322,8 +323,8 @@ Class.create("RepositoryEditor", AbstractEditor, {
this.metaSelector.insert(new Element("option", {value:"", selected:"true"}));
var prevType = "";
var currentGroup;
for(var i=0;i<choices.length;i++){
var id = choices[i].getAttribute("id");
for(i=0;i<choices.length;i++){
id = choices[i].getAttribute("id");
var type = id.split(".").shift();
var label = choices[i].getAttribute("label");
if(!currentGroup || type != prevType){
Expand Down Expand Up @@ -381,13 +382,13 @@ Class.create("RepositoryEditor", AbstractEditor, {
metaActionClick : function(event){
var img = Event.findElement(event, 'div');
Event.stop(event);
var action;
var action, form;
if(img && img._form){
var form = img._form;
form = img._form;
action = "meta_source_add";
}else{
var button = Event.findElement(event, 'div.largeButton');
var form = button.up('div.tabPaneButtons').previous('div.meta_form_container');
form = button.up('div.tabPaneButtons').previous('div.meta_form_container');
if(button.getAttribute("name")){
action = button.getAttribute("name");
}else{
Expand Down Expand Up @@ -475,7 +476,8 @@ Class.create("RepositoryEditor", AbstractEditor, {

mergeObjectsRecursive : function(source, destination){
var newObject = {};
for (var property in source) {
var property;
for (property in source) {
if (source.hasOwnProperty(property)) {
if( source[property] === null ) continue;
if( destination.hasOwnProperty(property)){
Expand All @@ -493,7 +495,7 @@ Class.create("RepositoryEditor", AbstractEditor, {
}
}
}
for (var property in destination){
for (property in destination){
if(destination.hasOwnProperty(property) && !newObject.hasOwnProperty(property) && destination[property]!==null){
if(destination[property] instanceof Object) {
newObject[property] = this.mergeObjectsRecursive(destination[property], {});
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.audio/class.AudioPreviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Class.create("AudioPreviewer", AbstractEditor, {
},

createFolderPlayer : function(ajxpNode){
var template = new Template('<head><title>#{window_title}</title></head><body style="margin:0px; padding:10px;"><div style=\"font-family:Trebuchet MS, sans-serif; color:#79f; font-size:15px; font-weight:bold;\">#{window_title}</div><div style="font-family:Trebuchet MS, sans-serif; color:#666; font-size:10px; padding-bottom: 10px;">#{reading_folder}: #{current_folder}</div><object type="application/x-shockwave-flash" data="plugins/editor.audio/dewplayer-playlist.swf" width="240" height="200"><param name="wmode" value="transparent"><param name="movie" value="plugins/editor.audio/dewplayer-playlist.swf"/><param name="flashvars" value="xml=#{playlist_url}&amp;showtime=true&amp;autoreplay=true&amp;autoplay=true"/></object></body>');
var template = new Template('<head><title>#{window_title}</title></head><body style="margin:0; padding:10px;"><div style=\"font-family:Trebuchet MS, sans-serif; color:#79f; font-size:15px; font-weight:bold;\">#{window_title}</div><div style="font-family:Trebuchet MS, sans-serif; color:#666; font-size:10px; padding-bottom: 10px;">#{reading_folder}: #{current_folder}</div><object type="application/x-shockwave-flash" data="plugins/editor.audio/dewplayer-playlist.swf" width="240" height="200"><param name="wmode" value="transparent"><param name="movie" value="plugins/editor.audio/dewplayer-playlist.swf"/><param name="flashvars" value="xml=#{playlist_url}&amp;showtime=true&amp;autoreplay=true&amp;autoplay=true"/></object></body>');
var newWin = window.open('#', '_blank', 'width=260,height=270,directories=no,location=no,menubar=no,resizeable=yes,scrollbars=no,status=no,toolbar=no');
try{
var playlist_url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=ls&skip_history=true&playlist=true&dir='+encodeURIComponent(base64_encode(ajxpNode.getPath()));
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/editor.browser/class.BrowserOpener.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Class.create("BrowserOpener", AbstractEditor, {
var open_file_url = url + "/" + window.ajxpServerAccessPath + "&get_action=open_file&repository_id=" + repo + "&file=" + encodeURIComponent(node.getPath());

if(this.editorOptions.context.__className == 'Modal'){
var myRef = window.open(open_file_url);
window.open(open_file_url);
if(!Modernizr.boxshadow){
window.setTimeout('hideLightBox()', 1500);
}else{
Expand Down
Loading

0 comments on commit 0668c98

Please sign in to comment.