rem:     tagName = "hr"; hLine = editorShell.GetSelectedElement(tagName);  if (hLine) { dump("HLine was found -- opening dialog...!\n");   window.openDialog("chrome: } else { hLine = editorShell.CreateElementWithDefaults(tagName);  if (hLine) {  var prefs = Components.classes['component: if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { dump(" We found the Prefs Service\n"); var percent; var height; var shading; var ud = "undefined";  try { var align = prefs.GetIntPref("editor.hrule.align"); dump("Align pref: "+align+"\n"); if (align == 0 ) { hLine.setAttribute("align", "left"); } else if (align == 2) { hLine.setAttribute("align", "right"); } else  {  hLine.setAttribute("align", "center"); }  var width = prefs.GetIntPref("editor.hrule.width"); var percent = prefs.GetBoolPref("editor.hrule.width_percent"); dump("Width pref: "+width+", percent:"+percent+"\n"); if (percent) width = width +"%";  hLine.setAttribute("width", width);  var height = prefs.GetIntPref("editor.hrule.height"); dump("Size pref: "+height+"\n"); hLine.setAttribute("size", String(height));  var shading = prefs.GetBoolPref("editor.hrule.shading"); dump("Shading pref:"+shading+"\n"); if (shading) { hLine.removeAttribute("noshade"); } else { hLine.setAttribute("noshade", ""); } } catch (ex) { dump("failed to get HLine prefs\n"); } } try { editorShell.InsertElementAtSelection(hLine, true); } catch (e) { dump("Exception occured in InsertElementAtSelection\n"); } } } contentWindow.focus(); } 
add: return _EditorObsolete();} 
context: function EditorInsertOrEditHLine(){  // Inserting an HLine is different in that we don't use properties dialog  //  unless we are editing an existing line's attributes  //  We get the last-used attributes from the prefs and insert immediately  tagName = "hr";  hLine = editorShell.GetSelectedElement(tagName);  if (hLine) {    dump("HLine was found -- opening dialog...!\n");    // We only open the dialog for an existing HRule    window.openDialog("chrome://editor/content/EdHLineProps.xul", "_blank", "chrome,close,titlebar,modal");  } else {    hLine = editorShell.CreateElementWithDefaults(tagName);    if (hLine) {      // We change the default attributes to those saved in the user prefs      var prefs = Components.classes['component://netscape/preferences'];      if (prefs) {        prefs = prefs.getService();      }      if (prefs) {        prefs = prefs.QueryInterface(Components.interfaces.nsIPref);      }      if (prefs) {        dump(" We found the Prefs Service\n");        var percent;        var height;        var shading;        var ud = "undefined";        try {          var align = prefs.GetIntPref("editor.hrule.align");          dump("Align pref: "+align+"\n");          if (align == 0 ) {            hLine.setAttribute("align", "left");          } else if (align == 2) {            hLine.setAttribute("align", "right");          } else  {            // Default is center            hLine.setAttribute("align", "center");          }	            var width = prefs.GetIntPref("editor.hrule.width");          var percent = prefs.GetBoolPref("editor.hrule.width_percent");          dump("Width pref: "+width+", percent:"+percent+"\n");          if (percent)            width = width +"%";          hLine.setAttribute("width", width);          var height = prefs.GetIntPref("editor.hrule.height");          dump("Size pref: "+height+"\n");          hLine.setAttribute("size", String(height));          var shading = prefs.GetBoolPref("editor.hrule.shading");          dump("Shading pref:"+shading+"\n");          if (shading) {            hLine.removeAttribute("noshade");          } else {            hLine.setAttribute("noshade", "");          }        }        catch (ex) {          dump("failed to get HLine prefs\n");        }      }      try {        editorShell.InsertElementAtSelection(hLine, true);      } catch (e) {        dump("Exception occured in InsertElementAtSelection\n");      }    }  }  contentWindow.focus();}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/035965297dd3eee99dadbd7c3a6f8560d975d3ea/EditorCommands.js/clean/editor/ui/composer/content/EditorCommands.js