aboutsummaryrefslogtreecommitdiffstats
path: root/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js')
-rw-r--r--library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js
index d94c8e499..61fe53707 100644
--- a/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js
+++ b/library/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js
@@ -69,6 +69,16 @@
each(previewStyles.split(' '), function(name) {
var value = dom.getStyle(previewElm, name, true);
+ // If background is transparent then check if the body has a background color we can use
+ if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+ value = dom.getStyle(ed.getBody(), name, true);
+
+ // Ignore white since it's the default color, not the nicest fix
+ if (dom.toHex(value).toLowerCase() == '#ffffff') {
+ return;
+ }
+ }
+
// Old IE won't calculate the font size so we need to do that manually
if (name == 'font-size') {
if (/em|%$/.test(value)) {
@@ -608,7 +618,7 @@
// TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
// Maybe actually inherit it from the original textara?
- n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
+ n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')});
DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
if (!DOM.boxModel)
@@ -925,7 +935,7 @@
},
_addToolbars : function(c, o) {
- var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false;
toolbarGroup = cf.createToolbarGroup('toolbargroup', {
'name': ed.getLang('advanced.toolbar'),
@@ -941,6 +951,7 @@
// Create toolbar and add the controls
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
+ toolbarsExist = true;
tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
if (s['theme_advanced_buttons' + i + '_add'])
@@ -954,6 +965,9 @@
o.deltaHeight -= s.theme_advanced_row_height;
}
+ // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly
+ if (!toolbarsExist)
+ o.deltaHeight -= s.theme_advanced_row_height;
h.push(toolbarGroup.renderHTML());
h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
DOM.setHTML(n, h.join(''));
@@ -1112,7 +1126,7 @@
}
if (c = cm.get('formatselect')) {
- p = getParent(DOM.isBlock);
+ p = getParent(ed.dom.isBlock);
if (p)
c.select(p.nodeName.toLowerCase());
@@ -1210,7 +1224,7 @@
return;
// Handle prefix
- if (tinymce.isIE && n.scopeName !== 'HTML')
+ if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName)
na = n.scopeName + ':' + na;
// Remove internal prefix
@@ -1271,7 +1285,7 @@
if (v) {
ti += 'class: ' + v + ' ';
- if (DOM.isBlock(n) || na == 'img' || na == 'span')
+ if (ed.dom.isBlock(n) || na == 'img' || na == 'span')
na += '.' + v;
}
}