Vorlage:FlogrThumbs: Unterschied zwischen den Versionen

Aus RTW

(using global lightboxOptions)
(making work for multiple sets on one page)
Zeile 1: Zeile 1:
 
<html>
 
<html>
<div id="flogrthumb_container" class="flogrthumb"></div>
+
<div id="flogrthumb_container</html>{{{1}}}<html>" class="flogrthumb"></div>
 
<script type="text/javascript">
 
<script type="text/javascript">
 
jQuery(document).ready(function() {
 
jQuery(document).ready(function() {
jQuery('#flogrthumb_container').addClass('initialized loading');
+
var flogrthumbId = '</html>{{{1}}}<html>'; // in var for readability
 +
var flogrthumbDomId = '#flogrthumb_container' + flogrthumbId;
 +
jQuery(flogrthumbDomId).addClass('initialized loading');
 
var amp = String.fromCharCode(38); // wiki escapes ampersands
 
var amp = String.fromCharCode(38); // wiki escapes ampersands
var url = '/extensions/flogr/?type=sets'+amp+'setId=</html>{{{1}}}<html>';
+
var url = '/extensions/flogr/?type=sets' + amp + 'setId=' + flogrthumbId;
 
jQuery.get(url, function(data) {
 
jQuery.get(url, function(data) {
 
var res = data.match(/.*<div id=['"]thumbnail_container['"]>([\s\S]+?)<\/div>.*/ig);
 
var res = data.match(/.*<div id=['"]thumbnail_container['"]>([\s\S]+?)<\/div>.*/ig);
jQuery('#flogrthumb_container').removeClass('loading').html(res[0]);
+
jQuery(flogrthumbDomId).removeClass('loading').html(res[0]);
jQuery('#flogrthumb_container a').attr('rel', 'lightbox[</html>{{{1}}}<html>]');
+
jQuery(flogrthumbDomId + ' a').attr('rel', 'lightbox[' + flogrthumbId + ']');
jQuery('#flogrthumb_container a').lightBox(lightboxOptions);
+
jQueryflogrthumbDomId + ' a').lightBox(lightboxOptions);
 
});
 
});
 
});
 
});
 
</script>
 
</script>
 
</html>
 
</html>

Version vom 24. Oktober 2011, 10:34 Uhr