Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make package work with plone.app.imaging approach

  • Loading branch information...
commit 2f80d2c0cf667479f2734848ad4893e7389f47fe 1 parent 0ec9360
@vipod vipod authored
Showing with 17 additions and 4 deletions.
  1. +17 −4 collective/imageinbox/browser/js/collective.imageinbox.js
View
21 collective/imageinbox/browser/js/collective.imageinbox.js
@@ -3,15 +3,21 @@ var dummy = function($) {
function attachThickboxesToBodyImages() {
// attach thickbox to every image in body text
// skip <img class="noThickBox" /> elements
- $('#content img[class!="noThickBox"]').each(function(idx, el) {
+ $('#content img').each(function(idx, el) {
var img = $(el);
+ // skipp noThickBox images
+ if (img.hasClass('noThickBox')) {
+ return;
+ }
+
// attach thickbox if image tag is wrapped by "a" tag with href ending
// with '/image_fullscreen' url or there is 'image_' line inside image's tag
// src attribute
var a = img.parent('[href$=/image_view_fullscreen]');
- if (a.length > 0 || img.attr('src').match(/\/image_.+$/)) {
-
+ var src = img.attr('src');
+ if (a.length > 0 || src.match(/\/image_.+$/) ||
+ src.match(/\/\@\@images\/.+?\/.+$/)) {
// add cursor pointer to standalone images
if (a.length == 0) {
img.css('cursor', 'pointer');
@@ -25,6 +31,14 @@ function attachThickboxesToBodyImages() {
'urlmatch': '/image_view_fullscreen$',
'urlreplace': ''
});
+ } else if (src.match(/\/\@\@images\/.+?\/.+$/)) {
+ var match = src.match(/\/\@\@images\/(.+?)\/(.+)$/);
+ // main content body images inserted via Kupu or TinyMCE editors
+ img.prepOverlay({
+ 'subtype': 'image',
+ 'urlmatch': '/@@images/.+$',
+ 'urlreplace': '/'+match[1]
+ });
} else {
// main content body images inserted via Kupu or TinyMCE editors
img.prepOverlay({
@@ -33,7 +47,6 @@ function attachThickboxesToBodyImages() {
'urlreplace': ''
});
}
-
}
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.