PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 3.0.0
WP Popular Posts v3.0.0
4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 5.0.0 5.0.1 5.0.2 5.1.0 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.2 5.5.0 5.5.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.2.0 6.2.1 6.3.0 6.3.1 6.3.2 6.3.3 6.3.4 6.4.0 6.4.1 6.4.2 7.0.0 7.0.1 7.1.0 7.2.0 7.3.0 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4.0 trunk 2.3.7 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.2 4.0.3 4.0.5 4.0.6
wordpress-popular-posts / js / admin.js
wordpress-popular-posts / js Last commit date
admin.js 12 years ago index.php 12 years ago widget.js 12 years ago wpp-upload.js 12 years ago
admin.js
99 lines
1 (function ($) {
2 "use strict";
3 $(function () {
4
5 // STATISTICS TABS
6 $("#wpp-stats-tabs a").click(function(e){
7 var activeTab = $(this).attr("rel");
8 $(this).removeClass("button-secondary").addClass("button-primary").siblings().removeClass("button-primary").addClass("button-secondary");
9 $(".wpp-stats:visible").hide("fast", function(){
10 $("#"+activeTab).slideDown("fast");
11 });
12
13 e.preventDefault();
14 });
15
16 $(".wpp-stats").each(function(){
17 if ($("li", this).length == 1) {
18 $("li", this).addClass("wpp-stats-last-item");
19 } else {
20 $("li:last", this).addClass("wpp-stats-last-item");
21 }
22 });
23
24 // TOOLS
25 // thumb source selection
26 $("#thumb_source").change(function() {
27 if ($(this).val() == "custom_field") {
28 $("#lbl_field, #thumb_field, #row_custom_field, #row_custom_field_resize").show();
29 } else {
30 $("#lbl_field, #thumb_field, #row_custom_field, #row_custom_field_resize").hide();
31 }
32 });
33 // file upload
34 $('#upload_thumb_button').click(function(e) {
35 tb_show('Upload a thumbnail', 'media-upload.php?referer=wpp_admin&type=image&TB_iframe=true&post_id=0', false);
36 e.preventDefault();
37 });
38 window.send_to_editor = function(html) {
39 var image_url = $('img',html).attr('src');
40 $('#upload_thumb_src').val(image_url);
41
42 var img = new Image();
43 img.src = image_url;
44
45 $("#thumb-review").html( img );
46 $("#thumb-review").parent().show();
47
48 tb_remove();
49 };
50 // cache interval
51 $("#cache").change(function() {
52 if ($(this).val() == 1) {
53 $("#cache_refresh_interval").show();
54 } else {
55 $("#cache_refresh_interval, #cache_too_long").hide();
56 }
57 });
58 // interval
59 $("#cache_interval_time").change(function() {
60 var value = parseInt( $("#cache_interval_value").val() );
61 var time = $(this).val();
62
63 console.log(time + " " + value);
64
65 if ( time == "hour" && value > 72 ) {
66 $("#cache_too_long").show();
67 } else if ( time == "day" && value > 3 ) {
68 $("#cache_too_long").show();
69 } else if ( time == "week" && value > 1 ) {
70 $("#cache_too_long").show();
71 } else if ( time == "month" && value >= 1 ) {
72 $("#cache_too_long").show();
73 } else if ( time == "year" && value >= 1 ) {
74 $("#cache_too_long").show();
75 } else {
76 $("#cache_too_long").hide();
77 }
78 });
79
80 $("#cache_interval_value").change(function() {
81 var value = parseInt( $(this).val() );
82 var time = $("#cache_interval_time").val();
83
84 if ( time == "hour" && value > 72 ) {
85 $("#cache_too_long").show();
86 } else if ( time == "day" && value > 3 ) {
87 $("#cache_too_long").show();
88 } else if ( time == "week" && value > 1 ) {
89 $("#cache_too_long").show();
90 } else if ( time == "month" && value >= 1 ) {
91 $("#cache_too_long").show();
92 } else if ( time == "year" && value >= 1 ) {
93 $("#cache_too_long").show();
94 } else {
95 $("#cache_too_long").hide();
96 }
97 });
98 });
99 }(jQuery));