"lefttoright", "righttoleft", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
- "inserthorizontalrule", "createanchor", "createlink", "unlink", "insertimage", "inserttable",
+ "inserthorizontalrule", "createanchor", "createlink", "unlink", "nolink", "separator",
+ "insertimage", "inserttable",
"insertsmile", "insertchar",
<?php if (!empty($CFG->aspellpath) && !empty($CFG->editorspelling)) {
echo '"separator","spellcheck",';
createanchor: [ "Create anchor", "ed_anchor.gif", false, function(e) {e.execCommand("createanchor", true);} ],
createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
unlink: [ "Remove Link", "ed_unlink.gif", false, function(e) {e.execCommand("unlink");} ],
+ nolink: [ "No link", "ed_nolink.gif", false, function(e) {e.execCommand("nolink");} ],
insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
html += '<body>\n';
// See bug #2222
html += (editor._textArea.value != null && editor._textArea.value != '') ? editor._textArea.value : '<p> </p>';
+ html = html.replace(/<nolink>/gi, '<span class="nolink">').
+ replace(/<\/nolink>/gi, '</span>');
html += "</body>\n";
html += "</html>";
} else {
var rng = this._createRange(sel);
var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
if(len < 1) {
- alert("You must select text first!");
+ alert("<?php print_string("alertnoselectedtext","editor");?>");
return false;
}
}
var rng = this._createRange(sel);
var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
if(len < 1) {
- alert("You must select text first!");
+ alert("<?php print_string("alertnoselectedtext","editor");?>");
return false;
}
this._popupDialog("createanchor.php", function(objAn) {
},null);
};
+HTMLArea.prototype._nolinktag = function () {
+
+ var editor = this;
+ var sel = this._getSelection();
+ var rng = this._createRange(sel);
+ var len = HTMLArea.is_ie ? rng.text.toString().length : sel.toString().length;
+
+ if (len < 1) {
+ alert("<?php print_string("alertnoselectedtext","editor");?>");
+ return false;
+ }
+ var str = '<span class="nolink">';
+ str += HTMLArea.is_ie ? rng.text : sel;
+ str += '</span>';
+ editor.insertHTML(str);
+ this.focusEditor();
+
+};
+
/// Moodle hack's ends
//
// Category: EVENT HANDLERS
this._createLink();
break;
case "unlink": this._removelink(); break;
+ case "nolink": this._nolinktag(); break;
case "popupeditor":
// this object will be passed to the newly opened window
HTMLArea._object = this;