MyBB-Plugins Forums

Full Version: How to integrate this!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
I need to integrate this javascript file with MyBB. (it uses jQuery)
When i try, i have a problem with moderation_inline.js because when I check the checkbox from showthread page nothing happen.
PHP Code:
//jQuery Translate plugin and related components


/*! 
 * jQuery nodesContainingText plugin 
 * 
 * Version: 1.1.2
 * 
 * http://code.google.com/p/jquery-translate/
 * 
 * Copyright (c) 2009 Balazs Endresz ([email protected])
 * Dual licensed under the MIT and GPL licenses.
 * 
 */
 
;(function($){

function 
Nct(){}

Nct.prototype = {
    
init: function(jqo){
        
this.textArray = [];
        
this.elements = [];
        
this.options o;
        
this.jquery jq;
        
this.= -1;
        if(
o.async === true)
            
o.async 2;
        
        if(
o.not){
            
jq jq.not(o.not);
            
jq jq.addjq.find("*").not(o.not) ).not( $(o.not).find("*") );
        }else
            
jq jq.addjq.find("*") );

        
this.jq jq;
        
this.jql this.jq.length;
        return 
this.process();

    },

    
process: function(){
        
this.n++;
        var 
that thisthis.optionstext ""hasTextNode false,
            
hasChildNode falseel this.jq[this.n], ecret;
        
        if(
this.=== this.jql){
            
ret this.jquery.pushStack(this.elements"nodesContainingText");
            
o.complete.call(retretthis.textArray);
            
            if(
o.returnAll === false && o.walk === false)
                return 
this.jquery;
            return 
ret;
        }
        
        if(!
el)
            return 
this.process();
        
e=$(el);

        var 
nodeName el.nodeName.toUpperCase(),
            
type nodeName === "INPUT" && $.attr(el"type").toLowerCase();
        
        if( ({
SCRIPT:1NOSCRIPT:1STYLE:1OBJECT:1IFRAME:1})[ nodeName ] )
            return 
this.process();
        
        if(
typeof o.subject === "string"){
            
text=e.attr(o.subject);
        }else{    
            if(
o.altAndVal && (nodeName === "IMG" || type === "image" ) )
                
text e.attr("alt");
            else if( 
o.altAndVal && ({text:1button:1submit:1})[ type ] )
                
text e.val();
            else if(
nodeName === "TEXTAREA")
                
text e.val();
            else{
                
//check childNodes:
                
el.firstChild;
                if(
o.walk !== true)
                    
hasChildNode true;
                else{
                    while(
c){
                        if(
c.nodeType == 1){
                            
hasChildNode true;
                            break;
                        }
                        
c=c.nextSibling;
                    }
                }

                if(!
hasChildNode)
                    
text e.text();
                else{
//check textNodes:
                    
if(o.walk !== true)
                        
hasTextNode true;
                    
                    
c=el.firstChild;
                    while(
c){
                        if(
c.nodeType == && c.nodeValue.match(/\S/) !== null){//textnodes with text
                            /*jslint skipLines*/
                            
if(c.nodeValue.match(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/) !== null){
                                if(
c.nodeValue.match(/(\S+(?=.*<))|(>(?=.*\S+))/) !== null){
                                    
hasTextNode true;
                                    break;
                                }
                            }else{
                                
hasTextNode true;
                                break;
                            }
                            
/*jslint skipLinesEnd*/
                        
}
                        
c.nextSibling;
                    }

                    if(
hasTextNode){//remove child nodes from jq
                        //remove scripts:
                        
text e.html();
                        
/*jslint skipLines*/
                        
text o.stripScripts text.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi"") : text;
                        
/*jslint skipLinesEnd*/
                        
this.jq this.jq.note.find("*") );
                    }
                }
            }
        }

        if(!
text)
            return 
this.process();
        
this.elements.push(el);
        
this.textArray.push(text);

        
o.each.call(elthis.elements.length 1eltext);
        
        if(
o.async){
            
setTimeout(function(){that.process();}, o.async);
            return 
this.jquery;
        }else
            return 
this.process();
        
    }
};

var 
defaults = {
    
not"",
    
asyncfalse,
    
each: function(){},
    
complete: function(){},
    
commentsfalse,
    
returnAlltrue,
    
walktrue,
    
altAndValfalse,
    
subjecttrue,
    
stripScriptstrue
};

$.
fn.nodesContainingText = function(o){
    
= $.extend({}, defaults, $.fn.nodesContainingText.defaultso);
    return new 
Nct().init(thiso);
};

