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

Commit

Permalink
Filter the for(var k in ...) entries with hasOwnProperty() call in Ro…
Browse files Browse the repository at this point in the history
…leEditor. Fixes #789
  • Loading branch information
cdujeu committed Dec 30, 2014
1 parent 62bbed7 commit 3c9029f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/plugins/editor.ajxp_role/class.RoleEditor.js
Expand Up @@ -114,8 +114,10 @@ Class.create("RoleEditor", AbstractEditor, {
var objectValue = pair.value.evalJSON();
var repoScope = pName;
for(var pluginId in objectValue){
if(!objectValue.hasOwnProperty(pluginId)) continue;
var pluginData = objectValue[pluginId];
for(var paramName in pluginData){
if(!pluginData.hasOwnProperty(paramName)) continue;
// update roleWrite
if(!this.roleWrite.PARAMETERS[repoScope]) this.roleWrite.PARAMETERS[repoScope] = {};
if(!this.roleWrite.PARAMETERS[repoScope][pluginId]) this.roleWrite.PARAMETERS[repoScope][pluginId] = {};
Expand Down Expand Up @@ -515,7 +517,9 @@ Class.create("RoleEditor", AbstractEditor, {

feedPluginsSelectors : function(jsonData, select){
var oManager = this;
window.jsd = jsonData;
for(var key in jsonData.LIST){
if(!jsonData.LIST.hasOwnProperty(key)) continue;
select.insert(new Element("option", {value:key}).update(key));
}
var nextSelect = select.up("div.SF_element").next().down("select");
Expand Down Expand Up @@ -543,7 +547,7 @@ Class.create("RoleEditor", AbstractEditor, {
nextSelect.select("*").invoke("remove");
nextSelect.insert(new Element("option", {value:-1}).update((type == "action" ? MessageHash["ajxp_role_editor.12a"]:MessageHash["ajxp_role_editor.12b"])));
for(var key in actions){
if(!actions[key][type]) continue;
if(!actions.hasOwnProperty(key) || !actions[key][type]) continue;
var label = actions[key]['label'];
if(label){
if(MessageHash[label]) label = actions[key][type] +" (" +MessageHash[label] +")";
Expand Down Expand Up @@ -575,6 +579,7 @@ Class.create("RoleEditor", AbstractEditor, {
select.insert(new Element("option", {value:"AJXP_REPO_SCOPE_ALL"}).update(MessageHash["ajxp_role_editor.12d"]));
select.insert(new Element("option", {value:"AJXP_REPO_SCOPE_SHARED"}).update(MessageHash["ajxp_role_editor.12e"]));
for(var key in repositories){
if(!repositories.hasOwnProperty(key)) continue;
select.insert(new Element("option", {value:key}).update(repositories[key]));
}
//select.disabled = false;
Expand All @@ -589,6 +594,7 @@ Class.create("RoleEditor", AbstractEditor, {
if(!Object.keys(repositories).length) return;
//repositories.sortBy(function(element) {return XPathGetSingleNodeText(element, "label");});
for(var repoId in repositories){
if(!repositories.hasOwnProperty(repoId)) continue;
var repoLabel = repositories[repoId];
var readBox = new Element('input', {type:'checkbox', id:'chck_'+repoId+'_read'});
var writeBox = new Element('input', {type:'checkbox', id:'chck_'+repoId+'_write'});
Expand Down

0 comments on commit 3c9029f

Please sign in to comment.