aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-07 22:46:47 +0000
commitceab24db2a7bf459684a650c287770b4ff090f54 (patch)
tree171760af3de53f07b77c12d8e7931241a8d0377e /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
parentd924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (diff)
downloadelgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.gz
elgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.bz2
Refs #3510, #9113. Updated tinyMCE version in trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
index b78e82f76..837c937c6 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
@@ -30,8 +30,6 @@ function init() {
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
- document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
- document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
// Link list
@@ -41,6 +39,13 @@ function init() {
else
document.getElementById("linklisthrefcontainer").innerHTML = html;
+ // Anchor list
+ html = getAnchorListHTML('anchorlist','href');
+ if (html == "")
+ document.getElementById("anchorlistrow").style.display = 'none';
+ else
+ document.getElementById("anchorlistcontainer").innerHTML = html;
+
// Resize some elements
if (isVisible('hrefbrowser'))
document.getElementById('href').style.width = '260px';
@@ -360,20 +365,22 @@ function setAttrib(elm, attrib, value) {
}
function getAnchorListHTML(id, target) {
- var inst = tinyMCEPopup.editor;
- var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;
- var html = "";
-
- html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
- html += 'this.options[this.selectedIndex].value;">';
- html += '<option value="">---</option>';
+ var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
- for (i=0; i<nodes.length; i++) {
- if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")
+ for (i=0, len=nodes.length; i<len; i++) {
+ if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
html += '<option value="#' + name + '">' + name + '</option>';
}
- html += '</select>';
+ if (html == "")
+ return "";
+
+ html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
+ + ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
+ + '>'
+ + '<option value="">---</option>'
+ + html
+ + '</select>';
return html;
}
@@ -389,7 +396,6 @@ function insertAction() {
// Remove element if there is no href
if (!document.forms[0].href.value) {
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
i = inst.selection.getBookmark();
inst.dom.remove(elm, 1);
inst.selection.moveToBookmark(i);
@@ -398,12 +404,10 @@ function insertAction() {
return;
}
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
-
// Create new anchor elements
if (elm == null) {
inst.getDoc().execCommand("unlink", false, null);
- tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
+ tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
for (i=0; i<elementArray.length; i++)
@@ -425,7 +429,7 @@ function insertAction() {
function setAllAttribs(elm) {
var formObj = document.forms[0];
- var href = formObj.href.value;
+ var href = formObj.href.value.replace(/ /g, '%20');
var target = getSelectValue(formObj, 'targetlist');
setAttrib(elm, 'href', href);