$.
fn.nodesContainingText.defaults defaults;

})(
jQuery);

/*!
 * Textnode Translator
 * Ariel Flesler - http://flesler.blogspot.com/2008/05/textnode-translator-for-javascript.html
 */
//This is now only a placeholder, the original script has been modified 
//and the Translator class is no longer exposed

/*! 
 * jQuery Translate plugin 
 * 
 * Version: 1.4.7
 * 
 * http://code.google.com/p/jquery-translate/
 * 
 * Copyright (c) 2009 Balazs Endresz ([email protected])
 * Dual licensed under the MIT and GPL licenses.
 * 
 * This plugin uses the 'Google AJAX Language API' (http://code.google.com/apis/ajaxlanguage/)
 * You can read the terms of use at http://code.google.com/apis/ajaxlanguage/terms.html
 * 
 */
;(function($){
           
function 
$function(){}

var 
True trueFalse falseundefinedreplace "".replace,
    
Str StringFn = Function, Obj Object,
    
GLGLLtoLangCodeinverseLanguages = {},
    
loadingreadyList = [],
    
defaults = {
        
from"",
        
to"",
        
start$function,
        
error$function,
        
each$function,
        
complete$function,
        
onTimeout$function,
        
timeout0,
        
        
stripCommentsTrue,
        
stripWhitespaceTrue,
        
stripScriptsTrue,
        
separators: /\.\?\!;:/,
        
limit1750,
        

        
walkTrue,
        
returnAllFalse,
        
replaceTrue,
        
rebindTrue,
        
dataTrue,
        
setLangAttrFalse,
        
subjectTrue,
        
not"",
        
altAndVal:True,
        
asyncFalse,
        
toggleFalse,
        
fromOriginalTrue,
        
        
parallelfalse,
        
trimtrue,
        
alwaysReplacefalse
        
//,response: $function
        
    
};


function 
loaded(){
    $.
translate.GL GL google.language;
    $.
translate.GLL GLL GL.Languages;
    
toLangCode = $.translate.toLanguageCode;
    
    $.
each(GLL, function(llc){
        
inverseLanguageslc.toUpperCase() ] = l;
    });
    
    $.
translate.isReady True;
    var 
fn;
    while((
fn readyList.shift())) fn();
}

function 
filter(objfn){
    var 
newObj = {};
    $.
each(obj, function(langlangCode){
        if( 
fn(langCodelang) === TruenewObjlang ] = langCode;
    });
    return 
newObj;
}

function 
bind(fnthisObjargs){
    return function(){
        return 
fn.apply(thisObj === True arguments[0] : thisObjargs || arguments);
    };
}

function isSet(
e){
    return 
!== undefined;
}

function 
validate(_argsoverloaderror){
    var 
matchedobj = {}, args = $.grep(_args, isSet);
    
    $.
each(overload, function(_el){
        var 
matches = $.grep(el[0], function(ei){
                return isSet(
args[i]) && args[i].constructor === e;
            }).
length;
        if(
matches === args.length && matches === el[0].length && (matched True)){
            $.
each(el[1], function(iprop){
                
obj[prop] = args[i];
            });
            return 
False;
        }
    });
    
//TODO
    
if(!matched) throw error;
    return 
obj;
}


function 
getOpt(args0_defaults){
    
//args0=[].slice.call(args0, 0)
    
var args validate(args0 , $.translate.overload"jQuery.translate: Invalid arguments" ),
        
args.options || {};
    
delete args.options;
    
= $.extend({}, defaults_defaults, $.extend(oargs));
    
    if(
o.fromOriginalo.toggle True;
    if(
o.toggleo.data True;
    if(
o.async === Trueo.async 2;
    
    return 
o;
}


function 
T(){
    
//copy over static methods during each instantiation
    //for backward compatibility and access inside callback functions
    
this.extend($.translate);
    
delete this.defaults;
    
delete this.fn;
}

T.prototype = {
    
version"1.4.7",
    
    
_init: function(to){
        var 
separator o.separators.source || o.separators,
            
isString this.isString typeof t === "string",
            
lastpos 0substr;
        
        $.
each(["stripComments""stripScripts""stripWhitespace"], function(iname){
            var 
fn = $.translate[name];
            if( 
o[name] )
                
isString fn(t) : $.map(tfn);
        });

        
this.rawSource "<div>" + (isString t.join("</div><div>")) + "</div>";
        
this._m3 = new RegExp("[" separator "](?![^" separator "]*[" separator "])");
        
this.options o;
        
this.from o.from toLangCode(o.from) || "";
        
this.to o.to toLangCode(o.to) || "";
        
this.source t;
        
this.rawTranslation "";
        
this.translation = [];
        
this.0;
        
this.stopped False;
        
this.elements o.nodes;
        
        
//this._nres = 0;
        //this._progress = 0;
        
this._i = -1//TODO: rename
        
this.rawSources = [];
        
        while(
True){
            
substr this.truncatethis.rawSource.substr(lastpos), o.limit);
            if(!
substr) break;
            
this.rawSources.push(substr);
            
lastpos += substr.length;
        }
        
this.queue = new Array(this.rawSources.length);
        
this.done 0;
        
        
o.start.call(thiso.fromo.too);
        
        if(
o.timeout)
            
this.timeout setTimeout(bind(o.onTimeoutthis, [to.fromo.too]), o.timeout);
        
        (
o.toggle && o.nodes) ?    
            (
o.textNodes this._toggleTextNodes() : this._toggle()) : 
            
this._process();
    },
    
    
_process: function(){
        if(
this.stopped)
            return;
        var 
this.options,
            
this.rawTranslation.length,
            
lastpossubstdivstdivcl;
        var 
that this;
        
        while( (
lastpos this.rawTranslation.lastIndexOf("</div>"i)) > -1){

            
lastpos 1;
            
subst this.rawTranslation.substr(01);
            
/*jslint skipLines*/        
            
divst subst.match(/<div[> ]/gi);    
            
divcl subst.match(/<\/div>/gi);
            
/*jslint skipLinesEnd*/
            
            
divst divst divst.length 0;
            
divcl divcl divcl.length 0;
            
            if(
divst !== divcl 1) continue; //if there are some unclosed divs

            
var divscompl = $( this.rawTranslation.substr(07) ), 
                
divlen divscompl.length
                
this.i;
            
            if(
=== divlen) break; //if no new elements have been completely translated
            
            
divscompl.slice(ldivlen).eachbind(function(je){
                if(
this.stopped)
                    return 
False;
                var 
e_html = $(e).html(), tr o.trim ? $.trim(e_html) : e_html,
                    
jsrc this.source,
                    
from = !this.from && this.detectedSourceLanguage || this.from;
                
this.translation[i] = tr;//create an array for complete callback
                
this.isString this.translation tr src this.source[i];
                
                
o.each.call(thisitrsrcfromthis.too);
                
                
this.i++;
            }, 
this));
            
            break;
        }
        
        if(
this.rawSources.length == this._i)
            
this._complete();
        
        var 
_translate bind(this._translatethis);
        
        if(
o.parallel){
            if(
this._i 0){
                if(!
o.parallel){
                    $.
each(this.rawSources_translate);
                }else{
                    var 
0this.rawSources.length;
                    function 
seq(){
                        
_translate();
                        if(
n)
                            
setTimeoutseqo.parallel );
                    }
                    
seq();
                }
            }
        }else
            
_translate();
            
    },
    
    
_translate: function(){
        
this._i++;        
        var 
this._isrc this.rawSourceSub this.rawSources[i];
        if(!
src) return;
        
        
GL.translate(srcthis.fromthis.tobind(function(result){
            
//this._progress = 100 * (++this._nres) / this.rawSources.length;
            //this.options.response.call(this, this._progress, result);
            
if(result.error)
                return 
this.options.error.call(thisresult.errorthis.rawSourceSubthis.fromthis.tothis.options);
            
            
this.queue[i] = result.translation || this.rawSourceSub;
            
this.detectedSourceLanguage result.detectedSourceLanguage;
            
this._check();
        }, 
this));

    },
    
    
_check: function(){
        if(!
this.options.parallel){
            
this.rawTranslation += this.queue[this._i];
            
this._process();
            return;
        }
        
        var 
done 0;
        
jQuery.each(this.queue, function(in) {
            if (
!= undefineddone i;
            else return 
false;
        });            
        
        if ((
done this.done) || (done === this.queue.length 1)) {
            for(var 
0<= donei++)
                
this.rawTranslation += this.queue[i];
            
this._process();
        }
        
this.done done;
        
    },
    
    
_complete: function(){
        
clearTimeout(this.timeout);

        
this.options.complete.call(thisthis.translationthis.source
            !
this.from && this.detectedSourceLanguage || this.fromthis.tothis.options);
    },
    
    
stop: function(){
        if(
this.stopped)
            return 
this;
        
this.stopped True;
        
this.options.error.call(this, {message:"stopped"});
        return 
this;
    }
};



$.
translate = function(ta){
    if(
== undefined)
        return new 
T();
    if( $.
isFunction(t) )
        return $.
translate.ready(ta);
    var 
that = new T();
    
    var 
args = [].slice.call(arguments0);
    
args.shift();
    return $.
translate.readybind(that._initthat, [tgetOpt(args, $.translate.defaults)] ), Falsethat );
};


$.
translate.fn = $.translate.prototype T.prototype;

$.
translate.fn.extend = $.translate.extend = $.extend;


$.
translate.extend({
    
    
_bindbind,
    
    
_filterfilter,
    
    
_validatevalidate,
    
    
_getOptgetOpt,
    
    
_defaultsdefaults//base defaults used by other components as well //TODO
    
    
defaults: $.extend({}, defaults),
    
    
capitalize: function(t){ return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase(); },
    
    
truncate: function(textlimit){
        var 
im1m2m3m4tencoded encodeURIComponenttext );
        
        for(
010i++){
            try { 
                
decodeURIComponentencoded.substr(0limit i) );
            } catch(
e){ continue; }
            if(
t) break;
        }
        
        return ( !( 
m1 = /<(?![^<]*>)/.exec(t) ) ) ? (  //if no broken tag present
            
( !( m2 = />\s*$/.exec(t) ) ) ? (  //if doesn't end with '>'
                
m3 this._m3.exec(t) ) ? (  //if broken sentence present
                    
m4 = />(?![^>]*<)/.exec(t) ) ? ( 
                        
m3.index m4.index t.substring(0m3.index+1) : t.substring(0m4.index+1)
                    ) : 
t.substring(0m3.index+1) ) : ) : ) : t.substring(0m1.index);
    },

    
