ASNMTAP

 view release on metacpan or  search on metacpan

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

//\/////
//\  overLIB Anchor Plugin
//\  This file requires overLIB 4.10 or later.
//\
//\  overLIB 4.10 - You may not remove or change this notice.
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
//\  Contributors are listed on the homepage.
//\  See http://www.bosrup.com/web/overlib/ for details.
//   $Revision: 1.7 $                      $Date: 2004/11/25 21:27:19 $
//\/////
//\mini


////////
// PRE-INIT
// 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 Anchor Plugin.');
else {
registerCommands('anchor,anchorx,anchory,noanchorwarn,anchoralign');



////////
// 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_anchor ==  'undefined') var ol_anchor = '';
if (typeof ol_anchorx ==  'undefined') var ol_anchorx = 0;
if (typeof ol_anchory ==  'undefined') var ol_anchory = 0;
if (typeof ol_noanchorwarn ==  'undefined') var ol_noanchorwarn = 1;
if (typeof ol_anchoralign ==  'undefined') var ol_anchoralign = 'UL';

////////
// 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_anchor = "";
var o3_anchorx = 0;
var o3_anchory = 0;
var o3_noanchorwarn = 1;
var o3_anchoralign = 'UL';
var mrkObj, rmrkPosition;  //reference mark object, reference mark position, an array;


////////
// PLUGIN FUNCTIONS
////////
function setAnchorVariables() {
	o3_anchor = ol_anchor;
	o3_anchorx = ol_anchorx;
	o3_anchory = ol_anchory;
	o3_noanchorwarn = ol_noanchorwarn;
	o3_anchoralign = ol_anchoralign;
	mrkObj = null;  // initialize this variable
}

// Parses Reference Mark commands
function parseAnchorExtras(pf,i,ar) {
	var v, k=i;

	if (k < ar.length) {
		if (ar[k] ==  ANCHOR) { eval(pf + "anchor = '" + escSglQuote(ar[++k]) + "'"); return k; }
		if (ar[k] ==  ANCHORX) { eval(pf + 'anchorx = ' + ar[++k]); return k; }
		if (ar[k] ==  ANCHORY) { eval(pf + 'anchory = ' + ar[++k]); return k; }
		if (ar[k] ==  NOANCHORWARN) { eval(pf + 'noanchorwarn = (' + pf + 'noanchorwarn==1) ? 0 : 1'); return k; }
		if (ar[k] ==  ANCHORALIGN) { k = opt_MULTIPLEARGS(++k, ar, (pf + 'anchoralign'));  return k; }
	}



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