Version Description
Download this release
Release Info
Developer | oferwald |
Plugin | Transposh WordPress Translation |
Version | 0.0.1 |
Comparing to | |
See all releases |
Version 0.0.1
- constants.php +78 -0
- flags/ad.png +0 -0
- flags/ae.png +0 -0
- flags/af.png +0 -0
- flags/ag.png +0 -0
- flags/ai.png +0 -0
- flags/al.png +0 -0
- flags/am.png +0 -0
- flags/an.png +0 -0
- flags/ao.png +0 -0
- flags/ar.png +0 -0
- flags/as.png +0 -0
- flags/at.png +0 -0
- flags/au.png +0 -0
- flags/aw.png +0 -0
- flags/ax.png +0 -0
- flags/az.png +0 -0
- flags/ba.png +0 -0
- flags/bb.png +0 -0
- flags/bd.png +0 -0
- flags/be.png +0 -0
- flags/bf.png +0 -0
- flags/bg.png +0 -0
- flags/bh.png +0 -0
- flags/bi.png +0 -0
- flags/bj.png +0 -0
- flags/bm.png +0 -0
- flags/bn.png +0 -0
- flags/bo.png +0 -0
- flags/br.png +0 -0
- flags/bs.png +0 -0
- flags/bt.png +0 -0
- flags/bv.png +0 -0
- flags/bw.png +0 -0
- flags/by.png +0 -0
- flags/bz.png +0 -0
- flags/ca.png +0 -0
- flags/catalonia.png +0 -0
- flags/cc.png +0 -0
- flags/cd.png +0 -0
- flags/cf.png +0 -0
- flags/cg.png +0 -0
- flags/ch.png +0 -0
- flags/ci.png +0 -0
- flags/ck.png +0 -0
- flags/cl.png +0 -0
- flags/cm.png +0 -0
- flags/cn.png +0 -0
- flags/co.png +0 -0
- flags/cr.png +0 -0
- flags/cs.png +0 -0
- flags/cu.png +0 -0
- flags/cv.png +0 -0
- flags/cx.png +0 -0
- flags/cy.png +0 -0
- flags/cz.png +0 -0
- flags/de.png +0 -0
- flags/dj.png +0 -0
- flags/dk.png +0 -0
- flags/dm.png +0 -0
- flags/do.png +0 -0
- flags/dz.png +0 -0
- flags/ec.png +0 -0
- flags/ee.png +0 -0
- flags/eg.png +0 -0
- flags/eh.png +0 -0
- flags/england.png +0 -0
- flags/er.png +0 -0
- flags/es.png +0 -0
- flags/et.png +0 -0
- flags/europeanunion.png +0 -0
- flags/fam.png +0 -0
- flags/fi.png +0 -0
- flags/fj.png +0 -0
- flags/fk.png +0 -0
- flags/fm.png +0 -0
- flags/fo.png +0 -0
- flags/fr.png +0 -0
- flags/ga.png +0 -0
- flags/gb.png +0 -0
- flags/gd.png +0 -0
- flags/ge.png +0 -0
- flags/gf.png +0 -0
- flags/gh.png +0 -0
- flags/gi.png +0 -0
- flags/gl.png +0 -0
- flags/gm.png +0 -0
- flags/gn.png +0 -0
- flags/gp.png +0 -0
- flags/gq.png +0 -0
- flags/gr.png +0 -0
- flags/gs.png +0 -0
- flags/gt.png +0 -0
- flags/gu.png +0 -0
- flags/gw.png +0 -0
- flags/gy.png +0 -0
- flags/hk.png +0 -0
- flags/hm.png +0 -0
- flags/hn.png +0 -0
- flags/hr.png +0 -0
- flags/ht.png +0 -0
- flags/hu.png +0 -0
- flags/id.png +0 -0
- flags/ie.png +0 -0
- flags/il.png +0 -0
- flags/in.png +0 -0
- flags/io.png +0 -0
- flags/iq.png +0 -0
- flags/ir.png +0 -0
- flags/is.png +0 -0
- flags/it.png +0 -0
- flags/jm.png +0 -0
- flags/jo.png +0 -0
- flags/jp.png +0 -0
- flags/ke.png +0 -0
- flags/kg.png +0 -0
- flags/kh.png +0 -0
- flags/ki.png +0 -0
- flags/km.png +0 -0
- flags/kn.png +0 -0
- flags/kp.png +0 -0
- flags/kr.png +0 -0
- flags/kw.png +0 -0
- flags/ky.png +0 -0
- flags/kz.png +0 -0
- flags/la.png +0 -0
- flags/lb.png +0 -0
- flags/lc.png +0 -0
- flags/li.png +0 -0
- flags/lk.png +0 -0
- flags/lr.png +0 -0
- flags/ls.png +0 -0
- flags/lt.png +0 -0
- flags/lu.png +0 -0
- flags/lv.png +0 -0
- flags/ly.png +0 -0
- flags/ma.png +0 -0
- flags/mc.png +0 -0
- flags/md.png +0 -0
- flags/me.png +0 -0
- flags/mg.png +0 -0
- flags/mh.png +0 -0
- flags/mk.png +0 -0
- flags/ml.png +0 -0
- flags/mm.png +0 -0
- flags/mn.png +0 -0
- flags/mo.png +0 -0
- flags/mp.png +0 -0
- flags/mq.png +0 -0
- flags/mr.png +0 -0
- flags/ms.png +0 -0
- flags/mt.png +0 -0
- flags/mu.png +0 -0
- flags/mv.png +0 -0
- flags/mw.png +0 -0
- flags/mx.png +0 -0
- flags/my.png +0 -0
- flags/mz.png +0 -0
- flags/na.png +0 -0
- flags/nc.png +0 -0
- flags/ne.png +0 -0
- flags/nf.png +0 -0
- flags/ng.png +0 -0
- flags/ni.png +0 -0
- flags/nl.png +0 -0
- flags/no.png +0 -0
- flags/np.png +0 -0
- flags/nr.png +0 -0
- flags/nu.png +0 -0
- flags/nz.png +0 -0
- flags/om.png +0 -0
- flags/pa.png +0 -0
- flags/pe.png +0 -0
- flags/pf.png +0 -0
- flags/pg.png +0 -0
- flags/ph.png +0 -0
- flags/pk.png +0 -0
- flags/pl.png +0 -0
- flags/pm.png +0 -0
- flags/pn.png +0 -0
- flags/pr.png +0 -0
- flags/ps.png +0 -0
- flags/pt.png +0 -0
- flags/pw.png +0 -0
- flags/py.png +0 -0
- flags/qa.png +0 -0
- flags/re.png +0 -0
- flags/ro.png +0 -0
- flags/rs.png +0 -0
- flags/ru.png +0 -0
- flags/rw.png +0 -0
- flags/sa.png +0 -0
- flags/sb.png +0 -0
- flags/sc.png +0 -0
- flags/scotland.png +0 -0
- flags/sd.png +0 -0
- flags/se.png +0 -0
- flags/sg.png +0 -0
- flags/sh.png +0 -0
- flags/si.png +0 -0
- flags/sj.png +0 -0
- flags/sk.png +0 -0
- flags/sl.png +0 -0
- flags/sm.png +0 -0
- flags/sn.png +0 -0
- flags/so.png +0 -0
- flags/sr.png +0 -0
- flags/st.png +0 -0
- flags/sv.png +0 -0
- flags/sy.png +0 -0
- flags/sz.png +0 -0
- flags/tc.png +0 -0
- flags/td.png +0 -0
- flags/tf.png +0 -0
- flags/tg.png +0 -0
- flags/th.png +0 -0
- flags/tj.png +0 -0
- flags/tk.png +0 -0
- flags/tl.png +0 -0
- flags/tm.png +0 -0
- flags/tn.png +0 -0
- flags/to.png +0 -0
- flags/tr.png +0 -0
- flags/tt.png +0 -0
- flags/tv.png +0 -0
- flags/tw.png +0 -0
- flags/tz.png +0 -0
- flags/ua.png +0 -0
- flags/ug.png +0 -0
- flags/um.png +0 -0
- flags/us.png +0 -0
- flags/uy.png +0 -0
- flags/uz.png +0 -0
- flags/va.png +0 -0
- flags/vc.png +0 -0
- flags/ve.png +0 -0
- flags/vg.png +0 -0
- flags/vi.png +0 -0
- flags/vn.png +0 -0
- flags/vu.png +0 -0
- flags/wales.png +0 -0
- flags/wf.png +0 -0
- flags/ws.png +0 -0
- flags/ye.png +0 -0
- flags/yt.png +0 -0
- flags/za.png +0 -0
- flags/zm.png +0 -0
- flags/zw.png +0 -0
- js/overlibmws/BabelFish.js +58 -0
- js/overlibmws/ajaxcontentmws.js +185 -0
- js/overlibmws/arrow.gif +0 -0
- js/overlibmws/calendarmws.js +624 -0
- js/overlibmws/calendarmws_lang.js +705 -0
- js/overlibmws/cornerBL.gif +0 -0
- js/overlibmws/cornerBR.gif +0 -0
- js/overlibmws/cornerTL.gif +0 -0
- js/overlibmws/cornerTR.gif +0 -0
- js/overlibmws/edgeB.gif +0 -0
- js/overlibmws/edgeL.gif +0 -0
- js/overlibmws/edgeR.gif +0 -0
- js/overlibmws/edgeT.gif +0 -0
- js/overlibmws/exit.gif +0 -0
- js/overlibmws/exit_blue.gif +0 -0
- js/overlibmws/exit_metallic.gif +0 -0
- js/overlibmws/flower.gif +0 -0
- js/overlibmws/htmlspecialcharsmws.js +68 -0
- js/overlibmws/iframecontentmws.js +53 -0
- js/overlibmws/inputText.gif +0 -0
- js/overlibmws/license.html +265 -0
- js/overlibmws/loading.gif +0 -0
- js/overlibmws/objectcontentmws.js +16 -0
- js/overlibmws/oval.gif +0 -0
- js/overlibmws/overlibCompat.js +30 -0
- js/overlibmws/overlibConfig.txt +650 -0
- js/overlibmws/overlibmws.js +624 -0
- js/overlibmws/overlibmws_bubble.js +134 -0
- js/overlibmws/overlibmws_crossframe.js +58 -0
- js/overlibmws/overlibmws_debug.js +120 -0
- js/overlibmws/overlibmws_draggable.js +85 -0
- js/overlibmws/overlibmws_exclusive.js +58 -0
- js/overlibmws/overlibmws_filter.js +156 -0
- js/overlibmws/overlibmws_function.js +44 -0
- js/overlibmws/overlibmws_hide.js +81 -0
- js/overlibmws/overlibmws_iframe.js +93 -0
- js/overlibmws/overlibmws_modal.js +139 -0
- js/overlibmws/overlibmws_overtwo.js +112 -0
- js/overlibmws/overlibmws_print.js +143 -0
- js/overlibmws/overlibmws_regCore.js +75 -0
- js/overlibmws/overlibmws_scroll.js +70 -0
- js/overlibmws/overlibmws_shadow.js +113 -0
- js/overlibmws/overlibmwslogo.gif +0 -0
- js/overlibmws/print.gif +0 -0
- js/overlibmws/pushpin.gif +0 -0
- js/overlibmws/quotation.gif +0 -0
- js/overlibmws/raised_blue.gif +0 -0
- js/overlibmws/raised_metallic.gif +0 -0
- js/overlibmws/semitrans.gif +0 -0
- js/overlibmws/showCalendar.gif +0 -0
- js/overlibmws/sprintf.js +133 -0
- js/overlibmws/square.gif +0 -0
- js/transposh.js +66 -0
- parser.php +687 -0
- readme.txt +74 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- translate.png +0 -0
- translate_fix.png +0 -0
- transposh.css +97 -0
- transposh.php +725 -0
- transposh_admin.php +301 -0
- transposh_widget.php +259 -0
constants.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
3 |
+
*
|
4 |
+
* This program is free software; you can redistribute it and/or modify
|
5 |
+
* it under the terms of the GNU General Public License as published by
|
6 |
+
* the Free Software Foundation; either version 2 of the License, or
|
7 |
+
* (at your option) any later version.
|
8 |
+
*
|
9 |
+
* This program is distributed in the hope that it will be useful,
|
10 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
* GNU General Public License for more details.
|
13 |
+
*
|
14 |
+
* You should have received a copy of the GNU General Public License
|
15 |
+
* along with this program; if not, write to the Free Software
|
16 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
//Language indicator in URL. i.e. lang=en
|
20 |
+
define("LANG_PARAM", "lang");
|
21 |
+
|
22 |
+
//Edit mode indicator in URL. i.e. lang=en&edit=true
|
23 |
+
define("EDIT_PARAM", "edit");
|
24 |
+
|
25 |
+
//Enable apc usage
|
26 |
+
define("ENABLE_APC", TRUE);
|
27 |
+
|
28 |
+
//Class marking a section not be translated.
|
29 |
+
define("NO_TRANSLATE_CLASS", "no_translate");
|
30 |
+
|
31 |
+
//Supported languages, new languages can be added here
|
32 |
+
$languages = array("en" => "English,us",
|
33 |
+
"ar" => "العربية,sa",
|
34 |
+
"bg" => "Български,bg",
|
35 |
+
"zh" => "汉字,cn",
|
36 |
+
"hr" => "Hrvatski,hr",
|
37 |
+
"cs" => "čeština,cz",
|
38 |
+
"nl" => "Nederlands,nl",
|
39 |
+
"fi" => "Suomi,fi",
|
40 |
+
"fr" => "Français,fr",
|
41 |
+
"de" => "Deutsch,de",
|
42 |
+
"el" => "Ελληνικά,gr",
|
43 |
+
"he" => "עברית,il",
|
44 |
+
"hu" => "magyar,hu",
|
45 |
+
"it" => "Italiano,it",
|
46 |
+
"ko" => "우리말,kr",
|
47 |
+
"pl" => "Polski,pl",
|
48 |
+
"pt" => "Português,pt",
|
49 |
+
"ro" => "Română,ro",
|
50 |
+
"ru" => "Русский,ru",
|
51 |
+
"es" => "Español,es",
|
52 |
+
"sv" => "svenska,se",
|
53 |
+
"th" => "ภาษาไทย,th",
|
54 |
+
"tr" => "Türkçe,tr");
|
55 |
+
|
56 |
+
|
57 |
+
//Language which are read from right to left (rtl)
|
58 |
+
$rtl_languages = array("ar", "he");
|
59 |
+
|
60 |
+
//Define the new capability that will be assigned to roles - translator
|
61 |
+
define("TRANLSLATOR", 'translator');
|
62 |
+
|
63 |
+
//Option defining whether anonymous translation is allowed.
|
64 |
+
define("ANONYMOUS_TRANSLATION", "transposh_allow_anonymous_translation");
|
65 |
+
|
66 |
+
//Option defining the list of currentlly viewable languages
|
67 |
+
define("VIEWABLE_LANGS", "transposh_viewable_languages");
|
68 |
+
|
69 |
+
//Option defining the list of currentlly editable languages
|
70 |
+
define("EDITABLE_LANGS", "transposh_editable_languages");
|
71 |
+
|
72 |
+
//Option defining the default language
|
73 |
+
define("DEFAULT_LANG", "transposh_default_language");
|
74 |
+
|
75 |
+
//Option defining transposh widget appearance
|
76 |
+
define("WIDGET_TRANSPOSH", "widget_transposh");
|
77 |
+
|
78 |
+
?>
|
flags/ad.png
ADDED
Binary file
|
flags/ae.png
ADDED
Binary file
|
flags/af.png
ADDED
Binary file
|
flags/ag.png
ADDED
Binary file
|
flags/ai.png
ADDED
Binary file
|
flags/al.png
ADDED
Binary file
|
flags/am.png
ADDED
Binary file
|
flags/an.png
ADDED
Binary file
|
flags/ao.png
ADDED
Binary file
|
flags/ar.png
ADDED
Binary file
|
flags/as.png
ADDED
Binary file
|
flags/at.png
ADDED
Binary file
|
flags/au.png
ADDED
Binary file
|
flags/aw.png
ADDED
Binary file
|
flags/ax.png
ADDED
Binary file
|
flags/az.png
ADDED
Binary file
|
flags/ba.png
ADDED
Binary file
|
flags/bb.png
ADDED
Binary file
|
flags/bd.png
ADDED
Binary file
|
flags/be.png
ADDED
Binary file
|
flags/bf.png
ADDED
Binary file
|
flags/bg.png
ADDED
Binary file
|
flags/bh.png
ADDED
Binary file
|
flags/bi.png
ADDED
Binary file
|
flags/bj.png
ADDED
Binary file
|
flags/bm.png
ADDED
Binary file
|
flags/bn.png
ADDED
Binary file
|
flags/bo.png
ADDED
Binary file
|
flags/br.png
ADDED
Binary file
|
flags/bs.png
ADDED
Binary file
|
flags/bt.png
ADDED
Binary file
|
flags/bv.png
ADDED
Binary file
|
flags/bw.png
ADDED
Binary file
|
flags/by.png
ADDED
Binary file
|
flags/bz.png
ADDED
Binary file
|
flags/ca.png
ADDED
Binary file
|
flags/catalonia.png
ADDED
Binary file
|
flags/cc.png
ADDED
Binary file
|
flags/cd.png
ADDED
Binary file
|
flags/cf.png
ADDED
Binary file
|
flags/cg.png
ADDED
Binary file
|
flags/ch.png
ADDED
Binary file
|
flags/ci.png
ADDED
Binary file
|
flags/ck.png
ADDED
Binary file
|
flags/cl.png
ADDED
Binary file
|
flags/cm.png
ADDED
Binary file
|
flags/cn.png
ADDED
Binary file
|
flags/co.png
ADDED
Binary file
|
flags/cr.png
ADDED
Binary file
|
flags/cs.png
ADDED
Binary file
|
flags/cu.png
ADDED
Binary file
|
flags/cv.png
ADDED
Binary file
|
flags/cx.png
ADDED
Binary file
|
flags/cy.png
ADDED
Binary file
|
flags/cz.png
ADDED
Binary file
|
flags/de.png
ADDED
Binary file
|
flags/dj.png
ADDED
Binary file
|
flags/dk.png
ADDED
Binary file
|
flags/dm.png
ADDED
Binary file
|
flags/do.png
ADDED
Binary file
|
flags/dz.png
ADDED
Binary file
|
flags/ec.png
ADDED
Binary file
|
flags/ee.png
ADDED
Binary file
|
flags/eg.png
ADDED
Binary file
|
flags/eh.png
ADDED
Binary file
|
flags/england.png
ADDED
Binary file
|
flags/er.png
ADDED
Binary file
|
flags/es.png
ADDED
Binary file
|
flags/et.png
ADDED
Binary file
|
flags/europeanunion.png
ADDED
Binary file
|
flags/fam.png
ADDED
Binary file
|
flags/fi.png
ADDED
Binary file
|
flags/fj.png
ADDED
Binary file
|
flags/fk.png
ADDED
Binary file
|
flags/fm.png
ADDED
Binary file
|
flags/fo.png
ADDED
Binary file
|
flags/fr.png
ADDED
Binary file
|
flags/ga.png
ADDED
Binary file
|
flags/gb.png
ADDED
Binary file
|
flags/gd.png
ADDED
Binary file
|
flags/ge.png
ADDED
Binary file
|
flags/gf.png
ADDED
Binary file
|
flags/gh.png
ADDED
Binary file
|
flags/gi.png
ADDED
Binary file
|
flags/gl.png
ADDED
Binary file
|
flags/gm.png
ADDED
Binary file
|
flags/gn.png
ADDED
Binary file
|
flags/gp.png
ADDED
Binary file
|
flags/gq.png
ADDED
Binary file
|
flags/gr.png
ADDED
Binary file
|
flags/gs.png
ADDED
Binary file
|
flags/gt.png
ADDED
Binary file
|
flags/gu.png
ADDED
Binary file
|
flags/gw.png
ADDED
Binary file
|
flags/gy.png
ADDED
Binary file
|
flags/hk.png
ADDED
Binary file
|
flags/hm.png
ADDED
Binary file
|
flags/hn.png
ADDED
Binary file
|
flags/hr.png
ADDED
Binary file
|
flags/ht.png
ADDED
Binary file
|
flags/hu.png
ADDED
Binary file
|
flags/id.png
ADDED
Binary file
|
flags/ie.png
ADDED
Binary file
|
flags/il.png
ADDED
Binary file
|
flags/in.png
ADDED
Binary file
|
flags/io.png
ADDED
Binary file
|
flags/iq.png
ADDED
Binary file
|
flags/ir.png
ADDED
Binary file
|
flags/is.png
ADDED
Binary file
|
flags/it.png
ADDED
Binary file
|
flags/jm.png
ADDED
Binary file
|
flags/jo.png
ADDED
Binary file
|
flags/jp.png
ADDED
Binary file
|
flags/ke.png
ADDED
Binary file
|
flags/kg.png
ADDED
Binary file
|
flags/kh.png
ADDED
Binary file
|
flags/ki.png
ADDED
Binary file
|
flags/km.png
ADDED
Binary file
|
flags/kn.png
ADDED
Binary file
|
flags/kp.png
ADDED
Binary file
|
flags/kr.png
ADDED
Binary file
|
flags/kw.png
ADDED
Binary file
|
flags/ky.png
ADDED
Binary file
|
flags/kz.png
ADDED
Binary file
|
flags/la.png
ADDED
Binary file
|
flags/lb.png
ADDED
Binary file
|
flags/lc.png
ADDED
Binary file
|
flags/li.png
ADDED
Binary file
|
flags/lk.png
ADDED
Binary file
|
flags/lr.png
ADDED
Binary file
|
flags/ls.png
ADDED
Binary file
|
flags/lt.png
ADDED
Binary file
|
flags/lu.png
ADDED
Binary file
|
flags/lv.png
ADDED
Binary file
|
flags/ly.png
ADDED
Binary file
|
flags/ma.png
ADDED
Binary file
|
flags/mc.png
ADDED
Binary file
|
flags/md.png
ADDED
Binary file
|
flags/me.png
ADDED
Binary file
|
flags/mg.png
ADDED
Binary file
|
flags/mh.png
ADDED
Binary file
|
flags/mk.png
ADDED
Binary file
|
flags/ml.png
ADDED
Binary file
|
flags/mm.png
ADDED
Binary file
|
flags/mn.png
ADDED
Binary file
|
flags/mo.png
ADDED
Binary file
|
flags/mp.png
ADDED
Binary file
|
flags/mq.png
ADDED
Binary file
|
flags/mr.png
ADDED
Binary file
|
flags/ms.png
ADDED
Binary file
|
flags/mt.png
ADDED
Binary file
|
flags/mu.png
ADDED
Binary file
|
flags/mv.png
ADDED
Binary file
|
flags/mw.png
ADDED
Binary file
|
flags/mx.png
ADDED
Binary file
|
flags/my.png
ADDED
Binary file
|
flags/mz.png
ADDED
Binary file
|
flags/na.png
ADDED
Binary file
|
flags/nc.png
ADDED
Binary file
|
flags/ne.png
ADDED
Binary file
|
flags/nf.png
ADDED
Binary file
|
flags/ng.png
ADDED
Binary file
|
flags/ni.png
ADDED
Binary file
|
flags/nl.png
ADDED
Binary file
|
flags/no.png
ADDED
Binary file
|
flags/np.png
ADDED
Binary file
|
flags/nr.png
ADDED
Binary file
|
flags/nu.png
ADDED
Binary file
|
flags/nz.png
ADDED
Binary file
|
flags/om.png
ADDED
Binary file
|
flags/pa.png
ADDED
Binary file
|
flags/pe.png
ADDED
Binary file
|
flags/pf.png
ADDED
Binary file
|
flags/pg.png
ADDED
Binary file
|
flags/ph.png
ADDED
Binary file
|
flags/pk.png
ADDED
Binary file
|
flags/pl.png
ADDED
Binary file
|
flags/pm.png
ADDED
Binary file
|
flags/pn.png
ADDED
Binary file
|
flags/pr.png
ADDED
Binary file
|
flags/ps.png
ADDED
Binary file
|
flags/pt.png
ADDED
Binary file
|
flags/pw.png
ADDED
Binary file
|
flags/py.png
ADDED
Binary file
|
flags/qa.png
ADDED
Binary file
|
flags/re.png
ADDED
Binary file
|
flags/ro.png
ADDED
Binary file
|
flags/rs.png
ADDED
Binary file
|
flags/ru.png
ADDED
Binary file
|
flags/rw.png
ADDED
Binary file
|
flags/sa.png
ADDED
Binary file
|
flags/sb.png
ADDED
Binary file
|
flags/sc.png
ADDED
Binary file
|
flags/scotland.png
ADDED
Binary file
|
flags/sd.png
ADDED
Binary file
|
flags/se.png
ADDED
Binary file
|
flags/sg.png
ADDED
Binary file
|
flags/sh.png
ADDED
Binary file
|
flags/si.png
ADDED
Binary file
|
flags/sj.png
ADDED
Binary file
|
flags/sk.png
ADDED
Binary file
|
flags/sl.png
ADDED
Binary file
|
flags/sm.png
ADDED
Binary file
|
flags/sn.png
ADDED
Binary file
|
flags/so.png
ADDED
Binary file
|
flags/sr.png
ADDED
Binary file
|
flags/st.png
ADDED
Binary file
|
flags/sv.png
ADDED
Binary file
|
flags/sy.png
ADDED
Binary file
|
flags/sz.png
ADDED
Binary file
|
flags/tc.png
ADDED
Binary file
|
flags/td.png
ADDED
Binary file
|
flags/tf.png
ADDED
Binary file
|
flags/tg.png
ADDED
Binary file
|
flags/th.png
ADDED
Binary file
|
flags/tj.png
ADDED
Binary file
|
flags/tk.png
ADDED
Binary file
|
flags/tl.png
ADDED
Binary file
|
flags/tm.png
ADDED
Binary file
|
flags/tn.png
ADDED
Binary file
|
flags/to.png
ADDED
Binary file
|
flags/tr.png
ADDED
Binary file
|
flags/tt.png
ADDED
Binary file
|
flags/tv.png
ADDED
Binary file
|
flags/tw.png
ADDED
Binary file
|
flags/tz.png
ADDED
Binary file
|
flags/ua.png
ADDED
Binary file
|
flags/ug.png
ADDED
Binary file
|
flags/um.png
ADDED
Binary file
|
flags/us.png
ADDED
Binary file
|
flags/uy.png
ADDED
Binary file
|
flags/uz.png
ADDED
Binary file
|
flags/va.png
ADDED
Binary file
|
flags/vc.png
ADDED
Binary file
|
flags/ve.png
ADDED
Binary file
|
flags/vg.png
ADDED
Binary file
|
flags/vi.png
ADDED
Binary file
|
flags/vn.png
ADDED
Binary file
|
flags/vu.png
ADDED
Binary file
|
flags/wales.png
ADDED
Binary file
|
flags/wf.png
ADDED
Binary file
|
flags/ws.png
ADDED
Binary file
|
flags/ye.png
ADDED
Binary file
|
flags/yt.png
ADDED
Binary file
|
flags/za.png
ADDED
Binary file
|
flags/zm.png
ADDED
Binary file
|
flags/zw.png
ADDED
Binary file
|
js/overlibmws/BabelFish.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
BabelFish.js - Script for using the AltaVista BabelFish translation service.
|
3 |
+
Adapted by Foteos Macrides for use with the overlibmws code set.
|
4 |
+
See http://www.macridesweb.com/oltest/BabelFish.html for a demonstration.
|
5 |
+
Initial: October 26, 2003 - Last Revised: January 26, 2008
|
6 |
+
*/
|
7 |
+
OLtrans_en = new Image();
|
8 |
+
OLtrans_en.src = "http://babelfish.altavista.com/static/i/af/trans_en.gif"
|
9 |
+
OLtrans_en_off = new Image();
|
10 |
+
OLtrans_en_off.src = "http://babelfish.altavista.com/static/i/af/trans_en_off.gif"
|
11 |
+
|
12 |
+
var OLbfURL = location.href;
|
13 |
+
|
14 |
+
if (location.href.indexOf("babelfish.altavista.com") == -1) {
|
15 |
+
var BabelFish =
|
16 |
+
'<div class="babelfish">'
|
17 |
+
+'<p align="center"><strong>Note:</strong> This page can be viewed in a different language by '
|
18 |
+
+'selecting the corresponding flag below.</p>'
|
19 |
+
+'<p align="center">'
|
20 |
+
+'<!--script type="text/javascript" src="http://www.altavista.com/r?entr"></script-->'
|
21 |
+
+'<Map name="translate_eng">'
|
22 |
+
+'<AREA COORDS="0,1,129,38" SHAPE="rect" target="translate" '
|
23 |
+
+'title="Go to Babel Fish home page/" '
|
24 |
+
+'href="http://babelfish.altavista.com">'
|
25 |
+
+'<AREA COORDS="5,110,32,126" SHAPE="rect" target="translate" '
|
26 |
+
+'title="Translate English to Chinese." '
|
27 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_zh">'
|
28 |
+
+'<AREA COORDS="38,110,65,126" SHAPE="rect" target="translate" '
|
29 |
+
+'title="Translate English to German." '
|
30 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_de">'
|
31 |
+
+'<AREA COORDS="70,110,95,126" SHAPE="rect" target="translate" '
|
32 |
+
+'title="Translate English to Japanese." '
|
33 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_ja">'
|
34 |
+
+'<AREA COORDS="99,110,123,126" SHAPE="rect" target="translate" '
|
35 |
+
+'title="Translate English to Korean." '
|
36 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_ko">'
|
37 |
+
+'<AREA COORDS="8,130,31,146" SHAPE="rect" target="translate" '
|
38 |
+
+'title="Translate English to French." '
|
39 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_fr">'
|
40 |
+
+'<AREA COORDS="39,130,65,146" SHAPE="rect" target="translate" '
|
41 |
+
+'title="Translate English to Italian." '
|
42 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_it">'
|
43 |
+
+'<AREA COORDS="70,130,93,146" SHAPE="rect" target="translate" '
|
44 |
+
+'title="Translate English to Portuguese." '
|
45 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_pt">'
|
46 |
+
+'<AREA COORDS="100,130,125,146" SHAPE="rect" target="translate" '
|
47 |
+
+'title="Translate English to Spanish." '
|
48 |
+
+'href="http://babelfish.altavista.com/babelfish/tr?doit=done&url='+OLbfURL+'&lp=en_es">'
|
49 |
+
+'</Map>'
|
50 |
+
+'<img src="http://babelfish.altavista.com/static/i/af/trans_en.gif" '
|
51 |
+
+'width="131" height="156" usemap="#translate_eng" border="0"><br></p>'
|
52 |
+
+'<p align="center">The translations are done via the AltaVista Babel Fish service.</p></div>';
|
53 |
+
}else{
|
54 |
+
var BabelFish =
|
55 |
+
'<div class="babelfish"><p align="center">'
|
56 |
+
+'<img src="http://babelfish.altavista.com/static/i/af/trans_en_off.gif" '
|
57 |
+
+'width="131" height="156" border="0"></p></div>';
|
58 |
+
}
|
js/overlibmws/ajaxcontentmws.js
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
ajaxcontentmws.js - Foteos Macrides (author and Copyright holder)
|
3 |
+
Initial: June 22, 2006 - Last Revised: March 24, 2008
|
4 |
+
Wrapper function set for getting and using the responseText and / or
|
5 |
+
responseXML from a GET or POST XMLHttpRequest, which can be used to
|
6 |
+
generate dynamic content for overlib or overlib2 calls, or to modify
|
7 |
+
the content of a displayed STICKY popup dynamically.
|
8 |
+
|
9 |
+
For GET Use:
|
10 |
+
onmouseover="return OLgetAJAX(url, command, delay, css);"
|
11 |
+
onmouseout="OLclearAJAX();" (if delay > 0)
|
12 |
+
or:
|
13 |
+
onclick="OLgetAJAX(url, command, 0, css); return false;"
|
14 |
+
or:
|
15 |
+
onload="OLgetAJAX(url, command, 0, css);
|
16 |
+
|
17 |
+
Where:
|
18 |
+
url (required)
|
19 |
+
is a quoted string, or unquoted string variable name or array entry, with
|
20 |
+
the full, relative, or partial URL for a file or a server-side script (php,
|
21 |
+
asp, or cgi, e.g. perl), and may have a query string appended (e.g.,
|
22 |
+
'http://my.domain.com/scripts/myScript.php?foo=bar&life=grand').
|
23 |
+
And:
|
24 |
+
command (required)
|
25 |
+
is the function reference (unquoted name without parens) of a function to
|
26 |
+
be called when the server's response has been received (it could instead be
|
27 |
+
an inline function, i.e., defined within the 2nd argument, or a quoted string
|
28 |
+
for a function with parens and any args)
|
29 |
+
And:
|
30 |
+
delay (may be omitted unless css is included)
|
31 |
+
is an unquoted number indicating the number of millisecs to wait before
|
32 |
+
initiating an XMLHttpRequest GET request. It should be 0 when using onclick
|
33 |
+
or onload, but may be a modest value such as 300 for onmouseover to avoid
|
34 |
+
any chatter of requests. When used with onmouseover, include:
|
35 |
+
onmouseout="OLclearAJAX();"
|
36 |
+
to clear the request if the user does not hover for at least that long. If
|
37 |
+
the popup is not STICKY, include an nd or nd2 call, e.g.,
|
38 |
+
onmouseout="OLclearAJAX(); nd();"
|
39 |
+
And:
|
40 |
+
css (may be omitted)
|
41 |
+
is a quoted string with the CSS class (e.g. 'ovfl510' for
|
42 |
+
.ovfl510 {width:510px; height:145px; overflow:auto; ...} ) for a div to
|
43 |
+
encase the responseText and set the width, height and scrollbars in the
|
44 |
+
main text area of the popup, or the unquoted number 0 if no encasing div
|
45 |
+
is to be used.
|
46 |
+
|
47 |
+
For POST substitute OLpostAJAX(url, qry, command, delay, css);
|
48 |
+
Where
|
49 |
+
qry (required)
|
50 |
+
is the string to be posted, typically a query string (without a lead ?)
|
51 |
+
and the other arguments are as above.
|
52 |
+
|
53 |
+
See http://www.macridesweb.com/oltest/AJAX.html for more information.
|
54 |
+
*/
|
55 |
+
|
56 |
+
// Initialize our global variables for this function set.
|
57 |
+
var OLhttp=false,OLcommandAJAX=null,OLdelayidAJAX=0,OLclassAJAX='',
|
58 |
+
OLresponseAJAX='',OLabortAJAX=0,OLdebugAJAX=0;
|
59 |
+
|
60 |
+
// Create a series of wrapper functions (e.g. OLcmdT#() for ones which
|
61 |
+
// use OLhttp.responseText via the OLresponseAJAX global, and OLcmdX#()
|
62 |
+
// for ones which use OLhttp.responseXML) whose reference (unquoted name
|
63 |
+
// without parens) is the 2nd argument in OLgetAJAX(url,command,delay,css)
|
64 |
+
// calls. This one is for the first example in the AJAX.html support
|
65 |
+
// document, to use the OLresponseAJAX global as the lead argument for an
|
66 |
+
// overlib popup. Put your functions in the head, or in another imported
|
67 |
+
// .js file, so that they will not be affected by updates of this .js file.
|
68 |
+
//
|
69 |
+
function OLcmdExT1() {
|
70 |
+
return overlib(OLresponseAJAX, TEXTPADDING,0, CAPTIONPADDING,4,
|
71 |
+
CAPTION,'Example with AJAX content via <span '
|
72 |
+
+'class="yellow">responseText</span>. Popup scrolls with the window.',
|
73 |
+
WRAP, BORDER,2, STICKY, CLOSECLICK, SCROLL,
|
74 |
+
MIDX,0, RELY,100,
|
75 |
+
STATUS,'Example with AJAX content via responseText of XMLHttpResponse');
|
76 |
+
}
|
77 |
+
|
78 |
+
// Alert for old browsers which lack XMLHttpRequest support.
|
79 |
+
function OLsorryAJAX() {
|
80 |
+
alert('Sorry, AJAX is not supported by your browser.');
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
// Check 2nd arg for function
|
85 |
+
function OLchkFuncAJAX(ar){
|
86 |
+
var t=typeof ar;return (((t=='function'))||((t=='string')&&(/.+\(.*\)/.test(ar))));
|
87 |
+
}
|
88 |
+
|
89 |
+
// Alert for bad 2nd argument
|
90 |
+
function OLnotFuncAJAX(m) {
|
91 |
+
if(over)cClick();
|
92 |
+
alert('The 2nd arg of OL'+m+'AJAX is not a function reference, nor an inline function, '
|
93 |
+
+'nor a quoted string with a function indicated.');
|
94 |
+
return OLclearAJAX();
|
95 |
+
}
|
96 |
+
|
97 |
+
// Alert for indicating an XMLHttpRequest network error.
|
98 |
+
function OLerrorAJAX() {
|
99 |
+
if(OLhttp.status&&OLhttp.status!=2147746065)alert('Network error '+OLhttp.status+'. Try again later.');
|
100 |
+
return false;
|
101 |
+
}
|
102 |
+
|
103 |
+
// Returns a new XMLHttpRequest object, or false for older browsers
|
104 |
+
// which did not yet support it. Called as OLhttp=OLnewXMLHttp() via
|
105 |
+
// the OLgetAJAX(url,command,delay,css) wrapper function.
|
106 |
+
//
|
107 |
+
function OLnewXMLHttp() {
|
108 |
+
var f=false,req=f;
|
109 |
+
if(window.XMLHttpRequest)eval(new Array('try{',
|
110 |
+
'req=new XMLHttpRequest();','}catch(e){','req=f;','}').join('\n'));
|
111 |
+
/*@cc_on @if(@_jscript_version>=5)if(!req)
|
112 |
+
eval(new Array('try{','req=new ActiveXObject("Msxml2.XMLHTTP");',
|
113 |
+
'}catch(e){','try{','req=new ActiveXObject("Microsoft.XMLHTTP");',
|
114 |
+
'}catch(e){','req=f;','}}').join('\n')); @end @*/
|
115 |
+
return req;
|
116 |
+
}
|
117 |
+
|
118 |
+
// Handle the OLhttp.responseText string from the XMLHttpRequest object.
|
119 |
+
function OLdoAJAX() {
|
120 |
+
if(OLhttp.readyState==4){
|
121 |
+
if(OLdebugAJAX)alert(
|
122 |
+
'OLhttp.status = '+OLhttp.status+'\n'
|
123 |
+
+'OLhttp.statusText = '+OLhttp.statusText+'\n'
|
124 |
+
+'OLhttp.getAllResponseHeaders() = \n'
|
125 |
+
+OLhttp.getAllResponseHeaders()+'\n'
|
126 |
+
+'OLhttp.getResponseHeader("Content-Type") = '
|
127 |
+
+OLhttp.getResponseHeader("Content-Type")+'\n');
|
128 |
+
if(OLhttp.status==200||(OLhttp.status==0&&!OLabortAJAX&&!OLie55)){
|
129 |
+
OLresponseAJAX=OLclassAJAX?'<div class="'+OLclassAJAX+'">':'';
|
130 |
+
OLresponseAJAX += OLhttp.responseText;
|
131 |
+
OLresponseAJAX += OLclassAJAX?'</div>':'';
|
132 |
+
if(OLdebugAJAX)alert('OLresponseAJAX = \n'+OLresponseAJAX);
|
133 |
+
OLclassAJAX=0;
|
134 |
+
return (typeof OLcommandAJAX=='string')?eval(OLcommandAJAX):OLcommandAJAX();
|
135 |
+
}else{
|
136 |
+
OLclassAJAX=0;
|
137 |
+
OLabortAJAX=0;
|
138 |
+
return OLerrorAJAX();
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
// Actually make the request initiated via OLgetAJAX or OLpostAJAX, or
|
144 |
+
// invoke a "permission denied" alert if a cross-domain URL was used.
|
145 |
+
function OLsetAJAX(url,qry) {
|
146 |
+
if(window.location.protocol.indexOf('http')==0&&
|
147 |
+
(url.indexOf('file:')==0||url.indexOf('ftp:')==0)){
|
148 |
+
alert('[object Error]\n(Cross-domain access not permitted)');return false;}
|
149 |
+
qry=(qry||null);var s='',m=(qry)?'POST':'GET';OLabortAJAX=0;
|
150 |
+
OLdelayidAJAX=0;eval(new Array('try{','OLhttp.open(m,url,true);',
|
151 |
+
'}catch(e){','s=e','OLhttp=false;','}').join('\n'));if(!OLhttp){
|
152 |
+
alert(s+'\n(Cross-domain access not permitted)');return false;}if(qry)
|
153 |
+
OLhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
|
154 |
+
OLhttp.onreadystatechange=OLdoAJAX;
|
155 |
+
OLhttp.send(qry);
|
156 |
+
}
|
157 |
+
|
158 |
+
// Clear or abort any delayed OLsetAJAX call or pending request.
|
159 |
+
function OLclearAJAX() {
|
160 |
+
if(OLdelayidAJAX){clearTimeout(OLdelayidAJAX);OLdelayidAJAX=0;}
|
161 |
+
if(OLhttp&&!OLdebugAJAX){OLabortAJAX=1;OLhttp.abort();}
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
|
165 |
+
// Load a new XMLHttpRequest object into the OLhttp global, load the
|
166 |
+
// OLcommandAJAX and OLclassAJAX globals, and initiate a GET request
|
167 |
+
// via OLsetAJAX(url) to populate OLhttp.
|
168 |
+
function OLgetAJAX(url,command,delay,css) {
|
169 |
+
if(!OLchkFuncAJAX(command))return OLnotFuncAJAX('get');
|
170 |
+
OLclearAJAX();OLhttp=OLnewXMLHttp();if(!OLhttp)return OLsorryAJAX();
|
171 |
+
OLcommandAJAX=command;delay=(delay||0);css=(css||0);OLclassAJAX=css;
|
172 |
+
if(delay)OLdelayidAJAX=setTimeout("OLsetAJAX('"+url+"')",delay);
|
173 |
+
else OLsetAJAX(url);
|
174 |
+
}
|
175 |
+
|
176 |
+
// Load a new XMLHttpRequest object into the OLhttp global, load the
|
177 |
+
// OLcommandAJAX and OLclassAJAX globals, and initiate a POST request
|
178 |
+
// via OLsetAJAX(url,qry) to populate OLhttp.
|
179 |
+
function OLpostAJAX(url,qry,command,delay,css) {
|
180 |
+
if(!OLchkFuncAJAX(command))return OLnotFuncAJAX('post');
|
181 |
+
OLclearAJAX();OLhttp=OLnewXMLHttp();if(!OLhttp)return OLsorryAJAX();
|
182 |
+
qry=(qry||0);OLcommandAJAX=command;delay=(delay||0);css=(css||0);OLclassAJAX=css;
|
183 |
+
if(delay)OLdelayidAJAX=setTimeout("OLsetAJAX('"+url+"','"+qry+"')",delay);
|
184 |
+
else OLsetAJAX(url,qry);
|
185 |
+
}
|
js/overlibmws/arrow.gif
ADDED
Binary file
|
js/overlibmws/calendarmws.js
ADDED
@@ -0,0 +1,624 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
calendarmws.js - Script for generating calender popups and selecting dates for form
|
3 |
+
submissions. See http://www.macridesweb.com/oltest/calendarmws.html for a demonstration.
|
4 |
+
Initial: November 9, 2003 - Last Revised: June 11, 2008
|
5 |
+
|
6 |
+
****
|
7 |
+
Original: Kedar R. Bhave (softricks@hotmail.com)
|
8 |
+
Web Site: http://www.softricks.com
|
9 |
+
(uses window popups)
|
10 |
+
|
11 |
+
Modifications and customizations to work with the overLIB v3.50
|
12 |
+
Author: James B. O'Connor (joconnor@nordenterprises.com)
|
13 |
+
Web Site: http://www.nordenterprises.com
|
14 |
+
Developed for use with http://home-owners-assoc.com
|
15 |
+
Note: while overlib works fine with Netscape 4, this function does not work very
|
16 |
+
well, since portions of the "over" div end up under other fields on the form and
|
17 |
+
cannot be seen. If you want to use this with NS4, you'll need to change the
|
18 |
+
positioning in the overlib() call to make sure the "over" div gets positioned
|
19 |
+
away from all other form fields
|
20 |
+
The O'Connor script and many more are available free online at:
|
21 |
+
The JavaScript Source!! http://javascript.internet.com
|
22 |
+
|
23 |
+
Further modifications made by Foteos Macrides (http://www.macridesweb.com/oltest/)
|
24 |
+
and Bill McCormick (wpmccormick@freeshell.org) for overlibmws
|
25 |
+
*/
|
26 |
+
|
27 |
+
var ggPosX = -1;
|
28 |
+
var ggPosY = -1;
|
29 |
+
var ggInactive = 0;
|
30 |
+
var ggOnChange = null;
|
31 |
+
var ggUseOverlib2 = 0;
|
32 |
+
|
33 |
+
var ggWinContent = "";
|
34 |
+
|
35 |
+
var weekend = [0,6];
|
36 |
+
var weekendColor = "#e0e0e0";
|
37 |
+
var fontface = "Verdana";
|
38 |
+
var fontsize = 8; // in "pt" units; used with "font-size" style element
|
39 |
+
|
40 |
+
var gNow = new Date();
|
41 |
+
|
42 |
+
Calendar.Months = ["January", "February", "March", "April", "May", "June",
|
43 |
+
"July", "August", "September", "October", "November", "December"];
|
44 |
+
|
45 |
+
// Non-Leap year Month days..
|
46 |
+
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
47 |
+
// Leap year Month days..
|
48 |
+
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
49 |
+
|
50 |
+
function Calendar(p_item, p_month, p_year, p_format) {
|
51 |
+
if ((p_month == null) && (p_year == null)) return;
|
52 |
+
|
53 |
+
if (p_month == null) {
|
54 |
+
this.gMonthName = null;
|
55 |
+
this.gMonth = null;
|
56 |
+
this.gYearly = true;
|
57 |
+
} else {
|
58 |
+
this.gMonthName = Calendar.get_month(p_month);
|
59 |
+
this.gMonth = new Number(p_month);
|
60 |
+
this.gYearly = false;
|
61 |
+
}
|
62 |
+
|
63 |
+
this.gYear = p_year;
|
64 |
+
this.gFormat = p_format;
|
65 |
+
this.gBGColor = "white";
|
66 |
+
this.gFGColor = "black";
|
67 |
+
this.gTextColor = "black";
|
68 |
+
this.gHeaderColor = "black";
|
69 |
+
this.gReturnItem = p_item;
|
70 |
+
}
|
71 |
+
|
72 |
+
Calendar.get_month = Calendar_get_month;
|
73 |
+
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
|
74 |
+
Calendar.calc_month_year = Calendar_calc_month_year;
|
75 |
+
|
76 |
+
function Calendar_get_month(monthNo) {
|
77 |
+
return Calendar.Months[monthNo];
|
78 |
+
}
|
79 |
+
|
80 |
+
function Calendar_get_daysofmonth(monthNo, p_year) {
|
81 |
+
/*
|
82 |
+
Check for leap year ..
|
83 |
+
1.Years evenly divisible by four are normally leap years, except for...
|
84 |
+
2.Years also evenly divisible by 100 are not leap years, except for...
|
85 |
+
3.Years also evenly divisible by 400 are leap years.
|
86 |
+
*/
|
87 |
+
if ((p_year % 4) == 0) {
|
88 |
+
if ((p_year % 100) == 0 && (p_year % 400) != 0)
|
89 |
+
return Calendar.DOMonth[monthNo];
|
90 |
+
|
91 |
+
return Calendar.lDOMonth[monthNo];
|
92 |
+
} else
|
93 |
+
return Calendar.DOMonth[monthNo];
|
94 |
+
}
|
95 |
+
|
96 |
+
function Calendar_calc_month_year(p_Month, p_Year, incr) {
|
97 |
+
/*
|
98 |
+
Will return an 1-D array with 1st element being the calculated month
|
99 |
+
and second being the calculated year
|
100 |
+
after applying the month increment/decrement as specified by 'incr' parameter.
|
101 |
+
'incr' will normally have 1/-1 to navigate thru the months.
|
102 |
+
*/
|
103 |
+
var ret_arr = new Array();
|
104 |
+
|
105 |
+
if (incr == -1) {
|
106 |
+
// B A C K W A R D
|
107 |
+
if (p_Month == 0) {
|
108 |
+
ret_arr[0] = 11;
|
109 |
+
ret_arr[1] = parseInt(p_Year) - 1;
|
110 |
+
} else {
|
111 |
+
ret_arr[0] = parseInt(p_Month) - 1;
|
112 |
+
ret_arr[1] = parseInt(p_Year);
|
113 |
+
}
|
114 |
+
} else if (incr == 1) {
|
115 |
+
// F O R W A R D
|
116 |
+
if (p_Month == 11) {
|
117 |
+
ret_arr[0] = 0;
|
118 |
+
ret_arr[1] = parseInt(p_Year) + 1;
|
119 |
+
} else {
|
120 |
+
ret_arr[0] = parseInt(p_Month) + 1;
|
121 |
+
ret_arr[1] = parseInt(p_Year);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
return ret_arr;
|
125 |
+
}
|
126 |
+
|
127 |
+
function Calendar_calc_month_year(p_Month, p_Year, incr) {
|
128 |
+
/*
|
129 |
+
Will return an 1-D array with 1st element being the calculated month
|
130 |
+
and second being the calculated year
|
131 |
+
after applying the month increment/decrement as specified by 'incr' parameter.
|
132 |
+
'incr' will normally have 1/-1 to navigate thru the months.
|
133 |
+
*/
|
134 |
+
var ret_arr = new Array();
|
135 |
+
|
136 |
+
if (incr == -1) {
|
137 |
+
// B A C K W A R D
|
138 |
+
if (p_Month == 0) {
|
139 |
+
ret_arr[0] = 11;
|
140 |
+
ret_arr[1] = parseInt(p_Year) - 1;
|
141 |
+
} else {
|
142 |
+
ret_arr[0] = parseInt(p_Month) - 1;
|
143 |
+
ret_arr[1] = parseInt(p_Year);
|
144 |
+
}
|
145 |
+
} else if (incr == 1) {
|
146 |
+
// F O R W A R D
|
147 |
+
if (p_Month == 11) {
|
148 |
+
ret_arr[0] = 0;
|
149 |
+
ret_arr[1] = parseInt(p_Year) + 1;
|
150 |
+
} else {
|
151 |
+
ret_arr[0] = parseInt(p_Month) + 1;
|
152 |
+
ret_arr[1] = parseInt(p_Year);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
return ret_arr;
|
156 |
+
}
|
157 |
+
|
158 |
+
// This is for compatibility with Navigator 3, we have to create and discard one object
|
159 |
+
// before the prototype object exists.
|
160 |
+
new Calendar();
|
161 |
+
|
162 |
+
Calendar.prototype.getMonthlyCalendarCode = function() {
|
163 |
+
var vCode = "";
|
164 |
+
var vHeader_Code = "";
|
165 |
+
var vData_Code = "";
|
166 |
+
|
167 |
+
// Begin Table Drawing code here..
|
168 |
+
vCode += ('<div align="center"><table border="1" bgcolor="' + this.gBGColor +
|
169 |
+
"\" style='font-size:" + fontsize + "pt;'>");
|
170 |
+
|
171 |
+
vHeader_Code = this.cal_header();
|
172 |
+
vData_Code = this.cal_data();
|
173 |
+
vCode += (vHeader_Code + vData_Code);
|
174 |
+
|
175 |
+
vCode += '</table></div>';
|
176 |
+
|
177 |
+
return vCode;
|
178 |
+
}
|
179 |
+
|
180 |
+
Calendar.prototype.show = function() {
|
181 |
+
var vCode = "";
|
182 |
+
|
183 |
+
var vDate = new Date();
|
184 |
+
vDate.setMonth(this.gMonth);
|
185 |
+
vDate.setFullYear(this.gYear);
|
186 |
+
var vNowMonth = gNow.getMonth();
|
187 |
+
var vNowYear = gNow.getFullYear();
|
188 |
+
var yOK=!ggInactive||vNowYear<vDate.getFullYear()?1:0;
|
189 |
+
var mOK=!ggInactive||(yOK||
|
190 |
+
(vNowYear<=vDate.getFullYear()&&vNowMonth<vDate.getMonth()))?1:0;
|
191 |
+
|
192 |
+
// build content into global var ggWinContent
|
193 |
+
ggWinContent += ('<div style="font-family:\'' + fontface + '\';font-weight:bold;'
|
194 |
+
+'font-size:' + fontsize + 'pt;text-align:center;">');
|
195 |
+
ggWinContent += (this.gMonthName + ' ' + this.gYear);
|
196 |
+
ggWinContent += '</div>';
|
197 |
+
|
198 |
+
// Show navigation buttons
|
199 |
+
var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
|
200 |
+
var prevMM = prevMMYYYY[0];
|
201 |
+
var prevYYYY = prevMMYYYY[1];
|
202 |
+
|
203 |
+
var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
|
204 |
+
var nextMM = nextMMYYYY[0];
|
205 |
+
var nextYYYY = nextMMYYYY[1];
|
206 |
+
|
207 |
+
ggWinContent += ('<table width="100%" border="1" cellspacing="0" cellpadding="0" '
|
208 |
+
+'bgcolor="#e0e0e0" style="font-size:' + fontsize
|
209 |
+
+'pt;"><tr><td align="center">');
|
210 |
+
ggWinContent += ('['
|
211 |
+
+(yOK?'<a href="javascript:void(0);" '
|
212 |
+
+'title="Go back one year" '
|
213 |
+
+'onmouseover="window.status=\'Go back one year\'; return true;" '
|
214 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
215 |
+
+'onclick="Build(\'' + this.gReturnItem + '\', \'' + this.gMonth + '\', \''
|
216 |
+
+(parseInt(this.gYear)-1) + '\', \'' + this.gFormat + '\');"'
|
217 |
+
+'>':'')
|
218 |
+
+'<<Year'
|
219 |
+
+(yOK?'</a>':'')
|
220 |
+
+']</td><td align="center">');
|
221 |
+
ggWinContent += ('['
|
222 |
+
+(mOK?'<a href="javascript:void(0);" '
|
223 |
+
+'title="Go back one month" '
|
224 |
+
+'onmouseover="window.status=\'Go back one month\'; return true;" '
|
225 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
226 |
+
+'onclick="Build(\'' + this.gReturnItem + '\', \'' + prevMM + '\', \''
|
227 |
+
+prevYYYY + '\', \'' + this.gFormat + '\');"'
|
228 |
+
+'>':'')
|
229 |
+
+'<Mon'
|
230 |
+
+(mOK?'</a>':'')
|
231 |
+
+']</td><td align="center">');
|
232 |
+
ggWinContent += ' </td><td align="center">';
|
233 |
+
ggWinContent += ('[<a href="javascript:void(0);" '
|
234 |
+
+'title="Go forward one month" '
|
235 |
+
+'onmouseover="window.status=\'Go forward one month\'; return true;" '
|
236 |
+
+'onmouseput="window.status=\'\'; return true;" '
|
237 |
+
+'onclick="Build(\'' + this.gReturnItem + '\', \'' + nextMM + '\', \''
|
238 |
+
+nextYYYY + '\', \'' + this.gFormat + '\');"'
|
239 |
+
+'>Mon></a>]</td><td align="center">');
|
240 |
+
ggWinContent += ('[<a href="javascript:void(0);" '
|
241 |
+
+'title="Go forward one year" '
|
242 |
+
+'onmouseover="window.status=\'Go forward one year\'; return true;" '
|
243 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
244 |
+
+'onClick="Build(\'' + this.gReturnItem + '\', \'' + this.gMonth + '\', \''
|
245 |
+
+(parseInt(this.gYear)+1) + '\', \'' + this.gFormat + '\');"'
|
246 |
+
+'>Year>></a>]</td></tr></table><div style="font-size:3px;">'
|
247 |
+
+' </div>');
|
248 |
+
|
249 |
+
// Get the complete calendar code for the month, and add it to the content var
|
250 |
+
vCode = this.getMonthlyCalendarCode();
|
251 |
+
ggWinContent += vCode;
|
252 |
+
}
|
253 |
+
|
254 |
+
Calendar.prototype.showY = function() {
|
255 |
+
var vCode = "";
|
256 |
+
var i;
|
257 |
+
|
258 |
+
ggWinContent += ('<div style="font-family:\'' + fontface + '\';font-weight:bold;'
|
259 |
+
+'font-size:' + (fontsize+1) +'pt;text-align:center;">' + this.gYear +'</div>');
|
260 |
+
|
261 |
+
var vDate = new Date();
|
262 |
+
vDate.setDate(1);
|
263 |
+
vDate.setFullYear(this.gYear);
|
264 |
+
var vNowYear = gNow.getFullYear();
|
265 |
+
var yOK=!ggInactive||vNowYear<vDate.getFullYear()?1:0;
|
266 |
+
|
267 |
+
// Show navigation buttons
|
268 |
+
var prevYYYY = parseInt(this.gYear) - 1;
|
269 |
+
var nextYYYY = parseInt(this.gYear) + 1;
|
270 |
+
|
271 |
+
ggWinContent += ('<table width="100%" border="1" cellspacing="0" cellpadding="0" '
|
272 |
+
+'bgcolor="#e0e0e0" style="font-size:' + fontsize + 'pt;"><tr><td '
|
273 |
+
+'align="center">');
|
274 |
+
ggWinContent += ('['
|
275 |
+
+(yOK?'<a href="javascript:void(0);" '
|
276 |
+
+'title="Go back one year" '
|
277 |
+
+'onmouseover="window.status=\'Go back one year\'; return true;" '
|
278 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
279 |
+
+'onclick="Build(\'' + this.gReturnItem + '\', null, \'' + prevYYYY + '\', \''
|
280 |
+
+this.gFormat + '\');">':'')
|
281 |
+
+'<<Year'
|
282 |
+
+(yOK?'<a>':'')
|
283 |
+
+']</td><td align="center">');
|
284 |
+
ggWinContent += ' </td><td align="center">';
|
285 |
+
ggWinContent += ('[<a href="javascript:void(0);" '
|
286 |
+
+'title="Go forward one year" '
|
287 |
+
+'onmouseover="window.status=\'Go forward one year\'; return true;" '
|
288 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
289 |
+
+'onclick="Build(\'' + this.gReturnItem + '\', null, \'' + nextYYYY + '\', \''
|
290 |
+
+this.gFormat + '\');">Year>></a>]</td></tr></table>');
|
291 |
+
|
292 |
+
// Get the complete calendar code for each month.
|
293 |
+
// start a table and first row in the table
|
294 |
+
ggWinContent += ('<table width="100%" border="0" cellspacing="0" cellpadding="2" '
|
295 |
+
+'style="font-size:' + fontsize + 'pt;"><tr>');
|
296 |
+
for (i=0; i<12; i++) {
|
297 |
+
// start the table cell
|
298 |
+
ggWinContent += '<td align="center" valign="top">';
|
299 |
+
this.gMonth = i;
|
300 |
+
this.gMonthName = Calendar.get_month(this.gMonth);
|
301 |
+
vCode = this.getMonthlyCalendarCode();
|
302 |
+
ggWinContent += (this.gMonthName + '/' + this.gYear + '<div '
|
303 |
+
+'style="font-size:2px;"> </div>');
|
304 |
+
ggWinContent += vCode;
|
305 |
+
ggWinContent += '</td>';
|
306 |
+
if (i == 3 || i == 7) ggWinContent += '</tr><tr>';
|
307 |
+
}
|
308 |
+
ggWinContent += '</tr></table>';
|
309 |
+
}
|
310 |
+
|
311 |
+
Calendar.prototype.cal_header = function() {
|
312 |
+
var vCode = '<tr>';
|
313 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
314 |
+
+this.gHeaderColor + ';font-weight:bold;">Sun</td>');
|
315 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
316 |
+
+this.gHeaderColor + ';font-weight:bold;">Mon</td>');
|
317 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
318 |
+
+this.gHeaderColor + ';font-weight:bold;">Tue</td>');
|
319 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
320 |
+
+this.gHeaderColor + ';font-weight:bold;">Wed</td>');
|
321 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
322 |
+
+this.gHeaderColor + ';font-weight:bold;">Thu</td>');
|
323 |
+
vCode += ('<td width="14%" style="font-family:' + fontface + ';color:'
|
324 |
+
+this.gHeaderColor + ';font-weight:bold;">Fri</td>');
|
325 |
+
vCode += ('<td width="16%" style="font-family:' + fontface + ';color:'
|
326 |
+
+this.gHeaderColor + ';font-weight:bold;">Sat</td>');
|
327 |
+
vCode += '</tr>';
|
328 |
+
return vCode;
|
329 |
+
}
|
330 |
+
|
331 |
+
Calendar.prototype.cal_data = function() {
|
332 |
+
var vDate = new Date();
|
333 |
+
vDate.setDate(1);
|
334 |
+
vDate.setMonth(this.gMonth);
|
335 |
+
vDate.setFullYear(this.gYear);
|
336 |
+
|
337 |
+
var vNowDay = gNow.getDate();
|
338 |
+
var vNowMonth = gNow.getMonth();
|
339 |
+
var vNowYear = gNow.getFullYear();
|
340 |
+
|
341 |
+
var yOK=!ggInactive||vNowYear<=vDate.getFullYear()?1:0;
|
342 |
+
var mOK=!ggInactive||vNowYear<vDate.getFullYear()||
|
343 |
+
(vNowYear==vDate.getFullYear()&&vNowMonth<=vDate.getMonth())?1:0;
|
344 |
+
var ymOK=yOK&&mOK?1:0;
|
345 |
+
var dOK=!ggInactive||vNowYear<vDate.getFullYear()||vNowMonth<vDate.getMonth()?1:0;
|
346 |
+
|
347 |
+
var vFirstDay=vDate.getDay();
|
348 |
+
var vDay=1;
|
349 |
+
var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
|
350 |
+
var vOnLastDay=0;
|
351 |
+
var vCode = '<tr>';
|
352 |
+
var i,j,k,m;
|
353 |
+
var orig = eval("document." + this.gReturnItem + ".value").toString();
|
354 |
+
/*
|
355 |
+
Get day for the 1st of the requested month/year..
|
356 |
+
Place as many blank cells before the 1st day of the month as necessary.
|
357 |
+
*/
|
358 |
+
for (i=0; i<vFirstDay; i++) { vCode +=
|
359 |
+
('<td width="14%"' + this.write_weekend_string(i)
|
360 |
+
+'style="font-family:\'' + fontface + '\';text-align:center;"> </td>');
|
361 |
+
}
|
362 |
+
|
363 |
+
// Write rest of the 1st week
|
364 |
+
for (j=vFirstDay; j<7; j++) { vCode +=
|
365 |
+
('<td width="14%"' + this.write_weekend_string(j) +'style="font-family:\''
|
366 |
+
+ fontface + '\';text-align:center;">'
|
367 |
+
+((ymOK)&&(vDay>=vNowDay||dOK)?'<a href="javascript:void(0);" '
|
368 |
+
+'title="set date to ' + this.format_data(vDay) + '" '
|
369 |
+
+'onmouseover="window.status=\'set date to ' + this.format_data(vDay) + '\'; '
|
370 |
+
+'return true;" '
|
371 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
372 |
+
+'onclick="document.' + this.gReturnItem + '.value=\'' + this.format_data(vDay)
|
373 |
+
+'\';ggPosX= -1;ggPosY= -1;' + OLfnRef + (ggUseOverlib2?'cClick2();':'cClick();')
|
374 |
+
+'if((ggOnChange)&&(document.' + this.gReturnItem + '.value!=\'' + orig
|
375 |
+
+'\'))ggOnChange();">':'')
|
376 |
+
+ this.format_day(vDay)
|
377 |
+
+((ymOK)&&(vDay>=vNowDay||dOK)?'</a>':'')
|
378 |
+
+'</td>');
|
379 |
+
vDay += 1;
|
380 |
+
}
|
381 |
+
vCode += '</tr>';
|
382 |
+
|
383 |
+
// Write the rest of the weeks
|
384 |
+
for (k=2; k<7; k++) {
|
385 |
+
vCode += '<tr>';
|
386 |
+
for (j=0; j<7; j++) { vCode +=
|
387 |
+
('<td width="14%"' + this.write_weekend_string(j)
|
388 |
+
+'style="font-family:\'' + fontface + '\';text-align:center;">'
|
389 |
+
+((ymOK)&&(vDay>=vNowDay||dOK)?'<a '
|
390 |
+
+'href="javascript:void(0);" '
|
391 |
+
+'title="set date to ' + this.format_data(vDay) + '" '
|
392 |
+
+'onmouseover="window.status=\'set date to ' + this.format_data(vDay)
|
393 |
+
+'\'; return true;" '
|
394 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
395 |
+
+'onclick="document.' + this.gReturnItem + '.value=\''
|
396 |
+
+ this.format_data(vDay) + '\';ggPosX= -1;ggPosY= -1;'
|
397 |
+
+ OLfnRef + (ggUseOverlib2?'cClick2();':'cClick();')
|
398 |
+
+'if((ggOnChange)&&(document.' + this.gReturnItem + '.value!=\''
|
399 |
+
+orig + '\'))ggOnChange();">':'')
|
400 |
+
+ this.format_day(vDay)
|
401 |
+
+((ymOK)&&(vDay>=vNowDay||dOK)?'</a>':'')
|
402 |
+
+'</td>');
|
403 |
+
vDay += 1;
|
404 |
+
if (vDay > vLastDay) {
|
405 |
+
vOnLastDay = 1;
|
406 |
+
break;
|
407 |
+
}
|
408 |
+
}
|
409 |
+
if (j == 6) vCode += '</tr>';
|
410 |
+
if (vOnLastDay == 1) break;
|
411 |
+
}
|
412 |
+
|
413 |
+
// Fill up the rest of last week with proper blanks, so that we get proper square blocks
|
414 |
+
for (m=1; m<(7-j); m++) { vCode +=
|
415 |
+
('<td width="14%"' + this.write_weekend_string(j+m) + 'style="font-family:\''
|
416 |
+
+ fontface + '\';color:gray;text-align:center;"> </td>');
|
417 |
+
}
|
418 |
+
return vCode;
|
419 |
+
}
|
420 |
+
|
421 |
+
Calendar.prototype.format_day = function(vday) {
|
422 |
+
var vNowDay = gNow.getDate();
|
423 |
+
var vNowMonth = gNow.getMonth();
|
424 |
+
var vNowYear = gNow.getFullYear();
|
425 |
+
|
426 |
+
if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
|
427 |
+
return ('<span style="color:red;font-weight:bold;">' + vday + '</span>');
|
428 |
+
else
|
429 |
+
return (vday);
|
430 |
+
}
|
431 |
+
|
432 |
+
Calendar.prototype.write_weekend_string = function(vday) {
|
433 |
+
var i;
|
434 |
+
|
435 |
+
// Return special formatting for the weekend day.
|
436 |
+
for (i=0; i<weekend.length; i++) {
|
437 |
+
if (vday == weekend[i])
|
438 |
+
return (' bgcolor="' + weekendColor + '"');
|
439 |
+
}
|
440 |
+
|
441 |
+
return "";
|
442 |
+
}
|
443 |
+
|
444 |
+
Calendar.prototype.format_data = function(p_day) {
|
445 |
+
var vData;
|
446 |
+
var vMonth = 1 + this.gMonth;
|
447 |
+
vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
|
448 |
+
var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
|
449 |
+
var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
|
450 |
+
var vY4 = new String(this.gYear);
|
451 |
+
var vY2 = new String(this.gYear.substr(2,2));
|
452 |
+
var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;
|
453 |
+
|
454 |
+
switch (this.gFormat) {
|
455 |
+
case "MM\/DD\/YYYY" :
|
456 |
+
vData = vMonth + "\/" + vDD + "\/" + vY4;
|
457 |
+
break;
|
458 |
+
case "MM\/DD\/YY" :
|
459 |
+
vData = vMonth + "\/" + vDD + "\/" + vY2;
|
460 |
+
break;
|
461 |
+
case "MM-DD-YYYY" :
|
462 |
+
vData = vMonth + "-" + vDD + "-" + vY4;
|
463 |
+
break;
|
464 |
+
case "YYYY-MM-DD" :
|
465 |
+
vData = vY4 + "-" + vMonth + "-" + vDD;
|
466 |
+
break;
|
467 |
+
case "MM-DD-YY" :
|
468 |
+
vData = vMonth + "-" + vDD + "-" + vY2;
|
469 |
+
break;
|
470 |
+
case "DD\/MON\/YYYY" :
|
471 |
+
vData = vDD + "\/" + vMon + "\/" + vY4;
|
472 |
+
break;
|
473 |
+
case "DD\/MON\/YY" :
|
474 |
+
vData = vDD + "\/" + vMon + "\/" + vY2;
|
475 |
+
break;
|
476 |
+
case "DD-MON-YYYY" :
|
477 |
+
vData = vDD + "-" + vMon + "-" + vY4;
|
478 |
+
break;
|
479 |
+
case "DD-MON-YY" :
|
480 |
+
vData = vDD + "-" + vMon + "-" + vY2;
|
481 |
+
break;
|
482 |
+
case "DD\/MONTH\/YYYY" :
|
483 |
+
vData = vDD + "\/" + vFMon + "\/" + vY4;
|
484 |
+
break;
|
485 |
+
case "DD\/MONTH\/YY" :
|
486 |
+
vData = vDD + "\/" + vFMon + "\/" + vY2;
|
487 |
+
break;
|
488 |
+
case "DD-MONTH-YYYY" :
|
489 |
+
vData = vDD + "-" + vFMon + "-" + vY4;
|
490 |
+
break;
|
491 |
+
case "DD-MONTH-YY" :
|
492 |
+
vData = vDD + "-" + vFMon + "-" + vY2;
|
493 |
+
break;
|
494 |
+
case "DD\/MM\/YYYY" :
|
495 |
+
vData = vDD + "\/" + vMonth + "\/" + vY4;
|
496 |
+
break;
|
497 |
+
case "DD\/MM\/YY" :
|
498 |
+
vData = vDD + "\/" + vMonth + "\/" + vY2;
|
499 |
+
break;
|
500 |
+
case "DD-MM-YYYY" :
|
501 |
+
vData = vDD + "-" + vMonth + "-" + vY4;
|
502 |
+
break;
|
503 |
+
case "DD-MM-YY" :
|
504 |
+
vData = vDD + "-" + vMonth + "-" + vY2;
|
505 |
+
break;
|
506 |
+
case "DD.MM.YYYY" :
|
507 |
+
vData = vDD + "." + vMonth + "." + vY4;
|
508 |
+
break;
|
509 |
+
case "DD.MM.YY" :
|
510 |
+
vData = vDD + "." + vMonth + "." + vY2;
|
511 |
+
break;
|
512 |
+
default :
|
513 |
+
vData = vMonth + "\/" + vDD + "\/" + vY4;
|
514 |
+
}
|
515 |
+
|
516 |
+
return vData;
|
517 |
+
}
|
518 |
+
|
519 |
+
function Build(p_item, p_month, p_year, p_format) {
|
520 |
+
var gCal = new Calendar(p_item, p_month, p_year, p_format);
|
521 |
+
|
522 |
+
// Customize your Calendar here..
|
523 |
+
gCal.gBGColor="white";
|
524 |
+
gCal.gLinkColor="black";
|
525 |
+
gCal.gTextColor="black";
|
526 |
+
gCal.gHeaderColor="darkgreen";
|
527 |
+
|
528 |
+
// initialize the content string
|
529 |
+
ggWinContent = "";
|
530 |
+
|
531 |
+
// Check for DRAGGABLE support
|
532 |
+
if (typeof ol_draggable == 'undefined') DRAGGABLE = DONOTHING;
|
533 |
+
|
534 |
+
// Choose appropriate show function
|
535 |
+
if (gCal.gYearly) {
|
536 |
+
// Note: you can set ggPosX and ggPosY as part of the onclick javascript
|
537 |
+
// code before you call the show_yearly_calendar function:
|
538 |
+
// onclick="ggPosX=20;ggPosY=5;show_yearly_calendar(...);"
|
539 |
+
if (OLns6) {
|
540 |
+
if (ggPosX == -1) ggPosX = 20;
|
541 |
+
if (ggPosY == -1) ggPosY = 10;
|
542 |
+
}
|
543 |
+
if (fontsize == 8) fontsize = 6;
|
544 |
+
// generate the calendar
|
545 |
+
gCal.showY();
|
546 |
+
} else {
|
547 |
+
if (fontsize == 6) fontsize = 8;
|
548 |
+
gCal.show();
|
549 |
+
}
|
550 |
+
|
551 |
+
// Clear or force EXCLUSIVE setting
|
552 |
+
o3_exclusive=(ggUseOverlib2)?1:0;
|
553 |
+
var CalendarOv=(ggUseOverlib2)?overlib2:overlib;
|
554 |
+
// If X and Y positions are not specified use MIDX and RELY
|
555 |
+
if (ggPosX == -1 && ggPosY == -1) {
|
556 |
+
CalendarOv(ggWinContent, AUTOSTATUSCAP, STICKY, EXCLUSIVE, DRAGGABLE,
|
557 |
+
CLOSECLICK, TEXTSIZE,'8pt', CAPTIONSIZE,'8pt', CLOSESIZE,'8pt',
|
558 |
+
CAPTION,'Select a date', MIDX,0, RELY,10);
|
559 |
+
// Otherwise use FIXX and FIXY
|
560 |
+
} else {
|
561 |
+
// Make sure popup is on screen
|
562 |
+
var X = ((ggPosX < 10)?0:ggPosX - 10), Y = ((ggPosY < 10)?0:ggPosY - 10);
|
563 |
+
window.scroll(X, Y);
|
564 |
+
// Put up the calendar
|
565 |
+
CalendarOv(ggWinContent, AUTOSTATUSCAP, STICKY, EXCLUSIVE, DRAGGABLE,
|
566 |
+
CLOSECLICK, TEXTSIZE,'8pt', CAPTIONSIZE,'8pt', CLOSESIZE,'8pt',
|
567 |
+
CAPTION,'Select a date', FIXX,ggPosX, FIXY,ggPosY);
|
568 |
+
// Reset the position variables
|
569 |
+
ggPosX = -1; ggPosY = -1;
|
570 |
+
}
|
571 |
+
ggUseOverlib2=0;
|
572 |
+
}
|
573 |
+
|
574 |
+
function show_calendar() {
|
575 |
+
var p_item // Return Item.
|
576 |
+
var p_month // 0-11 for Jan-Dec; 12 for All Months.
|
577 |
+
var p_year // 4-digit year
|
578 |
+
var p_format // Date format (YYYY-MM-DD, DD/MM/YYYY, ...)
|
579 |
+
fontsize = 8;
|
580 |
+
|
581 |
+
p_item = arguments[0];
|
582 |
+
if (arguments[1] == "" || arguments[1] == null || arguments[1] == '12')
|
583 |
+
p_month = new String(gNow.getMonth());
|
584 |
+
else
|
585 |
+
p_month = arguments[1];
|
586 |
+
if (arguments[2] == "" || arguments[2] == null)
|
587 |
+
p_year = new String(gNow.getFullYear().toString());
|
588 |
+
else
|
589 |
+
p_year = arguments[2];
|
590 |
+
if (arguments[3] == "" || arguments[3] == null)
|
591 |
+
p_format = "YYYY-MM-DD";
|
592 |
+
else
|
593 |
+
p_format = arguments[3];
|
594 |
+
|
595 |
+
if (OLns4) return overlib('Sorry, your browser does not support this feature. '
|
596 |
+
+'Manually enter<br>' + p_format,
|
597 |
+
FGCOLOR,'#ffffcc', TEXTSIZE,2, STICKY, NOCLOSE, OFFSETX,-10, OFFSETY,-10,
|
598 |
+
WIDTH,110, BASE,2);
|
599 |
+
|
600 |
+
Build(p_item, p_month, p_year, p_format);
|
601 |
+
}
|
602 |
+
|
603 |
+
function show_yearly_calendar() {
|
604 |
+
var p_item // Return Item.
|
605 |
+
var p_year // 4-digit year
|
606 |
+
var p_format // Date format (YYYY-MM-DD, DD/MM/YYYY, ...)
|
607 |
+
|
608 |
+
p_item = arguments[0];
|
609 |
+
if (arguments[1] == "" || arguments[1] == null)
|
610 |
+
p_year = new String(gNow.getFullYear().toString());
|
611 |
+
else
|
612 |
+
p_year = arguments[1];
|
613 |
+
if (arguments[2] == "" || arguments[2] == null)
|
614 |
+
p_format = "YYYY-MM-DD";
|
615 |
+
else
|
616 |
+
p_format = arguments[2];
|
617 |
+
|
618 |
+
if (OLns4) return overlib('Sorry, your browser does not support this feature. '
|
619 |
+
+'Manually enter<br>' + p_format,
|
620 |
+
FGCOLOR,'#ffffcc', TEXTSIZE,2, STICKY, NOCLOSE, OFFSETX,-10, OFFSETY,-10,
|
621 |
+
WIDTH,110, BASE,2);
|
622 |
+
|
623 |
+
Build(p_item, null, p_year, p_format);
|
624 |
+
}
|
js/overlibmws/calendarmws_lang.js
ADDED
@@ -0,0 +1,705 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
calendarmws_lang.js - Script with multi-language support for generating calender popups
|
3 |
+
and selecting dates for form submissions.
|
4 |
+
See http://www.macridesweb.com/oltest/calendarmws_lang.html for a demonstration.
|
5 |
+
Initial (calendarmws.js): November 9, 2003 - Last Revised: June 11, 2008
|
6 |
+
|
7 |
+
****
|
8 |
+
Original: Kedar R. Bhave (softricks@hotmail.com)
|
9 |
+
Web Site: http://www.softricks.com
|
10 |
+
(uses window popups)
|
11 |
+
|
12 |
+
Modifications and customizations to work with the overLIB v3.50
|
13 |
+
Author: James B. O'Connor (joconnor@nordenterprises.com)
|
14 |
+
Web Site: http://www.nordenterprises.com
|
15 |
+
Developed for use with http://home-owners-assoc.com
|
16 |
+
Note: while overlib works fine with Netscape 4, this function does not work very
|
17 |
+
well, since portions of the "over" div end up under other fields on the form and
|
18 |
+
cannot be seen. If you want to use this with NS4, you'll need to change the
|
19 |
+
positioning in the overlib() call to make sure the "over" div gets positioned
|
20 |
+
away from all other form fields
|
21 |
+
The O'Connor script and many more are available free online at:
|
22 |
+
The JavaScript Source!! http://javascript.internet.com
|
23 |
+
|
24 |
+
Further modifications made by Foteos Macrides (http://www.macridesweb.com/oltest/),
|
25 |
+
Bodo Hantschmann (http://www.hantschmann.org) - multi-language support, and
|
26 |
+
Bill McCormick (wpmccormick@freeshell.org) - draggable support, for overlibmws.
|
27 |
+
|
28 |
+
Requires sprintf.js from the overlibmws distribution.
|
29 |
+
*/
|
30 |
+
|
31 |
+
var ggPosX = -1;
|
32 |
+
var ggPosY = -1;
|
33 |
+
var ggInactive = 0;
|
34 |
+
var ggOnChange = null;
|
35 |
+
var ggLang = 'eng';
|
36 |
+
var ggUseOverlib2 = 0;
|
37 |
+
|
38 |
+
var ggWinContent = "";
|
39 |
+
|
40 |
+
var weekend = [0,6];
|
41 |
+
var weekendColor = "#e0e0e0";
|
42 |
+
var fontface = "Verdana";
|
43 |
+
var fontsize = 8; // in "pt" units; used with "font-size" style element
|
44 |
+
|
45 |
+
var calmsg = new Array();
|
46 |
+
var datFormat = new Array();
|
47 |
+
var CalendarMonths = new Array();
|
48 |
+
var CalendarWeekdays = new Array();
|
49 |
+
|
50 |
+
/* -----------------------------------------------------------------------------------------
|
51 |
+
Languages (set via the value of the ggLang global)
|
52 |
+
|
53 |
+
'eng' - English
|
54 |
+
'ger' - German
|
55 |
+
'esp' - Spanish
|
56 |
+
'dut' - Dutch / Netherlands
|
57 |
+
|
58 |
+
for more languages:
|
59 |
+
greetings from babelfish ;-) (Hint: Use always english as base, that gives the best
|
60 |
+
results.
|
61 |
+
----------------------------------------------------------------------------------------- */
|
62 |
+
|
63 |
+
/* -------------------------------
|
64 |
+
English
|
65 |
+
------------------------------- */
|
66 |
+
calmsg["eng"] = new Array;
|
67 |
+
calmsg["eng"][0] = "One year backward";
|
68 |
+
calmsg["eng"][1] = "One year forward";
|
69 |
+
calmsg["eng"][2] = "One month backward";
|
70 |
+
calmsg["eng"][3] = "One month forward";
|
71 |
+
calmsg["eng"][4] = "Set date";
|
72 |
+
calmsg["eng"][5] = "Select date";
|
73 |
+
calmsg["eng"][6] = "Your Browser does NOT support this feature. Update asap, please!<br />";
|
74 |
+
calmsg["eng"][7] = "Year";
|
75 |
+
calmsg["eng"][8] = "Click to close";
|
76 |
+
datFormat["eng"] = "MM/DD/YYYY";
|
77 |
+
CalendarMonths["eng"] = new Array("January", "February", "March", "April", "May", "June",
|
78 |
+
"July", "August", "September", "October", "November", "December");
|
79 |
+
CalendarWeekdays["eng"] = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
|
80 |
+
|
81 |
+
/* -------------------------------
|
82 |
+
German
|
83 |
+
------------------------------- */
|
84 |
+
calmsg["ger"] = new Array;
|
85 |
+
calmsg["ger"][0] = "Ein Jahr zurück";
|
86 |
+
calmsg["ger"][1] = "Ein Jahr vorwärts";
|
87 |
+
calmsg["ger"][2] = "Einen Monat zurück";
|
88 |
+
calmsg["ger"][3] = "Einen Monat vorwärts";
|
89 |
+
calmsg["ger"][4] = "Datum setzen";
|
90 |
+
calmsg["ger"][5] = "Datum wählen";
|
91 |
+
calmsg["ger"][6] = "Leider unterstützt Ihr Browser dieses Feature nicht. "
|
92 |
+
+"Bitte updaten!<br />";
|
93 |
+
calmsg["ger"][7] = "Jahr";
|
94 |
+
calmsg["ger"][8] = "Zum schließen klicken";
|
95 |
+
datFormat["ger"] = "DD.MM.YYYY";
|
96 |
+
CalendarMonths["ger"] = new Array("Januar", "Februar", "März", "April", "Mai", "Juni",
|
97 |
+
"Juli", "August", "September", "Oktober", "November", "Dezember");
|
98 |
+
CalendarWeekdays["ger"] = new Array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
99 |
+
|
100 |
+
/* -------------------------------
|
101 |
+
Spanish
|
102 |
+
------------------------------- */
|
103 |
+
calmsg["esp"] = new Array;
|
104 |
+
calmsg["esp"][0] = "Un a�o atras";
|
105 |
+
calmsg["esp"][1] = "Un a�o adelante";
|
106 |
+
calmsg["esp"][2] = "Un mes atras";
|
107 |
+
calmsg["esp"][3] = "Un mes adelante";
|
108 |
+
calmsg["esp"][4] = "Fije la fecha";
|
109 |
+
calmsg["esp"][5] = "Seleccione la fecha";
|
110 |
+
calmsg["esp"][6] = "Su browser no apoya esta caracter�stica. �Actualizaci�n cuanto antes, "
|
111 |
+
+"por favor!<br />";
|
112 |
+
calmsg["esp"][7] = "A�o";
|
113 |
+
calmsg["esp"][8] = "Tecleo a cerrarse";
|
114 |
+
datFormat["esp"] = "DD.MM.YYYY";
|
115 |
+
CalendarMonths["esp"] = new Array("Enero", "Febrero", "Marcha", "Abril", "Puede", "Junio",
|
116 |
+
"Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
|
117 |
+
CalendarWeekdays["esp"] = new Array("Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa");
|
118 |
+
|
119 |
+
/* -------------------------------
|
120 |
+
Dutch
|
121 |
+
------------------------------- */
|
122 |
+
calmsg["dut"] = new Array;
|
123 |
+
calmsg["dut"][0] = "��n jaar achteruit";
|
124 |
+
calmsg["dut"][1] = "��n jaar voorwaarts";
|
125 |
+
calmsg["dut"][2] = "��n maand achteruit";
|
126 |
+
calmsg["dut"][3] = "��n maand voorwaarts";
|
127 |
+
calmsg["dut"][4] = "Overname datum";
|
128 |
+
calmsg["dut"][5] = "Selecteer datum";
|
129 |
+
calmsg["dut"][6] = "Uw Browser steunt deze eigenschap niet. Update zo vlug mogelijk, "
|
130 |
+
+"tevreden!<br />";
|
131 |
+
calmsg["dut"][7] = "Jaar";
|
132 |
+
calmsg["dut"][8] = "klik aan het sluiten";
|
133 |
+
datFormat["dut"] = "DD.MM.YYYY";
|
134 |
+
CalendarMonths["dut"] = new Array("Januari", "Februari", "Maart", "April", "Mei", "Juni",
|
135 |
+
"Juli", "Augustus", "September", "Oktober", "November", "December");
|
136 |
+
CalendarWeekdays["dut"] = new Array("Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za");
|
137 |
+
|
138 |
+
var gNow = new Date();
|
139 |
+
|
140 |
+
Calendar.CellWidth = ["14%", "14%", "14%", "14%", "14%", "14%", "16%"];
|
141 |
+
|
142 |
+
// Non-Leap year Month days..
|
143 |
+
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
144 |
+
// Leap year Month days..
|
145 |
+
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
146 |
+
|
147 |
+
function Calendar(p_item, p_month, p_year, p_format) {
|
148 |
+
if ((p_month == null) && (p_year == null)) return;
|
149 |
+
|
150 |
+
if (p_month == null) {
|
151 |
+
this.gMonthName = null;
|
152 |
+
this.gMonth = null;
|
153 |
+
this.gYearly = true;
|
154 |
+
} else {
|
155 |
+
this.gMonthName = Calendar.get_month(p_month);
|
156 |
+
this.gMonth = new Number(p_month);
|
157 |
+
this.gYearly = false;
|
158 |
+
}
|
159 |
+
|
160 |
+
this.gYear = p_year;
|
161 |
+
this.gFormat = p_format;
|
162 |
+
this.gBGColor = "white";
|
163 |
+
this.gFGColor = "black";
|
164 |
+
this.gTextColor = "black";
|
165 |
+
this.gHeaderColor = "black";
|
166 |
+
this.gReturnItem = p_item;
|
167 |
+
}
|
168 |
+
|
169 |
+
Calendar.get_month = Calendar_get_month;
|
170 |
+
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
|
171 |
+
Calendar.calc_month_year = Calendar_calc_month_year;
|
172 |
+
|
173 |
+
function Calendar_get_month(monthNo) {
|
174 |
+
return Calendar.Months[monthNo];
|
175 |
+
}
|
176 |
+
|
177 |
+
function Calendar_get_daysofmonth(monthNo, p_year) {
|
178 |
+
/*
|
179 |
+
Check for leap year ..
|
180 |
+
1.Years evenly divisible by four are normally leap years, except for...
|
181 |
+
2.Years also evenly divisible by 100 are not leap years, except for...
|
182 |
+
3.Years also evenly divisible by 400 are leap years.
|
183 |
+
*/
|
184 |
+
if ((p_year % 4) == 0) {
|
185 |
+
if ((p_year % 100) == 0 && (p_year % 400) != 0)
|
186 |
+
return Calendar.DOMonth[monthNo];
|
187 |
+
|
188 |
+
return Calendar.lDOMonth[monthNo];
|
189 |
+
} else
|
190 |
+
return Calendar.DOMonth[monthNo];
|
191 |
+
}
|
192 |
+
|
193 |
+
function Calendar_calc_month_year(p_Month, p_Year, incr) {
|
194 |
+
/*
|
195 |
+
Will return an 1-D array with 1st element being the calculated month
|
196 |
+
and second being the calculated year
|
197 |
+
after applying the month increment/decrement as specified by 'incr' parameter.
|
198 |
+
'incr' will normally have 1/-1 to navigate thru the months.
|
199 |
+
*/
|
200 |
+
var ret_arr = new Array();
|
201 |
+
|
202 |
+
if (incr == -1) {
|
203 |
+
// B A C K W A R D
|
204 |
+
if (p_Month == 0) {
|
205 |
+
ret_arr[0] = 11;
|
206 |
+
ret_arr[1] = parseInt(p_Year) - 1;
|
207 |
+
} else {
|
208 |
+
ret_arr[0] = parseInt(p_Month) - 1;
|
209 |
+
ret_arr[1] = parseInt(p_Year);
|
210 |
+
}
|
211 |
+
} else if (incr == 1) {
|
212 |
+
// F O R W A R D
|
213 |
+
if (p_Month == 11) {
|
214 |
+
ret_arr[0] = 0;
|
215 |
+
ret_arr[1] = parseInt(p_Year) + 1;
|
216 |
+
} else {
|
217 |
+
ret_arr[0] = parseInt(p_Month) + 1;
|
218 |
+
ret_arr[1] = parseInt(p_Year);
|
219 |
+
}
|
220 |
+
}
|
221 |
+
return ret_arr;
|
222 |
+
}
|
223 |
+
|
224 |
+
function Calendar_calc_month_year(p_Month, p_Year, incr) {
|
225 |
+
/*
|
226 |
+
Will return an 1-D array with 1st element being the calculated month
|
227 |
+
and second being the calculated year
|
228 |
+
after applying the month increment/decrement as specified by 'incr' parameter.
|
229 |
+
'incr' will normally have 1/-1 to navigate thru the months.
|
230 |
+
*/
|
231 |
+
var ret_arr = new Array();
|
232 |
+
|
233 |
+
if (incr == -1) {
|
234 |
+
// B A C K W A R D
|
235 |
+
if (p_Month == 0) {
|
236 |
+
ret_arr[0] = 11;
|
237 |
+
ret_arr[1] = parseInt(p_Year) - 1;
|
238 |
+
} else {
|
239 |
+
ret_arr[0] = parseInt(p_Month) - 1;
|
240 |
+
ret_arr[1] = parseInt(p_Year);
|
241 |
+
}
|
242 |
+
} else if (incr == 1) {
|
243 |
+
// F O R W A R D
|
244 |
+
if (p_Month == 11) {
|
245 |
+
ret_arr[0] = 0;
|
246 |
+
ret_arr[1] = parseInt(p_Year) + 1;
|
247 |
+
} else {
|
248 |
+
ret_arr[0] = parseInt(p_Month) + 1;
|
249 |
+
ret_arr[1] = parseInt(p_Year);
|
250 |
+
}
|
251 |
+
}
|
252 |
+
return ret_arr;
|
253 |
+
}
|
254 |
+
|
255 |
+
// This is for compatibility with Navigator 3, we have to create and discard one object
|
256 |
+
// before the prototype object exists.
|
257 |
+
new Calendar();
|
258 |
+
|
259 |
+
Calendar.prototype.getMonthlyCalendarCode = function() {
|
260 |
+
var vCode = "";
|
261 |
+
var vHeader_Code = "";
|
262 |
+
var vData_Code = "";
|
263 |
+
|
264 |
+
// Begin Table Drawing code here..
|
265 |
+
vCode += ('<div align="center"><table border="1" bgcolor="' + this.gBGColor
|
266 |
+
+'" style="font-size:' + fontsize + 'pt;">');
|
267 |
+
|
268 |
+
vHeader_Code = this.cal_header();
|
269 |
+
vData_Code = this.cal_data();
|
270 |
+
vCode += (vHeader_Code + vData_Code);
|
271 |
+
|
272 |
+
vCode += '</table></div>';
|
273 |
+
|
274 |
+
return vCode;
|
275 |
+
}
|
276 |
+
|
277 |
+
Calendar.prototype.show = function() {
|
278 |
+
var vCode = "";
|
279 |
+
|
280 |
+
var vDate = new Date();
|
281 |
+
vDate.setMonth(this.gMonth);
|
282 |
+
vDate.setFullYear(this.gYear);
|
283 |
+
var vNowMonth = gNow.getMonth();
|
284 |
+
var vNowYear = gNow.getFullYear();
|
285 |
+
var yOK=!ggInactive||vNowYear<vDate.getFullYear()?1:0;
|
286 |
+
var mOK=!ggInactive||(yOK||
|
287 |
+
(vNowYear<=vDate.getFullYear()&&vNowMonth<vDate.getMonth()))?1:0;
|
288 |
+
|
289 |
+
// build content into global var ggWinContent
|
290 |
+
ggWinContent += sprintf('<div style="font-family:\'%s\';font-weight:bold;'
|
291 |
+
+'font-size:%spt;text-align:center;">%s %s</div>',
|
292 |
+
fontface, fontsize, this.gMonthName, this.gYear);
|
293 |
+
|
294 |
+
// Show navigation buttons
|
295 |
+
var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
|
296 |
+
var prevMM = prevMMYYYY[0];
|
297 |
+
var prevYYYY = prevMMYYYY[1];
|
298 |
+
|
299 |
+
var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
|
300 |
+
var nextMM = nextMMYYYY[0];
|
301 |
+
var nextYYYY = nextMMYYYY[1];
|
302 |
+
|
303 |
+
var nav_cell = '<td align="%s"> [<a href="javascript:void(0);" title="%s" '
|
304 |
+
+'onmouseover="window.status=\'%s\'; return true;" '
|
305 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
306 |
+
+'onclick="Build(\'%s\',\'%s\',\'%s\',\'%s\');">%s%s%s<\/a>] </td>';
|
307 |
+
var nav_cell_inactive = '<td align="%s"> [%s%s] </td>'
|
308 |
+
|
309 |
+
ggWinContent += '<table width="100%" border="0" cellspacing="0" cellpadding="0" '
|
310 |
+
+'bgcolor="#e0e0e0" style="font-size:' + fontsize + 'pt;">';
|
311 |
+
ggWinContent += '<tr>';
|
312 |
+
ggWinContent += yOK?sprintf(nav_cell,
|
313 |
+
'left', calmsg[ggLang][0], calmsg[ggLang][0],
|
314 |
+
this.gReturnItem, this.gMonth, (parseInt(this.gYear)-1), this.gFormat,
|
315 |
+
'<<', (parseInt(this.gYear)-1), ''):
|
316 |
+
sprintf(nav_cell_inactive, 'left', '<<', (parseInt(this.gYear)-1));
|
317 |
+
ggWinContent += sprintf(nav_cell,
|
318 |
+
'right', calmsg[ggLang][1], calmsg[ggLang][1],
|
319 |
+
this.gReturnItem, this.gMonth, (parseInt(this.gYear)+1), this.gFormat,
|
320 |
+
'', (parseInt(this.gYear)+1), '>>');
|
321 |
+
ggWinContent += '</tr><tr>';
|
322 |
+
ggWinContent += mOK?sprintf(nav_cell,
|
323 |
+
'left', calmsg[ggLang][2], calmsg[ggLang][2],
|
324 |
+
this.gReturnItem, prevMM, prevYYYY, this.gFormat, '<',
|
325 |
+
Calendar.Months[prevMM], ''):
|
326 |
+
sprintf(nav_cell_inactive, '<', Calendar.Months[prevMM]);
|
327 |
+
ggWinContent += sprintf(nav_cell,
|
328 |
+
'right', calmsg[ggLang][3], calmsg[ggLang][3],
|
329 |
+
this.gReturnItem, nextMM, nextYYYY, this.gFormat, '',
|
330 |
+
Calendar.Months[nextMM], '>');
|
331 |
+
ggWinContent += '</tr></table><div style="font-size:3px;"> </div>';
|
332 |
+
|
333 |
+
// Get the complete calendar code for the month, and add it to the content var
|
334 |
+
vCode = this.getMonthlyCalendarCode();
|
335 |
+
ggWinContent += vCode;
|
336 |
+
}
|
337 |
+
|
338 |
+
Calendar.prototype.showY = function() {
|
339 |
+
var vCode = "";
|
340 |
+
var i;
|
341 |
+
|
342 |
+
ggWinContent += sprintf(
|
343 |
+
'<div style="font-family:\'%s\';font-weight:bold;font-size:%spt;'
|
344 |
+
+'text-align:center;">%s</div>', fontface, fontsize+1, this.gYear);
|
345 |
+
// Show navigation buttons
|
346 |
+
var prevYYYY = parseInt(this.gYear) - 1;
|
347 |
+
var nextYYYY = parseInt(this.gYear) + 1;
|
348 |
+
|
349 |
+
var vDate = new Date();
|
350 |
+
vDate.setFullYear(this.gYear);
|
351 |
+
var vCode = "";
|
352 |
+
var vNowYear = gNow.getFullYear();
|
353 |
+
var yOK=!ggInactive||vNowYear<vDate.getFullYear()?1:0;
|
354 |
+
|
355 |
+
ggWinContent += '<table width="100%" ' + sprintf(
|
356 |
+
'border="1" cellspacing="0" cellpadding="0" bgcolor="%s" '
|
357 |
+
+'style="font-size:%spt;">', '#e0e0e0', fontsize);
|
358 |
+
ggWinContent += '<tr>';
|
359 |
+
ggWinContent += yOK?sprintf(
|
360 |
+
'<td align="center">[<a href="javascript:void(0);" title="%s" '
|
361 |
+
+'onmouseover="window.status=\'%s\'; return true;" '
|
362 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
363 |
+
+'onclick="Build(\'%s\', null, \'%s\', \'%s\');"><<%s</a>]</td>',
|
364 |
+
calmsg[ggLang][0], calmsg[ggLang][0], this.gReturnItem,
|
365 |
+
prevYYYY, this.gFormat, (parseInt(this.gYear)-1)):
|
366 |
+
sprintf('<td align="center">[<<%s]</td>',(parseInt(this.gYear)-1));
|
367 |
+
ggWinContent += '<td align="center"> </td>';
|
368 |
+
ggWinContent += sprintf(
|
369 |
+
'<td align="center">[<a href="javascript:void(0);" title="%s" '
|
370 |
+
+'onmouseover="window.status=\'%s\'; return true;" '
|
371 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
372 |
+
+'onclick="Build(\'%s\', null, \'%s\', \'%s\');">%s>></a>]</td>',
|
373 |
+
calmsg[ggLang][1], calmsg[ggLang][1], this.gReturnItem,
|
374 |
+
nextYYYY, this.gFormat, (parseInt(this.gYear)+1));
|
375 |
+
ggWinContent += '</tr></table>';
|
376 |
+
|
377 |
+
// Get the complete calendar code for each month.
|
378 |
+
// start a table and first row in the table
|
379 |
+
ggWinContent += '<table width="100%" border="0" cellspacing="0" cellpadding="2" '
|
380 |
+
+'style="font-size:' + fontsize + 'pt;"><tr>';
|
381 |
+
for (i=0; i<12; i++) {
|
382 |
+
// start the table cell
|
383 |
+
ggWinContent += '<td align="center" valign="top">';
|
384 |
+
this.gMonth = i;
|
385 |
+
this.gMonthName = Calendar.get_month(this.gMonth);
|
386 |
+
vCode = this.getMonthlyCalendarCode();
|
387 |
+
ggWinContent += (this.gMonthName + '/' + this.gYear+ '<div '
|
388 |
+
+'style="font-size:2px;"> </div>');
|
389 |
+
ggWinContent += vCode;
|
390 |
+
ggWinContent += '</td>';
|
391 |
+
if (i == 3 || i == 7) ggWinContent += '</tr><tr>';
|
392 |
+
}
|
393 |
+
ggWinContent += '</tr></table>';
|
394 |
+
}
|
395 |
+
|
396 |
+
Calendar.prototype.cal_header = function() {
|
397 |
+
var vCode = '<tr>';
|
398 |
+
for (i=0; i<7; i++) { vCode += sprintf(
|
399 |
+
'<td width="%s" style="font-family:\'%s\';font-weight:bold;color:%s; '
|
400 |
+
+'text-align:center;">%s</td>',
|
401 |
+
Calendar.CellWidth[i], fontface, this.gHeaderColor, Calendar.Weekdays[i]);
|
402 |
+
}
|
403 |
+
return (vCode + '</tr>');
|
404 |
+
}
|
405 |
+
|
406 |
+
Calendar.prototype.cal_data = function() {
|
407 |
+
var vDate = new Date();
|
408 |
+
vDate.setDate(1);
|
409 |
+
vDate.setMonth(this.gMonth);
|
410 |
+
vDate.setFullYear(this.gYear);
|
411 |
+
|
412 |
+
var vNowDay = gNow.getDate();
|
413 |
+
var vNowMonth = gNow.getMonth();
|
414 |
+
var vNowYear = gNow.getFullYear();
|
415 |
+
|
416 |
+
var yOK=!ggInactive||vNowYear<=vDate.getFullYear()?1:0;
|
417 |
+
var mOK=!ggInactive||vNowYear<vDate.getFullYear()||
|
418 |
+
(vNowYear==vDate.getFullYear()&&vNowMonth<=vDate.getMonth())?1:0;
|
419 |
+
var ymOK=yOK&&mOK?1:0;
|
420 |
+
var dOK=!ggInactive||vNowYear<vDate.getFullYear()||vNowMonth<vDate.getMonth()?1:0;
|
421 |
+
|
422 |
+
var vFirstDay=vDate.getDay();
|
423 |
+
var vDay=1;
|
424 |
+
var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
|
425 |
+
var vOnLastDay=0;
|
426 |
+
var vCode = '<tr>';
|
427 |
+
var i,j,k,m;
|
428 |
+
var orig = eval("document." + this.gReturnItem + ".value").toString();
|
429 |
+
/*
|
430 |
+
Get day for the 1st of the requested month/year..
|
431 |
+
Place as many blank cells before the 1st day of the month as necessary.
|
432 |
+
*/
|
433 |
+
for (i=0; i<vFirstDay; i++) { vCode += sprintf(
|
434 |
+
'<td width="%s" %s style="font-family:\'%s\';text-align:center;"> </td>',
|
435 |
+
Calendar.CellWidth[0], this.write_weekend_string(i),fontface);
|
436 |
+
}
|
437 |
+
// Write rest of the 1st week
|
438 |
+
for (j=vFirstDay; j<7; j++) { vCode += (ymOK)&&(vDay>=vNowDay||dOK)?sprintf(
|
439 |
+
'<td width="%s" %s style="font-family:\'%s\';text-align:center;"><a '
|
440 |
+
+'href="javascript:void(0);" title="%s: %s" '
|
441 |
+
+'onmouselver="window.status=\'%s: %s\'; return true;" '
|
442 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
443 |
+
+'onclick="document.%s.value=\'%s\';ggPosX= -1;ggPosY= -1;%s'
|
444 |
+
+(ggUseOverlib2?'cClick2();':'cClick();')
|
445 |
+
+'if((ggOnChange)&&(document.%s.value!=\'%s\'))ggOnChange();">%s</a></td>',
|
446 |
+
Calendar.CellWidth[j+1], this.write_weekend_string(j), fontface,
|
447 |
+
calmsg[ggLang][4], this.format_data(vDay), calmsg[ggLang][4],
|
448 |
+
this.format_data(vDay), this.gReturnItem, this.format_data(vDay), OLfnRef,
|
449 |
+
this.gReturnItem, orig, this.format_day(vDay)):
|
450 |
+
sprintf('<td width="%s" %s style="font-family:\'%s\';text-align:center;">'
|
451 |
+
+'%s</td>', Calendar.CellWidth[j+1], this.write_weekend_string(j), fontface,
|
452 |
+
this.format_day(vDay));
|
453 |
+
vDay += 1;
|
454 |
+
}
|
455 |
+
vCode += '</tr>';
|
456 |
+
|
457 |
+
// Write the rest of the weeks
|
458 |
+
for (k=2; k<7; k++) {
|
459 |
+
vCode += '<tr>';
|
460 |
+
for (j=0; j<7; j++) { vCode += (ymOK)&&(vDay>=vNowDay||dOK)?sprintf(
|
461 |
+
'<td width="%s" %s style="font-family:\'%s\';text-align:center;"><a '
|
462 |
+
+'href="javascript:void(0);" title="%s: %s" '
|
463 |
+
+'onmouseover="window.status=\'%s: %s\'; return true;" '
|
464 |
+
+'onmouseout="window.status=\'\'; return true;" '
|
465 |
+
+'onclick="document.%s.value=\'%s\';ggPosX= -1;ggPosY= -1;%s'
|
466 |
+
+(ggUseOverlib2?'cClick2();':'cClick();')+'if'
|
467 |
+
+'((ggOnChange)&&(document.%s.value!=\'%s\'))ggOnChange();">%s</a></td>',
|
468 |
+
Calendar.CellWidth[j+1], this.write_weekend_string(j), fontface,
|
469 |
+
calmsg[ggLang][4], this.format_data(vDay),calmsg[ggLang][4],
|
470 |
+
this.format_data(vDay), this.gReturnItem, this.format_data(vDay),
|
471 |
+
OLfnRef, this.gReturnItem, orig, this.format_day(vDay)):sprintf(
|
472 |
+
'<td width="%s" %s style="font-family:\'%s\';text-align:center;">'
|
473 |
+
+'%s</td>', Calendar.CellWidth[j+1], this.write_weekend_string(j),
|
474 |
+
fontface, this.format_day(vDay));
|
475 |
+
vDay += 1;
|
476 |
+
if (vDay > vLastDay) {
|
477 |
+
vOnLastDay = 1;
|
478 |
+
break;
|
479 |
+
}
|
480 |
+
}
|
481 |
+
if (j == 6) vCode += '</tr>';
|
482 |
+
if (vOnLastDay == 1) break;
|
483 |
+
}
|
484 |
+
|
485 |
+
// Fill up the rest of last week with proper blanks, so that we get proper square blocks
|
486 |
+
for (m=1; m<(7-j); m++) { vCode += sprintf(
|
487 |
+
'<td width="%s" %s style="font-family:\'%s\';color:gray;text-align:center;"'
|
488 |
+
+'> </td>',
|
489 |
+
Calendar.CellWidth[m+1], this.write_weekend_string(j+m), fontface);
|
490 |
+
}
|
491 |
+
return vCode;
|
492 |
+
}
|
493 |
+
|
494 |
+
Calendar.prototype.format_day = function(vday) {
|
495 |
+
var vNowDay = gNow.getDate();
|
496 |
+
var vNowMonth = gNow.getMonth();
|
497 |
+
var vNowYear = gNow.getFullYear();
|
498 |
+
|
499 |
+
if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
|
500 |
+
return ('<span style="color:red;font-weight:bold;">' + vday + '</span>');
|
501 |
+
else
|
502 |
+
return (vday);
|
503 |
+
}
|
504 |
+
|
505 |
+
Calendar.prototype.write_weekend_string = function(vday) {
|
506 |
+
var i;
|
507 |
+
|
508 |
+
// Return special formatting for the weekend day.
|
509 |
+
for (i=0; i<weekend.length; i++) {
|
510 |
+
if (vday == weekend[i])
|
511 |
+
return (' bgcolor="' + weekendColor + '"');
|
512 |
+
}
|
513 |
+
|
514 |
+
return "";
|
515 |
+
}
|
516 |
+
|
517 |
+
Calendar.prototype.format_data = function(p_day) {
|
518 |
+
var vData;
|
519 |
+
var vMonth = 1 + this.gMonth;
|
520 |
+
vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
|
521 |
+
var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
|
522 |
+
var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
|
523 |
+
var vY4 = new String(this.gYear);
|
524 |
+
var vY2 = new String(this.gYear.substr(2,2));
|
525 |
+
var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;
|
526 |
+
|
527 |
+
switch (this.gFormat) {
|
528 |
+
case "MM\/DD\/YYYY" :
|
529 |
+
vData = vMonth + "\/" + vDD + "\/" + vY4;
|
530 |
+
break;
|
531 |
+
case "MM\/DD\/YY" :
|
532 |
+
vData = vMonth + "\/" + vDD + "\/" + vY2;
|
533 |
+
break;
|
534 |
+
case "MM-DD-YYYY" :
|
535 |
+
vData = vMonth + "-" + vDD + "-" + vY4;
|
536 |
+
break;
|
537 |
+
case "YYYY-MM-DD" :
|
538 |
+
vData = vY4 + "-" + vMonth + "-" + vDD;
|
539 |
+
break;
|
540 |
+
case "MM-DD-YY" :
|
541 |
+
vData = vMonth + "-" + vDD + "-" + vY2;
|
542 |
+
break;
|
543 |
+
case "DD\/MON\/YYYY" :
|
544 |
+
vData = vDD + "\/" + vMon + "\/" + vY4;
|
545 |
+
break;
|
546 |
+
case "DD\/MON\/YY" :
|
547 |
+
vData = vDD + "\/" + vMon + "\/" + vY2;
|
548 |
+
break;
|
549 |
+
case "DD-MON-YYYY" :
|
550 |
+
vData = vDD + "-" + vMon + "-" + vY4;
|
551 |
+
break;
|
552 |
+
case "DD-MON-YY" :
|
553 |
+
vData = vDD + "-" + vMon + "-" + vY2;
|
554 |
+
break;
|
555 |
+
case "DD\/MONTH\/YYYY" :
|
556 |
+
vData = vDD + "\/" + vFMon + "\/" + vY4;
|
557 |
+
break;
|
558 |
+
case "DD\/MONTH\/YY" :
|
559 |
+
vData = vDD + "\/" + vFMon + "\/" + vY2;
|
560 |
+
break;
|
561 |
+
case "DD-MONTH-YYYY" :
|
562 |
+
vData = vDD + "-" + vFMon + "-" + vY4;
|
563 |
+
break;
|
564 |
+
case "DD-MONTH-YY" :
|
565 |
+
vData = vDD + "-" + vFMon + "-" + vY2;
|
566 |
+
break;
|
567 |
+
case "DD\/MM\/YYYY" :
|
568 |
+
vData = vDD + "\/" + vMonth + "\/" + vY4;
|
569 |
+
break;
|
570 |
+
case "DD\/MM\/YY" :
|
571 |
+
vData = vDD + "\/" + vMonth + "\/" + vY2;
|
572 |
+
break;
|
573 |
+
case "DD-MM-YYYY" :
|
574 |
+
vData = vDD + "-" + vMonth + "-" + vY4;
|
575 |
+
break;
|
576 |
+
case "DD-MM-YY" :
|
577 |
+
vData = vDD + "-" + vMonth + "-" + vY2;
|
578 |
+
break;
|
579 |
+
case "DD.MM.YYYY" :
|
580 |
+
vData = vDD + "." + vMonth + "." + vY4;
|
581 |
+
break;
|
582 |
+
case "DD.MM.YY" :
|
583 |
+
vData = vDD + "." + vMonth + "." + vY2;
|
584 |
+
break;
|
585 |
+
default :
|
586 |
+
vData = vMonth + "\/" + vDD + "\/" + vY4;
|
587 |
+
}
|
588 |
+
|
589 |
+
return vData;
|
590 |
+
}
|
591 |
+
|
592 |
+
function Build(p_item, p_month, p_year, p_format) {
|
593 |
+
var gCal = new Calendar(p_item, p_month, p_year, p_format);
|
594 |
+
|
595 |
+
// Customize your Calendar here..
|
596 |
+
gCal.gBGColor="white";
|
597 |
+
gCal.gLinkColor="black";
|
598 |
+
gCal.gTextColor="black";
|
599 |
+
gCal.gHeaderColor="darkgreen";
|
600 |
+
|
601 |
+
// initialize the content string
|
602 |
+
ggWinContent = "";
|
603 |
+
|
604 |
+
// Check for DRAGGABLE support
|
605 |
+
if (typeof ol_draggable == 'undefined') DRAGGABLE = DONOTHING;
|
606 |
+
|
607 |
+
// Choose appropriate show function
|
608 |
+
if (gCal.gYearly) {
|
609 |
+
// Note: you can set ggPosX and ggPosY as part of the onclick javascript
|
610 |
+
// code before you call the show_yearly_calendar function:
|
611 |
+
// onclick="ggPosX=20;ggPosY=5;show_yearly_calendar(...);"
|
612 |
+
if (OLns6) {
|
613 |
+
if (ggPosX == -1) ggPosX = 20;
|
614 |
+
if (ggPosY == -1) ggPosY = 10;
|
615 |
+
}
|
616 |
+
if (fontsize == 8) fontsize = 6;
|
617 |
+
// generate the calendar
|
618 |
+
gCal.showY();
|
619 |
+
} else {
|
620 |
+
if (fontsize == 6) fontsize = 8;
|
621 |
+
gCal.show();
|
622 |
+
}
|
623 |
+
|
624 |
+
// Clear or force EXCLUSIVE setting
|
625 |
+
o3_exclusive=(ggUseOverlib2)?1:0;
|
626 |
+
var CalendarOv=(ggUseOverlib2)?overlib2:overlib;
|
627 |
+
// If X and Y positions are not specified use MIDX and RELY
|
628 |
+
if (ggPosX == -1 && ggPosY == -1) {
|
629 |
+
CalendarOv(ggWinContent, AUTOSTATUSCAP, STICKY, EXCLUSIVE, DRAGGABLE,
|
630 |
+
CLOSECLICK, TEXTSIZE,'8pt', CAPTIONSIZE,'8pt', CLOSESIZE,'8pt',
|
631 |
+
CAPTION,calmsg[ggLang][5], CLOSETITLE,calmsg[ggLang][8],CLOSETEXT,
|
632 |
+
'<span style="background:#e0e0e0;color:#000000;text-decoration:none;'
|
633 |
+
+'font-weight:bold;"> X </span>', MIDX,0, RELY,10);
|
634 |
+
// Otherwise use FIXX and FIXY
|
635 |
+
} else {
|
636 |
+
// Make sure popup is on screen
|
637 |
+
var X = ((ggPosX < 10)?0:ggPosX - 10), Y = ((ggPosY < 10)?0:ggPosY - 10);
|
638 |
+
window.scroll(X, Y);
|
639 |
+
// Put up the calendar
|
640 |
+
CalendarOv(ggWinContent, AUTOSTATUSCAP, STICKY, EXCLUSIVE, DRAGGABLE,
|
641 |
+
CLOSECLICK, TEXTSIZE,'8pt', CAPTIONSIZE,'8pt', CLOSESIZE,'8pt',
|
642 |
+
CAPTION,calmsg[ggLang][5], CLOSETITLE,calmsg[ggLang][8],CLOSETEXT,
|
643 |
+
'<span style="background:#e0e0e0;color:#000000;text-decoration:none;'
|
644 |
+
+'font-weight:bold;"> X </span>', FIXX,ggPosX, FIXY,ggPosY);
|
645 |
+
// Reset the position variables
|
646 |
+
ggPosX = -1; ggPosY = -1;
|
647 |
+
}
|
648 |
+
ggUseOverlib2=0;
|
649 |
+
}
|
650 |
+
|
651 |
+
function show_calendar() {
|
652 |
+
var p_item // Return Item.
|
653 |
+
var p_month // 0-11 for Jan-Dec; 12 for All Months.
|
654 |
+
var p_year // 4-digit year
|
655 |
+
var p_format // Date format (YYYY-MM-DD, DD/MM/YYYY, ...)
|
656 |
+
fontsize = 8;
|
657 |
+
|
658 |
+
Calendar.Months = CalendarMonths[ggLang];
|
659 |
+
Calendar.Weekdays = CalendarWeekdays[ggLang];
|
660 |
+
|
661 |
+
p_item = arguments[0];
|
662 |
+
if (arguments[1] == "" || arguments[1] == null || arguments[1] == '12')
|
663 |
+
p_month = new String(gNow.getMonth());
|
664 |
+
else
|
665 |
+
p_month = arguments[1];
|
666 |
+
if (arguments[2] == "" || arguments[2] == null)
|
667 |
+
p_year = new String(gNow.getFullYear().toString());
|
668 |
+
else
|
669 |
+
p_year = arguments[2];
|
670 |
+
if (arguments[3] == "" || arguments[3] == null)
|
671 |
+
p_format = datFormat[ggLang];
|
672 |
+
else
|
673 |
+
p_format = arguments[3];
|
674 |
+
|
675 |
+
if (OLns4) return overlib(calmsg[ggLang][6]+p_format,
|
676 |
+
FGCOLOR,'#ffffcc', TEXTSIZE,2, STICKY, NOCLOSE, OFFSETX,-10, OFFSETY,-10,
|
677 |
+
WIDTH,110, BASE,2);
|
678 |
+
|
679 |
+
Build(p_item, p_month, p_year, p_format);
|
680 |
+
}
|
681 |
+
|
682 |
+
function show_yearly_calendar() {
|
683 |
+
var p_item // Return Item.
|
684 |
+
var p_year // 4-digit year
|
685 |
+
var p_format // Date format (YYYY-MM-DD, DD/MM/YYYY, ...)
|
686 |
+
|
687 |
+
Calendar.Months = CalendarMonths[ggLang];
|
688 |
+
Calendar.Weekdays = CalendarWeekdays[ggLang];
|
689 |
+
|
690 |
+
p_item = arguments[0];
|
691 |
+
if (arguments[1] == "" || arguments[1] == null)
|
692 |
+
p_year = new String(gNow.getFullYear().toString());
|
693 |
+
else
|
694 |
+
p_year = arguments[1];
|
695 |
+
if (arguments[2] == "" || arguments[2] == null)
|
696 |
+
p_format = datFormat[ggLang];
|
697 |
+
else
|
698 |
+
p_format = arguments[2];
|
699 |
+
|
700 |
+
if (OLns4) return overlib(calmsg[ggLang][6]+p_format,
|
701 |
+
FGCOLOR,'#ffffcc', TEXTSIZE,2, STICKY, NOCLOSE, OFFSETX,-10, OFFSETY,-10,
|
702 |
+
WIDTH,110, BASE,2);
|
703 |
+
|
704 |
+
Build(p_item, null, p_year, p_format);
|
705 |
+
}
|
js/overlibmws/cornerBL.gif
ADDED
Binary file
|
js/overlibmws/cornerBR.gif
ADDED
Binary file
|
js/overlibmws/cornerTL.gif
ADDED
Binary file
|
js/overlibmws/cornerTR.gif
ADDED
Binary file
|
js/overlibmws/edgeB.gif
ADDED
Binary file
|
js/overlibmws/edgeL.gif
ADDED
Binary file
|
js/overlibmws/edgeR.gif
ADDED
Binary file
|
js/overlibmws/edgeT.gif
ADDED
Binary file
|
js/overlibmws/exit.gif
ADDED
Binary file
|
js/overlibmws/exit_blue.gif
ADDED
Binary file
|
js/overlibmws/exit_metallic.gif
ADDED
Binary file
|
js/overlibmws/flower.gif
ADDED
Binary file
|
js/overlibmws/htmlspecialcharsmws.js
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
htmlspecialcharsmws.js - Foteos Macrides (author and Copyright holder)
|
3 |
+
Initial: January 26, 2008 - Last Revised: March 28, 2008
|
4 |
+
Wrapper function set for performing the equivalent of the php
|
5 |
+
htmlspecialchars(sting, quote_style) function on html fragments
|
6 |
+
(see: http://us2.php.net/manual/en/function.htmlspecialchars.php)
|
7 |
+
to display the raw markup via overlibmws STICKY, EXCLUSIVE popups.
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
/* Optional second argment values (ampersands and angle brackets always converted)
|
12 |
+
none or 0: convert double qoutes but not single quotes
|
13 |
+
ENT_NOQUOTES: don't covert either
|
14 |
+
ENT_QUOTES: convert both
|
15 |
+
*/
|
16 |
+
var ENT_NOQUOTES=1,ENT_QUOTES=2;
|
17 |
+
|
18 |
+
/* Covert an html fragment */
|
19 |
+
function OLhtmlspecialchars(str,quo){
|
20 |
+
var s=(str||'').toString().replace(/&/g,"&"),q=(quo||0);
|
21 |
+
if(q!=ENT_NOQUOTES)s=s.replace(/"/g,""");
|
22 |
+
if(q==ENT_QUOTES)s=s.replace(/'/g,"'");
|
23 |
+
return s.replace(/</g,"<").replace(/>/g,">");
|
24 |
+
}
|
25 |
+
|
26 |
+
/* Convert and show arbitary Markup */
|
27 |
+
function OLshowMarkup(str,quo){
|
28 |
+
var so=OLoverHTML,s=(str||'null').toString(),q=(quo||0);
|
29 |
+
overlib(OLhtmlspecialchars(s,q), CAPTION,'<div align="center">Markup</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,
|
30 |
+
BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,
|
31 |
+
CGCOLOR,'#999999', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',
|
32 |
+
TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,
|
33 |
+
(OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);
|
34 |
+
OLoverHTML=so;
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Convert and show most recent OLoverHTML */
|
38 |
+
function OLoverHTMLshow(quo){
|
39 |
+
var so=OLoverHTML,s=(so||'null').toString(),q=(quo||0);
|
40 |
+
overlib(OLhtmlspecialchars(s,q), CAPTION,'<div align="center">OLoverHTML</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,
|
41 |
+
BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,
|
42 |
+
CGCOLOR,'#999999', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',
|
43 |
+
TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,
|
44 |
+
(OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);
|
45 |
+
OLoverHTML=so;
|
46 |
+
}
|
47 |
+
|
48 |
+
/* Convert and show most recent OLover2HTML */
|
49 |
+
function OLover2HTMLshow(quo){
|
50 |
+
var so=OLoverHTML,s2=(OLover2HTML||'null').toString(),q=(quo||0);
|
51 |
+
overlib(OLhtmlspecialchars(s2,q), CAPTION,'<div align="center">OLover2HTML</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,
|
52 |
+
BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,
|
53 |
+
CGCOLOR,'#aaaaaa', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',
|
54 |
+
TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,
|
55 |
+
(OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);
|
56 |
+
OLoverHTML=so;
|
57 |
+
}
|
58 |
+
|
59 |
+
/* Convert and show most recent OLresponseAJAX */
|
60 |
+
function OLresponseAJAXshow(quo){
|
61 |
+
var so=OLoverHTML,s=(OLresponseAJAX||'null').toString(),q=(quo||0);
|
62 |
+
overlib(OLhtmlspecialchars(s,q), CAPTION,'<div align="center">OLresponseAJAX</div>', EXCLUSIVEOVERRIDE, STICKY, EXCLUSIVE,
|
63 |
+
BGCLASS,'', BORDER,1, BGCOLOR,'#666666', BASE,0, CGCLASS,'', CAPTIONFONTCLASS,'', CLOSEFONTCLASS,'', CAPTIONPADDING,6,
|
64 |
+
CGCOLOR,'#999999', CAPTIONSIZE,'12px', CAPCOLOR,'#ffffff', CLOSESIZE,'11px', CLOSECOLOR,'#ffffff', FGCLASS,'',
|
65 |
+
TEXTFONTCLASS,'', TEXTPADDING,6, FGCOLOR,'#eeeeee', TEXTSIZE,'12px', TEXTCOLOR,'#000000', MIDX,0, RELY,5, WRAP,
|
66 |
+
(OLfilterPI)?-FILTER:DONOTHING, (OLshadowPI)?-SHADOW:DONOTHING);
|
67 |
+
OLoverHTML=so;
|
68 |
+
}
|
js/overlibmws/iframecontentmws.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
iframecontentmws.js - Foteos Macrides (author and copyright holder)
|
3 |
+
Initial: October 10, 2004 - Last Revised: January 26, 2008
|
4 |
+
Scripts for using HTML documents as iframe content in overlibmws popups.
|
5 |
+
|
6 |
+
See http://www.macridesweb.com/oltest/IFRAME.html
|
7 |
+
and http://www.macridesweb.com/oltest/AJAX.html#ajaxex3
|
8 |
+
for more information.
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*
|
12 |
+
Use as lead argument in overlib or overlb2 calls. Include WRAP and
|
13 |
+
TEXTPADDING,0 in the call to ensure that the width arg is respected (unless
|
14 |
+
the CAPTION plus CLOSETEXT widths add up to more than the width arg, in which
|
15 |
+
case you should increase the width arg). The name arg should be a unique
|
16 |
+
string for each popup with iframe content in the document. The frameborder
|
17 |
+
arg should be 1 (browser default if omitted) or 0. The scrolling arg should
|
18 |
+
be 'auto' (default if omitted), 'yes' or 'no'.
|
19 |
+
*/
|
20 |
+
function OLiframeContent(src, width, height, name, frameborder, scrolling) {
|
21 |
+
return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
|
22 |
+
+(name!=null?' name="'+name+'" id="'+name+'"':'')
|
23 |
+
+(frameborder!=null?' frameborder="'+frameborder+'"':'')
|
24 |
+
+' scrolling="'+(scrolling!=null?scrolling:'auto')
|
25 |
+
+'"><div>[iframe not supported]</div></iframe>');
|
26 |
+
}
|
27 |
+
|
28 |
+
/*
|
29 |
+
Swap the src if we are iframe content. The name arg should be the same
|
30 |
+
string as in the OLiframeContent function for the popup. The src arg is
|
31 |
+
a partial, relative, or complete URL for the document to be swapped in.
|
32 |
+
*/
|
33 |
+
function OLswapIframeSrc(name, src){
|
34 |
+
if(parent==self){
|
35 |
+
alert(src+'\n\n is only for iframe content');
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
var o=parent.OLgetRef(name);
|
39 |
+
if(o)o.src=src;
|
40 |
+
else alert(src+'\n\n is not available');
|
41 |
+
}
|
42 |
+
|
43 |
+
/*
|
44 |
+
Emulate the Back button if we are iframe content. Use only in documents
|
45 |
+
which are swapped in by using the OLswapIframeSrc function.
|
46 |
+
*/
|
47 |
+
function OLiframeBack(){
|
48 |
+
if(parent==self){
|
49 |
+
alert('This feature is only for iframe content');
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
history.back();
|
53 |
+
}
|
js/overlibmws/inputText.gif
ADDED
Binary file
|
js/overlibmws/license.html
ADDED
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
2 |
+
"http://www.w3.org/TR/html4/loose.dtd">
|
3 |
+
<html>
|
4 |
+
<head>
|
5 |
+
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1">
|
6 |
+
<meta name="keywords" content="overlib, overlibmws, DHTML popups, DHTML tooltips, DHTML, popup, tooltip, Macrides Web Services, Macrides">
|
7 |
+
<meta name="description" content="Open source license for the overlibmws DHTML popup and tooltip software package.">
|
8 |
+
<meta name="author" content="Foteos Macrides">
|
9 |
+
<title>overLIB - License for the overlibmws package</title>
|
10 |
+
|
11 |
+
<script type="text/javascript">
|
12 |
+
<!--
|
13 |
+
var OLbubbleImageDir='http://www.macridesweb.com/oltest/';
|
14 |
+
var OLbubbleImages='flower';
|
15 |
+
//-->
|
16 |
+
</script>
|
17 |
+
|
18 |
+
<script type="text/javascript"
|
19 |
+
src="http://www.macridesweb.com/oltest/overlibmws.js"></script>
|
20 |
+
<script type="text/javascript"
|
21 |
+
src="http://www.macridesweb.com/oltest/overlibmws_filter.js"></script>
|
22 |
+
<script type="text/javascript"
|
23 |
+
src="http://www.macridesweb.com/oltest/overlibmws_bubble.js"></script>
|
24 |
+
<script type="text/javascript"
|
25 |
+
src="http://www.macridesweb.com/oltest/overlibmws_shadow.js"></script>
|
26 |
+
|
27 |
+
<script type="text/javascript">
|
28 |
+
<!--
|
29 |
+
OLpageDefaults(TEXTPADDING,6,CAPTIONPADDING,6,WRAP,
|
30 |
+
FILTER,FILTERSHADOW,1,FILTERSHADOWCOLOR,'#cf33cf',
|
31 |
+
SHADOW,SHADOWCOLOR,'#cf33cf',SHADOWOPACITY,100);
|
32 |
+
|
33 |
+
// Preload backgound images.
|
34 |
+
rainbowline=new Image();
|
35 |
+
rainbowline.src="http://www.macridesweb.com/image/rainbowline.gif"
|
36 |
+
rb=new Image();
|
37 |
+
rb.src="http://www.macridesweb.com/image/rb.jpg"
|
38 |
+
// -->
|
39 |
+
</script>
|
40 |
+
|
41 |
+
<style type="text/css">
|
42 |
+
<!--
|
43 |
+
.oltxt14 {font-family:Verdana;font-size:14px;font-weight:bold;color:#330033;}
|
44 |
+
a {color:#338855;font-weight:bold;}
|
45 |
+
a:hover {color:#FF00FF}
|
46 |
+
.txtb12 {font-family:Verdana,Arial,sans-serif;font-size:12px;font-weight:bold;}
|
47 |
+
.text14 {font-family:Verdana,Arial,sans-serif;font-size:14px;}
|
48 |
+
.text20 {font-family:Verdana,Arial,sans-serif;font-size:20px;font-weight:bold;}
|
49 |
+
.text22 {font-family:Verdana,Arial,sans-serif;font-size:22px;font-weight:bold;}
|
50 |
+
.myText {font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;color:#000000;}
|
51 |
+
.snip {font-family:Verdana,Arial,Helvetica;font-size:10px;}
|
52 |
+
.purple14 {font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;color:purple;
|
53 |
+
font-weight:bold;}
|
54 |
+
.purple22 {font-family:Verdana,Arial,Helvetica,sans-serif;font-size:22px;color:purple;
|
55 |
+
font-weight:bold;font-style:italic;}
|
56 |
+
.comic20 {font-family:'Comic Sans MS';font-size:20px;}
|
57 |
+
-->
|
58 |
+
</style>
|
59 |
+
</head>
|
60 |
+
|
61 |
+
<body text="#000000" bgcolor="#ddeeff">
|
62 |
+
|
63 |
+
<table width="90%" cellpadding="0" cellspacing="0" align="center">
|
64 |
+
<tr>
|
65 |
+
<td align="center" class="text22">
|
66 |
+
Open Source License for the <span class="purple22">overlibmws</span> Package
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
<tr>
|
70 |
+
<td class="text14">
|
71 |
+
<br>
|
72 |
+
<span class="text20">1. License coverage</span>
|
73 |
+
<br><br>
|
74 |
+
Note that this license only covers the script library (javascript core and plugin modules)
|
75 |
+
and not any supporting material such as the <span class="purple14">overlibmws</span> <a
|
76 |
+
href="http://www.macridesweb.com/oltest/"
|
77 |
+
onmouseover="return overlib('Link to the Download and Test Directory for '
|
78 |
+
+'<span class=\'purple14\'><i>overlibmws</i></span>',
|
79 |
+
TEXTFONTCLASS,'myText', VAUTO, OFFSETY,20, CENTER, FGCOLOR,'#cceeff');"
|
80 |
+
onmouseout="nd();">website</a> or its online documentation and support files. You may not
|
81 |
+
reproduce the website or its online material without explicit written permission from the
|
82 |
+
author, but can freely incorporate scripts and procedures which are demonstrated in that
|
83 |
+
material into your own HTML or XML documents.
|
84 |
+
<br><br>
|
85 |
+
<span class="text20">2. License (Artistic)</span>
|
86 |
+
<ul>
|
87 |
+
<li>
|
88 |
+
<b>Preamble</b><br>
|
89 |
+
The intent of this document is to state the conditions under which a Package may be
|
90 |
+
copied, such that the Copyright Holder maintains some semblance of artistic control over
|
91 |
+
the development of the package, while giving the users of the package the right to use
|
92 |
+
and distribute the Package in a more-or-less customary fashion, plus the right to make
|
93 |
+
reasonable modifications.
|
94 |
+
</li>
|
95 |
+
</ul>
|
96 |
+
<ul>
|
97 |
+
<li>
|
98 |
+
<b>Definitions:</b><br>
|
99 |
+
"Package" refers to the collection of files distributed by the Copyright Holder, and
|
100 |
+
derivatives of that collection of files created through textual modification.
|
101 |
+
<br><br>
|
102 |
+
"Standard Version" refers to such a Package if it has not been modified, or has been
|
103 |
+
modified in accordance with the wishes of the Copyright Holder.
|
104 |
+
<br><br>
|
105 |
+
"Copyright Holder" is whoever is named in the copyright or copyrights for the package.
|
106 |
+
<br><br>
|
107 |
+
"You" is you, if you're thinking about copying or distributing this Package.
|
108 |
+
<br><br>
|
109 |
+
"Reasonable copying fee" is whatever you can justify on the basis of media cost,
|
110 |
+
duplication charges, time of people involved, and so on. (You will not be required to
|
111 |
+
justify it to the Copyright Holder, but only to the computing community at large as a
|
112 |
+
market that must bear the fee.)
|
113 |
+
<br><br>
|
114 |
+
"Freely Available" means that no fee is charged for the item itself, though there may be
|
115 |
+
fees involved in handling the item. It also means that recipients of the item may
|
116 |
+
redistribute it under the same conditions they received it.
|
117 |
+
</li>
|
118 |
+
</ul>
|
119 |
+
<ol>
|
120 |
+
<li>
|
121 |
+
You may make and give away verbatim copies of the source form of the Standard Version
|
122 |
+
of this Package without restriction, provided that you duplicate all of the original
|
123 |
+
copyright notices and associated disclaimers.
|
124 |
+
</li>
|
125 |
+
<li>
|
126 |
+
You may apply bug fixes, portability fixes and other modifications derived from the
|
127 |
+
Public Domain or from the Copyright Holder. A Package modified in such a way shall still
|
128 |
+
be considered the Standard Version.
|
129 |
+
</li>
|
130 |
+
<li>
|
131 |
+
You may otherwise modify your copy of this Package in any way, provided that you insert
|
132 |
+
a prominent notice in each changed file stating how and when you changed that file, and
|
133 |
+
provided that you do at least ONE of the following:
|
134 |
+
<ol>
|
135 |
+
<li>
|
136 |
+
place your modifications in the Public Domain or otherwise make them Freely Available,
|
137 |
+
such as by posting said modifications to Usenet or an equivalent medium, or placing the
|
138 |
+
modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright
|
139 |
+
Holder to include your modifications in the Standard Version of the Package.
|
140 |
+
</li>
|
141 |
+
<li>
|
142 |
+
use the modified Package only within your corporation or organization.
|
143 |
+
</li>
|
144 |
+
<li>
|
145 |
+
rename any non-standard executables so the names do not conflict with standard
|
146 |
+
executables, which must also be provided, and provide a separate manual page for each
|
147 |
+
non-standard executable that clearly documents how it differs from the Standard Version.
|
148 |
+
</li>
|
149 |
+
<li>
|
150 |
+
make other distribution arrangements with the Copyright Holder.
|
151 |
+
</li>
|
152 |
+
</ol>
|
153 |
+
</li>
|
154 |
+
<li>
|
155 |
+
You may distribute the programs of this Package in object code or executable form,
|
156 |
+
provided that you do at least ONE of the following:
|
157 |
+
<ol>
|
158 |
+
<li>
|
159 |
+
distribute a Standard Version of the executables and library files, together with
|
160 |
+
instructions (in the manual page or equivalent) on where to get the Standard Version.
|
161 |
+
</li>
|
162 |
+
<li>
|
163 |
+
accompany the distribution with the machine-readable source of the Package with your
|
164 |
+
modifications.
|
165 |
+
</li>
|
166 |
+
<li>
|
167 |
+
accompany any non-standard executables with their corresponding Standard Version
|
168 |
+
executables, giving the non-standard executables non-standard names, and clearly
|
169 |
+
documenting the differences in manual pages (or equivalent), together with instructions
|
170 |
+
on where to get the Standard Version.
|
171 |
+
</li>
|
172 |
+
<li>
|
173 |
+
make other distribution arrangements with the Copyright Holder.
|
174 |
+
</li>
|
175 |
+
</ol>
|
176 |
+
</li>
|
177 |
+
<li>
|
178 |
+
You may charge a reasonable copying fee for any distribution of this Package. You may
|
179 |
+
charge any fee you choose for support of this Package. You may not charge a fee for this
|
180 |
+
Package itself. However, you may distribute this Package in aggregate with other (possibly
|
181 |
+
commercial) programs as part of a larger (possibly commercial) software distribution
|
182 |
+
provided that you do not advertise this Package as a product of your own.
|
183 |
+
</li>
|
184 |
+
<li>
|
185 |
+
The scripts and library files supplied as input to or produced as output from the programs
|
186 |
+
of this Package do not automatically fall under the copyright of this Package, but belong
|
187 |
+
to whomever generated them, and may be sold commercially, and may be aggregated with this
|
188 |
+
Package.
|
189 |
+
</li>
|
190 |
+
<li>
|
191 |
+
C or perl subroutines supplied by you and linked into this Package shall not be considered
|
192 |
+
part of this Package.
|
193 |
+
</li>
|
194 |
+
<li>
|
195 |
+
The name of the Copyright Holder may not be used to endorse or promote products derived
|
196 |
+
from this software without specific prior written permission.
|
197 |
+
</li>
|
198 |
+
<li>
|
199 |
+
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
200 |
+
WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
201 |
+
PURPOSE.
|
202 |
+
</li>
|
203 |
+
</ol>
|
204 |
+
<br>
|
205 |
+
</td>
|
206 |
+
</tr>
|
207 |
+
</table>
|
208 |
+
|
209 |
+
<table align="center" cellpadding="0" cellspacing="0" border="0" bgcolor="#ccddff">
|
210 |
+
<tr>
|
211 |
+
<td width="90" align="right" valign="middle" class="myText">
|
212 |
+
<a
|
213 |
+
href="http://www.macridesweb.com/oltest/"
|
214 |
+
onmousemove="if(OLie55)self.status=this.href;"
|
215 |
+
onmouseover="return overlib(
|
216 |
+
'Popups by <span class=\'purple14\'><i>overlibmws</i></span>',
|
217 |
+
REF,'logo',REFX,96,REFY,-4,BORDER,3,BASE,3,TEXTPADDING,4,TEXTFONTCLASS,'oltxt14',
|
218 |
+
FGBACKGROUND,'http://www.macridesweb.com/image/rb.jpg',
|
219 |
+
BGBACKGROUND,'http://www.macridesweb.com/image/rainbowline.gif');"
|
220 |
+
onmouseout="nd();"><img
|
221 |
+
name='logo' id="logo"
|
222 |
+
width="88" height="31" hspace="10" vspace="10" align="right" border="0" alt=""
|
223 |
+
src="http://www.macridesweb.com/image/overlibmwslogo.gif"></a><br>
|
224 |
+
</td>
|
225 |
+
<td valign="middle" class="snip">
|
226 |
+
Copyright Foteos Macrides<br>
|
227 |
+
2002-2009.<br>
|
228 |
+
All rights reserved.<br>
|
229 |
+
</td>
|
230 |
+
<td width="72" align="right" valign="middle" class="myText">
|
231 |
+
<a
|
232 |
+
target="_blank"
|
233 |
+
href="https://www.paypal.com/xclick/business=overlibmws%40macridesweb.com&item_name=Donation+for+overlibmws&no_note=1&tax=0&currency_code=USD"
|
234 |
+
onmousemove="if(OLie55)self.status=this.href;"
|
235 |
+
onmouseover="return overlib(
|
236 |
+
'The <span class=\'purple14\'><i>overlibmws</i></span> library '
|
237 |
+
+'and its support materials at this site are <br>free to download and use, but '
|
238 |
+
+'voluntary donations via PayPal are<br>appreciated (donations via PayPal are fast, '
|
239 |
+
+'simple, and secure).',TEXTPADDING,8,FGCOLOR,'#bbddff',
|
240 |
+
FGBACKGROUND,'http://www.macridesweb.com/image/rb.jpg',
|
241 |
+
REF,'logo',REFC,'UL',REFP,'LL',REFX,-10,REFY,-10,TEXTFONTCLASS,'txtb12',BORDER,6,BASE,6,
|
242 |
+
BGBACKGROUND,'http://www.macridesweb.com/image/rainbowline.gif');"
|
243 |
+
onmouseout="nd();"><img
|
244 |
+
src="http://www.macridesweb.com/image/PayPalDonate.gif"
|
245 |
+
width="62" height="31" border="0"
|
246 |
+
alt=""></a><br>
|
247 |
+
</td>
|
248 |
+
<td width="110" align="right" valign="middle" class="myText">
|
249 |
+
<a
|
250 |
+
onmousemove="if(OLie55)self.status=this.href;"
|
251 |
+
onmouseover="return overlib(' Valid HTML 4.01',BUBBLE,
|
252 |
+
TEXTFONTCLASS,'comic20',REF,'w3c',REFC,'UR',REFP,'LR',REFX,73,REFY,2,
|
253 |
+
FILTERSHADOW,1,FILTERSHADOWCOLOR,'#00B000');"
|
254 |
+
onmouseout="nd();"
|
255 |
+
href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.macridesweb.com%2Foltest%2Flicense.html"><img
|
256 |
+
name="w3c" id="w3c"
|
257 |
+
border="0" height="31" width="88" alt="" hspace="6"
|
258 |
+
src="http://www.macridesweb.com/image/valid-html401.gif"></a><br>
|
259 |
+
</td>
|
260 |
+
</tr>
|
261 |
+
</table>
|
262 |
+
<br>
|
263 |
+
|
264 |
+
</body>
|
265 |
+
</html>
|
js/overlibmws/loading.gif
ADDED
Binary file
|
js/overlibmws/objectcontentmws.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
objectcontentmws.js - Foteos Macrides
|
3 |
+
Initial: October 10, 2004 - Last Revised: January 26, 2008
|
4 |
+
Simple script for using an HTML file as object content in overlibmws popups.
|
5 |
+
Include WRAP and TEXTPADDING,0 in the overlib call to ensure that the width
|
6 |
+
argument is respected (unless the CAPTION plus CLOSETEXT widths add up to more
|
7 |
+
than the width argument, in which case you should increase the width argument).
|
8 |
+
|
9 |
+
See http://www.macridesweb.com/oltest/overflow.html for demonstrations.
|
10 |
+
*/
|
11 |
+
|
12 |
+
function OLobjectContent(data, width, height, name) {
|
13 |
+
return ('<object data="'+data+'" width="'+width+'" height="'+height+'"'
|
14 |
+
+(name?' name="'+name+'" id="'+name+'"':'')+' type="text/html">'
|
15 |
+
+'<div>[object not supported]</div></object>');
|
16 |
+
}
|
js/overlibmws/oval.gif
ADDED
Binary file
|
js/overlibmws/overlibCompat.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
////////////////////////////////////////////////////////////////////////////////////
|
2 |
+
// OVERLIB 2 COMPATABILITY FUNCTIONS
|
3 |
+
// Include this if you are upgrading from overlib v2.x. Otherwise, forget it.
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Converts old 0=left, 1=right and 2=center into constants.
|
6 |
+
function vpos_convert(d){if(d==0){d=LEFT;}else{if(d==1){d=RIGHT;}else{d=CENTER;}}return d;}
|
7 |
+
// Simple popup
|
8 |
+
function dts(d,text){o3_hpos=vpos_convert(d);overlib(text,o3_hpos,CAPTION,"");}
|
9 |
+
// Caption popup
|
10 |
+
function dtc(d,text,title){o3_hpos=vpos_convert(d);overlib(text,CAPTION,title,o3_hpos);}
|
11 |
+
// Sticky
|
12 |
+
function stc(d,text,title){o3_hpos=vpos_convert(d);overlib(text,CAPTION,title,o3_hpos,STICKY);}
|
13 |
+
// Simple popup right
|
14 |
+
function drs(text){dts(1,text);}
|
15 |
+
// Caption popup right
|
16 |
+
function drc(text,title){dtc(1,text,title);}
|
17 |
+
// Sticky caption right
|
18 |
+
function src(text,title){stc(1,text,title);}
|
19 |
+
// Simple popup left
|
20 |
+
function dls(text){dts(0,text);}
|
21 |
+
// Caption popup left
|
22 |
+
function dlc(text,title){dtc(0,text,title);}
|
23 |
+
// Sticky caption left
|
24 |
+
function slc(text,title){stc(0,text,title);}
|
25 |
+
// Simple popup center
|
26 |
+
function dcs(text){dts(2,text);}
|
27 |
+
// Caption popup center
|
28 |
+
function dcc(text,title){dtc(2,text,title);}
|
29 |
+
// Sticky caption center
|
30 |
+
function scc(text,title){stc(2,text,title);}
|
js/overlibmws/overlibConfig.txt
ADDED
@@ -0,0 +1,650 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Below are described the configuration variables and arrays associated with the
|
3 |
+
overlib commands, and their defaults as set in the
|
4 |
+
overlibmws.js
|
5 |
+
core module and the
|
6 |
+
overlibmws_bubble.js, overlibmws_crossframe.js, overlibmws_debug.js,
|
7 |
+
overlibmws_draggable.js, overlibmws_exclusive.js, overlib_filter.js,
|
8 |
+
overlibmws_function.js, overlibmws_hide.js, overlibmws_modal.js,
|
9 |
+
overlibmws_overtwo.js, overlibmws_print.js, overlibmws_scroll.js and
|
10 |
+
overlibmws_shadow.js
|
11 |
+
plugin modules. The
|
12 |
+
overlibmws_iframe.js and overlib_regCore.js
|
13 |
+
plugin modules do not have configuration variables or arrays.
|
14 |
+
|
15 |
+
You can change any of the configuration default values for all pages by making
|
16 |
+
the modifications in overlibmws.js or the plugin modules, or for individual HTML
|
17 |
+
pages by declaring any of these variables with the values you prefer in a SCRIPT
|
18 |
+
block or imported js file for those pages.
|
19 |
+
|
20 |
+
You instead can change the configuration default values for individual HTML pages by
|
21 |
+
calling the OLpageDefaults(arguments) function in a SCRIPT block or imported js file
|
22 |
+
with "arguments" consisting of a comma-separated list of uppercase command names and
|
23 |
+
their parameters if any, homologously to the arguments for an overlib() call.
|
24 |
+
|
25 |
+
The overlibmws_overtwo.js module is used by calling overlib2() and nd2() from within
|
26 |
+
an overlib() call that invokes a primary popup, to invoke and close secondary popups.
|
27 |
+
Its LABLE2 command and its configuration variable are specific to the secondary popups,
|
28 |
+
and are complementary to the core module's LABLEL command and its configuration variable
|
29 |
+
for primary popups.
|
30 |
+
|
31 |
+
The overlibmws_iframe.js module has no additional commands, and thus no configuration
|
32 |
+
variables. It should be imported when a page has system controls (e.g., some form
|
33 |
+
elements, flash objects, applets) which obscure overlib popups. It corrects this
|
34 |
+
problem for IE v5.5 or higher. For versions of IE lower than v5.5 and for other browsers,
|
35 |
+
you can use commands in the overlibmws_hide.js plugin module. See the examples in
|
36 |
+
http://www.macridesweb.com/oltest/hide.html and http://www.macridesweb.com/oltest/flash.html
|
37 |
+
on how to use those command to hide the system controls when overlib popups are invoked.
|
38 |
+
|
39 |
+
The overlibmws_regCore.js module has no overlib() or overlib2() commands, and thus
|
40 |
+
no configuration variables. It should be imported in frames which will not themselves
|
41 |
+
import the core module and any plugin modules, but instead will use those in another
|
42 |
+
frame. See its header for more information. Examples of its use are in
|
43 |
+
http://www.macridesweb.com/oltest/testFrame.html
|
44 |
+
|
45 |
+
See the overlibmws Command Reference (http://www.macridesweb.com/oltest/commandRef.html)
|
46 |
+
for more information about the commands, configuration variables, and plugin modules.
|
47 |
+
|
48 |
+
|
49 |
+
////////////////////////////////////////////////////////////////////////////////////
|
50 |
+
// DEFAULT CONFIGURATION FOR CORE MODULE overlibmws.js
|
51 |
+
////////////////////////////////////////////////////////////////////////////////////
|
52 |
+
|
53 |
+
// FGCOLOR - Main background color (the large area).
|
54 |
+
// Usually a bright color (white, yellow etc).
|
55 |
+
var ol_fgcolor = "#CCCCFF";
|
56 |
+
|
57 |
+
// BGCOLOR - Border color.
|
58 |
+
// Usually a dark color (black, brown etc).
|
59 |
+
var ol_bgcolor = "#333399";
|
60 |
+
|
61 |
+
// CGCOLOR - Caption background color (typically same as border color).
|
62 |
+
// Usually a dark color (black, brown etc).
|
63 |
+
var ol_cgcolor = "#333399";
|
64 |
+
|
65 |
+
// TEXTCOLOR - Text color.
|
66 |
+
// Usually a dark color.
|
67 |
+
var ol_textcolor = "#000000";
|
68 |
+
|
69 |
+
// CAPCOLOR - Color of the caption text.
|
70 |
+
// Usually a bright color
|
71 |
+
var ol_capcolor = "#FFFFFF";
|
72 |
+
|
73 |
+
// CLOSECOLOR - Color of "Close" when using Sticky.
|
74 |
+
// Usually a semi-bright color.
|
75 |
+
var ol_closecolor = "#9999FF";
|
76 |
+
|
77 |
+
// TEXTFONT - Font face for the main text.
|
78 |
+
var ol_textfont = "Verdana,Arial,Helvetica";
|
79 |
+
|
80 |
+
// CAPTIONFONT - Font face for the caption.
|
81 |
+
var ol_captionfont = "Verdana,Arial,Helvetica";
|
82 |
+
|
83 |
+
// CLOSEFONT - Font face for the close text.
|
84 |
+
var ol_closefont = "Verdana,Arial,Helvetica";
|
85 |
+
|
86 |
+
// TEXTSIZE - Font size for the main text.
|
87 |
+
var ol_textsize = "1";
|
88 |
+
|
89 |
+
// CAPTIONSIZE - Font size for the caption.
|
90 |
+
var ol_captionsize = "1";
|
91 |
+
|
92 |
+
// CLOSESIZE - Font size for the close text.
|
93 |
+
var ol_closesize = "1";
|
94 |
+
|
95 |
+
// FGCLASS - Main background class.
|
96 |
+
var ol_fgclass = "";
|
97 |
+
|
98 |
+
// BGCLASS - Frame background class.
|
99 |
+
var ol_bgclass = "";
|
100 |
+
|
101 |
+
// CGCLASS - Caption background class.
|
102 |
+
var ol_cgclass = "";
|
103 |
+
|
104 |
+
// TEXTPADDING - Padding for main text.
|
105 |
+
var ol_textpadding = "2";
|
106 |
+
|
107 |
+
// TEXTFONTCLASS - Main font class.
|
108 |
+
var ol_textfontclass = "";
|
109 |
+
|
110 |
+
// CAPTIONPADDING - Padding for caption (including Close text if present).
|
111 |
+
var ol_captionpadding = "2";
|
112 |
+
|
113 |
+
// CAPTIONFONTCLASS - Caption font class.
|
114 |
+
var ol_captionfontclass = "";
|
115 |
+
|
116 |
+
// CLOSEFONTCLASS - Close font class.
|
117 |
+
var ol_closefontclass = "";
|
118 |
+
|
119 |
+
// CLOSECLICK - If the user has to click to close stickies.
|
120 |
+
var ol_closeclick = 0;
|
121 |
+
|
122 |
+
// CLOSETEXT - Text for the closing sticky popups. Normal is "Close".
|
123 |
+
var ol_close = "Close";
|
124 |
+
|
125 |
+
// CLOSETITLE - Text to use as value of TITLE attribute for browser-generated TooTips
|
126 |
+
// with the "Close" link in captions of stickies when CLOSECLICK is changed to 1;
|
127 |
+
var ol_closetitle = "Click to Close";
|
128 |
+
|
129 |
+
// Default text for popups
|
130 |
+
// Should you forget to pass something to overLIB this will be displayed.
|
131 |
+
var ol_text = "Default Text";
|
132 |
+
|
133 |
+
// Default caption
|
134 |
+
// You should leave this blank or you will have problems making non caps popups.
|
135 |
+
var ol_cap = "";
|
136 |
+
|
137 |
+
// CAPBELOW - Whether the caption should appear below the main text area. Default is
|
138 |
+
// off (0) such that the caption appears above.
|
139 |
+
var ol_capbelow=0;
|
140 |
+
|
141 |
+
// BACKGROUND - Default background image. Better left empty unless you always want one.
|
142 |
+
var ol_background = "";
|
143 |
+
|
144 |
+
// WIDTH - Default width of the popups in pixels. 100-300 pixels is typical.
|
145 |
+
// This value is simply a suggestion to the browser, which may change the
|
146 |
+
// actual width depending on the content.
|
147 |
+
var ol_width = "200";
|
148 |
+
|
149 |
+
// WRAP - Intended to keep the popup no wider than its content plus normal padding, but
|
150 |
+
// to wrap the content if it would exceed the window width, or if it would exceed WRAPMAX
|
151 |
+
// when that has been set to a value greater than zero.
|
152 |
+
// Overrides the o3_width setting. Default is no wrap (0).
|
153 |
+
var ol_wrap = 0;
|
154 |
+
|
155 |
+
// WRAPMAX - If set to a value greater than 0, sets the maximum width of the popup, up to
|
156 |
+
// the window width, before wrapping occurs when the WRAP command is set.
|
157 |
+
var ol_wrapmax = 0;
|
158 |
+
|
159 |
+
// HEIGHT - Default height for popup. Often best left alone.
|
160 |
+
var ol_height = -1;
|
161 |
+
|
162 |
+
// BORDER - How thick the ol_border should be in pixels.
|
163 |
+
// 1-3 pixels is typical.
|
164 |
+
var ol_border = "1";
|
165 |
+
|
166 |
+
// BASE - Any additional thickening of the border's base in pixels.
|
167 |
+
var ol_base = "0";
|
168 |
+
|
169 |
+
// OFFSETX - How many pixels to the right (positive values) or left (negative values)
|
170 |
+
// of the cursor to show the popup. Values between 3 and 12 are best.
|
171 |
+
var ol_offsetx = 10;
|
172 |
+
|
173 |
+
// OFFSETY - How many pixels below (positive values) or above (negative values) the
|
174 |
+
// cursor to show the popup. Values between 3 and 20 are best.
|
175 |
+
var ol_offsety = 10;
|
176 |
+
|
177 |
+
// STICKY - Decides if sticky popups are default. 0 for non, 1 for stickies.
|
178 |
+
var ol_sticky = 0;
|
179 |
+
|
180 |
+
// NOFOLLOW - Should non-sticky popups not follow cursor movements (i.e., remain
|
181 |
+
// stationary where initially positioned on invocation, like title-based tooltips).
|
182 |
+
var ol_nofollow = 0;
|
183 |
+
|
184 |
+
// NOCLOSE - Omit Close text in stickies with captions, for all stickies use mouse off
|
185 |
+
// after mouse over sticky to close, and cancel any timeout while over sticky.
|
186 |
+
var ol_noclose = 0;
|
187 |
+
|
188 |
+
// MOUSEOFF - For stickies which do have a caption with a CLOSETEXT, also use mouse off
|
189 |
+
// after mouse over sticky to close, and cancel any timeout while over sticky.
|
190 |
+
var ol_mouseoff = 0;
|
191 |
+
|
192 |
+
// OFFDELAY - Default delay for closing NOCLOSE or MOUSEOFF popups. If a mouse over the
|
193 |
+
// sticky occurs during this delay, the close is cancelled.
|
194 |
+
var ol_delay = 300;
|
195 |
+
|
196 |
+
// RIGHT - Default vertical alignment for popups.
|
197 |
+
// It's best to leave RIGHT here. Other options are LEFT and CENTER.
|
198 |
+
var ol_hpos = RIGHT;
|
199 |
+
|
200 |
+
// BELOW - Default vertical position of the popups.
|
201 |
+
// It's best to leave BELOW here. Other options are ABOVE and VCENTER.
|
202 |
+
var ol_vpos = BELOW;
|
203 |
+
|
204 |
+
// Default status bar text when a popup is invoked.
|
205 |
+
var ol_status = "";
|
206 |
+
|
207 |
+
// AUTOSTATUS, AUTOSTATUSCAP - If the status bar automatically should load either
|
208 |
+
// text or caption. 0=nothing, 1=text, 2=caption
|
209 |
+
var ol_autostatus = 0;
|
210 |
+
|
211 |
+
// SNAPX - Horizontal grid spacing that popups will snap to.
|
212 |
+
// 0 makes no grid, anything else will cause a snap to that grid spacing.
|
213 |
+
var ol_snapx = 0;
|
214 |
+
|
215 |
+
// SNAPY - Vertical grid spacing that popups will snap to.
|
216 |
+
// 0 makes no grid, anything else will cause a snap to that grid spacing.
|
217 |
+
var ol_snapy = 0;
|
218 |
+
|
219 |
+
// FIXX - Sets the popup horizontal position to a fixed column.
|
220 |
+
// Numbers greater than -1 will cause fixed position.
|
221 |
+
var ol_fixx = -1;
|
222 |
+
|
223 |
+
// FIXY - Sets the popup vertical position to a fixed row.
|
224 |
+
// Numbers greater than -1 will cause fixed position.
|
225 |
+
var ol_fixy = -1;
|
226 |
+
|
227 |
+
// RELX - Sets the popup horizontal position to a column relative to the window display.
|
228 |
+
// Anything numeric (non-null) will cause relative position. Positive and 0 is to
|
229 |
+
// the right from left window margin for left margin of popup. Negative is to the
|
230 |
+
// left from right window margin for right margin of popup.
|
231 |
+
var ol_relx = null;
|
232 |
+
|
233 |
+
// RELY - Sets the popup vertical position to a row relative to the window display.
|
234 |
+
// Anything numeric (non-null) will cause relative position. Positive and 0 is down
|
235 |
+
// from top window margin for top margin of popup. Negaive is up from bottom window
|
236 |
+
// margin for bottom margin of popup.
|
237 |
+
var ol_rely = null;
|
238 |
+
|
239 |
+
// MIDX - Sets the popup horizontal midpoint to a column relative to the window horizontal
|
240 |
+
// midpoint. Anything numeric (non-null) will cause midpoint position. Positive and
|
241 |
+
// 0 is to the right from the window midpoint. Negative is to the left.
|
242 |
+
var ol_midx = null;
|
243 |
+
|
244 |
+
// MIDY - Sets the popup vertical midpoint to a row relative to the window vertical midpoint.
|
245 |
+
// Anything numeric (non-null) will cause midpoint position. Positive and 0 is down from
|
246 |
+
// the window midpoint. Negative is up.
|
247 |
+
var ol_midy = null;
|
248 |
+
|
249 |
+
// REF - The NAME of an anchor or image, or ID of a layer, to serve as a reference object such
|
250 |
+
// that a corner of the popup will be positioned relative to a corner of the object.
|
251 |
+
var ol_ref = "";
|
252 |
+
|
253 |
+
// REFC - Corner of the reference object for positioning.
|
254 |
+
// Value can be: 'UL' (Upper Left), 'UR', 'LR', or 'LL'.
|
255 |
+
var ol_refc = 'UL';
|
256 |
+
|
257 |
+
// REFP - Corner of the popup for positioning.
|
258 |
+
// Value can be: 'UL' (Upper Left), 'UR', 'LR', or 'LL'.
|
259 |
+
var ol_refp = 'UL';
|
260 |
+
|
261 |
+
// REFX - X displacement from the reference point. Positive to the right,
|
262 |
+
// negative left.
|
263 |
+
var ol_refx = 0;
|
264 |
+
|
265 |
+
// REFY - Y displacement from the reference point. Positive down, negative up.
|
266 |
+
var ol_refy = 0;
|
267 |
+
|
268 |
+
// FGBACKGROUND - Background image for the popup's inside.
|
269 |
+
var ol_fgbackground = "";
|
270 |
+
|
271 |
+
// BGBACKGROUND - Background image for the popup's frame (border).
|
272 |
+
var ol_bgbackground = "";
|
273 |
+
|
274 |
+
// CGBACKGROUND - Background image for the caption.
|
275 |
+
var ol_cgbackground = "";
|
276 |
+
|
277 |
+
// PADX
|
278 |
+
// How much horizontal left padding text should get by default when BACKGROUND is used.
|
279 |
+
var ol_padxl = 1;
|
280 |
+
// How much horizontal right padding text should get by default when BACKGROUND is used.
|
281 |
+
var ol_padxr = 1;
|
282 |
+
|
283 |
+
// PADY
|
284 |
+
// How much vertical top padding text should get by default when BACKGROUND is used.
|
285 |
+
var ol_padyt = 1;
|
286 |
+
// How much vertical bottom padding text should get by default when BACKGROUND is used.
|
287 |
+
var ol_padyb = 1;
|
288 |
+
|
289 |
+
// FULLHTML - If the user by default must supply all html for complete control of popup content.
|
290 |
+
// Set to 1 to activate, 0 otherwise.
|
291 |
+
var ol_fullhtml = 0;
|
292 |
+
|
293 |
+
// CAPICON - Default icon to place next to the popups caption.
|
294 |
+
var ol_capicon = "";
|
295 |
+
|
296 |
+
// FRAME - Default frame. We default to current frame if there is no frame defined.
|
297 |
+
var ol_frame = self;
|
298 |
+
|
299 |
+
// TIMEOUT - Default timeout. By default there is no timeout.
|
300 |
+
var ol_timeout = 0;
|
301 |
+
|
302 |
+
// DELAY - Default delay for onset of popup. By default there is no delay.
|
303 |
+
var ol_delay = 0;
|
304 |
+
|
305 |
+
// HAUTO - If overLIB should decide the horizontal placement.
|
306 |
+
var ol_hauto = 0;
|
307 |
+
|
308 |
+
// VAUTO - If overLIB should decide the vertical placement.
|
309 |
+
var ol_vauto = 0;
|
310 |
+
|
311 |
+
// NOJUSTX - If overLIB should let popups overrun the left or right window margins.
|
312 |
+
var ol_nojustx = 0;
|
313 |
+
|
314 |
+
// NOJUSTY - If overLIB should let popups overrun the top or bottom window margins.
|
315 |
+
var ol_nojusty = 0;
|
316 |
+
|
317 |
+
// LABEL - A labeling string for the primary popup while it is displayed (visible).
|
318 |
+
var ol_label = "";
|
319 |
+
|
320 |
+
// DECODE - If overLIB should automatically decode any URL-encoded characters in
|
321 |
+
// lead argument and/or caption.
|
322 |
+
var ol_decode = "";
|
323 |
+
|
324 |
+
////////////////////////////////////////////////////////////////////////////////////
|
325 |
+
// ARRAY CONFIGURATION FOR CORE MODULE overlibmws.js
|
326 |
+
////////////////////////////////////////////////////////////////////////////////////
|
327 |
+
|
328 |
+
// INARRAY - Array with texts.
|
329 |
+
var ol_texts = new Array(
|
330 |
+
"Text 0",
|
331 |
+
"Text 1");
|
332 |
+
|
333 |
+
// CAPARRAY - Array with captions.
|
334 |
+
var ol_caps = new Array(
|
335 |
+
"Caption 0",
|
336 |
+
"Caption 1");
|
337 |
+
|
338 |
+
////////////////////////////////////////////////////////////////////////////////////
|
339 |
+
// END CONFIGURATION FOR overlibmws.js
|
340 |
+
////////////////////////////////////////////////////////////////////////////////////
|
341 |
+
|
342 |
+
|
343 |
+
////////////////////////////////////////////////////////////////////////////////////
|
344 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_bubble.js
|
345 |
+
////////////////////////////////////////////////////////////////////////////////////
|
346 |
+
|
347 |
+
// BUBBLE - Whether to use a bubble type popup. Default is no (0).
|
348 |
+
var ol_bubble = 0;
|
349 |
+
|
350 |
+
// BUBBLETYPE - Type of bubble image to use. Default is 'flower'. Other options are
|
351 |
+
// 'oval', 'square', 'pushpin', 'quotation', or 'roundedcorners'. Specify directory
|
352 |
+
// for images via the last parameter of registerImages() near the top of the plugin
|
353 |
+
// module (default value is './').
|
354 |
+
var ol_bubbletype = 'flower';
|
355 |
+
|
356 |
+
// ADJBUBBLE - Whether to resize the image in relation to the content.
|
357 |
+
// Default is no (0).
|
358 |
+
var ol_adjbubble = 0;
|
359 |
+
|
360 |
+
// RCBUBBLECOLOR - Color for the textual content of speech bubble popups which have
|
361 |
+
// 'roundcorners' as their BUBBLETYPE parameter. Default value is '#ffffcc'.
|
362 |
+
var ol_rcbubblecolor = '#ffffcc';
|
363 |
+
|
364 |
+
// BUBBLECLOSE - Whether to block the normally automatic setting of NOCLOSE for
|
365 |
+
// bubble popups that are sticky.
|
366 |
+
// Default is no (0).
|
367 |
+
var ol_bubbleclose = 0;
|
368 |
+
|
369 |
+
////////////////////////////////////////////////////////////////////////////////////
|
370 |
+
// END CONFIGURATION FOR overlibmws_bubble.js
|
371 |
+
////////////////////////////////////////////////////////////////////////////////////
|
372 |
+
|
373 |
+
|
374 |
+
////////////////////////////////////////////////////////////////////////////////////
|
375 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_crossframe.js
|
376 |
+
////////////////////////////////////////////////////////////////////////////////////
|
377 |
+
|
378 |
+
You must import this plugin module to use the FRAME command, but its configuration
|
379 |
+
variable, ol_frame, is set in the core module.
|
380 |
+
|
381 |
+
////////////////////////////////////////////////////////////////////////////////////
|
382 |
+
// END CONFIGURATION FOR overlibmws_crossframe.js
|
383 |
+
////////////////////////////////////////////////////////////////////////////////////
|
384 |
+
|
385 |
+
|
386 |
+
////////////////////////////////////////////////////////////////////////////////////
|
387 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_debug.js
|
388 |
+
////////////////////////////////////////////////////////////////////////////////////
|
389 |
+
|
390 |
+
// ALLOWDEBUG - The ID or a comma-separated list of IDs for debug layers which, if
|
391 |
+
// invoked following an overlib call and then made hidden via the close link at
|
392 |
+
// upper right, should be made visible again whenever that overlib call occurs.
|
393 |
+
var ol_allowdebug = "";
|
394 |
+
|
395 |
+
////////////////////////////////////////////////////////////////////////////////////
|
396 |
+
// END CONFIGURATION FOR overlibmws_debug.js
|
397 |
+
////////////////////////////////////////////////////////////////////////////////////
|
398 |
+
|
399 |
+
|
400 |
+
////////////////////////////////////////////////////////////////////////////////////
|
401 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_draggable.js
|
402 |
+
////////////////////////////////////////////////////////////////////////////////////
|
403 |
+
|
404 |
+
// DRAGGABLE - If sticky should be draggable.
|
405 |
+
var ol_draggable = 0;
|
406 |
+
|
407 |
+
// DRAGCAP - Restrict dragging handle to the caption.
|
408 |
+
var ol_dragcap = 0;
|
409 |
+
|
410 |
+
// DRAGID - The id of a container div with a CSS class that uses overflow:auto
|
411 |
+
// for a DRAGGABLE popup that doesn't have iframe content and doesn't use DRAGCAP.
|
412 |
+
var ol_dragid = '';
|
413 |
+
|
414 |
+
////////////////////////////////////////////////////////////////////////////////////
|
415 |
+
// END CONFIGURATION FOR overlibmws_draggable.js
|
416 |
+
////////////////////////////////////////////////////////////////////////////////////
|
417 |
+
|
418 |
+
|
419 |
+
////////////////////////////////////////////////////////////////////////////////////
|
420 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_exclusive.js
|
421 |
+
////////////////////////////////////////////////////////////////////////////////////
|
422 |
+
|
423 |
+
// EXCLUSIVE - Decides if a sticky primary popup should be exclusive, such that no other
|
424 |
+
// primry popup can be invoked and replace it before the sticky is closed by the user or
|
425 |
+
// a timeout (secondary popups can still be invoked from within the exclusive primary).
|
426 |
+
var ol_exclusive = 0;
|
427 |
+
|
428 |
+
// EXCLUSIVESTATUS - Status line string to use for exclusive stickies
|
429 |
+
var ol_exclusivestatus = 'Please act on or close the open popup.';
|
430 |
+
|
431 |
+
// EXCLUSIVEOVERRIDE = If a displayed exclusive sticky should be overridden by the
|
432 |
+
// current overlib call for a popup.
|
433 |
+
var ol_exclusiveoverride=0;
|
434 |
+
|
435 |
+
////////////////////////////////////////////////////////////////////////////////////
|
436 |
+
// END CONFIGURATION FOR overlibmws_exclusive.js
|
437 |
+
////////////////////////////////////////////////////////////////////////////////////
|
438 |
+
|
439 |
+
|
440 |
+
////////////////////////////////////////////////////////////////////////////////////
|
441 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_filter.js
|
442 |
+
////////////////////////////////////////////////////////////////////////////////////
|
443 |
+
|
444 |
+
// FILTER - Toggles on the filter feature set for IE v5.5+ browsers. Defualt is off.
|
445 |
+
var ol_filter=0;
|
446 |
+
|
447 |
+
// FADEIN - Filter type for stylinzed fadein. Value can be 0 - 50 for the 51 types,
|
448 |
+
// or 51 (default) for random selections of the type across successive occurrences
|
449 |
+
// of the popup.
|
450 |
+
var ol_fadein=51;
|
451 |
+
|
452 |
+
// FADETIME - Duration of fadein (millisec).
|
453 |
+
var ol_fadetime=800;
|
454 |
+
|
455 |
+
// FILTEROPACITY - Opacity of entire popup. The higher the number in the range of 1-99,
|
456 |
+
// the more more opaque (less transparent) the popup will be. But 0 is handled as
|
457 |
+
// equivalent to 100 (no transparency). This feature also is implemented for Mozilla
|
458 |
+
// and Netscape v6+ browsers.
|
459 |
+
var ol_filteropacity=100;
|
460 |
+
|
461 |
+
// FILTERSHADOW - Type of filter-based shadow. Default is off (0).
|
462 |
+
// Dropshadow is 1. Shadow (tapers from corners) is 2.
|
463 |
+
var ol_filtershadow=0;
|
464 |
+
|
465 |
+
// FILTERSHADOWCOLOR - Color of filter-based shadow.
|
466 |
+
var ol_filtershadowcolor="#cccccc";
|
467 |
+
|
468 |
+
////////////////////////////////////////////////////////////////////////////////////
|
469 |
+
// END CONFIGURATION FOR overlibmws_filter.js
|
470 |
+
////////////////////////////////////////////////////////////////////////////////////
|
471 |
+
|
472 |
+
|
473 |
+
////////////////////////////////////////////////////////////////////////////////////
|
474 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_function.js
|
475 |
+
////////////////////////////////////////////////////////////////////////////////////
|
476 |
+
|
477 |
+
// FUNCTION - Default javascript function. By default there is none.
|
478 |
+
var ol_function = null;
|
479 |
+
|
480 |
+
////////////////////////////////////////////////////////////////////////////////////
|
481 |
+
// END CONFIGURATION FOR overlibmws_function.js
|
482 |
+
////////////////////////////////////////////////////////////////////////////////////
|
483 |
+
|
484 |
+
|
485 |
+
////////////////////////////////////////////////////////////////////////////////////
|
486 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_hide.js
|
487 |
+
////////////////////////////////////////////////////////////////////////////////////
|
488 |
+
|
489 |
+
// HIDESELECTBOXES - Whether to hide any select boxes which overlap the popup
|
490 |
+
// while the popup is being displayed.
|
491 |
+
var ol_hideselectboxes=0;
|
492 |
+
|
493 |
+
// HIDEBYID - An id or comma-separated list of id's to be hidden while the popup
|
494 |
+
// is displayed. Is intended for form elements and is ignored for any browsers
|
495 |
+
// using HIDESELECTBOXES and for Opera v7+.
|
496 |
+
var ol_hidebyid='';
|
497 |
+
|
498 |
+
// HIDEBYIDALL - An id or comma=separated list of id's to be hidden while the popup
|
499 |
+
// is displayed. Is intended for non-form elements with system controls, e.g.,
|
500 |
+
// flash objects and applets.
|
501 |
+
var ol_hidebyidall='';
|
502 |
+
|
503 |
+
// HIDEBYIDNS4 - An id or comma-separated list of id's for positioned div's to be
|
504 |
+
// hidden while the popup is being displayed by Netscape v4.x browsers.
|
505 |
+
var ol_hidebyidns4='';
|
506 |
+
|
507 |
+
////////////////////////////////////////////////////////////////////////////////////
|
508 |
+
// END CONFIGURATION FOR overlibmws_hide.js
|
509 |
+
////////////////////////////////////////////////////////////////////////////////////
|
510 |
+
|
511 |
+
|
512 |
+
////////////////////////////////////////////////////////////////////////////////////
|
513 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_modal.js
|
514 |
+
////////////////////////////////////////////////////////////////////////////////////
|
515 |
+
|
516 |
+
// MODAL - Whether to make the popup modal (block access to any other items in the
|
517 |
+
// document via a shield until the popup is acted upon and closed).
|
518 |
+
var ol_modal = 0;
|
519 |
+
|
520 |
+
// MODALCOLOR - The color of the modal shield.
|
521 |
+
var ol_modalcolor = '#bbbbbb';
|
522 |
+
|
523 |
+
// MODALOPACITY - The opacity of the modal shield.
|
524 |
+
var ol_modalopacity = 40;
|
525 |
+
|
526 |
+
////////////////////////////////////////////////////////////////////////////////////
|
527 |
+
// END CONFIGURATION FOR overlibmws_overtwo.js
|
528 |
+
////////////////////////////////////////////////////////////////////////////////////
|
529 |
+
|
530 |
+
|
531 |
+
////////////////////////////////////////////////////////////////////////////////////
|
532 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_overtwo.js
|
533 |
+
////////////////////////////////////////////////////////////////////////////////////
|
534 |
+
|
535 |
+
// LABEL - A labeling string for the secondary popup while it is displayed (visible).
|
536 |
+
var ol_label = "";
|
537 |
+
|
538 |
+
////////////////////////////////////////////////////////////////////////////////////
|
539 |
+
// END CONFIGURATION FOR overlibmws_overtwo.js
|
540 |
+
////////////////////////////////////////////////////////////////////////////////////
|
541 |
+
|
542 |
+
|
543 |
+
////////////////////////////////////////////////////////////////////////////////////
|
544 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_print.js
|
545 |
+
////////////////////////////////////////////////////////////////////////////////////
|
546 |
+
|
547 |
+
// PRINT - Whether sticky should include a Print link or button.
|
548 |
+
var ol_print = 0;
|
549 |
+
|
550 |
+
// PRINTBUTTON - Whether to use button in main text area even if caption area is present.
|
551 |
+
var ol_printbutton=0;
|
552 |
+
|
553 |
+
// NOAUTOPRINT - Whether to block automatic printing and deletion of temporary printing window.
|
554 |
+
var ol_noautoprint=0;
|
555 |
+
|
556 |
+
// PRINTCOLOR - Color of "Print" link in caption area of sticky.
|
557 |
+
var ol_printcolor="#eeeeff";
|
558 |
+
|
559 |
+
// PRINTFONT - Font face for the print text.
|
560 |
+
var ol_printfont="Verdana,Arial,Helvetica";
|
561 |
+
|
562 |
+
// PRINTSIZE - Font size for the print text.
|
563 |
+
var ol_printsize=1;
|
564 |
+
|
565 |
+
// PRINTTEXT - Text for the sticky popup print link. Normal is "Print".
|
566 |
+
var ol_printtext='Print';
|
567 |
+
|
568 |
+
// PRINTBUTTONTEXT - Text for the sticky popup print button. Normal is "Print".
|
569 |
+
var ol_printbuttontext='Print';
|
570 |
+
|
571 |
+
// PRINTTITLE - Text to use as value of TITLE attribute for browser-generated TooTips
|
572 |
+
// with the "Print" link in captions of stickies or "Print" button in main text area.
|
573 |
+
var ol_printtitle="Click to Print";
|
574 |
+
|
575 |
+
// PRINTFONTCLASS - Print font class.
|
576 |
+
var ol_printfontclass="";
|
577 |
+
|
578 |
+
// PRINTCSSFILE - URL for .ccs file with CSS rules for styling the popup.
|
579 |
+
var ol_printcssfile="";
|
580 |
+
|
581 |
+
// PRINTXML - String for (optional) xml tag for temporary printing window.
|
582 |
+
var ol_printxml="";
|
583 |
+
|
584 |
+
// PRINTDOCTYPE - String for DOCTYPE declaration for temporary printing window.
|
585 |
+
var ol_printdoctype=
|
586 |
+
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" '
|
587 |
+
+'"http://www.w3.org/TR/html4/loose.dtd">';
|
588 |
+
|
589 |
+
// PRINTROOT - String for root tag for temporary printing window.
|
590 |
+
var ol_printroot="<html>";
|
591 |
+
|
592 |
+
// PRINTTYPE - String for MIME type for temporary printing window.
|
593 |
+
var ol_printtype="text/html";
|
594 |
+
|
595 |
+
// PRINTCHARSET - String for charset for temporary printing window.
|
596 |
+
var ol_printcharset="iso-8859-1";
|
597 |
+
|
598 |
+
// PRINTURL - URL for a document to be printed via the temporary printing window.
|
599 |
+
var ol_printurl="";
|
600 |
+
|
601 |
+
// PRINTJOB - string for an external function to be used for the temporary printing window.
|
602 |
+
var ol_printjob="";
|
603 |
+
|
604 |
+
////////////////////////////////////////////////////////////////////////////////////
|
605 |
+
// END CONFIGURATION FOR overlibmws_print.js
|
606 |
+
////////////////////////////////////////////////////////////////////////////////////
|
607 |
+
|
608 |
+
|
609 |
+
////////////////////////////////////////////////////////////////////////////////////
|
610 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_scroll.js
|
611 |
+
////////////////////////////////////////////////////////////////////////////////////
|
612 |
+
|
613 |
+
// SCROLL - Whether sticky should scroll with the document when positioned via
|
614 |
+
// RELX or MIDX, and RELY or MIDY.
|
615 |
+
var ol_scroll = 0;
|
616 |
+
|
617 |
+
////////////////////////////////////////////////////////////////////////////////////
|
618 |
+
// END CONFIGURATION FOR overlibmws_scroll.js
|
619 |
+
////////////////////////////////////////////////////////////////////////////////////
|
620 |
+
|
621 |
+
|
622 |
+
////////////////////////////////////////////////////////////////////////////////////
|
623 |
+
// DEFAULT CONFIGURATION FOR PLUGIN MODULE overlibmws_shadow.js
|
624 |
+
////////////////////////////////////////////////////////////////////////////////////
|
625 |
+
|
626 |
+
// SHADOW - Whether to add a dropshadow. Default is no (0).
|
627 |
+
var ol_shadow = 0;
|
628 |
+
|
629 |
+
// SHADOWX - Horizontal dropshadow displacement in pixels.
|
630 |
+
// Positive is to the right and negative is to the left.
|
631 |
+
var ol_shadowx = 5;
|
632 |
+
|
633 |
+
// SHADOWY - Vertical dropshadow displacement in pixels.
|
634 |
+
// Positive is downward and negative is upward.
|
635 |
+
var ol_shadowy = 5;
|
636 |
+
|
637 |
+
// SHADOWCOLOR - Dropshadow color.
|
638 |
+
var ol_shadowcolor = "#666666";
|
639 |
+
|
640 |
+
// SHADOWIMAGE - Dropshadow background image. Default is none.
|
641 |
+
var ol_shadowimage = "";
|
642 |
+
|
643 |
+
// SHADOWOPACITY - Dropshadow opacity (100 is solid; 0 turns off this feature and
|
644 |
+
// thus also yields a solid shadow). Default is 60.
|
645 |
+
var ol_shadowopacity = 60;
|
646 |
+
|
647 |
+
////////////////////////////////////////////////////////////////////////////////////
|
648 |
+
// END CONFIGURATION FOR overlibmws_shadow.js
|
649 |
+
////////////////////////////////////////////////////////////////////////////////////
|
650 |
+
|
js/overlibmws/overlibmws.js
ADDED
@@ -0,0 +1,624 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Do not remove or change this notice.
|
3 |
+
overlibmws.js core module - Copyright Foteos Macrides 2002-2009. All rights reserved.
|
4 |
+
Initial: August 18, 2002 - Last Revised: October 25, 2008
|
5 |
+
This module is subject to the same terms of usage as for Erik Bosrup's overLIB,
|
6 |
+
though only a minority of the code and API now correspond with Erik's version.
|
7 |
+
See the overlibmws Change History and Command Reference via:
|
8 |
+
|
9 |
+
http://www.macridesweb.com/oltest/
|
10 |
+
|
11 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
12 |
+
Give credit on sites that use overlibmws and submit changes so others can use them as well.
|
13 |
+
You can get Erik's version via: http://www.bosrup.com/web/overlib/
|
14 |
+
*/
|
15 |
+
|
16 |
+
// PRE-INIT -- Ignore these lines, configuration is below.
|
17 |
+
var OLloaded=0,OLbubblePI=0,OLcrossframePI=0,OLdebugPI=0,OLdraggablePI=0,OLexclusivePI=0,OLfilterPI=0,
|
18 |
+
OLfunctionPI=0,OLhidePI=0,OLiframePI=0,OLmodalPI=0,OLovertwoPI=0,OLscrollPI=0,OLshadowPI=0,OLprintPI=0,
|
19 |
+
pmCnt=1,pMtr=new Array(),OLcmdLine=new Array(),OLrunTime=new Array(),OLv,OLudf,OLrefXY,
|
20 |
+
OLpct=new Array("83%","67%","83%","100%","117%","150%","200%","267%");if(typeof OLgateOK=='undefined')var OLgateOK=1;
|
21 |
+
var OLp1or2c='inarray,caparray,caption,closetext,right,left,center,autostatuscap,padx,pady,below,above,vcenter,donothing',
|
22 |
+
OLp1or2co='nofollow,background,offsetx,offsety,fgcolor,bgcolor,cgcolor,textcolor,capcolor,width,wrap,wrapmax,height,border,'
|
23 |
+
+'base,status,autostatus,snapx,snapy,fixx,fixy,relx,rely,midx,midy,ref,refc,refp,refx,refy,fgbackground,bgbackground,'
|
24 |
+
+'cgbackground,fullhtml,capicon,textfont,captionfont,textsize,captionsize,timeout,delay,hauto,vauto,nojustx,nojusty,fgclass,'
|
25 |
+
+'bgclass,cgclass,capbelow,textpadding,textfontclass,captionpadding,captionfontclass,sticky,noclose,mouseoff,offdelay,'
|
26 |
+
+'closecolor,closefont,closesize,closeclick,closetitle,closefontclass,decode',OLp1or2o='text,cap,close,hpos,vpos,padxl,'
|
27 |
+
+'padxr,padyt,padyb',OLp1co='label',OLp1or2=OLp1or2co+','+OLp1or2o,OLp1=OLp1co+','+'frame';
|
28 |
+
OLregCmds(OLp1or2c+','+OLp1or2co+','+OLp1co);
|
29 |
+
function OLud(v){return eval('typeof ol_'+v+'=="undefined"')?1:0;}
|
30 |
+
|
31 |
+
// DEFAULT CONFIGURATION -- See overlibConfig.txt for descriptions
|
32 |
+
if(OLud('fgcolor'))var ol_fgcolor="#ccccff";
|
33 |
+
if(OLud('bgcolor'))var ol_bgcolor="#333399";
|
34 |
+
if(OLud('cgcolor'))var ol_cgcolor="#333399";
|
35 |
+
if(OLud('textcolor'))var ol_textcolor="#000000";
|
36 |
+
if(OLud('capcolor'))var ol_capcolor="#ffffff";
|
37 |
+
if(OLud('closecolor'))var ol_closecolor="#eeeeff";
|
38 |
+
if(OLud('textfont'))var ol_textfont="Verdana,Arial,Helvetica";
|
39 |
+
if(OLud('captionfont'))var ol_captionfont="Verdana,Arial,Helvetica";
|
40 |
+
if(OLud('closefont'))var ol_closefont="Verdana,Arial,Helvetica";
|
41 |
+
if(OLud('textsize'))var ol_textsize=1;
|
42 |
+
if(OLud('captionsize'))var ol_captionsize=1;
|
43 |
+
if(OLud('closesize'))var ol_closesize=1;
|
44 |
+
if(OLud('fgclass'))var ol_fgclass="";
|
45 |
+
if(OLud('bgclass'))var ol_bgclass="";
|
46 |
+
if(OLud('cgclass'))var ol_cgclass="";
|
47 |
+
if(OLud('textpadding'))var ol_textpadding=2;
|
48 |
+
if(OLud('textfontclass'))var ol_textfontclass="";
|
49 |
+
if(OLud('captionpadding'))var ol_captionpadding=2;
|
50 |
+
if(OLud('captionfontclass'))var ol_captionfontclass="";
|
51 |
+
if(OLud('closefontclass'))var ol_closefontclass="";
|
52 |
+
if(OLud('close'))var ol_close="Close";
|
53 |
+
if(OLud('closeclick'))var ol_closeclick=0;
|
54 |
+
if(OLud('closetitle'))var ol_closetitle="Click to Close";
|
55 |
+
if(OLud('text'))var ol_text="Default Text";
|
56 |
+
if(OLud('cap'))var ol_cap="";
|
57 |
+
if(OLud('capbelow'))var ol_capbelow=0;
|
58 |
+
if(OLud('background'))var ol_background="";
|
59 |
+
if(OLud('width'))var ol_width=200;
|
60 |
+
if(OLud('wrap'))var ol_wrap=0;
|
61 |
+
if(OLud('wrapmax'))var ol_wrapmax=0;
|
62 |
+
if(OLud('height'))var ol_height= -1;
|
63 |
+
if(OLud('border'))var ol_border=1;
|
64 |
+
if(OLud('base'))var ol_base=0;
|
65 |
+
if(OLud('offsetx'))var ol_offsetx=10;
|
66 |
+
if(OLud('offsety'))var ol_offsety=10;
|
67 |
+
if(OLud('sticky'))var ol_sticky=0;
|
68 |
+
if(OLud('nofollow'))var ol_nofollow=0;
|
69 |
+
if(OLud('noclose'))var ol_noclose=0;
|
70 |
+
if(OLud('mouseoff'))var ol_mouseoff=0;
|
71 |
+
if(OLud('offdelay'))var ol_offdelay=300;
|
72 |
+
if(OLud('hpos'))var ol_hpos=RIGHT;
|
73 |
+
if(OLud('vpos'))var ol_vpos=BELOW;
|
74 |
+
if(OLud('status'))var ol_status="";
|
75 |
+
if(OLud('autostatus'))var ol_autostatus=0;
|
76 |
+
if(OLud('snapx'))var ol_snapx=0;
|
77 |
+
if(OLud('snapy'))var ol_snapy=0;
|
78 |
+
if(OLud('fixx'))var ol_fixx= -1;
|
79 |
+
if(OLud('fixy'))var ol_fixy= -1;
|
80 |
+
if(OLud('relx'))var ol_relx=null;
|
81 |
+
if(OLud('rely'))var ol_rely=null;
|
82 |
+
if(OLud('midx'))var ol_midx=null;
|
83 |
+
if(OLud('midy'))var ol_midy=null;
|
84 |
+
if(OLud('ref'))var ol_ref="";
|
85 |
+
if(OLud('refc'))var ol_refc='UL';
|
86 |
+
if(OLud('refp'))var ol_refp='UL';
|
87 |
+
if(OLud('refx'))var ol_refx=0;
|
88 |
+
if(OLud('refy'))var ol_refy=0;
|
89 |
+
if(OLud('fgbackground'))var ol_fgbackground="";
|
90 |
+
if(OLud('bgbackground'))var ol_bgbackground="";
|
91 |
+
if(OLud('cgbackground'))var ol_cgbackground="";
|
92 |
+
if(OLud('padxl'))var ol_padxl=1;
|
93 |
+
if(OLud('padxr'))var ol_padxr=1;
|
94 |
+
if(OLud('padyt'))var ol_padyt=1;
|
95 |
+
if(OLud('padyb'))var ol_padyb=1;
|
96 |
+
if(OLud('fullhtml'))var ol_fullhtml=0;
|
97 |
+
if(OLud('capicon'))var ol_capicon="";
|
98 |
+
if(OLud('frame'))var ol_frame=self;
|
99 |
+
if(OLud('timeout'))var ol_timeout=0;
|
100 |
+
if(OLud('delay'))var ol_delay=0;
|
101 |
+
if(OLud('hauto'))var ol_hauto=0;
|
102 |
+
if(OLud('vauto'))var ol_vauto=0;
|
103 |
+
if(OLud('nojustx'))var ol_nojustx=0;
|
104 |
+
if(OLud('nojusty'))var ol_nojusty=0;
|
105 |
+
if(OLud('label'))var ol_label="";
|
106 |
+
if(OLud('decode'))var ol_decode=0;
|
107 |
+
// ARRAY CONFIGURATION - See overlibConfig.txt for descriptions.
|
108 |
+
if(OLud('texts'))var ol_texts=new Array("Text 0","Text 1");
|
109 |
+
if(OLud('caps'))var ol_caps=new Array("Caption 0","Caption 1");
|
110 |
+
// END CONFIGURATION -- Don't change anything below, all configuration is above.
|
111 |
+
|
112 |
+
// INIT -- Runtime variables.
|
113 |
+
var o3_text="",o3_cap="",o3_sticky=0,o3_nofollow=0,o3_background="",o3_noclose=0,o3_mouseoff=0,o3_offdelay=300,o3_hpos=RIGHT,
|
114 |
+
o3_offsetx=10,o3_offsety=10,o3_fgcolor="",o3_bgcolor="",o3_cgcolor="",o3_textcolor="",o3_capcolor="",o3_closecolor="",
|
115 |
+
o3_width=200,o3_wrap=0,o3_wrapmax=0,o3_height= -1,o3_border=1,o3_base=0,o3_status="",o3_autostatus=0,o3_snapx=0,o3_snapy=0,
|
116 |
+
o3_fixx= -1,o3_fixy= -1,o3_relx=null,o3_rely=null,o3_midx=null,o3_midy=null,o3_ref="",o3_refc='UL',o3_refp='UL',o3_refx=0,
|
117 |
+
o3_refy=0,o3_fgbackground="",o3_bgbackground="",o3_cgbackground="",o3_padxl=0,o3_padxr=0,o3_padyt=0,o3_padyb=0,o3_fullhtml=0,
|
118 |
+
o3_vpos=BELOW,o3_capicon="",o3_textfont="Verdana,Arial,Helvetica",o3_captionfont="",o3_closefont="",o3_textsize=1,OLcC=null,
|
119 |
+
o3_captionsize=1,o3_closesize=1,o3_frame=self,o3_timeout=0,o3_delay=0,o3_hauto=0,o3_vauto=0,o3_nojustx=0,o3_nojusty=0,
|
120 |
+
o3_close="",o3_closeclick=0,o3_closetitle="",o3_fgclass="",o3_bgclass="",o3_cgclass="",o3_textpadding=2,o3_textfontclass="",
|
121 |
+
o3_captionpadding=2,o3_captionfontclass="",o3_closefontclass="",o3_capbelow=0,o3_label="",o3_decode=0,
|
122 |
+
CSSOFF=DONOTHING,CSSCLASS=DONOTHING,over=null,OLdelayid=0,OLtimerid=0,OLshowid=0,OLndt=0,OLfnRef="",OLhover=0,OLx=0,OLy=0,
|
123 |
+
OLshowingsticky=0,OLallowmove=0,OLoverHTML="",OLover2HTML="",OLifRef="",OLo2Ref="",OLifX=0,OLifY=0,
|
124 |
+
OLua=(OLv=navigator.userAgent)?OLv.toLowerCase():'',
|
125 |
+
OLns4=(navigator.appName=='Netscape'&&parseInt(navigator.appVersion)==4)?1:0,
|
126 |
+
OLns6=(document.getElementById)?1:0,
|
127 |
+
OLie4=(document.all)?1:0,
|
128 |
+
OLgek=(OLv=OLua.match(/gecko\/(\d{8})/i))?parseInt(OLv[1]):0,
|
129 |
+
OLmac=(OLua.indexOf('mac')>=0)?1:0,
|
130 |
+
OLsaf=(OLua.indexOf('safari')>=0)?1:0,
|
131 |
+
OLkon=(OLua.indexOf('konqueror')>=0)?1:0,
|
132 |
+
OLkht=(OLsaf||OLkon)?1:0,
|
133 |
+
OLopr=(OLua.indexOf('opera')>=0)?1:0,
|
134 |
+
OLop7=(OLopr&&document.createTextNode)?1:0;
|
135 |
+
OLop95=(OLop7&&document.getElementsByClassName)?1:0;
|
136 |
+
if(OLopr){OLns4=OLns6=OLgek=0;OLie4=(OLop7)?1:0;}
|
137 |
+
var OLieM=((OLie4&&OLmac)&&!(OLkht||OLopr))?1:0,
|
138 |
+
OLie5=0,OLie55=0,OLie7=0;if(OLie4&&!OLop7){
|
139 |
+
if((OLv=OLua.match(/msie (\d\.\d+)\.*/i))&&(OLv=parseFloat(OLv[1]))>=5.0){
|
140 |
+
OLie5=1;OLns6=0;if(OLv>=5.5)OLie55=1;if(OLv>=7.0)OLie7=1;}if(OLns6)OLie4=0;}
|
141 |
+
if(OLns4)window.onresize=function(){location.reload();};var OLchkMh=1,OLdw;
|
142 |
+
if(OLns4||OLie4||OLns6){OLmh();if(window.addEventListener)window.addEventListener("unload",
|
143 |
+
OLulCl,false);}else{overlib=nd=cClick=OLpageDefaults=no_overlib;}
|
144 |
+
function OLulCl(){if(over)cClick();window.removeEventListener("unload",OLulCl,false);}
|
145 |
+
|
146 |
+
/*
|
147 |
+
PUBLIC FUNCTIONS
|
148 |
+
*/
|
149 |
+
// Loads defaults then args into runtime variables.
|
150 |
+
function overlib(){
|
151 |
+
if(!(OLloaded&&OLgateOK))return;if((OLexclusivePI)&&OLisExclusive(arguments))return true;if(OLchkMh)OLmh();if(OLndt&&
|
152 |
+
!OLtimerid)OLndt=0;if(over){if(OLfilterPI)o3_filter=0;cClick();}if(parent!=self){if(parent.OLo2Ref){parent.OLeval(
|
153 |
+
parent.OLo2Ref);parent.OLo2Ref="";}if(parent.OLifRef){parent.OLeval(parent.OLifRef);parent.OLifRef="";}}if(OLo2Ref){
|
154 |
+
eval(OLo2Ref);OLo2Ref="";}if(OLifRef){eval(OLifRef);OLifRef="";}OLload(OLp1or2);OLload(OLp1);OLfnRef="";OLifX=0;OLifY=0;
|
155 |
+
OLhover=0;if(OLcrossframePI&&parent!=self)OLchkFRAME(arguments);OLsetRunTimeVar();OLparseTokens('o3_',arguments);if(!(
|
156 |
+
over=OLmkLyr()))return false;if(o3_decode)OLdecode();if(OLprintPI)OLchkPrint();if(OLbubblePI)OLchkForBubbleEffect();if(
|
157 |
+
OLdebugPI)OLsetDebugCanShow();if(OLshadowPI)OLinitShadow();if(OLiframePI)OLinitIfs();if(OLfilterPI)OLinitFilterLyr();if(
|
158 |
+
OLexclusivePI&&o3_exclusive&&o3_exclusivestatus!="")o3_status=o3_exclusivestatus;else if(o3_autostatus==2&&o3_cap!="")
|
159 |
+
o3_status=o3_cap;else if(o3_autostatus==1&&o3_text!="")o3_status=o3_text;if(!o3_delay){return OLmain();}else{OLdelayid=
|
160 |
+
setTimeout("OLmain()",o3_delay);if(o3_status!=""){self.status=o3_status;return true;}else if(!(OLop7&&event&&event.type==
|
161 |
+
'mouseover'))return false;}
|
162 |
+
}
|
163 |
+
function OLeval(s){eval(s);}
|
164 |
+
|
165 |
+
// Clears popups if appropriate
|
166 |
+
function nd(time){
|
167 |
+
if(OLloaded&&OLgateOK){if(!((OLexclusivePI)&&OLisExclusive())){if(time&&over&&!o3_delay){
|
168 |
+
if(OLtimerid>0)clearTimeout(OLtimerid);OLtimerid=(OLhover&&o3_frame==self&&!OLcursorOff())?0:
|
169 |
+
setTimeout("cClick()",(o3_timeout=OLndt=time));}else{if(!OLshowingsticky){OLallowmove=0;
|
170 |
+
if(over)OLhideObject(over);}}}}return false;
|
171 |
+
}
|
172 |
+
|
173 |
+
// Close function for stickies
|
174 |
+
function cClick(){
|
175 |
+
if(OLloaded&&OLgateOK){OLhover=0;if(over){if(OLo2Ref){eval(OLo2Ref);OLo2Ref="";}if(OLovertwoPI&&over==over2)cClick2();
|
176 |
+
OLhideObject(over);OLshowingsticky=0;OLallowmove=0;}if(OLmodalPI)OLclearModal();}return false;
|
177 |
+
}
|
178 |
+
|
179 |
+
// Sets page-specific defaults.
|
180 |
+
function OLpageDefaults(){
|
181 |
+
OLparseTokens('ol_',arguments);
|
182 |
+
}
|
183 |
+
|
184 |
+
// Gets object referenced by its id or name
|
185 |
+
function OLgetRef(l,d){var r=OLgetRefById(l,d);return (r)?r:OLgetRefByName(l,d);}
|
186 |
+
|
187 |
+
// For unsupported browsers.
|
188 |
+
function no_overlib(){return false;}
|
189 |
+
|
190 |
+
/*
|
191 |
+
OVERLIB MAIN FUNCTION SET
|
192 |
+
*/
|
193 |
+
function OLmain(){
|
194 |
+
o3_delay=0;if(parent!=self&&o3_frame==parent&&parent.OLscrollPI&&parent.over)parent.OLclearScroll();if(o3_frame==self){
|
195 |
+
if(o3_noclose)OLoptMOUSEOFF(0);else if(o3_mouseoff)OLoptMOUSEOFF(1);}if(o3_sticky){OLshowingsticky=1;if(OLfnRef&&
|
196 |
+
parent!=self&&o3_frame==parent&&parent.overlib)parent.OLifRef=(OLfilterPI?OLfnRef+'o3_filter=0;':'')+OLfnRef+'cClick();';}
|
197 |
+
OLdoLyr();OLallowmove=0;if(o3_timeout>0){if(OLtimerid>0)clearTimeout(OLtimerid);OLtimerid=setTimeout("cClick()",o3_timeout);}
|
198 |
+
OLchkRef();OLdisp(o3_status);if(OLdraggablePI)OLcheckDrag();if(o3_status!="")return true;else if(!(OLop7&&event&&
|
199 |
+
event.type=='mouseover'))return false;
|
200 |
+
}
|
201 |
+
function OLchkRef(){
|
202 |
+
if(o3_ref){OLrefXY=OLgetRefXY(o3_ref);if(OLrefXY[0]==null&&OLcrossframePI)OLchkIfRef();
|
203 |
+
if(OLrefXY[0]==null){o3_ref="";o3_midx=0;o3_midy=0;}}
|
204 |
+
}
|
205 |
+
|
206 |
+
// Loads o3_ variables
|
207 |
+
function OLload(c){var i,m=c.split(',');for(i=0;i<m.length;i++)eval('o3_'+m[i]+'=ol_'+m[i]);}
|
208 |
+
|
209 |
+
// Chooses LGF
|
210 |
+
function OLdoLGF(){
|
211 |
+
return (o3_background!=''||o3_fullhtml)?OLcontentBackground(o3_text,o3_background,o3_fullhtml):(o3_cap=="")?
|
212 |
+
OLcontentSimple(o3_text):(o3_sticky)?OLcontentCaption(o3_text,o3_cap,o3_close):OLcontentCaption(o3_text,o3_cap,'');
|
213 |
+
}
|
214 |
+
|
215 |
+
// Makes Layer
|
216 |
+
function OLmkLyr(id,f,z){
|
217 |
+
id=(id||'overDiv');f=(f||o3_frame);z=(z||1000);var fd=f.document,d=OLgetRefById(id,fd);
|
218 |
+
if(!d){if(OLns4)d=fd.layers[id]=new Layer(1024,f);else if(OLie4&&!OLop7){
|
219 |
+
fd.body.insertAdjacentHTML('AfterBegin','<div id="'+id+'"></div>');d=fd.all[id];}else{d=fd.createElement('div');
|
220 |
+
if(d){d.id=id;fd.body.appendChild(d);}}if(!d)return null;if(OLns4)d.zIndex=z;else{var o=d.style;o.position='absolute';
|
221 |
+
o.visibility='hidden';o.zIndex=z;}}return d;
|
222 |
+
}
|
223 |
+
|
224 |
+
// Creates and writes layer content
|
225 |
+
function OLdoLyr(){
|
226 |
+
if(o3_sticky&&OLtimerid>0){clearTimeout(OLtimerid);OLtimerid=0;}if(o3_background==''&&!o3_fullhtml){
|
227 |
+
if(o3_fgbackground!='')o3_fgbackground=' background="'+o3_fgbackground+'"';
|
228 |
+
if(o3_bgbackground!='')o3_bgbackground=' background="'+o3_bgbackground+'"';
|
229 |
+
if(o3_cgbackground!='')o3_cgbackground=' background="'+o3_cgbackground+'"';
|
230 |
+
if(o3_fgcolor!='')o3_fgcolor=' bgcolor="'+o3_fgcolor+'"';if(o3_bgcolor!='')o3_bgcolor=' bgcolor="'+o3_bgcolor+'"';
|
231 |
+
if(o3_cgcolor!='')o3_cgcolor=' bgcolor="'+o3_cgcolor+'"';if(o3_height>0)o3_height=(OLns4)?' height="'+o3_height+'"':
|
232 |
+
' style="height:'+o3_height+'px;"';else o3_height='';}if(!OLns4)OLrepositionTo(over,(OLns6?20:0),0);var lyrHtml=OLdoLGF();
|
233 |
+
if(o3_wrap&&!o3_fullhtml){OLlayerWrite(lyrHtml);o3_width=(OLns4?over.clip.width:over.offsetWidth);if(OLie4&&!OLop95){
|
234 |
+
var w=OLfd().clientWidth;if(o3_width>=w){if(OLop7){if(OLovertwoPI&&over==over2){var z=over2.style.zIndex;
|
235 |
+
o3_frame.document.body.removeChild(over);over2=OLmkLyr('overDiv2',o3_frame,z);over=over2;}else{
|
236 |
+
o3_frame.document.body.removeChild(over);over=OLmkLyr();}}o3_width=w-20;}}
|
237 |
+
if(o3_wrapmax<1&&o3_frame.innerWidth)o3_wrapmax=o3_frame.innerWidth-40;
|
238 |
+
if(o3_wrapmax>0&&o3_width>o3_wrapmax)o3_width=o3_wrapmax;o3_wrap=0;lyrHtml=OLdoLGF();}OLlayerWrite(lyrHtml);
|
239 |
+
o3_width=(OLns4?over.clip.width:over.offsetWidth);if(OLbubblePI)OLgenerateBubble(lyrHtml);
|
240 |
+
}
|
241 |
+
|
242 |
+
/*
|
243 |
+
LAYER GENERATION FUNCTIONS
|
244 |
+
*/
|
245 |
+
// Makes simple table without caption
|
246 |
+
function OLcontentSimple(txt){
|
247 |
+
var t=OLbgLGF()+OLfgLGF(txt)+OLbaseLGF();OLsetBackground('');return t;
|
248 |
+
}
|
249 |
+
|
250 |
+
// Makes table with caption and optional close link
|
251 |
+
function OLcontentCaption(txt,title,close){
|
252 |
+
var closing=(OLprintPI?OLprintCapLGF():''),closeevent='onmouseover',caption,t,cC='javascript:return '+OLfnRef
|
253 |
+
+(OLovertwoPI&&over==over2?'cClick2();':'cClick();');if(o3_closeclick)closeevent=(o3_closetitle?'title="'
|
254 |
+
+o3_closetitle+'" ':'')+'onclick';if(o3_capicon!=''&&o3_capicon.indexOf('<img')!=0)o3_capicon='<img src="'+o3_capicon
|
255 |
+
+'" /> ';if(close){closing+='<td align="right"><a href="'+cC+'" '+closeevent+'="'+cC+'"'+(o3_closefontclass?' class="'
|
256 |
+
+o3_closefontclass+'">':(OLns4?'><':'')+OLlgfUtil(0,1,'','a',o3_closecolor,o3_closefont,o3_closesize))+close+
|
257 |
+
(o3_closefontclass?'':(OLns4?OLlgfUtil(1,1,'','a'):''))+'</a></td>';}caption='<table id="overCap'
|
258 |
+
+(OLovertwoPI&&over==over2?'2':'')+'"'+OLwd(0)+' border="0" cellpadding="'+o3_captionpadding+'" cellspacing="0"'
|
259 |
+
+(o3_cgclass?' class="'+o3_cgclass+'"':o3_cgcolor+o3_cgbackground)+'><tr><td'+OLwd(0)+(o3_cgclass?' class="'
|
260 |
+
+o3_cgclass+'">':'>')+(o3_captionfontclass?'<div'+OLhL(1)+' class="'+o3_captionfontclass+'">':OLlgfUtil(0,1,'','div',
|
261 |
+
o3_capcolor,o3_captionfont,o3_captionsize))+o3_capicon+title+OLlgfUtil(1,1,'','div')+'</td>'+closing+'</tr></table>';
|
262 |
+
t=OLbgLGF()+(o3_capbelow?OLfgLGF(txt)+caption:caption+OLfgLGF(txt))+OLbaseLGF();OLsetBackground('');return t;
|
263 |
+
}
|
264 |
+
|
265 |
+
// For BACKGROUND and FULLHTML commands
|
266 |
+
function OLcontentBackground(txt,image,hasfullhtml){
|
267 |
+
var t;if(hasfullhtml){t=txt;}else{t='<table'+OLwd(1)+' border="0" cellpadding="0" '+'cellspacing="0" '+'height="'
|
268 |
+
+o3_height+'"><tr><td colspan="3" height="'+o3_padyt+'"></td></tr><tr><td width="'+o3_padxl+'"></td><td valign="top"'
|
269 |
+
+OLwd(2)+'>'+OLlgfUtil(0,0,o3_textfontclass,'div',o3_textcolor,o3_textfont,o3_textsize)+txt+OLlgfUtil(1,0,'','div')
|
270 |
+
+'</td><td width="'+o3_padxr+'"></td></tr><tr><td colspan="3" height="'+o3_padyb+'"></td></tr></table>';}
|
271 |
+
OLsetBackground(image);return t;
|
272 |
+
}
|
273 |
+
|
274 |
+
// LGF utilities
|
275 |
+
function OLbgLGF(){
|
276 |
+
return '<table'+OLwd(1)+o3_height+' border="0" cellpadding="'+o3_border+'" cellspacing="0"'+(o3_bgclass?' class="'
|
277 |
+
+o3_bgclass+'"':o3_bgcolor+o3_bgbackground)+'><tr><td>';
|
278 |
+
}
|
279 |
+
function OLfgLGF(t){
|
280 |
+
return '<table'+OLwd(0)+o3_height+' border="0" cellpadding="'+o3_textpadding+'" cellspacing="0"'+(o3_fgclass?' class="'
|
281 |
+
+o3_fgclass+'"':o3_fgcolor+o3_fgbackground)+'><tr><td valign="top"'+(o3_fgclass?' class="'+o3_fgclass+'"':'')+'>'
|
282 |
+
+OLlgfUtil(0,0,o3_textfontclass,'div',o3_textcolor,o3_textfont,o3_textsize)+t+(OLprintPI?OLprintFgLGF():'')
|
283 |
+
+OLlgfUtil(1,0,'','div')+'</td></tr></table>';
|
284 |
+
}
|
285 |
+
function OLlgfUtil(end,stg,tfc,ele,col,fac,siz){
|
286 |
+
if(end)return('</'+(OLns4?'font'+(stg?'></strong':''):ele)+'>');else return(tfc?'<div'+OLhL(1)+' class="'+tfc+'">':
|
287 |
+
((ele=='a'?'':'<')+(OLns4?(stg?'strong><':'')+'font color="'+col+'" face="'+OLquoteMultiNameFonts(fac)+'" size="'
|
288 |
+
+siz:(ele=='a'?'':ele)+' style="'+((ele=='div')?OLhL(0):'')+'color:'+col+(stg?';font-weight:bold':'')+';font-family:'
|
289 |
+
+OLquoteMultiNameFonts(fac)+';font-size:'+siz+';'+(ele=='span'?'text-decoration:underline;':''))+'">'));
|
290 |
+
}
|
291 |
+
function OLquoteMultiNameFonts(f){
|
292 |
+
var i,v,pM=f.split(',');for(i=0;i<pM.length;i++){v=pM[i];v=v.replace(/^\s+/,'').replace(/\s+$/,'');
|
293 |
+
if(/\s/.test(v) && !/['"]/.test(v)){v="\'"+v+"\'";pM[i]=v;}}return pM.join();
|
294 |
+
}
|
295 |
+
function OLbaseLGF(){
|
296 |
+
return ((o3_base>0&&!o3_wrap)?('<table width="100%" border="0" cellpadding="0" cellspacing="0"'+(o3_bgclass?' class="'
|
297 |
+
+o3_bgclass+'"':'')+'><tr><td height="'+o3_base+'"></td></tr></table>'):'')+'</td></tr></table>';
|
298 |
+
}
|
299 |
+
function OLwd(a){return(o3_wrap?'':' width="'+(!a?'100%':(a==1?o3_width:(o3_width-o3_padxl-o3_padxr)))+'"');}
|
300 |
+
function OLhL(s){if(!OLie5)return '';return(s?' style="overflow:auto;"':'overflow:auto;');}
|
301 |
+
|
302 |
+
// Loads image into the div.
|
303 |
+
function OLsetBackground(i){
|
304 |
+
if(i==''){if(OLns4)over.background.src=null;else{if(OLns6)over.style.width='';over.style.backgroundImage='none';}}
|
305 |
+
else{if(OLns4)over.background.src=i;else{if(OLns6)over.style.width=o3_width+'px';over.style.backgroundImage='url('+i+')';}}
|
306 |
+
}
|
307 |
+
|
308 |
+
/*
|
309 |
+
HANDLING FUNCTIONS
|
310 |
+
*/
|
311 |
+
// Displays layer
|
312 |
+
function OLdisp(s){
|
313 |
+
if(OLmodalPI&&!o3_modalscroll)OLchkModal();if(!OLallowmove){if(OLshadowPI)OLdispShadow();if(OLiframePI)OLdispIfs();
|
314 |
+
OLplaceLayer();if(OLmodalPI&&o3_modalscroll)OLchkModal();if(OLndt)OLshowObject(over);
|
315 |
+
else OLshowid=setTimeout("OLshowObject(over)",1);OLallowmove=(o3_sticky||o3_nofollow)?0:1;}OLndt=0;if(s!="")self.status=s;
|
316 |
+
}
|
317 |
+
|
318 |
+
// Decides placement of layer.
|
319 |
+
function OLplaceLayer(){
|
320 |
+
var snp,X,Y,pgLeft,pgTop,pWd=o3_width,pHt,iWd=100,iHt=100,SB=0,LM=0,CX=0,TM=0,BM=0,CY=0,o=OLfd(),
|
321 |
+
nsb=(OLgek>=20010505&&!o3_frame.scrollbars.visible)?1:0;
|
322 |
+
if(!OLkht&&!OLop95&&o&&o.clientWidth)iWd=o.clientWidth;
|
323 |
+
else if(o3_frame.innerWidth){SB=Math.ceil(1.4*(o3_frame.outerWidth-o3_frame.innerWidth));
|
324 |
+
if(SB>20)SB=20;iWd=o3_frame.innerWidth;}
|
325 |
+
pgLeft=(OLie4&&!OLop95)?o.scrollLeft:o3_frame.pageXOffset;
|
326 |
+
if(OLie55&&OLfilterPI&&o3_filter&&o3_filtershadow)SB=CX=5;else
|
327 |
+
if((OLshadowPI)&&bkdrop&&o3_shadow&&o3_shadowx){SB+=((o3_shadowx>0)?o3_shadowx:0);
|
328 |
+
LM=((o3_shadowx<0)?Math.abs(o3_shadowx):0);CX=Math.abs(o3_shadowx);}
|
329 |
+
if(o3_ref!=""||o3_fixx> -1||o3_relx!=null||o3_midx!=null){
|
330 |
+
if(o3_ref!=""){X=OLrefXY[0];if(OLie55&&OLfilterPI&&o3_filter&&o3_filtershadow){
|
331 |
+
if(o3_refp=='UR'||o3_refp=='LR')X-=5;}
|
332 |
+
else if((OLshadowPI)&&bkdrop&&o3_shadow&&o3_shadowx){
|
333 |
+
if(o3_shadowx<0&&(o3_refp=='UL'||o3_refp=='LL'))X-=o3_shadowx;else
|
334 |
+
if(o3_shadowx>0&&(o3_refp=='UR'||o3_refp=='LR'))X-=o3_shadowx;}
|
335 |
+
}else{if(o3_midx!=null){
|
336 |
+
X=parseInt(pgLeft+((iWd-pWd-SB-LM)/2)+o3_midx);
|
337 |
+
}else{if(o3_relx!=null){
|
338 |
+
if(o3_relx>=0)X=pgLeft+o3_relx+LM;else X=pgLeft+o3_relx+iWd-pWd-SB;
|
339 |
+
}else{X=o3_fixx+LM;}}}
|
340 |
+
}else{
|
341 |
+
if(o3_hauto){
|
342 |
+
if(o3_hpos==LEFT&&OLx-pgLeft+OLifX<iWd/2&&OLx-pWd-o3_offsetx+OLifX<pgLeft+LM)o3_hpos=RIGHT;else
|
343 |
+
if(o3_hpos==RIGHT&&OLx-pgLeft+OLifX>iWd/2&&OLx+pWd+o3_offsetx+OLifX>pgLeft+iWd-SB)o3_hpos=LEFT;}
|
344 |
+
X=(o3_hpos==CENTER)?parseInt(OLx-((pWd+CX)/2)+o3_offsetx):
|
345 |
+
(o3_hpos==LEFT)?OLx-o3_offsetx-pWd:OLx+o3_offsetx;
|
346 |
+
if(o3_snapx>1){
|
347 |
+
snp=X % o3_snapx;
|
348 |
+
if(o3_hpos==LEFT){X=X-(o3_snapx+snp);}else{X=X+(o3_snapx-snp);}}X+=OLifX;}
|
349 |
+
if(!o3_nojustx&&X+pWd>pgLeft+iWd-SB)
|
350 |
+
X=iWd+pgLeft-pWd-SB;if(!o3_nojustx&&X-LM<pgLeft)X=pgLeft+LM;
|
351 |
+
pgTop=OLie4&&!OLop95?o.scrollTop:o3_frame.pageYOffset;
|
352 |
+
if(!OLkht&&!OLop95&&!nsb&&o&&o.clientHeight)iHt=o.clientHeight;
|
353 |
+
else if(o3_frame.innerHeight)iHt=o3_frame.innerHeight;
|
354 |
+
if(OLbubblePI&&o3_bubble)pHt=OLbubbleHt;else pHt=OLns4?over.clip.height:over.offsetHeight;
|
355 |
+
if((OLshadowPI)&&bkdrop&&o3_shadow&&o3_shadowy){TM=(o3_shadowy<0)?Math.abs(o3_shadowy):0;
|
356 |
+
if(OLie55&&OLfilterPI&&o3_filter&&o3_filtershadow)BM=CY=5;else
|
357 |
+
BM=(o3_shadowy>0)?o3_shadowy:0;CY=Math.abs(o3_shadowy);}
|
358 |
+
if(o3_ref!=""||o3_fixy> -1||o3_rely!=null||o3_midy!=null){
|
359 |
+
if(o3_ref!=""){Y=OLrefXY[1];if(OLie55&&OLfilterPI&&o3_filter&&o3_filtershadow){
|
360 |
+
if(o3_refp=='LL'||o3_refp=='LR')Y-=5;}else if((OLshadowPI)&&bkdrop&&o3_shadow&&o3_shadowy){
|
361 |
+
if(o3_shadowy<0&&(o3_refp=='UL'||o3_refp=='UR'))Y-=o3_shadowy;else
|
362 |
+
if(o3_shadowy>0&&(o3_refp=='LL'||o3_refp=='LR'))Y-=o3_shadowy;}
|
363 |
+
}else{if(o3_midy!=null){
|
364 |
+
Y=parseInt(pgTop+((iHt-pHt-CY)/2)+o3_midy);
|
365 |
+
}else{if(o3_rely!=null){
|
366 |
+
if(o3_rely>=0)Y=pgTop+o3_rely+TM;else Y=pgTop+o3_rely+iHt-pHt-BM;}else{
|
367 |
+
Y=o3_fixy+TM;}}}
|
368 |
+
}else{
|
369 |
+
if(o3_vauto){
|
370 |
+
if(o3_vpos==ABOVE&&OLy-pgTop+OLifY<iHt/2&&OLy-pHt-o3_offsety+OLifY<pgTop)o3_vpos=BELOW;else
|
371 |
+
if(o3_vpos==BELOW&&OLy-pgTop+OLifY>iHt/2&&OLy+pHt+o3_offsety+((OLns4||OLkht)?17:0)+OLifY>pgTop+iHt-BM)
|
372 |
+
o3_vpos=ABOVE;}Y=(o3_vpos==VCENTER)?parseInt(OLy-((pHt+CY)/2)+o3_offsety):
|
373 |
+
(o3_vpos==ABOVE)?OLy-(pHt+o3_offsety+BM):OLy+o3_offsety+TM;
|
374 |
+
if(o3_snapy>1){
|
375 |
+
snp=Y % o3_snapy;
|
376 |
+
if(pHt>0&&o3_vpos==ABOVE){Y=Y-(o3_snapy+snp);}else{Y=Y+(o3_snapy-snp);}}Y+=OLifY;}
|
377 |
+
if(!o3_nojusty&&Y+pHt+BM>pgTop+iHt)Y=pgTop+iHt-pHt-BM;if(!o3_nojusty&&Y-TM<pgTop)Y=pgTop+TM;
|
378 |
+
OLrepositionTo(over,X,Y);
|
379 |
+
if(OLshadowPI)OLrepositionShadow(X,Y);if(OLiframePI)OLrepositionIfs(X,Y);
|
380 |
+
if(OLns6&&o3_frame.innerHeight){iHt=o3_frame.innerHeight;OLrepositionTo(over,X,Y);}
|
381 |
+
if(OLscrollPI)OLchkScroll(X-pgLeft,Y-pgTop);
|
382 |
+
}
|
383 |
+
|
384 |
+
// Chooses body or documentElement
|
385 |
+
function OLfd(f){
|
386 |
+
var fd=((f)?f:o3_frame).document,fdc=fd.compatMode,fdd=fd.documentElement;
|
387 |
+
return (!OLop7&&fdc&&fdc!='BackCompat'&&fdd&&fdd.clientWidth)?fd.documentElement:fd.body;
|
388 |
+
}
|
389 |
+
|
390 |
+
// Gets location of REFerence object
|
391 |
+
function OLgetRefXY(r,d){
|
392 |
+
var o=OLgetRef(r,d),ob=o,rXY=[o3_refx,o3_refy],of;if(!o)return [null,null];if(OLns4){
|
393 |
+
if(typeof o.length!='undefined'&&o.length>1){ob=o[0];rXY[0]+=o[0].x+o[1].pageX;rXY[1]+=o[0].y+o[1].pageY;}else{
|
394 |
+
if((o.toString().indexOf('Image')!= -1)||(o.toString().indexOf('Anchor')!= -1)){rXY[0]+=o.x;rXY[1]+=o.y;}
|
395 |
+
else{rXY[0]+=o.pageX;rXY[1]+=o.pageY;}}}else{rXY[0]+=OLpageLoc(o,'Left');rXY[1]+=OLpageLoc(o,'Top');}
|
396 |
+
of=OLgetRefOffsets(ob);rXY[0]+=of[0];rXY[1]+=of[1];return rXY;
|
397 |
+
}
|
398 |
+
|
399 |
+
// Seeks REFerence by id
|
400 |
+
function OLgetRefById(l,d){
|
401 |
+
l=(l||'overDiv');d=(d||o3_frame.document);var j,r;if(d.getElementById)return d.getElementById(l);
|
402 |
+
if(OLie4&&d.all)return d.all[l];if(d.layers&&d.layers.length>0){if(d.layers[l])return d.layers[l];
|
403 |
+
for(j=0;j<d.layers.length;j++){r=OLgetRefById(l,d.layers[j].document);if(r)return r;}}return null;
|
404 |
+
}
|
405 |
+
|
406 |
+
// Seeks REFerence by name
|
407 |
+
function OLgetRefByName(l,d){
|
408 |
+
d=(d||o3_frame.document);var j,r,v=OLie4?d.all.tags('iframe'):OLns6?d.getElementsByTagName('iframe'):null;
|
409 |
+
if(typeof d.images!='undefined'&&d.images[l])return d.images[l];
|
410 |
+
if(typeof d.anchors!='undefined'&&d.anchors[l])return d.anchors[l];
|
411 |
+
if(v)for(j=0;j<v.length;j++)if(v[j].name==l)return v[j];if(d.layers&&d.layers.length>0)for(j=0;j<d.layers.length;j++){
|
412 |
+
r=OLgetRefByName(l,d.layers[j].document);if(r&&r.length>0)return r;else if(r)return [r,d.layers[j]];}return null;
|
413 |
+
}
|
414 |
+
|
415 |
+
// Gets layer vs REFerence offsets
|
416 |
+
function OLgetRefOffsets(o){
|
417 |
+
var c=o3_refc.toUpperCase(),p=o3_refp.toUpperCase(),W=0,H=0,pW=0,pH=0,of=[0,0];pW=(OLbubblePI&&o3_bubble)?
|
418 |
+
o3_width:OLns4?over.clip.width:over.offsetWidth;pH=(OLbubblePI&&o3_bubble)?OLbubbleHt:OLns4?
|
419 |
+
over.clip.height:over.offsetHeight;if((!OLop7)&&o.toString().indexOf('Image')!= -1){W=o.width;H=o.height;}
|
420 |
+
else if((!OLop7)&&o.toString().indexOf('Anchor')!= -1){c=o3_refc='UL';}else{W=(OLns4)?o.clip.width:o.offsetWidth;
|
421 |
+
H=(OLns4)?o.clip.height:o.offsetHeight;}if((OLns4||(OLns6&&OLgek))&&o.border){W+=2*parseInt(o.border);
|
422 |
+
H+=2*parseInt(o.border);}if(c=='UL'){of=(p=='UR')?[-pW,0]:(p=='LL')?[0,-pH]:(p=='LR')?[-pW,-pH]:[0,0];}else if(c=='UR'){
|
423 |
+
of=(p=='UR')?[W-pW,0]:(p=='LL')?[W,-pH]:(p=='LR')?[W-pW,-pH]:[W,0];}else if(c=='LL'){of=(p=='UR')?[-pW,H]:(p=='LL')?[0,H-pH]:
|
424 |
+
(p=='LR')?[-pW,H-pH]:[0,H];}else if(c=='LR'){of=(p=='UR')?[W-pW,H]:(p=='LL')?[W,H-pH]:(p=='LR')?[W-pW,H-pH]:[W,H];}return of;
|
425 |
+
}
|
426 |
+
|
427 |
+
// Gets x or y location of object
|
428 |
+
function OLpageLoc(o,t){
|
429 |
+
var l=0,s=o;while(o.offsetParent&&o.offsetParent.tagName.toLowerCase()!='html'){l+=o['offset'+t];o=o.offsetParent;}
|
430 |
+
l+=o['offset'+t];if(!OLop7)while(s=s.parentNode){if((s['scroll'+t]>0)&&s.tagName.toLowerCase()=='div')l-=s['scroll'+t];}
|
431 |
+
return l;
|
432 |
+
}
|
433 |
+
|
434 |
+
// Moves layer
|
435 |
+
function OLmouseMove(e){
|
436 |
+
var e=(e||event);OLcC=(OLovertwoPI&&over2&&over==over2?cClick2:cClick);OLx=(e.pageX||e.clientX+OLfd().scrollLeft);
|
437 |
+
OLy=(e.pageY||e.clientY+OLfd().scrollTop);if((OLallowmove&&over)&&(o3_frame==self||over==OLgetRefById()||(OLovertwoPI&&
|
438 |
+
over2==over&&over==OLgetRefById('overDiv2')))){OLplaceLayer();if(OLhidePI)OLhideUtil(0,1,1,0,0,0);}if(OLhover&&over&&
|
439 |
+
o3_frame==self&&OLcursorOff())if(o3_offdelay<1)OLcC();else{if(OLtimerid>0)clearTimeout(OLtimerid);
|
440 |
+
OLtimerid=setTimeout("OLcC()",o3_offdelay);}
|
441 |
+
}
|
442 |
+
|
443 |
+
// Capture mouse and chain other scripts.
|
444 |
+
function OLmh(){
|
445 |
+
var fN,f,j,k,s,mh=OLmouseMove,w=(OLns4&&window.onmousemove),re=/function[ ]*(\w*)\(/;OLdw=document;if(document.onmousemove||
|
446 |
+
w){if(w)OLdw=window;f=OLdw.onmousemove.toString();fN=f.match(re);if(!fN||fN[1]=='anonymous'||fN[1]=='OLmouseMove'){OLchkMh=0;
|
447 |
+
return;}if(fN[1])s=fN[1]+'(e)';else{j=f.indexOf('{');k=f.lastIndexOf('}')+1;s=f.substring(j,k);}s+=';OLmouseMove(e);';
|
448 |
+
mh=new Function('e',s);}OLdw.onmousemove=mh;if(OLns4)OLdw.captureEvents(Event.MOUSEMOVE);
|
449 |
+
}
|
450 |
+
|
451 |
+
/*
|
452 |
+
PARSING
|
453 |
+
*/
|
454 |
+
function OLparseTokens(pf,ar){
|
455 |
+
var i,v,md= -1,par=(pf!='ol_'),p=OLpar,q=OLparQuo,t=OLtoggle;OLudf=(par&&!ar.length?1:0);
|
456 |
+
for(i=0;i<ar.length;i++){if(md<0){if(typeof ar[i]=='number'){OLudf=(par?1:0);i--;}
|
457 |
+
else{switch(pf){case 'ol_':ol_text=ar[i];break;default:o3_text=ar[i];}}md=0;}else{
|
458 |
+
if(ar[i]==INARRAY){OLudf=0;eval(pf+'text=ol_texts['+ar[++i]+']');continue;}
|
459 |
+
if(ar[i]==CAPARRAY){eval(pf+'cap=ol_caps['+ar[++i]+']');continue;}
|
460 |
+
if(ar[i]==CAPTION){q(ar[++i],pf+'cap');continue;}
|
461 |
+
if(Math.abs(ar[i])==STICKY){t(ar[i],pf+'sticky');continue;}
|
462 |
+
if(Math.abs(ar[i])==NOFOLLOW){t(ar[i],pf+'nofollow');continue;}
|
463 |
+
if(ar[i]==BACKGROUND){q(ar[++i],pf+'background');continue;}
|
464 |
+
if(Math.abs(ar[i])==NOCLOSE){t(ar[i],pf+'noclose');continue;}
|
465 |
+
if(Math.abs(ar[i])==MOUSEOFF){t(ar[i],pf+'mouseoff');continue;}
|
466 |
+
if(ar[i]==OFFDELAY){p(ar[++i],pf+'offdelay');continue;}
|
467 |
+
if(ar[i]==RIGHT||ar[i]==LEFT||ar[i]==CENTER){p(ar[i],pf+'hpos');continue;}
|
468 |
+
if(ar[i]==OFFSETX){p(ar[++i],pf+'offsetx');continue;}
|
469 |
+
if(ar[i]==OFFSETY){p(ar[++i],pf+'offsety');continue;}
|
470 |
+
if(ar[i]==FGCOLOR){q(ar[++i],pf+'fgcolor');continue;}
|
471 |
+
if(ar[i]==BGCOLOR){q(ar[++i],pf+'bgcolor');continue;}
|
472 |
+
if(ar[i]==CGCOLOR){q(ar[++i],pf+'cgcolor');continue;}
|
473 |
+
if(ar[i]==TEXTCOLOR){q(ar[++i],pf+'textcolor');continue;}
|
474 |
+
if(ar[i]==CAPCOLOR){q(ar[++i],pf+'capcolor');continue;}
|
475 |
+
if(ar[i]==CLOSECOLOR){q(ar[++i],pf+'closecolor');continue;}
|
476 |
+
if(ar[i]==WIDTH){p(ar[++i],pf+'width');continue;}
|
477 |
+
if(Math.abs(ar[i])==WRAP){t(ar[i],pf+'wrap');continue;}
|
478 |
+
if(ar[i]==WRAPMAX){p(ar[++i],pf+'wrapmax');continue;}
|
479 |
+
if(ar[i]==HEIGHT){p(ar[++i],pf+'height');continue;}
|
480 |
+
if(ar[i]==BORDER){p(ar[++i],pf+'border');continue;}
|
481 |
+
if(ar[i]==BASE){p(ar[++i],pf+'base');continue;}
|
482 |
+
if(ar[i]==STATUS){q(ar[++i],pf+'status');continue;}
|
483 |
+
if(Math.abs(ar[i])==AUTOSTATUS){v=pf+'autostatus';
|
484 |
+
eval(v+'=('+ar[i]+'<0)?('+v+'==2?2:0):('+v+'==1?0:1)');continue;}
|
485 |
+
if(Math.abs(ar[i])==AUTOSTATUSCAP){v=pf+'autostatus';
|
486 |
+
eval(v+'=('+ar[i]+'<0)?('+v+'==1?1:0):('+v+'==2?0:2)');continue;}
|
487 |
+
if(ar[i]==CLOSETEXT){q(ar[++i],pf+'close');continue;}
|
488 |
+
if(ar[i]==SNAPX){p(ar[++i],pf+'snapx');continue;}
|
489 |
+
if(ar[i]==SNAPY){p(ar[++i],pf+'snapy');continue;}
|
490 |
+
if(ar[i]==FIXX){p(ar[++i],pf+'fixx');continue;}
|
491 |
+
if(ar[i]==FIXY){p(ar[++i],pf+'fixy');continue;}
|
492 |
+
if(ar[i]==RELX){p(ar[++i],pf+'relx');continue;}
|
493 |
+
if(ar[i]==RELY){p(ar[++i],pf+'rely');continue;}
|
494 |
+
if(ar[i]==MIDX){p(ar[++i],pf+'midx');continue;}
|
495 |
+
if(ar[i]==MIDY){p(ar[++i],pf+'midy');continue;}
|
496 |
+
if(ar[i]==REF){q(ar[++i],pf+'ref');continue;}
|
497 |
+
if(ar[i]==REFC){q(ar[++i],pf+'refc');continue;}
|
498 |
+
if(ar[i]==REFP){q(ar[++i],pf+'refp');continue;}
|
499 |
+
if(ar[i]==REFX){p(ar[++i],pf+'refx');continue;}
|
500 |
+
if(ar[i]==REFY){p(ar[++i],pf+'refy');continue;}
|
501 |
+
if(ar[i]==FGBACKGROUND){q(ar[++i],pf+'fgbackground');continue;}
|
502 |
+
if(ar[i]==BGBACKGROUND){q(ar[++i],pf+'bgbackground');continue;}
|
503 |
+
if(ar[i]==CGBACKGROUND){q(ar[++i],pf+'cgbackground');continue;}
|
504 |
+
if(ar[i]==PADX){p(ar[++i],pf+'padxl');p(ar[++i],pf+'padxr');continue;}
|
505 |
+
if(ar[i]==PADY){p(ar[++i],pf+'padyt');p(ar[++i],pf+'padyb');continue;}
|
506 |
+
if(Math.abs(ar[i])==FULLHTML){t(ar[i],pf+'fullhtml');continue;}
|
507 |
+
if(ar[i]==BELOW||ar[i]==ABOVE||ar[i]==VCENTER){p(ar[i],pf+'vpos');continue;}
|
508 |
+
if(ar[i]==CAPICON){q(ar[++i],pf+'capicon');continue;}
|
509 |
+
if(ar[i]==TEXTFONT){q(ar[++i],pf+'textfont');continue;}
|
510 |
+
if(ar[i]==CAPTIONFONT){q(ar[++i],pf+'captionfont');continue;}
|
511 |
+
if(ar[i]==CLOSEFONT){q(ar[++i],pf+'closefont');continue;}
|
512 |
+
if(ar[i]==TEXTSIZE){q(ar[++i],pf+'textsize');continue;}
|
513 |
+
if(ar[i]==CAPTIONSIZE){q(ar[++i],pf+'captionsize');continue;}
|
514 |
+
if(ar[i]==CLOSESIZE){q(ar[++i],pf+'closesize');continue;}
|
515 |
+
if(ar[i]==TIMEOUT){p(ar[++i],pf+'timeout');continue;}
|
516 |
+
if(ar[i]==DELAY){p(ar[++i],pf+'delay');continue;}
|
517 |
+
if(Math.abs(ar[i])==HAUTO){t(ar[i],pf+'hauto');continue;}
|
518 |
+
if(Math.abs(ar[i])==VAUTO){t(ar[i],pf+'vauto');continue;}
|
519 |
+
if(Math.abs(ar[i])==NOJUSTX){t(ar[i],pf+'nojustx');continue;}
|
520 |
+
if(Math.abs(ar[i])==NOJUSTY){t(ar[i],pf+'nojusty');continue;}
|
521 |
+
if(Math.abs(ar[i])==CLOSECLICK){t(ar[i],pf+'closeclick');continue;}
|
522 |
+
if(ar[i]==CLOSETITLE){q(ar[++i],pf+'closetitle');continue;}
|
523 |
+
if(ar[i]==FGCLASS){q(ar[++i],pf+'fgclass');continue;}
|
524 |
+
if(ar[i]==BGCLASS){q(ar[++i],pf+'bgclass');continue;}
|
525 |
+
if(ar[i]==CGCLASS){q(ar[++i],pf+'cgclass');continue;}
|
526 |
+
if(ar[i]==TEXTPADDING){p(ar[++i],pf+'textpadding');continue;}
|
527 |
+
if(ar[i]==TEXTFONTCLASS){q(ar[++i],pf+'textfontclass');continue;}
|
528 |
+
if(ar[i]==CAPTIONPADDING){p(ar[++i],pf+'captionpadding');continue;}
|
529 |
+
if(ar[i]==CAPTIONFONTCLASS){q(ar[++i],pf+'captionfontclass');continue;}
|
530 |
+
if(ar[i]==CLOSEFONTCLASS){q(ar[++i],pf+'closefontclass');continue;}
|
531 |
+
if(Math.abs(ar[i])==CAPBELOW){t(ar[i],pf+'capbelow');continue;}
|
532 |
+
if(ar[i]==LABEL){q(ar[++i],pf+'label');continue;}
|
533 |
+
if(Math.abs(ar[i])==DECODE){t(ar[i],pf+'decode');continue;}
|
534 |
+
if(ar[i]==DONOTHING){continue;}
|
535 |
+
i=OLparseCmdLine(pf,i,ar);}}
|
536 |
+
if((OLfunctionPI)&&OLudf&&o3_function)o3_text=o3_function();
|
537 |
+
if(pf=='o3_')OLfontSize();
|
538 |
+
}
|
539 |
+
function OLpar(a,v){eval(v+'='+a);}
|
540 |
+
function OLparQuo(a,v){eval(v+"='"+OLescSglQt(a)+"'");}
|
541 |
+
function OLescSglQt(s){return s.toString().replace(/\\/g,"\\\\").replace(/'/g,"\\'");}
|
542 |
+
function OLtoggle(a,v){eval(v+'=('+v+'==0&&'+a+'>=0)?1:0');}
|
543 |
+
function OLhasDims(s){return /[%\-a-z]+$/.test(s);}
|
544 |
+
function OLfontSize(){
|
545 |
+
var i;if(OLhasDims(o3_textsize)){if(OLns4)o3_textsize="2";}else
|
546 |
+
if(!OLns4){i=parseInt(o3_textsize);o3_textsize=(i>0&&i<8)?OLpct[i]:OLpct[0];}
|
547 |
+
if(OLhasDims(o3_captionsize)){if(OLns4)o3_captionsize="2";}else
|
548 |
+
if(!OLns4){i=parseInt(o3_captionsize);o3_captionsize=(i>0&&i<8)?OLpct[i]:OLpct[0];}
|
549 |
+
if(OLhasDims(o3_closesize)){if(OLns4)o3_closesize="2";}else
|
550 |
+
if(!OLns4){i=parseInt(o3_closesize);o3_closesize=(i>0&&i<8)?OLpct[i]:OLpct[0];}
|
551 |
+
if(OLprintPI)OLprintDims();
|
552 |
+
}
|
553 |
+
function OLdecode(){
|
554 |
+
var re=/%[0-9A-Fa-f]{2,}/,t=o3_text,c=o3_cap,u=unescape,d=!OLns4&&(!OLgek||OLgek>=20020826)&&typeof decodeURIComponent?
|
555 |
+
decodeURIComponent:u;if(typeof(window.TypeError)=='function'){if(re.test(t)){eval(new Array('try{','o3_text=d(t);',
|
556 |
+
'}catch(e){','o3_text=u(t);','}').join('\n'))};if(c&&re.test(c)){eval(new Array('try{','o3_cap=d(c);','}catch(e){',
|
557 |
+
'o3_cap=u(c);','}').join('\n'))}}else{if(re.test(t))o3_text=u(t);if(c&&re.test(c))o3_cap=u(c);}
|
558 |
+
}
|
559 |
+
|
560 |
+
/*
|
561 |
+
LAYER FUNCTIONS
|
562 |
+
*/
|
563 |
+
// Writes to layer
|
564 |
+
function OLlayerWrite(t){
|
565 |
+
t+="\n";if(OLns4){over.document.write(t);over.document.close();}else if(typeof over.innerHTML!='undefined'){
|
566 |
+
if(OLieM)over.innerHTML='';over.innerHTML=t;}else{var range=o3_frame.document.createRange();range.setStartAfter(over);
|
567 |
+
var domfrag=range.createContextualFragment(t);while(over.hasChildNodes()){over.removeChild(over.lastChild);}
|
568 |
+
over.appendChild(domfrag);}if(OLovertwoPI&&over==over2)OLover2HTML=t;else OLoverHTML=t;
|
569 |
+
if(OLprintPI)over.print=o3_print?t:null;
|
570 |
+
}
|
571 |
+
|
572 |
+
// Makes object visible
|
573 |
+
function OLshowObject(o){
|
574 |
+
OLshowid=0;o=(OLns4)?o:o.style;if(((OLfilterPI)&&!OLchkFilter(o))||!OLfilterPI)o.visibility="visible";
|
575 |
+
if(OLshadowPI)OLshowShadow();if(OLiframePI)OLshowIfs();if(OLhidePI)OLhideUtil(1,1,0);
|
576 |
+
}
|
577 |
+
|
578 |
+
// Hides object
|
579 |
+
function OLhideObject(o){
|
580 |
+
if(OLshowid>0){clearTimeout(OLshowid);OLshowid=0;}if(OLtimerid>0)clearTimeout(OLtimerid);
|
581 |
+
if(OLdelayid>0)clearTimeout(OLdelayid);OLtimerid=0;OLdelayid=0;self.status="";o3_label=ol_label;
|
582 |
+
if(o3_frame!=self)o=OLgetRefById();if(o){if(o.onmouseover)o.onmouseover=null;if(OLscrollPI&&o==over)OLclearScroll();
|
583 |
+
if(OLdraggablePI)OLclearDrag();if(OLfilterPI)OLcleanupFilter(o);if(OLshadowPI)OLhideShadow();var os=(OLns4)?o:o.style;
|
584 |
+
if(((OLfilterPI)&&!OLchkFadeOut(os))||!OLfilterPI){os.visibility="hidden";if(!OLie55||(typeof ggOnChange=='undefined'&&
|
585 |
+
(!OLfilterPI||!o3_filter||o3_fadeout<0)))o.innerHTML='';}if(OLhidePI&&o==over)OLhideUtil(0,0,1);if(OLiframePI)OLhideIfs(o);}
|
586 |
+
}
|
587 |
+
|
588 |
+
// Moves layer
|
589 |
+
function OLrepositionTo(o,xL,yL){
|
590 |
+
o=(OLns4)?o:o.style;o.left=(OLns4?xL:xL+'px');o.top=(OLns4?yL:yL+'px');
|
591 |
+
}
|
592 |
+
|
593 |
+
// Handle NOCLOSE-MOUSEOFF
|
594 |
+
function OLoptMOUSEOFF(c){
|
595 |
+
if(!c)o3_close="";
|
596 |
+
over.onmouseover=function(){OLhover=1;if(OLtimerid>0){clearTimeout(OLtimerid);OLtimerid=0;}}
|
597 |
+
}
|
598 |
+
function OLcursorOff(){
|
599 |
+
var o=(OLns4?over:over.style),pHt=OLns4?over.clip.height:over.offsetHeight,left=parseInt(o.left),top=parseInt(o.top),
|
600 |
+
right=left+o3_width,bottom=top+((OLbubblePI&&o3_bubble)?OLbubbleHt:pHt);
|
601 |
+
if(OLx<left||OLx>right||OLy<top||OLy>bottom)return true;return false;
|
602 |
+
}
|
603 |
+
|
604 |
+
/*
|
605 |
+
REGISTRATION
|
606 |
+
*/
|
607 |
+
function OLsetRunTimeVar(){
|
608 |
+
if(OLrunTime.length)for(var k=0;k<OLrunTime.length;k++)OLrunTime[k]();
|
609 |
+
}
|
610 |
+
function OLparseCmdLine(pf,i,ar){
|
611 |
+
if(OLcmdLine.length){for(var k=0;k<OLcmdLine.length;k++){var j=OLcmdLine[k](pf,i,ar);if(j>-1){i=j;break;}}}return i;
|
612 |
+
}
|
613 |
+
function OLregCmds(c){
|
614 |
+
if(typeof c!='string')return;var pM=c.split(',');pMtr=pMtr.concat(pM);
|
615 |
+
for(var i=0;i<pM.length;i++)eval(pM[i].toUpperCase()+'='+pmCnt++);
|
616 |
+
}
|
617 |
+
function OLregRunTimeFunc(f){
|
618 |
+
if(typeof f=='object')OLrunTime=OLrunTime.concat(f);else OLrunTime[OLrunTime.length++]=f;
|
619 |
+
}
|
620 |
+
function OLregCmdLineFunc(f){
|
621 |
+
if(typeof f=='object')OLcmdLine=OLcmdLine.concat(f);else OLcmdLine[OLcmdLine.length++]=f;
|
622 |
+
}
|
623 |
+
|
624 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_bubble.js
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_bubble.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the BUBBLE feature.
|
4 |
+
Initial: July 26, 2003 - Last Revised: January 26, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLbubbleCmds='bubble,bubbletype,adjbubble,rcbubblecolor,bubbleclose';OLregCmds(OLbubbleCmds);
|
14 |
+
|
15 |
+
// DEFAULT CONFIGURATION
|
16 |
+
if(OLud('bubble'))var ol_bubble=0;
|
17 |
+
if(OLud('bubbletype'))var ol_bubbletype='';
|
18 |
+
if(OLud('adjbubble'))var ol_adjbubble=0;
|
19 |
+
if(OLud('rcbubblecolor'))var ol_rcbubblecolor='#ffffcc';
|
20 |
+
if(OLud('bubbleclose'))var ol_bubbleclose=0;
|
21 |
+
// END CONFIGURATION
|
22 |
+
|
23 |
+
function OLund(v){return eval('typeof '+v+'=="undefined"')?1:0;}
|
24 |
+
if(OLund('OLbubbleImageSet'))var OLbubbleImageSet='flower,oval,square,pushpin,quotation,roundcorners';
|
25 |
+
if(OLund('OLbubbleImages'))var OLbubbleImages=OLbubbleImageSet;
|
26 |
+
if(OLund('OLbubbleImageDir'))var OLbubbleImageDir='./';
|
27 |
+
if(OLund('OLbubbleIMGsuffix'))var OLbubbleIMGsuffix='';
|
28 |
+
if(OLund('OLbubbleRCsuffix'))var OLbubbleRCsuffix='';
|
29 |
+
if(OLund('OLimgWidth'))var OLimgWidth=[250,330,144,202,200];
|
30 |
+
if(OLund('OLimgHeight'))var OLimgHeight=[150,160,190,221,66];
|
31 |
+
if(OLund('OLcontentWidth'))var OLcontentWidth=[200,250,130,184,190];
|
32 |
+
if(OLund('OLcontentHeight'))var OLcontentHeight=[80,85,150,176,46];
|
33 |
+
if(OLund('OLpadLeft'))var OLpadLeft=[30,40,7,9,5];
|
34 |
+
if(OLund('OLpadTop'))var OLpadTop=[25,48,10,34,4];
|
35 |
+
if(OLund('OLarwTipX'))var OLarwTipX=[180,50,51,9,19];
|
36 |
+
if(OLund('OLarwTipY'))var OLarwTipY=[148,5,180,221,64];
|
37 |
+
|
38 |
+
var o3_bubble=0,o3_bubbletype='',o3_adjbubble=0,o3_rcbubblecolor='',o3_bubbleclose=0,
|
39 |
+
OLbubbleHt=0,OLbI,OLbContentWd=OLcontentWidth;
|
40 |
+
OLregisterImages(OLbubbleImageSet,OLbubbleImageDir,OLbubbleIMGsuffix,OLbubbleRCsuffix);
|
41 |
+
|
42 |
+
function OLloadBubble(){
|
43 |
+
OLload(OLbubbleCmds);OLbubbleHt=0;
|
44 |
+
}
|
45 |
+
|
46 |
+
function OLparseBubble(pf,i,ar){
|
47 |
+
var k=i,t=OLtoggle,q=OLparQuo;if(k<ar.length){
|
48 |
+
if(Math.abs(ar[k])==BUBBLE){t(ar[k],pf+'bubble');return k;}
|
49 |
+
if(ar[k]==BUBBLETYPE){q(ar[++k],pf+'bubbletype');return k;}
|
50 |
+
if(Math.abs(ar[k])==ADJBUBBLE){t(ar[k],pf+'adjbubble');return k;}
|
51 |
+
if(ar[k]==RCBUBBLECOLOR){q(ar[++k],pf+'rcbubblecolor');return k;}
|
52 |
+
if(Math.abs(ar[k])==BUBBLECLOSE){t(ar[k],pf+'bubbleclose');return k;}}
|
53 |
+
return -1;
|
54 |
+
}
|
55 |
+
|
56 |
+
function OLchkForBubbleEffect(){
|
57 |
+
if(o3_bubble){o3_bubbletype=(o3_bubbletype)?o3_bubbletype:'flower';
|
58 |
+
for(var i=0;i<OLbTypes.length;i++){if(OLbTypes[i]==o3_bubbletype){OLbI=i;break;}}
|
59 |
+
// disable inappropriate parameters
|
60 |
+
o3_bgcolor=o3_fgcolor='';o3_border=o3_base=0;o3_fgbackground=o3_bgbackground=o3_cgbackground=o3_background='';
|
61 |
+
o3_cap='';if(o3_sticky)o3_noclose=(o3_bubbleclose)?0:1;o3_fullhtml=0;if(OLshadowPI)o3_shadow=0;
|
62 |
+
if(o3_bubbletype.indexOf('roundcorners')<0){o3_width=OLbContentWd[OLbI];o3_hpos=RIGHT;o3_vpos=BELOW;o3_vauto=0;
|
63 |
+
o3_hauto=0;o3_wrap=0;o3_nojusty=1;}}return true;
|
64 |
+
}
|
65 |
+
|
66 |
+
function OLregisterImages(imgStr,path,isuffix,rsuffix){
|
67 |
+
if(typeof imgStr!='string')return;var p=(path&&typeof path=='string')?path:'.',is=(typeof isuffix=='string')?isuffix:'',
|
68 |
+
rs=(typeof rsuffix=='string')?rsuffix:'',bT;if(p.charAt(p.length-1)=='/')p=p.substring(0,p.length-1);
|
69 |
+
if(OLund('OLbTypes'))OLbTypes=imgStr.split(',');if(OLund('OLbubbleImg')){OLbubbleImg=new Array();
|
70 |
+
for(var i=0;i<OLbTypes.length;i++){bT=OLbTypes[i];if(OLbubbleImages.indexOf(bT)<0)continue;
|
71 |
+
if(bT.indexOf('roundcorners')==0){OLbubbleImg[i]=new Array();
|
72 |
+
var o=OLbubbleImg[i],su=((bT.length>12)?bT.substring(12):'')+rs;
|
73 |
+
o[0]=new Image();o[0].src=p+'/cornerTL'+su+'.gif';o[1]=new Image();o[1].src=p+'/edgeT'+su+'.gif';
|
74 |
+
o[2]=new Image();o[2].src=p+'/cornerTR'+su+'.gif';o[3]=new Image();o[3].src=p+'/edgeL'+su+'.gif';
|
75 |
+
o[4]=new Image();o[4].src=p+'/edgeR'+su+'.gif';o[5]=new Image();o[5].src=p+'/cornerBL'+su+'.gif';
|
76 |
+
o[6]=new Image();o[6].src=p+'/edgeB'+su+'.gif';o[7]=new Image();o[7].src=p+'/cornerBR'+su+'.gif';}
|
77 |
+
else{OLbubbleImg[i]=new Image();OLbubbleImg[i].src=p+'/'+bT+is+'.gif';}}}
|
78 |
+
}
|
79 |
+
|
80 |
+
function OLgenerateBubble(content){
|
81 |
+
if(!o3_bubble)return;if(o3_bubbletype.indexOf('roundcorners')==0)return OLdoRoundCorners(content);
|
82 |
+
var ar,X,Y,W,fc=1.0,txt,sY,bHtDiff,bPadDiff=0,bLobj,bCobj,bTopPad=OLpadTop,bLeftPad=OLpadLeft,
|
83 |
+
bContentHt=OLcontentHeight,bHt=OLimgHeight,bWd=OLimgWidth,bArwTipX=OLarwTipX,bArwTipY=OLarwTipY;
|
84 |
+
bHtDiff=fc*bContentHt[OLbI]-(OLns4?over.clip.height:over.offsetHeight);if(o3_adjbubble){
|
85 |
+
fc=OLresizeBubble(bHtDiff,0.5,fc);ar=OLgetHeightDiff(fc);bHtDiff=ar[0];content=ar[1];}
|
86 |
+
if(bHtDiff>0)bPadDiff=(bHtDiff<2)?0:parseInt(0.5*bHtDiff);
|
87 |
+
Y=(bHtDiff<0)?fc*bTopPad[OLbI]:fc*bTopPad[OLbI]+bPadDiff;X=fc*bLeftPad[OLbI];
|
88 |
+
Y=Math.ceil(Y);X=Math.ceil(X);o3_width=Math.ceil(fc*bWd[OLbI]);W=Math.ceil(fc*OLbContentWd[OLbI]);
|
89 |
+
OLbubbleHt=Math.ceil((bHtDiff<0?fc*bHt[OLbI]-bHtDiff:fc*bHt[OLbI]));
|
90 |
+
txt='<img src="'+OLbubbleImg[OLbI].src+'" width="'+o3_width+'" height="'+OLbubbleHt+'" />'
|
91 |
+
+(OLns4?'<div id="bContent">':'<div id="bContent" style="position:absolute; top:'+Y+'px; left:'
|
92 |
+
+X+'px; width:'+W+'px; z-index:1;">')+content+'</div>';OLlayerWrite(txt);
|
93 |
+
if(OLns4){bCobj=over.document.layers['bContent'];if(typeof bCobj=='undefined')return;
|
94 |
+
bCobj.top=Y;bCobj.left=X;bCobj.clip.width=W;bCobj.zIndex=1;}
|
95 |
+
if(fc*bArwTipY[OLbI]<0.5*fc*bHt[OLbI])sY=Math.ceil(fc*bArwTipY[OLbI]);else sY= -(OLbubbleHt+20);
|
96 |
+
o3_offsetx -=Math.ceil(fc*bArwTipX[OLbI]);o3_offsety +=sY;
|
97 |
+
}
|
98 |
+
|
99 |
+
function OLdoRoundCorners(content){
|
100 |
+
var wd=(OLns4)?over.clip.width:over.offsetWidth,ht=(OLns4)?over.clip.height:over.offsetHeight,
|
101 |
+
o=OLbubbleImg[OLbI],ids=(OLns6?' style="display:block;"':''),wd14='" width="14',ht14='" height="14"',
|
102 |
+
t='<table cellpadding="0" cellspacing="0" border="0"><tr><td align="right" valign="bottom"><img src="'
|
103 |
+
+o[0].src+wd14+ht14+ids+' /></td><td valign="bottom"><img src="'
|
104 |
+
+o[1].src+'" width="'+wd+ht14+ids+' /></td><td align="left" valign="bottom"><img src="'
|
105 |
+
+o[2].src+wd14+ht14+ids+' /></td></tr><tr><td align="right"><img src="'
|
106 |
+
+o[3].src+wd14+'" height="'+ht+'"'+ids+' /></td><td bgcolor="'+o3_rcbubblecolor+'">'
|
107 |
+
+content+'</td><td align="left"><img src="'
|
108 |
+
+o[4].src+wd14+'" height="'+ht+'"'+ids+' /></td></tr><tr><td align="right" valign="top"><img src="'
|
109 |
+
+o[5].src+wd14+ht14+' /></td><td valign="top"><img src="'
|
110 |
+
+o[6].src+'" width="'+wd+ht14+' /></td><td align="left" valign="top"><img src="'
|
111 |
+
+o[7].src+wd14+ht14+' /></td></tr></table>';OLlayerWrite(t);o3_width=wd+28;OLbubbleHt=ht+28;
|
112 |
+
}
|
113 |
+
|
114 |
+
function OLresizeBubble(h1,dF,fold){
|
115 |
+
var df,h2,fnew,alpha,cnt=0;while(cnt<2){df= -OLsignOf(h1)*dF;fnew=fold+df;h2=OLgetHeightDiff(fnew)[0];
|
116 |
+
if(Math.abs(h2)<11)break;if(OLsignOf(h1)!=OLsignOf(h2)){alpha=Math.abs(h1)/(Math.abs(h1)+Math.abs(h2));
|
117 |
+
if(h1<0)fnew=alpha*fnew+(1.0-alpha)*fold;else fnew=(1.0-alpha)*fnew+alpha*fold;}else{
|
118 |
+
alpha=Math.abs(h1)/(Math.abs(h2)-Math.abs(h1));if(h1<0)fnew=(1.0+alpha)*fold-alpha*fnew;
|
119 |
+
else fnew=(1.0+alpha)*fnew-alpha*fold;}fold=fnew;h1=h2;dF*=0.5;cnt++;}return fnew;
|
120 |
+
}
|
121 |
+
function OLsignOf(x){return (x<0)? -1:1;}
|
122 |
+
|
123 |
+
function OLgetHeightDiff(f){
|
124 |
+
var lyrhtml;o3_width=Math.ceil(f*OLcontentWidth[OLbI]);lyrhtml=OLcontentSimple(o3_text);OLlayerWrite(lyrhtml)
|
125 |
+
return [f*OLcontentHeight[OLbI]-((OLns4)?over.clip.height:over.offsetHeight),lyrhtml];
|
126 |
+
}
|
127 |
+
|
128 |
+
OLregRunTimeFunc(OLloadBubble);OLregCmdLineFunc(OLparseBubble);
|
129 |
+
|
130 |
+
if(OLns4)
|
131 |
+
document.write('<style type="text/css">\n<!--\n#bContent{position:absolute;left:0px;top:0px;width:1024}\n'
|
132 |
+
+'-->\n<'+'\/style>');
|
133 |
+
OLbubblePI=1;
|
134 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_crossframe.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_crossframe.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of FRAME.
|
4 |
+
Initial: August 3, 2003 - Last Revised: October 25, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
OLregCmds('frame');
|
14 |
+
|
15 |
+
function OLparseCrossframe(pf,i,ar){
|
16 |
+
var k=i,v;
|
17 |
+
if(k<ar.length){
|
18 |
+
if(ar[k]==FRAME){v=ar[++k];if(pf=='ol_')ol_frame=v;else OLoptFRAME(v);return k;}}
|
19 |
+
return -1;
|
20 |
+
}
|
21 |
+
|
22 |
+
function OLgetFrameRef(thisFrame,ofrm){
|
23 |
+
var i,v,retVal='';for(i=0;i<thisFrame.length;i++){if((((thisFrame[i].length>0)))&&(((OLns4))||
|
24 |
+
((OLie4)&&(v=thisFrame[i].document.all.tags('iframe'))!=null&&v.length==0)||
|
25 |
+
((OLns6)&&(v=thisFrame[i].document.getElementsByTagName('iframe'))!=null&&v.length==0))){
|
26 |
+
retVal=OLgetFrameRef(thisFrame[i],ofrm);if(retVal=='')continue;}
|
27 |
+
else if(thisFrame[i]!=ofrm)continue;retVal='['+i+']'+retVal;break;}
|
28 |
+
return retVal;
|
29 |
+
}
|
30 |
+
|
31 |
+
function OLoptFRAME(frm){
|
32 |
+
o3_frame=OLmkLyr('overDiv',frm)?frm:self;if(o3_frame!=self){var l,tFrm=OLgetFrameRef(top.frames,o3_frame),
|
33 |
+
sFrm=OLgetFrameRef(top.frames,ol_frame);if(sFrm.length==tFrm.length) {l=tFrm.lastIndexOf('[');if(l){
|
34 |
+
while(sFrm.substring(0,l)!=tFrm.substring(0,l))l=tFrm.lastIndexOf('[',l-1);tFrm=tFrm.substr(l);sFrm=sFrm.substr(l);}}
|
35 |
+
var i,k,cnt=0,p='',str=tFrm;while((k=str.lastIndexOf('['))!= -1){cnt++;str=str.substring(0,k);}if(!sFrm&&o3_frame==parent)
|
36 |
+
sFrm=OLgetFrameRef(parent,self);else for(i=0;i<cnt;i++)p=p+'parent.';OLfnRef=p+'frames'+sFrm+'.';var n=window.name,o;
|
37 |
+
if((n&&parent!=self&&o3_frame==parent)&&(o=OLgetRef(n,parent.document))){if(OLie4&&!OLop7){
|
38 |
+
OLx=event.clientX+OLfd().scrollLeft;OLy=event.clientY+OLfd().scrollTop;}
|
39 |
+
OLifX=OLpageLoc(o,'Left')-(OLie4&&!OLop7?OLfd().scrollLeft:self.pageXOffset);
|
40 |
+
OLifY=OLpageLoc(o,'Top')-(OLie4&&!OLop7?OLfd().scrollTop:self.pageYOffset);}}
|
41 |
+
}
|
42 |
+
|
43 |
+
function OLchkIfRef(){
|
44 |
+
var n=(parent!=self&&o3_frame==parent)?window.name:'',o=n?OLgetRef(n):null;
|
45 |
+
if(o){var oR=OLgetRef(o3_ref,document);if(oR){OLrefXY=OLgetRefXY(o3_ref,document);
|
46 |
+
OLrefXY[0]+=(OLpageLoc(o,'Left')-(OLie4&&!OLop7?OLfd(self).scrollLeft:self.pageXOffset));
|
47 |
+
OLrefXY[1]+=(OLpageLoc(o,'Top')-(OLie4&&!OLop7?OLfd(self).scrollTop:self.pageYOffset));}}
|
48 |
+
}
|
49 |
+
|
50 |
+
function OLchkFRAME(args){
|
51 |
+
var OLfrmVal=self;for(var i=0;i<args.length;i++){if(typeof args[i]=='number'&&args[i]==FRAME){OLfrmVal=args[i+1];break;}}
|
52 |
+
if(OLfrmVal!=self&&OLfrmVal.over&&OLfrmVal.cClick)OLfrmVal.cClick();
|
53 |
+
}
|
54 |
+
|
55 |
+
OLregCmdLineFunc(OLparseCrossframe);
|
56 |
+
|
57 |
+
OLcrossframePI=1;
|
58 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_debug.js
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_debug.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the OLshowProperties() debugging function.
|
4 |
+
Initial: July 26, 2003 - Last Revised: June 22, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLzIndex;
|
14 |
+
OLregCmds('allowdebug');
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('allowdebug'))var ol_allowdebug='';
|
18 |
+
// END CONFIGURATION
|
19 |
+
|
20 |
+
var o3_allowdebug='';
|
21 |
+
|
22 |
+
function OLloadDebug(){
|
23 |
+
OLload('allowdebug');
|
24 |
+
}
|
25 |
+
|
26 |
+
function OLparseDebug(pf,i,ar){
|
27 |
+
var k=i;
|
28 |
+
if(ar[k]==ALLOWDEBUG){
|
29 |
+
if(k<(ar.length-1)&&typeof ar[k+1]=='string')OLparQuo(ar[++k],pf+'allowdebug');return k;}
|
30 |
+
return -1;
|
31 |
+
}
|
32 |
+
|
33 |
+
function OLshowProperties(){
|
34 |
+
var ar=arguments,sho,shoS,vis,lvl=0,istrt=0,theDiv='showProps',txt='',
|
35 |
+
fac='Verdana,Arial,Helvetica',siz=(OLns4?'1':'67%'),
|
36 |
+
fon='><font color="#000000" face="'+fac+'" size="'+siz,
|
37 |
+
stl=' style="font-family:'+fac+';font-size:'+siz+';',
|
38 |
+
sty=stl+'color:#000000;',clo=(OLns4?'</font>':'');
|
39 |
+
if(ar.length==0)return;
|
40 |
+
if(ar.length%2&&typeof ar[0]=='string'){istrt=1;theDiv=ar[0];}
|
41 |
+
if(!(sho=OLmkLyr(theDiv,self)))return;
|
42 |
+
shoS=(OLns4)?sho:sho.style;
|
43 |
+
lvl=OLgetLayerLevel(theDiv);
|
44 |
+
if(typeof sho.position=='undefined'){
|
45 |
+
sho.position=new OLpageLocDebug(10+lvl*20,10,1);
|
46 |
+
if(typeof OLzIndex=='undefined')OLzIndex=OLgetDivZindex('overDiv',self);
|
47 |
+
shoS.zIndex=OLzIndex+1+lvl;}
|
48 |
+
txt='<table cellpadding="1" cellspacing="0" border="0" bgcolor="#000000"><tr><td>'
|
49 |
+
+'<table cellpadding="5" border="0" cellspacing="0" bgcolor="#ffffcc">'
|
50 |
+
+'<tr><td><strong><a href="javascript:OLmoveToBack(\''+theDiv+'\');" title="Move to back"'
|
51 |
+
+(OLns4?fon:stl)+'">'+theDiv+clo
|
52 |
+
+'</a></strong></td><td align="right"><strong><a href="javascript:OLcloseLayer(\''+theDiv
|
53 |
+
+'\');" title="Close Layer"'+(OLns4?fon:stl
|
54 |
+
+'background-color:#cccccc;border:1px #333369 outset;padding:0px;')+'">X'+clo
|
55 |
+
+'</a></strong></td></tr><tr><td'+(OLns4?fon:sty)+'">'+'<strong><em>Item</em></strong>'
|
56 |
+
+clo+'</td><td'+(OLns4?fon:sty)+'">'+'<strong><em>Value</em></strong>'+clo+'</td></tr>';
|
57 |
+
for(var i=istrt;i<ar.length-1;i++)
|
58 |
+
txt+='<tr><td align="right"'+(OLns4?fon:sty)+'">'+'<strong>'+ar[i]+': </strong>'
|
59 |
+
+clo+'</td><td'+(OLns4?fon:sty)+'">'+ar[++i]+clo+'</td></tr>';
|
60 |
+
txt+='</table></td></tr></table>';
|
61 |
+
if(OLns4){sho.document.open();sho.document.write(txt);sho.document.close();
|
62 |
+
}else{if(OLie4&&OLieM)sho.innerHTML='';sho.innerHTML=txt;}
|
63 |
+
OLshowAllVisibleLayers();
|
64 |
+
}
|
65 |
+
|
66 |
+
function OLgetLayerLevel(lyr){
|
67 |
+
var i=0;
|
68 |
+
if(typeof document.popups=='undefined'){document.popups=new Array(lyr);
|
69 |
+
}else{var l=document.popups;for(i=0;i<l.length;i++)if(lyr==l[i])break;
|
70 |
+
if(i==l.length)l[l.length++]=lyr;}
|
71 |
+
return i;
|
72 |
+
}
|
73 |
+
|
74 |
+
function OLgetDivZindex(id,f){
|
75 |
+
if(!id)id='overDiv';if(!f)f=o3_frame;
|
76 |
+
var o=OLgetRefById(id,f.document);
|
77 |
+
if(o){o=OLns4?o:o.style;return o.zIndex;}
|
78 |
+
else return 1000;
|
79 |
+
}
|
80 |
+
|
81 |
+
function OLsetDebugCanShow(){
|
82 |
+
if(o3_allowdebug!=''){
|
83 |
+
var i,lyr,pLyr=o3_allowdebug.replace(/[ ]/ig,'').split(',');
|
84 |
+
for(i=0;i<pLyr.length;i++){lyr=OLgetRefById(pLyr[i],self.document);
|
85 |
+
if(lyr&&typeof lyr.position!='undefined')lyr.position.canShow=1;}}
|
86 |
+
}
|
87 |
+
|
88 |
+
function OLpageLocDebug(x,y,canShow){
|
89 |
+
this.x=x;this.y=y;this.canShow=(canShow==null)?0:canShow;
|
90 |
+
}
|
91 |
+
|
92 |
+
function OLshowAllVisibleLayers(){
|
93 |
+
var i,lyr,o,l=document.popups;
|
94 |
+
for(i=0;i<l.length;i++){if((lyr=OLgetRefById(l[i],self.document))&&lyr.position.canShow){
|
95 |
+
o=OLns4?lyr:lyr.style;OLpositionLayer(o,lyr.position.x,lyr.position.y);o.visibility='visible';}}
|
96 |
+
}
|
97 |
+
|
98 |
+
function OLpositionLayer(o,x,y){
|
99 |
+
o.left=x+(OLie4&&!OLop95?OLfd(self).scrollLeft:self.pageXOffset)+(OLns4?0:'px');
|
100 |
+
o.top=y+(OLie4&&!OLop95?OLfd(self).scrollTop:self.pageYOffset)+(OLns4?0:'px');
|
101 |
+
}
|
102 |
+
|
103 |
+
function OLcloseLayer(id){
|
104 |
+
var lyr=OLgetRefById(id,self.document);
|
105 |
+
if(lyr){lyr.position.canShow=0;lyr=OLns4?lyr:lyr.style;lyr.visibility='hidden';}
|
106 |
+
}
|
107 |
+
|
108 |
+
function OLmoveToBack(layer){
|
109 |
+
var l=document.popups,lyr,o,i,x=10,dx=20,z=OLzIndex+1;if(l.length==1)return;
|
110 |
+
if(lyr=OLgetRefById(layer,self.document)){lyr.position.x=x;o=OLns4?lyr:lyr.style;o.zIndex=z;
|
111 |
+
for(i=0;i<l.length;i++){if(layer==l[i])continue;
|
112 |
+
if(!(lyr=OLgetRefById(l[i],self.document))||lyr.position.canShow==0)continue;
|
113 |
+
o=OLns4?lyr:lyr.style;o.zIndex+=1;lyr.position.x+=dx;}OLshowAllVisibleLayers();}
|
114 |
+
}
|
115 |
+
|
116 |
+
OLregRunTimeFunc(OLloadDebug);
|
117 |
+
OLregCmdLineFunc(OLparseDebug);
|
118 |
+
|
119 |
+
OLdebugPI=1;
|
120 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_draggable.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_draggable.js plug-in module - Copyright Foteos Macrides 2002-2009. All rights reserved.
|
3 |
+
For support of the DRAGGABLE feature.
|
4 |
+
Initial: August 24, 2002 - Last Revised: January 26, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLdraggableCmds='draggable,dragcap,dragid';
|
14 |
+
OLregCmds(OLdraggableCmds);
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('draggable'))var ol_draggable=0;
|
18 |
+
if(OLud('dragcap'))var ol_dragcap=0;
|
19 |
+
if(OLud('dragid'))var ol_dragid='';
|
20 |
+
// END CONFIGURATION
|
21 |
+
|
22 |
+
var o3_draggable=0,o3_dragcap=0,o3_dragid='',o3_dragging=0,OLdrg=null,OLmMv,
|
23 |
+
OLcX,OLcY,OLcbX,OLcbY;function OLloadDraggable(){OLload(OLdraggableCmds);}
|
24 |
+
function OLparseDraggable(pf,i,ar){var t=OLtoggle,k=i;if(k<ar.length){
|
25 |
+
if(Math.abs(ar[k])==DRAGGABLE){t(ar[k],pf+'draggable');return k;}
|
26 |
+
if(Math.abs(ar[k])==DRAGCAP){t(ar[k],pf+'dragcap');return k;}
|
27 |
+
if(ar[k]==DRAGID){OLparQuo(ar[++k],pf+'dragid');return k;}}return -1;
|
28 |
+
}
|
29 |
+
|
30 |
+
function OLcheckDrag(){
|
31 |
+
if(o3_draggable){if(o3_sticky&&(o3_frame==self))OLinitDrag();else o3_draggable=0;}
|
32 |
+
}
|
33 |
+
function OLinitDrag(){
|
34 |
+
OLmMv=OLdw.onmousemove;o3_dragging=0;
|
35 |
+
if(OLns4){document.captureEvents(Event.MOUSEDOWN|Event.CLICK);
|
36 |
+
document.onmousedown=OLgrabEl;document.onclick=function(e){return routeEvent(e);}}
|
37 |
+
else{var dvido=(o3_dragid)?OLgetRef(o3_dragid):null,capid=(OLovertwoPI&&over==over2?
|
38 |
+
'overCap2':'overCap');if(dvido)dvido.onscroll=function(){OLdw.onmousemove=OLmMv;
|
39 |
+
OLinitDrag();};OLdrg=(o3_cap&&o3_dragcap)?OLgetRef(capid):over;
|
40 |
+
if(!OLdrg||!OLdrg.style)OLdrg=over;OLdrg.onmousedown=OLgrabEl;OLsetDrgCur(1);}
|
41 |
+
}
|
42 |
+
function OLsetDrgCur(d){if(!OLns4&&OLdrg)OLdrg.style.cursor=(d?'move':'auto');}
|
43 |
+
|
44 |
+
function OLgrabEl(e){
|
45 |
+
var e=(e||event);
|
46 |
+
var cKy=(OLns4?e.modifiers&Event.ALT_MASK:(e.altKey||(OLop7&&e.ctrlKey)));o3_dragging=1;
|
47 |
+
if(cKy){OLsetDrgCur(0);document.onmouseup=function(){OLsetDrgCur(1);o3_dragging=0;}
|
48 |
+
return(OLns4?routeEvent(e):true);}
|
49 |
+
OLx=(e.pageX||e.clientX+OLfd().scrollLeft);OLy=(e.pageY||e.clientY+OLfd().scrollTop);
|
50 |
+
if(OLie4)over.onselectstart=function(){return false;}
|
51 |
+
if(OLns4){OLcX=OLx;OLcY=OLy;document.captureEvents(Event.MOUSEUP)}else{
|
52 |
+
OLcX=OLx-(OLns4?over.left:parseInt(over.style.left));
|
53 |
+
OLcY=OLy-(OLns4?over.top:parseInt(over.style.top));
|
54 |
+
if((OLshadowPI)&&bkdrop&&o3_shadow){OLcbX=OLx-(parseInt(bkdrop.style.left));
|
55 |
+
OLcbY=OLy-(parseInt(bkdrop.style.top));}}OLdw.onmousemove=OLmoveEl;
|
56 |
+
document.onmouseup=function(){
|
57 |
+
if(OLie4)over.onselectstart=null;o3_dragging=0;OLdw.onmousemove=OLmMv;}
|
58 |
+
return(OLns4?routeEvent(e):false);
|
59 |
+
}
|
60 |
+
|
61 |
+
function OLmoveEl(e){
|
62 |
+
var e=(e||event);
|
63 |
+
OLx=(e.pageX||e.clientX+OLfd().scrollLeft);OLy=(e.pageY||e.clientY+OLfd().scrollTop);
|
64 |
+
if(o3_dragging){if(OLns4){over.moveBy(OLx-OLcX,OLy-OLcY);
|
65 |
+
if(OLshadowPI&&bkdrop&&o3_shadow)bkdrop.moveBy(OLx-OLcX,OLy-OLcY);}
|
66 |
+
else{OLrepositionTo(over,OLx-OLcX,OLy-OLcY);
|
67 |
+
if((OLiframePI)&&OLie55&&OLifsP1)OLrepositionTo(OLifsP1,OLx-OLcX,OLy-OLcY);
|
68 |
+
if((OLshadowPI)&&bkdrop&&o3_shadow){OLrepositionTo(bkdrop,OLx-OLcbX,OLy-OLcbY);
|
69 |
+
if((OLiframePI)&&OLie55&&OLifsSh)OLrepositionTo(OLifsSh,OLx-OLcbX,OLy-OLcbY);}}
|
70 |
+
if(OLhidePI)OLhideUtil(0,1,1,0,0,0);}if(OLns4){OLcX=OLx;OLcY=OLy;}
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
function OLclearDrag(){
|
75 |
+
if(OLns4){document.releaseEvents(Event.MOUSEDOWN|Event.MOUSEUP|Event.CLICK);
|
76 |
+
document.onmousedown=document.onclick=null;}else{
|
77 |
+
if(OLdrg)OLdrg.onmousedown=null;over.onmousedown=null;OLsetDrgCur(0);}
|
78 |
+
document.onmouseup=null;o3_dragging=0;
|
79 |
+
}
|
80 |
+
|
81 |
+
OLregRunTimeFunc(OLloadDraggable);
|
82 |
+
OLregCmdLineFunc(OLparseDraggable);
|
83 |
+
|
84 |
+
OLdraggablePI=1;
|
85 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_exclusive.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_exclusive.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the EXCLUSIVE feature.
|
4 |
+
Initial: November 7, 2003 - Last Revised: June 11, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLexclusiveCmds='exclusive,exclusivestatus,exclusiveoverride';
|
14 |
+
OLregCmds(OLexclusiveCmds);
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('exclusive'))var ol_exclusive=0;
|
18 |
+
if(OLud('exclusivestatus'))var ol_exclusivestatus='Please act on or close the open popup.';
|
19 |
+
if(OLud('exclusiveoverride'))var ol_exclusiveoverride=0;
|
20 |
+
// END CONFIGURATION
|
21 |
+
|
22 |
+
var o3_exclusive=0,o3_exclusivestatus='',o3_exclusiveoverride=0;
|
23 |
+
|
24 |
+
function OLloadExclusive(){
|
25 |
+
OLload(OLexclusiveCmds);
|
26 |
+
}
|
27 |
+
|
28 |
+
function OLparseExclusive(pf,i,ar){
|
29 |
+
var k=i,t=OLtoggle;
|
30 |
+
if(k<ar.length){
|
31 |
+
if(Math.abs(ar[k])==EXCLUSIVE){t(ar[k],pf+'exclusive');return k;}
|
32 |
+
if(ar[k]==EXCLUSIVESTATUS){OLparQuo(ar[++k],pf+'exclusivestatus');return k;}
|
33 |
+
if(Math.abs(ar[k])==EXCLUSIVEOVERRIDE){t(ar[k],pf+'exclusiveoverride');return k;}}
|
34 |
+
return -1;
|
35 |
+
}
|
36 |
+
|
37 |
+
function OLisExclusive(args){
|
38 |
+
if((args!=null)&&OLhasOverRide(args))o3_exclusiveoverride=(ol_exclusiveoverride==0)?1:0;
|
39 |
+
else o3_exclusiveoverride=ol_exclusiveoverride;
|
40 |
+
var rtnVal=(o3_exclusive&&!o3_exclusiveoverride&&OLshowingsticky&&
|
41 |
+
((OLovertwoPI&&OLshowingsticky2)||over==OLgetRefById('overDiv')));
|
42 |
+
if(rtnVal)self.status=o3_exclusivestatus;
|
43 |
+
return rtnVal;
|
44 |
+
}
|
45 |
+
|
46 |
+
function OLhasOverRide(args){
|
47 |
+
var rtnFlag=0;
|
48 |
+
for(var i=0;i<args.length;i++){
|
49 |
+
if(typeof args[i]=='number'&&args[i]==EXCLUSIVEOVERRIDE){
|
50 |
+
rtnFlag=1;break;}}
|
51 |
+
return rtnFlag;
|
52 |
+
}
|
53 |
+
|
54 |
+
OLregRunTimeFunc(OLloadExclusive);
|
55 |
+
OLregCmdLineFunc(OLparseExclusive);
|
56 |
+
|
57 |
+
OLexclusivePI=1;
|
58 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_filter.js
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_filter.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the FILTER feature.
|
4 |
+
Initial: November 27, 2003 - Last Revised: October 25, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLfilterCmds='filter,fadein,fadeout,fadetime,filteropacity,filtershadow,filtershadowcolor';
|
14 |
+
OLregCmds(OLfilterCmds);
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('filter'))var ol_filter=0;
|
18 |
+
if(OLud('fadein'))var ol_fadein=52;
|
19 |
+
if(OLud('fadeout'))var ol_fadeout=52;
|
20 |
+
if(OLud('fadetime'))var ol_fadetime=800;
|
21 |
+
if(OLud('filteropacity'))var ol_filteropacity=100;
|
22 |
+
if(OLud('filtershadow'))var ol_filtershadow=0;
|
23 |
+
if(OLud('filtershadowcolor'))var ol_filtershadowcolor="#cccccc";
|
24 |
+
// END CONFIGURATION
|
25 |
+
|
26 |
+
var o3_filter=0,o3_fadein=52,o3_fadeout=52,o3_fadetime=800,o3_filteropacity=100,
|
27 |
+
o3_filtershadow=0,o3_filtershadowcolor="#cccccc",OLfiIdx= -1,OLfInc=5,OLfTmInc=40,OLfOp=1,
|
28 |
+
OLfiId=0,OLfoId=0,OLfOp2=1,OLfiId2=0,OLfoId2=0,OLfInc2=5,OLfTmInc2=40;
|
29 |
+
|
30 |
+
function OLloadFilter(){
|
31 |
+
OLload(OLfilterCmds);
|
32 |
+
}
|
33 |
+
|
34 |
+
function OLparseFilter(pf,i,ar){
|
35 |
+
var k=i,p=OLpar;
|
36 |
+
if(k<ar.length){
|
37 |
+
if(Math.abs(ar[k])==FILTER){OLtoggle(ar[k],pf+'filter');return k;}
|
38 |
+
if(ar[k]==FADEIN){p(ar[++k],pf+'fadein');return k;}
|
39 |
+
if(ar[k]==FADEOUT){p(ar[++k],pf+'fadeout');return k;}
|
40 |
+
if(ar[k]==FADETIME){p(ar[++k],pf+'fadetime');return k;}
|
41 |
+
if(ar[k]==FILTEROPACITY){p(ar[++k],pf+'filteropacity');return k;}
|
42 |
+
if(ar[k]==FILTERSHADOW){p(ar[++k],pf+'filtershadow');return k;}
|
43 |
+
if(ar[k]==FILTERSHADOWCOLOR){OLparQuo(ar[++k],pf+'filtershadowcolor');return k;}}
|
44 |
+
return -1;
|
45 |
+
}
|
46 |
+
|
47 |
+
function OLhasOp(){
|
48 |
+
var op=0;if(OLns4||OLieM)return op;var os=over.style,u='undefined';if(os)op=(typeof os.opacity!=u||typeof os.MozOpacity!=u||
|
49 |
+
typeof os.KhtmlOpacity!=u||OLie4&&!OLopr)?1:0;return(op);
|
50 |
+
}
|
51 |
+
|
52 |
+
function OLinitFilterLyr(o2){
|
53 |
+
if(!OLie55){if(!OLhasOp()){o3_filter=0;return;}var O2=(o2||0);if(parent!=self){if(parent.OLshowingsticky)o3_fadeout=0;
|
54 |
+
if(parent.OLfilterPI)parent.OLcleanupFilter(parent.over,O2);}OLcleanupFilter(over,O2);}if(OLie55){o3_fadein-=1;o3_fadeout-=1;
|
55 |
+
OLfiIdx= -1;if(over.style.filter&&!OLop95){var p,s,ob=over.filters[28];for(p=28;p<31;p++){over.filters[p].enabled=0;}
|
56 |
+
for(s=0;s<28;s++){if(over.filters[s].status)over.filters[s].stop();over.filters[s].enabled=0;}ob.enabled=0;
|
57 |
+
ob.opacity=ol_filteropacity;return;}}if(OLie55&&(!o3_filter||(OLshadowPI&&o3_shadow)))return;if(!OLie55){var b=(OLshadowPI)?
|
58 |
+
OLgetRef('backdrop2'):null;if(o2){if(OLfiId2)clearTimeout(OLfiId2);if(OLfoId2)clearInterval(OLfoId2);OLfiId2=OLfoId2=0;
|
59 |
+
if(b)b.style.visibility='hidden';over2.style.visibility='hidden';OLopOv(ol_filteropacity,2);if(o3_filter&&(o3_fadein||
|
60 |
+
o3_fadeout)){OLfInc2=o3_filteropacity/20;OLfOp2=(o3_fadein?1:o3_filteropacity);OLfTmInc2=parseInt(o3_fadetime/20);}}else{
|
61 |
+
if(OLfiId)clearTimeout(OLfiId);if(OLfoId)clearInterval(OLfoId);OLfiId=OLfoId=0;if(OLshadowPI&&bkdrop)
|
62 |
+
bkdrop.style.visibility='hidden';over.style.visibility='hidden';OLopOv(ol_filteropacity);if(o3_filter&&(o3_fadein||
|
63 |
+
o3_fadeout)){OLfInc=o3_filteropacity/20;OLfOp=(o3_fadein?1:o3_filteropacity);OLfTmInc=parseInt(o3_fadetime/20);}}return;}
|
64 |
+
var d=" progid:DXImageTransform.Microsoft.";over.style.filter="revealTrans()"
|
65 |
+
+d+"Fade(Overlap=1.00 enabled=0)"+d+"Inset(enabled=0)"
|
66 |
+
+d+"Iris(irisstyle=PLUS,motion=in enabled=0)"+d+"Iris(irisstyle=PLUS,motion=out enabled=0)"
|
67 |
+
+d+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+d+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"
|
68 |
+
+d+"Iris(irisstyle=CROSS,motion=in enabled=0)"+d+"Iris(irisstyle=CROSS,motion=out enabled=0)"
|
69 |
+
+d+"Iris(irisstyle=STAR,motion=in enabled=0)"+d+"Iris(irisstyle=STAR,motion=out enabled=0)"
|
70 |
+
+d+"RadialWipe(wipestyle=CLOCK enabled=0)"+d+"RadialWipe(wipestyle=WEDGE enabled=0)"
|
71 |
+
+d+"RadialWipe(wipestyle=RADIAL enabled=0)"+d+"Pixelate(MaxSquare=35,enabled=0)"
|
72 |
+
+d+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+d+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"
|
73 |
+
+d+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+d+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"
|
74 |
+
+d+"Stretch(stretchstyle=HIDE enabled=0)"+d+"Stretch(stretchstyle=PUSH enabled=0)"
|
75 |
+
+d+"Stretch(stretchstyle=SPIN enabled=0)"+d+"Wheel(spokes=16 enabled=0)"
|
76 |
+
+d+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"
|
77 |
+
+d+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"
|
78 |
+
+d+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"
|
79 |
+
+d+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"
|
80 |
+
+d+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+d+"Alpha(enabled=0)"
|
81 |
+
+d+"Dropshadow(OffX=5,OffY=5,Positive=true,enabled=0)"
|
82 |
+
+d+"Shadow(strength=5,direction=135,enabled=0)";
|
83 |
+
}
|
84 |
+
|
85 |
+
function OLchkFilter(o,o2){
|
86 |
+
if(!o3_filter||o!=over.style||(OLie55&&OLshadowPI&&o3_shadow))return false;if(!OLie55){var op=o3_filteropacity;
|
87 |
+
if(op>0&&op<100){if(o2)OLopOv(op,2);else OLopOv(op);}if(o3_fadein||o3_fadeout){var p=(o3_fadein)?(o2?OLfOp2:OLfOp):
|
88 |
+
o3_filteropacity;if(o2){OLopOv(p,2);if(o3_fadein&&!OLfiId2)OLfadeIn2();}else{OLopOv(p);if(o3_fadein&&!OLfiId)OLfadeIn();}}
|
89 |
+
return false;}var fi=o3_fadein,fo=o3_fadeout,fp=1,ft=o3_fadetime/1000;if(fi<0||fi>51){fi=fo;fp=0;}if(fi==51)
|
90 |
+
fi=parseInt(Math.random()*50);var at=fi>-1&&fi<24&&ft>0,af=fi>23&&fi<51&&ft>0;OLfiIdx=(af?fi-23:0);var p,s,e,ob,
|
91 |
+
t=over.filters[OLfiIdx];for(p=28;p<31;p++){over.filters[p].enabled=0;}for(s=0;s<28;s++){if(over.filters[s].status)
|
92 |
+
over.filters[s].stop();over.filters[s].enabled=0;}for(e=1;e<3;e++){if(o3_filtershadowcolor&&o3_filtershadow==e){
|
93 |
+
ob=over.filters[28+e];ob.enabled=1;ob.color=o3_filtershadowcolor;}}if(o3_filteropacity>0&&o3_filteropacity<100){
|
94 |
+
ob=over.filters[28];ob.enabled=1;ob.opacity=o3_filteropacity;}if(fp&&(at||af)){if(at)over.filters[0].transition=fi;
|
95 |
+
t.duration=ft;t.apply();o.visibility='visible';t.play();return true;}return false;
|
96 |
+
}
|
97 |
+
|
98 |
+
function OLopOv(op,o2){
|
99 |
+
var o=(o2?over2:over),os=o.style;if(OLie4&&!OLop95&&typeof os.filter=='string')os.filter='Alpha(opacity='+op+')';
|
100 |
+
else if(typeof os.opacity!='undefined')os.opacity=op/100;else if(typeof os.MozOpacity!='undefined')os.MozOpacity=op/100;
|
101 |
+
else if(typeof os.KhtmlOpacity!='undefined')os.KhtmlOpacity=op/100;
|
102 |
+
}
|
103 |
+
|
104 |
+
function OLopOvSh(op,o){
|
105 |
+
if(!bkdrop&&!o)return;var os=(o)?o.style:bkdrop.style;if(OLie4&&!OLop95&&typeof os.filter=='string')os.filter=
|
106 |
+
'Alpha(opacity='+op+')';else if(typeof os.opacity!='undefined')os.opacity=op/100;else if(typeof os.MozOpacity!='undefined')
|
107 |
+
os.MozOpacity=op/100;else if(typeof os.KhtmlOpacity!='undefined')os.KhtmlOpacity=op/100;
|
108 |
+
}
|
109 |
+
|
110 |
+
function OLcleanupFilter(o,o2){
|
111 |
+
if(!o3_filter||!over||o!=over||(OLie55&&OLshadowPI&&o3_shadow))return;if(!OLie55){if(o2){if(OLfiId2)clearTimeout(OLfiId2);
|
112 |
+
if(OLfoId2)clearInterval(OLfoId2);OLfiId2=OLfoId2=0;var op=o3_filteropacity;if(op>0&&op<100)OLopOv(ol_filteropacity,2);}
|
113 |
+
else{if(OLfiId)clearTimeout(OLfiId);if(OLfoId)clearInterval(OLfoId);OLfiId=OLfoId=0;var op=o3_filteropacity;
|
114 |
+
if(op>0&&op<100)OLopOv(ol_filteropacity);}return;}if(typeof over.filters!='object')return;var os=over.style,fi=o3_fadein,
|
115 |
+
fo=o3_fadeout;if(fi>=0&&fi<=51&&fo==fi){if(OLfiIdx<0)return;var t=over.filters[OLfiIdx];if(t.status)t.stop();
|
116 |
+
os.visibility='visible';t.apply();os.visibility='hidden';t.play();}else{if(fo>=0&&fo<=51){fi=fo;if(fi==51)
|
117 |
+
fi=parseInt(Math.random()*50);var ft=o3_fadetime;var at=fi>-1&&fi<24&&ft>0; var af=fi>23&&fi<51&&ft>0;OLfiIdx=(af?fi-23:0);
|
118 |
+
t=over.filters[OLfiIdx];if(at||af){if(at)over.filters[0].transition=fi;if(t.status)t.stop();os.visibility='visible';
|
119 |
+
t.apply();os.visibility='hidden';t.play();}}}OLfiIdx=-1;if(event&&event.type=='click')event.returnValue=false;
|
120 |
+
}
|
121 |
+
|
122 |
+
function OLfadeIn(){
|
123 |
+
if(OLfOp>=o3_filteropacity){if(OLshadowPI&&o3_shadow&&bkdrop)OLopOvSh(o3_shadowopacity);OLopOv(o3_filteropacity);
|
124 |
+
clearTimeout(OLfiId);OLfiId=0;}else{OLopOv(OLfOp);if(!OLfOp&&over.style.visibility=='hidden')over.style.visibility='visible';
|
125 |
+
var ops=0.3*OLfOp;if(OLfOp>40&&OLshadowPI&&o3_shadow&&bkdrop&&ops<o3_shadowopacity)OLopOvSh(ops);OLfOp+=OLfInc;
|
126 |
+
OLfiId=setTimeout("OLfadeIn()",OLfTmInc);}
|
127 |
+
}
|
128 |
+
function OLfadeIn2(){
|
129 |
+
if(OLfOp2>=o3_filteropacity){if(OLshadowPI&&o3_shadow&&bkdrop)OLopOvSh(o3_shadowopacity);OLopOv(o3_filteropacity,2);
|
130 |
+
clearTimeout(OLfiId2);OLfiId2=0;}else{OLopOv(OLfOp2,2);if(!OLfOp2&&over2&&over2.style.visibility=='hidden')
|
131 |
+
over2.style.visibility='visible';var ops=0.3*OLfOp2;if(OLfOp2>40&&OLshadowPI&&o3_shadow&&bkdrop&&ops<o3_shadowopacity)
|
132 |
+
OLopOvSh(ops);OLfOp2+=OLfInc2;OLfiId2=setTimeout("OLfadeIn2()",OLfTmInc2);}
|
133 |
+
}
|
134 |
+
|
135 |
+
function OLchkFadeOut(o){
|
136 |
+
if(OLie55||!o3_filter||!o3_fadeout||o!=over.style)return false;OLfoId=setInterval('OLfadeOut()',OLfTmInc);return true;
|
137 |
+
}
|
138 |
+
function OLfadeOut(){
|
139 |
+
if(OLfOp<0){clearInterval(OLfoId);OLfoId=0;o3_fadeout=0;if(OLshadowPI&&o3_shadow&&bkdrop){bkdrop.style.visibility="hidden";
|
140 |
+
OLcleanUpShadow();}OLhideObject(over);}else{var ops=0.3*OLfOp;
|
141 |
+
if(OLfOp>40&&OLshadowPI&&o3_shadow&&bkdrop&&ops<o3_shadowopacity)OLopOvSh(ops);OLopOv(OLfOp);OLfOp-=OLfInc;}
|
142 |
+
}
|
143 |
+
function OLchkFadeOut2(o){
|
144 |
+
if(OLie55||!o3_filter||!o3_fadeout||o!=over.style)return false;OLfoId2=setInterval('OLfadeOut2()',OLfTmInc2);return true;
|
145 |
+
}
|
146 |
+
function OLfadeOut2(){
|
147 |
+
var b=(OLshadowPI)?OLgetRef('backdrop2'):null;if(!b)b=(bkdrop)?bkdrop:null;if(OLfOp2<0){clearInterval(OLfoId2);if(b){
|
148 |
+
b.style.visibility="hidden";if(over==over2)OLcleanUpShadow();}OLfoId2=0;OLhideObjectP2(over);over2.style.visibility='hidden';
|
149 |
+
}else{var ops=0.3*OLfOp2;if(b){if(OLfOp2>40)OLopOvSh(ops,b);else OLopOvSh(1,b);}OLopOv(OLfOp2,2);OLfOp2-=OLfInc2;}
|
150 |
+
}
|
151 |
+
|
152 |
+
OLregRunTimeFunc(OLloadFilter);
|
153 |
+
OLregCmdLineFunc(OLparseFilter);
|
154 |
+
|
155 |
+
OLfilterPI=1;
|
156 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_function.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_function.js plug-in module - Copyright Foteos Macrides 2002-2009. All rights reserved.
|
3 |
+
For support of the FUNCTION feature.
|
4 |
+
Initial: August 18, 2002 - Last Revised: January 26, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
OLregCmds('function');
|
14 |
+
|
15 |
+
// DEFAULT CONFIGURATION
|
16 |
+
if(OLud('function'))var ol_function=null;
|
17 |
+
// END CONFIGURATION
|
18 |
+
|
19 |
+
var o3_function=null;
|
20 |
+
|
21 |
+
function OLloadFunction(){
|
22 |
+
OLload('function');
|
23 |
+
}
|
24 |
+
|
25 |
+
function OLparseFunction(pf,i,ar){
|
26 |
+
var k=i,v=null;
|
27 |
+
if(k<ar.length){
|
28 |
+
if(ar[k]==FUNCTION){if(pf=='ol_'){if(typeof ar[k+1]!='number'){v=ar[++k];
|
29 |
+
ol_function=(typeof v=='function'?v:null);}}
|
30 |
+
else{OLudf=0;v=null;if(typeof ar[k+1]!='number')v=ar[++k];OLoptFUNCTION(v);}return k;}}
|
31 |
+
return -1;
|
32 |
+
}
|
33 |
+
|
34 |
+
function OLoptFUNCTION(callme){
|
35 |
+
o3_text=(callme?(typeof callme=='string'?(/.+\(.*\)/.test(callme)?eval(callme):
|
36 |
+
callme):callme()):(o3_function?o3_function():'No Function'));
|
37 |
+
return 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
OLregRunTimeFunc(OLloadFunction);
|
41 |
+
OLregCmdLineFunc(OLparseFunction);
|
42 |
+
|
43 |
+
OLfunctionPI=1;
|
44 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_hide.js
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_hide.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For hiding elements.
|
4 |
+
Initial: November 13, 2003 - Last Revised: February 10, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLhideCmds='hideselectboxes,hidebyid,hidebyidall,hidebyidns4';
|
14 |
+
OLregCmds(OLhideCmds);
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('hideselectboxes'))var ol_hideselectboxes=0;
|
18 |
+
if(OLud('hidebyid'))var ol_hidebyid='';
|
19 |
+
if(OLud('hidebyidall'))var ol_hidebyidall='';
|
20 |
+
if(OLud('hidebyidns4'))var ol_hidebyidns4='';
|
21 |
+
// END CONFIGURATION
|
22 |
+
|
23 |
+
var o3_hideselectboxes=0,o3_hidebyid='',o3_hidebyidall='',o3_hidebyidns4='',
|
24 |
+
OLselectOK=(OLie7||OLop7||OLgek>=20030624||OLsaf)?1:0;
|
25 |
+
|
26 |
+
function OLloadHide(){
|
27 |
+
OLload(OLhideCmds);
|
28 |
+
}
|
29 |
+
|
30 |
+
function OLparseHide(pf,i,ar){
|
31 |
+
var k=i,q=OLparQuo;
|
32 |
+
if(k<ar.length){
|
33 |
+
if(Math.abs(ar[k])==HIDESELECTBOXES){OLtoggle(ar[k],pf+'hideselectboxes');return k;}
|
34 |
+
if(ar[k]==HIDEBYID){q(ar[++k],pf+'hidebyid');return k;}
|
35 |
+
if(ar[k]==HIDEBYIDALL){q(ar[++k],pf+'hidebyidall');return k;}
|
36 |
+
if(ar[k]==HIDEBYIDNS4){q(ar[++k],pf+'hidebyidns4');return k;}}
|
37 |
+
return -1;
|
38 |
+
}
|
39 |
+
|
40 |
+
function OLchkHide(hide){
|
41 |
+
if(OLiframePI&&OLie55)return;if(OLmodalPI&&o3_modal)o3_hideselectboxes=0;var id,o,i;
|
42 |
+
if(o3_hidebyid&&typeof o3_hidebyid=='string'&&!(o3_hideselectboxes&&OLns6)&&!OLop7&&!OLns4){
|
43 |
+
id=o3_hidebyid.replace(/[ ]/ig,'').split(',');for(i=0;i<id.length;i++){
|
44 |
+
o=(OLie4?o3_frame.document.all[id[i]]:OLns6?o3_frame.document.getElementById(id[i]):null);
|
45 |
+
if(o)o.style.visibility=(hide?'hidden':'visible');}}
|
46 |
+
if(o3_hidebyidall&&typeof o3_hidebyidall=='string'){
|
47 |
+
id=o3_hidebyidall.replace(/[ ]/ig,'').split(',');for(i=0;i<id.length;i++){
|
48 |
+
o=OLgetRefById(id[i]);if(o){o=(OLns4)?o:o.style;
|
49 |
+
o.visibility=(hide?'hidden':'visible');}}}
|
50 |
+
if(o3_hidebyidns4&&OLns4&&typeof o3_hidebyidns4=='string'){
|
51 |
+
id=o3_hidebyidns4.replace(/[ ]/ig,'').split(',');for(i=0;i<id.length;i++){
|
52 |
+
o=eval('o3_frame.document.'+id[i]);if(o)o.visibility=(hide?'hidden':'visible');}}
|
53 |
+
}
|
54 |
+
|
55 |
+
function OLselectBoxes(hide,all){
|
56 |
+
if((OLiframePI&&OLie55)||OLselectOK||OLns4)return;var sel=OLie4?
|
57 |
+
o3_frame.document.all.tags('select'):o3_frame.document.getElementsByTagName('select'),
|
58 |
+
px=over.offsetLeft,py=over.offsetTop,pw=over.offsetWidth,ph=over.offsetHeight,bx=px,by=py,
|
59 |
+
bw=pw,bh=ph,sx,sy,sw,sh,i,sp,si;if((OLshadowPI)&&bkdrop&&o3_shadow){bx=bkdrop.offsetLeft;
|
60 |
+
by=bkdrop.offsetTop;bw=bkdrop.offsetWidth;bh=bkdrop.offsetHeight;}for(i=0;i<sel.length;i++){
|
61 |
+
sx=0;sy=0;si=0;if(sel[i].offsetParent){sp=sel[i];while(sp.offsetParent&&
|
62 |
+
sp.offsetParent.tagName.toLowerCase()!='body'){if(sp.offsetParent.id=='overDiv'||
|
63 |
+
sp.offsetParent.id=='overDiv2')si=1;sp=sp.offsetParent;sx+=sp.offsetLeft;sy+=sp.offsetTop;}
|
64 |
+
sx+=sel[i].offsetLeft;sy+=sel[i].offsetTop;sw=sel[i].offsetWidth;sh=sel[i].offsetHeight;
|
65 |
+
if(si||(!OLie4&&sel[i].size<2))continue;else if(hide){if((px+pw>sx&&px<sx+sw&&py+ph>sy&&
|
66 |
+
py<sy+sh)||(bx+bw>sx&&bx<sx+sw&&by+bh>sy&&by<sy+sh)){if(sel[i].style.visibility!="hidden")
|
67 |
+
sel[i].style.visibility="hidden";}}else{if(all||(!(OLovertwoPI&&over==over2)&&(px+pw<sx||
|
68 |
+
px>sx+sw||py+ph<sy||py>sy+sh)&&(bx+bw<sx||bx>sx+sw||by+bh<sy||by>sy+sh))){
|
69 |
+
if(sel[i].style.visibility!="visible")sel[i].style.visibility="visible";}}}}
|
70 |
+
}
|
71 |
+
|
72 |
+
function OLhideUtil(a1,a2,a3,a4,a5,a6){
|
73 |
+
if(a4==null){OLchkHide(a1);if(o3_hideselectboxes)OLselectBoxes(a2,a3);}else{OLchkHide(a1);
|
74 |
+
OLchkHide(a2);if(o3_hideselectboxes){OLselectBoxes(a3,a4);OLselectBoxes(a5,a6);}}
|
75 |
+
}
|
76 |
+
|
77 |
+
OLregRunTimeFunc(OLloadHide);
|
78 |
+
OLregCmdLineFunc(OLparseHide);
|
79 |
+
|
80 |
+
OLhidePI=1;
|
81 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_iframe.js
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_iframe.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
Masks system controls to prevent obscuring of popops for IE v5.5 or higher.
|
4 |
+
Initial: October 19, 2003 - Last Revised: January 26, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
|
14 |
+
var OLifsP1=null,OLifsSh=null,OLifsP2=null;
|
15 |
+
|
16 |
+
// IFRAME SHIM SUPPORT FUNCTIONS
|
17 |
+
function OLinitIfs(){
|
18 |
+
if(!OLie55)return;
|
19 |
+
if((OLovertwoPI)&&over2&&over==over2){
|
20 |
+
var o=o3_frame.document.all['overIframeOvertwo'];
|
21 |
+
if(!o||OLifsP2!=o){OLifsP2=null;OLgetIfsP2Ref();}return;}
|
22 |
+
o=o3_frame.document.all['overIframe'];
|
23 |
+
if(!o||OLifsP1!=o){OLifsP1=null;OLgetIfsRef();}
|
24 |
+
if((OLshadowPI)&&o3_shadow){o=o3_frame.document.all['overIframeShadow'];
|
25 |
+
if(!o||OLifsSh!=o){OLifsSh=null;OLgetIfsShRef();}}
|
26 |
+
}
|
27 |
+
|
28 |
+
function OLsetIfsRef(o,i,z){
|
29 |
+
o.id=i;o.src='javascript:false;';o.scrolling='no';var os=o.style;os.position='absolute';
|
30 |
+
os.top='0px';os.left='0px';os.width='1px';os.height='1px';os.visibility='hidden';
|
31 |
+
os.zIndex=over.style.zIndex-z;os.filter='Alpha(style=0,opacity=0)';
|
32 |
+
}
|
33 |
+
|
34 |
+
function OLgetIfsRef(){
|
35 |
+
if(OLifsP1||!OLie55)return;
|
36 |
+
OLifsP1=o3_frame.document.createElement('iframe');
|
37 |
+
OLsetIfsRef(OLifsP1,'overIframe',2);
|
38 |
+
o3_frame.document.body.appendChild(OLifsP1);
|
39 |
+
}
|
40 |
+
|
41 |
+
function OLgetIfsShRef(){
|
42 |
+
if(OLifsSh||!OLie55)return;
|
43 |
+
OLifsSh=o3_frame.document.createElement('iframe');
|
44 |
+
OLsetIfsRef(OLifsSh,'overIframeShadow',3);
|
45 |
+
o3_frame.document.body.appendChild(OLifsSh);
|
46 |
+
}
|
47 |
+
|
48 |
+
function OLgetIfsP2Ref(){
|
49 |
+
if(OLifsP2||!OLie55)return;
|
50 |
+
OLifsP2=o3_frame.document.createElement('iframe');
|
51 |
+
OLsetIfsRef(OLifsP2,'overIframeOvertwo',1);
|
52 |
+
o3_frame.document.body.appendChild(OLifsP2);
|
53 |
+
}
|
54 |
+
|
55 |
+
function OLsetDispIfs(o,w,h){
|
56 |
+
var os=o.style;
|
57 |
+
os.width=w+'px';os.height=h+'px';os.clip='rect(0px '+w+'px '+h+'px 0px)';
|
58 |
+
o.filters.alpha.enabled=true;
|
59 |
+
}
|
60 |
+
|
61 |
+
function OLdispIfs(){
|
62 |
+
if(!OLie55)return;
|
63 |
+
var wd=over.offsetWidth,ht=over.offsetHeight;
|
64 |
+
if(OLfilterPI&&o3_filter&&o3_filtershadow){wd+=5;ht+=5;}
|
65 |
+
if((OLovertwoPI)&&over2&&over==over2){
|
66 |
+
if(!OLifsP2)return;
|
67 |
+
OLsetDispIfs(OLifsP2,wd,ht);return;}
|
68 |
+
if(!OLifsP1)return;
|
69 |
+
OLsetDispIfs(OLifsP1,wd,ht);
|
70 |
+
if((!OLshadowPI)||!o3_shadow||!OLifsSh)return;
|
71 |
+
OLsetDispIfs(OLifsSh,wd,ht);
|
72 |
+
}
|
73 |
+
|
74 |
+
function OLshowIfs(){
|
75 |
+
if(OLifsP1){OLifsP1.style.visibility="visible";
|
76 |
+
if((OLshadowPI)&&o3_shadow&&OLifsSh)OLifsSh.style.visibility="visible";}
|
77 |
+
}
|
78 |
+
|
79 |
+
function OLhideIfs(o){
|
80 |
+
if(!OLie55||o!=over)return;
|
81 |
+
if(OLifsP1)OLifsP1.style.visibility="hidden";
|
82 |
+
if((OLshadowPI)&&o3_shadow&&OLifsSh)OLifsSh.style.visibility="hidden";
|
83 |
+
}
|
84 |
+
|
85 |
+
function OLrepositionIfs(X,Y){
|
86 |
+
if(OLie55){if((OLovertwoPI)&&over2&&over==over2){
|
87 |
+
if(OLifsP2)OLrepositionTo(OLifsP2,X,Y);}
|
88 |
+
else{if(OLifsP1){OLrepositionTo(OLifsP1,X,Y);if((OLshadowPI)&&o3_shadow&&OLifsSh)
|
89 |
+
OLrepositionTo(OLifsSh,X+o3_shadowx,Y+o3_shadowy);}}}
|
90 |
+
}
|
91 |
+
|
92 |
+
OLiframePI=1;
|
93 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_modal.js
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_modal.js plug-in module - Copyright Foteos Macrides 2006-2009. All rights reserved.
|
3 |
+
For support of the MODAL feature.
|
4 |
+
Initial: November 15, 2006 - Last Revised: June 21, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;var OLmodalCmds='modal,modalcolor,modalopacity,modalscroll';OLregCmds(OLmodalCmds);
|
13 |
+
|
14 |
+
// DEFAULT CONFIGURATION
|
15 |
+
if(OLud('modal'))var ol_modal=0;
|
16 |
+
if(OLud('modalcolor'))var ol_modalcolor="#bbbbbb";
|
17 |
+
if(OLud('modalopacity'))var ol_modalopacity=40;
|
18 |
+
if(OLud('modalscroll'))var ol_modalscroll=0;
|
19 |
+
// END CONFIGURATION
|
20 |
+
|
21 |
+
var o3_modal=0,o3_modalcolor="#bbbbbb",o3_modalopacity=40,o3_modalscroll=0;
|
22 |
+
|
23 |
+
function OLloadModal(){
|
24 |
+
OLload(OLmodalCmds);
|
25 |
+
}
|
26 |
+
|
27 |
+
function OLparseModal(pf,i,ar){
|
28 |
+
var t=OLtoggle,k=i;if(k<ar.length){
|
29 |
+
if(Math.abs(ar[k])==MODAL){t(ar[k],pf+'modal');return k;}
|
30 |
+
if(ar[k]==MODALCOLOR){OLparQuo(ar[++k],pf+'modalcolor');return k;}
|
31 |
+
if(ar[k]==MODALOPACITY){OLpar(ar[++k],pf+'modalopacity');return k;}
|
32 |
+
if(Math.abs(ar[k])==MODALSCROLL){t(ar[k],pf+'modalscroll');return k;}}
|
33 |
+
return -1;
|
34 |
+
}
|
35 |
+
|
36 |
+
var OLmMask=null,OLmIframe=null,OLmMaskOn=0,OLmSelectOK=(OLie55||OLop7||OLgek>=20030624)?1:0,OLmRoot='html',OLmGotSc=0,
|
37 |
+
OLmScLeft=0,OLmScTop=0,OLmKDH=null,OLmTI=new Array(),OLmTT=new Array("a","button","iframe","input","select","textarea"),
|
38 |
+
OLmEdit=0;
|
39 |
+
|
40 |
+
function OLchkModal(){
|
41 |
+
if(o3_modal){if(OLsaf&&!o3_modalscroll){o3_modalscroll=1;return;}if(o3_sticky&&!OLns4)OLmInitMask();else o3_modal=0;}
|
42 |
+
}
|
43 |
+
function OLclearModal(){
|
44 |
+
if(OLmMaskOn)OLmHideMask();
|
45 |
+
}
|
46 |
+
|
47 |
+
function OLsetModalIframe(o,i,z){
|
48 |
+
o.id=i;o.src='javascript:false;';o.scrolling='no';var os=o.style;os.position='absolute';os.zIndex=z;
|
49 |
+
os.filter='Alpha(style=0,opacity=0)';
|
50 |
+
}
|
51 |
+
|
52 |
+
function OLmInitMask(){
|
53 |
+
OLmRoot=(o3_frame.document.compatMode&&o3_frame.document.compatMode=='BackCompat')?'body':'html';
|
54 |
+
var doCss=(!OLgetRef('modalMask'))?1:0,zI=(over)?over.style.zIndex-2:998;OLmMask=OLmkLyr('modalMask',o3_frame);
|
55 |
+
OLmMask.style.zIndex=zI;if(OLie55){if(!OLgetRef('modalIframe')){OLmIframe=o3_frame.document.createElement('iframe');
|
56 |
+
OLsetModalIframe(OLmIframe,'modalIframe',(zI-1));o3_frame.document.body.appendChild(OLmIframe);}
|
57 |
+
else OLmIframe.style.zIndex=(zI-1);}var o=OLmMask.style,op=o3_modalopacity;op=(op<=100&&op>0?op:100);
|
58 |
+
o.backgroundColor=o3_modalcolor;if(doCss){o.display='none';o.top='0px';o.left='0px';o.width='100%';o.height='100%';
|
59 |
+
o.visibility='visible';if(OLie55){var oi=o3_frame.document.all['modalIframe'].style;oi.display='none';oi.top='0px';
|
60 |
+
oi.left='0px';oi.width='100%';oi.height='100%';oi.visibility='visible';}}if(OLie4&&!OLieM&&!OLop95
|
61 |
+
&&typeof o.filter=='string'){o.filter='Alpha(opacity='+op+')';if(OLie55)OLmMask.filters.alpha.enabled=1;}else{op=op/100;
|
62 |
+
if(typeof o.opacity!='undefined')o.opacity=op;else if(typeof o.MozOpacity!='undefined')o.MozOpacity=op;
|
63 |
+
else if(typeof o.KhtmlOpacity!='undefined')o.KhtmlOpacity=op;}OLmAddEv(window,"resize",OLmHandleMask);OLmShowMask();
|
64 |
+
}
|
65 |
+
function OLmShowMask(){
|
66 |
+
OLmMaskOn=1;if(!OLie4||OLop7){OLmKDH=document.onkeypress?document.onkeypress.toString():null;
|
67 |
+
document.onkeypress=OLmKeyDownHandler;}else OLmDisableTI();OLmMask.style.display="block";
|
68 |
+
if(OLie55)OLmIframe.style.display="block";OLmHandleMask();OLmSetMaskSize();if(!OLmSelectOK)OLmHideSB();
|
69 |
+
}
|
70 |
+
function OLmHandleMask(){
|
71 |
+
if(OLmMaskOn){if(!OLmGotSc){OLmScLeft=parseInt((OLie4&&!OLop95?OLfd(o3_frame).scrollLeft:o3_frame.pageXOffset),10);
|
72 |
+
OLmScTop=parseInt((OLie4&&!OLop95?OLfd(o3_frame).scrollTop:o3_frame.pageYOffset),10);OLmGotSc=1;}
|
73 |
+
var root=o3_frame.document.getElementsByTagName(OLmRoot)[0];if(!o3_modalscroll&&root.style.overflow!='hidden')
|
74 |
+
root.style.overflow='hidden';var o=OLmMask.style,oi=(OLie55&&OLmIframe)?OLmIframe.style:null;o.top=o.left=0+'px';
|
75 |
+
o.height=o.width='100%';if(oi){oi.top=oi.left=0+'px';oi.height=oi.width='100%';}OLmSetMaskSize();}
|
76 |
+
}
|
77 |
+
function OLmSetMaskSize(){
|
78 |
+
var root=o3_frame.document.getElementsByTagName(OLmRoot)[0],mHt,fullWd=OLmViewportWd(),fullHt=OLmViewportHt();
|
79 |
+
if(fullHt>root.scrollHeight)mHt=fullHt;else mHt=root.scrollHeight;OLmMask.style.height=mHt+'px';
|
80 |
+
OLmMask.style.width=root.scrollWidth+'px';if(OLie55&&OLmIframe){OLmIframe.style.height=mHt+'px';
|
81 |
+
OLmIframe.style.width=root.scrollWidth+'px';}
|
82 |
+
}
|
83 |
+
function OLmHideMask(){
|
84 |
+
OLmMaskOn=0;var root=o3_frame.document.getElementsByTagName(OLmRoot)[0];root.style.overflow=(OLop7?'auto':'');
|
85 |
+
if(!OLie4||OLop7){document.onkeypress=OLmKDH;OLmKDH=null;}else OLmRestoreTI();if(!OLmSelectOK)OLmShowSB();
|
86 |
+
OLmRemoveEv(window,"resize",OLmHandleMask);if(o3_frame.scrollTo&&OLmGotSc){o3_frame.scrollTo(OLmScLeft,OLmScTop);OLmGotSc=0;}
|
87 |
+
if(OLgetRef('modalMask')&&OLmMask){OLmMask.style.display='none';if(OLie55)OLmIframe.style.display='none';}OLmEdit=0;
|
88 |
+
}
|
89 |
+
|
90 |
+
function OLmKeyDownHandler(e){
|
91 |
+
var ev=(e||event),k=ev.keyCode,c=ev.charCode;
|
92 |
+
if(OLmMaskOn&&!OLmEdit&&(k==9||c==32||(OLgek&&k==13)||(k>=32&&k<=40)))return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
function OLmAddEv(obj,evType,fn){
|
96 |
+
if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}if(obj.attachEvent){
|
97 |
+
var r=obj.attachEvent("on"+evType,fn);return r;}return false;
|
98 |
+
}
|
99 |
+
function OLmRemoveEv(obj,evType,fn){
|
100 |
+
if(obj.removeEventListener){obj.removeEventListener(evType,fn,false);return true;}if(obj.detachEvent){
|
101 |
+
var r=obj.detachEvent("on"+evType,fn);return r;}return false;
|
102 |
+
}
|
103 |
+
|
104 |
+
function OLmViewportWd(){
|
105 |
+
if(o3_frame.innerWidth!=o3_frame.undefined)return o3_frame.innerWidth;
|
106 |
+
if(o3_frame.document.compatMode=='CSS1Compat')return o3_frame.document.documentElement.clientWidth;
|
107 |
+
if(o3_frame.document.body)return o3_frame.document.body.clientWidth;return o3_frame.undefined;
|
108 |
+
}
|
109 |
+
function OLmViewportHt(){
|
110 |
+
if(o3_frame.innerHeight!=o3_frame.undefined)return o3_frame.innerHeight;
|
111 |
+
if(o3_frame.document.compatMode=='CSS1Compat')return o3_frame.document.documentElement.clientHeight;
|
112 |
+
if(o3_frame.document.body)return o3_frame.document.body.clientHeight;return o3_frame.undefined;
|
113 |
+
}
|
114 |
+
|
115 |
+
function OLmHideSB(){
|
116 |
+
var s=over.innerHTML;over.innerHTML='';
|
117 |
+
var sel=OLie4?o3_frame.document.all.tags('select'):o3_frame.document.getElementsByTagName('select');
|
118 |
+
for(i=0;i<sel.length;i++)sel[i].style.visibility="hidden";over.innerHTML=s;
|
119 |
+
}
|
120 |
+
function OLmShowSB(){
|
121 |
+
var s=over.innerHTML;over.innerHTML='';
|
122 |
+
var sel=OLie4?o3_frame.document.all.tags('select'):o3_frame.document.getElementsByTagName('select');
|
123 |
+
for(i=0;i<sel.length;i++)sel[i].style.visibility="visible";over.innerHTML=s;
|
124 |
+
}
|
125 |
+
|
126 |
+
function OLmDisableTI(){
|
127 |
+
if(OLie4&&!OLop7){var i=0;for(var j=0;j<OLmTT.length;j++){var tagE=o3_frame.document.getElementsByTagName(OLmTT[j]);
|
128 |
+
for(var k=0;k<tagE.length;k++){OLmTI[i]=tagE[k].tabIndex;tagE[k].tabIndex="-1";i++;}}}
|
129 |
+
}
|
130 |
+
function OLmRestoreTI(){
|
131 |
+
if(OLie4&&!OLop7){var i=0;for(var j=0;j<OLmTT.length;j++){var tagE=o3_frame.document.getElementsByTagName(OLmTT[j]);
|
132 |
+
for(var k=0;k<tagE.length;k++){tagE[k].tabIndex=OLmTI[i];tagE[k].tabEnabled=true;i++;}}}
|
133 |
+
}
|
134 |
+
|
135 |
+
OLregRunTimeFunc(OLloadModal);
|
136 |
+
OLregCmdLineFunc(OLparseModal);
|
137 |
+
|
138 |
+
OLmodalPI=1;
|
139 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_overtwo.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_overtwo.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the popups-within-a-popup feature.
|
4 |
+
Initial: July 14, 2003 - Last Revised: June 12, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
OLregCmds('label2');
|
14 |
+
|
15 |
+
// DEFAULT CONFIGURATION
|
16 |
+
if(OLud('label2'))var ol_label2="";
|
17 |
+
// END CONFIGURATION
|
18 |
+
|
19 |
+
var o3_label2="",OLshowingsticky2=0,over2=null,OLp1over=null,bkdrop2=null,OLp1bkdrop=null,OLp1scroll=0,OLp1X=0,OLp1Y=0,
|
20 |
+
OLp1If=null,OLp1IfShadow=null,OLp1bubbleHt=0,OLp1exclusive=0,OLp1modal=0,OLp1fiIdx= -1,OLp1Hover=0,OLp2over=null;
|
21 |
+
|
22 |
+
function OLloadOvertwo(){
|
23 |
+
OLload('label2');
|
24 |
+
}
|
25 |
+
|
26 |
+
function OLparseOvertwo(pf,i,ar){
|
27 |
+
var k=i,q=OLparQuo;
|
28 |
+
if(k<ar.length){
|
29 |
+
if(ar[k]==LABEL2){q(ar[++k],pf+'label2');return k;}}
|
30 |
+
return -1;
|
31 |
+
}
|
32 |
+
|
33 |
+
// PUBLIC FUNCTIONS
|
34 |
+
function overlib2(){
|
35 |
+
var ar=arguments;if(over2)cClick2();if(ar.length==0)return false;OLp2over=null;if(!OLshowingsticky||OLpFrame(ar)){
|
36 |
+
if(parent!=self&&window.name&&parent.OLshowingsticky&&OLpFrame(ar)){if(over)cClick();OLp2over=over;over=parent.over;}else
|
37 |
+
return false;}OLifX=0;OLifY=0;if(OLtimerid>0){clearTimeout(OLtimerid);OLtimerid=0;}if(OLshowid>0){clearTimeout(OLshowid);
|
38 |
+
OLshowid=0;}if(OLdelayid>0){clearTimeout(OLdelayid);OLdelayid=0;}if(typeof over.onmouseover!='undefined'&&
|
39 |
+
over.onmouseover!=null){OLp1Hover=1;OLhover=0;over.onmouseover=null;}else OLp1Hover=0;OLp1over=null;OLp1scroll=(OLscrollPI&&
|
40 |
+
o3_scroll?1:0);if(OLp1scroll){OLp1X=over.scroll.x;OLp1Y=over.scroll.y;OLclearScroll();o3_scroll=0;}if(OLfunctionPI)
|
41 |
+
o3_function=ol_function;if(OLdraggablePI&&o3_draggable)OLclearDrag();OLp1exclusive=(OLexclusivePI&&o3_exclusive?1:0);
|
42 |
+
OLp1modal=(OLmodalPI&&o3_modal?1:0);if((OLiframePI)&&OLifsP1){OLp1If=OLifsP1;OLifsP1=null;if(OLifsSh){OLp1IfShadow=OLifsSh;
|
43 |
+
OLifsSh=null;}}else{OLp1If=null;OLp1IfSh=null}OLpullP1(OLo2c(1));if(OLbubblePI)OLp1bubbleHt=OLbubbleHt;if(OLfilterPI){
|
44 |
+
OLp1fiIdx=OLfiIdx;if(!OLie55&&o3_filter)OLopOv(o3_filteropacity);}OLload(OLo2c(0));o3_label2=ol_label2;
|
45 |
+
OLparseTokens('o3_',ar);OLpushP1(OLp1co);if(OLexclusivePI)o3_exclusive=OLp1exclusive;if(o3_decode)OLdecode();
|
46 |
+
if(!OLshowingsticky)parent.OLo2Ref=(OLfnRef)?OLfnRef+'cClick2()':'';if(OLbubblePI)OLchkForBubbleEffect();
|
47 |
+
if(o3_autostatus==2&&o3_cap!="")o3_status=o3_cap;else if(o3_autostatus==1&&o3_text!="")o3_status=o3_text;if(o3_delay==0)
|
48 |
+
OLdispP2();else OLdelayid=setTimeout("OLdispP2()",o3_delay);if(o3_status!=""){self.status=o3_status;return true;}
|
49 |
+
else if(!(OLop7&&event&&event.type=='mouseover'))return false;
|
50 |
+
}
|
51 |
+
|
52 |
+
function nd2(){
|
53 |
+
if(OLshowingsticky2)return false;return cClick2();
|
54 |
+
}
|
55 |
+
|
56 |
+
function cClick2(){
|
57 |
+
if(!over2||over!=over2)return false;if(OLtimerid>0){clearTimeout(OLtimerid);OLtimerid=0;}if(OLshowid>0){
|
58 |
+
clearTimeout(OLshowid);OLshowid=0;}if(OLp1over&&OLp1over!=OLmkLyr()){OLp1over=null;over2=null;return false;}OLhover=0;
|
59 |
+
over.onmouseover=null;OLhideObjectP2(over);OLshowingsticky2=0;if(OLp1bkdrop){bkdrop=OLp1bkdrop;OLp1bkdrop=null;}
|
60 |
+
if(OLp1over){over=OLp1over;OLp1over=null;}if(parent!=self&&over==parent.over){if(OLp2over||parent.OLshowingsticky)
|
61 |
+
over=OLp2over;}OLp2over=null;if((OLiframePI)&&OLp1If){OLifsP1=OLp1If;OLp1If=null;if(OLp1IfShadow){OLifsSh=OLp1IfShadow;
|
62 |
+
OLp1IfShadow=null;}}OLpushP1(OLo2c(1));if(OLbubblePI){OLbubbleHt=OLp1bubbleHt;OLp1BubbleHt=0;}if(OLfilterPI)
|
63 |
+
OLfiIdx=OLp1fiIdx;var o=OLgetRefById();if(o&&o==over){if(OLp1scroll){o3_scroll=1;OLp1scroll=0;OLchkScroll(OLp1X,OLp1Y);}
|
64 |
+
else o3_scroll=0;if(OLdraggablePI)OLcheckDrag();if(OLp1exclusive){o3_exclusive=1;OLp1exclusive=0;}if(OLhidePI)
|
65 |
+
OLhideUtil(0,1,1,0,0,0);if(o3_autostatus==2&&o3_cap!="")o3_status=o3_cap;else if(o3_autostatus==1&&o3_text!="")
|
66 |
+
o3_status=o3_text;if(OLp1Hover){OLoptMOUSEOFF(1);OLp1Hover=0;OLhover=1;}if(o3_status!="")self.status=o3_status;}
|
67 |
+
if(OLmodalPI&&!OLp1modal)OLclearModal();OLp1modal=0;return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
// SUPPORT FUNCTIONS
|
71 |
+
function OLpullP1(c){var i,m=c.split(',');for(i=0;i<m.length;i++)eval('OLp1'+m[i]+'=o3_'+m[i]);}
|
72 |
+
function OLpushP1(c){var i,m=c.split(',');for(i=0;i<m.length;i++)eval('o3_'+m[i]+'=OLp1'+m[i]);}
|
73 |
+
function OLo2c(a){return OLp1or2+(a?','+OLp1:'')+(OLbubblePI?','+OLbubbleCmds:'')+(OLdraggablePI?','+OLdraggableCmds:'')
|
74 |
+
+(OLfilterPI?','+OLfilterCmds:'')+(OLmodalPI?','+OLmodalCmds:'')+(OLprintPI?','+OLprintCmds:'')
|
75 |
+
+(OLshadowPI?','+OLshadowCmds:'');}
|
76 |
+
|
77 |
+
function OLpFrame(ar){
|
78 |
+
var r=0;if(OLcrossframePI){for(var i=0;i<ar.length;i++){if(typeof ar[i]=='number'&&ar[i]==FRAME){if(ar[i+1]==parent)r=1;
|
79 |
+
break;}}}return r;
|
80 |
+
}
|
81 |
+
|
82 |
+
function OLdispP2(){
|
83 |
+
var o=(OLns4?over:over.style),zI=parseInt(o.zIndex)+2;o3_delay=0;if(!(over2=OLmkLyr('overDiv2',o3_frame,zI)))return;
|
84 |
+
OLp1over=over;over=over2;if(OLmodalPI&&!OLp1modal&&!o3_modalscroll)OLchkModal();if(OLbubblePI)OLbubbleHt=0;
|
85 |
+
if(o3_frame==self){if(o3_noclose)OLoptMOUSEOFF(0);else if(o3_mouseoff)OLoptMOUSEOFF(1);}if(o3_sticky)OLshowingsticky2=1;
|
86 |
+
OLdoLyr();if(o3_timeout>0){if(OLtimerid>0)clearTimeout(OLtimerid);OLtimerid=setTimeout("cClick2()",o3_timeout);
|
87 |
+
o3_timeout=0;}OLchkRef();if(OLshadowPI&&o3_shadow){OLp1bkdrop=bkdrop;bkdrop=bkdrop2;OLinitShadow();}if(OLiframePI){
|
88 |
+
OLinitIfs();OLdispIfs();}if(OLfilterPI)OLinitFilterLyr(2);if(OLshadowPI&&o3_shadow)OLdispShadow();OLplaceLayer();
|
89 |
+
if(OLmodalPI&&!OLp1modal&&o3_modalscroll)OLchkModal();OLshowid=setTimeout("OLshowObjectP2(over2)",1);
|
90 |
+
OLallowmove=(o3_sticky||o3_nofollow)?0:1;
|
91 |
+
}
|
92 |
+
|
93 |
+
function OLshowObjectP2(o){
|
94 |
+
OLshowid=0;if(o)o=(OLns4?o:o.style);if(((OLfilterPI)&&!OLchkFilter(o,2))||!OLfilterPI)o.visibility="visible";
|
95 |
+
if(OLshadowPI)OLshowShadow();if(OLiframePI&&OLifsP2)OLifsP2.style.visibility="visible";if(OLhidePI)OLhideUtil(1,1,0);
|
96 |
+
if(OLdraggablePI)OLcheckDrag();
|
97 |
+
}
|
98 |
+
|
99 |
+
function OLhideObjectP2(o){
|
100 |
+
if(OLshowid>0){clearTimeout(OLshowid);OLshowid=0;}if(OLtimerid>0){clearTimeout(OLtimerid);OLtimerid=0;}o3_timeout=0;
|
101 |
+
if(OLdelayid>0){clearTimeout(OLdelayid);OLdelayid=0;}o3_delay=0;if(o&&o==OLgetRefById('overDiv2')){
|
102 |
+
if(OLscrollPI)OLclearScroll();if(OLdraggablePI)OLclearDrag();if(OLfilterPI)OLcleanupFilter(o,2);if(OLshadowPI)OLhideShadow();
|
103 |
+
var os=(OLns4)?o:o.style;if(((OLfilterPI)&&!OLchkFadeOut2(os))||!OLfilterPI){os.visibility="hidden";
|
104 |
+
if(!OLie55||(typeof ggOnChange=='undefined'&&(!OLfilterPI||!o3_filter||o3_fadeout<0)))o.innerHTML='';}
|
105 |
+
if(OLiframePI&&OLifsP2)OLifsP2.style.visibility="hidden";}OLallowmove=o3_nofollow=0;o3_label2=ol_label2;
|
106 |
+
}
|
107 |
+
|
108 |
+
OLregRunTimeFunc(OLloadOvertwo);
|
109 |
+
OLregCmdLineFunc(OLparseOvertwo);
|
110 |
+
|
111 |
+
OLovertwoPI=1;
|
112 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_print.js
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_print.js plug-in module - Copyright Foteos Macrides 2002-2009. All rights reserved.
|
3 |
+
For support of the PRINT feature.
|
4 |
+
Initial: April 25, 2005 - Last Revised: October 15, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLprintCmds='print,printbutton,noautoprint,printcolor,printfont,printsize,printtext,'
|
14 |
+
+'printbuttontext,printtitle,printfontclass,printcssfile,printxml,printdoctype,printroot,'
|
15 |
+
+'printtype,printcharset,printurl,printjob',OLprJob=null;OLregCmds(OLprintCmds);
|
16 |
+
|
17 |
+
// DEFAULT CONFIGURATION
|
18 |
+
if(OLud('print'))var ol_print=0;
|
19 |
+
if(OLud('printbutton'))var ol_printbutton=0;
|
20 |
+
if(OLud('noautoprint'))var ol_noautoprint=0;
|
21 |
+
if(OLud('printcolor'))var ol_printcolor="#eeeeff";
|
22 |
+
if(OLud('printfont'))var ol_printfont="Verdana,Arial,Helvetica";
|
23 |
+
if(OLud('printsize'))var ol_printsize=1;
|
24 |
+
if(OLud('printtext'))var ol_printtext='Print';
|
25 |
+
if(OLud('printbuttontext'))var ol_printbuttontext='Print';
|
26 |
+
if(OLud('printtitle'))var ol_printtitle="Click to Print";
|
27 |
+
if(OLud('printfontclass'))var ol_printfontclass="";
|
28 |
+
if(OLud('printcssfile'))var ol_printcssfile="";
|
29 |
+
if(OLud('printxml'))var ol_printxml="";
|
30 |
+
if(OLud('printdoctype'))var ol_printdoctype=
|
31 |
+
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" '
|
32 |
+
+'"http://www.w3.org/TR/html4/loose.dtd">';
|
33 |
+
if(OLud('printroot'))var ol_printroot="<html>";
|
34 |
+
if(OLud('printtype'))var ol_printtype="text/html";
|
35 |
+
if(OLud('printcharset'))var ol_printcharset="iso-8859-1";
|
36 |
+
if(OLud('printurl'))var ol_printurl="";
|
37 |
+
if(OLud('printjob'))var ol_printjob="";
|
38 |
+
// END CONFIGURATION
|
39 |
+
|
40 |
+
var o3_print=0,o3_printbutton=0,o3_noautoprint,o3_printcolor="",o3_printfont="",o3_printsize=1,
|
41 |
+
o3_printtext="",o3_printbuttontext="",o3_printtitle="",o3_printfontclass="",o3_printcssfile="",
|
42 |
+
o3_printxml="",o3_printdoctype="",o3_printroot="",o3_printtype="",o3_printcharset="",
|
43 |
+
o3_printurl="",o3_printjob="";
|
44 |
+
|
45 |
+
function OLloadPrint(){
|
46 |
+
OLload(OLprintCmds);
|
47 |
+
}
|
48 |
+
|
49 |
+
function OLparsePrint(pf,i,ar){
|
50 |
+
var k=i,t=OLtoggle,q=OLparQuo;
|
51 |
+
if(k<ar.length){
|
52 |
+
if(Math.abs(ar[k])==PRINT){t(ar[k],pf+'print');return k;}
|
53 |
+
if(Math.abs(ar[k])==PRINTBUTTON){t(ar[k],pf+'printbutton');return k;}
|
54 |
+
if(Math.abs(ar[k])==NOAUTOPRINT){t(ar[k],pf+'noautoprint');return k;}
|
55 |
+
if(ar[k]==PRINTCOLOR){q(ar[++k],pf+'printcolor');return k;}
|
56 |
+
if(ar[k]==PRINTFONT){q(ar[++k],pf+'printfont');return k;}
|
57 |
+
if(ar[k]==PRINTSIZE){q(ar[++k],pf+'printsize');return k;}
|
58 |
+
if(ar[k]==PRINTTEXT){q(ar[++k],pf+'printtext');return k;}
|
59 |
+
if(ar[k]==PRINTBUTTONTEXT){q(ar[++k],pf+'printbuttontext');return k;}
|
60 |
+
if(ar[k]==PRINTTITLE){q(ar[++k],pf+'printtitle');return k;}
|
61 |
+
if(ar[k]==PRINTFONTCLASS){q(ar[++k],pf+'printfontclass');return k;}
|
62 |
+
if(ar[k]==PRINTCSSFILE){q(ar[++k],pf+'printcssfile');return k;}
|
63 |
+
if(ar[k]==PRINTXML){q(ar[++k],pf+'printxml');return k;}
|
64 |
+
if(ar[k]==PRINTDOCTYPE){q(ar[++k],pf+'printdoctype');return k;}
|
65 |
+
if(ar[k]==PRINTROOT){q(ar[++k],pf+'printroot');return k;}
|
66 |
+
if(ar[k]==PRINTTYPE){q(ar[++k],pf+'printtype');return k;}
|
67 |
+
if(ar[k]==PRINTCHARSET){q(ar[++k],pf+'printcharset');return k;}
|
68 |
+
if(ar[k]==PRINTURL){q(ar[++k],pf+'printurl');return k;}
|
69 |
+
if(ar[k]==PRINTJOB){q(ar[++k],pf+'printjob');return k;}}
|
70 |
+
return -1;
|
71 |
+
}
|
72 |
+
|
73 |
+
function OLprintDims(){
|
74 |
+
if(OLhasDims(o3_printsize)){if(OLns4)o3_printsize="2";}else
|
75 |
+
if(!OLns4){var i=parseInt(o3_printsize);o3_printsize=(i>0&&i<8)?OLpct[i]:OLpct[0];}
|
76 |
+
}
|
77 |
+
|
78 |
+
function OLchkPrint(){if(!o3_sticky)o3_print=0;else over.print=null;}
|
79 |
+
|
80 |
+
function OLprintCapLGF(){
|
81 |
+
var n=(OLovertwoPI&&over2&&over==over2)?2:1;
|
82 |
+
return(o3_print&&!o3_printbutton?'<td align="right"><a href="javascript:'+OLfnRef
|
83 |
+
+'return OLprint('+n+');" '+(o3_printtitle?'title="'+o3_printtitle+'" ':'')+'onclick="'
|
84 |
+
+OLfnRef+'return OLprint('+n+');"'+(o3_printfontclass?' class="'+o3_printfontclass+'">':
|
85 |
+
(OLns4?'><':'')+OLlgfUtil(0,1,'','a',o3_printcolor,o3_printfont,o3_printsize))+o3_printtext
|
86 |
+
+(o3_printfontclass?'':(OLns4?OLlgfUtil(1,1,'','a'):''))+'</a></td>':'');
|
87 |
+
}
|
88 |
+
|
89 |
+
function OLprintFgLGF(){
|
90 |
+
var n=(OLovertwoPI&&over2&&over==over2)?2:1;return (o3_print&&(!o3_cap||o3_printbutton)?
|
91 |
+
'<div align="center"><form action="javascript:void(0);"><input type="button" '
|
92 |
+
+(OLns4?'':'style="font-family:Verdana;font-size:11px;color:#000000;" ')+'value="'
|
93 |
+
+o3_printbuttontext+'" title="'+o3_printtitle+'" '+(OLgek?'autocomplete="off" ':'')
|
94 |
+
+'onclick="'+OLfnRef+'return OLprint('+n+');" /></form></div>':'');
|
95 |
+
}
|
96 |
+
|
97 |
+
function OLprint(n){
|
98 |
+
if(n!=2&&OLovertwoPI&&over2&&over==over2)cClick2();
|
99 |
+
if(!(over&&over.print))return false;if(o3_printjob){eval(o3_printjob);
|
100 |
+
if(OLie55&&event&&event.type=='click')event.returnValue=false;return false;}
|
101 |
+
if(o3_printurl){if(!window.print||o3_noautoprint)
|
102 |
+
alert('Print (Control-P) the OLprint Window when it appears, then close it.');OLprJob=
|
103 |
+
window.open(o3_printurl,'OLurlJob','resizable=1,status=1,screenX=0,left=0,screenY=0,top=0');
|
104 |
+
OLprJob.focus();if(OLprJob){if(window.print&&!o3_noautoprint){OLprJob.print();
|
105 |
+
setTimeout("OLprJob.close();OLprJob=null;",2);}}return false;}
|
106 |
+
var sx=(OLshadowPI&&o3_shadow?o3_shadowx:0),sy=(OLshadowPI&&o3_shadow?o3_shadowy:0),
|
107 |
+
lm=20+(sx<0?Math.abs(sx):0),rm=20+(sx>0?sx:0),tm=20+(sy<0?Math.abs(sy):0),bm=20+(sy>0?sy:0),
|
108 |
+
pWd=o3_width,pHt=(OLns4?over.clip.height:over.offsetHeight),iWd=pWd+lm+rm,iHt=pHt+tm+bm,
|
109 |
+
fs=(OLfilterPI&&OLie55&&o3_filter?o3_filtershadow:0),Fn='{return false;}',
|
110 |
+
o2=(OLovertwoPI?OLp1or2c+','+OLp1or2co+','+OLp1co+',scroll,function':'');
|
111 |
+
t=o3_printxml+o3_printdoctype+o3_printroot+'<head><meta http-equiv="content-Type" content="'
|
112 |
+
+o3_printtype+'; charset='+o3_printcharset+'" /><title>OLprint Job</title>'
|
113 |
+
+(o3_printcssfile?'<link rel="stylesheet" type="text/css" href="'+o3_printcssfile+'" />':'')
|
114 |
+
+'<script type="text/javascript">var OLfnRef="",OLna='+o3_noautoprint+',OLo2="'+o2+'";'
|
115 |
+
+'function OLprintAndClose(){if(window.print&&!OLna){self.print();setTimeout("self.close()",2);}'
|
116 |
+
+'else{alert("Print (Control-P) the OLprint Window, then close it.");}}'
|
117 |
+
+'function OLprint(){if(window.print)self.print();}function cClick(){self.close();}'
|
118 |
+
+'function nd()'+Fn+'function overlib2()'+Fn+'function nd2()'+Fn+'if(OLo2){'
|
119 |
+
+'var i,m=OLo2.split(",");for(i=0;i<m.length;i++)eval(m[i].toUpperCase()+"="+0);}</script>'
|
120 |
+
+'</head><body onLoad="self.focus();OLprintAndClose()">'
|
121 |
+
+(sx||sy?'<div id="printBackdrop" style="position:absolute;z-index:999;visibility:visible;'
|
122 |
+
+'width:'+o3_width+(OLns4?';':'px;')+'height:'+pHt+(OLns4?';':'px;')
|
123 |
+
+(o3_shadowimage?'background-image:url('+o3_shadowimage+');':'background-color:'
|
124 |
+
+o3_shadowcolor+';')+'left:'+(lm+sx).toString()+(OLns4?';':'px;')+'top:'+(tm+sy).toString()
|
125 |
+
+(OLns4?';':'px;')+'"></div>':'')
|
126 |
+
+'<div id="overPrintDiv" style="position:absolute;z-index:1000;visibility:visible;width:'
|
127 |
+
+o3_width+(OLns4?';':'px;')+(o3_background?'background-image:url('+o3_background+');':'')
|
128 |
+
+'left:'+lm.toString()+(OLns4?';':'px;')+'top:'+tm.toString()+(OLns4?';':'px;')
|
129 |
+
+(fs?'filter:progid:DXImageTransform.Microsoft.':'')
|
130 |
+
+(fs==2?'Shadow(color=\''+o3_filtershadowcolor+'\',direction=135,strength=5);':'')
|
131 |
+
+(fs==1?'Dropshadow(color=\''+o3_filtershadowcolor+'\');':'')+'">'+over.print
|
132 |
+
+'</div></body></html>';
|
133 |
+
OLprJob=window.open('','OLprintJob','resizable=0,width='+iWd+',height='+iHt
|
134 |
+
+',status=0,location=0,toolbar=0,menubar=0,scrolling=0,screenX=0,left=0,screenY=0,top=0');
|
135 |
+
OLprJob.document.write(t);OLprJob.document.close();if(OLie55&&event&&event.type=='click')
|
136 |
+
event.returnValue=false;return false;
|
137 |
+
}
|
138 |
+
|
139 |
+
OLregRunTimeFunc(OLloadPrint);
|
140 |
+
OLregCmdLineFunc(OLparsePrint);
|
141 |
+
|
142 |
+
OLprintPI=1;
|
143 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_regCore.js
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_regCore.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
Import this file to declare the core command constants in frame documents which do not
|
4 |
+
import the core module, overlibmws.js, but point to the overlib() and nd() commands in
|
5 |
+
another document of the frameset, e.g. parent.scene.overlib(...) and parent.scene.nd()
|
6 |
+
in a frame document named "scene" which does import the core module. You can then use
|
7 |
+
this file's OLregisterPlugins() function via a script block to declare pre-existing
|
8 |
+
plugin modules, or it's OLregisterCommands() function for new plugins whose
|
9 |
+
commands are not yet defined as string variables in this file. The order of
|
10 |
+
entries in those functions should parallel the order of importing the plugins.
|
11 |
+
Initial: August 3, 2003 - Last Revised: January 26, 2008
|
12 |
+
See the Change History and Command Reference for overlibmws via:
|
13 |
+
|
14 |
+
http://www.macridesweb.com/oltest/
|
15 |
+
|
16 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
17 |
+
*/
|
18 |
+
|
19 |
+
var OLloaded=0,OLpmCnt=1,OLpMtr=new Array();
|
20 |
+
OLregisterCommands('inarray,caparray,caption,closetext,right,left,center,autostatuscap,padx,'
|
21 |
+
+'pady,below,above,vcenter,donothing,nofollow,background,offsetx,offsety,fgcolor,bgcolor,'
|
22 |
+
+'cgcolor,textcolor,capcolor,width,wrap,wrapmax,height,border,base,status,autostatus,snapx,'
|
23 |
+
+'snapy,fixx,fixy,relx,rely,midx,midy,ref,refc,refp,refx,refy,fgbackground,bgbackground,'
|
24 |
+
+'cgbackground,fullhtml,capicon,textfont,captionfont,textsize,captionsize,timeout,delay,hauto,'
|
25 |
+
+'vauto,nojustx,nojusty,fgclass,bgclass,cgclass,capbelow,textpadding,textfontclass,'
|
26 |
+
+'captionpadding,captionfontclass,sticky,noclose,mouseoff,offdelay,closecolor,closefont,'
|
27 |
+
+'closesize,closeclick,closetitle,closefontclass,decode,label');
|
28 |
+
|
29 |
+
var CSSOFF=DONOTHING,CSSCLASS=DONOTHING;
|
30 |
+
var OLpluginBUBBLE='bubble,bubbletype,adjbubble,rcbubblecolor,bubbleclose';
|
31 |
+
var OLpluginCROSSFRAME='frame';
|
32 |
+
var OLpluginDEBUG='allowdebug';
|
33 |
+
var OLpluginDRAGGABLE='draggable,dragcap,dragid';
|
34 |
+
var OLpluginEXCLUSIVE='exclusive,exclusivestatus,exclusiveoverride';
|
35 |
+
var OLpluginFILTER='filter,fadein,fadeout,fadetime,filteropacity,filtershadow,filtershadowcolor';
|
36 |
+
var OLpluginFUNCTION='function';
|
37 |
+
var OLpluginHIDE='hideselectboxes,hidebyid,hidebyidall,hidebyidns4';
|
38 |
+
var OLpluginMODAL='modal,modalcolor,modalopacity,modalscroll';
|
39 |
+
var OLpluginOVERTWO='label2';
|
40 |
+
var OLpluginPRINT='print,printbutton,noautoprint,printcolor,printfont,printsize,printtext,'
|
41 |
+
+'printbuttontext,printtitle,printfontclass,printcssfile,printxml,printdoctype,printroot,'
|
42 |
+
+'printtype,printcharset,printurl,printjob';
|
43 |
+
var OLpluginSCROLL='scroll';
|
44 |
+
var OLpluginSHADOW='shadow,shadowx,shadowy,shadowcolor,shadowimage,shadowopacity';
|
45 |
+
|
46 |
+
// PUBLIC FUNCTIONS
|
47 |
+
function OLregisterCommands(cmdStr){
|
48 |
+
if(typeof cmdStr!='string')return;
|
49 |
+
var pM=cmdStr.split(',');
|
50 |
+
OLpMtr=OLpMtr.concat(pM);
|
51 |
+
for(var i=0;i<pM.length;i++)
|
52 |
+
eval(pM[i].toUpperCase()+'='+OLpmCnt++);
|
53 |
+
}
|
54 |
+
|
55 |
+
function OLregisterPlugins(){
|
56 |
+
var ar=arguments;
|
57 |
+
for(var i=0;i<ar.length;i++){
|
58 |
+
if(ar[i].toUpperCase()=='BUBBLE'){OLregisterCommands(OLpluginBUBBLE);continue;}
|
59 |
+
if(ar[i].toUpperCase()=='CROSSFRAME'){OLregisterCommands(OLpluginCROSSFRAME);continue;}
|
60 |
+
if(ar[i].toUpperCase()=='DEBUG'){OLregisterCommands(OLpluginDEBUG);continue;}
|
61 |
+
if(ar[i].toUpperCase()=='DRAGGABLE'){OLregisterCommands(OLpluginDRAGGABLE);continue;}
|
62 |
+
if(ar[i].toUpperCase()=='EXCLUSIVE'){OLregisterCommands(OLpluginEXCLUSIVE);continue;}
|
63 |
+
if(ar[i].toUpperCase()=='FILTER'){OLregisterCommands(OLpluginFILTER);continue;}
|
64 |
+
if(ar[i].toUpperCase()=='FUNCTION'){OLregisterCommands(OLpluginFUNCTION);continue;}
|
65 |
+
if(ar[i].toUpperCase()=='HIDE'){OLregisterCommands(OLpluginHIDE);continue;}
|
66 |
+
if(ar[i].toUpperCase()=='IFRAME')continue;
|
67 |
+
if(ar[i].toUpperCase()=='MODAL'){OLregisterCommands(OLpluginMODAL);continue;}
|
68 |
+
if(ar[i].toUpperCase()=='OVERTWO'){OLregisterCommands(OLpluginOVERTWO);continue;}
|
69 |
+
if(ar[i].toUpperCase()=='PRINT'){OLregisterCommands(OLpluginPRINT);continue;}
|
70 |
+
if(ar[i].toUpperCase()=='REGCORE')continue;
|
71 |
+
if(ar[i].toUpperCase()=='SCROLL'){OLregisterCommands(OLpluginSCROLL);continue;}
|
72 |
+
if(ar[i].toUpperCase()=='SHADOW'){OLregisterCommands(OLpluginSHADOW);continue;}}
|
73 |
+
}
|
74 |
+
|
75 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_scroll.js
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_scroll.js plug-in module - Copyright Foteos Macrides 2002-2009. All rights reserved.
|
3 |
+
For support of the SCROLL feature.
|
4 |
+
Initial: October 20, 2002 - Last Revised: June 21, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
OLregCmds('scroll');
|
14 |
+
|
15 |
+
// DEFAULT CONFIGURATION
|
16 |
+
if(OLud('scroll'))var ol_scroll=0;
|
17 |
+
// END CONFIGURATION
|
18 |
+
|
19 |
+
var o3_scroll=0,OLscrollRefresh=100;
|
20 |
+
|
21 |
+
function OLloadScroll(){
|
22 |
+
OLload('scroll');
|
23 |
+
}
|
24 |
+
|
25 |
+
function OLparseScroll(pf,i,ar){
|
26 |
+
var k=i;
|
27 |
+
if(k<ar.length){if(Math.abs(ar[k])==SCROLL){OLtoggle(ar[k],pf+'scroll');return k;}}
|
28 |
+
return -1;
|
29 |
+
}
|
30 |
+
|
31 |
+
function OLchkScroll(X,Y){
|
32 |
+
if(o3_scroll){if(!OLshowingsticky||
|
33 |
+
(OLovertwoPI&&over==over2&&!OLshowingsticky2)||
|
34 |
+
(OLdraggablePI&&o3_draggable&&o3_frame==self)||
|
35 |
+
(o3_relx==null&&o3_midx==null)||(o3_rely==null&&o3_midy==null))o3_scroll=0;
|
36 |
+
else if(typeof over.scroll=='undefined'||over.scroll.canScroll)
|
37 |
+
over.scroll=new OLsetScroll(X,Y,OLscrollRefresh);}
|
38 |
+
}
|
39 |
+
|
40 |
+
function OLsetScroll(X,Y,refresh){
|
41 |
+
if(o3_scroll){this.canScroll=0;this.refresh=refresh;this.x=X;this.y=Y;
|
42 |
+
this.timer=setTimeout("OLscrollReposition()",this.refresh);}
|
43 |
+
}
|
44 |
+
|
45 |
+
function OLclearScroll(){
|
46 |
+
if(o3_scroll){if(typeof over.scroll=='undefined'){o3_scroll=0;return;}
|
47 |
+
over.scroll.canScroll=1;if(over.scroll.timer){
|
48 |
+
clearTimeout(over.scroll.timer);over.scroll.timer=null;}}
|
49 |
+
}
|
50 |
+
|
51 |
+
function OLscrollReposition(){
|
52 |
+
var o=over,oD=(OLovertwoPI&&over==over2?'overDiv2':'overDiv');
|
53 |
+
if(o3_scroll&&o&&o==OLgetRefById(oD)){var X,Y,pgLeft,pgTop;
|
54 |
+
pgLeft=(OLie4&&!OLop95)?OLfd().scrollLeft:o3_frame.pageXOffset;
|
55 |
+
pgTop=(OLie4&&!OLop95)?OLfd().scrollTop:o3_frame.pageYOffset;
|
56 |
+
X=(o.pageX?o.pageX:o.style.left?o.style.left:0)-pgLeft;
|
57 |
+
Y=(o.pageY?o.pageY:o.style.top?o.style.top:0)-pgTop;
|
58 |
+
if(X!=o.scroll.x||Y!=o.scroll.y){
|
59 |
+
OLrepositionTo(o,pgLeft+o.scroll.x,pgTop+o.scroll.y);
|
60 |
+
if(OLshadowPI)OLrepositionShadow(pgLeft+o.scroll.x,pgTop+o.scroll.y);
|
61 |
+
if(OLiframePI)OLrepositionIfs(pgLeft+o.scroll.x,pgTop+o.scroll.y);
|
62 |
+
if(OLhidePI)OLhideUtil(0,1,1,0,0,0);}
|
63 |
+
o.scroll.timer=setTimeout("OLscrollReposition()",o.scroll.refresh);}
|
64 |
+
}
|
65 |
+
|
66 |
+
OLregRunTimeFunc(OLloadScroll);
|
67 |
+
OLregCmdLineFunc(OLparseScroll);
|
68 |
+
|
69 |
+
OLscrollPI=1;
|
70 |
+
OLloaded=1;
|
js/overlibmws/overlibmws_shadow.js
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
overlibmws_shadow.js plug-in module - Copyright Foteos Macrides 2003-2009. All rights reserved.
|
3 |
+
For support of the SHADOW feature.
|
4 |
+
Initial: July 14, 2003 - Last Revised: June 21, 2008
|
5 |
+
See the Change History and Command Reference for overlibmws via:
|
6 |
+
|
7 |
+
http://www.macridesweb.com/oltest/
|
8 |
+
|
9 |
+
Published under an open source license: http://www.macridesweb.com/oltest/license.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
OLloaded=0;
|
13 |
+
var OLshadowCmds='shadow,shadowx,shadowy,shadowcolor,shadowimage,shadowopacity';
|
14 |
+
OLregCmds(OLshadowCmds);
|
15 |
+
|
16 |
+
// DEFAULT CONFIGURATION
|
17 |
+
if(OLud('shadow'))var ol_shadow=0;
|
18 |
+
if(OLud('shadowx'))var ol_shadowx=5;
|
19 |
+
if(OLud('shadowy'))var ol_shadowy=5;
|
20 |
+
if(OLud('shadowcolor'))var ol_shadowcolor="#666666";
|
21 |
+
if(OLud('shadowimage'))var ol_shadowimage="";
|
22 |
+
if(OLud('shadowopacity'))var ol_shadowopacity=60;
|
23 |
+
// END CONFIGURATION
|
24 |
+
|
25 |
+
var o3_shadow=0,o3_shadowx=5,o3_shadowy=5,o3_shadowcolor="#666666",o3_shadowimage="";
|
26 |
+
var o3_shadowopacity=60,bkdrop=null;
|
27 |
+
|
28 |
+
function OLloadShadow(){
|
29 |
+
OLload(OLshadowCmds);
|
30 |
+
}
|
31 |
+
|
32 |
+
function OLparseShadow(pf,i,ar){
|
33 |
+
var k=i,p=OLpar,q=OLparQuo;
|
34 |
+
if(k<ar.length){
|
35 |
+
if(Math.abs(ar[k])==SHADOW){OLtoggle(ar[k],pf+'shadow');return k;}
|
36 |
+
if(ar[k]==SHADOWX){p(ar[++k],pf+'shadowx');return k;}
|
37 |
+
if(ar[k]==SHADOWY){p(ar[++k],pf+'shadowy');return k;}
|
38 |
+
if(ar[k]==SHADOWCOLOR){q(ar[++k],pf+'shadowcolor');return k;}
|
39 |
+
if(ar[k]==SHADOWIMAGE){q(ar[++k],pf+'shadowimage');return k;}
|
40 |
+
if(ar[k]==SHADOWOPACITY){p(ar[++k],pf+'shadowopacity');return k;}}
|
41 |
+
return -1;
|
42 |
+
}
|
43 |
+
|
44 |
+
function OLdispShadow(){
|
45 |
+
if(o3_shadow){OLgetShadowLyrRef();if(bkdrop)OLgenerateShadowLyr();}
|
46 |
+
}
|
47 |
+
|
48 |
+
function OLinitShadow(){
|
49 |
+
if(OLie55&&OLfilterPI&&o3_filter){if(o3_shadow){o3_shadow=0;
|
50 |
+
if(!o3_filtershadow){o3_filtershadow=2;o3_filtershadowcolor=o3_shadowcolor;}}return;}
|
51 |
+
var o;if(!(o=OLmkLyr((OLovertwoPI&&over2&&over==over2?'backdrop2':'backdrop'),
|
52 |
+
o3_frame,999))||bkdrop!=o){bkdrop=null;OLgetShadowLyrRef();}
|
53 |
+
}
|
54 |
+
|
55 |
+
function OLgetShadowLyrRef(){
|
56 |
+
if(bkdrop||!o3_shadow)return;
|
57 |
+
bkdrop=OLgetRefById((OLovertwoPI&&over2&&over==over2?'backdrop2':'backdrop'));
|
58 |
+
if(!bkdrop){o3_shadow=0;bkdrop=null;}
|
59 |
+
}
|
60 |
+
|
61 |
+
function OLgenerateShadowLyr(){
|
62 |
+
var wd=(OLns4?over.clip.width:over.offsetWidth),hgt=(OLns4?over.clip.height:over.offsetHeight);
|
63 |
+
if(OLns4){bkdrop.clip.width=wd;bkdrop.clip.height=hgt;
|
64 |
+
if(o3_shadowimage)bkdrop.background.src=o3_shadowimage;
|
65 |
+
else{bkdrop.bgColor=o3_shadowcolor;bkdrop.zIndex=over.zIndex -1;}
|
66 |
+
}else{var o=bkdrop.style;o.width=wd+'px';o.height=hgt+'px';
|
67 |
+
if(o3_shadowimage)o.backgroundImage="url("+o3_shadowimage+")";
|
68 |
+
else o.backgroundColor=o3_shadowcolor;
|
69 |
+
o.clip='rect(0px '+wd+'px '+hgt+'px 0px)';o.zIndex=over.style.zIndex -1;
|
70 |
+
if(o3_shadowopacity){var op=o3_shadowopacity;op=(op<=100&&op>0?op:100);
|
71 |
+
if(OLie4&&!OLieM&&!OLop95&&typeof o.filter=='string'){
|
72 |
+
o.filter='Alpha(opacity='+op+')';if(OLie55&&typeof bkdrop.filters=='object')
|
73 |
+
bkdrop.filters.alpha.enabled=1;}else{op=op/100;OLopBk(op);}}}
|
74 |
+
}
|
75 |
+
|
76 |
+
function OLopBk(op){
|
77 |
+
var o=bkdrop.style;
|
78 |
+
if(typeof o.opacity!='undefined')o.opacity=op;
|
79 |
+
else if(typeof o.MozOpacity!='undefined')o.MozOpacity=op;
|
80 |
+
else if(typeof o.KhtmlOpacity!='undefined')o.KhtmlOpacity=op;
|
81 |
+
}
|
82 |
+
|
83 |
+
function OLcleanUpShadow(){
|
84 |
+
if(!bkdrop)return;
|
85 |
+
if(OLns4){bkdrop.bgColor=null;bkdrop.background.src=null;}else{
|
86 |
+
var o=bkdrop.style;o.backgroundColor='transparent';o.backgroundImage='none';
|
87 |
+
if(OLie4&&!OLieM&&typeof o.filter=='string'){
|
88 |
+
o.filter='Alpha(opacity=100)';if(OLie55&&typeof bkdrop.filters=='object')
|
89 |
+
bkdrop.filters.alpha.enabled=0;}else OLopBk(1.0);
|
90 |
+
if(OLns6){o.width=1+'px';o.height=1+'px';
|
91 |
+
OLrepositionTo(bkdrop,o3_frame.pageXOffset,o3_frame.pageYOffset);}}
|
92 |
+
}
|
93 |
+
|
94 |
+
function OLshowShadow(){if(bkdrop&&o3_shadow){var o=(OLns4?bkdrop:bkdrop.style);
|
95 |
+
if(!OLns4&&!OLieM&&(OLfilterPI&&o3_filter&&o3_fadein))OLopOvSh(1);o.visibility="visible";}
|
96 |
+
}
|
97 |
+
|
98 |
+
function OLhideShadow(){
|
99 |
+
if(bkdrop&&o3_shadow){var o=OLgetRefById((OLovertwoPI&&over2&&over==over2?
|
100 |
+
'backdrop2':'backdrop'));if(o&&o==bkdrop){var os=(OLns4?bkdrop:bkdrop.style);
|
101 |
+
if(OLns4||OLieM||!OLfilterPI||((OLfilterPI)&&(!o3_filter||!o3_fadeout||!OLhasOp()))){
|
102 |
+
os.visibility="hidden";OLcleanUpShadow();}}}
|
103 |
+
}
|
104 |
+
|
105 |
+
function OLrepositionShadow(X,Y){
|
106 |
+
if(bkdrop&&o3_shadow)OLrepositionTo(bkdrop,X+o3_shadowx,Y+o3_shadowy);
|
107 |
+
}
|
108 |
+
|
109 |
+
OLregRunTimeFunc(OLloadShadow);
|
110 |
+
OLregCmdLineFunc(OLparseShadow);
|
111 |
+
|
112 |
+
OLshadowPI=1;
|
113 |
+
OLloaded=1;
|
js/overlibmws/overlibmwslogo.gif
ADDED
Binary file
|
js/overlibmws/print.gif
ADDED
Binary file
|
js/overlibmws/pushpin.gif
ADDED
Binary file
|
js/overlibmws/quotation.gif
ADDED
Binary file
|
js/overlibmws/raised_blue.gif
ADDED
Binary file
|
js/overlibmws/raised_metallic.gif
ADDED
Binary file
|
js/overlibmws/semitrans.gif
ADDED
Binary file
|
js/overlibmws/showCalendar.gif
ADDED
Binary file
|
js/overlibmws/sprintf.js
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Function printf(format_string,arguments...)
|
2 |
+
* Javascript emulation of the C printf function (modifiers and argument types
|
3 |
+
* "p" and "n" are not supported due to language restrictions)
|
4 |
+
*
|
5 |
+
* Copyright 2003 K&L Productions. All rights reserved
|
6 |
+
* http://www.klproductions.com
|
7 |
+
*
|
8 |
+
* Terms of use: This function can be used free of charge IF this header is not
|
9 |
+
* modified and remains with the function code.
|
10 |
+
*
|
11 |
+
* Legal: Use this code at your own risk. K&L Productions assumes NO resposibility
|
12 |
+
* for anything.
|
13 |
+
********************************************************************************/
|
14 |
+
function sprintf(fstring)
|
15 |
+
{ var pad = function(str,ch,len)
|
16 |
+
{ var ps='';
|
17 |
+
for(var i=0; i<Math.abs(len); i++) ps+=ch;
|
18 |
+
return len>0?str+ps:ps+str;
|
19 |
+
}
|
20 |
+
var processFlags = function(flags,width,rs,arg)
|
21 |
+
{ var pn = function(flags,arg,rs)
|
22 |
+
{ if(arg>=0)
|
23 |
+
{ if(flags.indexOf(' ')>=0) rs = ' ' + rs;
|
24 |
+
else if(flags.indexOf('+')>=0) rs = '+' + rs;
|
25 |
+
}
|
26 |
+
else
|
27 |
+
rs = '-' + rs;
|
28 |
+
return rs;
|
29 |
+
}
|
30 |
+
var iWidth = parseInt(width,10);
|
31 |
+
if(width.charAt(0) == '0')
|
32 |
+
{ var ec=0;
|
33 |
+
if(flags.indexOf(' ')>=0 || flags.indexOf('+')>=0) ec++;
|
34 |
+
if(rs.length<(iWidth-ec)) rs = pad(rs,'0',rs.length-(iWidth-ec));
|
35 |
+
return pn(flags,arg,rs);
|
36 |
+
}
|
37 |
+
rs = pn(flags,arg,rs);
|
38 |
+
if(rs.length<iWidth)
|
39 |
+
{ if(flags.indexOf('-')<0) rs = pad(rs,' ',rs.length-iWidth);
|
40 |
+
else rs = pad(rs,' ',iWidth - rs.length);
|
41 |
+
}
|
42 |
+
return rs;
|
43 |
+
}
|
44 |
+
var converters = new Array();
|
45 |
+
converters['c'] = function(flags,width,precision,arg)
|
46 |
+
{ if(typeof(arg) == 'number') return String.fromCharCode(arg);
|
47 |
+
if(typeof(arg) == 'string') return arg.charAt(0);
|
48 |
+
return '';
|
49 |
+
}
|
50 |
+
converters['d'] = function(flags,width,precision,arg)
|
51 |
+
{ return converters['i'](flags,width,precision,arg);
|
52 |
+
}
|
53 |
+
converters['u'] = function(flags,width,precision,arg)
|
54 |
+
{ return converters['i'](flags,width,precision,Math.abs(arg));
|
55 |
+
}
|
56 |
+
converters['i'] = function(flags,width,precision,arg)
|
57 |
+
{ var iPrecision=parseInt(precision);
|
58 |
+
var rs = ((Math.abs(arg)).toString().split('.'))[0];
|
59 |
+
if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
|
60 |
+
return processFlags(flags,width,rs,arg);
|
61 |
+
}
|
62 |
+
converters['E'] = function(flags,width,precision,arg)
|
63 |
+
{ return (converters['e'](flags,width,precision,arg)).toUpperCase();
|
64 |
+
}
|
65 |
+
converters['e'] = function(flags,width,precision,arg)
|
66 |
+
{ iPrecision = parseInt(precision);
|
67 |
+
if(isNaN(iPrecision)) iPrecision = 6;
|
68 |
+
rs = (Math.abs(arg)).toExponential(iPrecision);
|
69 |
+
if(rs.indexOf('.')<0 && flags.indexOf('#')>=0) rs = rs.replace(/^(.*)(e.*)$/,'$1.$2');
|
70 |
+
return processFlags(flags,width,rs,arg);
|
71 |
+
}
|
72 |
+
converters['f'] = function(flags,width,precision,arg)
|
73 |
+
{ iPrecision = parseInt(precision);
|
74 |
+
if(isNaN(iPrecision)) iPrecision = 6;
|
75 |
+
rs = (Math.abs(arg)).toFixed(iPrecision);
|
76 |
+
if(rs.indexOf('.')<0 && flags.indexOf('#')>=0) rs = rs + '.';
|
77 |
+
return processFlags(flags,width,rs,arg);
|
78 |
+
}
|
79 |
+
converters['G'] = function(flags,width,precision,arg)
|
80 |
+
{ return (converters['g'](flags,width,precision,arg)).toUpperCase();
|
81 |
+
}
|
82 |
+
converters['g'] = function(flags,width,precision,arg)
|
83 |
+
{ iPrecision = parseInt(precision);
|
84 |
+
absArg = Math.abs(arg);
|
85 |
+
rse = absArg.toExponential();
|
86 |
+
rsf = absArg.toFixed(6);
|
87 |
+
if(!isNaN(iPrecision))
|
88 |
+
{ rsep = absArg.toExponential(iPrecision);
|
89 |
+
rse = rsep.length < rse.length ? rsep : rse;
|
90 |
+
rsfp = absArg.toFixed(iPrecision);
|
91 |
+
rsf = rsfp.length < rsf.length ? rsfp : rsf;
|
92 |
+
}
|
93 |
+
if(rse.indexOf('.')<0 && flags.indexOf('#')>=0) rse = rse.replace(/^(.*)(e.*)$/,'$1.$2');
|
94 |
+
if(rsf.indexOf('.')<0 && flags.indexOf('#')>=0) rsf = rsf + '.';
|
95 |
+
rs = rse.length<rsf.length ? rse : rsf;
|
96 |
+
return processFlags(flags,width,rs,arg);
|
97 |
+
}
|
98 |
+
converters['o'] = function(flags,width,precision,arg)
|
99 |
+
{ var iPrecision=parseInt(precision);
|
100 |
+
var rs = Math.round(Math.abs(arg)).toString(8);
|
101 |
+
if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
|
102 |
+
if(flags.indexOf('#')>=0) rs='0'+rs;
|
103 |
+
return processFlags(flags,width,rs,arg);
|
104 |
+
}
|
105 |
+
converters['X'] = function(flags,width,precision,arg)
|
106 |
+
{ return (converters['x'](flags,width,precision,arg)).toUpperCase();
|
107 |
+
}
|
108 |
+
converters['x'] = function(flags,width,precision,arg)
|
109 |
+
{ var iPrecision=parseInt(precision);
|
110 |
+
arg = Math.abs(arg);
|
111 |
+
var rs = Math.round(arg).toString(16);
|
112 |
+
if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
|
113 |
+
if(flags.indexOf('#')>=0) rs='0x'+rs;
|
114 |
+
return processFlags(flags,width,rs,arg);
|
115 |
+
}
|
116 |
+
converters['s'] = function(flags,width,precision,arg)
|
117 |
+
{ var iPrecision=parseInt(precision);
|
118 |
+
var rs = arg;
|
119 |
+
if(rs.length > iPrecision) rs = rs.substring(0,iPrecision);
|
120 |
+
return processFlags(flags,width,rs,0);
|
121 |
+
}
|
122 |
+
farr = fstring.split('%');
|
123 |
+
retstr = farr[0];
|
124 |
+
fpRE = /^([-+ #]*)(\d*)\.?(\d*)([cdieEfFgGosuxX])(.*)$/;
|
125 |
+
for(var i=1; i<farr.length; i++)
|
126 |
+
{ fps=fpRE.exec(farr[i]);
|
127 |
+
if(!fps) continue;
|
128 |
+
if(arguments[i]!=null) retstr+=converters[fps[4]](fps[1],fps[2],fps[3],arguments[i]);
|
129 |
+
retstr += fps[5];
|
130 |
+
}
|
131 |
+
return retstr;
|
132 |
+
}
|
133 |
+
/* Function sprintf() END */
|
js/overlibmws/square.gif
ADDED
Binary file
|
js/transposh.js
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
2 |
+
*
|
3 |
+
* This program is free software; you can redistribute it and/or modify
|
4 |
+
* it under the terms of the GNU General Public License as published by
|
5 |
+
* the Free Software Foundation; either version 2 of the License, or
|
6 |
+
* (at your option) any later version.
|
7 |
+
*
|
8 |
+
* This program is distributed in the hope that it will be useful,
|
9 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11 |
+
* GNU General Public License for more details.
|
12 |
+
*
|
13 |
+
* You should have received a copy of the GNU General Public License
|
14 |
+
* along with this program; if not, write to the Free Software
|
15 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
16 |
+
*/
|
17 |
+
function display_dialog(caption, content)
|
18 |
+
{
|
19 |
+
overlib(content,
|
20 |
+
MODAL,
|
21 |
+
MODALCOLOR, '#4488dd',
|
22 |
+
MODALOPACITY, 20,
|
23 |
+
MODALSCROLL,
|
24 |
+
CAPTION, caption,
|
25 |
+
CGCLASS, 'olraisedBlue',
|
26 |
+
CLOSETEXT, 'Close',
|
27 |
+
CLOSECLICK,
|
28 |
+
CLOSETITLE,'Close',
|
29 |
+
CAPTIONPADDING,4,
|
30 |
+
TEXTPADDING,14,
|
31 |
+
BGCLASS,'olbgD',
|
32 |
+
CAPTIONFONTCLASS,'olcapD',
|
33 |
+
FGCLASS,'olfgD',
|
34 |
+
TEXTFONTCLASS,'oltxtD',
|
35 |
+
SHADOW, SHADOWCOLOR, '#113377', SHADOWOPACITY, 20,
|
36 |
+
WRAP, STICKY, SCROLL, MIDX,0, MIDY,0);
|
37 |
+
}
|
38 |
+
|
39 |
+
//Show tooltip over a translated text
|
40 |
+
function hint(original)
|
41 |
+
{
|
42 |
+
overlib('<bdo dir="ltr">'+ original +'</bdo>',
|
43 |
+
FGCLASS,'olfgD',
|
44 |
+
TEXTFONTCLASS,'oltxtD',
|
45 |
+
AUTOSTATUS,WRAP);
|
46 |
+
}
|
47 |
+
|
48 |
+
//Open translation dialog
|
49 |
+
function translate_dialog(original, trans, lang, post_url)
|
50 |
+
{
|
51 |
+
caption='Edit Translation';
|
52 |
+
|
53 |
+
//TODO accept the action url as a parameter
|
54 |
+
var dialog = ''+
|
55 |
+
('<form name="transposh_edit_form" method="post" action="' + post_url + '"><div>') +
|
56 |
+
'<p dir="ltr">Original text<br \/><textarea cols="60" rows="3" readonly="readyonly">' +
|
57 |
+
original + '</textarea> <\/p>' +
|
58 |
+
'<p>Translate to<br \/><input type="text" name="translation" size="80" value="'+ trans + '"' + 'onfocus="OLmEdit=1;" onblur="OLmEdit=0;"<\/p>' +
|
59 |
+
'<input type="hidden" name="original" value="'+escape(original)+'">' +
|
60 |
+
'<input type="hidden" name="lang" value="'+lang+'">' +
|
61 |
+
'<input type="hidden" name="translation_posted" value= "1">' +
|
62 |
+
'<p><input type="submit" value="Translate"><\/p>' +
|
63 |
+
('<\/div><\/form>');
|
64 |
+
|
65 |
+
display_dialog(caption, dialog);
|
66 |
+
}
|
parser.php
ADDED
@@ -0,0 +1,687 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
3 |
+
*
|
4 |
+
* This program is free software; you can redistribute it and/or modify
|
5 |
+
* it under the terms of the GNU General Public License as published by
|
6 |
+
* the Free Software Foundation; either version 2 of the License, or
|
7 |
+
* (at your option) any later version.
|
8 |
+
*
|
9 |
+
* This program is distributed in the hope that it will be useful,
|
10 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
* GNU General Public License for more details.
|
13 |
+
*
|
14 |
+
* You should have received a copy of the GNU General Public License
|
15 |
+
* along with this program; if not, write to the Free Software
|
16 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
/*
|
20 |
+
* Contains the core functionality of the html parser. I.e. break into translation segments,
|
21 |
+
* fetch translation and update the translated page.
|
22 |
+
* This file should include only general purpose parser functionality while using callbacks
|
23 |
+
* to obtain WorkdPress specific capabilities, e.g. db access.
|
24 |
+
*/
|
25 |
+
|
26 |
+
require_once("constants.php");
|
27 |
+
|
28 |
+
//The language to which the current page will be translated to.
|
29 |
+
$lang;
|
30 |
+
|
31 |
+
//The html page which starts contains the content being translated
|
32 |
+
$page;
|
33 |
+
|
34 |
+
//Marks the current position of the translation process within the page
|
35 |
+
$pos = 0;
|
36 |
+
|
37 |
+
//Contains the stack of tag in the current position within the page
|
38 |
+
$tags_list = array();
|
39 |
+
|
40 |
+
//The translated html page
|
41 |
+
$tr_page;
|
42 |
+
|
43 |
+
//Points to the last character that have been copied from the original to the translated page.
|
44 |
+
$tr_mark = 0;
|
45 |
+
|
46 |
+
//Is the current use is in edit mode.
|
47 |
+
$is_edit_mode = FALSE;
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
/*
|
52 |
+
* Parse the html page into tags, identify translateable string which
|
53 |
+
* will be translated.
|
54 |
+
*/
|
55 |
+
function process_html()
|
56 |
+
{
|
57 |
+
|
58 |
+
|
59 |
+
global $page, $tr_page, $pos, $tags_list, $lang;
|
60 |
+
$no_translate = 0;
|
61 |
+
|
62 |
+
while($pos < strlen($page))
|
63 |
+
{
|
64 |
+
//find beginning of next tag
|
65 |
+
$pos = strpos($page, '<', $pos);
|
66 |
+
if($pos === FALSE)
|
67 |
+
{
|
68 |
+
//
|
69 |
+
break;
|
70 |
+
}
|
71 |
+
$pos++;
|
72 |
+
|
73 |
+
//Get the element identifying this tag
|
74 |
+
$element = get_element();
|
75 |
+
|
76 |
+
if(should_skip_element($element))
|
77 |
+
{
|
78 |
+
//do nothing
|
79 |
+
}
|
80 |
+
else
|
81 |
+
{
|
82 |
+
//Mark tag start position
|
83 |
+
$tag_start = $pos;
|
84 |
+
|
85 |
+
//skip to the '>' marking the end of the element
|
86 |
+
$pos = strpos($page, '>', $pos);
|
87 |
+
|
88 |
+
//Mark tag end position
|
89 |
+
$tag_end = $pos;
|
90 |
+
|
91 |
+
if($page[$pos-1] == '/')
|
92 |
+
{
|
93 |
+
//single line tag - no need to update tags list
|
94 |
+
process_tag_init($element, $tag_start, $tag_end);
|
95 |
+
}
|
96 |
+
else if($element[0] != '/')
|
97 |
+
{
|
98 |
+
if(!$no_translate)
|
99 |
+
{
|
100 |
+
process_tag_init($element, $tag_start, $tag_end);
|
101 |
+
}
|
102 |
+
|
103 |
+
$tags_list[] = $element;
|
104 |
+
|
105 |
+
//Look for the no translate class
|
106 |
+
if(stripos($element, NO_TRANSLATE_CLASS) !== FALSE)
|
107 |
+
{
|
108 |
+
$no_translate++;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
else
|
112 |
+
{
|
113 |
+
$popped_element = array_pop($tags_list);
|
114 |
+
if(!$no_translate)
|
115 |
+
{
|
116 |
+
process_tag_termination($element);
|
117 |
+
}
|
118 |
+
|
119 |
+
//Look for the no translate class
|
120 |
+
if(stripos($popped_element, NO_TRANSLATE_CLASS) !== FALSE)
|
121 |
+
{
|
122 |
+
$no_translate--;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
$pos++;
|
127 |
+
|
128 |
+
//skip processing while enclosed within a tag marked by no_translate
|
129 |
+
if(!$no_translate)
|
130 |
+
{
|
131 |
+
process_current_tag();
|
132 |
+
}
|
133 |
+
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
if(strlen($tr_page) > 0)
|
138 |
+
{
|
139 |
+
//Some translation has been taken place. Complete the translated
|
140 |
+
//page up to the full contents of the original page.
|
141 |
+
update_translated_page(strlen($page), -1, "");
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
/*
|
149 |
+
* Determine if the specified element should be skipped. If so the position
|
150 |
+
* is moved past end of tag.
|
151 |
+
* Return TRUE if element is skipped otherwise FALSE.
|
152 |
+
*/
|
153 |
+
function should_skip_element(&$element)
|
154 |
+
{
|
155 |
+
global $page, $pos;
|
156 |
+
$rc = TRUE;
|
157 |
+
|
158 |
+
if(strncmp($element, "!DOCTYPE", 8) == 0)
|
159 |
+
{
|
160 |
+
$pos = strpos($page, '>', $pos);
|
161 |
+
}
|
162 |
+
else if(strncmp($element, "!--", 3) == 0)
|
163 |
+
{
|
164 |
+
$pos = strpos($page, '-->', $pos);
|
165 |
+
}
|
166 |
+
else
|
167 |
+
{
|
168 |
+
$rc = FALSE;
|
169 |
+
}
|
170 |
+
|
171 |
+
return $rc;
|
172 |
+
}
|
173 |
+
|
174 |
+
/*
|
175 |
+
* Process tag init for the specified element, with the current start and
|
176 |
+
* end positions within the page buffer.
|
177 |
+
*/
|
178 |
+
function process_tag_init(&$element, $start, $end)
|
179 |
+
{
|
180 |
+
switch ($element)
|
181 |
+
{
|
182 |
+
case 'a':
|
183 |
+
process_anchor_tag($start, $end);
|
184 |
+
break;
|
185 |
+
case 'div' :
|
186 |
+
case 'span':
|
187 |
+
process_span_or_div_tag($element, $start, $end);
|
188 |
+
break;
|
189 |
+
case 'html':
|
190 |
+
process_html_tag($start, $end);
|
191 |
+
break;
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
/*
|
199 |
+
* Handle span tags. Looks for 'no_tranlate' identifier that will disable
|
200 |
+
* translation for the enclosed text.
|
201 |
+
*
|
202 |
+
*/
|
203 |
+
function process_span_or_div_tag(&$element, $start, $end)
|
204 |
+
{
|
205 |
+
|
206 |
+
$cls = get_attribute($start, $end, 'class');
|
207 |
+
|
208 |
+
if($cls == NULL)
|
209 |
+
{
|
210 |
+
return;
|
211 |
+
}
|
212 |
+
|
213 |
+
//Look for the no translate class
|
214 |
+
if(stripos($cls, NO_TRANSLATE_CLASS) === FALSE)
|
215 |
+
{
|
216 |
+
return;
|
217 |
+
}
|
218 |
+
|
219 |
+
//Mark the element as not translatable
|
220 |
+
$element .= "." . NO_TRANSLATE_CLASS;
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
/*
|
225 |
+
* Process html tag. Set the direction for rtl languages.
|
226 |
+
*
|
227 |
+
*/
|
228 |
+
function process_html_tag($start, $end)
|
229 |
+
{
|
230 |
+
global $lang, $rtl_languages;
|
231 |
+
|
232 |
+
if(!(in_array ($lang, $rtl_languages)))
|
233 |
+
{
|
234 |
+
return;
|
235 |
+
}
|
236 |
+
|
237 |
+
$dir = get_attribute($start, $end, 'dir');
|
238 |
+
|
239 |
+
if($dir == NULL)
|
240 |
+
{
|
241 |
+
|
242 |
+
//attribute does not exist - add it
|
243 |
+
update_translated_page($end, -1, 'dir="rtl"');
|
244 |
+
}
|
245 |
+
else
|
246 |
+
{
|
247 |
+
$dir = 'rtl';
|
248 |
+
|
249 |
+
//rewrite url in translated page
|
250 |
+
update_translated_page($start, $end, $dir);
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
+
/*
|
258 |
+
* Process tag termination.
|
259 |
+
* Note: The current position in buffer points to the '>' character
|
260 |
+
*/
|
261 |
+
function process_tag_termination(&$element)
|
262 |
+
{
|
263 |
+
global $pos, $tags_list, $page;
|
264 |
+
|
265 |
+
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
/*
|
270 |
+
* Return the element id within the current tag.
|
271 |
+
*/
|
272 |
+
function get_element()
|
273 |
+
{
|
274 |
+
|
275 |
+
global $page, $pos;
|
276 |
+
|
277 |
+
skip_white_space();
|
278 |
+
|
279 |
+
$start = $pos;
|
280 |
+
|
281 |
+
//keep scanning till the first white space or the '>' mark
|
282 |
+
while($pos < strlen($page) && $page[$pos] != ' '&&
|
283 |
+
$page[$pos] != '>' && $page[$pos] != '\t')
|
284 |
+
{
|
285 |
+
$pos++;
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
return substr($page,$start, $pos - $start);
|
290 |
+
}
|
291 |
+
|
292 |
+
/*
|
293 |
+
* Search for the given attribute within the limit of the start and
|
294 |
+
* end position within the buffer.
|
295 |
+
* Returns the string containing the attribute if available otherwise NULL.
|
296 |
+
* In addition the start and end position are moved to boundaries of the
|
297 |
+
* attribute's value.
|
298 |
+
*/
|
299 |
+
function get_attribute(&$start, &$end, $id)
|
300 |
+
{
|
301 |
+
global $page;
|
302 |
+
|
303 |
+
//look for the id within the given limits.
|
304 |
+
while($start < $end)
|
305 |
+
{
|
306 |
+
$index = 0;
|
307 |
+
|
308 |
+
while($start < $end && $page[$start + $index] == $id[$index]
|
309 |
+
&& $index < strlen($id))
|
310 |
+
{
|
311 |
+
$index++;
|
312 |
+
}
|
313 |
+
|
314 |
+
if($index == strlen($id))
|
315 |
+
{
|
316 |
+
//we have match
|
317 |
+
break;
|
318 |
+
}
|
319 |
+
|
320 |
+
$start++;
|
321 |
+
}
|
322 |
+
|
323 |
+
if($start == $end)
|
324 |
+
{
|
325 |
+
return NULL;
|
326 |
+
}
|
327 |
+
|
328 |
+
//look for the " or ' marking start of attribute's value
|
329 |
+
while($start < $end && $page[$start] != '"' && $page[$start] != "'")
|
330 |
+
{
|
331 |
+
$start++;
|
332 |
+
}
|
333 |
+
|
334 |
+
$start++;
|
335 |
+
if($start >= $end)
|
336 |
+
{
|
337 |
+
return NULL;
|
338 |
+
}
|
339 |
+
|
340 |
+
$tmp = $start + 1;
|
341 |
+
//look for the " or ' marking the end of attribute's value
|
342 |
+
while($tmp < $end && $page[$tmp] != '"' && $page[$tmp] != "'")
|
343 |
+
{
|
344 |
+
$tmp++;
|
345 |
+
}
|
346 |
+
|
347 |
+
$end = $tmp - 1;
|
348 |
+
|
349 |
+
|
350 |
+
return substr($page, $start, $end - $start + 1);
|
351 |
+
}
|
352 |
+
|
353 |
+
/*
|
354 |
+
* Attempt to process the content of the tag (if exists). If the current
|
355 |
+
* is of a type that need translation then translate, otherwise skip.
|
356 |
+
*
|
357 |
+
*/
|
358 |
+
function process_current_tag()
|
359 |
+
{
|
360 |
+
global $page, $pos, $tags_list;
|
361 |
+
|
362 |
+
$current_tag = end($tags_list);
|
363 |
+
|
364 |
+
|
365 |
+
|
366 |
+
//translate only specific elements - <a> or <div>
|
367 |
+
if($current_tag == 'a' || $current_tag == 'title' ||
|
368 |
+
array_search('div', $tags_list))
|
369 |
+
{
|
370 |
+
skip_white_space();
|
371 |
+
$start = $pos;
|
372 |
+
|
373 |
+
while($pos < strlen($page) && $page[$pos] != '<')
|
374 |
+
{
|
375 |
+
//will break translation unit when one of the following characters is reached: .,
|
376 |
+
if(is_sentence_breaker($pos))
|
377 |
+
{
|
378 |
+
translate_text($start);
|
379 |
+
$pos++;
|
380 |
+
$start = $pos;
|
381 |
+
}
|
382 |
+
else if(($end_of_entity = is_html_entity($pos)))
|
383 |
+
{
|
384 |
+
translate_text($start);
|
385 |
+
$pos++;
|
386 |
+
$start = $end_of_entity;
|
387 |
+
}
|
388 |
+
else
|
389 |
+
{
|
390 |
+
$pos++;
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
if($pos > $start)
|
395 |
+
{
|
396 |
+
translate_text($start);
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
/*
|
404 |
+
* Determine if the current position in buffer is a sentence breaker, e.g. '.' or ',' .
|
405 |
+
* Note html markups are not considered sentence breaker within the scope of this function.
|
406 |
+
* Return TRUE is current position marks a break in sentence otherwise FALSE
|
407 |
+
*/
|
408 |
+
function is_sentence_breaker($position)
|
409 |
+
{
|
410 |
+
global $page;
|
411 |
+
$rc = FALSE;
|
412 |
+
|
413 |
+
if($page[$position] == '.' || $page[$position] == '-')
|
414 |
+
{
|
415 |
+
//Only break if the next character is a white space,
|
416 |
+
//in order to avoid breaks on cases like this: (hello world.)
|
417 |
+
if(is_white_space($position + 1) || $page[$position + 1] == '<')
|
418 |
+
{
|
419 |
+
$rc = TRUE;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
else if($page[$position] == ',' || $page[$position] == '?' ||
|
423 |
+
$page[$position] == '(' || $page[$position] == ')' ||
|
424 |
+
$page[$position] == '[' || $page[$position] == ']' ||
|
425 |
+
$page[$position] == '"' || $page[$position] == '!' ||
|
426 |
+
$page[$position] == ':' || $page[$position] == '|')
|
427 |
+
{
|
428 |
+
//break the sentence into segments regardless of the next character.
|
429 |
+
$rc = TRUE;
|
430 |
+
}
|
431 |
+
|
432 |
+
return $rc;
|
433 |
+
}
|
434 |
+
|
435 |
+
/*
|
436 |
+
* Determines if the current position marks the begining of an html
|
437 |
+
* entity. E.g &
|
438 |
+
* Return 0 if not an html entity otherwise return the position past this
|
439 |
+
* entity.
|
440 |
+
*
|
441 |
+
*/
|
442 |
+
function is_html_entity($position)
|
443 |
+
{
|
444 |
+
global $page;
|
445 |
+
if($page[$position] == "&" )
|
446 |
+
{
|
447 |
+
$end_pos = $position + 1;
|
448 |
+
|
449 |
+
while($page[$end_pos] == "#" ||
|
450 |
+
is_digit($end_pos) || is_a_to_z_character($end_pos))
|
451 |
+
{
|
452 |
+
$end_pos++;
|
453 |
+
}
|
454 |
+
|
455 |
+
if($page[$end_pos] == ';')
|
456 |
+
{
|
457 |
+
$entity = substr($page, $position, $end_pos - $position + 1);
|
458 |
+
|
459 |
+
//Don't break on ` so for our use we don't consider it an entity
|
460 |
+
//e.g. Jack`s apple
|
461 |
+
if($entity == "’" || $entity == "'")
|
462 |
+
{
|
463 |
+
return 0;
|
464 |
+
}
|
465 |
+
|
466 |
+
//It is an html entity.
|
467 |
+
return $end_pos + 1;
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
471 |
+
return 0;
|
472 |
+
}
|
473 |
+
|
474 |
+
|
475 |
+
/*
|
476 |
+
* Determine if the current position in page points to a character in the
|
477 |
+
* range of a-z (case insensetive).
|
478 |
+
* Return TRUE if a-z otherwise FALSE
|
479 |
+
*
|
480 |
+
*/
|
481 |
+
|
482 |
+
function is_a_to_z_character($position)
|
483 |
+
{
|
484 |
+
global $page;
|
485 |
+
|
486 |
+
if(($page[$position] >= 'a' && $page[$position] <= 'z') ||
|
487 |
+
($page[$position] >= 'A' && $page[$position] <= 'Z'))
|
488 |
+
{
|
489 |
+
return TRUE;
|
490 |
+
}
|
491 |
+
|
492 |
+
return FALSE;
|
493 |
+
}
|
494 |
+
|
495 |
+
/*
|
496 |
+
* Determine if the current position is a number.
|
497 |
+
* Return TRUE if a number otherwise FALSE
|
498 |
+
*/
|
499 |
+
function is_digit($position)
|
500 |
+
{
|
501 |
+
global $page;
|
502 |
+
|
503 |
+
if($page[$position] >= '0' && $page[$position] <= '9')
|
504 |
+
{
|
505 |
+
return TRUE;
|
506 |
+
}
|
507 |
+
|
508 |
+
return FALSE;
|
509 |
+
}
|
510 |
+
|
511 |
+
/*
|
512 |
+
* Determine if the current position in buffer is a white space.
|
513 |
+
* return TRUE if current position marks a white space otherwise FALSE.
|
514 |
+
*/
|
515 |
+
function is_white_space($position)
|
516 |
+
{
|
517 |
+
global $page;
|
518 |
+
|
519 |
+
if($page[$position] == " " || $page[$position] == "" ||
|
520 |
+
$page[$position] == "\t" || $page[$position] == "\r" ||
|
521 |
+
$page[$position] == "\n" || $page[$position] == "\x0B" ||
|
522 |
+
$page[$position] == "\0")
|
523 |
+
{
|
524 |
+
return TRUE;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
/*
|
529 |
+
* Skip within buffer past unreadable characters , i.e. white space
|
530 |
+
* and characters considred to be a sentence breaker. Staring from the specified
|
531 |
+
* position going either forward or backward.
|
532 |
+
* param forward - indicate direction going either backward of forward.
|
533 |
+
*/
|
534 |
+
function skip_unreadable_chars(&$index, $forward=TRUE)
|
535 |
+
{
|
536 |
+
global $page, $pos;
|
537 |
+
|
538 |
+
if(!isset($index))
|
539 |
+
{
|
540 |
+
//use $pos as the default position if not specified otherwise
|
541 |
+
$index = &$pos;
|
542 |
+
}
|
543 |
+
$start = $index;
|
544 |
+
|
545 |
+
while($index < strlen($page) && $index > 0 &&
|
546 |
+
(is_white_space($index) || is_sentence_breaker($index)))
|
547 |
+
{
|
548 |
+
($forward ? $index++ : $index--);
|
549 |
+
}
|
550 |
+
|
551 |
+
return $index;
|
552 |
+
}
|
553 |
+
|
554 |
+
/*
|
555 |
+
* Skip within buffer past white space characters , Staring from the specified
|
556 |
+
* position going either forward or backward.
|
557 |
+
* param forward - indicate direction going either backward of forward.
|
558 |
+
*/
|
559 |
+
function skip_white_space(&$index, $forward=TRUE)
|
560 |
+
{
|
561 |
+
global $page, $pos;
|
562 |
+
|
563 |
+
if(!isset($index))
|
564 |
+
{
|
565 |
+
//use $pos as the default position if not specified otherwise
|
566 |
+
$index = &$pos;
|
567 |
+
}
|
568 |
+
|
569 |
+
while($index < strlen($page) && $index > 0 && is_white_space($index))
|
570 |
+
{
|
571 |
+
($forward ? $index++ : $index--);
|
572 |
+
}
|
573 |
+
|
574 |
+
return $index;
|
575 |
+
}
|
576 |
+
|
577 |
+
/**
|
578 |
+
* Translate the text between the given start position and the current
|
579 |
+
* position (pos) within the buffer.
|
580 |
+
*/
|
581 |
+
function translate_text($start)
|
582 |
+
{
|
583 |
+
|
584 |
+
global $page, $pos, $is_edit_mode;
|
585 |
+
|
586 |
+
//trim white space from the start position going forward
|
587 |
+
skip_white_space($start);
|
588 |
+
|
589 |
+
//Set the end position of the string to one back from current position
|
590 |
+
//(i.e. current position points to '<' or a breaker '.') and then trim
|
591 |
+
//white space from the right backwards
|
592 |
+
$end = $pos - 1;
|
593 |
+
$end = skip_white_space($end, $forward=FALSE);
|
594 |
+
|
595 |
+
if($start >= $end)
|
596 |
+
{
|
597 |
+
//empty string - nothing to do
|
598 |
+
return;
|
599 |
+
}
|
600 |
+
|
601 |
+
$original_text = substr($page, $start, $end - $start + 1);
|
602 |
+
|
603 |
+
//Cleanup and prepare text
|
604 |
+
$original_text = scrub_text($original_text);
|
605 |
+
if($original_text == NULL)
|
606 |
+
{
|
607 |
+
//nothing left from the text
|
608 |
+
return;
|
609 |
+
}
|
610 |
+
|
611 |
+
$is_translated = FALSE;
|
612 |
+
$translated_text = fetch_translation($original_text);
|
613 |
+
if($translated_text != NULL)
|
614 |
+
{
|
615 |
+
|
616 |
+
$translated_text = htmlspecialchars($translated_text);
|
617 |
+
update_translated_page($start, $end, $translated_text);
|
618 |
+
$is_translated = TRUE;
|
619 |
+
}
|
620 |
+
|
621 |
+
if($is_edit_mode)
|
622 |
+
{
|
623 |
+
$img = get_img_tag($original_text, $translated_text, $is_translated);
|
624 |
+
update_translated_page($end + 1, - 1, $img);
|
625 |
+
}
|
626 |
+
|
627 |
+
|
628 |
+
}
|
629 |
+
|
630 |
+
|
631 |
+
/*
|
632 |
+
* Scrubs text prior to translation to remove/encode special
|
633 |
+
* characters.
|
634 |
+
* Return the scurbed text, or NULL if nothing left to translate
|
635 |
+
*/
|
636 |
+
function scrub_text(&$text)
|
637 |
+
{
|
638 |
+
//skip strings like without any readable characters (i.e. ".")
|
639 |
+
//Todo: need a broader defintion for non-ascii characters as well
|
640 |
+
if(preg_match("/^[.?!|\(\)\[\],0-9]+$/", $text))
|
641 |
+
{
|
642 |
+
return NULL;
|
643 |
+
}
|
644 |
+
|
645 |
+
//replace multi space chars with a single space
|
646 |
+
$text = preg_replace("/\s\s+/", " ", $text);
|
647 |
+
|
648 |
+
//Make that the string is encoded in the same way as it will
|
649 |
+
//decoded, when passed back for translation (i.e. post)
|
650 |
+
$text = htmlspecialchars($text);
|
651 |
+
|
652 |
+
return $text;
|
653 |
+
}
|
654 |
+
|
655 |
+
|
656 |
+
/**
|
657 |
+
* Insert a translated text to the translated page.
|
658 |
+
* Currentlly assume that we always insert and move forward - not moving
|
659 |
+
* back in buffer.
|
660 |
+
* param start - marks the starting position of the replaced string in the original page.
|
661 |
+
* param end - marks the end position of the replaced string in the original page.
|
662 |
+
Use -1 to do insert instead of replace.
|
663 |
+
* param translated_text - text to be inserted.
|
664 |
+
*/
|
665 |
+
function update_translated_page($start, $end, $translated_text)
|
666 |
+
{
|
667 |
+
global $page, $tr_page, $tr_mark;
|
668 |
+
|
669 |
+
//Bring the translated up to date up to the start position.
|
670 |
+
while($tr_mark < $start)
|
671 |
+
{
|
672 |
+
$tr_page .= $page[$tr_mark++];
|
673 |
+
}
|
674 |
+
|
675 |
+
$tr_page .= $translated_text;
|
676 |
+
|
677 |
+
if($end > $start)
|
678 |
+
{
|
679 |
+
//Move mark to correlate the posistion between the two pages.
|
680 |
+
//Only do this when some content has been replaced, i.e. not
|
681 |
+
//an insert.
|
682 |
+
$tr_mark = $end + 1;
|
683 |
+
}
|
684 |
+
|
685 |
+
}
|
686 |
+
|
687 |
+
?>
|
readme.txt
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Transposh - translation filter for wordpress ===
|
2 |
+
Contributors: oferwald
|
3 |
+
Donate link: http://transposh.org/
|
4 |
+
Tags: translation, widget, filter, bilingual, multilingual, transposh, language, RTL, Hebrew, Spanish, French, Russian, crowdsourcing, context, wiki
|
5 |
+
Requires at least: 2.5
|
6 |
+
Tested up to: 2.7.1
|
7 |
+
Stable tag: 0.0.1
|
8 |
+
|
9 |
+
Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
Transposh translation filter for WordPress offers a unique approach to blog translation. It allows your blog to be translated by your readers in-context.
|
13 |
+
|
14 |
+
***The following features are supported:***
|
15 |
+
|
16 |
+
* Support for any language - including RTL/LTR
|
17 |
+
* Unique interface for choosing viewable/translatable languages
|
18 |
+
* Multiple selection for widget appearances
|
19 |
+
* Translation of external plugins with no changes
|
20 |
+
* Fine grained control for advanced users
|
21 |
+
|
22 |
+
***We are focused on:***
|
23 |
+
|
24 |
+
* **Performance** - very fast - using APC cache if available
|
25 |
+
* **Support** - you want it - we'll implement it, visit our trac site http://trac.transposh.org
|
26 |
+
* **Security** - we have externally audited the plugin for improved security
|
27 |
+
* **Ease of Use** - making translation as fun and as easy as possible
|
28 |
+
* **SEO Optimization** - your site content will be available in all languages via search engines
|
29 |
+
|
30 |
+
Technology has been tested on a large dynamic site with millions of monthly page views. Feel free to visit [ColNect](http://colnect.com "website for collectors").
|
31 |
+
|
32 |
+
== Installation ==
|
33 |
+
|
34 |
+
1. Upload the plugin to the `/wp-content/plugins/` directory
|
35 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
36 |
+
1. Add the widget to your side bar, decide which interface you prefer
|
37 |
+
1. On the settings page - define which languages you would like viewable, translatable and which language is currently used (default)
|
38 |
+
1. You are good to go
|
39 |
+
|
40 |
+
== Frequently Asked Questions ==
|
41 |
+
|
42 |
+
= My requested language does not appear on the list =
|
43 |
+
|
44 |
+
You can edit the constants.php and add a line to the languages array, or just contact us to add your language
|
45 |
+
|
46 |
+
= I am using the flag interface and would like to change the flag used for some language =
|
47 |
+
|
48 |
+
In the languages array in the constants.php file change the two letter ISO code used for the flag
|
49 |
+
|
50 |
+
= I have a feature to suggest =
|
51 |
+
|
52 |
+
The correct place for that would be our [development site](http://trac.transposh.com "ticket system")
|
53 |
+
|
54 |
+
= The interface looks messed up =
|
55 |
+
|
56 |
+
Another .css file might intervene with our in ways we didn't predict yet, either fix that .css alone or contact us
|
57 |
+
|
58 |
+
= Why should I allow anonymous translation =
|
59 |
+
|
60 |
+
Wiki has proven itself quite a valid model on the Internet. More people have good intentions than bad intentions and that can be
|
61 |
+
harnessed to get your message out to more people. Future versions will give more focus on preventing spammers from defacing sites
|
62 |
+
|
63 |
+
|
64 |
+
== Screenshots ==
|
65 |
+
|
66 |
+
1. This is a screen shot of a site using Transposh widget on the sidebar
|
67 |
+
2. This is the same site, translated to Hebrew
|
68 |
+
3. A look at the translation interface
|
69 |
+
4. Management of languages in the settings page
|
70 |
+
5. Widget style selection
|
71 |
+
|
72 |
+
== Release notes ==
|
73 |
+
|
74 |
+
09/02/28 - 0.0.1 - Initial release
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
screenshot-5.png
ADDED
Binary file
|
translate.png
ADDED
Binary file
|
translate_fix.png
ADDED
Binary file
|
transposh.css
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style type='text/css'>
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Overlibmws library - For the dialog popups
|
5 |
+
*/
|
6 |
+
|
7 |
+
/*
|
8 |
+
* Fix collisions with some themes
|
9 |
+
*/
|
10 |
+
|
11 |
+
#overDiv {
|
12 |
+
border: 0px;
|
13 |
+
text-align:center;
|
14 |
+
margin: 0px;
|
15 |
+
padding: 0px;}
|
16 |
+
|
17 |
+
#overDiv table {
|
18 |
+
border: 0px;
|
19 |
+
text-align:center;
|
20 |
+
margin: 0px;
|
21 |
+
padding: 0px;}
|
22 |
+
|
23 |
+
#overDiv table th, #overDiv table td {
|
24 |
+
border: 0px;
|
25 |
+
text-align:center;
|
26 |
+
margin: 0px;
|
27 |
+
padding: 1px;}
|
28 |
+
|
29 |
+
#overDiv table tr:hover {
|
30 |
+
background-color:#225588;}
|
31 |
+
|
32 |
+
/*
|
33 |
+
* Define our styling
|
34 |
+
*/
|
35 |
+
|
36 |
+
.olbgD {
|
37 |
+
background-color:#225588;}
|
38 |
+
|
39 |
+
.olcgD {
|
40 |
+
background-color:#336699;
|
41 |
+
text-align:center;}
|
42 |
+
|
43 |
+
.olfgD {
|
44 |
+
background-color:#bbddff;
|
45 |
+
text-align:center;}
|
46 |
+
|
47 |
+
.olcapD {font-family:Verdana,Arial,
|
48 |
+
Helvetica,sans-serif;
|
49 |
+
font-size:11px;
|
50 |
+
font-weight:bold;
|
51 |
+
color:#ffffff;}
|
52 |
+
|
53 |
+
.olcloD {
|
54 |
+
font-family:Verdana,Arial,
|
55 |
+
Helvetica,sans-serif;
|
56 |
+
font-size:11px;
|
57 |
+
color:#bbddff;
|
58 |
+
font-weight:bold;}
|
59 |
+
|
60 |
+
a.olcloD:hover {
|
61 |
+
color:#ddeeff;}
|
62 |
+
|
63 |
+
.oltxtD {
|
64 |
+
font-family:Verdana,
|
65 |
+
Arial,Helvetica,
|
66 |
+
sans-serif; font-size:13px;
|
67 |
+
color:#000000;}
|
68 |
+
|
69 |
+
.sep4 {
|
70 |
+
font-size:4px;
|
71 |
+
line-height:4px;}
|
72 |
+
|
73 |
+
/*
|
74 |
+
* Overlibmws library - popup with MODAL form
|
75 |
+
*/
|
76 |
+
|
77 |
+
.olraisedBlue {
|
78 |
+
text-align:center;
|
79 |
+
background:#33aaff url(raised_blue.gif) repeat-x bottom left;}
|
80 |
+
|
81 |
+
table.olraisedBlue {
|
82 |
+
border-bottom:1px solid #333399;}
|
83 |
+
|
84 |
+
.oltxtRaisedBlue {
|
85 |
+
font-family:Verdana;
|
86 |
+
font-size:14px;
|
87 |
+
font-weight:bold;
|
88 |
+
color:#ffffff;}
|
89 |
+
|
90 |
+
input.olinput {
|
91 |
+
background:white url(inputText.gif) repeat-x bottom left;
|
92 |
+
min-height:16px;
|
93 |
+
font-family:Verdana,Arial,Helvetica,sans-serif;
|
94 |
+
font-size:13px;
|
95 |
+
color: #000000;}
|
96 |
+
|
97 |
+
</style>
|
transposh.php
ADDED
@@ -0,0 +1,725 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Transposh Translation Filter
|
4 |
+
Plugin URI: http://transposh.org/#
|
5 |
+
Description: Translation filter for WordPress, After enabling please set languages at the <a href="options-general.php?page=Transposh">the options page</a> Want to help? visit our development site at <a href="http://trac.transposh.org/">trac.transposh.org</a>.
|
6 |
+
Author: Team Transposh
|
7 |
+
Version: 0.0.1
|
8 |
+
Author URI: http://transposh.org/
|
9 |
+
License: GPL (http://www.gnu.org/licenses/gpl.txt)
|
10 |
+
*/
|
11 |
+
|
12 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
13 |
+
*
|
14 |
+
* This program is free software; you can redistribute it and/or modify
|
15 |
+
* it under the terms of the GNU General Public License as published by
|
16 |
+
* the Free Software Foundation; either version 2 of the License, or
|
17 |
+
* (at your option) any later version.
|
18 |
+
*
|
19 |
+
* This program is distributed in the hope that it will be useful,
|
20 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
* GNU General Public License for more details.
|
23 |
+
*
|
24 |
+
* You should have received a copy of the GNU General Public License
|
25 |
+
* along with this program; if not, write to the Free Software
|
26 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
require_once("constants.php");
|
30 |
+
require_once("parser.php");
|
31 |
+
require_once("transposh_widget.php");
|
32 |
+
require_once("transposh_admin.php");
|
33 |
+
|
34 |
+
//
|
35 |
+
//Constants
|
36 |
+
//
|
37 |
+
|
38 |
+
//Table name in database for storing translations
|
39 |
+
define("TRANSLATIONS_TABLE", "translations");
|
40 |
+
define("TRANSLATIONS_LOG", "translations_log");
|
41 |
+
|
42 |
+
//Database version
|
43 |
+
define("DB_VERSION", "1.0");
|
44 |
+
|
45 |
+
//Constant used as key in options database
|
46 |
+
define("TRANSPOSH_DB_VERSION", "transposh_db_version");
|
47 |
+
|
48 |
+
//
|
49 |
+
// Global variables
|
50 |
+
//
|
51 |
+
|
52 |
+
//The full table name, i.e. prefix + name
|
53 |
+
$table_name;
|
54 |
+
|
55 |
+
//Home url of the blog
|
56 |
+
$home_url;
|
57 |
+
|
58 |
+
//Home url of the blog - already quoted and ready for regex
|
59 |
+
$home_url_quoted;
|
60 |
+
|
61 |
+
//The url pointing to the base of the plugin
|
62 |
+
$plugin_url;
|
63 |
+
|
64 |
+
//Error message displayed for the admin in case of failure
|
65 |
+
$admin_msg;
|
66 |
+
|
67 |
+
|
68 |
+
/*
|
69 |
+
* Called when the buffer containing the original page is flused. Triggers the
|
70 |
+
* translation process.
|
71 |
+
*
|
72 |
+
*/
|
73 |
+
function process_page(&$buffer) {
|
74 |
+
|
75 |
+
global $wp_query, $tr_page, $page, $pos, $lang, $plugin_url, $is_edit_mode, $wpdb,
|
76 |
+
$table_name;
|
77 |
+
|
78 |
+
$start_time = microtime(TRUE);
|
79 |
+
|
80 |
+
if (!isset($wp_query->query_vars[LANG_PARAM]))
|
81 |
+
{
|
82 |
+
//No language code - avoid further processing.
|
83 |
+
return $buffer;
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
$lang = $wp_query->query_vars[LANG_PARAM];
|
88 |
+
$default_lang = get_default_lang();
|
89 |
+
if($lang == $default_lang)
|
90 |
+
{
|
91 |
+
//Don't translate the default language
|
92 |
+
|
93 |
+
return $buffer;
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
$page = $buffer;
|
98 |
+
|
99 |
+
|
100 |
+
if (($wp_query->query_vars[EDIT_PARAM] == "1" ||
|
101 |
+
$wp_query->query_vars[EDIT_PARAM] == "true"))
|
102 |
+
{
|
103 |
+
//Verify that the current language is editable and that the
|
104 |
+
//user has the required permissions
|
105 |
+
$editable_langs = get_option(EDITABLE_LANGS);
|
106 |
+
|
107 |
+
if(is_translator() && strstr($editable_langs, $lang))
|
108 |
+
{
|
109 |
+
$is_edit_mode = TRUE;
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
//translate the entire page
|
117 |
+
process_html();
|
118 |
+
|
119 |
+
$end_time = microtime(TRUE);
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
//return the translated page unless it is empty, othewise return the original
|
124 |
+
return (strlen($tr_page) > 0 ? $tr_page : $page);
|
125 |
+
}
|
126 |
+
|
127 |
+
/*
|
128 |
+
* Fix links on the page. href needs to be modified to include
|
129 |
+
* lang specifier and editing mode.
|
130 |
+
*
|
131 |
+
*/
|
132 |
+
function process_anchor_tag($start, $end)
|
133 |
+
{
|
134 |
+
global $home_url, $home_url_quoted, $lang, $is_edit_mode, $wp_rewrite;
|
135 |
+
|
136 |
+
$href = get_attribute($start, $end, 'href');
|
137 |
+
|
138 |
+
if($href == NULL)
|
139 |
+
{
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
//Ignore urls not from this site
|
144 |
+
if(stripos($href, $home_url) === FALSE)
|
145 |
+
{
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
|
149 |
+
$use_params = FALSE;
|
150 |
+
|
151 |
+
//Only use params if permalinks are not enabled.
|
152 |
+
//don't fix links pointing to real files as it will cause that the
|
153 |
+
//web server will not be able to locate them
|
154 |
+
if(!$wp_rewrite->using_permalinks() ||
|
155 |
+
stripos($href, '/wp-admin') !== FALSE ||
|
156 |
+
stripos($href, '/wp-content') !== FALSE ||
|
157 |
+
stripos($href, '/wp-login') !== FALSE ||
|
158 |
+
stripos($href, '/.php') !== FALSE)
|
159 |
+
{
|
160 |
+
$use_params = TRUE;
|
161 |
+
}
|
162 |
+
|
163 |
+
$href = rewrite_url_lang_param($href, $lang, $is_edit_mode, $use_params);
|
164 |
+
|
165 |
+
//rewrite url in translated page
|
166 |
+
update_translated_page($start, $end, $href);
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
/*
|
172 |
+
* Update the given url to include language params.
|
173 |
+
* param url - the original url to rewrite
|
174 |
+
* param lang - language code
|
175 |
+
* param is_edit - is running in edit mode.
|
176 |
+
* param use_params_only - use only parameters as modifiers, i.e. not permalinks
|
177 |
+
*/
|
178 |
+
function rewrite_url_lang_param($url, $lang, $is_edit, $use_params_only)
|
179 |
+
{
|
180 |
+
global $home_url, $home_url_quoted;
|
181 |
+
|
182 |
+
if($is_edit)
|
183 |
+
{
|
184 |
+
$params = EDIT_PARAM . '=1&';
|
185 |
+
|
186 |
+
}
|
187 |
+
|
188 |
+
if($use_params_only)
|
189 |
+
{
|
190 |
+
$params .= LANG_PARAM . "=$lang&";
|
191 |
+
}
|
192 |
+
else
|
193 |
+
{
|
194 |
+
$url = preg_replace("/$home_url_quoted\/(..\/)?\/?/",
|
195 |
+
"$home_url/$lang/", $url);
|
196 |
+
}
|
197 |
+
|
198 |
+
if($params)
|
199 |
+
{
|
200 |
+
//insert params to url
|
201 |
+
$url = preg_replace("/(.+\/[^\?\#]*[\?]?)/", '$1?' . $params, $url);
|
202 |
+
|
203 |
+
//Cleanup extra &
|
204 |
+
$url = preg_replace("/&&+/", "&", $url);
|
205 |
+
|
206 |
+
//Cleanup extra ?
|
207 |
+
$url = preg_replace("/\?\?+/", "?", $url);
|
208 |
+
}
|
209 |
+
|
210 |
+
return $url;
|
211 |
+
}
|
212 |
+
|
213 |
+
/*
|
214 |
+
* Fetch translation from db or cache.
|
215 |
+
* Returns the translated string or NULL if not available.
|
216 |
+
*/
|
217 |
+
function fetch_translation($original)
|
218 |
+
{
|
219 |
+
global $wpdb, $lang, $table_name;
|
220 |
+
$translated = NULL;
|
221 |
+
|
222 |
+
|
223 |
+
if(ENABLE_APC && function_exists('apc_fetch'))
|
224 |
+
{
|
225 |
+
$cached = apc_fetch($original . $lang, $rc);
|
226 |
+
if($rc === TRUE)
|
227 |
+
{
|
228 |
+
return $cached;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
$query = "SELECT * FROM $table_name WHERE original = '$original' and lang = '$lang' ";
|
233 |
+
$row = $wpdb->get_row($query);
|
234 |
+
|
235 |
+
if($row !== FALSE)
|
236 |
+
{
|
237 |
+
$translated = $row->translated;
|
238 |
+
$translated = stripslashes($translated);
|
239 |
+
|
240 |
+
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
if(ENABLE_APC && function_exists('apc_store'))
|
245 |
+
{
|
246 |
+
//update cache
|
247 |
+
$rc = apc_store($original . $lang, $translated, 3600);
|
248 |
+
if($rc === TRUE)
|
249 |
+
{
|
250 |
+
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
|
255 |
+
return $translated;
|
256 |
+
}
|
257 |
+
|
258 |
+
/*
|
259 |
+
* Insert references to the javascript files used in the transalted
|
260 |
+
* version of the page.
|
261 |
+
*
|
262 |
+
*/
|
263 |
+
function insert_javascript_includes()
|
264 |
+
{
|
265 |
+
global $pos, $plugin_url;
|
266 |
+
|
267 |
+
$overlib_dir = "$plugin_url/js/overlibmws";
|
268 |
+
|
269 |
+
$js = "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws.js\"></script>";
|
270 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws_filter.js\"></script>";
|
271 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws_modal.js\"></script>";
|
272 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws_overtwo.js\"></script>";
|
273 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws_scroll.js\"></script>";
|
274 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$overlib_dir/overlibmws_shadow.js\"></script>";
|
275 |
+
|
276 |
+
$js .= "\n<script type=\"text/javascript\" src=\"$plugin_url/js/transposh.js\"></script>\n";
|
277 |
+
|
278 |
+
echo $js;
|
279 |
+
}
|
280 |
+
|
281 |
+
|
282 |
+
/*
|
283 |
+
* Return the img tag that will added to enable editing a translatable
|
284 |
+
* item on the page.
|
285 |
+
*
|
286 |
+
*/
|
287 |
+
function get_img_tag($original, $translation, $is_translated = FALSE)
|
288 |
+
{
|
289 |
+
global $plugin_url, $lang;
|
290 |
+
|
291 |
+
//For use in javascript, make the following changes:
|
292 |
+
//1. Add slashes to escape the inner text
|
293 |
+
//2. Convert the html special characters
|
294 |
+
//The browser will take decode step 2 and pass it to the js engine which decode step 1 - a bit tricky
|
295 |
+
$translation = htmlspecialchars(addslashes($translation));
|
296 |
+
|
297 |
+
if ($is_translated) $add_img="_fix";
|
298 |
+
$img = "<img src=\"$plugin_url/translate$add_img.png\" alt=\"translate\"
|
299 |
+
onclick=\"translate_dialog('$original','$translation','$lang','$home_url'); return false;\"
|
300 |
+
onmouseover=\"hint('$original'); return true;\"
|
301 |
+
onmouseout=\"nd()\" />";
|
302 |
+
|
303 |
+
return $img;
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
/*
|
308 |
+
* Add custom css, i.e. transposh.css
|
309 |
+
*
|
310 |
+
*/
|
311 |
+
function add_custom_css()
|
312 |
+
{
|
313 |
+
transposh_css();
|
314 |
+
insert_javascript_includes();
|
315 |
+
}
|
316 |
+
|
317 |
+
// We need some CSS to position the paragraph
|
318 |
+
function transposh_css()
|
319 |
+
{
|
320 |
+
global $plugin_url, $wp_query;
|
321 |
+
|
322 |
+
if (!isset($wp_query->query_vars[LANG_PARAM]))
|
323 |
+
{
|
324 |
+
return;
|
325 |
+
}
|
326 |
+
|
327 |
+
//include the transposh.css
|
328 |
+
echo "<link rel=\"stylesheet\" href=\"$plugin_url/transposh.css\" type=\"text/css\" />";
|
329 |
+
|
330 |
+
|
331 |
+
}
|
332 |
+
|
333 |
+
/*
|
334 |
+
* Init global variables later used throughout this process
|
335 |
+
*/
|
336 |
+
function init_global_vars()
|
337 |
+
{
|
338 |
+
global $home_url, $home_url_quoted, $plugin_url, $table_name, $wpdb;
|
339 |
+
|
340 |
+
$home_url = get_option('home');
|
341 |
+
|
342 |
+
$plugin_url= $home_url . "/wp-content/plugins/transposh";
|
343 |
+
$home_url_quoted = preg_quote($home_url);
|
344 |
+
$home_url_quoted = preg_replace("/\//", "\\/", $home_url_quoted);
|
345 |
+
|
346 |
+
$table_name = $wpdb->prefix . TRANSLATIONS_TABLE;
|
347 |
+
}
|
348 |
+
|
349 |
+
|
350 |
+
/*
|
351 |
+
* A new translation has been posted, update the translation database.
|
352 |
+
*
|
353 |
+
*/
|
354 |
+
function update_translation()
|
355 |
+
{
|
356 |
+
global $wpdb, $table_name;
|
357 |
+
|
358 |
+
$ref=getenv('HTTP_REFERER');
|
359 |
+
$original = $_POST['original'];
|
360 |
+
$translation = $_POST['translation'];
|
361 |
+
$lang = $_POST['lang'];
|
362 |
+
|
363 |
+
if(!isset($original) || !isset($translation) || !isset($lang))
|
364 |
+
{
|
365 |
+
logger("Enter " . __FILE__ . " missing params: $original , $translation, $lang," .
|
366 |
+
$ref, 0);
|
367 |
+
return;
|
368 |
+
}
|
369 |
+
|
370 |
+
//Check that use is allowed to translate
|
371 |
+
if(!is_translator())
|
372 |
+
{
|
373 |
+
|
374 |
+
}
|
375 |
+
|
376 |
+
//encode text
|
377 |
+
$original = $wpdb->escape(htmlspecialchars(urldecode($original)));
|
378 |
+
|
379 |
+
//remove already escaped character to avoid double escaping
|
380 |
+
$translation = $wpdb->escape(stripslashes(urldecode($translation)));
|
381 |
+
|
382 |
+
$update = "REPLACE INTO $table_name (original, translated, lang)
|
383 |
+
VALUES ('" . $original . "','" . $translation . "','" . $lang . "')";
|
384 |
+
|
385 |
+
$result = $wpdb->query($update);
|
386 |
+
|
387 |
+
if($result !== FALSE)
|
388 |
+
{
|
389 |
+
update_transaction_log($original, $translation, $lang);
|
390 |
+
|
391 |
+
//Delete entry from cache
|
392 |
+
if(ENABLE_APC && function_exists('apc_store'))
|
393 |
+
{
|
394 |
+
apc_delete($original . $lang);
|
395 |
+
}
|
396 |
+
|
397 |
+
}
|
398 |
+
else
|
399 |
+
{
|
400 |
+
|
401 |
+
}
|
402 |
+
|
403 |
+
wp_redirect($ref);
|
404 |
+
exit;
|
405 |
+
}
|
406 |
+
|
407 |
+
|
408 |
+
/*
|
409 |
+
* Update the transaction log
|
410 |
+
*
|
411 |
+
*/
|
412 |
+
function update_transaction_log(&$original, &$translation, &$lang)
|
413 |
+
{
|
414 |
+
global $wpdb, $user_ID;
|
415 |
+
get_currentuserinfo();
|
416 |
+
|
417 |
+
// log either the user ID or his IP
|
418 |
+
if ('' == $user_ID)
|
419 |
+
{
|
420 |
+
$loguser = $_SERVER['REMOTE_ADDR'];
|
421 |
+
}
|
422 |
+
else
|
423 |
+
{
|
424 |
+
$loguser = $user_ID;
|
425 |
+
}
|
426 |
+
|
427 |
+
$log = "INSERT INTO ".$wpdb->prefix.TRANSLATIONS_LOG." (original, translated, lang, translated_by)
|
428 |
+
VALUES ('" . $original . "','" . $translation . "','" . $lang . "','".$loguser."')";
|
429 |
+
|
430 |
+
$result = $wpdb->query($log);
|
431 |
+
|
432 |
+
if($result === FALSE)
|
433 |
+
{
|
434 |
+
|
435 |
+
}
|
436 |
+
|
437 |
+
}
|
438 |
+
|
439 |
+
|
440 |
+
/*
|
441 |
+
* Gets the default language setting, i.e. the source language which
|
442 |
+
* should not be translated.
|
443 |
+
* Return the default language setting
|
444 |
+
*/
|
445 |
+
function get_default_lang()
|
446 |
+
{
|
447 |
+
global $languages;
|
448 |
+
|
449 |
+
$default = get_option(DEFAULT_LANG);
|
450 |
+
if(!$languages[$default])
|
451 |
+
{
|
452 |
+
$default = "en";
|
453 |
+
}
|
454 |
+
|
455 |
+
return $default;
|
456 |
+
}
|
457 |
+
|
458 |
+
/*
|
459 |
+
* Setup a buffer that will contain the contents of the html page.
|
460 |
+
* Once processing is completed the buffer will go into the translation process.
|
461 |
+
*/
|
462 |
+
function on_init()
|
463 |
+
{
|
464 |
+
|
465 |
+
init_global_vars();
|
466 |
+
|
467 |
+
|
468 |
+
if ($_POST['translation_posted'])
|
469 |
+
{
|
470 |
+
update_translation();
|
471 |
+
}
|
472 |
+
else
|
473 |
+
{
|
474 |
+
//set the callback for translating the page when it's done
|
475 |
+
ob_start("process_page");
|
476 |
+
}
|
477 |
+
}
|
478 |
+
|
479 |
+
|
480 |
+
/*
|
481 |
+
* Page generation completed - flush buffer.
|
482 |
+
*/
|
483 |
+
function on_shutdown()
|
484 |
+
{
|
485 |
+
ob_flush();
|
486 |
+
}
|
487 |
+
|
488 |
+
|
489 |
+
/*
|
490 |
+
* Update the url rewrite rules to include language identifier
|
491 |
+
*
|
492 |
+
*/
|
493 |
+
function update_rewrite_rules($rules){
|
494 |
+
|
495 |
+
|
496 |
+
$newRules = array();
|
497 |
+
$lang_prefix="([a-z]{2,2}(\-[a-z]{2,2})?)/";
|
498 |
+
|
499 |
+
$lang_parameter= "&" . LANG_PARAM . '=$matches[1]';
|
500 |
+
|
501 |
+
//catch the root url
|
502 |
+
$newRules[$lang_prefix."?$"] = "index.php?lang=\$matches[1]";
|
503 |
+
|
504 |
+
|
505 |
+
foreach ($rules as $key=>$value) {
|
506 |
+
$original_key = $key;
|
507 |
+
$original_value = $value;
|
508 |
+
|
509 |
+
$key = $lang_prefix . $key;
|
510 |
+
|
511 |
+
//Shift existing matches[i] two step forward as we pushed new elements
|
512 |
+
//in the beginning of the expression
|
513 |
+
for($i = 6; $i > 0; $i--)
|
514 |
+
{
|
515 |
+
$value = str_replace('['. $i .']', '['. ($i + 2) .']', $value);
|
516 |
+
}
|
517 |
+
|
518 |
+
$value .= $lang_parameter;
|
519 |
+
|
520 |
+
|
521 |
+
|
522 |
+
|
523 |
+
$newRules[$key] = $value;
|
524 |
+
$newRules[$original_key] = $original_value;
|
525 |
+
|
526 |
+
|
527 |
+
}
|
528 |
+
|
529 |
+
|
530 |
+
return $newRules;
|
531 |
+
}
|
532 |
+
|
533 |
+
/*
|
534 |
+
* Let WordPress which parameters are of interest to us.
|
535 |
+
*/
|
536 |
+
function parameter_queryvars($qvars)
|
537 |
+
{
|
538 |
+
$qvars[] = LANG_PARAM;
|
539 |
+
$qvars[] = EDIT_PARAM;
|
540 |
+
|
541 |
+
return $qvars;
|
542 |
+
}
|
543 |
+
|
544 |
+
|
545 |
+
/*
|
546 |
+
* Setup the translation database.
|
547 |
+
*
|
548 |
+
*/
|
549 |
+
function setup_db()
|
550 |
+
{
|
551 |
+
|
552 |
+
global $wpdb;
|
553 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
554 |
+
|
555 |
+
$table_name = $wpdb->prefix . TRANSLATIONS_TABLE;
|
556 |
+
|
557 |
+
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name)
|
558 |
+
{
|
559 |
+
|
560 |
+
$sql = "CREATE TABLE " . $table_name . " (original VARCHAR(256) NOT NULL,
|
561 |
+
lang CHAR(5) NOT NULL,
|
562 |
+
translated VARCHAR(256),
|
563 |
+
PRIMARY KEY (original, lang)) ";
|
564 |
+
|
565 |
+
|
566 |
+
dbDelta($sql);
|
567 |
+
|
568 |
+
//Verify that newly created table is ready for use.
|
569 |
+
$insert = "INSERT INTO " . $table_name . " (original, translated, lang) " .
|
570 |
+
"VALUES ('Hello','Hi There','zz')";
|
571 |
+
|
572 |
+
$result = $wpdb->query($insert);
|
573 |
+
|
574 |
+
if($result === FALSE)
|
575 |
+
{
|
576 |
+
|
577 |
+
}
|
578 |
+
else
|
579 |
+
{
|
580 |
+
|
581 |
+
add_option(TRANSPOSH_DB_VERSION, DB_VERSION);
|
582 |
+
}
|
583 |
+
}
|
584 |
+
|
585 |
+
$table_name = $wpdb->prefix . TRANSLATIONS_LOG;
|
586 |
+
|
587 |
+
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name)
|
588 |
+
{
|
589 |
+
|
590 |
+
$sql = "CREATE TABLE " . $table_name . " (original VARCHAR(256) NOT NULL,
|
591 |
+
lang CHAR(5) NOT NULL,
|
592 |
+
translated VARCHAR(256),
|
593 |
+
translated_by VARCHAR(15),
|
594 |
+
timestamp TIMESTAMP,
|
595 |
+
PRIMARY KEY (original, lang, timestamp)) ";
|
596 |
+
|
597 |
+
|
598 |
+
dbDelta($sql);
|
599 |
+
}
|
600 |
+
|
601 |
+
|
602 |
+
}
|
603 |
+
|
604 |
+
/*
|
605 |
+
* Determine if the current user is allowed to translate.
|
606 |
+
* Return TRUE if allowed to translate otherwise FALSE
|
607 |
+
*/
|
608 |
+
function is_translator()
|
609 |
+
{
|
610 |
+
if(is_user_logged_in())
|
611 |
+
{
|
612 |
+
if(current_user_can(TRANSLATOR))
|
613 |
+
{
|
614 |
+
return TRUE;
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
if(get_option(ANONYMOUS_TRANSLATION))
|
619 |
+
{
|
620 |
+
//if anonymous translation is allowed - let anyone enjoy it
|
621 |
+
return TRUE;
|
622 |
+
}
|
623 |
+
|
624 |
+
return FALSE;
|
625 |
+
}
|
626 |
+
|
627 |
+
|
628 |
+
/*
|
629 |
+
* Plugin activated.
|
630 |
+
*
|
631 |
+
*/
|
632 |
+
function plugin_activate()
|
633 |
+
{
|
634 |
+
global $wp_rewrite;
|
635 |
+
|
636 |
+
|
637 |
+
setup_db();
|
638 |
+
|
639 |
+
add_filter('rewrite_rules_array', 'update_rewrite_rules');
|
640 |
+
$wp_rewrite->flush_rules();
|
641 |
+
|
642 |
+
|
643 |
+
}
|
644 |
+
|
645 |
+
|
646 |
+
/*
|
647 |
+
* Plugin deactivated.
|
648 |
+
*
|
649 |
+
*/
|
650 |
+
function plugin_deactivate(){
|
651 |
+
global $wp_rewrite;
|
652 |
+
|
653 |
+
|
654 |
+
remove_filter('rewrite_rules_array', 'update_rewrite_rules');
|
655 |
+
$wp_rewrite->flush_rules();
|
656 |
+
|
657 |
+
|
658 |
+
}
|
659 |
+
|
660 |
+
/*
|
661 |
+
* Callback from admin_notices - display error message to the admin.
|
662 |
+
*
|
663 |
+
*/
|
664 |
+
function plugin_install_error()
|
665 |
+
{
|
666 |
+
global $admin_msg;
|
667 |
+
|
668 |
+
|
669 |
+
echo '<div class="updated"><p>';
|
670 |
+
echo 'Error has occured in the installation process of the translation plugin: <br>';
|
671 |
+
|
672 |
+
echo $admin_msg;
|
673 |
+
|
674 |
+
if (function_exists('deactivate_plugins') ) {
|
675 |
+
deactivate_plugins("transposh/translate.php", "translate.php");
|
676 |
+
echo '<br> This plugin has been automatically deactivated.';
|
677 |
+
}
|
678 |
+
|
679 |
+
echo '</p></div>';
|
680 |
+
}
|
681 |
+
|
682 |
+
|
683 |
+
/*
|
684 |
+
* Callback when all plugins have been loaded. Serves as the location
|
685 |
+
* to check that the plugin loaded successfully else trigger notification
|
686 |
+
* to the admin and deactivate plugin.
|
687 |
+
*
|
688 |
+
*/
|
689 |
+
function plugin_loaded()
|
690 |
+
{
|
691 |
+
global $admin_msg;
|
692 |
+
|
693 |
+
|
694 |
+
if (get_option(TRANSPOSH_DB_VERSION) == NULL)
|
695 |
+
{
|
696 |
+
$admin_msg = "Failed to locate the translation table <em> " . TRANSLATIONS_TABLE . "</em> in local database. <br>";
|
697 |
+
|
698 |
+
|
699 |
+
//Some error occured - notify admin and deactivate plugin
|
700 |
+
add_action('admin_notices', 'plugin_install_error');
|
701 |
+
}
|
702 |
+
|
703 |
+
$db_version = get_option(TRANSPOSH_DB_VERSION);
|
704 |
+
|
705 |
+
if ($db_version != DB_VERSION)
|
706 |
+
{
|
707 |
+
$admin_msg = "Translation database version ($db_version) is not comptabile with this plugin (". DB_VERSION . ") <br>";
|
708 |
+
|
709 |
+
|
710 |
+
//Some error occured - notify admin and deactivate plugin
|
711 |
+
add_action('admin_notices', 'plugin_install_error');
|
712 |
+
}
|
713 |
+
}
|
714 |
+
|
715 |
+
//Register callbacks
|
716 |
+
add_action('wp_head', 'add_custom_css');
|
717 |
+
add_filter('query_vars', 'parameter_queryvars' );
|
718 |
+
|
719 |
+
add_action('init', 'on_init');
|
720 |
+
add_action('shutdown', 'on_shutdown');
|
721 |
+
|
722 |
+
add_action( 'plugins_loaded', 'plugin_loaded');
|
723 |
+
add_action('activate_'.str_replace('\\','/',plugin_basename(__FILE__)),'plugin_activate');
|
724 |
+
add_action('deactivate_'.str_replace('\\','/',plugin_basename(__FILE__)),'plugin_deactivate');
|
725 |
+
?>
|
transposh_admin.php
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
3 |
+
*
|
4 |
+
* This program is free software; you can redistribute it and/or modify
|
5 |
+
* it under the terms of the GNU General Public License as published by
|
6 |
+
* the Free Software Foundation; either version 2 of the License, or
|
7 |
+
* (at your option) any later version.
|
8 |
+
*
|
9 |
+
* This program is distributed in the hope that it will be useful,
|
10 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
* GNU General Public License for more details.
|
13 |
+
*
|
14 |
+
* You should have received a copy of the GNU General Public License
|
15 |
+
* along with this program; if not, write to the Free Software
|
16 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
/*
|
20 |
+
* Provide the admin page for configuring the translation options. eg. what languages ?
|
21 |
+
* who is allowed to translate ?
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
require_once("constants.php");
|
26 |
+
|
27 |
+
|
28 |
+
/*
|
29 |
+
* Add transposh to the admin menu.
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
function transposh_admin_menu()
|
33 |
+
{
|
34 |
+
add_options_page('Transposh','Transposh', 6,'Transposh', 'transposh_admin_page');
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
/*
|
39 |
+
* Create the admin page.
|
40 |
+
*
|
41 |
+
*/
|
42 |
+
function transposh_admin_page()
|
43 |
+
{
|
44 |
+
|
45 |
+
|
46 |
+
if($_POST['transposh_admin_posted'])
|
47 |
+
{
|
48 |
+
update_admin_options();
|
49 |
+
}
|
50 |
+
|
51 |
+
echo '<div class="wrap alternate">
|
52 |
+
<h2>Transposh</h2>
|
53 |
+
<form action="?page=Transposh" method="post">
|
54 |
+
<h3>Supported Languages</h3>';
|
55 |
+
|
56 |
+
insert_supported_langs();
|
57 |
+
echo '<br/> <h3>Who can translate ?</h3>';
|
58 |
+
insert_permissions();
|
59 |
+
|
60 |
+
echo '<input type="hidden" name="transposh_admin_posted" value="1" />
|
61 |
+
<p class="submit"><input type="submit" value="Save Changes" /></p>
|
62 |
+
</form>
|
63 |
+
</div>';
|
64 |
+
}
|
65 |
+
|
66 |
+
/*
|
67 |
+
* Insert supported languages section in admin page
|
68 |
+
*
|
69 |
+
*/
|
70 |
+
function insert_supported_langs()
|
71 |
+
{
|
72 |
+
global $languages, $plugin_url;
|
73 |
+
|
74 |
+
echo '
|
75 |
+
<script type="text/javascript" >
|
76 |
+
function chbx_change(lang)
|
77 |
+
{
|
78 |
+
var view = lang + "_view";
|
79 |
+
if(document.getElementById(view).checked)
|
80 |
+
{
|
81 |
+
var edit = lang + "_edit";
|
82 |
+
document.getElementById(edit).checked = true;
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
</script>
|
87 |
+
|
88 |
+
<table>
|
89 |
+
<tr>';
|
90 |
+
|
91 |
+
|
92 |
+
$columns = 2;
|
93 |
+
|
94 |
+
for($hdr=0; $hdr < $columns; $hdr++)
|
95 |
+
{
|
96 |
+
echo '<th>Language </th> <th>Viewable </th> <th>Translatable </th>
|
97 |
+
<th>Default</th><th style="padding-right: 80px"> </th>';
|
98 |
+
}
|
99 |
+
|
100 |
+
echo '</tr>';
|
101 |
+
|
102 |
+
foreach($languages as $code => $lang)
|
103 |
+
{
|
104 |
+
list ($language,$flag) = explode (",",$lang);
|
105 |
+
if($i % $columns == 0)
|
106 |
+
{
|
107 |
+
echo '</tr>';
|
108 |
+
}
|
109 |
+
echo "\n";
|
110 |
+
|
111 |
+
$i++;
|
112 |
+
|
113 |
+
echo "<td><img src=\"$plugin_url/flags/$flag.png\"/> $language</td>";
|
114 |
+
echo '<td align="center"> <input type="checkbox" id="' . $code .'_view" name="' .
|
115 |
+
$code . '_view" onChange="chbx_change(\'' . $code . '\')"' . is_viewable($code) . '/></td>';
|
116 |
+
echo "\n";
|
117 |
+
echo '<td align="center"> <input type="checkbox" id="' . $code . '_edit" name="' .
|
118 |
+
$code . '_edit" ' . is_editable($code). '/></td>';
|
119 |
+
echo "\n";
|
120 |
+
echo "<td align=\"center\"><input type=\"radio\" name=\"default_lang\" value=\"$code\"" .
|
121 |
+
is_default_lang($code). "/> </td>";
|
122 |
+
|
123 |
+
if($i % $columns == 0)
|
124 |
+
{
|
125 |
+
echo '</tr>';
|
126 |
+
}
|
127 |
+
else
|
128 |
+
{
|
129 |
+
echo "<td><style padding-right: 60px></style></td>";
|
130 |
+
}
|
131 |
+
|
132 |
+
echo "\n";
|
133 |
+
|
134 |
+
}
|
135 |
+
|
136 |
+
echo '</table>';
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/*
|
141 |
+
* Determine if the given language code is currentlly editable
|
142 |
+
* Return 'checked' if true otherwise ""
|
143 |
+
*/
|
144 |
+
function is_editable($code)
|
145 |
+
{
|
146 |
+
$langs = get_option(EDITABLE_LANGS);
|
147 |
+
|
148 |
+
if(strstr($langs, $code))
|
149 |
+
{
|
150 |
+
return "checked";
|
151 |
+
}
|
152 |
+
|
153 |
+
return "";
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/*
|
158 |
+
* Determine if the given language code is currentlly viewable
|
159 |
+
* Return 'checked' if true otherwise ""
|
160 |
+
*/
|
161 |
+
function is_viewable($code)
|
162 |
+
{
|
163 |
+
$langs = get_option(VIEWABLE_LANGS);
|
164 |
+
if(strstr($langs, $code))
|
165 |
+
{
|
166 |
+
return "checked";
|
167 |
+
}
|
168 |
+
|
169 |
+
return "";
|
170 |
+
}
|
171 |
+
|
172 |
+
/*
|
173 |
+
* Determine if the given language code is currentlly the default language
|
174 |
+
* Return 'checked' if true otherwise ""
|
175 |
+
*/
|
176 |
+
function is_default_lang($code)
|
177 |
+
{
|
178 |
+
global $languages;
|
179 |
+
|
180 |
+
$default = get_option(DEFAULT_LANG);
|
181 |
+
|
182 |
+
if(!$languages[$default])
|
183 |
+
{
|
184 |
+
$default = "en";
|
185 |
+
}
|
186 |
+
|
187 |
+
if($default == $code)
|
188 |
+
{
|
189 |
+
return "checked";
|
190 |
+
}
|
191 |
+
|
192 |
+
return "";
|
193 |
+
}
|
194 |
+
|
195 |
+
/*
|
196 |
+
* Insert permissiions section in the admin page
|
197 |
+
*
|
198 |
+
*/
|
199 |
+
function insert_permissions()
|
200 |
+
{
|
201 |
+
global $wp_roles;
|
202 |
+
|
203 |
+
//display known roles and their permission to translate
|
204 |
+
foreach($wp_roles->get_names() as $role_name => $something)
|
205 |
+
{
|
206 |
+
echo '<input type="checkbox" value="1" name="' . $role_name . '" ' . can_translate($role_name) .
|
207 |
+
'" />' . $role_name . '   </input>';
|
208 |
+
}
|
209 |
+
|
210 |
+
//Add our own custom role
|
211 |
+
echo '<input type="checkbox" value="1" name="anonymous"' .
|
212 |
+
can_translate('anonymous') . '" /> Anonymous</input>';
|
213 |
+
}
|
214 |
+
|
215 |
+
/*
|
216 |
+
* Indicates whether the given role can translate.
|
217 |
+
* Return either "checked" or ""
|
218 |
+
*/
|
219 |
+
function can_translate($role_name)
|
220 |
+
{
|
221 |
+
global $wp_roles;
|
222 |
+
if($role_name != 'anonymous')
|
223 |
+
{
|
224 |
+
$role = $wp_roles->get_role($role_name);
|
225 |
+
if(isset($role) && $role->has_cap(TRANSLATOR))
|
226 |
+
{
|
227 |
+
return 'checked';
|
228 |
+
}
|
229 |
+
}
|
230 |
+
else
|
231 |
+
{
|
232 |
+
$allow_anonymous = get_option(ANONYMOUS_TRANSLATION);
|
233 |
+
if($allow_anonymous == "1")
|
234 |
+
{
|
235 |
+
return 'checked';
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
return "";
|
240 |
+
}
|
241 |
+
|
242 |
+
/*
|
243 |
+
* Handle newly posted admin options.
|
244 |
+
*
|
245 |
+
*/
|
246 |
+
function update_admin_options()
|
247 |
+
{
|
248 |
+
|
249 |
+
global $wp_roles, $languages;
|
250 |
+
|
251 |
+
//update roles and capabilities
|
252 |
+
foreach($wp_roles->get_names() as $role_name => $something)
|
253 |
+
{
|
254 |
+
$role = $wp_roles->get_role($role_name);
|
255 |
+
if($_POST[$role_name] == "1")
|
256 |
+
{
|
257 |
+
$role->add_cap(TRANSLATOR);
|
258 |
+
}
|
259 |
+
else
|
260 |
+
{
|
261 |
+
$role->remove_cap(TRANSLATOR);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
//Anonymous needs to be handled differently as it does not have a role
|
266 |
+
if($_POST['anonymous'] == "1")
|
267 |
+
{
|
268 |
+
update_option(ANONYMOUS_TRANSLATION, 1);
|
269 |
+
}
|
270 |
+
else
|
271 |
+
{
|
272 |
+
update_option(ANONYMOUS_TRANSLATION, 0);
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
//Update the list of supported/editable languages
|
277 |
+
foreach($languages as $code => $lang)
|
278 |
+
{
|
279 |
+
if($_POST[$code . '_view'])
|
280 |
+
{
|
281 |
+
$viewable_langs[] = $code;
|
282 |
+
}
|
283 |
+
|
284 |
+
if($_POST[$code . '_edit'])
|
285 |
+
{
|
286 |
+
$editable_langs[] = $code;
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
update_option(VIEWABLE_LANGS, implode(',', $viewable_langs));
|
291 |
+
update_option(EDITABLE_LANGS, implode(',', $editable_langs));
|
292 |
+
update_option(DEFAULT_LANG, $_POST['default_lang']);
|
293 |
+
|
294 |
+
echo '<div id="message"class="updated fade">';
|
295 |
+
echo ('<p> Changes saved</p>');
|
296 |
+
echo '</div>';
|
297 |
+
}
|
298 |
+
|
299 |
+
add_action('admin_menu', 'transposh_admin_menu');
|
300 |
+
|
301 |
+
?>
|
transposh_widget.php
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Copyright © 2009 Transposh Team (website : http://transposh.org)
|
3 |
+
*
|
4 |
+
* This program is free software; you can redistribute it and/or modify
|
5 |
+
* it under the terms of the GNU General Public License as published by
|
6 |
+
* the Free Software Foundation; either version 2 of the License, or
|
7 |
+
* (at your option) any later version.
|
8 |
+
*
|
9 |
+
* This program is distributed in the hope that it will be useful,
|
10 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
* GNU General Public License for more details.
|
13 |
+
*
|
14 |
+
* You should have received a copy of the GNU General Public License
|
15 |
+
* along with this program; if not, write to the Free Software
|
16 |
+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
/*
|
20 |
+
* Provides the sidebar widget for selecting a language and switching between edit/view
|
21 |
+
* mode.
|
22 |
+
*/
|
23 |
+
require_once("constants.php");
|
24 |
+
require_once("transposh.php");
|
25 |
+
|
26 |
+
/*
|
27 |
+
* Intercept init calls to see if it was posted by the widget.
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
function init_transposh()
|
31 |
+
{
|
32 |
+
if ($_POST['transposh_widget_posted'])
|
33 |
+
{
|
34 |
+
|
35 |
+
|
36 |
+
global $wp_rewrite;
|
37 |
+
|
38 |
+
$ref=getenv('HTTP_REFERER');
|
39 |
+
$lang = $_POST[LANG_PARAM];
|
40 |
+
|
41 |
+
//remove existing language settings.
|
42 |
+
$ref = cleanup_url($ref);
|
43 |
+
|
44 |
+
if($lang != "none")
|
45 |
+
{
|
46 |
+
$use_params_only = !$wp_rewrite->using_permalinks();
|
47 |
+
$is_edit = $_POST[EDIT_PARAM];
|
48 |
+
|
49 |
+
$ref = rewrite_url_lang_param($ref, $lang, $is_edit, $use_params_only);
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
wp_redirect($ref);
|
55 |
+
exit;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
/*
|
60 |
+
* Register the widget.
|
61 |
+
*/
|
62 |
+
function transposh_widget_init()
|
63 |
+
{
|
64 |
+
|
65 |
+
if (!function_exists('register_sidebar_widget'))
|
66 |
+
{
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
|
70 |
+
// Register widget
|
71 |
+
register_sidebar_widget(array('Transposh', 'widgets'), 'transposh_widget');
|
72 |
+
|
73 |
+
// Register widget control
|
74 |
+
register_widget_control("Transposh",'transposh_widget_control');
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/*
|
79 |
+
* The actual widget implementation.
|
80 |
+
*/
|
81 |
+
function transposh_widget($args)
|
82 |
+
{
|
83 |
+
|
84 |
+
global $languages, $wp_query, $wp_rewrite;
|
85 |
+
extract($args);
|
86 |
+
|
87 |
+
$page_url = ($_SERVER['HTTPS'] == 'on' ?
|
88 |
+
'https://' : 'http://') . $_SERVER["SERVER_NAME"];
|
89 |
+
$page_url .= ($_SERVER["SERVER_PORT"] != "80" ? ":" .$_SERVER["SERVER_PORT"] : "");
|
90 |
+
$page_url .= $_SERVER["REQUEST_URI"];
|
91 |
+
|
92 |
+
$is_edit = ($wp_query->query_vars[EDIT_PARAM] == "1" ? TRUE : FALSE);
|
93 |
+
$lang = $wp_query->query_vars[LANG_PARAM];
|
94 |
+
|
95 |
+
$options = get_option(WIDGET_TRANSPOSH);
|
96 |
+
$viewable_langs = get_option(VIEWABLE_LANGS);
|
97 |
+
$editable_langs = get_option(EDITABLE_LANGS);
|
98 |
+
$is_translator = is_translator();
|
99 |
+
|
100 |
+
$is_showing_languages = FALSE;
|
101 |
+
|
102 |
+
echo $before_widget . $before_title . __(no_translate("Transposh")) . $after_title;
|
103 |
+
echo "<span class=\"" . NO_TRANSLATE_CLASS . "\" >";
|
104 |
+
|
105 |
+
switch ($options['style']) {
|
106 |
+
case 1: // flags
|
107 |
+
//keep the flags in the same direction regardless of the overall page direction
|
108 |
+
echo "<div dir=rtl>";
|
109 |
+
|
110 |
+
global $plugin_url;
|
111 |
+
$using_permalinks = $wp_rewrite->using_permalinks();
|
112 |
+
|
113 |
+
foreach($languages as $code => $lang2)
|
114 |
+
{
|
115 |
+
list($language,$flag) = explode (",",$lang2);
|
116 |
+
|
117 |
+
//remove any language identifier
|
118 |
+
$page_url = cleanup_url($page_url);
|
119 |
+
|
120 |
+
//Only show languages which are viewable or (editable and the user is a translator)
|
121 |
+
if(strstr($viewable_langs, $code) ||
|
122 |
+
($is_translator && strstr($editable_langs, $code)))
|
123 |
+
{
|
124 |
+
$page_url = rewrite_url_lang_param($page_url, $code, $is_edit, !$using_permalinks);
|
125 |
+
|
126 |
+
echo "<a href=\"" . $page_url . "\">
|
127 |
+
<img src=\"$plugin_url/flags/$flag.png\" title=\"$language\" alt=\"$language\"
|
128 |
+
style=\"padding: 1px 3px\"/></a>";
|
129 |
+
$is_showing_languages = TRUE;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
echo "</div>";
|
134 |
+
|
135 |
+
// this is the form for the edit...
|
136 |
+
echo "<form action=\"$page_url\" method=\"post\">";
|
137 |
+
echo "<input type=\"hidden\" name=\"lang\" id=\"lang\" value=\"$lang\"/>";
|
138 |
+
break;
|
139 |
+
default: // language list
|
140 |
+
|
141 |
+
echo "<form action=\"$page_url\" method=\"post\">";
|
142 |
+
echo "<select name=\"lang\" id=\"lang\" onchange=\"Javascript:this.form.submit();\">";
|
143 |
+
echo "<option value=\"none\">[Language]</option>";
|
144 |
+
|
145 |
+
foreach($languages as $code => $lang2)
|
146 |
+
{
|
147 |
+
list($language,$flag) = explode (",",$lang2);
|
148 |
+
|
149 |
+
//Only show languages which are viewable or (editable and the user is a translator)
|
150 |
+
if(strstr($viewable_langs, $code) ||
|
151 |
+
($is_translator && strstr($editable_langs, $code)))
|
152 |
+
{
|
153 |
+
$is_selected = ($lang == $code ? "selected=\"selected\"" : "" );
|
154 |
+
echo "<option value=\"$code\" $is_selected>" . no_translate($language) . "</option>";
|
155 |
+
$is_showing_languages = TRUE;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
echo "</select><br/>";
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
//at least one language showing - add the edit box if applicable
|
163 |
+
if($is_showing_languages)
|
164 |
+
{
|
165 |
+
//Add the edit checkbox only for translators on languages marked as editable
|
166 |
+
if($is_translator && strstr($editable_langs, $lang))
|
167 |
+
{
|
168 |
+
echo "<input type=\"checkbox\" name=\"" . EDIT_PARAM . "\" value=\"1\"" .
|
169 |
+
($is_edit ? "checked=\"1\"" : "0") .
|
170 |
+
"\" onClick=\"this.form.submit();\"/>Edit Translation<br/>";
|
171 |
+
}
|
172 |
+
|
173 |
+
echo "<input type=\"hidden\" name=\"transposh_widget_posted\" value=\"1\"/>";
|
174 |
+
}
|
175 |
+
else
|
176 |
+
{
|
177 |
+
//no languages configured - error message
|
178 |
+
echo '<p> No languages available for display. Check the Transposh settings (Admin).</p>';
|
179 |
+
}
|
180 |
+
|
181 |
+
echo "</form>";
|
182 |
+
echo "</span>"; // the no_translate for the widget
|
183 |
+
|
184 |
+
echo $after_widget;
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
/*
|
189 |
+
*Remove from url any language (or editing) params that were added for our use.
|
190 |
+
*Return the scrubed url
|
191 |
+
*/
|
192 |
+
function cleanup_url($url)
|
193 |
+
{
|
194 |
+
global $home_url, $home_url_quoted;
|
195 |
+
|
196 |
+
//cleanup previous lang & edit parameter from url
|
197 |
+
$url = preg_replace("/(" . LANG_PARAM . "|" . EDIT_PARAM . ")=[^&]*/i", "", $url);
|
198 |
+
|
199 |
+
|
200 |
+
if(!$home_url)
|
201 |
+
{
|
202 |
+
//make sure required home urls are fetched - as they are need now
|
203 |
+
init_global_vars();
|
204 |
+
}
|
205 |
+
|
206 |
+
//cleanup lang identifier in permalinks
|
207 |
+
$url = preg_replace("/$home_url_quoted\/(..\/)/", "$home_url/", $url);
|
208 |
+
|
209 |
+
return $url;
|
210 |
+
}
|
211 |
+
|
212 |
+
/*
|
213 |
+
* Mark the given text so it will not subject to translation.
|
214 |
+
* Return the text with the required tags
|
215 |
+
*/
|
216 |
+
function no_translate($text)
|
217 |
+
{
|
218 |
+
return "<span class=\"" . NO_TRANSLATE_CLASS . "\">$text</span>";
|
219 |
+
}
|
220 |
+
|
221 |
+
/*
|
222 |
+
* This is the widget control, allowing the selection of presentation type.
|
223 |
+
*/
|
224 |
+
function transposh_widget_control()
|
225 |
+
{
|
226 |
+
$options = $newoptions = get_option(WIDGET_TRANSPOSH);
|
227 |
+
|
228 |
+
if ( isset($_POST['transposh-submit']) )
|
229 |
+
{
|
230 |
+
$newoptions['style'] = $_POST['transposh-style'];
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( $options != $newoptions )
|
234 |
+
{
|
235 |
+
$options = $newoptions;
|
236 |
+
update_option('widget_transposh', $options);
|
237 |
+
}
|
238 |
+
|
239 |
+
$style = $options['style'];
|
240 |
+
|
241 |
+
echo '<p><label for="transposh-style">Style:<br />
|
242 |
+
<select id="transposh-style" name="transposh-style">';
|
243 |
+
echo '<option ' . ($style == 0 ? 'selected="selected"' : '') .
|
244 |
+
'value="0">Language list</option>';
|
245 |
+
echo '<option ' . ($style == 1 ? 'selected="selected"' : '') .
|
246 |
+
'value="1">Flags</option>';
|
247 |
+
|
248 |
+
echo '</select></label></p>
|
249 |
+
<input type="hidden" name="transposh-submit" id="transposh-submit" value="1" />';
|
250 |
+
|
251 |
+
}
|
252 |
+
|
253 |
+
|
254 |
+
//Register callback for WordPress events
|
255 |
+
add_action('init', 'init_transposh',0);
|
256 |
+
add_action('widgets_init', 'transposh_widget_init');
|
257 |
+
|
258 |
+
|
259 |
+
?>
|