getLanguages: function(ab){
        if(
== undefined || (== undefined && !a))
            return 
GLL;
        
        var 
newObj = {}, typeof_a typeof a,
            
languages ? $.translate.getLanguages(a) : GLL,
            
filterArg = ( typeof_a  === "object" || typeof_a  === "function" ) ? b;
                
        if(
filterArg)
            if(
filterArg.call//if it's a filter function
                
newObj filter(languagesfilterArg);
            else 
//if it's an array of languages
                
for(var 0length filterArg.lengthlanglengthi++){
                    
lang = $.translate.toLanguage(filterArg[i]);
                    if(
languages[lang] != undefined)
                        
newObj[lang] = languages[lang];
                }
        else 
//if the first argument is true -> only translatable languages
            
newObj filter(GLLGL.isTranslatable);
        
        return 
newObj;
    },
    

    
toLanguage: function(aformat){
        var 
a.toUpperCase();
        var 
inverseLanguages[u] || 
            (
GLL[u] ? undefined) || 
            
inverseLanguages[($.translate.languageCodeMap[a.toLowerCase()]||"").toUpperCase()];
        return 
== undefined undefined :
            
format === "lowercase" l.toLowerCase() : format === "capitalize" ? $.translate.capitalize(l) : l;                
    },
    
    
toLanguageCode: function(a){
        return 
GLL[a] || 
            
GLL[ $.translate.toLanguage(a) ] || 
            $.
translate.languageCodeMap[a.toLowerCase()];
    },
        
    
same: function(ab){
        return 
=== || toLangCode(a) === toLangCode(b);
    },
        
    
isTranslatable: function(l){
        return 
GL.isTranslatabletoLangCode(l) );
    },

    
