|
@@ -54,6 +54,8 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
|
|
|
var current_value = this.getTextareaValue(false);
|
|
|
else
|
|
|
var current_value = this.getWysiwygEditorValue();
|
|
|
+
|
|
|
+ return current_value;
|
|
|
},
|
|
|
appendEmoticon: function (code, emoticon) {
|
|
|
if (code == \'\')
|
|
@@ -155,6 +157,69 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
|
|
|
})(jQuery);
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
+ $.sceditor.setCommand(
|
|
|
+ \'ftp\',
|
|
|
+ function (caller) {
|
|
|
+ var editor = this,
|
|
|
+ content = $(this._(\'<form><div><label for="link">{0}</label> <input type="text" id="link" value="ftp://" /></div>\' +
|
|
|
+ \'<div><label for="des">{1}</label> <input type="text" id="des" value="" /></div></form>\',
|
|
|
+ this._("URL:"),
|
|
|
+ this._("Description (optional):")
|
|
|
+ ))
|
|
|
+ .submit(function () {return false;});
|
|
|
+
|
|
|
+ content.append($(
|
|
|
+ this._(\'<div><input type="button" class="button" value="{0}" /></div>\',
|
|
|
+ this._("Insert")
|
|
|
+ )).click(function (e) {
|
|
|
+ var val = $(this).parent("form").find("#link").val(),
|
|
|
+ description = $(this).parent("form").find("#des").val();
|
|
|
+
|
|
|
+ if(val !== "" && val !== "ftp://") {
|
|
|
+ // needed for IE to reset the last range
|
|
|
+ editor.focus();
|
|
|
+
|
|
|
+ if(!editor.getRangeHelper().selectedHtml() || description)
|
|
|
+ {
|
|
|
+ if(!description)
|
|
|
+ description = val;
|
|
|
+
|
|
|
+ editor.wysiwygEditorInsertHtml(\'<a href="\' + val + \'">\' + description + \'</a>\');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ editor.execCommand("createlink", val);
|
|
|
+ }
|
|
|
+
|
|
|
+ editor.closeDropDown(true);
|
|
|
+ e.preventDefault();
|
|
|
+ }));
|
|
|
+
|
|
|
+ editor.createDropDown(caller, "insertlink", content);
|
|
|
+ },
|
|
|
+ ', javaScriptEscape($txt['ftp']), '
|
|
|
+ );
|
|
|
+ $.sceditor.setCommand(
|
|
|
+ \'glow\',
|
|
|
+ function () {
|
|
|
+ this.wysiwygEditorInsertText(\'[glow=red,2,300][/glow]\');
|
|
|
+ },
|
|
|
+ ', javaScriptEscape($txt['glow']), '
|
|
|
+ );
|
|
|
+ $.sceditor.setCommand(
|
|
|
+ \'shadow\',
|
|
|
+ function () {
|
|
|
+ this.wysiwygEditorInsertText(\'[shadow=red,left][/shadow]\');
|
|
|
+ },
|
|
|
+ ', javaScriptEscape($txt['shadow']), '
|
|
|
+ );
|
|
|
+ $.sceditor.setCommand(
|
|
|
+ \'tt\',
|
|
|
+ function () {
|
|
|
+ this.wysiwygEditorInsertHtml(\'<tt>\', \'</tt>\');
|
|
|
+ },
|
|
|
+ ', javaScriptEscape($txt['teletype']), '
|
|
|
+ );
|
|
|
+
|
|
|
$("#', $editor_id, '").sceditorBBCodePlugin({
|
|
|
style: "', $settings['default_theme_url'], '/css/jquery.sceditor.default.css",
|
|
|
emoticonsCompat: true,
|
|
@@ -196,232 +261,24 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
|
|
|
}
|
|
|
echo '
|
|
|
}';
|
|
|
+ }
|
|
|
|
|
|
-/*
|
|
|
-emoticons:
|
|
|
-{
|
|
|
- // emoticons to be included in the dropdown
|
|
|
- dropdown: {
|
|
|
- ":)": "emoticons/smile.png",
|
|
|
- ":angel:": "emoticons/angel.png"
|
|
|
- },
|
|
|
- // emoticons to be included in the more section
|
|
|
- more: {
|
|
|
- ":alien:": "emoticons/alien.png",
|
|
|
- ":blink:": "emoticons/blink.png"
|
|
|
- },
|
|
|
- // emoticons that are not shwon in the dropdown but will be converted ATY
|
|
|
- hidden: {
|
|
|
- ":aliasforalien:": "emoticons/alien.png",
|
|
|
- ":aliasforblink:": "emoticons/blink.png"
|
|
|
- }
|
|
|
-},*/
|
|
|
+ if ($context['show_bbc'] && $bbcContainer !== null)
|
|
|
+ {
|
|
|
+ echo ',
|
|
|
+ toolbar: "';
|
|
|
+ $count_tags = count($context['bbc_tags']);
|
|
|
+ foreach ($context['bbc_toolbar'] as $i => $buttonRow)
|
|
|
+ {
|
|
|
+ echo implode('|', $buttonRow);
|
|
|
+ $count_tags--;
|
|
|
+ if (!empty($count_tags))
|
|
|
+ echo '||';
|
|
|
+ }
|
|
|
|
|
|
+ echo '",';
|
|
|
}
|
|
|
/*
|
|
|
- // Show the smileys.
|
|
|
-// if ((!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) && !$editor_context['disable_smiley_box'] && $smileyContainer !== null)
|
|
|
-// {
|
|
|
-// echo '
|
|
|
-// var oSmileyBox_', $editor_id, ' = new smc_SmileyBox({
|
|
|
-// sUniqueId: ', JavaScriptEscape('smileyBox_' . $editor_id), ',
|
|
|
-// sContainerDiv: ', JavaScriptEscape($smileyContainer), ',
|
|
|
-// sClickHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.insertSmiley'), ',
|
|
|
-// oSmileyLocations: {';
|
|
|
-//
|
|
|
-// foreach ($context['smileys'] as $location => $smileyRows)
|
|
|
-// {
|
|
|
-// echo '
|
|
|
-// ', $location, ': [';
|
|
|
-// foreach ($smileyRows as $smileyRow)
|
|
|
-// {
|
|
|
-// echo '
|
|
|
-// [';
|
|
|
-// foreach ($smileyRow['smileys'] as $smiley)
|
|
|
-// echo '
|
|
|
-// {
|
|
|
-// sCode: ', JavaScriptEscape($smiley['code']), ',
|
|
|
-// sSrc: ', JavaScriptEscape($settings['smileys_url'] . '/' . $smiley['filename']), ',
|
|
|
-// sDescription: ', JavaScriptEscape($smiley['description']), '
|
|
|
-// }', empty($smiley['isLast']) ? ',' : '';
|
|
|
-//
|
|
|
-// echo '
|
|
|
-// ]', empty($smileyRow['isLast']) ? ',' : '';
|
|
|
-// }
|
|
|
-// echo '
|
|
|
-// ]', $location === 'postform' ? ',' : '';
|
|
|
-// }
|
|
|
-// echo '
|
|
|
-// },
|
|
|
-// sSmileyBoxTemplate: ', JavaScriptEscape('
|
|
|
-// %smileyRows% %moreSmileys%
|
|
|
-// '), ',
|
|
|
-// sSmileyRowTemplate: ', JavaScriptEscape('
|
|
|
-// <div>%smileyRow%</div>
|
|
|
-// '), ',
|
|
|
-// sSmileyTemplate: ', JavaScriptEscape('
|
|
|
-// <img src="%smileySource%" align="bottom" alt="%smileyDescription%" title="%smileyDescription%" id="%smileyId%" />
|
|
|
-// '), ',
|
|
|
-// sMoreSmileysTemplate: ', JavaScriptEscape('
|
|
|
-// <a href="#" id="%moreSmileysId%">[' . (!empty($context['smileys']['postform']) ? $txt['more_smileys'] : $txt['more_smileys_pick']) . ']</a>
|
|
|
-// '), ',
|
|
|
-// sMoreSmileysLinkId: ', JavaScriptEscape('moreSmileys_' . $editor_id), ',
|
|
|
-// sMoreSmileysPopupTemplate: ', JavaScriptEscape('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
-// <html>
|
|
|
-// <head>
|
|
|
-// <title>' . $txt['more_smileys_title'] . '</title>
|
|
|
-// <link rel="stylesheet" type="text/css" href="' . $settings['theme_url'] . '/css/index' . $context['theme_variant'] . '.css?alp21" />
|
|
|
-// </head>
|
|
|
-// <body id="help_popup">
|
|
|
-// <div class="padding windowbg">
|
|
|
-// <div class="cat_bar">
|
|
|
-// <h3 class="catbg">
|
|
|
-// ' . $txt['more_smileys_pick'] . '
|
|
|
-// </h3>
|
|
|
-// </div>
|
|
|
-// <div class="padding">
|
|
|
-// %smileyRows%
|
|
|
-// </div>
|
|
|
-// <div class="smalltext centertext">
|
|
|
-// <a href="#" id="%moreSmileysCloseLinkId%">' . $txt['more_smileys_close_window'] . '</a>
|
|
|
-// </div>
|
|
|
-// </div>
|
|
|
-// </body>
|
|
|
-// </html>'), '
|
|
|
-// });';
|
|
|
-// }
|
|
|
-*/ /*
|
|
|
-// if ($context['show_bbc'] && $bbcContainer !== null)
|
|
|
-// {
|
|
|
-// echo '
|
|
|
-// var oBBCBox_', $editor_id, ' = new smc_BBCButtonBox({
|
|
|
-// sUniqueId: ', JavaScriptEscape('BBCBox_' . $editor_id), ',
|
|
|
-// sContainerDiv: ', JavaScriptEscape($bbcContainer), ',
|
|
|
-// sButtonClickHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.handleButtonClick'), ',
|
|
|
-// sSelectChangeHandler: ', JavaScriptEscape('oEditorHandle_' . $editor_id . '.handleSelectChange'), ',
|
|
|
-// aButtonRows: [';
|
|
|
-//
|
|
|
-// // Here loop through the array, printing the images/rows/separators!
|
|
|
-// foreach ($context['bbc_tags'] as $i => $buttonRow)
|
|
|
-// {
|
|
|
-// echo '
|
|
|
-// [';
|
|
|
-// foreach ($buttonRow as $tag)
|
|
|
-// {
|
|
|
-// // Is there a "before" part for this bbc button? If not, it can't be a button!!
|
|
|
-// if (isset($tag['before']))
|
|
|
-// echo '
|
|
|
-// {
|
|
|
-// sType: \'button\',
|
|
|
-// bEnabled: ', empty($context['disabled_tags'][$tag['code']]) ? 'true' : 'false', ',
|
|
|
-// sImage: ', file_exists($settings['theme_dir'] . '/images/bbc/' . $tag['image'] . '.png') ? JavaScriptEscape($settings['images_url'] . '/bbc/' . $tag['image'] . '.png') : JavaScriptEscape($settings['images_url'] . '/bbc/' . $tag['image'] . '.gif'), ',
|
|
|
-// sCode: ', JavaScriptEscape($tag['code']), ',
|
|
|
-// sBefore: ', JavaScriptEscape($tag['before']), ',
|
|
|
-// sAfter: ', isset($tag['after']) ? JavaScriptEscape($tag['after']) : 'null', ',
|
|
|
-// sDescription: ', JavaScriptEscape($tag['description']), '
|
|
|
-// }', empty($tag['isLast']) ? ',' : '';
|
|
|
-//
|
|
|
-// // Must be a divider then.
|
|
|
-// else
|
|
|
-// echo '
|
|
|
-// {
|
|
|
-// sType: \'divider\'
|
|
|
-// }', empty($tag['isLast']) ? ',' : '';
|
|
|
-// }
|
|
|
-//
|
|
|
-// // Add the select boxes to the first row.
|
|
|
-// if ($i == 0)
|
|
|
-// {
|
|
|
-// // Show the font drop down...
|
|
|
-// if (!isset($context['disabled_tags']['font']))
|
|
|
-// echo ',
|
|
|
-// {
|
|
|
-// sType: \'select\',
|
|
|
-// sName: \'sel_face\',
|
|
|
-// oOptions: {
|
|
|
-// \'\': ', JavaScriptEscape($txt['font_face']), ',
|
|
|
-// \'courier\': \'Courier\',
|
|
|
-// \'arial\': \'Arial\',
|
|
|
-// \'arial black\': \'Arial Black\',
|
|
|
-// \'impact\': \'Impact\',
|
|
|
-// \'verdana\': \'Verdana\',
|
|
|
-// \'times new roman\': \'Times New Roman\',
|
|
|
-// \'georgia\': \'Georgia\',
|
|
|
-// \'andale mono\': \'Andale Mono\',
|
|
|
-// \'trebuchet ms\': \'Trebuchet MS\',
|
|
|
-// \'comic sans ms\': \'Comic Sans MS\'
|
|
|
-// }
|
|
|
-// }';
|
|
|
-//
|
|
|
-// // Font sizes anyone?
|
|
|
-// if (!isset($context['disabled_tags']['size']))
|
|
|
-// echo ',
|
|
|
-// {
|
|
|
-// sType: \'select\',
|
|
|
-// sName: \'sel_size\',
|
|
|
-// oOptions: {
|
|
|
-// \'\': ', JavaScriptEscape($txt['font_size']), ',
|
|
|
-// \'1\': \'8pt\',
|
|
|
-// \'2\': \'10pt\',
|
|
|
-// \'3\': \'12pt\',
|
|
|
-// \'4\': \'14pt\',
|
|
|
-// \'5\': \'18pt\',
|
|
|
-// \'6\': \'24pt\',
|
|
|
-// \'7\': \'36pt\'
|
|
|
-// }
|
|
|
-// }';
|
|
|
-//
|
|
|
-// // Print a drop down list for all the colors we allow!
|
|
|
-// if (!isset($context['disabled_tags']['color']))
|
|
|
-// echo ',
|
|
|
-// {
|
|
|
-// sType: \'select\',
|
|
|
-// sName: \'sel_color\',
|
|
|
-// oOptions: {
|
|
|
-// \'\': ', JavaScriptEscape($txt['change_color']), ',
|
|
|
-// \'black\': ', JavaScriptEscape($txt['black']), ',
|
|
|
-// \'red\': ', JavaScriptEscape($txt['red']), ',
|
|
|
-// \'yellow\': ', JavaScriptEscape($txt['yellow']), ',
|
|
|
-// \'pink\': ', JavaScriptEscape($txt['pink']), ',
|
|
|
-// \'green\': ', JavaScriptEscape($txt['green']), ',
|
|
|
-// \'orange\': ', JavaScriptEscape($txt['orange']), ',
|
|
|
-// \'purple\': ', JavaScriptEscape($txt['purple']), ',
|
|
|
-// \'blue\': ', JavaScriptEscape($txt['blue']), ',
|
|
|
-// \'beige\': ', JavaScriptEscape($txt['beige']), ',
|
|
|
-// \'brown\': ', JavaScriptEscape($txt['brown']), ',
|
|
|
-// \'teal\': ', JavaScriptEscape($txt['teal']), ',
|
|
|
-// \'navy\': ', JavaScriptEscape($txt['navy']), ',
|
|
|
-// \'maroon\': ', JavaScriptEscape($txt['maroon']), ',
|
|
|
-// \'limegreen\': ', JavaScriptEscape($txt['lime_green']), ',
|
|
|
-// \'white\': ', JavaScriptEscape($txt['white']), '
|
|
|
-// }
|
|
|
-// }';
|
|
|
-// }
|
|
|
-// echo '
|
|
|
-// ]', $i == count($context['bbc_tags']) - 1 ? '' : ',';
|
|
|
-// }
|
|
|
-// echo '
|
|
|
-// ],
|
|
|
-// sButtonTemplate: ', JavaScriptEscape('
|
|
|
-// <img id="%buttonId%" src="%buttonSrc%" align="bottom" width="23" height="22" alt="%buttonDescription%" title="%buttonDescription%" />
|
|
|
-// '), ',
|
|
|
-// sButtonBackgroundImage: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_bg.png'), ',
|
|
|
-// sButtonBackgroundImageHover: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_hoverbg.png'), ',
|
|
|
-// sActiveButtonBackgroundImage: ', JavaScriptEscape($settings['images_url'] . '/bbc/bbc_hoverbg.png'), ',
|
|
|
-// sDividerTemplate: ', JavaScriptEscape('
|
|
|
-// <img src="' . $settings['images_url'] . '/bbc/divider.png" alt="|" style="margin: 0 3px;" />
|
|
|
-// '), ',
|
|
|
-// sSelectTemplate: ', JavaScriptEscape('
|
|
|
-// <select name="%selectName%" id="%selectId%" style="margin-bottom: 1ex; font-size: x-small;">
|
|
|
-// %selectOptions%
|
|
|
-// </select>
|
|
|
-// '), ',
|
|
|
-// sButtonRowTemplate: ', JavaScriptEscape('
|
|
|
-// <div>%buttonRow%</div>
|
|
|
-// '), '
|
|
|
-// });';
|
|
|
-// }
|
|
|
-
|
|
|
// // Now it's all drawn out we'll actually setup the box.
|
|
|
// echo '
|
|
|
// var oEditorHandle_', $editor_id, ' = new smc_Editor({
|