Created function for initialize TinyMCE
This commit is contained in:
parent
b65200fde6
commit
d181d5357b
|
@ -418,24 +418,16 @@ $(document).ready (function () {
|
||||||
$table_macros_field.show();
|
$table_macros_field.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyMCE.init({
|
var added_config = {
|
||||||
selector: 'textarea.tiny-mce-editor',
|
"selector": "textarea.tiny-mce-editor",
|
||||||
theme : "advanced",
|
"plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
||||||
plugins : "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
"theme_advanced_buttons1": "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsize,select",
|
"theme_advanced_buttons2": "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
||||||
theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
"valid_children": "+body[style]",
|
||||||
theme_advanced_buttons3 : "",
|
"width": "90%",
|
||||||
theme_advanced_toolbar_location : "top",
|
}
|
||||||
theme_advanced_toolbar_align : "left",
|
defineTinyMCE(added_config);
|
||||||
theme_advanced_resizing : true,
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
force_p_newlines : false,
|
|
||||||
forced_root_block : '',
|
|
||||||
inline_styles : true,
|
|
||||||
valid_children : "+body[style]",
|
|
||||||
element_format : "html"
|
|
||||||
});
|
|
||||||
|
|
||||||
render_command_preview(original_command);
|
render_command_preview(original_command);
|
||||||
render_command_recovery_preview(original_command);
|
render_command_recovery_preview(original_command);
|
||||||
|
|
||||||
|
|
|
@ -1310,23 +1310,19 @@ if ($step == 2) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
tinyMCE.init({
|
var added_config = {
|
||||||
selector: 'textarea.tiny-mce-editor',
|
"selector": 'textarea.tiny-mce-editor',
|
||||||
theme : "advanced",
|
"plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
||||||
plugins : "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
"theme_advanced_buttons1": "bold,italic,underline,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,|,forecolor,backcolor,|,formatselect,fontselect,fontsizeselect",
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsize,select",
|
"theme_advanced_buttons2": "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview",
|
||||||
theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
"force_p_newlines" : false,
|
||||||
theme_advanced_buttons3 : "",
|
"forced_root_block" : '',
|
||||||
theme_advanced_toolbar_location : "top",
|
"inline_styles": true,
|
||||||
theme_advanced_toolbar_align : "left",
|
"valid_children": "+body[style]",
|
||||||
theme_advanced_resizing : true,
|
}
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
force_p_newlines : false,
|
defineTinyMCE(added_config);
|
||||||
forced_root_block : '',
|
|
||||||
inline_styles : true,
|
|
||||||
valid_children : "+body[style]",
|
|
||||||
element_format : "html"
|
|
||||||
});
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -195,54 +195,21 @@ ui_require_javascript_file('encode_decode_base64');
|
||||||
id_visual_console = <?php echo $visualConsole['id']; ?>;
|
id_visual_console = <?php echo $visualConsole['id']; ?>;
|
||||||
visual_map_main();
|
visual_map_main();
|
||||||
|
|
||||||
tinyMCE.init({
|
var added_config = {
|
||||||
mode : "exact",
|
"plugins": "noneditable",
|
||||||
elements: "text-label",
|
"elements": "text-label",
|
||||||
convert_urls: false,
|
"theme_advanced_buttons1":
|
||||||
theme : "advanced",
|
"bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
|
||||||
<?php
|
"valid_children": "+body[style]",
|
||||||
if ($config['style'] == 'pandora_legacy') {
|
"theme_advanced_font_sizes": "true",
|
||||||
echo 'content_css: "'.ui_get_full_url('include/styles/pandora_legacy.css', false, false, false).'",'."\n";
|
"content_css": <?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
|
||||||
} else {
|
"editor_deselector": "noselected",
|
||||||
echo 'content_css: "'.ui_get_full_url('include/styles/pandora.css', false, false, false).'",'."\n";
|
"inline_styles": true,
|
||||||
}
|
"nowrap": true,
|
||||||
?>
|
"width": "50%",
|
||||||
theme_advanced_font_sizes :
|
"height": "100%",
|
||||||
"4pt=.visual_font_size_4pt, " +
|
}
|
||||||
"6pt=.visual_font_size_6pt, " +
|
defineTinyMCE(added_config);
|
||||||
"8pt=.visual_font_size_8pt, " +
|
|
||||||
"10pt=.visual_font_size_10pt, " +
|
|
||||||
"12pt=.visual_font_size_12pt, " +
|
|
||||||
"14pt=.visual_font_size_14pt, " +
|
|
||||||
"18pt=.visual_font_size_18pt, " +
|
|
||||||
"24pt=.visual_font_size_24pt, " +
|
|
||||||
"28pt=.visual_font_size_28pt, " +
|
|
||||||
"36pt=.visual_font_size_36pt, " +
|
|
||||||
"48pt=.visual_font_size_48pt, " +
|
|
||||||
"60pt=.visual_font_size_60pt, " +
|
|
||||||
"72pt=.visual_font_size_72pt, " +
|
|
||||||
"84pt=.visual_font_size_84pt, " +
|
|
||||||
"96pt=.visual_font_size_96pt, " +
|
|
||||||
"116pt=.visual_font_size_116pt, " +
|
|
||||||
"128pt=.visual_font_size_128pt, " +
|
|
||||||
"140pt=.visual_font_size_140pt, " +
|
|
||||||
"154pt=.visual_font_size_154pt, " +
|
|
||||||
"196pt=.visual_font_size_196pt",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "bold,italic, |, justifyleft, justifycenter, justifyright, |,undo, redo, |, image, link, |, fontselect, |, forecolor, fontsizeselect, |, code",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
theme_advanced_statusbar_location : "none",
|
|
||||||
width: "400",
|
|
||||||
height: "200",
|
|
||||||
nowrap: true,
|
|
||||||
plugins : "noneditable",
|
|
||||||
inline_styles : true,
|
|
||||||
valid_children : "+body[style]",
|
|
||||||
element_format : "html",
|
|
||||||
editor_deselector : "noselected"
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.item img').each(function(){
|
$('.item img').each(function(){
|
||||||
|
|
||||||
|
|
|
@ -710,48 +710,25 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
tinymce.init({
|
var added_config = {
|
||||||
selector: "#tinyMCE_editor",
|
"selector": "#tinyMCE_editor",
|
||||||
theme : "advanced",
|
"elements": "text-label",
|
||||||
<?php
|
"plugins": "noneditable",
|
||||||
if ($config['style'] == 'pandora_legacy') {
|
"theme_advanced_buttons1":
|
||||||
echo 'content_css: "'.ui_get_full_url('include/styles/pandora_legacy.css', false, false, false).'",'."\n";
|
"bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
|
||||||
} else {
|
"valid_children": "+body[style]",
|
||||||
echo 'content_css: "'.ui_get_full_url('include/styles/pandora.css', false, false, false).'",'."\n";
|
"theme_advanced_font_sizes": "true",
|
||||||
}
|
"content_css":
|
||||||
?>
|
<?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
|
||||||
theme_advanced_font_sizes :
|
"editor_deselector": "noselected",
|
||||||
"4pt=.visual_font_size_4pt, " +
|
"inline_styles": true,
|
||||||
"6pt=.visual_font_size_6pt, " +
|
"nowrap": true,
|
||||||
"8pt=.visual_font_size_8pt, " +
|
"width": "400",
|
||||||
"10pt=.visual_font_size_10pt, " +
|
"height": "200",
|
||||||
"12pt=.visual_font_size_12pt, " +
|
}
|
||||||
"14pt=.visual_font_size_14pt, " +
|
|
||||||
"18pt=.visual_font_size_18pt, " +
|
defineTinyMCE(added_config);
|
||||||
"24pt=.visual_font_size_24pt, " +
|
|
||||||
"28pt=.visual_font_size_28pt, " +
|
|
||||||
"36pt=.visual_font_size_36pt, " +
|
|
||||||
"48pt=.visual_font_size_48pt, " +
|
|
||||||
"60pt=.visual_font_size_60pt, " +
|
|
||||||
"72pt=.visual_font_size_72pt, " +
|
|
||||||
"84pt=.visual_font_size_84pt, " +
|
|
||||||
"96pt=.visual_font_size_96pt, " +
|
|
||||||
"116pt=.visual_font_size_116pt, " +
|
|
||||||
"128pt=.visual_font_size_128pt, " +
|
|
||||||
"140pt=.visual_font_size_140pt, " +
|
|
||||||
"154pt=.visual_font_size_154pt, " +
|
|
||||||
"196pt=.visual_font_size_196pt",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "bold,italic, |, image, link, |, forecolor, fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
theme_advanced_statusbar_location : "none",
|
|
||||||
width: "400",
|
|
||||||
height: "200",
|
|
||||||
nowrap: true
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#dialog_label_editor").hide ()
|
$("#dialog_label_editor").hide ()
|
||||||
.dialog ({
|
.dialog ({
|
||||||
|
|
|
@ -300,6 +300,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
|
||||||
|
|
||||||
// Include tiny for wysiwyg editor
|
// Include tiny for wysiwyg editor
|
||||||
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||||
|
ui_require_javascript_file('pandora');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
@ -323,20 +324,8 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
showAnim: "slideDown"});
|
showAnim: "slideDown"});
|
||||||
|
|
||||||
|
defineTinyMCE({"elements": "textarea_text",});
|
||||||
tinyMCE.init({
|
|
||||||
mode : "exact",
|
|
||||||
elements: "textarea_text",
|
|
||||||
theme : "advanced",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright, | ,code",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
convert_urls : false,
|
|
||||||
theme_advanced_statusbar_location : "none"
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#checkbox-expire").click(function() {
|
$("#checkbox-expire").click(function() {
|
||||||
check_expire();
|
check_expire();
|
||||||
|
|
|
@ -1401,30 +1401,17 @@ function change_servicetree_nodes_padding () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyMCE.init({
|
var added_config1 = {
|
||||||
mode : "exact",
|
"elements":"textarea_custom_report_front_header, textarea_custom_report_front_footer",
|
||||||
elements: "textarea_custom_report_front_header, textarea_custom_report_front_footer",
|
}
|
||||||
theme : "advanced",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "bold,italic, |, image, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
theme_advanced_statusbar_location : "none"
|
|
||||||
});
|
|
||||||
|
|
||||||
tinyMCE.init({
|
defineTinyMCE(added_config1);
|
||||||
mode : "exact",
|
|
||||||
elements: "textarea_custom_report_front_firstpage",
|
var added_config2 = {
|
||||||
theme : "advanced",
|
"elements":"textarea_custom_report_front_firstpage",
|
||||||
theme_advanced_toolbar_location : "top",
|
}
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "bold,italic, |, image, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright",
|
defineTinyMCE(added_config2);
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
convert_urls : false,
|
|
||||||
theme_advanced_statusbar_location : "none"
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
|
|
|
@ -1458,6 +1458,7 @@ if ($create_alert || $update_alert) {
|
||||||
unset($table);
|
unset($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui_require_javascript_file('pandora', 'include/javascript/', true);
|
||||||
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
@ -1563,24 +1564,19 @@ $(document).ready (function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
tinyMCE.init({
|
var added_config = {
|
||||||
selector: 'textarea.tiny-mce-editor',
|
"selector": "textarea.tiny-mce-editor",
|
||||||
theme : "advanced",
|
"plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
||||||
plugins : "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
"theme_advanced_buttons1" : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsize,select",
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsize,select",
|
"theme_advanced_buttons2" : "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
||||||
theme_advanced_buttons2 : "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
"force_p_newlines": false,
|
||||||
theme_advanced_buttons3 : "",
|
"forced_root_block": '',
|
||||||
theme_advanced_toolbar_location : "top",
|
"inline_styles": true,
|
||||||
theme_advanced_toolbar_align : "left",
|
"valid_children": "+body[style]",
|
||||||
theme_advanced_resizing : true,
|
"element_format": "html",
|
||||||
theme_advanced_statusbar_location : "bottom",
|
}
|
||||||
force_p_newlines : false,
|
|
||||||
forced_root_block : '',
|
|
||||||
inline_styles : true,
|
|
||||||
valid_children : "+body[style]",
|
|
||||||
element_format : "html"
|
|
||||||
});
|
|
||||||
|
|
||||||
|
defineTinyMCE(added_config);
|
||||||
});
|
});
|
||||||
|
|
||||||
function show_add_action_snmp(id_alert_snmp) {
|
function show_add_action_snmp(id_alert_snmp) {
|
||||||
|
|
|
@ -1287,6 +1287,72 @@ function openURLTagWindow(url) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Inicialize tinyMCE with customized parameters
|
||||||
|
*
|
||||||
|
* @param added_config Associative Array. Config to add adding default.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function defineTinyMCE(added_config) {
|
||||||
|
// Default values
|
||||||
|
var buttons1 =
|
||||||
|
"bold,italic,underline,|,link,image,|,cut,copy,paste,|,undo,redo,|,forecolor,fontselect,fontsizeselect,|,justifyleft,justifycenter,justifyright";
|
||||||
|
var elements = added_config["elements"];
|
||||||
|
var plugins = added_config["plugins"];
|
||||||
|
// Initialize with fixed parameters. Some parameters must be initialized too.
|
||||||
|
tinyMCE.init({
|
||||||
|
mode: "exact",
|
||||||
|
theme: "advanced",
|
||||||
|
elements: elements,
|
||||||
|
plugins: plugins,
|
||||||
|
theme_advanced_buttons1: buttons1,
|
||||||
|
theme_advanced_toolbar_location: "top",
|
||||||
|
theme_advanced_toolbar_align: "left",
|
||||||
|
theme_advanced_statusbar_location: "none",
|
||||||
|
convert_urls: false,
|
||||||
|
element_format: "html"
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!isEmptyObject(added_config)) {
|
||||||
|
// If use asterisk mask, you can add at end of buttons new buttons.
|
||||||
|
for (var key in added_config) {
|
||||||
|
switch (key) {
|
||||||
|
case "theme_advanced_buttons1*":
|
||||||
|
tinyMCE.settings.theme_advanced_buttons1 =
|
||||||
|
buttons1 + ",|," + added_config[key];
|
||||||
|
break;
|
||||||
|
case "theme_advanced_font_sizes":
|
||||||
|
tinyMCE.settings.theme_advanced_font_sizes =
|
||||||
|
"4pt=.visual_font_size_4pt, " +
|
||||||
|
"6pt=.visual_font_size_6pt, " +
|
||||||
|
"8pt=.visual_font_size_8pt, " +
|
||||||
|
"10pt=.visual_font_size_10pt, " +
|
||||||
|
"12pt=.visual_font_size_12pt, " +
|
||||||
|
"14pt=.visual_font_size_14pt, " +
|
||||||
|
"18pt=.visual_font_size_18pt, " +
|
||||||
|
"24pt=.visual_font_size_24pt, " +
|
||||||
|
"28pt=.visual_font_size_28pt, " +
|
||||||
|
"36pt=.visual_font_size_36pt, " +
|
||||||
|
"48pt=.visual_font_size_48pt, " +
|
||||||
|
"60pt=.visual_font_size_60pt, " +
|
||||||
|
"72pt=.visual_font_size_72pt, " +
|
||||||
|
"84pt=.visual_font_size_84pt, " +
|
||||||
|
"96pt=.visual_font_size_96pt, " +
|
||||||
|
"116pt=.visual_font_size_116pt, " +
|
||||||
|
"128pt=.visual_font_size_128pt, " +
|
||||||
|
"140pt=.visual_font_size_140pt, " +
|
||||||
|
"154pt=.visual_font_size_154pt, " +
|
||||||
|
"196pt=.visual_font_size_196pt";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tinyMCE.settings[key] = added_config[key];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function removeTinyMCE(elementID) {
|
function removeTinyMCE(elementID) {
|
||||||
if (elementID.length > 0 && !isEmptyObject(tinyMCE))
|
if (elementID.length > 0 && !isEmptyObject(tinyMCE))
|
||||||
tinyMCE.EditorManager.execCommand("mceRemoveControl", true, elementID);
|
tinyMCE.EditorManager.execCommand("mceRemoveControl", true, elementID);
|
||||||
|
|
Loading…
Reference in New Issue