summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStella Power2008-04-24 17:35:52 (GMT)
committer Stella Power2008-04-24 17:35:52 (GMT)
commit5297a1a6635de9918c0c3a9c6af8c3da77ce7554 (patch)
tree9239d4301d06445da8b4547a136e9a5ebe30f680
parent13130a64b8073552da873089bb2d071e1b458fbc (diff)
Added in new option for configuring the page count text when using iframes.
-rw-r--r--js/lightbox.js7
-rw-r--r--js/lightbox2.js2
-rw-r--r--lightbox2.install1
-rw-r--r--lightbox2.module9
4 files changed, 18 insertions, 1 deletions
diff --git a/js/lightbox.js b/js/lightbox.js
index 54453e8..fff661a 100644
--- a/js/lightbox.js
+++ b/js/lightbox.js
@@ -772,7 +772,12 @@ var Lightbox = {
var settings = Drupal.settings.lightbox2;
var numberDisplay = null;
if (Lightbox.imageArray.length > 1) {
- numberDisplay = settings.image_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length);
+ if (!Lightbox.isLightframe) {
+ numberDisplay = settings.image_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length);
+ }
+ else {
+ numberDisplay = settings.page_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length);
+ }
$('#numberDisplay').html(numberDisplay).css({zIndex: '10500'}).show();
}
diff --git a/js/lightbox2.js b/js/lightbox2.js
index ad60942..6e9e09f 100644
--- a/js/lightbox2.js
+++ b/js/lightbox2.js
@@ -24,6 +24,7 @@ function lightbox2_lite_general_handler(event) {
$("input[@name=lightbox2_force_show_nav]").attr("disabled", "disabled");
$("input[@name=lightbox2_disable_zoom]").attr("disabled", "disabled");
$("input[@name=lightbox2_image_count_str]").attr("disabled", "disabled");
+ $("input[@name=lightbox2_page_count_str]").attr("disabled", "disabled");
$("select[@name=lightbox2_display_image_size]").attr("disabled", "disabled");
$("select[@name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
$("input[@name=lightbox2_overlay_opacity]").attr("disabled", "disabled");
@@ -33,6 +34,7 @@ function lightbox2_lite_general_handler(event) {
$("input[@name=lightbox2_force_show_nav]").removeAttr("disabled");
$("input[@name=lightbox2_disable_zoom]").removeAttr("disabled");
$("input[@name=lightbox2_image_count_str]").removeAttr("disabled");
+ $("input[@name=lightbox2_page_count_str]").removeAttr("disabled");
$("select[@name=lightbox2_display_image_size]").removeAttr("disabled");
$("select[@name='lightbox2_trigger_image_size[]']").removeAttr("disabled");
$("input[@name=lightbox2_overlay_opacity]").removeAttr("disabled");
diff --git a/lightbox2.install b/lightbox2.install
index 840f876..9d5384d 100644
--- a/lightbox2.install
+++ b/lightbox2.install
@@ -26,6 +26,7 @@ function lightbox2_uninstall() {
variable_del('lightbox2_use_alt_layout');
variable_del('lightbox2_force_show_nav');
variable_del('lightbox2_image_count_str');
+ variable_del('lightbox2_page_count_str');
variable_del('lightbox2_disable_zoom');
variable_del('lightbox2_disable_these_urls');
variable_del('lightbox2_imagefield_group_node_id');
diff --git a/lightbox2.module b/lightbox2.module
index dbc70be..405f501 100644
--- a/lightbox2.module
+++ b/lightbox2.module
@@ -229,6 +229,14 @@ function lightbox2_general_settings_form() {
'#default_value' => variable_get('lightbox2_image_count_str', 'Image !current of !total'),
);
+ // Add text box for page count for grouping.
+ $form['lightbox2_page_count_str'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page Count Text'),
+ '#description' => t('This text is used to display the page count underneath HTML content displayed in the lightbox when using groups. Use !current as a placeholder for the number of the current page and !total for the total number of pages in the group. For example, "Page !current of !total".'),
+ '#default_value' => variable_get('lightbox2_page_count_str', 'Page !current of !total'),
+ );
+
// Add checkbox for zoom image.
$form['lightbox2_disable_zoom'] = array(
'#type' => 'checkbox',
@@ -772,6 +780,7 @@ function lightbox2_add_files() {
'node_link_text' => check_plain(t(variable_get('lightbox2_node_link_text', 'View Image Details'))),
'node_link_target' => variable_get('lightbox2_node_link_target', FALSE),
'image_count' => check_plain(t(variable_get('lightbox2_image_count_str', 'Image !current of !total'))),
+ 'page_count' => check_plain(t(variable_get('lightbox2_page_count_str', 'Page !current of !total'))),
'lite_press_x_close' => t('press !x to close', array('!x' => '<a href="#" onclick="hideLightbox(); return FALSE;"><kbd>x</kbd></a>')),
// Automatic image handling settings.
'display_image_size' => variable_get('lightbox2_display_image_size', ''),