rem: kukit.ar.actionRegistry.register("plone-initKupu", function(oper) { 
add: kukit.actionsGlobalRegistry.register("plone-initKupu", function(oper) { 
context: kukit.ar.actionRegistry.register("plone-initKupu", function(oper) {    oper.completeParms([], {}, 'plone-initKupu action');    // we start from the iframe node...    if (oper.node.tagName.toLowerCase() != 'iframe') {        throw 'The plone-initKupu action can only execute on the iframe node as a target.';    }    var divnode = oper.node.parentNode.parentNode.parentNode.parentNode;    var id = divnode.id;    if (! id) {        throw 'The plone-initKupu action did not find the editor id from the iframe node.';    }    window.kupu = initPloneKupu(id);    //    // Register the editor to ourselves    // This makes possible to execute update on the field    //    var prefix = '#'+id+' ';    //var iframe = getFromSelector(prefix+'iframe.kupu-editor-iframe');    var textarea = getFromSelector(prefix+'textarea.kupu-editor-textarea');    kukit.fo.fieldUpdateRegistry.register(textarea,            {editor: window.kupu,             node: textarea,             doUpdate: function() {                this.editor.saveDataToField(this.node.form, this.node);                // set back _initialized                // XXX check if this is actually ok?                this.editor._initialized = true;                }             });    // Finish setup    window.kupuui = window.kupu.getTool('ui');    window.drawertool = window.kupu.getTool('drawertool');    window.kupu.initialize();    //    // We do some correction here. Problem: the kupu editor    // initialization trasforms the original AT widget. It cannot    // be called twice. If this happens, on IE a second hidden input    // field for the text format qill appear and this will destruct    // the traditional (non-ajax) form submit. Solution:    //    //  - we should not have a duplicate call of the editor init (we    //    need to, currently, because the original inline init does not    //    register the editor.    //    //  - in addition the initialize should not add the node for a second    //    time, once added    //    var form = textarea.form;    var elements = form.elements;    var fmtname = textarea.name + '_text_format';    var hiddencnt = 0;    for (var y=0; y<elements.length; y++) {        var element = elements[y];        if (element.tagName.toLowerCase() == 'input' && element.name == fmtname) {            if (hiddencnt > 0) {                // delete all further duplicates                element.parentNode.removeChild(element);            }            hiddencnt += 1;        }    }});
meta: 5418	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5418/36a929341741c0027164e9d4a0160afba956a65c/plugin.js/clean/plone/app/kss/plugins/plone/plugin.js