first re-commit.
180
sn_templates/editor_stuff/de.js
Normal file
@@ -0,0 +1,180 @@
|
||||
tinyMCE.addI18n({de:{
|
||||
common:{
|
||||
edit_confirm:"Wollen Sie diesen Textbereich mit WYSIWYG bearbeiten?",
|
||||
apply:"\u00DCbernehmen",
|
||||
insert:"Einf\u00FCgen",
|
||||
update:"Aktualisieren",
|
||||
cancel:"Abbrechen",
|
||||
close:"Schlie\u00DFen",
|
||||
browse:"Durchsuchen",
|
||||
class_name:"CSS-Klasse",
|
||||
not_set:"- unbestimmt -",
|
||||
clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\nM\u00F6chten Sie mehr \u00FCber dieses Problem erfahren?",
|
||||
clipboard_no_support:"Wird derzeit in Ihrem Browser nicht unterst\u00FCtzt. Bitte benutzen Sie stattdessen die Tastenk\u00FCrzel.",
|
||||
popup_blocked:"Leider hat Ihr Popup-Blocker ein Fenster unterbunden, das f\u00FCr den Betrieb dieses Programms n\u00F6tig ist. Bitte deaktivieren Sie den Popup-Blocker f\u00FCr diese Seite.",
|
||||
invalid_data:"Fehler: Sie haben ung\u00FCltige Werte eingegeben (rot markiert).",
|
||||
more_colors:"Weitere Farben"
|
||||
},
|
||||
contextmenu:{
|
||||
align:"Ausrichtung",
|
||||
left:"Linksb\u00FCndig",
|
||||
center:"Zentriert",
|
||||
right:"Rechtsb\u00FCndig",
|
||||
full:"Blocksatz"
|
||||
},
|
||||
insertdatetime:{
|
||||
date_fmt:"%d.%m.%Y",
|
||||
time_fmt:"%H:%M:%S",
|
||||
insertdate_desc:"Datum einf\u00FCgen",
|
||||
inserttime_desc:"Zeit einf\u00FCgen",
|
||||
months_long:"Januar,Februar,M\u00E4rz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",
|
||||
months_short:"Jan,Feb,M\u00E4r,Apr,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez",
|
||||
day_long:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag",
|
||||
day_short:"So,Mo,Di,Mi,Do,Fr,Sa,So"
|
||||
},
|
||||
print:{
|
||||
print_desc:"Drucken"
|
||||
},
|
||||
preview:{
|
||||
preview_desc:"Vorschau"
|
||||
},
|
||||
directionality:{
|
||||
ltr_desc:"Schrift von links nach rechts",
|
||||
rtl_desc:"Schrift von rechts nach links"
|
||||
},
|
||||
layer:{
|
||||
insertlayer_desc:"Neue Ebene einf\u00FCgen",
|
||||
forward_desc:"Nach vorne holen",
|
||||
backward_desc:"Nach hinten legen",
|
||||
absolute_desc:"Absolute Positionierung",
|
||||
content:"Neue Ebene..."
|
||||
},
|
||||
save:{
|
||||
save_desc:"Speichern",
|
||||
cancel_desc:"Alle \u00C4nderungen verwerfen"
|
||||
},
|
||||
nonbreaking:{
|
||||
nonbreaking_desc:"Gesch\u00FCtztes Leerzeichen einf\u00FCgen"
|
||||
},
|
||||
iespell:{
|
||||
iespell_desc:"Rechtschreibpr\u00FCfung",
|
||||
download:"ieSpell konnte nicht gefunden werden. Wollen Sie es installieren?"
|
||||
},
|
||||
advhr:{
|
||||
advhr_desc:"Trennlinie"
|
||||
},
|
||||
emotions:{
|
||||
emotions_desc:"Smilies"
|
||||
},
|
||||
searchreplace:{
|
||||
search_desc:"Suchen",
|
||||
replace_desc:"Suchen/Ersetzen"
|
||||
},
|
||||
advimage:{
|
||||
image_desc:"Bild einf\u00FCgen/ersetzen"
|
||||
},
|
||||
advlink:{
|
||||
link_desc:"Link einf\u00FCgen/bearbeiten"
|
||||
},
|
||||
xhtmlxtras:{
|
||||
cite_desc:"Quellenangabe",
|
||||
abbr_desc:"Abk\u00FCrzung",
|
||||
acronym_desc:"Akronym",
|
||||
del_desc:"Entfernter Text",
|
||||
ins_desc:"Eingef\u00FCgter Text",
|
||||
attribs_desc:"Attribute einf\u00FCgen/bearbeiten"
|
||||
},
|
||||
style:{
|
||||
desc:"CSS-Styles bearbeiten"
|
||||
},
|
||||
paste:{
|
||||
paste_text_desc:"Als normalen Text einf\u00FCgen",
|
||||
paste_word_desc:"Mit Formatierungen (aus Word) einf\u00FCgen",
|
||||
selectall_desc:"Alles ausw\u00E4hlen",
|
||||
plaintext_mode_sticky:"Einf\u00FCgemodus ist nun \"Nur Text\". Erneut klicken (oder das Einf\u00FCgen aus der Zwischenablage) stellt den Normalmodus wieder her.",
|
||||
plaintext_mode:"Einf\u00FCgemodus ist nun \"Nur Text\". Erneut klicken stellt den Normalmodus wieder her."
|
||||
},
|
||||
paste_dlg:{
|
||||
text_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen.",
|
||||
text_linebreaks:"Zeilenumbr\u00FCche beibehalten",
|
||||
word_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen."
|
||||
},
|
||||
table:{
|
||||
desc:"Tabelle erstellen/bearbeiten",
|
||||
row_before_desc:"Zeile oberhalb einf\u00FCgen",
|
||||
row_after_desc:"Zeile unterhalb einf\u00FCgen",
|
||||
delete_row_desc:"Zeile l\u00F6schen",
|
||||
col_before_desc:"Spalte links einf\u00FCgen",
|
||||
col_after_desc:"Spalte rechts einf\u00FCgen",
|
||||
delete_col_desc:"Spalte l\u00F6schen",
|
||||
split_cells_desc:"Verbundene Zellen trennen",
|
||||
merge_cells_desc:"Zellen verbinden",
|
||||
row_desc:"Eigenschaften der Zeile",
|
||||
cell_desc:"Eigenschaften der Zelle",
|
||||
props_desc:"Eigenschaften der Tabelle",
|
||||
paste_row_before_desc:"Zeile oberhalb aus der Zwischenablage einf\u00FCgen",
|
||||
paste_row_after_desc:"Zeile unterhalb aus der Zwischenablage einf\u00FCgen",
|
||||
cut_row_desc:"Zeile ausschneiden",
|
||||
copy_row_desc:"Zeile kopieren",
|
||||
del:"Tabelle l\u00F6schen",
|
||||
row:"Zeile",
|
||||
col:"Spalte",
|
||||
cell:"Zelle",
|
||||
cellprops_delta_width:"150"
|
||||
},
|
||||
autosave:{
|
||||
unload_msg:"Ihre \u00C4nderungen werden verloren gehen, wenn Sie die Seite verlassen.",
|
||||
restore_content:"Automatisch gespeicherten Inhalt wiederherstellen.",
|
||||
warning_message:"Wenn Sie den Inhalt wiederherstellen, gehen die aktuellen Daten im Editor verloren.\n\nSind sie sicher, dass Sie den Inhalt wiederherstellen m\u00F6chten?"
|
||||
},
|
||||
fullscreen:{
|
||||
desc:"Vollbildschirm"
|
||||
},
|
||||
media:{
|
||||
desc:"Multimedia einbetten/bearbeiten",
|
||||
edit:"Multimediaeinbettung bearbeiten"
|
||||
},
|
||||
fullpage:{
|
||||
desc:"Dokument-Eigenschaften"
|
||||
},
|
||||
template:{
|
||||
desc:"Inhalt aus Vorlage einf\u00FCgen"
|
||||
},
|
||||
visualchars:{
|
||||
desc:"Sichtbarkeit der Steuerzeichen an/aus"
|
||||
},
|
||||
spellchecker:{
|
||||
desc:"Rechtschreibpr\u00FCfung an/aus",
|
||||
menu:"Einstellungen der Rechtschreibpr\u00FCfung",
|
||||
ignore_word:"Wort ignorieren",
|
||||
ignore_words:"Alle ignorieren",
|
||||
langs:"Sprachen",
|
||||
wait:"Bitte warten...",
|
||||
sug:"Vorschl\u00E4ge",
|
||||
no_sug:"Keine Vorschl\u00E4ge",
|
||||
no_mpell:"Keine Rechtschreibfehler gefunden."
|
||||
},
|
||||
pagebreak:{
|
||||
desc:"Seitenumbruch einf\u00FCgen"
|
||||
},
|
||||
snstuff:{
|
||||
img_desc:"Bild einf\u00FCgen/ersetzen",
|
||||
lnk_desc:"Link einf\u00FCgen/ersetzen",
|
||||
code_desc:"Quelltext einf\u00FCgen",
|
||||
quote_desc:"Zitat einf\u00FCgen",
|
||||
proposals_desc:"Linkvorschl\u00E4ge einf\u00FCgen",
|
||||
infobox_desc:"Infobox einf\u00FCgen/bearbeiten",
|
||||
infoboxhead_desc:"Infobox \u00FCberschrift"
|
||||
},
|
||||
advlist:{
|
||||
types:"Typen",
|
||||
def:"Standard",
|
||||
lower_alpha:"a. b. c.",
|
||||
lower_greek:"1. 2. 3.",
|
||||
lower_roman:"i. ii. iii.",
|
||||
upper_alpha:"A. B. C.",
|
||||
upper_roman:"I. II. III.",
|
||||
circle:"Kreis",
|
||||
disc:"Punkt",
|
||||
square:"Quadrat"
|
||||
}}});
|
455
sn_templates/editor_stuff/plugin/advimagescale/editor_plugin.js
Normal file
@@ -0,0 +1,455 @@
|
||||
/**
|
||||
* TinyMCE Advanced Image Resize Helper Plugin
|
||||
*
|
||||
* Forces images to maintain aspect ratio while scaling - also optionally enforces
|
||||
* min/max image dimensions, and appends width/height to the image URL for server-side
|
||||
* resizing
|
||||
*
|
||||
* @author Marc Hodgins
|
||||
* @link http://www.hodginsmedia.com Hodgins Media Ventures Inc.
|
||||
* @copyright Copyright (C) 2008 Hodgins Media Ventures Inc., All right reserved.
|
||||
* @license http://www.opensource.org/licenses/lgpl-3.0.html LGPLv3
|
||||
*/
|
||||
(function() {
|
||||
|
||||
/**
|
||||
* Stores pre-resize image dimensions
|
||||
* @var {array} (w,h)
|
||||
*/
|
||||
var originalDimensions = new Array();
|
||||
|
||||
/**
|
||||
* Stores last dimensions before a resize
|
||||
* @var {array} (w,h)
|
||||
*/
|
||||
var lastDimensions = new Array();
|
||||
|
||||
/**
|
||||
* Track mousedown status in editor
|
||||
* @var {boolean}
|
||||
*/
|
||||
var edMouseDown = false;
|
||||
|
||||
tinymce.create('tinymce.plugins.AdvImageScale', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
|
||||
|
||||
// Watch for mousedown (as a fall through to ensure that prepareImage() definitely
|
||||
// got called on an image tag before mouseup).
|
||||
//
|
||||
// Normally this should have happened via the onPreProcess/onSetContent listeners, but
|
||||
// for completeness we check once more here in case there are edge cases we've missed.
|
||||
ed.onMouseDown.add(function(ed, e) {
|
||||
var el = tinyMCE.activeEditor.selection.getNode();
|
||||
if (el.nodeName == 'IMG') {
|
||||
// prepare image for resizing
|
||||
prepareImage(ed, e.target);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// Watch for mouseup (catch image resizes)
|
||||
ed.onMouseUp.add(function(ed, e) {
|
||||
var el = tinyMCE.activeEditor.selection.getNode();
|
||||
if (el.nodeName == 'IMG') {
|
||||
// setTimeout is necessary to allow the browser to complete the resize so we have new dimensions
|
||||
setTimeout(function() {
|
||||
constrainSize(ed, el);
|
||||
}, 100);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
/*****************************************************
|
||||
* ENFORCE CONSTRAINTS ON CONTENT INSERTED INTO EDITOR
|
||||
*****************************************************/
|
||||
|
||||
// Catch editor.setContent() events via onPreProcess (because onPreProcess allows us to
|
||||
// modify the DOM before it is inserted, unlike onSetContent)
|
||||
ed.onPreProcess.add(function(ed, o) {
|
||||
if (!o.set) return; // only 'set' operations let us modify the nodes
|
||||
|
||||
// loop in each img node and run constrainSize
|
||||
tinymce.each(ed.dom.select('img', o.node), function(currentNode) {
|
||||
constrainSize(ed, currentNode);
|
||||
});
|
||||
});
|
||||
|
||||
// To be complete, we also need to watch for setContent() calls on the selection object so that
|
||||
// constraints are enforced (i.e. in case an <img> tag is inserted via mceInsertContent).
|
||||
// So, catch all insertions using the editor's selection object
|
||||
ed.onInit.add(function(ed) {
|
||||
// http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.dom.Selection/onSetContent
|
||||
ed.selection.onSetContent.add(function(se, o) {
|
||||
// @todo This seems to grab the entire editor contents - it works but could
|
||||
// perform poorly on large documents
|
||||
var currentNode = se.getNode();
|
||||
tinymce.each(ed.dom.select('img', currentNode), function (currentNode) {
|
||||
// IF condition required as tinyMCE inserts 24x24 placeholders uner some conditions
|
||||
if (currentNode.id != "__mce_tmp")
|
||||
constrainSize(ed, currentNode);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*****************************
|
||||
* DISALLOW EXTERNAL IMAGE DRAG/DROPS
|
||||
*****************************/
|
||||
// This is a hack. Listening for drag events wasn't working.
|
||||
//
|
||||
// Watches for mousedown and mouseup/dragdrop events within the editor. If a mouseup or
|
||||
// dragdrop occurs in the editor without a preceeding mousedown, we assume it is an external
|
||||
// dragdrop that should be rejected.
|
||||
if (ed.getParam('advimagescale_reject_external_dragdrop', true)) {
|
||||
|
||||
// catch mousedowns mouseups and dragdrops (which are basically mouseups too..)
|
||||
ed.onMouseDown.add(function(e) { edMouseDown = true; });
|
||||
ed.onMouseUp.add(function(e) { edMouseDown = false; });
|
||||
ed.onInit.add(function(ed, o) {
|
||||
tinymce.dom.Event.add(ed.getBody().parentNode, 'dragdrop', function(e) { edMouseDown = false; });
|
||||
});
|
||||
|
||||
// watch for drag attempts
|
||||
var evt = (tinymce.isIE) ? 'dragenter' : 'dragover'; // IE allows dragdrop reject on dragenter (more efficient)
|
||||
ed.onInit.add(function(ed, o) {
|
||||
// use parentNode to go above editor content, to cover entire editor area
|
||||
tinymce.dom.Event.add(ed.getBody().parentNode, evt, function (e) {
|
||||
if (!edMouseDown) {
|
||||
// disallow drop
|
||||
return tinymce.dom.Event.cancel(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced Image Resize Helper',
|
||||
author : 'Marc Hodgins',
|
||||
authorurl : 'http://www.hodginsmedia.com',
|
||||
infourl : 'http://code.google.com/p/tinymce-plugin-advimagescale',
|
||||
version : '1.1.2'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('advimagescale', tinymce.plugins.AdvImageScale);
|
||||
|
||||
/**
|
||||
* Store image dimensions, pre-resize
|
||||
*
|
||||
* @param {object} el HTMLDomNode
|
||||
*/
|
||||
function storeDimensions(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId = dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// store original dimensions if this is the first resize of this element
|
||||
if (!originalDimensions[elId]) {
|
||||
originalDimensions[elId] = lastDimensions[elId] = {width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height)};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare image for resizing
|
||||
* Check to see if we've seen this IMG tag before; does tasks such as adding
|
||||
* unique IDs to image tags, saving "original" image dimensions, etc.
|
||||
* @param {object} e is optional
|
||||
*/
|
||||
function prepareImage(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId= dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// is this the first time this image tag has been seen?
|
||||
if (!elId) {
|
||||
var elId = ed.dom.uniqueId();
|
||||
dom.setAttrib(el, 'mce_advimageresize_id', elId);
|
||||
storeDimensions(ed, el);
|
||||
}
|
||||
|
||||
return elId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts width and height to keep within min/max bounds and also maintain aspect ratio
|
||||
* If mce_noresize attribute is set to image tag, then image resize is disallowed
|
||||
*/
|
||||
function constrainSize(ed, el, e) {
|
||||
var dom = ed.dom;
|
||||
var elId = prepareImage(ed, el); // also calls storeDimensions
|
||||
var resized = (dom.getAttrib(el, 'width') != lastDimensions[elId].width || dom.getAttrib(el, 'height') != lastDimensions[elId].height);
|
||||
|
||||
if (!resized)
|
||||
return; // nothing to do
|
||||
|
||||
// disallow image resize if mce_noresize or the noresize class is set on the image tag
|
||||
if (dom.getAttrib(el, 'mce_noresize') || dom.hasClass(el, ed.getParam('advimagescale_noresize_class', 'noresize')) || ed.getParam('advimagescale_noresize_all')) {
|
||||
dom.setAttrib(el, 'width', lastDimensions[elId].width);
|
||||
dom.setAttrib(el, 'height', lastDimensions[elId].height);
|
||||
if (tinymce.isGecko)
|
||||
fixGeckoHandles(ed);
|
||||
return;
|
||||
}
|
||||
|
||||
// Both IE7 and Gecko (as of FF3.0.03) has a "expands image by border width" bug before doing anything else
|
||||
if (ed.getParam('advimagescale_fix_border_glitch', true /* default to true */)) {
|
||||
fixImageBorderGlitch(ed, el);
|
||||
storeDimensions(ed, el); // store adjusted dimensions
|
||||
}
|
||||
|
||||
// filter by regexp so only some images get constrained
|
||||
var src_filter = ed.getParam('advimagescale_filter_src');
|
||||
if (src_filter) {
|
||||
var r = new RegExp(src_filter);
|
||||
if (!el.src.match(r)) {
|
||||
return; // skip this element
|
||||
}
|
||||
}
|
||||
|
||||
// allow filtering by classname
|
||||
var class_filter = ed.getParam('advimagescale_filter_class');
|
||||
if (class_filter) {
|
||||
if (!dom.hasClass(el, class_filter)) {
|
||||
return; // skip this element, doesn't have the class we want
|
||||
}
|
||||
}
|
||||
|
||||
// populate new dimensions object
|
||||
var newDimensions = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) };
|
||||
|
||||
// adjust w/h to maintain aspect ratio
|
||||
if (ed.getParam('advimagescale_maintain_aspect_ratio', true /* default to true */)) {
|
||||
newDimensions = maintainAspect(ed, el, newDimensions.width, newDimensions.height);
|
||||
}
|
||||
|
||||
// enforce minW/minH/maxW/maxH
|
||||
newDimensions = checkBoundaries(ed, el, newDimensions.width, newDimensions.height);
|
||||
|
||||
// was an adjustment made?
|
||||
var adjusted = (dom.getAttrib(el, 'width', el.width) != newDimensions.width || dom.getAttrib(el, 'height', el.height) != newDimensions.height);
|
||||
|
||||
// apply new w/h
|
||||
if (adjusted) {
|
||||
dom.setAttrib(el, 'width', newDimensions.width);
|
||||
dom.setAttrib(el, 'height', newDimensions.height);
|
||||
if (tinymce.isGecko) fixGeckoHandles(ed);
|
||||
}
|
||||
|
||||
if (ed.getParam('advimagescale_append_to_url')) {
|
||||
appendToUri(ed, el, dom.getAttrib(el, 'width', el.width), dom.getAttrib(el, 'height', el.height));
|
||||
}
|
||||
|
||||
// was the image resized?
|
||||
if (lastDimensions[elId].width != dom.getAttrib(el, 'width', el.width) || lastDimensions[elId].height != dom.getAttrib(el, 'height', el.height)) {
|
||||
// call "image resized" callback (if set)
|
||||
if (ed.getParam('advimagescale_resize_callback')) {
|
||||
ed.getParam('advimagescale_resize_callback')(ed, el);
|
||||
}
|
||||
}
|
||||
|
||||
// remember "last dimensions" for next time
|
||||
lastDimensions[elId] = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) };
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes IE7 and Gecko border width glitch
|
||||
*
|
||||
* Both "add" the border width to an image after the resize handles have been
|
||||
* dropped. This reverses it by looking at the "previous" known size and comparing
|
||||
* to the current size. If they don't match, then a resize has taken place and the browser
|
||||
* has (probably) messed it up. So, we reverse it. Note, this will probably need to be
|
||||
* wrapped in a conditional statement if/when each browser fixes this bug.
|
||||
*/
|
||||
function fixImageBorderGlitch(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId = dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
var currentWidth = dom.getAttrib(el, 'width', el.width);
|
||||
var currentHeight= dom.getAttrib(el, 'height', el.height);
|
||||
var adjusted = false;
|
||||
|
||||
// if current dimensions do not match what we last saw, then a resize has taken place
|
||||
if (currentWidth != lastDimensions[elId].width) {
|
||||
var adjustWidth = 0;
|
||||
|
||||
// get computed border left/right widths
|
||||
adjustWidth += parseInt(dom.getStyle(el, 'borderLeftWidth', 'borderLeftWidth'));
|
||||
adjustWidth += parseInt(dom.getStyle(el, 'borderRightWidth', 'borderRightWidth'));
|
||||
|
||||
// reset the width height to NOT include these amounts
|
||||
if (adjustWidth > 0) {
|
||||
dom.setAttrib(el, 'width', (currentWidth - adjustWidth));
|
||||
adjusted = true;
|
||||
}
|
||||
}
|
||||
if (currentHeight != lastDimensions[elId].height) {
|
||||
var adjustHeight = 0;
|
||||
|
||||
// get computed border top/bottom widths
|
||||
adjustHeight += parseInt(dom.getStyle(el, 'borderTopWidth', 'borderTopWidth'));
|
||||
adjustHeight += parseInt(dom.getStyle(el, 'borderBottomWidth', 'borderBottomWidth'));
|
||||
|
||||
if (adjustHeight > 0) {
|
||||
dom.setAttrib(el, 'height', (currentHeight - adjustHeight));
|
||||
adjusted = true;
|
||||
}
|
||||
}
|
||||
if (adjusted && tinymce.isGecko) fixGeckoHandles(ed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix gecko resize handles glitch
|
||||
*/
|
||||
function fixGeckoHandles(ed) {
|
||||
ed.execCommand('mceRepaint', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set image dimensions on into a uri as querystring params
|
||||
*/
|
||||
function appendToUri(ed, el, w, h) {
|
||||
var dom = ed.dom;
|
||||
var uri = dom.getAttrib(el, 'src');
|
||||
var wKey = ed.getParam('advimagescale_url_width_key', 'w');
|
||||
uri = setQueryParam(uri, wKey, w);
|
||||
var hKey = ed.getParam('advimagescale_url_height_key', 'h');
|
||||
uri = setQueryParam(uri, hKey, h);
|
||||
|
||||
// no need to continue if URL didn't change
|
||||
if (uri == dom.getAttrib(el, 'src')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trigger image loading callback (if set)
|
||||
if (ed.getParam('advimagescale_loading_callback')) {
|
||||
// call loading callback
|
||||
ed.getParam('advimagescale_loading_callback')(el);
|
||||
}
|
||||
// hook image load(ed) callback (if set)
|
||||
if (ed.getParam('advimagescale_loaded_callback')) {
|
||||
// hook load event on the image tag to call the loaded callback
|
||||
tinymce.dom.Event.add(el, 'load', imageLoadedCallback, {el: el, ed: ed});
|
||||
}
|
||||
|
||||
// set new src
|
||||
dom.setAttrib(el, 'src', uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback event when an image is (re)loaded
|
||||
* @param {object} e Event (use e.target or this.el to access element, this.ed to access editor instance)
|
||||
*/
|
||||
function imageLoadedCallback(e) {
|
||||
var el = this.el; // image element
|
||||
var ed = this.ed; // editor
|
||||
var callback = ed.getParam('advimagescale_loaded_callback'); // user specified callback
|
||||
|
||||
// call callback, pass img as param
|
||||
callback(el);
|
||||
|
||||
// remove callback event
|
||||
tinymce.dom.Event.remove(el, 'load', imageLoadedCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets URL querystring parameters by appending or replacing existing params of same name
|
||||
*/
|
||||
function setQueryParam(uri, key, value) {
|
||||
if (!uri.match(/\?/)) uri += '?';
|
||||
if (!uri.match(new RegExp('([\?&])' + key + '='))) {
|
||||
if (!uri.match(/[&\?]$/)) uri += '&';
|
||||
uri += key + '=' + escape(value);
|
||||
} else {
|
||||
uri = uri.replace(new RegExp('([\?\&])' + key + '=[^&]*'), '$1' + key + '=' + escape(value));
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns w/h that maintain aspect ratio
|
||||
*/
|
||||
function maintainAspect(ed, el, w, h) {
|
||||
var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// calculate aspect ratio of original so we can maintain it
|
||||
var ratio = originalDimensions[elId].width / originalDimensions[elId].height;
|
||||
|
||||
// decide which dimension changed more (percentage), because that's the
|
||||
// one we'll respect (the other we'll adjust to keep aspect ratio)
|
||||
var lastW = lastDimensions[elId].width;
|
||||
var lastH = lastDimensions[elId].height;
|
||||
var deltaW = Math.abs(lastW - w); // absolute
|
||||
var deltaH = Math.abs(lastH - h); // absolute
|
||||
var pctW = Math.abs(deltaW / lastW); // percentage
|
||||
var pctH = Math.abs(deltaH / lastH); // percentage
|
||||
|
||||
if (deltaW || deltaH) {
|
||||
if (pctW > pctH) {
|
||||
// width changed more - use that as the locked point and adjust height
|
||||
return { width: w, height: Math.round(w / ratio) };
|
||||
} else {
|
||||
// height changed more - use that as the locked point and adjust width
|
||||
return { width: Math.round(h * ratio), height: h };
|
||||
}
|
||||
}
|
||||
|
||||
// nothing changed
|
||||
return { width: w, height: h };
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce min/max boundaries
|
||||
*
|
||||
* Returns true if an adjustment was made
|
||||
*/
|
||||
function checkBoundaries(ed, el, w, h) {
|
||||
|
||||
var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
var maxW = ed.getParam('advimagescale_max_width');
|
||||
var maxH = ed.getParam('advimagescale_max_height');
|
||||
var minW = ed.getParam('advimagescale_min_width');
|
||||
var minH = ed.getParam('advimagescale_min_height');
|
||||
var maintainAspect = ed.getParam('advimagescale_maintain_aspect_ratio', true);
|
||||
var oW = originalDimensions[elId].width;
|
||||
var oH = originalDimensions[elId].height;
|
||||
var ratio = oW/oH;
|
||||
|
||||
// max
|
||||
if (maxW && w > maxW) {
|
||||
w = maxW;
|
||||
h = maintainAspect ? Math.round(w / ratio) : h;
|
||||
}
|
||||
if (maxH && h > maxH) {
|
||||
h = maxH;
|
||||
w = maintainAspect ? Math.round(h * ratio) : w;
|
||||
}
|
||||
|
||||
// min
|
||||
if (minW && w < minW) {
|
||||
w = minW;
|
||||
h = maintainAspect ? Math.round(w / ratio) : h;
|
||||
}
|
||||
if (minH && h < minH) {
|
||||
h = minH;
|
||||
w = maintainAspect ? Math.round(h * ratio) : h;
|
||||
}
|
||||
|
||||
return { width: w, height:h };
|
||||
}
|
||||
|
||||
})();
|
@@ -0,0 +1,454 @@
|
||||
/**
|
||||
* TinyMCE Advanced Image Resize Helper Plugin
|
||||
*
|
||||
* Forces images to maintain aspect ratio while scaling - also optionally enforces
|
||||
* min/max image dimensions, and appends width/height to the image URL for server-side
|
||||
* resizing
|
||||
*
|
||||
* @author Marc Hodgins
|
||||
* @link http://www.hodginsmedia.com Hodgins Media Ventures Inc.
|
||||
* @copyright Copyright (C) 2008 Hodgins Media Ventures Inc., All right reserved.
|
||||
* @license http://www.opensource.org/licenses/lgpl-3.0.html LGPLv3
|
||||
*/
|
||||
(function() {
|
||||
|
||||
/**
|
||||
* Stores pre-resize image dimensions
|
||||
* @var {array} (w,h)
|
||||
*/
|
||||
var originalDimensions = new Array();
|
||||
|
||||
/**
|
||||
* Stores last dimensions before a resize
|
||||
* @var {array} (w,h)
|
||||
*/
|
||||
var lastDimensions = new Array();
|
||||
|
||||
/**
|
||||
* Track mousedown status in editor
|
||||
* @var {boolean}
|
||||
*/
|
||||
var edMouseDown = false;
|
||||
|
||||
tinymce.create('tinymce.plugins.AdvImageScale', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
|
||||
// Watch for mousedown (as a fall through to ensure that prepareImage() definitely
|
||||
// got called on an image tag before mouseup).
|
||||
//
|
||||
// Normally this should have happened via the onPreProcess/onSetContent listeners, but
|
||||
// for completeness we check once more here in case there are edge cases we've missed.
|
||||
ed.onMouseDown.add(function(ed, e) {
|
||||
var el = tinyMCE.activeEditor.selection.getNode();
|
||||
if (el.nodeName == 'IMG') {
|
||||
// prepare image for resizing
|
||||
prepareImage(ed, e.target);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// Watch for mouseup (catch image resizes)
|
||||
ed.onMouseUp.add(function(ed, e) {
|
||||
var el = tinyMCE.activeEditor.selection.getNode();
|
||||
if (el.nodeName == 'IMG') {
|
||||
// setTimeout is necessary to allow the browser to complete the resize so we have new dimensions
|
||||
setTimeout(function() {
|
||||
constrainSize(ed, el);
|
||||
}, 100);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
/*****************************************************
|
||||
* ENFORCE CONSTRAINTS ON CONTENT INSERTED INTO EDITOR
|
||||
*****************************************************/
|
||||
|
||||
// Catch editor.setContent() events via onPreProcess (because onPreProcess allows us to
|
||||
// modify the DOM before it is inserted, unlike onSetContent)
|
||||
ed.onPreProcess.add(function(ed, o) {
|
||||
if (!o.set) return; // only 'set' operations let us modify the nodes
|
||||
|
||||
// loop in each img node and run constrainSize
|
||||
tinymce.each(ed.dom.select('img', o.node), function(currentNode) {
|
||||
constrainSize(ed, currentNode);
|
||||
});
|
||||
});
|
||||
|
||||
// To be complete, we also need to watch for setContent() calls on the selection object so that
|
||||
// constraints are enforced (i.e. in case an <img> tag is inserted via mceInsertContent).
|
||||
// So, catch all insertions using the editor's selection object
|
||||
ed.onInit.add(function(ed) {
|
||||
// http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.dom.Selection/onSetContent
|
||||
ed.selection.onSetContent.add(function(se, o) {
|
||||
// @todo This seems to grab the entire editor contents - it works but could
|
||||
// perform poorly on large documents
|
||||
var currentNode = se.getNode();
|
||||
tinymce.each(ed.dom.select('img', currentNode), function (currentNode) {
|
||||
// IF condition required as tinyMCE inserts 24x24 placeholders uner some conditions
|
||||
if (currentNode.id != "__mce_tmp")
|
||||
constrainSize(ed, currentNode);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*****************************
|
||||
* DISALLOW EXTERNAL IMAGE DRAG/DROPS
|
||||
*****************************/
|
||||
// This is a hack. Listening for drag events wasn't working.
|
||||
//
|
||||
// Watches for mousedown and mouseup/dragdrop events within the editor. If a mouseup or
|
||||
// dragdrop occurs in the editor without a preceeding mousedown, we assume it is an external
|
||||
// dragdrop that should be rejected.
|
||||
if (ed.getParam('advimagescale_reject_external_dragdrop', true)) {
|
||||
|
||||
// catch mousedowns mouseups and dragdrops (which are basically mouseups too..)
|
||||
ed.onMouseDown.add(function(e) { edMouseDown = true; });
|
||||
ed.onMouseUp.add(function(e) { edMouseDown = false; });
|
||||
ed.onInit.add(function(ed, o) {
|
||||
tinymce.dom.Event.add(ed.getBody().parentNode, 'dragdrop', function(e) { edMouseDown = false; });
|
||||
});
|
||||
|
||||
// watch for drag attempts
|
||||
var evt = (tinymce.isIE) ? 'dragenter' : 'dragover'; // IE allows dragdrop reject on dragenter (more efficient)
|
||||
ed.onInit.add(function(ed, o) {
|
||||
// use parentNode to go above editor content, to cover entire editor area
|
||||
tinymce.dom.Event.add(ed.getBody().parentNode, evt, function (e) {
|
||||
if (!edMouseDown) {
|
||||
// disallow drop
|
||||
return tinymce.dom.Event.cancel(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced Image Resize Helper',
|
||||
author : 'Marc Hodgins',
|
||||
authorurl : 'http://www.hodginsmedia.com',
|
||||
infourl : 'http://code.google.com/p/tinymce-plugin-advimagescale',
|
||||
version : '1.1.2'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('advimagescale', tinymce.plugins.AdvImageScale);
|
||||
|
||||
/**
|
||||
* Store image dimensions, pre-resize
|
||||
*
|
||||
* @param {object} el HTMLDomNode
|
||||
*/
|
||||
function storeDimensions(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId = dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// store original dimensions if this is the first resize of this element
|
||||
if (!originalDimensions[elId]) {
|
||||
originalDimensions[elId] = lastDimensions[elId] = {width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height)};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare image for resizing
|
||||
* Check to see if we've seen this IMG tag before; does tasks such as adding
|
||||
* unique IDs to image tags, saving "original" image dimensions, etc.
|
||||
* @param {object} e is optional
|
||||
*/
|
||||
function prepareImage(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId= dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// is this the first time this image tag has been seen?
|
||||
if (!elId) {
|
||||
var elId = ed.dom.uniqueId();
|
||||
dom.setAttrib(el, 'mce_advimageresize_id', elId);
|
||||
storeDimensions(ed, el);
|
||||
}
|
||||
|
||||
return elId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts width and height to keep within min/max bounds and also maintain aspect ratio
|
||||
* If mce_noresize attribute is set to image tag, then image resize is disallowed
|
||||
*/
|
||||
function constrainSize(ed, el, e) {
|
||||
var dom = ed.dom;
|
||||
var elId = prepareImage(ed, el); // also calls storeDimensions
|
||||
var resized = (dom.getAttrib(el, 'width') != lastDimensions[elId].width || dom.getAttrib(el, 'height') != lastDimensions[elId].height);
|
||||
|
||||
if (!resized)
|
||||
return; // nothing to do
|
||||
|
||||
// disallow image resize if mce_noresize or the noresize class is set on the image tag
|
||||
if (dom.getAttrib(el, 'mce_noresize') || dom.hasClass(el, ed.getParam('advimagescale_noresize_class', 'noresize')) || ed.getParam('advimagescale_noresize_all')) {
|
||||
dom.setAttrib(el, 'width', lastDimensions[elId].width);
|
||||
dom.setAttrib(el, 'height', lastDimensions[elId].height);
|
||||
if (tinymce.isGecko)
|
||||
fixGeckoHandles(ed);
|
||||
return;
|
||||
}
|
||||
|
||||
// Both IE7 and Gecko (as of FF3.0.03) has a "expands image by border width" bug before doing anything else
|
||||
if (ed.getParam('advimagescale_fix_border_glitch', true /* default to true */)) {
|
||||
fixImageBorderGlitch(ed, el);
|
||||
storeDimensions(ed, el); // store adjusted dimensions
|
||||
}
|
||||
|
||||
// filter by regexp so only some images get constrained
|
||||
var src_filter = ed.getParam('advimagescale_filter_src');
|
||||
if (src_filter) {
|
||||
var r = new RegExp(src_filter);
|
||||
if (!el.src.match(r)) {
|
||||
return; // skip this element
|
||||
}
|
||||
}
|
||||
|
||||
// allow filtering by classname
|
||||
var class_filter = ed.getParam('advimagescale_filter_class');
|
||||
if (class_filter) {
|
||||
if (!dom.hasClass(el, class_filter)) {
|
||||
return; // skip this element, doesn't have the class we want
|
||||
}
|
||||
}
|
||||
|
||||
// populate new dimensions object
|
||||
var newDimensions = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) };
|
||||
|
||||
// adjust w/h to maintain aspect ratio
|
||||
if (ed.getParam('advimagescale_maintain_aspect_ratio', true /* default to true */)) {
|
||||
newDimensions = maintainAspect(ed, el, newDimensions.width, newDimensions.height);
|
||||
}
|
||||
|
||||
// enforce minW/minH/maxW/maxH
|
||||
newDimensions = checkBoundaries(ed, el, newDimensions.width, newDimensions.height);
|
||||
|
||||
// was an adjustment made?
|
||||
var adjusted = (dom.getAttrib(el, 'width', el.width) != newDimensions.width || dom.getAttrib(el, 'height', el.height) != newDimensions.height);
|
||||
|
||||
// apply new w/h
|
||||
if (adjusted) {
|
||||
dom.setAttrib(el, 'width', newDimensions.width);
|
||||
dom.setAttrib(el, 'height', newDimensions.height);
|
||||
if (tinymce.isGecko) fixGeckoHandles(ed);
|
||||
}
|
||||
|
||||
if (ed.getParam('advimagescale_append_to_url')) {
|
||||
appendToUri(ed, el, dom.getAttrib(el, 'width', el.width), dom.getAttrib(el, 'height', el.height));
|
||||
}
|
||||
|
||||
// was the image resized?
|
||||
if (lastDimensions[elId].width != dom.getAttrib(el, 'width', el.width) || lastDimensions[elId].height != dom.getAttrib(el, 'height', el.height)) {
|
||||
// call "image resized" callback (if set)
|
||||
if (ed.getParam('advimagescale_resize_callback')) {
|
||||
ed.getParam('advimagescale_resize_callback')(ed, el);
|
||||
}
|
||||
}
|
||||
|
||||
// remember "last dimensions" for next time
|
||||
lastDimensions[elId] = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) };
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes IE7 and Gecko border width glitch
|
||||
*
|
||||
* Both "add" the border width to an image after the resize handles have been
|
||||
* dropped. This reverses it by looking at the "previous" known size and comparing
|
||||
* to the current size. If they don't match, then a resize has taken place and the browser
|
||||
* has (probably) messed it up. So, we reverse it. Note, this will probably need to be
|
||||
* wrapped in a conditional statement if/when each browser fixes this bug.
|
||||
*/
|
||||
function fixImageBorderGlitch(ed, el) {
|
||||
var dom = ed.dom;
|
||||
var elId = dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
var currentWidth = dom.getAttrib(el, 'width', el.width);
|
||||
var currentHeight= dom.getAttrib(el, 'height', el.height);
|
||||
var adjusted = false;
|
||||
|
||||
// if current dimensions do not match what we last saw, then a resize has taken place
|
||||
if (currentWidth != lastDimensions[elId].width) {
|
||||
var adjustWidth = 0;
|
||||
|
||||
// get computed border left/right widths
|
||||
adjustWidth += parseInt(dom.getStyle(el, 'borderLeftWidth', 'borderLeftWidth'));
|
||||
adjustWidth += parseInt(dom.getStyle(el, 'borderRightWidth', 'borderRightWidth'));
|
||||
|
||||
// reset the width height to NOT include these amounts
|
||||
if (adjustWidth > 0) {
|
||||
dom.setAttrib(el, 'width', (currentWidth - adjustWidth));
|
||||
adjusted = true;
|
||||
}
|
||||
}
|
||||
if (currentHeight != lastDimensions[elId].height) {
|
||||
var adjustHeight = 0;
|
||||
|
||||
// get computed border top/bottom widths
|
||||
adjustHeight += parseInt(dom.getStyle(el, 'borderTopWidth', 'borderTopWidth'));
|
||||
adjustHeight += parseInt(dom.getStyle(el, 'borderBottomWidth', 'borderBottomWidth'));
|
||||
|
||||
if (adjustHeight > 0) {
|
||||
dom.setAttrib(el, 'height', (currentHeight - adjustHeight));
|
||||
adjusted = true;
|
||||
}
|
||||
}
|
||||
if (adjusted && tinymce.isGecko) fixGeckoHandles(ed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix gecko resize handles glitch
|
||||
*/
|
||||
function fixGeckoHandles(ed) {
|
||||
ed.execCommand('mceRepaint', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set image dimensions on into a uri as querystring params
|
||||
*/
|
||||
function appendToUri(ed, el, w, h) {
|
||||
var dom = ed.dom;
|
||||
var uri = dom.getAttrib(el, 'src');
|
||||
var wKey = ed.getParam('advimagescale_url_width_key', 'w');
|
||||
uri = setQueryParam(uri, wKey, w);
|
||||
var hKey = ed.getParam('advimagescale_url_height_key', 'h');
|
||||
uri = setQueryParam(uri, hKey, h);
|
||||
|
||||
// no need to continue if URL didn't change
|
||||
if (uri == dom.getAttrib(el, 'src')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trigger image loading callback (if set)
|
||||
if (ed.getParam('advimagescale_loading_callback')) {
|
||||
// call loading callback
|
||||
ed.getParam('advimagescale_loading_callback')(el);
|
||||
}
|
||||
// hook image load(ed) callback (if set)
|
||||
if (ed.getParam('advimagescale_loaded_callback')) {
|
||||
// hook load event on the image tag to call the loaded callback
|
||||
tinymce.dom.Event.add(el, 'load', imageLoadedCallback, {el: el, ed: ed});
|
||||
}
|
||||
|
||||
// set new src
|
||||
dom.setAttrib(el, 'src', uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback event when an image is (re)loaded
|
||||
* @param {object} e Event (use e.target or this.el to access element, this.ed to access editor instance)
|
||||
*/
|
||||
function imageLoadedCallback(e) {
|
||||
var el = this.el; // image element
|
||||
var ed = this.ed; // editor
|
||||
var callback = ed.getParam('advimagescale_loaded_callback'); // user specified callback
|
||||
|
||||
// call callback, pass img as param
|
||||
callback(el);
|
||||
|
||||
// remove callback event
|
||||
tinymce.dom.Event.remove(el, 'load', imageLoadedCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets URL querystring parameters by appending or replacing existing params of same name
|
||||
*/
|
||||
function setQueryParam(uri, key, value) {
|
||||
if (!uri.match(/\?/)) uri += '?';
|
||||
if (!uri.match(new RegExp('([\?&])' + key + '='))) {
|
||||
if (!uri.match(/[&\?]$/)) uri += '&';
|
||||
uri += key + '=' + escape(value);
|
||||
} else {
|
||||
uri = uri.replace(new RegExp('([\?\&])' + key + '=[^&]*'), '$1' + key + '=' + escape(value));
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns w/h that maintain aspect ratio
|
||||
*/
|
||||
function maintainAspect(ed, el, w, h) {
|
||||
var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
|
||||
// calculate aspect ratio of original so we can maintain it
|
||||
var ratio = originalDimensions[elId].width / originalDimensions[elId].height;
|
||||
|
||||
// decide which dimension changed more (percentage), because that's the
|
||||
// one we'll respect (the other we'll adjust to keep aspect ratio)
|
||||
var lastW = lastDimensions[elId].width;
|
||||
var lastH = lastDimensions[elId].height;
|
||||
var deltaW = Math.abs(lastW - w); // absolute
|
||||
var deltaH = Math.abs(lastH - h); // absolute
|
||||
var pctW = Math.abs(deltaW / lastW); // percentage
|
||||
var pctH = Math.abs(deltaH / lastH); // percentage
|
||||
|
||||
if (deltaW || deltaH) {
|
||||
if (pctW > pctH) {
|
||||
// width changed more - use that as the locked point and adjust height
|
||||
return { width: w, height: Math.round(w / ratio) };
|
||||
} else {
|
||||
// height changed more - use that as the locked point and adjust width
|
||||
return { width: Math.round(h * ratio), height: h };
|
||||
}
|
||||
}
|
||||
|
||||
// nothing changed
|
||||
return { width: w, height: h };
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforce min/max boundaries
|
||||
*
|
||||
* Returns true if an adjustment was made
|
||||
*/
|
||||
function checkBoundaries(ed, el, w, h) {
|
||||
|
||||
var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id');
|
||||
var maxW = ed.getParam('advimagescale_max_width');
|
||||
var maxH = ed.getParam('advimagescale_max_height');
|
||||
var minW = ed.getParam('advimagescale_min_width');
|
||||
var minH = ed.getParam('advimagescale_min_height');
|
||||
var maintainAspect = ed.getParam('advimagescale_maintain_aspect_ratio', true);
|
||||
var oW = originalDimensions[elId].width;
|
||||
var oH = originalDimensions[elId].height;
|
||||
var ratio = oW/oH;
|
||||
|
||||
// max
|
||||
if (maxW && w > maxW) {
|
||||
w = maxW;
|
||||
h = maintainAspect ? Math.round(w / ratio) : h;
|
||||
}
|
||||
if (maxH && h > maxH) {
|
||||
h = maxH;
|
||||
w = maintainAspect ? Math.round(h * ratio) : w;
|
||||
}
|
||||
|
||||
// min
|
||||
if (minW && w < minW) {
|
||||
w = minW;
|
||||
h = maintainAspect ? Math.round(w / ratio) : h;
|
||||
}
|
||||
if (minH && h < minH) {
|
||||
h = minH;
|
||||
w = maintainAspect ? Math.round(h * ratio) : h;
|
||||
}
|
||||
|
||||
return { width: w, height:h };
|
||||
}
|
||||
|
||||
})();
|
337
sn_templates/editor_stuff/plugin/bbcode/editor_plugin.js
Normal file
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onSaveContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
// if (o.get)
|
||||
// o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in PunBB dialect
|
||||
_punbb_html2bbcode : function(s) {
|
||||
// alert("html2bbcode");
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// rep(/(.*?>)[\n|\r]/g,"$1");
|
||||
rep(/[\n\r]{0,1}(<(ol|ul).*?>)[\n\r]{0,1}/g,"$1");
|
||||
rep(/(<\/(ul|ol|li)>)[\n\r]/g,"$1");
|
||||
|
||||
// bbcode of img for sn article
|
||||
while(/(<img class=\"(.+?)\" .+?>)/.test(s)){
|
||||
var _res = RegExp.$1;
|
||||
var _typ = RegExp.$2;
|
||||
var _rpl = "";
|
||||
|
||||
if(_typ == 'snVideo'){
|
||||
var _w = /width=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
var _h = /height=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
var _p = /alt=\"(.*?)\"/.test(_res) ? RegExp.$1:'';
|
||||
var _v = /title=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
_rpl = '[video='+_v+_w+_h+_p+']';
|
||||
} else{
|
||||
var _p = (/src=\"(.*?)\"/.test(_res) ? RegExp.$1:'').split('/').pop();
|
||||
var _f = (/alt=\"(.*?)\"/.test(_res) ? RegExp.$1:'').split('/').pop();
|
||||
var _s = (/style=\"float:(.*?);\"/.test(_res) ? RegExp.$1:'').replace(/ /g,'');
|
||||
var _i = 'img';
|
||||
switch(_s){
|
||||
case 'left':
|
||||
_i = 'imgl';
|
||||
break;
|
||||
case 'right':
|
||||
_i = 'imgr';
|
||||
break;
|
||||
|
||||
}
|
||||
_rpl = '['+_i+'='+_f+']'+_p+'[/'+_i+']';
|
||||
}
|
||||
|
||||
s = s.replace(_res,_rpl);
|
||||
}
|
||||
|
||||
//////
|
||||
|
||||
// replace list html-codeStyle
|
||||
var rl = new Array();
|
||||
rl[0] = {o:"[list]",c:"[/list]",f:/<ul>/};
|
||||
rl[1] = {o:"[list=d]",c:"[/list]",f:/<ul style="list-style-type: disc;">/};
|
||||
rl[2] = {o:"[list=c]",c:"[/list]",f:/<ul style="list-style-type: circle;">/};
|
||||
rl[3] = {o:"[list=s]",c:"[/list]",f:/<ul style="list-style-type: square;">/};
|
||||
|
||||
rl[4] = {o:"[list=i]",c:"[/list]",f:/<ol style="list-style-type: lower-roman;">/};
|
||||
rl[5] = {o:"[list=I]",c:"[/list]",f:/<ol style="list-style-type: upper-roman;">/};
|
||||
rl[6] = {o:"[list=a]",c:"[/list]",f:/<ol style="list-style-type: lower-alpha;">/};
|
||||
rl[7] = {o:"[list=A]",c:"[/list]",f:/<ol style="list-style-type: upper-alpha;">/};
|
||||
rl[8] = {o:"[list=1]",c:"[/list]",f:/<ol style="list-style-type: decimal;">/};
|
||||
rl[9] = {o:"[list=1]",c:"[/list]",f:/<ol>/};
|
||||
|
||||
|
||||
var cl = new Array();
|
||||
do{
|
||||
var p = s.search(/<\/ol>|<\/ul>/);
|
||||
var re = "";
|
||||
|
||||
for(var i = 0; i < rl.length; i++){
|
||||
var np = s.search(rl[i].f);
|
||||
|
||||
if(np != -1 && p > np){
|
||||
p = np;
|
||||
cl[cl.length] = rl[i];
|
||||
re = rl[i].f;
|
||||
}
|
||||
}
|
||||
|
||||
if(cl.length > 0){
|
||||
if(re == ""){
|
||||
s = s.replace(/<\/ol>|<\/ul>/,cl.pop().c);
|
||||
}else{
|
||||
s = s.replace(re, cl[cl.length-1].o);
|
||||
}
|
||||
}
|
||||
}while(cl.length > 0 || s.search(/<(ol|ul).*?>/) != -1 );
|
||||
|
||||
// s = s.replace(/<li>(.*?)<\/li>/g,"[*]$1[/*]");
|
||||
|
||||
s = s.replace(/<li>/g,"[*]");
|
||||
s = s.replace(/<\/li>/g,"[/*]");
|
||||
|
||||
while(s.match(/<a(.*?)>(.*?)<\/a>/i)){
|
||||
var lnkh = RegExp.$1;
|
||||
var lnkt = RegExp.$2;
|
||||
lnkh.match(/title=\"(.+?)\"/);
|
||||
var title = RegExp.$1;
|
||||
lnkh.match(/href=\"(.+?)\"/);
|
||||
var href = RegExp.$1;
|
||||
|
||||
if(title!=href){
|
||||
url = "[xurl="+href+"|"+title+"]"+lnkt+"[/url]";
|
||||
}else{
|
||||
url = "[url="+href+"]"+lnkt+"[/url]";
|
||||
}
|
||||
s = s.replace(/<a(.*?)>(.*?)<\/a>/i, url);
|
||||
}
|
||||
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
|
||||
|
||||
rep(/<(h[1|2|3])>(.*?)<\/(h[1|2|3])>/gi,"[$1]$2[/$3]");
|
||||
|
||||
rep(/<sup>(.*?)<\/sup>/gi,"[sup]$1[/sup]");
|
||||
rep(/<sub>(.*?)<\/sub>/gi,"[sub]$1[/sub]");
|
||||
|
||||
|
||||
|
||||
|
||||
// rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
// rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
// rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
// rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
// rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
// // rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
// rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
// rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
|
||||
s = s.replace(/<span class=\"snInfoBoxHead\".*?>(.+?)<\/span>/g,"[boxhead]$1[/boxhead]");
|
||||
|
||||
while(s.match(/<span class=\"snInfoBox\" style=\"(.+?)\">(.+?)<\/span>/)){
|
||||
var l = RegExp.$1; var c = RegExp.$2;
|
||||
var b = l.indexOf("float: left") != -1 ? "infol":"infor";
|
||||
var w = "";
|
||||
|
||||
if(l.match(/width:(.+?);.+/)){
|
||||
var _cwn = parseInt(RegExp.$1);
|
||||
if(!isNaN(_cwn)){
|
||||
w = "="+_cwn;
|
||||
}
|
||||
}
|
||||
|
||||
s = s.replace(/<span class=\"snInfoBox\" style=\"(.+?)\">(.+?)<\/span>/,"["+b+w+"]"+c+"[/"+b+"]");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<blockquote>(.*?)<\/blockquote>/gi,"[quote]$1[/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p(.*?)>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
rep(/\[\/(tr|td|table)\]\n/gi,"[/$1]");
|
||||
rep(/\[(tr|table|td)\]\n/gi,"[$1]");
|
||||
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from PunBB dialect
|
||||
_punbb_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
// alert("bbcode2html");
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
var img_path = (tinyMCE.activeEditor.getParam("snstuff_img_url_image") || "/articleimage/{artikelid}/").replace(/\{artikelid\}/g,parent.entryid);
|
||||
img_path = img_path.replace(/\{imgname\}/g,"");
|
||||
|
||||
rep(/\[imgl=(.*?)\](.*?)\[\/imgl\]/gi,"<img class=\"noresize\" style=\"float:left;\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
rep(/\[imgr=(.*?)\](.*?)\[\/imgr\]/gi,"<img class=\"noresize\" style=\"float:right;\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
rep(/\[img=(.*?)\](.*?)\[\/img\]/gi,"<img class=\"noresize\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
|
||||
|
||||
while(/(\[video=(.*?)\])/.test(s)){
|
||||
var _res = RegExp.$1;
|
||||
var _l = RegExp.$2.split(';');
|
||||
var _rpl = '<img class="snVideo" src="/editor_stuff/plugin/snstuff/images/trans.gif" title="'+_l[0]+'" width="'+parseInt(_l[1])+'" height="'+parseInt(_l[2])+'" ';
|
||||
_rpl += _l[3]?'alt="'+_l[3]+'" />':'/>';
|
||||
s = s.replace(_res,_rpl);
|
||||
}
|
||||
|
||||
// replace list bbcode
|
||||
var rl = new Array();
|
||||
rl[0] = {f:/\[list\]/, o:"<ul style=\"list-style-type: disc;\">",c:"</ul>"};
|
||||
rl[1] = {f:/\[list=d\]/, o:"<ul style=\"list-style-type: disc;\">",c:"</ul>"};
|
||||
rl[2] = {f:/\[list=s\]/, o:"<ul style=\"list-style-type: square;\">",c:"</ul>"};
|
||||
rl[3] = {f:/\[list=c\]/, o:"<ul style=\"list-style-type: circle;\">",c:"</ul>"};
|
||||
|
||||
rl[4] = {f:/\[list=1\]/, o:"<ol style=\"list-style-type: decimal;\">",c:"</ol>"};
|
||||
rl[5] = {f:/\[list=i\]/, o:"<ol style=\"list-style-type: lower-roman;\">",c:"</ol>"};
|
||||
rl[6] = {f:/\[list=I\]/, o:"<ol style=\"list-style-type: upper-roman;\">",c:"</ol>"};
|
||||
rl[7] = {f:/\[list=a\]/, o:"<ol style=\"list-style-type: lower-alpha;\">",c:"</ol>"};
|
||||
rl[8] = {f:/\[list=A\]/, o:"<ol style=\"list-style-type: upper-alpha;\">",c:"</ol>"};
|
||||
|
||||
var cl = new Array();
|
||||
do{
|
||||
var p = s.search(/\[\/list\]/);
|
||||
var re = "";
|
||||
|
||||
for(var i = 0; i < rl.length; i++){
|
||||
var np = s.search(rl[i].f);
|
||||
|
||||
if(np != -1 && p > np){
|
||||
p = np;
|
||||
cl[cl.length] = rl[i];
|
||||
re = rl[i].f;
|
||||
}
|
||||
}
|
||||
if(cl.length > 0){
|
||||
if(re == ""){
|
||||
s = s.replace(/\[\/list\]/,cl.pop().c);
|
||||
}else{
|
||||
s = s.replace(re, cl[cl.length-1].o);
|
||||
}
|
||||
}
|
||||
}while(cl.length > 0 || s.search(/\[list.*?\]/) != -1);
|
||||
|
||||
|
||||
s = s.replace(/\[\/\*\]/g,"</li>");
|
||||
s = s.replace(/\[\*\]/g,"<li>");
|
||||
|
||||
|
||||
s = s.replace(/\[infor\]/mg,"<span class=\"snInfoBox\" style=\"width:100px; float: right;\">");
|
||||
s = s.replace(/\[infol\]/mg,"<span class=\"snInfoBox\" style=\"width:100px; float: left;\">");
|
||||
|
||||
s = s.replace(/\[infor=(.+?){0,1}\]/mg,"<span class=\"snInfoBox\" style=\"width:$1px; float: right;\">");
|
||||
s = s.replace(/\[infol=(.+?){0,1}\]/mg,"<span class=\"snInfoBox\" style=\"width:$1px; float: left;\">");
|
||||
|
||||
s = s.replace(/\[\/(infor|infol)\]/g,"</span>");
|
||||
|
||||
s = s.replace(/\[boxhead\]/g,"<span class=\"snInfoBoxHead\">");
|
||||
s = s.replace(/\[\/boxhead\]/g,"</span>");
|
||||
|
||||
|
||||
// example: [b] to <strong>
|
||||
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$1\">$2</a>");
|
||||
rep(/\[xurl=([^\]]+)\|(.*?)\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$2\">$3</a>");
|
||||
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$1\">$1</a>");
|
||||
// rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
|
||||
rep(/\[(h[1|2|3])\](.*?)\[\/(h[1|2|3])\]/gi,"<$1>$2</$3>");
|
||||
rep(/(<\/h[1|2|3]>)\n/gi,"$1");
|
||||
rep(/\n(<h[1|2|3]>)/gi,"$1");
|
||||
|
||||
|
||||
|
||||
rep(/\[sup\](.*?)\[\/sup\]/gi,"<sup>$1</sup>");
|
||||
rep(/\[sub\](.*?)\[\/sub\]/gi,"<sub>$1</sub>");
|
||||
|
||||
/*
|
||||
rep(/\[\/(tr|td|table)\]/gi,"[/$1]");
|
||||
rep(/\[(tr|table)\]/gi,"[$1]");*/
|
||||
|
||||
|
||||
rep(/\n/gi,"<br />");
|
||||
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
337
sn_templates/editor_stuff/plugin/bbcode/editor_plugin_src.js
Normal file
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onSaveContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
// if (o.get)
|
||||
// o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in PunBB dialect
|
||||
_punbb_html2bbcode : function(s) {
|
||||
// alert("html2bbcode");
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// rep(/(.*?>)[\n|\r]/g,"$1");
|
||||
rep(/[\n\r]{0,1}(<(ol|ul).*?>)[\n\r]{0,1}/g,"$1");
|
||||
rep(/(<\/(ul|ol|li)>)[\n\r]/g,"$1");
|
||||
|
||||
// bbcode of img for sn article
|
||||
while(/(<img class=\"(.+?)\" .+?>)/.test(s)){
|
||||
var _res = RegExp.$1;
|
||||
var _typ = RegExp.$2;
|
||||
var _rpl = "";
|
||||
|
||||
if(_typ == 'snVideo'){
|
||||
var _w = /width=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
var _h = /height=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
var _p = /alt=\"(.*?)\"/.test(_res) ? RegExp.$1:'';
|
||||
var _v = /title=\"(.*?)\"/.test(_res) ? RegExp.$1+';':'';
|
||||
_rpl = '[video='+_v+_w+_h+_p+']';
|
||||
} else{
|
||||
var _p = (/src=\"(.*?)\"/.test(_res) ? RegExp.$1:'').split('/').pop();
|
||||
var _f = (/alt=\"(.*?)\"/.test(_res) ? RegExp.$1:'').split('/').pop();
|
||||
var _s = (/style=\"float:(.*?);\"/.test(_res) ? RegExp.$1:'').replace(/ /g,'');
|
||||
var _i = 'img';
|
||||
switch(_s){
|
||||
case 'left':
|
||||
_i = 'imgl';
|
||||
break;
|
||||
case 'right':
|
||||
_i = 'imgr';
|
||||
break;
|
||||
|
||||
}
|
||||
_rpl = '['+_i+'='+_f+']'+_p+'[/'+_i+']';
|
||||
}
|
||||
|
||||
s = s.replace(_res,_rpl);
|
||||
}
|
||||
|
||||
//////
|
||||
|
||||
// replace list html-codeStyle
|
||||
var rl = new Array();
|
||||
rl[0] = {o:"[list]",c:"[/list]",f:/<ul>/};
|
||||
rl[1] = {o:"[list=d]",c:"[/list]",f:/<ul style="list-style-type: disc;">/};
|
||||
rl[2] = {o:"[list=c]",c:"[/list]",f:/<ul style="list-style-type: circle;">/};
|
||||
rl[3] = {o:"[list=s]",c:"[/list]",f:/<ul style="list-style-type: square;">/};
|
||||
|
||||
rl[4] = {o:"[list=i]",c:"[/list]",f:/<ol style="list-style-type: lower-roman;">/};
|
||||
rl[5] = {o:"[list=I]",c:"[/list]",f:/<ol style="list-style-type: upper-roman;">/};
|
||||
rl[6] = {o:"[list=a]",c:"[/list]",f:/<ol style="list-style-type: lower-alpha;">/};
|
||||
rl[7] = {o:"[list=A]",c:"[/list]",f:/<ol style="list-style-type: upper-alpha;">/};
|
||||
rl[8] = {o:"[list=1]",c:"[/list]",f:/<ol style="list-style-type: decimal;">/};
|
||||
rl[9] = {o:"[list=1]",c:"[/list]",f:/<ol>/};
|
||||
|
||||
|
||||
var cl = new Array();
|
||||
do{
|
||||
var p = s.search(/<\/ol>|<\/ul>/);
|
||||
var re = "";
|
||||
|
||||
for(var i = 0; i < rl.length; i++){
|
||||
var np = s.search(rl[i].f);
|
||||
|
||||
if(np != -1 && p > np){
|
||||
p = np;
|
||||
cl[cl.length] = rl[i];
|
||||
re = rl[i].f;
|
||||
}
|
||||
}
|
||||
|
||||
if(cl.length > 0){
|
||||
if(re == ""){
|
||||
s = s.replace(/<\/ol>|<\/ul>/,cl.pop().c);
|
||||
}else{
|
||||
s = s.replace(re, cl[cl.length-1].o);
|
||||
}
|
||||
}
|
||||
}while(cl.length > 0 || s.search(/<(ol|ul).*?>/) != -1 );
|
||||
|
||||
// s = s.replace(/<li>(.*?)<\/li>/g,"[*]$1[/*]");
|
||||
|
||||
s = s.replace(/<li>/g,"[*]");
|
||||
s = s.replace(/<\/li>/g,"[/*]");
|
||||
|
||||
while(s.match(/<a(.*?)>(.*?)<\/a>/i)){
|
||||
var lnkh = RegExp.$1;
|
||||
var lnkt = RegExp.$2;
|
||||
lnkh.match(/title=\"(.+?)\"/);
|
||||
var title = RegExp.$1;
|
||||
lnkh.match(/href=\"(.+?)\"/);
|
||||
var href = RegExp.$1;
|
||||
|
||||
if(title!=href){
|
||||
url = "[xurl="+href+"|"+title+"]"+lnkt+"[/url]";
|
||||
}else{
|
||||
url = "[url="+href+"]"+lnkt+"[/url]";
|
||||
}
|
||||
s = s.replace(/<a(.*?)>(.*?)<\/a>/i, url);
|
||||
}
|
||||
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
|
||||
|
||||
rep(/<(h[1|2|3])>(.*?)<\/(h[1|2|3])>/gi,"[$1]$2[/$3]");
|
||||
|
||||
rep(/<sup>(.*?)<\/sup>/gi,"[sup]$1[/sup]");
|
||||
rep(/<sub>(.*?)<\/sub>/gi,"[sub]$1[/sub]");
|
||||
|
||||
|
||||
|
||||
|
||||
// rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
// rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
// rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
// rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
// rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
// // rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
// rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
// rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
|
||||
s = s.replace(/<span class=\"snInfoBoxHead\".*?>(.+?)<\/span>/g,"[boxhead]$1[/boxhead]");
|
||||
|
||||
while(s.match(/<span class=\"snInfoBox\" style=\"(.+?)\">(.+?)<\/span>/)){
|
||||
var l = RegExp.$1; var c = RegExp.$2;
|
||||
var b = l.indexOf("float: left") != -1 ? "infol":"infor";
|
||||
var w = "";
|
||||
|
||||
if(l.match(/width:(.+?);.+/)){
|
||||
var _cwn = parseInt(RegExp.$1);
|
||||
if(!isNaN(_cwn)){
|
||||
w = "="+_cwn;
|
||||
}
|
||||
}
|
||||
|
||||
s = s.replace(/<span class=\"snInfoBox\" style=\"(.+?)\">(.+?)<\/span>/,"["+b+w+"]"+c+"[/"+b+"]");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<blockquote>(.*?)<\/blockquote>/gi,"[quote]$1[/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p(.*?)>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
rep(/\[\/(tr|td|table)\]\n/gi,"[/$1]");
|
||||
rep(/\[(tr|table|td)\]\n/gi,"[$1]");
|
||||
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from PunBB dialect
|
||||
_punbb_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
// alert("bbcode2html");
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
var img_path = (tinyMCE.activeEditor.getParam("snstuff_img_url_image") || "/articleimage/{artikelid}/").replace(/\{artikelid\}/g,parent.entryid);
|
||||
img_path = img_path.replace(/\{imgname\}/g,"");
|
||||
|
||||
rep(/\[imgl=(.*?)\](.*?)\[\/imgl\]/gi,"<img class=\"noresize\" style=\"float:left;\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
rep(/\[imgr=(.*?)\](.*?)\[\/imgr\]/gi,"<img class=\"noresize\" style=\"float:right;\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
rep(/\[img=(.*?)\](.*?)\[\/img\]/gi,"<img class=\"noresize\" src=\""+img_path+"$2\" alt=\"$1\"/>");
|
||||
|
||||
|
||||
while(/(\[video=(.*?)\])/.test(s)){
|
||||
var _res = RegExp.$1;
|
||||
var _l = RegExp.$2.split(';');
|
||||
var _rpl = '<img class="snVideo" src="/editor_stuff/plugin/snstuff/images/trans.gif" title="'+_l[0]+'" width="'+parseInt(_l[1])+'" height="'+parseInt(_l[2])+'" ';
|
||||
_rpl += _l[3]?'alt="'+_l[3]+'" />':'/>';
|
||||
s = s.replace(_res,_rpl);
|
||||
}
|
||||
|
||||
// replace list bbcode
|
||||
var rl = new Array();
|
||||
rl[0] = {f:/\[list\]/, o:"<ul style=\"list-style-type: disc;\">",c:"</ul>"};
|
||||
rl[1] = {f:/\[list=d\]/, o:"<ul style=\"list-style-type: disc;\">",c:"</ul>"};
|
||||
rl[2] = {f:/\[list=s\]/, o:"<ul style=\"list-style-type: square;\">",c:"</ul>"};
|
||||
rl[3] = {f:/\[list=c\]/, o:"<ul style=\"list-style-type: circle;\">",c:"</ul>"};
|
||||
|
||||
rl[4] = {f:/\[list=1\]/, o:"<ol style=\"list-style-type: decimal;\">",c:"</ol>"};
|
||||
rl[5] = {f:/\[list=i\]/, o:"<ol style=\"list-style-type: lower-roman;\">",c:"</ol>"};
|
||||
rl[6] = {f:/\[list=I\]/, o:"<ol style=\"list-style-type: upper-roman;\">",c:"</ol>"};
|
||||
rl[7] = {f:/\[list=a\]/, o:"<ol style=\"list-style-type: lower-alpha;\">",c:"</ol>"};
|
||||
rl[8] = {f:/\[list=A\]/, o:"<ol style=\"list-style-type: upper-alpha;\">",c:"</ol>"};
|
||||
|
||||
var cl = new Array();
|
||||
do{
|
||||
var p = s.search(/\[\/list\]/);
|
||||
var re = "";
|
||||
|
||||
for(var i = 0; i < rl.length; i++){
|
||||
var np = s.search(rl[i].f);
|
||||
|
||||
if(np != -1 && p > np){
|
||||
p = np;
|
||||
cl[cl.length] = rl[i];
|
||||
re = rl[i].f;
|
||||
}
|
||||
}
|
||||
if(cl.length > 0){
|
||||
if(re == ""){
|
||||
s = s.replace(/\[\/list\]/,cl.pop().c);
|
||||
}else{
|
||||
s = s.replace(re, cl[cl.length-1].o);
|
||||
}
|
||||
}
|
||||
}while(cl.length > 0 || s.search(/\[list.*?\]/) != -1);
|
||||
|
||||
|
||||
s = s.replace(/\[\/\*\]/g,"</li>");
|
||||
s = s.replace(/\[\*\]/g,"<li>");
|
||||
|
||||
|
||||
s = s.replace(/\[infor\]/mg,"<span class=\"snInfoBox\" style=\"width:100px; float: right;\">");
|
||||
s = s.replace(/\[infol\]/mg,"<span class=\"snInfoBox\" style=\"width:100px; float: left;\">");
|
||||
|
||||
s = s.replace(/\[infor=(.+?){0,1}\]/mg,"<span class=\"snInfoBox\" style=\"width:$1px; float: right;\">");
|
||||
s = s.replace(/\[infol=(.+?){0,1}\]/mg,"<span class=\"snInfoBox\" style=\"width:$1px; float: left;\">");
|
||||
|
||||
s = s.replace(/\[\/(infor|infol)\]/g,"</span>");
|
||||
|
||||
s = s.replace(/\[boxhead\]/g,"<span class=\"snInfoBoxHead\">");
|
||||
s = s.replace(/\[\/boxhead\]/g,"</span>");
|
||||
|
||||
|
||||
// example: [b] to <strong>
|
||||
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$1\">$2</a>");
|
||||
rep(/\[xurl=([^\]]+)\|(.*?)\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$2\">$3</a>");
|
||||
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\" title=\"$1\">$1</a>");
|
||||
// rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
|
||||
rep(/\[(h[1|2|3])\](.*?)\[\/(h[1|2|3])\]/gi,"<$1>$2</$3>");
|
||||
rep(/(<\/h[1|2|3]>)\n/gi,"$1");
|
||||
rep(/\n(<h[1|2|3]>)/gi,"$1");
|
||||
|
||||
|
||||
|
||||
rep(/\[sup\](.*?)\[\/sup\]/gi,"<sup>$1</sup>");
|
||||
rep(/\[sub\](.*?)\[\/sub\]/gi,"<sub>$1</sub>");
|
||||
|
||||
/*
|
||||
rep(/\[\/(tr|td|table)\]/gi,"[/$1]");
|
||||
rep(/\[(tr|table)\]/gi,"[$1]");*/
|
||||
|
||||
|
||||
rep(/\n/gi,"<br />");
|
||||
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
@@ -0,0 +1,3 @@
|
||||
td.radio { text-align: right; }
|
||||
td.label { text-align: right; }
|
||||
.panel_wrapper div.current {height:auto;}
|
@@ -0,0 +1 @@
|
||||
(function(){tinymce.PluginManager.requireLangPack('liststyle');tinymce.create('tinymce.plugins.ListStylePlugin',{init:function(ed,url){ed.addCommand('mceListStyle',function(ui,v){var listStyleType='',listStart,isIE=tinyMCE.isIE;var listNode=ed.plugins.liststyle._findList(ed,ed.selection.getNode());if(listNode){listStyleType=listNode.style.listStyleType;if(listNode.nodeName.toLowerCase()=='ol'){listStart=parseInt(listNode.start);if(listStart<1){listStart=1}ed.windowManager.open({file:url+'/liststyle_ol.htm',width:340+parseInt(ed.getLang('liststyle.delta_width',0)),height:300+(isIE?40:0)+parseInt(ed.getLang('liststyle.delta_height',0)),inline:1},{plugin_url:url,listStyleType:listStyleType,listNode:listNode,listStart:listStart,classAttr:listNode.className,isIE:isIE})}else{ed.windowManager.open({file:url+'/liststyle_ul.htm',width:340+parseInt(ed.getLang('liststyle.delta_width',0)),height:300+(isIE?40:0)+parseInt(ed.getLang('liststyle.delta_height',0)),inline:1},{plugin_url:url,listStyleType:listStyleType,listNode:listNode,classAttr:listNode.className,isIE:isIE})}}});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(ed.plugins.liststyle._findList(ed,ed.selection.getNode())){m.add({title:'liststyle.desc',cmd:'mceListStyle',icon:'liststyle',ui:true})}})}});ed.addButton('liststyle',{title:'liststyle.desc',cmd:'mceListStyle',image:url+'/img/liststyle.gif'});ed.onNodeChange.add(function(ed,cm,node){cm.setDisabled('liststyle',ed.plugins.liststyle._findList(ed,node)==null)})},_isList:function(node){if(node==null)return null;return node.nodeName=='OL'||node.nodeName=='UL'},_findList:function(ed,node){if(ed.plugins.liststyle._isList(node)){return node}return ed.dom.getParent(node,ed.plugins.liststyle._isList)},getInfo:function(){return{longname:'ListStyle',author:'PolicyPoint Technologies Pty. Ltd.',authorurl:'http://policypoint.net/',infourl:'http://policypoint.net/tinymce/docs/plugin_liststyle.html',version:"3.1-alfa"}}});tinymce.PluginManager.add('liststyle',tinymce.plugins.ListStylePlugin)})();
|
132
sn_templates/editor_stuff/plugin/liststyle/editor_plugin_src.js
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* $Id:$
|
||||
* vim: expandtab ts=8 sw=8
|
||||
*
|
||||
* @author Scott Eade, PolicyPoint Technologies Pty. Ltd.
|
||||
* @copyright Copyright 2005-2008, PolicyPoint Technologies Pty. Ltd.
|
||||
* @author Mariusz P<>kala, iDelfi Polska sp. z o.o.
|
||||
* @copyright Copyright 2008, iDelfi Polska sp. z o.o.
|
||||
* @license LGPL
|
||||
*/
|
||||
|
||||
(function() {
|
||||
// Load plugin specific language pack
|
||||
tinymce.PluginManager.requireLangPack('liststyle');
|
||||
|
||||
tinymce.create('tinymce.plugins.ListStylePlugin', {
|
||||
/**
|
||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||
* of the editor instance to intercept that event.
|
||||
*
|
||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed, url) {
|
||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
||||
ed.addCommand('mceListStyle', function(ui, v) {
|
||||
var listStyleType = '', listStart, isIE = tinyMCE.isIE;
|
||||
// ed.selection.getNode(); => selectedElement - common ancestor
|
||||
var listNode = ed.plugins.liststyle._findList(ed, ed.selection.getNode() );
|
||||
if( listNode ) {
|
||||
listStyleType = listNode.style.listStyleType;
|
||||
if( listNode.nodeName.toLowerCase() == 'ol' ) {
|
||||
listStart = parseInt(listNode.start);
|
||||
if( listStart < 1) { listStart = 1; }
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/liststyle_ol.htm',
|
||||
width : 340 + parseInt(ed.getLang('liststyle.delta_width', 0)),
|
||||
height : 300 + (isIE ? 40 : 0) + parseInt(ed.getLang('liststyle.delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url, // Plugin absolute URL
|
||||
listStyleType : listStyleType,
|
||||
listNode : listNode,
|
||||
listStart : listStart,
|
||||
classAttr : listNode.className,
|
||||
isIE : isIE
|
||||
}
|
||||
);
|
||||
} else {
|
||||
ed.windowManager.open({
|
||||
file : url + '/liststyle_ul.htm',
|
||||
width : 340 + parseInt(ed.getLang('liststyle.delta_width', 0)),
|
||||
height : 300 + (isIE ? 40 : 0) + parseInt(ed.getLang('liststyle.delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url, // Plugin absolute URL
|
||||
listStyleType : listStyleType,
|
||||
listNode : listNode,
|
||||
classAttr : listNode.className,
|
||||
isIE : isIE
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ed.onInit.add(function() {
|
||||
if (ed && ed.plugins.contextmenu) {
|
||||
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
|
||||
if( ed.plugins.liststyle._findList(ed,ed.selection.getNode() ) ) {
|
||||
m.add({title : 'liststyle.desc', cmd : 'mceListStyle', icon : 'liststyle', ui : true});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Register the button
|
||||
ed.addButton('liststyle', {
|
||||
title : 'liststyle.desc',
|
||||
cmd : 'mceListStyle',
|
||||
image : url + '/img/liststyle.gif'
|
||||
});
|
||||
|
||||
// Enable/disable the button depending on the current selection element
|
||||
// It looks like the node is the same as selection.getNode - it means, a common ancestor of
|
||||
// all selected nodes.
|
||||
ed.onNodeChange.add(function(ed, cm, node) {
|
||||
cm.setDisabled('liststyle', ed.plugins.liststyle._findList(ed,node) == null);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Helper function: find a list element (<ol> or <ul>) being somewhere
|
||||
* amongst parents of given element.
|
||||
*/
|
||||
_isList : function(node) {
|
||||
if( node == null )
|
||||
return null;
|
||||
return node.nodeName == 'OL' || node.nodeName == 'UL';
|
||||
},
|
||||
|
||||
_findList : function(ed, node) {
|
||||
if( ed.plugins.liststyle._isList(node) ) {
|
||||
return node;
|
||||
}
|
||||
return ed.dom.getParent( node, ed.plugins.liststyle._isList );
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about the plugin as a name/value array.
|
||||
* The current keys are longname, author, authorurl, infourl and version.
|
||||
*
|
||||
* @return {Object} Name/value array containing information about the plugin.
|
||||
*/
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'ListStyle',
|
||||
author : 'PolicyPoint Technologies Pty. Ltd.',
|
||||
authorurl : 'http://policypoint.net/',
|
||||
infourl : 'http://policypoint.net/tinymce/docs/plugin_liststyle.html',
|
||||
version : "3.1-alfa"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('liststyle', tinymce.plugins.ListStylePlugin);
|
||||
})();
|
BIN
sn_templates/editor_stuff/plugin/liststyle/img/liststyle.gif
Normal file
After Width: | Height: | Size: 123 B |
73
sn_templates/editor_stuff/plugin/liststyle/js/liststyle.js
Normal file
@@ -0,0 +1,73 @@
|
||||
// vim: expandtab ts=8 sw=8
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
|
||||
/**
|
||||
* Window args passed to the popup:
|
||||
* (retrieve by tinyMCEPopup.getWindowArg('isIE');
|
||||
*
|
||||
* - plugin_url : url, // Plugin absolute URL
|
||||
* - listStyleType : listStyleType, // 'decimal', 'disc', etc.
|
||||
* - listNode : listNode, // the list dom element
|
||||
* - listStart : listStart, // 1, 2, 3
|
||||
* - classAttr : p.className, // html class attribute class
|
||||
* - isIE : isIE // true / false
|
||||
*/
|
||||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var isIE = tinyMCEPopup.getWindowArg('isIE');
|
||||
var classAttr = tinyMCEPopup.getWindowArg('classAttr') || '';
|
||||
var listStyleType = tinyMCEPopup.getWindowArg('listStyleType');
|
||||
|
||||
listSpecificInit();
|
||||
|
||||
setListStyleType( listSpecificSwitch( formObj, listStyleType) );
|
||||
|
||||
if (isIE) {
|
||||
document.getElementById("classAttrId").value = classAttr;
|
||||
} else {
|
||||
document.getElementById("classNameRow").style.display = "none";
|
||||
listSpecificNonIEInit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Just copy a value from radio button to a hidden input.
|
||||
* This function is set as onclick event on radio controls.
|
||||
*/
|
||||
function setListStyleType(listStyleType) {
|
||||
document.forms[0].listStyleTypeId.value = listStyleType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is set as onclick event on the 'OK' button.
|
||||
*/
|
||||
function okayAction() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
var listNode = tinyMCEPopup.getWindowArg('listNode');
|
||||
var classAttr = formObj.classAttr.value;
|
||||
var listStyleType = formObj.listStyleType.value;
|
||||
var isIE = tinyMCEPopup.getWindowArg('isIE');
|
||||
|
||||
if (listNode) {
|
||||
tinyMCEPopup.execCommand('mceBeginUndoLevel');
|
||||
listNode.style.listStyleType = listStyleType;
|
||||
listNode.removeAttribute('mce_style'); // MAGIC! FIXME: wyjaśnij, po co jest mce_style
|
||||
|
||||
listSpecificOkayAction( formObj, listNode );
|
||||
|
||||
if (isIE) {
|
||||
listNode.className = classAttr;
|
||||
}
|
||||
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
||||
}
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
@@ -0,0 +1,62 @@
|
||||
// vim: expandtab ts=8 sw=8
|
||||
|
||||
|
||||
function listSpecificInit() {
|
||||
var listStart = parseInt( tinyMCEPopup.getWindowArg('listStart') );
|
||||
if( listStart ) {
|
||||
if( listStart < 1 ) { listStart = 1; }
|
||||
} else {
|
||||
listStart = '';
|
||||
}
|
||||
// document.getElementById("listStartId").value = listStart || '';
|
||||
}
|
||||
|
||||
function listSpecificNonIEInit() {
|
||||
}
|
||||
|
||||
function listSpecificSwitch( formObj, listStyleType ) {
|
||||
switch (listStyleType) {
|
||||
case "decimal":
|
||||
formObj.decimalId.checked = true;
|
||||
break;
|
||||
case "lower-alpha":
|
||||
formObj.lowerAlphaId.checked = true;
|
||||
break;
|
||||
case "upper-alpha":
|
||||
formObj.upperAlphaId.checked = true;
|
||||
break;
|
||||
case "lower-roman":
|
||||
formObj.lowerRomanId.checked = true;
|
||||
break;
|
||||
case "upper-roman":
|
||||
formObj.upperRomanId.checked = true;
|
||||
break;
|
||||
case "none":
|
||||
formObj.noneId.checked = true;
|
||||
break;
|
||||
default:
|
||||
formObj.decimalId.checked = true;
|
||||
listStyleType = 'decimal';
|
||||
}
|
||||
return listStyleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called from the onsubmit form handler "okAction()".
|
||||
*/
|
||||
function listSpecificOkayAction( formObj, listNode ) {
|
||||
|
||||
var listStart = 1;//parseInt(formObj.listStart.value); // may be NaN !
|
||||
if( listStart < 1) {
|
||||
listStart = 1;
|
||||
};
|
||||
|
||||
if (listNode) {
|
||||
if( listStart ) {
|
||||
listNode.start = listStart;
|
||||
} else {
|
||||
listNode.removeAttribute('start');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,37 @@
|
||||
// vim: expandtab ts=8 sw=8
|
||||
|
||||
function listSpecificInit() {
|
||||
}
|
||||
|
||||
function listSpecificNonIEInit() {
|
||||
// no additional properties left. Hide the section title:
|
||||
// document.getElementById("listAttrsRow").style.display = "none";
|
||||
}
|
||||
|
||||
|
||||
function listSpecificSwitch( formObj, listStyleType ) {
|
||||
switch (listStyleType) {
|
||||
case "disc":
|
||||
formObj.discId.checked = true;
|
||||
break;
|
||||
case "circle":
|
||||
formObj.circleId.checked = true;
|
||||
break;
|
||||
case "square":
|
||||
formObj.squareId.checked = true;
|
||||
break;
|
||||
case "none":
|
||||
formObj.noneId.checked = true;
|
||||
break;
|
||||
default:
|
||||
formObj.discId.checked = true;
|
||||
listStyleType = 'disc';
|
||||
}
|
||||
return listStyleType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// do nothing
|
||||
function listSpecificOkayAction( formObj, listNode ) {
|
||||
}
|
19
sn_templates/editor_stuff/plugin/liststyle/langs/de.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// UK lang variables
|
||||
|
||||
tinyMCE.addI18n("de.liststyle", {
|
||||
desc : 'List eigenschaften',
|
||||
listtype : 'List type',
|
||||
decimal : "1, 2, 3, ...",
|
||||
lalpha : 'a, b, c, ...',
|
||||
ualpha : 'A, B, C, ...',
|
||||
lroman : 'i, ii, iii, ...',
|
||||
uroman : 'I, II, III...',
|
||||
disc : 'Punkte',
|
||||
circle : 'Kreise',
|
||||
square : 'Quadrate',
|
||||
none : 'Keine',
|
||||
listattributes : 'List eigenschaften',
|
||||
start : 'start',
|
||||
startdesc : '1, 2, 3, ...',
|
||||
classname : 'class'
|
||||
});
|
@@ -0,0 +1 @@
|
||||
// UK lang variables
|
19
sn_templates/editor_stuff/plugin/liststyle/langs/en.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// UK lang variables
|
||||
|
||||
tinyMCE.addI18n("en.liststyle", {
|
||||
desc : 'List properties',
|
||||
listtype : 'List type',
|
||||
decimal : "Decimal numbers (1, 2, 3, ...)",
|
||||
lalpha : 'Lower alphabetic letters (a, b, c, ...)',
|
||||
ualpha : 'Upper alphabetic letters (A, B, C, ...)',
|
||||
lroman : 'Lower roman numbers (i, ii, iii, ...)',
|
||||
uroman : 'Upper roman numbers (I, II, III...)',
|
||||
disc : 'Disc',
|
||||
circle : 'Circle',
|
||||
square : 'Square',
|
||||
none : 'None',
|
||||
listattributes : 'List attributes',
|
||||
start : 'start',
|
||||
startdesc : '(1, 2, 3, ...)',
|
||||
classname : 'class'
|
||||
});
|
@@ -0,0 +1 @@
|
||||
// UK lang variables
|
80
sn_templates/editor_stuff/plugin/liststyle/liststyle_ol.htm
Normal file
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#liststyle.desc}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="js/liststyle_ol.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="js/liststyle.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<link href="css/liststyle.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="liststyle_ol">
|
||||
<form onsubmit="okayAction();return false;" action="#">
|
||||
<input type="hidden" name="listStyleType" id="listStyleTypeId" />
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#liststyle.desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="2" class="title">{#liststyle.listtype}</td>
|
||||
</tr>
|
||||
<tr id="decimalRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="decimalId" value="decimal" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="decimalId">{#liststyle.decimal}</label></td>
|
||||
</tr>
|
||||
<tr id="laRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="lowerAlphaId" value="lower-alpha" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="lowerAlphaId">{#liststyle.lalpha}</label></td>
|
||||
</tr>
|
||||
<tr id="uaRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="upperAlphaId" value="upper-alpha" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="upperAlphaId">{#liststyle.ualpha}</label></td>
|
||||
</tr>
|
||||
<tr id="lrRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="lowerRomanId" value="lower-roman" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="lowerRomanId">{#liststyle.lroman}</label></td>
|
||||
</tr>
|
||||
<tr id="urRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="upperRomanId" value="upper-roman" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="upperRomanId">{#liststyle.uroman}</label></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="noneId" value="none" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="noneId">{#liststyle.none}</label></td>
|
||||
</tr>-->
|
||||
<!--
|
||||
<tr id="listAttrsRow">
|
||||
<td colspan="2" class="title">{#liststyle.listattributes}</td>
|
||||
</tr>
|
||||
|
||||
<tr id="startRow">
|
||||
<td class="label"><label for="listStartId">{#liststyle.start}</label></td>
|
||||
<td><input name="listStart" type="text" id="listStartId" value="" size="4" maxlength="4" /> {#liststyle.startdesc}</td>
|
||||
</tr>
|
||||
-->
|
||||
<tr id="classNameRow">
|
||||
<td class="label"><label for="startId">{#liststyle.classname}</label></td>
|
||||
<td><input name="classAttr" type="text" id="classAttrId" value="" size="20" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float:left">
|
||||
<input type="submit" id="insert" name="insert" value="{#update}" />
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
67
sn_templates/editor_stuff/plugin/liststyle/liststyle_ul.htm
Normal file
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#liststyle.desc}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="js/liststyle_ul.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="js/liststyle.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<link href="css/liststyle.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="liststyle_ul">
|
||||
<form onsubmit="okayAction();return false;" action="#">
|
||||
<input type="hidden" name="listStyleType" id="listStyleTypeId" />
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#liststyle.desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="2" class="title">{#liststyle.listtype}</td>
|
||||
</tr>
|
||||
<tr id="discRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="discId" value="disc" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="discId">{#liststyle.disc}</label></td>
|
||||
</tr>
|
||||
<!-- <tr id="circleRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="circleId" value="circle" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="circleId">{#liststyle.circle}</label></td>
|
||||
</tr>
|
||||
<tr id="squareRow">
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="squareId" value="square" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="squareId">{#liststyle.square}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="radio"><input type="radio" name="typeRadio" id="noneId" value="none" onclick="setListStyleType(this.value)" class="radio" /></td>
|
||||
<td><label for="noneId">{#liststyle.none}</label></td>
|
||||
</tr>
|
||||
|
||||
<tr id="listAttrsRow">
|
||||
<td colspan="2" class="title">{#liststyle.listattributes}</td>
|
||||
</tr>-->
|
||||
|
||||
<tr id="classNameRow">
|
||||
<td class="label"><label for="startId">{#liststyle.classname}</label></td>
|
||||
<td><input name="classAttr" type="text" id="classAttrId" value="" size="20" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float:left">
|
||||
<input type="submit" id="insert" name="insert" value="{#update}" />
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
177
sn_templates/editor_stuff/plugin/liststyle/plugin_liststyle.html
Normal file
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Plugin: liststyle</title>
|
||||
<link href="css/screen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>
|
||||
Plugin: liststyle
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<p>
|
||||
The List Style plugin allows you to set the list-style-type CSS property on lists within the TinyMCE editor. This plugin caters for both ordered and unordered lists.
|
||||
</p>
|
||||
|
||||
<h3>
|
||||
Installation Instructions
|
||||
</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Copy the liststyle directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
|
||||
</li>
|
||||
<li>
|
||||
Add plugin to TinyMCE plugin option list. Example: plugins : "liststyle".
|
||||
</li>
|
||||
<li>
|
||||
Add the liststyle button to the button list. Example: theme_advanced_button3_add : "liststyle"
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>
|
||||
Initialization Example
|
||||
</h3>
|
||||
<br />
|
||||
<div class="example">
|
||||
<pre>
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
mode : "textareas",
|
||||
plugins : "liststyle",
|
||||
theme_advanced_button3_add : "liststyle"
|
||||
});
|
||||
</pre>
|
||||
</div>
|
||||
<br />
|
||||
<h3>
|
||||
Usage Instructions
|
||||
</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Position the cursor on an item in the list whose style you
|
||||
wish to alter and click the liststyle button.
|
||||
</li>
|
||||
<li>
|
||||
Select the list style type and click "Update".
|
||||
</li>
|
||||
<li>
|
||||
The plugin supports nested lists - the style of the list at the level
|
||||
of the item at the cursor position is altered, not the others.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>
|
||||
License
|
||||
</h3>
|
||||
|
||||
<blockquote>
|
||||
<a href="http://wiki.moxiecode.com/index.php/TinyMCE:License">LGPL 2.0</a>
|
||||
</blockquote>
|
||||
|
||||
<h3>
|
||||
History
|
||||
</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
2008-05-07: Version 3.0 released.
|
||||
<ul>
|
||||
<li>
|
||||
Updated for TinyMCE 3.x.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2007-11-28: Version 1.1.3 released.
|
||||
<ul>
|
||||
<li>
|
||||
Tweaked the popup window height to allow for IE7 security address bar.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2006-08-25: Version 1.1.2 released.
|
||||
<ul>
|
||||
<li>
|
||||
Added Usage instructions.
|
||||
</li>
|
||||
<li>
|
||||
Added support for undo and redo.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2006-03-25: Version 1.1.1 released.
|
||||
<ul>
|
||||
<li>
|
||||
Fixed Javascript error under IE. Thanks to Bryan Costin
|
||||
for highlighting this issue.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2006-03-10: Version 1.1.0 released.
|
||||
<ul>
|
||||
<li>
|
||||
Updated for TinyMCE plugin architecture change introduced in TinyMCE 2.0.3.
|
||||
Use ListStyle 1.0.1 if you are using a TinyMCE 2.0.0 - 2.0.2.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2006-01-30: Version 1.0.2 released.
|
||||
<ul>
|
||||
<li>
|
||||
Fixed error that occurred when invoked on a non-LI element.
|
||||
</li>
|
||||
<li>
|
||||
Consistently use single quotes in plugin.
|
||||
</li>
|
||||
<li>
|
||||
Added compressed plugin file.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2005-10-11: Version 1.0.1 released. Changes made thanks to spocke:
|
||||
<ul>
|
||||
<li>
|
||||
Fixed so it uses inst.getFocusElement instead of the deprecated tinyMCE.selectedElement.
|
||||
</li>
|
||||
<li>
|
||||
Moved the style information to a separate .css file.
|
||||
</li>
|
||||
<li>
|
||||
Made it possible for translation of all labels.
|
||||
</li>
|
||||
<li>
|
||||
Translated the plugin into Swedish.
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
2005-10-07: Version 1.0 released.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<div class="helpindexlink">
|
||||
<a href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">TinyMCE Documentation</a>
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
Copyright 2005-2008 PolicyPoint Technologies Pty. Ltd.
|
||||
</div>
|
||||
<br style="clear:both;" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
sn_templates/editor_stuff/plugin/snstuff/css/content.css
Normal file
@@ -0,0 +1 @@
|
||||
.snVideo{border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;background-image:url(../images/video.png);}
|
14
sn_templates/editor_stuff/plugin/snstuff/css/default.css
Normal file
@@ -0,0 +1,14 @@
|
||||
#src_list, #over_list, #out_list {width:280px;}
|
||||
#video{display:none;}
|
||||
.mceActionPanel {margin-top:7px;}
|
||||
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
||||
.checkbox {border:0;}
|
||||
.panel_wrapper div.current {height:470px;}
|
||||
#prev, #prev2 {margin:0; border:1px solid #000; width:428px; height:260px; overflow:auto;}
|
||||
#align, #classlist {width:150px;}
|
||||
#width, #height {vertical-align:middle; width:50px; text-align:center;}
|
||||
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
|
||||
#class_list {width:180px;}
|
||||
/* input {width: 100px;} */
|
||||
#constrain, #onmousemovecheck {width:auto;}
|
||||
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
|
618
sn_templates/editor_stuff/plugin/snstuff/editor_plugin.js
Normal file
@@ -0,0 +1,618 @@
|
||||
(function() {
|
||||
|
||||
tinymce.create('tinymce.plugins.SNStuff', {
|
||||
|
||||
//// ImageUpload
|
||||
init : function(ed, url) {
|
||||
ed.onInit.add(function() {
|
||||
if (ed.settings.content_css !== false)
|
||||
ed.dom.loadCSS(url + "/css/content.css");
|
||||
});
|
||||
|
||||
ed.addCommand('mceSNImages', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/image.html',
|
||||
width : 490,
|
||||
height : 550,
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('snimages', {
|
||||
title : 'snstuff.img_desc',
|
||||
cmd : 'mceSNImages',
|
||||
image : url + '/images/insert-image.png'
|
||||
});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('snimages', n.nodeName == 'IMG');
|
||||
});
|
||||
|
||||
|
||||
/// Link
|
||||
ed.addCommand('mceSNLink', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/link.html',
|
||||
width : 500 + parseInt(ed.getLang('snstuff.snlink_delta_width', 0)),
|
||||
height : 180 + parseInt(ed.getLang('snstuff.snlink_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('snlink', {title : 'snstuff.lnk_desc', cmd : 'mceSNLink', image: url+'/images/insert-link.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('snlink', false);
|
||||
var node = n;
|
||||
while(node != null){
|
||||
if(node.nodeName == 'A'){
|
||||
cm.setActive('snlink', true);
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/// Code
|
||||
ed.addCommand('mceSNCode', function() {
|
||||
|
||||
handleSNCode(ed,url);
|
||||
|
||||
});
|
||||
ed.addButton('sncode', {title : 'snstuff.code_desc', cmd : 'mceSNCode', image: url+'/images/code-context.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('sncode', n.nodeName == 'CODE');
|
||||
});
|
||||
|
||||
/// Infobox
|
||||
ed.addCommand('mceSNInfoBox', function() { handleSNInfoBox(ed, url)});
|
||||
ed.addCommand('mceSNInfoBoxHead', function() { handleSNInfoBoxHead(ed, url) });
|
||||
|
||||
|
||||
ed.addButton('sninfobox', {title : 'snstuff.infobox_desc', cmd : 'mceSNInfoBox', image: url+'/images/textinfo.png'});
|
||||
ed.addButton('sninfoboxhead', {title : 'snstuff.infoboxhead_desc', cmd : 'mceSNInfoBoxHead', image: url+'/images/textinfo_head.png'});
|
||||
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
var scas = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBox");}) != null;
|
||||
var scae = ed.dom.getParent(ed.selection.getEnd(), function(n) {return ed.dom.hasClass(n, "snInfoBox");}) != null;
|
||||
var sca = scas && scae;
|
||||
var scbs = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");}) != null;
|
||||
var scbe = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");}) != null;
|
||||
var scb = scbs && scbe;
|
||||
|
||||
var cs = ed.selection.getContent().length > 0;
|
||||
cm.setDisabled('sninfobox', scae != scas);
|
||||
cm.setDisabled('sninfoboxhead', (!((sca && cs) || scb) || scae != scas));
|
||||
cm.setActive('sninfobox', sca);
|
||||
cm.setActive('sninfoboxhead', scb);
|
||||
});
|
||||
|
||||
/// Quote
|
||||
ed.addCommand('mceSNQuote', function() {
|
||||
|
||||
handleSNQuote(ed,url);
|
||||
|
||||
});
|
||||
ed.addButton('snquote', {title : 'snstuff.quote_desc', cmd : 'mceSNQuote', image: url+'/images/quote.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
|
||||
cm.setActive('snquote', n.nodeName == 'BLOCKQUOTE');
|
||||
});
|
||||
|
||||
/// LinkVorschlag
|
||||
Proposals.url = url;
|
||||
ed.addCommand('mceSNProposals', function(ui,v) {
|
||||
Proposals.findWordAll(ed);
|
||||
});
|
||||
ed.onKeyUp.add(
|
||||
function(ed,e){
|
||||
var an = ed.dom.getParent(ed.selection.getNode(),function(n){return n.nodeName == 'A'});
|
||||
if(an == null && e.keyCode == 32){
|
||||
var cm = ed.selection.getBookmark();
|
||||
var ps = ed.dom.get(cm.id+'_start').previousSibling;
|
||||
var pos = ps.nodeValue.length;
|
||||
ed.selection.moveToBookmark(cm);
|
||||
Proposals.findWord(ed,ps,pos);
|
||||
}else{
|
||||
Proposals.closeWin();
|
||||
}
|
||||
}
|
||||
);
|
||||
ed.addButton('snproposals', {title : 'snstuff.proposals_desc', cmd : 'mceSNProposals', image: url+'/images/proposals.png'});
|
||||
|
||||
ed.onLoadContent.add( SNStuffContentCounter.counter );
|
||||
ed.onChange.add( SNStuffContentCounter.counter );
|
||||
ed.onUndo.add( SNStuffContentCounter.counter );
|
||||
ed.onRedo.add( SNStuffContentCounter.counter );
|
||||
|
||||
ed.onKeyPress.add( SNStuffContentCounter.counter );
|
||||
|
||||
|
||||
}, // init
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'SN-Stuff (ImageUpload, Quote, Code, Link, etc.)',
|
||||
author : 'Member from .de',
|
||||
authorurl : 'http://www..de',
|
||||
infourl : 'http://www..de',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add('snstuff', tinymce.plugins.SNStuff);
|
||||
})();
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
var Proposals = {
|
||||
url: '',
|
||||
// ajaxBlock: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_block"),
|
||||
// ajaxLink: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_link"),
|
||||
|
||||
// ajaxBlock: "/ajax_block",
|
||||
// ajaxLink: "/ajax_link",
|
||||
proposalsFrame: undefined,
|
||||
proposalsFrameBody: undefined,
|
||||
proposalsFrameId: Math.round(Math.random()*1000),
|
||||
|
||||
running: false,
|
||||
cancel: function(){
|
||||
if(this.running){
|
||||
this.running = false;
|
||||
}
|
||||
},
|
||||
|
||||
findWord: function(ed, node,pos){
|
||||
running = true;
|
||||
var ntn = node;
|
||||
var word;
|
||||
var txt = node.nodeValue.substr(0,pos);
|
||||
word = txt.replace(/ $/,'').split(/ /).pop();
|
||||
if(word.length > 0){
|
||||
this.getProposals(ed,ntn, word, pos, false);
|
||||
}
|
||||
},// find word
|
||||
|
||||
findWordAll: function(ed){
|
||||
running = true;
|
||||
var wl = new Array();
|
||||
this._getContentWordList(ed.getBody(),wl);
|
||||
this.getProposals(ed,null,wl.join('+'),-1,true);
|
||||
},
|
||||
|
||||
getProposals: function(ed,node, word, pos, block){
|
||||
var po = this;
|
||||
if(!running){return;}
|
||||
|
||||
tinymce.util.XHR.send({
|
||||
url : block ? tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_block", "/ajax_block")
|
||||
: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_link","/ajax_link"),
|
||||
content_type : "application/json",
|
||||
type : "POST",
|
||||
data : block ? "sn_msgbody="+escape(word) : "sn_key="+escape(word),
|
||||
async : true,
|
||||
scope : po,
|
||||
|
||||
success : function( data, req, o ) {
|
||||
var obj = tinymce.util.JSON.parse(data);
|
||||
po.showProposals(obj, ed, node, pos, block);
|
||||
},
|
||||
|
||||
error : function( type, req, o ){ alert("ERROR:"+type+"\n"+req+" - "+o);}
|
||||
});
|
||||
},
|
||||
|
||||
closeWin: function(){
|
||||
this.cancel();
|
||||
if(this.proposalsFrame && this.proposalsFrame.style.display != 'none'){
|
||||
this.proposalsFrame.style.display = 'none';
|
||||
}
|
||||
},
|
||||
showProposals:function(obj, ed, node, pos, block){
|
||||
if(!running){return;}
|
||||
// remove used Lnk
|
||||
tinymce.grep(ed.dom.select("a"), function(n) {
|
||||
var h = n.getAttributeNode('href');
|
||||
if(h != null){
|
||||
var v = h.nodeValue;
|
||||
for(var e in obj){
|
||||
if(v == obj[e].Link){
|
||||
delete obj[e];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(!this.proposalsFrame){this._buildFrame();}
|
||||
|
||||
var pf = this.proposalsFrameBody;
|
||||
while(pf.hasChildNodes()){
|
||||
pf.removeChild(pf.firstChild);
|
||||
}
|
||||
if(!obj){return;}
|
||||
for(var i = 0; i < obj.length; i++){
|
||||
if(!obj[i]){continue;}
|
||||
|
||||
var o = obj[i];
|
||||
var bgColor = (i%2 == 0) ? "#FFFAB3":"#FFFE9A";
|
||||
var root = this._buildHTMLElement("DIV","lnkBody_"+i,"border-bottom:black 1px solid;background-color:"+bgColor);
|
||||
var lnk = this._buildHTMLElement("IMG","lnkLnk_"+i,"float:right;cursor:pointer");
|
||||
var desc = this._buildHTMLElement("DIV", "lnkDesc_"+i, "",o.Comment);
|
||||
var prevLnk = this._buildHTMLElement("A","lnkPrevLnk_"+i,"", o.Link);
|
||||
var keyword = this._buildHTMLElement("DIV","lnkKeyWord_"+i, "font-weight:bold", o.Key);
|
||||
var small = this._buildHTMLElement("SMALL","lnkSmall_"+i);
|
||||
small.appendChild(prevLnk);
|
||||
lnk.src = this.url+"/images/add.png";
|
||||
lnk.alt = "Link einfügen";
|
||||
lnk.title = "Das Wort \""+o.Key+"\" im Text verlinken";
|
||||
prevLnk.href = o.Link;
|
||||
prevLnk.target = "blank";
|
||||
|
||||
root.appendChild(keyword); keyword.appendChild(lnk); root.appendChild(desc);root.appendChild(small);
|
||||
this._setOnclickEvent(lnk, {obj:o,block:block,ed:ed,node:node,pos:pos});
|
||||
pf.appendChild(root);
|
||||
}
|
||||
if(this.proposalsFrameBody.hasChildNodes()){
|
||||
this.proposalsFrame.style.display = "block";
|
||||
}
|
||||
},
|
||||
_setOnclickEvent:function(lnk, o){
|
||||
var p = this;
|
||||
lnk.onclick = function(){p._insertAction(o,this)};
|
||||
},
|
||||
_insertAction:function(o,fn){
|
||||
if(!o.block){
|
||||
this._insertLink(o);
|
||||
this.closeWin();
|
||||
}else{
|
||||
var fw = this._findWord(o.ed.getBody(),o.obj.Key);
|
||||
if(fw){
|
||||
this._insertLink(fw.node,fw.pos,o.obj.Link,o.ed);
|
||||
var pe = fn.parentNode.parentNode;
|
||||
pe.parentNode.removeChild(pe);
|
||||
if(!this.proposalsFrameBody.hasChildNodes()){
|
||||
this.proposalsFrame.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_insertLink: function(o){
|
||||
var node = o.node; var pos = o.pos; var lnk = o.obj.Link; var ed = o.ed;
|
||||
|
||||
var nv = node.nodeValue;
|
||||
var pre = nv.substring(0,pos).replace(/ $/,'').split(/ /);
|
||||
var post = " "+nv.substr(pos);
|
||||
var w = pre.pop();
|
||||
var a = ed.getDoc().createElement('A');
|
||||
var ha = ed.getDoc().createAttribute("href");
|
||||
var tit = ed.getDoc().createAttribute("title");
|
||||
|
||||
tit.nodeValue=o.obj.Comment;
|
||||
ha.nodeValue = lnk;
|
||||
a.setAttributeNode(ha);
|
||||
a.setAttributeNode(tit);
|
||||
a.appendChild(ed.getDoc().createTextNode(w));
|
||||
|
||||
var pnode = node.parentNode;
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
pnode.insertBefore(ed.getDoc().createTextNode(pre.join(' ')+' '),node);
|
||||
pnode.insertBefore(a,node);
|
||||
pnode.insertBefore(ed.getDoc().createTextNode(post),node);
|
||||
pnode.removeChild(node);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
ed.focus();
|
||||
ed.selection.select(a);
|
||||
ed.selection.collapse();
|
||||
},
|
||||
|
||||
_findWord: function(doc, word){
|
||||
var node = doc;
|
||||
var w;
|
||||
while(node != null){
|
||||
if(node.nodeType == 1 && node.nodeName != "A"){
|
||||
w = this._findWord(node.firstChild,word);
|
||||
if(w){ return w;}
|
||||
}
|
||||
|
||||
if(node.nodeType == 3){
|
||||
var txt = node.nodeValue.toLowerCase();
|
||||
var p = txt.indexOf(word.toLowerCase());
|
||||
if(p != -1){
|
||||
return {pos:p+word.length, node: node};
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
return w;
|
||||
},
|
||||
|
||||
_getContentWordList: function(doc, wlist){
|
||||
var node = doc;
|
||||
|
||||
while(node != null){
|
||||
if(node.nodeType == 1 && node.nodeName != "A"){
|
||||
this._getContentWordList(node.firstChild, wlist);
|
||||
}
|
||||
|
||||
if(node.nodeType == 3){
|
||||
var lst = node.nodeValue.split(/ /);
|
||||
while(lst.length > 0){
|
||||
var s = lst.pop().replace(/\s/g,"");
|
||||
if(s != ""){
|
||||
wlist.push(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
},
|
||||
///////////////////////
|
||||
_buildFrame: function(){
|
||||
var container = tinyMCE.activeEditor.getContentAreaContainer();
|
||||
var ot = container.offsetTop;
|
||||
var ol = container.offsetLeft + container.offsetWidth;
|
||||
|
||||
if(document.getElementsByTagName("body")[0].offsetWidth < ol+355){
|
||||
ol = document.getElementsByTagName("body")[0].offsetWidth - 360;
|
||||
}
|
||||
|
||||
var pa = (document.all) ? "absolute":"fixed";
|
||||
|
||||
var p = this._buildHTMLElement("DIV", "proposalsFrame","position:"+pa+";width:350px;left:"+ol+"px;top:"+ot+"px;padding:5px;background-color:#FFFE9A;border:solid black 1px;");
|
||||
var h = this._buildHTMLElement("DIV", "proposalsFrameHead","border-bottom:black 1px solid;font-weight:bold;background-color:#FFF27A;cursor:pointer;padding:2px;","Tipps zum Thema");
|
||||
var b = this._buildHTMLElement("DIV", "proposalsFrameBody","min-height:100px;max-height:300px;overflow:auto;padding:5px;");
|
||||
var c = this._buildHTMLElement("IMG", "proposalsFrameClose","float:right");
|
||||
|
||||
|
||||
h.onmousedown = function(){
|
||||
var p = this.parentNode;
|
||||
var ox,oy;
|
||||
this.onmouseup = function(){p.onmousemove = function(){}; p.onmouseout = function(){}}
|
||||
var m = function(ev){
|
||||
var px = (!ev) ? window.event.clientX : ev.pageX;var py = (!ev) ? window.event.clientY : ev.pageY;
|
||||
if(!ox){oy = py - parseInt(this.style.top); ox = px - parseInt(this.style.left); }
|
||||
this.style.left = (px-ox)+"px"; this.style.top = (py-oy)+"px";
|
||||
return false;
|
||||
}
|
||||
p.onmousemove = m;p.onmouseout = m;
|
||||
return false;
|
||||
}
|
||||
|
||||
var me = this;
|
||||
c.onclick = function(){me.closeWin()};
|
||||
|
||||
c.alt = "X";
|
||||
c.src = this.url+'/images/close.png';
|
||||
c.alt = "Fenster schlissen";
|
||||
c.title = "Fenster schliessen";
|
||||
|
||||
h.insertBefore(c,h.firstChild);
|
||||
p.appendChild(h); p.appendChild(b)
|
||||
|
||||
this.proposalsFrame = p;
|
||||
this.proposalsFrameBody = b;
|
||||
|
||||
document.getElementsByTagName("body")[0].appendChild(p);
|
||||
},
|
||||
|
||||
_buildHTMLElement: function(n, id, style, txt){
|
||||
var e = document.createElement(n);
|
||||
var an = document.createAttribute("id");
|
||||
an.nodeValue = id+"_"+this.proposalsFrameId;
|
||||
var clazz = document.createAttribute("class");
|
||||
clazz.nodeValue = id;
|
||||
e.setAttributeNode(clazz);
|
||||
e.setAttributeNode(an);
|
||||
|
||||
e.style.cssText = style;
|
||||
if(txt){ e.appendChild( document.createTextNode(txt)); }
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
function handleSNCode(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
var isBlock = (enode != null && enode.nodeName == 'CODE');
|
||||
|
||||
if(isBlock){
|
||||
|
||||
// Remove element
|
||||
if(enode.nodeName == 'CODE'){
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
|
||||
if(sel.length == 0 ){
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/code.html',
|
||||
width : 410 + parseInt(ed.getLang('snstuff.snlink_delta_width', 0)),
|
||||
height : 480 + parseInt(ed.getLang('snstuff.snlink_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
}else{
|
||||
ed.execCommand('mceInsertContent', false, '<code>'+ed.selection.getContent()+'</code>', {skip_undo : 1});
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
|
||||
}
|
||||
|
||||
function handleSNQuote(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
var isBlock = (enode != null && enode.nodeName == 'BLOCKQUOTE');
|
||||
|
||||
if(isBlock){
|
||||
|
||||
// Remove element
|
||||
if(enode.nodeName == 'BLOCKQUOTE'){
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
|
||||
if(sel.length == 0 ){
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/quote.html',
|
||||
width : 410 + parseInt(ed.getLang('snstuff.snquote_delta_width', 0)),
|
||||
height : 480 + parseInt(ed.getLang('snstuff.snquote_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
}else{
|
||||
ed.execCommand('mceInsertContent', false, '<blockquote>'+ed.selection.getContent()+'</blockquote>', {skip_undo : 1});
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function handleSNInfoBox(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/infobox.html',
|
||||
width : 250+ parseInt(ed.getLang('snstuff.snquote_delta_width', 0)),
|
||||
height : 100 + parseInt(ed.getLang('snstuff.snquote_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
node: enode,
|
||||
plugin_url : url
|
||||
});
|
||||
}
|
||||
|
||||
function handleSNInfoBoxHead(ed, url){
|
||||
var enode = ed.dom.getParent(ed.selection.getNode(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");})
|
||||
var sel = ed.selection.getContent();
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
if(sel.length > 0){
|
||||
ed.execCommand('mceInsertRawHTML', false, '<span id="__snInfoBoxHeadTmp">'+ed.selection.getContent()+'</span>',{skip_undo : 1});
|
||||
ed.dom.setAttribs('__snInfoBoxHeadTmp', {style:"", class:"snInfoBoxHead"});
|
||||
ed.dom.setAttrib('__snInfoBoxHeadTmp', 'id', '');
|
||||
}else{
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
SNStuffContentCounter = {
|
||||
elm: Array(),
|
||||
|
||||
isInit:false,
|
||||
init: function(ed){
|
||||
|
||||
var elm = ed.getParam("snstuff_contentcounter","").replace(/ /g,"").split(",");
|
||||
for(var e = 0; e < elm.length; e++){
|
||||
var l = new Object();
|
||||
|
||||
var cv = ed.getParam("snstuff_charcolor_"+elm[e],"none").replace(/ /g,"");
|
||||
|
||||
if(cv != "none"){
|
||||
var a = new Array();
|
||||
cc = cv.split(",");
|
||||
for(var cci = 0; cci < cc.length; cci++){
|
||||
var v = cc[cci].split(":");
|
||||
a.push({v:v[0],c:v[1]});
|
||||
}
|
||||
l.c = a.sort(function(a,b){return a.v-b.v});
|
||||
}
|
||||
|
||||
var wv = ed.getParam("snstuff_wordcolor_"+elm[e],"none").replace(/ /g,"");
|
||||
|
||||
if(wv != "none"){
|
||||
var a = new Array();
|
||||
wc = wv.split(",");
|
||||
for(var wci = 0; wci < wc.length; wci++){
|
||||
var v = wc[wci].split(":");
|
||||
a.push({v:v[0],c:v[1]});
|
||||
}
|
||||
l.w = a.sort(function(a,b){return a.v-b.v});
|
||||
}
|
||||
|
||||
this.elm[elm[e]] = l;
|
||||
|
||||
}
|
||||
|
||||
this.isInit = true;
|
||||
},
|
||||
|
||||
counter : function(ed,e){
|
||||
if(!SNStuffContentCounter.isInit){
|
||||
SNStuffContentCounter.init(ed);
|
||||
}
|
||||
if(SNStuffContentCounter.elm[ed.id]){
|
||||
var c = ed.getContent().replace(/<br \/>/g," ").replace(/<.+?>/g,"").replace(/ {1,}/g," ").replace(/^ | $/g,"");
|
||||
var cl = c.length;
|
||||
var wl = c.split(" ").length;
|
||||
var p = tinymce.DOM.get(ed.id + '_path_row');
|
||||
html = "";
|
||||
|
||||
var cvl = SNStuffContentCounter.elm[ed.id];
|
||||
if(cvl.c){
|
||||
var col = "";
|
||||
for(var i = 0; i < cvl.c.length; i++){
|
||||
if(cl > cvl.c[i].v){
|
||||
col = "color:"+cvl.c[i].c;
|
||||
}
|
||||
}
|
||||
html += ' <span style="'+col+'"> Zeichen:'+cl+' </span> ';
|
||||
}
|
||||
|
||||
if(cvl.w){
|
||||
|
||||
var col = "";
|
||||
for(var i = 0; i < cvl.w.length; i++){
|
||||
if(wl > cvl.w[i].v){
|
||||
col = "color:"+cvl.w[i].c;
|
||||
}
|
||||
}
|
||||
html += ' <span style="'+col+'"> Wörter:'+wl+' </span> ';
|
||||
}
|
||||
tinymce.DOM.setHTML(p,html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
618
sn_templates/editor_stuff/plugin/snstuff/editor_plugin_src.js
Normal file
@@ -0,0 +1,618 @@
|
||||
(function() {
|
||||
|
||||
tinymce.create('tinymce.plugins.SNStuff', {
|
||||
|
||||
//// ImageUpload
|
||||
init : function(ed, url) {
|
||||
ed.onInit.add(function() {
|
||||
if (ed.settings.content_css !== false)
|
||||
ed.dom.loadCSS(url + "/css/content.css");
|
||||
});
|
||||
|
||||
ed.addCommand('mceSNImages', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/image.html',
|
||||
width : 490,
|
||||
height : 550,
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('snimages', {
|
||||
title : 'snstuff.img_desc',
|
||||
cmd : 'mceSNImages',
|
||||
image : url + '/images/insert-image.png'
|
||||
});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('snimages', n.nodeName == 'IMG');
|
||||
});
|
||||
|
||||
|
||||
/// Link
|
||||
ed.addCommand('mceSNLink', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/link.html',
|
||||
width : 500 + parseInt(ed.getLang('snstuff.snlink_delta_width', 0)),
|
||||
height : 180 + parseInt(ed.getLang('snstuff.snlink_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('snlink', {title : 'snstuff.lnk_desc', cmd : 'mceSNLink', image: url+'/images/insert-link.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('snlink', false);
|
||||
var node = n;
|
||||
while(node != null){
|
||||
if(node.nodeName == 'A'){
|
||||
cm.setActive('snlink', true);
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/// Code
|
||||
ed.addCommand('mceSNCode', function() {
|
||||
|
||||
handleSNCode(ed,url);
|
||||
|
||||
});
|
||||
ed.addButton('sncode', {title : 'snstuff.code_desc', cmd : 'mceSNCode', image: url+'/images/code-context.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('sncode', n.nodeName == 'CODE');
|
||||
});
|
||||
|
||||
/// Infobox
|
||||
ed.addCommand('mceSNInfoBox', function() { handleSNInfoBox(ed, url)});
|
||||
ed.addCommand('mceSNInfoBoxHead', function() { handleSNInfoBoxHead(ed, url) });
|
||||
|
||||
|
||||
ed.addButton('sninfobox', {title : 'snstuff.infobox_desc', cmd : 'mceSNInfoBox', image: url+'/images/textinfo.png'});
|
||||
ed.addButton('sninfoboxhead', {title : 'snstuff.infoboxhead_desc', cmd : 'mceSNInfoBoxHead', image: url+'/images/textinfo_head.png'});
|
||||
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
var scas = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBox");}) != null;
|
||||
var scae = ed.dom.getParent(ed.selection.getEnd(), function(n) {return ed.dom.hasClass(n, "snInfoBox");}) != null;
|
||||
var sca = scas && scae;
|
||||
var scbs = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");}) != null;
|
||||
var scbe = ed.dom.getParent(ed.selection.getStart(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");}) != null;
|
||||
var scb = scbs && scbe;
|
||||
|
||||
var cs = ed.selection.getContent().length > 0;
|
||||
cm.setDisabled('sninfobox', scae != scas);
|
||||
cm.setDisabled('sninfoboxhead', (!((sca && cs) || scb) || scae != scas));
|
||||
cm.setActive('sninfobox', sca);
|
||||
cm.setActive('sninfoboxhead', scb);
|
||||
});
|
||||
|
||||
/// Quote
|
||||
ed.addCommand('mceSNQuote', function() {
|
||||
|
||||
handleSNQuote(ed,url);
|
||||
|
||||
});
|
||||
ed.addButton('snquote', {title : 'snstuff.quote_desc', cmd : 'mceSNQuote', image: url+'/images/quote.png'});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
|
||||
cm.setActive('snquote', n.nodeName == 'BLOCKQUOTE');
|
||||
});
|
||||
|
||||
/// LinkVorschlag
|
||||
Proposals.url = url;
|
||||
ed.addCommand('mceSNProposals', function(ui,v) {
|
||||
Proposals.findWordAll(ed);
|
||||
});
|
||||
ed.onKeyUp.add(
|
||||
function(ed,e){
|
||||
var an = ed.dom.getParent(ed.selection.getNode(),function(n){return n.nodeName == 'A'});
|
||||
if(an == null && e.keyCode == 32){
|
||||
var cm = ed.selection.getBookmark();
|
||||
var ps = ed.dom.get(cm.id+'_start').previousSibling;
|
||||
var pos = ps.nodeValue.length;
|
||||
ed.selection.moveToBookmark(cm);
|
||||
Proposals.findWord(ed,ps,pos);
|
||||
}else{
|
||||
Proposals.closeWin();
|
||||
}
|
||||
}
|
||||
);
|
||||
ed.addButton('snproposals', {title : 'snstuff.proposals_desc', cmd : 'mceSNProposals', image: url+'/images/proposals.png'});
|
||||
|
||||
ed.onLoadContent.add( SNStuffContentCounter.counter );
|
||||
ed.onChange.add( SNStuffContentCounter.counter );
|
||||
ed.onUndo.add( SNStuffContentCounter.counter );
|
||||
ed.onRedo.add( SNStuffContentCounter.counter );
|
||||
|
||||
ed.onKeyPress.add( SNStuffContentCounter.counter );
|
||||
|
||||
|
||||
}, // init
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'SN-Stuff (ImageUpload, Quote, Code, Link, etc.)',
|
||||
author : 'Member from .de',
|
||||
authorurl : 'http://www..de',
|
||||
infourl : 'http://www..de',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add('snstuff', tinymce.plugins.SNStuff);
|
||||
})();
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
var Proposals = {
|
||||
url: '',
|
||||
// ajaxBlock: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_block"),
|
||||
// ajaxLink: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_link"),
|
||||
|
||||
// ajaxBlock: "/ajax_block",
|
||||
// ajaxLink: "/ajax_link",
|
||||
proposalsFrame: undefined,
|
||||
proposalsFrameBody: undefined,
|
||||
proposalsFrameId: Math.round(Math.random()*1000),
|
||||
|
||||
running: false,
|
||||
cancel: function(){
|
||||
if(this.running){
|
||||
this.running = false;
|
||||
}
|
||||
},
|
||||
|
||||
findWord: function(ed, node,pos){
|
||||
running = true;
|
||||
var ntn = node;
|
||||
var word;
|
||||
var txt = node.nodeValue.substr(0,pos);
|
||||
word = txt.replace(/ $/,'').split(/ /).pop();
|
||||
if(word.length > 0){
|
||||
this.getProposals(ed,ntn, word, pos, false);
|
||||
}
|
||||
},// find word
|
||||
|
||||
findWordAll: function(ed){
|
||||
running = true;
|
||||
var wl = new Array();
|
||||
this._getContentWordList(ed.getBody(),wl);
|
||||
this.getProposals(ed,null,wl.join('+'),-1,true);
|
||||
},
|
||||
|
||||
getProposals: function(ed,node, word, pos, block){
|
||||
var po = this;
|
||||
if(!running){return;}
|
||||
|
||||
tinymce.util.XHR.send({
|
||||
url : block ? tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_block", "/ajax_block")
|
||||
: tinyMCE.activeEditor.getParam("snstuff_proposals_ajax_link","/ajax_link"),
|
||||
content_type : "application/json",
|
||||
type : "POST",
|
||||
data : block ? "sn_msgbody="+escape(word) : "sn_key="+escape(word),
|
||||
async : true,
|
||||
scope : po,
|
||||
|
||||
success : function( data, req, o ) {
|
||||
var obj = tinymce.util.JSON.parse(data);
|
||||
po.showProposals(obj, ed, node, pos, block);
|
||||
},
|
||||
|
||||
error : function( type, req, o ){ alert("ERROR:"+type+"\n"+req+" - "+o);}
|
||||
});
|
||||
},
|
||||
|
||||
closeWin: function(){
|
||||
this.cancel();
|
||||
if(this.proposalsFrame && this.proposalsFrame.style.display != 'none'){
|
||||
this.proposalsFrame.style.display = 'none';
|
||||
}
|
||||
},
|
||||
showProposals:function(obj, ed, node, pos, block){
|
||||
if(!running){return;}
|
||||
// remove used Lnk
|
||||
tinymce.grep(ed.dom.select("a"), function(n) {
|
||||
var h = n.getAttributeNode('href');
|
||||
if(h != null){
|
||||
var v = h.nodeValue;
|
||||
for(var e in obj){
|
||||
if(v == obj[e].Link){
|
||||
delete obj[e];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(!this.proposalsFrame){this._buildFrame();}
|
||||
|
||||
var pf = this.proposalsFrameBody;
|
||||
while(pf.hasChildNodes()){
|
||||
pf.removeChild(pf.firstChild);
|
||||
}
|
||||
if(!obj){return;}
|
||||
for(var i = 0; i < obj.length; i++){
|
||||
if(!obj[i]){continue;}
|
||||
|
||||
var o = obj[i];
|
||||
var bgColor = (i%2 == 0) ? "#FFFAB3":"#FFFE9A";
|
||||
var root = this._buildHTMLElement("DIV","lnkBody_"+i,"border-bottom:black 1px solid;background-color:"+bgColor);
|
||||
var lnk = this._buildHTMLElement("IMG","lnkLnk_"+i,"float:right;cursor:pointer");
|
||||
var desc = this._buildHTMLElement("DIV", "lnkDesc_"+i, "",o.Comment);
|
||||
var prevLnk = this._buildHTMLElement("A","lnkPrevLnk_"+i,"", o.Link);
|
||||
var keyword = this._buildHTMLElement("DIV","lnkKeyWord_"+i, "font-weight:bold", o.Key);
|
||||
var small = this._buildHTMLElement("SMALL","lnkSmall_"+i);
|
||||
small.appendChild(prevLnk);
|
||||
lnk.src = this.url+"/images/add.png";
|
||||
lnk.alt = "Link einfügen";
|
||||
lnk.title = "Das Wort \""+o.Key+"\" im Text verlinken";
|
||||
prevLnk.href = o.Link;
|
||||
prevLnk.target = "blank";
|
||||
|
||||
root.appendChild(keyword); keyword.appendChild(lnk); root.appendChild(desc);root.appendChild(small);
|
||||
this._setOnclickEvent(lnk, {obj:o,block:block,ed:ed,node:node,pos:pos});
|
||||
pf.appendChild(root);
|
||||
}
|
||||
if(this.proposalsFrameBody.hasChildNodes()){
|
||||
this.proposalsFrame.style.display = "block";
|
||||
}
|
||||
},
|
||||
_setOnclickEvent:function(lnk, o){
|
||||
var p = this;
|
||||
lnk.onclick = function(){p._insertAction(o,this)};
|
||||
},
|
||||
_insertAction:function(o,fn){
|
||||
if(!o.block){
|
||||
this._insertLink(o);
|
||||
this.closeWin();
|
||||
}else{
|
||||
var fw = this._findWord(o.ed.getBody(),o.obj.Key);
|
||||
if(fw){
|
||||
this._insertLink(fw.node,fw.pos,o.obj.Link,o.ed);
|
||||
var pe = fn.parentNode.parentNode;
|
||||
pe.parentNode.removeChild(pe);
|
||||
if(!this.proposalsFrameBody.hasChildNodes()){
|
||||
this.proposalsFrame.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_insertLink: function(o){
|
||||
var node = o.node; var pos = o.pos; var lnk = o.obj.Link; var ed = o.ed;
|
||||
|
||||
var nv = node.nodeValue;
|
||||
var pre = nv.substring(0,pos).replace(/ $/,'').split(/ /);
|
||||
var post = " "+nv.substr(pos);
|
||||
var w = pre.pop();
|
||||
var a = ed.getDoc().createElement('A');
|
||||
var ha = ed.getDoc().createAttribute("href");
|
||||
var tit = ed.getDoc().createAttribute("title");
|
||||
|
||||
tit.nodeValue=o.obj.Comment;
|
||||
ha.nodeValue = lnk;
|
||||
a.setAttributeNode(ha);
|
||||
a.setAttributeNode(tit);
|
||||
a.appendChild(ed.getDoc().createTextNode(w));
|
||||
|
||||
var pnode = node.parentNode;
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
pnode.insertBefore(ed.getDoc().createTextNode(pre.join(' ')+' '),node);
|
||||
pnode.insertBefore(a,node);
|
||||
pnode.insertBefore(ed.getDoc().createTextNode(post),node);
|
||||
pnode.removeChild(node);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
ed.focus();
|
||||
ed.selection.select(a);
|
||||
ed.selection.collapse();
|
||||
},
|
||||
|
||||
_findWord: function(doc, word){
|
||||
var node = doc;
|
||||
var w;
|
||||
while(node != null){
|
||||
if(node.nodeType == 1 && node.nodeName != "A"){
|
||||
w = this._findWord(node.firstChild,word);
|
||||
if(w){ return w;}
|
||||
}
|
||||
|
||||
if(node.nodeType == 3){
|
||||
var txt = node.nodeValue.toLowerCase();
|
||||
var p = txt.indexOf(word.toLowerCase());
|
||||
if(p != -1){
|
||||
return {pos:p+word.length, node: node};
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
return w;
|
||||
},
|
||||
|
||||
_getContentWordList: function(doc, wlist){
|
||||
var node = doc;
|
||||
|
||||
while(node != null){
|
||||
if(node.nodeType == 1 && node.nodeName != "A"){
|
||||
this._getContentWordList(node.firstChild, wlist);
|
||||
}
|
||||
|
||||
if(node.nodeType == 3){
|
||||
var lst = node.nodeValue.split(/ /);
|
||||
while(lst.length > 0){
|
||||
var s = lst.pop().replace(/\s/g,"");
|
||||
if(s != ""){
|
||||
wlist.push(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
},
|
||||
///////////////////////
|
||||
_buildFrame: function(){
|
||||
var container = tinyMCE.activeEditor.getContentAreaContainer();
|
||||
var ot = container.offsetTop;
|
||||
var ol = container.offsetLeft + container.offsetWidth;
|
||||
|
||||
if(document.getElementsByTagName("body")[0].offsetWidth < ol+355){
|
||||
ol = document.getElementsByTagName("body")[0].offsetWidth - 360;
|
||||
}
|
||||
|
||||
var pa = (document.all) ? "absolute":"fixed";
|
||||
|
||||
var p = this._buildHTMLElement("DIV", "proposalsFrame","position:"+pa+";width:350px;left:"+ol+"px;top:"+ot+"px;padding:5px;background-color:#FFFE9A;border:solid black 1px;");
|
||||
var h = this._buildHTMLElement("DIV", "proposalsFrameHead","border-bottom:black 1px solid;font-weight:bold;background-color:#FFF27A;cursor:pointer;padding:2px;","Tipps zum Thema");
|
||||
var b = this._buildHTMLElement("DIV", "proposalsFrameBody","min-height:100px;max-height:300px;overflow:auto;padding:5px;");
|
||||
var c = this._buildHTMLElement("IMG", "proposalsFrameClose","float:right");
|
||||
|
||||
|
||||
h.onmousedown = function(){
|
||||
var p = this.parentNode;
|
||||
var ox,oy;
|
||||
this.onmouseup = function(){p.onmousemove = function(){}; p.onmouseout = function(){}}
|
||||
var m = function(ev){
|
||||
var px = (!ev) ? window.event.clientX : ev.pageX;var py = (!ev) ? window.event.clientY : ev.pageY;
|
||||
if(!ox){oy = py - parseInt(this.style.top); ox = px - parseInt(this.style.left); }
|
||||
this.style.left = (px-ox)+"px"; this.style.top = (py-oy)+"px";
|
||||
return false;
|
||||
}
|
||||
p.onmousemove = m;p.onmouseout = m;
|
||||
return false;
|
||||
}
|
||||
|
||||
var me = this;
|
||||
c.onclick = function(){me.closeWin()};
|
||||
|
||||
c.alt = "X";
|
||||
c.src = this.url+'/images/close.png';
|
||||
c.alt = "Fenster schlissen";
|
||||
c.title = "Fenster schliessen";
|
||||
|
||||
h.insertBefore(c,h.firstChild);
|
||||
p.appendChild(h); p.appendChild(b)
|
||||
|
||||
this.proposalsFrame = p;
|
||||
this.proposalsFrameBody = b;
|
||||
|
||||
document.getElementsByTagName("body")[0].appendChild(p);
|
||||
},
|
||||
|
||||
_buildHTMLElement: function(n, id, style, txt){
|
||||
var e = document.createElement(n);
|
||||
var an = document.createAttribute("id");
|
||||
an.nodeValue = id+"_"+this.proposalsFrameId;
|
||||
var clazz = document.createAttribute("class");
|
||||
clazz.nodeValue = id;
|
||||
e.setAttributeNode(clazz);
|
||||
e.setAttributeNode(an);
|
||||
|
||||
e.style.cssText = style;
|
||||
if(txt){ e.appendChild( document.createTextNode(txt)); }
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
function handleSNCode(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
var isBlock = (enode != null && enode.nodeName == 'CODE');
|
||||
|
||||
if(isBlock){
|
||||
|
||||
// Remove element
|
||||
if(enode.nodeName == 'CODE'){
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
|
||||
if(sel.length == 0 ){
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/code.html',
|
||||
width : 410 + parseInt(ed.getLang('snstuff.snlink_delta_width', 0)),
|
||||
height : 480 + parseInt(ed.getLang('snstuff.snlink_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
}else{
|
||||
ed.execCommand('mceInsertContent', false, '<code>'+ed.selection.getContent()+'</code>', {skip_undo : 1});
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
|
||||
}
|
||||
|
||||
function handleSNQuote(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
var isBlock = (enode != null && enode.nodeName == 'BLOCKQUOTE');
|
||||
|
||||
if(isBlock){
|
||||
|
||||
// Remove element
|
||||
if(enode.nodeName == 'BLOCKQUOTE'){
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
|
||||
if(sel.length == 0 ){
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/quote.html',
|
||||
width : 410 + parseInt(ed.getLang('snstuff.snquote_delta_width', 0)),
|
||||
height : 450 + parseInt(ed.getLang('snstuff.snquote_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
}else{
|
||||
ed.execCommand('mceInsertContent', false, '<blockquote>'+ed.selection.getContent()+'</blockquote>', {skip_undo : 1});
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function handleSNInfoBox(ed, url){
|
||||
var enode = ed.selection.getNode();
|
||||
var sel = ed.selection.getContent();
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/html/infobox.html',
|
||||
width : 250+ parseInt(ed.getLang('snstuff.snquote_delta_width', 0)),
|
||||
height : 100 + parseInt(ed.getLang('snstuff.snquote_delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
node: enode,
|
||||
plugin_url : url
|
||||
});
|
||||
}
|
||||
|
||||
function handleSNInfoBoxHead(ed, url){
|
||||
var enode = ed.dom.getParent(ed.selection.getNode(), function(n) {return ed.dom.hasClass(n, "snInfoBoxHead");})
|
||||
var sel = ed.selection.getContent();
|
||||
|
||||
tinyMCE.execCommand("mceBeginUndoLevel");
|
||||
if(sel.length > 0){
|
||||
ed.execCommand('mceInsertRawHTML', false, '<span id="__snInfoBoxHeadTmp">'+ed.selection.getContent()+'</span>',{skip_undo : 1});
|
||||
ed.dom.setAttribs('__snInfoBoxHeadTmp', {style:"", class:"snInfoBoxHead"});
|
||||
ed.dom.setAttrib('__snInfoBoxHeadTmp', 'id', '');
|
||||
}else{
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(enode, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
}
|
||||
tinyMCE.execCommand("mceEndUndoLevel");
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
SNStuffContentCounter = {
|
||||
elm: Array(),
|
||||
|
||||
isInit:false,
|
||||
init: function(ed){
|
||||
|
||||
var elm = ed.getParam("snstuff_contentcounter","").replace(/ /g,"").split(",");
|
||||
for(var e = 0; e < elm.length; e++){
|
||||
var l = new Object();
|
||||
|
||||
var cv = ed.getParam("snstuff_charcolor_"+elm[e],"none").replace(/ /g,"");
|
||||
|
||||
if(cv != "none"){
|
||||
var a = new Array();
|
||||
cc = cv.split(",");
|
||||
for(var cci = 0; cci < cc.length; cci++){
|
||||
var v = cc[cci].split(":");
|
||||
a.push({v:v[0],c:v[1]});
|
||||
}
|
||||
l.c = a.sort(function(a,b){return a.v-b.v});
|
||||
}
|
||||
|
||||
var wv = ed.getParam("snstuff_wordcolor_"+elm[e],"none").replace(/ /g,"");
|
||||
|
||||
if(wv != "none"){
|
||||
var a = new Array();
|
||||
wc = wv.split(",");
|
||||
for(var wci = 0; wci < wc.length; wci++){
|
||||
var v = wc[wci].split(":");
|
||||
a.push({v:v[0],c:v[1]});
|
||||
}
|
||||
l.w = a.sort(function(a,b){return a.v-b.v});
|
||||
}
|
||||
|
||||
this.elm[elm[e]] = l;
|
||||
|
||||
}
|
||||
|
||||
this.isInit = true;
|
||||
},
|
||||
|
||||
counter : function(ed,e){
|
||||
if(!SNStuffContentCounter.isInit){
|
||||
SNStuffContentCounter.init(ed);
|
||||
}
|
||||
if(SNStuffContentCounter.elm[ed.id]){
|
||||
var c = ed.getContent().replace(/<br \/>/g," ").replace(/<.+?>/g,"").replace(/ {1,}/g," ").replace(/^ | $/g,"");
|
||||
var cl = c.length;
|
||||
var wl = c.split(" ").length;
|
||||
var p = tinymce.DOM.get(ed.id + '_path_row');
|
||||
html = "";
|
||||
|
||||
var cvl = SNStuffContentCounter.elm[ed.id];
|
||||
if(cvl.c){
|
||||
var col = "";
|
||||
for(var i = 0; i < cvl.c.length; i++){
|
||||
if(cl > cvl.c[i].v){
|
||||
col = "color:"+cvl.c[i].c;
|
||||
}
|
||||
}
|
||||
html += ' <span style="'+col+'"> Zeichen:'+cl+' </span> ';
|
||||
}
|
||||
|
||||
if(cvl.w){
|
||||
|
||||
var col = "";
|
||||
for(var i = 0; i < cvl.w.length; i++){
|
||||
if(wl > cvl.w[i].v){
|
||||
col = "color:"+cvl.w[i].c;
|
||||
}
|
||||
}
|
||||
html += ' <span style="'+col+'"> Wörter:'+wl+' </span> ';
|
||||
}
|
||||
tinymce.DOM.setHTML(p,html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
32
sn_templates/editor_stuff/plugin/snstuff/html/code.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.code_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../js/sncode.js"></script>
|
||||
<!-- <link href="css/snlink.css" rel="stylesheet" type="text/css" /> -->
|
||||
</head>
|
||||
<body id="advlink" style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="panel">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.code_general_props}</legend>
|
||||
|
||||
<textarea id="text" rows="30" cols="60"></textarea>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
117
sn_templates/editor_stuff/plugin/snstuff/html/image.html
Normal file
@@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.img_dialog_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/validate.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/editable_selects.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../js/config.js"></script>
|
||||
<script type="text/javascript" src="../js/image.js"></script>
|
||||
|
||||
<link href="../css/default.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body id="snimages" style="display: none">
|
||||
|
||||
<div class="panel_wrapper">
|
||||
|
||||
<iframe id="actionTarget" name="actionTarget" style="width:1px; height:1px; visibility:hidden" onload="ImageDialog.actionStop()"></iframe>
|
||||
<div id="general_panel" class="panel current">
|
||||
|
||||
<form id="uploadForm" name="uploadForm" enctype="multipart/form-data" action="" method="post" target="actionTarget" onsubmit="ImageDialog.uploadStart()">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_tab_upload}</legend>
|
||||
|
||||
<img id="waitImg" src="../images/wait.gif" style="float:right; visibility:hidden">
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td><lable for="input_filed">{#snstuff_dlg.img_imagefile_select}</lable>
|
||||
<input id="fileField" name="sn_filename" type="file">
|
||||
</td>
|
||||
<td>
|
||||
<input id="uploadSubmit" type="submit" value="{#snstuff_dlg.img_imagefile_sndbtn}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_general}</legend>
|
||||
|
||||
<table class="properties">
|
||||
<!-- <tr rowspan="2">
|
||||
<td class="column1"><label id="srclabel" for="src">{#snstuff_dlg.src}</label></td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input name="src" disabled type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
|
||||
<td id="srcbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td colspan="2"><label for="src_list">{#snstuff_dlg.img_image_list}</label></td>
|
||||
<td colspan="2"><select id="src_list" name="src_list" onchange="ImageDialog.srcListAction( this.value );"><option value="">Lade Medienliste...</option></select></td>
|
||||
</tr>
|
||||
<tr id="pic">
|
||||
<td colspan="2">
|
||||
<label id="l_src_list_size" for="src_list_size">{#snstuff_dlg.img_pic_select}</label>
|
||||
<label id="l_src_list_vpic" for="src_list_vid_pic">{#snstuff_dlg.img_vpic_select}</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<span id="src_list_size_elm">{#snstuff_dlg.img_pic_show}<select id="src_list_size" name="src_list_size" onchange="ImageDialog.media1Action(this.value)"><option value=""></option></select></span>
|
||||
<span id="src_list_size_full_elm">{#snstuff_dlg.img_pic_show_full}<select id="src_list_size_full" name="src_list_size_full" onchange="ImageDialog.media2Action( this.value)"><option value=""></option></select></span>
|
||||
<span id="src_list_vid_pic_elm">
|
||||
{#snstuff_dlg.img_video_pic}<select id="src_list_vid_pic" name="src_list_vid_pic" onchange="ImageDialog.media1Action(this.value)"><option value=""></option></select>
|
||||
{#snstuff_dlg.img_width} <input id="video_width" name="video_width" type="text" size="4">
|
||||
{#snstuff_dlg.img_height} <input id="video_height" name="video_height" type="text" size="4">
|
||||
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="column1"><label id="alignlabel" for="align">{#snstuff_dlg.img_align}</label></td>
|
||||
<td>
|
||||
<select id="align" name="align" onchange="">
|
||||
<option value="none">{#snstuff_dlg.img_align_none}</option>
|
||||
<option value="left">{#snstuff_dlg.img_align_left}</option>
|
||||
<option value="right">{#snstuff_dlg.img_align_right}</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input id="imgDelBtn" type="button" value="{#snstuff_dlg.img_imagedelete}" onclick="ImageDialog.doDeleteImg()" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_preview}</legend>
|
||||
<div id="prev"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.insert();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- </form> -->
|
||||
<iframe name="upload_target" style="position:absolute;top:-999; left-999;border: 0;width: 0px;height: 0px;" onload=""></iframe>
|
||||
</body>
|
||||
</html>
|
108
sn_templates/editor_stuff/plugin/snstuff/html/image_bk.html
Normal file
@@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.img_dialog_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/editable_selects.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../js/config.js"></script>
|
||||
<script type="text/javascript" src="../js/image.js"></script>
|
||||
|
||||
<link href="../css/default.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body id="snimages" style="display: none">
|
||||
|
||||
<div class="panel_wrapper">
|
||||
|
||||
<iframe id="actionTarget" name="actionTarget" style="width:1px; height:1px; visibility:hidden" onload="ImageDialog.actionStop()"></iframe>
|
||||
<div id="general_panel" class="panel current">
|
||||
|
||||
<form id="uploadForm" name="uploadForm" enctype="multipart/form-data" action="" method="post" target="actionTarget" onsubmit="ImageDialog.uploadStart()">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_tab_upload}</legend>
|
||||
|
||||
<img id="waitImg" src="../images/wait.gif" style="float:right; visibility:hidden">
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td><lable for="input_filed">{#snstuff_dlg.img_imagefile_select}</lable>
|
||||
<input id="fileField" name="sn_filename" type="file">
|
||||
</td>
|
||||
<td>
|
||||
<input id="uploadSubmit" type="submit" value="{#snstuff_dlg.img_imagefile_sndbtn}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_general}</legend>
|
||||
|
||||
<table class="properties">
|
||||
<!-- <tr rowspan="2">
|
||||
<td class="column1"><label id="srclabel" for="src">{#snstuff_dlg.src}</label></td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input name="src" disabled type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
|
||||
<td id="srcbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td colspan="2"><label for="src_list">{#snstuff_dlg.img_image_list}</label></td>
|
||||
<td colspan="2"><select id="src_list" name="src_list" onchange="ImageDialog.showImageSizeList(this);"><option value=""></option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><label for="src_list_size">Size{#snstuff_dlg.img_image_list}</label></td>
|
||||
<td colspan="2">
|
||||
<select id="src_list_size" name="src_list_size" onchange="ImageDialog.showSelectedImage(this)"><option value=""></option></select>
|
||||
<select id="src_list_size_full" name="src_list_size_full" onchange=""><option value=""></option></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="column1"><label id="alignlabel" for="align">{#snstuff_dlg.img_align}</label></td>
|
||||
<td>
|
||||
<select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
|
||||
<option value="">{#snstuff_dlg.img_align_none}</option>
|
||||
<option value="left">{#snstuff_dlg.img_align_left}</option>
|
||||
<option value="right">{#snstuff_dlg.img_align_right}</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input id="imgDelBtn" type="button" value="{#snstuff_dlg.img_imagedelete}" onclick="ImageDialog.doDeleteImg()" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.img_preview}</legend>
|
||||
<div id="prev"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.insert();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- </form> -->
|
||||
<iframe name="upload_target" style="position:absolute;top:-999; left-999;border: 0;width: 0px;height: 0px;" onload=""></iframe>
|
||||
</body>
|
||||
</html>
|
41
sn_templates/editor_stuff/plugin/snstuff/html/infobox.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.ibox_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../js/infobox.js"></script>
|
||||
<!-- <link href="css/snlink.css" rel="stylesheet" type="text/css" /> -->
|
||||
</head>
|
||||
<body style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="panel">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.ibox_general_props}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr><td>{#snstuff_dlg.ibox_input_size}<input type="text" name="size" size="5" value="100">px</td>
|
||||
<td>{#snstuff_dlg.ibox_input_float}
|
||||
<select name="float">
|
||||
<option value="left">{#snstuff_dlg.ibox_fopt_left}</option>
|
||||
<option value="right">{#snstuff_dlg.ibox_fopt_right}</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
36
sn_templates/editor_stuff/plugin/snstuff/html/link.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.lnk_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../js/snlink.js"></script>
|
||||
<!-- <link href="css/snlink.css" rel="stylesheet" type="text/css" /> -->
|
||||
</head>
|
||||
<body id="advlink" style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="panel">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.lnk_general_props}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr style="float: right"><td>{#snstuff_dlg.lnk_field_url}</td><td><input id="urlField" type="text" size="45"></td></tr>
|
||||
<tr id="urlName" style="float: right"><td>{#snstuff_dlg.lnk_field_name}</td><td><input id="nameField" type="text" size="45"></td></tr>
|
||||
<tr id="urlDescription" style="float: right"><td>{#snstuff_dlg.lnk_field_desc}</td><td><input id="descField" type="text" size="45"></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
32
sn_templates/editor_stuff/plugin/snstuff/html/quote.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#snstuff_dlg.quote_title}</title>
|
||||
<script type="text/javascript" src="../../../tiny_mce_popup.js"></script>
|
||||
<!-- <script type="text/javascript" src="../../../utils/mctabs.js"></script> -->
|
||||
<script type="text/javascript" src="../../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../js/snquote.js"></script>
|
||||
<!-- <link href="css/snlink.css" rel="stylesheet" type="text/css" /> -->
|
||||
</head>
|
||||
<body id="advlink" style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="panel">
|
||||
<fieldset>
|
||||
<legend>{#snstuff_dlg.qoute_general_props}</legend>
|
||||
|
||||
<textarea id="text" rows="30" cols="60"></textarea>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
BIN
sn_templates/editor_stuff/plugin/snstuff/images/add.png
Normal file
After Width: | Height: | Size: 907 B |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/close.png
Normal file
After Width: | Height: | Size: 842 B |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/code-context.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/insert-image.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/insert-link.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/player.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/proposals.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/quote.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/textinfo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/trans.gif
Normal file
After Width: | Height: | Size: 43 B |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/video.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/wait.gif
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
sn_templates/editor_stuff/plugin/snstuff/images/window-new.png
Normal file
After Width: | Height: | Size: 680 B |
69
sn_templates/editor_stuff/plugin/snstuff/js/code.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/* Functions for the advlink plugin popup */
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function preinit() {
|
||||
var url;
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode();
|
||||
|
||||
node = ed.dom.getParent(node, "A");
|
||||
|
||||
if(node != null && typeof node != 'undefined' && node.nodeName == 'A'){
|
||||
formObj.insert.value = tinyMCEPopup.getLang('update', 'Insert', true);
|
||||
|
||||
var url = ed.dom.getAttrib(node,"href");
|
||||
var txt = node.firstChild.nodeValue;
|
||||
|
||||
formObj.urlField.value = url;
|
||||
formObj.descField.value = txt;
|
||||
}else{
|
||||
var selTxt = ed.selection.getContent();
|
||||
|
||||
if(isURL(selTxt)){
|
||||
formObj.urlField.value = selTxt.replace(/^\s*/,"");
|
||||
}
|
||||
if(selTxt.length > 0){
|
||||
document.getElementById("urlDescription").style.visibility = "hidden";
|
||||
}
|
||||
formObj.descField.value = selTxt;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function insertAction() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode()
|
||||
|
||||
if (node && node.nodeName == 'A') {
|
||||
ed.dom.setAttrib(node, "href", document.getElementById("urlField").value);
|
||||
node.firstChild.nodeValue = document.getElementById("descField").value;
|
||||
}else {
|
||||
ed.execCommand('mceInsertContent', false, '<a href="'+formObj.urlField.value+'">'+formObj.descField.value+'</a>', {skip_undo : 1});
|
||||
ed.undoManager.add();
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function isURL(str){
|
||||
if(str.match(/^http(s){0,1}:\/\//) || str.match(/^\s*www.*\..+/)){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
tinyMCEPopup.onInit.add(init);
|
52
sn_templates/editor_stuff/plugin/snstuff/js/config.js
Normal file
@@ -0,0 +1,52 @@
|
||||
var Config = {
|
||||
|
||||
imageListUrl : "" ,
|
||||
uploadUrl : "" ,
|
||||
deleteUrl : "" ,
|
||||
imageUrl : "",
|
||||
artikelid : null ,
|
||||
pagetype : null,
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
getImageListUrl : function(){
|
||||
|
||||
var url = Config._replace( Config.imageListUrl );
|
||||
|
||||
return tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);
|
||||
},
|
||||
|
||||
getUploadUrl : function(){
|
||||
|
||||
var url = Config._replace( Config.uploadUrl );
|
||||
|
||||
return tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);
|
||||
},
|
||||
|
||||
getDeleteUrl : function(imgname){
|
||||
|
||||
var url = Config._replace( Config.deleteUrl );
|
||||
|
||||
url = url.replace(/\{imgname\}/g,imgname);
|
||||
return tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);
|
||||
},
|
||||
|
||||
getImageUrl : function(imgname,nofull){
|
||||
|
||||
var url = Config._replace( Config.imageUrl );
|
||||
|
||||
url = url.replace(/\{imgname\}/g,imgname);
|
||||
return (nofull)?url:tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);
|
||||
},
|
||||
|
||||
_replace : function(url){
|
||||
|
||||
if(Config.artikelid != null && typeof Config.artikelid != 'undefined'){
|
||||
url = url.replace(/\{artikelid\}/g,Config.artikelid);
|
||||
}
|
||||
if(Config.pagetype != null && typeof Config.pagetype != 'undefined'){
|
||||
url = url.replace(/\{pagetype\}/g,Config.pagetype);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
}
|
445
sn_templates/editor_stuff/plugin/snstuff/js/image.js
Normal file
@@ -0,0 +1,445 @@
|
||||
var ImageDialog = {
|
||||
preInit : function() {
|
||||
var url;
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
Config.artikelid = parent.entryid;
|
||||
Config.pagetype = parent.pagetype;
|
||||
//Config.imageListUrl = tinyMCEPopup.getParam("snstuff_img_url_list") || "/admin_list_pictures_json/{artikelid}";
|
||||
Config.imageListUrl = tinyMCEPopup.getParam("snstuff_img_url_list") || "{pagetype}?sx_action=on_image_list&id={artikelid}";
|
||||
//Config.uploadUrl = tinyMCEPopup.getParam("snstuff_img_url_upload") || "/{pagetype}/{artikelid}?sx_action=on_user_upload";
|
||||
Config.uploadUrl = tinyMCEPopup.getParam("snstuff_img_url_upload") || "{pagetype}?sx_action=on_image_upload&id={artikelid}";
|
||||
Config.deleteUrl = tinyMCEPopup.getParam("snstuff_img_url_delete") || "/admin_kill_picture?name=articleimage/sn_computer/{artikelid}/{imgname}&id={artikelid}";
|
||||
Config.imageUrl = tinyMCEPopup.getParam("snstuff_img_url_image") || "/on_image_preview/{artikelid}/{imgname}";
|
||||
|
||||
},
|
||||
|
||||
srcData:{},
|
||||
|
||||
selectedData:'',
|
||||
|
||||
srcMedia:'',
|
||||
media1:'',
|
||||
media2:'',
|
||||
|
||||
selM1:'',
|
||||
selM2:'',
|
||||
|
||||
videoW:undefined,
|
||||
videoH:undefined,
|
||||
|
||||
selBigges: true,
|
||||
isUploading: false,
|
||||
isDeleting: false,
|
||||
|
||||
init : function(ed) {
|
||||
|
||||
tinyMCEPopup.dom.get("uploadForm").action = Config.getUploadUrl();
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic_elm").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("l_src_list_size").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("l_src_list_vpic").style.display = 'none';
|
||||
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
TinyMCE_EditableSelects.init();
|
||||
|
||||
if ( n != null && typeof n != 'undefined' && n.nodeName == 'IMG') {
|
||||
this.selBigges = false;
|
||||
document.getElementById("insert").value = ed.getLang('update');
|
||||
var imgURL = dom.getAttrib(n, 'src');
|
||||
if(n.className == 'snVideo'){
|
||||
this.selM2 = dom.getAttrib(n, 'alt');
|
||||
this.videoW = dom.getAttrib(n, 'width');
|
||||
this.videoH = dom.getAttrib(n, 'height');
|
||||
this.selM1 = dom.getAttrib(n, 'title');
|
||||
}else{
|
||||
|
||||
this.selM2 = dom.getAttrib(n, 'alt')
|
||||
this.selM1 = imgURL.split('/').pop();
|
||||
|
||||
var a = 'none';
|
||||
if (ed.settings.inline_styles) {
|
||||
if (!(a = dom.getStyle(n, 'float'))){
|
||||
a = dom.getStyle(n, 'vertical-align')
|
||||
}
|
||||
}
|
||||
if(!a){
|
||||
a = dom.getAttrib(n, 'align');
|
||||
}
|
||||
var al = tinyMCEPopup.dom.get("align");
|
||||
a = a.replace(/ /g,'');
|
||||
for(var i = 0; i < al.length; i++){
|
||||
if(al.options[i].value == a)
|
||||
al.selectedIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.dom.get("video_width").value = this.videoW;
|
||||
tinyMCEPopup.dom.get("video_height").value = this.videoH;
|
||||
this.loadData();
|
||||
},
|
||||
|
||||
srcListAction: function(v){
|
||||
this.srcMedia = v;
|
||||
tinyMCEPopup.dom.get("src_list_size_elm").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("src_list_size_full_elm").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic_elm").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("l_src_list_size").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("l_src_list_vpic").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("align").disabled = true;
|
||||
|
||||
if(this.srcMedia.indexOf(':') == -1){
|
||||
this.previewData();
|
||||
return;
|
||||
}
|
||||
var on = this.srcMedia.split(':');
|
||||
|
||||
var lst = tinyMCEPopup.dom.get("src_list_size");
|
||||
var lst2 = tinyMCEPopup.dom.get("src_list_size_full");
|
||||
var lstv = tinyMCEPopup.dom.get("src_list_vid_pic");
|
||||
|
||||
lst.options.length = 0;lst2.options.length = 0; lstv.options.length = 0;
|
||||
|
||||
|
||||
|
||||
if(on[0] == 'pic'){
|
||||
tinyMCEPopup.dom.get("src_list_size_elm").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("src_list_size_full_elm").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("l_src_list_size").style.display = 'inline';
|
||||
|
||||
tinyMCEPopup.dom.get("align").disabled = false;
|
||||
var obj = this.srcData.pic[on[1]];
|
||||
var m = undefined, m2 = undefined;
|
||||
for(var i = 0; i < obj.subpic.length; i++){
|
||||
obj.subpic[i].width = parseInt(obj.subpic[i].width);
|
||||
obj.subpic[i].height = parseInt(obj.subpic[i].height);
|
||||
|
||||
|
||||
var fname = obj.subpic[i].name;
|
||||
var wh = obj.subpic[i].width + ' X '+ obj.subpic[i].height;
|
||||
if( obj.subpic[i].isOrig ){
|
||||
wh += '*';
|
||||
}
|
||||
|
||||
lst.options[lst.options.length] = new Option(wh, v+':'+i);
|
||||
lst2.options[lst2.options.length] = new Option(wh, v+':'+i);
|
||||
if(fname == this.selM1){lst.selectedIndex = lst.options.length-1;}
|
||||
if(fname == this.selM2){lst2.selectedIndex = lst2.options.length-1;}
|
||||
|
||||
if(this.selBigges){
|
||||
if(!m || m && (obj.subpic[i].width < m.width && obj.subpic[i].height < m.height)){
|
||||
lst.selectedIndex = lst.options.length-1;
|
||||
m = obj.subpic[i];
|
||||
}
|
||||
if(!m2 || m2 && (obj.subpic[i].width > m2.width && obj.subpic[i].height > m2.height)){
|
||||
lst2.selectedIndex = lst2.options.length-1;
|
||||
m2 = obj.subpic[i];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.selBigges = true;
|
||||
|
||||
lst.onchange();lst2.onchange();
|
||||
}
|
||||
if(on[0] == 'vid'){
|
||||
var obj = this.srcData.video[on[1]];
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic_elm").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("video_width").value = this.videoW ? this.videoW:obj.width;
|
||||
tinyMCEPopup.dom.get("video_height").value = this.videoH ? this.videoH:obj.height;
|
||||
tinyMCEPopup.dom.get("l_src_list_vpic").style.display = 'inline';
|
||||
|
||||
for(var e in this.srcData.pic){
|
||||
var pl = this.srcData.pic[e].subpic;
|
||||
lstv.options[lstv.options.length] = new Option('','');
|
||||
for(var i = 0; i < pl.length; i++){
|
||||
lstv.options[lstv.options.length] = new Option(pl[i].name,'pic:'+e+':'+i);
|
||||
if(pl[i].name == this.selM2){lstv.selectedIndex = lstv.options.length-1;}
|
||||
}
|
||||
}
|
||||
lstv.onchange();
|
||||
}
|
||||
},
|
||||
|
||||
media1Action: function(v){
|
||||
this.media1 = v;
|
||||
this.previewData();
|
||||
},
|
||||
|
||||
media2Action: function(v){
|
||||
this.media2 = v;
|
||||
},
|
||||
|
||||
|
||||
previewData : function() {
|
||||
if (!this.srcMedia) {
|
||||
tinyMCEPopup.dom.setHTML('prev', '');
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
return;
|
||||
}
|
||||
var on;
|
||||
if(this.srcMedia.indexOf("vid:") != -1){
|
||||
on = this.srcMedia.split(':');
|
||||
}else{
|
||||
on = this.media1.split(':');
|
||||
}
|
||||
|
||||
var u; var html = '';
|
||||
if(on[0] == 'pic'){
|
||||
var p = this.srcData.pic[on[1]].subpic[on[2]];
|
||||
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(Config.getImageUrl(p.name,true));
|
||||
html = '<img id="previewImg" src="' + u + '" border="0" />';
|
||||
|
||||
}else{
|
||||
var o = this.srcData.video[on[1]];
|
||||
var fvars = "file="+Config.getImageUrl(o.name,true);
|
||||
if(this.media1 && this.media1.indexOf(':') != -1){
|
||||
var m2 = this.media1.split(':');
|
||||
fvars += "&image="+Config.getImageUrl(this.srcData.pic[m2[1]].subpic[m2[2]].name,true);
|
||||
}
|
||||
fvars +="&autoload=false";
|
||||
html = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='350' height='280' id='"+o.name+"' name='"+o.name+"'>"
|
||||
+"<param name='movie' value='/video/player-viral.swf'><param name='allowfullscreen' value='false'><param name='play' value='false'>"
|
||||
+"<param name='flashvars' value='"+fvars+"'>"
|
||||
+"<embed type='application/x-shockwave-flash' id='"+o.name+"' name='"+o.name+"' src='/video/player-viral.swf' width='400' height='250' "
|
||||
+"allowscriptaccess='always' allowfullscreen='false' flashvars='"+fvars+"'/>"
|
||||
+"</object>";
|
||||
}
|
||||
document.getElementById("imgDelBtn").disabled = false
|
||||
tinyMCEPopup.dom.setHTML('prev', html);
|
||||
},
|
||||
|
||||
|
||||
insert:function(){
|
||||
var ed = tinyMCEPopup.editor, t = this
|
||||
if (!this.srcMedia) {
|
||||
if (ed.selection.getNode().nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
ed.execCommand('mceRepaint');
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
////// insert/update
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
// Fixes crash in Safari
|
||||
if (tinymce.isWebKit){ ed.getWin().focus();}
|
||||
|
||||
|
||||
|
||||
var args;
|
||||
var clazzName = 'noresize';
|
||||
if(this.srcMedia && this.srcMedia.indexOf('pic:') != -1){
|
||||
var m1 = this.media1.split(':');
|
||||
var m2 = this.media2.split(':');
|
||||
|
||||
args = {'class':'noresize',
|
||||
'align': tinyMCEPopup.dom.get("align").value,
|
||||
'src': Config.getImageUrl(this.srcData.pic[m1[1]].subpic[m1[2]].name,true),
|
||||
'alt': this.srcData.pic[m2[1]].subpic[m2[2]].name,
|
||||
'style': "float:"+tinyMCEPopup.dom.get("align").value+";"
|
||||
};
|
||||
}
|
||||
|
||||
if(this.srcMedia && this.srcMedia.indexOf('vid:') != -1){
|
||||
var sm = this.srcMedia.split(':');
|
||||
var o = this.srcData.video[sm[1]];
|
||||
this.videoW = parseInt(tinyMCEPopup.dom.get("video_width").value);
|
||||
this.videoH = parseInt(tinyMCEPopup.dom.get("video_height").value);
|
||||
|
||||
if(!this.videoH || this.videoH < 0){
|
||||
this.videoH = o.height;
|
||||
}
|
||||
if(!this.videoW || this.videoW < 0){
|
||||
this.videoW = o.width;
|
||||
}
|
||||
|
||||
|
||||
clazzName = 'snVideo';
|
||||
args = {'class':'snVideo',
|
||||
'align': tinyMCEPopup.dom.get("align").value,
|
||||
'src': tinyMCEPopup.getWindowArg("plugin_url")+'/images/trans.gif',
|
||||
'title': o.name,
|
||||
'width':this.videoW,
|
||||
'height':this.videoH
|
||||
}
|
||||
if(this.media1 && this.media1.indexOf(':') != -1){
|
||||
var m1 = this.media1.split(':');
|
||||
args.alt = this.srcData.pic[m1[1]].subpic[m1[2]].name;
|
||||
}
|
||||
}
|
||||
|
||||
el = ed.selection.getNode();
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
if (el && el.nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
}
|
||||
if(args){
|
||||
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
|
||||
// ed.dom.get('__mce_tmp').className = clazzName;
|
||||
ed.dom.setAttribs('__mce_tmp', args);
|
||||
ed.dom.setAttrib('__mce_tmp', 'id', '');
|
||||
}
|
||||
ed.undoManager.add();
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
//////////////////////////////// Helper ////////////////////////////
|
||||
|
||||
loadData: function(){
|
||||
var lst = tinyMCEPopup.dom.get("src_list");
|
||||
lst.options.length = 0;
|
||||
lst.options[lst.options.length] = new Option('Lade Medienliste...','');
|
||||
lst.disabled = true;
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', Config.getImageListUrl(), true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.parseAndSet(xmlHttp.responseText);
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
deleteData: function(url){
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', url, true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.actionStop();
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
doDeleteImg : function(){
|
||||
var dl = "";
|
||||
if(this.srcMedia.indexOf("pic:") != -1){
|
||||
var m = this.media1.split(':');
|
||||
dl = Config.getDeleteUrl(this.srcData.pic[m[1]].subpic[m[2]].name);
|
||||
}else{
|
||||
var m = this.srcMedia.split(':');
|
||||
dl = Config.getDeleteUrl(this.srcData.video[m[1]].name);
|
||||
}
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
ImageDialog.isDeleting = true;
|
||||
ImageDialog.deleteData(dl);
|
||||
|
||||
},
|
||||
|
||||
getXMLHttpRequest: function(){
|
||||
var xmlHttp = null;
|
||||
// Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
|
||||
if (typeof XMLHttpRequest != 'undefined') {
|
||||
xmlHttp = new XMLHttpRequest();
|
||||
}
|
||||
if (!xmlHttp) {
|
||||
// Internet Explorer 6 und älter
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch(e) {
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch(e) {
|
||||
xmlHttp = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
},
|
||||
|
||||
parseAndSet: function(xml){
|
||||
var obj = eval( '('+xml+')');
|
||||
|
||||
this.srcData = obj;
|
||||
|
||||
// parse loaded JSON object & create new object
|
||||
|
||||
var lst = tinyMCEPopup.dom.get("src_list");
|
||||
lst.options.length = 0;
|
||||
lst.options[lst.options.length] = new Option('','');
|
||||
if(obj.pic){
|
||||
|
||||
lst.options[lst.options.length] = new Option('------ Bilder -----','');
|
||||
for(var e in obj.pic){
|
||||
if(obj.pic[e].name && obj.pic[e].name.length > 0){
|
||||
var p = obj.pic[e];
|
||||
obj.pic[e].subpic.push({name:p.name,width:p.width,height:p.height,isOrig:true});
|
||||
}
|
||||
lst.options[lst.options.length] = new Option(e,'pic:'+e);
|
||||
if(this.selM1 && this.selM1.toLowerCase().indexOf(e.toLowerCase()) != -1){lst.selectedIndex = lst.options.length-1;}
|
||||
}
|
||||
}
|
||||
|
||||
if(obj.video && obj.video.length > 0){
|
||||
lst.options[lst.options.length] = new Option('------ Videos -----','');
|
||||
for(var i = 0; i < obj.video.length; i++){
|
||||
lst.options[lst.options.length] = new Option(obj.video[i].name,'vid:'+i);
|
||||
if(this.selM1 == obj.video[i].name){lst.selectedIndex = lst.options.length-1;}
|
||||
}
|
||||
}
|
||||
tinyMCEPopup.dom.get("src_list").disabled = false;
|
||||
lst.onchange();
|
||||
},
|
||||
|
||||
uploadStart : function(){
|
||||
ImageDialog.isUploading = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
document.getElementById("uploadSubmit").disabled = true;
|
||||
},
|
||||
|
||||
actionStop : function(){
|
||||
|
||||
|
||||
if(ImageDialog.isUploading){
|
||||
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("uploadSubmit").disabled = false;
|
||||
document.getElementById("fileField").disabled = false;
|
||||
document.getElementById("fileField").value = "";
|
||||
this.loadData();
|
||||
ImageDialog.isUploading = false;
|
||||
}
|
||||
|
||||
if(ImageDialog.isDeleting){
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("imgDelBtn").disabled = false;
|
||||
|
||||
this.loadData();
|
||||
|
||||
ImageDialog.isDeleting = false;
|
||||
}
|
||||
|
||||
// var http_status=507;
|
||||
// var http_message='507 Insufficient Storage';
|
||||
// var error_message='Upload zu gross, bitte maximal 2 MB hochladen.';
|
||||
|
||||
var iFrame = document.getElementById('actionTarget').contentWindow;
|
||||
|
||||
if(typeof iFrame.error_message != 'undefined'){
|
||||
alert(iFrame.error_message);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
ImageDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
638
sn_templates/editor_stuff/plugin/snstuff/js/image_bk.js
Normal file
@@ -0,0 +1,638 @@
|
||||
var ImageDialog = {
|
||||
preInit : function() {
|
||||
var url;
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
Config.artikelid = parent.entryid;
|
||||
Config.pagetype = parent.pagetpye;
|
||||
Config.imageListUrl = tinyMCEPopup.getParam("snstuff_img_url_list") || "/admin_list_pictures_json/{artikelid}";
|
||||
Config.uploadUrl = tinyMCEPopup.getParam("snstuff_img_url_upload") || "/{pagetype}/{artikelid}?sx_action=on_user_upload";
|
||||
Config.deleteUrl = tinyMCEPopup.getParam("snstuff_img_url_delete") || "/admin_kill_picture?name=articleimage/sn_computer/{artikelid}/{imgname}&id={artikelid}";
|
||||
Config.imageUrl = tinyMCEPopup.getParam("snstuff_img_url_image") || "/articleimage/{artikelid}/{imgname}";
|
||||
|
||||
},
|
||||
|
||||
imgURL: "",
|
||||
imgAlign:"",
|
||||
|
||||
init : function(ed) {
|
||||
ImageDialog.ImageList = new ImageData();
|
||||
|
||||
document.forms["uploadForm"].action = Config.getUploadUrl();
|
||||
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
TinyMCE_EditableSelects.init();
|
||||
|
||||
if ( n != null && typeof n != 'undefined' && n.nodeName == 'IMG') {
|
||||
this.imgURL = dom.getAttrib(n, 'src');
|
||||
this.selectByValue(document.getElementById('align'), this.getAttrib(n, 'align'));
|
||||
document.getElementById("insert").value = ed.getLang('update');
|
||||
this.imgAlign = dom.getAttrib(n, 'style');
|
||||
|
||||
if (ed.settings.inline_styles) {
|
||||
// Move attribs to styles
|
||||
if (dom.getAttrib(n, 'align'))
|
||||
this.updateStyle('align');
|
||||
|
||||
if (dom.getAttrib(n, 'hspace'))
|
||||
this.updateStyle('hspace');
|
||||
|
||||
if (dom.getAttrib(n, 'border'))
|
||||
this.updateStyle('border');
|
||||
|
||||
if (dom.getAttrib(n, 'vspace'))
|
||||
this.updateStyle('vspace');
|
||||
}
|
||||
}
|
||||
|
||||
this.changeAppearance();
|
||||
this.showPreviewImage(this.imgURL, 1);
|
||||
this.loadImages();
|
||||
},
|
||||
|
||||
|
||||
selectOptions : function(){
|
||||
var n = tinyMCEPopup.editor.selection.getNode(), ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
|
||||
|
||||
if(n.nodeName != 'IMG')
|
||||
return;
|
||||
|
||||
var srcLstSize = tinyMCEPopup.dom.get("src_list_size").options;
|
||||
var imgurl = this.imgURL;
|
||||
var imgname = imgurl.split("/").pop();
|
||||
|
||||
// select image in selectbox
|
||||
var oname = ImageDialog.ImageList.getOrigNameOf(imgname);
|
||||
var slist = tinyMCEPopup.dom.get("src_list_size");
|
||||
slist.options.length = 0;
|
||||
|
||||
ImageDialog.showImageSizeList({value:oname});
|
||||
|
||||
this.selectInList(tinyMCEPopup.dom.get("src_list"),oname);
|
||||
this.selectInList(tinyMCEPopup.dom.get("src_list_size"),imgurl);
|
||||
this.showSelectedImage(tinyMCEPopup.dom.get("src_list_size"));
|
||||
this.selectInList(tinyMCEPopup.dom.get("src_list_size_full"),dom.getAttrib(n, 'href'));
|
||||
},
|
||||
|
||||
showSelectedImage : function(obj){
|
||||
|
||||
this.imgURL = obj.options[obj.selectedIndex].value;
|
||||
this.showPreviewImage(this.imgURL);
|
||||
},
|
||||
|
||||
insert : function(file, title) {
|
||||
var ed = tinyMCEPopup.editor, t = this;
|
||||
|
||||
if (this.imgURL === '') {
|
||||
if (ed.selection.getNode().nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
ed.execCommand('mceRepaint');
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
|
||||
t.insertAndClose();
|
||||
|
||||
},
|
||||
|
||||
insertAndClose : function() {
|
||||
var ed = tinyMCEPopup.editor, v, args = {}, el;
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
// Fixes crash in Safari
|
||||
if (tinymce.isWebKit)
|
||||
ed.getWin().focus();
|
||||
|
||||
if (!ed.settings.inline_styles) {
|
||||
args = {
|
||||
vspace : document.getElementById("vspace").value,
|
||||
hspace : document.getElementById("hspace").value,
|
||||
border : document.getElementById("border").value,
|
||||
align : document.getElementById("align").value
|
||||
};
|
||||
} else {
|
||||
// Remove deprecated values
|
||||
args = {
|
||||
vspace : '',
|
||||
hspace : '',
|
||||
border : '',
|
||||
align : ''
|
||||
};
|
||||
}
|
||||
var lnk = document.getElementById("src_list_size_full").value;
|
||||
if(lnk == "auto."){
|
||||
lnk = ImageDialog.ImageList.getBiggest(document.getElementById("src_list").value)
|
||||
}
|
||||
tinymce.extend(args, {
|
||||
src : this.imgURL,
|
||||
alt : lnk,
|
||||
style : this.imgAlign,
|
||||
href : lnk
|
||||
});
|
||||
|
||||
el = ed.selection.getNode();
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
// entfernen und neu einfuegen. Weil das das advimagescale plugin sonst unerwuenschten nebeneffekt erzeugt
|
||||
if (el && el.nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
// ed.dom.setAttribs(el, args);
|
||||
} //else {
|
||||
|
||||
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
|
||||
ed.dom.setAttribs('__mce_tmp', args);
|
||||
ed.dom.setAttrib('__mce_tmp', 'id', '');
|
||||
ed.undoManager.add();
|
||||
// }
|
||||
|
||||
// ed.execCommand('mceRepaint');
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
|
||||
getAttrib : function(e, at) {
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
||||
|
||||
if (ed.settings.inline_styles) {
|
||||
switch (at) {
|
||||
case 'align':
|
||||
if (v = dom.getStyle(e, 'float'))
|
||||
return v;
|
||||
|
||||
if (v = dom.getStyle(e, 'vertical-align'))
|
||||
return v;
|
||||
|
||||
break;
|
||||
|
||||
case 'hspace':
|
||||
v = dom.getStyle(e, 'margin-left')
|
||||
v2 = dom.getStyle(e, 'margin-right');
|
||||
|
||||
if (v && v == v2)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
|
||||
case 'vspace':
|
||||
v = dom.getStyle(e, 'margin-top')
|
||||
v2 = dom.getStyle(e, 'margin-bottom');
|
||||
if (v && v == v2)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
|
||||
case 'border':
|
||||
v = 0;
|
||||
|
||||
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
||||
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
||||
|
||||
// False or not the same as prev
|
||||
if (!sv || (sv != v && v !== 0)) {
|
||||
v = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sv)
|
||||
v = sv;
|
||||
});
|
||||
|
||||
if (v)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (v = dom.getAttrib(e, at))
|
||||
return v;
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
|
||||
fillSelectList : function() {
|
||||
|
||||
var dom = tinyMCEPopup.dom, lst = dom.get("src_list");
|
||||
|
||||
lst.options.length = 0;
|
||||
|
||||
lst.options[lst.options.length] = new Option('', '');
|
||||
ImageDialog.ImageList.fillListWithNames(lst);
|
||||
|
||||
},
|
||||
|
||||
showImageSizeList : function(obj){
|
||||
var dom = tinyMCEPopup.dom;
|
||||
var lst = dom.get("src_list_size");
|
||||
var lst2 = dom.get("src_list_size_full");
|
||||
|
||||
if(obj.selectedIndex == 0){
|
||||
this.imgURL = "";
|
||||
lst.options.length = 0;
|
||||
lst2.options.length = 0;
|
||||
this.showPreviewImage();
|
||||
}else{
|
||||
|
||||
lst.options.length = 0;
|
||||
ImageDialog.ImageList.fillListWithSizeOf(lst,obj.value);
|
||||
|
||||
|
||||
lst2.options.length = 0;
|
||||
lst2.options[lst2.options.length] = new Option("auto.","auto.");
|
||||
ImageDialog.ImageList.fillListWithSizeOf(lst2,obj.value);
|
||||
|
||||
ImageDialog.showSelectedImage(document.getElementById("src_list_size"));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
resetImageData : function() {
|
||||
// document.getElementById("width").value = document.getElementById("height").value = '';
|
||||
},
|
||||
|
||||
|
||||
updateImageData : function(img, st) {
|
||||
|
||||
this.preloadImg = img;
|
||||
},
|
||||
|
||||
changeAppearance : function() {
|
||||
var ed = tinyMCEPopup.editor, img = document.getElementById('alignSampleImg');
|
||||
|
||||
if (img) {
|
||||
if (ed.getParam('inline_styles')) {
|
||||
ed.dom.setAttrib(img, 'style', ImageDialog.imgAlign);
|
||||
} else {
|
||||
img.align = document.getElementById("align").value;
|
||||
img.border = document.getElementById("border").value;
|
||||
img.hspace = document.getElementById("hspace").value;
|
||||
img.vspace = document.getElementById("vspace").value;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
updateStyle : function(ty) {
|
||||
var dom = tinyMCEPopup.dom, st, v, img = dom.create('img', {style : ImageDialog.imgAlign});
|
||||
|
||||
if (tinyMCEPopup.editor.settings.inline_styles) {
|
||||
// Handle align
|
||||
if (ty == 'align') {
|
||||
dom.setStyle(img, 'float', '');
|
||||
dom.setStyle(img, 'vertical-align', '');
|
||||
|
||||
v = document.getElementById("align").value;
|
||||
if (v) {
|
||||
if (v == 'left' || v == 'right')
|
||||
dom.setStyle(img, 'float', v);
|
||||
else
|
||||
img.style.verticalAlign = v;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle border
|
||||
if (ty == 'border') {
|
||||
dom.setStyle(img, 'border', '');
|
||||
|
||||
v = document.getElementById("border").value;
|
||||
if (v || v == '0') {
|
||||
if (v == '0')
|
||||
img.style.border = '0';
|
||||
else
|
||||
img.style.border = v + 'px solid black';
|
||||
}
|
||||
}
|
||||
|
||||
// Handle hspace
|
||||
if (ty == 'hspace') {
|
||||
dom.setStyle(img, 'marginLeft', '');
|
||||
dom.setStyle(img, 'marginRight', '');
|
||||
|
||||
v = document.getElementById("hspace").value;
|
||||
if (v) {
|
||||
img.style.marginLeft = v + 'px';
|
||||
img.style.marginRight = v + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
// Handle vspace
|
||||
if (ty == 'vspace') {
|
||||
dom.setStyle(img, 'marginTop', '');
|
||||
dom.setStyle(img, 'marginBottom', '');
|
||||
|
||||
v = document.getElementById("vspace").value;
|
||||
if (v) {
|
||||
img.style.marginTop = v + 'px';
|
||||
img.style.marginBottom = v + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
// Merge
|
||||
ImageDialog.imgAlign = dom.serializeStyle(dom.parseStyle(img.style.cssText));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
showPreviewImage : function(u, st) {
|
||||
|
||||
if (!u) {
|
||||
tinyMCEPopup.dom.setHTML('prev', '');
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
||||
this.resetImageData();
|
||||
|
||||
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
||||
document.getElementById("imgDelBtn").disabled = false
|
||||
|
||||
if (!st)
|
||||
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
||||
else
|
||||
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
||||
},
|
||||
|
||||
|
||||
selectInList : function(list, val){
|
||||
|
||||
var lst = list.options;
|
||||
var vimg = val.split("/").pop();
|
||||
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
var oimg = lst[i].value.split("/").pop();
|
||||
|
||||
if(oimg == vimg){
|
||||
list.selectedIndex = i;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//////////////////////////////// Helper ////////////////////////////
|
||||
|
||||
loadImages: function(){
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', Config.getImageListUrl(), true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.parseAndSet(xmlHttp.responseText);
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
deleteImage: function(url){
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', url, true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.actionStop();
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
getXMLHttpRequest: function(){
|
||||
var xmlHttp = null;
|
||||
// Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
|
||||
if (typeof XMLHttpRequest != 'undefined') {
|
||||
xmlHttp = new XMLHttpRequest();
|
||||
}
|
||||
if (!xmlHttp) {
|
||||
// Internet Explorer 6 und älter
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch(e) {
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch(e) {
|
||||
xmlHttp = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
},
|
||||
|
||||
ImageList: null,
|
||||
|
||||
parseAndSet: function(xml){
|
||||
var obj = eval('(' + xml + ')');
|
||||
|
||||
ImageDialog.ImageList.clear()
|
||||
|
||||
// parse loaded JSON object & create new object
|
||||
for(var i = 0; i < obj.length; i++){
|
||||
var size = obj[i].Size;
|
||||
var lnk = obj[i].Link;
|
||||
var imgnameFull = lnk.split("/").pop();
|
||||
|
||||
imgname = imgnameFull.replace("_"+size,"");
|
||||
|
||||
var lnk_test = lnk.split("/");
|
||||
|
||||
if(lnk_test.length == 1 &&lnk_test.shift() != "http:"){
|
||||
lnk = Config.getImageUrl(lnk);
|
||||
}
|
||||
|
||||
if(size == 0)
|
||||
size = "Orig.";
|
||||
|
||||
ImageDialog.ImageList.add(imgname, lnk, size, imgnameFull);
|
||||
}
|
||||
|
||||
|
||||
this.fillSelectList();
|
||||
this.selectOptions();
|
||||
},
|
||||
|
||||
selectByValue: function (obj, value, add_custom, ignore_case) {
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
var found = false;
|
||||
for (var i=0; i<obj.options.length; i++) {
|
||||
var option = obj.options[i];
|
||||
|
||||
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
|
||||
option.selected = true;
|
||||
found = true;
|
||||
} else{
|
||||
option.selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && add_custom && value != '') {
|
||||
var option = new Option(value, value);
|
||||
option.selected = true;
|
||||
obj.options[sel.options.length] = option;
|
||||
obj.selectedIndex = obj.options.length - 1;
|
||||
}
|
||||
|
||||
return found;
|
||||
},
|
||||
|
||||
doDeleteImg : function(){
|
||||
var img = document.getElementById("src_list_size").value.split("/").pop();
|
||||
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
ImageDialog.isDeleting = true;
|
||||
ImageDialog.deleteImage(Config.getDeleteUrl(img));
|
||||
|
||||
},
|
||||
|
||||
isUploading : false,
|
||||
isDeleting : false,
|
||||
|
||||
uploadStart : function(){
|
||||
ImageDialog.isUploading = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
document.getElementById("uploadSubmit").disabled = true;
|
||||
},
|
||||
|
||||
actionStop : function(){
|
||||
|
||||
|
||||
if(ImageDialog.isUploading){
|
||||
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("uploadSubmit").disabled = false;
|
||||
document.getElementById("fileField").disabled = false;
|
||||
document.getElementById("fileField").value = "";
|
||||
this.loadImages();
|
||||
ImageDialog.isUploading = false;
|
||||
}
|
||||
|
||||
if(ImageDialog.isDeleting){
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("imgDelBtn").disabled = false;
|
||||
|
||||
this.loadImages();
|
||||
|
||||
ImageDialog.isDeleting = false;
|
||||
}
|
||||
|
||||
// var http_status=507;
|
||||
// var http_message='507 Insufficient Storage';
|
||||
// var error_message='Upload zu gross, bitte maximal 2 MB hochladen.';
|
||||
|
||||
var iFrame = document.getElementById('actionTarget').contentWindow;
|
||||
|
||||
if(typeof iFrame.error_message != 'undefined'){
|
||||
alert(iFrame.error_message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
function ImageData(){
|
||||
this.list = new Array();
|
||||
}
|
||||
|
||||
ImageData.prototype.add = function(n,u,s ,fn){
|
||||
if(typeof this.list[n] == 'undefined'){
|
||||
this.list[n] = new Array();
|
||||
}
|
||||
|
||||
this.list[n][this.list[n].length] = {url:u, size:s, fullname:fn};
|
||||
|
||||
}
|
||||
ImageData.prototype.clear = function(){
|
||||
this.list = new Array();
|
||||
}
|
||||
ImageData.prototype.getBiggest = function(n){
|
||||
|
||||
if(typeof this.list[n] == 'undefined')
|
||||
return;
|
||||
|
||||
var lst = this.list[n];
|
||||
var b = "";
|
||||
var s = -1;
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
|
||||
if(lst[i].size == "Orig."){
|
||||
return lst[i].url;
|
||||
}
|
||||
|
||||
if( parseInt(lst[i].size) > parseInt(s) ){
|
||||
s = lst[i].size;
|
||||
b = lst[i].url;
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
ImageData.prototype.getUrlOf = function(img){
|
||||
for(n in this.list){
|
||||
var lst = this.list[n];
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
if(lst[i].fn == img){
|
||||
return lst[i].url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImageData.prototype.getOrigNameOf = function(img){
|
||||
|
||||
for(n in this.list){
|
||||
var lst = this.list[n];
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
|
||||
if(lst[i].fullname == img){
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImageData.prototype.fillListWithNames = function(list){
|
||||
for(n in this.list){
|
||||
list.options[list.options.length] = new Option(n, n);
|
||||
}
|
||||
}
|
||||
|
||||
ImageData.prototype.fillListWithSizeOf = function(list, img){
|
||||
|
||||
var lst = this.list[img];
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
list.options[list.options.length] = new Option(lst[i].size, lst[i].url);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ImageData.prototype.fillList = function(l){
|
||||
|
||||
for(n in this.list){
|
||||
var lst = this.list[n];
|
||||
// if(list.options.length > 0){
|
||||
l.options[l.options.length] = new Option("","");
|
||||
// }
|
||||
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
l.options[l.options.length] = new Option(lst[i].fullname, lst[i].url);
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
ImageDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
565
sn_templates/editor_stuff/plugin/snstuff/js/image_old.js
Normal file
@@ -0,0 +1,565 @@
|
||||
var ImageDialog = {
|
||||
preInit : function() {
|
||||
var url;
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
Config.artikelid = parent.entryid;
|
||||
Config.pagetype = parent.pagetpye;
|
||||
Config.imageListUrl = tinyMCEPopup.getParam("snstuff_img_url_list") || "/admin_list_pictures_json/{artikelid}";
|
||||
Config.uploadUrl = tinyMCEPopup.getParam("snstuff_img_url_upload") || "/{pagetype}/{artikelid}?sx_action=on_user_upload";
|
||||
Config.deleteUrl = tinyMCEPopup.getParam("snstuff_img_url_delete") || "/admin_kill_picture?name=articleimage/sn_computer/{artikelid}/{imgname}&id={artikelid}";
|
||||
Config.imageUrl = tinyMCEPopup.getParam("snstuff_img_url_image") || "/articleimage/{artikelid}/{imgname}";
|
||||
|
||||
},
|
||||
|
||||
|
||||
objData:{a:{},c:{},t:'',l:''},
|
||||
|
||||
activeDataName:'',
|
||||
activeDataFullname:'',
|
||||
activeClickPic:'',
|
||||
isUploading: false,
|
||||
isDeleting : false,
|
||||
|
||||
srcData: {},
|
||||
isVideo: false,
|
||||
|
||||
srcList:'',
|
||||
srcListSize:'',
|
||||
srcListSizeFull:'',
|
||||
|
||||
selData: {},
|
||||
imgAlign:"",
|
||||
|
||||
tsrcData:'',
|
||||
tsrcDataName:'',
|
||||
tpicShow:'',
|
||||
tpicShowFull:'',
|
||||
tvideoPic:'',
|
||||
|
||||
init : function(ed) {
|
||||
|
||||
this.watch('tsrcDataName',this.tsrcDataNameAction);
|
||||
this.watch('tsrcData',this.tsrcDataAction);
|
||||
this.watch('tpicShow',this.tpicShowAction);
|
||||
|
||||
document.forms["uploadForm"].action = Config.getUploadUrl();
|
||||
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
TinyMCE_EditableSelects.init();
|
||||
|
||||
if ( n != null && typeof n != 'undefined' && n.nodeName == 'IMG') {
|
||||
this.objData.t = 'pic';
|
||||
this.imgURL = dom.getAttrib(n, 'src');
|
||||
this.objData.a['click'] = dom.getAttrib(n, 'alt');
|
||||
this.selectByValue(document.getElementById('align'), this.getAttrib(n, 'align'));
|
||||
document.getElementById("insert").value = ed.getLang('update');
|
||||
this.imgAlign = dom.getAttrib(n, 'style');
|
||||
|
||||
if (ed.settings.inline_styles) {
|
||||
// Move attribs to styles
|
||||
if (dom.getAttrib(n, 'align'))
|
||||
this.updateStyle('align');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// this.changeAppearance();
|
||||
this.loadData();
|
||||
},
|
||||
|
||||
////////////////////////////
|
||||
tsrcDataNameAction: function(p,o,n){
|
||||
this.tsrcData = this.srcData.o[n]
|
||||
},
|
||||
|
||||
tpicShowAction: function(p,o,n){
|
||||
this.previewData();
|
||||
},
|
||||
|
||||
tpicShowFullAction: function(p,o,n){},
|
||||
|
||||
|
||||
tsrcDataAction: function(p,o,n){
|
||||
|
||||
var lst = tinyMCEPopup.dom.get("src_list_size");
|
||||
var lst2 = tinyMCEPopup.dom.get("src_list_size_full");
|
||||
var lstv = tinyMCEPopup.dom.get("src_list_vid_pic");
|
||||
lstv.options.length = 0;
|
||||
lst.options.length = 0;
|
||||
lst2.options.length = 0;
|
||||
var sp = 0; var sp2 = 0;
|
||||
|
||||
if(typeof(this.tsrcData) != 'undefined'){
|
||||
var dl = this.tsrcData.l;
|
||||
|
||||
tinyMCEPopup.dom.get("src_list_size").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("src_list_size_full").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("align").disabled = false;
|
||||
|
||||
for(var i = 0; i < dl.length; i++){
|
||||
var o = this.tsrcData.o[dl[i]];
|
||||
if(o.fullName == this.activeDataFullname){sp = i;}
|
||||
if(o.fullName == this.activeClickPic){sp2 = i;}
|
||||
lst.options[lst.options.length] = new Option(o.size, o.fullName);
|
||||
lst2.options[lst2.options.length] = new Option(o.size, o.fullName);
|
||||
}
|
||||
|
||||
if(!this.activeClickPic){
|
||||
var sd = -1;
|
||||
for(var i = 0; i < lst2.options.length;i++){
|
||||
var txt = lst2.options[i].text;
|
||||
var s = (txt == 'Orig.')?9999999:parseInt(txt);
|
||||
if(s > sd ){
|
||||
sd = s;
|
||||
sp2 = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
lst2.selectedIndex = sp2;
|
||||
lst.selectedIndex = sp;
|
||||
|
||||
lst.onchange();lst2.onchange();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
// changeAppearance : function() {
|
||||
// var ed = tinyMCEPopup.editor, img = document.getElementById('alignSampleImg');
|
||||
//
|
||||
// if (img) {
|
||||
// if (ed.getParam('inline_styles')) {
|
||||
// ed.dom.setAttrib(img, 'style', ImageDialog.imgAlign);
|
||||
// } else {
|
||||
// img.align = document.getElementById("align").value;
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
insert : function(file, title) {
|
||||
var ed = tinyMCEPopup.editor, t = this;
|
||||
|
||||
if (!this.srcList) {
|
||||
if (ed.selection.getNode().nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
ed.execCommand('mceRepaint');
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
|
||||
t.insertPicAndClose();
|
||||
|
||||
},
|
||||
insertPicAndClose : function() {
|
||||
var ed = tinyMCEPopup.editor, v, args = {}, el;
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
// Fixes crash in Safari
|
||||
if (tinymce.isWebKit)
|
||||
ed.getWin().focus();
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
|
||||
// if (!ed.settings.inline_styles) {
|
||||
args = {
|
||||
align : document.getElementById("align").value
|
||||
};
|
||||
// } else {
|
||||
// // Remove deprecated values
|
||||
// args = {
|
||||
// align : ''
|
||||
// };
|
||||
// }
|
||||
|
||||
tinymce.extend(args, {
|
||||
src : this.selData.lnk,
|
||||
alt : this.srcListSizeFull,
|
||||
style : this.imgAlign,
|
||||
href : this.selData.lnk
|
||||
});
|
||||
|
||||
el = ed.selection.getNode();
|
||||
|
||||
|
||||
// entfernen und neu einfuegen. Weil das advimagescale plugin sonst unerwuenschten nebeneffekt erzeugt
|
||||
if (el && el.nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
// ed.dom.setAttribs(el, args);
|
||||
} //else {
|
||||
// if(this.srcList){
|
||||
ed.execCommand('mceInsertContent', false, '<img class="noresize" id="__mce_tmp" />', {skip_undo : 1});
|
||||
ed.dom.setAttribs('__mce_tmp', args);
|
||||
ed.dom.setAttrib('__mce_tmp', 'id', '');
|
||||
ed.undoManager.add();
|
||||
// }
|
||||
// }
|
||||
|
||||
// ed.execCommand('mceRepaint');
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
|
||||
insertVideoAndClose: function(){
|
||||
var html = "";
|
||||
},
|
||||
|
||||
updateStyle : function(ty) {
|
||||
var dom = tinyMCEPopup.dom, st, v, img = dom.create('img', {style : ImageDialog.imgAlign});
|
||||
|
||||
if (tinyMCEPopup.editor.settings.inline_styles) {
|
||||
// Handle align
|
||||
if (ty == 'align') {
|
||||
dom.setStyle(img, 'float', '');
|
||||
dom.setStyle(img, 'vertical-align', '');
|
||||
|
||||
v = document.getElementById("align").value;
|
||||
if (v) {
|
||||
if (v == 'left' || v == 'right')
|
||||
dom.setStyle(img, 'float', v);
|
||||
else
|
||||
img.style.verticalAlign = v;
|
||||
}
|
||||
}
|
||||
// Merge
|
||||
ImageDialog.imgAlign = dom.serializeStyle(dom.parseStyle(img.style.cssText));
|
||||
}
|
||||
},
|
||||
|
||||
selectByValue: function (obj, value, add_custom, ignore_case) {
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
var found = false;
|
||||
for (var i=0; i<obj.options.length; i++) {
|
||||
var option = obj.options[i];
|
||||
|
||||
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
|
||||
option.selected = true;
|
||||
found = true;
|
||||
} else{
|
||||
option.selected = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && add_custom && value != '') {
|
||||
var option = new Option(value, value);
|
||||
option.selected = true;
|
||||
obj.options[sel.options.length] = option;
|
||||
obj.selectedIndex = obj.options.length - 1;
|
||||
}
|
||||
|
||||
return found;
|
||||
},
|
||||
|
||||
getAttrib : function(e, at) {
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
||||
|
||||
if (ed.settings.inline_styles) {
|
||||
switch (at) {
|
||||
case 'align':
|
||||
if (v = dom.getStyle(e, 'float'))
|
||||
return v;
|
||||
|
||||
if (v = dom.getStyle(e, 'vertical-align'))
|
||||
return v;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (v = dom.getAttrib(e, at))
|
||||
return v;
|
||||
|
||||
return '';
|
||||
},
|
||||
srcListAction: function(v){
|
||||
|
||||
this.srcList = v;
|
||||
var lst = tinyMCEPopup.dom.get("src_list_size");
|
||||
var lst2 = tinyMCEPopup.dom.get("src_list_size_full");
|
||||
var lstv = tinyMCEPopup.dom.get("src_list_vid_pic");
|
||||
lstv.options.length = 0;
|
||||
lst.options.length = 0;
|
||||
lst2.options.length = 0;
|
||||
var sp = 0; var sp2 = 0;
|
||||
|
||||
if(this.srcData.data[v]){
|
||||
if(this.srcData.data[v].type == 'pic'){
|
||||
tinyMCEPopup.dom.get("src_list_size").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("src_list_size_full").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("align").disabled = false;
|
||||
var d = this.srcData.data[v].lst;
|
||||
|
||||
for(var i = 0; i < d.length; i++){
|
||||
if(d[i].fullName == this.activeDataFullname){sp = i;}
|
||||
if(d[i].fullName == this.activeClickPic){sp2 = i;}
|
||||
|
||||
lst.options[lst.options.length] = new Option(d[i].size, d[i].fullName);
|
||||
lst2.options[lst2.options.length] = new Option(d[i].size, d[i].fullName);
|
||||
}
|
||||
|
||||
if(!this.activeClickPic){
|
||||
var sd = -1;
|
||||
for(var i = 0; i < lst2.options.length;i++){
|
||||
var txt = lst2.options[i].text;
|
||||
var s = (txt == 'Orig.')?9999999:parseInt(txt);
|
||||
if(s > sd ){
|
||||
sd = s;
|
||||
sp2 = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
lst2.selectedIndex = sp2;
|
||||
lst.selectedIndex = sp;
|
||||
|
||||
|
||||
this.srcListSize = lst.options[lst.selectedIndex].value;
|
||||
this.srcListSizeFull = lst2.options[lst2.selectedIndex].value;
|
||||
lst.onchange();
|
||||
}else{
|
||||
tinyMCEPopup.dom.get("src_list_size").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("src_list_size_full").style.display = 'none';
|
||||
tinyMCEPopup.dom.get("src_list_vid_pic").style.display = 'inline';
|
||||
tinyMCEPopup.dom.get("align").disabled = true;
|
||||
|
||||
this.selData = this.srcData.data[v].lst[0];
|
||||
|
||||
var d = this.srcData;
|
||||
for(var i = 0; i < d.imgLst.length; i++){
|
||||
if(this.srcData.data[d.imgLst[i]].type != 'pic'){continue;}
|
||||
var pl = this.srcData.data[d.imgLst[i]].lst;
|
||||
lstv.options[lstv.options.length] = new Option('','');
|
||||
for(var j = 0; j < pl.length; j++){
|
||||
if(pl[j].fullName == this.srcListSize){ sp = lst.options.length};
|
||||
lstv.options[lstv.options.length] = new Option(pl[j].fullName,pl[j].fullName);
|
||||
}
|
||||
}
|
||||
lstv.selectedIndex = sp;
|
||||
lstv.onchange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
picSizeAction:function(v){
|
||||
this.srcListSize = v;
|
||||
this.selData = {};
|
||||
if(this.srcData.data[this.srcList]){
|
||||
var lst = this.srcData.data[this.srcList].lst;
|
||||
for(var i = 0; i < lst.length; i++){
|
||||
if(lst[i].fullName == v){
|
||||
this.selData = lst[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.previewData(this.selData);
|
||||
},
|
||||
|
||||
videoPicAction: function(v){
|
||||
this.srcListSize = v;
|
||||
},
|
||||
|
||||
picSizeFullAction:function(v){
|
||||
this.srcListSizeFull = v;
|
||||
},
|
||||
|
||||
previewData : function() {
|
||||
|
||||
if (!this.tsrcData) {
|
||||
tinyMCEPopup.dom.setHTML('prev', '');
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// if (tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
||||
// this.resetImageData();
|
||||
var o = this.tsrcData.o[this.tpicShow];
|
||||
var u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(o.lnk);
|
||||
document.getElementById("imgDelBtn").disabled = false
|
||||
|
||||
// if (!st)
|
||||
// tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
||||
// else
|
||||
// tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
||||
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="" />');
|
||||
},
|
||||
//////////////////////////////// Helper ////////////////////////////
|
||||
|
||||
loadData: function(){
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', Config.getImageListUrl(), true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.parseAndSet(xmlHttp.responseText);
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
deleteData: function(url){
|
||||
var xmlHttp = this.getXMLHttpRequest();
|
||||
if(xmlHttp){
|
||||
xmlHttp.open('GET', url, true);
|
||||
xmlHttp.onreadystatechange = function () {
|
||||
|
||||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||||
ImageDialog.actionStop();
|
||||
}
|
||||
};
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
},
|
||||
|
||||
doDeleteImg : function(){
|
||||
var img = this.srcListSize;;
|
||||
|
||||
document.getElementById("imgDelBtn").disabled = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
ImageDialog.isDeleting = true;
|
||||
ImageDialog.deleteData(Config.getDeleteUrl(img));
|
||||
|
||||
},
|
||||
|
||||
getXMLHttpRequest: function(){
|
||||
var xmlHttp = null;
|
||||
// Mozilla, Opera, Safari sowie Internet Explorer (ab v7)
|
||||
if (typeof XMLHttpRequest != 'undefined') {
|
||||
xmlHttp = new XMLHttpRequest();
|
||||
}
|
||||
if (!xmlHttp) {
|
||||
// Internet Explorer 6 und älter
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch(e) {
|
||||
try {
|
||||
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch(e) {
|
||||
xmlHttp = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return xmlHttp;
|
||||
},
|
||||
|
||||
parseAndSet: function(xml){
|
||||
var obj = eval('(' + xml + ')');
|
||||
|
||||
this.srcData = {'l':[],'o':{},'t':''};
|
||||
|
||||
var id = 0;
|
||||
// parse loaded JSON object & create new object
|
||||
|
||||
this.activeDataFullname = (this.imgURL)?this.imgURL.split('/').pop():undefined;
|
||||
|
||||
for(var i = 0; i < obj.length; i++){
|
||||
var size = obj[i].Size;
|
||||
var lnk = obj[i].Link;
|
||||
var imgnameFull = lnk.split("/").pop();
|
||||
|
||||
imgname = imgnameFull.replace("_"+size,"");
|
||||
|
||||
var lnk_test = lnk.split("/");
|
||||
|
||||
if(lnk_test.length == 1 &&lnk_test.shift() != "http:"){
|
||||
lnk = Config.getImageUrl(lnk);
|
||||
}
|
||||
|
||||
if(size == 0)
|
||||
size = "Orig.";
|
||||
|
||||
if(typeof(this.srcData.o[imgname]) == 'undefined'){
|
||||
this.srcData.l.push(imgname);
|
||||
this.srcData.o[imgname] = {'l':[],'o':{},'t':''};
|
||||
this.srcData.o[imgname]['t'] = obj[i].Type;
|
||||
}
|
||||
|
||||
|
||||
this.srcData.o[imgname].o[imgnameFull] = {'name':imgname, 'fullName':imgnameFull, 'size':size,'lnk':lnk};
|
||||
this.srcData.o[imgname].l.push(imgnameFull);
|
||||
|
||||
|
||||
if(imgnameFull == this.activeDataFullname){ this.activeDataName = imgname;}
|
||||
}
|
||||
////////////
|
||||
|
||||
var lst = tinyMCEPopup.dom.get("src_list");
|
||||
|
||||
lst.options.length = 0;
|
||||
|
||||
lst.options[lst.options.length] = new Option('', '');
|
||||
var d = this.srcData;
|
||||
var sp = 0;
|
||||
for(var i = 0; i < d.l.length; i++){
|
||||
if(d.l[i] == this.activeDataName){
|
||||
sp = i+1;
|
||||
}
|
||||
lst.options[lst.options.length] = new Option(d.l[i], d.l[i]);
|
||||
}
|
||||
lst.selectedIndex = sp;
|
||||
lst.onchange();
|
||||
},
|
||||
|
||||
uploadStart : function(){
|
||||
ImageDialog.isUploading = true;
|
||||
document.getElementById("waitImg").style.visibility = "visible";
|
||||
document.getElementById("uploadSubmit").disabled = true;
|
||||
},
|
||||
|
||||
actionStop : function(){
|
||||
|
||||
|
||||
if(ImageDialog.isUploading){
|
||||
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("uploadSubmit").disabled = false;
|
||||
document.getElementById("fileField").disabled = false;
|
||||
document.getElementById("fileField").value = "";
|
||||
this.loadData();
|
||||
ImageDialog.isUploading = false;
|
||||
}
|
||||
|
||||
if(ImageDialog.isDeleting){
|
||||
document.getElementById("waitImg").style.visibility = "hidden";
|
||||
document.getElementById("imgDelBtn").disabled = false;
|
||||
|
||||
this.loadData();
|
||||
|
||||
ImageDialog.isDeleting = false;
|
||||
}
|
||||
|
||||
// var http_status=507;
|
||||
// var http_message='507 Insufficient Storage';
|
||||
// var error_message='Upload zu gross, bitte maximal 2 MB hochladen.';
|
||||
|
||||
var iFrame = document.getElementById('actionTarget').contentWindow;
|
||||
|
||||
if(typeof iFrame.error_message != 'undefined'){
|
||||
alert(iFrame.error_message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
ImageDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
63
sn_templates/editor_stuff/plugin/snstuff/js/infobox.js
Normal file
@@ -0,0 +1,63 @@
|
||||
/* Functions for the advlink plugin popup */
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function preinit() {
|
||||
var url;
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
}
|
||||
|
||||
function init() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode()
|
||||
var sel = ed.selection.getContent();
|
||||
var pnode = ed.dom.getParent(node, function(n) {return ed.dom.hasClass(n, "snInfoBox");});
|
||||
|
||||
if(pnode){
|
||||
formObj.insert.value = tinyMCEPopup.getLang('update', 'Insert', true);
|
||||
var _pwv = parseInt(pnode.style.width);
|
||||
formObj.size.value = isNaN(_pwv) ? 100: _pwv;
|
||||
var f = pnode.style.cssText.indexOf("float: left") != -1 ? "left":"right"; // workroung becouse pnode.style.float return undefined
|
||||
var o = formObj.float.options;
|
||||
for(var i = 0; i < o.length;i++){
|
||||
if(o[i].value == f){
|
||||
o.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode()
|
||||
var sel = ed.selection.getContent();
|
||||
var pnode = ed.dom.getParent(node, function(n) {return ed.dom.hasClass(n, "snInfoBox");});
|
||||
|
||||
var s = parseInt(formObj.size.value);
|
||||
var f = formObj.float.value;
|
||||
var args = {style: "width:"+s+"px; float:"+f+";", class:"snInfoBox"};
|
||||
|
||||
if(!pnode && sel.length == 0){ sel = tinyMCEPopup.getLang('snstuff_dlg.ibox_defaulttext', 'Text....', true);}
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
if(sel.length > 0){
|
||||
ed.execCommand('mceInsertRawHTML', false, '<span id="__snInfoBoxTmp" >'+sel+'</span>', {skip_undo : 1});
|
||||
ed.dom.setAttribs('__snInfoBoxTmp', args);
|
||||
ed.dom.setAttrib('__snInfoBoxTmp', 'id', '');
|
||||
ed.undoManager.add();
|
||||
}else{
|
||||
ed.dom.setAttribs(pnode, args);
|
||||
}
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
ed.execCommand('mceRepaint');
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
|
32
sn_templates/editor_stuff/plugin/snstuff/js/sncode.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Functions for the advlink plugin popup */
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function preinit() {
|
||||
var url;
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
}
|
||||
|
||||
function init() {
|
||||
}
|
||||
function insertAction() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode()
|
||||
|
||||
// if (node && node.nodeName == 'CODE') {
|
||||
// node.firstChild.nodeValue = document.getElementById("text").value;
|
||||
// }else {
|
||||
ed.execCommand('mceInsertContent', false, '<code>'+formObj.text.value.replace(/\n/g,"<br />")+'</code>', {skip_undo : 1});
|
||||
ed.undoManager.add();
|
||||
// }
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
|
112
sn_templates/editor_stuff/plugin/snstuff/js/snlink.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/* Functions for the advlink plugin popup */
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function preinit() {
|
||||
/* var url;
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');*/
|
||||
}
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var enode = ed.selection.getNode();
|
||||
|
||||
var node = ed.dom.getParent(enode, "A");
|
||||
var selTxt = ed.selection.getContent();
|
||||
|
||||
if(enode.nodeName == 'IMG'){
|
||||
document.getElementById("urlName").style.visibility = "hidden";
|
||||
}
|
||||
|
||||
if(node != null && typeof node != 'undefined' && node.nodeName == 'A'){
|
||||
formObj.insert.value = tinyMCEPopup.getLang('update', 'Insert', true);
|
||||
|
||||
var url = ed.dom.getAttrib(node,"href");
|
||||
var txt = node.firstChild.nodeValue;
|
||||
var desc = ed.dom.getAttrib(node,"title");
|
||||
formObj.urlField.value = url;
|
||||
formObj.nameField.value = txt;
|
||||
formObj.descField.value = desc;
|
||||
|
||||
}else{
|
||||
|
||||
if(isURL(selTxt)){
|
||||
formObj.urlField.value = selTxt.replace(/^\s*/,"");
|
||||
}
|
||||
if(enode.nodeName != 'IMG'){
|
||||
formObj.nameField.value = selTxt;
|
||||
}
|
||||
if(selTxt.length > 0){
|
||||
document.getElementById("urlName").style.visibility = "hidden";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var enode = ed.selection.getNode();
|
||||
|
||||
var node = ed.dom.getParent(enode, "A");
|
||||
|
||||
// Remove element if there is no href
|
||||
if (!formObj.urlField.value) {
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
i = ed.selection.getBookmark();
|
||||
ed.dom.remove(node, 1);
|
||||
ed.selection.moveToBookmark(i);
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
|
||||
var lnk = formObj.urlField.value;//ed.baseURI.toAbsolute(formObj.urlField.value);
|
||||
var title = formObj.descField.value;
|
||||
if(!title || title.length == 0){
|
||||
title = lnk;
|
||||
}
|
||||
if (node && node.nodeName == 'A') {
|
||||
ed.dom.setAttrib(node, "href", lnk);
|
||||
ed.dom.setAttrib(node, "title", title);
|
||||
node.firstChild.nodeValue = formObj.nameField.value;
|
||||
|
||||
}else {
|
||||
// if(ed.selection.getContent().length > 0){
|
||||
// ed.getDoc().execCommand("unlink", false, null);
|
||||
// tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
|
||||
//
|
||||
// elementArray = tinymce.grep(ed.dom.select("a"), function(n) {return ed.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
||||
// for (i=0; i<elementArray.length; i++){
|
||||
// var elm = elementArray[i];
|
||||
// ed.dom.setAttrib(elm, "href", formObj.urlField.value);
|
||||
// }
|
||||
// }else{
|
||||
ed.execCommand('mceInsertContent', false, '<a href="'+lnk+'" title="'+title+'">'+formObj.nameField.value+'</a>', {skip_undo : 1});
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isURL(str){
|
||||
if(str.match(/^http(s){0,1}:\/\//) || str.match(/^\s*www.*\..+/)){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
tinyMCEPopup.onInit.add(init);
|
31
sn_templates/editor_stuff/plugin/snstuff/js/snquote.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Functions for the advlink plugin popup */
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function preinit() {
|
||||
var url;
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
}
|
||||
|
||||
function init() {
|
||||
}
|
||||
function insertAction() {
|
||||
var formObj = document.forms[0];
|
||||
var ed = tinyMCEPopup.editor;
|
||||
var node = ed.selection.getNode()
|
||||
|
||||
// if (node && node.nodeName == 'BLOCKQUOTE') {
|
||||
// node.firstChild.nodeValue = document.getElementById("text").value;
|
||||
// }else {
|
||||
ed.execCommand('mceInsertRawHTML', false, '<blockquote>'+formObj.text.value.replace(/\n/g,"<br />")+'</blockquote>', {skip_undo : 1});
|
||||
ed.undoManager.add();
|
||||
// }
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
tinyMCEPopup.onInit.add(init);
|
70
sn_templates/editor_stuff/plugin/snstuff/langs/de_dlg.js
Normal file
@@ -0,0 +1,70 @@
|
||||
tinyMCE.addI18n('de.snstuff_dlg',{
|
||||
img_tab_upload: "Bilder Hochladen",
|
||||
img_general:"Allgemein",
|
||||
img_title:"Title",
|
||||
img_preview:"Vorschau",
|
||||
img_style:"Style",
|
||||
img_classes:"Classes",
|
||||
img_ltr:"Links nach Rechts",
|
||||
img_rtl:"Rechts nach Links",
|
||||
img_id:"Id",
|
||||
img_map:"Bilderliste",
|
||||
img_dialog_title:"Bilder/Videos Einf\u00FCgen/Bearbeiten",
|
||||
img_list:"Medienliste",
|
||||
img_align:"Ausrichtung",
|
||||
img_align_top:"Oben",
|
||||
img_align_middle:"Mittig",
|
||||
img_align_bottom:"Unten",
|
||||
img_align_texttop:"Text oben",
|
||||
img_align_textbottom:"Text unten",
|
||||
img_align_left:"Links",
|
||||
img_align_right:"Reschts",
|
||||
img_align_none:"Keine",
|
||||
img_image_list:"Medienliste",
|
||||
img_image_delete:"Löschen",
|
||||
img_upload:"Bild/Video hochladen",
|
||||
img_imagefile_select:"Bild/Video:",
|
||||
img_imagefile_sndbtn: "Hochladen",
|
||||
img_imagefile_uploadnotify:"Bildvorschau",
|
||||
img_imagedelete:"Gewähltes Bild/Video löschen",
|
||||
img_imgsize_40height : "40 Pixel Höhe",
|
||||
img_imgsize_80height : "80 Pixel Höhe",
|
||||
img_imgsize_200width : "200 Pixel Breite",
|
||||
img_imgsize_470width : "470 Pixel Breite",
|
||||
img_width:"Breite",
|
||||
img_height:"Höhe",
|
||||
img_pic_select : "Bild größe",
|
||||
img_vpic_select : "Vorschaubild",
|
||||
img_video_pic : " ",
|
||||
img_pic_show : " ",
|
||||
img_pic_show_full : " Vollbild ",
|
||||
|
||||
|
||||
lnk_title: "Link Einf\u00FCgen/Bearbeiten",
|
||||
lnk_general_props: "Link bearbeiten",
|
||||
lnk_desc:"Link",
|
||||
lnk_field_url:"URL",
|
||||
lnk_field_desc:"Title (Opt.)",
|
||||
lnk_field_name:"Text",
|
||||
|
||||
|
||||
quote_desc:"Zitat",
|
||||
qoute_general_props: "Zitat",
|
||||
quote_title:"Zitat einf\u00FCgen",
|
||||
|
||||
code_desc:"Quelltext",
|
||||
code_general_props: "Quelltext",
|
||||
code_title:"Quelltext einf\u00FCgen",
|
||||
|
||||
ibox_title: "InfoBox Einf\u00FCgen/Bearbeiten",
|
||||
ibox_general_props:"InfoBox",
|
||||
ibox_input_titel:"Titel:",
|
||||
ibox_input_size:"Breite:",
|
||||
ibox_input_float:"Position:",
|
||||
ibox_fopt_none:"keine",
|
||||
ibox_fopt_right:"Rechts",
|
||||
ibox_fopt_left:"Links",
|
||||
ibox_defaulttext:"Bitte text eingeben..",
|
||||
////
|
||||
last:""
|
||||
});
|
83
sn_templates/editor_stuff/plugin/snstuff/langs/en_dlg.js
Normal file
@@ -0,0 +1,83 @@
|
||||
tinyMCE.addI18n('en.snimages_dlg',{
|
||||
tab_general:"General",
|
||||
tab_appearance:"Appearance",
|
||||
tab_advanced:"Advanced",
|
||||
tab_upload: "Image Upload",
|
||||
general:"General",
|
||||
title:"Title",
|
||||
preview:"Preview",
|
||||
constrain_proportions:"Constrain proportions",
|
||||
langdir:"Language direction",
|
||||
langcode:"Language code",
|
||||
long_desc:"Long description link",
|
||||
style:"Style",
|
||||
classes:"Classes",
|
||||
ltr:"Left to right",
|
||||
rtl:"Right to left",
|
||||
id:"Id",
|
||||
map:"Image map",
|
||||
swap_image:"Swap image",
|
||||
alt_image:"Alternative image",
|
||||
mouseover:"for mouse over",
|
||||
mouseout:"for mouse out",
|
||||
misc:"Miscellaneous",
|
||||
example_img:"Appearance preview image",
|
||||
missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
|
||||
dialog_title:"1Insert/edit image",
|
||||
src:"Image URL",
|
||||
alt:"Image description",
|
||||
list:"Image list",
|
||||
border:"Border",
|
||||
dimensions:"Dimensions",
|
||||
vspace:"Vertical space",
|
||||
hspace:"Horizontal space",
|
||||
align:"Alignment",
|
||||
align_baseline:"Baseline",
|
||||
align_top:"Top",
|
||||
align_middle:"Middle",
|
||||
align_bottom:"Bottom",
|
||||
align_texttop:"Text top",
|
||||
align_textbottom:"Text bottom",
|
||||
align_left:"Left",
|
||||
align_right:"Right",
|
||||
align_none:"None",
|
||||
image_list:"Image list",
|
||||
image_delete:"Delete",
|
||||
upload:"Image Upload",
|
||||
imagefile_select:"Select Image",
|
||||
imagefile_sndbtn: "Upload",
|
||||
imagefile_uploadnotify:"Image Preview",
|
||||
imagedelete:"Delete selected Image",
|
||||
imgsize_40height : "40 Pixel height",
|
||||
imgsize_80height : "80 Pixel height",
|
||||
imgsize_200width : "200 Pixel width",
|
||||
imgsize_470width : "470 Pixel width",
|
||||
|
||||
|
||||
lnk_title: "Insert/Edit link",
|
||||
lnk_general_props: "Edit Link",
|
||||
lnk_desc:"Link",
|
||||
lnk_field_url:"URL",
|
||||
lnk_field_desc:"Description",
|
||||
|
||||
quote_desc:"Quote",
|
||||
qoute_general_props: "Quote",
|
||||
quote_title:"Insert Quote",
|
||||
|
||||
code_desc:"Code",
|
||||
code_general_props: "Code",
|
||||
code_title:"Insert Code",
|
||||
|
||||
ibox_titel:"Insert/Edit InfoBox",
|
||||
ibox_general_props:"InfoBox",
|
||||
ibox_input_titel:"Titel:",
|
||||
ibox_input_size:"Width:",
|
||||
ibox_input_float:"Position:",
|
||||
ibox_fopt_none:"none",
|
||||
ibox_fopt_right:"Right",
|
||||
ibox_fopt_left:"Left",
|
||||
ibox_defaulttext:"Enter text here...",
|
||||
////
|
||||
last:""
|
||||
|
||||
});
|
5
sn_templates/editor_stuff/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Im Ordner editor_stuff befinden sich alle geänderten dateien/plugins.
|
||||
Bei ein update des editor sollte drauf geachtet werden das alle links passen.
|
||||
Das sind im Ordner editor_stuff die links: utils und tinymce_popup.js
|
||||
Im unterordner langs von tinymce sollte ein link auf die deutsche sprachdatei(de.js) im ordner editor_stuff befinden.
|
||||
Oder die de.js in den langs ordner von tinymce kopieren.
|
54
sn_templates/editor_stuff/themes/advanced/about.htm
Normal file
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.about_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="js/about.js"></script>
|
||||
</head>
|
||||
<body id="about" style="display: none">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
|
||||
<li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
|
||||
<li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<h3>{#advanced_dlg.about_title}</h3>
|
||||
<p>Version: <span id="version"></span> (<span id="date"></span>)</p>
|
||||
<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
|
||||
by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
|
||||
<p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
|
||||
<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
|
||||
|
||||
<div id="buttoncontainer">
|
||||
<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
|
||||
<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>
|
||||
<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="plugins_panel" class="panel">
|
||||
<div id="pluginscontainer">
|
||||
<h3>{#advanced_dlg.about_loaded}</h3>
|
||||
|
||||
<div id="plugintablecontainer">
|
||||
</div>
|
||||
|
||||
<p> </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="help_panel" class="panel noscroll" style="overflow: visible;">
|
||||
<div id="iframecontainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
26
sn_templates/editor_stuff/themes/advanced/anchor.htm
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.anchor_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/anchor.js"></script>
|
||||
</head>
|
||||
<body style="display: none">
|
||||
<form onsubmit="AnchorDialog.update();return false;" action="#">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap">{#advanced_dlg.anchor_name}:</td>
|
||||
<td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#update}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
52
sn_templates/editor_stuff/themes/advanced/charmap.htm
Normal file
@@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.charmap_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/charmap.js"></script>
|
||||
</head>
|
||||
<body id="charmap" style="display:none">
|
||||
<table align="center" border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="charmapView" rowspan="2" align="left" valign="top">
|
||||
<!-- Chars will be rendered here -->
|
||||
</td>
|
||||
<td width="100" align="center" valign="top">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px">
|
||||
<tr>
|
||||
<td id="codeV"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="codeN"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="bottom" style="padding-bottom: 3px;">
|
||||
<table width="100" align="center" border="0" cellpadding="2" cellspacing="0">
|
||||
<tr>
|
||||
<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 1px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
73
sn_templates/editor_stuff/themes/advanced/color_picker.htm
Normal file
@@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.colorpicker_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="js/color_picker.js"></script>
|
||||
</head>
|
||||
<body id="colorpicker" style="display: none">
|
||||
<form onsubmit="insertAction();return false" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
|
||||
<li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
|
||||
<li id="named_tab"><span><a href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="picker_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
|
||||
<div id="picker">
|
||||
<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
|
||||
|
||||
<div id="light">
|
||||
<!-- Will be filled with divs -->
|
||||
</div>
|
||||
|
||||
<br style="clear: both" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="rgb_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{#advanced_dlg.colorpicker_palette_title}</legend>
|
||||
<div id="webcolors">
|
||||
<!-- Gets filled with web safe colors-->
|
||||
</div>
|
||||
|
||||
<br style="clear: both" />
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="named_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{#advanced_dlg.colorpicker_named_title}</legend>
|
||||
<div id="namedcolors">
|
||||
<!-- Gets filled with named colors-->
|
||||
</div>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
||||
<div id="colornamecontainer">
|
||||
{#advanced_dlg.colorpicker_name} <span id="colorname"></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#apply}" />
|
||||
|
||||
<div id="preview"></div>
|
||||
|
||||
<div id="previewblock">
|
||||
<label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
1176
sn_templates/editor_stuff/themes/advanced/editor_template_src.js
Normal file
80
sn_templates/editor_stuff/themes/advanced/image.htm
Normal file
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.image_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="js/image.js"></script>
|
||||
</head>
|
||||
<body id="image" style="display: none">
|
||||
<form onsubmit="ImageDialog.update();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
|
||||
<td id="srcbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="image_list">{#advanced_dlg.image_list}</label></td>
|
||||
<td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
|
||||
<td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
|
||||
<td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="baseline">{#advanced_dlg.image_align_baseline}</option>
|
||||
<option value="top">{#advanced_dlg.image_align_top}</option>
|
||||
<option value="middle">{#advanced_dlg.image_align_middle}</option>
|
||||
<option value="bottom">{#advanced_dlg.image_align_bottom}</option>
|
||||
<option value="text-top">{#advanced_dlg.image_align_texttop}</option>
|
||||
<option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
|
||||
<option value="left">{#advanced_dlg.image_align_left}</option>
|
||||
<option value="right">{#advanced_dlg.image_align_right}</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
|
||||
<td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
|
||||
x
|
||||
<input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
|
||||
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
|
||||
<td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
|
||||
<td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
BIN
sn_templates/editor_stuff/themes/advanced/img/colorpicker.jpg
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
sn_templates/editor_stuff/themes/advanced/img/icons.gif
Normal file
After Width: | Height: | Size: 12 KiB |
72
sn_templates/editor_stuff/themes/advanced/js/about.js
Normal file
@@ -0,0 +1,72 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function init() {
|
||||
var ed, tcont;
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
ed = tinyMCEPopup.editor;
|
||||
|
||||
// Give FF some time
|
||||
window.setTimeout(insertHelpIFrame, 10);
|
||||
|
||||
tcont = document.getElementById('plugintablecontainer');
|
||||
document.getElementById('plugins_tab').style.display = 'none';
|
||||
|
||||
var html = "";
|
||||
html += '<table id="plugintable">';
|
||||
html += '<thead>';
|
||||
html += '<tr>';
|
||||
html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';
|
||||
html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';
|
||||
html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';
|
||||
html += '</tr>';
|
||||
html += '</thead>';
|
||||
html += '<tbody>';
|
||||
|
||||
tinymce.each(ed.plugins, function(p, n) {
|
||||
var info;
|
||||
|
||||
if (!p.getInfo)
|
||||
return;
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
info = p.getInfo();
|
||||
|
||||
if (info.infourl != null && info.infourl != '')
|
||||
html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';
|
||||
else
|
||||
html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';
|
||||
|
||||
if (info.authorurl != null && info.authorurl != '')
|
||||
html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';
|
||||
else
|
||||
html += '<td width="35%">' + info.author + '</td>';
|
||||
|
||||
html += '<td width="15%">' + info.version + '</td>';
|
||||
html += '</tr>';
|
||||
|
||||
document.getElementById('plugins_tab').style.display = '';
|
||||
|
||||
});
|
||||
|
||||
html += '</tbody>';
|
||||
html += '</table>';
|
||||
|
||||
tcont.innerHTML = html;
|
||||
|
||||
tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
|
||||
tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;
|
||||
}
|
||||
|
||||
function insertHelpIFrame() {
|
||||
var html;
|
||||
|
||||
if (tinyMCEPopup.getParam('docs_url')) {
|
||||
html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
|
||||
document.getElementById('iframecontainer').innerHTML = html;
|
||||
document.getElementById('help_tab').style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
37
sn_templates/editor_stuff/themes/advanced/js/anchor.js
Normal file
@@ -0,0 +1,37 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var AnchorDialog = {
|
||||
init : function(ed) {
|
||||
var action, elm, f = document.forms[0];
|
||||
|
||||
this.editor = ed;
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
v = ed.dom.getAttrib(elm, 'name');
|
||||
|
||||
if (v) {
|
||||
this.action = 'update';
|
||||
f.anchorName.value = v;
|
||||
}
|
||||
|
||||
f.insert.value = ed.getLang(elm ? 'update' : 'insert');
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var ed = this.editor, elm, name = document.forms[0].anchorName.value;
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
if (this.action != 'update')
|
||||
ed.selection.collapse(1);
|
||||
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
if (elm)
|
||||
elm.name = name;
|
||||
else
|
||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
|
335
sn_templates/editor_stuff/themes/advanced/js/charmap.js
Normal file
@@ -0,0 +1,335 @@
|
||||
/**
|
||||
* charmap.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var charmap = [
|
||||
[' ', ' ', true, 'no-break space'],
|
||||
['&', '&', true, 'ampersand'],
|
||||
['"', '"', true, 'quotation mark'],
|
||||
// finance
|
||||
['¢', '¢', true, 'cent sign'],
|
||||
['€', '€', true, 'euro sign'],
|
||||
['£', '£', true, 'pound sign'],
|
||||
['¥', '¥', true, 'yen sign'],
|
||||
// signs
|
||||
['©', '©', true, 'copyright sign'],
|
||||
['®', '®', true, 'registered sign'],
|
||||
['™', '™', true, 'trade mark sign'],
|
||||
['‰', '‰', true, 'per mille sign'],
|
||||
['µ', 'µ', true, 'micro sign'],
|
||||
['·', '·', true, 'middle dot'],
|
||||
['•', '•', true, 'bullet'],
|
||||
['…', '…', true, 'three dot leader'],
|
||||
['′', '′', true, 'minutes / feet'],
|
||||
['″', '″', true, 'seconds / inches'],
|
||||
['§', '§', true, 'section sign'],
|
||||
['¶', '¶', true, 'paragraph sign'],
|
||||
['ß', 'ß', true, 'sharp s / ess-zed'],
|
||||
// quotations
|
||||
['‹', '‹', true, 'single left-pointing angle quotation mark'],
|
||||
['›', '›', true, 'single right-pointing angle quotation mark'],
|
||||
['«', '«', true, 'left pointing guillemet'],
|
||||
['»', '»', true, 'right pointing guillemet'],
|
||||
['‘', '‘', true, 'left single quotation mark'],
|
||||
['’', '’', true, 'right single quotation mark'],
|
||||
['“', '“', true, 'left double quotation mark'],
|
||||
['”', '”', true, 'right double quotation mark'],
|
||||
['‚', '‚', true, 'single low-9 quotation mark'],
|
||||
['„', '„', true, 'double low-9 quotation mark'],
|
||||
['<', '<', true, 'less-than sign'],
|
||||
['>', '>', true, 'greater-than sign'],
|
||||
['≤', '≤', true, 'less-than or equal to'],
|
||||
['≥', '≥', true, 'greater-than or equal to'],
|
||||
['–', '–', true, 'en dash'],
|
||||
['—', '—', true, 'em dash'],
|
||||
['¯', '¯', true, 'macron'],
|
||||
['‾', '‾', true, 'overline'],
|
||||
['¤', '¤', true, 'currency sign'],
|
||||
['¦', '¦', true, 'broken bar'],
|
||||
['¨', '¨', true, 'diaeresis'],
|
||||
['¡', '¡', true, 'inverted exclamation mark'],
|
||||
['¿', '¿', true, 'turned question mark'],
|
||||
['ˆ', 'ˆ', true, 'circumflex accent'],
|
||||
['˜', '˜', true, 'small tilde'],
|
||||
['°', '°', true, 'degree sign'],
|
||||
['−', '−', true, 'minus sign'],
|
||||
['±', '±', true, 'plus-minus sign'],
|
||||
['÷', '÷', true, 'division sign'],
|
||||
['⁄', '⁄', true, 'fraction slash'],
|
||||
['×', '×', true, 'multiplication sign'],
|
||||
['¹', '¹', true, 'superscript one'],
|
||||
['²', '²', true, 'superscript two'],
|
||||
['³', '³', true, 'superscript three'],
|
||||
['¼', '¼', true, 'fraction one quarter'],
|
||||
['½', '½', true, 'fraction one half'],
|
||||
['¾', '¾', true, 'fraction three quarters'],
|
||||
// math / logical
|
||||
['ƒ', 'ƒ', true, 'function / florin'],
|
||||
['∫', '∫', true, 'integral'],
|
||||
['∑', '∑', true, 'n-ary sumation'],
|
||||
['∞', '∞', true, 'infinity'],
|
||||
['√', '√', true, 'square root'],
|
||||
['∼', '∼', false,'similar to'],
|
||||
['≅', '≅', false,'approximately equal to'],
|
||||
['≈', '≈', true, 'almost equal to'],
|
||||
['≠', '≠', true, 'not equal to'],
|
||||
['≡', '≡', true, 'identical to'],
|
||||
['∈', '∈', false,'element of'],
|
||||
['∉', '∉', false,'not an element of'],
|
||||
['∋', '∋', false,'contains as member'],
|
||||
['∏', '∏', true, 'n-ary product'],
|
||||
['∧', '∧', false,'logical and'],
|
||||
['∨', '∨', false,'logical or'],
|
||||
['¬', '¬', true, 'not sign'],
|
||||
['∩', '∩', true, 'intersection'],
|
||||
['∪', '∪', false,'union'],
|
||||
['∂', '∂', true, 'partial differential'],
|
||||
['∀', '∀', false,'for all'],
|
||||
['∃', '∃', false,'there exists'],
|
||||
['∅', '∅', false,'diameter'],
|
||||
['∇', '∇', false,'backward difference'],
|
||||
['∗', '∗', false,'asterisk operator'],
|
||||
['∝', '∝', false,'proportional to'],
|
||||
['∠', '∠', false,'angle'],
|
||||
// undefined
|
||||
['´', '´', true, 'acute accent'],
|
||||
['¸', '¸', true, 'cedilla'],
|
||||
['ª', 'ª', true, 'feminine ordinal indicator'],
|
||||
['º', 'º', true, 'masculine ordinal indicator'],
|
||||
['†', '†', true, 'dagger'],
|
||||
['‡', '‡', true, 'double dagger'],
|
||||
// alphabetical special chars
|
||||
['À', 'À', true, 'A - grave'],
|
||||
['Á', 'Á', true, 'A - acute'],
|
||||
['Â', 'Â', true, 'A - circumflex'],
|
||||
['Ã', 'Ã', true, 'A - tilde'],
|
||||
['Ä', 'Ä', true, 'A - diaeresis'],
|
||||
['Å', 'Å', true, 'A - ring above'],
|
||||
['Æ', 'Æ', true, 'ligature AE'],
|
||||
['Ç', 'Ç', true, 'C - cedilla'],
|
||||
['È', 'È', true, 'E - grave'],
|
||||
['É', 'É', true, 'E - acute'],
|
||||
['Ê', 'Ê', true, 'E - circumflex'],
|
||||
['Ë', 'Ë', true, 'E - diaeresis'],
|
||||
['Ì', 'Ì', true, 'I - grave'],
|
||||
['Í', 'Í', true, 'I - acute'],
|
||||
['Î', 'Î', true, 'I - circumflex'],
|
||||
['Ï', 'Ï', true, 'I - diaeresis'],
|
||||
['Ð', 'Ð', true, 'ETH'],
|
||||
['Ñ', 'Ñ', true, 'N - tilde'],
|
||||
['Ò', 'Ò', true, 'O - grave'],
|
||||
['Ó', 'Ó', true, 'O - acute'],
|
||||
['Ô', 'Ô', true, 'O - circumflex'],
|
||||
['Õ', 'Õ', true, 'O - tilde'],
|
||||
['Ö', 'Ö', true, 'O - diaeresis'],
|
||||
['Ø', 'Ø', true, 'O - slash'],
|
||||
['Œ', 'Œ', true, 'ligature OE'],
|
||||
['Š', 'Š', true, 'S - caron'],
|
||||
['Ù', 'Ù', true, 'U - grave'],
|
||||
['Ú', 'Ú', true, 'U - acute'],
|
||||
['Û', 'Û', true, 'U - circumflex'],
|
||||
['Ü', 'Ü', true, 'U - diaeresis'],
|
||||
['Ý', 'Ý', true, 'Y - acute'],
|
||||
['Ÿ', 'Ÿ', true, 'Y - diaeresis'],
|
||||
['Þ', 'Þ', true, 'THORN'],
|
||||
['à', 'à', true, 'a - grave'],
|
||||
['á', 'á', true, 'a - acute'],
|
||||
['â', 'â', true, 'a - circumflex'],
|
||||
['ã', 'ã', true, 'a - tilde'],
|
||||
['ä', 'ä', true, 'a - diaeresis'],
|
||||
['å', 'å', true, 'a - ring above'],
|
||||
['æ', 'æ', true, 'ligature ae'],
|
||||
['ç', 'ç', true, 'c - cedilla'],
|
||||
['è', 'è', true, 'e - grave'],
|
||||
['é', 'é', true, 'e - acute'],
|
||||
['ê', 'ê', true, 'e - circumflex'],
|
||||
['ë', 'ë', true, 'e - diaeresis'],
|
||||
['ì', 'ì', true, 'i - grave'],
|
||||
['í', 'í', true, 'i - acute'],
|
||||
['î', 'î', true, 'i - circumflex'],
|
||||
['ï', 'ï', true, 'i - diaeresis'],
|
||||
['ð', 'ð', true, 'eth'],
|
||||
['ñ', 'ñ', true, 'n - tilde'],
|
||||
['ò', 'ò', true, 'o - grave'],
|
||||
['ó', 'ó', true, 'o - acute'],
|
||||
['ô', 'ô', true, 'o - circumflex'],
|
||||
['õ', 'õ', true, 'o - tilde'],
|
||||
['ö', 'ö', true, 'o - diaeresis'],
|
||||
['ø', 'ø', true, 'o slash'],
|
||||
['œ', 'œ', true, 'ligature oe'],
|
||||
['š', 'š', true, 's - caron'],
|
||||
['ù', 'ù', true, 'u - grave'],
|
||||
['ú', 'ú', true, 'u - acute'],
|
||||
['û', 'û', true, 'u - circumflex'],
|
||||
['ü', 'ü', true, 'u - diaeresis'],
|
||||
['ý', 'ý', true, 'y - acute'],
|
||||
['þ', 'þ', true, 'thorn'],
|
||||
['ÿ', 'ÿ', true, 'y - diaeresis'],
|
||||
['Α', 'Α', true, 'Alpha'],
|
||||
['Β', 'Β', true, 'Beta'],
|
||||
['Γ', 'Γ', true, 'Gamma'],
|
||||
['Δ', 'Δ', true, 'Delta'],
|
||||
['Ε', 'Ε', true, 'Epsilon'],
|
||||
['Ζ', 'Ζ', true, 'Zeta'],
|
||||
['Η', 'Η', true, 'Eta'],
|
||||
['Θ', 'Θ', true, 'Theta'],
|
||||
['Ι', 'Ι', true, 'Iota'],
|
||||
['Κ', 'Κ', true, 'Kappa'],
|
||||
['Λ', 'Λ', true, 'Lambda'],
|
||||
['Μ', 'Μ', true, 'Mu'],
|
||||
['Ν', 'Ν', true, 'Nu'],
|
||||
['Ξ', 'Ξ', true, 'Xi'],
|
||||
['Ο', 'Ο', true, 'Omicron'],
|
||||
['Π', 'Π', true, 'Pi'],
|
||||
['Ρ', 'Ρ', true, 'Rho'],
|
||||
['Σ', 'Σ', true, 'Sigma'],
|
||||
['Τ', 'Τ', true, 'Tau'],
|
||||
['Υ', 'Υ', true, 'Upsilon'],
|
||||
['Φ', 'Φ', true, 'Phi'],
|
||||
['Χ', 'Χ', true, 'Chi'],
|
||||
['Ψ', 'Ψ', true, 'Psi'],
|
||||
['Ω', 'Ω', true, 'Omega'],
|
||||
['α', 'α', true, 'alpha'],
|
||||
['β', 'β', true, 'beta'],
|
||||
['γ', 'γ', true, 'gamma'],
|
||||
['δ', 'δ', true, 'delta'],
|
||||
['ε', 'ε', true, 'epsilon'],
|
||||
['ζ', 'ζ', true, 'zeta'],
|
||||
['η', 'η', true, 'eta'],
|
||||
['θ', 'θ', true, 'theta'],
|
||||
['ι', 'ι', true, 'iota'],
|
||||
['κ', 'κ', true, 'kappa'],
|
||||
['λ', 'λ', true, 'lambda'],
|
||||
['μ', 'μ', true, 'mu'],
|
||||
['ν', 'ν', true, 'nu'],
|
||||
['ξ', 'ξ', true, 'xi'],
|
||||
['ο', 'ο', true, 'omicron'],
|
||||
['π', 'π', true, 'pi'],
|
||||
['ρ', 'ρ', true, 'rho'],
|
||||
['ς', 'ς', true, 'final sigma'],
|
||||
['σ', 'σ', true, 'sigma'],
|
||||
['τ', 'τ', true, 'tau'],
|
||||
['υ', 'υ', true, 'upsilon'],
|
||||
['φ', 'φ', true, 'phi'],
|
||||
['χ', 'χ', true, 'chi'],
|
||||
['ψ', 'ψ', true, 'psi'],
|
||||
['ω', 'ω', true, 'omega'],
|
||||
// symbols
|
||||
['ℵ', 'ℵ', false,'alef symbol'],
|
||||
['ϖ', 'ϖ', false,'pi symbol'],
|
||||
['ℜ', 'ℜ', false,'real part symbol'],
|
||||
['ϑ','ϑ', false,'theta symbol'],
|
||||
['ϒ', 'ϒ', false,'upsilon - hook symbol'],
|
||||
['℘', '℘', false,'Weierstrass p'],
|
||||
['ℑ', 'ℑ', false,'imaginary part'],
|
||||
// arrows
|
||||
['←', '←', true, 'leftwards arrow'],
|
||||
['↑', '↑', true, 'upwards arrow'],
|
||||
['→', '→', true, 'rightwards arrow'],
|
||||
['↓', '↓', true, 'downwards arrow'],
|
||||
['↔', '↔', true, 'left right arrow'],
|
||||
['↵', '↵', false,'carriage return'],
|
||||
['⇐', '⇐', false,'leftwards double arrow'],
|
||||
['⇑', '⇑', false,'upwards double arrow'],
|
||||
['⇒', '⇒', false,'rightwards double arrow'],
|
||||
['⇓', '⇓', false,'downwards double arrow'],
|
||||
['⇔', '⇔', false,'left right double arrow'],
|
||||
['∴', '∴', false,'therefore'],
|
||||
['⊂', '⊂', false,'subset of'],
|
||||
['⊃', '⊃', false,'superset of'],
|
||||
['⊄', '⊄', false,'not a subset of'],
|
||||
['⊆', '⊆', false,'subset of or equal to'],
|
||||
['⊇', '⊇', false,'superset of or equal to'],
|
||||
['⊕', '⊕', false,'circled plus'],
|
||||
['⊗', '⊗', false,'circled times'],
|
||||
['⊥', '⊥', false,'perpendicular'],
|
||||
['⋅', '⋅', false,'dot operator'],
|
||||
['⌈', '⌈', false,'left ceiling'],
|
||||
['⌉', '⌉', false,'right ceiling'],
|
||||
['⌊', '⌊', false,'left floor'],
|
||||
['⌋', '⌋', false,'right floor'],
|
||||
['⟨', '〈', false,'left-pointing angle bracket'],
|
||||
['⟩', '〉', false,'right-pointing angle bracket'],
|
||||
['◊', '◊', true,'lozenge'],
|
||||
['♠', '♠', false,'black spade suit'],
|
||||
['♣', '♣', true, 'black club suit'],
|
||||
['♥', '♥', true, 'black heart suit'],
|
||||
['♦', '♦', true, 'black diamond suit'],
|
||||
[' ', ' ', false,'en space'],
|
||||
[' ', ' ', false,'em space'],
|
||||
[' ', ' ', false,'thin space'],
|
||||
['‌', '‌', false,'zero width non-joiner'],
|
||||
['‍', '‍', false,'zero width joiner'],
|
||||
['‎', '‎', false,'left-to-right mark'],
|
||||
['‏', '‏', false,'right-to-left mark'],
|
||||
['­', '­', false,'soft hyphen']
|
||||
];
|
||||
|
||||
tinyMCEPopup.onInit.add(function() {
|
||||
tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
|
||||
});
|
||||
|
||||
function renderCharMapHTML() {
|
||||
var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
|
||||
var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
|
||||
var cols=-1;
|
||||
|
||||
for (i=0; i<charmap.length; i++) {
|
||||
if (charmap[i][2]==true) {
|
||||
cols++;
|
||||
html += ''
|
||||
+ '<td class="charmap">'
|
||||
+ '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
|
||||
+ charmap[i][1]
|
||||
+ '</a></td>';
|
||||
if ((cols+1) % charsPerRow == 0)
|
||||
html += '</tr><tr height="' + tdHeight + '">';
|
||||
}
|
||||
}
|
||||
|
||||
if (cols % charsPerRow > 0) {
|
||||
var padd = charsPerRow - (cols % charsPerRow);
|
||||
for (var i=0; i<padd-1; i++)
|
||||
html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';
|
||||
}
|
||||
|
||||
html += '</tr></table>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function insertChar(chr) {
|
||||
tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
|
||||
|
||||
// Refocus in window
|
||||
if (tinyMCEPopup.isWindow)
|
||||
window.focus();
|
||||
|
||||
tinyMCEPopup.editor.focus();
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function previewChar(codeA, codeB, codeN) {
|
||||
var elmA = document.getElementById('codeA');
|
||||
var elmB = document.getElementById('codeB');
|
||||
var elmV = document.getElementById('codeV');
|
||||
var elmN = document.getElementById('codeN');
|
||||
|
||||
if (codeA=='#160;') {
|
||||
elmV.innerHTML = '__';
|
||||
} else {
|
||||
elmV.innerHTML = '&' + codeA;
|
||||
}
|
||||
|
||||
elmB.innerHTML = '&' + codeA;
|
||||
elmA.innerHTML = '&' + codeB;
|
||||
elmN.innerHTML = codeN;
|
||||
}
|
253
sn_templates/editor_stuff/themes/advanced/js/color_picker.js
Normal file
@@ -0,0 +1,253 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
||||
|
||||
var colors = [
|
||||
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
||||
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
||||
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
||||
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
||||
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
||||
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
||||
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
||||
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
||||
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
||||
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
||||
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
||||
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
||||
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
||||
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
||||
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
||||
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
||||
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
||||
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
||||
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
||||
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
||||
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
||||
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
||||
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
||||
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
||||
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
||||
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
||||
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
||||
];
|
||||
|
||||
var named = {
|
||||
'#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
||||
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
|
||||
'#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
|
||||
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
|
||||
'#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
|
||||
'#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
|
||||
'#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
|
||||
'#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
|
||||
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
|
||||
'#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
||||
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
|
||||
'#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
|
||||
'#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
|
||||
'#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
||||
'#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
|
||||
'#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
|
||||
'#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
|
||||
'#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
|
||||
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
|
||||
'#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
||||
'#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
|
||||
'#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
||||
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
|
||||
};
|
||||
|
||||
function init() {
|
||||
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));
|
||||
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
generatePicker();
|
||||
|
||||
if (inputColor) {
|
||||
changeFinalColor(inputColor);
|
||||
|
||||
col = convertHexToRGB(inputColor);
|
||||
|
||||
if (col)
|
||||
updateLight(col.r, col.g, col.b);
|
||||
}
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
if (f)
|
||||
f(color);
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function showColor(color, name) {
|
||||
if (name)
|
||||
document.getElementById("colorname").innerHTML = name;
|
||||
|
||||
document.getElementById("preview").style.backgroundColor = color;
|
||||
document.getElementById("color").value = color.toLowerCase();
|
||||
}
|
||||
|
||||
function convertRGBToHex(col) {
|
||||
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
||||
|
||||
if (!col)
|
||||
return col;
|
||||
|
||||
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
||||
if (rgb.length == 3) {
|
||||
r = parseInt(rgb[0]).toString(16);
|
||||
g = parseInt(rgb[1]).toString(16);
|
||||
b = parseInt(rgb[2]).toString(16);
|
||||
|
||||
r = r.length == 1 ? '0' + r : r;
|
||||
g = g.length == 1 ? '0' + g : g;
|
||||
b = b.length == 1 ? '0' + b : b;
|
||||
|
||||
return "#" + r + g + b;
|
||||
}
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
function convertHexToRGB(col) {
|
||||
if (col.indexOf('#') != -1) {
|
||||
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
||||
|
||||
r = parseInt(col.substring(0, 2), 16);
|
||||
g = parseInt(col.substring(2, 4), 16);
|
||||
b = parseInt(col.substring(4, 6), 16);
|
||||
|
||||
return {r : r, g : g, b : b};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function generatePicker() {
|
||||
var el = document.getElementById('light'), h = '', i;
|
||||
|
||||
for (i = 0; i < detail; i++){
|
||||
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
||||
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
||||
+ ' onmousedown="isMouseDown = true; return false;"'
|
||||
+ ' onmouseup="isMouseDown = false;"'
|
||||
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
||||
+ ' onmouseover="isMouseOver = true;"'
|
||||
+ ' onmouseout="isMouseOver = false;"'
|
||||
+ '></div>';
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
}
|
||||
|
||||
function generateWebColors() {
|
||||
var el = document.getElementById('webcolors'), h = '', i;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
h += '<table border="0" cellspacing="1" cellpadding="0">'
|
||||
+ '<tr>';
|
||||
|
||||
for (i=0; i<colors.length; i++) {
|
||||
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
||||
+ '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'
|
||||
+ '</a></td>';
|
||||
if ((i+1) % 18 == 0)
|
||||
h += '</tr><tr>';
|
||||
}
|
||||
|
||||
h += '</table>';
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
}
|
||||
|
||||
function generateNamedColors() {
|
||||
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
||||
|
||||
if (el.className == 'generated')
|
||||
return;
|
||||
|
||||
for (n in named) {
|
||||
v = named[n];
|
||||
h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
|
||||
}
|
||||
|
||||
el.innerHTML = h;
|
||||
el.className = 'generated';
|
||||
}
|
||||
|
||||
function dechex(n) {
|
||||
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
||||
}
|
||||
|
||||
function computeColor(e) {
|
||||
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
|
||||
|
||||
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
|
||||
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
|
||||
|
||||
partWidth = document.getElementById('colors').width / 6;
|
||||
partDetail = detail / 2;
|
||||
imHeight = document.getElementById('colors').height;
|
||||
|
||||
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
||||
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
||||
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
||||
|
||||
coef = (imHeight - y) / imHeight;
|
||||
r = 128 + (r - 128) * coef;
|
||||
g = 128 + (g - 128) * coef;
|
||||
b = 128 + (b - 128) * coef;
|
||||
|
||||
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
||||
updateLight(r, g, b);
|
||||
}
|
||||
|
||||
function updateLight(r, g, b) {
|
||||
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
||||
|
||||
for (i=0; i<detail; i++) {
|
||||
if ((i>=0) && (i<partDetail)) {
|
||||
finalCoef = i / partDetail;
|
||||
finalR = dechex(255 - (255 - r) * finalCoef);
|
||||
finalG = dechex(255 - (255 - g) * finalCoef);
|
||||
finalB = dechex(255 - (255 - b) * finalCoef);
|
||||
} else {
|
||||
finalCoef = 2 - i / partDetail;
|
||||
finalR = dechex(r * finalCoef);
|
||||
finalG = dechex(g * finalCoef);
|
||||
finalB = dechex(b * finalCoef);
|
||||
}
|
||||
|
||||
color = finalR + finalG + finalB;
|
||||
|
||||
setCol('gs' + i, '#'+color);
|
||||
}
|
||||
}
|
||||
|
||||
function changeFinalColor(color) {
|
||||
if (color.indexOf('#') == -1)
|
||||
color = convertRGBToHex(color);
|
||||
|
||||
setCol('preview', color);
|
||||
document.getElementById('color').value = color;
|
||||
}
|
||||
|
||||
function setCol(e, c) {
|
||||
try {
|
||||
document.getElementById(e).style.backgroundColor = c;
|
||||
} catch (ex) {
|
||||
// Ignore IE warning
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(init);
|
245
sn_templates/editor_stuff/themes/advanced/js/image.js
Normal file
@@ -0,0 +1,245 @@
|
||||
var ImageDialog = {
|
||||
preInit : function() {
|
||||
var url;
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_image_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
},
|
||||
|
||||
init : function() {
|
||||
var f = document.forms[0], ed = tinyMCEPopup.editor;
|
||||
|
||||
// Setup browse button
|
||||
document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
|
||||
if (isVisible('srcbrowser'))
|
||||
document.getElementById('src').style.width = '180px';
|
||||
|
||||
e = ed.selection.getNode();
|
||||
|
||||
this.fillFileList('image_list', 'tinyMCEImageList');
|
||||
|
||||
if (e.nodeName == 'IMG') {
|
||||
f.src.value = ed.dom.getAttrib(e, 'src');
|
||||
f.alt.value = ed.dom.getAttrib(e, 'alt');
|
||||
f.border.value = this.getAttrib(e, 'border');
|
||||
f.vspace.value = this.getAttrib(e, 'vspace');
|
||||
f.hspace.value = this.getAttrib(e, 'hspace');
|
||||
f.width.value = ed.dom.getAttrib(e, 'width');
|
||||
f.height.value = ed.dom.getAttrib(e, 'height');
|
||||
f.insert.value = ed.getLang('update');
|
||||
this.styleVal = ed.dom.getAttrib(e, 'style');
|
||||
selectByValue(f, 'image_list', f.src.value);
|
||||
selectByValue(f, 'align', this.getAttrib(e, 'align'));
|
||||
this.updateStyle();
|
||||
}
|
||||
},
|
||||
|
||||
fillFileList : function(id, l) {
|
||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
||||
|
||||
l = window[l];
|
||||
|
||||
if (l && l.length > 0) {
|
||||
lst.options[lst.options.length] = new Option('', '');
|
||||
|
||||
tinymce.each(l, function(o) {
|
||||
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
||||
});
|
||||
} else
|
||||
dom.remove(dom.getParent(id, 'tr'));
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
|
||||
if (f.src.value === '') {
|
||||
if (ed.selection.getNode().nodeName == 'IMG') {
|
||||
ed.dom.remove(ed.selection.getNode());
|
||||
ed.execCommand('mceRepaint');
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ed.settings.inline_styles) {
|
||||
args = tinymce.extend(args, {
|
||||
vspace : nl.vspace.value,
|
||||
hspace : nl.hspace.value,
|
||||
border : nl.border.value,
|
||||
align : getSelectValue(f, 'align')
|
||||
});
|
||||
} else
|
||||
args.style = this.styleVal;
|
||||
|
||||
tinymce.extend(args, {
|
||||
src : f.src.value,
|
||||
alt : f.alt.value,
|
||||
width : f.width.value,
|
||||
height : f.height.value
|
||||
});
|
||||
|
||||
el = ed.selection.getNode();
|
||||
|
||||
if (el && el.nodeName == 'IMG') {
|
||||
ed.dom.setAttribs(el, args);
|
||||
} else {
|
||||
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
|
||||
ed.dom.setAttribs('__mce_tmp', args);
|
||||
ed.dom.setAttrib('__mce_tmp', 'id', '');
|
||||
ed.undoManager.add();
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
|
||||
updateStyle : function() {
|
||||
var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
|
||||
|
||||
if (tinyMCEPopup.editor.settings.inline_styles) {
|
||||
st = tinyMCEPopup.dom.parseStyle(this.styleVal);
|
||||
|
||||
// Handle align
|
||||
v = getSelectValue(f, 'align');
|
||||
if (v) {
|
||||
if (v == 'left' || v == 'right') {
|
||||
st['float'] = v;
|
||||
delete st['vertical-align'];
|
||||
} else {
|
||||
st['vertical-align'] = v;
|
||||
delete st['float'];
|
||||
}
|
||||
} else {
|
||||
delete st['float'];
|
||||
delete st['vertical-align'];
|
||||
}
|
||||
|
||||
// Handle border
|
||||
v = f.border.value;
|
||||
if (v || v == '0') {
|
||||
if (v == '0')
|
||||
st['border'] = '0';
|
||||
else
|
||||
st['border'] = v + 'px solid black';
|
||||
} else
|
||||
delete st['border'];
|
||||
|
||||
// Handle hspace
|
||||
v = f.hspace.value;
|
||||
if (v) {
|
||||
delete st['margin'];
|
||||
st['margin-left'] = v + 'px';
|
||||
st['margin-right'] = v + 'px';
|
||||
} else {
|
||||
delete st['margin-left'];
|
||||
delete st['margin-right'];
|
||||
}
|
||||
|
||||
// Handle vspace
|
||||
v = f.vspace.value;
|
||||
if (v) {
|
||||
delete st['margin'];
|
||||
st['margin-top'] = v + 'px';
|
||||
st['margin-bottom'] = v + 'px';
|
||||
} else {
|
||||
delete st['margin-top'];
|
||||
delete st['margin-bottom'];
|
||||
}
|
||||
|
||||
// Merge
|
||||
st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');
|
||||
this.styleVal = dom.serializeStyle(st, 'img');
|
||||
}
|
||||
},
|
||||
|
||||
getAttrib : function(e, at) {
|
||||
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
||||
|
||||
if (ed.settings.inline_styles) {
|
||||
switch (at) {
|
||||
case 'align':
|
||||
if (v = dom.getStyle(e, 'float'))
|
||||
return v;
|
||||
|
||||
if (v = dom.getStyle(e, 'vertical-align'))
|
||||
return v;
|
||||
|
||||
break;
|
||||
|
||||
case 'hspace':
|
||||
v = dom.getStyle(e, 'margin-left')
|
||||
v2 = dom.getStyle(e, 'margin-right');
|
||||
if (v && v == v2)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
|
||||
case 'vspace':
|
||||
v = dom.getStyle(e, 'margin-top')
|
||||
v2 = dom.getStyle(e, 'margin-bottom');
|
||||
if (v && v == v2)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
|
||||
case 'border':
|
||||
v = 0;
|
||||
|
||||
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
||||
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
||||
|
||||
// False or not the same as prev
|
||||
if (!sv || (sv != v && v !== 0)) {
|
||||
v = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sv)
|
||||
v = sv;
|
||||
});
|
||||
|
||||
if (v)
|
||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (v = dom.getAttrib(e, at))
|
||||
return v;
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
resetImageData : function() {
|
||||
var f = document.forms[0];
|
||||
|
||||
f.width.value = f.height.value = "";
|
||||
},
|
||||
|
||||
updateImageData : function() {
|
||||
var f = document.forms[0], t = ImageDialog;
|
||||
|
||||
if (f.width.value == "")
|
||||
f.width.value = t.preloadImg.width;
|
||||
|
||||
if (f.height.value == "")
|
||||
f.height.value = t.preloadImg.height;
|
||||
},
|
||||
|
||||
getImageData : function() {
|
||||
var f = document.forms[0];
|
||||
|
||||
this.preloadImg = new Image();
|
||||
this.preloadImg.onload = this.updateImageData;
|
||||
this.preloadImg.onerror = this.resetImageData;
|
||||
this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);
|
||||
}
|
||||
};
|
||||
|
||||
ImageDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
156
sn_templates/editor_stuff/themes/advanced/js/link.js
Normal file
@@ -0,0 +1,156 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var LinkDialog = {
|
||||
preInit : function() {
|
||||
var url;
|
||||
|
||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
||||
},
|
||||
|
||||
init : function() {
|
||||
var f = document.forms[0], ed = tinyMCEPopup.editor;
|
||||
|
||||
// Setup browse button
|
||||
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');
|
||||
if (isVisible('hrefbrowser'))
|
||||
document.getElementById('href').style.width = '180px';
|
||||
|
||||
this.fillClassList('class_list');
|
||||
this.fillFileList('link_list', 'tinyMCELinkList');
|
||||
this.fillTargetList('target_list');
|
||||
|
||||
if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {
|
||||
f.href.value = ed.dom.getAttrib(e, 'href');
|
||||
f.linktitle.value = ed.dom.getAttrib(e, 'title');
|
||||
f.insert.value = ed.getLang('update');
|
||||
selectByValue(f, 'link_list', f.href.value);
|
||||
selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));
|
||||
selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));
|
||||
}
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;
|
||||
|
||||
tinyMCEPopup.restoreSelection();
|
||||
e = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
|
||||
// Remove element if there is no href
|
||||
if (!f.href.value) {
|
||||
if (e) {
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
b = ed.selection.getBookmark();
|
||||
ed.dom.remove(e, 1);
|
||||
ed.selection.moveToBookmark(b);
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
|
||||
// Create new anchor elements
|
||||
if (e == null) {
|
||||
ed.getDoc().execCommand("unlink", false, null);
|
||||
tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
|
||||
|
||||
tinymce.each(ed.dom.select("a"), function(n) {
|
||||
if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
|
||||
e = n;
|
||||
|
||||
ed.dom.setAttribs(e, {
|
||||
href : f.href.value,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ed.dom.setAttribs(e, {
|
||||
href : f.href.value,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
});
|
||||
}
|
||||
|
||||
// Don't move caret if selection was image
|
||||
if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {
|
||||
ed.focus();
|
||||
ed.selection.select(e);
|
||||
ed.selection.collapse(0);
|
||||
tinyMCEPopup.storeSelection();
|
||||
}
|
||||
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
|
||||
checkPrefix : function(n) {
|
||||
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))
|
||||
n.value = 'mailto:' + n.value;
|
||||
|
||||
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))
|
||||
n.value = 'http://' + n.value;
|
||||
},
|
||||
|
||||
fillFileList : function(id, l) {
|
||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
||||
|
||||
l = window[l];
|
||||
|
||||
if (l && l.length > 0) {
|
||||
lst.options[lst.options.length] = new Option('', '');
|
||||
|
||||
tinymce.each(l, function(o) {
|
||||
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
||||
});
|
||||
} else
|
||||
dom.remove(dom.getParent(id, 'tr'));
|
||||
},
|
||||
|
||||
fillClassList : function(id) {
|
||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
||||
|
||||
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
||||
cl = [];
|
||||
|
||||
tinymce.each(v.split(';'), function(v) {
|
||||
var p = v.split('=');
|
||||
|
||||
cl.push({'title' : p[0], 'class' : p[1]});
|
||||
});
|
||||
} else
|
||||
cl = tinyMCEPopup.editor.dom.getClasses();
|
||||
|
||||
if (cl.length > 0) {
|
||||
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
||||
|
||||
tinymce.each(cl, function(o) {
|
||||
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
||||
});
|
||||
} else
|
||||
dom.remove(dom.getParent(id, 'tr'));
|
||||
},
|
||||
|
||||
fillTargetList : function(id) {
|
||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v;
|
||||
|
||||
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
||||
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');
|
||||
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');
|
||||
|
||||
if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {
|
||||
tinymce.each(v.split(','), function(v) {
|
||||
v = v.split('=');
|
||||
lst.options[lst.options.length] = new Option(v[0], v[1]);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
LinkDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);
|
@@ -0,0 +1,62 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
tinyMCEPopup.onInit.add(onLoadInit);
|
||||
|
||||
function saveContent() {
|
||||
tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function onLoadInit() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
// Remove Gecko spellchecking
|
||||
if (tinymce.isGecko)
|
||||
document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
|
||||
|
||||
document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});
|
||||
|
||||
if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
|
||||
setWrap('soft');
|
||||
document.getElementById('wraped').checked = true;
|
||||
}
|
||||
|
||||
resizeInputs();
|
||||
}
|
||||
|
||||
function setWrap(val) {
|
||||
var v, n, s = document.getElementById('htmlSource');
|
||||
|
||||
s.wrap = val;
|
||||
|
||||
if (!tinymce.isIE) {
|
||||
v = s.value;
|
||||
n = s.cloneNode(false);
|
||||
n.setAttribute("wrap", val);
|
||||
s.parentNode.replaceChild(n, s);
|
||||
n.value = v;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleWordWrap(elm) {
|
||||
if (elm.checked)
|
||||
setWrap('soft');
|
||||
else
|
||||
setWrap('off');
|
||||
}
|
||||
|
||||
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
|
||||
|
||||
function resizeInputs() {
|
||||
var el = document.getElementById('htmlSource');
|
||||
|
||||
if (!tinymce.isIE) {
|
||||
wHeight = self.innerHeight - 65;
|
||||
wWidth = self.innerWidth - 16;
|
||||
} else {
|
||||
wHeight = document.body.clientHeight - 70;
|
||||
wWidth = document.body.clientWidth - 16;
|
||||
}
|
||||
|
||||
el.style.height = Math.abs(wHeight) + 'px';
|
||||
el.style.width = Math.abs(wWidth) + 'px';
|
||||
}
|
63
sn_templates/editor_stuff/themes/advanced/langs/de.js
Normal file
@@ -0,0 +1,63 @@
|
||||
tinyMCE.addI18n('de.advanced',{
|
||||
style_select:"Format",
|
||||
font_size:"Schriftgr\u00F6\u00DFe",
|
||||
fontdefault:"Schriftart",
|
||||
block:"Vorlage",
|
||||
paragraph:"Absatz",
|
||||
div:"Zusammenh\u00E4ngender Bereich",
|
||||
address:"Adresse",
|
||||
pre:"Rohdaten",
|
||||
h1:"\u00DCberschrift 1",
|
||||
h2:"\u00DCberschrift 2",
|
||||
h3:"\u00DCberschrift 3",
|
||||
h4:"\u00DCberschrift 4",
|
||||
h5:"\u00DCberschrift 5",
|
||||
h6:"\u00DCberschrift 6",
|
||||
blockquote:"Zitatblock",
|
||||
code:"Code",
|
||||
samp:"Beispiel",
|
||||
dt:"Definitionsbegriff",
|
||||
dd:"Definitionsbeschreibung",
|
||||
bold_desc:"Fett (Strg+B)",
|
||||
italic_desc:"Kursiv (Strg+I)",
|
||||
underline_desc:"Unterstrichen (Strg+U)",
|
||||
striketrough_desc:"Durchgestrichen",
|
||||
justifyleft_desc:"Links ausgerichtet",
|
||||
justifycenter_desc:"Mittig ausgerichtet",
|
||||
justifyright_desc:"Rechts ausgerichtet",
|
||||
justifyfull_desc:"Blocksatz",
|
||||
bullist_desc:"Unsortierte Liste",
|
||||
numlist_desc:"Sortierte Liste",
|
||||
outdent_desc:"Ausr\u00FCcken",
|
||||
indent_desc:"Einr\u00FCcken",
|
||||
undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)",
|
||||
redo_desc:"Wiederholen (Strg+Y)",
|
||||
link_desc:"Link einf\u00FCgen/ver\u00E4ndern",
|
||||
unlink_desc:"Link entfernen",
|
||||
image_desc:"Bild einf\u00FCgen/ver\u00E4ndern",
|
||||
cleanup_desc:"Quellcode aufr\u00E4umen",
|
||||
code_desc:"HTML-Quellcode bearbeiten",
|
||||
sub_desc:"Tiefgestellt",
|
||||
sup_desc:"Hochgestellt",
|
||||
hr_desc:"Trennlinie einf\u00FCgen",
|
||||
removeformat_desc:"Formatierungen zur\u00FCcksetzen",
|
||||
custom1_desc:"Benutzerdefinierte Beschreibung",
|
||||
forecolor_desc:"Textfarbe",
|
||||
backcolor_desc:"Hintergrundfarbe",
|
||||
charmap_desc:"Sonderzeichen einf\u00FCgen",
|
||||
visualaid_desc:"Hilfslinien und unsichtbare Elemente ein-/ausblenden",
|
||||
anchor_desc:"Anker einf\u00FCgen/ver\u00E4ndern",
|
||||
cut_desc:"Ausschneiden",
|
||||
copy_desc:"Kopieren",
|
||||
paste_desc:"Einf\u00FCgen",
|
||||
image_props_desc:"Bildeigenschaften",
|
||||
newdocument_desc:"Neues Dokument",
|
||||
help_desc:"Hilfe",
|
||||
blockquote_desc:"Zitatblock",
|
||||
clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\r\nWollen Sie mehr \u00FCber dieses Problem erfahren?",
|
||||
path:"Pfad",
|
||||
newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00F6schen?",
|
||||
toolbar_focus:"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X",
|
||||
more_colors:"Weitere Farben",
|
||||
anchor_delta_width:"13"
|
||||
});
|
51
sn_templates/editor_stuff/themes/advanced/langs/de_dlg.js
Normal file
@@ -0,0 +1,51 @@
|
||||
tinyMCE.addI18n('de.advanced_dlg',{
|
||||
about_title:"\u00DCber TinyMCE",
|
||||
about_general:"\u00DCber\u2026",
|
||||
about_help:"Hilfe",
|
||||
about_license:"Lizenzbedingungen",
|
||||
about_plugins:"Plugins",
|
||||
about_plugin:"Plugin",
|
||||
about_author:"Urheber",
|
||||
about_version:"Version",
|
||||
about_loaded:"Geladene Plugins",
|
||||
anchor_title:"Anker einf\u00FCgen/ver\u00E4ndern",
|
||||
anchor_name:"Name des Ankers",
|
||||
code_title:"HTML-Quellcode bearbeiten",
|
||||
code_wordwrap:"Automatischer Zeilenumbruch",
|
||||
colorpicker_title:"Farbe",
|
||||
colorpicker_picker_tab:"Farbwahl",
|
||||
colorpicker_picker_title:"Farbwahl",
|
||||
colorpicker_palette_tab:"Palette",
|
||||
colorpicker_palette_title:"Farbpalette",
|
||||
colorpicker_named_tab:"Benannte Farben",
|
||||
colorpicker_named_title:"Benannte Farben",
|
||||
colorpicker_color:"Farbe:",
|
||||
colorpicker_name:"Name:",
|
||||
charmap_title:"Sonderzeichen",
|
||||
image_title:"Bild einf\u00FCgen/bearbeiten",
|
||||
image_src:"Adresse",
|
||||
image_alt:"Alternativtext",
|
||||
image_list:"Bilderliste",
|
||||
image_border:"Rahmen",
|
||||
image_dimensions:"Ausma\u00DFe",
|
||||
image_vspace:"Vertikaler Abstand",
|
||||
image_hspace:"Horizontaler Abstand",
|
||||
image_align:"Ausrichtung",
|
||||
image_align_baseline:"Zeile",
|
||||
image_align_top:"Oben",
|
||||
image_align_middle:"Mittig",
|
||||
image_align_bottom:"Unten",
|
||||
image_align_texttop:"Oben im Text",
|
||||
image_align_textbottom:"Unten im Text",
|
||||
image_align_left:"Links",
|
||||
image_align_right:"Rechts",
|
||||
link_title:"Link einf\u00FCgen/bearbeiten",
|
||||
link_url:"Adresse",
|
||||
link_target:"Fenster",
|
||||
link_target_same:"Im selben Fenster \u00F6ffnen",
|
||||
link_target_blank:"Neues Fenster \u00F6ffnen",
|
||||
link_titlefield:"Titel",
|
||||
link_is_email:"Diese Adresse scheint eine E-Mail-Adresse zu sein. M\u00F6chten Sie das dazu ben\u00F6tigte mailto: voranstellen?",
|
||||
link_is_external:"Diese Adresse scheint ein externer Link zu sein. M\u00F6chten Sie das dazu ben\u00F6tigte http:// voranstellen?",
|
||||
link_list:"Linkliste"
|
||||
});
|
62
sn_templates/editor_stuff/themes/advanced/langs/en.js
Normal file
@@ -0,0 +1,62 @@
|
||||
tinyMCE.addI18n('en.advanced',{
|
||||
style_select:"Styles",
|
||||
font_size:"Font size",
|
||||
fontdefault:"Font family",
|
||||
block:"Format",
|
||||
paragraph:"Paragraph",
|
||||
div:"Div",
|
||||
address:"Address",
|
||||
pre:"Preformatted",
|
||||
h1:"Heading 1",
|
||||
h2:"Heading 2",
|
||||
h3:"Heading 3",
|
||||
h4:"Heading 4",
|
||||
h5:"Heading 5",
|
||||
h6:"Heading 6",
|
||||
blockquote:"Blockquote",
|
||||
code:"Code",
|
||||
samp:"Code sample",
|
||||
dt:"Definition term ",
|
||||
dd:"Definition description",
|
||||
bold_desc:"Bold (Ctrl+B)",
|
||||
italic_desc:"Italic (Ctrl+I)",
|
||||
underline_desc:"Underline (Ctrl+U)",
|
||||
striketrough_desc:"Strikethrough",
|
||||
justifyleft_desc:"Align left",
|
||||
justifycenter_desc:"Align center",
|
||||
justifyright_desc:"Align right",
|
||||
justifyfull_desc:"Align full",
|
||||
bullist_desc:"Unordered list",
|
||||
numlist_desc:"Ordered list",
|
||||
outdent_desc:"Outdent",
|
||||
indent_desc:"Indent",
|
||||
undo_desc:"Undo (Ctrl+Z)",
|
||||
redo_desc:"Redo (Ctrl+Y)",
|
||||
link_desc:"Insert/edit link",
|
||||
unlink_desc:"Unlink",
|
||||
image_desc:"Insert/edit image",
|
||||
cleanup_desc:"Cleanup messy code",
|
||||
code_desc:"Edit HTML Source",
|
||||
sub_desc:"Subscript",
|
||||
sup_desc:"Superscript",
|
||||
hr_desc:"Insert horizontal ruler",
|
||||
removeformat_desc:"Remove formatting",
|
||||
custom1_desc:"Your custom description here",
|
||||
forecolor_desc:"Select text color",
|
||||
backcolor_desc:"Select background color",
|
||||
charmap_desc:"Insert custom character",
|
||||
visualaid_desc:"Toggle guidelines/invisible elements",
|
||||
anchor_desc:"Insert/edit anchor",
|
||||
cut_desc:"Cut",
|
||||
copy_desc:"Copy",
|
||||
paste_desc:"Paste",
|
||||
image_props_desc:"Image properties",
|
||||
newdocument_desc:"New document",
|
||||
help_desc:"Help",
|
||||
blockquote_desc:"Blockquote",
|
||||
clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
|
||||
path:"Path",
|
||||
newdocument:"Are you sure you want clear all contents?",
|
||||
toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
|
||||
more_colors:"More colors"
|
||||
});
|
51
sn_templates/editor_stuff/themes/advanced/langs/en_dlg.js
Normal file
@@ -0,0 +1,51 @@
|
||||
tinyMCE.addI18n('en.advanced_dlg',{
|
||||
about_title:"About TinyMCE",
|
||||
about_general:"About",
|
||||
about_help:"Help",
|
||||
about_license:"License",
|
||||
about_plugins:"Plugins",
|
||||
about_plugin:"Plugin",
|
||||
about_author:"Author",
|
||||
about_version:"Version",
|
||||
about_loaded:"Loaded plugins",
|
||||
anchor_title:"Insert/edit anchor",
|
||||
anchor_name:"Anchor name",
|
||||
code_title:"HTML Source Editor",
|
||||
code_wordwrap:"Word wrap",
|
||||
colorpicker_title:"Select a color",
|
||||
colorpicker_picker_tab:"Picker",
|
||||
colorpicker_picker_title:"Color picker",
|
||||
colorpicker_palette_tab:"Palette",
|
||||
colorpicker_palette_title:"Palette colors",
|
||||
colorpicker_named_tab:"Named",
|
||||
colorpicker_named_title:"Named colors",
|
||||
colorpicker_color:"Color:",
|
||||
colorpicker_name:"Name:",
|
||||
charmap_title:"Select custom character",
|
||||
image_title:"Insert/edit image",
|
||||
image_src:"Image URL",
|
||||
image_alt:"Image description",
|
||||
image_list:"Image list",
|
||||
image_border:"Border",
|
||||
image_dimensions:"Dimensions",
|
||||
image_vspace:"Vertical space",
|
||||
image_hspace:"Horizontal space",
|
||||
image_align:"Alignment",
|
||||
image_align_baseline:"Baseline",
|
||||
image_align_top:"Top",
|
||||
image_align_middle:"Middle",
|
||||
image_align_bottom:"Bottom",
|
||||
image_align_texttop:"Text top",
|
||||
image_align_textbottom:"Text bottom",
|
||||
image_align_left:"Left",
|
||||
image_align_right:"Right",
|
||||
link_title:"Insert/edit link",
|
||||
link_url:"Link URL",
|
||||
link_target:"Target",
|
||||
link_target_same:"Open link in the same window",
|
||||
link_target_blank:"Open link in a new window",
|
||||
link_titlefield:"Title",
|
||||
link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
|
||||
link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
|
||||
link_list:"Link list"
|
||||
});
|
58
sn_templates/editor_stuff/themes/advanced/link.htm
Normal file
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.link_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="js/link.js"></script>
|
||||
</head>
|
||||
<body id="link" style="display: none">
|
||||
<form onsubmit="LinkDialog.update();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td>
|
||||
<td id="hrefbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="link_list">{#advanced_dlg.link_list}</label></td>
|
||||
<td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
|
||||
<td><select id="target_list" name="target_list"></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
|
||||
<td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="class_list">{#class_name}</label></td>
|
||||
<td><select id="class_list" name="class_list"></select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,35 @@
|
||||
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
||||
body {background:#FFF;}
|
||||
body.mceForceColors {background:#FFF; color:#000;}
|
||||
h1 {font-size: 2em}
|
||||
h2 {font-size: 1.5em}
|
||||
h3 {font-size: 1.17em}
|
||||
h4 {font-size: 1em}
|
||||
h5 {font-size: .83em}
|
||||
h6 {font-size: .75em}
|
||||
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
||||
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;}
|
||||
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
|
||||
img {border:0;}
|
||||
table {cursor:default}
|
||||
table td, table th {cursor:text}
|
||||
ins {border-bottom:1px solid green; text-decoration: none; color:green}
|
||||
del {color:red; text-decoration:line-through}
|
||||
cite {border-bottom:1px dashed blue}
|
||||
acronym {border-bottom:1px dotted #CCC; cursor:help}
|
||||
abbr {border-bottom:1px dashed #CCC; cursor:help}
|
||||
|
||||
/* IE */
|
||||
* html body {
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
}
|
||||
|
||||
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
|
||||
font[face=mceinline] {font-family:inherit !important}
|
@@ -0,0 +1,117 @@
|
||||
/* Generic */
|
||||
body {
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDDDDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
background:#F0F0EE;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
html {background:#F0F0EE;}
|
||||
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
textarea {resize:none;outline:none;}
|
||||
a:link, a:visited {color:black;}
|
||||
a:hover {color:#2B6FB6;}
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #CCC;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #808080;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert, #cancel, input.button, .updateButton {
|
||||
border:0; margin:0; padding:0;
|
||||
font-weight:bold;
|
||||
width:94px; height:26px;
|
||||
background:url(img/buttons.png) 0 -26px;
|
||||
cursor:pointer;
|
||||
padding-bottom:2px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
#insert {background:url(img/buttons.png) 0 -52px}
|
||||
#cancel {background:url(img/buttons.png) 0 0; float:right}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
a.pickcolor:hover span.disabled {}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
|
||||
.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 70 B |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 70 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
213
sn_templates/editor_stuff/themes/advanced/skins/default/ui.css
Normal file
@@ -0,0 +1,213 @@
|
||||
/* Reset */
|
||||
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
||||
.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
.defaultSkin table td {vertical-align:middle}
|
||||
|
||||
/* Containers */
|
||||
.defaultSkin table {direction:ltr; background:#F0F0EE}
|
||||
.defaultSkin iframe {display:block; background:#FFF}
|
||||
.defaultSkin .mceToolbar {height:26px}
|
||||
.defaultSkin .mceLeft {text-align:left}
|
||||
.defaultSkin .mceRight {text-align:right}
|
||||
|
||||
/* External */
|
||||
.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
|
||||
.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
|
||||
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
||||
|
||||
/* Layout */
|
||||
.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}
|
||||
.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
|
||||
.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
|
||||
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
|
||||
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
|
||||
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
|
||||
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
|
||||
.defaultSkin .mceStatusbar div {float:left; margin:2px}
|
||||
.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
|
||||
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
|
||||
.defaultSkin table.mceToolbar {margin-left:3px}
|
||||
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
.defaultSkin td.mceCenter {text-align:center;}
|
||||
.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}
|
||||
.defaultSkin td.mceRight table {margin:0 0 0 auto;}
|
||||
|
||||
/* Button */
|
||||
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}
|
||||
.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
|
||||
.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.defaultSkin .mceButtonLabeled {width:auto}
|
||||
.defaultSkin .mceButtonLabeled span.mceIcon {float:left}
|
||||
.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
|
||||
.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}
|
||||
|
||||
/* Separator */
|
||||
.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
|
||||
|
||||
/* ListBox */
|
||||
.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
|
||||
.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
|
||||
.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
|
||||
.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}
|
||||
.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}
|
||||
.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}
|
||||
.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
|
||||
.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}
|
||||
.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}
|
||||
.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
|
||||
|
||||
/* SplitButton */
|
||||
.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
|
||||
.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
|
||||
.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
|
||||
.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
|
||||
.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
|
||||
.defaultSkin .mceSplitButton span.mceOpen {display:none}
|
||||
.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
|
||||
.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}
|
||||
.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}
|
||||
|
||||
/* ColorSplitButton */
|
||||
.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
|
||||
.defaultSkin .mceColorSplitMenu td {padding:2px}
|
||||
.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
|
||||
.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
|
||||
.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
|
||||
.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
|
||||
.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
|
||||
.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}
|
||||
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
|
||||
|
||||
/* Menu */
|
||||
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
|
||||
.defaultSkin .mceNoIcons span.mceIcon {width:0;}
|
||||
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
|
||||
.defaultSkin .mceMenu table {background:#FFF}
|
||||
.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
|
||||
.defaultSkin .mceMenu td {height:20px}
|
||||
.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
|
||||
.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
|
||||
.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}
|
||||
.defaultSkin .mceMenu pre.mceText {font-family:Monospace}
|
||||
.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
|
||||
.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
|
||||
.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
|
||||
.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
|
||||
.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
|
||||
.defaultSkin .mceMenuItemDisabled .mceText {color:#888}
|
||||
.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}
|
||||
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
|
||||
.defaultSkin .mceMenu span.mceMenuLine {display:none}
|
||||
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
|
||||
|
||||
/* Progress,Resize */
|
||||
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
|
||||
.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
|
||||
|
||||
/* Formats */
|
||||
.defaultSkin .mce_formatPreview a {font-size:10px}
|
||||
.defaultSkin .mce_p span.mceText {}
|
||||
.defaultSkin .mce_address span.mceText {font-style:italic}
|
||||
.defaultSkin .mce_pre span.mceText {font-family:monospace}
|
||||
.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
|
||||
.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
|
||||
.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
|
||||
.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
|
||||
.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
|
||||
.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
|
||||
|
||||
/* Theme */
|
||||
.defaultSkin span.mce_bold {background-position:0 0}
|
||||
.defaultSkin span.mce_italic {background-position:-60px 0}
|
||||
.defaultSkin span.mce_underline {background-position:-140px 0}
|
||||
.defaultSkin span.mce_strikethrough {background-position:-120px 0}
|
||||
.defaultSkin span.mce_undo {background-position:-160px 0}
|
||||
.defaultSkin span.mce_redo {background-position:-100px 0}
|
||||
.defaultSkin span.mce_cleanup {background-position:-40px 0}
|
||||
.defaultSkin span.mce_bullist {background-position:-20px 0}
|
||||
.defaultSkin span.mce_numlist {background-position:-80px 0}
|
||||
.defaultSkin span.mce_justifyleft {background-position:-460px 0}
|
||||
.defaultSkin span.mce_justifyright {background-position:-480px 0}
|
||||
.defaultSkin span.mce_justifycenter {background-position:-420px 0}
|
||||
.defaultSkin span.mce_justifyfull {background-position:-440px 0}
|
||||
.defaultSkin span.mce_anchor {background-position:-200px 0}
|
||||
.defaultSkin span.mce_indent {background-position:-400px 0}
|
||||
.defaultSkin span.mce_outdent {background-position:-540px 0}
|
||||
.defaultSkin span.mce_link {background-position:-500px 0}
|
||||
.defaultSkin span.mce_unlink {background-position:-640px 0}
|
||||
.defaultSkin span.mce_sub {background-position:-600px 0}
|
||||
.defaultSkin span.mce_sup {background-position:-620px 0}
|
||||
.defaultSkin span.mce_removeformat {background-position:-580px 0}
|
||||
.defaultSkin span.mce_newdocument {background-position:-520px 0}
|
||||
.defaultSkin span.mce_image {background-position:-380px 0}
|
||||
.defaultSkin span.mce_help {background-position:-340px 0}
|
||||
.defaultSkin span.mce_code {background-position:-260px 0}
|
||||
.defaultSkin span.mce_hr {background-position:-360px 0}
|
||||
.defaultSkin span.mce_visualaid {background-position:-660px 0}
|
||||
.defaultSkin span.mce_charmap {background-position:-240px 0}
|
||||
.defaultSkin span.mce_paste {background-position:-560px 0}
|
||||
.defaultSkin span.mce_copy {background-position:-700px 0}
|
||||
.defaultSkin span.mce_cut {background-position:-680px 0}
|
||||
.defaultSkin span.mce_blockquote {background-position:-220px 0}
|
||||
.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}
|
||||
.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}
|
||||
.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}
|
||||
.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}
|
||||
|
||||
/* Plugins */
|
||||
.defaultSkin span.mce_advhr {background-position:-0px -20px}
|
||||
.defaultSkin span.mce_ltr {background-position:-20px -20px}
|
||||
.defaultSkin span.mce_rtl {background-position:-40px -20px}
|
||||
.defaultSkin span.mce_emotions {background-position:-60px -20px}
|
||||
.defaultSkin span.mce_fullpage {background-position:-80px -20px}
|
||||
.defaultSkin span.mce_fullscreen {background-position:-100px -20px}
|
||||
.defaultSkin span.mce_iespell {background-position:-120px -20px}
|
||||
.defaultSkin span.mce_insertdate {background-position:-140px -20px}
|
||||
.defaultSkin span.mce_inserttime {background-position:-160px -20px}
|
||||
.defaultSkin span.mce_absolute {background-position:-180px -20px}
|
||||
.defaultSkin span.mce_backward {background-position:-200px -20px}
|
||||
.defaultSkin span.mce_forward {background-position:-220px -20px}
|
||||
.defaultSkin span.mce_insert_layer {background-position:-240px -20px}
|
||||
.defaultSkin span.mce_insertlayer {background-position:-260px -20px}
|
||||
.defaultSkin span.mce_movebackward {background-position:-280px -20px}
|
||||
.defaultSkin span.mce_moveforward {background-position:-300px -20px}
|
||||
.defaultSkin span.mce_media {background-position:-320px -20px}
|
||||
.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}
|
||||
.defaultSkin span.mce_pastetext {background-position:-360px -20px}
|
||||
.defaultSkin span.mce_pasteword {background-position:-380px -20px}
|
||||
.defaultSkin span.mce_selectall {background-position:-400px -20px}
|
||||
.defaultSkin span.mce_preview {background-position:-420px -20px}
|
||||
.defaultSkin span.mce_print {background-position:-440px -20px}
|
||||
.defaultSkin span.mce_cancel {background-position:-460px -20px}
|
||||
.defaultSkin span.mce_save {background-position:-480px -20px}
|
||||
.defaultSkin span.mce_replace {background-position:-500px -20px}
|
||||
.defaultSkin span.mce_search {background-position:-520px -20px}
|
||||
.defaultSkin span.mce_styleprops {background-position:-560px -20px}
|
||||
.defaultSkin span.mce_table {background-position:-580px -20px}
|
||||
.defaultSkin span.mce_cell_props {background-position:-600px -20px}
|
||||
.defaultSkin span.mce_delete_table {background-position:-620px -20px}
|
||||
.defaultSkin span.mce_delete_col {background-position:-640px -20px}
|
||||
.defaultSkin span.mce_delete_row {background-position:-660px -20px}
|
||||
.defaultSkin span.mce_col_after {background-position:-680px -20px}
|
||||
.defaultSkin span.mce_col_before {background-position:-700px -20px}
|
||||
.defaultSkin span.mce_row_after {background-position:-720px -20px}
|
||||
.defaultSkin span.mce_row_before {background-position:-740px -20px}
|
||||
.defaultSkin span.mce_merge_cells {background-position:-760px -20px}
|
||||
.defaultSkin span.mce_table_props {background-position:-980px -20px}
|
||||
.defaultSkin span.mce_row_props {background-position:-780px -20px}
|
||||
.defaultSkin span.mce_split_cells {background-position:-800px -20px}
|
||||
.defaultSkin span.mce_template {background-position:-820px -20px}
|
||||
.defaultSkin span.mce_visualchars {background-position:-840px -20px}
|
||||
.defaultSkin span.mce_abbr {background-position:-860px -20px}
|
||||
.defaultSkin span.mce_acronym {background-position:-880px -20px}
|
||||
.defaultSkin span.mce_attribs {background-position:-900px -20px}
|
||||
.defaultSkin span.mce_cite {background-position:-920px -20px}
|
||||
.defaultSkin span.mce_del {background-position:-940px -20px}
|
||||
.defaultSkin span.mce_ins {background-position:-960px -20px}
|
||||
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
|
||||
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
|
||||
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
|
@@ -0,0 +1,35 @@
|
||||
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
||||
body {background:#FFF;}
|
||||
body.mceForceColors {background:#FFF; color:#000;}
|
||||
h1 {font-size: 2em}
|
||||
h2 {font-size: 1.5em}
|
||||
h3 {font-size: 1.17em}
|
||||
h4 {font-size: 1em}
|
||||
h5 {font-size: .83em}
|
||||
h6 {font-size: .75em}
|
||||
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
||||
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
|
||||
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
|
||||
img {border:0;}
|
||||
table {cursor:default}
|
||||
table td, table th {cursor:text}
|
||||
ins {border-bottom:1px solid green; text-decoration: none; color:green}
|
||||
del {color:red; text-decoration:line-through}
|
||||
cite {border-bottom:1px dashed blue}
|
||||
acronym {border-bottom:1px dotted #CCC; cursor:help}
|
||||
abbr {border-bottom:1px dashed #CCC; cursor:help}
|
||||
|
||||
/* IE */
|
||||
* html body {
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
}
|
||||
|
||||
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
|
||||
font[face=mceinline] {font-family:inherit !important}
|
116
sn_templates/editor_stuff/themes/advanced/skins/o2k7/dialog.css
Normal file
@@ -0,0 +1,116 @@
|
||||
/* Generic */
|
||||
body {
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDDDDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
background:#F0F0EE;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
html {background:#F0F0EE;}
|
||||
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
textarea {resize:none;outline:none;}
|
||||
a:link, a:visited {color:black;}
|
||||
a:hover {color:#2B6FB6;}
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #CCC;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #808080;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert, #cancel, input.button, .updateButton {
|
||||
border:0; margin:0; padding:0;
|
||||
font-weight:bold;
|
||||
width:94px; height:26px;
|
||||
background:url(../default/img/buttons.png) 0 -26px;
|
||||
cursor:pointer;
|
||||
padding-bottom:2px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
#insert {background:url(../default/img/buttons.png) 0 -52px}
|
||||
#cancel {background:url(../default/img/buttons.png) 0 0; float:right}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
a.pickcolor:hover span.disabled {}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
|
||||
.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
215
sn_templates/editor_stuff/themes/advanced/skins/o2k7/ui.css
Normal file
@@ -0,0 +1,215 @@
|
||||
/* Reset */
|
||||
.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
||||
.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
.o2k7Skin table td {vertical-align:middle}
|
||||
|
||||
/* Containers */
|
||||
.o2k7Skin table {background:#E5EFFD}
|
||||
.o2k7Skin iframe {display:block; background:#FFF}
|
||||
.o2k7Skin .mceToolbar {height:26px}
|
||||
|
||||
/* External */
|
||||
.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}
|
||||
.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
|
||||
.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
||||
|
||||
/* Layout */
|
||||
.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
|
||||
.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}
|
||||
.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
|
||||
.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
|
||||
.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
|
||||
.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
|
||||
.o2k7Skin .mceStatusbar div {float:left; padding:2px}
|
||||
.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
|
||||
.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
|
||||
.o2k7Skin table.mceToolbar {margin-left:3px}
|
||||
.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
|
||||
.o2k7Skin .mceToolbar td.mceFirst span {margin:0}
|
||||
.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
|
||||
.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}
|
||||
.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
.o2k7Skin td.mceCenter {text-align:center;}
|
||||
.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;}
|
||||
.o2k7Skin td.mceRight table {margin:0 0 0 auto;}
|
||||
|
||||
/* Button */
|
||||
.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
|
||||
.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}
|
||||
.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}
|
||||
.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
|
||||
.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}
|
||||
.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.o2k7Skin .mceButtonLabeled {width:auto}
|
||||
.o2k7Skin .mceButtonLabeled span.mceIcon {float:left}
|
||||
.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
|
||||
.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888}
|
||||
|
||||
/* Separator */
|
||||
.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
|
||||
|
||||
/* ListBox */
|
||||
.o2k7Skin .mceListBox {margin-left:3px}
|
||||
.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
|
||||
.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
|
||||
.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
|
||||
.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
|
||||
.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
|
||||
.o2k7Skin .mceListBoxDisabled .mceText {color:gray}
|
||||
.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
|
||||
.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
|
||||
.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
|
||||
|
||||
/* SplitButton */
|
||||
.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}
|
||||
.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
|
||||
.o2k7Skin .mceSplitButton a.mceAction {width:22px}
|
||||
.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
|
||||
.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}
|
||||
.o2k7Skin .mceSplitButton span.mceOpen {display:none}
|
||||
.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}
|
||||
.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}
|
||||
.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}
|
||||
|
||||
/* ColorSplitButton */
|
||||
.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
|
||||
.o2k7Skin .mceColorSplitMenu td {padding:2px}
|
||||
.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
|
||||
.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
|
||||
.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
|
||||
.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
|
||||
.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}
|
||||
.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}
|
||||
.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}
|
||||
|
||||
/* Menu */
|
||||
.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}
|
||||
.o2k7Skin .mceNoIcons span.mceIcon {width:0;}
|
||||
.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}
|
||||
.o2k7Skin .mceMenu table {background:#FFF}
|
||||
.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}
|
||||
.o2k7Skin .mceMenu td {height:20px}
|
||||
.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}
|
||||
.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
|
||||
.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px}
|
||||
.o2k7Skin .mceMenu pre.mceText {font-family:Monospace}
|
||||
.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
|
||||
.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
|
||||
.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}
|
||||
.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}
|
||||
.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
|
||||
.o2k7Skin .mceMenuItemDisabled .mceText {color:#888}
|
||||
.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}
|
||||
.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
|
||||
.o2k7Skin .mceMenu span.mceMenuLine {display:none}
|
||||
.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
|
||||
|
||||
/* Progress,Resize */
|
||||
.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
|
||||
.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
|
||||
|
||||
/* Formats */
|
||||
.o2k7Skin .mce_formatPreview a {font-size:10px}
|
||||
.o2k7Skin .mce_p span.mceText {}
|
||||
.o2k7Skin .mce_address span.mceText {font-style:italic}
|
||||
.o2k7Skin .mce_pre span.mceText {font-family:monospace}
|
||||
.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
|
||||
.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
|
||||
.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
|
||||
.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
|
||||
.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
|
||||
.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
|
||||
|
||||
/* Theme */
|
||||
.o2k7Skin span.mce_bold {background-position:0 0}
|
||||
.o2k7Skin span.mce_italic {background-position:-60px 0}
|
||||
.o2k7Skin span.mce_underline {background-position:-140px 0}
|
||||
.o2k7Skin span.mce_strikethrough {background-position:-120px 0}
|
||||
.o2k7Skin span.mce_undo {background-position:-160px 0}
|
||||
.o2k7Skin span.mce_redo {background-position:-100px 0}
|
||||
.o2k7Skin span.mce_cleanup {background-position:-40px 0}
|
||||
.o2k7Skin span.mce_bullist {background-position:-20px 0}
|
||||
.o2k7Skin span.mce_numlist {background-position:-80px 0}
|
||||
.o2k7Skin span.mce_justifyleft {background-position:-460px 0}
|
||||
.o2k7Skin span.mce_justifyright {background-position:-480px 0}
|
||||
.o2k7Skin span.mce_justifycenter {background-position:-420px 0}
|
||||
.o2k7Skin span.mce_justifyfull {background-position:-440px 0}
|
||||
.o2k7Skin span.mce_anchor {background-position:-200px 0}
|
||||
.o2k7Skin span.mce_indent {background-position:-400px 0}
|
||||
.o2k7Skin span.mce_outdent {background-position:-540px 0}
|
||||
.o2k7Skin span.mce_link {background-position:-500px 0}
|
||||
.o2k7Skin span.mce_unlink {background-position:-640px 0}
|
||||
.o2k7Skin span.mce_sub {background-position:-600px 0}
|
||||
.o2k7Skin span.mce_sup {background-position:-620px 0}
|
||||
.o2k7Skin span.mce_removeformat {background-position:-580px 0}
|
||||
.o2k7Skin span.mce_newdocument {background-position:-520px 0}
|
||||
.o2k7Skin span.mce_image {background-position:-380px 0}
|
||||
.o2k7Skin span.mce_help {background-position:-340px 0}
|
||||
.o2k7Skin span.mce_code {background-position:-260px 0}
|
||||
.o2k7Skin span.mce_hr {background-position:-360px 0}
|
||||
.o2k7Skin span.mce_visualaid {background-position:-660px 0}
|
||||
.o2k7Skin span.mce_charmap {background-position:-240px 0}
|
||||
.o2k7Skin span.mce_paste {background-position:-560px 0}
|
||||
.o2k7Skin span.mce_copy {background-position:-700px 0}
|
||||
.o2k7Skin span.mce_cut {background-position:-680px 0}
|
||||
.o2k7Skin span.mce_blockquote {background-position:-220px 0}
|
||||
.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0}
|
||||
.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0}
|
||||
.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0}
|
||||
.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0}
|
||||
|
||||
/* Plugins */
|
||||
.o2k7Skin span.mce_advhr {background-position:-0px -20px}
|
||||
.o2k7Skin span.mce_ltr {background-position:-20px -20px}
|
||||
.o2k7Skin span.mce_rtl {background-position:-40px -20px}
|
||||
.o2k7Skin span.mce_emotions {background-position:-60px -20px}
|
||||
.o2k7Skin span.mce_fullpage {background-position:-80px -20px}
|
||||
.o2k7Skin span.mce_fullscreen {background-position:-100px -20px}
|
||||
.o2k7Skin span.mce_iespell {background-position:-120px -20px}
|
||||
.o2k7Skin span.mce_insertdate {background-position:-140px -20px}
|
||||
.o2k7Skin span.mce_inserttime {background-position:-160px -20px}
|
||||
.o2k7Skin span.mce_absolute {background-position:-180px -20px}
|
||||
.o2k7Skin span.mce_backward {background-position:-200px -20px}
|
||||
.o2k7Skin span.mce_forward {background-position:-220px -20px}
|
||||
.o2k7Skin span.mce_insert_layer {background-position:-240px -20px}
|
||||
.o2k7Skin span.mce_insertlayer {background-position:-260px -20px}
|
||||
.o2k7Skin span.mce_movebackward {background-position:-280px -20px}
|
||||
.o2k7Skin span.mce_moveforward {background-position:-300px -20px}
|
||||
.o2k7Skin span.mce_media {background-position:-320px -20px}
|
||||
.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px}
|
||||
.o2k7Skin span.mce_pastetext {background-position:-360px -20px}
|
||||
.o2k7Skin span.mce_pasteword {background-position:-380px -20px}
|
||||
.o2k7Skin span.mce_selectall {background-position:-400px -20px}
|
||||
.o2k7Skin span.mce_preview {background-position:-420px -20px}
|
||||
.o2k7Skin span.mce_print {background-position:-440px -20px}
|
||||
.o2k7Skin span.mce_cancel {background-position:-460px -20px}
|
||||
.o2k7Skin span.mce_save {background-position:-480px -20px}
|
||||
.o2k7Skin span.mce_replace {background-position:-500px -20px}
|
||||
.o2k7Skin span.mce_search {background-position:-520px -20px}
|
||||
.o2k7Skin span.mce_styleprops {background-position:-560px -20px}
|
||||
.o2k7Skin span.mce_table {background-position:-580px -20px}
|
||||
.o2k7Skin span.mce_cell_props {background-position:-600px -20px}
|
||||
.o2k7Skin span.mce_delete_table {background-position:-620px -20px}
|
||||
.o2k7Skin span.mce_delete_col {background-position:-640px -20px}
|
||||
.o2k7Skin span.mce_delete_row {background-position:-660px -20px}
|
||||
.o2k7Skin span.mce_col_after {background-position:-680px -20px}
|
||||
.o2k7Skin span.mce_col_before {background-position:-700px -20px}
|
||||
.o2k7Skin span.mce_row_after {background-position:-720px -20px}
|
||||
.o2k7Skin span.mce_row_before {background-position:-740px -20px}
|
||||
.o2k7Skin span.mce_merge_cells {background-position:-760px -20px}
|
||||
.o2k7Skin span.mce_table_props {background-position:-980px -20px}
|
||||
.o2k7Skin span.mce_row_props {background-position:-780px -20px}
|
||||
.o2k7Skin span.mce_split_cells {background-position:-800px -20px}
|
||||
.o2k7Skin span.mce_template {background-position:-820px -20px}
|
||||
.o2k7Skin span.mce_visualchars {background-position:-840px -20px}
|
||||
.o2k7Skin span.mce_abbr {background-position:-860px -20px}
|
||||
.o2k7Skin span.mce_acronym {background-position:-880px -20px}
|
||||
.o2k7Skin span.mce_attribs {background-position:-900px -20px}
|
||||
.o2k7Skin span.mce_cite {background-position:-920px -20px}
|
||||
.o2k7Skin span.mce_del {background-position:-940px -20px}
|
||||
.o2k7Skin span.mce_ins {background-position:-960px -20px}
|
||||
.o2k7Skin span.mce_pagebreak {background-position:0 -40px}
|
||||
.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
|
||||
.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
|
@@ -0,0 +1,8 @@
|
||||
/* Black */
|
||||
.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}
|
||||
.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}
|
||||
.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}
|
||||
.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}
|
||||
.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}
|
||||
.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)}
|
||||
.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}
|
@@ -0,0 +1,5 @@
|
||||
/* Silver */
|
||||
.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}
|
||||
.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}
|
||||
.o2k7SkinSilver .mceListBox .mceText {background:#FFF}
|
||||
.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}
|
@@ -0,0 +1,42 @@
|
||||
body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
||||
body {background:#FFF;}
|
||||
body.mceForceColors {background:#FFF; color:#000;}
|
||||
h1 {font-size: 2em}
|
||||
h2 {font-size: 1.5em}
|
||||
h3 {font-size: 1.17em}
|
||||
h4 {font-size: 1em}
|
||||
h5 {font-size: .83em}
|
||||
h6 {font-size: .75em}
|
||||
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
||||
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
|
||||
img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
|
||||
img {border:0;}
|
||||
table {cursor:default}
|
||||
table td, table th {cursor:text}
|
||||
ins {border-bottom:1px solid green; text-decoration: none; color:green}
|
||||
del {color:red; text-decoration:line-through}
|
||||
cite {border-bottom:1px dashed blue}
|
||||
acronym {border-bottom:1px dotted #CCC; cursor:help}
|
||||
abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
|
||||
|
||||
|
||||
blockquote:before{ content:"Zitat:"; display:block; font-weight:bold;font-size:large}
|
||||
blockquote{ background-color:#444444; padding:2px;}
|
||||
|
||||
code{background-color:lightgray;}
|
||||
|
||||
.snInfoBoxHead{font-weight:bold;color:black;display:block;}
|
||||
.snInfoBox{border: solid black 2px; padding:4px;background-color:#444;color:#A0A0A0;}
|
||||
|
||||
|
||||
/* IE */
|
||||
* html body {
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
}
|
@@ -0,0 +1,115 @@
|
||||
/* Generic */
|
||||
body {
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDDDDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
background:#F0F0EE;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
html {background:#F0F0EE;}
|
||||
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
textarea {resize:none;outline:none;}
|
||||
a:link, a:visited {color:black;}
|
||||
a:hover {color:#2B6FB6;}
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #CCC;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #808080;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert, #cancel, input.button, .updateButton {
|
||||
border:0; margin:0; padding:0;
|
||||
font-weight:bold;
|
||||
width:94px; height:26px;
|
||||
background:url(img/buttons.png) 0 -26px;
|
||||
cursor:pointer;
|
||||
padding-bottom:2px;
|
||||
}
|
||||
|
||||
#insert {background:url(img/buttons.png) 0 -52px;}
|
||||
#cancel {background:url(img/buttons.png) 0 0;}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
a.pickcolor:hover span.disabled {}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
|
||||
.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,215 @@
|
||||
/* Reset */
|
||||
.Skin table, .Skin tbody, .Skin a, .Skin img, .Skin tr, .Skin div, .Skin td, .Skin iframe, .Skin span, .Skin *, .Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
||||
.Skin a:hover, .Skin a:link, .Skin a:visited, .Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
.Skin table td {vertical-align:middle}
|
||||
|
||||
/* Containers */
|
||||
.Skin table {background:#E5EFFD}
|
||||
.Skin iframe {display:block; background:#FFF}
|
||||
.Skin .mceToolbar {height:26px}
|
||||
|
||||
/* External */
|
||||
.Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}
|
||||
.Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
|
||||
.Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
||||
|
||||
/* Layout */
|
||||
.Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
|
||||
.Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}
|
||||
.Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
|
||||
.Skin table.mceToolbar, .Skin tr.mceFirst .mceToolbar tr td, .Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
|
||||
.Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
|
||||
.Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
|
||||
.Skin .mceStatusbar div {float:left; padding:2px}
|
||||
.Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
|
||||
.Skin .mceStatusbar a:hover {text-decoration:underline}
|
||||
.Skin table.mceToolbar {margin-left:3px}
|
||||
.Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
|
||||
.Skin .mceToolbar td.mceFirst span {margin:0}
|
||||
.Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
|
||||
.Skin .mceToolbar .mceToolbarEndListBox span, .Skin .mceToolbar .mceToolbarStartListBox span {display:none}
|
||||
.Skin span.mceIcon, .Skin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
.Skin td.mceCenter {text-align:center;}
|
||||
.Skin td.mceCenter table {margin:0 auto; text-align:left;}
|
||||
.Skin td.mceRight table {margin:0 0 0 auto;}
|
||||
|
||||
/* Button */
|
||||
.Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
|
||||
.Skin a.mceButton span, .Skin a.mceButton img {margin-left:1px}
|
||||
.Skin .mceOldBoxModel a.mceButton span, .Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}
|
||||
.Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
|
||||
.Skin a.mceButtonActive, .Skin a.mceButtonSelected {background-position:0 -44px}
|
||||
.Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.Skin .mceButtonLabeled {width:auto}
|
||||
.Skin .mceButtonLabeled span.mceIcon {float:left}
|
||||
.Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
|
||||
.Skin .mceButtonDisabled .mceButtonLabel {color:#888}
|
||||
|
||||
/* Separator */
|
||||
.Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
|
||||
|
||||
/* ListBox */
|
||||
.Skin .mceListBox {margin-left:3px}
|
||||
.Skin .mceListBox, .Skin .mceListBox a {display:block}
|
||||
.Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
|
||||
.Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
|
||||
.Skin table.mceListBoxEnabled:hover .mceText, .Skin .mceListBoxHover .mceText, .Skin .mceListBoxSelected .mceText {background:#FFF}
|
||||
.Skin table.mceListBoxEnabled:hover .mceOpen, .Skin .mceListBoxHover .mceOpen, .Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
|
||||
.Skin .mceListBoxDisabled .mceText {color:gray}
|
||||
.Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
|
||||
.Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
|
||||
.Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
|
||||
|
||||
/* SplitButton */
|
||||
.Skin .mceSplitButton, .Skin .mceSplitButton a, .Skin .mceSplitButton span {display:block; height:22px}
|
||||
.Skin .mceSplitButton {background:url(img/button_bg.png)}
|
||||
.Skin .mceSplitButton a.mceAction {width:22px}
|
||||
.Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
|
||||
.Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}
|
||||
.Skin .mceSplitButton span.mceOpen {display:none}
|
||||
.Skin table.mceSplitButtonEnabled:hover a.mceAction, .Skin .mceSplitButtonHover a.mceAction, .Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}
|
||||
.Skin table.mceSplitButtonEnabled:hover a.mceOpen, .Skin .mceSplitButtonHover a.mceOpen, .Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}
|
||||
.Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
.Skin .mceSplitButtonActive {background-position:0 -44px}
|
||||
|
||||
/* ColorSplitButton */
|
||||
.Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
|
||||
.Skin .mceColorSplitMenu td {padding:2px}
|
||||
.Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
|
||||
.Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
|
||||
.Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
|
||||
.Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
|
||||
.Skin a.mceMoreColors:hover {border:1px solid #0A246A}
|
||||
.Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}
|
||||
.Skin .mce_forecolor span.mceAction, .Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}
|
||||
|
||||
/* Menu */
|
||||
.Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}
|
||||
.Skin .mceNoIcons span.mceIcon {width:0;}
|
||||
.Skin .mceNoIcons a .mceText {padding-left:10px}
|
||||
.Skin .mceMenu table {background:#FFF}
|
||||
.Skin .mceMenu a, .Skin .mceMenu span, .Skin .mceMenu {display:block}
|
||||
.Skin .mceMenu td {height:20px}
|
||||
.Skin .mceMenu a {position:relative;padding:3px 0 4px 0}
|
||||
.Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
|
||||
.Skin .mceMenu span.mceText, .Skin .mceMenu .mcePreview {font-size:11px}
|
||||
.Skin .mceMenu pre.mceText {font-family:Monospace}
|
||||
.Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
|
||||
.Skin .mceMenu .mceMenuItemEnabled a:hover, .Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
|
||||
.Skin td.mceMenuItemSeparator {background:#DDD; height:1px}
|
||||
.Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}
|
||||
.Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
|
||||
.Skin .mceMenuItemDisabled .mceText {color:#888}
|
||||
.Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}
|
||||
.Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
|
||||
.Skin .mceMenu span.mceMenuLine {display:none}
|
||||
.Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
|
||||
|
||||
/* Progress,Resize */
|
||||
.Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
|
||||
.Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
|
||||
|
||||
/* Formats */
|
||||
.Skin .mce_formatPreview a {font-size:10px}
|
||||
.Skin .mce_p span.mceText {}
|
||||
.Skin .mce_address span.mceText {font-style:italic}
|
||||
.Skin .mce_pre span.mceText {font-family:monospace}
|
||||
.Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
|
||||
.Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
|
||||
.Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
|
||||
.Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
|
||||
.Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
|
||||
.Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
|
||||
|
||||
/* Theme */
|
||||
.Skin span.mce_bold {background-position:0 0}
|
||||
.Skin span.mce_italic {background-position:-60px 0}
|
||||
.Skin span.mce_underline {background-position:-140px 0}
|
||||
.Skin span.mce_strikethrough {background-position:-120px 0}
|
||||
.Skin span.mce_undo {background-position:-160px 0}
|
||||
.Skin span.mce_redo {background-position:-100px 0}
|
||||
.Skin span.mce_cleanup {background-position:-40px 0}
|
||||
.Skin span.mce_bullist {background-position:-20px 0}
|
||||
.Skin span.mce_numlist {background-position:-80px 0}
|
||||
.Skin span.mce_justifyleft {background-position:-460px 0}
|
||||
.Skin span.mce_justifyright {background-position:-480px 0}
|
||||
.Skin span.mce_justifycenter {background-position:-420px 0}
|
||||
.Skin span.mce_justifyfull {background-position:-440px 0}
|
||||
.Skin span.mce_anchor {background-position:-200px 0}
|
||||
.Skin span.mce_indent {background-position:-400px 0}
|
||||
.Skin span.mce_outdent {background-position:-540px 0}
|
||||
.Skin span.mce_link {background-position:-500px 0}
|
||||
.Skin span.mce_unlink {background-position:-640px 0}
|
||||
.Skin span.mce_sub {background-position:-600px 0}
|
||||
.Skin span.mce_sup {background-position:-620px 0}
|
||||
.Skin span.mce_removeformat {background-position:-580px 0}
|
||||
.Skin span.mce_newdocument {background-position:-520px 0}
|
||||
.Skin span.mce_image {background-position:-380px 0}
|
||||
.Skin span.mce_help {background-position:-340px 0}
|
||||
.Skin span.mce_code {background-position:-260px 0}
|
||||
.Skin span.mce_hr {background-position:-360px 0}
|
||||
.Skin span.mce_visualaid {background-position:-660px 0}
|
||||
.Skin span.mce_charmap {background-position:-240px 0}
|
||||
.Skin span.mce_paste {background-position:-560px 0}
|
||||
.Skin span.mce_copy {background-position:-700px 0}
|
||||
.Skin span.mce_cut {background-position:-680px 0}
|
||||
.Skin span.mce_blockquote {background-position:-220px 0}
|
||||
.Skin .mce_forecolor span.mceAction {background-position:-720px 0}
|
||||
.Skin .mce_backcolor span.mceAction {background-position:-760px 0}
|
||||
.Skin span.mce_forecolorpicker {background-position:-720px 0}
|
||||
.Skin span.mce_backcolorpicker {background-position:-760px 0}
|
||||
|
||||
/* Plugins */
|
||||
.Skin span.mce_advhr {background-position:-0px -20px}
|
||||
.Skin span.mce_ltr {background-position:-20px -20px}
|
||||
.Skin span.mce_rtl {background-position:-40px -20px}
|
||||
.Skin span.mce_emotions {background-position:-60px -20px}
|
||||
.Skin span.mce_fullpage {background-position:-80px -20px}
|
||||
.Skin span.mce_fullscreen {background-position:-100px -20px}
|
||||
.Skin span.mce_iespell {background-position:-120px -20px}
|
||||
.Skin span.mce_insertdate {background-position:-140px -20px}
|
||||
.Skin span.mce_inserttime {background-position:-160px -20px}
|
||||
.Skin span.mce_absolute {background-position:-180px -20px}
|
||||
.Skin span.mce_backward {background-position:-200px -20px}
|
||||
.Skin span.mce_forward {background-position:-220px -20px}
|
||||
.Skin span.mce_insert_layer {background-position:-240px -20px}
|
||||
.Skin span.mce_insertlayer {background-position:-260px -20px}
|
||||
.Skin span.mce_movebackward {background-position:-280px -20px}
|
||||
.Skin span.mce_moveforward {background-position:-300px -20px}
|
||||
.Skin span.mce_media {background-position:-320px -20px}
|
||||
.Skin span.mce_nonbreaking {background-position:-340px -20px}
|
||||
.Skin span.mce_pastetext {background-position:-360px -20px}
|
||||
.Skin span.mce_pasteword {background-position:-380px -20px}
|
||||
.Skin span.mce_selectall {background-position:-400px -20px}
|
||||
.Skin span.mce_preview {background-position:-420px -20px}
|
||||
.Skin span.mce_print {background-position:-440px -20px}
|
||||
.Skin span.mce_cancel {background-position:-460px -20px}
|
||||
.Skin span.mce_save {background-position:-480px -20px}
|
||||
.Skin span.mce_replace {background-position:-500px -20px}
|
||||
.Skin span.mce_search {background-position:-520px -20px}
|
||||
.Skin span.mce_styleprops {background-position:-560px -20px}
|
||||
.Skin span.mce_table {background-position:-580px -20px}
|
||||
.Skin span.mce_cell_props {background-position:-600px -20px}
|
||||
.Skin span.mce_delete_table {background-position:-620px -20px}
|
||||
.Skin span.mce_delete_col {background-position:-640px -20px}
|
||||
.Skin span.mce_delete_row {background-position:-660px -20px}
|
||||
.Skin span.mce_col_after {background-position:-680px -20px}
|
||||
.Skin span.mce_col_before {background-position:-700px -20px}
|
||||
.Skin span.mce_row_after {background-position:-720px -20px}
|
||||
.Skin span.mce_row_before {background-position:-740px -20px}
|
||||
.Skin span.mce_merge_cells {background-position:-760px -20px}
|
||||
.Skin span.mce_table_props {background-position:-980px -20px}
|
||||
.Skin span.mce_row_props {background-position:-780px -20px}
|
||||
.Skin span.mce_split_cells {background-position:-800px -20px}
|
||||
.Skin span.mce_template {background-position:-820px -20px}
|
||||
.Skin span.mce_visualchars {background-position:-840px -20px}
|
||||
.Skin span.mce_abbr {background-position:-860px -20px}
|
||||
.Skin span.mce_acronym {background-position:-880px -20px}
|
||||
.Skin span.mce_attribs {background-position:-900px -20px}
|
||||
.Skin span.mce_cite {background-position:-920px -20px}
|
||||
.Skin span.mce_del {background-position:-940px -20px}
|
||||
.Skin span.mce_ins {background-position:-960px -20px}
|
||||
.Skin span.mce_pagebreak {background-position:0 -40px}
|
||||
.Skin span.mce_restoredraft {background-position:-20px -40px}
|
||||
.Skin span.mce_spellchecker {background-position:-540px -20px}
|
@@ -0,0 +1,42 @@
|
||||
body, td, pre {color:#A0A0A0; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
|
||||
body {background:#151515;}
|
||||
body.mceForceColors {background:#151515; color:#A0A0A0;}
|
||||
h1 {font-size: 2em}
|
||||
h2 {font-size: 1.5em}
|
||||
h3 {font-size: 1.17em}
|
||||
h4 {font-size: 1em}
|
||||
h5 {font-size: .83em}
|
||||
h6 {font-size: .75em}
|
||||
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
|
||||
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
|
||||
img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
|
||||
img {border:0;}
|
||||
table {cursor:default}
|
||||
table td, table th {cursor:text}
|
||||
ins {border-bottom:1px solid green; text-decoration: none; color:green}
|
||||
del {color:red; text-decoration:line-through}
|
||||
cite {border-bottom:1px dashed blue}
|
||||
acronym {border-bottom:1px dotted #CCC; cursor:help}
|
||||
abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
|
||||
|
||||
|
||||
blockquote:before{ content:"Zitat:"; display:block; font-weight:bold;font-size:large}
|
||||
blockquote{ background-color:#444444; padding:2px;}
|
||||
|
||||
code{background-color:lightgray;}
|
||||
|
||||
.snInfoBoxHead{font-weight:bold;color:black;display:block;}
|
||||
.snInfoBox{border: solid black 2px; padding:4px;background-color:#444;color:#A0A0A0;}
|
||||
|
||||
|
||||
/* IE */
|
||||
* html body {
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
}
|
@@ -0,0 +1,115 @@
|
||||
/* Generic */
|
||||
body {
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
|
||||
scrollbar-3dlight-color:#F0F0EE;
|
||||
scrollbar-arrow-color:#676662;
|
||||
scrollbar-base-color:#F0F0EE;
|
||||
scrollbar-darkshadow-color:#DDDDDD;
|
||||
scrollbar-face-color:#E0E0DD;
|
||||
scrollbar-highlight-color:#F0F0EE;
|
||||
scrollbar-shadow-color:#F0F0EE;
|
||||
scrollbar-track-color:#F5F5F5;
|
||||
background:#F0F0EE;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
html {background:#F0F0EE;}
|
||||
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
textarea {resize:none;outline:none;}
|
||||
a:link, a:visited {color:black;}
|
||||
a:hover {color:#2B6FB6;}
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #CCC;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #808080;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert, #cancel, input.button, .updateButton {
|
||||
border:0; margin:0; padding:0;
|
||||
font-weight:bold;
|
||||
width:94px; height:26px;
|
||||
background:url(img/buttons.png) 0 -26px;
|
||||
cursor:pointer;
|
||||
padding-bottom:2px;
|
||||
}
|
||||
|
||||
#insert {background:url(img/buttons.png) 0 -52px;}
|
||||
#cancel {background:url(img/buttons.png) 0 0;}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
a.pickcolor:hover span.disabled {}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
|
||||
.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
After Width: | Height: | Size: 5.2 KiB |