Sha256: 640703ba08790b120da21cb19de429173a6625fbab7e8c9c443f93995eb06ffc

Contents?: true

Size: 1.29 KB

Versions: 736

Compression:

Stored size: 1.29 KB

Contents

var AdvHRDialog = {
	init : function(ed) {
		var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;

		w = dom.getAttrib(n, 'width');
		f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
		f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
		f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
		selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
	},

	update : function() {
		var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';

		h = '<hr';

		if (f.size.value) {
			h += ' size="' + f.size.value + '"';
			st += ' height:' + f.size.value + 'px;';
		}

		if (f.width.value) {
			h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
			st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
		}

		if (f.noshade.checked) {
			h += ' noshade="noshade"';
			st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
		}

		if (ed.settings.inline_styles)
			h += ' style="' + tinymce.trim(st) + '"';

		h += ' />';

		ed.execCommand("mceInsertContent", false, h);
		tinyMCEPopup.close();
	}
};

tinyMCEPopup.requireLangPack();
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);

Version data entries

736 entries across 683 versions & 50 rubygems

Version Path
goldencobra-2.3.4 app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/advhr/js/rule.js
goldencobra-2.3.3 app/assets/javascripts/goldencobra/html_editors/tinymce_v3/plugins/advhr/js/rule.js
wagn-1.21.1 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.21.0 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.20.4 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.20.3 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.20.2 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.20.1 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.20.0 rails/assets/tinymce/plugins/advhr/js/rule.js
ish_lib-0.0.8 vendor/assets/javascripts/.trash/tinymce/plugins/advhr/js/rule.js
ish_lib-0.0.8 vendor/assets/themeforest/alpona/html/js/tiny_mce/plugins/advhr/js/rule.js
wagn-1.19.6 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.5 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.4 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.3 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.2 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.1 rails/assets/tinymce/plugins/advhr/js/rule.js
wagn-1.19.0 rails/assets/tinymce/plugins/advhr/js/rule.js
tinymce-rails-3.5.11.1 vendor/assets/javascripts/tinymce/plugins/advhr/js/rule.js
wagn-1.18.6 rails/assets/tinymce/plugins/advhr/js/rule.js