//keys must be lower case, and values must equal to a 
    //language code specified in the Language API
    
languageCodeMap: {
        
"pt""pt-PT",
        
"pt-br""pt-PT",        
        
"he""iw",
        
"zlm""ms",
        
"zh-hans""zh-CN",
        
"zh-hant""zh-TW"
        
//,"zh-sg":"zh-CN"
        //,"zh-hk":"zh-TW"
        //,"zh-mo":"zh-TW"
    
},
    
    
//use only language codes specified in the Language API
    
isRtl: {
        
"ar"True,
        
"iw"True,
        
"fa"True,
        
"ur"True,
        
"yi"True
    
},
    
    
getBranding: function(){
        return $( 
GL.getBranding.apply(GLarguments) );
    },
    
    
load: function(keyversion){
        
loading True;
        function 
_load(){ 
            
google.load("language"version || "1", {"callback" loaded});
        }
        
        if(
typeof google !== "undefined" && google.load)
            
_load();
        else
            $.
getScript(((document.location.protocol == "https:") ? "https://" "http://") +
                        
"www.google.com/jsapi" + (key "?key=" key ""), _load);
        return $.
translate;
    },
    
    
ready: function(fnpreventAutoloadthat){
        $.
translate.isReady fn() : readyList.push(fn);
        if(!
loading && !preventAutoload)
            $.
translate.load();
        return 
that || $.translate;
    },
    
    
