rem: var options = null; var el = null; var cmd = null; var customSelects = editor.config.customSelects; var context = null; var tooltip = ""; switch (txt) { case "fontsize": case "fontname": case "formatblock":        options = editor.config[txt]; cmd = txt; break; default:  cmd = txt; var dropdown = customSelects[cmd]; if (typeof dropdown != "undefined") { options = dropdown.options; context = dropdown.context; if (typeof dropdown.tooltip != "undefined") { tooltip = dropdown.tooltip; } } else { alert("ERROR [createSelect]:\nCan't find the requested dropdown definition"); } break; } if (options) { el = document.createElement("select"); el.title = tooltip; var obj = { name	: txt, element : el, enabled : true, text	: false, cmd	: cmd, state	: setButtonStatus, context : context }; tb_objects[txt] = obj; for (var i in options) { var op = document.createElement("option"); op.innerHTML = i; op.value = options[i]; el.appendChild(op); } HTMLArea._addEvent(el, "change", function () { editor._comboSelected(el, txt); }); } return el; }; 
add: var options = null; var el = null; var cmd = null; var customSelects = editor.config.customSelects; var context = null; var tooltip = ""; switch (txt) { case "fontsize": case "fontname": case "formatblock":        options = editor.config[txt]; cmd = txt; break; default:  cmd = txt; var dropdown = customSelects[cmd]; if (typeof dropdown != "undefined") { options = dropdown.options; context = dropdown.context; if (typeof dropdown.tooltip != "undefined") { tooltip = dropdown.tooltip; } } else { alert("ERROR [createSelect]:\nCan't find the requested dropdown definition"); } break; } if (options) { el = document.createElement("select"); el.title = tooltip; var obj = { name	: txt, element : el, enabled : true, text	: false, cmd	: cmd, state	: setButtonStatus, context : context }; tb_objects[txt] = obj; for (var i in options) { var op = document.createElement("option"); op.appendChild(document.createTextNode(i)); op.value = options[i]; el.appendChild(op); } HTMLArea._addEvent(el, "change", function () { editor._comboSelected(el, txt); }); } return el; }; 
context:   function createSelect(txt) {    var options = null;    var el = null;    var cmd = null;    var customSelects = editor.config.customSelects;    var context = null;    var tooltip = "";    switch (txt) {        case "fontsize":        case "fontname":        case "formatblock":      // the following line retrieves the correct      // configuration option because the variable name      // inside the Config object is named the same as the      // button/select in the toolbar.  For instance, if txt      // == "formatblock" we retrieve config.formatblock (or      // a different way to write it in JS is      // config["formatblock"].      options = editor.config[txt];      cmd = txt;      break;        default:      // try to fetch it from the list of registered selects      cmd = txt;      var dropdown = customSelects[cmd];      if (typeof dropdown != "undefined") {        options = dropdown.options;        context = dropdown.context;        if (typeof dropdown.tooltip != "undefined") {          tooltip = dropdown.tooltip;        }      } else {        alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");      }      break;    }    if (options) {      el = document.createElement("select");      el.title = tooltip;      var obj = {        name	: txt, // field name        element : el,	// the UI element (SELECT)        enabled : true, // is it enabled?        text	: false, // enabled in text mode?        cmd	: cmd, // command ID        state	: setButtonStatus, // for changing state        context : context      };      tb_objects[txt] = obj;      for (var i in options) {        var op = document.createElement("option");        op.innerHTML = i;        op.value = options[i];        el.appendChild(op);      }      HTMLArea._addEvent(el, "change", function () {        editor._comboSelected(el, txt);      });    }    return el;  }; // END of function: createSelect
meta: 7119	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7119/4d968a51f578e3361a382d6fa8372e519c47ba55/htmlarea.js/clean/phpgwapi/js/htmlarea/htmlarea.js