ASNMTAP

 view release on metacpan or  search on metacpan

applications/htmlroot/overlib_cssstyle.js  view on Meta::CPAN

// Ignore these lines, configuration is below.
////////
if (typeof olInfo == 'undefined' || typeof olInfo.meets == 'undefined' || !olInfo.meets(4.10)) alert('overLIB 4.10 or later is required for the CSS Style Plugin.');
else {
registerCommands('cssstyle,padunit,heightunit,widthunit,textsizeunit,textdecoration,textstyle,textweight,captionsizeunit,captiondecoration,captionstyle,captionweight,closesizeunit,closedecoration,closestyle,closeweight');


////////
// DEFAULT CONFIGURATION
// Settings you want everywhere are set here. All of this can also be
// changed on your html page or through an overLIB call.
////////
if (typeof ol_padunit=='undefined') var ol_padunit="px";
if (typeof ol_heightunit=='undefined') var ol_heightunit="px";
if (typeof ol_widthunit=='undefined') var ol_widthunit="px";
if (typeof ol_textsizeunit=='undefined') var ol_textsizeunit="px";
if (typeof ol_textdecoration=='undefined') var ol_textdecoration="none";
if (typeof ol_textstyle=='undefined') var ol_textstyle="normal";
if (typeof ol_textweight=='undefined') var ol_textweight="normal";
if (typeof ol_captionsizeunit=='undefined') var ol_captionsizeunit="px";
if (typeof ol_captiondecoration=='undefined') var ol_captiondecoration="none";
if (typeof ol_captionstyle=='undefined') var ol_captionstyle="normal";
if (typeof ol_captionweight=='undefined') var ol_captionweight="bold";
if (typeof ol_closesizeunit=='undefined') var ol_closesizeunit="px";
if (typeof ol_closedecoration=='undefined') var ol_closedecoration="none";
if (typeof ol_closestyle=='undefined') var ol_closestyle="normal";
if (typeof ol_closeweight=='undefined') var ol_closeweight="normal";

////////
// END OF CONFIGURATION
// Don't change anything below this line, all configuration is above.
////////



////////
// INIT
////////
// Runtime variables init. Don't change for config!
var o3_padunit="px";
var o3_heightunit="px";
var o3_widthunit="px";
var o3_textsizeunit="px";
var o3_textdecoration="";
var o3_textstyle="";
var o3_textweight="";
var o3_captionsizeunit="px";
var o3_captiondecoration="";
var o3_captionstyle="";
var o3_captionweight="";
var o3_closesizeunit="px";
var o3_closedecoration="";
var o3_closestyle="";
var o3_closeweight="";


////////
// PLUGIN FUNCTIONS
////////

// Function which sets runtime variables to their default values
function setCSSStyleVariables() {
	o3_padunit=ol_padunit;
	o3_heightunit=ol_heightunit;
	o3_widthunit=ol_widthunit;
	o3_textsizeunit=ol_textsizeunit;
	o3_textdecoration=ol_textdecoration;
	o3_textstyle=ol_textstyle;
	o3_textweight=ol_textweight;
	o3_captionsizeunit=ol_captionsizeunit;
	o3_captiondecoration=ol_captiondecoration;
	o3_captionstyle=ol_captionstyle;
	o3_captionweight=ol_captionweight;
	o3_closesizeunit=ol_closesizeunit;
	o3_closedecoration=ol_closedecoration;
	o3_closestyle=ol_closestyle;
	o3_closeweight=ol_closeweight;
}

// Parses CSS Style commands.
function parseCSSStyleExtras(pf, i, ar) {
	var k = i;
	
	if (k < ar.length) {
		if (ar[k]==CSSSTYLE) { eval(pf+'css='+ar[k]); return k; }
		if (ar[k]==PADUNIT) { eval(pf+'padunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==HEIGHTUNIT) { eval(pf+'heightunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==WIDTHUNIT) { eval(pf+'widthunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTSIZEUNIT) { eval(pf+'textsizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTDECORATION) { eval(pf+'textdecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTSTYLE) { eval(pf+'textstyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTWEIGHT) { eval(pf+'textweight="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONSIZEUNIT) { eval(pf+'captionsizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONDECORATION) { eval(pf+'captiondecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONSTYLE) { eval(pf+'captionstyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONWEIGHT) { eval(pf+'captionweight="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSESIZEUNIT) { eval(pf+'closesizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSEDECORATION) { eval(pf+'closedecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSESTYLE) { eval(pf+'closestyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSEWEIGHT) { eval(pf+'closeweight="'+ar[++k]+'"'); return k; }
	}
	
	return -1;
}

////////
// LAYER GENERATION FUNCTIONS
////////

// Makes simple table without caption
function ol_content_simple_cssstyle(text) {
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" style="background-color: '+o3_bgcolor+'; height: '+o3_height+o3_heightunit+';"><tr><td><table width="100%" border="0" cellpadding="' + o3_cellpad + '" cellspa...
	set_background("");
	
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption_cssstyle(text, title, close) {
	var nameId;
	closing = "";



( run in 0.372 second using v1.01-cache-2.11-cpan-39bf76dae61 )