isReadyFalse,
    
    
overload: [
        [[],[]],
        [[
StrStrObj],    ["from""to""options"]    ],
        [[
StrObj],         ["to""options"]            ],
        [[
Obj],             ["options"]                    ],
        [[
StrStr],         ["from""to"]                ],
        [[
Str],             ["to"]                        ],
        [[
StrStrFn],    ["from""to""complete"]    ],
        [[
StrFn],         ["to""complete"]            ]
         
//TODO
        //,[[Str, Str, Fn, Fn], ["from", "to", "each", "complete"]]
    
]
    
/*jslint skipLines*/
    
,
    
//jslint doesn't seem to be able to parse some regexes correctly if used on the server,
    //however it works fine if it's run on the command line: java -jar rhino.jar jslint.js file.js
    
stripScriptsbind(replaceTrue, [/<script[^>]*>([\s\S]*?)<\/script>/gi""]),
    
    
stripWhitespacebind(replaceTrue, [/\s\s+/g" "]),
    
    
stripCommentsbind(replaceTrue, [/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g""])
    
/*jslint skipLinesEnd*/
});


})(
jQuery);

/*!-
 * jQuery.fn.nodesContainingText adapter for the jQuery Translate plugin 
 * Version: 1.4.7
 * http://code.google.com/p/jquery-translate/
 */
;(function($){

var 
True true,
    
isInput = {text:Truebutton:Truesubmit:True},
    
dontCopyEvents = {SCRIPT:TrueNOSCRIPT:TrueSTYLE:TrueOBJECT:TrueIFRAME:True},
    
$fly = $([]);

$fly.length 1;

function 
getDoc(node){
    while (
node && node.nodeType != 9)
        
node node.parentNode;
    return 
node;
}

function 
toggleDir(edir){
    var 
align e.css("text-align");
    
e.css("direction"dir);
    if(
align === "right"e.css("text-align""left");
    if(
align === "left"e.css("text-align""right");
}

function 
getType(elo){
    var 
nodeName el.nodeName.toUpperCase(),
        
type nodeName === 'INPUT' && $.attr(el'type').toLowerCase();
    
|| {altAndVal:Truesubject:True};
    return 
typeof o.subject === "string" o.subject :
        
o.altAndVal && (nodeName === 'IMG' || type === "image" )  ? "alt" :
        
o.altAndVal && isInputtype ] ? "$val:
        
nodeName === "TEXTAREA" "$val"$html";
}

$.
translate.fn._toggle = function(){
    var 
this.optionsto o.tostop;
    
    
this.elements.each($.translate._bind(function(iel){
        
this.i;
        var 
= $(el), tr = $.translate.getData(etoo);
        
        if(!
tr) return !(stop True);
        
        
this.translation.push(tr);

        
o.each.call(thisieltrthis.source[i], this.fromtoo);
        
//'from' will be undefined if it wasn't set
    
}, this));
    
    !
stop this._complete() : this._process();
    
//o.complete.call(this, o.nodes, this.translation, this.source, this.from, this.to, o)
};



$.
translate.extend({
    
_getTypegetType,
    
    
each: function(ieltsfromtoo){
        
$fly[0] = el;
        $.
translate.setData($flytotfromso);
        $.
translate.replace($flyttoo);
        $.
translate.setLangAttr($flytoo);
    },
    
    
getData: function(elango){
        var 
el e[0] || edata = $.data(el"translation");
        return 
data && data[lang] && data[lang][ getType(elo) ];
    },
    
    
setData: function(etotfromso){
        if(
&& !o.data) return;
        
        var 
el e[0] || e,
            
type getType(elo),
            
data = $.data(el"translation");
        
        
data data || $.data(el"translation", {});
        (
data[from] = data[from] || {})[type] = s;
        (
data[to] = data[to] || {})[type] = t;
    },
    
    
    
replace: function(ettoo){
        
        if(
&& !o.replace) return;
        
        if(
&& typeof o.subject === "string")
            return 
e.attr(o.subjectt);

        var 
el e[0] || e
            
nodeName el.nodeName.toUpperCase(),
            
type nodeName === 'INPUT' && $.attr(el'type').toLowerCase(),
            
isRtl = $.translate.isRtl,
            
lang = $.data(el"lang");
        
        
//http://code.google.com/p/jquery-translate/issues/detail?id=38
        
if(!o.alwaysReplace)
            if( 
lang === to )
                return;
        
        if( 
isRtlto ] !== isRtllang || && o.from ] ){
            if( 
isRtlto ] )
                
toggleDir(e"rtl");
            else if( 
e.css("direction") === "rtl" )
                
toggleDir(e"ltr");
        }
        
        if( (!
|| o.altAndVal) && (nodeName === 'IMG' || type === "image" ) )
            
e.attr("alt"t);
        else if( 
nodeName === "TEXTAREA" || (!|| o.altAndVal) && isInputtype ] )
            
e.val(t);
        else{
            if(!
|| o.rebind){
                
this.doc this.doc || getDoc(el);
                var 
origContents e.find("*").not("script"),
                    
newElem = $(this.doc.createElement("div")).html(t);
                $.
translate.copyEventsorigContentsnewElem.find("*") );
                
e.htmlnewElem.contents() );
            }else
                
e.html(t);
        }
        
        
