Plugin Directory

Changeset 740007


Ignore:
Timestamp:
07/12/2013 08:29:40 PM (12 years ago)
Author:
shauno
Message:

Development version for improved ajax with js magnification. requires users testing, and the premium release to get approved and out there before this is fully released

Location:
nextgen-gallery-voting/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nextgen-gallery-voting/trunk/js/ajaxify-likes.js

    r739201 r740007  
    1111                data: '',
    1212                success: function(data, textStatus, XMLHttpRequest) {
    13                     var start = data.indexOf("<!-- NGGV START AJAX RESPONSE -->") + 41; //find the start of the outputting by the ajax url (stupid wordpress and poor buffering options blah blah)
    14                     var end = data.indexOf("<script><!-- NGGV END AJAX RESPONSE -->");
    15                    
    16                     var js = data.substr(start, (end-start));
    17                     js = js.replace(/(\r\n|\n|\r)/gm,'');
    18                    
    19                     eval(js); //the array of voters gets echoed out at the ajax url
     13                    var ajaxVer = data.indexOf('var nggv_ajax_ver'); //bit of a hack to improve ajax with minification, but keeping backwards compat for older users
     14                    if(ajaxVer > -1) { //means it was actually found, the ver num is irrelevent for now
     15                        eval(data);
     16                    }else{
     17                        var start = data.indexOf("<!-- NGGV START AJAX RESPONSE -->") + 41; //find the start of the outputting by the ajax url (stupid wordpress and poor buffering options blah blah)
     18                        var end = data.indexOf("<script><!-- NGGV END AJAX RESPONSE -->");
     19                       
     20                        var js = data.substr(start, (end-start));
     21                        js = js.replace(/(\r\n|\n|\r)/gm,'');
     22                       
     23                        eval(js); //the array of voters gets echoed out at the ajax url
     24                    }
    2025                   
    2126                    if(typeof(nggv_js) == 'object') {
  • nextgen-gallery-voting/trunk/js/ajaxify-stars.js

    r739201 r740007  
    1111            data: '',
    1212            success: function(data, textStatus, XMLHttpRequest) {
    13                 var start = data.indexOf("<!-- NGGV START AJAX RESPONSE -->") + 41; //find the start of the outputting by the ajax url (stupid wordpress and poor buffering options blah blah)
    14                 var end = data.indexOf("<script><!-- NGGV END AJAX RESPONSE -->");
    15                
    16                 var js = data.substr(start, (end-start));
    17                 js = js.replace(/(\r\n|\n|\r)/gm,'');
    18                
    19                 eval(js); //the array of voters gets echoed out at the ajax url
     13                var ajaxVer = data.indexOf('var nggv_ajax_ver'); //bit of a hack to improve ajax with minification, but keeping backwards compat for older users
     14                if(ajaxVer > -1) { //means it was actually found, the ver num is irrelevent for now
     15                    eval(data);
     16                }else{
     17                    var start = data.indexOf("<!-- NGGV START AJAX RESPONSE -->") + 41; //find the start of the outputting by the ajax url (stupid wordpress and poor buffering options blah blah)
     18                    var end = data.indexOf("<script><!-- NGGV END AJAX RESPONSE -->");
     19                   
     20                    var js = data.substr(start, (end-start));
     21                    js = js.replace(/(\r\n|\n|\r)/gm,'');
     22                   
     23                    eval(js); //the array of voters gets echoed out at the ajax url
     24                }
    2025               
    2126                if(typeof(nggv_js) == 'object') {
  • nextgen-gallery-voting/trunk/ngg-voting.php

    r739201 r740007  
    17091709                    $form = $this->getImageVoteMarkup($options);
    17101710
    1711                     echo '<!-- NGGV START AJAX RESPONSE -->';
    1712                     echo '<script>';
     1711                    //echo '<!-- NGGV START AJAX RESPONSE -->';
     1712                    //echo '<script>';
     1713                    echo 'var nggv_ajax_ver = 2;'; //new in 2.6.1 to help js minification messing up ajac voting
    17131714                    echo 'var nggv_js = {};';
    17141715                    echo 'nggv_js.options = {};';
     
    17161717                    echo 'nggv_js.msg = "'.addslashes($votedOrErr).'";';
    17171718                    echo 'nggv_js.voting_form = "'.addslashes($form['form']).'";';
    1718                     echo '<script><!-- NGGV END AJAX RESPONSE -->';
     1719                    //echo '<script><!-- NGGV END AJAX RESPONSE -->';
    17191720                    exit;
    17201721                }
Note: See TracChangeset for help on using the changeset viewer.