| 63 | | InsertAnchor.prototype.buttonPress = function(editor, id) { |
| 64 | | var anchor; |
| 65 | | anchor = prompt(this._lc("Anchor name"), ""); |
| 66 | | if (anchor == "" || anchor == null) { |
| 67 | | return; |
| 68 | | } |
| 69 | | |
| 70 | | try { |
| 71 | | var doc = editor._doc; |
| 72 | | var alink = doc.createElement("a"); |
| 73 | | alink.id = anchor; |
| 74 | | alink.name = anchor; |
| 75 | | alink.title = anchor; |
| 76 | | alink.className = "anchor"; |
| 77 | | if (HTMLArea.is_ie) { |
| 78 | | var sel = editor._getSelection(); |
| 79 | | var range = editor._createRange(sel); |
| 80 | | range.pasteHTML(alink.outerHTML); |
| 81 | | } else { |
| 82 | | editor.insertNodeAtSelection(alink); |
| 83 | | } |
| 84 | | } |
| 85 | | catch (e) { } |
| | 63 | InsertAnchor.prototype.buttonPress = function(editor) { |
| | 64 | var outparam = null; |
| | 65 | editor._popupDialog( "plugin://InsertAnchor/insert_anchor", function( param ) { |
| | 66 | if ( param ) { |
| | 67 | var anchor = param["name"]; |
| | 68 | if (anchor == "" || anchor == null) { |
| | 69 | return; |
| | 70 | } |
| | 71 | try { |
| | 72 | var doc = editor._doc; |
| | 73 | var alink = doc.createElement("a"); |
| | 74 | alink.id = anchor; |
| | 75 | alink.name = anchor; |
| | 76 | alink.title = anchor; |
| | 77 | alink.className = "anchor"; |
| | 78 | if (HTMLArea.is_ie) { |
| | 79 | var sel = editor._getSelection(); |
| | 80 | var range = editor._createRange(sel); |
| | 81 | range.pasteHTML(alink.outerHTML); |
| | 82 | } else { |
| | 83 | editor.insertNodeAtSelection(alink); |
| | 84 | } |
| | 85 | } |
| | 86 | catch (e) { } |
| | 87 | } |
| | 88 | }, outparam); |