//used for determining if the text-align property should be changed,
        //it's much faster than setting the "lang" attribute, see bug #13
        
$.data(el"lang"to);
    },
    
    
setLangAttr: function(etoo){    
        if(!
|| o.setLangAttr)
            
e.attr((!|| o.setLangAttr === True) ? "lang" o.setLangAttrto);
    },
    
    
copyEvents: function(fromto){
        
to.each(function(ito_i){
            var 
from_i from[i];
            if( !
to_i || !from_i //in some rare cases the translated html structure can be slightly different
                
return false;
            if( 
dontCopyEventsfrom_i.nodeName.toUpperCase() ])
                return 
True;
            var 
events = $.data(from_i"events");
            if(!
events)
                return 
True;
            for(var 
type in events)
                for(var 
handler in events[type])
                    $.
event.add(to_itypeevents[type][handler], events[type][handler].data);
        });
    }
    
});


$.
fn.translate = function(abc){
    var 
= $.translate._getOpt(arguments, $.fn.translate.defaults),
        
ncto = $.extend( {}, $.translate._defaults, $.fn.translate.defaultso,
            { 
complete:function(e,t){$.translate(function(){
                
                var 
from = $.translate.toLanguageCode(o.from);

                if(
o.fromOriginal)
                    
e.each(function(iel){
                        
$fly[0] = el;
                        var 
data = $.translate.getData($flyfromo);
                        if( !
data ) return true;
                        
t[i] = data;
                    });
                
                
                var 
each o.each;
                
                function 
unshiftArgs(method){
                    return function(){
                        [].
unshift.call(argumentsthis.elements);
                        
method.apply(thisarguments);
                    };
                }
                
                
//TODO: set as instance property
                
o.nodes e;
                
o.start unshiftArgs(o.start);
                
o.onTimeout unshiftArgs(o.onTimeout);
                
o.complete unshiftArgs(o.complete);
                
                
o.each = function(i){
                    var 
args arguments;
                    if(
arguments.length !== 7//if isn't called from _toggle
                        
[].splice.call(args10this.elements[i]);
                    
this.each.apply(thisargs);
                    
each.apply(thisargs);
                };
                
                $.
translate(to);
                
            });},
            
            
each: function(){}
        });

    if(
this.nodesContainingText)
        return 
this.nodesContainingText(ncto);
    
    
//fallback if nodesContainingText method is not present:
    
o.nodes this;
    $.
translate($.map(this, function(e){ return $(e).html() || $(e).val(); }), o);
    return 
this;
};

$.
fn.translate.defaults = $.extend({}, $.translate._defaults);

})(
jQuery);

/*!-
 * TextNode Translator for the jQuery Translate plugin 
 * Version: 1.4.7
 * http://code.google.com/p/jquery-translate/
 */

;(function($){


function 
getTextNodesroot_filter ){

    var 
nodes = [],
        
skip = {SCRIPT:1NOSCRIPT:1STYLE:1IFRAME:1},
        
notType typeof _filter,
        
filter notType === "string" ? function(node){ return !$(node).is(_filter); } :
                 
notType === "function" _filter :  //e.g. function(node){ return node.nodeName != 'A'; }
                 
null;
    
    function 
recurse(_root){
        var 
0children root.childNodeschildren.lengthnode;
        for(; 
li++){
            
node children[i];
            
            if(
node.nodeType == && /\S/.test(node.nodeValue))
                
nodes.push(node);
            else if( 
node.nodeType == &&
                    !
skipnode.nodeName.toUpperCase() ] && 
                    (!
filter || filter(node)))
                
recurse(nullnode);
        }
    }
    
    $.
each((root.length && !root.nodeName) ? root : [root], recurse);

    return 
nodes;
}

