includes/clientside/tinymce/plugins/style/js/props.js
changeset 543 dffcbfbc4e59
parent 459 31c23016ab62
child 1193 e3b94bd055dc
equal deleted inserted replaced
542:5841df0ab575 543:dffcbfbc4e59
   221 	selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
   221 	selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
   222 
   222 
   223 	f.positioning_height.value = getNum(ce.style.height);
   223 	f.positioning_height.value = getNum(ce.style.height);
   224 	selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
   224 	selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
   225 
   225 
   226 	setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
   226 	setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);
   227 
   227 
   228 	s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
   228 	s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
   229 	s = s.replace(/,/g, ' ');
   229 	s = s.replace(/,/g, ' ');
   230 
   230 
   231 	if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
   231 	if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {
   232 		f.positioning_clip_top.value = getNum(getVal(s, 0));
   232 		f.positioning_clip_top.value = getNum(getVal(s, 0));
   233 		selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
   233 		selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
   234 		f.positioning_clip_right.value = getNum(getVal(s, 1));
   234 		f.positioning_clip_right.value = getNum(getVal(s, 1));
   235 		selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
   235 		selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
   236 		f.positioning_clip_bottom.value = getNum(getVal(s, 2));
   236 		f.positioning_clip_bottom.value = getNum(getVal(s, 2));
   277 		selectByValue(f, n, v, true, true);
   277 		selectByValue(f, n, v, true, true);
   278 }
   278 }
   279 
   279 
   280 function setupBox(f, ce, fp, pr, sf, b) {
   280 function setupBox(f, ce, fp, pr, sf, b) {
   281 	if (typeof(b) == "undefined")
   281 	if (typeof(b) == "undefined")
   282 		b = new Array('Top', 'Right', 'Bottom', 'Left');
   282 		b = ['Top', 'Right', 'Bottom', 'Left'];
   283 
   283 
   284 	if (isSame(ce, pr, sf, b)) {
   284 	if (isSame(ce, pr, sf, b)) {
   285 		f.elements[fp + "_same"].checked = true;
   285 		f.elements[fp + "_same"].checked = true;
   286 
   286 
   287 		setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
   287 		setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
   326 		}
   326 		}
   327 	}
   327 	}
   328 }
   328 }
   329 
   329 
   330 function isSame(e, pr, sf, b) {
   330 function isSame(e, pr, sf, b) {
   331 	var a = new Array(), i, x;
   331 	var a = [], i, x;
   332 
   332 
   333 	if (typeof(b) == "undefined")
   333 	if (typeof(b) == "undefined")
   334 		b = new Array('Top', 'Right', 'Bottom', 'Left');
   334 		b = ['Top', 'Right', 'Bottom', 'Left'];
   335 
   335 
   336 	if (typeof(sf) == "undefined" || sf == null)
   336 	if (typeof(sf) == "undefined" || sf == null)
   337 		sf = "";
   337 		sf = "";
   338 
   338 
   339 	a[0] = e.style[pr + b[0] + sf];
   339 	a[0] = e.style[pr + b[0] + sf];