diff options
Diffstat (limited to 'modules/lightbox')
90 files changed, 8698 insertions, 0 deletions
diff --git a/modules/lightbox/admin-config.php b/modules/lightbox/admin-config.php new file mode 100644 index 0000000000..b2bb5ef0c1 --- /dev/null +++ b/modules/lightbox/admin-config.php @@ -0,0 +1,54 @@ +<?php +/** + * Lightbox configuration User Interface. + * + * Provides links for administrators to get to other administrative areas of the site + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * This Page Is Valid XHTML 1.0 Transitional! > 01 September 2005 + * + * @package webtrees + * @subpackage Admin + * $Id$ + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +if (WT_USER_IS_ADMIN) { ?> + <tr> + <td colspan="2" class="topbottombar" style="text-align:center; "><?php echo i18n::translate('Lightbox-Album Configuration'); ?></td> + </tr> + <tr> + <td class="optionbox"> + <a href="module.php?mod=lightbox&pgvaction=lb_editconfig"><?php echo i18n::translate('Manage Lightbox configuration');?> + </a><?php echo help_link('LIGHTBOX_CONFIG','lightbox'); ?> + </td> + <td class="optionbox"> + + </td> + </tr> + +<?php } +?> diff --git a/modules/lightbox/album.php b/modules/lightbox/album.php new file mode 100644 index 0000000000..08aded758c --- /dev/null +++ b/modules/lightbox/album.php @@ -0,0 +1,165 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2007 to 2009 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +global $mediatab, $mediacnt; +global $edit, $controller, $tabno, $_REQUEST, $thumb_edit, $n, $LB_URL_WIDTH, $LB_URL_HEIGHT, $LB_TT_BALLOON ; +global $reorder, $rownum, $sort_i, $GEDCOM; + +$reorder=safe_get('reorder', '1', '0'); + +// Get Javascript variables from lb_config.php --------------------------- +require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; +// require_once WT_ROOT.'modules/lightbox/functions/browser_detection_php_ar.php'; + +function cut_html($string) +{ + $a=$string; + + while ($a = strstr($a, '&')) + { + //echo "'", $a, "'\n"; + $b=strstr($a, ';'); + if (!$b) + { + //echo "couper...\n"; + $nb=strlen($a); + return substr($string, 0, strlen($string)-$nb); + } + $a=substr($a, 1, strlen($a)-1); + } + return $string; +} + +if (isset($edit)) { + $edit=$edit; +}else{ + $edit=1; + } + +// Used when sorting media on album tab page =============================================== +if ($reorder==1 ){ + +$sort_i=0; // Used in sorting on lightbox_print_media_row.php page + +?> + <script type="text/javascript"> + <!-- + // This script saves the dranNdrop reordered info into a hidden form input element (name=order2) + function saveOrder() { + // var sections = document.getElementsByClassName('section'); + var sections = $$('.section'); + var order = ''; + sections.each(function(section) { + order += Sortable.sequence(section) + ','; + document.getElementById("ord2").value = order; + }); + //document.getElementById("ord2").value = order; + }; + //--> + </script> + + + <form name="reorder_form" method="post" action="edit_interface.php"> + <input type="hidden" name="action" value="al_reorder_media_update" /> + <input type="hidden" name="pid" value="<?php print $pid; ?>" /> + <input type="hidden" id="ord2" name="order2" value="" /> + + <center> + <button type="submit" title="<?php print i18n::translate('Saves the sorted media to the database');?>" onclick="saveOrder();" ><?php print i18n::translate('Save');?></button> + <button type="submit" title="<?php print i18n::translate('Reset to the original order');?>" onclick="document.reorder_form.action.value='al_reset_media_update'; document.reorder_form.submit();"><?php print i18n::translate('Reset');?></button> + <button type="button" title="<?php print i18n::translate('Quit and return');?>" onClick="location.href='<?php echo WT_SCRIPT_NAME, "?pid=", $pid, "&tab=", $tabno; ?>'"><?php print i18n::translate('Cancel');?></button> +<?php +/* + // Debug --------------------------------------------------------------------------- + + <input type="button" onClick="getGroupOrder()" value="Debug: Sorted"> + // ------------------------------------------------------------------------------------ +*/ +?> + </center> + </form> +<?php +} +// ===================================================================================== + +//------------------------------------------------------------------------------ +// Start Main Table +//------------------------------------------------------------------------------ +// echo "<table border='0' width='100%' cellpadding=\"0\" ><tr>", "\n\n"; + +//------------------------------------------------------------------------------ +// Build Thumbnail Rows +//------------------------------------------------------------------------------ +// echo "<td valign=\"top\">"; + echo "<table width=\"100%\" cellpadding=\"0\" border=\"0\"><tr>"; + echo "<td width=\"100%\" valign=\"top\" >"; + lightbox_print_media($pid, 0, true, 1); // map, painting, photo, tombstone) + lightbox_print_media($pid, 0, true, 2); // card, certificate, document, magazine, manuscript, newspaper + lightbox_print_media($pid, 0, true, 3); // electronic, fiche, film + lightbox_print_media($pid, 0, true, 4); // audio, book, coat, video, other + lightbox_print_media($pid, 0, true, 5); // footnotes + echo "</td>"; + echo "</tr></table>"; +// echo "</td>"; +//------------------------------------------------------------------------------ +// End Thumbnail Rows +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Build Relatives navigator from includes/controllers/individual_ctrl +//------------------------------------------------------------------------------ +/* + echo '<td valign="top" align="center" width="220px">', "\n" ; + echo "<table cellpadding=\"0\" style=\"margin-top:2px; margin-left:0px;\" ><tr><td width=\"220px\" class=\"optionbox\" align=\"center\">"; + echo "<b>", i18n::translate('View Album of ...'), "</b><br /><br />" . "\n" ; + $controller->fam_nav(); + echo "<br />"; + echo "</td></tr></table>"; + echo "</td>" . "\n\n" ; +*/ +// ----------------------------------------------------------------------------- +// end Relatives navigator +// ----------------------------------------------------------------------------- + + +//------------------------------------------------------------------------------ +// End Main Table +//------------------------------------------------------------------------------ +//echo "</tr></table>"; + + +?> diff --git a/modules/lightbox/css/album_page.css b/modules/lightbox/css/album_page.css new file mode 100644 index 0000000000..cf64b34c9e --- /dev/null +++ b/modules/lightbox/css/album_page.css @@ -0,0 +1,195 @@ +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 John Finlay and Others + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Modules + * @version $Id$ + */ + +/* lightbox_plus.css version 3.00 29/06/2007 */ +/* +#lightbox { + background-color: #FFFFFF; + padding-left: 8px; + padding-right: 8px; + padding-top: 18px; + padding-bottom: 18px; +} + +#overlay { + background-color: #000000; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +#lightboxCaption { + padding-top: 3px; + padding-bottom: 3px; + color: #000080; + background-color: #FFFFFF; + font-size: 100%; + font-weight: bold; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + text-align: center; +} + +#lightboxIndicator { + border: 0px solid #FFFFFF; +} + +#lightboxOverallView { + background-image: url(images/overlay.png); +} + +* html #lightboxOverallView, +* html #overlay { + background-color: #000000; + background-image: url(images/blank.gif); + filter: Alpha(opacity=50); +} +*/ +.lb_notes:target, .lb_notes:target a{ + color:#000000; + background-color: #ffffcc; +} + +.prvpic +{ +background-color: #999999; +height: 80px; +width: 60px; +border: 1px; +border-style: solid; +border-color: black; +margin-top: 0px; +} + +.prvpic img +{ +/* background-color: none; */ +border-style: dotted; +border: 0px; +/* border-color: none; */ +padding: 0px; +} + +.pic +{ +/* background-color: #777777; */ +/* background-color: none; */ +border-style: solid; +border: 0px; +border-color: #ffffff; +padding: 0px; +} + + +.thumbcontainer +{ +display: block; +width: 100%; +} + +#lb_icons +{ +/* text-align: center, justify; */ +text-align: justify; +} + +#thumblist_1, #thumblist_2, #thumblist_3, #thumblist_4, #thumblist_5, +#thumblist_1a, #thumblist_2a, #thumblist_3a, #thumblist_4a, #thumblist_5a +{ +display: block; +list-style-type: none; +float: left; +} + + +#thumblist_1 li, #thumblist_2 li, #thumblist_3 li, #thumblist_4 li, #thumblist_5 li, +#thumblist_1a li, #thumblist_2a li, #thumblist_3a li, #thumblist_4a li, #thumblist_5a li +{ +display: block; +/* +border-style: dotted; +border: 2px; +border-color: pink; +background-color:#BDB071; +*/ +margin-right: 5px; +list-style-type: none; +padding-bottom: 0px; +padding-left: 4px; +padding-right: 4px; +float: left; +} + +li.li_norm{ +border: 2px solid transparent; +/* border: 2px; */ +} + +li.li_new { + border: 2px solid #0000ff; +} + +li.li_old { + border: 2px solid #ff0000; +} + +#thumblist_1 a img, #thumblist_2 a img, #thumblist_3 a img, #thumblist_4 a img, #thumblist_5 a img, +#thumblist_1a a img, #thumblist_2a a img, #thumblist_3a a img, #thumblist_4a a img, #thumblist_5a a img +{ +border-style:none; +border:1px; +padding:1px; +} + + +#thumblist_1 a:hover img, #thumblist_2 a:hover img, #thumblist_3 a:hover img, #thumblist_4 a:hover img, #thumblist_5 a:hover img, +#thumblist_1a a:hover img, #thumblist_2a a:hover img, #thumblist_3a a:hover img, #thumblist_4a a:hover img, #thumblist_5a a:hover img +{ +border-style:none; +border:0px; +background-color:#BDB071; +padding:1px; +} + + +.clearlist:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* #clearlist {display: inline-block;} */ + +/* Hides from IE-mac \*/ +* html .clearfix {height: 1%;} +#clearlist {display: block;} +/* End hide from IE-mac */
\ No newline at end of file diff --git a/modules/lightbox/css/album_page_RTL.css b/modules/lightbox/css/album_page_RTL.css new file mode 100644 index 0000000000..eadfb34d0a --- /dev/null +++ b/modules/lightbox/css/album_page_RTL.css @@ -0,0 +1,187 @@ +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 John Finlay and Others + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Modules + * @version $Id$ + */ + +/* lightbox_plus.css version 3.00 29/06/2007 */ +/* +#lightbox { + background-color: #FFFFFF; + padding-left: 8px; + padding-right: 8px; + padding-top: 18px; + padding-bottom: 18px; +} + +#overlay { + background-color: #000000; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +#lightboxCaption { + padding-top: 3px; + padding-bottom: 3px; + color: #000080; + background-color: #FFFFFF; + font-size: 100%; + font-weight: bold; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + text-align: center; +} + +#lightboxIndicator { + border: 0px solid #FFFFFF; +} + +#lightboxOverallView { + background-image: url(images/overlay.png); +} + +* html #lightboxOverallView, +* html #overlay { + background-color: #000000; + background-image: url(images/blank.gif); + filter: Alpha(opacity=50); +} +*/ +.lb_notes:target { + color:#000000; + background-color: #ffffcc; +} + +.prvpic +{ +background-color: #999999; +height: 80px; +width: 60px; +border: 1px; +border-style: solid; +border-color: black; +margin-top: 0px; +} + +.prvpic img +{ +/* background-color: none; */ +border-style: dotted; +border: 0px; +/* border-color: none; */ +padding: 0px; +} + +.pic +{ +/* background-color: #777777; */ +/* background-color: none; */ +border-style: solid; +border: 0px; +border-color: #ffffff; +padding: 0px; +} + + +.thumbcontainer +{ +display: block; +width: 100%; +} + +#lb_icons +{ +text-align: center, justify; +} + +#thumblist_1, #thumblist_2, #thumblist_3, #thumblist_4, #thumblist_5, +#thumblist_1a, #thumblist_2a, #thumblist_3a, #thumblist_4a, #thumblist_5a +{ +display: block; +list-style-type: none; +float: left; +} + +#thumblist_1 li, #thumblist_2 li, #thumblist_3 li, #thumblist_4 li, #thumblist_5 li, +#thumblist_1a li, #thumblist_2a li, #thumblist_3a li, #thumblist_4a li, #thumblist_5a li +{ +display: block; +margin-right: 5px; +list-style-type: none; +padding-bottom: 0px; +padding-left: 4px; +padding-right: 4px; +float: right; +} + +li.li_norm{ +border: 2px solid transparent; +/* border: 2px; */ +} + +li.li_new { + border: 2px solid #0000ff; +} + +li.li_old { + border: 2px solid #ff0000; +} + +#thumblist_1 a img, #thumblist_2 a img, #thumblist_3 a img, #thumblist_4 a img, #thumblist_5 a img, +#thumblist_1a a img, #thumblist_2a a img, #thumblist_3a a img, #thumblist_4a a img, #thumblist_5a a img +{ +border-style:none; +border:1px; +padding:1px; +} + + +#thumblist_1 a:hover img, #thumblist_2 a:hover img, #thumblist_3 a:hover img, #thumblist_4 a:hover img, #thumblist_5 a:hover img, +#thumblist_1a a:hover img, #thumblist_2a a:hover img, #thumblist_3a a:hover img, #thumblist_4a a:hover img, #thumblist_5a a:hover img +{ +border-style:none; +border:0px; +background-color:#BDB071; +padding:1px; +} + + +.clearlist:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* #clearlist {display: inline-block;} */ + +/* Hides from IE-mac \*/ +* html .clearfix {height: 1%;} +#clearlist {display: block;} +/* End hide from IE-mac */
\ No newline at end of file diff --git a/modules/lightbox/css/album_page_RTL2.css b/modules/lightbox/css/album_page_RTL2.css new file mode 100644 index 0000000000..eadfb34d0a --- /dev/null +++ b/modules/lightbox/css/album_page_RTL2.css @@ -0,0 +1,187 @@ +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 John Finlay and Others + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Modules + * @version $Id$ + */ + +/* lightbox_plus.css version 3.00 29/06/2007 */ +/* +#lightbox { + background-color: #FFFFFF; + padding-left: 8px; + padding-right: 8px; + padding-top: 18px; + padding-bottom: 18px; +} + +#overlay { + background-color: #000000; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +#lightboxCaption { + padding-top: 3px; + padding-bottom: 3px; + color: #000080; + background-color: #FFFFFF; + font-size: 100%; + font-weight: bold; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + text-align: center; +} + +#lightboxIndicator { + border: 0px solid #FFFFFF; +} + +#lightboxOverallView { + background-image: url(images/overlay.png); +} + +* html #lightboxOverallView, +* html #overlay { + background-color: #000000; + background-image: url(images/blank.gif); + filter: Alpha(opacity=50); +} +*/ +.lb_notes:target { + color:#000000; + background-color: #ffffcc; +} + +.prvpic +{ +background-color: #999999; +height: 80px; +width: 60px; +border: 1px; +border-style: solid; +border-color: black; +margin-top: 0px; +} + +.prvpic img +{ +/* background-color: none; */ +border-style: dotted; +border: 0px; +/* border-color: none; */ +padding: 0px; +} + +.pic +{ +/* background-color: #777777; */ +/* background-color: none; */ +border-style: solid; +border: 0px; +border-color: #ffffff; +padding: 0px; +} + + +.thumbcontainer +{ +display: block; +width: 100%; +} + +#lb_icons +{ +text-align: center, justify; +} + +#thumblist_1, #thumblist_2, #thumblist_3, #thumblist_4, #thumblist_5, +#thumblist_1a, #thumblist_2a, #thumblist_3a, #thumblist_4a, #thumblist_5a +{ +display: block; +list-style-type: none; +float: left; +} + +#thumblist_1 li, #thumblist_2 li, #thumblist_3 li, #thumblist_4 li, #thumblist_5 li, +#thumblist_1a li, #thumblist_2a li, #thumblist_3a li, #thumblist_4a li, #thumblist_5a li +{ +display: block; +margin-right: 5px; +list-style-type: none; +padding-bottom: 0px; +padding-left: 4px; +padding-right: 4px; +float: right; +} + +li.li_norm{ +border: 2px solid transparent; +/* border: 2px; */ +} + +li.li_new { + border: 2px solid #0000ff; +} + +li.li_old { + border: 2px solid #ff0000; +} + +#thumblist_1 a img, #thumblist_2 a img, #thumblist_3 a img, #thumblist_4 a img, #thumblist_5 a img, +#thumblist_1a a img, #thumblist_2a a img, #thumblist_3a a img, #thumblist_4a a img, #thumblist_5a a img +{ +border-style:none; +border:1px; +padding:1px; +} + + +#thumblist_1 a:hover img, #thumblist_2 a:hover img, #thumblist_3 a:hover img, #thumblist_4 a:hover img, #thumblist_5 a:hover img, +#thumblist_1a a:hover img, #thumblist_2a a:hover img, #thumblist_3a a:hover img, #thumblist_4a a:hover img, #thumblist_5a a:hover img +{ +border-style:none; +border:0px; +background-color:#BDB071; +padding:1px; +} + + +.clearlist:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* #clearlist {display: inline-block;} */ + +/* Hides from IE-mac \*/ +* html .clearfix {height: 1%;} +#clearlist {display: block;} +/* End hide from IE-mac */
\ No newline at end of file diff --git a/modules/lightbox/css/album_page_RTL_ff.css b/modules/lightbox/css/album_page_RTL_ff.css new file mode 100644 index 0000000000..693f308e03 --- /dev/null +++ b/modules/lightbox/css/album_page_RTL_ff.css @@ -0,0 +1,188 @@ +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 John Finlay and Others + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Modules + * @version $Id$ + */ + +/* lightbox_plus.css version 3.00 29/06/2007 */ +/* +#lightbox { + background-color: #FFFFFF; + padding-left: 8px; + padding-right: 8px; + padding-top: 18px; + padding-bottom: 18px; +} + +#overlay { + background-color: #000000; + filter:alpha(opacity=60); + -moz-opacity: 0.6; + opacity: 0.6; +} + +#lightboxCaption { + padding-top: 3px; + padding-bottom: 3px; + color: #000080; + background-color: #FFFFFF; + font-size: 100%; + font-weight: bold; + font-family: tahoma, verdana, arial, helvetica, sans-serif; + text-align: center; +} + +#lightboxIndicator { + border: 0px solid #FFFFFF; +} + +#lightboxOverallView { + background-image: url(images/overlay.png); +} + +* html #lightboxOverallView, +* html #overlay { + background-color: #000000; + background-image: url(images/blank.gif); + filter: Alpha(opacity=50); +} +*/ +.lb_notes:target { + color:#000000; + background-color: #ffffcc; +} + +.prvpic +{ +background-color: #999999; +height: 80px; +width: 60px; +border: 1px; +border-style: solid; +border-color: black; +margin-top: 0px; +} + +.prvpic img +{ +/* background-color: none; */ +border-style: dotted; +border: 0px; +/* border-color: none; */ +padding: 0px; +} + +.pic +{ +/* background-color: #777777; */ +/* background-color: none; */ +border-style: solid; +border: 0px; +border-color: #ffffff; +padding: 0px; +} + + +.thumbcontainer +{ +display: block; +width: 100%; +} + +#lb_icons +{ +text-align: center, justify; +} + + +#thumblist_1, #thumblist_2, #thumblist_3, #thumblist_4, #thumblist_5, +#thumblist_1a, #thumblist_2a, #thumblist_3a, #thumblist_4a, #thumblist_5a +{ +display: block; +list-style-type: none; +float: right; +} + +#thumblist_1 li, #thumblist_2 li, #thumblist_3 li, #thumblist_4 li, #thumblist_5 li, +#thumblist_1a li, #thumblist_2a li, #thumblist_3a li, #thumblist_4a li, #thumblist_5a li +{ +display: block; +margin-right: 5px; +list-style-type: none; +padding-bottom: 0px; +padding-left: 4px; +padding-right: 4px; +float: right; +} + +li.li_norm{ +border: 2px solid transparent; +/* border: 2px; */ +} + +li.li_new { + border: 2px solid #0000ff; +} + +li.li_old { + border: 2px solid #ff0000; +} + +#thumblist_1 a img, #thumblist_2 a img, #thumblist_3 a img, #thumblist_4 a img, #thumblist_5 a img, +#thumblist_1a a img, #thumblist_2a a img, #thumblist_3a a img, #thumblist_4a a img, #thumblist_5a a img +{ +border-style:none; +border:1px; +padding:1px; +} + + +#thumblist_1 a:hover img, #thumblist_2 a:hover img, #thumblist_3 a:hover img, #thumblist_4 a:hover img, #thumblist_5 a:hover img, +#thumblist_1a a:hover img, #thumblist_2a a:hover img, #thumblist_3a a:hover img, #thumblist_4a a:hover img, #thumblist_5a a:hover img +{ +border-style:none; +border:0px; +background-color:#BDB071; +padding:1px; +} + + +.clearlist:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* #clearlist {display: inline-block;} */ + +/* Hides from IE-mac \*/ +* html .clearfix {height: 1%;} +#clearlist {display: block;} +/* End hide from IE-mac */
\ No newline at end of file diff --git a/modules/lightbox/css/clearbox_music.css b/modules/lightbox/css/clearbox_music.css new file mode 100644 index 0000000000..a5e26d7afc --- /dev/null +++ b/modules/lightbox/css/clearbox_music.css @@ -0,0 +1,337 @@ + /* clearbox.css a ClearBox scripthez :: http://www.kreatura.hu/pyro/clearbox */ + +#CB_ShowTh, #CB_Thumbs2, #CB_Thumbs, .CB_RoundPixBugFix, #CB_Padding, #CB_ImgContainer, #CB_PrevNext, #CB_ContentHide, #CB_LoadingImage, #CB_Text, #CB_Window, #CB_Image, #CB_TopLeft, #CB_Top, #CB_TopRight, #CB_Left, #CB_Content, #CB_Right, #CB_BtmLeft, #CB_Btm, #CB_BtmRight, #CB_Prev, #CB_Next, #CB_Prev:hover, #CB_Next:hover, #CB_CloseWindow, #CB_SlideShowS, #CB_SlideShowP, #CB_SlideShowBar, #CB_Email { + margin: 0; + padding: 0; + background-color: transparent; + border: 0px; +} + +#CB_ImgHide { + position: absolute; + visibility: hidden; + z-index: 1098; + left: 0px; +} + +#CB_ShowTh { + width: 100%; + height: 15%; + visibility: hidden; + position: absolute; + z-index: 1097; + top: 0px; + left: 0px; +} + +#CB_ShowEtc { + width: 100%; + height: 15%; + visibility: hidden; + position: absolute; + z-index: 1097; + top: 15px; + left: 0px; +} + +#CB_Etc { + text-align: center; + display: none; + height: 60px; + padding-top: 10px; + background-color: #fff; + position: absolute; + z-index: 1100; + overflow: hidden; + top: 20px; + left: 0px; +} + +#CB_Thumbs { + display: none; + height: 60px; + padding-top: 10px; + background-color: #777; + position: absolute; + z-index: 1100; + overflow: hidden; + top: 10px; + left: 0px; +} + +#CB_Thumbs2 { + height: 50px; + position: absolute; +} + +.CB_ThumbsImg { + position: absolute; +} + +.CB_RoundPixBugFix { + display: block; + visibility: hidden; + font-family: arial; + font-size: 1pt; +} + +#CB_ImgContainer { + position: relative; + width: 100%; +} + +#CB_PrevNext { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + z-index: 1002; +} + +#CB_ContentHide { + position: absolute; + z-index: 1000; + top: 0px; + left: 0px; +} + +#CB_LoadingImage { + position: absolute; + left: 50%; + top: 50%; + margin-left: -12px; + margin-top: -12px; + visibility: hidden; +} + +#CB_Text { + text-align: center; + color: #0000FF; + margin-top: 4px; +/* width: 150px; + overflow: auto; */ +} + +#CB_Text { + position: relative; + top: -6px; +} + +#CB_DetailText, #CB_NoteText { + width: 5px; + background-color: #FFFFFF; + text-align: center; + font-weight: 300; + color: #8800FF; + padding-bottom: 4px; + margin-top: -3px; + margin-bottom: 6px; +} +#CB_DetailText a, #CB_NoteText a, #CB_Txt2 a { + color: #888888; +} +#CB_DetailText a:hover, #CB_NoteText a:hover, #CB_Txt2 a:hover { + color: #AA0000; +} + +#CB_NavBar table { + background-color: #FFFFFF; + text-align: center; + font-weight: 300; + color: #8800FF; + padding-bottom: 4px; + margin-top: -4px; + margin-bottom: 3px; +} +#CB_NavBar table td img{ + border: 0px; +} + +#CB_Window { + left:50%; + position:absolute; + top:50%; + visibility:hidden; + z-index: 1100; +} + +#CB_Image { + position: relative; +} + +#CB_iFrame { + /* border: red solid 1px; */ + position: absolute; + width: 0px; + height: 0px; + z-index: 1003; +} + +#CB_UrlNotes { + position: absolute; + color: magenta; + width: 0px; + height: 0px; + background: #ffff88; + border: blue solid 1px; + z-index: 1010; +} + +#CB_TopLeft { + background-image:url(../pic/s_topleft.png); + background-position:right bottom; +} + +#CB_Top { + background-image:url(../pic/s_top.png); + background-position:left bottom; +} + +#CB_TopRight { + background-image:url(../pic/s_topright.png); + background-position:left bottom; +} + +#CB_Left { + background-image:url(../pic/s_left.png); + background-position:right top; +} + +#CB_Content { + background-color:#FFFFFF; +} + +#CB_Right { + background-image:url(../pic/s_right.png); + background-position:left top; +} + +#CB_BtmLeft { + background-image:url(../pic/s_btmleft.png); + background-position:right top; +} + +#CB_Btm { + background-image:url(../pic/s_btm.png); + background-position:left top; +} + +#CB_BtmRight { + background-image:url(../pic/s_btmright.png); + background-position:left top; +} + +#CB_Prev, #CB_Next { + background: transparent url(../pic/blank.gif) no-repeat scroll 0%; + display: block; + width: 49%; + cursor: pointer; + outline-style:none; + z-index: 1102; +} + +.CB_TextNav { + margin-left: 30px; + margin-right: 30px; + text-decoration: underline; + color: #aaaaaa; +} + +.CB_TextNav:hover { + margin-left: 30px; + margin-right: 30px; + text-decoration: none; + color: #ff7700; +} + +#CB_Prev { + float: left; + left: 0px; +} + +#CB_Next { + float: right; + left: 0px; +} + +#CB_Prev:hover { +background:transparent url(../pic/prev.gif) no-repeat scroll left 50%; +} + +#CB_Next:hover { +background:transparent url(../pic/next.gif) no-repeat scroll right 50%; +} + + +#CB_NavBar { + position: relative; + top: 10px; +} + +#CB_SlideShowS, #CB_SlideShowP { + position: absolute; +/* top: -4px; */ + top: 2px; + left: 2px; + z-index: 1104; + cursor: pointer; +} + +#CB_MusicOn, #CB_MusicOff { + position: absolute; +/* top: -6px; */ + top: 0px; + left: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_Speak, #CB_Speaker { + position: absolute; +/* top: -6px; */ + top: 0px; + left: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_ZoomOn { + position: absolute; + top: -1px; + right: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_ZoomOff { + position: absolute; + top: -1px; + right: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_CloseWindow { + position: absolute; + top: 1px; + right: 2px; + z-index: 1104; + cursor: pointer; +} + +#CB_SlideShowBar { + width: 0px; + position: absolute; + top: 5px; +/* left: 22px; */ + left: 2px; + height: 5px; + display: none; +} + +#CB_Email { + position: absolute; + right: 15px; +} +
\ No newline at end of file diff --git a/modules/lightbox/css/clearbox_music_RTL.css b/modules/lightbox/css/clearbox_music_RTL.css new file mode 100644 index 0000000000..e38918e6d8 --- /dev/null +++ b/modules/lightbox/css/clearbox_music_RTL.css @@ -0,0 +1,341 @@ + /* clearbox.css a ClearBox scripthez :: http://www.kreatura.hu/pyro/clearbox */ + +#CB_ShowTh, #CB_Thumbs2, #CB_Thumbs, .CB_RoundPixBugFix, #CB_Padding, #CB_ImgContainer, #CB_PrevNext, #CB_ContentHide, #CB_LoadingImage, #CB_Text, #CB_Window, #CB_Image, #CB_TopLeft, #CB_Top, #CB_TopRight, #CB_Left, #CB_Content, #CB_Right, #CB_BtmLeft, #CB_Btm, #CB_BtmRight, #CB_Prev, #CB_Next, #CB_Prev:hover, #CB_Next:hover, #CB_CloseWindow, #CB_SlideShowS, #CB_SlideShowP, #CB_SlideShowBar, #CB_Email { + margin: 0; + padding: 0; + background-color: transparent; + border: 0px; +} + +#CB_ImgHide { + position: absolute; + visibility: hidden; + z-index: 1098; + left: 0px; +} +/* +#CB_ShowTh { + width: 100%; + height: 15%; + visibility: hidden; + position: absolute; + z-index: 1097; + top: 0px; + left: 0px; +} + +#CB_ShowEtc { + width: 100%; + height: 15%; + visibility: hidden; + position: absolute; + z-index: 1097; + top: 15px; + left: 0px; +} + +#CB_Etc { + text-align: center; + display: none; + height: 60px; + padding-top: 10px; + background-color: #fff; + position: absolute; + z-index: 1100; + overflow: hidden; + top: 20px; + left: 0px; +} + +#CB_Thumbs { + display: none; + height: 60px; + padding-top: 10px; + background-color: #777; + position: absolute; + z-index: 1100; + overflow: hidden; + top: 10px; + left: 0px; +} + +#CB_Thumbs2 { + height: 50px; + position: absolute; +} + +.CB_ThumbsImg { + position: absolute; +} +*/ + +.CB_RoundPixBugFix { + display: block; + visibility: hidden; + font-family: arial; + font-size: 1pt; +} + +#CB_ImgContainer { + position: relative; + width: 100%; +} + +#CB_PrevNext { + position: absolute; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + z-index: 1002; +} + +#CB_ContentHide { + position: absolute; + z-index: 1000; + top: 0px; + left: 0px; +} + +#CB_LoadingImage { + position: absolute; + left: 50%; + top: 50%; + margin-left: -12px; + margin-top: -12px; + visibility: hidden; +} + +#CB_Text { + text-align: center; + color: #0000FF; + margin-top: 4px; +/* width: 150px; + overflow: auto; */ +} + +#CB_Text { + position: relative; + top: -6px; +} + +#CB_DetailText, #CB_NoteText { + width: 5px; + background-color: #FFFFFF; + text-align: center; + font-weight: 300; + color: #8800FF; + padding-bottom: 4px; + margin-top: -3px; + margin-bottom: 6px; +} +#CB_DetailText a, #CB_NoteText a, #CB_Txt2 a { + color: #888888; +} +#CB_DetailText a:hover, #CB_NoteText a:hover, #CB_Txt2 a:hover { + color: #AA0000; +} + +#CB_NavBar table { + background-color: #FFFFFF; + text-align: center; + font-weight: 300; + color: #8800FF; + padding-bottom: 4px; + margin-top: -4px; + margin-bottom: 3px; +} +#CB_NavBar table td img{ + border: 0px; +} + +#CB_Window { + /* For IE */ + right:expression( (document.body.clientWidth - CB_ImgWidthOld ) /2 + 'px'); + /* For FF */ + left:50%; + position:absolute; + top:50%; + visibility:hidden; + z-index: 1100; +} + +#CB_Image { + position: relative; +} + +#CB_iFrame { + /* border: red solid 1px; */ + position: absolute; + width: 0px; + height: 0px; + z-index: 1003; +} + +#CB_UrlNotes { + position: absolute; + color: magenta; + width: 0px; + height: 0px; + background: #ffff88; + border: blue solid 1px; + z-index: 1010; +} + +#CB_TopLeft { + background-image:url(../pic/s_topright.png); + background-position:right bottom; +} + +#CB_Top { + background-image:url(../pic/s_top.png); + background-position:left bottom; +} + +#CB_TopRight { + background-image:url(../pic/s_topleft.png); + background-position:left bottom; +} + +#CB_Left { + background-image:url(../pic/s_right.png); + background-position:right top; +} + +#CB_Content { + background-color:#FFFFFF; +} + +#CB_Right { + background-image:url(../pic/s_left.png); + background-position:left top; +} + +#CB_BtmLeft { + background-image:url(../pic/s_btmright.png); + background-position:right top; +} + +#CB_Btm { + background-image:url(../pic/s_btm.png); + background-position:left top; +} + +#CB_BtmRight { + background-image:url(../pic/s_btmleft.png); + background-position:left top; +} + +#CB_Prev, #CB_Next { + background: transparent url(../pic/blank.gif) no-repeat scroll 0%; + display: block; + width: 49%; + cursor: pointer; + outline-style:none; + z-index: 1102; +} + +.CB_TextNav { + margin-left: 30px; + margin-right: 30px; + text-decoration: underline; + color: #aaaaaa; +} + +.CB_TextNav:hover { + margin-left: 30px; + margin-right: 30px; + text-decoration: none; + color: #ff7700; +} + +#CB_Prev { + float: left; + left: 0px; +} + +#CB_Next { + float: right; + left: 0px; +} + +#CB_Prev:hover { +background:transparent url(../pic/prev.gif) no-repeat scroll left 50%; +} + +#CB_Next:hover { +background:transparent url(../pic/next.gif) no-repeat scroll right 50%; +} + + +#CB_NavBar { + position: relative; + top: 10px; +} + +#CB_SlideShowS, #CB_SlideShowP { + position: absolute; +/* top: -4px; */ + top: 2px; + left: 2px; + z-index: 1104; + cursor: pointer; +} + +#CB_MusicOn, #CB_MusicOff { + position: absolute; +/* top: -6px; */ + top: 0px; + left: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_Speak, #CB_Speaker { + position: absolute; +/* top: -6px; */ + top: 0px; + left: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_ZoomOn { + position: absolute; + top: -1px; + right: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_ZoomOff { + position: absolute; + top: -1px; + right: 28px; + z-index: 1104; + cursor: pointer; +} + +#CB_CloseWindow { + position: absolute; + top: 1px; + right: 2px; + z-index: 1104; + cursor: pointer; +} + +#CB_SlideShowBar { + width: 0px; + position: absolute; + top: 5px; +/* left: 22px; */ + left: 2px; + height: 5px; + display: none; +} + +#CB_Email { + position: absolute; + right: 15px; +} +
\ No newline at end of file diff --git a/modules/lightbox/db_schema/db_schema_0_1.php b/modules/lightbox/db_schema/db_schema_0_1.php new file mode 100644 index 0000000000..d826e43d9d --- /dev/null +++ b/modules/lightbox/db_schema/db_schema_0_1.php @@ -0,0 +1,62 @@ +<?php +/** + * Update the LB module database schema from version 0 to version 1 + * + * Version 0: empty database + * Version 1: move the configuration from lb_config.php (PGV 4.2.3 and earlier) to the pgv_site_setting table + * + * The script should assume that it can be interrupted at + * any point, and be able to continue by re-running the script. + * Fatal errors, however, should be allowed to throw exceptions, + * which will be caught by the framework. + * It shouldn't do anything that might take more than a few + * seconds, for systems with low timeout values. + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2009 Greg Roach + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @version $Id$ + */ + +if (!defined('WT_WEBTREES')) { +header('HTTP/1.0 403 Forbidden'); +exit; +} + +define('WT_LB_DB_SCHEMA_0_1', ''); + +if (file_exists(WT_ROOT.'modules/lightbox/lb_config.php')) { + // Use @, in case the lb_config.php file is incomplete/corrupt + @require_once WT_ROOT.'modules/lightbox/lb_config.php'; + @set_site_setting('LB_ENABLED', $mediatab); + @set_site_setting('LB_AL_HEAD_LINKS', $LB_AL_HEAD_LINKS); + @set_site_setting('LB_AL_THUMB_LINKS', $LB_AL_THUMB_LINKS); + @set_site_setting('LB_TT_BALLOON', $LB_TT_BALLOON); + @set_site_setting('LB_ML_THUMB_LINKS', $LB_ML_THUMB_LINKS); + @set_site_setting('LB_MUSIC_FILE', $LB_MUSIC_FILE); + @set_site_setting('LB_SS_SPEED', $LB_SS_SPEED); + @set_site_setting('LB_TRANSITION', $LB_TRANSITION); + @set_site_setting('LB_URL_WIDTH', $LB_URL_WIDTH); + @set_site_setting('LB_URL_HEIGHT', $LB_URL_HEIGHT); + @unlink(WT_ROOT.'modules/lightbox/lb_config.php'); +} + +// Update the version to indicate sucess +set_site_setting($schema_name, $next_version); diff --git a/modules/lightbox/functions/lb_call_js.php b/modules/lightbox/functions/lb_call_js.php new file mode 100644 index 0000000000..2bad11221b --- /dev/null +++ b/modules/lightbox/functions/lb_call_js.php @@ -0,0 +1,111 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +global $tabno, $LB_MUSIC_FILE, $LB_SS_SPEED, $LB_TRANSITION, $TEXT_DIRECTION; + +// Get Javascript variables from lb_config.php --------------------------- +// require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; +// if ($theme_name=="Minimal") { + // Force icon options to "text" when we're dealing with the Minimal theme +// if ($LB_AL_HEAD_LINKS!="none") $LB_AL_HEAD_LINKS = "text"; +// if ($LB_AL_THUMB_LINKS!="none") $LB_AL_THUMB_LINKS = "text"; +// if ($LB_ML_THUMB_LINKS!="none") $LB_ML_THUMB_LINKS = "text"; +// } + + ?> + <script language="javascript" type="text/javascript"> + + var CB_ImgDetails = "<?php print i18n::translate('Details'); ?>"; // = "Details" + var CB_Detail_Info = "<?php print i18n::translate('View this Media Item Details ... Plus other Media Options - MediaViewer page'); ?>"; // = "View this Media Item......etc" + var CB_ImgNotes = "<?php print i18n::translate('Notes'); ?>"; // = "Notes" + var CB_Note_Info = "<?php print ''; ?>"; // = "" + var CB_Pause_SS = "<?php print i18n::translate('Pause Slideshow'); ?>"; // = "Pause Slideshow" + var CB_Start_SS = "<?php print i18n::translate('Start Slideshow'); ?>"; // = "Start Slideshow" + var CB_Music = "<?php print i18n::translate('Turn Music On/Off'); ?>"; // = "Music On/Off " + var CB_Zoom_Off = "<?php print i18n::translate('Disable Zoom'); ?>"; // = "Disable Zoom" + var CB_Zoom_On = "<?php print i18n::translate('Zoom is enabled ... Use mousewheel or i and o keys to zoom in and out'); ?>"; // = "Zoom is Enabled" + var CB_Close_Win = "<?php print i18n::translate('Close Lightbox window'); ?>"; // = "Close Lightbox Window" + var CB_Balloon = "<?php print "false"; ?>"; // Notes Tooltip Balloon or not + + <?php if ($TEXT_DIRECTION=="rtl") { ?> + var CB_Alignm = "<?php print "right"; ?>"; // Notes RTL Tooltip Balloon Text align + var CB_ImgNotes2 = "<?php print i18n::translate('Notes'); ?>"; // Notes RTL Tooltip for Full Image + <?php }else{ ?> + var CB_Alignm = "<?php print "left"; ?>"; // Notes LTR Tooltip Balloon Text align + var CB_ImgNotes2 = "<?php print i18n::translate('Notes'); ?>"; // Notes LTR Tooltip for Full Image + <?php }?> + + <?php if ($LB_MUSIC_FILE == "") { ?> + var myMusic = null; + <?php }else{ ?> + var myMusic = '<?php print $LB_MUSIC_FILE; ?>'; // The music file + <?php } ?> + var CB_SlShowTime = '<?php print $LB_SS_SPEED; ?>'; // Slide show timer + var CB_Animation = '<?php print $LB_TRANSITION; ?>'; // Next/Prev Image transition effect + + </script> + <?php +// ------------------------------------------------------------------------------- +?> +<?php if ($TEXT_DIRECTION == "rtl") { ?> + <script src="modules/lightbox/js/Sound.js" type="text/javascript"></script> + <script src="modules/lightbox/js/clearbox.js" type="text/javascript"></script> + <!--[if lte IE 7]> + <link href ="modules/lightbox/css/album_page_RTL.css" rel="stylesheet" type="text/css" media="screen" /> + <![endif]--> + +<?php }else{ ?> + <script src="modules/lightbox/js/Sound.js" type="text/javascript"></script> + <script src="modules/lightbox/js/clearbox.js" type="text/javascript"></script> + +<?php } ?> + + <script src="modules/lightbox/js/wz_tooltip.js" type="text/javascript"></script> + <script src="modules/lightbox/js/tip_centerwindow.js" type="text/javascript"></script> + <?php if ($TEXT_DIRECTION=="rtl") { ?> + <script src="modules/lightbox/js/tip_balloon_RTL.js" type="text/javascript"></script> + <?php }else{ ?> + <script src="modules/lightbox/js/tip_balloon.js" type="text/javascript"></script> + <?php } ?> + +<?php + + require_once WT_ROOT.'js/prototype.js.htm'; + + +// ------------------------------------------------------------------------------- + +?> diff --git a/modules/lightbox/functions/lb_head.php b/modules/lightbox/functions/lb_head.php new file mode 100644 index 0000000000..ac500d72d7 --- /dev/null +++ b/modules/lightbox/functions/lb_head.php @@ -0,0 +1,265 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox 4.1 + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2007 to 2008 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +global $reorder, $GEDCOM, $LB_AL_HEAD_LINKS; + +$reorder=safe_get('reorder', '1', '0'); + +/* +if (!file_exists("modules/googlemap/defaultconfig.php")) { + $tabno = "7"; +}else{ + $tabno = "8"; +} +*/ +$tabno=safe_get('tab'); + +// The following is temporary, until the handling of the Lightbox Help system +// is adjusted to match the usual webtrees practice +$lbHelpFile = "modules/lightbox/languages/help.".WT_LOCALE.".php"; +if (!file_exists($lbHelpFile)) $lbHelpFile = "modules/lightbox/languages/help_text.en.php"; + +?> + +<script language="javascript" type="text/javascript"> +<!-- + function album_help(OPTS) { + var win01 = window.open("<?php print $lbHelpFile;?>?"+OPTS, "win01", "resizable=1, scrollbars=1, HEIGHT=780, WIDTH=500 "); + win01.focus() + } + + function reorder_media() { + var win02 = window.open( + "edit_interface.php?action=reorder_media&pid=<?php print $pid; ?>", "win02", "resizable=1, menubar=0, scrollbars=1, top=20, HEIGHT=840, WIDTH=450 "); + if (window.focus) {win02.focus();} + } + + function album_add() { + win03 = window.open( + "addmedia.php?action=showmediaform&linktoid=<?php print $pid; ?>", "win03", "resizable=1, scrollbars=1, top=50, HEIGHT=780, WIDTH=600 "); + if (window.focus) {win03.focus();} + } + + function album_link() { + win04 = window.open( + "inverselink.php?linktoid=<?php print $pid; ?>&linkto=person", "win04", "resizable=1, scrollbars=1, top=50, HEIGHT=300, WIDTH=450 "); + win04.focus() + } + + function goto_config_lightbox() { + window.location = "module.php?mod=lightbox&pgvaction=lb_editconfig&pid=<?php print $pid; ?>&gedcom=<?php print $GEDCOM; ?>&tab="+selectedTab; + } +--> +</script> + +<?php + +// Load Lightbox javascript and css files +// require_once WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; + +// Find if indi and family associated media exists and then count them ( $tot_med_ct) +require_once WT_ROOT.'includes/media_reorder_count.php'; + + // If in re-order mode do not show header links, but instead, show drag and drop title. + if (isset($reorder) && $reorder==1){ + echo "<center><b>", i18n::translate('Drag-and-drop thumbnails to re-order media items'), "</b></center>" ; + echo "<br />"; + + }else{ + //Show Lightbox-Album header Links + //print "<br />"; + echo '<table border="0" width="75%"><tr>'; + // print "<td class=\"width10 center wrap\" valign=\"top\"></td>"; + + if ($LB_AL_HEAD_LINKS == "icon" || (!WT_USER_IS_ADMIN && !WT_USER_CAN_EDIT)) { + print "<td>"; + } + + // Configuration + if (WT_USER_IS_ADMIN) { + if ($LB_AL_HEAD_LINKS == "both") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + // print "<a href=\"".encode_url("module.php?mod=lightbox&pgvaction=lb_editconfig&pid={$pid}&gedcom={$GEDCOM}&tab=4")."\">"; + print "<a href=\"javascript:goto_config_lightbox()\">"; + print "<img src=\"modules/lightbox/images/image_edit.gif\" class=\"icon\" title=\"".i18n::translate('Lightbox-Album Configuration')."\" alt=\"".i18n::translate('Lightbox-Album Configuration')."\" /><br />" ; + print "" . i18n::translate('Lightbox-Album Configuration') . " "; + print "</a>"; + print "</td>"; + // print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "text") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript:goto_config_lightbox()\">"; + print "" . i18n::translate('Lightbox-Album Configuration') . " "; + print "</a>"; + print "</td>"; + // print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "icon") { + print " "; + print "<a href=\"javascript:goto_config_lightbox()\">"; + print "<img src=\"modules/lightbox/images/image_edit.gif\" class=\"icon\" title=\"".i18n::translate('Lightbox-Album Configuration')."\" alt=\"".i18n::translate('Lightbox-Album Configuration')."\" />" ; + print "</a>"; + print "\n"; + } + } + + //Add a new multimedia object + if (WT_USER_CAN_EDIT) { + if ($LB_AL_HEAD_LINKS == "both") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: album_add()\"> "; + print "<img src=\"modules/lightbox/images/image_add.gif\" class=\"icon\" title=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" alt=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" /><br />" ; + print "" . i18n::translate('Add a new Media Object') . " "; + print " </a> "; + print "</td>"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "text") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: album_add()\"> "; + print "" . i18n::translate('Add a new Media Object') . " "; + print " </a> "; + print "</td>"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "icon") { + print " "; + print "<a href=\"javascript: album_add()\"> "; + print "<img src=\"modules/lightbox/images/image_add.gif\" class=\"icon\" title=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" alt=\"".i18n::translate('Add a new Multimedia Object to this Individual')."\" />" ; + print "</a>"; + print "\n"; + } + } + + //Link to an existing item + if (WT_USER_CAN_EDIT) { + if ($LB_AL_HEAD_LINKS == "both") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: album_link()\"> "; + print "<img src=\"modules/lightbox/images/image_link.gif\" class=\"icon\" title=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" alt=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" /><br />" ; + print "" . i18n::translate('Link to an existing Media Object') . " "; + print " </a> "; + print "</td>"; + // print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "text") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: album_link()\"> "; + print "" . i18n::translate('Link to an existing Media Object') . " "; + print " </a> "; + print "</td>"; + // print "<td width=\"5%\"> </td>"; + }else if ($LB_AL_HEAD_LINKS == "icon") { + print " "; + print "<a href=\"javascript: album_link()\">"; + print "<img src=\"modules/lightbox/images/image_link.gif\" class=\"icon\" title=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" alt=\"".i18n::translate('Link this Individual to an existing Multimedia Object')."\" />" ; + print "</a> "; + print "\n"; + }else{ + } + } +/* + //Album Reorder Media ( If media exists and is greater than 1 item ) ----- + if (WT_USER_CAN_EDIT && $tot_med_ct>1) { + if ($LB_AL_HEAD_LINKS == "both") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media')."\" alt=\"".i18n::translate('Re-order media')."\" /><br />" ; + print "" . i18n::translate('Re-order media') . " "; + print '</a>'; + print "</td>"; + // print "<input type=\"hidden\" name=\"reorder\" value=\"1\" />"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "text") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "" . i18n::translate('Re-order media') . " "; + print '</a>'; + print "</td>"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "icon") { + print " "; + print "<a href=\"".encode_url(WT_SCRIPT_NAME."?pid={$pid}&tab={$tabno}&reorder=1")."\">" ; + print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media')."\" alt=\"".i18n::translate('Re-order media')."\" />" ; + print '</a>'; + //print "<td width=\"5%\"> </td>"; + } + } +*/ + + //Popup Reorder Media ( If media exists and is greater than 1 item ) ----- + if (WT_USER_CAN_EDIT && $tot_med_ct>1) { + if ($LB_AL_HEAD_LINKS == "both") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: reorder_media()\">" ; + print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media (window)')."\" alt=\"".i18n::translate('Re-order media (window)')."\" /><br />" ; + //print "" . i18n::translate('Re-order media (window)') . " "; + print "" . i18n::translate('Re-order media (window)') . " "; + print '</a>'; + print "</td>"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "text") { + print "<td class=\"width15 center wrap\" valign=\"top\">"; + print "<a href=\"javascript: reorder_media()\">" ; + // print "" . i18n::translate('Re-order media (window)') . " "; + print "" . i18n::translate('Re-order media') . " "; + print '</a>'; + print "</td>"; + //print "<td width=\"5%\"> </td>"; + print "\n"; + }else if ($LB_AL_HEAD_LINKS == "icon") { + print " "; + print "<a href=\"javascript: reorder_media()\">" ; + print "<img src=\"modules/lightbox/images/images.gif\" class=\"icon\" title=\"".i18n::translate('Re-order media (window)')."\" alt=\"".i18n::translate('Re-order media (window)')."\" /><br />" ; + print '</a>'; + //print "<td width=\"5%\"> </td>"; + print "\n"; + } + } + + + if ($LB_AL_HEAD_LINKS == "icon" || (!WT_USER_IS_ADMIN && !WT_USER_CAN_EDIT)) { + print "</td>"; + } + + print "</tr></table>"; + } +?> diff --git a/modules/lightbox/functions/lb_horiz_sort.php b/modules/lightbox/functions/lb_horiz_sort.php new file mode 100644 index 0000000000..b3fde0b940 --- /dev/null +++ b/modules/lightbox/functions/lb_horiz_sort.php @@ -0,0 +1,103 @@ +<?php +/** + * Lightbox Album Include for Horizontal Album sort + * + * Various printing functions used to print fact records + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +/* + <script type="text/javascript" src="js/conio/prototype.js"></script> + <script type="text/javascript" src="js/scriptaculous/scriptaculous.js"></script> +*/ +?> + <script language="JavaScript"> + function getGroupOrder() { + // var sections = document.getElementsByClassName('section'); + var sections = $$('.section'); + + var alerttext = ''; + var order = ''; + + sections.each(function(section) { + order += Sortable.sequence(section) + ','; + alerttext = order; + }); + alert(alerttext); + return false; + } + + </script> + + <style type="text/css"> + + body, div { + font-family: Arial, Helvetica; + font-size: 12px; + } + + ul { + width: 100%; + list-style-type:none; + color: black; + } + + li.facts_value { + padding: 2px; + cursor: move; + border: none; + text-align: center; + } + + </style> + +<script type="text/javascript"> +// <![CDATA[ + //sections = [ 'group1','group2' ]; + + <?php if ($rownum1>0) { ?> + Sortable.create( 'thumblist_1', { tag:'li', dropOnEmpty: false, constraint: false, only:'facts_value' } ); + <?php } ?> + <?php if ($rownum2>0) { ?> + Sortable.create( 'thumblist_2', { tag:'li', dropOnEmpty: false, constraint: false, only:'facts_value' } ); + <?php } ?> + <?php if ($rownum3>0) { ?> + Sortable.create( "thumblist_3", { tag:'li', dropOnEmpty: false, constraint: false, only:'facts_value' } ); + <?php } ?> + <?php if ($rownum4>0) { ?> + Sortable.create( "thumblist_4", { tag:'li', dropOnEmpty: false, constraint: false, only:'facts_value' } ); + <?php } ?> + +// Sortable.create( "thumblist", { tag:'li', dropOnEmpty: false, constraint: false, only:'facts_value' } ); + // ]]> +</script> + diff --git a/modules/lightbox/functions/lb_indi_doors_0.php b/modules/lightbox/functions/lb_indi_doors_0.php new file mode 100644 index 0000000000..e4ffec603e --- /dev/null +++ b/modules/lightbox/functions/lb_indi_doors_0.php @@ -0,0 +1,68 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +?> + <dd id="door1"><a href="javascript:;" onclick="tabswitch(1); return false;" ><?php echo i18n::translate('Personal Facts and Details')?></a></dd> + <dd id="door2"><a href="javascript:;" onclick="tabswitch(2); return false;" ><?php echo i18n::translate('Notes')?></a></dd> + <dd id="door3"><a href="javascript:;" onclick="tabswitch(3); return false;" ><?php echo i18n::translate('Sources')?></a></dd> +<?php + if ($MULTI_MEDIA){ + if (!file_exists("modules/googlemap/defaultconfig.php")) { ?> + <?php if (file_exists("modules/lightbox/album.php") ) {?> + <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); return false;" ><?php print i18n::translate('Album') ?></a></dd> + <?php } + }elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> + <?php if (file_exists("modules/lightbox/album.php") ) {?> + <dd id="door9"><a href="javascript:;" onclick="tabswitch(9); return false;" ><?php print i18n::translate('Album') ?></a></dd> + <?php } + } + } + ?> + + <dd id="door5"><a href="javascript:;" onclick="tabswitch(5); return false;" ><?php print i18n::translate('Close Relatives')?></a></dd> + <dd id="door6"><a href="javascript:;" onclick="tabswitch(6); return false;" ><?php print i18n::translate('Tree')?></a></dd> + <dd id="door7"><a href="javascript:;" onclick="tabswitch(7); return false;" ><?php print i18n::translate('Research Assistant')?></a></dd> + <?php if (file_exists("modules/googlemap/defaultconfig.php")) { ?> + <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); if (loadedTabs[8]) {ResizeMap(); ResizeMap();} return false;" ><?php print i18n::translate('Map')?></a></dd> + <?php } ?> +<!-- <dd id="door10"><a href="javascript:;" onclick="tabswitch(10); return false;" ><?php print "Spare Tab" ?></a></dd> --> + <dd id="door0"><a href="javascript:;" onclick="tabswitch(0); if (loadedTabs[8]) {ResizeMap(); ResizeMap();} return false;" ><?php print i18n::translate('ALL')?></a></dd> + + + + + diff --git a/modules/lightbox/functions/lb_indi_doors_1.php b/modules/lightbox/functions/lb_indi_doors_1.php new file mode 100644 index 0000000000..323c142da2 --- /dev/null +++ b/modules/lightbox/functions/lb_indi_doors_1.php @@ -0,0 +1,71 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +?> + <dd id="door1"><a href="javascript:;" onclick="tabswitch(1); return false;" ><?php echo i18n::translate('Personal Facts and Details')?></a></dd> + <dd id="door2"><a href="javascript:;" onclick="tabswitch(2); return false;" ><?php echo i18n::translate('Notes')?></a></dd> + <dd id="door3"><a href="javascript:;" onclick="tabswitch(3); return false;" ><?php echo i18n::translate('Sources')?></a></dd> + +<?php + if ($MULTI_MEDIA){ + if (!file_exists("modules/googlemap/defaultconfig.php")) { ?> + <?php if (file_exists("modules/lightbox/album.php") ) {?> + <dd id="door4"><a href="javascript:;" onclick="tabswitch(4); return false;" ><?php print i18n::translate('Media') ?></a></dd> + <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); return false;" ><?php print i18n::translate('Album') ?></a></dd> + <?php } + }elseif (file_exists("modules/googlemap/defaultconfig.php")) { ?> + <?php if (file_exists("modules/lightbox/album.php") ) {?> + <dd id="door4"><a href="javascript:;" onclick="tabswitch(4); return false;" ><?php print i18n::translate('Media') ?></a></dd> + <dd id="door9"><a href="javascript:;" onclick="tabswitch(9); return false;" ><?php print i18n::translate('Album') ?></a></dd> + <?php } + } + } + ?> + + <dd id="door5"><a href="javascript:;" onclick="tabswitch(5); return false;" ><?php print i18n::translate('Close Relatives')?></a></dd> + <dd id="door6"><a href="javascript:;" onclick="tabswitch(6); return false;" ><?php print i18n::translate('Tree')?></a></dd> + <dd id="door7"><a href="javascript:;" onclick="tabswitch(7); return false;" ><?php print i18n::translate('Research Assistant')?></a></dd> + <?php if (file_exists("modules/googlemap/defaultconfig.php")) { ?> + <dd id="door8"><a href="javascript:;" onclick="tabswitch(8); if (loadedTabs[8]) {ResizeMap(); ResizeMap();} return false;" ><?php print i18n::translate('Map')?></a></dd> + <?php } ?> +<!-- <dd id="door10"><a href="javascript:;" onclick="tabswitch(10); return false;" ><?php print "Spare Tab" ?></a></dd> --> + + <dd id="door0"><a href="javascript:;" onclick="tabswitch(0); if (loadedTabs[8]) {ResizeMap(); ResizeMap();} return false;" ><?php print i18n::translate('ALL')?></a></dd> + + + + diff --git a/modules/lightbox/functions/lb_indi_tabs_0.php b/modules/lightbox/functions/lb_indi_tabs_0.php new file mode 100644 index 0000000000..f7b46cd587 --- /dev/null +++ b/modules/lightbox/functions/lb_indi_tabs_0.php @@ -0,0 +1,49 @@ +<?php +/** + * Individual Page + * + * Display all of the information about an individual + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Charts + * @version $Id$ + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +if (file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','lightbox2','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false,false); +<?php }else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); +<?php }else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','lightbox2','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); +<?php }else{ ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false); +<?php } ?> diff --git a/modules/lightbox/functions/lb_indi_tabs_1.php b/modules/lightbox/functions/lb_indi_tabs_1.php new file mode 100644 index 0000000000..f7b46cd587 --- /dev/null +++ b/modules/lightbox/functions/lb_indi_tabs_1.php @@ -0,0 +1,49 @@ +<?php +/** + * Individual Page + * + * Display all of the information about an individual + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Charts + * @version $Id$ + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +if (file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','lightbox2','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false,false); +<?php }else if (file_exists("modules/googlemap/defaultconfig.php") && !file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','googlemap','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); +<?php }else if (!file_exists("modules/googlemap/defaultconfig.php") && file_exists("modules/lightbox/album.php")) { ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','lightbox2','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false,false); +<?php }else{ ?> + var tabid = new Array('0','facts','notes','sources','media','relatives','tree','researchlog','spare'); + var loadedTabs = new Array(false,false,false,false,false,false,false,false,false); +<?php } ?> diff --git a/modules/lightbox/functions/lb_link.php b/modules/lightbox/functions/lb_link.php new file mode 100644 index 0000000000..82606b8633 --- /dev/null +++ b/modules/lightbox/functions/lb_link.php @@ -0,0 +1,98 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + + // Set Link + /** + * Generate link flyout menu + * + * @param string $mediaid + */ +// function print_link_menu2($mediaid) { + $mediaid=$media["XREF"]; + global $TEXT_DIRECTION; + + $classSuffix = ""; + if ($TEXT_DIRECTION=="rtl") $classSuffix = "_rtl"; + + // main link displayed on page + $menu = new Menu(); + if ($LB_ML_THUMB_LINKS == "icon" || $LB_ML_THUMB_LINKS == "both") { + $menu->addIcon("modules/lightbox/images/image_link.gif"); + } + if ($LB_ML_THUMB_LINKS == "both") { + $menu->addLabel(i18n::translate('Set link'), "down"); + } + if ($LB_ML_THUMB_LINKS == "text") { + $menu->addLabel(i18n::translate('Set link')); + } + $menu->addOnclick("return ilinkitem('$mediaid','person')"); + $menu->addClass("", "", "submenu"); + $menu->addFlyout("left"); + + $submenu = new Menu(i18n::translate('To Person'), "#"); + $submenu->addOnclick("return ilinkitem('$mediaid','person')"); + $submenu->addClass("submenuitem".$classSuffix, "submenuitem".$classSuffix); + $menu->addSubMenu($submenu); + + $submenu = new Menu(i18n::translate('To Family'), "#"); + $submenu->addOnclick("return ilinkitem('$mediaid','family')"); + $submenu->addClass("submenuitem".$classSuffix, "submenuitem".$classSuffix); + $menu->addSubMenu($submenu); + + $submenu = new Menu(i18n::translate('To Source'), "#"); + $submenu->addOnclick("return ilinkitem('$mediaid','source')"); + $submenu->addClass("submenuitem".$classSuffix, "submenuitem".$classSuffix); + $menu->addSubMenu($submenu); + + $menu->printMenu(); +?> +<script language="JavaScript" type="text/javascript"> + function ilinkitem(mediaid, type) { + window.open('inverselink.php?mediaid='+mediaid+'&linkto='+type+'&'+sessionname+'='+sessionid, '_blank', 'top=50,left=50,width=400,height=300,resizable=1,scrollbars=1'); + return false; + } +</script> +<?php + +// } + + // Only set link on media that is in the DB +// if ($media["XREF"] != "") { +// print_link_menu($media2["XREF"]); +// } + +?> diff --git a/modules/lightbox/functions/lightbox_print_media.php b/modules/lightbox/functions/lightbox_print_media.php new file mode 100644 index 0000000000..16078d9b73 --- /dev/null +++ b/modules/lightbox/functions/lightbox_print_media.php @@ -0,0 +1,418 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2007 to 2009 PGV Development Team. All rights reserved. + * + * Modifications Copyright (c) 2010 Greg Roach + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + * + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +/** + * ----------------------------------------------------------------------------- + * Print the links to multi-media objects + * @param string $pid The the xref id of the object to find media records related to + * @param int $level The level of media object to find + * @param boolean $related Whether or not to grab media from related records + */ +function lightbox_print_media($pid, $level=1, $related=false, $kind=1, $noedit=false) { + + $edit="1"; + $n=1; + $fn=1; + + global $MULTI_MEDIA, $TBLPREFIX, $SHOW_ID_NUMBERS, $MEDIA_EXTERNAL; + global $pgv_changes; + global $GEDCOM, $MEDIATYPE; + global $WORD_WRAPPED_NOTES, $MEDIA_DIRECTORY, $WT_IMAGE_DIR, $WT_IMAGES, $TEXT_DIRECTION; + + global $is_media, $cntm1, $cntm2, $cntm3, $cntm4, $t, $mgedrec; + global $res, $typ2b, $edit, $tabno, $n, $item, $items, $p, $note, $rowm, $note_text, $reorder; + global $action, $order, $order2, $rownum, $rownum1, $rownum2, $rownum3, $rownum4, $media_data, $sort_i; + + global $GEDCOM_ID_PREFIX; + $ged_id=get_id_from_gedcom($GEDCOM); + + if (!showFact("OBJE", $pid)) return false; + if (!isset($pgv_changes[$pid."_".$GEDCOM])) $gedrec = find_gedcom_record($pid, $ged_id); + else $gedrec = find_updated_record($pid, $ged_id); + $ids = array($pid); + + //-- find all of the related ids + if ($related) { + $ct = preg_match_all("/1 FAMS @(.*)@/", $gedrec, $match, PREG_SET_ORDER); + for ($i=0; $i<$ct; $i++) { + $ids[] = trim($match[$i][1]); + } + } + + //LBox -- if exists, get a list of the sorted current objects in the indi gedcom record - (1 _WT_OBJS @xxx@ .... etc) ---------- + $sort_current_objes = array(); + if ($level>0) $sort_regexp = "/".$level." _WT_OBJS @(.*)@/"; + else $sort_regexp = "/_WT_OBJS @(.*)@/"; + $sort_ct = preg_match_all($sort_regexp, $gedrec, $sort_match, PREG_SET_ORDER); + for ($i=0; $i<$sort_ct; $i++) { + if (!isset($sort_current_objes[$sort_match[$i][1]])) $sort_current_objes[$sort_match[$i][1]] = 1; + else $sort_current_objes[$sort_match[$i][1]]++; + $sort_obje_links[$sort_match[$i][1]][] = $sort_match[$i][0]; + } + + // create ORDER BY list from Gedcom sorted records list --------------------------- + $orderbylist = 'ORDER BY '; // initialize + foreach ($sort_match as $id) { + $orderbylist .= "m_media='$id[1]' DESC, "; + } + $orderbylist = rtrim($orderbylist, ', '); + // --------------------------------------------------------------------------------------------------------------------------------------------------- + + //-- get a list of the current objects in the record + $current_objes = array(); + if ($level>0) $regexp = "/".$level." OBJE @(.*)@/"; + else $regexp = "/OBJE @(.*)@/"; + $ct = preg_match_all($regexp, $gedrec, $match, PREG_SET_ORDER); + for ($i=0; $i<$ct; $i++) { + if (!isset($current_objes[$match[$i][1]])) { + $current_objes[$match[$i][1]] = 1; + } else { + $current_objes[$match[$i][1]]++; + } + $obje_links[$match[$i][1]][] = $match[$i][0]; + } + + $media_found = false; + + // Get the related media items + $sqlmm = "SELECT DISTINCT "; + $sqlmm .= "m_media, m_ext, m_file, m_titl, m_gedfile, m_gedrec, mm_gid, mm_gedrec FROM ".$TBLPREFIX."media, ".$TBLPREFIX."media_mapping where "; + $sqlmm .= "mm_gid IN ("; + $vars=array(); + foreach ($ids as $id) { + $sqlmm .= "?, "; + $vars[]=$id; + } + $sqlmm = rtrim($sqlmm, ', '); + $sqlmm .= ") AND mm_gedfile=? AND mm_media=m_media AND mm_gedfile=m_gedfile "; + $vars[]=WT_GED_ID; + //-- for family and source page only show level 1 obje references + if ($level>0) { + $sqlmm .= "AND mm_gedrec LIKE ?"; + $vars[]="$level OBJE%"; + } + + // Set type of media from call in album + switch ($kind) { + case 1: + $tt=i18n::translate('Photo'); + $sqlmm.="AND (m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ?)"; + $vars[]='%TYPE photo%'; + $vars[]='%TYPE map%'; + $vars[]='%TYPE painting%'; + $vars[]='%TYPE tombstone%'; + break; + case 2: + $tt=i18n::translate('Document'); + $sqlmm.="AND (m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ?)"; + $vars[]='%TYPE card%'; + $vars[]='%TYPE certificate%'; + $vars[]='%TYPE document%'; + $vars[]='%TYPE magazine%'; + $vars[]='%TYPE manuscript%'; + $vars[]='%TYPE newspaper%'; + break; + case 3: + $tt=i18n::translate('Census'); + $sqlmm.="AND (m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ?)"; + $vars[]='%TYPE electronic%'; + $vars[]='%TYPE fiche%'; + $vars[]='%TYPE film%'; + break; + case 4: + $tt=i18n::translate('Other'); + $sqlmm.="AND (m_gedrec NOT LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ? OR m_gedrec LIKE ?)"; + $vars[]='%TYPE %'; + $vars[]='%TYPE coat%'; + $vars[]='%TYPE book%'; + $vars[]='%TYPE audio%'; + $vars[]='%TYPE video%'; + $vars[]='%TYPE other%'; + break; + case 5: + default: + $tt = i18n::translate('Not in DB'); + break; + } + + if ($sort_ct>0) { + $sqlmm .= $orderbylist; + } else { + $sqlmm .= " ORDER BY mm_gid DESC "; + } + + $rows=WT_DB::prepare($sqlmm)->execute($vars)->fetchAll(PDO::FETCH_ASSOC); + $foundObjs = array(); + $numm = count($rows); + + // Begin to Layout the Album Media Rows + if ($numm>0 || $kind==5) { + if ($kind!=5) { + echo "\n\n"; + echo "<table cellpadding=\"0\" border=\"0\" width=\"100%\" class=\"facts_table\"><tr>", "\n"; + + echo '<td width="100" align="center" class="descriptionbox" style="vertical-align:middle;">'; + echo "<b>{$tt}</b>"; + echo '</td>'; + + echo '<td class="facts_value" >'; + echo '<table class="facts_table" width="100%" cellpadding="0"><tr><td >' . "\n"; + echo "<div id=\"thumbcontainer", $kind, "\">" . "\n"; + echo "<ul class=\"section\" id=\"thumblist_", $kind, "\">" . "\n\n"; + } + + // Album Reorder include ============================= + // Following used for Album media sort ------------------ + $reorder=safe_get('reorder', '1', '0'); + if ($reorder==1) { + if ($kind==1) $rownum1=$numm; + if ($kind==2) $rownum2=$numm; + if ($kind==3) $rownum3=$numm; + if ($kind==4) $rownum4=$numm; + if ($kind==5) include 'modules/lightbox/functions/lb_horiz_sort.php'; + } + // ================================================== + + // Start pulling media items into thumbcontainer div ============================== + foreach ($rows as $rowm) { + if (isset($foundObjs[$rowm['m_media']])) { + if (isset($current_objes[$rowm['m_media']])) { + $current_objes[$rowm['m_media']]--; + } + continue; + } + // NOTE: Determine the size of the mediafile + $imgwidth = 300+40; + $imgheight = 300+150; + if (isFileExternal($rowm["m_file"])) { + if (in_array($rowm["m_ext"], $MEDIATYPE)) { + $imgwidth = 400+40; + $imgheight = 500+150; + } else { + $imgwidth = 800+40; + $imgheight = 400+150; + } + } else if (media_exists(check_media_depth($rowm["m_file"], "NOTRUNC"))) { + $imgsize = findImageSize(check_media_depth($rowm["m_file"], "NOTRUNC")); + $imgwidth = $imgsize[0]+40; + $imgheight = $imgsize[1]+150; + } + $rows=array(); + + + //-- if there is a change to this media item then get the + //-- updated media item and show it + if (isset($pgv_changes[$rowm["m_media"]."_".$GEDCOM][0]["gid"]) && $kind!=5 ) { + $newrec = find_updated_record($rowm["m_media"], $ged_id); + $row = array(); + $row['m_media'] = $rowm["m_media"]; + $row['m_file'] = get_gedcom_value("FILE", 1, $newrec); + $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec); + if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec); + $row['m_gedrec'] = $newrec; + $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch); + $ext = ""; + if ($et>0) $ext = substr(trim($ematch[1]), 1); + $row['m_ext'] = $ext; + $row['mm_gid'] = $pid; + $row['mm_gedrec'] = $rowm["mm_gedrec"]; + $rows['new'] = $row; + $rows['old'] = $rowm; + } else { + if (!isset($current_objes[$rowm['m_media']]) && ($rowm['mm_gid']==$pid)) { + $rows['old'] = $rowm; + } else { + $rows['normal'] = $rowm; + if (isset($current_objes[$rowm['m_media']])) { + $current_objes[$rowm['m_media']]--; + } + } + } + + foreach ($rows as $rtype => $rowm) { + if ($kind!=5) { + $res = lightbox_print_media_row($rtype, $rowm, $pid); + } + $media_found = $media_found || $res; + $foundObjs[$rowm['m_media']]=true; + } + } + + // ===================================================================================== + //-- Objects are removed from the $current_objes list as they are printed. + //-- Any "Extra" objects left in the list are new objects recently added to the gedcom + //-- but not yet accepted into the database. + //-- We will print them too, and put any "Extra Items not in DB" into a new Row. + + // Firstly, get count of Items in Database for this Individual + $indiobjs = "SELECT DISTINCT "; + $indiobjs .= "m_media, m_ext, m_file, m_titl, m_gedfile, m_gedrec, mm_gid, mm_gedrec FROM {$TBLPREFIX}media, {$TBLPREFIX}media_mapping where "; + $indiobjs .= "mm_gid=? "; + $indiobjs .= "AND mm_gedfile=? AND mm_media=m_media AND mm_gedfile=m_gedfile "; + $vars2=array($pid, WT_GED_ID); + $rows=WT_DB::prepare($indiobjs)->execute($vars2)->fetchAll(PDO::FETCH_ASSOC); + $foundObjs = array(); + $numindiobjs = count($rows); + + // Compare Items count in Database versus Item count in GEDCOM + if ($kind==5 && $ct!=$numindiobjs) { + // If any items are left in $current_objes list for this individual, put them into $kind 5 ("Not in DB") row + echo "\n\n"; + echo "<table cellpadding=\"0\" border=\"0\" width=\"100%\" class=\"facts_table\"><tr>", "\n"; + echo '<td width="100" align="center" class="descriptionbox" style="vertical-align:middle;">'; + echo "<b>{$tt}</b>"; + echo '</td>'; + echo '<td class="facts_value" >'; + echo '<table class="facts_table" width="100%" cellpadding="0"><tr><td >' . "\n"; + echo "<div id=\"thumbcontainer", $kind, "\">" . "\n"; + echo "<ul class=\"section\" id=\"thumblist_", $kind, "\">" . "\n\n"; + foreach ($current_objes as $media_id=>$value) { + while ($value>0) { + $objSubrec = array_pop($obje_links[$media_id]); + //-- check if we need to get the object from a remote location + $ct = preg_match("/(.*):(.*)/", $media_id, $match); + if ($ct>0) { + require_once WT_ROOT.'includes/classes/class_serviceclient.php'; + $client = ServiceClient::getInstance($match[1]); + if (!is_null($client)) { + $newrec = $client->getRemoteRecord($match[2]); + $row['m_media'] = $media_id; + $row['m_file'] = get_gedcom_value("FILE", 1, $newrec); + $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec); + if (empty($row['m_titl'])) { + $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec); + } + $row['m_gedrec'] = $newrec; + $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch); + $ext = ""; + if ($et>0) $ext = substr(trim($ematch[1]), 1); + $row['m_ext'] = $ext; + $row['mm_gid'] = $pid; + $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec); + if ($newrec && isset($rowm['m_file'])) { + // ----- + } else { + echo "<li class=\"li_new\" >"; + echo "<center><table class=\"pic\" border=\"0\" ></center>"; + echo "<tr><td align=\"center\" colspan=\"4\">"; + echo $row['m_media']; + echo "</td></tr>"; + + $res = lightbox_print_media_row('new', $row, $pid); + $media_found = $media_found || $res; + } + } + } else { + $row = array(); + $newrec = find_updated_record($media_id, $ged_id); + if (empty($newrec)) { + $newrec = find_media_record($media_id, $ged_id); + } + $row['m_media'] = $media_id; + $row['m_file'] = get_gedcom_value("FILE", 1, $newrec); + $row['m_titl'] = get_gedcom_value("TITL", 1, $newrec); + if (empty($row['m_titl'])) { + $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec); + } + $row['m_gedrec'] = $newrec; + $et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch); + $ext = ""; + if ($et>0) { + $ext = substr(trim($ematch[1]), 1); + } + $row['m_ext'] = $ext; + $row['mm_gid'] = $pid; + $row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec); + if ($newrec && isset($rowm['m_file'])) { + // ----- + } else { + echo "<li class=\"li_new\" >"; + echo "<center><table class=\"pic\" border=\"0\" ></center>"; + echo "<tr><td align=\"center\" colspan=\"4\">"; + echo $row['m_media']; + echo "</td></tr>"; + + $res = lightbox_print_media_row('new', $row, $pid); + $media_found = $media_found || $res; + } + } + $value--; + } + } + } + + // No "Extra" Media Items ============================ + if ($kind==5 && $ct==$numindiobjs) { + // "Extra" Media Item in GEDCOM but NOT in DB ======== + } else if ($kind==5 && $ct!=$numindiobjs) { + echo "</ul>"; + echo "</div>"; + echo "<div class=\"clearlist\">"; + echo "</div>"; + echo '</td></tr></table>' . "\n"; + echo '</td>'. "\n"; + echo '</tr>'; + echo '</table>' . "\n\n"; + // Media Item in GEDCOM & in DB ====================== + } else { + echo "</ul>"; + echo "</div>"; + echo "<div class=\"clearlist\">"; + echo "</div>"; + echo '</td></tr></table>' . "\n"; + if ($kind==3 && $numm > 0) { + echo "<font size='1'>"; + echo i18n::translate('"UK census images have been obtained from "The National Archives", the custodian of the original records, and appear here with their approval on the condition that no commercial use is made of them without permission. +Requests for commercial publication of these or other UK census images appearing on this website should be directed to: Image Library, The National Archives, Kew, Surrey, TW9 4DU, United Kingdom." +'); + echo "</font>"; + } + echo '</td>'. "\n"; + echo '</tr>'; + echo '</table>' . "\n\n"; + } + + } + + if ($media_found) return $is_media="YES" ; + else return $is_media="NO" ; + +} +?> diff --git a/modules/lightbox/functions/lightbox_print_media_row.php b/modules/lightbox/functions/lightbox_print_media_row.php new file mode 100644 index 0000000000..1a265bd795 --- /dev/null +++ b/modules/lightbox/functions/lightbox_print_media_row.php @@ -0,0 +1,360 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox 4.1 + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2007 to 2009 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +/** + * print a media row in a table + * @param string $rtype whether this is a 'new', 'old', or 'normal' media row... this is used to determine if the rows should be printed with an outline color + * @param array $rowm An array with the details about this media item + * @param string $pid The record id this media item was attached to + */ +function lightbox_print_media_row($rtype, $rowm, $pid) { + + global $WT_IMAGE_DIR, $WT_IMAGES, $MEDIA_DIRECTORY, $TEXT_DIRECTION; + global $SHOW_ID_NUMBERS, $GEDCOM, $THUMBNAIL_WIDTH, $USE_MEDIA_VIEWER; + global $SEARCH_SPIDER; + global $t, $n, $item, $items, $p, $edit, $SERVER_URL, $reorder, $LB_AL_THUMB_LINKS, $note; + global $LB_URL_WIDTH, $LB_URL_HEIGHT, $order1, $sort_i, $notes, $q, $LB_TT_BALLOON, $theme_name ; + global $SERVER_URL; + + $reorder=safe_get('reorder', '1', '0'); + + $mainMedia = check_media_depth($rowm["m_file"], "NOTRUNC"); + // If media file is missing from "media" directory, but is referenced in Gedcom + if (!media_exists($mainMedia)) { + if (!file_exists($rowm['m_file']) && !isset($rowm['m_file'])) { + print "<tr>"; + print "<td valign=\"top\" rowspan=\"2\" >"; + print "<img src=\"modules/lightbox/images/transp80px.gif\" height=\"82px\" alt=\"\"></img>"; + print "</td>". "\n"; + print "<td class=\"description_box\" valign=\"top\" colspan=\"3\" nowrap=\"nowrap\" >"; + print "<center><br /><img src=\"themes/" . strtolower($theme_name) . "/images/media.gif\" height=\"30\" border=\"0\" />"; + print "<font size=\"1\"><br />" . i18n::translate('File not found.') . "</font></center>"; + print "</td>"; + print "</tr>". "\n"; + } else if (!file_exists($rowm['m_file'])) { + print "<li class=\"li_norm\" >"; + print "<table class=\"pic\" width=\"50px\" border=\"0\" >"; + print "<tr>"; + print "<td valign=\"top\" rowspan=\"2\" >"; + print "<img src=\"modules/lightbox/images/transp80px.gif\" height=\"100px\" alt=\"\"></img>"; + print "</td>". "\n"; + print "<td class=\"description_box\" valign=\"top\" colspan=\"3\" nowrap=\"nowrap\" >"; + print "<center><br /><img src=\"themes/" . strtolower($theme_name) . "/images/media.gif\" height=\"30\" border=\"0\" />"; + print "<font size=\"1\"><br />" . i18n::translate('File not found.') . "</font></center>"; + print "</td>"; + print "</tr>". "\n"; + + } else { + print "<li class=\"li_norm\" >"; + print "<table class=\"pic\" width=\"50px\" border=\"0\" >"; + } + // Else Media files are present in "media" directory + } else { + //If media is linked to a 'private' person + if (!displayDetailsById($rowm['m_media'], 'OBJE') || FactViewRestricted($rowm['m_media'], $rowm['m_gedrec'])) { + return false; + } else { + // Media is NOT linked to private person + // If reorder media has been clicked + if (isset($reorder) && $reorder==1) { + print "<li class=\"facts_value\" style=\"border:0px;\" id=\"li_" . $rowm['m_media'] . "\" >"; + + // Else If reorder media has NOT been clicked + // Highlight Album Thumbnails - Changed=new (blue), Changed=old (red), Changed=no (none) + } else if ($rtype=='new'){ + print "<li class=\"li_new\">" . "\n"; + } else if ($rtype=='old'){ + print "<li class=\"li_old\">" . "\n"; + } else { + print "<li class=\"li_norm\">" . "\n"; + } + } + } + + // Add blue or red borders + $styleadd=""; + if ($rtype=='new') $styleadd = "change_new"; + if ($rtype=='old') $styleadd = "change_old"; + + // NOTE Start printing the media details + if (!media_exists($mainMedia)) { + if (!media_exists($rowm['m_file'])) { + $thumbnail = ""; + $isExternal = ""; // isFileExternal($thumbnail); + } else { + $thumbnail = thumbnail_file($rowm["m_file"], true, false, $pid); + $isExternal = isFileExternal($thumbnail); + } + } else { + $thumbnail = thumbnail_file($mainMedia, true, false, $pid); + $isExternal = isFileExternal($thumbnail); + // echo $thumbnail; + } + $linenum = 0; + + // If Fact details can be shown -------------------------------------------------------------------------------------------- + if (showFactDetails("OBJE", $pid)) { + + // Get the title of the media + $media=Media::getInstance($rowm["m_media"]); + $rawTitle = $rowm["m_titl"]; + if (empty($rawTitle)) $rawTitle = get_gedcom_value("TITL", 2, $rowm["mm_gedrec"]); + if (empty($rawTitle)) $rawTitle = basename($rowm["m_file"]); + $mediaTitle = PrintReady(htmlspecialchars($rawTitle)); + + $mainMedia = check_media_depth($rowm["m_file"], "NOTRUNC"); + $mainFileExists = true; + $imgsize = findImageSize($mainMedia); + $imgwidth = $imgsize[0]+40; + $imgheight = $imgsize[1]+150; + + // Get the tooltip link for source + $sour = get_gedcom_value("SOUR", 1, $rowm["m_gedrec"]); + + //Get media item Notes + $haystack = $rowm["m_gedrec"]; + $needle = "1 NOTE"; + $before = substr($haystack, 0, strpos($haystack, $needle)); + $after = substr(strstr($haystack, $needle), strlen($needle)); + $final = $before.$needle.$after; + $notes = PrintReady(htmlspecialchars(addslashes(print_fact_notes($final, 1, true, true)),ENT_COMPAT,'UTF-8')); + + // Get info on how to handle this media file + $mediaInfo = mediaFileInfo($mainMedia, $thumbnail, $rowm["m_media"], $mediaTitle, $notes); + + //text alignment for Tooltips + if ($TEXT_DIRECTION=="rtl") { + $alignm = "right"; + $left = "true"; + } else { + $alignm = "left"; + $left = "false"; + } + + // Tooltip Options + $tt_opts = ", BALLOON," . $LB_TT_BALLOON ; + $tt_opts .= ", LEFT," . $left . ""; + $tt_opts .= ", ABOVE, true"; + $tt_opts .= ", TEXTALIGN, '" . $alignm . "'"; + $tt_opts .= ", WIDTH, -480 "; + $tt_opts .= ", BORDERCOLOR, ''"; + $tt_opts .= ", TITLEBGCOLOR, ''"; + $tt_opts .= ", CLOSEBTNTEXT, 'X'"; + $tt_opts .= ", CLOSEBTN, false"; + $tt_opts .= ", CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000']"; + $tt_opts .= ", OFFSETX, -30"; + $tt_opts .= ", OFFSETY, 110"; + $tt_opts .= ", STICKY, true"; + $tt_opts .= ", PADDING, 6"; + $tt_opts .= ", CLICKCLOSE, true"; + $tt_opts .= ", DURATION, 8000"; + $tt_opts .= ", BGCOLOR, '#f3f3f3'"; + $tt_opts .= ", JUMPHORZ, 'true' "; + $tt_opts .= ", JUMPVERT, 'false' "; + $tt_opts .= ", DELAY, 0"; + + // Prepare Below Thumbnail menu ---------------------------------------------------- + if ($TEXT_DIRECTION== "rtl") { + $submenu_class = "submenuitem_rtl"; + $submenu_hoverclass = "submenuitem_hover_rtl"; + } else { + $submenu_class = "submenuitem"; + $submenu_hoverclass = "submenuitem_hover"; + } + $menu = new Menu(); + // Truncate media title to 13 chars and add ellipsis + $mtitle = $rawTitle; + if (utf8_strlen($rawTitle)>16) $mtitle = utf8_substr($rawTitle, 0, 13).i18n::translate('…'); + $mtitle = PrintReady(htmlspecialchars($mtitle)); + + // Continue menu construction + // If media file is missing from "media" directory, but is referenced in Gedcom + if (!media_exists($rowm['m_file']) && !media_exists($mainMedia)) { + $menu->addLabel("\n<img src=\"{$thumbnail}\" style=\"display:none;\" alt=\"\" title=\"\" />" . i18n::translate('Edit')." (". $rowm["m_media"].")" . "\n", "right"); + } else { + $menu->addLabel("\n<img src=\"{$thumbnail}\" style=\"display:none;\" alt=\"\" title=\"\" />" . PrintReady($mtitle) . "\n", "right"); + } + // Next line removed to avoid gallery thumbnail duplication + // $menu["link"] = mediaInfo['url']; + + if ($rtype=='old') { + // Do not print menu if item has changed and this is the old item + } else { + // Continue printing menu + $menu->addClass("", "", "submenu"); + + // View Notes + if (strpos($rowm['m_gedrec'], "\n1 NOTE")) { + $submenu = new Menu(" " . i18n::translate('View Notes') . " ", "#", "right"); + // Notes Tooltip ---------------------------------------------------- + $sonclick = "TipTog("; + // Contents of Notes + $sonclick .= "'"; + $sonclick .= "<font color=#008800><b>" . i18n::translate('Notes') . ":</b></font><br />"; + $sonclick .= $notes; + $sonclick .= "'"; + // Notes Tooltip Parameters + $sonclick .= $tt_opts; + $sonclick .= ");"; + $sonclick .= "return false;"; + $submenu->addOnclick($sonclick); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + } + //View Details + $submenu = new Menu(" " . i18n::translate('View Details') . " ", $SERVER_URL . "mediaviewer.php?mid=" . $rowm["m_media"], "right"); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + //View Source + if (strpos($rowm['m_gedrec'], "\n1 SOUR") && displayDetailsById($sour, "SOUR")) { + $submenu = new Menu(" " . i18n::translate('View Source') . " ", $SERVER_URL . "source.php?sid=" . $sour, "right"); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + } + if (WT_USER_CAN_EDIT) { + // Edit Media + $submenu = new Menu(" " . i18n::translate('Edit Media') . " ", "#", "right"); + $submenu->addOnclick("return window.open('addmedia.php?action=editmedia&pid={$rowm['m_media']}&linktoid={$rowm['mm_gid']}', '_blank', 'top=50,left=50,width=600,height=700,resizable=1,scrollbars=1');"); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + if (WT_USER_IS_ADMIN) { + // Manage Links + $submenu = new Menu(" " . i18n::translate('Manage links') . " ", "#", "right"); + $submenu->addOnclick("return window.open('inverselink.php?mediaid={$rowm['m_media']}&linkto=manage', '_blank', 'top=50,left=50,width=570,height=650,resizable=1,scrollbars=1');"); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + // Unlink Media + $submenu = new Menu(" " . i18n::translate('Unlink Media') . " ", "#", "right"); + $submenu->addOnclick("return delete_record('$pid', 'OBJE', '".$rowm['m_media']."');"); + $submenu->addClass($submenu_class, $submenu_hoverclass); + $menu->addSubMenu($submenu); + } + } + } + + // Check if allowed to View media + if ($isExternal || media_exists($thumbnail) && !FactViewRestricted($rowm['m_media'], $rowm['m_gedrec'])) { + $mainFileExists = false; + + // Get Media info + if ($isExternal || media_exists($rowm['m_file']) || media_exists($mainMedia)) { + $mainFileExists = true; + $imgsize = findImageSize($rowm['m_file']); + $imgwidth = $imgsize[0]+40; + $imgheight = $imgsize[1]+150; + + // Start Thumbnail Enclosure table + print "<table width=\"10px\" class=\"pic\" border=\"0\"><tr>" . "\n"; + print "<td align=\"center\" rowspan=\"2\" >"; + print "<img src=\"modules/lightbox/images/transp80px.gif\" height=\"100px\" alt=\"\"></img>"; + print "</td>". "\n"; + + // Check for Notes associated media item + if ($reorder) { + // If reorder media has been clicked + print "<td width=\"90% align=\"center\"><b><font size=\"2\" style=\"cursor:move;margin-bottom:2px;\">" . $rowm['m_media'] . "</font></b></td>"; + print "</tr>"; + } + $item++; + + print "<td colspan=\"3\" valign=\"middle\" align=\"center\" >". "\n"; + // If not reordering, enable Lightbox or popup and show thumbnail tooltip ---------- + if (!$reorder) { + echo '<a href="', $mediaInfo['url'], '">'; + } + } + + // Now finally print the thumbnail ---------------------------------- + $height = 78; + $size = findImageSize($mediaInfo['thumb']); + if ($size[1]<$height) $height = $size[1]; + print "<img src=\"{$mediaInfo['thumb']}\" border=\"0\" height=\"{$height}\"" ; + + // print browser tooltips associated with image ---------------------------------------------- + print " alt=\"\" title=\"" . Printready(strip_tags($mediaTitle)) . "\" />"; + + // Close anchor -------------------------------------------------------------- + if ($mainFileExists) { + print "</a>" . "\n"; + } + print "</td></tr>" . "\n"; + + //View Edit Menu ---------------------------------- + if (!$reorder) { + // If not reordering media print View or View-Edit Menu + print "<tr>"; + print "<td width=\"5px\"></td>"; + print "<td valign=\"bottom\" align=\"center\" nowrap=\"nowrap\">"; + $menu->printMenu(); + print "</td>"; + print "<td width=\"5px\"></td>"; + print "</tr>" . "\n"; + } + + // print "</table>" . "\n"; + } + + } // NOTE End If Show fact details + + + // If media file is missing but details are in Gedcom then add the menu as well + //if (!media_exists($rowm['m_file'])) { + if (!media_exists($mainMedia)) { + if (!media_exists($rowm['m_file'])) { + print "<tr>"; + print "<td ></td>"; + print "<td valign=\"bottom\" align=\"center\" nowrap=\"nowrap\">"; + $menu->printMenu(); + print "</td>"; + print "<td ></td>"; + print "</tr>" . "\n"; + } + } + + //close off the table + print "</table>"; + + $media_data = $rowm['m_media']; + print "<input type=\"hidden\" name=\"order1[$media_data]\" value=\"$sort_i\" />" . "\n"; + $sort_i++; + + print "</li>"; + print "\n\n"; + return true; + +} +?> diff --git a/modules/lightbox/help_text.php b/modules/lightbox/help_text.php new file mode 100644 index 0000000000..21d60a429c --- /dev/null +++ b/modules/lightbox/help_text.php @@ -0,0 +1,88 @@ +<?php +/** + * Lightbox Module help text. + * + * This file is included from the application help_text.php script. + * It simply needs to set $title and $text for the help topic $help_topic + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @version $Id$ + */ + +if (!defined('WT_WEBTREES') || !defined('WT_SCRIPT_NAME') || WT_SCRIPT_NAME!='help_text.php') { + header('HTTP/1.0 403 Forbidden'); + exit; +} +switch ($help) { + +// Added in VERSION 4.1.6 + +case 'LIGHTBOX_CONFIG': + $title=i18n::translate('Configure Lightbox'); + $text=i18n::translate('Configure all aspects of the Lightbox module here.'); + break; + +case 'lb_tt_balloon': + $title=i18n::translate('Album Tab Thumbnail - Notes Link Tooltip'); + $text=i18n::translate('This option lets you determine whether the \'View Notes\' link should show a \'Balloon\' Tooltip or \'Normal\' Tooltip when clicked. <br /><br />The link shown here show you the Notes associated with a Media item (if available).<br />'); + break; + +// VERSION 4.1.3 + +case 'mediatab': + $title=i18n::translate('Media Tab Appearance'); + $text=i18n::translate('This option lets you determine whether the Media tab should be shown on the Individual Information page.<br /><br />When this option is set to <b>Hide</b>, only the <b>Lightbox</b> tab will be shown.<br />'); + break; + +case 'lb_al_head_links': + $title=i18n::translate('Album Tab Header Link appearance'); + $text=i18n::translate('This option lets you determine whether the header area of the Lightbox tab, which contains links to control various aspects of the Lightbox module, should contain only icons, only text, or both.<br /><br />The <b>Icon</b> option is probably not very useful, since you won\'t see any indication of each icon\'s function until your mouse hovers over the icon.<br />'); + break; + +case 'lb_al_thumb_links': + $title=i18n::translate('Album Tab Thumbnails Link appearance'); + $text=i18n::translate('This option lets you determine whether the links area below each thumbnail should show an icon or text. The links shown here let you edit the Media object\'s details or delete it.<br />'); + break; + +case 'lb_ml_thumb_links': + $title=i18n::translate('Thumbnails Link appearance'); + $text=i18n::translate('This option lets you determine whether the Links area above the Media object\'s details in the MultiMedia list should contain only icons, only text, or both. The links shown here let you perform various editing actions on the Media object in question.<br /><br />The <b>None</b> option completely hides these links, and thus acts as if the user did not have any editing rights.<br />'); + break; + +case 'lb_ss_speed': + $title=i18n::translate('Slide Show speed'); + $text=i18n::translate('This option determines the length of time each image should be displayed before the Slide Show displays the next image in the sequence.<br />'); + break; + +case 'lb_music_file': + $title=i18n::translate('Slideshow Sound Track'); + $text=i18n::translate('This option lets you specify a sound track to be played whenever the slide show is active. When you leave this field blank, no sound will play during the slide show.<br /><br />This feature only supports files in the mp3 format.<br />'); + break; + +case 'lb_transition': + $title=i18n::translate('Image Transition speed'); + $text=i18n::translate('This option lets you specify the transition speed when the image changes. This selection is applied during the slideshow. It is also applied when you move to the next or previous image when the slideshow is not running.<br /><br />The <b>None</b> option eliminates image transitions so that the new image immediately replaces the old without visible adjustment of the new image\'s dimensions.<br />'); + break; + +case 'lb_url_dimensions': + $title=i18n::translate('Lightbox URL Window dimensions'); + $text=i18n::translate('When clicking on a URL image thumbnail, this option lets you specify the Lightbox URL Window dimensions in pixels.<br /><br />This should normally be less than your current browser window dimensions, and certainly less than your screen resolution.<br />'); + break; + +} diff --git a/modules/lightbox/images/blank.gif b/modules/lightbox/images/blank.gif Binary files differnew file mode 100644 index 0000000000..1d11fa9ada --- /dev/null +++ b/modules/lightbox/images/blank.gif diff --git a/modules/lightbox/images/close_1.gif b/modules/lightbox/images/close_1.gif Binary files differnew file mode 100644 index 0000000000..fac64f5d6e --- /dev/null +++ b/modules/lightbox/images/close_1.gif diff --git a/modules/lightbox/images/image_add.gif b/modules/lightbox/images/image_add.gif Binary files differnew file mode 100644 index 0000000000..b8d6a2e5e4 --- /dev/null +++ b/modules/lightbox/images/image_add.gif diff --git a/modules/lightbox/images/image_copy.gif b/modules/lightbox/images/image_copy.gif Binary files differnew file mode 100644 index 0000000000..f9c1074068 --- /dev/null +++ b/modules/lightbox/images/image_copy.gif diff --git a/modules/lightbox/images/image_delete.gif b/modules/lightbox/images/image_delete.gif Binary files differnew file mode 100644 index 0000000000..fc6b67eda7 --- /dev/null +++ b/modules/lightbox/images/image_delete.gif diff --git a/modules/lightbox/images/image_edit.gif b/modules/lightbox/images/image_edit.gif Binary files differnew file mode 100644 index 0000000000..ad5a6769ef --- /dev/null +++ b/modules/lightbox/images/image_edit.gif diff --git a/modules/lightbox/images/image_link.gif b/modules/lightbox/images/image_link.gif Binary files differnew file mode 100644 index 0000000000..1ccfbf3b88 --- /dev/null +++ b/modules/lightbox/images/image_link.gif diff --git a/modules/lightbox/images/image_view.gif b/modules/lightbox/images/image_view.gif Binary files differnew file mode 100644 index 0000000000..22fc38c9aa --- /dev/null +++ b/modules/lightbox/images/image_view.gif diff --git a/modules/lightbox/images/images.gif b/modules/lightbox/images/images.gif Binary files differnew file mode 100644 index 0000000000..f9c1074068 --- /dev/null +++ b/modules/lightbox/images/images.gif diff --git a/modules/lightbox/images/loading.gif b/modules/lightbox/images/loading.gif Binary files differnew file mode 100644 index 0000000000..5bb90fd6a4 --- /dev/null +++ b/modules/lightbox/images/loading.gif diff --git a/modules/lightbox/images/next.gif b/modules/lightbox/images/next.gif Binary files differnew file mode 100644 index 0000000000..bfeb97cf36 --- /dev/null +++ b/modules/lightbox/images/next.gif diff --git a/modules/lightbox/images/nextlabel.gif b/modules/lightbox/images/nextlabel.gif Binary files differnew file mode 100644 index 0000000000..7c66121faf --- /dev/null +++ b/modules/lightbox/images/nextlabel.gif diff --git a/modules/lightbox/images/norm_2.gif b/modules/lightbox/images/norm_2.gif Binary files differnew file mode 100644 index 0000000000..fdc2f6d05f --- /dev/null +++ b/modules/lightbox/images/norm_2.gif diff --git a/modules/lightbox/images/overlay.png b/modules/lightbox/images/overlay.png Binary files differnew file mode 100644 index 0000000000..be64c0c7f6 --- /dev/null +++ b/modules/lightbox/images/overlay.png diff --git a/modules/lightbox/images/prev.gif b/modules/lightbox/images/prev.gif Binary files differnew file mode 100644 index 0000000000..dc8f31693a --- /dev/null +++ b/modules/lightbox/images/prev.gif diff --git a/modules/lightbox/images/prevlabel.gif b/modules/lightbox/images/prevlabel.gif Binary files differnew file mode 100644 index 0000000000..064187672c --- /dev/null +++ b/modules/lightbox/images/prevlabel.gif diff --git a/modules/lightbox/images/private.gif b/modules/lightbox/images/private.gif Binary files differnew file mode 100644 index 0000000000..21baed2115 --- /dev/null +++ b/modules/lightbox/images/private.gif diff --git a/modules/lightbox/images/slideshow.jpg b/modules/lightbox/images/slideshow.jpg Binary files differnew file mode 100644 index 0000000000..c964604327 --- /dev/null +++ b/modules/lightbox/images/slideshow.jpg diff --git a/modules/lightbox/images/transp80px.gif b/modules/lightbox/images/transp80px.gif Binary files differnew file mode 100644 index 0000000000..68d259058a --- /dev/null +++ b/modules/lightbox/images/transp80px.gif diff --git a/modules/lightbox/images/zoom_1.gif b/modules/lightbox/images/zoom_1.gif Binary files differnew file mode 100644 index 0000000000..dc3b210e83 --- /dev/null +++ b/modules/lightbox/images/zoom_1.gif diff --git a/modules/lightbox/index.php b/modules/lightbox/index.php new file mode 100644 index 0000000000..edcfdc1ecc --- /dev/null +++ b/modules/lightbox/index.php @@ -0,0 +1,33 @@ +<?php +/** + * Entry point for Lightbox module when changing theme on configuration page + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Lightbox + * @author Brian Holland + * $Id$ + */ + +header("Location: ../../index.php"); +exit; +?>
\ No newline at end of file diff --git a/modules/lightbox/js/Sound.js b/modules/lightbox/js/Sound.js new file mode 100644 index 0000000000..cb33573964 --- /dev/null +++ b/modules/lightbox/js/Sound.js @@ -0,0 +1,197 @@ +/* +Copyright (c) 2006, Gustavo Ribeiro Amigo +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + + function Sound(options) { + + this.options = options; + if(this.options == undefined) this.options = new Object(); + + if(!this.options.swfLocation) { + this.options.swfLocation = "js/SoundBridge.swf"; + } + + if(Sound.id_count == undefined) { + Sound.id_count = 1; + } else { + Sound.id_count ++; + } + + if(Sound.instances == undefined) { + Sound.instances = new Object(); + } + + this.object_id = 'object_id_' + Sound.id_count; + + Sound.instances[this.object_id] = this; + + movie_swf = this.options.swfLocation; + movie_id = this.object_id; + + movie_element = ""; + movie_element += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="0" height="0"'; + movie_element += ' id="' + movie_id+ '"'; + movie_element += ' align="middle">'; + movie_element += '<param name="movie" value="'+movie_swf+'" />'; + movie_element += '<param name="quality" value="high" />'; + movie_element += '<param name="bgcolor" value="#ffffff" />'; + movie_element += '<param name="FlashVars" value="id='+ movie_id +'"/>'; + movie_element += '<param name="allowScriptAccess" value="allowScriptAccess"/>'; + movie_element += '<embed src="'+movie_swf+'" FlashVars="id='+ movie_id +'"'; + movie_element += ' allowScriptAccess="always" quality="high" bgcolor="#ffffff" width="0" height="0"'; + movie_element += ' name="' + movie_id + '" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; + movie_element += '</object>'; + +/* + this.so = new SWFObject(movie_swf, movie_id, "0", "0", "8", "#ffffff"); + this.so.addParam("quality", "high"); + this.so.addParam("FlashVars", "id="+ movie_id); + this.so.addParam("allowScriptAccess", "always"); +*/ + + if( document.getElementById('__sound_flash__') == undefined) { + var element = document.createElement("div"); + element.id = "__sound_flash__"; + document.body.appendChild(element); + } + + document.getElementById('__sound_flash__').innerHTML += movie_element; + //this.so.write('__sound_flash__'); + + } + + Sound.prototype.loadSound = function(url, streaming) { + return Sound.__call('loadSound',this.object_id, url, streaming); + } + + Sound.prototype.start= function() { + return Sound.__call('start', this.object_id); + } + + Sound.prototype.stop = function() { + return Sound.__call('stop', this.object_id); + } + + Sound.prototype.getId3 = function() { + return Sound.__call('id3', this.object_id); + } + + Sound.prototype.getPan = function() { + return Sound.__call('getPan', this.object_id); + } + + Sound.prototype.getTransform = function() { + return Sound.__call('getTransform', this.object_id); + } + + Sound.prototype.getVolume = function(){ + return Sound.__call('getVolume', this.object_id); + } + + Sound.prototype.setPan = function(value){ + return Sound.__call('setPan', this.object_id, value); + } + + Sound.prototype.setTransform = function(transformObject){ + return Sound.__call('setTransform', this.object_id, transformObject); + } + + Sound.prototype.setVolume = function(value){ + return Sound.__call('setVolume', this.object_id, value); + } + + Sound.prototype.start = function(secondOffset, loops){ + return Sound.__call('start', this.object_id, secondOffset, loops); + } + + Sound.prototype.getDuration = function(){ + return Sound.__call('getDuration', this.object_id); + } + + Sound.prototype.setDuration = function(value){ + return Sound.__call('setDuration', this.object_id, value); + } + + Sound.prototype.getPosition = function(){ + return Sound.__call('getPosition', this.object_id); + } + + Sound.prototype.setPosition = function(value){ + return Sound.__call('setPosition', this.object_id, value); + } + + Sound.prototype.getBytesLoaded = function(){ + return Sound.__call('getBytesLoaded', this.object_id); + } + + Sound.prototype.getBytesTotal = function(){ + return Sound.__call('getBytesTotal', this.object_id); + } + + Sound.prototype.onLoad = function(success){ + Sound.trace('Sound:onLoad('+success+') event triggered'); + } + + Sound.onLoad = function(object_id, success) { + //Sound.trace('Sound.onLoad('+success+') object_id=' + object_id); + Sound.instances[object_id].onLoad(success); + } + + Sound.prototype.onSoundComplete = function(){ + Sound.trace('Sound:onSoundComplete() event triggered'); + } + + Sound.onSoundComplete = function(object_id) { + Sound.instances[object_id].onSoundComplete; + } + + Sound.prototype.onID3 = function(){ + Sound.trace('Sound:onID3() event triggered'); + } + + Sound.onID3 = function(object_id) { + Sound.instances[object_id].onID3(); + } + + Sound.trace = function(value, isJavascript) { + if(document.getElementById('sound_tracer') != undefined) { + if(isJavascript == undefined || isJavascript == true) { + document.getElementById('sound_tracer').value += 'Javascript: ' + value + '\n'; + } else { + document.getElementById('sound_tracer').value += value + '\n'; + } + } + } + + Sound.__thisMovie = function(movieName) { + if (navigator.appName.indexOf("Microsoft") != -1) { + return window[movieName] + } + else { + return document[movieName] + } + } + + Sound.__call = function () { + Sound.trace('Sound.__call '+ arguments[0]+ ' on object_id ' + arguments[1] ); + var functionname = arguments[0]; + var object_id = arguments[1]; + var justArgs = new Array(); + if (arguments.length > 1) { + for (var i = 2; i < arguments.length; i++ ) { + justArgs.push(arguments[i]); + } + } + + return Sound.__thisMovie(object_id).proxyMethods(functionname, justArgs); + }
\ No newline at end of file diff --git a/modules/lightbox/js/SoundBridge.swf b/modules/lightbox/js/SoundBridge.swf Binary files differnew file mode 100644 index 0000000000..2131e4d49c --- /dev/null +++ b/modules/lightbox/js/SoundBridge.swf diff --git a/modules/lightbox/js/clearbox.js b/modules/lightbox/js/clearbox.js new file mode 100644 index 0000000000..7a83db1a62 --- /dev/null +++ b/modules/lightbox/js/clearbox.js @@ -0,0 +1,371 @@ +/* clearbox.js - Author Brian Holland .... email webman@windmillway.f2s.com - (modified from Clearbox.js - Author Pyro ... email pyrex@chello.hu) + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland +*/ + +/* + ClearBox JS by pyro + + script home: http://www.kreatura.hu/pyro/clearbox + author e-mail: pyrexkukacchelloponthu + author msn: prokukacradiomaxponthu + support forum 1: http://www.sg.hu/listazas.php3?id=1172325655 + support forum 2: http://www.tutorial.hu/forum/index.php?showtopic=1391&st=0 + + LICENSZ FELTÉTELEK: + + A ClearBox szabadon felhasználható bármilyen nem kereskedelmi jellegû honlapon, tehát olyanokon + amik nem hivatalos cégek oldalai, amik nem tartalmaznak kereskedelmi jellegû szolgáltatást vagy + termék(ek) eladás(á)t, illetve reklámozását. A kereskedelmi jellegû honlapokon való + felhasználásáról érdeklõdj a készítõnél! A ClearBox forrása (clsource.js) kizárólag a készítõ + elõzetes hozzájárulásával módosítható. A ClearBox a készítõ beleegyezése nélkül pénzért harmadik + félnek tovább nem adható! +*/ + var CB_version='200beta'; + +/* + clearbox.js: + + ClearBox konfigurációs fájl. Ebben a fájlban tudod kedved szerint testre szabni a scriptet. + Az 1.70 verziótól kezdve a ClearBox script két külön .js fájlra tagolódott: clearbox.js és + cbsource.js. A cbsource.js fájl kódolva és tömörítve tartalmazza a ClearBox scriptet, azt + ne változtasd! A dokumentációt külön fájlok helyett a clearbox.js (ez a fájl) tartalmazza. + Minden paraméternél leírást találsz, hogy az hogyan befolyásolja a ClearBox mûködését. + + CB_HideColor: + + Értéke egy színkód. Megadja, hogy a script meghívásakor a dokumentumot 'eltakaró' + felület milyen színárnyalatú legyen. Mindenképpen használd a ' ' jeleket és a #-et. +*/ + var CB_HideColor='#000'; + +/* + CB_HideOpacity: + + Értéke egy nem negatív egész szám (0-100). Megadja, hogy a háttér hány százalékig + vegye fel a CB_HideColor színkódot. Ha 0, akkor egyáltalán nem fog látszódni, ha 100, + akkor teljesen elfedi a dokumentumot. A köztes esetekben pedig áttetszõ lesz. +*/ + var CB_HideOpacity=75; + +/* + CB_OpacityStep: + + Értéke egy pozitív egész szám (1-CB_HideOpacity). Megadja, hogy a háttér elõtûnése, + halványítása mekkora lépésekben történjen, amíg el nem éri a CB_HideOpacity értéket. + (Ne legyen nagyobb, mint CB_HideOpacity és nem árt, ha CB_HideOpacity maradéktalanul + osztható CB_OpacityStep-pel!) + +*/ + var CB_OpacityStep=25; + +/* + CB_WinBaseW: + + Értéke egy pozitív egész szám. (25- ) A ClearBox ablak kezdeti szélessége + (ehhez még hozzáadódik a CB_RoundPix értéknek a kétszerese). + Ne adj meg túl nagy értéket! Ha nem létfontosságú, ne változtass az alapértéken! +*/ + var CB_WinBaseW=120; + +/* + CB_WinBaseH: + + Értéke egy pozitív egész szám. (50- ) A ClearBox ablak kezdeti magassága + (ehhez még hozzáadódik a CB_RoundPix értéknek a kétszerese, viszont beletartozik a + CB_TextH értéke.). Ne adj meg túl nagy értéket! Ha nem létfontosságú, ne változtass az + alapértéken! +*/ + var CB_WinBaseH=110; + +/* + CB_WinPadd: + + Értéke egy nem negatív egész szám. (0- ) Megadja, hogy normális esetben minimum hány + pixel legyen a böngészõ széle és a ClearBox ablak között. Ne adj meg túl nagy értéket! + Megjegyzés: alapállapotban a ClearBox ablakot körülvevõ árnyék miatt ez az érték nagyobbnak + néz ki, mint ami meg van adva!) +*/ + var CB_WinPadd=1; + +/* + CB_RoundPix: + + Értéke nem negatív egész szám. Megadja a lekerekítések képeinek nagyságát. + Fontos: Változtatásához a lekerekítések képeit is cserélni kell, ezért ennek a megváltoztatása + csak a jobban hozzértõknek ajánlott! + Tipp: Amennyiben azt szeretnéd, hogy a ClearBox ablak sarkai szögletesek legyenek, állítsd az + értéket 0-ra. (Ilyenkor nem árt megnövelni a CB_Padd értékét minimum 5-re, a szebb vizuális + megjelenés érdekében.) +*/ + var CB_RoundPix=12; + +/* + CB_Animation: + + A ClearBox ablak animációja állítható be vele. Többféle lehetõség közül választhatsz: + + 'none': ilyenkor az ablak egy lépésben felveszi a méretet, + 'normal': ez a már megszokott animáció, + 'double': ilyenkor az ablak egyszerre méretezõdik X és Y irányban + 'warp': mint a double, de a kép még az animáció megkezdése elõtt megjelenik + (nagy a cpu igénye, ezért kisebb méretû képekhez ajánlott) + + Mindenképpen használd a ' ' jeleket. +*/ +// var CB_Animation='none'; + +/* + CB_Jump_X: + + Értéke egy pozitív egész szám (1-99). Megadja a vízszintes átméretezõ animáció gyorsaságát, + részletességét. +*/ + var CB_Jump_X= 40; + +/* + CB_Jump_Y: + + Értéke egy pozitív egész szám (1-99). Megadja a függõleges átméretezõ animáció gyorsaságát, + részletességét. +*/ + var CB_Jump_Y= 40; + +/* + CB_AnimTimeout: + + Értéke egy pozitív egész szám (5- ). Megadja (milisecundumban), hogy átméretezõ animáció lépései + közben mennyit 'várjon' a script. +*/ + var CB_AnimTimeout=5; + +/* + CB_ImgBorder: + + Értéke egy nem negatív egész szám (0- ). Megadja a kép körüli keret vastagságát. +*/ + var CB_ImgBorder=1; + +/* + CB_ImgBorderColor: + + Értéke egy színkód. Megadja a kép körüli keret színét. Mindenképpen használd a ' ' jeleket és a #-et. +*/ + var CB_ImgBorderColor='#ccc'; + +/* + CB_Padd: + + Értéke egy nem negatív egész szám (0- ). A kép keretén (és a lekerekítéseken) kívül ad még egy plusz + – gyakorlatilag láthatatlan - keretet a képnek (magyarul a kép körüli fehér keret vastagságát növeli). +*/ + var CB_Padd=0; + +/* + CB_ShowImgURL: + + Értéke lehet 'be' vagy 'ki'. Megadja, hogy a ClearBox ablakban megjelenjen-e a kép elérési útja, amennyiben + nincs cím megadva a képnek. Mindenképpen használd a ' ' jeleket. +*/ + var CB_ShowImgURL='be'; + +/* + CB_ImgNum: + + Értéke lehet 'be' vagy 'ki'. Megadja, hogy ha a ClearBox galériáknál legyen-e kijelezve az összes kép, illetve, + hogy éppen hányadik kép van megjelenítve. Mindenképpen használd a ' ' jeleket. +*/ + var CB_ImgNum='ki'; + +/* + CB_ImgNumBracket: + + Ha a CB_ImgNum be van kapcsolva, akkor ez adja meg, hogy milyen zárójelben legyen a képek számozásának a + kijelzése. Mindenképpen használd a ' ' jeleket és mindenképpen két, azaz 2 karaktert adj meg, szünet nélkül. +*/ + var CB_ImgNumBracket='[]'; + +/* + CB_SlShowTime: + + Értéke egy pozitív egész szám (1- ). Megadja, hogy a SlideShow effekt (1.6 verziótól) mennyit várjon + (másodpercben), mielõtt megjeleníti a következõ képet. Megjegyzés: sajnos ez csak közelítõleges értéket ad, + valójában a böngészõtõl is függ. +*/ +// var CB_SlShowTime=6; + +/* + CB_PadT: + + Értéke egy nem negatív egész szám (0- ). A szövegmezõ kép aljától való távolságát adja meg. + Fontos: használd okosan ezt a paramétert a CB_TextH értékkel. A CB_PaddT a CB_TextH-ból mindenképpen + levonódik, így könnyen hibát generálhatunk a nem megfelelõ értékadással! +*/ +// var CB_PadT=10; + var CB_PadT=8; + +/* + CB_TextH: + + Értéke egy pozitív egész szám (25- ). A kép alatti szövegmezõ magasságát adja meg. + Fontos: figyelj a CB_PadT megfelelõ értékére is! +*/ +// var CB_TextH=40; + var CB_TextH=30; + +/* + CB_Font: + + Értéke egy (vagy több) betûtípus. A kép alatti szöveg betûtípusát adja meg. + Használhatunk egyszerre a CSS-ben is alkalmazható több értéket, pl: 'Arial, Verdana, Tahoma'. + Mindenképpen használd a ' ' jeleket. +*/ + var CB_Font='arial'; + +/* + Cb_FontSize: + + Értéke egy pozitív egész szám (6- ). A kép alatti szöveg méretét adja meg. +*/ + var CB_FontSize=12; + +/* + CB_FontColor: + + Értéke egy színkód. A kép alatti szöveg színét adja meg. Mindenképpen használd a ' ' jeleket és a #-et. +*/ +// var CB_FontColor='#656565'; + var CB_FontColor='#0000FF'; + +/* + CB_FontWeight: + + Értéke lehet 'normal' vagy 'bold'. A kép alatti szöveg betûvastagságát adja meg. + Mindenképpen használd a ' ' jeleket. +*/ + var CB_FontWeigth='bold'; + +/* + CB_CheckDuplicates: + + Késõbbi funkció, jelenleg nem mûködik! + Értéke lehet 'be' vagy 'ki'. Megadja, hogy legyen-e a gelériákban ismétlõdés-ellenõrzés. Amennyiben be van + kapcsolva, úgy agy adott galériában ugyanazzal az elérési úttal egyszerre csak egy kép lehet, tehát véletlenül + sem történik ismétlõdés. Mindenképpen használd a ' ' jeleket. +*/ + var CB_CheckDuplicates='ki'; + +/* + CB_LoadingText: + + Megadja, hogy alul milyen szöveg jelenjen meg a képek betöltése közben. Mindenképpen használd a ' ' jeleket. +*/ +// var CB_LoadingText='- kép betöltése -'; + var CB_LoadingText='- > < -'; + +/* + CB_PicDir: + + Megadja a ClearBox-hoz tartozó képek elérési útját. Amennyiben megváltoztatod, a clearbox.css-ben se felejtsd el + végrehajtani a szükséges változtatásokat! Mindenképpen használd a ' ' jeleket. +*/ + var CB_PicDir='modules/lightbox/pic'; +// var CB_MusicDir='../music'; + +/* + CB_BodyMargin paraméterek: + + Amennyiben az oldaladon szándékozol konkrét értéket adni a BODY margin-jának, tehát ha: + margin-left, margin-top, margin-bottom vagy margin-right BÁRMELYIKE NEM 0 és NEM auto, akkor az alábbi + paraméterekkel meg KELL adnod azt a ClearBox-nak is. Ez a HideContent Layer pontos méretezése miatt szükséges! + Megjegyzés: figyelj arra, hogy ha nem adtál meg a css fájlodban a body-nak egyáltalán margin értéket, akkor is van egy + alapértelmezett margin érték a böngészõk szerint! + Fontos: NE használj %-os értékeket, mert akkor a ClearBox HideContent Layer-e nem fog megfelelõen megjelenni! +*/ + var CB_BodyMarginLeft=0; + var CB_BodyMarginRight=0; + var CB_BodyMarginTop=0; + var CB_BodyMarginBottom=0; + +/* + CB_Preload: + + Értéke lehet 'be' vagy 'ki'. Megadja, hogy galériáknál legyen-e az elõzõ és következõ képek elõre töltése. + Mindenképpen használd a ' ' jeleket. +*/ + var CB_Preload='be'; + +/* + CB_TextNav: + + Értéke lehet 'be' vagy 'ki'. Megadja, hogy galériáknál legyen-e elõzõ és következõ felirat megjelenítése a CB_TextH + sávban (ahol a kép neve is található). Mindenképpen használd a ' ' jeleket. +*/ + var CB_TextNav='ki'; + +/* + CB_NavText paraméterek: + + Megadhatod a CB_TextH megjelenõ gombok (linkek) nevét. Mindenképpen használd a ' ' jeleket. + A linkek kinézetét a clearbox.css fájlban tudod módosítani, a linkek class osztálya: CB_TextNav. +*/ +//BH var CB_NavTextPrv='elõzõ'; +//BH var CB_NavTextNxt='következõ'; +//BH var CB_NavTextCls='bezár'; + var CB_NavTextPrv='Prev'; + var CB_NavTextNxt='Next'; +//BH var CB_NavTextCls=''; + +/* + CB_Picture paraméterek: + + Ha meg akarod változtatni a ClearBox által használt Start, Pause és Close gombokat, valamint a Loading képet, + akkor azt itt teheted meg. Fontos: kizárólag a fájlnevet add meg, / jel és mappa nélkül! + Mindenképpen használd a ' ' jeleket. + Megjegyzés: az Elõzõ és Következõ gombokat a clearbox.css-ben tudod megváltoztatni. + +*/ + var CB_PictureStart='start.png'; + var CB_PicturePause='pause.png'; + var CB_PictureClose='close_red.png'; + var CB_PictureLoading='loading.gif'; + var CB_PictureNotes='notes.gif'; + var CB_PictureDetails='detail.gif'; + var CB_MusicStart='music_off.png'; + var CB_MusicStop='music_on.png'; + var CB_MusicNull='music_null.png'; + var CB_Speak='music_off.png'; + var CB_ZoomStart='zoom_on.png'; + var CB_ZoomStop='zoom_off.png'; + + +// Slideshow music configurable options --------------------------------------------------------- + var foreverLoop = 0; // Set 0 if want to stop on the last image or Set it to 1 for Infinite loop feature + var loopMusic = true; //loops music if it is shorter then slideshow + var SoundBridgeSWF = "modules/lightbox/js/SoundBridge.swf"; + +// Music variables --------------------------------------------------------- + var slideshowMusic = null; + var firstTime = 1; + var objSpeakerImage; + var saveLoopMusic; + + +/* + Az alábbi kódon ne változtass, ellenkezõ esetben a ClearBox nem (megfelelõen) fog mûködni!. + clearbox.js elérési útjának megkeresése, majd ez alapján cbsource.js beillesztése a html dokumentumba: +*/ + + var CB_Scripts = document.getElementsByTagName('script'); + for(i=0;i<CB_Scripts.length;i++){ + if(CB_Scripts[i].src.match('clearbox.js')!=null){ + var CB_jsdir=CB_Scripts[i].src.substring(0,CB_Scripts[i].src.length-11); + } + } + document.write('<' + 'script'); + document.write(' language="javascript"'); + document.write(' type="text/javascript"'); + document.write(' src="'+CB_jsdir+'clsource_music.js">'); + document.write('</' + 'script' + '>'); diff --git a/modules/lightbox/js/clsource_music.js b/modules/lightbox/js/clsource_music.js new file mode 100644 index 0000000000..dec4d237a5 --- /dev/null +++ b/modules/lightbox/js/clsource_music.js @@ -0,0 +1,2242 @@ +/* clsource_music.js - Author Brian Holland .... email webman@windmillway.f2s.com - (modified from Clsource.js - Author Pyro ... email pyrex@chello.hu) + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland +*/ + +//Browser detection ==================================================================== + +var nVer = navigator.appVersion; +var nAgt = navigator.userAgent; +var browserName = ''; +var fullVersion = 0; +var majorVersion = 0; + +// In Internet Explorer, the true version is after "MSIE" in userAgent +if ((verOffset=nAgt.indexOf("MSIE"))!=-1) { + browserName = "Microsoft Internet Explorer"; + fullVersion = parseFloat(nAgt.substring(verOffset+5)); + majorVersion = parseInt(''+fullVersion); +} + +// In Opera, the true version is after "Opera" +else if ((verOffset=nAgt.indexOf("Opera"))!=-1) { + browserName = "Opera"; + fullVersion = parseFloat(nAgt.substring(verOffset+6)); + majorVersion = parseInt(''+fullVersion); +} + +// In Firefox, the true version is after "Firefox" +else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) { + browserName = "Firefox"; + fullVersion = parseFloat(nAgt.substring(verOffset+8)); + majorVersion = parseInt(''+fullVersion); +} + +// In most other browsers, "name/version" is at the end of userAgent +else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) +{ + browserName = nAgt.substring(nameOffset,verOffset); + fullVersion = parseFloat(nAgt.substring(verOffset+1)); + if (!isNaN(fullVersion)) majorVersion = parseInt(''+fullVersion); + else {fullVersion = 0; majorVersion = 0;} +} + +// Finally, if no name and/or no version detected from userAgent... +if (browserName.toLowerCase() == browserName.toUpperCase() + || fullVersion==0 || majorVersion == 0 ) +{ + browserName = navigator.appName; + fullVersion = parseFloat(nVer); + majorVersion = parseInt(nVer); +} + +//document.write('Browser name = '+browserName+'<br>'); +//document.write('Full version = '+fullVersion+'<br>'); +//document.write('Major version = '+majorVersion+'<br>'); +//document.write('navigator.appName = '+navigator.appName+'<br>'); +//document.write('navigator.userAgent = '+navigator.userAgent+'<br>'); + +// ================================================================================================= + +// Initial variable settings + +var CB_Show = 1; +var CB_Zoom = null; +var zoomSet = 0; // ZoomSet = 0 means No Lightbox window. (Leave at 0 here please) + // Note: ZoomSet = 1 means Lightbox window open. + // Note: ZoomSet = 2 means Lightbox window open and zoomed. + +var soond = null; +var CB_Alignm = CB_Alignm; +var CB_Balloon = CB_Balloon; +var CB_Animation = CB_Animation; +var CB_SlShowTime = CB_SlShowTime; +var CB_ImgDetails = CB_ImgDetails; +var CB_Detail_Info = CB_Detail_Info; +var CB_ImgNotes = CB_ImgNotes; +var CB_ImgNotes2 = CB_ImgNotes2; +var CB_Note_Info = CB_Note_Info; +var CB_Start_SS = CB_Start_SS; +var CB_Pause_SS = CB_Pause_SS; +var CB_Music = CB_Music; +var CB_Zoom_Off = CB_Zoom_Off; +var CB_Zoom_On = CB_Zoom_On; +var CB_Close_Win = CB_Close_Win; + +// ------- Keyboard options --------------------------------------------------------- + + function CB_KeyPress(a) { + + var b; + if (!a) { + var a = window.event; + } + if (a.keyCode) { + b = a.keyCode; + }else if (a.which) { + b = a.which; + } + var c = String.fromCharCode(b); + + if (CB_ClearBox == "be") { + + // Previous or Move Left - "Keys P, or left arrow, or 4" + if (c == "%" || c == "p" || b == 80 || b == 37 || b == 52) { + if (CB_Zoom == "true" ) { + moveLeft(); + return false; + }else if (CB_ActImgId > 1) { + if (CB_SSTimer ) { + CB_SlideShowJump(); + } + CB_LoadImage(CB_ActImgId - 1); + return false; + }else{ + } + } + + // Next or Move Right - "Keys N, or right arrow, or 6" + if (c == "'" || c == "n" || b == 78 || b == 39 || b == 54) { + if (CB_Zoom == "true") { + moveRight(); + return false; + }else if (CB_ActImgId < CB_Gallery.length - 1) { + if (CB_SSTimer) { + CB_SlideShowJump(); + } + CB_LoadImage(CB_ActImgId + 1); + return false; + }else{ + } + } + + // Move Up - "Keys U, or up arrow" + if (c == "u" || b == 38 || b == 85) { + if (CB_Zoom == "true") { + moveUp(); + return false; + }else{ + } + } + + // Move Up - "Keys D, or down arrow" + if (c == "d" || b == 40 || b == 68) { + if (CB_Zoom == "true") { + moveDown(); + return false; + }else{ + } + } + + // Start/Stop Slideshow - "Key Spacebar" + if ((c == " " || b == 32) && CB_IsAnimating == 0) { + if (CB_Gallery.length < 3) { + return false; + } + if (CB_SS == "start") { + resetZoom(); + CB_SSStart(); + return false; + }else{ + CB_SSPause(); + return false; + } + } + + // Close - "Keys Esc or X" + if (c == "\x1B" || b == 27 || c == "x" || b == 88 ) { + CB_Close(); + return false; + } + + // Toggle Volume - "Key S" + if (c == "s" || b == 83) { + player.toggleVolume(); + return false; + } + + // Zoom in - "Key I" + if (c == "i" || b == 73) { + if (CB_SS == "start") { + zoomIn(); + return false; + } + } + + // Zoom Out - "Key O" + if (c == "o" || b == 79) { + if (CB_SS == "start") { + zoomOut(); + return false; + } + } + + // Reset Zoom - "Key Z" + if (c == "z" || b == 90) { + if (CB_SS == "start") { + resetZoom(); + CB_SSStart(); + CB_SSPause(); + return false; + // }else if (CB_SS == "start" && zoomSet==1) { + // CB_FullSize(); + }else{ + } + } + + // Do nothing - "Key Enter" + if (b == 13) { + return false; + } + + }else{ + + // If animating Do nothing - "Keys Spacebar, or Enter" + if (CB_IsAnimating == 1 && (c == " " || b == 32 || b == 13)) { + return false; + } + } + } +// End function keyboard ---------------------------------------------- + + +// Mousewheel for zooming --------------------------------------------- +// if (zoomSet == 2) { + function handle(delta) { + if (delta <0) { + if (CB_SS == "start" ) { + zoomIn(); + return false; + } + }else{ + if (CB_SS == "start" ) { + zoomOut(); + return false; + } + } + } + + function wheel(event){ + var delta = 0; + if (!event) event = window.event; + if (event.wheelDelta) { + delta = event.wheelDelta/120; + if (window.opera) delta = -delta; + } else if (event.detail) { + delta = -event.detail/3; + } + if (delta) + handle(delta); + + if (zoomSet == 2 || zoomSet == 1) { + // Prevents default scrolling + if (event.preventDefault) + event.preventDefault(); + event.returnValue = false; + } + } + + /* Initialization code. */ + if (window.addEventListener) + window.addEventListener('DOMMouseScroll', wheel, false); + window.onmousewheel = document.onmousewheel = wheel; +//} +// End Mousewheel for zooming --------------------------------------------- + + +// Music Player Class ---------------------------------------------- + function Player () { + this.paused = true; + this.stoped = true; + + this.options = new Object(); + this.options.swfLocation = SoundBridgeSWF; + this.sound = new Sound(this.options); + + this.position = 0; + this.frequency = 1000; + this.isLoaded = false; + this.duration = 0; + this.bytesTotal = 0; + this.callback = this.registerCallback(); + } + + + Player.prototype.onTimerEvent = function() { + var isDurationOk = false + if(!this.paused) { + var position = this.sound.getPosition(); + if(!position) position = 0; + + if(position != this.position && position != 0) { + this.onPlaying(); + } else { + this.onBuffering(); + } + this.position = position; + + var duration = 0; + duration = this.sound.getDuration(); + + if(!duration) duration = 0; + if(duration == this.duration && duration != 0) { + isDurationOk = true; + } + this.duration = duration; + var progress = position/duration; + if(isDurationOk) { + this.setProgressBar(progress); + } + + var isBytesTotalOk = false; + + var bytesTotal = this.sound.getBytesTotal(); + if(bytesTotal == this.bytesTotal) { + isBytesTotalOk = true; + } + this.bytesTotal = bytesTotal; + + if(isBytesTotalOk) { + var loaded = this.sound.getBytesLoaded()/bytesTotal; + this.setLoadedBar(loaded); + } + if (progress == 1 && duration != 0 && position != 0) { + this.onSoundComplete(); + } + } + } + + Player.prototype.registerCallback = function() { + return setInterval(this.onTimerEvent.bind(this), this.frequency); + } + + Player.prototype.clearCallback = function() { + clearInterval(this.callback); + this.callback = null; + } + + Player.prototype.setProgressBar = function(progress) { + if(!progress) progress = 0; + } + + Player.prototype.setLoadedBar = function(loaded) { + if(!loaded) loaded = 0; + } + + Player.prototype.onPlaying = function() { + //Element.show('caption'); + //Element.setInnerHTML( 'caption', this.sound.getId3()); + } + + Player.prototype.onPause = function() { + } + + Player.prototype.onBuffering = function() { + } + + Player.prototype.onSoundComplete = function() { + if(!this.paused) { + if (loopMusic) { + this.onForward(); + } + } + } + + Player.prototype.onForward = function() { + this.position = 0; + this.duration = 0; + this.sound.start(this.duration/1000, 1); + this.sound.stop(); + this.loadTrack(this.track); + this.stoped = true; + this.setProgressBar(0); + this.setLoadedBar(0); + if (this.sound.getVolume() == 0) { + if (!this.paused) { + this.paused = true; + this.play(); + this.sound.setVolume(0); + } + }else{ + if (!this.paused) { + this.paused = true; + this.play(); + } + } + } + + Player.prototype.fadeOut = function() { + for (var i=this.sound.getVolume()-1; i>=0; i--) { + this.sound.setVolume(i); + //pause(1); + } + } + + Player.prototype.fadeIn = function() { + for (var i=1; i <= 100; i++) { + this.sound.setVolume(i); + //pause(1); + } + } + + Player.prototype.toggleVolume = function() { + if (this.paused) return; + var volume = this.sound.getVolume(); + if (volume == 0) { + this.fadeIn(); + //this.sound.setVolume(100); + CB_Speak.setAttribute('src', CB_PicDir + CB_MusicStop); + } + if (volume == 100) { + this.fadeOut(); + //this.sound.setVolume(0); + CB_Speak.setAttribute('src', CB_PicDir + CB_MusicStart); + } + } + + Player.prototype.play = function() { + if(this.paused) { + this.paused = false; + if(this.stoped) { + this.sound.loadSound(this.track, true); + } + this.sound.start(this.position/1000, 1); + this.stoped = false; + CB_Speak.setAttribute('src', CB_PicDir + CB_MusicStop); + } else { + this.position = this.sound.getPosition(); + this.sound.stop(); + this.paused = true; + this.onPause(); + CB_Speak.setAttribute('src', CB_PicDir + CB_MusicStart); + } + } + + Player.prototype.stop = function() { + if (! this.paused) { + //fade out + for (var i=this.sound.getVolume()-1; i>=0; i--) { + this.sound.setVolume(i); + pause(1); + } + } + this.paused = true; + this.stoped = true; + this.position = 0; + this.duration = 0; + this.sound.start(this.duration/1000, 1); + this.sound.stop(); + } + + Player.prototype.loadTrack = function(track) { + this.track = track; + } + + Player.prototype.onStopButtonClick = function() { + this.paused = true; + this.stoped = true; + this.position = 0; + this.duration = 0; + this.sound.start(this.duration/1000, 1); + this.sound.stop(); + this.setProgressBar(0); +// $('button_play').className ='button_play'; +// $('display').innerHTML = "stoped"; + } + + var player; + +// Set Music Player functions ---------------------------------------------- + function setMusicPlayer() { + if (slideshowMusic == null) { + player = new Player(); + slideshowMusic = null; + } + } + + function resetVolume() { + if (player.sound.getVolume() == 0) { + player.toggleVolume(); + }else{ + } + } + + +// Start slideshow --------------------------------------------------------------------- + function CB_SSStart() { + resetZoom(); + saveForeverLoop = foreverLoop; + saveLoopMusic = loopMusic; +// if (imageArray.length == 1) { +// slideshowMusic = anchor.getAttribute('music'); + slideshowMusic = myMusic; + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + } else { + CB_Speak.style.display = "block"; + player.loadTrack(slideshowMusic); + if ( soond==null ){ + CB_Speak.setAttribute('src', CB_PicDir + CB_MusicStart); + }else{ + } + } +// var foreverMusic = anchor.getAttribute('loopMusic'); + var foreverMusic = "true"; + if (foreverMusic != null) { + if (foreverMusic == "true") loopMusic = true; else loopMusic = false; + } + if (foreverLoop == 1) { loopMusic = true; } +// } + +// CB_Prv.style.display = "none"; +// CB_Nxt.style.display = "none"; + CB_SlideS.style.display = "none"; + CB_SlideP.style.display = "block"; + CB_ZoomS.style.display = "none"; + CB_ZoomP.style.display = "none"; + CB_SlideB.style.display = "block"; + CB_SS = "pause"; + CB_SlideShow(); + if ( slideshowMusic != null && soond==null) { + soond="playing"; + }else{ + } + } + + +// Pause slideshow --------------------------------------------------------------------- + function CB_SSPause() { +// CB_Prv.style.display = "block"; +// CB_Nxt.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_SlideS.style.display = "block"; + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } + CB_ZoomS.style.display = "block"; + CB_ZoomP.style.display = "none"; + CB_SlideShowStop(); + } + +// --------------------------------------------------------------------- + + + CB_AnimTimeout = parseInt(CB_AnimTimeout); + if (CB_AnimTimeout < 5) { + CB_AnimTimeout = 5; + } + CB_BodyMarginLeft = parseInt(CB_BodyMarginLeft); + if (CB_BodyMarginLeft < 0) { + CB_BodyMarginLeft = 0; + } + CB_BodyMarginRight = parseInt(CB_BodyMarginRight); + if (CB_BodyMarginRight < 0) { + CB_BodyMarginRight = 0; + } + CB_BodyMarginTop = parseInt(CB_BodyMarginTop); + if (CB_BodyMarginTop < 0) { + CB_BodyMarginTop = 0; + } + CB_BodyMarginBottom = parseInt(CB_BodyMarginBottom); + if (CB_BodyMarginBottom < 0) { + CB_BodyMarginBottom = 0; + } + CB_HideOpacity = parseInt(CB_HideOpacity); + if (CB_HideOpacity < 0 || CB_HideOpacity > 100) { + CB_HideOpacity = 70; + } + CB_OpacityStep = parseInt(CB_OpacityStep); + if (CB_OpacityStep < 1 || CB_OpacityStep > CB_HideOpacity) { + CB_OpacityStep = 10; + } + CB_WinBaseW = parseInt(CB_WinBaseW); + if (CB_WinBaseW < 25 || CB_WinBaseW > 1000) { + CB_WinBaseW = 120; + } + CB_WinBaseH = parseInt(CB_WinBaseH); + if (CB_WinBaseH < 50 || CB_WinBaseH > 1000) { + CB_WinBaseH = 110; + } + CB_WinPadd = parseInt(CB_WinPadd); + if (CB_WinPadd < 0) { + CB_WinPadd = 5; + } + + if (CB_Animation != "none" && + CB_Animation != "normal" && + CB_Animation != "double" && CB_Animation != "warp") { + CB_Animation = "double"; + } + + CB_Jump_X = parseInt(CB_Jump_X); + if (CB_Jump_X < 1 || CB_Jump_X > 99) { + CB_Jump_X = 50; + } + + CB_Jump_Y = parseInt(CB_Jump_Y); + if (CB_Jump_Y < 1 || CB_Jump_Y > 99) { + CB_Jump_Y = 50; + } + + CB_ImgBorder = parseInt(CB_ImgBorder); + if (CB_ImgBorder < 0) { + CB_ImgBorder = 1; + } + + CB_Padd = parseInt(CB_Padd); + if (CB_Padd < 0) { + CB_Padd = 2; + } + + if (CB_ShowImgURL != "be" && CB_ShowImgURL != "ki") { + CB_ShowImgURL = "ki"; + } + + CB_PadT = parseInt(CB_PadT); + if (CB_PadT < 0) { + CB_PadT = 10; + } + + CB_RoundPix = parseInt(CB_RoundPix); + if (CB_RoundPix < 0) { + CB_RoundPix = 12; + } + + CB_TextH = parseInt(CB_TextH); + if (CB_TextH < 25) { + CB_TextH = 25; + } + + CB_FontSize = parseInt(CB_FontSize); + if (CB_FontSize < 6) { + CB_FontSize = 13; + } + + if (CB_ImgNum != "be" && CB_ImgNum != "ki") { + CB_ImgNum = "be"; + } + + CB_SlShowTime = parseInt(CB_SlShowTime); + if (CB_SlShowTime < 1) { + CB_SlShowTime = 5; + } + +// var CB_SlShowTime = 5; + + CB_SlShowTime *= 1000; + if (CB_CheckDuplicates != "be" && CB_CheckDuplicates != "ki") { + CB_CheckDuplicates = "ki"; + } + + if (CB_Preload != "be" && CB_Preload != "ki") { + CB_Preload = "be"; + } + + var CB_AllThumbsWidth, CB_ResizeTimer, CB_IsAnimating, CB_ImgWidthOrig, CB_ImgHeightOrig; + var CB_ieRPBug = 0, CB_ie6RPBug = "", CB_ClearBox, CB_AnimX, CB_AnimY; + var CB_BodyMarginX = CB_BodyMarginLeft + CB_BodyMarginRight, CB_BodyMarginY = CB_BodyMarginTop + CB_BodyMarginBottom; + var FF_ScrollbarBug, CB_Links, CB_SlideBW = 0, CB_SSTimer, CB_SS = "start", CB_ii = 0, CB_jj = 0; + var CB_Hide, CB_LoadingImg, CB_JumpX, CB_JumpY, CB_MarginL, CB_MarginT, CB_Content; + var CB_ImgWidth = CB_WinBaseW, CB_ImgHeight = CB_WinBaseH - CB_TextH; + var CB_ImgRate, CB_Win, CB_Txt, CB_Img, CB_Prv, CB_Nxt, CB_ImgWidthOld, CB_ImgHeightOld, CB_ActImgId; + var CB_Gallery, CB_Count, CB_preImages, CB_Loaded, CB_Header, CB_Footer, CB_Left, CB_Right, CB_Txt3, CB_Txt3a; + + CB_PicDir += "/"; + + var IE = document.all ? true : false; + if (!IE) { + document.captureEvents(Event.MOUSEMOVE); + } + + function OnLoad(a, b) { + if (typeof window.addEventListener != "undefined") { + window.addEventListener(a, b, false); + } else if (typeof document.addEventListener != "undefined") { + document.addEventListener(a, b, false); + } else if (typeof window.attachEvent != "undefined") { + window.attachEvent("on" + a, b); + } + } + + OnLoad("load", CB_Init); + + + function CB_Init() { + //BH --------------- Changed following lines for IE7 arrow keys ------------- + if (navigator.appVersion.indexOf("MSIE")!=-1){ + document.onkeydown = CB_KeyPress; + }else{ + document.onkeypress = CB_KeyPress; + } + //BH ------------------------------------------------------------------------------ + + if (!document.getElementById("CB_All") && CB_Show != 0) { + document.body.style.position = "static"; + var a = "<div class=\"CB_RoundPixBugFix\" style=\"width: " + CB_RoundPix + "px; height: " + CB_RoundPix + "px;\"></div>"; + var b = document.getElementsByTagName("body").item(0); + var c = document.createElement("div"); + c.setAttribute("id", "CB_All"); + b.appendChild(c); + + document.getElementById("CB_All").innerHTML = "<table cellspacing=\"0\" cellpadding=\"0\" id=\"CB_Window\"><tr id=\"CB_Header\"><td id=\"CB_TopLeft\">" + a + "</td><td id=\"CB_Top\"></td><td id=\"CB_TopRight\">" + a + "</td></tr><tr id=\"CB_Body\"><td id=\"CB_Left\"></td><td id=\"CB_Content\" valign=\"top\" align=\"left\"><div id=\"CB_Padding\"><div id=\"CB_Text\"></div><div id=\"CB_ImgContainer\"><iframe frameborder=\"0\" id=\"CB_iFrame\" src=\"\"></iframe><div id=\"CB_UrlNotes\" ></div><div id=\"CB_ShowTh\"></div><div id=\"CB_Thumbs\"><div id=\"CB_Thumbs2\"></div></div><img id=\"CB_LoadingImage\" title=\"loading\" src=\"" + CB_PicDir + CB_PictureLoading + "\" alt=\"\" /><img id=\"CB_Image\" alt=\"\" src=\"" + CB_PicDir + "blank.gif\" /><div id=\"CB_PrevNext\"><div id=\"CB_ImgHide\"></div><img id=\"CB_SlideShowBar\" src=\"" + CB_PicDir + "white.gif\" alt=\"\" /><a id=\"CB_Prev\" href=\"#\"></a><a id=\"CB_Next\" href=\"#\"></a></div></div><div id=\"CB_NavBar\"><img id=\"CB_SlideShowP\" title=\"" + CB_Pause_SS + "\" src=\"" + CB_PicDir + CB_PicturePause + "\" alt=\"\" /><img id=\"CB_SlideShowS\" title=\"" + CB_Start_SS + "\" src=\"" + CB_PicDir + CB_PictureStart + "\" alt=\"\" /><img id=\"CB_Speaker\" title=\"" + CB_Music + "\" src=\"" + CB_PicDir + CB_MusicNull + "\" alt=\"\" /><img id=\"CB_ZoomOff\" title=\"" + CB_Zoom_Off + "\" src=\"" + CB_PicDir + CB_ZoomStop + "\" alt=\"\" /><img id=\"CB_ZoomOn\" title=\"" + CB_Zoom_On + "\" src=\"" + CB_PicDir + CB_ZoomStart + "\" alt=\"\" /><center><table><tr><td valign=\"top\"><div id=\"CB_Notes\"></div></td><td><div id=\"CB_NoteText\" ></div></td><td><div id=\"CB_DetailText\" title=\"" + CB_Detail_Info + "\" alt=\"\"></div></td><td valign=\"top\"><a href=\"\"><img id=\"CB_Details\" title=\"" + CB_Detail_Info + "\" src=\"" + CB_PicDir + CB_PictureDetails + "\" alt=\"\" /></a></td></tr></table></center><img id=\"CB_CloseWindow\" title=\"" + CB_Close_Win + "\" src=\"" + CB_PicDir + CB_PictureClose + "\" alt=\"\" /></div></div></td><td id=\"CB_Right\"></td></tr><tr id=\"CB_Footer\"><td id=\"CB_BtmLeft\">" + a + "</td><td id=\"CB_Btm\"></td><td id=\"CB_BtmRight\">" + a + "</td></tr></table><div id=\"CB_ContentHide\"></div>"; + + if (navigator.userAgent.indexOf("MSIE 6") != -1 && + CB_RoundPix == 0) { + CB_ie6RPBug = 1; + } + + if (navigator.userAgent.indexOf("MSIE") != -1 && + CB_RoundPix < 2) { + CB_ieRPBug = 6; + } + + //Music player + var objFlashPlayer = document.createElement("div"); + objFlashPlayer.setAttribute('id','__sound_flash__'); + b.appendChild(objFlashPlayer); + + //CB All elements + document.getElementById("CB_Padding").style.padding = CB_Padd + "px"; + CB_ShTh = document.getElementById("CB_ShowTh"); + CB_ImgHd = document.getElementById("CB_ImgHide"); + CB_ImgHd.style.backgroundColor = "#fff"; + CB_ImgHd.style.opacity = 0.75; + CB_ImgHd.style.filter = "alpha(opacity=75)"; + CB_Win = document.getElementById("CB_Window"); + CB_Thm = document.getElementById("CB_Thumbs"); + CB_Thm2 = document.getElementById("CB_Thumbs2"); + CB_HideContent = document.getElementById("CB_ContentHide"); + CB_HideContent.style.backgroundColor = CB_HideColor; + CB_HideContent.style.opacity = 0; + CB_HideContent.style.filter = "alpha(opacity=0)"; + CB_Img = document.getElementById("CB_Image"); + CB_LoadingImg = document.getElementById("CB_LoadingImage"); + CB_ImgCont = document.getElementById("CB_ImgContainer"); + CB_Img.style.border = CB_ImgBorder + "px solid " + CB_ImgBorderColor; + CB_Cls = document.getElementById("CB_CloseWindow"); + CB_SlideS = document.getElementById("CB_SlideShowS"); + CB_SlideP = document.getElementById("CB_SlideShowP"); + CB_Speak = document.getElementById("CB_Speaker"); + CB_ZoomS = document.getElementById("CB_ZoomOn"); + CB_ZoomP = document.getElementById("CB_ZoomOff"); + CB_SlideB = document.getElementById("CB_SlideShowBar"); + CB_SlideB.style.opacity = 0.5; + CB_SlideB.style.filter = "alpha(opacity=50)"; + CB_Prv = document.getElementById("CB_Prev"); + CB_Nxt = document.getElementById("CB_Next"); + CB_Txt = document.getElementById("CB_Text"); + // CB_Txt.style.height = CB_TextH - CB_PadT + "px"; + // CB_Txt.style.marginTop = CB_PadT + "px"; + CB_Txt.style.fontFamily = CB_Font; + CB_Txt.style.fontSize = CB_FontSize + "px"; + CB_Txt.style.fontWeight = CB_FontWeigth; + //CB_Txt.style.color = CB_FontColor; + + CB_Txt2 = document.getElementById("CB_DetailText"); + CB_Txt2.style.fontFamily = CB_Font; + CB_Txt2.style.fontSize = CB_FontSize + "px"; + CB_Txt2.style.fontWeight = CB_FontWeigth; + + CB_Txt2a = document.getElementById("CB_Details"); + CB_Txt2a.style.fontFamily = CB_Font; + CB_Txt2a.style.fontSize = CB_FontSize + "px"; + CB_Txt2a.style.fontWeight = CB_FontWeigth; + + CB_Txt3 = document.getElementById("CB_NoteText"); + CB_Txt3.style.fontFamily = CB_Font; + CB_Txt3.style.fontSize = CB_FontSize + "px"; + CB_Txt3.style.fontWeight = CB_FontWeigth; + + CB_Txt3a = document.getElementById("CB_Notes"); + CB_Txt3a.style.fontFamily = CB_Font; + CB_Txt3a.style.fontSize = CB_FontSize + "px"; + CB_Txt3a.style.fontWeight = CB_FontWeigth; + + CB_Txt4 = document.getElementById("CB_UrlNotes"); + CB_Txt4.style.fontFamily = CB_Font; + CB_Txt4.style.fontSize = CB_FontSize + "px"; + CB_Txt4.style.fontWeight = CB_FontWeigth; + + CB_Header = document.getElementById("CB_Header").style; + CB_Header.height = CB_RoundPix + "px"; + CB_Footer = document.getElementById("CB_Footer").style; + CB_Footer.height = CB_RoundPix + "px"; + CB_Left = document.getElementById("CB_Left").style; + CB_Left.width = CB_RoundPix + CB_ie6RPBug + "px"; + CB_Right = document.getElementById("CB_Right").style; + CB_Right.width = CB_RoundPix + "px"; + CB_iFr = document.getElementById("CB_iFrame"); + CB_PrvNxt = document.getElementById("CB_PrevNext").style; + CB_ShTh.onmouseover = function () {CB_ShowThumbs();return;}; + CB_ImgHd.onmouseover = function () {CB_HideThumbs();return;}; + CB_Txt.onmouseover = function () {CB_HideThumbs();return;}; + CB_HideContent.onmouseover = function () {CB_HideThumbs();return;}; + + if (navigator.userAgent.indexOf("MSIE") != -1 && + navigator.userAgent.indexOf("Windows") != -1 && + navigator.userAgent.indexOf("MSIE 7") == -1) { + CB_pngFixIE(); + } + + if (navigator.userAgent.indexOf("Opera") != -1) { + CB_BodyMarginX = 0; + CB_BodyMarginY = 0; + } + + if (navigator.userAgent.indexOf("Firefox") != -1) { + CB_BodyMarginY = 0; + } + } + + document.getElementById("CB_Thumbs").onmousemove = getMouseXY; + + var d = 0; + var e = 0; + CB_Links = document.getElementsByTagName("a"); + for (i = 0; i < CB_Links.length; i++) { + CB_Rel = CB_Links[i].rel; + CB_URL = CB_Links[i].getAttribute("href"); + if (CB_Rel.match("clearbox") != null && CB_Show != 0) { + if (CB_Rel == "clearbox") { + CB_Links[i].onclick = function () {CB_ClickIMG(this.rel + "+\\+" + this.getAttribute("href") + "+\\+" + this.getAttribute("rev"));return false;}; + } else { + if (CB_Rel.substring(0, 8) == "clearbox" && + CB_Rel.charAt(8) == "[" && + CB_Rel.charAt(CB_Rel.length - 1) == "]") { + if (CB_Links[i].rel.substring(9, CB_Links[i].rel.length - 1).split(",")[0] != "clearbox") { + CB_Links[i].onclick = function () {CB_ClickIMG(this.rel.substring(9, this.rel.length - 1) + "+\\+" + this.getAttribute("href") + "+\\+" + this.getAttribute("rev"));return false;}; + } else { + alert("ClearBox HIBA:\n\nClearBox galeria neve NEM lehet \"clearbox[clearbox]\"!\n(Helye: dokumentum, a " + i + ". <a> tag-en belul.)"); } + } else if (CB_Rel.substring(0, 8) == "clearbox" && + CB_Rel.charAt(8) == "(" && + CB_Rel.charAt(CB_Rel.length - 1) == ")") { + if (CB_Rel.substring(9, CB_Rel.length - 1).split(", ")[2] == "click") { + CB_Links[i].onclick = function () {CB_ClickURL(this.rel.substring(9, this.rel.length - 1) + "+\\+" + this.getAttribute("href") + "+\\+" + this.getAttribute("rev"));return false;}; + } else { + CB_Links[i].onmouseover = function () {CB_ClickURL(this.rel.substring(9, this.rel.length - 1) + "+\\+" + this.getAttribute("href") + "+\\+" + this.getAttribute("rev"));return false;}; + } + } else { + alert("ClearBox HIBA:\n\nHibasan megadott clearbox REL azonosito: \"" + CB_Links[i].rel + "\"!\n(Helye: dokumentum, a " + i + ". <a> tag-en belul.)"); + } + } + } + } + } + + function CB_ClickIMG(a) { + zoomSet=1; + if (CB_Show == 0) { + return false; + } + CB_Cls.onclick = ""; + CB_SlideS.onclick = ""; + CB_SlideP.onclick = ""; + CB_Clicked = a.split("+\\+"); + CB_Rel = CB_Clicked[0].split(","); + + if (CB_Rel[1] > 0) { + CB_SlShowTimer = parseInt(CB_Rel[1]) * 1000; + } else { + CB_SlShowTimer = CB_SlShowTime; + } + + if (CB_Rel[2] == "start") { + CB_SS = "pause"; + } + + if (CB_Gallery && + CB_Rel[0] == CB_Gallery[0][0] && CB_Gallery[0][0] != "clearbox") { + } else { + CB_Gallery = new Array; + CB_Gallery.push(new Array(CB_Rel[0], CB_Rel[1], CB_Rel[2])); + if (CB_Clicked[0] == "clearbox") { + CB_Gallery.push(new Array(CB_Clicked[1], CB_Clicked[2])); + } else { + for (i = 0; i < CB_Links.length; i++) { + if (CB_Links[i].rel.substring(9, CB_Links[i].rel.length - 1).split(",")[0] == CB_Gallery[0][0]) { + var b = CB_PicDir + "blank.gif"; + if (CB_Links[i].getAttribute("tnhref") == null || + CB_Links[i].getAttribute("tnhref") == "null") { + for (j = 0; j < CB_Links[i].childNodes.length; j++) { + if (CB_Links[i].childNodes[j].src != undefined) { + b = CB_Links[i].childNodes[j].src; + } + } + } else { + b = CB_Links[i].getAttribute("tnhref"); + } + // Split the rev attribute + var splitTitle = CB_Links[i].getAttribute("rev").split("::",4); + CB_Gallery.push(new Array(CB_Links[i].getAttribute("href"), splitTitle[2], b, splitTitle[0], splitTitle[1], splitTitle[3])); + } + } + } + } + + CB_ActImgId = 0; + + while (CB_Gallery[CB_ActImgId][0] != CB_Clicked[1]) { + CB_ActImgId++; + } + CB_ImgWidthOld = CB_WinBaseW; + CB_ImgHeightOld = CB_WinBaseH - CB_TextH; + CB_SetAllPositions(); + CB_HideDocument(); + } + + function CB_SetAllPositions() { + getBrowserSize(); + getDocumentSize(); + getScrollPosition(); + if (BrSizeY > DocSizeY) { + DocSizeY = BrSizeY; + } + if ((navigator.userAgent.indexOf("Netscape") != -1 || + navigator.userAgent.indexOf("Firefox") != -1) && + BrSizeX != DocSizeX) { + FF_ScrollbarBug = window.scrollMaxY + window.innerHeight - DocSizeY; + } else { + FF_ScrollbarBug = 0; + } + CB_SetMargins(); + if (CB_BodyMarginX == 0) { + if (DocSizeX > BrSizeX) { + CB_HideContent.style.width = DocSizeX + "px"; + } else { + CB_HideContent.style.width = BrSizeX + "px"; + } + } else { + CB_HideContent.style.width = DocSizeX + CB_BodyMarginX + "px"; + } + CB_HideContent.style.height = BrSizeY + DocScrY + "px"; + CB_HideContent.style.visibility = "visible"; + return; + } + + var clicks=0; + function CB_BrBack_Close() { + // Debug ----------------- + // alert(browserName); + if (browserName=="Firefox" || browserName=="Opera"){ + CB_Close(); + history.go(-1); + }else if (browserName=="Microsoft Internet Explorer") { + clicks=(clicks+1); + if (clicks==1) { + CB_Close(); + }else{ + CB_Close(); + clicks=0; + history.go(-1); + } + }else{ + CB_Close(); + } + } + + + function CB_ClickURL(a) { + CB_iFr.src = ""; + // alert("Open = " + clicks); + if (CB_Show == 0) { + return false; + } + CB_ClearBox = "ki"; + CB_Clicked = a.split("+\\+"); + CB_PrvNxt.display = "none"; + CB_Cls.style.display = "block"; + CB_Cls.onclick = function () { CB_BrBack_Close();return false; }; + CB_Rel = CB_Clicked[0].split(", "); + // alert(CB_Clicked[0] + " and " + CB_Clicked[1] + " and " + CB_Clicked[2]); + CB_SetAllPositions(); + CB_ImgWidth = parseInt(CB_Rel[0]); + CB_ImgHeight = parseInt(CB_Rel[1]); + CB_ImgWidthOld = CB_WinBaseW; + CB_ImgHeightOld = CB_WinBaseH - CB_TextH; + if (CB_ImgWidth > BrSizeX - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd)) { + CB_ImgWidth = BrSizeX - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd); + } + if (CB_ImgHeight > BrSizeY - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd) - CB_TextH) { + CB_ImgHeight = BrSizeY - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd) - CB_TextH; + } + CB_Img.style.width = CB_WinBaseW + "px"; + CB_Img.style.height = CB_WinBaseH - CB_TextH + "px"; + CB_Img.style.display = "block"; + CB_Img.style.visibility = "hidden"; + CB_Win.style.visibility = "visible"; + CB_SlideS.style.display = "none"; + CB_SlideP.style.display = "none"; + CB_Speak.style.display = "none"; + CB_ZoomS.style.display = "none"; + CB_ZoomP.style.display = "none"; + + CB_Txt2.style.visibility = "hidden"; + CB_Txt2a.style.visibility = "hidden"; + CB_HideDocument("x"); + CB_HideContent.onclick = function () {CB_Close();return false;}; + CB_SS = "pause"; + } + + function CB_HideDocument(a) { + var b = a; + if (CB_ii < CB_HideOpacity) { + CB_ii += CB_OpacityStep; + CB_HideContent.style.opacity = CB_ii / 100; + CB_HideContent.style.filter = "alpha(opacity=" + CB_ii + ")"; + CB_Hide = CB_ii; + CB_Blur = setTimeout("CB_HideDocument('" + b + "')", 5); + } else { + CB_ii = 0; + CB_HideContent.style.height = DocSizeY + CB_BodyMarginY + "px"; + if (CB_HideOpacity != 0) { + clearTimeout(CB_Blur); + } + if (b == "x") { + CB_LoadingImg.style.visibility = "visible"; + CB_AnimatePlease("x"); + } else { + CB_NewWindow(); + } + return; + } + } + + function CB_NewWindow() { + CB_Img.style.width = CB_WinBaseW + "px"; + CB_Img.style.height = CB_WinBaseH - CB_TextH + "px"; + CB_Img.style.display = "block"; + CB_Img.style.visibility = "hidden"; + CB_Win.style.visibility = "visible"; + CB_LoadImage(); + } + + function CB_LoadImage(a) { + CB_ImgWidthOld = CB_ImgWidth; + CB_ImgHeightOld = CB_ImgHeight; + CB_Thm.style.display = "none"; + CB_ImgHd.style.width = "0px"; + CB_ImgHd.style.height = "0px"; + CB_ImgHd.style.visibility = "hidden"; + CB_Thm.style.width = "0px"; + CB_ClearBox = "ki"; + CB_jj = 0; + CB_HideContent.onclick = ""; + if (CB_Gallery.length < 3) { + CB_SlideS.style.display = "none"; + CB_SlideP.style.display = "none"; + CB_Speak.style.display = "none"; + CB_ZoomP.style.display = "none"; + CB_ZoomS.style.display = "block"; + } else { + if (CB_SS == "start") { + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } +// CB_ZoomS.style.display = "none"; + CB_ZoomP.style.display = "none"; + } else { + CB_SlideP.style.display = "block"; + CB_SlideS.style.display = "none"; +// CB_Speak.style.display = "none"; + CB_ZoomP.style.display = "none"; + CB_ZoomS.style.display = "none"; + } + } + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + + if (a) { + CB_ActImgId = parseInt(a); + } + CB_JumpX = CB_Jump_X; + CB_JumpY = CB_Jump_Y; + if (CB_Animation != "warp") { + CB_Img.style.visibility = "hidden"; + CB_LoadingImg.style.visibility = "visible"; + } + CB_Txt.innerHTML = CB_LoadingText; + CB_Txt.innerHTML = ""; + CB_Count = 0; + CB_preImages = new Image; + CB_preImages.src = CB_Gallery[CB_ActImgId][0]; + CB_Loaded = false; +// CB_preImages.onerror = function () {CB_ShowImage();alert("ClearBox ERROR:\n\nCould not open Image: " + CB_Gallery[CB_ActImgId][0]);return;}; + CB_preImages.onerror = function () {CB_ShowImage();alert("ClearBox ERROR:\n\nCould not open Image : " );return;}; + CB_CheckLoaded(); +// resetZoom(); + } + + function CB_CheckLoaded() { + if (CB_Count == 1) { + CB_Loaded = true; + clearTimeout(CB_ImgLoadTimer); + CB_GetImageSize(); + return; + } + if (CB_Loaded == false && CB_preImages.complete) { + CB_Count++; + } + CB_ImgLoadTimer = setTimeout("CB_CheckLoaded()", 5); + return; + } + + function CB_GetImageSize() { + CB_ImgWidth = CB_preImages.width; + CB_ImgHeight = CB_preImages.height; + CB_ImgWidthOrig = CB_ImgWidth; + CB_ImgHeightOrig = CB_ImgHeight; + CB_ImgRate = CB_ImgWidth / CB_ImgHeight; + CB_FitToBrowser(); + CB_Img.src = CB_Gallery[CB_ActImgId][0]; +// CB_Img.mid = CB_Gallery[CB_ActImgId][2]; +// CB_Txt.style.width = CB_ImgWidth + "px"; + CB_AnimatePlease(); + return; + } + + function CB_AnimatePlease(a) { + // CB_Speak.style.display = "none"; + tt_HideInit(); + CB_tt="closed"; + CB_JumpX = CB_Jump_X; + CB_JumpY = CB_Jump_Y; + CB_AnimX = "false"; + CB_AnimY = "false"; + CB_IsAnimating = 1; + + if (CB_Animation == "double") { + CB_WindowResizeX(); + CB_WindowResizeY(); + } else if (CB_Animation == "warp") { + if (!a) { + CB_LoadingImg.style.visibility = "hidden"; + CB_Img.style.visibility = "visible"; + } + CB_WindowResizeX(); + CB_WindowResizeY(); + } else if (CB_Animation == "none") { + CB_SetMargins(); + CB_ImgCont.style.height = CB_ImgHeight + 2 * CB_ImgBorder + "px"; + CB_Img.style.width = CB_ImgWidth + "px"; + CB_Img.style.height = CB_ImgHeight + "px"; + CB_AnimX = "true"; + CB_AnimY = "true"; + } else if (CB_Animation == "normal") { + CB_WindowResizeX(); + }else{ + // ---Adjust Title width to image --------------------------------------- + CB_Txt.style.width = CB_ImgWidthOld + "px"; + // -------------------------------------------------------------------------- + + } + if (a) { + CB_CheckResize2(); + } else { + CB_CheckResize(); + } + return; + } + + function CB_WindowResizeX() { + if (CB_ImgWidth == CB_ImgWidthOld) { + if (CB_TimerX) { + clearTimeout(CB_TimerX); + } + if (CB_Animation == "normal") { + CB_AnimX = "true"; + CB_WindowResizeY(); + } else { + CB_AnimX = "true"; + } + return; + } else { + if (CB_ImgWidth < CB_ImgWidthOld) { + if (CB_ImgWidthOld < CB_ImgWidth + 100 && CB_Jump_X > 20) { + CB_JumpX = 20; + } + if (CB_ImgWidthOld < CB_ImgWidth + 60 && CB_Jump_X > 10) { + CB_JumpX = 10; + } + if (CB_ImgWidthOld < CB_ImgWidth + 30 && CB_Jump_X > 5) { + CB_JumpX = 5; + } + if (CB_ImgWidthOld < CB_ImgWidth + 15 && CB_Jump_X > 2) { + CB_JumpX = 2; + } + if (CB_ImgWidthOld < CB_ImgWidth + 4) { + CB_JumpX = 1; + } + CB_ImgWidthOld -= CB_JumpX; + } else { + if (CB_ImgWidthOld > CB_ImgWidth - 100 && CB_Jump_X > 20) { + CB_JumpX = 20; + } + if (CB_ImgWidthOld > CB_ImgWidth - 60 && CB_Jump_X > 10) { + CB_JumpX = 10; + } + if (CB_ImgWidthOld > CB_ImgWidth - 30 && CB_Jump_X > 50) { + CB_JumpX = 5; + } + if (CB_ImgWidthOld > CB_ImgWidth - 15 && CB_Jump_X > 2) { + CB_JumpX = 2; + } + if (CB_ImgWidthOld > CB_ImgWidth - 4) { + CB_JumpX = 1; + } + CB_ImgWidthOld += CB_JumpX; + } + CB_Img.style.width = CB_ImgWidthOld + "px"; + // ---Adjust Title width to image --------------------------------------- + CB_Txt.style.width = CB_ImgWidthOld + "px"; + // -------------------------------------------------------------------------- + CB_MarginL = parseInt(DocScrX - (CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_TimerX = setTimeout("CB_WindowResizeX()", CB_AnimTimeout); + } + } + + function CB_WindowResizeY() { + if (CB_ImgHeight == CB_ImgHeightOld) { + if (CB_TimerY) { + clearTimeout(CB_TimerY); + } + CB_AnimY = "true"; + return; + } else { + if (CB_ImgHeight < CB_ImgHeightOld) { + if (CB_ImgHeightOld < CB_ImgHeight + 100 && CB_Jump_Y > 20) { + CB_JumpY = 20; + } + if (CB_ImgHeightOld < CB_ImgHeight + 60 && CB_Jump_Y > 10) { + CB_JumpY = 10; + } + if (CB_ImgHeightOld < CB_ImgHeight + 30 && CB_Jump_Y > 5) { + CB_JumpY = 5; + } + if (CB_ImgHeightOld < CB_ImgHeight + 15 && CB_Jump_Y > 2) { + CB_JumpY = 2; + } + if (CB_ImgHeightOld < CB_ImgHeight + 4) { + CB_JumpY = 1; + } + CB_ImgHeightOld -= CB_JumpY; + } else { + if (CB_ImgHeightOld > CB_ImgHeight - 100 && CB_Jump_Y > 20) { + CB_JumpY = 20; + } + if (CB_ImgHeightOld > CB_ImgHeight - 60 && CB_Jump_Y > 10) { + CB_JumpY = 10; + } + if (CB_ImgHeightOld > CB_ImgHeight - 30 && CB_Jump_Y > 5) { + CB_JumpY = 5; + } + if (CB_ImgHeightOld > CB_ImgHeight - 15 && CB_Jump_Y > 2) { + CB_JumpY = 2; + } + if (CB_ImgHeightOld > CB_ImgHeight - 4) { + CB_JumpY = 1; + } + CB_ImgHeightOld += CB_JumpY; + } + CB_Img.style.height = CB_ImgHeightOld + "px"; + CB_ImgCont.style.height = CB_ImgHeightOld + 2 * CB_ImgBorder + "px"; + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + CB_TimerY = setTimeout("CB_WindowResizeY()", CB_AnimTimeout); + } + } + + function CB_CheckResize() { + if (CB_AnimX == "true" && CB_AnimY == "true") { + if (CB_ResizeTimer) { + clearTimeout(CB_ResizeTimer); + } + + // ---Adjust Title width to image --------------------------------------- + CB_Txt.style.width = CB_ImgWidthOld + "px"; + // -------------------------------------------------------------------------- + + CB_ShowImage(); + return; + } else { + CB_ResizeTimer = setTimeout("CB_CheckResize()", 5); + } + } + + function CB_CheckResize2() { + if (CB_AnimX == "true" && CB_AnimY == "true") { + if (CB_ResizeTimer) { + clearTimeout(CB_ResizeTimer); + } + CB_Gallery = ""; + CB_iFr.src = CB_Clicked[1]; + CB_Img.style.visibility = "visible"; + CB_LoadingImg.style.visibility = "hidden"; + CB_iFr.style.top = CB_ImgBorder + "px"; + CB_iFr.style.left = CB_ImgBorder + "px"; + CB_iFr.style.width = CB_ImgWidth + "px"; + //BH next line changed to make url navbar smaller in Firefox + //BH CB_iFr.style.height = CB_ImgHeight + 2 + "px"; + CB_iFr.style.height = CB_ImgHeight + 4 + "px"; + + if (CB_Clicked[2] && + CB_Clicked[2] != "null" && CB_Clicked[2] != null) { + + CB_Txt.style.visibility = "visible"; + CB_Txt3.style.visibility = "visible"; + CB_Txt3a.style.visibility = "visible"; + + CB_Txt4.style.top = "20px"; + CB_Txt4.style.left = "20px"; + CB_Txt4.style.width = "200px"; + CB_Txt4.style.height = "80px"; + CB_Txt4.innerHTML = " Testing "; + CB_Txt4.style.visibility = "hidden"; + + // Split URL title and also create CB_Txt.innerHTML + // CB_Txt.innerHTML = CB_Clicked[2]; + var splitURLTitle = CB_Clicked[2].split("::",4); + CB_Txt.innerHTML = splitURLTitle[2]; + var MIDa = splitURLTitle[0]; + var GEDCOMa = splitURLTitle[1]; + var notey = splitURLTitle[3]; + if (notey != "<br />" && notey) { + CB_Txt3.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey + "', CENTERWINDOW, false, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, -450, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, false, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -25, OFFSETX, 40, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ></a>"; + CB_Txt3a.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey + "', CENTERWINDOW, false, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, -450, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, false, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -25, OFFSETX, 40, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ><img id=\"CB_PicNotes\" title=\"" + CB_ImgNotes + "\" src=\"" + CB_PicDir + CB_PictureNotes + "\" alt=\"\" /></a>"; + + } + CB_Txt2.onclick = function () { window.location.href = 'mediaviewer.php?mid='+MIDa+'&ged='+GEDCOMa; return false; }; + CB_Txt2a.onclick = function () { window.location.href = 'mediaviewer.php?mid='+MIDa+'&ged='+GEDCOM; return false; }; + } else { + CB_Txt.innerHTML = CB_Clicked[1]; + } +//Temp CB_Txt.innerHTML += " " + CB_ImgNumBracket.substring(0, 1) + "<a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"CB_Close();\">" + CB_NavTextCls + "</a>" + CB_ImgNumBracket.substring(1, 2); + CB_HideContent.onclick = function () {CB_BrBack_Close();return false;}; + CB_ClearBox = "be"; + CB_IsAnimating = 0; + return; + } else { + CB_ResizeTimer = setTimeout("CB_CheckResize2()", 5); + } + } + + + function moveLeft() { + if ( CB_ImgWidthOld > BrSizeX ) { + CB_MarginL = CB_MarginL - 10; + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + }else{ + } + } + + function moveRight() { + if (CB_ImgWidthOld > BrSizeX ){ + CB_MarginL = CB_MarginL + 10; + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + }else{ + } + } + + function moveUp() { + if ( CB_ImgHeightOld > BrSizeY ) { + CB_MarginT = CB_MarginT - 10; + CB_Win.style.marginTop = CB_MarginT + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + }else{ + } + } + + function moveDown() { + if ( CB_ImgHeightOld > BrSizeY ) { + CB_MarginT = CB_MarginT + 10; + CB_Win.style.marginTop = CB_MarginT + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + }else{ + } + } + + function zoomIn() { + if (zoomSet == 1) { + CB_ImgWidthOld = CB_ImgWidthOld + ( CB_ImgWidthOld * 0.05 ); + CB_ImgHeightOld = CB_ImgHeightOld + ( CB_ImgHeightOld * 0.05 ); + CB_Img.style.width = CB_ImgWidthOld + "px"; + CB_Img.style.height = CB_ImgHeightOld + "px" ; + CB_ImgCont.style.height = CB_ImgHeightOld + ( 2 ) * CB_ImgBorder + "px"; + CB_MarginL = parseInt(DocScrX - (CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + if (CB_Gallery.length < 3) { + CB_SlideS.style.display = "none"; + }else{ + CB_SlideS.style.display = "block"; + } + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + // ---Adjust Title width to image --------------------------------------- + CB_Txt.style.width = CB_ImgWidthOld + "px"; + // -------------------------------------------------------------------------- + CB_Zoom = "true"; + // Drag and Drop + dragDrop.initElement(CB_Win); + CB_Win.onclick = function() {return false;}; + } + } + + function zoomOut() { + if (zoomSet == 1) { + CB_ImgWidthOld = CB_ImgWidthOld - ( CB_ImgWidthOld * 0.05 ); + CB_ImgHeightOld = CB_ImgHeightOld - ( CB_ImgHeightOld * 0.05 ); + CB_Img.style.width = CB_ImgWidthOld + "px"; + CB_Img.style.height = CB_ImgHeightOld + "px"; + CB_ImgCont.style.height = CB_ImgHeightOld + ( 2 ) * CB_ImgBorder + "px"; + CB_MarginL = parseInt(DocScrX - (CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + CB_SlideB.style.display = "none"; + CB_ZoomP.style.display = "block"; + CB_ZoomS.style.display = "none"; + if (CB_Gallery.length < 3) { + CB_SlideS.style.display = "none"; + }else{ + CB_SlideS.style.display = "block"; + } + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "none"; + // ---Adjust Title width to image --------------------------------------- + CB_Txt.style.width = CB_ImgWidthOld + "px"; + // -------------------------------------------------------------------------- + CB_Zoom = "true"; + // Drag and Drop + dragDrop.initElement(CB_Win); + CB_Win.onclick = function() {return false;}; + } + } + + function setZoom() { + zoomSet = 2; + // Drag and Drop + } + + function resetZoom() { + + CB_AnimatePlease(); + + CB_ImgWidthOld = CB_ImgWidthOrig; + CB_ImgHeightOld = CB_ImgHeightOrig; + CB_Img.style.width = CB_ImgWidthOld + "px"; + CB_Img.style.height = CB_ImgHeightOld + "px"; + CB_ImgCont.style.height = CB_ImgHeightOld + ( 2 ) * CB_ImgBorder + "px"; + CB_MarginL = parseInt(DocScrX - (CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + if (CB_Gallery.length < 3) { + CB_Prv.style.display = "none"; + CB_Nxt.style.display = "none"; + }else{ + CB_Prv.style.display = "block"; + CB_Nxt.style.display = "block"; + } + CB_SlideB.style.display = "none"; + CB_ZoomS.style.display = "block"; + CB_ZoomP.style.display = "none"; + + if (CB_Gallery.length < 3) { + CB_SlideS.style.display = "none"; + }else{ + CB_SlideS.style.display = "block"; + } + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "block"; + zoomSet=1; + CB_Win.style.left = "50%"; + CB_Win.style.top = "50%"; + return; + } + + + + function closeZoom() { + CB_ImgWidthOld = CB_ImgWidthOrig; + CB_ImgHeightOld = CB_ImgHeightOrig; + CB_Img.style.width = CB_ImgWidthOrig + "px"; + CB_Img.style.height = CB_ImgHeightOrig + "px"; + CB_ImgCont.style.height = CB_ImgHeightOrig + ( 2 ) * CB_ImgBorder + "px"; + CB_MarginL = parseInt(DocScrX - (CB_ImgWidthOrig + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeightOrig + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + CB_Prv.style.display = "block"; + CB_Nxt.style.display = "block"; + CB_SlideB.style.display = "none"; + CB_ZoomS.style.display = "block"; + CB_ZoomP.style.display = "none"; + CB_SlideS.style.display = "block"; + CB_SlideP.style.display = "none"; + CB_ShTh.style.display = "block"; + zoomSet=1; + return; + } + + // New function used when counting number of lines in a Note ==================================== + function countOccurrencesOf(source, pattern) { + count = 0; + if (source!=null) { + len = pattern.length; + found = -1; + start = 0; + while( (found = source.indexOf(pattern, start) ) != -1) { + start = found + len; + count++; + } + return count; + } + else return 0; + } + // ======================================================================================== + + function decode_htmlspecialchars(p_string) { + p_string = p_string.replace(/&/g, '&'); + p_string = p_string.replace(/</g, '<'); + p_string = p_string.replace(/>/g, '>'); + p_string = p_string.replace(/\\"/g, '"'); + p_string = p_string.replace(/"/g, '"'); + p_string = p_string.replace(/'/g, '\''); + p_string=p_string.replace(/\\'/g,'\''); + p_string=p_string.replace(/\\"/g,'"'); + p_string=p_string.replace(/\\\\/g,'\\'); + p_string=p_string.replace(/\\0/g,'\0'); + return p_string; + }; + + function CB_ShowImage() { + // ---Adjust Title width to image ---------------------------- + CB_Txt.style.width = CB_ImgWidth + "px"; + // --------------------------------------------------------------- + + // UnTip(); // Supposed to Clear Notes Tooltip ... Does not work ? + tt_HideInit(); // Clears Notes Tooltip + + // init music player + setMusicPlayer(); + // set navigation controls + CB_Cls.onclick = function () {resetVolume(); CB_Close();}; // Close + CB_SlideS.onclick = function () {resetZoom(); CB_SSStart();return false; }; // Start Slideshow + CB_SlideP.onclick = function () {CB_SSPause();return false;}; // pause Slideshow + CB_Speak.onclick = function () {player.play();return false;}; // Speaker on/off + CB_ZoomP.onclick = function () {resetZoom(); CB_SSStart(); CB_SSPause(); return false; }; // Reset Zoom + CB_Win.ondblclick= function () {resetZoom(); CB_SSStart(); CB_SSPause(); return false; }; // REset Zoom +// CB_ZoomS.onclick = function () {CB_FullSize(); }; + + CB_PrvNxt.display = "block"; + if (CB_Animation != "warp") { + CB_Txt.innerHTML = ""; + CB_Txt3.innerHTML = ""; + CB_Txt3a.innerHTML = ""; + CB_LoadingImg.style.visibility = "hidden"; + CB_Img.src = CB_Gallery[CB_ActImgId][0]; + CB_Img.style.visibility = "visible"; + } + CB_Cls.style.display = "block"; + CB_HideContent.onclick = function () {CB_Close();return false;}; + CB_Prv.style.height = CB_ImgHeight + "px"; + CB_Nxt.style.height = CB_ImgHeight + "px"; + + if (CB_Gallery[CB_ActImgId][1] && + CB_Gallery[CB_ActImgId][1] != "null" && + CB_Gallery[CB_ActImgId][1] != null) { + + CB_Txt.innerHTML = CB_Gallery[CB_ActImgId][1]; + var notey1 = CB_Gallery[CB_ActImgId][5]; + if (notey1 != "<br />" && notey1 ) { + // alert(notey1); + var brs = countOccurrencesOf(notey1, "<br />"); + var spacer=7; + if (brs==1) {spacer=spacer+0;} + if (brs==2) {spacer=spacer+5;} + if (brs==3) {spacer=spacer+10;} + if (brs==4) {spacer=spacer+17;} + if (brs==5) {spacer=spacer+20;} + if (brs==6) {spacer=spacer+27;} + if (brs==7) {spacer=spacer+35;} + if (brs==8) {spacer=spacer+45;} + if (brs==9) {spacer=spacer+55;} + if (brs==10) {spacer=spacer+65;} + //alert(brs + " - " + spacer); + + // CB_Txt3.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey1 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true , BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, 150-" + ((DocSizeY-BrSizeY)/2) + ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ></a>"; + // CB_Txt3a.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey1 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -10-" + ((DocSizeY-BrSizeY)/2) + "+" +(CB_ImgHeight/2)+ "-" +(spacer)+ ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ><img id=\"CB_PicNotes\" title=\"" + CB_ImgNotes + "\" src=\"" + CB_PicDir + CB_PictureNotes + "\" alt=\"\" /></a>"; + CB_Txt3.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('" + notey1 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true , BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, 150-" + ((DocSizeY-BrSizeY)/2) + ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ></a>"; + CB_Txt3a.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('" + notey1 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -10-" + ((DocSizeY-BrSizeY)/2) + "+" +(CB_ImgHeight/2)+ "-" +(spacer)+ ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ><img id=\"CB_PicNotes\" title=\"" + CB_ImgNotes + "\" src=\"" + CB_PicDir + CB_PictureNotes + "\" alt=\"\" /></a>"; + + Tip(decode_htmlspecialchars(notey1), CENTERWINDOW, true, DELAY, 0, TEXTALIGN, CB_Alignm, WIDTH, CB_ImgWidth-30, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -10-((DocSizeY-BrSizeY)/2)+(CB_ImgHeight/2)-(spacer), OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true ); + + } + } else { + if (CB_ShowImgURL == "be") { + CB_Txt.innerHTML = CB_Gallery[CB_ActImgId][0].split("/")[CB_Gallery[CB_ActImgId][0].split("/").length - 1]; + var notey2 = CB_Gallery[CB_ActImgId][5]; + if (notey2 != "<br />" && notey2 ) { + // alert(notey2); + var brs = countOccurrencesOf(notey2, "<br />"); + var spacer=7; + if (brs==1) {spacer=spacer+0;} + if (brs==2) {spacer=spacer+5;} + if (brs==3) {spacer=spacer+10;} + if (brs==4) {spacer=spacer+17;} + if (brs==5) {spacer=spacer+20;} + if (brs==6) {spacer=spacer+27;} + if (brs==7) {spacer=spacer+35;} + if (brs==8) {spacer=spacer+45;} + if (brs==9) {spacer=spacer+55;} + if (brs==10) {spacer=spacer+65;} + // alert(brs + " - " + spacer); + CB_Txt3.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey2 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true , BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, 150-" + ((DocSizeY-BrSizeY)/2) + ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ></a>"; + CB_Txt3a.innerHTML = "<a href=\"JavaScript:void(0);\" onclick=\"TipTog('<font color=#008800><b>" + CB_ImgNotes2 + ":</b></font><br />" + notey2 + "', CENTERWINDOW, true, DELAY, 0, TEXTALIGN, '" + CB_Alignm + "', WIDTH, "+CB_ImgWidth+"-30, BGCOLOR, '#fffbcc', BALLOON, true, BALLOONSTEMWIDTH, 0, ABOVE, true, BORDERCOLOR, '', TITLEBGCOLOR, '', CLOSEBTNTEXT, 'X', CLOSEBTN, false, CLOSEBTNCOLORS, ['#ff0000', '#ffffff', '#ffffff', '#ff0000'], OFFSETY, -10-" + ((DocSizeY-BrSizeY)/2) + "+" +(CB_ImgHeight/2)+ "-" +(spacer)+ ", OFFSETX, 0, STICKY, true, PADDING, 6, CLICKCLOSE, true );\" ><img id=\"CB_PicNotes\" title=\"" + CB_ImgNotes + "\" src=\"" + CB_PicDir + CB_PictureNotes + "\" alt=\"\" /></a>"; + } + } + } + if (CB_ImgNum == "be" && CB_Gallery.length > 2) { + CB_Txt.innerHTML += " " + CB_ImgNumBracket.substring(0, 1) + CB_ActImgId + "/" + (CB_Gallery.length - 1) + CB_ImgNumBracket.substring(1, 2); + } + + CB_PrevNext(); + + CB_Txt.style.visibility = "visible"; + CB_Txt3.style.visibility= "visible"; + CB_Txt3a.style.visibility= "visible"; + if (CB_Gallery.length > 0) { + CB_ImgWidthOld = CB_ImgWidth; + CB_ImgHeightOld = CB_ImgHeight; + } + if (CB_Gallery.length > 2) { + if (CB_SS == "pause") { + CB_SlideP.style.display = "block"; + CB_SlideB.style.display = "block"; + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } + CB_SlideShow(); + } else { + CB_SlideS.style.display = "block"; + if (soond==null && CB_SS == "start") { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } + } + } else { + CB_SS = "start"; + } + CB_ClearBox = "be"; + CB_IsAnimating = 0; + if (CB_Gallery.length > 2) { + CB_ShTh.style.visibility = "visible"; + CB_ImgHd.style.width = CB_ImgWidth + 2 + "px"; + CB_ImgHd.style.height = CB_ImgHeight + 2 + "px"; + CB_Thm.style.width = CB_ImgWidth + 2 + "px"; + + var a = ""; + var b = 5; + CB_AllThumbsWidth = 0; + for (i = 1; i < CB_Gallery.length; i++) { + CB_preThumbs = new Image; + CB_preThumbs.src = CB_Gallery[i][2]; + CB_AllThumbsWidth += Math.round(CB_preThumbs.width / CB_preThumbs.height * 50); + } + CB_AllThumbsWidth += (CB_Gallery.length - 2) * b; + + var c = 0; + for (i = 1; i < CB_Gallery.length; i++) { + CB_preThumbs = new Image; + CB_preThumbs.src = CB_Gallery[i][2]; + a += "<a href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + i + ")\"><img style=\"border: 0; left: " + c + "px;\" \" src=\"" + CB_Gallery[i][2] + "\" height=\"50\" class=\"CB_ThumbsImg\" alt=\"\" /></a>"; + c += Math.round(CB_preThumbs.width / CB_preThumbs.height * 50) + b; + } + CB_Thm2.style.width = CB_AllThumbsWidth + "px"; + CB_Thm2.innerHTML = a; + CB_Thm2.style.marginLeft = (CB_ImgWidth - CB_AllThumbsWidth) / 2 + "px"; + } + +// var MID = splitURLTitle[0] + var MID = CB_Gallery[CB_ActImgId][3]; + var GEDCOM = CB_Gallery[CB_ActImgId][4]; +// CB_Txt2.onclick = function () { window.open('mediaviewer.php?filename='+MID+'&ged='+GEDCOM+'', "win01", " resizable=1, scrollbars=1, top=50, HEIGHT=800, WIDTH=1100 "); }; + if (MID != "") { + CB_Txt2.onclick = function () { window.location.href = 'mediaviewer.php?mid='+MID+'&ged='+GEDCOM; return false; }; + CB_Txt2a.onclick = function () { window.location.href = 'mediaviewer.php?mid='+MID+'&ged='+GEDCOM; return false; }; + //CB_Txt3.onclick = function () { alert(CB_Gallery[CB_ActImgId][5]); }; + + }else{ + CB_Txt2.onclick = function () { CB_Close(); }; + CB_Txt2a.onclick = function () { CB_Close(); }; + } + + return true; + } + + + + function CB_ShowThumbs() { + CB_ImgHd.style.visibility = "visible"; + CB_Thm.style.display = "block"; + return; + } + + function CB_HideThumbs() { + CB_ImgHd.style.visibility = "hidden"; + CB_Thm.style.display = "none"; + return; + } + + function getMouseXY(e) { + if (CB_AllThumbsWidth > CB_ImgWidth) { + if (IE) { + tempX = event.clientX; + } else { + tempX = e.pageX; + } + if (tempX < 0) { + tempX = 0; + } + CB_Thm2.style.marginLeft = ((BrSizeX - CB_ImgWidth) / 2 - tempX) / (CB_ImgWidth / (CB_AllThumbsWidth - CB_ImgWidth)) + "px"; + } + } + + function CB_FullSize() { + setZoom(); + CB_Img.style.width = CB_ImgWidthOrig + "px"; + CB_Img.style.height = CB_ImgHeightOrig + "px"; + CB_ImgCont.style.height = CB_ImgHeightOrig + 2 * CB_ImgBorder + "px"; + CB_ZoomS.style.display = "none"; + CB_ZoomP.style.display = "block"; +// CB_Speak.style.display = "block"; + } + + function CB_SlideShowStop() { + CB_SS = "start"; + CB_SlideShowJump(); + } + + function CB_SlideShowJump() { + if (CB_SSTimer) { + clearTimeout(CB_SSTimer); + } + CB_jj = 0; + CB_SlideBW = 0; + CB_SlideB.style.display = "none"; + } + + function CB_SlideShow() { + if (CB_SlShowTimer > CB_jj) { + CB_SSTimer = setTimeout("CB_SlideShow()", 25); + CB_jj += 25; +//BH ----- Changed slide show progress bar width as controls are now at bottom --------------------- +//BH CB_SlideBW += (CB_ImgWidth - 44) / (CB_SlShowTimer / 25); + CB_SlideBW += (CB_ImgWidth - 4) / (CB_SlShowTimer / 25); + + CB_SlideB.style.width = CB_SlideBW + "px"; + } else { + clearTimeout(CB_SSTimer); + CB_SlideBW = 0; + CB_SlideB.style.width = CB_SlideBW + "px"; + if (CB_ActImgId == CB_Gallery.length - 1) { + CB_LoadImage(1); + } else { + CB_LoadImage(CB_ActImgId + 1); + } + return; + } + } + + function CB_FitToBrowser() { + if (CB_ImgWidth > BrSizeX - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd)) { + CB_ImgWidth = BrSizeX - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd); + CB_ImgHeight = Math.round(CB_ImgWidth / CB_ImgRate); + } + if (CB_ImgHeight > BrSizeY - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd) - 3*CB_TextH) { + CB_ImgHeight = BrSizeY - 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd + CB_WinPadd) - 3*CB_TextH; + CB_ImgWidth = Math.round(CB_ImgRate * CB_ImgHeight); + } + return; + } + + function CB_SetMargins() { + CB_MarginL = parseInt(DocScrX - (CB_ImgWidth + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_MarginT = parseInt(DocScrY - (CB_ieRPBug + CB_ImgHeight + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + CB_Win.style.marginLeft = CB_MarginL + "px"; + CB_Win.style.marginTop = CB_MarginT - FF_ScrollbarBug / 2 + "px"; + return; + } + + function CB_PrevNext() { + if (CB_ActImgId > 1) { + if (CB_Preload == "be") { + PreloadPrv = new Image; + PreloadPrv.src = CB_Gallery[CB_ActImgId - 1][0]; + } + if (CB_TextNav == "be") { + var a = CB_Txt.innerHTML; + CB_Txt.innerHTML = "<a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId - 1) + ")\" alt=\"<\">" + CB_NavTextPrv + "</a> " + a; + } + CB_Prv.style.display = "block"; + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } + CB_Prv.onclick = function () { + if (CB_SSTimer) { + CB_SlideShowJump(); + } CB_LoadImage(CB_ActImgId - 1); + return false; + }; + } + if (CB_ActImgId < CB_Gallery.length - 1) { + if (CB_Preload == "be") { + PreloadNxt = new Image; + PreloadNxt.src = CB_Gallery[CB_ActImgId + 1][0]; + } + if (CB_TextNav == "be") { + CB_Txt.innerHTML += " <a class=\"CB_TextNav\" href=\"javascript:void(0)\" onclick=\"if(CB_SSTimer){CB_SlideShowJump();}CB_LoadImage(" + (CB_ActImgId + 1) + ")\" alt=\">\">" + CB_NavTextNxt + "</a>"; + } + CB_Nxt.style.display = "block"; + CB_Nxt.onclick = function () { + if (CB_SSTimer) { + CB_SlideShowJump(); + } CB_LoadImage(CB_ActImgId + 1); + return false; + }; + } + if (CB_ActImgId == 1 && CB_SS == "start" && soond=="playing" ) { + if (slideshowMusic == null) { + CB_Speak.style.display = "none"; + }else{ + CB_Speak.style.display = "block"; + } + } + return; + } + + function CB_Close() { + CB_Win.style.left = "50%"; + CB_Win.style.top = "50%"; + CB_ImgHd.style.width = "0px"; + CB_ImgHd.style.height = "0px"; + CB_ImgHd.style.visibility = "hidden"; + CB_ShTh.style.visibility = "hidden"; + CB_SlideShowStop(); + CB_Txt.style.visibility = "hidden"; + CB_Txt3.style.visibility = "hidden"; + CB_Txt3a.style.visibility = "hidden"; + CB_Txt4.style.visibility = "hidden"; + CB_Txt.innerHTML = ""; + CB_Txt3.innerHTML = ""; + CB_Txt3a.innerHTML = ""; + CB_Txt4.innerHTML = ""; + CB_Img.src = ""; + CB_ImgWidth = CB_WinBaseW; + CB_ImgHeight = CB_WinBaseH - CB_TextH; + CB_ImgCont.style.height = CB_ImgHeight + 2 * CB_ImgBorder + "px"; + CB_Img.style.display = "none"; + CB_Win.style.visibility = "hidden"; + CB_HideContent.onclick = ""; + CB_iFr.src = ""; + CB_iFr.style.top = "0px"; + CB_iFr.style.left = "0px"; + CB_iFr.style.width = "0px"; + CB_iFr.style.height = "0px"; + CB_ShowDocument(); + if (slideshowMusic == null) { + //do nothing + }else{ + player.onStopButtonClick(); + } + + soond=null; +// closeZoom(); + zoomSet=0; + return; + } + + function CB_ShowDocument() { + if (CB_Hide > 0) { + CB_HideContent.style.opacity = CB_Hide / 100; + CB_HideContent.style.filter = "alpha(opacity=" + CB_Hide + ")"; + CB_Hide -= CB_OpacityStep; + CB_Blur = setTimeout("CB_ShowDocument()", 5); + } else { + CB_HideContent.style.visibility = "hidden"; + CB_HideContent.style.width = "0px"; + CB_HideContent.style.height = "0px"; + if (CB_HideOpacity != 0) { + clearTimeout(CB_Blur); + } + CB_ClearBox = "ki"; + return; + } + } + + function getDocumentSize() { + this.DocSizeX = 0; + this.DocSizeY = 0; + if (window.innerWidth && window.scrollMaxX) { + DocSizeX = window.innerWidth + window.scrollMaxX; + DocSizeY = window.innerHeight + window.scrollMaxY; + } else if (document.body.scrollWidth > document.body.offsetWidth) { + DocSizeX = document.body.scrollWidth; + DocSizeY = document.body.scrollHeight; + } else { + DocSizeX = document.body.offsetWidth; + DocSizeY = document.body.offsetHeight; + } + if (navigator.userAgent.indexOf("MSIE") != -1 || + navigator.userAgent.indexOf("Opera") != -1) { + DocSizeX = document.body.scrollWidth; + DocSizeY = document.body.scrollHeight; + } + if (navigator.userAgent.indexOf("Firefox") != -1 || + navigator.userAgent.indexOf("Netscape") != -1) { + DocSizeX = BrSizeX + window.scrollMaxX; + DocSizeY = BrSizeY + window.scrollMaxY; + } + return; + } + + function getBrowserSize() { + this.BrSizeX = 0; + this.BrSizeY = 0; + if (document.documentElement && + (document.documentElement.clientWidth || + document.documentElement.clientHeight)) { + BrSizeX = document.documentElement.clientWidth; + BrSizeY = document.documentElement.clientHeight; + } else if (typeof window.innerWidth == "number") { + BrSizeX = window.innerWidth; + BrSizeY = window.innerHeight; + } else if (document.body && + (document.body.clientWidth || document.body.clientHeight)) { + BrSizeX = document.body.clientWidth; + BrSizeY = document.body.clientHeight; + return; + } + if (navigator.userAgent.indexOf("Opera") != -1) { + BrSizeX = document.documentElement.clientWidth; + BrSizeY = window.innerHeight; + } + if (document.compatMode != undefined) { + if (document.compatMode.match("Back") && + navigator.userAgent.indexOf("Firefox") != -1) { + BrSizeY = document.body.clientHeight; + } + } + return; + } + + function getScrollPosition() { + this.DocScrX = 0; + this.DocScrY = 0; + if (typeof window.pageYOffset == "number") { + DocScrY = window.pageYOffset; + DocScrX = window.pageXOffset; + } else if (document.body && + (document.body.scrollLeft || document.body.scrollTop)) { + DocScrY = document.body.scrollTop; + DocScrX = document.body.scrollLeft; + } else if (document.documentElement && + (document.documentElement.scrollLeft || + document.documentElement.scrollTop)) { + DocScrY = document.documentElement.scrollTop; + DocScrX = document.documentElement.scrollLeft; + } + return; + } + + function CB_pngFixIE() { + var s, i, j; + var a = new Array; + a.push(document.getElementById("CB_CloseWindow")); + a.push(document.getElementById("CB_SlideShowS")); + a.push(document.getElementById("CB_SlideShowP")); + for (i = 0; i < a.length; i++) { + s = a[i].getAttribute("src"); + if (s.toLowerCase().indexOf(".png") != -1) { + a[i].src = CB_PicDir + "blank.gif"; + a[i].style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + s + "', sizingMethod=image);"; + } + } + for (i = 0; i < document.styleSheets.length; i++) { + if (document.styleSheets[i].href.match("clearbox.css")) { + var b = document.styleSheets[i].href.lastIndexOf("/"); + var c = b != -1 ? document.styleSheets[i].href.substring(0, b + 1) : ""; + for (j = 0; j < document.styleSheets[i].rules.length; j++) { + var d = document.styleSheets[i].rules[j].style; + if (d.backgroundImage.toLowerCase().indexOf(".png") != -1) { + var e = d.backgroundImage.substring(4, d.backgroundImage.length - 1); + if (e.indexOf("http://") != 0 && + e.indexOf("/") != 0) { + e = c + e; + d.backgroundImage = "none"; + d.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e + "', sizingMethod='crop');"; + } + } + } + } + } + } + + +// --------------------------------------------------- + +function showFlash(){ + var flashObjects = document.getElementsByTagName("object"); + for (i = 0; i < flashObjects.length; i++) { + flashObjects[i].style.visibility = "visible"; + } + + var flashEmbeds = document.getElementsByTagName("embed"); + for (i = 0; i < flashEmbeds.length; i++) { + flashEmbeds[i].style.visibility = "visible"; + } +} + +// --------------------------------------------------- + + +function hideFlash(){ + var flashObjects = document.getElementsByTagName("object"); + for (i = 0; i < flashObjects.length; i++) { + flashObjects[i].style.visibility = "hidden"; + } + + var flashEmbeds = document.getElementsByTagName("embed"); + for (i = 0; i < flashEmbeds.length; i++) { + flashEmbeds[i].style.visibility = "hidden"; + } +} + + +/*------------------------------Drag and Drop - quirksmode----------------------------------------------*/ + +dragDrop = { + keyHTML: '<a href="#" class="keyLink">#</a>', + keySpeed: 10, // pixels per keypress event + initialMouseX: undefined, + initialMouseY: undefined, + startX: undefined, + startY: undefined, + dXKeys: undefined, + dYKeys: undefined, + draggedObject: undefined, + + initElement: function (element) { +/* + if (typeof element == 'string') + element = document.getElementById(element); + element = document.getElementById(element); +*/ + if (CB_ZoomP.style.display == "block") { + element.onmousedown = dragDrop.startDragMouse; + } +/* + element.innerHTML += dragDrop.keyHTML; + var links = element.getElementsByTagName('a'); + var lastLink = links[links.length-1]; + lastLink.relatedElement = element; + lastLink.onclick = dragDrop.startDragKeys; +*/ + }, + + startDragMouse: function (e) { + dragDrop.startDrag(CB_Win); + var evt = e || window.event; + dragDrop.initialMouseX = evt.clientX; + dragDrop.initialMouseY = evt.clientY; + addEventSimple(document,'mousemove',dragDrop.dragMouse); + addEventSimple(document,'mouseup',dragDrop.releaseElement); + return false; + }, + + startDragKeys: function () { + dragDrop.startDrag(this.relatedElement); + dragDrop.dXKeys = dragDrop.dYKeys = 0; + addEventSimple(document,'keydown',dragDrop.dragKeys); + addEventSimple(document,'keypress',dragDrop.switchKeyEvents); + this.blur(); + return false; + }, + + startDrag: function (obj) { + if (dragDrop.draggedObject) + dragDrop.releaseElement(); + if(IE){ + dragDrop.startX = (obj.offsetLeft+(CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + dragDrop.startY = ((obj.offsetTop-document.documentElement.scrollTop)+(CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + }else{ + // dragDrop.startX = (obj.offsetLeft)+CB_ieRPBug ; + // dragDrop.startY = (obj.offsetTop)+CB_ieRPBug ; + dragDrop.startX = (obj.offsetLeft+(CB_ImgWidthOld + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + dragDrop.startY = ((obj.offsetTop-document.documentElement.scrollTop)+(CB_ieRPBug + CB_ImgHeightOld + CB_TextH + 2 * (CB_RoundPix + CB_ImgBorder + CB_Padd)) / 2); + + } + dragDrop.draggedObject = obj; + obj.className += ' dragged'; + }, + + dragMouse: function (e) { + var evt = e || window.event; + var dX = evt.clientX - dragDrop.initialMouseX; + var dY = evt.clientY - dragDrop.initialMouseY; + dragDrop.setPosition(dX,dY); + return false; + }, + + dragKeys: function(e) { + var evt = e || window.event; + var key = evt.keyCode; + switch (key) { + case 37: // left + case 63234: + dragDrop.dXKeys -= dragDrop.keySpeed; + break; + + case 38: // up + case 63232: + dragDrop.dYKeys -= dragDrop.keySpeed; + break; + + case 39: // right + case 63235: + dragDrop.dXKeys += dragDrop.keySpeed; + break; + + case 40: // down + case 63233: + dragDrop.dYKeys += dragDrop.keySpeed; + break; + + case 13: // enter + case 27: // escape + dragDrop.releaseElement(); + return false; + + default: + return true; + } + + dragDrop.setPosition(dragDrop.dXKeys,dragDrop.dYKeys); + if (evt.preventDefault) // also solves problem in Saf; keypress part of default ??? + evt.preventDefault(); + return false; + }, + + setPosition: function (dx,dy) { + dragDrop.draggedObject.style.left = dragDrop.startX + dx + 'px'; + dragDrop.draggedObject.style.top = dragDrop.startY + dy + 'px'; + }, + + switchKeyEvents: function () { + // for Opera and Safari 1.3 + removeEventSimple(document,'keydown',dragDrop.dragKeys); + removeEventSimple(document,'keypress',dragDrop.switchKeyEvents); + addEventSimple(document,'keypress',dragDrop.dragKeys); + + }, + + + releaseElement: function() { + removeEventSimple(document,'mousemove',dragDrop.dragMouse); + removeEventSimple(document,'mouseup',dragDrop.releaseElement); + removeEventSimple(document,'keypress',dragDrop.dragKeys); + removeEventSimple(document,'keypress',dragDrop.switchKeyEvents); + removeEventSimple(document,'keydown',dragDrop.dragKeys); + dragDrop.draggedObject.className = dragDrop.draggedObject.className.replace(/dragged/,''); + dragDrop.draggedObject = null; + } +} + + +function addEventSimple(obj,evt,fn) { + if (obj.addEventListener) + obj.addEventListener(evt,fn,false); + else if (obj.attachEvent) + obj.attachEvent('on'+evt,fn); +} + +function removeEventSimple(obj,evt,fn) { + if (obj.removeEventListener) + obj.removeEventListener(evt,fn,false); + else if (obj.detachEvent) + obj.detachEvent('on'+evt,fn); +} + +// --------------------------------------------------------------------------------------
\ No newline at end of file diff --git a/modules/lightbox/js/swfobject.js b/modules/lightbox/js/swfobject.js new file mode 100644 index 0000000000..083b9b1a06 --- /dev/null +++ b/modules/lightbox/js/swfobject.js @@ -0,0 +1,145 @@ +/** + * SWFObject v1.4.3: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for + * legal reasons. + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();} +if(typeof deconcept.util=="undefined"){deconcept.util=new Object();} +if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();} +deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){ +if(!document.getElementById){return;} +this.DETECT_KEY=_b?_b:"detectflash"; +this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY); +this.params=new Object(); +this.variables=new Object(); +this.attributes=new Array(); +if(_1){this.setAttribute("swf",_1);} +if(id){this.setAttribute("id",id);} +if(w){this.setAttribute("width",w);} +if(h){this.setAttribute("height",h);} +if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));} +this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(); +if(c){this.addParam("bgcolor",c);} +var q=_8?_8:"high"; +this.addParam("quality",q); +this.setAttribute("useExpressInstall",_7); +this.setAttribute("doExpressInstall",false); +var _d=(_9)?_9:window.location; +this.setAttribute("xiRedirectUrl",_d); +this.setAttribute("redirectUrl",""); +if(_a){this.setAttribute("redirectUrl",_a);}}; +deconcept.SWFObject.prototype={setAttribute:function(_e,_f){ +this.attributes[_e]=_f; +},getAttribute:function(_10){ +return this.attributes[_10]; +},addParam:function(_11,_12){ +this.params[_11]=_12; +},getParams:function(){ +return this.params; +},addVariable:function(_13,_14){ +this.variables[_13]=_14; +},getVariable:function(_15){ +return this.variables[_15]; +},getVariables:function(){ +return this.variables; +},getVariablePairs:function(){ +var _16=new Array(); +var key; +var _18=this.getVariables(); +for(key in _18){_16.push(key+"="+_18[key]);} +return _16; +},getSWFHTML:function(){ +var _19=""; +if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){ +if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");} +_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\""; +_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" "; +var _1a=this.getParams(); +for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";} +var _1c=this.getVariablePairs().join("&"); +if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";} +_19+="/>"; +}else{ +if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");} +_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">"; +_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />"; +var _1d=this.getParams(); +for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";} +var _1f=this.getVariablePairs().join("&"); +if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";} +_19+="</object>";} +return _19; +},write:function(_20){ +if(this.getAttribute("useExpressInstall")){ +var _21=new deconcept.PlayerVersion([6,0,65]); +if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){ +this.setAttribute("doExpressInstall",true); +this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))); +document.title=document.title.slice(0,47)+" - Flash Player Installation"; +this.addVariable("MMdoctitle",document.title);}} +if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){ +var n=(typeof _20=="string")?document.getElementById(_20):_20; +n.innerHTML=this.getSWFHTML(); +return true; +}else{ +if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}} +return false;}}; +deconcept.SWFObjectUtil.getPlayerVersion=function(){ +var _23=new deconcept.PlayerVersion([0,0,0]); +if(navigator.plugins&&navigator.mimeTypes.length){ +var x=navigator.plugins["Shockwave Flash"]; +if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));} +}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");} +catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); +_23=new deconcept.PlayerVersion([6,0,21]); +axo.AllowScriptAccess="always"; +}catch(e){ +if(_23.major==6){return _23;}} +try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");} +catch(e){}} +if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}} +return _23;}; +deconcept.PlayerVersion=function(_27){ +this.major=_27[0]!=null?parseInt(_27[0]):0; +this.minor=_27[1]!=null?parseInt(_27[1]):0; +this.rev=_27[2]!=null?parseInt(_27[2]):0; +}; +deconcept.PlayerVersion.prototype.versionIsValid=function(fv){ +if(this.major<fv.major){return false;} +if(this.major>fv.major){return true;} +if(this.minor<fv.minor){return false;} +if(this.minor>fv.minor){return true;} +if(this.rev<fv.rev){return false;}return true;}; +deconcept.util={getRequestParameter:function(_29){ +var q=document.location.search||document.location.hash; +if(q){var _2b=q.substring(1).split("&"); +for(var i=0;i<_2b.length;i++){ +if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){ +return _2b[i].substring((_2b[i].indexOf("=")+1));}}} +return "";}}; +deconcept.SWFObjectUtil.cleanupSWFs=function(){ +var _2d=document.getElementsByTagName("OBJECT"); +if(_2d.length>0){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};} +for(var i=0;i<_2d.length;i++){ +_2d[i].style.display="none"; +for(var x in _2d[i]){ +if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}}; +if(typeof window.onbeforeunload=="function"){ +var oldBeforeUnload=window.onbeforeunload; +window.onbeforeunload=function(){ +deconcept.SWFObjectUtil.cleanupSWFs(); +oldBeforeUnload();}; +}else{window.onbeforeunload=deconcept.SWFObjectUtil.cleanupSWFs;} +if(Array.prototype.push==null){ +Array.prototype.push=function(_30){ +this[this.length]=_30; +return this.length;};} + +var getQueryParamValue=deconcept.util.getRequestParameter; +var FlashObject=deconcept.SWFObject; +var SWFObject=deconcept.SWFObject; + diff --git a/modules/lightbox/js/tip_balloon.js b/modules/lightbox/js/tip_balloon.js new file mode 100644 index 0000000000..d7ea18f8d6 --- /dev/null +++ b/modules/lightbox/js/tip_balloon.js @@ -0,0 +1,231 @@ +/* +tip_balloon.js v. 1.51 + +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Initial author: Walter Zorn +Last modified: 3.6.2008 + +Extension for the tooltip library wz_tooltip.js. +Implements balloon tooltips. +*/ + +// Make sure that the core file wz_tooltip.js is included first +if(typeof config == "undefined") + alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!"); + +// Here we define new global configuration variable(s) (as members of the +// predefined "config." class). +// From each of these config variables, wz_tooltip.js will automatically derive +// a command which can be passed to Tip() or TagToTip() in order to customize +// tooltips individually. These command names are just the config variable +// name(s) translated to uppercase, +// e.g. from config. Balloon a command BALLOON will automatically be +// created. + +//=================== GLOBAL TOOPTIP CONFIGURATION =========================// + +config. Balloon = false // true or false - set to true if you want this to be the default behaviour +config. BalloonImgPath = "modules/lightbox/js/tip_balloon/" // Path to images (border, corners, stem), in quotes. Path must be relative to your HTML file. + +// Sizes of balloon images +config. BalloonEdgeSize = 6 // Integer - sidelength of quadratic corner images +config. BalloonStemWidth = 15 // Integer +config. BalloonStemHeight = 19 // Integer +config. BalloonStemOffset = -7 // Integer - horizontal offset of left stem edge from mouse (recommended: -stemwidth/2 to center the stem above the mouse) + +//======= END OF TOOLTIP CONFIG, DO NOT CHANGE ANYTHING BELOW ==============// + + + + + +// Create a new tt_Extension object (make sure that the name of that object, +// here balloon, is unique amongst the extensions available for wz_tooltips.js): +var balloon = new tt_Extension(); + +// Implement extension eventhandlers on which our extension should react + +balloon.OnLoadConfig = function() +{ + if(tt_aV[BALLOON]) + { + // Turn off native style properties which are not appropriate + balloon.padding = Math.max(tt_aV[PADDING] - tt_aV[BALLOONEDGESIZE], 0); + balloon.width = tt_aV[WIDTH]; + //if(tt_bBoxOld) + // balloon.width += (balloon.padding << 1); + tt_aV[BORDERWIDTH] = 0; + tt_aV[WIDTH] = 0; + tt_aV[PADDING] = 0; + tt_aV[BGCOLOR] = ""; + tt_aV[BGIMG] = ""; + tt_aV[SHADOW] = false; + // Append slash to img path if missing + if(tt_aV[BALLOONIMGPATH].charAt(tt_aV[BALLOONIMGPATH].length - 1) != '/') + tt_aV[BALLOONIMGPATH] += "/"; + return true; + } + return false; +}; + +balloon.OnCreateContentString = function() +{ + if(!tt_aV[BALLOON]) + return false; + + var aImg, sImgZ, sCssCrn, sVaT, sVaB, sCssImg; + + // Cache balloon images in advance: + // Either use the pre-cached default images... + if(tt_aV[BALLOONIMGPATH] == config.BalloonImgPath) + aImg = balloon.aDefImg; + // ...or load images from different directory + else + aImg = Balloon_CacheImgs(tt_aV[BALLOONIMGPATH]); + sCssCrn = ' style="position:relative;width:' + tt_aV[BALLOONEDGESIZE] + 'px;padding:0px;margin:0px;overflow:hidden;line-height:0px;'; + sVaT = 'vertical-align:top;" valign="top"'; + sVaB = 'vertical-align:bottom;" valign="bottom"'; + sCssImg = 'padding:0px;margin:0px;border:0px;'; + sImgZ = '" style="' + sCssImg + '" />'; + + tt_sContent = '<table border="0" cellpadding="0" cellspacing="0" style="width:auto;padding:0px;margin:0px;left:0px;top:0px;"><tr>' + // Left-top corner + + '<td' + sCssCrn + sVaB + '>' + + '<img src="' + aImg[1].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + // Top border + + '<td valign="bottom" style="position:relative;padding:0px;margin:0px;overflow:hidden;">' + + '<img id="bALlOOnT" style="position:relative;top:1px;z-index:1;display:none;' + sCssImg + '" src="' + aImg[9].src + '" width="' + tt_aV[BALLOONSTEMWIDTH] + '" height="' + tt_aV[BALLOONSTEMHEIGHT] + '" />' + + '<div style="position:relative;z-index:0;padding:0px;margin:0px;overflow:hidden;width:auto;height:' + tt_aV[BALLOONEDGESIZE] + 'px;background-image:url(' + aImg[2].src + ');">' + + '</div>' + + '</td>' + // Right-top corner + + '<td' + sCssCrn + sVaB + '>' + + '<img src="' + aImg[3].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + + '</tr><tr>' + // Left border + + '<td style="position:relative;padding:0px;margin:0px;width:' + tt_aV[BALLOONEDGESIZE] + 'px;overflow:hidden;background-image:url(' + aImg[8].src + ');">' + // Redundant image for bugous old Geckos that won't auto-expand TD height to 100% + + '<img width="' + tt_aV[BALLOONEDGESIZE] + '" height="100%" src="' + aImg[8].src + sImgZ + + '</td>' + // Content + + '<td id="bALlO0nBdY" style="position:relative;line-height:normal;' + + ';background-image:url(' + aImg[0].src + ')' + + ';color:' + tt_aV[FONTCOLOR] + + ';font-family:' + tt_aV[FONTFACE] + + ';font-size:' + tt_aV[FONTSIZE] + + ';font-weight:' + tt_aV[FONTWEIGHT] + + ';text-align:' + tt_aV[TEXTALIGN] + + ';padding:' + balloon.padding + 'px' + + ';width:' + ((balloon.width > 0) ? (balloon.width + 'px') : 'auto') + + ';">' + tt_sContent + '</td>' + // Right border + + '<td style="position:relative;padding:0px;margin:0px;width:' + tt_aV[BALLOONEDGESIZE] + 'px;overflow:hidden;background-image:url(' + aImg[4].src + ');">' + // Image redundancy for bugous old Geckos that won't auto-expand TD height to 100% + + '<img width="' + tt_aV[BALLOONEDGESIZE] + '" height="100%" src="' + aImg[4].src + sImgZ + + '</td>' + + '</tr><tr>' + // Left-bottom corner + + '<td' + sCssCrn + sVaT + '>' + + '<img src="' + aImg[7].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + // Bottom border + + '<td valign="top" style="position:relative;padding:0px;margin:0px;overflow:hidden;">' + + '<div style="position:relative;left:0px;top:0px;padding:0px;margin:0px;overflow:hidden;width:auto;height:' + tt_aV[BALLOONEDGESIZE] + 'px;background-image:url(' + aImg[6].src + ');"></div>' + + '<img id="bALlOOnB" style="position:relative;top:-1px;left:2px;z-index:1;display:none;' + sCssImg + '" src="' + aImg[10].src + '" width="' + tt_aV[BALLOONSTEMWIDTH] + '" height="' + tt_aV[BALLOONSTEMHEIGHT] + '" />' + + '</td>' + // Right-bottom corner + + '<td' + sCssCrn + sVaT + '>' + + '<img src="' + aImg[5].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + + '</tr></table>'; + return true; +}; + +balloon.OnSubDivsCreated = function() +{ + if(tt_aV[BALLOON]) + { + balloon.iStem = tt_aV[ABOVE] * 1; + balloon.aStem = [tt_GetElt("bALlOOnT"), tt_GetElt("bALlOOnB")]; + balloon.aStem[balloon.iStem].style.display = "inline"; + if (balloon.width < -1) + Balloon_MaxW(); + return true; + } + return false; +}; + +// Display the stem appropriately +balloon.OnMoveAfter = function() +{ + if(tt_aV[BALLOON]) + { + var iStem = (tt_aV[ABOVE] != tt_bJmpVert) * 1; + + // Tooltip position vertically flipped? + if(iStem != balloon.iStem) + { + // Display opposite stem + balloon.aStem[balloon.iStem].style.display = "none"; + balloon.aStem[iStem].style.display = "inline"; + balloon.iStem = iStem; + } + + balloon.aStem[iStem].style.left = Balloon_CalcStemX() + "px"; + return true; + } + return false; +}; + +function Balloon_CalcStemX() +{ + var x = tt_musX - tt_x + tt_aV[BALLOONSTEMOFFSET] - tt_aV[BALLOONEDGESIZE]; + return Math.max(Math.min(x, tt_w - tt_aV[BALLOONSTEMWIDTH] - (tt_aV[BALLOONEDGESIZE] << 1) - 2), 2); +} + +function Balloon_CacheImgs(sPath) +{ + var asImg = ["background", "lt", "t", "rt", "r", "rb", "b", "lb", "l", "stemt", "stemb"], + n = asImg.length, + aImg = new Array(n), + img; + + while(n) + {--n; + img = aImg[n] = new Image(); + img.src = sPath + asImg[n] + ".gif"; // Change to ".png" if you want to use PNG images + } + return aImg; +} + +function Balloon_MaxW() +{ + var bdy = tt_GetElt("bALlO0nBdY"); + + if (bdy) + { + var iAdd = tt_bBoxOld ? (balloon.padding << 1) : 0, w = tt_GetDivW(bdy); + if (w > -balloon.width + iAdd) + bdy.style.width = (-balloon.width + iAdd) + "px"; + } +} + +// This mechanism pre-caches the default images specified by +// congif.BalloonImgPath, so, whenever a balloon tip using these default images +// is created, no further server connection is necessary. +function Balloon_PreCacheDefImgs() +{ + // Append slash to img path if missing + if(config.BalloonImgPath.charAt(config.BalloonImgPath.length - 1) != '/') + config.BalloonImgPath += "/"; + // Preload default images into array + balloon.aDefImg = Balloon_CacheImgs(config.BalloonImgPath); +} + +Balloon_PreCacheDefImgs(); diff --git a/modules/lightbox/js/tip_balloon/b.gif b/modules/lightbox/js/tip_balloon/b.gif Binary files differnew file mode 100644 index 0000000000..ff0c04b250 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/b.gif diff --git a/modules/lightbox/js/tip_balloon/background.gif b/modules/lightbox/js/tip_balloon/background.gif Binary files differnew file mode 100644 index 0000000000..cb61e7ffab --- /dev/null +++ b/modules/lightbox/js/tip_balloon/background.gif diff --git a/modules/lightbox/js/tip_balloon/l.gif b/modules/lightbox/js/tip_balloon/l.gif Binary files differnew file mode 100644 index 0000000000..14a68d93d2 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/l.gif diff --git a/modules/lightbox/js/tip_balloon/lb.gif b/modules/lightbox/js/tip_balloon/lb.gif Binary files differnew file mode 100644 index 0000000000..713c3739a3 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/lb.gif diff --git a/modules/lightbox/js/tip_balloon/lt.gif b/modules/lightbox/js/tip_balloon/lt.gif Binary files differnew file mode 100644 index 0000000000..93c71f465e --- /dev/null +++ b/modules/lightbox/js/tip_balloon/lt.gif diff --git a/modules/lightbox/js/tip_balloon/r.gif b/modules/lightbox/js/tip_balloon/r.gif Binary files differnew file mode 100644 index 0000000000..be041ff92b --- /dev/null +++ b/modules/lightbox/js/tip_balloon/r.gif diff --git a/modules/lightbox/js/tip_balloon/rb.gif b/modules/lightbox/js/tip_balloon/rb.gif Binary files differnew file mode 100644 index 0000000000..70b6834efc --- /dev/null +++ b/modules/lightbox/js/tip_balloon/rb.gif diff --git a/modules/lightbox/js/tip_balloon/rt.gif b/modules/lightbox/js/tip_balloon/rt.gif Binary files differnew file mode 100644 index 0000000000..2752a0ccb5 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/rt.gif diff --git a/modules/lightbox/js/tip_balloon/stemb.gif b/modules/lightbox/js/tip_balloon/stemb.gif Binary files differnew file mode 100644 index 0000000000..92f2ad5153 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/stemb.gif diff --git a/modules/lightbox/js/tip_balloon/stemt.gif b/modules/lightbox/js/tip_balloon/stemt.gif Binary files differnew file mode 100644 index 0000000000..d259a4aec5 --- /dev/null +++ b/modules/lightbox/js/tip_balloon/stemt.gif diff --git a/modules/lightbox/js/tip_balloon/t.gif b/modules/lightbox/js/tip_balloon/t.gif Binary files differnew file mode 100644 index 0000000000..6fec86f81a --- /dev/null +++ b/modules/lightbox/js/tip_balloon/t.gif diff --git a/modules/lightbox/js/tip_balloon_RTL.js b/modules/lightbox/js/tip_balloon_RTL.js new file mode 100644 index 0000000000..b1cd77a0b9 --- /dev/null +++ b/modules/lightbox/js/tip_balloon_RTL.js @@ -0,0 +1,233 @@ +/* +tip_balloon.js v. 1.51 + +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Initial author: Walter Zorn +Last modified: 3.6.2008 + +Extension for the tooltip library wz_tooltip.js. +Implements balloon tooltips. +*/ + +// Make sure that the core file wz_tooltip.js is included first +if(typeof config == "undefined") + alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!"); + +// Here we define new global configuration variable(s) (as members of the +// predefined "config." class). +// From each of these config variables, wz_tooltip.js will automatically derive +// a command which can be passed to Tip() or TagToTip() in order to customize +// tooltips individually. These command names are just the config variable +// name(s) translated to uppercase, +// e.g. from config. Balloon a command BALLOON will automatically be +// created. + +//=================== GLOBAL TOOPTIP CONFIGURATION =========================// + +config. Balloon = false // true or false - set to true if you want this to be the default behaviour +config. BalloonImgPath = "modules/lightbox/js/tip_balloon/" // Path to images (border, corners, stem), in quotes. Path must be relative to your HTML file. + +// Sizes of balloon images +config. BalloonEdgeSize = 6 // Integer - sidelength of quadratic corner images +config. BalloonStemWidth = 15 // Integer +config. BalloonStemHeight = 19 // Integer +config. BalloonStemOffset = -7 // Integer - horizontal offset of left stem edge from mouse (recommended: -stemwidth/2 to center the stem above the mouse) + +//======= END OF TOOLTIP CONFIG, DO NOT CHANGE ANYTHING BELOW ==============// + + + + + +// Create a new tt_Extension object (make sure that the name of that object, +// here balloon, is unique amongst the extensions available for wz_tooltips.js): +var balloon = new tt_Extension(); + +// Implement extension eventhandlers on which our extension should react + +balloon.OnLoadConfig = function() +{ + if(tt_aV[BALLOON]) + { + // Turn off native style properties which are not appropriate + balloon.padding = Math.max(tt_aV[PADDING] - tt_aV[BALLOONEDGESIZE], 0); + balloon.width = tt_aV[WIDTH]; + //if(tt_bBoxOld) + // balloon.width += (balloon.padding << 1); + tt_aV[BORDERWIDTH] = 0; + tt_aV[WIDTH] = 0; + tt_aV[PADDING] = 0; + tt_aV[BGCOLOR] = ""; + tt_aV[BGIMG] = ""; + tt_aV[SHADOW] = false; + // Append slash to img path if missing + if(tt_aV[BALLOONIMGPATH].charAt(tt_aV[BALLOONIMGPATH].length - 1) != '/') + tt_aV[BALLOONIMGPATH] += "/"; + return true; + } + return false; +}; + +balloon.OnCreateContentString = function() +{ + if(!tt_aV[BALLOON]) + return false; + + var aImg, sImgZ, sCssCrn, sVaT, sVaB, sCssImg; + + // Cache balloon images in advance: + // Either use the pre-cached default images... + if(tt_aV[BALLOONIMGPATH] == config.BalloonImgPath) + aImg = balloon.aDefImg; + // ...or load images from different directory + else + aImg = Balloon_CacheImgs(tt_aV[BALLOONIMGPATH]); + sCssCrn = ' style="position:relative;width:' + tt_aV[BALLOONEDGESIZE] + 'px;padding:0px;margin:0px;overflow:hidden;line-height:0px;'; + sVaT = 'vertical-align:top;" valign="top"'; + sVaB = 'vertical-align:bottom;" valign="bottom"'; + sCssImg = 'padding:0px;margin:0px;border:0px;'; + sImgZ = '" style="' + sCssImg + '" />'; + + tt_sContent = '<table border="0" cellpadding="0" cellspacing="0" style="width:auto;padding:0px;margin:0px;left:0px;top:0px;"><tr>' + // Left-top corner + + '<td' + sCssCrn + sVaB + '>' + + '<img src="' + aImg[3].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + // Top border + + '<td valign="bottom" style="position:relative;padding:0px;margin:0px;overflow:hidden;">' + + '<img id="bALlOOnT" style="position:relative;top:1px;z-index:1;display:none;' + sCssImg + '" src="' + aImg[9].src + '" width="' + tt_aV[BALLOONSTEMWIDTH] + '" height="' + tt_aV[BALLOONSTEMHEIGHT] + '" />' + + '<div style="position:relative;z-index:0;padding:0px;margin:0px;overflow:hidden;width:auto;height:' + tt_aV[BALLOONEDGESIZE] + 'px;background-image:url(' + aImg[2].src + ');">' + + '</div>' + + '</td>' + // Right-top corner + + '<td' + sCssCrn + sVaB + '>' + + '<img src="' + aImg[1].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + + '</tr><tr>' + // Left border + + '<td style="position:relative;padding:0px;margin:0px;width:' + tt_aV[BALLOONEDGESIZE] + 'px;overflow:hidden;background-image:url(' + aImg[4].src + ');">' + // Redundant image for bugous old Geckos that won't auto-expand TD height to 100% + + '<img width="' + tt_aV[BALLOONEDGESIZE] + '" height="100%" src="' + aImg[4].src + sImgZ + + '</td>' + // Content + + '<td id="bALlO0nBdY" style="position:relative;line-height:normal;' + + ';background-image:url(' + aImg[0].src + ')' + + ';color:' + tt_aV[FONTCOLOR] + + ';font-family:' + tt_aV[FONTFACE] + + ';font-size:' + tt_aV[FONTSIZE] + + ';font-weight:' + tt_aV[FONTWEIGHT] + + ';text-align:' + tt_aV[TEXTALIGN] + + ';padding:' + balloon.padding + 'px' + + ';width:' + ((balloon.width > 0) ? (balloon.width + 'px') : 'auto') + + ';">' + tt_sContent + '</td>' + // Right border + + '<td style="position:relative;padding:0px;margin:0px;width:' + tt_aV[BALLOONEDGESIZE] + 'px;overflow:hidden;background-image:url(' + aImg[8].src + ');">' + // Image redundancy for bugous old Geckos that won't auto-expand TD height to 100% + + '<img width="' + tt_aV[BALLOONEDGESIZE] + '" height="100%" src="' + aImg[8].src + sImgZ + + '</td>' + + '</tr><tr>' + // Left-bottom corner + + '<td' + sCssCrn + sVaT + '>' + + '<img src="' + aImg[5].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + // Bottom border + + '<td valign="top" style="position:relative;padding:0px;margin:0px;overflow:hidden;">' + + '<div style="position:relative;left:0px;top:0px;padding:0px;margin:0px;overflow:hidden;width:auto;height:' + tt_aV[BALLOONEDGESIZE] + 'px;background-image:url(' + aImg[6].src + ');"></div>' + + '<img id="bALlOOnB" style="position:relative;top:-1px;left:2px;z-index:1;display:none;' + sCssImg + '" src="' + aImg[10].src + '" width="' + tt_aV[BALLOONSTEMWIDTH] + '" height="' + tt_aV[BALLOONSTEMHEIGHT] + '" />' + + '</td>' + // Right-bottom corner + + '<td' + sCssCrn + sVaT + '>' + + '<img src="' + aImg[7].src + '" width="' + tt_aV[BALLOONEDGESIZE] + '" height="' + tt_aV[BALLOONEDGESIZE] + sImgZ + + '</td>' + + '</tr></table>'; + return true; +}; + +balloon.OnSubDivsCreated = function() +{ + if(tt_aV[BALLOON]) + { + balloon.iStem = tt_aV[ABOVE] * 1; + balloon.aStem = [tt_GetElt("bALlOOnT"), tt_GetElt("bALlOOnB")]; + balloon.aStem[balloon.iStem].style.display = "inline"; + if (balloon.width < -1) + Balloon_MaxW(); + return true; + } + return false; +}; + +// Display the stem appropriately +balloon.OnMoveAfter = function() +{ + if(tt_aV[BALLOON]) + { + var iStem = (tt_aV[ABOVE] != tt_bJmpVert) * 1; + + // Tooltip position vertically flipped? + if(iStem != balloon.iStem) + { + // Display opposite stem + balloon.aStem[balloon.iStem].style.display = "none"; + balloon.aStem[iStem].style.display = "inline"; + balloon.iStem = iStem; + } + + balloon.aStem[iStem].style.left = Balloon_CalcStemX() + "px"; + return true; + } + return false; +}; + +function Balloon_CalcStemX() +{ + // var x = tt_musX - tt_x + tt_aV[BALLOONSTEMOFFSET] - tt_aV[BALLOONEDGESIZE]; + // return Math.max(Math.min(x, tt_w - tt_aV[BALLOONSTEMWIDTH] - (tt_aV[BALLOONEDGESIZE] << 1) - 2), 2); + var x = -tt_musX - tt_x + tt_aV[BALLOONSTEMOFFSET] - tt_aV[BALLOONEDGESIZE]; + return Math.max(Math.min(x, tt_w - tt_aV[BALLOONSTEMWIDTH] - (tt_aV[BALLOONEDGESIZE] << 1) - 2), -2); +} + +function Balloon_CacheImgs(sPath) +{ + var asImg = ["background", "lt", "t", "rt", "r", "rb", "b", "lb", "l", "stemt", "stemb"], + n = asImg.length, + aImg = new Array(n), + img; + + while(n) + {--n; + img = aImg[n] = new Image(); + img.src = sPath + asImg[n] + ".gif"; // Change to ".png" if you want to use PNG images + } + return aImg; +} + +function Balloon_MaxW() +{ + var bdy = tt_GetElt("bALlO0nBdY"); + + if (bdy) + { + var iAdd = tt_bBoxOld ? (balloon.padding << 1) : 0, w = tt_GetDivW(bdy); + if (w > -balloon.width + iAdd) + bdy.style.width = (-balloon.width + iAdd) + "px"; + } +} + +// This mechanism pre-caches the default images specified by +// congif.BalloonImgPath, so, whenever a balloon tip using these default images +// is created, no further server connection is necessary. +function Balloon_PreCacheDefImgs() +{ + // Append slash to img path if missing + if(config.BalloonImgPath.charAt(config.BalloonImgPath.length - 1) != '/') + config.BalloonImgPath += "/"; + // Preload default images into array + balloon.aDefImg = Balloon_CacheImgs(config.BalloonImgPath); +} + +Balloon_PreCacheDefImgs(); diff --git a/modules/lightbox/js/tip_centerwindow.js b/modules/lightbox/js/tip_centerwindow.js new file mode 100644 index 0000000000..d2b1d0d92d --- /dev/null +++ b/modules/lightbox/js/tip_centerwindow.js @@ -0,0 +1,104 @@ +/* +tip_centerwindow.js v. 1.21 + +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Initial author: Walter Zorn +Last modified: 3.6.2008 + +Extension for the tooltip library wz_tooltip.js. +Centers a sticky tooltip in the window's visible clientarea, +optionally even if the window is being scrolled or resized. +*/ + +// Make sure that the core file wz_tooltip.js is included first +if(typeof config == "undefined") + alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!"); + +// Here we define new global configuration variable(s) (as members of the +// predefined "config." class). +// From each of these config variables, wz_tooltip.js will automatically derive +// a command which can be passed to Tip() or TagToTip() in order to customize +// tooltips individually. These command names are just the config variable +// name(s) translated to uppercase, +// e.g. from config. CenterWindow a command CENTERWINDOW will automatically be +// created. + +//=================== GLOBAL TOOPTIP CONFIGURATION =========================// +config. CenterWindow = false // true or false - set to true if you want this to be the default behaviour +config. CenterAlways = false // true or false - recenter if window is resized or scrolled +//======= END OF TOOLTIP CONFIG, DO NOT CHANGE ANYTHING BELOW ==============// + + +// Create a new tt_Extension object (make sure that the name of that object, +// here ctrwnd, is unique amongst the extensions available for +// wz_tooltips.js): +var ctrwnd = new tt_Extension(); + +// Implement extension eventhandlers on which our extension should react +ctrwnd.OnLoadConfig = function() +{ + if(tt_aV[CENTERWINDOW]) + { + // Permit CENTERWINDOW only if the tooltip is sticky + if(tt_aV[STICKY]) + { + if(tt_aV[CENTERALWAYS]) + { + // IE doesn't support style.position "fixed" + if(tt_ie) + tt_AddEvtFnc(window, "scroll", Ctrwnd_DoCenter); + else + tt_aElt[0].style.position = "fixed"; + tt_AddEvtFnc(window, "resize", Ctrwnd_DoCenter); + } + return true; + } + tt_aV[CENTERWINDOW] = false; + } + return false; +}; +// We react on the first OnMouseMove event to center the tip on that occasion +ctrwnd.OnMoveBefore = Ctrwnd_DoCenter; +ctrwnd.OnKill = function() +{ + if(tt_aV[CENTERWINDOW] && tt_aV[CENTERALWAYS]) + { + tt_RemEvtFnc(window, "resize", Ctrwnd_DoCenter); + if(tt_ie) + tt_RemEvtFnc(window, "scroll", Ctrwnd_DoCenter); + else + tt_aElt[0].style.position = "absolute"; + } + return false; +}; +// Helper function +function Ctrwnd_DoCenter() +{ + if(tt_aV[CENTERWINDOW]) + { + var x, y, dx, dy; + + // Here we use some functions and variables (tt_w, tt_h) which the + // extension API of wz_tooltip.js provides for us + if(tt_ie || !tt_aV[CENTERALWAYS]) + { + dx = tt_GetScrollX(); + dy = tt_GetScrollY(); + } + else + { + dx = 0; + dy = 0; + } + // Position the tip, offset from the center by OFFSETX and OFFSETY + x = (tt_GetClientW() - tt_w) / 2 + dx + tt_aV[OFFSETX]; + y = (tt_GetClientH() - tt_h) / 2 + dy + tt_aV[OFFSETY]; + tt_SetTipPos(x, y); + return true; + } + return false; +} diff --git a/modules/lightbox/js/wz_tooltip.js b/modules/lightbox/js/wz_tooltip.js new file mode 100644 index 0000000000..b301545afd --- /dev/null +++ b/modules/lightbox/js/wz_tooltip.js @@ -0,0 +1,1259 @@ +/* This notice must be untouched at all times. +Copyright (c) 2002-2008 Walter Zorn. All rights reserved. + +wz_tooltip.js v. 5.11 + +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Created 1.12.2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 22.5.2008 + +Easy-to-use cross-browser tooltips. +Just include the script at the beginning of the <body> section, and invoke +Tip('Tooltip text') from the desired HTML onmouseover eventhandlers, +and UnTip(), usually from the onmouseout eventhandlers, to hide the tip. +No container DIV required. +By default, width and height of tooltips are automatically adapted to content. +Is even capable of dynamically converting arbitrary HTML elements to tooltips +by calling TagToTip('ID_of_HTML_element_to_be_converted') instead of Tip(), +which means you can put important, search-engine-relevant stuff into tooltips. +Appearance & behaviour of tooltips can be individually configured +via commands passed to Tip() or TagToTip(). + +Tab Width: 4 +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details on the GNU Lesser General Public License, +see http://www.gnu.org/copyleft/lesser.html +*/ + +var config = new Object(); + + +//=================== GLOBAL TOOPTIP CONFIGURATION =========================// +var tt_Debug = true // false or true - recommended: false once you release your page to the public +var tt_Enabled = true // Allows to (temporarily) suppress tooltips, e.g. by providing the user with a button that sets this global variable to false +var TagsToTip = true // false or true - if true, HTML elements to be converted to tooltips via TagToTip() are automatically hidden; + // if false, you should hide those HTML elements yourself + +// For each of the following config variables there exists a command, which is +// just the variablename in uppercase, to be passed to Tip() or TagToTip() to +// configure tooltips individually. Individual commands override global +// configuration. Order of commands is arbitrary. +// Example: onmouseover="Tip('Tooltip text', LEFT, true, BGCOLOR, '#FF9900', FADEIN, 400)" + +config. Above = false // false or true - tooltip above mousepointer +config. BgColor = '#E2E7FF' // Background colour (HTML colour value, in quotes) +config. BgImg = '' // Path to background image, none if empty string '' +config. BorderColor = '#003099' +config. BorderStyle = 'solid' // Any permitted CSS value, but I recommend 'solid', 'dotted' or 'dashed' +config. BorderWidth = 1 +config. CenterMouse = false // false or true - center the tip horizontally below (or above) the mousepointer +config. ClickClose = false // false or true - close tooltip if the user clicks somewhere +config. ClickSticky = false // false or true - make tooltip sticky if user left-clicks on the hovered element while the tooltip is active +config. CloseBtn = false // false or true - closebutton in titlebar +config. CloseBtnColors = ['#990000', '#FFFFFF', '#DD3333', '#FFFFFF'] // [Background, text, hovered background, hovered text] - use empty strings '' to inherit title colours +config. CloseBtnText = ' X ' // Close button text (may also be an image tag) +config. CopyContent = true // When converting a HTML element to a tooltip, copy only the element's content, rather than converting the element by its own +config. Delay = 400 // Time span in ms until tooltip shows up +config. Duration = 0 // Time span in ms after which the tooltip disappears; 0 for infinite duration, < 0 for delay in ms _after_ the onmouseout until the tooltip disappears +config. FadeIn = 0 // Fade-in duration in ms, e.g. 400; 0 for no animation +config. FadeOut = 0 +config. FadeInterval = 30 // Duration of each fade step in ms (recommended: 30) - shorter is smoother but causes more CPU-load +config. Fix = null // Fixated position - x- an y-oordinates in brackets, e.g. [210, 480], or null for no fixation +config. FollowMouse = true // false or true - tooltip follows the mouse +config. FontColor = '#000044' +config. FontFace = 'Verdana,Geneva,sans-serif' +config. FontSize = '8pt' // E.g. '9pt' or '12px' - unit is mandatory +config. FontWeight = 'normal' // 'normal' or 'bold'; +config. Height = 0 // Tooltip height; 0 for automatic adaption to tooltip content, < 0 (e.g. -100) for a maximum for automatic adaption +config. JumpHorz = false // false or true - jump horizontally to other side of mouse if tooltip would extend past clientarea boundary +config. JumpVert = true // false or true - jump vertically " +config. Left = false // false or true - tooltip on the left of the mouse +config. OffsetX = 14 // Horizontal offset of left-top corner from mousepointer +config. OffsetY = 8 // Vertical offset +config. Opacity = 100 // Integer between 0 and 100 - opacity of tooltip in percent +config. Padding = 3 // Spacing between border and content +config. Shadow = false // false or true +config. ShadowColor = '#C0C0C0' +config. ShadowWidth = 5 +config. Sticky = false // false or true - fixate tip, ie. don't follow the mouse and don't hide on mouseout +config. TextAlign = 'left' // 'left', 'right' or 'justify' +config. Title = '' // Default title text applied to all tips (no default title: empty string '') +config. TitleAlign = 'left' // 'left' or 'right' - text alignment inside the title bar +config. TitleBgColor = '' // If empty string '', BorderColor will be used +config. TitleFontColor = '#FFFFFF' // Color of title text - if '', BgColor (of tooltip body) will be used +config. TitleFontFace = '' // If '' use FontFace (boldified) +config. TitleFontSize = '' // If '' use FontSize +config. TitlePadding = 2 +config. Width = 0 // Tooltip width; 0 for automatic adaption to tooltip content; < -1 (e.g. -240) for a maximum width for that automatic adaption; + // -1: tooltip width confined to the width required for the titlebar +//======= END OF TOOLTIP CONFIG, DO NOT CHANGE ANYTHING BELOW ==============// + + + + +//===================== PUBLIC =============================================// +var CB_tt=""; +function TipTog() +{ + if (CB_tt!="open") { + tt_Tip(arguments, null); + CB_tt="open"; + }else{ + tt_HideInit(); + CB_tt="closed"; + } +} + + +function Tip() +{ + tt_Tip(arguments, null); +} +function TagToTip() +{ + var t2t = tt_GetElt(arguments[0]); + if(t2t) + tt_Tip(arguments, t2t); +} +function UnTip() +{ + tt_OpReHref(); + if(tt_aV[DURATION] < 0 && (tt_iState & 0x2)) + tt_tDurt.Timer("tt_HideInit()", -tt_aV[DURATION], true); + else if(!(tt_aV[STICKY] && (tt_iState & 0x2))) + tt_HideInit(); +} + +//================== PUBLIC PLUGIN API =====================================// +// Extension eventhandlers currently supported: +// OnLoadConfig, OnCreateContentString, OnSubDivsCreated, OnShow, OnMoveBefore, +// OnMoveAfter, OnHideInit, OnHide, OnKill + +var tt_aElt = new Array(10), // Container DIV, outer title & body DIVs, inner title & body TDs, closebutton SPAN, shadow DIVs, and IFRAME to cover windowed elements in IE +tt_aV = new Array(), // Caches and enumerates config data for currently active tooltip +tt_sContent, // Inner tooltip text or HTML +tt_scrlX = 0, tt_scrlY = 0, +tt_musX, tt_musY, +tt_over, +tt_x, tt_y, tt_w, tt_h; // Position, width and height of currently displayed tooltip + +function tt_Extension() +{ + tt_ExtCmdEnum(); + tt_aExt[tt_aExt.length] = this; + return this; +} +function tt_SetTipPos(x, y) +{ + var css = tt_aElt[0].style; + + tt_x = x; + tt_y = y; + css.left = x + "px"; + css.top = y + "px"; + if(tt_ie56) + { + var ifrm = tt_aElt[tt_aElt.length - 1]; + if(ifrm) + { + ifrm.style.left = css.left; + ifrm.style.top = css.top; + } + } +} +function tt_HideInit() +{ + if(tt_iState) + { + tt_ExtCallFncs(0, "HideInit"); + tt_iState &= ~0x4; + if(tt_flagOpa && tt_aV[FADEOUT]) + { + tt_tFade.EndTimer(); + if(tt_opa) + { + var n = Math.round(tt_aV[FADEOUT] / (tt_aV[FADEINTERVAL] * (tt_aV[OPACITY] / tt_opa))); + tt_Fade(tt_opa, tt_opa, 0, n); + return; + } + } + tt_tHide.Timer("tt_Hide();", 1, false); + } +} +function tt_Hide() +{ + if(tt_db && tt_iState) + { + tt_OpReHref(); + if(tt_iState & 0x2) + { + tt_aElt[0].style.visibility = "hidden"; + tt_ExtCallFncs(0, "Hide"); + } + tt_tShow.EndTimer(); + tt_tHide.EndTimer(); + tt_tDurt.EndTimer(); + tt_tFade.EndTimer(); + CB_tt="closed"; + if(!tt_op && !tt_ie) + { + tt_tWaitMov.EndTimer(); + tt_bWait = false; + } + if(tt_aV[CLICKCLOSE] || tt_aV[CLICKSTICKY]) + tt_RemEvtFnc(document, "mouseup", tt_OnLClick); + tt_ExtCallFncs(0, "Kill"); + // In case of a TagToTip tooltip, hide converted DOM node and + // re-insert it into document + if(tt_t2t && !tt_aV[COPYCONTENT]) + { + tt_t2t.style.display = "none"; + tt_MovDomNode(tt_t2t, tt_aElt[6], tt_t2tDad); + } + tt_iState = 0; + tt_over = null; + tt_ResetMainDiv(); + if(tt_aElt[tt_aElt.length - 1]) + tt_aElt[tt_aElt.length - 1].style.display = "none"; + } +} +function tt_GetElt(id) +{ + return(document.getElementById ? document.getElementById(id) + : document.all ? document.all[id] + : null); +} +function tt_GetDivW(el) +{ + return(el ? (el.offsetWidth || el.style.pixelWidth || 0) : 0); +} +function tt_GetDivH(el) +{ + return(el ? (el.offsetHeight || el.style.pixelHeight || 0) : 0); +} +function tt_GetScrollX() +{ + return(window.pageXOffset || (tt_db ? (tt_db.scrollLeft || 0) : 0)); +} +function tt_GetScrollY() +{ + return(window.pageYOffset || (tt_db ? (tt_db.scrollTop || 0) : 0)); +} +function tt_GetClientW() +{ + return(document.body && (typeof(document.body.clientWidth) != tt_u) ? document.body.clientWidth + : (typeof(window.innerWidth) != tt_u) ? window.innerWidth + : tt_db ? (tt_db.clientWidth || 0) + : 0); +} +function tt_GetClientH() +{ + // Exactly this order seems to yield correct values in all major browsers + return(document.body && (typeof(document.body.clientHeight) != tt_u) ? document.body.clientHeight + : (typeof(window.innerHeight) != tt_u) ? window.innerHeight + : tt_db ? (tt_db.clientHeight || 0) + : 0); +} +function tt_GetEvtX(e) +{ + return (e ? ((typeof(e.pageX) != tt_u) ? e.pageX : (e.clientX + tt_scrlX)) : 0); +} +function tt_GetEvtY(e) +{ + return (e ? ((typeof(e.pageY) != tt_u) ? e.pageY : (e.clientY + tt_scrlY)) : 0); +} +function tt_AddEvtFnc(el, sEvt, PFnc) +{ + if(el) + { + if(el.addEventListener) + el.addEventListener(sEvt, PFnc, false); + else + el.attachEvent("on" + sEvt, PFnc); + } +} +function tt_RemEvtFnc(el, sEvt, PFnc) +{ + if(el) + { + if(el.removeEventListener) + el.removeEventListener(sEvt, PFnc, false); + else + el.detachEvent("on" + sEvt, PFnc); + } +} + +//====================== PRIVATE ===========================================// +var tt_aExt = new Array(), // Array of extension objects + +tt_db, tt_op, tt_ie, tt_ie56, tt_bBoxOld, // Browser flags +tt_body, +tt_ovr_, // HTML element the mouse is currently over +tt_flagOpa, // Opacity support: 1=IE, 2=Khtml, 3=KHTML, 4=Moz, 5=W3C +tt_maxPosX, tt_maxPosY, +tt_iState = 0, // Tooltip active |= 1, shown |= 2, move with mouse |= 4 +tt_opa, // Currently applied opacity +tt_bJmpVert, tt_bJmpHorz,// Tip temporarily on other side of mouse +tt_t2t, tt_t2tDad, // Tag converted to tip, and its parent element in the document +tt_elDeHref, // The tag from which we've removed the href attribute +// Timer +tt_tShow = new Number(0), tt_tHide = new Number(0), tt_tDurt = new Number(0), +tt_tFade = new Number(0), tt_tWaitMov = new Number(0), +tt_bWait = false, +tt_u = "undefined"; + + +function tt_Init() +{ + tt_MkCmdEnum(); + // Send old browsers instantly to hell + if(!tt_Browser() || !tt_MkMainDiv()) + return; + tt_IsW3cBox(); + tt_OpaSupport(); + tt_AddEvtFnc(window, "scroll", tt_OnScrl); + // IE doesn't fire onscroll event when switching to fullscreen; + // fix suggested by Yoav Karpeles 14.2.2008 + tt_AddEvtFnc(window, "resize", tt_OnScrl); + tt_AddEvtFnc(document, "mousemove", tt_Move); + // In Debug mode we search for TagToTip() calls in order to notify + // the user if they've forgotten to set the TagsToTip config flag + if(TagsToTip || tt_Debug) + tt_SetOnloadFnc(); + // Ensure the tip be hidden when the page unloads + tt_AddEvtFnc(window, "unload", tt_Hide); +} +// Creates command names by translating config variable names to upper case +function tt_MkCmdEnum() +{ + var n = 0; + for(var i in config) + eval("window." + i.toString().toUpperCase() + " = " + n++); + tt_aV.length = n; +} +function tt_Browser() +{ + var n, nv, n6, w3c; + + n = navigator.userAgent.toLowerCase(), + nv = navigator.appVersion; + tt_op = (document.defaultView && typeof(eval("w" + "indow" + "." + "o" + "p" + "er" + "a")) != tt_u); + tt_ie = n.indexOf("msie") != -1 && document.all && !tt_op; + if(tt_ie) + { + var ieOld = (!document.compatMode || document.compatMode == "BackCompat"); + tt_db = !ieOld ? document.documentElement : (document.body || null); + if(tt_db) + tt_ie56 = parseFloat(nv.substring(nv.indexOf("MSIE") + 5)) >= 5.5 + && typeof document.body.style.maxHeight == tt_u; + } + else + { + tt_db = document.documentElement || document.body || + (document.getElementsByTagName ? document.getElementsByTagName("body")[0] + : null); + if(!tt_op) + { + n6 = document.defaultView && typeof document.defaultView.getComputedStyle != tt_u; + w3c = !n6 && document.getElementById; + } + } + tt_body = (document.getElementsByTagName ? document.getElementsByTagName("body")[0] + : (document.body || null)); + if(tt_ie || n6 || tt_op || w3c) + { + if(tt_body && tt_db) + { + if(document.attachEvent || document.addEventListener) + return true; + } + else + tt_Err("wz_tooltip.js must be included INSIDE the body section," + + " immediately after the opening <body> tag.", false); + } + tt_db = null; + return false; +} +function tt_MkMainDiv() +{ + // Create the tooltip DIV + if(tt_body.insertAdjacentHTML) + tt_body.insertAdjacentHTML("afterBegin", tt_MkMainDivHtm()); + else if(typeof tt_body.innerHTML != tt_u && document.createElement && tt_body.appendChild) + tt_body.appendChild(tt_MkMainDivDom()); + if(window.tt_GetMainDivRefs /* FireFox Alzheimer */ && tt_GetMainDivRefs()) + return true; + tt_db = null; + return false; +} +function tt_MkMainDivHtm() +{ + return('<div id="WzTtDiV"></div>' + + (tt_ie56 ? ('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>') + : '')); +} +function tt_MkMainDivDom() +{ + var el = document.createElement("div"); + if(el) + el.id = "WzTtDiV"; + return el; +} +function tt_GetMainDivRefs() +{ + tt_aElt[0] = tt_GetElt("WzTtDiV"); + if(tt_ie56 && tt_aElt[0]) + { + tt_aElt[tt_aElt.length - 1] = tt_GetElt("WzTtIfRm"); + if(!tt_aElt[tt_aElt.length - 1]) + tt_aElt[0] = null; + } + if(tt_aElt[0]) + { + var css = tt_aElt[0].style; + + css.visibility = "hidden"; + css.position = "absolute"; + css.overflow = "hidden"; + return true; + } + return false; +} +function tt_ResetMainDiv() +{ + var w = (window.screen && screen.width) ? screen.width : 10000; + + tt_SetTipPos(-w, 0); + tt_aElt[0].innerHTML = ""; + tt_aElt[0].style.width = (w - 1) + "px"; + tt_h = 0; +} +function tt_IsW3cBox() +{ + var css = tt_aElt[0].style; + + css.padding = "10px"; + css.width = "40px"; + tt_bBoxOld = (tt_GetDivW(tt_aElt[0]) == 40); + css.padding = "0px"; + tt_ResetMainDiv(); +} +function tt_OpaSupport() +{ + var css = tt_body.style; + + tt_flagOpa = (typeof(css.filter) != tt_u) ? 1 + : (typeof(css.KhtmlOpacity) != tt_u) ? 2 + : (typeof(css.KHTMLOpacity) != tt_u) ? 3 + : (typeof(css.MozOpacity) != tt_u) ? 4 + : (typeof(css.opacity) != tt_u) ? 5 + : 0; +} +// Ported from http://dean.edwards.name/weblog/2006/06/again/ +// (Dean Edwards et al.) +function tt_SetOnloadFnc() +{ + tt_AddEvtFnc(document, "DOMContentLoaded", tt_HideSrcTags); + tt_AddEvtFnc(window, "load", tt_HideSrcTags); + if(tt_body.attachEvent) + tt_body.attachEvent("onreadystatechange", + function() { + if(tt_body.readyState == "complete") + tt_HideSrcTags(); + } ); + if(/WebKit|KHTML/i.test(navigator.userAgent)) + { + var t = setInterval(function() { + if(/loaded|complete/.test(document.readyState)) + { + clearInterval(t); + tt_HideSrcTags(); + } + }, 10); + } +} +function tt_HideSrcTags() +{ + if(!window.tt_HideSrcTags || window.tt_HideSrcTags.done) + return; + window.tt_HideSrcTags.done = true; + if(!tt_HideSrcTagsRecurs(tt_body)) + tt_Err("There are HTML elements to be converted to tooltips.\nIf you" + + " want these HTML elements to be automatically hidden, you" + + " must edit wz_tooltip.js, and set TagsToTip in the global" + + " tooltip configuration to true.", true); +} +function tt_HideSrcTagsRecurs(dad) +{ + var ovr, asT2t; + // Walk the DOM tree for tags that have an onmouseover or onclick attribute + // containing a TagToTip('...') call. + // (.childNodes first since .children is bugous in Safari) + var a = dad.childNodes || dad.children || null; + + for(var i = a ? a.length : 0; i;) + {--i; + if(!tt_HideSrcTagsRecurs(a[i])) + return false; + ovr = a[i].getAttribute ? (a[i].getAttribute("onmouseover") || a[i].getAttribute("onclick")) + : (typeof a[i].onmouseover == "function") ? (a[i].onmouseover || a[i].onclick) + : null; + if(ovr) + { + asT2t = ovr.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/); + if(asT2t && asT2t.length) + { + if(!tt_HideSrcTag(asT2t[0])) + return false; + } + } + } + return true; +} +function tt_HideSrcTag(sT2t) +{ + var id, el; + + // The ID passed to the found TagToTip() call identifies an HTML element + // to be converted to a tooltip, so hide that element + id = sT2t.replace(/.+'([^'.]+)'.+/, "$1"); + el = tt_GetElt(id); + if(el) + { + if(tt_Debug && !TagsToTip) + return false; + else + el.style.display = "none"; + } + else + tt_Err("Invalid ID\n'" + id + "'\npassed to TagToTip()." + + " There exists no HTML element with that ID.", true); + return true; +} +function tt_Tip(arg, t2t) +{ + if(!tt_db) + return; + if(tt_iState) + tt_Hide(); + if(!tt_Enabled) + return; + tt_t2t = t2t; + if(!tt_ReadCmds(arg)) + return; + tt_iState = 0x1 | 0x4; + tt_AdaptConfig1(); + tt_MkTipContent(arg); + tt_MkTipSubDivs(); + tt_FormatTip(); + tt_bJmpVert = false; + tt_bJmpHorz = false; + tt_maxPosX = tt_GetClientW() + tt_scrlX - tt_w - 1; + tt_maxPosY = tt_GetClientH() + tt_scrlY - tt_h - 1; + tt_AdaptConfig2(); + // Ensure the tip be shown and positioned before the first onmousemove + tt_OverInit(); + tt_ShowInit(); + tt_Move(); +} +function tt_ReadCmds(a) +{ + var i; + + // First load the global config values, to initialize also values + // for which no command is passed + i = 0; + for(var j in config) + tt_aV[i++] = config[j]; + // Then replace each cached config value for which a command is + // passed (ensure the # of command args plus value args be even) + if(a.length & 1) + { + for(i = a.length - 1; i > 0; i -= 2) + tt_aV[a[i - 1]] = a[i]; + return true; + } + tt_Err("Incorrect call of Tip() or TagToTip().\n" + + "Each command must be followed by a value.", true); + return false; +} +function tt_AdaptConfig1() +{ + tt_ExtCallFncs(0, "LoadConfig"); + // Inherit unspecified title formattings from body + if(!tt_aV[TITLEBGCOLOR].length) + tt_aV[TITLEBGCOLOR] = tt_aV[BORDERCOLOR]; + if(!tt_aV[TITLEFONTCOLOR].length) + tt_aV[TITLEFONTCOLOR] = tt_aV[BGCOLOR]; + if(!tt_aV[TITLEFONTFACE].length) + tt_aV[TITLEFONTFACE] = tt_aV[FONTFACE]; + if(!tt_aV[TITLEFONTSIZE].length) + tt_aV[TITLEFONTSIZE] = tt_aV[FONTSIZE]; + if(tt_aV[CLOSEBTN]) + { + // Use title colours for non-specified closebutton colours + if(!tt_aV[CLOSEBTNCOLORS]) + tt_aV[CLOSEBTNCOLORS] = new Array("", "", "", ""); + for(var i = 4; i;) + {--i; + if(!tt_aV[CLOSEBTNCOLORS][i].length) + tt_aV[CLOSEBTNCOLORS][i] = (i & 1) ? tt_aV[TITLEFONTCOLOR] : tt_aV[TITLEBGCOLOR]; + } + // Enforce titlebar be shown + if(!tt_aV[TITLE].length) + tt_aV[TITLE] = " "; + } + // Circumvents broken display of images and fade-in flicker in Geckos < 1.8 + if(tt_aV[OPACITY] == 100 && typeof tt_aElt[0].style.MozOpacity != tt_u && !Array.every) + tt_aV[OPACITY] = 99; + // Smartly shorten the delay for fade-in tooltips + if(tt_aV[FADEIN] && tt_flagOpa && tt_aV[DELAY] > 100) + tt_aV[DELAY] = Math.max(tt_aV[DELAY] - tt_aV[FADEIN], 100); +} +function tt_AdaptConfig2() +{ + if(tt_aV[CENTERMOUSE]) + { + tt_aV[OFFSETX] -= ((tt_w - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0)) >> 1); + tt_aV[JUMPHORZ] = false; + } +} +// Expose content globally so extensions can modify it +function tt_MkTipContent(a) +{ + if(tt_t2t) + { + if(tt_aV[COPYCONTENT]) + tt_sContent = tt_t2t.innerHTML; + else + tt_sContent = ""; + } + else + tt_sContent = a[0]; + tt_ExtCallFncs(0, "CreateContentString"); +} +function tt_MkTipSubDivs() +{ + var sCss = 'position:relative;margin:0px;padding:0px;border-width:0px;left:0px;top:0px;line-height:normal;width:auto;', + sTbTrTd = ' cellspacing="0" cellpadding="0" border="0" style="' + sCss + '"><tbody style="' + sCss + '"><tr><td '; + + tt_aElt[0].innerHTML = + ('' + + (tt_aV[TITLE].length ? + // BH change for line below enables close to be within a bubble area--------------------------------------- + // ('<div id="WzTiTl" style="position:relative;z-index:1;">' + // ------------------------------------------------------------------------------------------------------------------------ + ('<div id="WzTiTl" style="position:relative;left:-3px;top:20px;z-index:1;">' + + '<table id="WzTiTlTb"' + sTbTrTd + 'id="WzTiTlI" style="' + sCss + '">' + + tt_aV[TITLE] + + '</td>' + + (tt_aV[CLOSEBTN] ? + ('<td align="right" style="' + sCss + + 'text-align:right;">' + + '<span id="WzClOsE" style="position:relative;left:2px;padding-left:2px;padding-right:2px;' + + 'cursor:' + (tt_ie ? 'hand' : 'pointer') + + ';" onmouseover="tt_OnCloseBtnOver(1)" onmouseout="tt_OnCloseBtnOver(0)" onclick="tt_HideInit()">' + + tt_aV[CLOSEBTNTEXT] + + '</span></td>') + : '') + + '</tr></tbody></table></div>') + : '') + + '<div id="WzBoDy" style="position:relative;z-index:0;">' + + '<table' + sTbTrTd + 'id="WzBoDyI" style="' + sCss + '">' + + tt_sContent + + '</td></tr></tbody></table></div>' + + (tt_aV[SHADOW] + ? ('<div id="WzTtShDwR" style="position:absolute;overflow:hidden;"></div>' + + '<div id="WzTtShDwB" style="position:relative;overflow:hidden;"></div>') + : '') + ); + tt_GetSubDivRefs(); + // Convert DOM node to tip + if(tt_t2t && !tt_aV[COPYCONTENT]) + { + // Store the tag's parent element so we can restore that DOM branch + // once the tooltip is hidden + tt_t2tDad = tt_t2t.parentNode || tt_t2t.parentElement || tt_t2t.offsetParent || null; + if(tt_t2tDad) + { + tt_MovDomNode(tt_t2t, tt_t2tDad, tt_aElt[6]); + tt_t2t.style.display = "block"; + } + } + tt_ExtCallFncs(0, "SubDivsCreated"); +} +function tt_GetSubDivRefs() +{ + var aId = new Array("WzTiTl", "WzTiTlTb", "WzTiTlI", "WzClOsE", "WzBoDy", "WzBoDyI", "WzTtShDwB", "WzTtShDwR"); + + for(var i = aId.length; i; --i) + tt_aElt[i] = tt_GetElt(aId[i - 1]); +} +function tt_FormatTip() +{ + var css, w, h, pad = tt_aV[PADDING], padT, wBrd = tt_aV[BORDERWIDTH], + iOffY, iOffSh, iAdd = (pad + wBrd) << 1; + + //--------- Title DIV ---------- + if(tt_aV[TITLE].length) + { + padT = tt_aV[TITLEPADDING]; + css = tt_aElt[1].style; + css.background = tt_aV[TITLEBGCOLOR]; + css.paddingTop = css.paddingBottom = padT + "px"; + css.paddingLeft = css.paddingRight = (padT + 2) + "px"; + css = tt_aElt[3].style; + css.color = tt_aV[TITLEFONTCOLOR]; + if(tt_aV[WIDTH] == -1) + css.whiteSpace = "nowrap"; + css.fontFamily = tt_aV[TITLEFONTFACE]; + css.fontSize = tt_aV[TITLEFONTSIZE]; + css.fontWeight = "bold"; + css.textAlign = tt_aV[TITLEALIGN]; + // Close button DIV + if(tt_aElt[4]) + { + css = tt_aElt[4].style; + css.background = tt_aV[CLOSEBTNCOLORS][0]; + css.color = tt_aV[CLOSEBTNCOLORS][1]; + css.fontFamily = tt_aV[TITLEFONTFACE]; + css.fontSize = tt_aV[TITLEFONTSIZE]; + css.fontWeight = "bold"; + } + if(tt_aV[WIDTH] > 0) + tt_w = tt_aV[WIDTH]; + else + { + tt_w = tt_GetDivW(tt_aElt[3]) + tt_GetDivW(tt_aElt[4]); + // Some spacing between title DIV and closebutton + if(tt_aElt[4]) + tt_w += pad; + // Restrict auto width to max width + if(tt_aV[WIDTH] < -1 && tt_w > -tt_aV[WIDTH]) + tt_w = -tt_aV[WIDTH]; + } + // Ensure the top border of the body DIV be covered by the title DIV + iOffY = -wBrd; + } + else + { + tt_w = 0; + iOffY = 0; + } + + //-------- Body DIV ------------ + css = tt_aElt[5].style; + css.top = iOffY + "px"; + if(wBrd) + { + css.borderColor = tt_aV[BORDERCOLOR]; + css.borderStyle = tt_aV[BORDERSTYLE]; + css.borderWidth = wBrd + "px"; + } + if(tt_aV[BGCOLOR].length) + css.background = tt_aV[BGCOLOR]; + if(tt_aV[BGIMG].length) + css.backgroundImage = "url(" + tt_aV[BGIMG] + ")"; + css.padding = pad + "px"; + css.textAlign = tt_aV[TEXTALIGN]; + if(tt_aV[HEIGHT]) + { + css.overflow = "auto"; + if(tt_aV[HEIGHT] > 0) + css.height = (tt_aV[HEIGHT] + iAdd) + "px"; + else + tt_h = iAdd - tt_aV[HEIGHT]; + } + // TD inside body DIV + css = tt_aElt[6].style; + css.color = tt_aV[FONTCOLOR]; + css.fontFamily = tt_aV[FONTFACE]; + css.fontSize = tt_aV[FONTSIZE]; + css.fontWeight = tt_aV[FONTWEIGHT]; + css.background = ""; + css.textAlign = tt_aV[TEXTALIGN]; + if(tt_aV[WIDTH] > 0) + w = tt_aV[WIDTH]; + // Width like title (if existent) + else if(tt_aV[WIDTH] == -1 && tt_w) + w = tt_w; + else + { + // Measure width of the body's inner TD, as some browsers would expand + // the container and outer body DIV to 100% + w = tt_GetDivW(tt_aElt[6]); + // Restrict auto width to max width + if(tt_aV[WIDTH] < -1 && w > -tt_aV[WIDTH]) + w = -tt_aV[WIDTH]; + } + if(w > tt_w) + tt_w = w; + tt_w += iAdd; + + //--------- Shadow DIVs ------------ + if(tt_aV[SHADOW]) + { + tt_w += tt_aV[SHADOWWIDTH]; + iOffSh = Math.floor((tt_aV[SHADOWWIDTH] * 4) / 3); + // Bottom shadow + css = tt_aElt[7].style; + css.top = iOffY + "px"; + css.left = iOffSh + "px"; + css.width = (tt_w - iOffSh - tt_aV[SHADOWWIDTH]) + "px"; + css.height = tt_aV[SHADOWWIDTH] + "px"; + css.background = tt_aV[SHADOWCOLOR]; + // Right shadow + css = tt_aElt[8].style; + css.top = iOffSh + "px"; + css.left = (tt_w - tt_aV[SHADOWWIDTH]) + "px"; + css.width = tt_aV[SHADOWWIDTH] + "px"; + css.background = tt_aV[SHADOWCOLOR]; + } + else + iOffSh = 0; + + //-------- Container DIV ------- + tt_SetTipOpa(tt_aV[FADEIN] ? 0 : tt_aV[OPACITY]); + tt_FixSize(iOffY, iOffSh); +} +// Fixate the size so it can't dynamically change while the tooltip is moving. +function tt_FixSize(iOffY, iOffSh) +{ + var wIn, wOut, h, add, pad = tt_aV[PADDING], wBrd = tt_aV[BORDERWIDTH], i; + + tt_aElt[0].style.width = tt_w + "px"; + tt_aElt[0].style.pixelWidth = tt_w; + wOut = tt_w - ((tt_aV[SHADOW]) ? tt_aV[SHADOWWIDTH] : 0); + // Body + wIn = wOut; + if(!tt_bBoxOld) + wIn -= (pad + wBrd) << 1; + tt_aElt[5].style.width = wIn + "px"; + // Title + if(tt_aElt[1]) + { + wIn = wOut - ((tt_aV[TITLEPADDING] + 2) << 1); + if(!tt_bBoxOld) + wOut = wIn; + tt_aElt[1].style.width = wOut + "px"; + tt_aElt[2].style.width = wIn + "px"; + } + // Max height specified + if(tt_h) + { + h = tt_GetDivH(tt_aElt[5]); + if(h > tt_h) + { + if(!tt_bBoxOld) + tt_h -= (pad + wBrd) << 1; + tt_aElt[5].style.height = tt_h + "px"; + } + } + tt_h = tt_GetDivH(tt_aElt[0]) + iOffY; + // Right shadow + if(tt_aElt[8]) + tt_aElt[8].style.height = (tt_h - iOffSh) + "px"; + i = tt_aElt.length - 1; + if(tt_aElt[i]) + { + tt_aElt[i].style.width = tt_w + "px"; + tt_aElt[i].style.height = tt_h + "px"; + } +} +function tt_DeAlt(el) +{ + var aKid; + + if(el) + { + if(el.alt) + el.alt = ""; + if(el.title) + el.title = ""; + aKid = el.childNodes || el.children || null; + if(aKid) + { + for(var i = aKid.length; i;) + tt_DeAlt(aKid[--i]); + } + } +} +// This hack removes the native tooltips over links in Opera +function tt_OpDeHref(el) +{ + if(!tt_op) + return; + if(tt_elDeHref) + tt_OpReHref(); + while(el) + { + if(el.hasAttribute("href")) + { + el.t_href = el.getAttribute("href"); + el.t_stats = window.status; + el.removeAttribute("href"); + el.style.cursor = "hand"; + tt_AddEvtFnc(el, "mousedown", tt_OpReHref); + window.status = el.t_href; + tt_elDeHref = el; + break; + } + el = el.parentElement; + } +} +function tt_OpReHref() +{ + if(tt_elDeHref) + { + tt_elDeHref.setAttribute("href", tt_elDeHref.t_href); + tt_RemEvtFnc(tt_elDeHref, "mousedown", tt_OpReHref); + window.status = tt_elDeHref.t_stats; + tt_elDeHref = null; + } +} +function tt_OverInit() +{ + if(window.event) + tt_over = window.event.target || window.event.srcElement; + else + tt_over = tt_ovr_; + tt_DeAlt(tt_over); + tt_OpDeHref(tt_over); +} +function tt_ShowInit() +{ + tt_tShow.Timer("tt_Show()", tt_aV[DELAY], true); + if(tt_aV[CLICKCLOSE] || tt_aV[CLICKSTICKY]) + tt_AddEvtFnc(document, "mouseup", tt_OnLClick); +} +function tt_Show() +{ + var css = tt_aElt[0].style; + + // Override the z-index of the topmost wz_dragdrop.js D&D item + css.zIndex = Math.max((window.dd && dd.z) ? (dd.z + 2) : 0, 1110); + if(tt_aV[STICKY] || !tt_aV[FOLLOWMOUSE]) + tt_iState &= ~0x4; + if(tt_aV[DURATION] > 0) + tt_tDurt.Timer("tt_HideInit()", tt_aV[DURATION], true); + tt_ExtCallFncs(0, "Show") + css.visibility = "visible"; + tt_iState |= 0x2; + if(tt_aV[FADEIN]) + tt_Fade(0, 0, tt_aV[OPACITY], Math.round(tt_aV[FADEIN] / tt_aV[FADEINTERVAL])); + tt_ShowIfrm(); +} +function tt_ShowIfrm() +{ + if(tt_ie56) + { + var ifrm = tt_aElt[tt_aElt.length - 1]; + if(ifrm) + { + var css = ifrm.style; + css.zIndex = tt_aElt[0].style.zIndex - 1; + css.display = "block"; + } + } +} +function tt_Move(e) +{ + if(e) + tt_ovr_ = e.target || e.srcElement; + e = e || window.event; + if(e) + { + tt_musX = tt_GetEvtX(e); + tt_musY = tt_GetEvtY(e); + } + if(tt_iState & 0x04) + { + // Prevent jam of mousemove events + if(!tt_op && !tt_ie) + { + if(tt_bWait) + return; + tt_bWait = true; + tt_tWaitMov.Timer("tt_bWait = false;", 1, true); + } + if(tt_aV[FIX]) + { + var iY = tt_aV[FIX][1]; + // For a fixed tip to be positioned above the mouse, use the + // bottom edge as anchor + // (recommended by Christophe Rebeschini, 31.1.2008) + if(tt_aV[ABOVE]) + iY -= tt_h; + tt_iState &= ~0x4; + tt_SetTipPos(tt_aV[FIX][0], tt_aV[FIX][1]); + } + else if(!tt_ExtCallFncs(e, "MoveBefore")) + tt_SetTipPos(tt_Pos(0), tt_Pos(1)); + tt_ExtCallFncs([tt_musX, tt_musY], "MoveAfter") + } +} +function tt_Pos(iDim) +{ + var iX, bJmpMode, cmdAlt, cmdOff, cx, iMax, iScrl, iMus, bJmp; + + // Map values according to dimension to calculate + if(iDim) + { + bJmpMode = tt_aV[JUMPVERT]; + cmdAlt = ABOVE; + cmdOff = OFFSETY; + cx = tt_h; + iMax = tt_maxPosY; + iScrl = tt_scrlY; + iMus = tt_musY; + bJmp = tt_bJmpVert; + } + else + { + bJmpMode = tt_aV[JUMPHORZ]; + cmdAlt = LEFT; + cmdOff = OFFSETX; + cx = tt_w; + iMax = tt_maxPosX; + iScrl = tt_scrlX; + iMus = tt_musX; + bJmp = tt_bJmpHorz; + } + if(bJmpMode) + { + if(tt_aV[cmdAlt] && (!bJmp || tt_CalcPosAlt(iDim) >= iScrl + 16)) + iX = tt_PosAlt(iDim); + else if(!tt_aV[cmdAlt] && bJmp && tt_CalcPosDef(iDim) > iMax - 16) + iX = tt_PosAlt(iDim); + else + iX = tt_PosDef(iDim); + } + else + { + iX = iMus; + if(tt_aV[cmdAlt]) + iX -= cx + tt_aV[cmdOff] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); + else + iX += tt_aV[cmdOff]; + } + // Prevent tip from extending past clientarea boundary + if(iX > iMax) + iX = bJmpMode ? tt_PosAlt(iDim) : iMax; + + // In case of insufficient space on both sides, ensure the left/upper part + // of the tip be visible +//BH changed following line to correct HORZ JUMP + if(iX < (iScrl-OFFSETY)) + // iX = bJmpMode ? tt_PosDef(iDim) : iScrl; + iX = (bJmpMode ? tt_PosDef(iDim) : iScrl)-(OFFSETY*9); + return iX; +} +function tt_PosDef(iDim) +{ + if(iDim) + tt_bJmpVert = tt_aV[ABOVE]; + else + tt_bJmpHorz = tt_aV[LEFT]; + return tt_CalcPosDef(iDim); +} +function tt_PosAlt(iDim) +{ + if(iDim) + tt_bJmpVert = !tt_aV[ABOVE]; + else + tt_bJmpHorz = !tt_aV[LEFT]; + return tt_CalcPosAlt(iDim); +} +function tt_CalcPosDef(iDim) +{ + return iDim ? (tt_musY + tt_aV[OFFSETY]) : (tt_musX + tt_aV[OFFSETX]); +} +function tt_CalcPosAlt(iDim) +{ + var cmdOff = iDim ? OFFSETY : OFFSETX; + var dx = tt_aV[cmdOff] - (tt_aV[SHADOW] ? tt_aV[SHADOWWIDTH] : 0); + if(tt_aV[cmdOff] > 0 && dx <= 0) + dx = 1; + return((iDim ? (tt_musY - tt_h) : (tt_musX - tt_w)) - dx); +} +function tt_Fade(a, now, z, n) +{ + if(n) + { + now += Math.round((z - now) / n); + if((z > a) ? (now >= z) : (now <= z)) + now = z; + else + tt_tFade.Timer("tt_Fade(" + + a + "," + now + "," + z + "," + (n - 1) + + ")", + tt_aV[FADEINTERVAL], + true); + } + now ? tt_SetTipOpa(now) : tt_Hide(); +} +function tt_SetTipOpa(opa) +{ + // To circumvent the opacity nesting flaws of IE, we set the opacity + // for each sub-DIV separately, rather than for the container DIV. + tt_SetOpa(tt_aElt[5], opa); + if(tt_aElt[1]) + tt_SetOpa(tt_aElt[1], opa); + if(tt_aV[SHADOW]) + { + opa = Math.round(opa * 0.8); + tt_SetOpa(tt_aElt[7], opa); + tt_SetOpa(tt_aElt[8], opa); + } +} +function tt_OnScrl() +{ + tt_scrlX = tt_GetScrollX(); + tt_scrlY = tt_GetScrollY(); +} +function tt_OnCloseBtnOver(iOver) +{ + var css = tt_aElt[4].style; + + iOver <<= 1; + css.background = tt_aV[CLOSEBTNCOLORS][iOver]; + css.color = tt_aV[CLOSEBTNCOLORS][iOver + 1]; +} +function tt_OnLClick(e) +{ + // Ignore right-clicks + e = e || window.event; + if(!((e.button && e.button & 2) || (e.which && e.which == 3))) + { + if(tt_aV[CLICKSTICKY] && (tt_iState & 0x4)) + { + tt_aV[STICKY] = true; + tt_iState &= ~0x4; + } + else if(tt_aV[CLICKCLOSE]) + tt_HideInit(); + } +} +function tt_Int(x) +{ + var y; + + return(isNaN(y = parseInt(x)) ? 0 : y); +} +Number.prototype.Timer = function(s, iT, bUrge) +{ + if(!this.value || bUrge) + this.value = window.setTimeout(s, iT); +} +Number.prototype.EndTimer = function() +{ + if(this.value) + { + window.clearTimeout(this.value); + this.value = 0; + } +} +function tt_SetOpa(el, opa) +{ + var css = el.style; + + tt_opa = opa; + if(tt_flagOpa == 1) + { + if(opa < 100) + { + // Hacks for bugs of IE: + // 1.) Once a CSS filter has been applied, fonts are no longer + // anti-aliased, so we store the previous 'non-filter' to be + // able to restore it + if(typeof(el.filtNo) == tt_u) + el.filtNo = css.filter; + // 2.) A DIV cannot be made visible in a single step if an + // opacity < 100 has been applied while the DIV was hidden + var bVis = css.visibility != "hidden"; + // 3.) In IE6, applying an opacity < 100 has no effect if the + // element has no layout (position, size, zoom, ...) + css.zoom = "100%"; + if(!bVis) + css.visibility = "visible"; + css.filter = "alpha(opacity=" + opa + ")"; + if(!bVis) + css.visibility = "hidden"; + } + else if(typeof(el.filtNo) != tt_u) + // Restore 'non-filter' + css.filter = el.filtNo; + } + else + { + opa /= 100.0; + switch(tt_flagOpa) + { + case 2: + css.KhtmlOpacity = opa; break; + case 3: + css.KHTMLOpacity = opa; break; + case 4: + css.MozOpacity = opa; break; + case 5: + css.opacity = opa; break; + } + } +} +function tt_MovDomNode(el, dadFrom, dadTo) +{ + if(dadFrom) + dadFrom.removeChild(el); + if(dadTo) + dadTo.appendChild(el); +} +function tt_Err(sErr, bIfDebug) +{ + if(tt_Debug || !bIfDebug) + alert("Tooltip Script Error Message:\n\n" + sErr); +} + +//============ EXTENSION (PLUGIN) MANAGER ===============// +function tt_ExtCmdEnum() +{ + var s; + + // Add new command(s) to the commands enum + for(var i in config) + { + s = "window." + i.toString().toUpperCase(); + if(eval("typeof(" + s + ") == tt_u")) + { + eval(s + " = " + tt_aV.length); + tt_aV[tt_aV.length] = null; + } + } +} +function tt_ExtCallFncs(arg, sFnc) +{ + var b = false; + for(var i = tt_aExt.length; i;) + {--i; + var fnc = tt_aExt[i]["On" + sFnc]; + // Call the method the extension has defined for this event + if(fnc && fnc(arg)) + b = true; + } + return b; +} + +tt_Init(); diff --git a/modules/lightbox/lb_defaultconfig.php b/modules/lightbox/lb_defaultconfig.php new file mode 100644 index 0000000000..9a8ef64243 --- /dev/null +++ b/modules/lightbox/lb_defaultconfig.php @@ -0,0 +1,96 @@ +<?php +/** + * Lightbox Album module for phpGedView + * + * Display media Items using Lightbox + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2009 PHPGedView Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Module + * @version $Id$ + * @author Brian Holland + */ + +// ------------------------------------------------------- +// Configuration parameters for Lightbox Album +// ------------------------------------------------------- + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +global $mediatab,$LB_AL_HEAD_LINKS,$LB_AL_THUMB_LINKS,$LB_ML_THUMB_LINKS,$LB_SS_SPEED; +global $LB_MUSIC_FILE,$LB_TRANSITION,$LB_URL_WIDTH,$LB_URL_HEIGHT,$GEDCOM; + +// Create LB tables, if not already present +try { + WT_DB::updateSchema('./modules/lightbox/db_schema/', 'LB_SCHEMA_VERSION', 1); +} catch (PDOException $ex) { + // The schema update scripts should never fail. If they do, there is no clean recovery. + die($ex); +} + +// TODO: it will be more efficient to fetch all LB_% settings in a single DB query + +$mediatab=get_site_setting('LB_ENABLED', '1'); // Individual Page Media Tab + // Set to 0 to hide Media Tab on Indi page from All Users, + // Set to 1 to show Media Tab on Indi page to All Users, [Default] + + +$LB_AL_HEAD_LINKS=get_site_setting('LB_AL_HEAD_LINKS', 'both'); // Album Tab Page Header Links. + // Set to 'icon' to view icon links. + // Set to 'text' to view text links + // Set to 'both' to view both. + +$LB_TT_BALLOON=get_site_setting('LB_TT_BALLOON', 'true'); // Album Tab Page - Above Thumbnail Links. + // Set to 'true' to view Tooltip Balloon. + // Set to 'false' to view Tooltip Normal. + +$LB_AL_THUMB_LINKS=get_site_setting('LB_AL_THUMB_LINKS', 'text'); // Album Tab Page - Below Thumbnail Links. + // Set to 'icon' to view icon links. + // Set to 'text' to view text links. [Default] + +$LB_SS_SPEED=get_site_setting('LB_SS_SPEED', '6'); // SlideShow speed in seconds. [Min 2 max 25] + +$LB_MUSIC_FILE=get_site_setting('LB_MUSIC_FILE', 'modules/lightbox/music/music.mp3'); // The music file. [mp3 only] + +$LB_TRANSITION=get_site_setting('LB_TRANSITION', 'warp'); // Next or Prvious Image Transition effect + // Set to 'none' No transtion effect. + // Set to 'normal' Normal transtion effect. + // Set to 'double' Fast transition effect. + // Set to 'warp' Stretch transtition effect. [Default] + +$LB_URL_WIDTH =get_site_setting('LB_URL_WIDTH', '1000'); // URL Window width in pixels +$LB_URL_HEIGHT=get_site_setting('LB_URL_HEIGHT', '600'); // URL Window height in pixels + +$LB_ML_THUMB_LINKS = get_site_setting('LB_ML_THUMB_LINKS', 'text'); // MultiMedia List Page Thumbnail Links + // Set to 'icon' to view icon links. + // Set to 'text' to view text links. [Default] + // Set to 'both' to view both. + // Set to 'none' to view neither. + +// End Configuration Parameters ------------------------------------------------- + +// Tab id no for Lightbox +$tabno=get_site_setting('GM_ENABLED') ? 8 : 7; +?> diff --git a/modules/lightbox/lb_editconfig.php b/modules/lightbox/lb_editconfig.php new file mode 100644 index 0000000000..72552daf0e --- /dev/null +++ b/modules/lightbox/lb_editconfig.php @@ -0,0 +1,253 @@ +<?php +/** + * Online UI for editing config.php site configuration variables + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2002 to 2007 PGV Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * This Page Is Valid XHTML 1.0 Transitional! > 17 September 2005 + * + * @package webtrees + * @subpackage GoogleMap + * @see config.php + * @version $Id: editconfig.php,v$ + * $Id$ + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +global $pid, $GEDCOM ; + +$pid=safe_get('pid'); +$action = safe_POST("action"); + +print_header(i18n::translate('Lightbox-Album Configuration')); + +require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; + +print "<span class=\"subheaders\">".i18n::translate('Lightbox-Album Configuration')."</span>"; +print "<br /><br />"; + +if (!WT_USER_IS_ADMIN) { + print "<table class=\"facts_table\">\n"; + print "<tr><td colspan=\"2\" class=\"facts_value\">".i18n::translate('Page only for Administrators'); + print "</td></tr></table>\n"; + print "<br/><br/><br/>\n"; + print_footer(); + exit; +} + +if ($action=='update' && !isset($security_user)) { + set_site_setting('LB_ENABLED', $_POST['NEW_mediatab']); + set_site_setting('LB_AL_HEAD_LINKS', $_POST['NEW_LB_AL_HEAD_LINKS']); + set_site_setting('LB_AL_THUMB_LINKS', $_POST['NEW_LB_AL_THUMB_LINKS']); + set_site_setting('LB_TT_BALLOON', $_POST['NEW_LB_TT_BALLOON']); + set_site_setting('LB_ML_THUMB_LINKS', $_POST['NEW_LB_ML_THUMB_LINKS']); + set_site_setting('LB_MUSIC_FILE', $_POST['NEW_LB_MUSIC_FILE']); + set_site_setting('LB_SS_SPEED', $_POST['NEW_LB_SS_SPEED']); + set_site_setting('LB_TRANSITION', $_POST['NEW_LB_TRANSITION']); + set_site_setting('LB_URL_WIDTH', $_POST['NEW_LB_URL_WIDTH']); + set_site_setting('LB_URL_HEIGHT', $_POST['NEW_LB_URL_HEIGHT']); + + AddToLog('Lightbox config updated'); + // read the config file again, to set the vars + require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; +} + +$i = 0; + +?> +<form method="post" name="configform" action="<?php print encode_url("module.php?mod=lightbox&pgvaction=lb_editconfig&pid={$pid}"); ?>"> +<input type="hidden" name="action" value="update" /> + + <table class="facts_table"> + + <tr > + <td class="descriptionbox" width="400"><b><?php print i18n::translate('Individual Page - Media Tab');?></b><?php echo help_link('mediatab','lightbox'); ?><br /> <?php print i18n::translate('Appearance');?></td> + <td class="optionbox"> + <select name="NEW_mediatab" tabindex="<?php $i++; print $i?>" onfocus="getHelp('mediatab_help');"> + <option value="1" <?php if ($mediatab==1) print "selected=\"selected\""; ?>><?php print i18n::translate('Show');?></option> + <option value="0" <?php if ($mediatab==0) print "selected=\"selected\""; ?>><?php print i18n::translate('Hide');?></option> + </select> + <?php print i18n::translate('Show');?> <?php print i18n::translate('Hide');?> + </td> + </tr> + <tr><td><br> + </td></tr> + + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Individual Page - Album Tab Header');?></b><?php echo help_link('lb_al_head_links','lightbox'); ?><br /> <?php print i18n::translate('Link appearance');?></td> + <td class="optionbox"> + <select name="NEW_LB_AL_HEAD_LINKS" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_AL_HEAD_LINKS_help');"> + <option value="icon" <?php if ($LB_AL_HEAD_LINKS=="icon") print "selected=\"selected\""; ?>><?php print i18n::translate('Icon');?></option> + <option value="text" <?php if ($LB_AL_HEAD_LINKS=="text") print "selected=\"selected\""; ?>><?php print i18n::translate('Text');?></option> + <option value="both" <?php if ($LB_AL_HEAD_LINKS=="both") print "selected=\"selected\""; ?>><?php print i18n::translate('Both');?></option> + </select> + <?php print i18n::translate('Icon');?> <?php print i18n::translate('Text');?> <?php print i18n::translate('Both');?> + </td> + </tr> + <tr><td> + </td></tr> + + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Individual Page - Album Tab Thumbnail - Notes Tooltip');?></b><?php echo help_link('lb_tt_balloon','lightbox'); ?><br /> <?php print i18n::translate('Notes - Tooltip appearance');?></td> + <td class="optionbox"><select name="NEW_LB_TT_BALLOON" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_AL_THUMB_LINKS_help');"> + <option value="true" <?php if ($LB_TT_BALLOON=="true") print "selected=\"selected\""; ?>><?php print i18n::translate('Balloon');?></option> + <option value="false" <?php if ($LB_TT_BALLOON=="false") print "selected=\"selected\""; ?>><?php print i18n::translate('Normal');?></option> + </select> + <?php print i18n::translate('Balloon');?> <?php print i18n::translate('Normal');?> + </td> + </tr> + <tr><td> + </td></tr> + + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Individual Page - Album Tab Thumbnails');?></b><?php echo help_link('lb_al_thumb_links','lightbox'); ?><br /> <?php print i18n::translate('Link appearance');?></td> + <td class="optionbox"><select name="NEW_LB_AL_THUMB_LINKS" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_AL_THUMB_LINKS_help');"> + <option value="icon" <?php if ($LB_AL_THUMB_LINKS=="icon") print "selected=\"selected\""; ?>><?php print i18n::translate('Icon');?></option> + <option value="text" <?php if ($LB_AL_THUMB_LINKS=="text") print "selected=\"selected\""; ?>><?php print i18n::translate('Text');?></option> + </select> + <?php print i18n::translate('Icon');?> <?php print i18n::translate('Text');?> + </td> + </tr> + <tr><td> + </td></tr> + + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Slide Show speed');?></b><?php echo help_link('lb_ss_speed','lightbox'); ?></td> + <td class="optionbox"><select name="NEW_LB_SS_SPEED" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_SS_SPEED_help');" /> + <option value= "2" <?php if ($LB_SS_SPEED == 2) print "selected=\"selected\""; ?>><?php print "2";?></option> + <option value= "3" <?php if ($LB_SS_SPEED == 3) print "selected=\"selected\""; ?>><?php print "3";?></option> + <option value= "4" <?php if ($LB_SS_SPEED == 4) print "selected=\"selected\""; ?>><?php print "4";?></option> + <option value= "5" <?php if ($LB_SS_SPEED == 5) print "selected=\"selected\""; ?>><?php print "5";?></option> + <option value= "6" <?php if ($LB_SS_SPEED == 6) print "selected=\"selected\""; ?>><?php print "6";?></option> + <option value= "7" <?php if ($LB_SS_SPEED == 7) print "selected=\"selected\""; ?>><?php print "7";?></option> + <option value= "8" <?php if ($LB_SS_SPEED == 8) print "selected=\"selected\""; ?>><?php print "8";?></option> + <option value= "9" <?php if ($LB_SS_SPEED == 9) print "selected=\"selected\""; ?>><?php print "9";?></option> + <option value="10" <?php if ($LB_SS_SPEED ==10) print "selected=\"selected\""; ?>><?php print "10";?></option> + <option value="12" <?php if ($LB_SS_SPEED ==12) print "selected=\"selected\""; ?>><?php print "12";?></option> + <option value="15" <?php if ($LB_SS_SPEED ==15) print "selected=\"selected\""; ?>><?php print "15";?></option> + <option value="20" <?php if ($LB_SS_SPEED ==20) print "selected=\"selected\""; ?>><?php print "20";?></option> + <option value="25" <?php if ($LB_SS_SPEED ==25) print "selected=\"selected\""; ?>><?php print "25";?></option> + </select> + <?php print i18n::translate('Slide show timing in seconds');?> + </td> + </tr> + <tr><td> + </td></tr> + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Slideshow sound track'); ?></b><?php echo help_link('lb_music_file','lightbox'); ?><br /> <?php print i18n::translate('(mp3 only)'); ?></td> + <td class="optionbox"> + <input type="text" name="NEW_LB_MUSIC_FILE" value="<?php print $LB_MUSIC_FILE;?>" size="60" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_MUSIC_FILE_help');" /><br /> + <?php print i18n::translate('Location of sound track file (Leave blank for no sound track)');?> + </td> + </tr> + <tr><td> + </td></tr> + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Image Transition speed');?></b><?php echo help_link('lb_transition','lightbox'); ?></td> + <td class="optionbox"><select name="NEW_LB_TRANSITION" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_TRANSITION_help');"> + <option value="none" <?php if ($LB_TRANSITION=="none") print "selected=\"selected\""; ?>><?php print i18n::translate('None');?></option> + <option value="normal" <?php if ($LB_TRANSITION=="normal") print "selected=\"selected\""; ?>><?php print i18n::translate('Normal');?></option> + <option value="double" <?php if ($LB_TRANSITION=="double") print "selected=\"selected\""; ?>><?php print i18n::translate('Double');?></option> + <option value="warp" <?php if ($LB_TRANSITION=="warp") print "selected=\"selected\""; ?>><?php print i18n::translate('Warp');?></option> + </select> + <?php print i18n::translate('None');?> <?php print i18n::translate('Normal');?> <?php print i18n::translate('Double');?> <?php print i18n::translate('Warp');?> + </td> + </tr> + <tr><td> + </td></tr> + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('URL Window dimensions');?><b><?php echo help_link('lb_url_dimensions','lightbox'); ?></td> + <td class="optionbox"> + <input type="text" name="NEW_LB_URL_WIDTH" value="<?php print $LB_URL_WIDTH;?>" size="4" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_TRANSITION_help');" /> + <?php print i18n::translate('Width');?> + + <input type="text" name="NEW_LB_URL_HEIGHT" value="<?php print $LB_URL_HEIGHT;?>" size="4" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_TRANSITION_help');" /> + <?php print i18n::translate('Height');?><br /> + <?php print i18n::translate('Width and height of URL window in pixels');?> + </td> + </tr> + <tr><td><br> + </td></tr> + + + + <tr> + <td class="descriptionbox"><b><?php print i18n::translate('Multimedia Page - Thumbnails');?></b><?php echo help_link('lb_ml_thumb_links','lightbox'); ?><br /> <?php print i18n::translate('Link appearance');?></td> + <td class="optionbox"> + <select name="NEW_LB_ML_THUMB_LINKS" tabindex="<?php $i++; print $i?>" onfocus="getHelp('LB_ML_THUMB_LINKS_help');" /> + <option value= "none" <?php if ($LB_ML_THUMB_LINKS == "none") print "selected=\"selected\""; ?>><?php print i18n::translate('None');?></option> + <option value= "text" <?php if ($LB_ML_THUMB_LINKS == "text") print "selected=\"selected\""; ?>><?php print i18n::translate('Text');?></option> + <option value= "icon" <?php if ($LB_ML_THUMB_LINKS == "icon") print "selected=\"selected\""; ?>><?php print i18n::translate('Icon');?></option> + <option value= "both" <?php if ($LB_ML_THUMB_LINKS == "both") print "selected=\"selected\""; ?>><?php print i18n::translate('Both');?></option> + </select> + <?php print i18n::translate('None');?> <?php print i18n::translate('Text');?> <?php print i18n::translate('Icon');?> <?php print i18n::translate('Both');?> + </td> + </tr> + <tr><td> + </td></tr> + + + </table> + + <br /><br /> + + <table class="facts_table"> + + <tr> + + <td class="descriptionbox" colspan="2" align="center"> + <input type="submit" tabindex="<?php $i++; print $i?>" value="<?php print i18n::translate('Save configuration');?>" onclick="closeHelp();" /> + + <input type="reset" tabindex="<?php $i++; print $i?>" value="<?php print i18n::translate('Reset');?>" /> + + <?php if ($pid){ ?> + <INPUT TYPE="button" VALUE="<?php print i18n::translate('Return to Album page');?>" onclick="javascript:window.location='individual.php?pid=<?php echo $pid;?>&tab=<?php echo $tabno;?>&gedcom=<?php echo $GEDCOM;?>'" /> + <?php }else{ ?> + <INPUT TYPE="button" VALUE="<?php print i18n::translate('Return to Admin Page');?>" onclick="javascript:window.location='admin.php'" /> + <?php } ?> + + </td> + + </tr> + </table> +</form> + +<?php + +if(empty($SEARCH_SPIDER)) + print_footer(); +else { + print i18n::translate('Search Engine Spider Detected').": ".$SEARCH_SPIDER; + print "\n</div>\n\t</body>\n</html>"; +} + +?> diff --git a/modules/lightbox/music/music.mp3 b/modules/lightbox/music/music.mp3 Binary files differnew file mode 100644 index 0000000000..0ecd3fe9b8 --- /dev/null +++ b/modules/lightbox/music/music.mp3 diff --git a/modules/lightbox/pgv_module.php b/modules/lightbox/pgv_module.php new file mode 100644 index 0000000000..14431216cf --- /dev/null +++ b/modules/lightbox/pgv_module.php @@ -0,0 +1,138 @@ +<?php +/** + * Classes and libraries for module system + * + * webtrees: Web based Family History software + * Copyright (C) 2010 webtrees development team. + * + * Derived from PhpGedView + * Copyright (C) 2009 John Finlay + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @package webtrees + * @subpackage Modules + * @version $Id: class_media.php 5451 2009-05-05 22:15:34Z fisharebest $ + */ + +if (!defined('WT_WEBTREES')) { + header('HTTP/1.0 403 Forbidden'); + exit; +} + +require_once WT_ROOT.'includes/classes/class_module.php'; +require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; + +class lightbox_WT_Module extends WT_Module implements WT_Module_Config, WT_Module_Tab { + // Extend WT_Module + public function getTitle() { + return i18n::translate('Album'); + } + + // Extend WT_Module + public function getDescription() { + return i18n::translate('Adds a tab (Album) to the individual page which an alternate way to view and work with media.'); + } + + // Implement WT_Module_Config + public function getConfigLink() { + return 'module.php?mod=lightbox&pgvaction=lb_editconfig'; + } + + // Implement WT_Module_Tab + public function defaultTabOrder() { + return 60; + } + + // Implement WT_Module_Tab + public function hasTabContent() { + global $MULTI_MEDIA; + return $MULTI_MEDIA && $this->get_media_count()>0; + } + + // Implement WT_Module_Tab + public function getTabContent() { + global $MULTI_MEDIA, $SHOW_ID_NUMBERS, $MEDIA_EXTERNAL; + global $pgv_changes; + global $GEDCOM, $MEDIATYPE, $pgv_changes; + global $WORD_WRAPPED_NOTES, $MEDIA_DIRECTORY, $WT_IMAGE_DIR, $WT_IMAGES, $TEXT_DIRECTION, $is_media; + global $cntm1, $cntm2, $cntm3, $cntm4, $t, $mgedrec ; + global $edit ; + global $CONTACT_EMAIL, $pid, $tabno; + global $Fam_Navigator, $NAV_ALBUM; + + ob_start(); + $mediacnt = $this->get_media_count(); + require_once 'modules/lightbox/functions/lb_head.php'; + echo "<div id=\"lightbox2_content\">"; + + $media_found = false; + if (!$this->controller->indi->canDisplayDetails()) { + print "<table class=\"facts_table\" cellpadding=\"0\">\n"; + print "<tr><td class=\"facts_value\">"; + print_privacy_error($CONTACT_EMAIL); + print "</td></tr>"; + print "</table>"; + }else{ + if (file_exists("modules/lightbox/album.php")) { + include_once('modules/lightbox/album.php'); + } + } + echo "</div>"; + + $out .= ob_get_contents(); + ob_end_clean(); + $out .= "</div>"; + return $out; + } + + // Implement WT_Module_Tab + public function canLoadAjax() { + return true; + } + + // Implement WT_Module_Tab + public function getPreLoadContent() { + $out = ''; + ob_start(); + include_once('modules/lightbox/functions/lb_call_js.php'); + $out .= ob_get_contents(); + ob_end_clean(); + return $out; + } + + // Implement WT_Module_Tab + public function getJSCallbackAllTabs() { + return 'CB_Init();'; + } + + // Implement WT_Module_Tab + public function getJSCallback() { + return ''; + } + + protected $mediaCount = null; + + private function get_media_count() { + if ($this->mediaCount===null) { + $ct = preg_match("/\d OBJE/", $this->controller->indi->getGedcomRecord()); + foreach ($this->controller->indi->getSpouseFamilies() as $k=>$sfam) + $ct += preg_match("/\d OBJE/", $sfam->getGedcomRecord()); + $this->mediaCount = $ct; + } + return $this->mediaCount; + } + +} diff --git a/modules/lightbox/pic/blank.gif b/modules/lightbox/pic/blank.gif Binary files differnew file mode 100644 index 0000000000..35d42e808f --- /dev/null +++ b/modules/lightbox/pic/blank.gif diff --git a/modules/lightbox/pic/close.png b/modules/lightbox/pic/close.png Binary files differnew file mode 100644 index 0000000000..a721c3d385 --- /dev/null +++ b/modules/lightbox/pic/close.png diff --git a/modules/lightbox/pic/close_red.png b/modules/lightbox/pic/close_red.png Binary files differnew file mode 100644 index 0000000000..69ad560e0b --- /dev/null +++ b/modules/lightbox/pic/close_red.png diff --git a/modules/lightbox/pic/detail.gif b/modules/lightbox/pic/detail.gif Binary files differnew file mode 100644 index 0000000000..b8cf3781f9 --- /dev/null +++ b/modules/lightbox/pic/detail.gif diff --git a/modules/lightbox/pic/details.gif b/modules/lightbox/pic/details.gif Binary files differnew file mode 100644 index 0000000000..358a5482f9 --- /dev/null +++ b/modules/lightbox/pic/details.gif diff --git a/modules/lightbox/pic/loading.gif b/modules/lightbox/pic/loading.gif Binary files differnew file mode 100644 index 0000000000..474743b98b --- /dev/null +++ b/modules/lightbox/pic/loading.gif diff --git a/modules/lightbox/pic/music_null.png b/modules/lightbox/pic/music_null.png Binary files differnew file mode 100644 index 0000000000..2ba8b27760 --- /dev/null +++ b/modules/lightbox/pic/music_null.png diff --git a/modules/lightbox/pic/music_off.png b/modules/lightbox/pic/music_off.png Binary files differnew file mode 100644 index 0000000000..4495cff40f --- /dev/null +++ b/modules/lightbox/pic/music_off.png diff --git a/modules/lightbox/pic/music_on.png b/modules/lightbox/pic/music_on.png Binary files differnew file mode 100644 index 0000000000..99f0910f3f --- /dev/null +++ b/modules/lightbox/pic/music_on.png diff --git a/modules/lightbox/pic/next.gif b/modules/lightbox/pic/next.gif Binary files differnew file mode 100644 index 0000000000..3b72427ad4 --- /dev/null +++ b/modules/lightbox/pic/next.gif diff --git a/modules/lightbox/pic/notes.gif b/modules/lightbox/pic/notes.gif Binary files differnew file mode 100644 index 0000000000..8e2c05546e --- /dev/null +++ b/modules/lightbox/pic/notes.gif diff --git a/modules/lightbox/pic/pause.png b/modules/lightbox/pic/pause.png Binary files differnew file mode 100644 index 0000000000..f20d53e6ea --- /dev/null +++ b/modules/lightbox/pic/pause.png diff --git a/modules/lightbox/pic/prev.gif b/modules/lightbox/pic/prev.gif Binary files differnew file mode 100644 index 0000000000..02db9d6080 --- /dev/null +++ b/modules/lightbox/pic/prev.gif diff --git a/modules/lightbox/pic/s_btm.png b/modules/lightbox/pic/s_btm.png Binary files differnew file mode 100644 index 0000000000..dec4437ddc --- /dev/null +++ b/modules/lightbox/pic/s_btm.png diff --git a/modules/lightbox/pic/s_btmleft.png b/modules/lightbox/pic/s_btmleft.png Binary files differnew file mode 100644 index 0000000000..6e7881db34 --- /dev/null +++ b/modules/lightbox/pic/s_btmleft.png diff --git a/modules/lightbox/pic/s_btmright.png b/modules/lightbox/pic/s_btmright.png Binary files differnew file mode 100644 index 0000000000..b37f928fe4 --- /dev/null +++ b/modules/lightbox/pic/s_btmright.png diff --git a/modules/lightbox/pic/s_left.png b/modules/lightbox/pic/s_left.png Binary files differnew file mode 100644 index 0000000000..27814176a9 --- /dev/null +++ b/modules/lightbox/pic/s_left.png diff --git a/modules/lightbox/pic/s_right.png b/modules/lightbox/pic/s_right.png Binary files differnew file mode 100644 index 0000000000..d67bda8d49 --- /dev/null +++ b/modules/lightbox/pic/s_right.png diff --git a/modules/lightbox/pic/s_top.png b/modules/lightbox/pic/s_top.png Binary files differnew file mode 100644 index 0000000000..89d8cea5d0 --- /dev/null +++ b/modules/lightbox/pic/s_top.png diff --git a/modules/lightbox/pic/s_topleft.png b/modules/lightbox/pic/s_topleft.png Binary files differnew file mode 100644 index 0000000000..e40515765a --- /dev/null +++ b/modules/lightbox/pic/s_topleft.png diff --git a/modules/lightbox/pic/s_topright.png b/modules/lightbox/pic/s_topright.png Binary files differnew file mode 100644 index 0000000000..3372038513 --- /dev/null +++ b/modules/lightbox/pic/s_topright.png diff --git a/modules/lightbox/pic/start.png b/modules/lightbox/pic/start.png Binary files differnew file mode 100644 index 0000000000..2cc21d9017 --- /dev/null +++ b/modules/lightbox/pic/start.png diff --git a/modules/lightbox/pic/white.gif b/modules/lightbox/pic/white.gif Binary files differnew file mode 100644 index 0000000000..1713283595 --- /dev/null +++ b/modules/lightbox/pic/white.gif diff --git a/modules/lightbox/pic/zoom_off.png b/modules/lightbox/pic/zoom_off.png Binary files differnew file mode 100644 index 0000000000..8ab81ba3e7 --- /dev/null +++ b/modules/lightbox/pic/zoom_off.png diff --git a/modules/lightbox/pic/zoom_on.png b/modules/lightbox/pic/zoom_on.png Binary files differnew file mode 100644 index 0000000000..fb20efae40 --- /dev/null +++ b/modules/lightbox/pic/zoom_on.png |
