19 include_once($ROOT_PATH.
'wysiwyg_plugin.inc');
45 $this->_add_button(
'matrixinsertquicklink',
'matrixInsertQuickLink',
'Create a Quick Link',
'false',
'68');
60 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/js/general.js' ?>"></script>
61 <script type=
"text/javascript" src=
"<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js' ?>"></script>
63 <script type=
"text/javascript" language=
"Javascript">
66 HTMLArea.prototype._matrixInsertQuickLink =
function() {
70 var current_a = this.getClosest(
"a");
73 inside_html = current_a.innerHTML;
75 this.selectNodeContents(current_a);
76 inside_html = editor.getSelectedHTML();
79 inside_html = editor.getSelectedHTML();
81 sel = this._getSelection();
82 range = this._createRange(sel);
85 var para_html = inside_html.replace(/(<\/?)P/gi,
"$1p");
89 if (para_html.indexOf(
"<p") > -1) {
94 if (para_html.indexOf(
"<p") != para_html.lastIndexOf(
"<p")) {
95 alert(js_translate(
'select_one_paragraph_at_a_time'));
105 var test =
new String(sel);
106 var mailregexp =
new RegExp(
"^(.+)(\@)(.+)$",
"gi");
107 if (test.search(mailregexp) == -1) {
108 checkhttplink =
new RegExp(
"^http\:\/\/",
"gi");
109 if (test.search(checkhttplink) == -1) {
110 checkanchorlink =
new RegExp(
"^\#",
"gi");
111 if (test.search(checkanchorlink) == -1) {
112 link_url =
"http://" + sel;
120 checkmaillink =
new RegExp(
"^mailto\:",
"gi");
121 if (test.search(checkmaillink) == -1) {
122 link_url =
"mailto:" + sel;
128 var html_code =
'<a href="' + link_url +
'">' + sel +
'</a>';
129 html_code = editor.make_absolute_urls(html_code);
132 editor.insertHTML(html_code, range);
153 this._matrixInsertQuickLink();
168 case "matrixinsertquicklink":
169 this._matrixInsertQuickLink();