summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Correa da Conceição2011-10-13 19:34:47 (GMT)
committerFernando Correa da Conceição2011-10-13 19:34:47 (GMT)
commit61625e449a2575241b898818d15afef8af4ea44d (patch)
treef88881d382c20d2125ad97b5e068c9bafbc92f4a
parenteb8543c81158ca42be1a744f7f906daa02a1e333 (diff)
Issue #1308828 by Yukare: missing the update from jquery code break all auto image handling7.x-1.0-beta1
-rw-r--r--js/auto_image_handling.js57
-rw-r--r--js/lightbox_modal.js10
2 files changed, 13 insertions, 54 deletions
diff --git a/js/auto_image_handling.js b/js/auto_image_handling.js
index e769a8b..f5c4f97 100644
--- a/js/auto_image_handling.js
+++ b/js/auto_image_handling.js
@@ -1,9 +1,9 @@
-/* $Id: auto_image_handling.js,v 1.1.4.33 2010/09/22 21:07:57 snpower Exp $ */
-
// Image Node Auto-Format with Auto Image Grouping.
// Original version by Steve McKenzie.
// Altered by Stella Power for jQuery version.
+(function ($) {
+
function parse_url(url, param) {
param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
url = url.replace(/&/, "&");
@@ -31,14 +31,10 @@ function lightbox2_init_triggers(classes, rel_type, custom_class) {
}
$("a:has("+classes+")").each(function(i) {
-
if ((!settings.disable_for_gallery_lists && !settings.disable_for_acidfree_gallery_lists) || (!$(this).parents("td.giAlbumCell").attr("class") && !$(this).parents(".galleries").length && !$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || ($(this).parents(".galleries").length && !settings.disable_for_gallery_lists) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) {
-
var child = $(this).find(classes);
-
// Ensure the child has a class attribute we can work with.
- if ($(child).attr("class") && !$(this).parents("div.acidfree-video").length) {
-
+ if ($(child).attr("class")) {
// Set the alt text.
var alt = $(child).attr("alt");
if (!alt) {
@@ -79,7 +75,6 @@ function lightbox2_init_triggers(classes, rel_type, custom_class) {
orig_href = orig_href.replace(lang_pattern, Drupal.settings.basePath);
}
var frame_href = orig_href;
-
// Handle flickr images.
if ($(child).attr("class").match("flickr-photo-img") ||
$(child).attr("class").match("flickr-photoset-img")) {
@@ -156,7 +151,6 @@ function lightbox2_init_triggers(classes, rel_type, custom_class) {
rewrite = 0;
}
}
-
// Modify the image url.
var img_title = $(child).attr("title");
if (!img_title) {
@@ -205,39 +199,7 @@ function lightbox2_init_triggers(classes, rel_type, custom_class) {
});
}
-function lightbox2_init_acidfree_video() {
- var settings = Drupal.settings.lightbox2;
-
- var link_target = "";
- if (settings.node_link_target !== 0) {
- link_target = 'target="'+ settings.node_link_target +'"';
- }
-
- var link_text = settings.node_link_text;
- var rel = "lightframe";
-
- $("div.acidfree-video a").each(function(i) {
-
- if (!settings.disable_for_acidfree_gallery_lists || (!$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) {
- var orig_href = $(this).attr("href");
- var href = orig_href + "/lightframevideo";
- var title = $(this).attr("title");
- var title_link = "";
- if (link_text.length) {
- title_link = "<br /><a href=\"" + orig_href + "\" id=\"lightbox2-node-link-text\" "+ link_target +" >"+ link_text + "</a>";
- }
-
- $(this).attr({
- rel: rel,
- title: title + title_link,
- href: href
- });
- }
- });
-}
-
function lightbox2_image_nodes() {
-
var settings = Drupal.settings.lightbox2;
// Don't do it on the image assist popup selection screen.
@@ -251,15 +213,14 @@ function lightbox2_image_nodes() {
lightbox2_init_triggers(settings.trigger_slideshow_classes, "lightshow");
lightbox2_init_triggers(settings.trigger_lightframe_classes, "lightframe_ungrouped");
lightbox2_init_triggers(settings.trigger_lightframe_group_classes, "lightframe");
- if (settings.enable_acidfree_videos) {
- lightbox2_init_acidfree_video();
- }
-
}
}
-
-Drupal.behaviors.initAutoLightbox = function (context) {
- lightbox2_image_nodes();
+Drupal.behaviors.initAutoLightbox = {
+ attach: function(context, settings) {
+ lightbox2_image_nodes();
+ }
};
+//End jQuery block
+}(jQuery));
diff --git a/js/lightbox_modal.js b/js/lightbox_modal.js
index b9041a9..5010a43 100644
--- a/js/lightbox_modal.js
+++ b/js/lightbox_modal.js
@@ -1,7 +1,7 @@
-// $Id: lightbox_modal.js,v 1.1.2.5 2010/06/07 17:22:03 snpower Exp $
+(function ($) {
function lightbox2_login() {
- (function ($) {
+
$("a[href*='/user/login'], a[href*='?q=user/login']").each(function() {
$(this).attr({
href: this.href.replace(/user\/login?/,"user/login/lightbox2"),
@@ -9,11 +9,9 @@ function lightbox2_login() {
});
$(this).addClass('lightmodal-login');
});
- })(jQuery);
}
function lightbox2_contact() {
- (function ($) {
$("a[href$='/contact'], a[href$='?q=contact']").each(function() {
if (!this.href.match('admin/build/contact')) {
$(this).attr({
@@ -23,7 +21,6 @@ function lightbox2_contact() {
$(this).addClass('lightmodal-contact');
}
});
- })(jQuery);
}
Drupal.behaviors.initLightboxModal = {
@@ -36,4 +33,5 @@ Drupal.behaviors.initLightboxModal = {
}
}
};
-
+//End jQuery block
+}(jQuery));