createlink-base.js revision 33a04233c7a32ec1ac1b5d5991097fe0b099e87b
0N/A * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>. 0N/A * @class Plugin.CreateLinkBase 0N/A * @submodule createlink-base 0N/A * Strings used by the plugin 0N/A * String used for the Prompt 0N/A PROMPT:
'Please enter the URL for the link to point to:',
0N/A * String used as the default value of the Prompt 0N/A * @method COMMANDS.createlink 0N/A * @param {String} cmd The command executed: createlink 0N/A * @return {Node} Node instance of the item touched by this command. 0N/A holder.appendChild(url); 0N/A url = holder.innerHTML; 0N/A this.get('host')._execCommand(cmd, url); 0N/A sel = new inst.Selection(); 0N/A out = sel.getSelected(); 0N/A if (!sel.isCollapsed && out.size()) { 0N/A //We have a selection 0N/A a = out.item(0).one('a'); 0N/A out.item(0).replace(a); 0N/A if (a.get('parentNode').test('span')) { 1015N/A if (a.get('parentNode').one('br.yui-cursor')) { 1015N/A a.get('parentNode').insert(a, 'before'); 0N/A //No selection, insert a new node.. 0N/A this.get('host').execCommand('inserthtml', '<a href="' + url + '">' + url + '</a>'); 1488N/A}, '@VERSION@' ,{requires:['editor-base'], skinnable:false});