function 
toggleDir(edir){
    var 
align e.css("text-align");
    
e.css("direction"dir);
    if(
align === "right"e.css("text-align""left");
    if(
align === "left"e.css("text-align""right");
}

function 
setLangAttr(etoo){    
    if(!
|| o.setLangAttr)
        $(
e).attr((!|| o.setLangAttr === true) ? "lang" o.setLangAttrto);
}
    
function 
replace(parentnodetexttoo){
    if(!
o.replace) return;
    var 
isRtl = $.translate.isRtl,
        
lang = $.data(parent"lang");
    
    if( 
isRtlto ] !== isRtllang || && o.from ] ){
        var 
$parent = $(parent);
        if( 
isRtlto ] )
            
toggleDir($parent"rtl");
        else if( 
$parent.css("direction") === "rtl" )
            
toggleDir($parent"ltr");
    }
    
    $.
data(parent"lang"to);
    
    if(
text != node.nodeValue){
        var 
newTextNode document.createTextNode(text);
        
parent.replaceChild(newTextNodenode);
        return 
newTextNode;
    }
    
    return 
node;
}

function 
setData(parentosrctrnsl){
    if(
o.data){
        var 
TR "translation";
        if(!$.
data(parentTR))
            $.
data(parentTR, {});
        
        if(!$.
data(parentTR)[o.from])
            $.
data(parentTR)[o.from] = [];
        [].
push.call($.data(parentTR)[o.from], src);    
        
        if(!$.
data(parentTR)[o.to])
            $.
data(parentTR)[o.to] = [];
        [].
push.call($.data(parentTR)[o.to], trnsl);    
    }
}

function 
getData(parentlangthat){
    
that._childIndex that._prevParent === parent that._childIndex 0;
    var 
tr = $.data(parent"translation");
    
that._prevParent parent;
    return 
tr && tr[lang] && tr[lang][that._childIndex];
    
}

function 
_each(itextNodetsfromtoo){
    
t.replace(/&lt;/g'<')
        .
replace(/&gt;/g'>')
        .
replace(/&amp;/g'&')
        .
replace(/&quot;/g'"')
        .
replace(/&#39;|&apos;/g, "'");
    
    
var parent textNode.parentNode;
    
setData(parentost);
    var 
newTextNode replace(parenttextNodettoo);
    
setLangAttr(parento.too);
    
    return 
newTextNode;
}

$.
translateTextNodes = function(root){ 
    var 
args = [].slice.call(arguments,0);
    
args.shift();
    
$.
translate(function(){
    var 
= $.translate._getOpt(args, $.translateTextNodes.defaults),
        
each o.each,
        
nodes getTextNodes(rooto.not),
        
contents = $.map(nodes, function(n){ return n.nodeValue; }),
        
from = $.translate.toLanguageCode(o.from),
        
obj = {};
    
    
o.nodes nodes;
    
o.textNodes true;
    
o.trim false;

    if(
o.fromOriginal)
        $.
each(nodes, function(itextNode){
            var 
data getData(textNode.parentNodefromobj);
            if( !
data ) return true;
            
contents[i] = data;
        });
    
    function 
unshiftArgs(method){
        return function(){
            [].
unshift.call(argumentsthis.elements);
            
method.apply(thisarguments);
        };
    }
    
    
o.start unshiftArgs(o.start);
    
o.onTimeout unshiftArgs(o.onTimeout);
    
o.complete unshiftArgs(o.complete);
    
    
o.each = function(i){
        var 
args arguments;
        if(
arguments.length !== 7//if isn't called from _toggle
            
[].splice.call(args10this.elements[i]);        
        
this.elements[i] = args[1] = _each.apply(thisargs);
        
        
each.apply(thisargs);
    };
    
    $.
translate(contentso);
    
});
};

$.
translate.fn._toggleTextNodes = function(){
    var 
this.optionsto o.tostop;
    
    $.
each(this.elements, $.translate._bind(function(itextNode){
        
this.i;
        var 
parent textNode.parentNode
            
tr getData(parenttothis);
        
        if(!
tr) return !(stop true);
        
        
this.translation.push(tr);
        
        
o.each.call(thisitextNodetrthis.source[i], this.fromtoo);
        
//'from' will be undefined if it wasn't set
    
}, this));
    
    !
stop this._complete() : this._process();
    
//o.complete.call(this, this.elements, this.translation, this.source, this.from, this.to, o);
};

$.
fn.translateTextNodes = function(abc){
    [].
unshift.call(argumentsthis);
    $.
translateTextNodes.apply(nullarguments);
    return 
this;
};

$.
translateTextNodes.defaults = $.fn.translateTextNodes.defaults = $.extend({}, $.translate._defaults);


})(
jQuery);

