Slimbox: Multilingual

Version für MooTools V1.2.x

Datei: template/lib/slimbox/slimbox.mootools-1.2.js

In neueren CMS-Versionen: /template/lib/slimbox/slimbox.mootools-1.2.js

Diese Sequenz

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
    $$("a").filter(function(el) {
        return el.rel && el.rel.test(/^lightbox/i);
    }).slimbox({/* Put custom options here */}, null, function(el) {
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
};

wird ersetzt durch

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
    // OG: enhanced for translated image cpations
    var bLang=navigator.language?navigator.language:navigator.userLanguage;
    if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';}
    var cText="Image {x} of {y}";
    switch(bLang) {
        case 'de':    cText = "Bild {x} von {y}"; break;
        case 'es':    cText = "Imagen {x} de {y}"; break;
        case 'fr':    cText = "Image {x} de {y}"; break;
        case 'nl':    cText = "Afbeelding {x} van {y}"; break;
        case 'da':    cText = "billede {x} fra {y}"; break;
    }
    // OG: end enhancement
 
    $$("a").filter(function(el) {
        return el.rel && el.rel.test(/^lightbox/i);
    }).slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) {
        // OG: sorry I am too stupid to find the correct var,
        // so use "brute force method" to inject the class name
        $("lbCloseLink").className="lbCloseLink-"+bLang;
        $("lbNextLink").className="lbNextLink-"+bLang;
        $("lbPrevLink").className="lbPrevLink-"+bLang;
 
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
};


Mit den generierten Klassen:

class="lbCloseLink-XX"
class="lbNextLink-XX"
class="lbPrevLink-XX"

Wobei "XX" der Länderkennung in "bLang" entspricht. Z.B. bei "de" ⇒ class="lbCloseLink-de"


Version für MooTools V1.1.x

Datei: template/lib/slimbox/slimbox.mootools-1.1.js

In neueren CMS-Versionen: /template/lib/slimbox/slimbox.mootools-1.1.js

Diese Sequenz

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
    $$($$("a").filter(function(el) {
        return el.rel && el.rel.test(/^lightbox/i);
    })).slimbox({/* Put custom options here */}, null, function(el) {
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
};

wird ersetzt durch

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
    // OG: enhanced for translated image cpations
    var bLang=navigator.language?navigator.language:navigator.userLanguage;
    if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';}
    var cText="Image {x} of {y}";
    switch(bLang) {
        case 'de':    cText = "Bild {x} von {y}"; break;
        case 'es':    cText = "Imagen {x} de {y}"; break;
        case 'fr':    cText = "Image {x} de {y}"; break;
        case 'nl':    cText = "Afbeelding {x} van {y}"; break;
        case 'da':    cText = "billede {x} fra {y}"; break;
    }
    // OG: end enhancement
 
    $$($$("a").filter(function(el) {
        return el.rel && el.rel.test(/^lightbox/i);
    })).slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) {
        // OG: sorry I am too stupid to find the correct var,
        // so use "brute force method" to inject the class name
        $("lbCloseLink").className="lbCloseLink-"+bLang;
        $("lbNextLink").className="lbNextLink-"+bLang;
        $("lbPrevLink").className="lbPrevLink-"+bLang;
 
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
};


Mit den generierten Klassen:

class="lbCloseLink-XX"
class="lbNextLink-XX"
class="lbPrevLink-XX"

Wobei "XX" der Länderkennung in "bLang" entspricht. Z.B. bei "de" ⇒ class="lbCloseLink-de"


Version für jQuery V1.X.x

Datei: template/lib/slimbox/slimbox.jquery.js

In neueren CMS-Versionen: /template/lib/slimboxslimbox.jquery.js

Diese Sequenz

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
if (!/series60|symbian|windows ce/i.test(navigator.userAgent)) {
    jQuery(function($) {
        $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
            return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
        });
    });
}

wird ersetzt durch

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
if (!/series60|symbian|windows ce/i.test(navigator.userAgent)) {
 
        // OG: enhanced for translated image cpations
    var bLang=navigator.language?navigator.language:navigator.userLanguage;
    if(bLang){bLang=bLang.substr(0,2);bLang=bLang.toLowerCase();}else{bLang = 'en';}
    var cText="Image {x} of {y}";
    switch(bLang) {
        case 'de':    cText = "Bild {x} von {y}"; break;
        case 'es':    cText = "Imagen {x} de {y}"; break;
        case 'fr':    cText = "Image {x} de {y}"; break;
        case 'nl':    cText = "Afbeelding {x} van {y}"; break;
        case 'da':    cText = "billede {x} fra {y}"; break;
    }
    // OG: end enhancement
 
 
    jQuery(function($) {
        $("a[rel^='lightbox']").slimbox({counterText: cText, cLang: bLang /* Put custom options here */}, null, function(el) {
 
        // OG: sorry I am too stupid to find the correct var,
        // so use "brute force method" to inject the class name
        $("#lbCloseLink").addClass("lbCloseLink-"+bLang);
        $("#lbNextLink").addClass("lbNextLink-"+bLang);
        $("#lbPrevLink").addClass("lbPrevLink-"+bLang);
 
            return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
        });
    });
}


Mit den generierten Klassen:

class="lbCloseLink-XX"
class="lbNextLink-XX"
class="lbPrevLink-XX"

Wobei "XX" der Länderkennung in "bLang" entspricht. Z.B. bei "de" ⇒ class="lbCloseLink-de"

Die Klassen und IDs sind in der CSS-Datei template/lib/slimbox/slimbox.css zu finden.


deutsch/andere-erweiterungen/hacks/slimbox-de.txt · Last modified: 2012/09/03 09:37 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0