//////////////////////////////////////////////////////////////////
// Init color-list for RTE
function RTE_getColors()
{
hexChars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];
colors = [];
// Loop color-channels
for(r=0;r<16;r+=3)
{
for(g=0;g<16;g+=3)
{
for(b=0;b<16;b+=3)
{
color = hexChars[r]+hexChars[r]+hexChars[g]+hexChars[g]+hexChars[b]+hexChars[b];
// Push value (without Hash!)
colors.push(color);
// Push name
colors.push('#'+color);
}
}
}
// Reorder colors
colorsOrdered = [];
colorsOrdered = colorsOrdered.concat(colors.slice(0,36));
colorsOrdered = colorsOrdered.concat(colors.slice(72,108));
colorsOrdered = colorsOrdered.concat(colors.slice(144,180));
colorsOrdered = colorsOrdered.concat(colors.slice(216,252));
colorsOrdered = colorsOrdered.concat(colors.slice(288,324));
colorsOrdered = colorsOrdered.concat(colors.slice(360,396));
colorsOrdered = colorsOrdered.concat(colors.slice(36,72));
colorsOrdered = colorsOrdered.concat(colors.slice(108,144));
colorsOrdered = colorsOrdered.concat(colors.slice(180,216));
colorsOrdered = colorsOrdered.concat(colors.slice(252,288));
colorsOrdered = colorsOrdered.concat(colors.slice(324,360));
colorsOrdered = colorsOrdered.concat(colors.slice(396,432));
return colorsOrdered;
}
///////////////////////////////////////////////////////////////
// DAILOG page-select: Set click handler to pages in tree
function RTE_pageTreeClick()
{
$('A.CMM_treeLabel','#CMM_adminPageSelectRTE').on('click',function(e){
// Prevent regular click
e.preventDefault();
// Seiten-ID aus Link ermitteln
pageSelectString = $(this).attr('href').match(/CMM_page=(\d+)/i);
pageSelectID = pageSelectString[1];
//alert(pageSelectID);
// Seiten-ID an RTE-Browser-Dialog zurueck geben
RTE_returnPageID(pageSelectID);
});
}
///////////////////////////////////////////////////////////////
// DAILOG page-select: Callback for page-click
function RTE_returnPageID(URL)
{
top.tinymce.activeEditor.windowManager.getParams().oninsert(URL);
top.tinymce.activeEditor.windowManager.close();
}
///////////////////////////////////////////////////////////////////
// DAILOG icon-select: Realisze search
function RTE_createIconSearch()
{
// Set dialog container
var iconDialog = $('#CMM_adminIconSelectRTE');
$('#iconSearch',iconDialog).on('keyup', function() {
// Clear result list
$('.CMM_adminIconSelectSearch UL',iconDialog).empty();
// Search for matching icons
if($(this).val().length >= 2)
{
// Get matching icons
var tempIcons = $('.CMM_adminIconSelectList I[title*="'+$(this).val()+'"]',iconDialog);
// Loop icon list
tempIcons.each(function(index,elem) {
// Check if icon with same class is already in result list
if($('.CMM_adminIconSelectSearch I[class*="'+$(elem).attr('class')+'"]',iconDialog).length==0)
{ $(elem).parent().clone(true).appendTo('.CMM_adminIconSelectSearch UL',iconDialog); }
});
// Hide list
if($('.CMM_adminIconSelectList',iconDialog).is(":visible"))
{ $('.CMM_adminIconSelectList',iconDialog).css('display','none'); }
}
else
{
// Show list
if($('.CMM_adminIconSelectList',iconDialog).is(":visible") == false)
{ $('.CMM_adminIconSelectList',iconDialog).css('display','block'); }
}
});
}
///////////////////////////////////////////////////////////////
// DAILOG icon-select: Set click handler to icons in tree
function RTE_iconSelectClick()
{
// Set dialog container
var iconDialog = $('#CMM_adminIconSelectRTE');
$('LI I',iconDialog).on('click',function(e){
// Prevent regular click
e.preventDefault();
// Seiten-ID aus Link ermitteln
iconTag = ' ';
// alert(iconTag);
// Seiten-ID an RTE-Browser-Dialog zurueck geben
RTE_returnIconTag(iconTag);
});
}
///////////////////////////////////////////////////////////////////
// DAILOG icon-select: Callback for icon-click
function RTE_returnIconTag(iconTag)
{
top.tinymce.activeEditor.execCommand('mceInsertContent', false, iconTag);
top.tinymce.activeEditor.windowManager.close();
}
///////////////////////////////////////////////////////////////////
// Init RTE
function CMM_initRTE(RTEs)
{
RTEs.tinymce({
script_url: "tinymce/tinymce.min.js",
content_css: [
"https://www.seniorenwerk.de/CMM/tinymce/css/content.css",
"https://www.seniorenwerk.de/CMM/fontawesome/css/font-awesome.min.css"
],
theme: "modern",
convert_urls: false,
language: "de",
schema: "html5",
skin: "lightgray",
border: true,
height: 200,
entity_encoding: "named",
allow_script_urls: true,
entities: "160,nbsp,162,cent,8364,euro,163,pound,173,shy",
extended_valid_elements: "@[itemprop|itemscope|itemtype|style|class|id|href|target|rel|accesskey|tabindex|title|alt|name|onclick|onmouseover|onmouseout|onchange|onblur|onkeyup|onkeypress],article,section,header,footer,video,audio,figure,img,picture,div,h1,h2,h3,h4,h5,h6,p,hr,input,select,textarea,ul,ol,li,dl,dd,dt,span,i,a,b,em,strong,small,big,time[datetime]",
file_browser_callback: function(field_name, url, type, win) {
currentFieldValue = win.document.getElementById(field_name).value;
var cmsURL = 'wizards/wizard-RTE-browser.php?type='+type+'&url='+url+'&field_name='+field_name+'&CMM_pageSelected='+currentFieldValue;
tinyMCE.activeEditor.windowManager.open({
url : cmsURL,
width : 420,
height: 420,
title: 'Browser',
resizable : true
}, {
oninsert: function(url) {
win.document.getElementById(field_name).value = url;
}
});
},
menubar: false,
plugins: "advlist anchor autolink charmap code colorpicker contextmenu emoticons hr image layer link lists media nonbreaking pagebreak paste preview print searchreplace table template textcolor visualblocks visualchars wordcount shy CMM_fontawesome",
toolbar1: "styleselect formatselect styleprops forecolor | insertfile undo redo | code visualchars | template",
toolbar2: "bold italic underline strikethrough superscript subscript | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent blockquote hr shy",
toolbar3: "cut copy paste cleanup removeformat | link unlink anchor table layer image media charmap CMM_fontawesome | cite abbr acronym del ins attribs",
textcolor_cols: 18,
textcolor_rows: 18,
textcolor_map: RTE_getColors(),
formats: {
alignleft: {
selector: "h1,h2,h3,h4,h5,h6,td,th,div,p,ul,ol,li,table,img",
classes: "alignLeft"
},
alignright: {
selector: "h1,h2,h3,h4,h5,h6,td,th,div,p,ul,ol,li,table,img",
classes: "alignRight"
},
aligncenter: {
selector: "h1,h2,h3,h4,h5,h6,td,th,div,p,ul,ol,li,table,img",
classes: "alignCenter"
},
alignjustify: {
selector: "h1,h2,h3,h4,h5,h6,td,th,div,p,ul,ol,li,table,img",
classes: "alignJustify"
}
},
style_formats: [
{
title: "Container",
items: [
{
title: "Initial",
inline: "span",
classes: "dropcap"
},
{
title: "Unternehmen",
selector: "p",
classes: "boxCompany"
},
{
title: "Person",
selector: "p",
classes: "boxPerson"
},
{
title: "Adresse",
selector: "p",
classes: "boxAddress"
},
{
title: "Kontakt",
selector: "p",
classes: "boxContact"
},
{
title: "Internet",
selector: "p",
classes: "boxInternet"
},
{
title: "Datum",
selector: "p",
classes: "boxDate"
},
{
title: "Zeit",
selector: "p",
classes: "boxTime"
}
]
},
{
title: "Colors",
items: [
{
title: "Mark 1",
inline: "span",
classes: "mark1"
},
{
title: "Mark 1 invers",
inline: "span",
classes: "mark1invert"
},
{
title: "Mark 2",
inline: "span",
classes: "mark2"
},
{
title: "Mark 2 invers",
inline: "span",
classes: "mark2invert"
},
{
title: "Mark 3",
inline: "span",
classes: "mark3"
},
{
title: "Mark 3 invers",
inline: "span",
classes: "mark3invert"
},
{
title: "Mark light",
inline: "span",
classes: "markLight"
},
{
title: "Mark light invers",
inline: "span",
classes: "markLightInvert"
},
{
title: "Mark dark",
inline: "span",
classes: "markDark"
},
{
title: "Mark dark invers",
inline: "span",
classes: "markDarkInvert"
}
]
},
{
title: "Prices",
items: [
{
title: "Price 1",
selector: "p",
classes: "price1"
},
{
title: "Price 2",
selector: "p",
classes: "price2"
},
{
title: "Price Subtext",
selector: "p",
classes: "priceSub"
}
]
},
{
title: "List",
items: [
{
title: "List Round",
selector: "ul",
classes: "listround"
},
{
title: "List Square",
selector: "ul",
classes: "listsquare"
},
{
title: "List Check",
selector: "ul",
classes: "listcheck"
},
{
title: "List Arrow",
selector: "ul",
classes: "listarrow"
},
{
title: "List Star",
selector: "ul",
classes: "liststar"
},
{
title: "List Asterisk",
selector: "ul",
classes: "listasterisk"
},
{
title: "List Plus",
selector: "ul",
classes: "listplus"
},
{
title: "List Minus",
selector: "ul",
classes: "listminus"
},
{
title: "List Lines",
selector: "ul",
classes: "listlines"
},
{
title: "List 2 cols",
selector: "ul",
classes: "list2cols"
},
{
title: "List 3 cols",
selector: "ul",
classes: "list3cols"
},
{
title: "List 4 cols",
selector: "ul",
classes: "list4cols"
}
]
},
{
title: "Numbers",
items: [
{
title: "Numbers Big",
selector: "ol",
classes: "listNumberBig"
},
{
title: "Numbers Round",
selector: "ol",
classes: "listNumberRound"
},
{
title: "Numbers Square",
selector: "ol",
classes: "listNumberSquare"
},
{
title: "Numbers Lines",
selector: "ol",
classes: "listlines"
},
{
title: "Numbers 2 cols",
selector: "ol",
classes: "list2cols"
},
{
title: "Numbers 3 cols",
selector: "ol",
classes: "list3cols"
},
{
title: "Numbers 4 cols",
selector: "ol",
classes: "list4cols"
}
]
},
{
title: "Tables",
items: [
{
title: "Table CV",
selector: "table",
classes: "tableCV"
}
]
},
{
title: "Buttons",
items: [
{
title: "Button",
selector: "a,span",
classes: "button"
},
{
title: "Button More",
selector: "a,span",
classes: "button buttonMore"
},
{
title: "Button Back",
selector: "a,span",
classes: "button buttonBack"
},
{
title: "Button Prev",
selector: "a,span",
classes: "button buttonPrev"
},
{
title: "Button Next",
selector: "a,span",
classes: "button buttonNext"
},
{
title: "Button Download",
selector: "a,span",
classes: "button buttonDownload"
},
{
title: "Button Contact",
selector: "a,span",
classes: "button buttonContact"
},
{
title: "Button Type 1",
selector: "a,span",
classes: "buttonType1"
},
{
title: "Button Type 2",
selector: "a,span",
classes: "buttonType2"
},
{
title: "Button Type 3",
selector: "a,span",
classes: "buttonType3"
},
{
title: "Button Size 1",
selector: "a,span",
classes: "buttonSize1"
},
{
title: "Button Size 2",
selector: "a,span",
classes: "buttonSize2"
},
{
title: "Button Size 3",
selector: "a,span",
classes: "buttonSize3"
},
{
title: "Button Size 4",
selector: "a,span",
classes: "buttonSize4"
},
{
title: "Button Size 5",
selector: "a,span",
classes: "buttonSize5"
},
{
title: "Button Full Width",
selector: "a,span",
classes: "buttonFullWidth"
}
]
},
{
title: "Links",
items: [
{
title: "Scroll to element",
selector: "a",
classes: "scrollTo"
},
{
title: "Lightbox",
selector: "a",
classes: "lightbox"
}
]
},
{
title: "Font size",
items: [
{
title: "",
inline: "small"
},
{
title: "",
inline: "big"
},
{
title: "X-Smaller",
selector: "h1,h2,3,h4,h5,h6,li,p,span,div",
classes: "x-smaller"
},
{
title: "Smaller",
selector: "h1,h2,3,h4,h5,h6,li,p,span,div",
classes: "smaller"
},
{
title: "Normal",
selector: "h1,h2,3,h4,h5,h6,li,p,span,div",
classes: "normal"
},
{
title: "Bigger",
selector: "h1,h2,3,h4,h5,h6,li,p,span,div",
classes: "bigger"
},
{
title: "X-Bigger",
selector: "h1,h2,3,h4,h5,h6,li,p,span,div",
classes: "x-bigger"
}
]
},
{
title: "Info-Boxes",
items: [
{
title: "Box 1",
selector: "p,div",
classes: "infoBox infoBox1"
},
{
title: "Box 2",
selector: "p,div",
classes: "infoBox infoBox2"
},
{
title: "Box 3",
selector: "p,div",
classes: "infoBox infoBox3"
}
]
}
],
templates: [
],
});
}