Plugin Directory

Changeset 1268003


Ignore:
Timestamp:
10/17/2015 08:07:19 PM (10 years ago)
Author:
FlyerUA
Message:

Fixes against minifier

Location:
simple-rating/tags/1.4/resources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-rating/tags/1.4/resources/spr_script.js

    r1035847 r1268003  
    1 var $j=jQuery,pcl,rating_working,numb;$j(document).ready(function(){$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").mouseenter(function(e){if(rating_working=spr_ajax_object.rating_working){pcl=[],numb=e.target.id,numb=parseInt(numb.replace("spr_piece_",""));for(var t=1;t<=spr_ajax_object.scale;t++)pcl[t]=$j("#spr_piece_"+t).attr("class").replace("spr_rating_piece ","");for(var t=1;t<=spr_ajax_object.scale;t++)$j("#spr_piece_"+t).addClass("spr_"+spr_ajax_object.spr_type+"_empty");for($j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_full_voting"),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_half_voting"),t=1;numb>=t;t++)$j("#spr_piece_"+t).addClass("spr_"+spr_ajax_object.spr_type+"_full_voted")}}).mouseleave(function(){if(rating_working){$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_full_voted"),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_half_voted");for(var e=1;e<=spr_ajax_object.scale;e++)$j("#spr_piece_"+e).addClass(pcl[e])}}),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").click(function(e){rating_working=spr_ajax_object.rating_working,numb=e.target.id,numb=parseInt(numb.replace("spr_piece_","")),request={post_id:spr_ajax_object.post_id,points:numb,action:"spr_rate"},rating_working&&numb>=1&&numb<=spr_ajax_object.scale&&$j.ajax({type:"post",dataType:"json",url:spr_ajax_object.ajax_url,data:request,success:function(e){if(1==e.status)$j("#spr_container_"+spr_ajax_object.post_id).html(e.html),rating_working=!1;else if(2==e.status)return!1}})})})
     1var $j=jQuery,pcl,rating_working,numb;$j(document).ready(function(){$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").mouseenter(function(r){if(rating_working=spr_ajax_object.rating_working){pcl=[],numb=r.target.id,numb=parseInt(numb.replace("spr_piece_",""));for(var _=1;_<=spr_ajax_object.scale;_++)pcl[_]=$j("#spr_piece_"+_).attr("class").replace("spr_rating_piece ","");for(var _=1;_<=spr_ajax_object.scale;_++)$j("#spr_piece_"+_).addClass("spr_"+spr_ajax_object.spr_type+"_empty");for($j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_full_voting"),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_half_voting"),_=1;numb>=_;_++)$j("#spr_piece_"+_).addClass("spr_"+spr_ajax_object.spr_type+"_full_voted")}}).mouseleave(function(){if(rating_working){$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_full_voted"),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_"+spr_ajax_object.spr_type+"_half_voted");for(var r=1;r<=spr_ajax_object.scale;r++)$j("#spr_piece_"+r).addClass(pcl[r])}}),$j("#spr_container_"+spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").click(function(r){rating_working=spr_ajax_object.rating_working,numb=r.target.id,numb=parseInt(numb.replace("spr_piece_",""));var _={post_id:spr_ajax_object.post_id,points:numb,action:"spr_rate"};rating_working&&numb>=1&&numb<=spr_ajax_object.scale&&$j.ajax({type:"post",dataType:"json",url:spr_ajax_object.ajax_url,data:_,success:function(r){if(1==r.status)$j("#spr_container_"+spr_ajax_object.post_id).html(r.html),rating_working=!1;else if(2==r.status)return!1}})})});
  • simple-rating/tags/1.4/resources/spr_script_non_min.js

    r1035847 r1268003  
    11var $j = jQuery, pcl, rating_working, numb;
    2 $j( document ).ready(function() {
    3 $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").mouseenter(function(r) {
    4     if (rating_working = spr_ajax_object.rating_working) {
    5         pcl = [], numb = r.target.id, numb = parseInt(numb.replace("spr_piece_", ""));
    6         for (var _ = 1; _ <= spr_ajax_object.scale; _++)
    7             pcl[_] = $j("#spr_piece_" + _).attr("class").replace("spr_rating_piece ", "");
    8         for (var _ = 1; _ <= spr_ajax_object.scale; _++)
    9             $j("#spr_piece_" + _).addClass("spr_" + spr_ajax_object.spr_type + "_empty");
    10         for ($j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_full_voting"), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_half_voting"), _ = 1; numb >= _; _++)
    11             $j("#spr_piece_" + _).addClass("spr_" + spr_ajax_object.spr_type + "_full_voted")
    12     }
    13 }).mouseleave(function() {
    14     if (rating_working) {
    15         $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_full_voted"), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_half_voted");
    16         for (var r = 1; r <= spr_ajax_object.scale; r++)
    17             $j("#spr_piece_" + r).addClass(pcl[r])
    18     }
    19 }), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").click(function(r) {
    20     rating_working = spr_ajax_object.rating_working, numb = r.target.id, numb = parseInt(numb.replace("spr_piece_", "")), request = {post_id: spr_ajax_object.post_id, points: numb, action: "spr_rate"}, rating_working && numb >= 1 && numb <= spr_ajax_object.scale && $j.ajax({type: "post", dataType: "json", url: spr_ajax_object.ajax_url, data: request, success: function(r) {
    21             if (1 == r.status)
    22                 $j("#spr_container_" + spr_ajax_object.post_id).html(r.html), rating_working = !1;
    23             else if (2 == r.status)
    24                 return!1
    25         }})
     2$j(document).ready(function () {
     3    $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").mouseenter(function (r) {
     4        if (rating_working = spr_ajax_object.rating_working) {
     5            pcl = [], numb = r.target.id, numb = parseInt(numb.replace("spr_piece_", ""));
     6            for (var _ = 1; _ <= spr_ajax_object.scale; _++) {
     7                pcl[_] = $j("#spr_piece_" + _).attr("class").replace("spr_rating_piece ", "");
     8            }
     9            for (var _ = 1; _ <= spr_ajax_object.scale; _++) {
     10                $j("#spr_piece_" + _).addClass("spr_" + spr_ajax_object.spr_type + "_empty");
     11            }
     12            for ($j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_full_voting"), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_half_voting"), _ = 1; numb >= _; _++)
     13            {
     14                $j("#spr_piece_" + _).addClass("spr_" + spr_ajax_object.spr_type + "_full_voted");
     15            }
     16        }
     17    }).mouseleave(function () {
     18        if (rating_working) {
     19            $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_full_voted"), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").removeClass("spr_" + spr_ajax_object.spr_type + "_half_voted");
     20            for (var r = 1; r <= spr_ajax_object.scale; r++) {
     21                $j("#spr_piece_" + r).addClass(pcl[r]);
     22            }
     23        }
     24    }), $j("#spr_container_" + spr_ajax_object.post_id).children("#spr_shapes").children(".spr_rating_piece").click(function (r) {
     25        rating_working = spr_ajax_object.rating_working, numb = r.target.id, numb = parseInt(numb.replace("spr_piece_", ""));
     26        var request = {post_id: spr_ajax_object.post_id, points: numb, action: "spr_rate"};
     27        if (rating_working && numb >= 1 && numb <= spr_ajax_object.scale) {
     28            $j.ajax({type: "post", dataType: "json", url: spr_ajax_object.ajax_url, data: request, success: function (r) {
     29                    if (1 == r.status) {
     30                        $j("#spr_container_" + spr_ajax_object.post_id).html(r.html), rating_working = !1;
     31                    }
     32                    else if (2 == r.status) {
     33                        return false;
     34                    }
     35                }})
     36        }
     37    });
    2638});
    27 });
Note: See TracChangeset for help on using the changeset viewer.