Apache-SdnFw
view release on metacpan or search on metacpan
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js view on Meta::CPAN
}
});
t.contentAreaContainer = o.iframeContainer;
DOM.get(o.editorContainer).style.display = t.orgDisplay;
DOM.get(t.id).style.display = 'none';
if (!isIE || !tinymce.relaxedDomain)
t.setupIframe();
e = n = o = null; // Cleanup
},
setupIframe : function() {
var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;
// Setup iframe body
if (!isIE || !tinymce.relaxedDomain) {
d.open();
d.write(t.iframeHTML);
d.close();
}
// Design mode needs to be added here Ctrl+A will fail otherwise
if (!isIE) {
try {
if (!s.readonly)
d.designMode = 'On';
} catch (ex) {
// Will fail on Gecko if the editor is placed in an hidden container element
// The design mode will be set ones the editor is focused
}
}
// IE needs to use contentEditable or it will display non secure items for HTTPS
if (isIE) {
// It will not steal focus if we hide it while setting contentEditable
b = t.getBody();
DOM.hide(b);
if (!s.readonly)
b.contentEditable = true;
DOM.show(b);
}
t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {
keep_values : true,
url_converter : t.convertURL,
url_converter_scope : t,
hex_colors : s.force_hex_style_colors,
class_filter : s.class_filter,
update_styles : 1,
fix_ie_paragraphs : 1,
valid_styles : s.valid_styles
});
t.schema = new tinymce.dom.Schema();
t.serializer = new tinymce.dom.Serializer(extend(s, {
valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
dom : t.dom,
schema : t.schema
}));
t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
t.formatter = new tinymce.Formatter(this);
// Register default formats
t.formatter.register({
alignleft : [
{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
{selector : 'img,table', styles : {'float' : 'left'}}
],
aligncenter : [
{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
{selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},
{selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}}
],
alignright : [
{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
{selector : 'img,table', styles : {'float' : 'right'}}
],
alignfull : [
{selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}}
],
bold : [
{inline : 'strong'},
{inline : 'span', styles : {fontWeight : 'bold'}},
{inline : 'b'}
],
italic : [
{inline : 'em'},
{inline : 'span', styles : {fontStyle : 'italic'}},
{inline : 'i'}
],
underline : [
{inline : 'span', styles : {textDecoration : 'underline'}, exact : true},
{inline : 'u'}
],
strikethrough : [
{inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},
{inline : 'u'}
],
forecolor : {inline : 'span', styles : {color : '%value'}},
hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},
fontname : {inline : 'span', styles : {fontFamily : '%value'}},
fontsize : {inline : 'span', styles : {fontSize : '%value'}},
fontsize_class : {inline : 'span', attributes : {'class' : '%value'}},
blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},
removeformat : [
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js view on Meta::CPAN
n = 'span';
} else
n = 'div';
o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>');
o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>');
});
};
t.onBeforeSetContent.add(handleCustom);
t.onPostProcess.add(function(ed, o) {
if (o.set)
handleCustom(ed, o);
});
}
if (s.handle_node_change_callback) {
t.onNodeChange.add(function(ed, cm, n) {
t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());
});
}
if (s.save_callback) {
t.onSaveContent.add(function(ed, o) {
var h = t.execCallback('save_callback', t.id, o.content, t.getBody());
if (h)
o.content = h;
});
}
if (s.onchange_callback) {
t.onChange.add(function(ed, l) {
t.execCallback('onchange_callback', t, l);
});
}
if (s.convert_newlines_to_brs) {
t.onBeforeSetContent.add(function(ed, o) {
if (o.initial)
o.content = o.content.replace(/\r?\n/g, '<br />');
});
}
if (s.fix_nesting && isIE) {
t.onBeforeSetContent.add(function(ed, o) {
o.content = t._fixNesting(o.content);
});
}
if (s.preformatted) {
t.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/^\s*<pre.*?>/, '');
o.content = o.content.replace(/<\/pre>\s*$/, '');
if (o.set)
o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';
});
}
if (s.verify_css_classes) {
t.serializer.attribValueFilter = function(n, v) {
var s, cl;
if (n == 'class') {
// Build regexp for classes
if (!t.classesRE) {
cl = t.dom.getClasses();
if (cl.length > 0) {
s = '';
each (cl, function(o) {
s += (s ? '|' : '') + o['class'];
});
t.classesRE = new RegExp('(' + s + ')', 'gi');
}
}
return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';
}
return v;
};
}
if (s.cleanup_callback) {
t.onBeforeSetContent.add(function(ed, o) {
o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
});
t.onPreProcess.add(function(ed, o) {
if (o.set)
t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);
if (o.get)
t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);
});
t.onPostProcess.add(function(ed, o) {
if (o.set)
o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
if (o.get)
o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);
});
}
if (s.save_callback) {
t.onGetContent.add(function(ed, o) {
if (o.save)
o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());
});
}
if (s.handle_event_callback) {
t.onEvent.add(function(ed, e, o) {
if (t.execCallback('handle_event_callback', e, ed, o) === false)
Event.cancel(e);
});
( run in 0.690 second using v1.01-cache-2.11-cpan-39bf76dae61 )