Version Description
Download this release
Release Info
Developer | Rahe |
Plugin | Simple Image Sizes |
Version | 2.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.1 to 2.4
- css/Aristo/jquery-ui-1.8.7.custom.css +95 -97
- css/sis-style.css +33 -38
- inc/class.admin.php +246 -349
- inc/class.client.php +9 -12
- js/jquery-ui-1.8.16.custom.min.js +0 -77
- js/sis-attachments.js +52 -46
- js/sis-attachments.min.js +4 -3
- js/sis.js +219 -324
- js/sis.min.js +21 -25
- languages/sis-fr_FR.mo +0 -0
- languages/sis-fr_FR.po +126 -102
- languages/sis.pot +257 -254
- readme.txt +10 -3
- simple_image_sizes.php +6 -6
css/Aristo/jquery-ui-1.8.7.custom.css
CHANGED
@@ -56,26 +56,20 @@
|
|
56 |
|
57 |
/* Component containers
|
58 |
----------------------------------*/
|
59 |
-
.ui-widget { font-family:
|
60 |
.ui-widget .ui-widget { font-size: 1em; }
|
61 |
-
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family:
|
62 |
.ui-widget-content { border: 1px solid #B6B6B6; background: #ffffff; color: #4F4F4F; }
|
63 |
.ui-widget-content a { color: #4F4F4F; }
|
64 |
.ui-widget-header { border: 1px solid #B6B6B6; color: #4F4F4F; font-weight: bold; }
|
65 |
.ui-widget-header {
|
66 |
-
background: url(images/bg_fallback.png) 0 0 repeat-x;
|
67 |
-
|
68 |
-
linear,
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
);
|
74 |
-
background: -moz-linear-gradient(
|
75 |
-
center top,
|
76 |
-
rgb(237,237,237),
|
77 |
-
rgb(196,196,196)
|
78 |
-
);
|
79 |
}
|
80 |
.ui-widget-header a { color: #4F4F4F; }
|
81 |
|
@@ -83,21 +77,16 @@
|
|
83 |
----------------------------------*/
|
84 |
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B6B6B6; font-weight: normal; color: #4F4F4F; }
|
85 |
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
|
86 |
-
background: url(images/bg_fallback.png) 0 0 repeat-x;
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
);
|
94 |
-
background: -moz-linear-gradient(
|
95 |
-
center top,
|
96 |
-
rgb(237,237,237),
|
97 |
-
rgb(196,196,196)
|
98 |
-
);
|
99 |
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
|
100 |
-moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
|
|
|
101 |
}
|
102 |
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #4F4F4F; text-decoration: none; }
|
103 |
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #9D9D9D; font-weight: normal; color: #313131; }
|
@@ -105,21 +94,16 @@
|
|
105 |
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
|
106 |
outline: none;
|
107 |
color: #1c4257; border: 1px solid #7096ab;
|
108 |
-
background: url(images/bg_fallback.png) 0 -50px repeat-x;
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
);
|
116 |
-
background: -moz-linear-gradient(
|
117 |
-
center top,
|
118 |
-
rgb(185,224,245),
|
119 |
-
rgb(146,189,214)
|
120 |
-
);
|
121 |
-webkit-box-shadow: none;
|
122 |
-moz-box-shadow: none;
|
|
|
123 |
}
|
124 |
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #313131; text-decoration: none; }
|
125 |
.ui-widget :active { outline: none; }
|
@@ -353,7 +337,7 @@
|
|
353 |
* http://docs.jquery.com/UI/Resizable#theming
|
354 |
*/
|
355 |
.ui-resizable { position: relative;}
|
356 |
-
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index:
|
357 |
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
358 |
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
359 |
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
@@ -401,10 +385,13 @@
|
|
401 |
* http://docs.jquery.com/UI/Autocomplete#theming
|
402 |
*/
|
403 |
.ui-autocomplete {
|
404 |
-
position: absolute; cursor: default; z-index: 3
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
408 |
}
|
409 |
|
410 |
/* workarounds */
|
@@ -452,7 +439,9 @@
|
|
452 |
color: #FFFFFF;
|
453 |
text-shadow: 0px 1px 1px #234386;
|
454 |
border-color: #466086;
|
455 |
-
|
|
|
|
|
456 |
}
|
457 |
/*
|
458 |
* jQuery UI Button 1.8.7
|
@@ -471,44 +460,55 @@ button.ui-button-icons-only { width: 3.7em; }
|
|
471 |
|
472 |
/* button animation properties */
|
473 |
.ui-button {
|
474 |
-
-webkit-transition: all
|
475 |
-
-moz-transition: all
|
476 |
-
-o-transition: all
|
|
|
477 |
}
|
478 |
|
479 |
/*states*/
|
480 |
.ui-button.ui-state-hover {
|
481 |
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
482 |
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
|
|
483 |
}
|
484 |
.ui-button.ui-state-focus {
|
485 |
outline: none;
|
486 |
-
color: #1c4257;
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
);
|
499 |
-
-webkit-box-shadow: none;
|
500 |
-
-moz-box-shadow: none;
|
501 |
}
|
502 |
|
503 |
/*button text element */
|
504 |
-
.ui-button .ui-button-text { display: block; line-height: 1.4; font-weight: bold; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
|
505 |
-
.ui-button-text-only .ui-button-text { padding: .4em 1em
|
506 |
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
507 |
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
508 |
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
509 |
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
510 |
/* no icon support for input elements, provide padding by default */
|
511 |
-
input.ui-button {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
|
513 |
/*button icon element(s) */
|
514 |
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
@@ -522,20 +522,16 @@ input.ui-button { padding: .4em 1em; }
|
|
522 |
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
523 |
.ui-buttonset .ui-button.ui-state-active { color: #1c4257; border-color: #7096ab; }
|
524 |
.ui-buttonset .ui-button.ui-state-active {
|
525 |
-
background
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
background-image: -moz-linear-gradient(
|
533 |
-
center top,
|
534 |
-
rgb(185,224,245),
|
535 |
-
rgb(146,189,214)
|
536 |
-
);
|
537 |
-webkit-box-shadow: none;
|
538 |
-moz-box-shadow: none;
|
|
|
539 |
}
|
540 |
|
541 |
/* workarounds */
|
@@ -553,6 +549,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
553 |
.ui-dialog {
|
554 |
-webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
|
555 |
-moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
|
|
|
556 |
}
|
557 |
.ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #979797; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
|
558 |
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 14px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
|
@@ -575,12 +572,12 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
575 |
*
|
576 |
* http://docs.jquery.com/UI/Slider#theming
|
577 |
*/
|
578 |
-
.ui-slider { position: relative; text-align: left; background: #d7d7d7; }
|
579 |
-
.ui-slider { -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; }
|
580 |
-
.ui-slider .ui-slider-handle { background: url(images/slider_handles.png) 0px -23px no-repeat; position: absolute; z-index: 2; width: 23px; height: 23px; cursor: default; border: none; outline: none; -moz-box-shadow: none; -webkit-box-shadow: none; }
|
581 |
.ui-slider .ui-state-hover, .ui-slider .ui-state-active { background-position: 0 0; }
|
582 |
.ui-slider .ui-slider-range { background: #a3cae0; position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
583 |
-
.ui-slider .ui-slider-range { -moz-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; -webkit-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; }
|
584 |
|
585 |
|
586 |
.ui-slider-horizontal { height: 5px; }
|
@@ -602,7 +599,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
602 |
*
|
603 |
* http://docs.jquery.com/UI/Tabs#theming
|
604 |
*/
|
605 |
-
.ui-tabs { position: relative; zoom: 1; border: 0; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
606 |
.ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
|
607 |
.ui-tabs .ui-tabs-nav {
|
608 |
-moz-border-radius: 0;
|
@@ -615,7 +612,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
615 |
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; outline: none; }
|
616 |
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
617 |
.ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
|
618 |
-
.ui-tabs .ui-tabs-panel {
|
619 |
-moz-border-radius: 0;
|
620 |
-webkit-border-radius: 0;
|
621 |
border-radius: 0;
|
@@ -658,8 +655,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
658 |
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
659 |
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
660 |
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
661 |
-
.ui-datepicker .ui-state-
|
662 |
-
.ui-datepicker .ui-state-
|
|
|
|
|
663 |
|
664 |
/* with multiple calendars */
|
665 |
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
@@ -710,8 +709,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
710 |
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; background: url(images/progress_bar.gif) 0 0 repeat-x; }
|
711 |
|
712 |
/* Extra Input Field Styling */
|
713 |
-
|
714 |
-
textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
|
715 |
padding: 3px;
|
716 |
-webkit-border-radius: 2px;
|
717 |
-moz-border-radius: 2px;
|
@@ -721,20 +719,20 @@ textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
|
|
721 |
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
722 |
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
723 |
box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
724 |
-
-webkit-transition: all
|
725 |
-
-moz-transition: all
|
726 |
-
-o-transition: all
|
|
|
727 |
}
|
728 |
-
textarea:hover, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
|
729 |
border: 1px solid #bdbdbd;
|
730 |
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
731 |
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
732 |
box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
733 |
}
|
734 |
-
textarea:focus, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
|
735 |
border: 1px solid #95bdd4;
|
736 |
-webkit-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
737 |
-moz-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
738 |
box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
739 |
-
}
|
740 |
-
*/
|
56 |
|
57 |
/* Component containers
|
58 |
----------------------------------*/
|
59 |
+
.ui-widget { font-family: Arial,sans-serif; font-size: 1.1em; }
|
60 |
.ui-widget .ui-widget { font-size: 1em; }
|
61 |
+
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,sans-serif; font-size: 1em; }
|
62 |
.ui-widget-content { border: 1px solid #B6B6B6; background: #ffffff; color: #4F4F4F; }
|
63 |
.ui-widget-content a { color: #4F4F4F; }
|
64 |
.ui-widget-header { border: 1px solid #B6B6B6; color: #4F4F4F; font-weight: bold; }
|
65 |
.ui-widget-header {
|
66 |
+
background: #ededed url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
|
67 |
+
background: -moz-linear-gradient(top, #ededed 0%, #c4c4c4 100%); /* FF3.6+ */
|
68 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#c4c4c4)); /* Chrome,Safari4+ */
|
69 |
+
background: -webkit-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Chrome10+,Safari5.1+ */
|
70 |
+
background: -o-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Opera11.10+ */
|
71 |
+
background: -ms-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* IE10+ */
|
72 |
+
background: linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* W3C */
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
.ui-widget-header a { color: #4F4F4F; }
|
75 |
|
77 |
----------------------------------*/
|
78 |
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B6B6B6; font-weight: normal; color: #4F4F4F; }
|
79 |
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
|
80 |
+
background: #ededed url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
|
81 |
+
background: -moz-linear-gradient(top, #ededed 0%, #c4c4c4 100%); /* FF3.6+ */
|
82 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#c4c4c4)); /* Chrome,Safari4+ */
|
83 |
+
background: -webkit-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Chrome10+,Safari5.1+ */
|
84 |
+
background: -o-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Opera11.10+ */
|
85 |
+
background: -ms-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* IE10+ */
|
86 |
+
background: linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* W3C */
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
|
88 |
-moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
|
89 |
+
box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
|
90 |
}
|
91 |
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #4F4F4F; text-decoration: none; }
|
92 |
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #9D9D9D; font-weight: normal; color: #313131; }
|
94 |
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
|
95 |
outline: none;
|
96 |
color: #1c4257; border: 1px solid #7096ab;
|
97 |
+
background: #ededed url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
|
98 |
+
background: -moz-linear-gradient(top, #b9e0f5 0%, #92bdd6 100%); /* FF3.6+ */
|
99 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b9e0f5), color-stop(100%,#92bdd6)); /* Chrome,Safari4+ */
|
100 |
+
background: -webkit-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Chrome10+,Safari5.1+ */
|
101 |
+
background: -o-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Opera11.10+ */
|
102 |
+
background: -ms-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* IE10+ */
|
103 |
+
background: linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* W3C */
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
-webkit-box-shadow: none;
|
105 |
-moz-box-shadow: none;
|
106 |
+
box-shadow: none;
|
107 |
}
|
108 |
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #313131; text-decoration: none; }
|
109 |
.ui-widget :active { outline: none; }
|
337 |
* http://docs.jquery.com/UI/Resizable#theming
|
338 |
*/
|
339 |
.ui-resizable { position: relative;}
|
340 |
+
.ui-resizable-handle { position: absolute; font-size: 0.1px; z-index: 999; display: block;}
|
341 |
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
342 |
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
343 |
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
385 |
* http://docs.jquery.com/UI/Autocomplete#theming
|
386 |
*/
|
387 |
.ui-autocomplete {
|
388 |
+
position: absolute; cursor: default; z-index: 3;
|
389 |
+
-moz-border-radius: 0;
|
390 |
+
-webkit-border-radius: 0;
|
391 |
+
border-radius: 0;
|
392 |
+
-moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
|
393 |
+
-webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
|
394 |
+
box-shadow: 0 1px 5px rgba(0,0,0,0.3);
|
395 |
}
|
396 |
|
397 |
/* workarounds */
|
439 |
color: #FFFFFF;
|
440 |
text-shadow: 0px 1px 1px #234386;
|
441 |
border-color: #466086;
|
442 |
+
-moz-border-radius: 0;
|
443 |
+
-webkit-border-radius: 0;
|
444 |
+
border-radius: 0;
|
445 |
}
|
446 |
/*
|
447 |
* jQuery UI Button 1.8.7
|
460 |
|
461 |
/* button animation properties */
|
462 |
.ui-button {
|
463 |
+
-webkit-transition: all 250ms ease-in-out;
|
464 |
+
-moz-transition: all 250ms ease-in-out;
|
465 |
+
-o-transition: all 250ms ease-in-out;
|
466 |
+
transition: all 250ms ease-in-out;
|
467 |
}
|
468 |
|
469 |
/*states*/
|
470 |
.ui-button.ui-state-hover {
|
471 |
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
472 |
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
473 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
474 |
}
|
475 |
.ui-button.ui-state-focus {
|
476 |
outline: none;
|
477 |
+
color: #1c4257;
|
478 |
+
border-color: #7096ab;
|
479 |
+
background: #ededed url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
|
480 |
+
background: -moz-linear-gradient(top, #b9e0f5 0%, #92bdd6 100%); /* FF3.6+ */
|
481 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b9e0f5), color-stop(100%,#92bdd6)); /* Chrome,Safari4+ */
|
482 |
+
background: -webkit-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Chrome10+,Safari5.1+ */
|
483 |
+
background: -o-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Opera11.10+ */
|
484 |
+
background: -ms-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* IE10+ */
|
485 |
+
background: linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* W3C */
|
486 |
+
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
487 |
+
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
488 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.8) inset;
|
|
|
|
|
|
|
489 |
}
|
490 |
|
491 |
/*button text element */
|
492 |
+
.ui-button .ui-button-text { display: block; line-height: 1.4; font-size: 14px; font-weight: bold; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
|
493 |
+
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
494 |
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
495 |
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
496 |
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
497 |
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
498 |
/* no icon support for input elements, provide padding by default */
|
499 |
+
input.ui-button, .ui-widget-content input.ui-button { font-size: 14px; font-weight: bold; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); padding: 0 1em !important; height: 33px; }
|
500 |
+
/*remove submit button internal padding in Firefox*/
|
501 |
+
input.ui-button::-moz-focus-inner {
|
502 |
+
border: 0;
|
503 |
+
padding: 0;
|
504 |
+
}
|
505 |
+
/* fix webkits handling of the box model */
|
506 |
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
507 |
+
input.ui-button {
|
508 |
+
height: 31px !important;
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
|
513 |
/*button icon element(s) */
|
514 |
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
522 |
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
523 |
.ui-buttonset .ui-button.ui-state-active { color: #1c4257; border-color: #7096ab; }
|
524 |
.ui-buttonset .ui-button.ui-state-active {
|
525 |
+
background: #ededed url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
|
526 |
+
background: -moz-linear-gradient(top, #b9e0f5 0%, #92bdd6 100%); /* FF3.6+ */
|
527 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b9e0f5), color-stop(100%,#92bdd6)); /* Chrome,Safari4+ */
|
528 |
+
background: -webkit-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Chrome10+,Safari5.1+ */
|
529 |
+
background: -o-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Opera11.10+ */
|
530 |
+
background: -ms-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* IE10+ */
|
531 |
+
background: linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* W3C */
|
|
|
|
|
|
|
|
|
|
|
532 |
-webkit-box-shadow: none;
|
533 |
-moz-box-shadow: none;
|
534 |
+
box-shadow: none;
|
535 |
}
|
536 |
|
537 |
/* workarounds */
|
549 |
.ui-dialog {
|
550 |
-webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
|
551 |
-moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
|
552 |
+
box-shadow: 0 2px 12px rgba(0,0,0,0.6);
|
553 |
}
|
554 |
.ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #979797; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
|
555 |
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 14px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
|
572 |
*
|
573 |
* http://docs.jquery.com/UI/Slider#theming
|
574 |
*/
|
575 |
+
.ui-slider { position: relative; text-align: left; background: #d7d7d7; z-index: 1; }
|
576 |
+
.ui-slider { -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; box-shadow: 0 1px 2px rgba(0,0,0,0.5) inset; }
|
577 |
+
.ui-slider .ui-slider-handle { background: url(images/slider_handles.png) 0px -23px no-repeat; position: absolute; z-index: 2; width: 23px; height: 23px; cursor: default; border: none; outline: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
|
578 |
.ui-slider .ui-state-hover, .ui-slider .ui-state-active { background-position: 0 0; }
|
579 |
.ui-slider .ui-slider-range { background: #a3cae0; position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
580 |
+
.ui-slider .ui-slider-range { -moz-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; -webkit-box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; box-shadow: 0 1px 2px rgba(17,35,45,0.6) inset; }
|
581 |
|
582 |
|
583 |
.ui-slider-horizontal { height: 5px; }
|
599 |
*
|
600 |
* http://docs.jquery.com/UI/Tabs#theming
|
601 |
*/
|
602 |
+
.ui-tabs { position: relative; zoom: 1; border: 0; background: transparent; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
603 |
.ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
|
604 |
.ui-tabs .ui-tabs-nav {
|
605 |
-moz-border-radius: 0;
|
612 |
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; outline: none; }
|
613 |
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
614 |
.ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
|
615 |
+
.ui-tabs .ui-tabs-panel { background: #FFF;
|
616 |
-moz-border-radius: 0;
|
617 |
-webkit-border-radius: 0;
|
618 |
border-radius: 0;
|
655 |
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
656 |
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
657 |
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
658 |
+
.ui-datepicker table .ui-state-highlight { border-color: #5F83B9; }
|
659 |
+
.ui-datepicker table .ui-state-hover { background: #5F83B9; color: #FFF; font-weight: bold; text-shadow: 0 1px 1px #234386; -webkit-box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; -moz-box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; border-color: #5F83B9; }
|
660 |
+
.ui-datepicker-calendar .ui-state-default { background: transparent; border-color: #FFF; }
|
661 |
+
.ui-datepicker-calendar .ui-state-active { background: #5F83B9; border-color: #5F83B9; color: #FFF; font-weight: bold; text-shadow: 0 1px 1px #234386; }
|
662 |
|
663 |
/* with multiple calendars */
|
664 |
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
709 |
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; background: url(images/progress_bar.gif) 0 0 repeat-x; }
|
710 |
|
711 |
/* Extra Input Field Styling */
|
712 |
+
.ui-form textarea, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
|
|
|
713 |
padding: 3px;
|
714 |
-webkit-border-radius: 2px;
|
715 |
-moz-border-radius: 2px;
|
719 |
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
720 |
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
721 |
box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset, 0 1px 0 rgba(255,255,255,0.2);
|
722 |
+
-webkit-transition: all 250ms ease-in-out;
|
723 |
+
-moz-transition: all 250ms ease-in-out;
|
724 |
+
-o-transition: all 250ms ease-in-out;
|
725 |
+
transition: all 250ms ease-in-out;
|
726 |
}
|
727 |
+
.ui-form textarea:hover, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):hover {
|
728 |
border: 1px solid #bdbdbd;
|
729 |
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
730 |
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
731 |
box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset, 0 1px 0 rgba(255,255,255,0.2);
|
732 |
}
|
733 |
+
.ui-form textarea:focus, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus {
|
734 |
border: 1px solid #95bdd4;
|
735 |
-webkit-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
736 |
-moz-box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
737 |
box-shadow: 0 2px 3px rgba(161,202,226,0.5) inset, 0 1px 0 rgba(255,255,255,0.2);
|
738 |
+
}
|
|
css/sis-style.css
CHANGED
@@ -1,24 +1,12 @@
|
|
1 |
.progress {
|
2 |
-
position:relative;
|
3 |
-
height:13px;
|
4 |
-
margin-bottom:
|
5 |
margin-top: 60px;
|
6 |
-
color
|
7 |
-
display:none;
|
8 |
}
|
9 |
-
|
10 |
-
.progress .progress-percent {
|
11 |
-
position: absolute;
|
12 |
-
left: 0%;
|
13 |
-
top: -63px;
|
14 |
-
width: 82px;
|
15 |
-
height: 49px;
|
16 |
-
margin-top: -9px;
|
17 |
-
font-weight: bold;
|
18 |
-
line-height: 39px;
|
19 |
-
text-align: center;
|
20 |
-
}
|
21 |
-
input.h,input.w{
|
22 |
border-color: #DFDFDF;
|
23 |
background-color: white;
|
24 |
border-width: 1px;
|
@@ -28,43 +16,50 @@ input.h,input.w{
|
|
28 |
-webkit-border-radius: 3px;
|
29 |
border-radius: 3px;
|
30 |
}
|
31 |
-
tr{
|
32 |
-webkit-transition: all .5s ease-in-out;
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
}
|
37 |
table.sis tr:nth-child(even) {
|
38 |
-
background-color
|
39 |
}
|
40 |
table.sis tr:nth-child(odd) {
|
41 |
-
background-color:transparent
|
42 |
}
|
43 |
tr.addPending {
|
44 |
-
background-color
|
45 |
}
|
46 |
tr.successAdding {
|
47 |
-
background-color
|
48 |
}
|
49 |
tr.errorAdding {
|
50 |
-
background-color
|
51 |
}
|
52 |
tr.notChangedAdding {
|
53 |
-
background-color
|
54 |
}
|
55 |
|
56 |
-
#regenerate_message
|
57 |
-
display:none;
|
58 |
}
|
59 |
|
60 |
#ajax_thumbnail_rebuild {
|
61 |
-
margin-top:40px;
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
70 |
}
|
1 |
.progress {
|
2 |
+
position: relative;
|
3 |
+
height: 13px;
|
4 |
+
margin-bottom: 13px;
|
5 |
margin-top: 60px;
|
6 |
+
color: #FFFFFF;
|
7 |
+
display: none;
|
8 |
}
|
9 |
+
input.h, input.w {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
border-color: #DFDFDF;
|
11 |
background-color: white;
|
12 |
border-width: 1px;
|
16 |
-webkit-border-radius: 3px;
|
17 |
border-radius: 3px;
|
18 |
}
|
19 |
+
tr {
|
20 |
-webkit-transition: all .5s ease-in-out;
|
21 |
+
-moz-transition: all .5s ease-in-out;
|
22 |
+
-o-transition: all .5s ease-in-out;
|
23 |
+
transition: all .5s ease-in-out;
|
24 |
}
|
25 |
table.sis tr:nth-child(even) {
|
26 |
+
background-color: #FCFCFC;
|
27 |
}
|
28 |
table.sis tr:nth-child(odd) {
|
29 |
+
background-color: transparent;
|
30 |
}
|
31 |
tr.addPending {
|
32 |
+
background-color: #6CA1D7;
|
33 |
}
|
34 |
tr.successAdding {
|
35 |
+
background-color: #89D76A;
|
36 |
}
|
37 |
tr.errorAdding {
|
38 |
+
background-color: #C45858;
|
39 |
}
|
40 |
tr.notChangedAdding {
|
41 |
+
background-color: #F2A13A;
|
42 |
}
|
43 |
|
44 |
+
#regenerate_message, #time, #thumb {
|
45 |
+
display: none;
|
46 |
}
|
47 |
|
48 |
#ajax_thumbnail_rebuild {
|
49 |
+
margin-top: 40px;
|
50 |
+
}
|
51 |
+
#sis_progress-percent {
|
52 |
+
width: 100%;
|
53 |
+
text-align: center;
|
54 |
+
font-weight: bold;
|
55 |
}
|
56 |
+
|
57 |
+
#time .ui-state-highlight{
|
58 |
+
margin-top: 20px;
|
59 |
+
padding: 0 .7em;
|
60 |
+
}
|
61 |
+
|
62 |
+
#time .ui-icon{
|
63 |
+
float: left;
|
64 |
+
margin-right: .7em;
|
65 |
}
|
inc/class.admin.php
CHANGED
@@ -2,34 +2,39 @@
|
|
2 |
Class SISAdmin {
|
3 |
|
4 |
// Original sizes
|
5 |
-
public $original = array( 'thumbnail', 'medium', 'large' );
|
6 |
|
7 |
public function __construct(){
|
8 |
// Init
|
9 |
add_action ( 'admin_menu', array( &$this, 'init' ) );
|
10 |
-
add_action ( 'admin_enqueue_scripts', array(
|
|
|
|
|
|
|
11 |
|
12 |
// Add ajax action
|
13 |
-
|
14 |
-
add_action( 'wp_ajax_'.'
|
15 |
-
add_action( 'wp_ajax_'.'
|
16 |
-
add_action( 'wp_ajax_'.'
|
|
|
|
|
17 |
|
18 |
// Add image sizes in the form, check if 3.3 is installed or not
|
19 |
if( !function_exists( 'is_main_query' ) ) {
|
20 |
-
add_filter( 'attachment_fields_to_edit', array(
|
21 |
} else {
|
22 |
-
add_filter( 'image_size_names_choose', array(
|
23 |
}
|
24 |
|
25 |
// Add link in plugins list
|
26 |
-
add_filter( 'plugin_action_links', array(
|
27 |
|
28 |
// Add action in media row quick actions
|
29 |
-
add_filter( 'media_row_actions', array(
|
30 |
|
31 |
// Add filter for the Media single
|
32 |
-
add_filter( 'attachment_fields_to_edit', array(
|
33 |
|
34 |
}
|
35 |
|
@@ -40,28 +45,26 @@ Class SISAdmin {
|
|
40 |
* @return void
|
41 |
* @author Nicolas Juen
|
42 |
*/
|
43 |
-
public function registerScripts($hook_suffix = '' ) {
|
44 |
-
if( !isset( $hook_suffix ) || empty( $hook_suffix ) )
|
45 |
return false;
|
|
|
46 |
|
47 |
if( $hook_suffix == 'options-media.php' ) {
|
48 |
// Add javascript
|
49 |
-
wp_enqueue_script( '
|
50 |
-
wp_enqueue_script( 'sis_js', SIS_URL.'js/sis.min.js', array('jquery','
|
51 |
-
|
52 |
-
// Add javascript translation
|
53 |
-
wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
|
54 |
|
55 |
// Add CSS
|
56 |
-
wp_enqueue_style( 'jquery-ui-sis', SIS_URL.'css/Aristo/jquery-ui-1.8.7.custom.css', array(), '1.8.7' );
|
57 |
-
wp_enqueue_style( 'sis_css', SIS_URL.'css/sis-style.css', array(), SIS_VERSION );
|
58 |
-
} elseif( $hook_suffix == 'upload.php' || ( $hook_suffix == '
|
59 |
// Add javascript
|
60 |
-
wp_enqueue_script( 'sis_js', SIS_URL.'js/sis-attachments.min.js', array( 'jquery' ), SIS_VERSION );
|
61 |
-
|
62 |
-
// Add javascript translation
|
63 |
-
wp_localize_script( 'sis_js', 'sis', $this->localizeVars() );
|
64 |
}
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -71,7 +74,7 @@ Class SISAdmin {
|
|
71 |
* @return void
|
72 |
* @author Nicolas Juen
|
73 |
*/
|
74 |
-
public function localizeVars() {
|
75 |
return array(
|
76 |
'ajaxUrl' => admin_url( '/admin-ajax.php' ),
|
77 |
'reading' => __( 'Reading attachments...', 'sis' ),
|
@@ -104,8 +107,22 @@ Class SISAdmin {
|
|
104 |
'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
|
105 |
'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
|
106 |
'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'sis' ),
|
|
|
107 |
);
|
108 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
/**
|
111 |
* Add action in media row
|
@@ -115,10 +132,10 @@ Class SISAdmin {
|
|
115 |
* @return $actions : array of actions and content to display
|
116 |
* @author Nicolas Juen
|
117 |
*/
|
118 |
-
function addActionsList( $actions, $object ) {
|
119 |
|
120 |
// Add action for regeneration
|
121 |
-
$actions['sis-regenerate'] = "<a href='#' class='sis-regenerate-one'>".__( 'Regenerate thumbnails', 'sis' )."</a>"
|
122 |
|
123 |
// Return actions
|
124 |
return $actions;
|
@@ -133,13 +150,14 @@ Class SISAdmin {
|
|
133 |
* @return void
|
134 |
* @author Nicolas Juen
|
135 |
*/
|
136 |
-
public function addSettingsLink( $links, $file ) {
|
137 |
|
138 |
-
if( $file != 'simple-image-sizes/simple_image_sizes.php' )
|
139 |
return $links;
|
|
|
140 |
|
141 |
$settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'sis' ).' </a>';
|
142 |
-
array_unshift($links, $settings_link);
|
143 |
|
144 |
return $links;
|
145 |
}
|
@@ -153,8 +171,9 @@ Class SISAdmin {
|
|
153 |
*/
|
154 |
function init() {
|
155 |
// Check if admin
|
156 |
-
if( !is_admin() )
|
157 |
return false;
|
|
|
158 |
|
159 |
// Get the image sizes
|
160 |
global $_wp_additional_image_sizes;
|
@@ -163,28 +182,18 @@ Class SISAdmin {
|
|
163 |
// Get the sizes and add the settings
|
164 |
foreach ( get_intermediate_image_sizes() as $s ) {
|
165 |
// Don't make the original sizes or numeric sizes that appear
|
166 |
-
if( in_array( $s,
|
167 |
continue;
|
|
|
168 |
|
169 |
// Set width
|
170 |
-
|
171 |
-
$width = intval( $_wp_additional_image_sizes[$s]['width'] );
|
172 |
-
else // For default sizes set in options
|
173 |
-
$width = get_option( "{$s}_size_w" );
|
174 |
|
175 |
// Set height
|
176 |
-
|
177 |
-
$height = intval( $_wp_additional_image_sizes[$s]['height'] );
|
178 |
-
else // For default sizes set in options
|
179 |
-
$height = get_option( "{$s}_size_h" );
|
180 |
|
181 |
//Set crop
|
182 |
-
|
183 |
-
$crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
|
184 |
-
} else {
|
185 |
-
// For default sizes set in options
|
186 |
-
$crop = get_option( "{$s}_crop" );
|
187 |
-
}
|
188 |
|
189 |
// Add the setting field for this size
|
190 |
add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'sis' ), $s ), array( &$this, 'imageSizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
|
@@ -196,9 +205,6 @@ Class SISAdmin {
|
|
196 |
// Add the button
|
197 |
add_settings_field( 'add_size_button', __( 'Add a new size', 'sis' ), array( &$this, 'addSizeButton' ), 'media' );
|
198 |
|
199 |
-
// Add legend
|
200 |
-
add_settings_field( 'add_legend', __( 'Legend of the sizes', 'sis' ), array( &$this, 'addLegend' ), 'media' );
|
201 |
-
|
202 |
// Add php button
|
203 |
add_settings_field( 'get_php_button', __( 'Get php for theme', 'sis' ), array( &$this, 'getPhpButton' ), 'media' );
|
204 |
|
@@ -220,7 +226,7 @@ Class SISAdmin {
|
|
220 |
return false;
|
221 |
|
222 |
// Get the options
|
223 |
-
$sizes = (array)get_option( SIS_OPTION );
|
224 |
|
225 |
// Get the vars
|
226 |
$height = isset( $sizes[$args['name']]['h'] )? $sizes[$args['name']]['h'] : $args['height'] ;
|
@@ -286,18 +292,6 @@ Class SISAdmin {
|
|
286 |
<p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'sis'); ?> </p>
|
287 |
<code></code>
|
288 |
<?php
|
289 |
-
}
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Add the legend fo the colors
|
293 |
-
*
|
294 |
-
* @access public
|
295 |
-
* @return void
|
296 |
-
* @author Nicolas Juen
|
297 |
-
*/
|
298 |
-
public function addLegend() { ?>
|
299 |
-
<?php _e('The images created on your theme are <span style="color:#F2A13A">orange</span> and your custom size are <span style="color:#89D76A"> green </span>.', 'sis'); ?>
|
300 |
-
<?php
|
301 |
}
|
302 |
|
303 |
/**
|
@@ -308,156 +302,11 @@ Class SISAdmin {
|
|
308 |
* @author Nicolas Juen
|
309 |
*/
|
310 |
public function thumbnailRegenerate() {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
<input type="hidden" class="getList" value='<?php echo wp_create_nonce( 'getList' ); ?>' />
|
317 |
-
<div id="sis-regen">
|
318 |
-
<div class="wrapper" style="">
|
319 |
-
<h4> <?php _e( 'Select which thumbnails you want to rebuild:', 'sis'); ?> </h4>
|
320 |
-
<table cellspacing="0" id="sis_sizes" class="widefat page fixed sis">
|
321 |
-
<thead>
|
322 |
-
<tr>
|
323 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
324 |
-
<th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
|
325 |
-
<th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
|
326 |
-
<th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
|
327 |
-
<th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
|
328 |
-
</tr>
|
329 |
-
</thead>
|
330 |
-
<tbody>
|
331 |
-
<?php
|
332 |
-
// Display the sizes in the array
|
333 |
-
foreach ( get_intermediate_image_sizes() as $s ):
|
334 |
-
// Don't make or numeric sizes that appear
|
335 |
-
if( is_integer( $s ) )
|
336 |
-
continue;
|
337 |
-
|
338 |
-
if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) // For theme-added sizes
|
339 |
-
$width = intval( $_wp_additional_image_sizes[$s]['width'] );
|
340 |
-
else // For default sizes set in options
|
341 |
-
$width = get_option( "{$s}_size_w" );
|
342 |
-
|
343 |
-
if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) // For theme-added sizes
|
344 |
-
$height = intval( $_wp_additional_image_sizes[$s]['height'] );
|
345 |
-
else // For default sizes set in options
|
346 |
-
$height = get_option( "{$s}_size_h" );
|
347 |
-
|
348 |
-
if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) // For theme-added sizes
|
349 |
-
$crop = intval( $_wp_additional_image_sizes[$s]['crop'] );
|
350 |
-
else // For default sizes set in options
|
351 |
-
$crop = get_option( "{$s}_crop" );
|
352 |
-
?>
|
353 |
-
<tr>
|
354 |
-
<th class="check-column">
|
355 |
-
<input type="checkbox" class="thumbnails" id="<?php echo esc_attr( $s ) ?>" name="thumbnails[]" checked="checked" value="<?php echo esc_attr( $s ); ?>" />
|
356 |
-
</th>
|
357 |
-
<th>
|
358 |
-
<label for="<?php esc_attr_e( $s ); ?>">
|
359 |
-
<?php echo esc_html( $s ); ?>
|
360 |
-
</label>
|
361 |
-
</th>
|
362 |
-
<th>
|
363 |
-
<label for="<?php esc_attr_e( $s ); ?>">
|
364 |
-
<?php echo esc_html( $width); ?> px
|
365 |
-
</label>
|
366 |
-
</th>
|
367 |
-
<th>
|
368 |
-
<label for="<?php esc_attr_e( $s ); ?>">
|
369 |
-
<?php echo esc_html( $height ); ?> px
|
370 |
-
</label>
|
371 |
-
</th>
|
372 |
-
<th>
|
373 |
-
<label for="<?php esc_attr_e( $s ); ?>">
|
374 |
-
<?php echo ( $crop == 1 )? __( 'yes', 'sis' ):__( 'no', 'sis' ); ?>
|
375 |
-
</label>
|
376 |
-
</th>
|
377 |
-
</tr>
|
378 |
-
<?php endforeach;?>
|
379 |
-
</tbody>
|
380 |
-
<tfoot>
|
381 |
-
<tr>
|
382 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
383 |
-
<th class="manage-column" scope="col"><?php _e( 'Size name', 'sis'); ?></th>
|
384 |
-
<th class="manage-column" scope="col"><?php _e( 'Width', 'sis'); ?></th>
|
385 |
-
<th class="manage-column" scope="col"><?php _e( 'Height', 'sis'); ?></th>
|
386 |
-
<th class="manage-column" scope="col"><?php _e( 'Crop ?', 'sis'); ?></th>
|
387 |
-
</tr>
|
388 |
-
</tfoot>
|
389 |
-
</table>
|
390 |
-
|
391 |
-
<h4><?php _e( 'Select which post type source thumbnails you want to rebuild:', 'sis'); ?></h4>
|
392 |
-
<table cellspacing="0" class="widefat page fixed sis">
|
393 |
-
<thead>
|
394 |
-
<tr>
|
395 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input checked="checked" type="checkbox"></th>
|
396 |
-
<th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
|
397 |
-
</tr>
|
398 |
-
</thead>
|
399 |
-
<tbody>
|
400 |
-
<?php
|
401 |
-
// Diplay the post types table
|
402 |
-
foreach ( get_post_types( array( 'public' => true, '_builtin' => false ), 'objects', 'or' ) as $ptype ):
|
403 |
-
// Avoid the post_types without post thumbnails feature
|
404 |
-
if( !array_key_exists( 'thumbnail' , $_wp_post_type_features[$ptype->name] ) || $_wp_post_type_features[$ptype->name] == false )
|
405 |
-
continue;
|
406 |
-
?>
|
407 |
-
<tr>
|
408 |
-
<th class="check-column">
|
409 |
-
<label for="<?php esc_attr_e( $ptype->name ); ?>">
|
410 |
-
<input type="checkbox" class="post_types" name="post_types[]" checked="checked" id="<?php echo esc_attr( $ptype->name ); ?>" value="<?php echo esc_attr( $ptype->name ); ?>" />
|
411 |
-
</label>
|
412 |
-
</th>
|
413 |
-
<th>
|
414 |
-
<label for="<?php esc_attr_e( $ptype->name ); ?>">
|
415 |
-
<em><?php echo esc_html( $ptype->labels->name ); ?></em>
|
416 |
-
</label>
|
417 |
-
</th>
|
418 |
-
</tr>
|
419 |
-
<?php endforeach;?>
|
420 |
-
</tbody>
|
421 |
-
<tfoot>
|
422 |
-
<tr>
|
423 |
-
<th scope="col" id="cb" class="manage-column column-cb check-column"><input checked="checked" type="checkbox"></th>
|
424 |
-
<th class="manage-column" scope="col"><?php _e( 'Post type', 'sis'); ?></th>
|
425 |
-
</tr>
|
426 |
-
</tfoot>
|
427 |
-
</table>
|
428 |
-
</div>
|
429 |
-
</div>
|
430 |
-
<div >
|
431 |
-
<div id="regenerate_message"></div>
|
432 |
-
<div class="progress">
|
433 |
-
<div class=" progress-percent ui-widget">
|
434 |
-
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
435 |
-
<p>
|
436 |
-
<span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
|
437 |
-
<span class="text">0%</span>
|
438 |
-
</p>
|
439 |
-
</div>
|
440 |
-
</div>
|
441 |
-
</div>
|
442 |
-
<div class="ui-widget" id="time">
|
443 |
-
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
|
444 |
-
<p>
|
445 |
-
<span class="ui-icon ui-icon-info" style="float: left; margin-right: .7em;"></span>
|
446 |
-
<span><strong><?php _e( 'End time calculated :', 'sis' ); ?></strong> <span class='time_message'>Calculating...</span> </span>
|
447 |
-
</p>
|
448 |
-
<ul class="messages"></ul>
|
449 |
-
</div>
|
450 |
-
</div>
|
451 |
-
<div id="error_messages">
|
452 |
-
<p>
|
453 |
-
<ol class="messages">
|
454 |
-
</ol>
|
455 |
-
</p>
|
456 |
-
</div>
|
457 |
-
<div id="thumb"><h4><?php _e( 'Last image:', 'sis'); ?></h4><img id="thumb-img" /></div>
|
458 |
-
<input type="button" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Regenerate Thumbnails', 'sis' ) ?>" />
|
459 |
-
</div>
|
460 |
-
<?php
|
461 |
}
|
462 |
|
463 |
/**
|
@@ -467,13 +316,13 @@ Class SISAdmin {
|
|
467 |
* @return void
|
468 |
* @author Nicolas Juen
|
469 |
*/
|
470 |
-
public function
|
471 |
|
472 |
// Get the nonce
|
473 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
474 |
|
475 |
// Get old options
|
476 |
-
$sizes = (array)get_option( SIS_OPTION );
|
477 |
|
478 |
// Check entries
|
479 |
$name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
|
@@ -485,14 +334,12 @@ Class SISAdmin {
|
|
485 |
|
486 |
// Check the nonce
|
487 |
if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
|
488 |
-
|
489 |
-
die();
|
490 |
}
|
491 |
|
492 |
// If no name given do not save
|
493 |
if( empty( $name ) ) {
|
494 |
-
|
495 |
-
die();
|
496 |
}
|
497 |
|
498 |
// Make values
|
@@ -500,8 +347,7 @@ Class SISAdmin {
|
|
500 |
|
501 |
// If the size have not changed return 2
|
502 |
if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
|
503 |
-
|
504 |
-
die();
|
505 |
}
|
506 |
|
507 |
// Put the new values
|
@@ -519,10 +365,10 @@ Class SISAdmin {
|
|
519 |
* @return void
|
520 |
* @author Nicolas Juen
|
521 |
*/
|
522 |
-
public function
|
523 |
|
524 |
// Get old options
|
525 |
-
$sizes = (array)get_option( SIS_OPTION );
|
526 |
|
527 |
// Get the nonce and name
|
528 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
@@ -530,8 +376,7 @@ Class SISAdmin {
|
|
530 |
|
531 |
// Check the nonce
|
532 |
if( !wp_verify_nonce( $nonce , 'delete_'.$name ) ) {
|
533 |
-
|
534 |
-
die();
|
535 |
}
|
536 |
|
537 |
// Remove the size
|
@@ -549,38 +394,96 @@ Class SISAdmin {
|
|
549 |
* @access public
|
550 |
* @return void
|
551 |
*/
|
552 |
-
public function
|
553 |
global $_wp_additional_image_sizes;
|
554 |
|
555 |
-
foreach ( get_intermediate_image_sizes() as $s )
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
|
561 |
-
|
562 |
-
$width = intval( $_wp_additional_image_sizes[$s]['width'] );
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
$crop = ( $crop == 0 )? 'false' : 'true' ;
|
577 |
-
?>
|
578 |
-
add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop ?> );<br />
|
579 |
-
<?php endforeach;
|
580 |
|
581 |
die();
|
582 |
}
|
583 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
/**
|
585 |
* Rebuild the image
|
586 |
*
|
@@ -588,92 +491,68 @@ Class SISAdmin {
|
|
588 |
* @return void
|
589 |
* @author Nicolas Juen
|
590 |
*/
|
591 |
-
public function
|
592 |
global $wpdb;
|
593 |
|
594 |
// Get the nonce
|
595 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
596 |
|
597 |
// Time a the begining
|
598 |
-
$start_time = microtime(true);
|
599 |
-
|
600 |
-
// Get the action
|
601 |
-
$action = $_POST["do"];
|
602 |
|
603 |
// Get the thumbnails
|
604 |
$thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
|
605 |
-
|
606 |
-
if ( $action == "getlist" ) {
|
607 |
-
// Check the nonce
|
608 |
-
if( !wp_verify_nonce( $nonce , 'getList' ) ) {
|
609 |
-
echo json_encode( array( ) );
|
610 |
-
die();
|
611 |
-
}
|
612 |
-
|
613 |
-
if ( isset( $_POST['post_types'] ) && !empty( $_POST['post_types'] ) ) {
|
614 |
-
|
615 |
-
// Get image medias
|
616 |
-
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
617 |
-
|
618 |
-
// Get all parent from post type
|
619 |
-
$attachments = $wpdb->get_results( "SELECT *
|
620 |
-
FROM $wpdb->posts
|
621 |
-
WHERE 1 = 1
|
622 |
-
AND post_type = 'attachment'
|
623 |
-
$whichmimetype
|
624 |
-
AND post_parent IN (
|
625 |
-
SELECT DISTINCT ID
|
626 |
-
FROM $wpdb->posts
|
627 |
-
WHERE post_type IN ('".implode( "', '", $_POST['post_types'] )."')
|
628 |
-
)" );
|
629 |
-
|
630 |
-
} else {
|
631 |
-
$attachments =& get_children( array(
|
632 |
-
'post_type' => 'attachment',
|
633 |
-
'post_mime_type' => 'image',
|
634 |
-
'numberposts' => -1,
|
635 |
-
'post_status' => null,
|
636 |
-
'post_parent' => null, // any parent
|
637 |
-
'output' => 'object',
|
638 |
-
) );
|
639 |
-
}
|
640 |
-
|
641 |
-
// Get the attachments
|
642 |
-
foreach ( $attachments as $attachment ) {
|
643 |
-
$res[] = array('id' => $attachment->ID, 'title' => $attachment->post_title);
|
644 |
-
}
|
645 |
-
// Return the Id's and Title of medias
|
646 |
-
die( json_encode( $res ) );
|
647 |
-
} else if ( $action == "regen" ) {
|
648 |
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
}
|
674 |
-
|
675 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
}
|
678 |
|
679 |
/**
|
@@ -685,7 +564,7 @@ Class SISAdmin {
|
|
685 |
* @param string $file Filepath of the Attached image.
|
686 |
* @return mixed Metadata for attachment.
|
687 |
*/
|
688 |
-
public function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
|
689 |
$attachment = get_post( $attachment_id );
|
690 |
|
691 |
$meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
|
@@ -735,8 +614,9 @@ Class SISAdmin {
|
|
735 |
unset( $meta_datas['size'][$size] );
|
736 |
}
|
737 |
|
738 |
-
if ( $resized )
|
739 |
$metadata['sizes'][$size] = $resized;
|
|
|
740 |
}
|
741 |
|
742 |
// Only if not all sizes
|
@@ -749,8 +629,9 @@ Class SISAdmin {
|
|
749 |
|
750 |
// fetch additional metadata from exif/iptc
|
751 |
$image_meta = wp_read_image_metadata( $file );
|
752 |
-
if ( $image_meta )
|
753 |
$metadata['image_meta'] = $image_meta;
|
|
|
754 |
}
|
755 |
|
756 |
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
@@ -766,17 +647,17 @@ Class SISAdmin {
|
|
766 |
* @author Nicolas Juen
|
767 |
* @author Additional Image Sizes (zui)
|
768 |
*/
|
769 |
-
public function sizesInForm( $form_fields, $post ) {
|
770 |
// Protect from being view in Media editor where there are no sizes
|
771 |
if ( isset( $form_fields['image-size'] ) ) {
|
772 |
$out = NULL;
|
773 |
$size_names = array();
|
774 |
-
$sizes_custom = get_option( SIS_OPTION );
|
775 |
|
776 |
if ( is_array( $sizes_custom ) ) {
|
777 |
foreach( $sizes_custom as $key => $value ) {
|
778 |
if( isset( $value['s'] ) && $value['s'] == 1 ) {
|
779 |
-
$size_names[$key] =
|
780 |
}
|
781 |
}
|
782 |
}
|
@@ -784,12 +665,11 @@ Class SISAdmin {
|
|
784 |
$downsize = image_downsize( $post->ID, $size );
|
785 |
|
786 |
// is this size selectable?
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
// We must do a clumsy search of the existing html to determine is something has been checked yet
|
791 |
-
if ( FALSE === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
|
792 |
|
|
|
|
|
793 |
if ( empty($check) )
|
794 |
$check = get_user_setting( 'imgsize' ); // See if they checked a custom size last time
|
795 |
|
@@ -818,7 +698,7 @@ Class SISAdmin {
|
|
818 |
|
819 |
$out .= $html;
|
820 |
}
|
821 |
-
|
822 |
} // End protect from Media editor
|
823 |
|
824 |
return $form_fields;
|
@@ -834,9 +714,9 @@ Class SISAdmin {
|
|
834 |
* @author Nicolas Juen
|
835 |
* @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
|
836 |
*/
|
837 |
-
function AddThumbnailName($sizes) {
|
838 |
// Get options
|
839 |
-
$sizes_custom = get_option( SIS_OPTION );
|
840 |
// init size array
|
841 |
$addsizes = array();
|
842 |
|
@@ -844,8 +724,9 @@ Class SISAdmin {
|
|
844 |
if ( is_array( $sizes_custom ) && !empty( $sizes_custom ) ) {
|
845 |
foreach( $sizes_custom as $key => $value ) {
|
846 |
// If we show this size in the admin
|
847 |
-
if( isset( $value['s'] ) && $value['s'] == 1 )
|
848 |
-
$addsizes[$key] =
|
|
|
849 |
}
|
850 |
}
|
851 |
|
@@ -865,7 +746,7 @@ Class SISAdmin {
|
|
865 |
* @since 2.3
|
866 |
* @author Nicolas Juen
|
867 |
*/
|
868 |
-
private function _getThumbnailName( $thumbnailSlug = '' ) {
|
869 |
|
870 |
// get the options
|
871 |
$sizes_custom = get_option( SIS_OPTION );
|
@@ -894,21 +775,37 @@ Class SISAdmin {
|
|
894 |
* @since 2.3.1
|
895 |
* @author Nicolas Juen
|
896 |
*/
|
897 |
-
function addFieldRegenerate( $fields, $post ) {
|
898 |
// Check this is an image
|
899 |
-
if( strpos( $post->post_mime_type, 'image' ) === false )
|
900 |
return $fields;
|
|
|
901 |
|
902 |
$fields['sis-regenerate'] = array(
|
903 |
'label' => __( 'Regenerate Thumbnails', 'sis' ),
|
904 |
'input' => 'html',
|
905 |
'html' => '
|
906 |
-
<input type="button" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'sis' ).'" />
|
907 |
<span class="title"><em></em></span>
|
908 |
-
<input type="hidden" class="regen" value="'.wp_create_nonce( 'regen' ).'" />
|
909 |
-
'
|
|
|
910 |
);
|
911 |
return $fields;
|
912 |
}
|
913 |
-
|
914 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
Class SISAdmin {
|
3 |
|
4 |
// Original sizes
|
5 |
+
public static $original = array( 'thumbnail', 'medium', 'large' );
|
6 |
|
7 |
public function __construct(){
|
8 |
// Init
|
9 |
add_action ( 'admin_menu', array( &$this, 'init' ) );
|
10 |
+
add_action ( 'admin_enqueue_scripts', array( __CLASS__, 'registerScripts' ), 11 );
|
11 |
+
|
12 |
+
// Add underscore template
|
13 |
+
add_action( 'admin_footer', array( __CLASS__, 'addTemplate' ) );
|
14 |
|
15 |
// Add ajax action
|
16 |
+
// Option page
|
17 |
+
add_action( 'wp_ajax_'.'sis_get_list', array( __CLASS__, 'a_GetList' ) );
|
18 |
+
add_action( 'wp_ajax_'.'sis_rebuild_image', array( __CLASS__, 'a_ThumbnailRebuild' ) );
|
19 |
+
add_action( 'wp_ajax_'.'sis_get_sizes', array( __CLASS__, 'a_GetSizes' ) );
|
20 |
+
add_action( 'wp_ajax_'.'sis_add_size', array( __CLASS__, 'a_AddSize' ) );
|
21 |
+
add_action( 'wp_ajax_'.'sis_remove_size', array( __CLASS__, 'a_RemoveSize' ) );
|
22 |
|
23 |
// Add image sizes in the form, check if 3.3 is installed or not
|
24 |
if( !function_exists( 'is_main_query' ) ) {
|
25 |
+
add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'sizesInForm' ), 11, 2 ); // Add our sizes to media forms
|
26 |
} else {
|
27 |
+
add_filter( 'image_size_names_choose', array( __CLASS__, 'AddThumbnailName' ) );
|
28 |
}
|
29 |
|
30 |
// Add link in plugins list
|
31 |
+
add_filter( 'plugin_action_links', array( __CLASS__,'addSettingsLink' ), 10, 2 );
|
32 |
|
33 |
// Add action in media row quick actions
|
34 |
+
add_filter( 'media_row_actions', array( __CLASS__, 'addActionsList' ), 10, 2 );
|
35 |
|
36 |
// Add filter for the Media single
|
37 |
+
add_filter( 'attachment_fields_to_edit', array( __CLASS__, 'addFieldRegenerate' ), 9, 2 );
|
38 |
|
39 |
}
|
40 |
|
45 |
* @return void
|
46 |
* @author Nicolas Juen
|
47 |
*/
|
48 |
+
public static function registerScripts( $hook_suffix = '' ) {
|
49 |
+
if( !isset( $hook_suffix ) || empty( $hook_suffix ) ) {
|
50 |
return false;
|
51 |
+
}
|
52 |
|
53 |
if( $hook_suffix == 'options-media.php' ) {
|
54 |
// Add javascript
|
55 |
+
wp_enqueue_script( 'underscore', 'http//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.3/underscore-min.js' , array(), '1.4.3' );
|
56 |
+
wp_enqueue_script( 'sis_js', SIS_URL.'/js/sis.min.js', array( 'jquery', 'jquery-ui-button', 'jquery-ui-progressbar', 'underscore' ), SIS_VERSION );
|
|
|
|
|
|
|
57 |
|
58 |
// Add CSS
|
59 |
+
wp_enqueue_style( 'jquery-ui-sis', SIS_URL.'/css/Aristo/jquery-ui-1.8.7.custom.css', array(), '1.8.7' );
|
60 |
+
wp_enqueue_style( 'sis_css', SIS_URL.'/css/sis-style.css', array(), SIS_VERSION );
|
61 |
+
} elseif( $hook_suffix == 'upload.php' || ( $hook_suffix == 'post.php' && isset( $_GET['post'] ) && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) ) {
|
62 |
// Add javascript
|
63 |
+
wp_enqueue_script( 'sis_js', SIS_URL.'/js/sis-attachments.min.js', array( 'jquery' ), SIS_VERSION );
|
|
|
|
|
|
|
64 |
}
|
65 |
+
|
66 |
+
// Add javascript translation
|
67 |
+
wp_localize_script( 'sis_js', 'sis', self::localizeVars() );
|
68 |
}
|
69 |
|
70 |
/**
|
74 |
* @return void
|
75 |
* @author Nicolas Juen
|
76 |
*/
|
77 |
+
public static function localizeVars() {
|
78 |
return array(
|
79 |
'ajaxUrl' => admin_url( '/admin-ajax.php' ),
|
80 |
'reading' => __( 'Reading attachments...', 'sis' ),
|
107 |
'phpError' => __( 'Error during the php treatment, be sure to not have php errors in your page', 'sis' ),
|
108 |
'notSaved' => __( 'All the sizes you have modifed are not saved, continue anyway ?', 'sis' ),
|
109 |
'soloRegenerated' => __( 'This image has been regenerated in %s seconds', 'sis' ),
|
110 |
+
'regen_one' => wp_create_nonce( 'regen' )
|
111 |
);
|
112 |
}
|
113 |
+
|
114 |
+
public static function addTemplate() {
|
115 |
+
global $pagenow;
|
116 |
+
if( $pagenow != 'options-media.php' ) {
|
117 |
+
return false;
|
118 |
+
}
|
119 |
+
|
120 |
+
if( is_file( SIS_DIR.'/templates/admin-js.html' ) ) {
|
121 |
+
include( SIS_DIR.'/templates/admin-js.html' );
|
122 |
+
}
|
123 |
+
|
124 |
+
return true;
|
125 |
+
}
|
126 |
|
127 |
/**
|
128 |
* Add action in media row
|
132 |
* @return $actions : array of actions and content to display
|
133 |
* @author Nicolas Juen
|
134 |
*/
|
135 |
+
public static function addActionsList( $actions, $object ) {
|
136 |
|
137 |
// Add action for regeneration
|
138 |
+
$actions['sis-regenerate'] = "<a href='#' data-id='".$object->ID."' class='sis-regenerate-one'>".__( 'Regenerate thumbnails', 'sis' )."</a>";
|
139 |
|
140 |
// Return actions
|
141 |
return $actions;
|
150 |
* @return void
|
151 |
* @author Nicolas Juen
|
152 |
*/
|
153 |
+
public static function addSettingsLink( $links, $file ) {
|
154 |
|
155 |
+
if( $file != 'simple-image-sizes/simple_image_sizes.php' ) {
|
156 |
return $links;
|
157 |
+
}
|
158 |
|
159 |
$settings_link = '<a href="'.admin_url('options-media.php').'"> '.__( 'Settings', 'sis' ).' </a>';
|
160 |
+
array_unshift( $links, $settings_link );
|
161 |
|
162 |
return $links;
|
163 |
}
|
171 |
*/
|
172 |
function init() {
|
173 |
// Check if admin
|
174 |
+
if( !is_admin() ) {
|
175 |
return false;
|
176 |
+
}
|
177 |
|
178 |
// Get the image sizes
|
179 |
global $_wp_additional_image_sizes;
|
182 |
// Get the sizes and add the settings
|
183 |
foreach ( get_intermediate_image_sizes() as $s ) {
|
184 |
// Don't make the original sizes or numeric sizes that appear
|
185 |
+
if( in_array( $s, self::$original ) || is_integer( $s ) ) {
|
186 |
continue;
|
187 |
+
}
|
188 |
|
189 |
// Set width
|
190 |
+
$width = isset( $_wp_additional_image_sizes[$s]['width'] ) ? intval( $_wp_additional_image_sizes[$s]['width'] ) : get_option( "{$s}_size_w" ) ;
|
|
|
|
|
|
|
191 |
|
192 |
// Set height
|
193 |
+
$height = isset( $_wp_additional_image_sizes[$s]['height'] ) ? intval( $_wp_additional_image_sizes[$s]['height'] ) : get_option( "{$s}_size_h" ) ;
|
|
|
|
|
|
|
194 |
|
195 |
//Set crop
|
196 |
+
$crop = isset( $_wp_additional_image_sizes[$s]['crop'] ) ? intval( $_wp_additional_image_sizes[$s]['crop'] ) : get_option( "{$s}_crop" ) ;
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
// Add the setting field for this size
|
199 |
add_settings_field( 'image_size_'.$s, sprintf( __( '%s size', 'sis' ), $s ), array( &$this, 'imageSizes' ), 'media' , 'default', array( 'name' => $s , 'width' => $width , 'height' => $height, 'c' => $crop ) );
|
205 |
// Add the button
|
206 |
add_settings_field( 'add_size_button', __( 'Add a new size', 'sis' ), array( &$this, 'addSizeButton' ), 'media' );
|
207 |
|
|
|
|
|
|
|
208 |
// Add php button
|
209 |
add_settings_field( 'get_php_button', __( 'Get php for theme', 'sis' ), array( &$this, 'getPhpButton' ), 'media' );
|
210 |
|
226 |
return false;
|
227 |
|
228 |
// Get the options
|
229 |
+
$sizes = (array)get_option( SIS_OPTION, array() );
|
230 |
|
231 |
// Get the vars
|
232 |
$height = isset( $sizes[$args['name']]['h'] )? $sizes[$args['name']]['h'] : $args['height'] ;
|
292 |
<p> <?php _e( 'Copy and paste the code below into your Wordpress theme function file if you wanted to save them and deactivate the plugin.', 'sis'); ?> </p>
|
293 |
<code></code>
|
294 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
}
|
296 |
|
297 |
/**
|
302 |
* @author Nicolas Juen
|
303 |
*/
|
304 |
public function thumbnailRegenerate() {
|
305 |
+
if( is_file( SIS_DIR.'/templates/options-media.php' ) ) {
|
306 |
+
include( SIS_DIR.'/templates/options-media.php' );
|
307 |
+
} else {
|
308 |
+
echo _esc_html_e( 'Admin option-media template missing' );
|
309 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
|
312 |
/**
|
316 |
* @return void
|
317 |
* @author Nicolas Juen
|
318 |
*/
|
319 |
+
public static function a_AddSize() {
|
320 |
|
321 |
// Get the nonce
|
322 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
323 |
|
324 |
// Get old options
|
325 |
+
$sizes = (array)get_option( SIS_OPTION, array() );
|
326 |
|
327 |
// Check entries
|
328 |
$name = isset( $_POST['name'] ) ? sanitize_title( $_POST['name'] ): '' ;
|
334 |
|
335 |
// Check the nonce
|
336 |
if( !wp_verify_nonce( $nonce , 'add_size' ) ) {
|
337 |
+
die(0);
|
|
|
338 |
}
|
339 |
|
340 |
// If no name given do not save
|
341 |
if( empty( $name ) ) {
|
342 |
+
die(0);
|
|
|
343 |
}
|
344 |
|
345 |
// Make values
|
347 |
|
348 |
// If the size have not changed return 2
|
349 |
if( isset( $sizes[$name] ) && $sizes[$name] === $values ) {
|
350 |
+
die(2);
|
|
|
351 |
}
|
352 |
|
353 |
// Put the new values
|
365 |
* @return void
|
366 |
* @author Nicolas Juen
|
367 |
*/
|
368 |
+
public static function a_RemoveSize() {
|
369 |
|
370 |
// Get old options
|
371 |
+
$sizes = (array)get_option( SIS_OPTION, array() );
|
372 |
|
373 |
// Get the nonce and name
|
374 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
376 |
|
377 |
// Check the nonce
|
378 |
if( !wp_verify_nonce( $nonce , 'delete_'.$name ) ) {
|
379 |
+
die(0);
|
|
|
380 |
}
|
381 |
|
382 |
// Remove the size
|
394 |
* @access public
|
395 |
* @return void
|
396 |
*/
|
397 |
+
public static function a_GetSizes() {
|
398 |
global $_wp_additional_image_sizes;
|
399 |
|
400 |
+
foreach ( get_intermediate_image_sizes() as $s ) {
|
401 |
+
// Don't make the original sizes
|
402 |
+
if( in_array( $s, self::$original ) ) {
|
403 |
+
continue;
|
404 |
+
}
|
405 |
|
406 |
+
// Set width
|
407 |
+
$width = isset( $_wp_additional_image_sizes[$s]['width'] ) ? intval( $_wp_additional_image_sizes[$s]['width'] ) : get_option( "{$s}_size_w" ) ;
|
408 |
+
|
409 |
+
// Set height
|
410 |
+
$height = isset( $_wp_additional_image_sizes[$s]['height'] ) ? intval( $_wp_additional_image_sizes[$s]['height'] ) : get_option( "{$s}_size_h" ) ;
|
411 |
+
|
412 |
+
//Set crop
|
413 |
+
$crop = isset( $_wp_additional_image_sizes[$s]['crop'] ) ? intval( $_wp_additional_image_sizes[$s]['crop'] ) : get_option( "{$s}_crop" ) ;
|
414 |
+
|
415 |
+
$crop = ( $crop == 0 )? 'false' : 'true' ;
|
416 |
+
?>
|
417 |
+
add_image_size( '<?php echo $s; ?>', '<?php echo $width; ?>', '<?php echo $height; ?>', <?php echo $crop ?> );<br />
|
418 |
+
<?php
|
419 |
+
}
|
|
|
|
|
|
|
|
|
|
|
420 |
|
421 |
die();
|
422 |
}
|
423 |
+
/**
|
424 |
+
*
|
425 |
+
* Get the media list to regenerate
|
426 |
+
*
|
427 |
+
* @param : void
|
428 |
+
* @return oid
|
429 |
+
*/
|
430 |
+
public static function a_GetList() {
|
431 |
+
global $wpdb;
|
432 |
+
// Basic vars
|
433 |
+
$res = array();
|
434 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
435 |
+
|
436 |
+
// Check the nonce
|
437 |
+
if( !wp_verify_nonce( $nonce , 'getList' ) ) {
|
438 |
+
self::displayJson();
|
439 |
+
}
|
440 |
+
|
441 |
+
if ( isset( $_POST['post_types'] ) && !empty( $_POST['post_types'] ) ) {
|
442 |
+
|
443 |
+
foreach( $_POST['post_types'] as $key => $type ) {
|
444 |
+
if( !post_type_exists( $type ) ) {
|
445 |
+
unset( $_POST['post_types'][$key] );
|
446 |
+
}
|
447 |
+
}
|
448 |
+
|
449 |
+
if( empty( $_POST['post_types'][$key]) ) {
|
450 |
+
self::displayJson();
|
451 |
+
}
|
452 |
+
|
453 |
+
// Get image medias
|
454 |
+
$whichmimetype = wp_post_mime_type_where( 'image', $wpdb->posts );
|
455 |
+
|
456 |
+
// Get all parent from post type
|
457 |
+
$attachments = $wpdb->get_results( "SELECT *
|
458 |
+
FROM $wpdb->posts
|
459 |
+
WHERE 1 = 1
|
460 |
+
AND post_type = 'attachment'
|
461 |
+
$whichmimetype
|
462 |
+
AND post_parent IN (
|
463 |
+
SELECT DISTINCT ID
|
464 |
+
FROM $wpdb->posts
|
465 |
+
WHERE post_type IN ('".implode( "', '", $_POST['post_types'] )."')
|
466 |
+
)" );
|
467 |
+
|
468 |
+
} else {
|
469 |
+
$attachments =& get_children( array(
|
470 |
+
'post_type' => 'attachment',
|
471 |
+
'post_mime_type' => 'image',
|
472 |
+
'numberposts' => -1,
|
473 |
+
'post_status' => null,
|
474 |
+
'post_parent' => null, // any parent
|
475 |
+
'output' => 'object',
|
476 |
+
) );
|
477 |
+
}
|
478 |
+
|
479 |
+
// Get the attachments
|
480 |
+
foreach ( $attachments as $attachment ) {
|
481 |
+
$res[] = array( 'id' => $attachment->ID, 'title' => $attachment->post_title );
|
482 |
+
}
|
483 |
+
// Return the Id's and Title of medias
|
484 |
+
self::displayJson( $res );
|
485 |
+
}
|
486 |
+
|
487 |
/**
|
488 |
* Rebuild the image
|
489 |
*
|
491 |
* @return void
|
492 |
* @author Nicolas Juen
|
493 |
*/
|
494 |
+
public static function a_ThumbnailRebuild() {
|
495 |
global $wpdb;
|
496 |
|
497 |
// Get the nonce
|
498 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce']: '' ;
|
499 |
|
500 |
// Time a the begining
|
501 |
+
$start_time = microtime( true );
|
|
|
|
|
|
|
502 |
|
503 |
// Get the thumbnails
|
504 |
$thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
+
// Check the nonce
|
507 |
+
if( !wp_verify_nonce( $nonce , 'regen' ) ) {
|
508 |
+
self::displayJson( array( 'error' => _e( 'Trying to cheat ?', 'sis' ) ) );
|
509 |
+
}
|
510 |
+
|
511 |
+
// Get the id
|
512 |
+
$id = isset( $_POST["id"] ) ? $_POST["id"] : 0 ;
|
513 |
+
|
514 |
+
// Check Id
|
515 |
+
if( (int)$id <= 0 ) {
|
516 |
+
self::displayJson(
|
517 |
+
array(
|
518 |
+
'time' => round( microtime( true ) - $start_time, 4 ),
|
519 |
+
'error' => __( 'No id given in POST datas.', 'sis' )
|
520 |
+
)
|
521 |
+
);
|
522 |
+
}
|
523 |
+
|
524 |
+
// Get the path
|
525 |
+
$fullsizepath = get_attached_file( $id );
|
526 |
+
|
527 |
+
// Regen the attachment
|
528 |
+
if ( false !== $fullsizepath && @file_exists( $fullsizepath ) ) {
|
529 |
+
set_time_limit( 60 );
|
530 |
+
if( wp_update_attachment_metadata( $id, self::wp_generate_attachment_metadata_custom( $id, $fullsizepath, $thumbnails ) ) == false ) {
|
531 |
+
self::displayJson(
|
532 |
+
array(
|
533 |
+
'src' => wp_get_attachment_thumb_url( $id ),
|
534 |
+
'time' => round( microtime( true ) - $start_time, 4 ),
|
535 |
+
'message' => sprintf( __( 'This file already exists in this size and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'sis'), get_edit_post_link( $id ), get_the_title( $id ) )
|
536 |
+
)
|
537 |
+
);
|
538 |
}
|
539 |
+
} else {
|
540 |
+
self::displayJson(
|
541 |
+
array(
|
542 |
+
'src' => wp_get_attachment_thumb_url( $id ),
|
543 |
+
'time' => round( microtime( true ) - $start_time, 4 ),
|
544 |
+
'error' => sprintf( __( 'This file does not exists and have not been regenerated :<br/><a target="_blank" href="%1$s" >%2$s</a>', 'sis'), get_edit_post_link( $id ), get_the_title( $id ) )
|
545 |
+
)
|
546 |
+
);
|
547 |
}
|
548 |
+
// Display the attachment url for feedback
|
549 |
+
self::displayJson(
|
550 |
+
array(
|
551 |
+
'time' => round( microtime( true ) - $start_time, 4 ) ,
|
552 |
+
'src' => wp_get_attachment_thumb_url( $id ),
|
553 |
+
'title' => get_the_title( $id )
|
554 |
+
)
|
555 |
+
);
|
556 |
}
|
557 |
|
558 |
/**
|
564 |
* @param string $file Filepath of the Attached image.
|
565 |
* @return mixed Metadata for attachment.
|
566 |
*/
|
567 |
+
public static function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
|
568 |
$attachment = get_post( $attachment_id );
|
569 |
|
570 |
$meta_datas = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
|
614 |
unset( $meta_datas['size'][$size] );
|
615 |
}
|
616 |
|
617 |
+
if ( $resized ) {
|
618 |
$metadata['sizes'][$size] = $resized;
|
619 |
+
}
|
620 |
}
|
621 |
|
622 |
// Only if not all sizes
|
629 |
|
630 |
// fetch additional metadata from exif/iptc
|
631 |
$image_meta = wp_read_image_metadata( $file );
|
632 |
+
if ( $image_meta ) {
|
633 |
$metadata['image_meta'] = $image_meta;
|
634 |
+
}
|
635 |
}
|
636 |
|
637 |
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
647 |
* @author Nicolas Juen
|
648 |
* @author Additional Image Sizes (zui)
|
649 |
*/
|
650 |
+
public static function sizesInForm( $form_fields, $post ) {
|
651 |
// Protect from being view in Media editor where there are no sizes
|
652 |
if ( isset( $form_fields['image-size'] ) ) {
|
653 |
$out = NULL;
|
654 |
$size_names = array();
|
655 |
+
$sizes_custom = get_option( SIS_OPTION, array() );
|
656 |
|
657 |
if ( is_array( $sizes_custom ) ) {
|
658 |
foreach( $sizes_custom as $key => $value ) {
|
659 |
if( isset( $value['s'] ) && $value['s'] == 1 ) {
|
660 |
+
$size_names[$key] = self::_getThumbnailName( $key );;
|
661 |
}
|
662 |
}
|
663 |
}
|
665 |
$downsize = image_downsize( $post->ID, $size );
|
666 |
|
667 |
// is this size selectable?
|
668 |
+
$enabled = ( $downsize[3] || 'full' == $size );
|
669 |
+
$css_id = "image-size-{$size}-{$post->ID}";
|
|
|
|
|
|
|
670 |
|
671 |
+
// We must do a clumsy search of the existing html to determine is something has been checked yet
|
672 |
+
if ( FALSE === strpos( 'checked="checked"', $form_fields['image-size']['html'] ) ) {
|
673 |
if ( empty($check) )
|
674 |
$check = get_user_setting( 'imgsize' ); // See if they checked a custom size last time
|
675 |
|
698 |
|
699 |
$out .= $html;
|
700 |
}
|
701 |
+
$form_fields['image-size']['html'] .= $out;
|
702 |
} // End protect from Media editor
|
703 |
|
704 |
return $form_fields;
|
714 |
* @author Nicolas Juen
|
715 |
* @author radeno based on this post : http://www.wpmayor.com/wordpress-hacks/how-to-add-custom-image-sizes-to-wordpress-uploader/
|
716 |
*/
|
717 |
+
public static function AddThumbnailName($sizes) {
|
718 |
// Get options
|
719 |
+
$sizes_custom = get_option( SIS_OPTION, array() );
|
720 |
// init size array
|
721 |
$addsizes = array();
|
722 |
|
724 |
if ( is_array( $sizes_custom ) && !empty( $sizes_custom ) ) {
|
725 |
foreach( $sizes_custom as $key => $value ) {
|
726 |
// If we show this size in the admin
|
727 |
+
if( isset( $value['s'] ) && $value['s'] == 1 ) {
|
728 |
+
$addsizes[$key] = self::_getThumbnailName( $key );
|
729 |
+
}
|
730 |
}
|
731 |
}
|
732 |
|
746 |
* @since 2.3
|
747 |
* @author Nicolas Juen
|
748 |
*/
|
749 |
+
private static function _getThumbnailName( $thumbnailSlug = '' ) {
|
750 |
|
751 |
// get the options
|
752 |
$sizes_custom = get_option( SIS_OPTION );
|
775 |
* @since 2.3.1
|
776 |
* @author Nicolas Juen
|
777 |
*/
|
778 |
+
public static function addFieldRegenerate( $fields, $post ) {
|
779 |
// Check this is an image
|
780 |
+
if( strpos( $post->post_mime_type, 'image' ) === false ) {
|
781 |
return $fields;
|
782 |
+
}
|
783 |
|
784 |
$fields['sis-regenerate'] = array(
|
785 |
'label' => __( 'Regenerate Thumbnails', 'sis' ),
|
786 |
'input' => 'html',
|
787 |
'html' => '
|
788 |
+
<input type="button" data-id="'.$post->ID.'" class="button title sis-regenerate-one" value="'.__( 'Regenerate Thumbnails', 'sis' ).'" />
|
789 |
<span class="title"><em></em></span>
|
790 |
+
<input type="hidden" class="regen" value="'.wp_create_nonce( 'regen' ).'" />',
|
791 |
+
'show_in_edit' => true,
|
792 |
+
'show_in_modal' => false,
|
793 |
);
|
794 |
return $fields;
|
795 |
}
|
796 |
+
|
797 |
+
/**
|
798 |
+
* Display a json encoded element with right headers
|
799 |
+
*
|
800 |
+
* @param $data(optional) : the element to display ( if needed )
|
801 |
+
* @return void
|
802 |
+
* @author Nicolas Juen
|
803 |
+
*/
|
804 |
+
private static function displayJson( $data = array() ) {
|
805 |
+
header('Cache-Control: no-cache, must-revalidate');
|
806 |
+
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
807 |
+
header('Content-type: application/json');
|
808 |
+
echo json_encode( $data );
|
809 |
+
die();
|
810 |
+
}
|
811 |
+
}
|
inc/class.client.php
CHANGED
@@ -5,7 +5,7 @@ Class SISClient {
|
|
5 |
var $original = array( 'thumbnail', 'medium', 'large' );
|
6 |
|
7 |
function __construct() {
|
8 |
-
add_action ( 'init', array(
|
9 |
}
|
10 |
|
11 |
/**
|
@@ -15,22 +15,19 @@ Class SISClient {
|
|
15 |
* @return void
|
16 |
* @author Nicolas Juen
|
17 |
*/
|
18 |
-
function init() {
|
19 |
// Get inital options
|
20 |
-
$sizes = get_option(
|
21 |
|
22 |
// Return flase if empty
|
23 |
-
if( empty( $sizes ) || !is_array( $sizes ) )
|
24 |
return false;
|
|
|
25 |
|
26 |
// Set the new sizes
|
27 |
-
foreach( $sizes as $name => $size ){
|
28 |
-
// Get cropping
|
29 |
-
$crop = ( isset( $size['c'] ) && !empty( $size['c'] ) )? $size['c'] : 0 ;
|
30 |
-
|
31 |
// Add the images sizes
|
32 |
-
add_image_size( $name, $size['w'], $size['h'], $
|
33 |
-
}
|
34 |
}
|
35 |
-
}
|
36 |
-
?>
|
5 |
var $original = array( 'thumbnail', 'medium', 'large' );
|
6 |
|
7 |
function __construct() {
|
8 |
+
add_action ( 'init', array( __CLASS__, 'init' ) );
|
9 |
}
|
10 |
|
11 |
/**
|
15 |
* @return void
|
16 |
* @author Nicolas Juen
|
17 |
*/
|
18 |
+
public static function init() {
|
19 |
// Get inital options
|
20 |
+
$sizes = get_option( SIS_OPTION, array() );
|
21 |
|
22 |
// Return flase if empty
|
23 |
+
if( empty( $sizes ) || !is_array( $sizes ) ) {
|
24 |
return false;
|
25 |
+
}
|
26 |
|
27 |
// Set the new sizes
|
28 |
+
foreach( $sizes as $name => $size ) {
|
|
|
|
|
|
|
29 |
// Add the images sizes
|
30 |
+
add_image_size( $name, $size['w'], $size['h'], ( isset( $size['c'] ) && !empty( $size['c'] ) )? $size['c'] : 0 );
|
31 |
+
}
|
32 |
}
|
33 |
+
}
|
|
js/jquery-ui-1.8.16.custom.min.js
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery UI 1.8.16
|
3 |
-
*
|
4 |
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6 |
-
* http://jquery.org/license
|
7 |
-
*
|
8 |
-
* http://docs.jquery.com/UI
|
9 |
-
*/
|
10 |
-
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
|
11 |
-
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
|
12 |
-
this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
|
13 |
-
"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
|
14 |
-
"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
|
15 |
-
outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
|
16 |
-
"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
|
17 |
-
a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
|
18 |
-
c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
19 |
-
;/*!
|
20 |
-
* jQuery UI Widget 1.8.16
|
21 |
-
*
|
22 |
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
23 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
24 |
-
* http://jquery.org/license
|
25 |
-
*
|
26 |
-
* http://docs.jquery.com/UI/Widget
|
27 |
-
*/
|
28 |
-
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
|
29 |
-
function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
|
30 |
-
d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
|
31 |
-
b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
|
32 |
-
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
|
33 |
-
c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
34 |
-
;/*
|
35 |
-
* jQuery UI Button 1.8.16
|
36 |
-
*
|
37 |
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
38 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
39 |
-
* http://jquery.org/license
|
40 |
-
*
|
41 |
-
* http://docs.jquery.com/UI/Button
|
42 |
-
*
|
43 |
-
* Depends:
|
44 |
-
* jquery.ui.core.js
|
45 |
-
* jquery.ui.widget.js
|
46 |
-
*/
|
47 |
-
(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
|
48 |
-
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
|
49 |
-
this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
|
50 |
-
false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true");
|
51 |
-
var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
|
52 |
-
d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
|
53 |
-
"radio"){var a=this.element.parents().filter(":last"),c="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
|
54 |
-
widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
|
55 |
-
b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
|
56 |
-
"true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
57 |
-
c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
|
58 |
-
"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
|
59 |
-
"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
|
60 |
-
b.Widget.prototype.destroy.call(this)}})})(jQuery);
|
61 |
-
;/*
|
62 |
-
* jQuery UI Progressbar 1.8.16
|
63 |
-
*
|
64 |
-
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
65 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
66 |
-
* http://jquery.org/license
|
67 |
-
*
|
68 |
-
* http://docs.jquery.com/UI/Progressbar
|
69 |
-
*
|
70 |
-
* Depends:
|
71 |
-
* jquery.ui.core.js
|
72 |
-
* jquery.ui.widget.js
|
73 |
-
*/
|
74 |
-
(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
|
75 |
-
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
|
76 |
-
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery);
|
77 |
-
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/sis-attachments.js
CHANGED
@@ -1,20 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery( function() {
|
|
|
|
|
2 |
// Add action dinamycally
|
3 |
-
jQuery( 'select[name="action"]' ).append(
|
4 |
jQuery( '<option/>' ).attr( 'value', 'sis-regenerate' ).text( sis.regenerate )
|
5 |
);
|
6 |
-
|
7 |
// Regenerate one element
|
8 |
-
|
9 |
e.preventDefault();
|
10 |
-
new SISAttachRegenerate( this );
|
11 |
});
|
12 |
-
|
13 |
// On bulk actions
|
14 |
-
jQuery( '#doaction' ).
|
15 |
-
if( jQuery( this ).parent().find( 'select' ).val()
|
16 |
// Get checked checkbocxes
|
17 |
-
var els = jQuery( '
|
18 |
|
19 |
// Check there is any elements selected
|
20 |
if( els.length > 0 ) {
|
@@ -24,77 +34,73 @@ jQuery( function() {
|
|
24 |
|
25 |
// Make all the selected elements
|
26 |
els.each( function( i,el ) {
|
27 |
-
new SISAttachRegenerate(
|
28 |
-
} )
|
29 |
}
|
30 |
}
|
31 |
} );
|
32 |
-
|
33 |
// Function for regenerating the elements
|
34 |
-
|
35 |
var regenerate = {
|
36 |
-
list :
|
37 |
-
|
38 |
-
el :
|
39 |
-
id :
|
40 |
messageZone : '',
|
41 |
init: function( el ) {
|
42 |
-
this.el =
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
id = this.el.closest( '.media-item' ).attr( 'id' );
|
48 |
-
this.id = id.replace( 'media-item-', '' );
|
49 |
-
} else {
|
50 |
-
this.id = id.replace( 'post-', '' );
|
51 |
}
|
52 |
|
53 |
-
this.
|
54 |
|
55 |
-
if( this.
|
56 |
-
this.el.find('.title strong').after('<em/>');
|
57 |
-
|
58 |
-
this.messageZone = this.el.find('.title em');
|
59 |
-
|
60 |
-
if( !this.el.hasClass( 'ajaxing' ) )
|
61 |
this.regenItem();
|
|
|
62 |
},
|
63 |
setMessage : function( msg ) {
|
64 |
// Display the message
|
65 |
this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
|
66 |
},
|
67 |
regenItem : function( ) {
|
68 |
-
var
|
69 |
-
|
70 |
-
|
71 |
jQuery.ajax( {
|
72 |
url: sis.ajaxUrl,
|
73 |
type: "POST",
|
74 |
dataType: 'json',
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
76 |
beforeSend : function() {
|
77 |
-
|
78 |
},
|
79 |
success: function( r ) {
|
80 |
var message ='';
|
81 |
// Check if error or a message in response
|
82 |
if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
|
83 |
-
|
84 |
-
message = sis.phpError;
|
85 |
-
else
|
86 |
-
message = r.error
|
87 |
} else {
|
88 |
message = sis.soloRegenerated.replace( '%s', r.time );
|
89 |
}
|
90 |
-
|
91 |
-
|
92 |
}
|
93 |
});
|
94 |
}
|
95 |
-
}
|
96 |
-
|
97 |
// Launch regeneration
|
98 |
-
regenerate.init( jQuery( el )
|
99 |
-
}
|
100 |
} );
|
1 |
+
// Functions for the regenerating of images
|
2 |
+
var sis;
|
3 |
+
if( !sis ) {
|
4 |
+
sis = {};
|
5 |
+
} else if( typeof sis !== "object" ) {
|
6 |
+
throw new Error( 'sis already exists and not an object' );
|
7 |
+
}
|
8 |
+
|
9 |
jQuery( function() {
|
10 |
+
'use strict';
|
11 |
+
var bdy = jQuery( document.body ), SISAttachRegenerate = null, sis_obj = null;
|
12 |
// Add action dinamycally
|
13 |
+
jQuery( 'select[name="action"], select[name="action2"]' ).append(
|
14 |
jQuery( '<option/>' ).attr( 'value', 'sis-regenerate' ).text( sis.regenerate )
|
15 |
);
|
16 |
+
|
17 |
// Regenerate one element
|
18 |
+
bdy.on( 'click', '.sis-regenerate-one', function( e ) {
|
19 |
e.preventDefault();
|
20 |
+
sis_obj = new SISAttachRegenerate( this );
|
21 |
});
|
22 |
+
|
23 |
// On bulk actions
|
24 |
+
jQuery( '#doaction, #doaction2' ).on( 'click', function( e ) {
|
25 |
+
if( jQuery( this ).parent().find( 'select' ).val() === 'sis-regenerate' ) {
|
26 |
// Get checked checkbocxes
|
27 |
+
var els = jQuery( '#the-list .check-column input[type="checkbox"]:checked' ).closest( 'tr' ).find( '.sis-regenerate-one' );
|
28 |
|
29 |
// Check there is any elements selected
|
30 |
if( els.length > 0 ) {
|
34 |
|
35 |
// Make all the selected elements
|
36 |
els.each( function( i,el ) {
|
37 |
+
sis_obj = new SISAttachRegenerate( this );
|
38 |
+
} );
|
39 |
}
|
40 |
}
|
41 |
} );
|
42 |
+
|
43 |
// Function for regenerating the elements
|
44 |
+
SISAttachRegenerate = function( el ) {
|
45 |
var regenerate = {
|
46 |
+
list : {},
|
47 |
+
parent : null,
|
48 |
+
el : null,
|
49 |
+
id : null,
|
50 |
messageZone : '',
|
51 |
init: function( el ) {
|
52 |
+
this.el = el;
|
53 |
+
this.parent = el.closest( 'tr' );
|
54 |
+
this.id = this.el.data( 'id' );
|
55 |
+
this.list = { 'id' : this.id, 'title' : '' };
|
56 |
+
this.messageZone = this.parent.find( '.title em' );
|
57 |
|
58 |
+
if( this.parent.find( '.title em' ).length === 0 ) {
|
59 |
+
this.parent.find( '.title strong' ).after( '<em/>' );
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
+
this.messageZone = this.parent.find( '.title em' );
|
63 |
|
64 |
+
if( !this.parent.hasClass( 'ajaxing' ) ) {
|
|
|
|
|
|
|
|
|
|
|
65 |
this.regenItem();
|
66 |
+
}
|
67 |
},
|
68 |
setMessage : function( msg ) {
|
69 |
// Display the message
|
70 |
this.messageZone.html( ' - '+ msg ).addClass( 'updated' ).addClass( 'fade' ).show();
|
71 |
},
|
72 |
regenItem : function( ) {
|
73 |
+
var self = this;
|
74 |
+
|
|
|
75 |
jQuery.ajax( {
|
76 |
url: sis.ajaxUrl,
|
77 |
type: "POST",
|
78 |
dataType: 'json',
|
79 |
+
cache: false,
|
80 |
+
data: {
|
81 |
+
action : 'sis_rebuild_image',
|
82 |
+
id : this.list.id,
|
83 |
+
nonce : sis.regen_one
|
84 |
+
},
|
85 |
beforeSend : function() {
|
86 |
+
self.parent.fadeTo( 'fast' ,'0.2' ).addClass( 'ajaxing' );
|
87 |
},
|
88 |
success: function( r ) {
|
89 |
var message ='';
|
90 |
// Check if error or a message in response
|
91 |
if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
|
92 |
+
message = typeof r !== 'object' ? message = sis.phpError : r.error ;
|
|
|
|
|
|
|
93 |
} else {
|
94 |
message = sis.soloRegenerated.replace( '%s', r.time );
|
95 |
}
|
96 |
+
self.setMessage( message );
|
97 |
+
self.parent.fadeTo( 'fast' ,'1' ).removeClass( 'ajaxing' );
|
98 |
}
|
99 |
});
|
100 |
}
|
101 |
+
};
|
102 |
+
|
103 |
// Launch regeneration
|
104 |
+
regenerate.init( jQuery( el ) );
|
105 |
+
};
|
106 |
} );
|
js/sis-attachments.min.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
1 |
+
var sis;if(sis){if("object"!==typeof sis)throw Error("sis already exists and not an object");}else sis={};
|
2 |
+
jQuery(function(){var e=jQuery(document.body),d=null;jQuery('select[name="action"], select[name="action2"]').append(jQuery("<option/>").attr("value","sis-regenerate").text(sis.regenerate));e.on("click",".sis-regenerate-one",function(b){b.preventDefault();new d(this)});jQuery("#doaction, #doaction2").on("click",function(b){if("sis-regenerate"===jQuery(this).parent().find("select").val()){var a=jQuery('#the-list .check-column input[type="checkbox"]:checked').closest("tr").find(".sis-regenerate-one");
|
3 |
+
0<a.length&&(b.preventDefault(),a.each(function(){new d(this)}))}});d=function(b){({list:{},parent:null,el:null,id:null,messageZone:"",init:function(a){this.el=a;this.parent=a.closest("tr");this.id=this.el.data("id");this.list={id:this.id,title:""};this.messageZone=this.parent.find(".title em");0===this.parent.find(".title em").length&&this.parent.find(".title strong").after("<em/>");this.messageZone=this.parent.find(".title em");this.parent.hasClass("ajaxing")||this.regenItem()},setMessage:function(a){this.messageZone.html(" - "+
|
4 |
+
a).addClass("updated").addClass("fade").show()},regenItem:function(){var a=this;jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",cache:!1,data:{action:"sis_rebuild_image",id:this.list.id,nonce:sis.regen_one},beforeSend:function(){a.parent.fadeTo("fast","0.2").addClass("ajaxing")},success:function(c){var b="",b=!c.src||!c.time||c.error||"object"!==typeof c?"object"!==typeof c?b=sis.phpError:c.error:sis.soloRegenerated.replace("%s",c.time);a.setMessage(b);a.parent.fadeTo("fast","1").removeClass("ajaxing")}})}}).init(jQuery(b))}});
|
js/sis.js
CHANGED
@@ -1,46 +1,80 @@
|
|
1 |
-
sis_small = true;
|
2 |
// Functions for the regenerating of images
|
3 |
-
var
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
cur : 0,
|
8 |
-
timeScript:
|
9 |
dateScript: '',
|
10 |
percent : '' ,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
getThumbnails : function() {
|
12 |
-
var
|
13 |
-
|
14 |
|
15 |
// Get the checked thumbnails inputs
|
16 |
if (inputs.length != jQuery( 'input.thumbnails[type="checkbox"]' ).length) {
|
17 |
inputs.each( function( i ) {
|
18 |
-
|
19 |
});
|
20 |
}
|
21 |
},
|
22 |
getPostTypes : function() {
|
23 |
-
var
|
24 |
-
|
25 |
|
26 |
// Get the checked post Types inputs
|
27 |
if ( inputs.length != jQuery( 'input.post_types[type="checkbox"]' ).length ) {
|
28 |
inputs.each( function() {
|
29 |
-
|
30 |
} );
|
31 |
}
|
32 |
},
|
33 |
setMessage : function( msg ) {
|
34 |
// Display the message
|
35 |
-
|
36 |
this.refreshProgressBar();
|
37 |
},
|
38 |
setTimeMessage : function ( msg ) {
|
39 |
-
|
40 |
},
|
41 |
refreshProgressBar: function(){
|
42 |
// Refresh the progress Bar
|
43 |
-
|
44 |
},
|
45 |
checkStartRegenerating : function(){
|
46 |
if( jQuery( '.notSaved' ).size() > 0 ) {
|
@@ -57,55 +91,59 @@ var regenerate = {
|
|
57 |
}
|
58 |
},
|
59 |
startRegenerating : function( ) {
|
60 |
-
var
|
61 |
-
|
62 |
|
63 |
-
|
|
|
|
|
64 |
|
|
|
65 |
// Start ajax
|
66 |
jQuery.ajax( {
|
67 |
url: sis.ajaxUrl,
|
68 |
type: "POST",
|
69 |
dataType: 'json',
|
70 |
-
data:
|
|
|
|
|
|
|
|
|
71 |
beforeSend: function() {
|
72 |
|
73 |
// Disable the button
|
74 |
-
|
75 |
// Display the message
|
76 |
-
|
77 |
|
78 |
-
// Get the humbnails and post types
|
79 |
-
_self.getThumbnails();
|
80 |
-
_self.getPostTypes();
|
81 |
},
|
82 |
success: function( r ) {
|
83 |
|
84 |
if( typeof r !== 'object' ) {
|
85 |
-
|
86 |
-
|
87 |
return false;
|
88 |
}
|
89 |
|
90 |
-
|
91 |
|
92 |
// Eval the response
|
93 |
-
|
94 |
|
95 |
// Set the current to 0
|
96 |
-
|
97 |
|
98 |
// Display the progress Bar
|
99 |
-
|
100 |
|
101 |
// Start Regenerating
|
102 |
-
|
103 |
}
|
104 |
});
|
105 |
},
|
106 |
regenItem : function( ) {
|
107 |
-
var
|
108 |
-
|
109 |
|
110 |
// If the list is empty display the message of emptyness and reinitialize the form
|
111 |
if ( !this.list ) {
|
@@ -118,7 +156,7 @@ var regenerate = {
|
|
118 |
if ( this.curr >= this.list.length ) {
|
119 |
var now = new Date();
|
120 |
this.reInit();
|
121 |
-
this.setMessage( sis.done+this.curr+' '+sis.messageRegenerated+sis.startedAt+' '+
|
122 |
return;
|
123 |
}
|
124 |
|
@@ -129,122 +167,119 @@ var regenerate = {
|
|
129 |
url: sis.ajaxUrl,
|
130 |
type: "POST",
|
131 |
dataType: 'json',
|
132 |
-
data:
|
|
|
|
|
|
|
|
|
|
|
133 |
beforeSend : function() {
|
134 |
// Calculate the percentage of regeneration
|
135 |
-
|
136 |
|
137 |
// Change the progression
|
138 |
-
|
139 |
|
140 |
// Change the text of progression
|
141 |
-
|
142 |
},
|
143 |
success: function( r ) {
|
144 |
// Check if error or a message in response
|
145 |
if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
|
146 |
var message ='';
|
147 |
-
if( typeof r !== 'object' )
|
148 |
message = sis.phpError;
|
149 |
-
else
|
150 |
message = r.error
|
|
|
151 |
|
152 |
-
|
153 |
-
|
154 |
} else {
|
155 |
|
156 |
// Append a message if needed
|
157 |
-
if( r.message )
|
158 |
-
|
159 |
-
|
160 |
-
// Actual time
|
161 |
-
var dateEnd = new Date();
|
162 |
-
var curDate = new Date();
|
163 |
|
164 |
// Display the image
|
165 |
-
|
166 |
|
167 |
// Change his attribute
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
// Add the regenerating time to the array
|
171 |
-
|
172 |
|
173 |
// Get the number of elements in array
|
174 |
-
|
175 |
-
var sum = 0;
|
176 |
|
177 |
// Make the sum of the times
|
178 |
-
for(
|
179 |
-
sum +=
|
180 |
}
|
181 |
|
182 |
// Make the average value of the regenerating time
|
183 |
-
var ave = sum/num
|
184 |
|
185 |
// Round the value in miliseconds and add 25% or error
|
186 |
-
|
187 |
|
188 |
// Set the predicted time
|
189 |
-
dateEnd.setTime(
|
190 |
|
191 |
// Get the difference between the two dates
|
192 |
-
var time =
|
193 |
-
|
194 |
// Set the message in the notice box
|
195 |
-
|
196 |
}
|
197 |
|
198 |
// Inscrease the counter and regene the next item
|
199 |
-
|
200 |
-
|
201 |
}
|
202 |
});
|
203 |
|
204 |
},
|
205 |
s2t : function (secs) {
|
206 |
-
secs = secs % 86400
|
207 |
-
|
|
|
|
|
208 |
t.setSeconds(secs);
|
209 |
-
|
210 |
-
if(secs > 86399)
|
211 |
-
|
|
|
212 |
return s;
|
213 |
-
}
|
214 |
-
,
|
215 |
reInit: function() {
|
216 |
// Re initilize the form
|
217 |
-
|
218 |
-
|
|
|
|
|
219 |
}
|
220 |
}
|
221 |
|
222 |
-
|
223 |
i: 0,
|
224 |
add: function(e,el) {
|
225 |
e.preventDefault();
|
226 |
|
227 |
// Create the template
|
228 |
-
var elTr =
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
type: 'text',
|
233 |
-
id: 'new_size_'+this.i
|
234 |
-
}
|
235 |
-
)
|
236 |
-
.val( 'thumbnail-name' )
|
237 |
-
).appendTo( elTr );
|
238 |
-
|
239 |
-
jQuery( '<td />' ).append( jQuery( '<input />' )
|
240 |
-
.attr( {
|
241 |
-
type: 'button',
|
242 |
-
id: 'validate_'+this.i
|
243 |
-
}
|
244 |
-
)
|
245 |
-
.val( sis.validate )
|
246 |
-
.addClass('button-secondary action add_size_name')
|
247 |
-
).appendTo( elTr );
|
248 |
|
249 |
// Add the form for editing
|
250 |
jQuery(el).closest( 'tr' ).before( elTr );
|
@@ -257,11 +292,11 @@ var sizes = {
|
|
257 |
e.preventDefault();
|
258 |
|
259 |
// Get name and id
|
260 |
-
var name = jQuery(el).closest('tr').children( 'th' ).find( 'input' ).val()
|
261 |
-
|
262 |
|
263 |
// Get the number of elements with this name
|
264 |
-
|
265 |
|
266 |
// Check if not basic size or already present, display message
|
267 |
if( name == 'thumbnail' || name == "medium" || name == "large" ) {
|
@@ -272,105 +307,23 @@ var sizes = {
|
|
272 |
return false;
|
273 |
}
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
min: 0,
|
287 |
-
id: 'custom_image_sizes[' + name + '][w]',
|
288 |
-
base_w:0
|
289 |
-
}
|
290 |
-
).val( "0" ).addClass( "w small-text" )
|
291 |
-
).appendTo( tdEl );
|
292 |
-
|
293 |
-
jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][h]' ).addClass( 'sis-label' ).text(sis.maximumHeight).append(
|
294 |
-
jQuery( '<input />' ).attr( { type: 'number',
|
295 |
-
name: 'custom_image_sizes[' + name + '][h]',
|
296 |
-
step: 1,
|
297 |
-
min: 0,
|
298 |
-
id: 'custom_image_sizes[' + name + '][h]',
|
299 |
-
base_h:0
|
300 |
-
}
|
301 |
-
).val( "0" ).addClass( "h small-text" )
|
302 |
-
).appendTo( tdEl );
|
303 |
-
|
304 |
-
|
305 |
-
jQuery( '<label />' ).attr( 'for', 'custom_image_sizes[' + name + '][n]' ).addClass( 'sis-label' ).text(sis.customName).append(
|
306 |
-
jQuery( '<input />' ).attr( { type: 'text',
|
307 |
-
name: 'custom_image_sizes[' + name + '][n]',
|
308 |
-
id: 'custom_image_sizes[' + name + '][n]',
|
309 |
-
base_n:name
|
310 |
-
}
|
311 |
-
).val( name ).addClass( "n small-text" )
|
312 |
-
).appendTo( tdEl );
|
313 |
-
|
314 |
-
els = jQuery( '<span />' )
|
315 |
-
.addClass( 'size_options' )
|
316 |
-
.append(
|
317 |
-
jQuery( '<input />' )
|
318 |
-
.attr( {
|
319 |
-
type: 'checkbox',
|
320 |
-
name: 'custom_image_sizes[' + name + '][c]',
|
321 |
-
id: 'custom_image_sizes[' + name + '][c]',
|
322 |
-
base_c:0
|
323 |
-
} )
|
324 |
-
.val( "1" )
|
325 |
-
.addClass( 'c crop' )
|
326 |
-
)
|
327 |
-
.append(
|
328 |
-
jQuery( '<label />' )
|
329 |
-
.attr( {
|
330 |
-
'for': 'custom_image_sizes[' + name + '][c]',
|
331 |
-
id: 'custom_image_sizes[' + name + '][c]',
|
332 |
-
'class': 'c',
|
333 |
-
title:sis.crop
|
334 |
-
} )
|
335 |
-
.text( sis.crop )
|
336 |
-
)
|
337 |
-
.append(
|
338 |
-
jQuery( '<input />' )
|
339 |
-
.attr( {
|
340 |
-
type: 'checkbox',
|
341 |
-
name: 'custom_image_sizes[' + name + '][s]',
|
342 |
-
id: 'custom_image_sizes[' + name + '][s]',
|
343 |
-
base_s:0
|
344 |
-
} )
|
345 |
-
.val( "1" )
|
346 |
-
.addClass( 's show' )
|
347 |
-
)
|
348 |
-
.append(
|
349 |
-
jQuery( '<label />' )
|
350 |
-
.attr( {
|
351 |
-
'for': 'custom_image_sizes[' + name + '][s]',
|
352 |
-
id: 'custom_image_sizes[' + name + '][s]',
|
353 |
-
'class': 's',
|
354 |
-
title:sis.show
|
355 |
-
} )
|
356 |
-
.text( sis.show )
|
357 |
-
);
|
358 |
-
|
359 |
-
els.appendTo(tdEl);
|
360 |
-
|
361 |
-
jQuery( '<div />' ).text( sis.deleteImage ).addClass('delete_size').appendTo( tdEl );
|
362 |
-
jQuery( '<div />' ).text( sis.validateButton ).addClass('add_size validate_size').appendTo( tdEl );
|
363 |
|
364 |
// Add the row to the current list
|
365 |
-
jQuery('#' + id).closest( 'tr' ).html(
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
this.setButtonsSmall();
|
370 |
-
} else {
|
371 |
-
// Refresh the buttons
|
372 |
-
this.setButtons();
|
373 |
-
}
|
374 |
},
|
375 |
deleteSize: function( e, el ) {
|
376 |
e.preventDefault();
|
@@ -392,7 +345,7 @@ var sizes = {
|
|
392 |
jQuery.ajax( {
|
393 |
url: sis.ajaxUrl,
|
394 |
type: "POST",
|
395 |
-
data: { action : "
|
396 |
beforeSend: function() {
|
397 |
// Remove classes of status
|
398 |
parent.removeClass( 'addPending' );
|
@@ -409,37 +362,30 @@ var sizes = {
|
|
409 |
e.preventDefault();
|
410 |
|
411 |
// Get the vars
|
412 |
-
var
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
s = false;
|
430 |
-
} else {
|
431 |
-
s = true;
|
432 |
-
}
|
433 |
-
|
434 |
-
var w = parseInt( parent.find( 'input.w' ).val() );
|
435 |
-
var h = parseInt( parent.find( 'input.h' ).val() );
|
436 |
|
437 |
if( !parentTable.hasClass( 'ajaxing' ) ) {
|
438 |
jQuery.ajax({
|
439 |
url: sis.ajaxUrl,
|
440 |
type: "POST",
|
441 |
dataType :'json',
|
442 |
-
data: { action : "
|
443 |
beforeSend: function() {
|
444 |
// Remove status and set pending
|
445 |
parent.removeClass();
|
@@ -459,12 +405,12 @@ var sizes = {
|
|
459 |
classTr = 'notChangedAdding';
|
460 |
|
461 |
// add/update to the array with the status class
|
462 |
-
|
463 |
} else {
|
464 |
classTr = 'successAdding';
|
465 |
|
466 |
// add/update to the array with the status class
|
467 |
-
|
468 |
}
|
469 |
|
470 |
// Add the new sizes values for checking of changed or not
|
@@ -490,42 +436,41 @@ var sizes = {
|
|
490 |
}
|
491 |
},
|
492 |
ajaxUnregister: function( el ) {
|
493 |
-
// Get name and
|
494 |
-
var
|
495 |
-
|
496 |
-
|
497 |
|
498 |
// Make the ajax call
|
499 |
jQuery.ajax({
|
500 |
url: sis.ajaxUrl,
|
501 |
type: "POST",
|
502 |
-
data: { action : "
|
503 |
success: function(result) {
|
504 |
-
|
505 |
}
|
506 |
});
|
507 |
},
|
508 |
addToArray: function( n, w, h, c, s ) {
|
509 |
// Get the row for editing or updating
|
510 |
-
var testRow = jQuery( '#sis-
|
511 |
-
|
512 |
-
|
513 |
|
514 |
// Get the right newRow, updating or adding ?
|
515 |
-
if( testRow.length != 0 )
|
516 |
newRow = testRow.closest( 'tr' );
|
517 |
-
else
|
518 |
-
newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone();
|
|
|
519 |
|
520 |
-
|
521 |
-
c = sis.tr;
|
522 |
-
else
|
523 |
-
c = sis.fl;
|
524 |
|
525 |
// Set the datas with the given datas
|
526 |
newRow.find( 'th > label' ).attr( 'for', n )
|
527 |
.end()
|
528 |
-
.find( 'input.thumbnails' ).val( n ).attr( 'id', n )
|
|
|
529 |
.find( 'th:nth-child(2) > label' ).text( n )
|
530 |
.end()
|
531 |
.find( 'th:nth-child(3) > label' ).text( w+'px' )
|
@@ -535,8 +480,9 @@ var sizes = {
|
|
535 |
.find( 'th:nth-child(5) > label' ).text( c );
|
536 |
|
537 |
// If new then add the row
|
538 |
-
if( testRow.length == 0 )
|
539 |
newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
|
|
|
540 |
|
541 |
// Remove the previous status classes and add the status class
|
542 |
newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
|
@@ -552,7 +498,7 @@ var sizes = {
|
|
552 |
var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
|
553 |
|
554 |
// Remove the given name from the array
|
555 |
-
jQuery( '#sis-
|
556 |
},
|
557 |
setButtons: function() {
|
558 |
// UI for delete,crop and add buttons
|
@@ -582,58 +528,36 @@ var sizes = {
|
|
582 |
});
|
583 |
jQuery( '.size_options' ).buttonset();
|
584 |
},
|
585 |
-
setButtonsSmall: function() {
|
586 |
-
// UI for delete,crop and add buttons
|
587 |
-
jQuery(".delete_size").button( {icons: {
|
588 |
-
primary: 'ui-icon-circle-close'
|
589 |
-
},text: false} );
|
590 |
-
jQuery(".add_size").button( { icons: {
|
591 |
-
primary: 'ui-icon-check'
|
592 |
-
},text: false} );
|
593 |
-
jQuery(".crop").button({icons: {
|
594 |
-
primary: 'ui-icon-arrow-4-diag'
|
595 |
-
},text: false});
|
596 |
-
jQuery(".show").button( {icons: {
|
597 |
-
primary: 'ui-icon-lightbulb'
|
598 |
-
},text: false});
|
599 |
-
},
|
600 |
displayChange : function( el ) {
|
601 |
-
el = jQuery( el )
|
602 |
-
|
603 |
|
604 |
// Check not new size
|
605 |
-
if( parent.hasClass( 'new_size' ) )
|
606 |
return false;
|
|
|
607 |
|
608 |
-
var h_el = parent.find( 'input.h' )
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
var base_h = h_el.attr( 'base_h' );
|
621 |
-
var base_w = w_el.attr( 'base_w' );
|
622 |
-
var base_c = c_el.attr( 'base_c' );
|
623 |
-
var base_s = s_el.attr( 'base_s' );
|
624 |
-
var base_n = n_el.attr( 'base_n' );
|
625 |
-
|
626 |
-
if( base_c == '0' )
|
627 |
-
base_c = false;
|
628 |
-
else
|
629 |
-
base_c = true;
|
630 |
-
|
631 |
-
if( base_s == '0' )
|
632 |
-
base_s = false;
|
633 |
-
else
|
634 |
-
base_s = true;
|
635 |
-
|
636 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
|
638 |
if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
|
639 |
el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
|
@@ -643,58 +567,29 @@ var sizes = {
|
|
643 |
}
|
644 |
}
|
645 |
jQuery(function() {
|
646 |
-
|
|
|
647 |
// Regeneration listener
|
648 |
-
jQuery( '#ajax_thumbnail_rebuild' ).click( function() { regenerate.checkStartRegenerating(); } );
|
649 |
|
650 |
// Add size button listener
|
651 |
-
|
652 |
|
653 |
// Registering a new size listener
|
654 |
-
|
655 |
|
656 |
// Delete and Adding buttons
|
657 |
-
|
658 |
-
|
659 |
|
660 |
-
|
661 |
|
662 |
// Seup the getphp
|
663 |
-
|
664 |
jQuery('#get_php').nextAll('code').hide();
|
665 |
-
|
666 |
-
// Colors for the theme / custom sizes
|
667 |
-
jQuery('span.custom_size').closest('tr').children('th').css( {
|
668 |
-
'color': '#89D76A'
|
669 |
-
} );
|
670 |
-
jQuery('span.theme_size').closest('tr').children('th').css( {
|
671 |
-
'color': '#F2A13A'
|
672 |
-
} );
|
673 |
|
674 |
-
|
675 |
jQuery(".add_size").hide();
|
676 |
-
|
677 |
-
// Error ajax handler
|
678 |
-
jQuery( '<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo( "div#wpwrap" ).slideUp( 0 );
|
679 |
-
|
680 |
-
// Display the errors of ajax queries
|
681 |
-
jQuery("#msg").ajaxError( function(event, request, settings ) {
|
682 |
-
jQuery( this ).find( '.msg' ).append( "<li>"+sis.ajaxErrorHandler+" " + settings.url + ", status "+request.status+" : "+request.statusText+"</li>" ).end().stop( false, false ).slideDown( 200 ).delay( 5000 ).slideUp( 200 );
|
683 |
-
});
|
684 |
-
|
685 |
-
// Check resizing of the window
|
686 |
-
jQuery(window).bind('resize', sisCheckWindowSize );
|
687 |
-
|
688 |
-
function sisCheckWindowSize() {
|
689 |
-
if( window.innerWidth <= 820 && sis_small == false ) {
|
690 |
-
sizes.setButtonsSmall();
|
691 |
-
sis_small = true;
|
692 |
-
} else if( window.innerWidth > 820 && sis_small == true ){
|
693 |
-
sizes.setButtons();
|
694 |
-
sis_small = false;
|
695 |
-
}
|
696 |
-
}
|
697 |
|
698 |
// Set the buttons
|
699 |
-
sizes.setButtons();
|
700 |
});
|
|
|
1 |
// Functions for the regenerating of images
|
2 |
+
var rahe;
|
3 |
+
if( !rahe ) {
|
4 |
+
rahe = {};
|
5 |
+
} else if( typeof rahe !== "object" ) {
|
6 |
+
throw new Error( 'rahe already exists and not an object' );
|
7 |
+
}
|
8 |
+
|
9 |
+
if( !rahe.sis ) {
|
10 |
+
rahe.sis = {};
|
11 |
+
} else if( typeof rahe.sis !== "object" ) {
|
12 |
+
throw new Error( 'rahe.sis already exists and not an object' );
|
13 |
+
}
|
14 |
+
|
15 |
+
rahe.sis.regenerate = {
|
16 |
+
post_types : [],
|
17 |
+
thumbnails : [],
|
18 |
+
list : {},
|
19 |
cur : 0,
|
20 |
+
timeScript: [],
|
21 |
dateScript: '',
|
22 |
percent : '' ,
|
23 |
+
percentText : null,
|
24 |
+
progress : null,
|
25 |
+
messageZone : null,
|
26 |
+
time : null,
|
27 |
+
timeZone : null,
|
28 |
+
buttonRegenerate : null,
|
29 |
+
errorZone : null,
|
30 |
+
errorMessages : null,
|
31 |
+
thumb : null,
|
32 |
+
thumbImg : null,
|
33 |
+
init : function() {
|
34 |
+
this.percentText = jQuery('#sis_progress-percent');
|
35 |
+
this.progress = jQuery( '.progress' );
|
36 |
+
this.messageZone = jQuery("#regenerate_message");
|
37 |
+
this.time = jQuery("#time");
|
38 |
+
this.timeZone = this.time.find("p span.time_message");
|
39 |
+
this.buttonRegenerate = jQuery( "#ajax_thumbnail_rebuild" );
|
40 |
+
this.errorZone = jQuery( '#error_messages' );
|
41 |
+
this.errorMessages = this.errorZone.find( 'ul.messages' );
|
42 |
+
this.thumb = jQuery( '#thumb' );
|
43 |
+
this.thumbImg = jQuery( '#thumb-img' );
|
44 |
+
},
|
45 |
getThumbnails : function() {
|
46 |
+
var self = this,
|
47 |
+
inputs = jQuery( 'input.thumbnails:checked' );
|
48 |
|
49 |
// Get the checked thumbnails inputs
|
50 |
if (inputs.length != jQuery( 'input.thumbnails[type="checkbox"]' ).length) {
|
51 |
inputs.each( function( i ) {
|
52 |
+
self.thumbnails.push( this.value );
|
53 |
});
|
54 |
}
|
55 |
},
|
56 |
getPostTypes : function() {
|
57 |
+
var self = this,
|
58 |
+
inputs = jQuery( 'input.post_types:checked' );
|
59 |
|
60 |
// Get the checked post Types inputs
|
61 |
if ( inputs.length != jQuery( 'input.post_types[type="checkbox"]' ).length ) {
|
62 |
inputs.each( function() {
|
63 |
+
self.post_types.push( this.value );
|
64 |
} );
|
65 |
}
|
66 |
},
|
67 |
setMessage : function( msg ) {
|
68 |
// Display the message
|
69 |
+
this.messageZone.html( "<p>" + msg + "</p>" ).addClass( 'updated' ).addClass( 'fade' ).show();
|
70 |
this.refreshProgressBar();
|
71 |
},
|
72 |
setTimeMessage : function ( msg ) {
|
73 |
+
this.timeZone.html( msg );
|
74 |
},
|
75 |
refreshProgressBar: function(){
|
76 |
// Refresh the progress Bar
|
77 |
+
this.progress.progressbar();
|
78 |
},
|
79 |
checkStartRegenerating : function(){
|
80 |
if( jQuery( '.notSaved' ).size() > 0 ) {
|
91 |
}
|
92 |
},
|
93 |
startRegenerating : function( ) {
|
94 |
+
var self = this,
|
95 |
+
wp_nonce = jQuery('input.getList').val();
|
96 |
|
97 |
+
// Get the humbnails and post types
|
98 |
+
self.getThumbnails();
|
99 |
+
self.getPostTypes();
|
100 |
|
101 |
+
this.dateScript = new Date();
|
102 |
// Start ajax
|
103 |
jQuery.ajax( {
|
104 |
url: sis.ajaxUrl,
|
105 |
type: "POST",
|
106 |
dataType: 'json',
|
107 |
+
data: {
|
108 |
+
action : 'sis_get_list',
|
109 |
+
post_types : self.post_types,
|
110 |
+
nonce : wp_nonce
|
111 |
+
},
|
112 |
beforeSend: function() {
|
113 |
|
114 |
// Disable the button
|
115 |
+
self.buttonRegenerate.attr( "disabled", true );
|
116 |
// Display the message
|
117 |
+
self.setMessage( sis.reading );
|
118 |
|
|
|
|
|
|
|
119 |
},
|
120 |
success: function( r ) {
|
121 |
|
122 |
if( typeof r !== 'object' ) {
|
123 |
+
self.reInit();
|
124 |
+
self.setMessage( sis.phpError );
|
125 |
return false;
|
126 |
}
|
127 |
|
128 |
+
self.time.show();
|
129 |
|
130 |
// Eval the response
|
131 |
+
self.list = r ;
|
132 |
|
133 |
// Set the current to 0
|
134 |
+
self.curr = 0;
|
135 |
|
136 |
// Display the progress Bar
|
137 |
+
self.progress.show();
|
138 |
|
139 |
// Start Regenerating
|
140 |
+
self.regenItem();
|
141 |
}
|
142 |
});
|
143 |
},
|
144 |
regenItem : function( ) {
|
145 |
+
var self = this,
|
146 |
+
wp_nonce = jQuery('input.regen').val();
|
147 |
|
148 |
// If the list is empty display the message of emptyness and reinitialize the form
|
149 |
if ( !this.list ) {
|
156 |
if ( this.curr >= this.list.length ) {
|
157 |
var now = new Date();
|
158 |
this.reInit();
|
159 |
+
this.setMessage( sis.done+this.curr+' '+sis.messageRegenerated+sis.startedAt+' '+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+' '+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds() );
|
160 |
return;
|
161 |
}
|
162 |
|
167 |
url: sis.ajaxUrl,
|
168 |
type: "POST",
|
169 |
dataType: 'json',
|
170 |
+
data: {
|
171 |
+
action : 'sis_rebuild_image',
|
172 |
+
id : this.list[this.curr].id,
|
173 |
+
thumbnails : this.thumbnails,
|
174 |
+
nonce : wp_nonce
|
175 |
+
},
|
176 |
beforeSend : function() {
|
177 |
// Calculate the percentage of regeneration
|
178 |
+
self.percent = ( self.curr / self.list.length ) * 100;
|
179 |
|
180 |
// Change the progression
|
181 |
+
self.progress.progressbar( "value", self.percent );
|
182 |
|
183 |
// Change the text of progression
|
184 |
+
self.percentText.removeClass( 'hidden' ).html( Math.round( self.percent ) + "%");
|
185 |
},
|
186 |
success: function( r ) {
|
187 |
// Check if error or a message in response
|
188 |
if( ( !r.src || !r.time ) || r.error || typeof r !== 'object' ) {
|
189 |
var message ='';
|
190 |
+
if( typeof r !== 'object' ) {
|
191 |
message = sis.phpError;
|
192 |
+
} else {
|
193 |
message = r.error
|
194 |
+
}
|
195 |
|
196 |
+
self.errorZone.addClass( 'error message' );
|
197 |
+
self.errorMessages.prepend( '<li>'+message+'</li>' );
|
198 |
} else {
|
199 |
|
200 |
// Append a message if needed
|
201 |
+
if( r.message ) {
|
202 |
+
self.time.find( 'ul.messages' ).prepend( '<li>'+r.message+'</li>' );
|
203 |
+
}
|
|
|
|
|
|
|
204 |
|
205 |
// Display the image
|
206 |
+
self.thumb.show();
|
207 |
|
208 |
// Change his attribute
|
209 |
+
self.thumbImg.attr("src", r.src);
|
210 |
+
|
211 |
+
// Actual time
|
212 |
+
var dateEnd = new Date(),
|
213 |
+
curDate = new Date(),
|
214 |
+
num = 0,
|
215 |
+
sum = 0,
|
216 |
+
i = 0;
|
217 |
|
218 |
// Add the regenerating time to the array
|
219 |
+
self.timeScript.push(r.time);
|
220 |
|
221 |
// Get the number of elements in array
|
222 |
+
num = self.timeScript.length;
|
|
|
223 |
|
224 |
// Make the sum of the times
|
225 |
+
for( i; i < num ; i++ ) {
|
226 |
+
sum += self.timeScript[i];
|
227 |
}
|
228 |
|
229 |
// Make the average value of the regenerating time
|
230 |
+
var ave = sum/num,
|
231 |
|
232 |
// Round the value in miliseconds and add 25% or error
|
233 |
+
t = Math.round( ( ( ave *self.list.length ) * 1000 ) );
|
234 |
|
235 |
// Set the predicted time
|
236 |
+
dateEnd.setTime( self.dateScript.getTime() + t );
|
237 |
|
238 |
// Get the difference between the two dates
|
239 |
+
var time = self.s2t( Math.abs( ( dateEnd.getTime() - curDate.getTime() ) ) / 1000 );
|
240 |
+
|
241 |
// Set the message in the notice box
|
242 |
+
self.setTimeMessage( dateEnd.getHours()+":"+dateEnd.getMinutes()+":"+dateEnd.getSeconds()+sis.or+time+sis.beforeEnd );
|
243 |
}
|
244 |
|
245 |
// Inscrease the counter and regene the next item
|
246 |
+
self.curr++;
|
247 |
+
self.regenItem();
|
248 |
}
|
249 |
});
|
250 |
|
251 |
},
|
252 |
s2t : function (secs) {
|
253 |
+
var secs = secs % 86400,
|
254 |
+
t = new Date(1970,0,1),
|
255 |
+
s = 0;
|
256 |
+
|
257 |
t.setSeconds(secs);
|
258 |
+
s = t.toTimeString().substr(0,8);
|
259 |
+
if( secs > 86399 ) {
|
260 |
+
s = Math.floor( ( t - Date.parse( "1/1/70" ) ) / 3600000 ) + s.substr( 2 );
|
261 |
+
}
|
262 |
return s;
|
263 |
+
},
|
|
|
264 |
reInit: function() {
|
265 |
// Re initilize the form
|
266 |
+
this.buttonRegenerate.removeAttr( "disabled" );
|
267 |
+
this.thumb.hide();
|
268 |
+
this.progress.hide();
|
269 |
+
this.percentText.addClass( 'hidden' );
|
270 |
}
|
271 |
}
|
272 |
|
273 |
+
rahe.sis.sizes = {
|
274 |
i: 0,
|
275 |
add: function(e,el) {
|
276 |
e.preventDefault();
|
277 |
|
278 |
// Create the template
|
279 |
+
var elTr = _.template( document.getElementById( 'sis-new_size' ).text, {
|
280 |
+
size_id : this.i,
|
281 |
+
validate : sis.validate
|
282 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
// Add the form for editing
|
285 |
jQuery(el).closest( 'tr' ).before( elTr );
|
292 |
e.preventDefault();
|
293 |
|
294 |
// Get name and id
|
295 |
+
var name = jQuery(el).closest('tr').children( 'th' ).find( 'input' ).val(),
|
296 |
+
id = jQuery(el).closest('tr').children('th').find( 'input' ).attr( 'id' ),
|
297 |
|
298 |
// Get the number of elements with this name
|
299 |
+
checkPresent = jQuery( el ).closest('tbody').find( 'input[value="'+name+'"]' ).length;
|
300 |
|
301 |
// Check if not basic size or already present, display message
|
302 |
if( name == 'thumbnail' || name == "medium" || name == "large" ) {
|
307 |
return false;
|
308 |
}
|
309 |
|
310 |
+
var row = _.template( document.getElementById( 'sis-new_size_row' ).text, {
|
311 |
+
size : sis.size,
|
312 |
+
size_name : name,
|
313 |
+
maximumWidth : sis.maximumWidth,
|
314 |
+
maximumHeight : sis.maximumHeight,
|
315 |
+
customName : sis.customName,
|
316 |
+
crop : sis.crop,
|
317 |
+
show : sis.show,
|
318 |
+
deleteImage : sis.deleteImage,
|
319 |
+
validateButton : sis.validateButton
|
320 |
+
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
|
322 |
// Add the row to the current list
|
323 |
+
jQuery('#' + id).closest( 'tr' ).html( row );
|
324 |
|
325 |
+
// Refresh the buttons
|
326 |
+
this.setButtons();
|
|
|
|
|
|
|
|
|
|
|
327 |
},
|
328 |
deleteSize: function( e, el ) {
|
329 |
e.preventDefault();
|
345 |
jQuery.ajax( {
|
346 |
url: sis.ajaxUrl,
|
347 |
type: "POST",
|
348 |
+
data: { action : "sis_get_sizes" },
|
349 |
beforeSend: function() {
|
350 |
// Remove classes of status
|
351 |
parent.removeClass( 'addPending' );
|
362 |
e.preventDefault();
|
363 |
|
364 |
// Get the vars
|
365 |
+
var self = this,
|
366 |
+
parentTable = jQuery( el ).closest( 'table' ),
|
367 |
+
timer,
|
368 |
+
wp_nonce = jQuery( '.addSize' ).val(),
|
369 |
+
parent = jQuery( el ).closest( 'tr' ),
|
370 |
+
n = parent.find( 'input[name="image_name"]' ).val(),
|
371 |
+
c = parent.find( 'label.c' ).hasClass( 'ui-state-active' ),
|
372 |
+
s = parent.find( 'label.s' ).hasClass( 'ui-state-active' ),
|
373 |
+
cn = parent.find( 'input.n' ).val()
|
374 |
+
h = 0,
|
375 |
+
w = 0;
|
376 |
+
|
377 |
+
|
378 |
+
c = ( c == false || c == undefined ) ? false : true ;
|
379 |
+
s = ( s == false || s == undefined ) ? false : true ;
|
380 |
+
w = parseInt( parent.find( 'input.w' ).val() );
|
381 |
+
h = parseInt( parent.find( 'input.h' ).val() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
|
383 |
if( !parentTable.hasClass( 'ajaxing' ) ) {
|
384 |
jQuery.ajax({
|
385 |
url: sis.ajaxUrl,
|
386 |
type: "POST",
|
387 |
dataType :'json',
|
388 |
+
data: { action : "sis_add_size", width: w, height: h, crop: c, name: n, show: s, customName : cn , nonce : wp_nonce },
|
389 |
beforeSend: function() {
|
390 |
// Remove status and set pending
|
391 |
parent.removeClass();
|
405 |
classTr = 'notChangedAdding';
|
406 |
|
407 |
// add/update to the array with the status class
|
408 |
+
self.addToArray( n, w, h, c, classTr );
|
409 |
} else {
|
410 |
classTr = 'successAdding';
|
411 |
|
412 |
// add/update to the array with the status class
|
413 |
+
self.addToArray( n, w, h, c, classTr );
|
414 |
}
|
415 |
|
416 |
// Add the new sizes values for checking of changed or not
|
436 |
}
|
437 |
},
|
438 |
ajaxUnregister: function( el ) {
|
439 |
+
// Get name and self object
|
440 |
+
var self = this,
|
441 |
+
n = jQuery( el ).closest('tr').find( 'input[name="image_name"]' ).val(),
|
442 |
+
wp_nonce = jQuery( el ).closest('tr').find( 'input.deleteSize' ).val();
|
443 |
|
444 |
// Make the ajax call
|
445 |
jQuery.ajax({
|
446 |
url: sis.ajaxUrl,
|
447 |
type: "POST",
|
448 |
+
data: { action : "sis_remove_size", name: n, nonce : wp_nonce },
|
449 |
success: function(result) {
|
450 |
+
self.removeFromArray( el );
|
451 |
}
|
452 |
});
|
453 |
},
|
454 |
addToArray: function( n, w, h, c, s ) {
|
455 |
// Get the row for editing or updating
|
456 |
+
var testRow = jQuery( '#sis-'+n ),
|
457 |
+
newRow = '',
|
458 |
+
timer;
|
459 |
|
460 |
// Get the right newRow, updating or adding ?
|
461 |
+
if( testRow.length != 0 ) {
|
462 |
newRow = testRow.closest( 'tr' );
|
463 |
+
} else {
|
464 |
+
newRow = jQuery( '#sis-regen .wrapper > table#sis_sizes > tbody > tr:first' ).clone().attr( 'id', 'sis-'+n );
|
465 |
+
}
|
466 |
|
467 |
+
c = c == true ? sis.tr : sis.fl ;
|
|
|
|
|
|
|
468 |
|
469 |
// Set the datas with the given datas
|
470 |
newRow.find( 'th > label' ).attr( 'for', n )
|
471 |
.end()
|
472 |
+
.find( 'input.thumbnails' ).val( n ).attr( 'id', n )
|
473 |
+
.end()
|
474 |
.find( 'th:nth-child(2) > label' ).text( n )
|
475 |
.end()
|
476 |
.find( 'th:nth-child(3) > label' ).text( w+'px' )
|
480 |
.find( 'th:nth-child(5) > label' ).text( c );
|
481 |
|
482 |
// If new then add the row
|
483 |
+
if( testRow.length == 0 ) {
|
484 |
newRow.appendTo( '#sis-regen .wrapper > table#sis_sizes > tbody' );
|
485 |
+
}
|
486 |
|
487 |
// Remove the previous status classes and add the status class
|
488 |
newRow.removeClass( 'errorAdding notChangedAdding successAdding' ).addClass( s );
|
498 |
var n = jQuery( el ).closest( 'tr' ).find( 'input[name=image_name]' ).val();
|
499 |
|
500 |
// Remove the given name from the array
|
501 |
+
jQuery( '#sis-'+n ).remove();
|
502 |
},
|
503 |
setButtons: function() {
|
504 |
// UI for delete,crop and add buttons
|
528 |
});
|
529 |
jQuery( '.size_options' ).buttonset();
|
530 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
displayChange : function( el ) {
|
532 |
+
var el = jQuery( el ),
|
533 |
+
parent = el.closest( 'tr' );
|
534 |
|
535 |
// Check not new size
|
536 |
+
if( parent.hasClass( 'new_size' ) ) {
|
537 |
return false;
|
538 |
+
}
|
539 |
|
540 |
+
var h_el = parent.find( 'input.h' ),
|
541 |
+
w_el = parent.find( 'input.w' ),
|
542 |
+
c_el = parent.find( 'input.c' ),
|
543 |
+
s_el = parent.find( 'input.s' ),
|
544 |
+
n_el = parent.find( 'input.n' ),
|
545 |
+
|
546 |
+
h = h_el.val(),
|
547 |
+
w = w_el.val(),
|
548 |
+
c = parent.find( 'label.c' ).hasClass( 'ui-state-active' ),
|
549 |
+
s = parent.find( 'label.s' ).hasClass( 'ui-state-active' ),
|
550 |
+
n = n_el.val(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
|
552 |
+
base_h = h_el.attr( 'base_h' ),
|
553 |
+
base_w = w_el.attr( 'base_w' ),
|
554 |
+
base_c = c_el.attr( 'base_c' ),
|
555 |
+
base_s = s_el.attr( 'base_s' ),
|
556 |
+
base_n = n_el.attr( 'base_n' );
|
557 |
+
|
558 |
+
|
559 |
+
base_c = base_c == '0' ? false : true;
|
560 |
+
base_s = base_s == '0' ? false : true;
|
561 |
|
562 |
if( h != base_h || w != base_w || c != base_c || s != base_s || n != base_n ) {
|
563 |
el.closest( 'td' ).addClass( 'notSaved' ).find('.add_size').css( 'display', 'inline-block' );
|
567 |
}
|
568 |
}
|
569 |
jQuery(function() {
|
570 |
+
rahe.sis.regenerate.init();
|
571 |
+
var bodyContent = jQuery( '#wpbody-content');
|
572 |
// Regeneration listener
|
573 |
+
jQuery( '#ajax_thumbnail_rebuild' ).click( function() { rahe.sis.regenerate.checkStartRegenerating(); } );
|
574 |
|
575 |
// Add size button listener
|
576 |
+
bodyContent.on( 'click', '#add_size',function( e ) { rahe.sis.sizes.add( e, this ); } )
|
577 |
|
578 |
// Registering a new size listener
|
579 |
+
.on( 'click', '.add_size_name', function( e ) { rahe.sis.sizes.register( e, this ); } )
|
580 |
|
581 |
// Delete and Adding buttons
|
582 |
+
.on( 'click', '.delete_size', function( e ) { rahe.sis.sizes.deleteSize( e, this ); } )
|
583 |
+
.on( 'click', '.add_size', function( e ) { rahe.sis.sizes.ajaxRegister( e, this ); } )
|
584 |
|
585 |
+
.on( 'click keyup change', '.h,.w,.c,.s,.n', function( e ) { rahe.sis.sizes.displayChange( this ); } )
|
586 |
|
587 |
// Seup the getphp
|
588 |
+
.on( 'click', '#get_php', function( e ){ rahe.sis.sizes.getPhp( e, this ) } );
|
589 |
jQuery('#get_php').nextAll('code').hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
|
|
|
591 |
jQuery(".add_size").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
|
593 |
// Set the buttons
|
594 |
+
rahe.sis.sizes.setButtons();
|
595 |
});
|
js/sis.min.js
CHANGED
@@ -1,25 +1,21 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
this.
|
7 |
-
|
8 |
-
a
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
j!=("0"==g?!1:!0)||c!=("0"==e?!1:!0)||k!=d?a.closest("td").addClass("notSaved").find(".add_size").css("display","inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
|
23 |
-
jQuery(function(){jQuery("#ajax_thumbnail_rebuild").click(function(){regenerate.checkStartRegenerating()});jQuery("#add_size").click(function(a){sizes.add(a,this)});jQuery(".add_size_name").live("click",function(a){sizes.register(a,this)});jQuery(".delete_size").live("click",function(a){sizes.deleteSize(a,this)});jQuery(".add_size").live("click",function(a){sizes.ajaxRegister(a,this)});jQuery(".h,.w,.c,.s,.n").live("click skeyup change",function(){sizes.displayChange(this)});jQuery("#get_php").click(function(a){sizes.getPhp(a,
|
24 |
-
this)});jQuery("#get_php").nextAll("code").hide();jQuery("span.custom_size").closest("tr").children("th").css({color:"#89D76A"});jQuery("span.theme_size").closest("tr").children("th").css({color:"#F2A13A"});jQuery(".add_size").hide();jQuery('<div class="ui-widget" id="msg"><div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"><p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span><strong>Alert:</strong> <ul class="msg" ></ul></p></div></div>').prependTo("div#wpwrap").slideUp(0);
|
25 |
-
jQuery("#msg").ajaxError(function(a,c,b){jQuery(this).find(".msg").append("<li>"+sis.ajaxErrorHandler+" "+b.url+", status "+c.status+" : "+c.statusText+"</li>").end().stop(!1,!1).slideDown(200).delay(5E3).slideUp(200)});jQuery(window).bind("resize",function(){820>=window.innerWidth&&!1==sis_small?(sizes.setButtonsSmall(),sis_small=!0):820<window.innerWidth&&!0==sis_small&&(sizes.setButtons(),sis_small=!1)});sizes.setButtons()});
|
1 |
+
var rahe;if(rahe){if("object"!==typeof rahe)throw Error("rahe already exists and not an object");}else rahe={};if(rahe.sis){if("object"!==typeof rahe.sis)throw Error("rahe.sis already exists and not an object");}else rahe.sis={};
|
2 |
+
rahe.sis.regenerate={post_types:[],thumbnails:[],list:{},cur:0,timeScript:[],dateScript:"",percent:"",percentText:null,progress:null,messageZone:null,time:null,timeZone:null,buttonRegenerate:null,errorZone:null,errorMessages:null,thumb:null,thumbImg:null,init:function(){this.percentText=jQuery("#sis_progress-percent");this.progress=jQuery(".progress");this.messageZone=jQuery("#regenerate_message");this.time=jQuery("#time");this.timeZone=this.time.find("p span.time_message");this.buttonRegenerate=
|
3 |
+
jQuery("#ajax_thumbnail_rebuild");this.errorZone=jQuery("#error_messages");this.errorMessages=this.errorZone.find("ul.messages");this.thumb=jQuery("#thumb");this.thumbImg=jQuery("#thumb-img")},getThumbnails:function(){var a=this,b=jQuery("input.thumbnails:checked");b.length!=jQuery('input.thumbnails[type="checkbox"]').length&&b.each(function(){a.thumbnails.push(this.value)})},getPostTypes:function(){var a=this,b=jQuery("input.post_types:checked");b.length!=jQuery('input.post_types[type="checkbox"]').length&&
|
4 |
+
b.each(function(){a.post_types.push(this.value)})},setMessage:function(a){this.messageZone.html("<p>"+a+"</p>").addClass("updated").addClass("fade").show();this.refreshProgressBar()},setTimeMessage:function(a){this.timeZone.html(a)},refreshProgressBar:function(){this.progress.progressbar()},checkStartRegenerating:function(){if(0<jQuery(".notSaved").size())if(!0==confirm(sis.notSaved))this.startRegenerating();else return!1;else this.startRegenerating()},startRegenerating:function(){var a=this,b=jQuery("input.getList").val();
|
5 |
+
a.getThumbnails();a.getPostTypes();this.dateScript=new Date;jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:{action:"sis_get_list",post_types:a.post_types,nonce:b},beforeSend:function(){a.buttonRegenerate.attr("disabled",!0);a.setMessage(sis.reading)},success:function(b){if("object"!==typeof b)return a.reInit(),a.setMessage(sis.phpError),!1;a.time.show();a.list=b;a.curr=0;a.progress.show();a.regenItem()}})},regenItem:function(){var a=this,b=jQuery("input.regen").val();if(!this.list)return this.reInit(),
|
6 |
+
this.setMessage(sis.noMedia),!1;this.curr>=this.list.length?(b=new Date,this.reInit(),this.setMessage(sis.done+this.curr+" "+sis.messageRegenerated+sis.startedAt+" "+this.dateScript.getHours()+":"+this.dateScript.getMinutes()+":"+this.dateScript.getSeconds()+sis.finishedAt+" "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds())):(this.setMessage(sis.regenerating+(this.curr+1)+sis.of+this.list.length+" ("+this.list[this.curr].title+")..."),jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:{action:"sis_rebuild_image",
|
7 |
+
id:this.list[this.curr].id,thumbnails:this.thumbnails,nonce:b},beforeSend:function(){a.percent=100*(a.curr/a.list.length);a.progress.progressbar("value",a.percent);a.percentText.removeClass("hidden").html(Math.round(a.percent)+"%")},success:function(b){if(!b.src||!b.time||b.error||"object"!==typeof b){var e="",e="object"!==typeof b?sis.phpError:b.error;a.errorZone.addClass("error message");a.errorMessages.prepend("<li>"+e+"</li>")}else{b.message&&a.time.find("ul.messages").prepend("<li>"+b.message+
|
8 |
+
"</li>");a.thumb.show();a.thumbImg.attr("src",b.src);var e=new Date,g=new Date,f=0,c=0,j=0;a.timeScript.push(b.time);f=a.timeScript.length;for(j;j<f;j++)c+=a.timeScript[j];b=Math.round(1E3*c/f*a.list.length);e.setTime(a.dateScript.getTime()+b);b=a.s2t(Math.abs(e.getTime()-g.getTime())/1E3);a.setTimeMessage(e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+sis.or+b+sis.beforeEnd)}a.curr++;a.regenItem()}}))},s2t:function(a){a%=86400;var b=new Date(1970,0,1),d=0;b.setSeconds(a);d=b.toTimeString().substr(0,
|
9 |
+
8);86399<a&&(d=Math.floor((b-Date.parse("1/1/70"))/36E5)+d.substr(2));return d},reInit:function(){this.buttonRegenerate.removeAttr("disabled");this.thumb.hide();this.progress.hide();this.percentText.addClass("hidden")}};
|
10 |
+
rahe.sis.sizes={i:0,add:function(a,b){a.preventDefault();var d=_.template(document.getElementById("sis-new_size").text,{size_id:this.i,validate:sis.validate});jQuery(b).closest("tr").before(d);this.i++},register:function(a,b){a.preventDefault();var d=jQuery(b).closest("tr").children("th").find("input").val(),e=jQuery(b).closest("tr").children("th").find("input").attr("id"),g=jQuery(b).closest("tbody").find('input[value="'+d+'"]').length;if("thumbnail"==d||"medium"==d||"large"==d)return alert(sis.notOriginal),
|
11 |
+
!1;if(0!=g)return alert(sis.alreadyPresent),!1;d=_.template(document.getElementById("sis-new_size_row").text,{size:sis.size,size_name:d,maximumWidth:sis.maximumWidth,maximumHeight:sis.maximumHeight,customName:sis.customName,crop:sis.crop,show:sis.show,deleteImage:sis.deleteImage,validateButton:sis.validateButton});jQuery("#"+e).closest("tr").html(d);this.setButtons()},deleteSize:function(a,b){a.preventDefault();!0==confirm(sis.confirmDelete)&&(jQuery(b).closest("tr").remove(),this.ajaxUnregister(b))},
|
12 |
+
getPhp:function(a,b){a.preventDefault();var d=jQuery(b).closest("tr");jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"sis_get_sizes"},beforeSend:function(){d.removeClass("addPending");d.addClass("addPending")},success:function(a){jQuery("#get_php").nextAll("code").html("<br />"+a).show().css({display:"block"});d.removeClass("addPending")}})},ajaxRegister:function(a,b){a.preventDefault();var d=this,e=jQuery(b).closest("table"),g,f=jQuery(".addSize").val(),c=jQuery(b).closest("tr"),j=c.find('input[name="image_name"]').val(),
|
13 |
+
k=c.find("label.c").hasClass("ui-state-active"),l=c.find("label.s").hasClass("ui-state-active"),m=c.find("input.n").val();w=h=0;k=!1==k||void 0==k?!1:!0;l=!1==l||void 0==l?!1:!0;w=parseInt(c.find("input.w").val());h=parseInt(c.find("input.h").val());e.hasClass("ajaxing")||jQuery.ajax({url:sis.ajaxUrl,type:"POST",dataType:"json",data:{action:"sis_add_size",width:w,height:h,crop:k,name:j,show:l,customName:m,nonce:f},beforeSend:function(){c.removeClass();c.addClass("addPending");e.addClass("ajaxing")},
|
14 |
+
success:function(a){var b="";c.removeClass();e.removeClass("ajaxing");0==a?b="errorAdding":(b=2==a?"notChangedAdding":"successAdding",d.addToArray(j,w,h,k,b));c.find("input.h").attr({base_h:h});c.find("input.w").attr({base_w:w});c.find("input.c").attr({base_c:k});c.find("input.s").attr({base_s:l});c.addClass(b);c.find("td").removeClass("notSaved");c.find(".add_size").removeClass("validate_size").hide().children(".ui-button-text").text(sis.update);clearTimeout(g);g=setTimeout(function(){c.removeClass("errorAdding notChangedAdding successAdding")},
|
15 |
+
3E3)}})},ajaxUnregister:function(a){var b=this,d=jQuery(a).closest("tr").find('input[name="image_name"]').val(),e=jQuery(a).closest("tr").find("input.deleteSize").val();jQuery.ajax({url:sis.ajaxUrl,type:"POST",data:{action:"sis_remove_size",name:d,nonce:e},success:function(){b.removeFromArray(a)}})},addToArray:function(a,b,d,e,g){var f=jQuery("#sis-"+a),c="",j,c=0!=f.length?f.closest("tr"):jQuery("#sis-regen .wrapper > table#sis_sizes > tbody > tr:first").clone().attr("id","sis-"+a);e=!0==e?sis.tr:
|
16 |
+
sis.fl;c.find("th > label").attr("for",a).end().find("input.thumbnails").val(a).attr("id",a).end().find("th:nth-child(2) > label").text(a).end().find("th:nth-child(3) > label").text(b+"px").end().find("th:nth-child(4) > label").text(d+"px").end().find("th:nth-child(5) > label").text(e);0==f.length&&c.appendTo("#sis-regen .wrapper > table#sis_sizes > tbody");c.removeClass("errorAdding notChangedAdding successAdding").addClass(g);clearTimeout(j);j=setTimeout(function(){c.removeClass("errorAdding notChangedAdding successAdding")},
|
17 |
+
3E3)},removeFromArray:function(a){a=jQuery(a).closest("tr").find("input[name=image_name]").val();jQuery("#sis-"+a).remove()},setButtons:function(){jQuery(".delete_size").button({icons:{primary:"ui-icon-circle-close"},text:!0});jQuery(".add_size").button({icons:{primary:"ui-icon-check"},text:!0});jQuery(".crop").button({icons:{primary:"ui-icon-arrow-4-diag"},text:!0});jQuery(".show").button({icons:{primary:"ui-icon-lightbulb"},text:!0});jQuery(".size_options").buttonset()},displayChange:function(a){a=
|
18 |
+
jQuery(a);var b=a.closest("tr");if(b.hasClass("new_size"))return!1;var d=b.find("input.h"),e=b.find("input.w"),g=b.find("input.c"),f=b.find("input.s"),c=b.find("input.n"),j=d.val(),k=e.val(),l=b.find("label.c").hasClass("ui-state-active"),b=b.find("label.s").hasClass("ui-state-active"),m=c.val(),d=d.attr("base_h"),e=e.attr("base_w"),g=g.attr("base_c"),f=f.attr("base_s"),c=c.attr("base_n");j!=d||k!=e||l!=("0"==g?!1:!0)||b!=("0"==f?!1:!0)||m!=c?a.closest("td").addClass("notSaved").find(".add_size").css("display",
|
19 |
+
"inline-block"):a.closest("td").removeClass("notSaved").find(".add_size").css("display","none")}};
|
20 |
+
jQuery(function(){rahe.sis.regenerate.init();var a=jQuery("#wpbody-content");jQuery("#ajax_thumbnail_rebuild").click(function(){rahe.sis.regenerate.checkStartRegenerating()});a.on("click","#add_size",function(a){rahe.sis.sizes.add(a,this)}).on("click",".add_size_name",function(a){rahe.sis.sizes.register(a,this)}).on("click",".delete_size",function(a){rahe.sis.sizes.deleteSize(a,this)}).on("click",".add_size",function(a){rahe.sis.sizes.ajaxRegister(a,this)}).on("click keyup change",".h,.w,.c,.s,.n",
|
21 |
+
function(){rahe.sis.sizes.displayChange(this)}).on("click","#get_php",function(a){rahe.sis.sizes.getPhp(a,this)});jQuery("#get_php").nextAll("code").hide();jQuery(".add_size").hide();rahe.sis.sizes.setButtons()});
|
|
|
|
|
|
|
|
languages/sis-fr_FR.mo
CHANGED
Binary file
|
languages/sis-fr_FR.po
CHANGED
@@ -4,248 +4,272 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple image sizes\n"
|
6 |
"Report-Msgid-Bugs-To: \n"
|
7 |
-
"POT-Creation-Date:
|
8 |
-
"PO-Revision-Date:
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Beapi <njuen@beapi.fr>\n"
|
|
|
11 |
"MIME-Version: 1.0\n"
|
12 |
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
"X-Poedit-Language: French\n"
|
15 |
-
"X-Poedit-Country: FRANCE\n"
|
16 |
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
"X-Poedit-KeywordsList: __;_e;__\n"
|
18 |
"X-Poedit-Basepath: ../\n"
|
|
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
|
21 |
-
#: inc/class.admin.php:
|
22 |
msgid "Reading attachments..."
|
23 |
msgstr "Chargement des médias..."
|
24 |
|
25 |
-
#: inc/class.admin.php:
|
26 |
-
#: inc/class.admin.php:241
|
27 |
msgid "Maximum width"
|
28 |
msgstr "Largeur maximum"
|
29 |
|
30 |
-
#: inc/class.admin.php:
|
31 |
-
#: inc/class.admin.php:245
|
32 |
msgid "Maximum height"
|
33 |
msgstr "Hauteur maximum"
|
34 |
|
35 |
-
#: inc/class.admin.php:
|
36 |
-
#:
|
37 |
-
#: inc/class.admin.php:327
|
38 |
-
#: inc/class.admin.php:386
|
39 |
msgid "Crop ?"
|
40 |
msgstr "Rogner ?"
|
41 |
|
42 |
-
#: inc/class.admin.php:
|
43 |
-
#: inc/class.admin.php:374
|
44 |
msgid "yes"
|
45 |
msgstr "oui"
|
46 |
|
47 |
-
#: inc/class.admin.php:
|
48 |
-
#: inc/class.admin.php:374
|
49 |
msgid "no"
|
50 |
msgstr "non"
|
51 |
|
52 |
-
#: inc/class.admin.php:
|
53 |
-
#: inc/class.admin.php:257
|
54 |
msgid "Show in post insertion ?"
|
55 |
msgstr "Afficher dans l'insertion ?"
|
56 |
|
57 |
-
#: inc/class.admin.php:
|
58 |
msgid " of "
|
59 |
msgstr " de "
|
60 |
|
61 |
-
#: inc/class.admin.php:
|
62 |
msgid " or "
|
63 |
msgstr " ou "
|
64 |
|
65 |
-
#: inc/class.admin.php:
|
66 |
msgid " before the end."
|
67 |
msgstr " avant la fin."
|
68 |
|
69 |
-
#: inc/class.admin.php:
|
70 |
-
#: inc/class.admin.php:259
|
71 |
msgid "Delete"
|
72 |
msgstr "Supprimer"
|
73 |
|
74 |
-
#: inc/class.admin.php:
|
75 |
msgid "No media in your site to regenerate !"
|
76 |
msgstr "Pas de médias à regénérer !"
|
77 |
|
78 |
-
#: inc/class.admin.php:
|
79 |
msgid "Regenerating "
|
80 |
msgstr "Regénération "
|
81 |
|
82 |
-
#: inc/class.admin.php:
|
83 |
msgid "Regenerate "
|
84 |
msgstr "Regénérer "
|
85 |
|
86 |
-
#: inc/class.admin.php:
|
87 |
msgid "Validate image size name"
|
88 |
msgstr "Valider le nom de la taille d'image"
|
89 |
|
90 |
-
#: inc/class.admin.php:
|
91 |
msgid "Done."
|
92 |
msgstr "Fini."
|
93 |
|
94 |
-
#: inc/class.admin.php:
|
95 |
msgid "Size"
|
96 |
msgstr "Taille "
|
97 |
|
98 |
-
#: inc/class.admin.php:
|
99 |
-
msgid "
|
100 |
-
|
|
|
|
|
|
|
|
|
101 |
|
102 |
-
#: inc/class.admin.php:
|
103 |
msgid "This size is already registered, edit it instead of recreating it."
|
104 |
msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
|
105 |
|
106 |
-
#: inc/class.admin.php:
|
107 |
msgid "Do you really want to delete these size ?"
|
108 |
msgstr "Voulez-vous réellement supprimer cette taille ?"
|
109 |
|
110 |
-
#: inc/class.admin.php:
|
111 |
-
#: inc/class.admin.php:260
|
112 |
msgid "Update"
|
113 |
msgstr "Mettre à jour"
|
114 |
|
115 |
-
#: inc/class.admin.php:
|
116 |
msgid "Error requesting page"
|
117 |
msgstr "Erreur lors de la requête vers la page"
|
118 |
|
119 |
-
#: inc/class.admin.php:
|
120 |
msgid "images have been regenerated !"
|
121 |
msgstr "images ont été regénérées !"
|
122 |
|
123 |
-
#: inc/class.admin.php:
|
124 |
msgid "Validate"
|
125 |
msgstr "Valider"
|
126 |
|
127 |
-
#: inc/class.admin.php:
|
128 |
msgid " started at"
|
129 |
msgstr " commencé à "
|
130 |
|
131 |
-
#: inc/class.admin.php:
|
132 |
-
#: inc/class.admin.php:249
|
133 |
msgid "Public name"
|
134 |
msgstr "Nom public"
|
135 |
|
136 |
-
#: inc/class.admin.php:
|
137 |
msgid " finished at :"
|
138 |
msgstr " terminé à :"
|
139 |
|
140 |
-
#: inc/class.admin.php:
|
141 |
-
msgid "
|
142 |
-
|
|
|
|
|
|
|
143 |
|
144 |
-
#: inc/class.admin.php:
|
145 |
msgid "All the sizes you have modifed are not saved, continue anyway ?"
|
146 |
-
msgstr "
|
|
|
|
|
147 |
|
148 |
-
#: inc/class.admin.php:
|
149 |
#, php-format
|
150 |
msgid "This image has been regenerated in %s seconds"
|
151 |
msgstr "Cette image a été regénérée en %s secondes"
|
152 |
|
153 |
-
#: inc/class.admin.php:
|
154 |
msgid "Regenerate thumbnails"
|
155 |
msgstr "Régénérer les vignettes"
|
156 |
|
157 |
-
#: inc/class.admin.php:
|
158 |
msgid "Settings"
|
159 |
msgstr "Paramètres"
|
160 |
|
161 |
-
#: inc/class.admin.php:
|
162 |
#, php-format
|
163 |
msgid "%s size"
|
164 |
msgstr "Taille %s"
|
165 |
|
166 |
-
#: inc/class.admin.php:
|
167 |
msgid "Add a new size"
|
168 |
msgstr "Ajouter une nouvelle taille"
|
169 |
|
170 |
-
#: inc/class.admin.php:
|
171 |
-
msgid "Legend of the sizes"
|
172 |
-
msgstr "Légende des tailles"
|
173 |
-
|
174 |
-
#: inc/class.admin.php:203
|
175 |
msgid "Get php for theme"
|
176 |
msgstr "Récupérer le PHP pour le thème"
|
177 |
|
178 |
-
#: inc/class.admin.php:
|
179 |
msgid "Thumbnail regeneration"
|
180 |
msgstr "Régénération des vignettes"
|
181 |
|
182 |
-
#: inc/class.admin.php:
|
183 |
-
msgid "
|
184 |
-
|
|
|
|
|
|
|
|
|
185 |
|
186 |
-
#: inc/class.admin.php:
|
187 |
-
msgid "
|
188 |
-
msgstr "
|
189 |
|
190 |
-
#: inc/class.admin.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
msgid "Select which thumbnails you want to rebuild:"
|
192 |
msgstr "Sélectionnez les tailles de vignettes à régénérer"
|
193 |
|
194 |
-
#:
|
195 |
-
#: inc/class.admin.php:383
|
196 |
msgid "Size name"
|
197 |
msgstr "Nom de la taille"
|
198 |
|
199 |
-
#:
|
200 |
-
#: inc/class.admin.php:384
|
201 |
msgid "Width"
|
202 |
msgstr "Largeur"
|
203 |
|
204 |
-
#:
|
205 |
-
#: inc/class.admin.php:385
|
206 |
msgid "Height"
|
207 |
msgstr "Hauteur"
|
208 |
|
209 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
msgid "Select which post type source thumbnails you want to rebuild:"
|
211 |
-
msgstr "
|
|
|
|
|
212 |
|
213 |
-
#:
|
214 |
-
#: inc/class.admin.php:424
|
215 |
msgid "Post type"
|
216 |
msgstr "Type de contenu"
|
217 |
|
218 |
-
#:
|
219 |
msgid "End time calculated :"
|
220 |
msgstr "Fin du traitement calculé :"
|
221 |
|
222 |
-
#:
|
|
|
|
|
|
|
|
|
223 |
msgid "Last image:"
|
224 |
msgstr "Dernière image :"
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
msgid "
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
msgid "No id given in POST datas."
|
238 |
-
msgstr "Pas d'id donné dans les données du POST."
|
239 |
-
|
240 |
-
#: inc/class.admin.php:670
|
241 |
-
#, php-format
|
242 |
-
msgid "This file already exists in this size and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
243 |
-
msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
244 |
-
|
245 |
-
#: inc/class.admin.php:672
|
246 |
-
#, php-format
|
247 |
-
msgid "This file does not exists and have not been regenerated :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
248 |
-
msgstr "Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
249 |
|
250 |
#~ msgid "Size "
|
251 |
#~ msgstr "Taille "
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: Simple image sizes\n"
|
6 |
"Report-Msgid-Bugs-To: \n"
|
7 |
+
"POT-Creation-Date: 2013-01-20 02:54+0100\n"
|
8 |
+
"PO-Revision-Date: 2013-01-20 02:54+0100\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Beapi <njuen@beapi.fr>\n"
|
11 |
+
"Language: fr_FR\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
|
15 |
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
"X-Poedit-KeywordsList: __;_e;__\n"
|
17 |
"X-Poedit-Basepath: ../\n"
|
18 |
+
"X-Generator: Poedit 1.5.4\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
|
21 |
+
#: inc/class.admin.php:80
|
22 |
msgid "Reading attachments..."
|
23 |
msgstr "Chargement des médias..."
|
24 |
|
25 |
+
#: inc/class.admin.php:81 inc/class.admin.php:247
|
|
|
26 |
msgid "Maximum width"
|
27 |
msgstr "Largeur maximum"
|
28 |
|
29 |
+
#: inc/class.admin.php:82 inc/class.admin.php:251
|
|
|
30 |
msgid "Maximum height"
|
31 |
msgstr "Hauteur maximum"
|
32 |
|
33 |
+
#: inc/class.admin.php:83 inc/class.admin.php:260
|
34 |
+
#: templates/options-media.php:18 templates/options-media.php:65
|
|
|
|
|
35 |
msgid "Crop ?"
|
36 |
msgstr "Rogner ?"
|
37 |
|
38 |
+
#: inc/class.admin.php:84
|
|
|
39 |
msgid "yes"
|
40 |
msgstr "oui"
|
41 |
|
42 |
+
#: inc/class.admin.php:85
|
|
|
43 |
msgid "no"
|
44 |
msgstr "non"
|
45 |
|
46 |
+
#: inc/class.admin.php:86 inc/class.admin.php:263
|
|
|
47 |
msgid "Show in post insertion ?"
|
48 |
msgstr "Afficher dans l'insertion ?"
|
49 |
|
50 |
+
#: inc/class.admin.php:87
|
51 |
msgid " of "
|
52 |
msgstr " de "
|
53 |
|
54 |
+
#: inc/class.admin.php:88
|
55 |
msgid " or "
|
56 |
msgstr " ou "
|
57 |
|
58 |
+
#: inc/class.admin.php:89
|
59 |
msgid " before the end."
|
60 |
msgstr " avant la fin."
|
61 |
|
62 |
+
#: inc/class.admin.php:90 inc/class.admin.php:265
|
|
|
63 |
msgid "Delete"
|
64 |
msgstr "Supprimer"
|
65 |
|
66 |
+
#: inc/class.admin.php:91
|
67 |
msgid "No media in your site to regenerate !"
|
68 |
msgstr "Pas de médias à regénérer !"
|
69 |
|
70 |
+
#: inc/class.admin.php:92
|
71 |
msgid "Regenerating "
|
72 |
msgstr "Regénération "
|
73 |
|
74 |
+
#: inc/class.admin.php:93
|
75 |
msgid "Regenerate "
|
76 |
msgstr "Regénérer "
|
77 |
|
78 |
+
#: inc/class.admin.php:94
|
79 |
msgid "Validate image size name"
|
80 |
msgstr "Valider le nom de la taille d'image"
|
81 |
|
82 |
+
#: inc/class.admin.php:95
|
83 |
msgid "Done."
|
84 |
msgstr "Fini."
|
85 |
|
86 |
+
#: inc/class.admin.php:96
|
87 |
msgid "Size"
|
88 |
msgstr "Taille "
|
89 |
|
90 |
+
#: inc/class.admin.php:97
|
91 |
+
msgid ""
|
92 |
+
"Don't use the basic Wordpress thumbnail size name, use the form above to "
|
93 |
+
"edit them"
|
94 |
+
msgstr ""
|
95 |
+
"N'utilisez pas les tailles par défaut de WordPress comme nom de taille, "
|
96 |
+
"éditez leurs valeurs avec le formulaire ci-dessus."
|
97 |
|
98 |
+
#: inc/class.admin.php:98
|
99 |
msgid "This size is already registered, edit it instead of recreating it."
|
100 |
msgstr "Cette taille existe déjà, éditez la au lieu de la recréer."
|
101 |
|
102 |
+
#: inc/class.admin.php:99
|
103 |
msgid "Do you really want to delete these size ?"
|
104 |
msgstr "Voulez-vous réellement supprimer cette taille ?"
|
105 |
|
106 |
+
#: inc/class.admin.php:100 inc/class.admin.php:266
|
|
|
107 |
msgid "Update"
|
108 |
msgstr "Mettre à jour"
|
109 |
|
110 |
+
#: inc/class.admin.php:101
|
111 |
msgid "Error requesting page"
|
112 |
msgstr "Erreur lors de la requête vers la page"
|
113 |
|
114 |
+
#: inc/class.admin.php:102
|
115 |
msgid "images have been regenerated !"
|
116 |
msgstr "images ont été regénérées !"
|
117 |
|
118 |
+
#: inc/class.admin.php:103
|
119 |
msgid "Validate"
|
120 |
msgstr "Valider"
|
121 |
|
122 |
+
#: inc/class.admin.php:104
|
123 |
msgid " started at"
|
124 |
msgstr " commencé à "
|
125 |
|
126 |
+
#: inc/class.admin.php:105 inc/class.admin.php:255
|
|
|
127 |
msgid "Public name"
|
128 |
msgstr "Nom public"
|
129 |
|
130 |
+
#: inc/class.admin.php:106
|
131 |
msgid " finished at :"
|
132 |
msgstr " terminé à :"
|
133 |
|
134 |
+
#: inc/class.admin.php:107
|
135 |
+
msgid ""
|
136 |
+
"Error during the php treatment, be sure to not have php errors in your page"
|
137 |
+
msgstr ""
|
138 |
+
"Erreur durant le traitement, soyez sûr de ne pas avoir d'erreurs php dans "
|
139 |
+
"votre page"
|
140 |
|
141 |
+
#: inc/class.admin.php:108
|
142 |
msgid "All the sizes you have modifed are not saved, continue anyway ?"
|
143 |
+
msgstr ""
|
144 |
+
"Toutes les tailles qui ont été modifiée n'ont pas été sauvées, continuer "
|
145 |
+
"tout de même ?"
|
146 |
|
147 |
+
#: inc/class.admin.php:109
|
148 |
#, php-format
|
149 |
msgid "This image has been regenerated in %s seconds"
|
150 |
msgstr "Cette image a été regénérée en %s secondes"
|
151 |
|
152 |
+
#: inc/class.admin.php:138
|
153 |
msgid "Regenerate thumbnails"
|
154 |
msgstr "Régénérer les vignettes"
|
155 |
|
156 |
+
#: inc/class.admin.php:159
|
157 |
msgid "Settings"
|
158 |
msgstr "Paramètres"
|
159 |
|
160 |
+
#: inc/class.admin.php:199
|
161 |
#, php-format
|
162 |
msgid "%s size"
|
163 |
msgstr "Taille %s"
|
164 |
|
165 |
+
#: inc/class.admin.php:206
|
166 |
msgid "Add a new size"
|
167 |
msgstr "Ajouter une nouvelle taille"
|
168 |
|
169 |
+
#: inc/class.admin.php:209
|
|
|
|
|
|
|
|
|
170 |
msgid "Get php for theme"
|
171 |
msgstr "Récupérer le PHP pour le thème"
|
172 |
|
173 |
+
#: inc/class.admin.php:212
|
174 |
msgid "Thumbnail regeneration"
|
175 |
msgstr "Régénération des vignettes"
|
176 |
|
177 |
+
#: inc/class.admin.php:292
|
178 |
+
msgid ""
|
179 |
+
"Copy and paste the code below into your Wordpress theme function file if you "
|
180 |
+
"wanted to save them and deactivate the plugin."
|
181 |
+
msgstr ""
|
182 |
+
"Copiez et collez le code ci-dessous dans votre fichier de fonctions de votre "
|
183 |
+
"thème WordPress si vous voulez les conserver et désactiver ce plugin."
|
184 |
|
185 |
+
#: inc/class.admin.php:508
|
186 |
+
msgid "Trying to cheat ?"
|
187 |
+
msgstr "Cheater ?"
|
188 |
|
189 |
+
#: inc/class.admin.php:519
|
190 |
+
msgid "No id given in POST datas."
|
191 |
+
msgstr "Pas d'id donné dans les données du POST."
|
192 |
+
|
193 |
+
#: inc/class.admin.php:535
|
194 |
+
#, php-format
|
195 |
+
msgid ""
|
196 |
+
"This file already exists in this size and have not been regenerated :<br/><a "
|
197 |
+
"target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
198 |
+
msgstr ""
|
199 |
+
"Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
|
200 |
+
"regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
201 |
+
|
202 |
+
#: inc/class.admin.php:544
|
203 |
+
#, php-format
|
204 |
+
msgid ""
|
205 |
+
"This file does not exists and have not been regenerated :<br/><a target="
|
206 |
+
"\"_blank\" href=\"%1$s\" >%2$s</a>"
|
207 |
+
msgstr ""
|
208 |
+
"Ce fichier existe déjà dans cette ces tailles d'image et n'a pas été "
|
209 |
+
"regénéré :<br/><a target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
210 |
+
|
211 |
+
#: inc/class.admin.php:785 inc/class.admin.php:788
|
212 |
+
#: templates/options-media.php:128
|
213 |
+
msgid "Regenerate Thumbnails"
|
214 |
+
msgstr "Régénérer les vignettes"
|
215 |
+
|
216 |
+
#: templates/options-media.php:10
|
217 |
msgid "Select which thumbnails you want to rebuild:"
|
218 |
msgstr "Sélectionnez les tailles de vignettes à régénérer"
|
219 |
|
220 |
+
#: templates/options-media.php:15 templates/options-media.php:62
|
|
|
221 |
msgid "Size name"
|
222 |
msgstr "Nom de la taille"
|
223 |
|
224 |
+
#: templates/options-media.php:16 templates/options-media.php:63
|
|
|
225 |
msgid "Width"
|
226 |
msgstr "Largeur"
|
227 |
|
228 |
+
#: templates/options-media.php:17 templates/options-media.php:64
|
|
|
229 |
msgid "Height"
|
230 |
msgstr "Hauteur"
|
231 |
|
232 |
+
#: templates/options-media.php:54
|
233 |
+
msgid "Yes"
|
234 |
+
msgstr "Oui"
|
235 |
+
|
236 |
+
#: templates/options-media.php:54
|
237 |
+
msgid "No"
|
238 |
+
msgstr "Non"
|
239 |
+
|
240 |
+
#: templates/options-media.php:70
|
241 |
msgid "Select which post type source thumbnails you want to rebuild:"
|
242 |
+
msgstr ""
|
243 |
+
"Sélectionnez quelles vignettes de quel type de contenu vous souhaitez "
|
244 |
+
"régénérer : "
|
245 |
|
246 |
+
#: templates/options-media.php:75 templates/options-media.php:102
|
|
|
247 |
msgid "Post type"
|
248 |
msgstr "Type de contenu"
|
249 |
|
250 |
+
#: templates/options-media.php:116
|
251 |
msgid "End time calculated :"
|
252 |
msgstr "Fin du traitement calculé :"
|
253 |
|
254 |
+
#: templates/options-media.php:116
|
255 |
+
msgid "Calculating..."
|
256 |
+
msgstr "Calcul en cours..."
|
257 |
+
|
258 |
+
#: templates/options-media.php:127
|
259 |
msgid "Last image:"
|
260 |
msgstr "Dernière image :"
|
261 |
|
262 |
+
#~ msgid "Legend of the sizes"
|
263 |
+
#~ msgstr "Légende des tailles"
|
264 |
+
|
265 |
+
#~ msgid ""
|
266 |
+
#~ "The images created on your theme are <span style=\"color:#F2A13A"
|
267 |
+
#~ "\">orange</span> and your custom size are <span style=\"color:#89D76A\"> "
|
268 |
+
#~ "green </span>."
|
269 |
+
#~ msgstr ""
|
270 |
+
#~ "Les tailles d'images crées par votre thème sont en <span style=\"color:"
|
271 |
+
#~ "#F2A13A\">orange</span> et vos tailles personnalisées sont en <span style="
|
272 |
+
#~ "\"color:#89D76A\"> vert </span>."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
#~ msgid "Size "
|
275 |
#~ msgstr "Taille "
|
languages/sis.pot
CHANGED
@@ -1,254 +1,257 @@
|
|
1 |
-
# Copyright (C) 2010
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: \n"
|
6 |
-
"Report-Msgid-Bugs-To: \n"
|
7 |
-
"POT-Creation-Date:
|
8 |
-
"PO-Revision-Date:
|
9 |
-
"Last-Translator:
|
10 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11 |
-
"MIME-Version: 1.0\n"
|
12 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
-
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
"X-Poedit-Basepath: .\n"
|
15 |
-
"X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
|
16 |
-
"X-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
#: ../inc/class.admin.php:
|
24 |
-
msgid "Maximum width"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: ../inc/class.admin.php:
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
#: ../
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
#: ../inc/class.admin.php:
|
41 |
-
msgid "
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: ../inc/class.admin.php:
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
msgid "
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
#: ../
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
msgid "
|
253 |
-
msgstr ""
|
254 |
-
|
|
|
|
|
|
1 |
+
# Copyright (C) 2010
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: \n"
|
6 |
+
"Report-Msgid-Bugs-To: \n"
|
7 |
+
"POT-Creation-Date: 2013-01-20 02:55+0100\n"
|
8 |
+
"PO-Revision-Date: 2013-01-20 02:55+0100\n"
|
9 |
+
"Last-Translator: \n"
|
10 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
11 |
+
"MIME-Version: 1.0\n"
|
12 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
+
"Content-Transfer-Encoding: 8bit\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-KeywordsList: esc_attr_e;esc_html_e;esc_attr__;esc_html__;_e;__\n"
|
16 |
+
"X-Generator: Poedit 1.5.4\n"
|
17 |
+
"X-Poedit-SearchPath-0: ..\n"
|
18 |
+
|
19 |
+
#: ../inc/class.admin.php:80
|
20 |
+
msgid "Reading attachments..."
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: ../inc/class.admin.php:81 ../inc/class.admin.php:247
|
24 |
+
msgid "Maximum width"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: ../inc/class.admin.php:82 ../inc/class.admin.php:251
|
28 |
+
msgid "Maximum height"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: ../inc/class.admin.php:83 ../inc/class.admin.php:260
|
32 |
+
#: ../templates/options-media.php:18 ../templates/options-media.php:65
|
33 |
+
msgid "Crop ?"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: ../inc/class.admin.php:84
|
37 |
+
msgid "yes"
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: ../inc/class.admin.php:85
|
41 |
+
msgid "no"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: ../inc/class.admin.php:86 ../inc/class.admin.php:263
|
45 |
+
msgid "Show in post insertion ?"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#: ../inc/class.admin.php:87
|
49 |
+
msgid " of "
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: ../inc/class.admin.php:88
|
53 |
+
msgid " or "
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: ../inc/class.admin.php:89
|
57 |
+
msgid " before the end."
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: ../inc/class.admin.php:90 ../inc/class.admin.php:265
|
61 |
+
msgid "Delete"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: ../inc/class.admin.php:91
|
65 |
+
msgid "No media in your site to regenerate !"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: ../inc/class.admin.php:92
|
69 |
+
msgid "Regenerating "
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: ../inc/class.admin.php:93
|
73 |
+
msgid "Regenerate "
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: ../inc/class.admin.php:94
|
77 |
+
msgid "Validate image size name"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: ../inc/class.admin.php:95
|
81 |
+
msgid "Done."
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: ../inc/class.admin.php:96
|
85 |
+
msgid "Size"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: ../inc/class.admin.php:97
|
89 |
+
msgid ""
|
90 |
+
"Don't use the basic Wordpress thumbnail size name, use the form above to "
|
91 |
+
"edit them"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: ../inc/class.admin.php:98
|
95 |
+
msgid "This size is already registered, edit it instead of recreating it."
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: ../inc/class.admin.php:99
|
99 |
+
msgid "Do you really want to delete these size ?"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: ../inc/class.admin.php:100 ../inc/class.admin.php:266
|
103 |
+
msgid "Update"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: ../inc/class.admin.php:101
|
107 |
+
msgid "Error requesting page"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: ../inc/class.admin.php:102
|
111 |
+
msgid "images have been regenerated !"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: ../inc/class.admin.php:103
|
115 |
+
msgid "Validate"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: ../inc/class.admin.php:104
|
119 |
+
msgid " started at"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: ../inc/class.admin.php:105 ../inc/class.admin.php:255
|
123 |
+
msgid "Public name"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: ../inc/class.admin.php:106
|
127 |
+
msgid " finished at :"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: ../inc/class.admin.php:107
|
131 |
+
msgid ""
|
132 |
+
"Error during the php treatment, be sure to not have php errors in your page"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: ../inc/class.admin.php:108
|
136 |
+
msgid "All the sizes you have modifed are not saved, continue anyway ?"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: ../inc/class.admin.php:109
|
140 |
+
#, php-format
|
141 |
+
msgid "This image has been regenerated in %s seconds"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: ../inc/class.admin.php:138
|
145 |
+
msgid "Regenerate thumbnails"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: ../inc/class.admin.php:159
|
149 |
+
msgid "Settings"
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: ../inc/class.admin.php:199
|
153 |
+
#, php-format
|
154 |
+
msgid "%s size"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: ../inc/class.admin.php:206
|
158 |
+
msgid "Add a new size"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: ../inc/class.admin.php:209
|
162 |
+
msgid "Get php for theme"
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
#: ../inc/class.admin.php:212
|
166 |
+
msgid "Thumbnail regeneration"
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: ../inc/class.admin.php:248 ../inc/class.admin.php:250
|
170 |
+
#: ../inc/class.admin.php:252
|
171 |
+
msgid "custom_image_sizes["
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: ../inc/class.admin.php:279
|
175 |
+
msgid "Add a new size of thumbnail"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: ../inc/class.admin.php:291
|
179 |
+
msgid "Get the PHP for the theme"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: ../inc/class.admin.php:292
|
183 |
+
msgid ""
|
184 |
+
"Copy and paste the code below into your Wordpress theme function file if you "
|
185 |
+
"wanted to save them and deactivate the plugin."
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: ../inc/class.admin.php:508
|
189 |
+
msgid "Trying to cheat ?"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: ../inc/class.admin.php:519
|
193 |
+
msgid "No id given in POST datas."
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: ../inc/class.admin.php:535
|
197 |
+
#, php-format
|
198 |
+
msgid ""
|
199 |
+
"This file already exists in this size and have not been regenerated :<br/><a "
|
200 |
+
"target=\"_blank\" href=\"%1$s\" >%2$s</a>"
|
201 |
+
msgstr ""
|
202 |
+
|
203 |
+
#: ../inc/class.admin.php:544
|
204 |
+
#, php-format
|
205 |
+
msgid ""
|
206 |
+
"This file does not exists and have not been regenerated :<br/><a target="
|
207 |
+
"\"_blank\" href=\"%1$s\" >%2$s</a>"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: ../inc/class.admin.php:785 ../inc/class.admin.php:788
|
211 |
+
#: ../templates/options-media.php:128
|
212 |
+
msgid "Regenerate Thumbnails"
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: ../templates/options-media.php:10
|
216 |
+
msgid "Select which thumbnails you want to rebuild:"
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
#: ../templates/options-media.php:15 ../templates/options-media.php:62
|
220 |
+
msgid "Size name"
|
221 |
+
msgstr ""
|
222 |
+
|
223 |
+
#: ../templates/options-media.php:16 ../templates/options-media.php:63
|
224 |
+
msgid "Width"
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: ../templates/options-media.php:17 ../templates/options-media.php:64
|
228 |
+
msgid "Height"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#: ../templates/options-media.php:54
|
232 |
+
msgid "Yes"
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: ../templates/options-media.php:54
|
236 |
+
msgid "No"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: ../templates/options-media.php:70
|
240 |
+
msgid "Select which post type source thumbnails you want to rebuild:"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: ../templates/options-media.php:75 ../templates/options-media.php:102
|
244 |
+
msgid "Post type"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: ../templates/options-media.php:116
|
248 |
+
msgid "End time calculated :"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: ../templates/options-media.php:116
|
252 |
+
msgid "Calculating..."
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
#: ../templates/options-media.php:127
|
256 |
+
msgid "Last image:"
|
257 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: Rahe
|
3 |
Donate link: http://www.beapi.fr/donate/
|
4 |
Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
== Description ==
|
10 |
|
@@ -38,6 +38,13 @@ Contribute on https://github.com/Rahe/Simple-image-sizes
|
|
38 |
4. Regenerating image sizes
|
39 |
|
40 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
* 2.3.1
|
42 |
* Add Ajax bulk actions on medias list
|
43 |
* Add ajax thumbnail rebuild on single media
|
2 |
Contributors: Rahe
|
3 |
Donate link: http://www.beapi.fr/donate/
|
4 |
Tags: images, image, custom sizes, custom images, thumbnail regenerate, thumbnail, regenerate
|
5 |
+
Requires at least: 3.5
|
6 |
+
Tested up to: 3.5
|
7 |
+
Stable tag: 2.4
|
8 |
|
9 |
== Description ==
|
10 |
|
38 |
4. Regenerating image sizes
|
39 |
|
40 |
== Changelog ==
|
41 |
+
* 2.4
|
42 |
+
* Made for 3.5 and up
|
43 |
+
* Refactoring PHP/Javascript code
|
44 |
+
* Javascript improvements
|
45 |
+
* Remove useless UI
|
46 |
+
* UI improvements
|
47 |
+
* Global PHP performance improvements
|
48 |
* 2.3.1
|
49 |
* Add Ajax bulk actions on medias list
|
50 |
* Add ajax thumbnail rebuild on single media
|
simple_image_sizes.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Simple Image Size
|
4 |
Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
|
5 |
Description: Add options in media setting page for images sizes
|
6 |
-
Version: 2.
|
7 |
Author: Rahe
|
8 |
Author URI: http://nicolas-juen.fr
|
9 |
Text Domain: sis
|
@@ -27,9 +27,9 @@ along with this program; if not, write to the Free Software
|
|
27 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
*/
|
29 |
|
30 |
-
define( 'SIS_URL', plugins_url('
|
31 |
define( 'SIS_DIR', dirname(__FILE__) );
|
32 |
-
define( 'SIS_VERSION', '2.
|
33 |
define( 'SIS_OPTION', 'custom_image_sizes' );
|
34 |
|
35 |
require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
|
@@ -38,11 +38,11 @@ require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'cla
|
|
38 |
add_action ( 'plugins_loaded', 'initSIS' );
|
39 |
function initSIS() {
|
40 |
global $SIS;
|
41 |
-
if( is_admin() )
|
42 |
$SIS['admin'] = new SISAdmin();
|
|
|
43 |
|
44 |
$SIS['client'] = new SISClient();
|
45 |
|
46 |
load_plugin_textdomain ( 'sis', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
|
47 |
-
}
|
48 |
-
?>
|
3 |
Plugin Name: Simple Image Size
|
4 |
Plugin URI: http://redmine.beapi.fr/projects/show/simple-image-sizes
|
5 |
Description: Add options in media setting page for images sizes
|
6 |
+
Version: 2.4
|
7 |
Author: Rahe
|
8 |
Author URI: http://nicolas-juen.fr
|
9 |
Text Domain: sis
|
27 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
*/
|
29 |
|
30 |
+
define( 'SIS_URL', plugins_url('', __FILE__) );
|
31 |
define( 'SIS_DIR', dirname(__FILE__) );
|
32 |
+
define( 'SIS_VERSION', '2.4' );
|
33 |
define( 'SIS_OPTION', 'custom_image_sizes' );
|
34 |
|
35 |
require_once( SIS_DIR . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'class.admin.php' );
|
38 |
add_action ( 'plugins_loaded', 'initSIS' );
|
39 |
function initSIS() {
|
40 |
global $SIS;
|
41 |
+
if( is_admin() ) {
|
42 |
$SIS['admin'] = new SISAdmin();
|
43 |
+
}
|
44 |
|
45 |
$SIS['client'] = new SISClient();
|
46 |
|
47 |
load_plugin_textdomain ( 'sis', false, basename( rtrim( SIS_DIR, '/' ) ) . '/languages' );
|
48 |
+
}
|
|