Changeset 376 for trunk


Ignore:
Timestamp:
02/02/2010 12:06:00 PM (2 years ago)
Author:
ofer
Message:

Adhere to  http://www.whatwg.org/specs/web-apps/current-work/#custom-data-attribute by renaming our private properties with the data- prefix

Location:
trunk/WordPress/plugin/transposh
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/core/parser.php

    r361 r376  
    421421        // Use base64 encoding to make that when the page is translated (i.e. update_translation) we 
    422422        // get back exactlly the same string without having the client decode/encode it in anyway. 
    423         $span = '<span class ="'.SPAN_PREFIX.'" id="'.SPAN_PREFIX.$this->segment_id.'" token="' . base64_url_encode($original_text)."\" source=\"$source\""; 
     423        $span = '<span class ="'.SPAN_PREFIX.'" id="'.SPAN_PREFIX.$this->segment_id.'" data-token="' . base64_url_encode($original_text)."\" data-source=\"$source\""; 
    424424        // those are needed for on the fly image creation / hidden elements translations 
    425425        if ($this->is_edit_mode || $for_hidden_element) { 
    426             $span .= " orig=\"$original_text\""; 
     426            $span .= " data-orig=\"$original_text\""; 
    427427            if ($for_hidden_element) { 
    428                 $span.= ' hidden="y"'; 
     428                $span.= ' data-hidden="y"'; 
    429429                // hidden elements currently have issues figuring what they translated in the JS 
    430430                if ($translated_text != null) { 
    431                     $span.= " trans=\"$translated_text\""; 
     431                    $span.= " data-trans=\"$translated_text\""; 
    432432                } 
    433433            } 
  • trunk/WordPress/plugin/transposh/js/transposh.js

    r373 r376  
    4848            var img_segment_id = $(this).attr('id').substr($(this).attr('id').lastIndexOf('_') + 1), 
    4949            img = $("#" + t_jp_prefix + "img_" + img_segment_id); 
    50             $("#" + t_jp_prefix + img_segment_id).attr('source', 1); // source is 1 
     50            $("#" + t_jp_prefix + img_segment_id).attr('data-source', 1); // source is 1 
    5151            img.removeClass('tr-icon-yellow').removeClass('tr-icon-green').addClass('tr-icon-yellow'); 
    5252        }; 
    5353 
    5454        // rewrite text for all matching items at once 
    55         $("*[token='" + token + "'][hidden!='y']") 
     55        $("*[data-token='" + token + "'][data-hidden!='y']") 
    5656        .html(translation) 
    5757        .each(fix_image); 
    5858 
    5959        // TODO - FIX hidden elements too (need to update father's title) 
    60         $("*[token='" + token + "'][hidden='y']") 
    61         .attr('trans', translation) 
     60        $("*[data-token='" + token + "'][data-hidden='y']") 
     61        .attr('data-trans', translation) 
    6262        .each(fix_image); 
    6363    } 
     
    9292                // We are pre-accounting the progress bar here - which is not very nice 
    9393                //if (source > 0) { 
    94                 done_posted += $("*[token='" + tokens[i] + "']").size(); 
     94                done_posted += $("*[data-token='" + tokens[i] + "']").size(); 
    9595            //} 
    9696            } 
     
    137137        // auto_translated_previously... 
    138138        var auto_translated_phrases = [], binglang = t_jp.lang; 
    139         $("." + t_jp_prefix + '[source=""]').each(function (i) { 
     139        $("." + t_jp_prefix + '[data-source=""]').each(function (i) { 
    140140            // not needed! 
    141141            //var translated_id = $(this).attr('id'), 
    142             var token = $(this).attr('token'), 
     142            var token = $(this).attr('data-token'), 
    143143            //alert(translated_id); 
    144144            // we only have orig if we have some translation,? 
    145             to_trans = $(this).attr('orig'); 
     145            to_trans = $(this).attr('data-orig'); 
    146146            if (to_trans === undefined) { 
    147147                to_trans = $(this).html(); 
     
    159159                        Microsoft.Translator.translate(to_trans, "", binglang, function (translation) { 
    160160                            ajax_translate(token, $("<div>" + translation + "</div>").text()); 
    161                             make_progress(progressbar_id, (possibly_translateable - $("." + t_jp_prefix + '[source=""]').size()) / possibly_translateable * 100); 
     161                            make_progress(progressbar_id, (possibly_translateable - $("." + t_jp_prefix + '[data-source=""]').size()) / possibly_translateable * 100); 
    162162                            //$('#' + progressbar_id).progressbar('value', (possibly_translateable - $("." + t_jp_prefix + '[source=""]').size()) / possibly_translateable * 100); 
    163163                        }); 
     
    177177                            //fix_page($("<div>" + result.translation + "</div>").text(), 1, segment_id); 
    178178                            // ???? 
    179                             //to_trans = $(this).attr('orig'); 
     179                            //to_trans = $(this).attr('data-orig'); 
    180180                            ajax_translate(token, $("<div>" + result.translation + "</div>").text()); 
    181181                            // update the regular progress bar 
    182182                            // done = possibly_translateable - $("." + t_jp_prefix + '[source=""]').size(); 
    183                             make_progress(progressbar_id, (possibly_translateable - $("." + t_jp_prefix + '[source=""]').size()) / possibly_translateable * 100); 
     183                            make_progress(progressbar_id, (possibly_translateable - $("." + t_jp_prefix + '[data-source=""]').size()) / possibly_translateable * 100); 
    184184                            //$('#' + progressbar_id).progressbar('value', (possibly_translateable - $("." + t_jp_prefix + '[source=""]').size()) / possibly_translateable * 100); 
    185185                        } 
     
    231231            //if (translationstats !== undefined) { 
    232232            //possibly_translateable = (translationstats.total_phrases - translationstats.translated_phrases - (translationstats.meta_phrases - translationstats.meta_translated_phrases)); 
    233             possibly_translateable = $("." + t_jp_prefix + '[source=""]').size(); 
     233            possibly_translateable = $("." + t_jp_prefix + '[data-source=""]').size(); 
    234234 
    235235            now = new Date(); 
  • trunk/WordPress/plugin/transposh/js/transposhedit.js

    r370 r376  
    1616 */ 
    1717// source - 0 is human, 1 is gt - 2 and higher reserved for future engines 
    18 /*global Date, Math, Microsoft, alert, clearTimeout, document, google, jQuery, setTimeout, t_jp, window */ 
     18/*global Date, Math, Microsoft, alert, clearTimeout, document, google, $, setTimeout, t_jp, window */ 
    1919// fetch translation from google translate... 
    20 (function () { // closure 
     20(function ($) { // closure 
    2121    var loadLang, langLoaded; 
    2222    //google_langs = 'af|sq|ar|be|bg|ca|zh|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt-PT|ro|ru|sr|sk|sl|es|sw|sv|tl|th|tr|uk|vi|cy|yi|he|zh-tw|pt', 
     
    2727        //reset to the original content - the unescaped version if translation is empty 
    2828        // TODO! 
    29         if (jQuery.trim(translation).length === 0) { 
    30             translation = jQuery("[token='" + token + "']").attr('orig'); 
     29        if ($.trim(translation).length === 0) { 
     30            translation = $("[data-token='" + token + "']").attr('data-orig'); 
    3131        } 
    3232 
    3333        var fix_image = function () { // handle the image changes 
    34             var img_segment_id = jQuery(this).attr('id').substr(jQuery(this).attr('id').lastIndexOf('_') + 1), 
    35             img = jQuery("#" + t_jp.prefix + "img_" + img_segment_id); 
    36             jQuery("#" + t_jp.prefix + img_segment_id).attr('source', 0); // source is 0 human 
     34            var img_segment_id = $(this).attr('id').substr($(this).attr('id').lastIndexOf('_') + 1), 
     35            img = $("#" + t_jp.prefix + "img_" + img_segment_id); 
     36            $("#" + t_jp.prefix + img_segment_id).attr('data-source', 0); // source is 0 human 
    3737            img.removeClass('tr-icon-yellow').removeClass('tr-icon-green').addClass('tr-icon-green'); 
    38         // TODO if (jQuery.trim(translation).length !== 0) { remove green on zero length? 
     38        // TODO if ($.trim(translation).length !== 0) { remove green on zero length? 
    3939 
    4040        }; 
    4141        // rewrite text for all matching items at once 
    42         jQuery("*[token='" + token + "'][hidden!='y']") 
     42        $("*[data-token='" + token + "'][data-hidden!='y']") 
    4343        .html(translation) 
    4444        .each(fix_image); 
    4545 
    4646        // FIX hidden elements too (need to update father's title) 
    47         jQuery("*[token='" + token + "'][hidden='y']") 
    48         .attr('trans', translation) 
     47        $("*[data-token='" + token + "'][data-hidden='y']") 
     48        .attr('data-trans', translation) 
    4949        .each(fix_image); 
    5050    } 
     
    6565        // We are pre-accounting the progress bar here - which is not very nice 
    6666        /*TODO think!!!! if (source > 0) { 
    67             done_p += jQuery("*[token='" + token + "']").size(); 
     67            done_p += $("*[token='" + token + "']").size(); 
    6868        }*/ 
    69         jQuery.ajax({ 
     69        $.ajax({ 
    7070            type: "POST", 
    7171            url: t_jp.post_url, 
     
    7575            /* THINK if (t_jp.progress) { 
    7676                    if (togo > 4 && source > 0) { 
    77                         jQuery("#progress_bar2").progressbar('value', done_p / togo * 100); 
     77                        $("#progress_bar2").progressbar('value', done_p / togo * 100); 
    7878                    } 
    7979 
     
    9898                getgt(); 
    9999            }; 
    100             jQuery.xLazyLoader({ 
     100            $.xLazyLoader({ 
    101101                //                js: 'http://www.google.com/jsapi?callback=loadLang' 
    102102                js: 'http://www.google.com/jsapi', 
     
    104104            }); 
    105105        } else { 
    106             jQuery(":button:contains('Suggest - Google')").attr("disabled", "disabled").addClass("ui-state-disabled"); 
    107             google.language.translate(jQuery("#" + t_jp.prefix + "original").val(), "", t_jp.lang, function (result) { 
     106            $(":button:contains('Suggest - Google')").attr("disabled", "disabled").addClass("ui-state-disabled"); 
     107            google.language.translate($("#" + t_jp.prefix + "original").val(), "", t_jp.lang, function (result) { 
    108108                if (!result.error) { 
    109                     jQuery("#" + t_jp.prefix + "translation").val(jQuery("<div>" + result.translation + "</div>").text()) 
     109                    $("#" + t_jp.prefix + "translation").val($("<div>" + result.translation + "</div>").text()) 
    110110                    .keyup(); 
    111111                } 
     
    118118    { 
    119119        if (typeof Microsoft === 'undefined') { 
    120             jQuery.xLazyLoader({ 
     120            $.xLazyLoader({ 
    121121                js: 'http://api.microsofttranslator.com/V1/Ajax.svc/Embed?appId=' + t_jp.msnkey, 
    122122                success: function () { 
     
    126126 
    127127        } else { 
    128             jQuery(":button:contains('Suggest - Bing')").attr("disabled", "disabled").addClass("ui-state-disabled"); 
     128            $(":button:contains('Suggest - Bing')").attr("disabled", "disabled").addClass("ui-state-disabled"); 
    129129            var binglang = t_jp.lang; 
    130130            if (binglang === 'zh') { 
     
    135135            } 
    136136            try { 
    137                 Microsoft.Translator.translate(jQuery("#" + t_jp.prefix + "original").val(), "", binglang, function (translation) { 
    138                     jQuery("#" + t_jp.prefix + "translation").val(jQuery("<div>" + translation + "</div>").text()) 
     137                Microsoft.Translator.translate($("#" + t_jp.prefix + "original").val(), "", binglang, function (translation) { 
     138                    $("#" + t_jp.prefix + "translation").val($("<div>" + translation + "</div>").text()) 
    139139                    .keyup(); 
    140140                }); 
     
    147147 
    148148    function confirm_close() { 
    149         jQuery('<div id="dial" title="Close without saving?"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>You have made a change to the translation. Are you sure you want to discard it?</p></div>').appendTo("body").dialog({ 
     149        $('<div id="dial" title="Close without saving?"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>You have made a change to the translation. Are you sure you want to discard it?</p></div>').appendTo("body").dialog({ 
    150150            bgiframe: true, 
    151151            resizable: false, 
     
    158158            buttons: { 
    159159                'Discard': function () { 
    160                     jQuery("#" + t_jp.prefix + "translation").data("edit", { 
     160                    $("#" + t_jp.prefix + "translation").data("edit", { 
    161161                        changed: false 
    162162                    }); 
    163                     jQuery(this).dialog('close'); 
    164                     jQuery("#" + t_jp.prefix + "d-tabs").dialog('close'); 
     163                    $(this).dialog('close'); 
     164                    $("#" + t_jp.prefix + "d-tabs").dialog('close'); 
    165165                }, 
    166166                Cancel: function () { 
    167                     jQuery(this).dialog('close'); 
     167                    $(this).dialog('close'); 
    168168                } 
    169169            } 
     
    197197            },*/ 
    198198        tButtons.Ok = function () { 
    199             var translation = jQuery('#' + t_jp.prefix + 'translation').val(), 
    200             token = jQuery("#" + t_jp.prefix + segment_id).attr('token'); 
    201             if (jQuery('#' + t_jp.prefix + 'translation').data("edit").changed) { 
     199            var translation = $('#' + t_jp.prefix + 'translation').val(), 
     200            token = $("#" + t_jp.prefix + segment_id).attr('data-token'); 
     201            if ($('#' + t_jp.prefix + 'translation').data("edit").changed) { 
    202202                ajax_translate_human(token, translation); 
    203                 jQuery("#" + t_jp.prefix + "translation").data("edit", { 
     203                $("#" + t_jp.prefix + "translation").data("edit", { 
    204204                    changed: false 
    205205                }); 
    206206            } 
    207             jQuery(this).dialog('close'); 
     207            $(this).dialog('close'); 
    208208        }; 
    209209        //tButtons["beep"] = function () {alert(Microsoft.Translator.GetLanguages())}; 
    210210        hButtons = { 
    211211            Close: function () { 
    212                 jQuery(this).dialog('close'); 
     212                $(this).dialog('close'); 
    213213            } 
    214214        }; 
    215215 
    216         jQuery("#" + t_jp.prefix + "d-tabs").remove(); 
    217         jQuery('<div id="' + t_jp.prefix + 'd-tabs" title="Edit Translation"/>').appendTo("body"); 
    218         jQuery("#" + t_jp.prefix + "d-tabs").append('<ul/>').tabs({ 
     216        $("#" + t_jp.prefix + "d-tabs").remove(); 
     217        $('<div id="' + t_jp.prefix + 'd-tabs" title="Edit Translation"/>').appendTo("body"); 
     218        $("#" + t_jp.prefix + "d-tabs").append('<ul/>').tabs({ 
    219219            cache: true 
    220220        }) 
    221221        .tabs('add', "#" + t_jp.prefix + "d-tabs-1", 'Translate') 
    222         .tabs('add', t_jp.post_url + '?tr_token_hist=' + jQuery("#" + t_jp.prefix + segment_id).attr('token') + '&lang=' + t_jp.lang, 'History') 
     222        .tabs('add', t_jp.post_url + '?tr_token_hist=' + $("#" + t_jp.prefix + segment_id).attr('data-token') + '&lang=' + t_jp.lang, 'History') 
    223223        .css("text-align", "left") 
    224224        .css("padding", 0) 
    225225        .bind('tabsload', function (event, ui) { 
    226226            //TODO, formatting here, not server side 
    227             jQuery("table", ui.panel).addClass("ui-widget ui-widget-content").css({ 
     227            $("table", ui.panel).addClass("ui-widget ui-widget-content").css({ 
    228228                'width' : '95%', 
    229229                'padding' : '0' 
    230230            }); 
    231             //jQuery("table thead th:last",ui.panel).after("<th/>"); 
    232             jQuery("table thead tr", ui.panel).addClass("ui-widget-header"); 
    233             //jQuery("table tbody tr", ui.panel).append('<td/>'); 
    234             jQuery("table tbody td[source='2']", ui.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>'); 
    235             jQuery("table tbody td[source='1']", ui.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>'); 
    236             jQuery("table tbody td[source='0']", ui.panel).append('<span title="human" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-person"></span>'); 
    237         //jQuery("table tbody tr:first td:last", ui.panel).append('<span title="remove this translation" id="' + t_jp.prefix + 'revert" style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-scissors"/>'); 
    238         //jQuery("#" + t_jp.prefix + "revert").click(function () { 
     231            //$("table thead th:last",ui.panel).after("<th/>"); 
     232            $("table thead tr", ui.panel).addClass("ui-widget-header"); 
     233            //$("table tbody tr", ui.panel).append('<td/>'); 
     234            $("table tbody td[source='2']", ui.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>'); 
     235            $("table tbody td[source='1']", ui.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>'); 
     236            $("table tbody td[source='0']", ui.panel).append('<span title="human" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-person"></span>'); 
     237        //$("table tbody tr:first td:last", ui.panel).append('<span title="remove this translation" id="' + t_jp.prefix + 'revert" style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-scissors"/>'); 
     238        //$("#" + t_jp.prefix + "revert").click(function () { 
    239239        //alert ('hi'); 
    240240        //}); 
     
    242242        .bind('tabsselect', function (event, ui) { 
    243243            // Change buttons 
    244             if (jQuery(ui.tab).text() === 'Translate') { 
    245                 jQuery("#" + t_jp.prefix + "d-tabs").dialog('option', 'buttons', tButtons); 
     244            if ($(ui.tab).text() === 'Translate') { 
     245                $("#" + t_jp.prefix + "d-tabs").dialog('option', 'buttons', tButtons); 
    246246            } else { 
    247                 jQuery("#" + t_jp.prefix + "d-tabs").dialog('option', 'buttons', hButtons); 
     247                $("#" + t_jp.prefix + "d-tabs").dialog('option', 'buttons', hButtons); 
    248248            } 
    249249        }) 
    250250        .bind('dialogbeforeclose', function (event, ui) { 
    251             if (jQuery("#" + t_jp.prefix + "translation").data("edit").changed) { 
     251            if ($("#" + t_jp.prefix + "translation").data("edit").changed) { 
    252252                confirm_close(); 
    253253                return false; 
     
    256256        }); 
    257257        // fix for templates messing with li 
    258         jQuery("#" + t_jp.prefix + "d-tabs li").css("list-style-type", "none").css("list-style-position", "outside"); 
    259         jQuery("#" + t_jp.prefix + "d-tabs-1").css("padding", "1px").append( 
     258        $("#" + t_jp.prefix + "d-tabs li").css("list-style-type", "none").css("list-style-position", "outside"); 
     259        $("#" + t_jp.prefix + "d-tabs-1").css("padding", "1px").append( 
    260260            /*'<table><tr><td>'+*/ 
    261261            '<form id="' + t_jp.prefix + 'form">' + 
     
    273273        '<img src="/wp-content/plugins/transposh/img/knob/knobs/merge.png"/>'+ 
    274274        '</td></tr></table>'*/); 
    275         /*jQuery("#smart").click(function () { 
     275        /*$("#smart").click(function () { 
    276276        grabnext(segment_id); 
    277277    });*/ 
    278         jQuery("#" + t_jp.prefix + "d-tabs-1 label").css("display", "block"); 
    279         jQuery("#" + t_jp.prefix + "d-tabs-1 textarea.text").css({ 
     278        $("#" + t_jp.prefix + "d-tabs-1 label").css("display", "block"); 
     279        $("#" + t_jp.prefix + "d-tabs-1 textarea.text").css({ 
    280280            'margin-bottom': '12px', 
    281281            'width' : '95%', 
    282282            'padding' : '.4em' 
    283283        }); 
    284         jQuery("#" + t_jp.prefix + "original").val(jQuery("#" + t_jp.prefix + segment_id).attr('orig')); 
    285         jQuery("#" + t_jp.prefix + "translation").val(jQuery("#" + t_jp.prefix + segment_id).html()); 
    286         if (jQuery("#" + t_jp.prefix + segment_id).attr('trans')) { 
    287             jQuery("#" + t_jp.prefix + "translation").val(jQuery("#" + t_jp.prefix + segment_id).attr('trans')); 
    288         } 
    289         jQuery("#" + t_jp.prefix + "translation").data("edit", { 
     284        $("#" + t_jp.prefix + "original").val($("#" + t_jp.prefix + segment_id).attr('data-orig')); 
     285        $("#" + t_jp.prefix + "translation").val($("#" + t_jp.prefix + segment_id).html()); 
     286        if ($("#" + t_jp.prefix + segment_id).attr('data-trans')) { 
     287            $("#" + t_jp.prefix + "translation").val($("#" + t_jp.prefix + segment_id).attr('data-trans')); 
     288        } 
     289        $("#" + t_jp.prefix + "translation").data("edit", { 
    290290            changed: false 
    291291        }); 
    292         jQuery("#" + t_jp.prefix + "translation").keyup(function (e) { 
    293             if (jQuery("#" + t_jp.prefix + segment_id).text() !== jQuery(this).val()) { 
    294                 jQuery(this).css("background", "yellow"); 
    295                 jQuery(this).data("edit", { 
     292        $("#" + t_jp.prefix + "translation").keyup(function (e) { 
     293            if ($("#" + t_jp.prefix + segment_id).text() !== $(this).val()) { 
     294                $(this).css("background", "yellow"); 
     295                $(this).data("edit", { 
    296296                    changed: true 
    297297                }); 
    298298            } else { 
    299                 jQuery(this).css("background", ""); 
    300                 jQuery(this).data("edit", { 
     299                $(this).css("background", ""); 
     300                $(this).data("edit", { 
    301301                    changed: false 
    302302                }); 
    303303            } 
    304304        }); 
    305         jQuery("#" + t_jp.prefix + "d-tabs").dialog({ 
     305        $("#" + t_jp.prefix + "d-tabs").dialog({ 
    306306            bgiframe: true, 
    307307            modal: true, 
     
    314314    
    315315    // lets add the images 
    316     jQuery("." + t_jp.prefix).each(function (i) { 
    317         var translated_id = jQuery(this).attr('id').substr(jQuery(this).attr('id').lastIndexOf('_') + 1), img; 
    318         jQuery(this).after('<span id="' + t_jp.prefix + 'img_' + translated_id + '" class="tr-icon" title="' + jQuery(this).attr('orig') + '"></span>'); 
    319         img = jQuery('#' + t_jp.prefix + 'img_' + translated_id); 
     316    $("." + t_jp.prefix).each(function (i) { 
     317        var translated_id = $(this).attr('id').substr($(this).attr('id').lastIndexOf('_') + 1), img; 
     318        $(this).after('<span id="' + t_jp.prefix + 'img_' + translated_id + '" class="tr-icon" title="' + $(this).attr('data-orig') + '"></span>'); 
     319        img = $('#' + t_jp.prefix + 'img_' + translated_id); 
    320320        img.click(function () { 
    321             //  if we detect that jQuery.ui is missing (TODO - check tabs - etal) we load it first 
    322             if (typeof jQuery.fn.tabs !== 'function') { 
    323                 jQuery.ajaxSetup({ 
     321            //  if we detect that $.ui is missing (TODO - check tabs - etal) we load it first 
     322            if (typeof $.fn.tabs !== 'function') { 
     323                $.ajaxSetup({ 
    324324                    cache: true 
    325325                }); 
    326                 jQuery.getScript(t_jp.plugin_url + '/js/lazy.js', function () { 
    327                     jQuery.xLazyLoader({ 
    328                         js: 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js', 
    329                         css: 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css', 
     326                $.getScript(t_jp.plugin_url + '/js/lazy.js', function () { 
     327                    $.xLazyLoader({ 
     328                        js: 'http://ajax.googleapis.com/ajax/libs/$ui/1.7.2/$-ui.min.js', 
     329                        css: 'http://ajax.googleapis.com/ajax/libs/$ui/1.7.2/themes/ui-lightness/$-ui.css', 
    330330                        success: function () { 
    331331                            translate_dialog(translated_id); 
     
    342342            'padding': '0px' 
    343343        }); 
    344         if (jQuery(this).attr('source') === '0') { 
     344        if ($(this).attr('data-source') === '0') { 
    345345            img.addClass('tr-icon-green'); 
    346346        } 
    347         else if (jQuery(this).attr('source')) { 
     347        else if ($(this).attr('data-source')) { 
    348348            img.addClass('tr-icon-yellow'); 
    349349        } 
    350350        // if the image is sourced from a hidden element - kindly "show" this 
    351         if (jQuery(this).attr('hidden') === 'y') { 
     351        if ($(this).attr('data-hidden') === 'y') { 
    352352            img.css({ 
    353353                'opacity': '0.6' 
     
    355355        } 
    356356    }); 
    357 }()); // end of closure 
     357}(jQuery)); // end of closure 
Note: See TracChangeset for help on using the changeset viewer.