rem: /* NOT YET IMPLEMENTED */ var objectIndex = FindObjectIndexInObjectsArray(gDialog.selectedObject); if (objectIndex == -1) return; 
add: GetSelectedItemData(); var index = gDialog.selectedIndex; if (index <= 0) return; var sheetIndex = GetSheetContainer();  switch (gDialog.selectedType) { case SHEET: var ownerNode = gDialog.selectedObject.ownerNode; ClearTreeSelection(gDialog.sheetsTree) index--; while (index && objectsArray[index].type != SHEET) index--; if (index == -1) return; ownerNode.parentNode.insertBefore(ownerNode, objectsArray[index].cssElt.ownerNode); Restart(); selectTreeItem(objectsArray[index].xulElt); gDialog.modified = true; break;  case OWNER_NODE: ownerNode = gDialog.selectedObject; ClearTreeSelection(gDialog.sheetsTree) index--; while (index && objectsArray[index].type != SHEET) index--; if (index == -1) return; ownerNode.parentNode.insertBefore(ownerNode, objectsArray[index].cssElt.ownerNode); Restart(); selectTreeItem(objectsArray[index].xulElt); gDialog.modified = true; break;  case STYLE_RULE: case PAGE_RULE: var rule = gDialog.selectedObject; objectsArray[sheetIndex].modified = true;  ClearTreeSelection(gDialog.sheetsTree) var ruleText = rule.cssText; var subtreeitem; var newRule; if (rule.parentRule) { var ruleIndex = getRuleIndexInRulesList(rule.parentRule.cssRules, rule); var parentRule = rule.parentRule;  if (ruleIndex == -1) return;  if (!ruleIndex) {  parentRule.deleteRule(0); var parentRuleIndex;  parentRuleIndex = getRuleIndexInRulesList(parentRule.parentStyleSheet.cssRules, parentRule); parentRule.parentStyleSheet.insertRule(ruleText, parentRuleIndex); newRule = parentRule.parentStyleSheet.cssRules[parentRuleIndex]; } else {  parentRule.deleteRule(ruleIndex); parentRule.insertRule(ruleText, ruleIndex - 1); newRule = parentRule.cssRules.item(ruleIndex - 1); }  objectsArray[index].xulElt.parentNode.removeChild(objectsArray[index].xulElt);  objectsArray.splice(index, 1);  gInsertIndex = index - 1; subtreeitem =  AddStyleRuleToTreeChildren(newRule, objectsArray[index-1].external, objectsArray[index-1].depth);  objectsArray[index].xulElt.parentNode.insertBefore(subtreeitem, objectsArray[index].xulElt); selectTreeItem(subtreeitem);  } else {  ruleIndex = getRuleIndexInRulesList(rule.parentStyleSheet.cssRules, rule); var refStyleSheet = rule.parentStyleSheet; if (ruleIndex == -1) return; if (ruleIndex) {  refStyleSheet.deleteRule(ruleIndex); var targetRule = refStyleSheet.cssRules.item(ruleIndex - 1);  if (targetRule.type == CSSRule.MEDIA_RULE) { targetRule.insertRule(ruleText, targetRule.cssRules.length); var targetRuleIndex = FindObjectIndexInObjectsArray(targetRule); newRule = targetRule.cssRules.item(targetRule.cssRules.length - 1); var subtreechildren = GetSubtreeChildren(objectsArray[targetRuleIndex].xulElt);    objectsArray[index].xulElt.parentNode.removeChild(objectsArray[index].xulElt);  objectsArray.splice(index, 1);  gInsertIndex = index; subtreeitem = AddStyleRuleToTreeChildren(newRule, objectsArray[targetRuleIndex].external, objectsArray[targetRuleIndex].depth + 1);  subtreechildren.appendChild(subtreeitem); selectTreeItem(subtreeitem); return; } else if (targetRule.type != CSSRule.IMPORT_RULE && targetRule.type != CSSRule.CHARSET_RULE) {   refStyleSheet.insertRule(ruleText, ruleIndex - 1); newRule = refStyleSheet.cssRules[ruleIndex - 1];  objectsArray[index].xulElt.parentNode.removeChild(objectsArray[index].xulElt);  objectsArray.splice(index, 1);  gInsertIndex = index - 1; subtreeitem =  AddStyleRuleToTreeChildren(newRule, objectsArray[index-1].external, objectsArray[index-1].depth);  objectsArray[index].xulElt.parentNode.insertBefore(subtreeitem, objectsArray[index].xulElt); selectTreeItem(subtreeitem); return; } }     var refSheetIndex = FindObjectIndexInObjectsArray(refStyleSheet); sheetIndex = refSheetIndex;  if (!sheetIndex) return; sheetIndex--; while (sheetIndex && (objectsArray[sheetIndex].type != SHEET || objectsArray[sheetIndex])) { sheetIndex--; } if (sheetIndex == -1) return; var newStyleSheet = objectsArray[sheetIndex].cssElt;  if (newStyleSheet.cssRules.length && newStyleSheet.cssRules[newStyleSheet.cssRules.length - 1].type == CSSRule.MEDIA_RULE) {  var refMediaRule      = newStyleSheet.cssRules[newStyleSheet.cssRules.length - 1]; var refMediaRuleIndex = FindObjectIndexInObjectsArray(refMediaRule ); var refRuleIndex      = refMediaRuleIndex++; while (refRuleIndex < objectsArray.length && objectsArray[refRuleIndex].depth > 1) refRuleIndex++;  } else {  } } break; } 
context: function MoveObjectUp(){  /* NOT YET IMPLEMENTED */  var objectIndex = FindObjectIndexInObjectsArray(gDialog.selectedObject);  if (objectIndex == -1) return;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/f30d3ed334b276b661545ac9df74bc483ba398fa/EdCssProps.js/clean/extensions/editor/cascades/resources/content/EdCssProps.js