/*!-
 * Simple user interface extension for the jQuery Translate plugin 
 * Version: 1.4.7
 * http://code.google.com/p/jquery-translate/
 */
;(function($){

var 
defaults = {
    
tags: ["select""option"],
    
filter: $.translate.isTranslatable,
    
label: $.translate.toNativeLanguage || 
        function(
langCodelang){
            return $.
translate.capitalize(lang);
        },
    
includeUnknownfalse
};

$.
translate.ui = function(){
    var 
= {}, str=''cs=''cl='';
    
    if(
typeof arguments[0] === "string")
        
o.tags = $.makeArray(arguments);
    else 
arguments[0];
    
    
= $.extend({}, defaults, $.translate.ui.defaultso);
        
    if(
o.tags[2]){
        
cs '<' o.tags[2] + '>';
        
cl '</' o.tags[2] + '>';
    }
    
    var 
languages = $.translate.getLanguages(o.filter);
    if(!
o.includeUnknowndelete languages.UNKNOWN;
    
    $.
eachlanguages, function(llc){
        
str += ('<' o.tags[1] + " value=" lc '>' cs +
            
//$.translate.capitalize(l) + " - " + 
            
o.label(lcl) +
            
cl '</' o.tags[1] + '>');
    });

    return $(
'<' o.tags[0] + ' class="jq-translate-ui">' str '</' o.tags[0] + '>');

};

$.
translate.ui.defaults = $.extend({}, defaults);


})(
jQuery);

/*!-
 * Native language names extension for the jQuery Translate plugin 
 * Version: 1.4.7
 * http://code.google.com/p/jquery-translate/
 */
;(function($){
$.
translate.extend({

    
toNativeLanguage: function(lang){ 
        return $.
translate.nativeLanguageslang ] || 
            $.
translate.nativeLanguages[ $.translate.toLanguageCode(lang) ];
    },
    
    
nativeLanguages: {
        
"af":"Afrikaans",
        
"be":"Беларуская",
        
"is":"Íslenska",
        
"ga":"Gaeilge",
        
"mk":"Македонски",
        
"ms":"Bahasa Melayu",
        
"sw":"Kiswahili",
        
"cy":"Cymraeg",
        
"yi":"ייִדיש",
        
        
"sq":"Shqipe",
        
"ar":"العربية",
        
"bg":"Български",
        
"ca":"Català",
        
"zh":"中文",
        
"zh-CN":"简体中文",
        
"zh-TW":"繁體中文",
        
"hr":"Hrvatski",
        
"cs":"Čeština",
        
"da":"Dansk",
        
"nl":"Nederlands",
        
"en":"English",
        
"et":"Eesti",
        
"tl":"Tagalog",
        
"fi":"Suomi",
        
"fr":"Français",
        
"gl":"Galego",
        
"de":"Deutsch",
        
"el":"Ελληνικά",
        
"iw":"עברית",
        
"hi":"हिन्दी",
        
"hu":"Magyar",
        
"id":"Bahasa Indonesia",
        
"it":"Italiano",
        
"ja":"日本語",
        
"ko":"한국어",
        
"lv":"Latviešu",
        
"lt":"Lietuvių",
        
"mt":"Malti",
        
"no":"Norsk",
        
"fa":"فارسی",
        
"pl":"Polski",
        
"pt-PT":"Português",
        
"ro":"Român",
        
"ru":"Русский",
        
"sr":"Српски",
        
"sk":"Slovenský",
        
"sl":"Slovenski",
        
"es":"Español",
        
"sv":"Svenska",
        
"th":"ไทย",
        
"tr":"Türkçe",
        
"uk":"Українська",
        
"vi":"Tiếng Việt"
    
}

});

})(
jQuery); 
I read that it is a problem , a conflict between Prototype and jQuery but i don`t know how to solve it without replace "$" with "jQuery".

No Permission

Unfortunately you do not have sufficient rights to view replies in this thread.