http://community.conpresso.de/viewtopic ... 7851#17851
jetzt selbst erfüllt.
Dazu editiert man editor.php wie folgt
== SUCHE ==
ca. Zeile 96/97
Code: Alles auswählen
</script>
<script src="<?php echo BASE_REL.'_editor/editor.js'; ?>" type="text/javascript"></script>
Code: Alles auswählen
function showClasses()
{
// remove all possible class elements from the class selector
for (var i=document.getElementById('class_select').length; i--; ) {
document.getElementById('class_select').remove(0);
}
// add empty option element
var newOption = document.createElement('option');
newOption.text = '';
newOption.value = '';
try {
document.getElementById('class_select').add(newOption, null); // standards compliant; doesn't work in IE
} catch(e) {
document.getElementById('class_select').add(newOption); // IE only
}
// add other option elements
for (var i=0; i<allowedStyles.length; i++) {
if (allowedStyles[i].charAt(0)!='.'
&& allowedStyles[i].substr(0, settingsNode.tagName.length).toLowerCase()!= settingsNode.tagName.toLowerCase()) continue;
var newOption = document.createElement('option');
newOption.text = allowedStyles[i];
newOption.value = allowedStyles[i].substring(allowedStyles[i].indexOf('.')+1);
try {
document.getElementById('class_select').add(newOption, null); // standards compliant; doesn't work in IE
} catch(e) {
document.getElementById('class_select').add(newOption); // IE only
}
}
}
Code: Alles auswählen
<body class="darker" style="margin: 0.5em;" onLoad="initializeEditor()">
Code: Alles auswählen
<body class="darker" style="margin: 0.5em;" onLoad="initializeEditor();showClasses()">
Code: Alles auswählen
<!-- -->
== DANACH, EINFÜGEN ==
Code: Alles auswählen
CSS-Klasse:
<script type="text/javascript">
var allowedStyles = new Array();
<?php
$a = explode(' ', $cpoSystem['editorCSS']);
sort($a);
foreach ($a as $v) {
if (empty($v)) continue;
echo 'allowedStyles.unshift(\''.$v.'\');';
}
?>
</script>
<input type="text" class="text" id="edit_universal_class" onChange="updateAttribute('class', this.value);" <?php
if (!empty($cpoSystem['editorCSS'])) echo 'style="display: none;"'; ?> />
<select id="class_select" onChange="updateAttribute('class', this.value);" <?php
if (empty($cpoSystem['editorCSS'])) echo 'style="display: none;"'; ?>>
</select>
<!-- -->