Image Watermark - Version 1.5.3

Version Description

  • New: ImageMagic support
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Image Watermark
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2.1 to 1.5.3

css/image-watermark.css CHANGED
@@ -1,25 +1,25 @@
1
- /* Image Watermark settings */
2
- .df-credits { float: right; width: 280px; background: #fff; margin: 20px -300px 20px 20px; position: relative; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); }
3
- .df-credits .inner { padding-left: 10px; padding-right: 10px; }
4
- .df-credits h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; border-bottom: 1px solid #eee; }
5
- .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; padding-bottom: 10px; margin: 0; }
6
- .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
7
- .image-watermark-settings .df-credits form { min-width: 260px; margin-bottom: 1em; }
8
- .image-watermark-settings .df-credits form input { margin: 0; padding: 0; }
9
- .image-watermark-settings { margin-right: 300px; }
10
- .image-watermark-settings hr, .df-credits hr { border: solid #eee; border-width: 1px 0 0; clear: both; height: 0; }
11
- .image-watermark-settings form { float: left; min-width: 463px; width: auto; }
12
- .image-watermark-settings fieldset span.description { margin-bottom: 8px; margin-top: 4px; display: block; }
13
- .image-watermark-settings.ui-button { margin-bottom: 5px; }
14
- .image-watermark-settings .description { font-size: 13px; margin-bottom: 8px; }
15
-
16
- /* All Mobile Sizes (devices and browser) */
17
- @media only screen and (max-width: 959px) {
18
- .df-credits { width: 100%; float: none; margin: 20px 0; }
19
- .image-watermark-settings { margin-right: 0; }
20
- }
21
-
22
- #cpt-select { margin-top: 5px; }
23
- .wplike-slider span.middle { width: 150px; }
24
- .wplike-slider span.left { margin-right: 10px; }
25
  .wplike-slider span.right { margin-left: 10px; }
1
+ /* Image Watermark settings */
2
+ .df-credits { float: right; width: 280px; background: #fff; margin: 20px -300px 20px 20px; position: relative; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); }
3
+ .df-credits .inner { padding-left: 10px; padding-right: 10px; }
4
+ .df-credits h3 { font-size: 14px; line-height: 1.4; margin: 0; padding: 8px 12px; border-bottom: 1px solid #eee; }
5
+ .df-credits .df-link { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-style:italic; padding-bottom: 10px; margin: 0; }
6
+ .df-credits .df-link a { vertical-align: middle; padding: 5px 0 0 4px; }
7
+ .image-watermark-settings .df-credits form { min-width: 260px; margin-bottom: 1em; }
8
+ .image-watermark-settings .df-credits form input { margin: 0; padding: 0; }
9
+ .image-watermark-settings { margin-right: 300px; }
10
+ .image-watermark-settings hr, .df-credits hr { border: solid #eee; border-width: 1px 0 0; clear: both; height: 0; }
11
+ .image-watermark-settings form { float: left; min-width: 463px; width: auto; }
12
+ .image-watermark-settings fieldset span.description { margin-bottom: 8px; margin-top: 4px; display: block; }
13
+ .image-watermark-settings.ui-button { margin-bottom: 5px; }
14
+ .image-watermark-settings .description { font-size: 13px; margin-bottom: 8px; }
15
+
16
+ /* All Mobile Sizes (devices and browser) */
17
+ @media only screen and (max-width: 959px) {
18
+ .df-credits { width: 100%; float: none; margin: 20px 0; }
19
+ .image-watermark-settings { margin-right: 0; }
20
+ }
21
+
22
+ #cpt-select { margin-top: 5px; }
23
+ .wplike-slider span.middle { width: 150px; }
24
+ .wplike-slider span.left { margin-right: 10px; }
25
  .wplike-slider span.right { margin-left: 10px; }
css/wp-like-ui-theme.css CHANGED
@@ -1,782 +1,782 @@
1
- /*
2
- * jQuery UI CSS Framework 1.8.7
3
- *
4
- * Copyright 2010, 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/Theming/API
9
- */
10
-
11
- /* Layout helpers
12
- ----------------------------------*/
13
- .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
- .ui-helper-clearfix { display: inline-block; }
18
- /* required comment for clearfix to work in Opera \*/
19
- * html .ui-helper-clearfix { height:1%; }
20
- .ui-helper-clearfix { display:block; }
21
- /* end clearfix */
22
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
-
24
-
25
- /* Interaction Cues
26
- ----------------------------------*/
27
- .ui-state-disabled { cursor: default !important; }
28
-
29
-
30
- /* Icons
31
- ----------------------------------*/
32
-
33
- /* states and images */
34
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
-
36
-
37
- /* Misc visuals
38
- ----------------------------------*/
39
-
40
- /* Overlays */
41
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
-
43
-
44
- /*
45
- * jQuery UI CSS Framework 1.8.7
46
- *
47
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
48
- * Dual licensed under the MIT or GPL Version 2 licenses.
49
- * http://jquery.org/license
50
- *
51
- * http://docs.jquery.com/UI/Theming/API
52
- *
53
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
54
- */
55
-
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 #dfdfdf; background: #ffffff; color: #333333; font-size:12px; }
63
- .ui-widget-content a { color: #333333; }
64
- .ui-widget-header { border: 1px solid #dfdfdf; color: #333333; font-weight: normal; }
65
- .ui-widget-header {
66
- background: #f3f3f3 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
67
- background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
68
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
69
- background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
70
- background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
71
- background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
72
- background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
73
- }
74
- .ui-widget-header a { color: #333333; }
75
-
76
- /* Interaction states
77
- ----------------------------------*/
78
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #dfdfdf; font-weight: normal; color: #333333; }
79
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
80
- background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
81
- background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
82
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
83
- background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
84
- background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
85
- background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
86
- background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
87
- -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
88
- -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
89
- box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
90
- }
91
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #333333; 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 #bbbbbb; font-weight: normal; color: #313131; }
93
- .ui-state-hover a, .ui-state-hover a:hover { color: #313131; text-decoration: none; }
94
- .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
95
- outline: none;
96
- color: #ffffff;
97
- border-color: #21759b #21759b #1e6a8d;
98
- background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
99
- background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
100
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
101
- background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
102
- background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
103
- background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
104
- background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
105
- -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
106
- -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
107
- box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
108
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
109
- }
110
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #fff; text-decoration: none; }
111
- .ui-widget :active { outline: none; }
112
-
113
- /* Interaction Cues
114
- ----------------------------------*/
115
- .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #e6db55; background: #ffffe0; color: #333; }
116
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #333; }
117
- .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cc0000; background: #ffebe8; color: #333; }
118
- .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
119
- .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
120
- .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: normal; }
121
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { font-weight: normal; }
122
- .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
123
-
124
- /* Icons
125
- ----------------------------------*/
126
-
127
- /* states and images */
128
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
129
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
130
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
131
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); }
132
- .ui-state-hover .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
133
- .ui-state-focus .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
134
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
135
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
136
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background: url(images/icon_sprite.png) -16px 0 no-repeat !important; }
137
- .ui-state-highlight .ui-icon, .ui-state-error .ui-icon { margin-top: -1px; }
138
-
139
- /* positioning */
140
- .ui-icon-carat-1-n { background-position: 0 0; }
141
- .ui-icon-carat-1-ne { background-position: -16px 0; }
142
- .ui-icon-carat-1-e { background-position: -32px 0; }
143
- .ui-icon-carat-1-se { background-position: -48px 0; }
144
- .ui-icon-carat-1-s { background-position: -64px 0; }
145
- .ui-icon-carat-1-sw { background-position: -80px 0; }
146
- .ui-icon-carat-1-w { background-position: -96px 0; }
147
- .ui-icon-carat-1-nw { background-position: -112px 0; }
148
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
149
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
150
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
151
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
152
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
153
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
154
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
155
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
156
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
157
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
158
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
159
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
160
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
161
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
162
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
163
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
164
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
165
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
166
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
167
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
168
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
169
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
170
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
171
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
172
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
173
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
174
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
175
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
176
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
177
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
178
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
179
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
180
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
181
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
182
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
183
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
184
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
185
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
186
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
187
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
188
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
189
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
190
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
191
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
192
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
193
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
194
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
195
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
196
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
197
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
198
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
199
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
200
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
201
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
202
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
203
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
204
- .ui-icon-arrow-4 { background-position: 0 -80px; }
205
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
206
- .ui-icon-extlink { background-position: -32px -80px; }
207
- .ui-icon-newwin { background-position: -48px -80px; }
208
- .ui-icon-refresh { background-position: -64px -80px; }
209
- .ui-icon-shuffle { background-position: -80px -80px; }
210
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
211
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
212
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
213
- .ui-icon-folder-open { background-position: -16px -96px; }
214
- .ui-icon-document { background-position: -32px -96px; }
215
- .ui-icon-document-b { background-position: -48px -96px; }
216
- .ui-icon-note { background-position: -64px -96px; }
217
- .ui-icon-mail-closed { background-position: -80px -96px; }
218
- .ui-icon-mail-open { background-position: -96px -96px; }
219
- .ui-icon-suitcase { background-position: -112px -96px; }
220
- .ui-icon-comment { background-position: -128px -96px; }
221
- .ui-icon-person { background-position: -144px -96px; }
222
- .ui-icon-print { background-position: -160px -96px; }
223
- .ui-icon-trash { background-position: -176px -96px; }
224
- .ui-icon-locked { background-position: -192px -96px; }
225
- .ui-icon-unlocked { background-position: -208px -96px; }
226
- .ui-icon-bookmark { background-position: -224px -96px; }
227
- .ui-icon-tag { background-position: -240px -96px; }
228
- .ui-icon-home { background-position: 0 -112px; }
229
- .ui-icon-flag { background-position: -16px -112px; }
230
- .ui-icon-calendar { background-position: -32px -112px; }
231
- .ui-icon-cart { background-position: -48px -112px; }
232
- .ui-icon-pencil { background-position: -64px -112px; }
233
- .ui-icon-clock { background-position: -80px -112px; }
234
- .ui-icon-disk { background-position: -96px -112px; }
235
- .ui-icon-calculator { background-position: -112px -112px; }
236
- .ui-icon-zoomin { background-position: -128px -112px; }
237
- .ui-icon-zoomout { background-position: -144px -112px; }
238
- .ui-icon-search { background-position: -160px -112px; }
239
- .ui-icon-wrench { background-position: -176px -112px; }
240
- .ui-icon-gear { background-position: -192px -112px; }
241
- .ui-icon-heart { background-position: -208px -112px; }
242
- .ui-icon-star { background-position: -224px -112px; }
243
- .ui-icon-link { background-position: -240px -112px; }
244
- .ui-icon-cancel { background-position: 0 -128px; }
245
- .ui-icon-plus { background-position: -16px -128px; }
246
- .ui-icon-plusthick { background-position: -32px -128px; }
247
- .ui-icon-minus { background-position: -48px -128px; }
248
- .ui-icon-minusthick { background-position: -64px -128px; }
249
- .ui-icon-close { background-position: -80px -128px; }
250
- .ui-icon-closethick { background-position: -96px -128px; }
251
- .ui-icon-key { background-position: -112px -128px; }
252
- .ui-icon-lightbulb { background-position: -128px -128px; }
253
- .ui-icon-scissors { background-position: -144px -128px; }
254
- .ui-icon-clipboard { background-position: -160px -128px; }
255
- .ui-icon-copy { background-position: -176px -128px; }
256
- .ui-icon-contact { background-position: -192px -128px; }
257
- .ui-icon-image { background-position: -208px -128px; }
258
- .ui-icon-video { background-position: -224px -128px; }
259
- .ui-icon-script { background-position: -240px -128px; }
260
- .ui-icon-alert { background-position: 0 -144px; }
261
- .ui-icon-info { background: url(images/icon_sprite.png) 0 0 no-repeat !important; }
262
- .ui-icon-notice { background-position: -32px -144px; }
263
- .ui-icon-help { background-position: -48px -144px; }
264
- .ui-icon-check { background-position: -64px -144px; }
265
- .ui-icon-bullet { background-position: -80px -144px; }
266
- .ui-icon-radio-off { background-position: -96px -144px; }
267
- .ui-icon-radio-on { background-position: -112px -144px; }
268
- .ui-icon-pin-w { background-position: -128px -144px; }
269
- .ui-icon-pin-s { background-position: -144px -144px; }
270
- .ui-icon-play { background-position: 0 -160px; }
271
- .ui-icon-pause { background-position: -16px -160px; }
272
- .ui-icon-seek-next { background-position: -32px -160px; }
273
- .ui-icon-seek-prev { background-position: -48px -160px; }
274
- .ui-icon-seek-end { background-position: -64px -160px; }
275
- .ui-icon-seek-start { background-position: -80px -160px; }
276
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
277
- .ui-icon-seek-first { background-position: -80px -160px; }
278
- .ui-icon-stop { background-position: -96px -160px; }
279
- .ui-icon-eject { background-position: -112px -160px; }
280
- .ui-icon-volume-off { background-position: -128px -160px; }
281
- .ui-icon-volume-on { background-position: -144px -160px; }
282
- .ui-icon-power { background-position: 0 -176px; }
283
- .ui-icon-signal-diag { background-position: -16px -176px; }
284
- .ui-icon-signal { background-position: -32px -176px; }
285
- .ui-icon-battery-0 { background-position: -48px -176px; }
286
- .ui-icon-battery-1 { background-position: -64px -176px; }
287
- .ui-icon-battery-2 { background-position: -80px -176px; }
288
- .ui-icon-battery-3 { background-position: -96px -176px; }
289
- .ui-icon-circle-plus { background-position: 0 -192px; }
290
- .ui-icon-circle-minus { background-position: -16px -192px; }
291
- .ui-icon-circle-close { background-position: -32px -192px; }
292
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
293
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
294
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
295
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
296
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
297
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
298
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
299
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
300
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
301
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
302
- .ui-icon-circle-check { background-position: -208px -192px; }
303
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
304
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
305
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
306
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
307
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
308
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
309
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
310
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
311
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
312
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
313
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
314
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
315
-
316
-
317
- /* Misc visuals
318
- ----------------------------------*/
319
-
320
- /* Corner radius */
321
- .ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
322
- .ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
323
- .ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
324
- .ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
325
- .ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
326
- .ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
327
- .ui-corner-right { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
328
- .ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
329
- .ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
330
-
331
- /* Overlays */
332
- .ui-widget-overlay { background: #262b33; opacity: .70;filter:Alpha(Opacity=70); }
333
- .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
334
- * jQuery UI Resizable 1.8.7
335
- *
336
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
337
- * Dual licensed under the MIT or GPL Version 2 licenses.
338
- * http://jquery.org/license
339
- *
340
- * http://docs.jquery.com/UI/Resizable#theming
341
- */
342
- .ui-resizable { position: relative;}
343
- .ui-resizable-handle { position: absolute; font-size: 0.1px; z-index: 999; display: block;}
344
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
345
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
346
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
347
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
348
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
349
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
350
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
351
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
352
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
353
- * jQuery UI Selectable 1.8.7
354
- *
355
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
356
- * Dual licensed under the MIT or GPL Version 2 licenses.
357
- * http://jquery.org/license
358
- *
359
- * http://docs.jquery.com/UI/Selectable#theming
360
- */
361
- .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
362
- /*
363
- * jQuery UI Accordion 1.8.7
364
- *
365
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
366
- * Dual licensed under the MIT or GPL Version 2 licenses.
367
- * http://jquery.org/license
368
- *
369
- * http://docs.jquery.com/UI/Accordion#theming
370
- */
371
- /* IE/Win - Fix animation bug - #4615 */
372
- .ui-accordion { width: 100%; }
373
- .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 0.2em; zoom: 1; height:30px; line-height:30px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
374
- .ui-accordion .ui-accordion-header.ui-state-active { -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; }
375
- .ui-accordion .ui-accordion-content { -moz-border-radius: 0 0 3px 3px; -webkit-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; }
376
- .ui-accordion .ui-accordion-li-fix { display: inline; }
377
- .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
378
- .ui-accordion .ui-accordion-header a { display: block; font-size: 12px; font-weight: normal; padding: 0 .5em 0 1em; }
379
- .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
380
- .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; display:none; }
381
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; display: none; zoom: 1; }
382
- .ui-accordion .ui-accordion-content-active { display: block; }/*
383
- * jQuery UI Autocomplete 1.8.7
384
- *
385
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
386
- * Dual licensed under the MIT or GPL Version 2 licenses.
387
- * http://jquery.org/license
388
- *
389
- * http://docs.jquery.com/UI/Autocomplete#theming
390
- */
391
- .ui-autocomplete {
392
- position: absolute; cursor: default; z-index: 3;
393
- -moz-border-radius: 0;
394
- -webkit-border-radius: 0;
395
- border-radius: 0;
396
- -moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
397
- -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
398
- box-shadow: 0 1px 5px rgba(0,0,0,0.3);
399
- }
400
-
401
- /* workarounds */
402
- * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
403
-
404
- /*
405
- * jQuery UI Menu 1.8.7
406
- *
407
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
408
- * Dual licensed under the MIT or GPL Version 2 licenses.
409
- * http://jquery.org/license
410
- *
411
- * http://docs.jquery.com/UI/Menu#theming
412
- */
413
- .ui-menu {
414
- list-style:none;
415
- padding: 2px;
416
- margin: 0;
417
- display:block;
418
- float: left;
419
- }
420
- .ui-menu .ui-menu {
421
- margin-top: -3px;
422
- }
423
- .ui-menu .ui-menu-item {
424
- margin:0;
425
- padding: 0;
426
- zoom: 1;
427
- float: left;
428
- clear: left;
429
- width: 100%;
430
- }
431
- .ui-menu .ui-menu-item a {
432
- text-decoration:none;
433
- display:block;
434
- padding:.2em .4em;
435
- line-height:1.5;
436
- zoom:1;
437
- }
438
- .ui-menu .ui-menu-item a.ui-state-hover,
439
- .ui-menu .ui-menu-item a.ui-state-active {
440
- font-weight: normal;
441
- margin: -1px;
442
- background: #5f83b9;
443
- color: #FFFFFF;
444
- text-shadow: 0px 1px 1px #234386;
445
- border-color: #466086;
446
- -moz-border-radius: 0;
447
- -webkit-border-radius: 0;
448
- border-radius: 0;
449
- }
450
- /*
451
- * jQuery UI Button 1.8.7
452
- *
453
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
454
- * Dual licensed under the MIT or GPL Version 2 licenses.
455
- * http://jquery.org/license
456
- *
457
- * http://docs.jquery.com/UI/Button#theming
458
- */
459
- .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; -webkit-user-select: none; -moz-user-select: none; user-select: none; } /* the overflow property removes extra width in IE */
460
- .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
461
- button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
462
- .ui-button-icons-only { width: 3.4em; }
463
- button.ui-button-icons-only { width: 3.7em; }
464
-
465
- /* button animation properties */
466
- .ui-button {
467
- -webkit-transition: -webkit-box-shadow 0.25s ease-in-out;
468
- -moz-transition: -moz-box-shadow 0.25s ease-in-out;
469
- -o-transition: -o-box-shadow 0.25s ease-in-out;
470
- }
471
-
472
- /*states*/
473
- .ui-button.ui-state-hover {
474
- -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
475
- -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
476
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
477
- }
478
-
479
- /*button text element */
480
- .ui-button .ui-button-text { display: block; line-height: 23px; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
481
- .ui-button.ui-state-active .ui-button-text { display: block; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); border: 1px solid #21759B #21759B #1E6A8D; }
482
- .ui-button-text-only .ui-button-text { padding: 0 1em; }
483
- .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
484
- .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 1em 0 2.1em; }
485
- .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 2.1em .0 1em; }
486
- .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
487
- /* no icon support for input elements, provide padding by default */
488
- input.ui-button { font-size: 12px; font-weight: normal; padding: 0 1em !important; height: 30px; line-height:30px; }
489
- /*remove submit button internal padding in Firefox*/
490
- input.ui-button::-moz-focus-inner {
491
- border: 0;
492
- padding: 0;
493
- }
494
- /* fix webkits handling of the box model */
495
- @media screen and (-webkit-min-device-pixel-ratio:0) {
496
- input.ui-button {
497
- height: 30px !important;
498
- vertical-align: bottom;
499
- }
500
- }
501
-
502
- /*button icon element(s) */
503
- .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; }
504
- .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
505
- .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
506
- .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
507
- .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
508
-
509
- /*button sets*/
510
- .ui-buttonset { margin-right: 7px; }
511
- .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
512
- .ui-buttonset .ui-button.ui-state-active { color: #ffffff; border-color: #21759B #21759B #1E6A8D; }
513
- .ui-buttonset .ui-button.ui-state-active {
514
- background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
515
- background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
516
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
517
- background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
518
- background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
519
- background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
520
- background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
521
- -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
522
- -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
523
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
524
- }
525
-
526
- /* workarounds */
527
- button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
528
- /*
529
- * jQuery UI Dialog 1.8.7
530
- *
531
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
532
- * Dual licensed under the MIT or GPL Version 2 licenses.
533
- * http://jquery.org/license
534
- *
535
- * http://docs.jquery.com/UI/Dialog#theming
536
- */
537
- .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
538
- .ui-dialog {
539
- -webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
540
- -moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
541
- box-shadow: 0 2px 12px rgba(0,0,0,0.6);
542
- outline:none;
543
- }
544
- .ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
545
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
546
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .8em; top: 60%; width: 16px; margin: -10px 0 0 0; padding: 0; height: 16px; overflow:hidden; border:none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
547
- .ui-dialog .ui-dialog-titlebar-close span { display: block; background: url(images/icon_sprite.png) 0 -16px no-repeat; top:0; left:0; margin:0; }
548
- .ui-dialog .ui-dialog-titlebar-close span.ui-button-text { display:none; }
549
- .ui-dialog .ui-dialog-titlebar-close:hover span { background-position: -16px -16px; }
550
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; border:none; background:none; }
551
- .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
552
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
553
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
554
- .ui-dialog .ui-dialog-buttonpane button {
555
- margin: .5em .4em .5em 0;
556
- cursor: pointer;
557
- outline: none;
558
- color: #ffffff;
559
- border-color: #21759b #21759b #1e6a8d;
560
- background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
561
- background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
562
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
563
- background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
564
- background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
565
- background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
566
- background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
567
- -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
568
- -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
569
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
570
- }
571
- .ui-dialog .ui-dialog-buttonpane .ui-button-text {
572
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
573
- }
574
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
575
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
576
- /*
577
- * jQuery UI Slider 1.8.16
578
- *
579
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
580
- * Dual licensed under the MIT or GPL Version 2 licenses.
581
- * http://jquery.org/license
582
- *
583
- * http://docs.jquery.com/UI/Slider#theming
584
- */
585
- .ui-slider { position: relative; text-align: left; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; display: inline-block; *display: inline !important; *zoom: 1; }
586
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 17px; height: 21px; cursor: default; background: url(images/slider_handles.png) 0 0 no-repeat; outline: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; border: none; }
587
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; }
588
- .ui-slider .ui-slider-handle.ui-state-active { background-position: -17px 0; }
589
-
590
- .ui-slider-horizontal { height: 7px; }
591
- .ui-slider-horizontal .ui-slider-handle { top: -5px; margin-left: -.6em; }
592
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
593
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
594
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
595
-
596
- .ui-slider-vertical { width: 7px; height: 100px; }
597
- .ui-slider-vertical .ui-slider-handle { left: -.4em; margin-left: 0; margin-bottom: -.6em; }
598
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
599
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
600
- .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
601
- * jQuery UI Tabs 1.8.7
602
- *
603
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
604
- * Dual licensed under the MIT or GPL Version 2 licenses.
605
- * http://jquery.org/license
606
- *
607
- * http://docs.jquery.com/UI/Tabs#theming
608
- */
609
- .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") */
610
- .ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
611
- .ui-tabs .ui-tabs-nav {
612
- -moz-border-radius: 0;
613
- -webkit-border-radius: 0;
614
- border-radius: 0;
615
- }
616
- .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;}
617
- .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; font-size: 12px; font-weight: normal; outline: none; }
618
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; background: #fff; border-color: #dfdfdf; }
619
- .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; color:#333; }
620
- .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... */
621
- .ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
622
- .ui-tabs .ui-tabs-panel { background: #FFF;
623
- -moz-border-radius: 0;
624
- -webkit-border-radius: 0;
625
- border-radius: 0;
626
- }
627
- .ui-tabs .ui-tabs-hide { display: none !important; }
628
- /*
629
- * jQuery UI Datepicker 1.8.7
630
- *
631
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
632
- * Dual licensed under the MIT or GPL Version 2 licenses.
633
- * http://jquery.org/license
634
- *
635
- * http://docs.jquery.com/UI/Datepicker#theming
636
- */
637
- .ui-datepicker { width: 17em; padding: 0; display: none; border-color: #DDDDDD; }
638
- .ui-datepicker {
639
- -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
640
- -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
641
- box-shadow: 0 4px 8px rgba(0,0,0,0.5);
642
- }
643
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
644
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 6px; width: 1.8em; height: 1.8em; }
645
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { border: 1px none; }
646
- .ui-datepicker .ui-datepicker-prev { left:2px; }
647
- .ui-datepicker .ui-datepicker-next { right:2px; }
648
- .ui-datepicker .ui-datepicker-prev span { background-position: 0px -32px !important; }
649
- .ui-datepicker .ui-datepicker-next span { background-position: -16px -32px !important; }
650
- .ui-datepicker .ui-datepicker-prev-hover span { background-position: 0px -48px !important; }
651
- .ui-datepicker .ui-datepicker-next-hover span { background-position: -16px -48px !important; }
652
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; background: url(images/icon_sprite.png) no-repeat; }
653
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
654
- .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
655
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
656
- .ui-datepicker select.ui-datepicker-month,
657
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
658
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; background:#fff; }
659
- .ui-datepicker.ui-widget-content { background:#fff; }
660
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: normal; border: 0; }
661
- .ui-datepicker td { border: 0; padding: 1px; }
662
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: center; text-decoration: none; }
663
- .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; }
664
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; width:auto; overflow:visible; height:25px; line-height:22px; padding: 0 10px 1px; }
665
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
666
- .ui-datepicker table .ui-state-highlight { }
667
- .ui-datepicker table .ui-state-hover {
668
- border: 1px solid #dfdfdf;
669
- background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
670
- background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
671
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
672
- background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
673
- background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
674
- background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
675
- background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
676
- -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
677
- -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
678
- box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
679
- }
680
- .ui-datepicker-calendar .ui-state-default { background:none; border-color:#fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
681
- .ui-datepicker-calendar .ui-state-active, .ui-datepicker-calendar .ui-state-active.ui-state-hover {
682
- outline: none;
683
- color: #ffffff;
684
- border-color: #21759b #21759b #1e6a8d;
685
- background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
686
- background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
687
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
688
- background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
689
- background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
690
- background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
691
- background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
692
- -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
693
- -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
694
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
695
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
696
- font-weight: normal;
697
- }
698
-
699
- /* with multiple calendars */
700
- .ui-datepicker.ui-datepicker-multi { width:auto; }
701
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
702
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
703
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
704
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
705
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
706
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
707
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
708
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
709
- .ui-datepicker-row-break { clear:both; width:100%; }
710
-
711
- /* RTL support */
712
- .ui-datepicker-rtl { direction: rtl; }
713
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
714
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
715
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
716
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
717
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
718
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
719
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
720
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
721
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
722
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
723
-
724
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
725
- .ui-datepicker-cover {
726
- display: none; /*sorry for IE5*/
727
- display/**/: block; /*sorry for IE5*/
728
- position: absolute; /*must have*/
729
- z-index: -1; /*must have*/
730
- filter: mask(); /*must have*/
731
- top: -4px; /*must have*/
732
- left: -4px; /*must have*/
733
- width: 200px; /*must have*/
734
- height: 200px; /*must have*/
735
- }
736
- /*
737
- * jQuery UI Progressbar 1.8.16
738
- *
739
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
740
- * Dual licensed under the MIT or GPL Version 2 licenses.
741
- * http://jquery.org/license
742
- *
743
- * http://docs.jquery.com/UI/Progressbar#theming
744
- */
745
- .ui-progressbar { height: 10px; text-align: left; border: 0 none; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
746
- }
747
- .ui-progressbar .ui-progressbar-value { margin: -1px; height:100%; border: 0 none; }
748
- .ui-progressbar .ui-progressbar-value { background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
749
- }
750
-
751
- /* Extra Input Field Styling */
752
- .ui-form textarea, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
753
- color:#333;
754
- padding: 3px;
755
- -webkit-border-radius: 2px;
756
- -moz-border-radius: 2px;
757
- border-radius: 2px;
758
- border: 1px solid #dfdfdf;
759
- outline: none;
760
- -webkit-transition: all 0.25s ease-in-out;
761
- -moz-transition: all 0.25 ease-in-out;
762
- -o-transition: all 0.25s ease-in-out;
763
- -moz-box-sizing: border-box;
764
- font-family:Arial, Helvetica, sans-serif;
765
- font-size:12px;
766
- }
767
- .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 {
768
- border: 1px solid #dfdfdf;
769
- }
770
- .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 {
771
- border: 1px solid #aaa;
772
- -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
773
- -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
774
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
775
- }
776
-
777
- /* Time picker Addon */
778
- .ui-timepicker-div .ui-widget-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
779
- .ui-timepicker-div dl { padding:0 7px; }
780
- .ui-timepicker-div dl { border-collapse: collapse; font-size: 0.9em; }
781
- .ui_tpicker_hour_slider, .ui_tpicker_minute_slider { width:100%;}
782
  .ui-timepicker-div .ui-slider .ui-slider-handle { background: url("images/slider_handles.png") no-repeat scroll 0 0 transparent; border:none; }
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.7
3
+ *
4
+ * Copyright 2010, 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/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
+ .ui-helper-clearfix { display: inline-block; }
18
+ /* required comment for clearfix to work in Opera \*/
19
+ * html .ui-helper-clearfix { height:1%; }
20
+ .ui-helper-clearfix { display:block; }
21
+ /* end clearfix */
22
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
23
+
24
+
25
+ /* Interaction Cues
26
+ ----------------------------------*/
27
+ .ui-state-disabled { cursor: default !important; }
28
+
29
+
30
+ /* Icons
31
+ ----------------------------------*/
32
+
33
+ /* states and images */
34
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
35
+
36
+
37
+ /* Misc visuals
38
+ ----------------------------------*/
39
+
40
+ /* Overlays */
41
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
42
+
43
+
44
+ /*
45
+ * jQuery UI CSS Framework 1.8.7
46
+ *
47
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
48
+ * Dual licensed under the MIT or GPL Version 2 licenses.
49
+ * http://jquery.org/license
50
+ *
51
+ * http://docs.jquery.com/UI/Theming/API
52
+ *
53
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
54
+ */
55
+
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 #dfdfdf; background: #ffffff; color: #333333; font-size:12px; }
63
+ .ui-widget-content a { color: #333333; }
64
+ .ui-widget-header { border: 1px solid #dfdfdf; color: #333333; font-weight: normal; }
65
+ .ui-widget-header {
66
+ background: #f3f3f3 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
67
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
68
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
69
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
70
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
71
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
72
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
73
+ }
74
+ .ui-widget-header a { color: #333333; }
75
+
76
+ /* Interaction states
77
+ ----------------------------------*/
78
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #dfdfdf; font-weight: normal; color: #333333; }
79
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
80
+ background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
81
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
82
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
83
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
84
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
85
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
86
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
87
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
88
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
89
+ box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
90
+ }
91
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #333333; 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 #bbbbbb; font-weight: normal; color: #313131; }
93
+ .ui-state-hover a, .ui-state-hover a:hover { color: #313131; text-decoration: none; }
94
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
95
+ outline: none;
96
+ color: #ffffff;
97
+ border-color: #21759b #21759b #1e6a8d;
98
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
99
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
100
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
101
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
102
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
103
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
104
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
105
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
106
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
107
+ box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
108
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
109
+ }
110
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #fff; text-decoration: none; }
111
+ .ui-widget :active { outline: none; }
112
+
113
+ /* Interaction Cues
114
+ ----------------------------------*/
115
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #e6db55; background: #ffffe0; color: #333; }
116
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #333; }
117
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cc0000; background: #ffebe8; color: #333; }
118
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
119
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
120
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: normal; }
121
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { font-weight: normal; }
122
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
123
+
124
+ /* Icons
125
+ ----------------------------------*/
126
+
127
+ /* states and images */
128
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
129
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
130
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
131
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); }
132
+ .ui-state-hover .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
133
+ .ui-state-focus .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
134
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
135
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
136
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background: url(images/icon_sprite.png) -16px 0 no-repeat !important; }
137
+ .ui-state-highlight .ui-icon, .ui-state-error .ui-icon { margin-top: -1px; }
138
+
139
+ /* positioning */
140
+ .ui-icon-carat-1-n { background-position: 0 0; }
141
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
142
+ .ui-icon-carat-1-e { background-position: -32px 0; }
143
+ .ui-icon-carat-1-se { background-position: -48px 0; }
144
+ .ui-icon-carat-1-s { background-position: -64px 0; }
145
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
146
+ .ui-icon-carat-1-w { background-position: -96px 0; }
147
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
148
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
149
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
150
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
151
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
152
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
153
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
154
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
155
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
156
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
157
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
158
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
159
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
160
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
161
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
162
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
163
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
164
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
165
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
166
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
167
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
168
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
169
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
170
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
171
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
172
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
173
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
174
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
175
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
176
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
177
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
178
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
179
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
180
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
181
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
182
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
183
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
184
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
185
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
186
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
187
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
188
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
189
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
190
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
191
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
192
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
193
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
194
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
195
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
196
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
197
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
198
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
199
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
200
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
201
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
202
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
203
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
204
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
205
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
206
+ .ui-icon-extlink { background-position: -32px -80px; }
207
+ .ui-icon-newwin { background-position: -48px -80px; }
208
+ .ui-icon-refresh { background-position: -64px -80px; }
209
+ .ui-icon-shuffle { background-position: -80px -80px; }
210
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
211
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
212
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
213
+ .ui-icon-folder-open { background-position: -16px -96px; }
214
+ .ui-icon-document { background-position: -32px -96px; }
215
+ .ui-icon-document-b { background-position: -48px -96px; }
216
+ .ui-icon-note { background-position: -64px -96px; }
217
+ .ui-icon-mail-closed { background-position: -80px -96px; }
218
+ .ui-icon-mail-open { background-position: -96px -96px; }
219
+ .ui-icon-suitcase { background-position: -112px -96px; }
220
+ .ui-icon-comment { background-position: -128px -96px; }
221
+ .ui-icon-person { background-position: -144px -96px; }
222
+ .ui-icon-print { background-position: -160px -96px; }
223
+ .ui-icon-trash { background-position: -176px -96px; }
224
+ .ui-icon-locked { background-position: -192px -96px; }
225
+ .ui-icon-unlocked { background-position: -208px -96px; }
226
+ .ui-icon-bookmark { background-position: -224px -96px; }
227
+ .ui-icon-tag { background-position: -240px -96px; }
228
+ .ui-icon-home { background-position: 0 -112px; }
229
+ .ui-icon-flag { background-position: -16px -112px; }
230
+ .ui-icon-calendar { background-position: -32px -112px; }
231
+ .ui-icon-cart { background-position: -48px -112px; }
232
+ .ui-icon-pencil { background-position: -64px -112px; }
233
+ .ui-icon-clock { background-position: -80px -112px; }
234
+ .ui-icon-disk { background-position: -96px -112px; }
235
+ .ui-icon-calculator { background-position: -112px -112px; }
236
+ .ui-icon-zoomin { background-position: -128px -112px; }
237
+ .ui-icon-zoomout { background-position: -144px -112px; }
238
+ .ui-icon-search { background-position: -160px -112px; }
239
+ .ui-icon-wrench { background-position: -176px -112px; }
240
+ .ui-icon-gear { background-position: -192px -112px; }
241
+ .ui-icon-heart { background-position: -208px -112px; }
242
+ .ui-icon-star { background-position: -224px -112px; }
243
+ .ui-icon-link { background-position: -240px -112px; }
244
+ .ui-icon-cancel { background-position: 0 -128px; }
245
+ .ui-icon-plus { background-position: -16px -128px; }
246
+ .ui-icon-plusthick { background-position: -32px -128px; }
247
+ .ui-icon-minus { background-position: -48px -128px; }
248
+ .ui-icon-minusthick { background-position: -64px -128px; }
249
+ .ui-icon-close { background-position: -80px -128px; }
250
+ .ui-icon-closethick { background-position: -96px -128px; }
251
+ .ui-icon-key { background-position: -112px -128px; }
252
+ .ui-icon-lightbulb { background-position: -128px -128px; }
253
+ .ui-icon-scissors { background-position: -144px -128px; }
254
+ .ui-icon-clipboard { background-position: -160px -128px; }
255
+ .ui-icon-copy { background-position: -176px -128px; }
256
+ .ui-icon-contact { background-position: -192px -128px; }
257
+ .ui-icon-image { background-position: -208px -128px; }
258
+ .ui-icon-video { background-position: -224px -128px; }
259
+ .ui-icon-script { background-position: -240px -128px; }
260
+ .ui-icon-alert { background-position: 0 -144px; }
261
+ .ui-icon-info { background: url(images/icon_sprite.png) 0 0 no-repeat !important; }
262
+ .ui-icon-notice { background-position: -32px -144px; }
263
+ .ui-icon-help { background-position: -48px -144px; }
264
+ .ui-icon-check { background-position: -64px -144px; }
265
+ .ui-icon-bullet { background-position: -80px -144px; }
266
+ .ui-icon-radio-off { background-position: -96px -144px; }
267
+ .ui-icon-radio-on { background-position: -112px -144px; }
268
+ .ui-icon-pin-w { background-position: -128px -144px; }
269
+ .ui-icon-pin-s { background-position: -144px -144px; }
270
+ .ui-icon-play { background-position: 0 -160px; }
271
+ .ui-icon-pause { background-position: -16px -160px; }
272
+ .ui-icon-seek-next { background-position: -32px -160px; }
273
+ .ui-icon-seek-prev { background-position: -48px -160px; }
274
+ .ui-icon-seek-end { background-position: -64px -160px; }
275
+ .ui-icon-seek-start { background-position: -80px -160px; }
276
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
277
+ .ui-icon-seek-first { background-position: -80px -160px; }
278
+ .ui-icon-stop { background-position: -96px -160px; }
279
+ .ui-icon-eject { background-position: -112px -160px; }
280
+ .ui-icon-volume-off { background-position: -128px -160px; }
281
+ .ui-icon-volume-on { background-position: -144px -160px; }
282
+ .ui-icon-power { background-position: 0 -176px; }
283
+ .ui-icon-signal-diag { background-position: -16px -176px; }
284
+ .ui-icon-signal { background-position: -32px -176px; }
285
+ .ui-icon-battery-0 { background-position: -48px -176px; }
286
+ .ui-icon-battery-1 { background-position: -64px -176px; }
287
+ .ui-icon-battery-2 { background-position: -80px -176px; }
288
+ .ui-icon-battery-3 { background-position: -96px -176px; }
289
+ .ui-icon-circle-plus { background-position: 0 -192px; }
290
+ .ui-icon-circle-minus { background-position: -16px -192px; }
291
+ .ui-icon-circle-close { background-position: -32px -192px; }
292
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
293
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
294
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
295
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
296
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
297
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
298
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
299
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
300
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
301
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
302
+ .ui-icon-circle-check { background-position: -208px -192px; }
303
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
304
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
305
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
306
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
307
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
308
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
309
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
310
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
311
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
312
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
313
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
314
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
315
+
316
+
317
+ /* Misc visuals
318
+ ----------------------------------*/
319
+
320
+ /* Corner radius */
321
+ .ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
322
+ .ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
323
+ .ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
324
+ .ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
325
+ .ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
326
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
327
+ .ui-corner-right { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
328
+ .ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
329
+ .ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
330
+
331
+ /* Overlays */
332
+ .ui-widget-overlay { background: #262b33; opacity: .70;filter:Alpha(Opacity=70); }
333
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
334
+ * jQuery UI Resizable 1.8.7
335
+ *
336
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
337
+ * Dual licensed under the MIT or GPL Version 2 licenses.
338
+ * http://jquery.org/license
339
+ *
340
+ * http://docs.jquery.com/UI/Resizable#theming
341
+ */
342
+ .ui-resizable { position: relative;}
343
+ .ui-resizable-handle { position: absolute; font-size: 0.1px; z-index: 999; display: block;}
344
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
345
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
346
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
347
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
348
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
349
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
350
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
351
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
352
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
353
+ * jQuery UI Selectable 1.8.7
354
+ *
355
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
356
+ * Dual licensed under the MIT or GPL Version 2 licenses.
357
+ * http://jquery.org/license
358
+ *
359
+ * http://docs.jquery.com/UI/Selectable#theming
360
+ */
361
+ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
362
+ /*
363
+ * jQuery UI Accordion 1.8.7
364
+ *
365
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
366
+ * Dual licensed under the MIT or GPL Version 2 licenses.
367
+ * http://jquery.org/license
368
+ *
369
+ * http://docs.jquery.com/UI/Accordion#theming
370
+ */
371
+ /* IE/Win - Fix animation bug - #4615 */
372
+ .ui-accordion { width: 100%; }
373
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 0.2em; zoom: 1; height:30px; line-height:30px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
374
+ .ui-accordion .ui-accordion-header.ui-state-active { -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; }
375
+ .ui-accordion .ui-accordion-content { -moz-border-radius: 0 0 3px 3px; -webkit-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; }
376
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
377
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
378
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 12px; font-weight: normal; padding: 0 .5em 0 1em; }
379
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
380
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; display:none; }
381
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; display: none; zoom: 1; }
382
+ .ui-accordion .ui-accordion-content-active { display: block; }/*
383
+ * jQuery UI Autocomplete 1.8.7
384
+ *
385
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
386
+ * Dual licensed under the MIT or GPL Version 2 licenses.
387
+ * http://jquery.org/license
388
+ *
389
+ * http://docs.jquery.com/UI/Autocomplete#theming
390
+ */
391
+ .ui-autocomplete {
392
+ position: absolute; cursor: default; z-index: 3;
393
+ -moz-border-radius: 0;
394
+ -webkit-border-radius: 0;
395
+ border-radius: 0;
396
+ -moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
397
+ -webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
398
+ box-shadow: 0 1px 5px rgba(0,0,0,0.3);
399
+ }
400
+
401
+ /* workarounds */
402
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
403
+
404
+ /*
405
+ * jQuery UI Menu 1.8.7
406
+ *
407
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
408
+ * Dual licensed under the MIT or GPL Version 2 licenses.
409
+ * http://jquery.org/license
410
+ *
411
+ * http://docs.jquery.com/UI/Menu#theming
412
+ */
413
+ .ui-menu {
414
+ list-style:none;
415
+ padding: 2px;
416
+ margin: 0;
417
+ display:block;
418
+ float: left;
419
+ }
420
+ .ui-menu .ui-menu {
421
+ margin-top: -3px;
422
+ }
423
+ .ui-menu .ui-menu-item {
424
+ margin:0;
425
+ padding: 0;
426
+ zoom: 1;
427
+ float: left;
428
+ clear: left;
429
+ width: 100%;
430
+ }
431
+ .ui-menu .ui-menu-item a {
432
+ text-decoration:none;
433
+ display:block;
434
+ padding:.2em .4em;
435
+ line-height:1.5;
436
+ zoom:1;
437
+ }
438
+ .ui-menu .ui-menu-item a.ui-state-hover,
439
+ .ui-menu .ui-menu-item a.ui-state-active {
440
+ font-weight: normal;
441
+ margin: -1px;
442
+ background: #5f83b9;
443
+ color: #FFFFFF;
444
+ text-shadow: 0px 1px 1px #234386;
445
+ border-color: #466086;
446
+ -moz-border-radius: 0;
447
+ -webkit-border-radius: 0;
448
+ border-radius: 0;
449
+ }
450
+ /*
451
+ * jQuery UI Button 1.8.7
452
+ *
453
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
454
+ * Dual licensed under the MIT or GPL Version 2 licenses.
455
+ * http://jquery.org/license
456
+ *
457
+ * http://docs.jquery.com/UI/Button#theming
458
+ */
459
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; -webkit-user-select: none; -moz-user-select: none; user-select: none; } /* the overflow property removes extra width in IE */
460
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
461
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
462
+ .ui-button-icons-only { width: 3.4em; }
463
+ button.ui-button-icons-only { width: 3.7em; }
464
+
465
+ /* button animation properties */
466
+ .ui-button {
467
+ -webkit-transition: -webkit-box-shadow 0.25s ease-in-out;
468
+ -moz-transition: -moz-box-shadow 0.25s ease-in-out;
469
+ -o-transition: -o-box-shadow 0.25s ease-in-out;
470
+ }
471
+
472
+ /*states*/
473
+ .ui-button.ui-state-hover {
474
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
475
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
476
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
477
+ }
478
+
479
+ /*button text element */
480
+ .ui-button .ui-button-text { display: block; line-height: 23px; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
481
+ .ui-button.ui-state-active .ui-button-text { display: block; font-size: 12px; font-weight: normal; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); border: 1px solid #21759B #21759B #1E6A8D; }
482
+ .ui-button-text-only .ui-button-text { padding: 0 1em; }
483
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
484
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 1em 0 2.1em; }
485
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0 2.1em .0 1em; }
486
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
487
+ /* no icon support for input elements, provide padding by default */
488
+ input.ui-button { font-size: 12px; font-weight: normal; padding: 0 1em !important; height: 30px; line-height:30px; }
489
+ /*remove submit button internal padding in Firefox*/
490
+ input.ui-button::-moz-focus-inner {
491
+ border: 0;
492
+ padding: 0;
493
+ }
494
+ /* fix webkits handling of the box model */
495
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
496
+ input.ui-button {
497
+ height: 30px !important;
498
+ vertical-align: bottom;
499
+ }
500
+ }
501
+
502
+ /*button icon element(s) */
503
+ .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; }
504
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
505
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
506
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
507
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
508
+
509
+ /*button sets*/
510
+ .ui-buttonset { margin-right: 7px; }
511
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
512
+ .ui-buttonset .ui-button.ui-state-active { color: #ffffff; border-color: #21759B #21759B #1E6A8D; }
513
+ .ui-buttonset .ui-button.ui-state-active {
514
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
515
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
516
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
517
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
518
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
519
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
520
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
521
+ -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
522
+ -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
523
+ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
524
+ }
525
+
526
+ /* workarounds */
527
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
528
+ /*
529
+ * jQuery UI Dialog 1.8.7
530
+ *
531
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
532
+ * Dual licensed under the MIT or GPL Version 2 licenses.
533
+ * http://jquery.org/license
534
+ *
535
+ * http://docs.jquery.com/UI/Dialog#theming
536
+ */
537
+ .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; }
538
+ .ui-dialog {
539
+ -webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
540
+ -moz-box-shadow: 0 2px 12px rgba(0,0,0,0.6);
541
+ box-shadow: 0 2px 12px rgba(0,0,0,0.6);
542
+ outline:none;
543
+ }
544
+ .ui-dialog .ui-dialog-titlebar { padding: 0.7em 1em 0.6em 1em; position: relative; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
545
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
546
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .8em; top: 60%; width: 16px; margin: -10px 0 0 0; padding: 0; height: 16px; overflow:hidden; border:none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
547
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; background: url(images/icon_sprite.png) 0 -16px no-repeat; top:0; left:0; margin:0; }
548
+ .ui-dialog .ui-dialog-titlebar-close span.ui-button-text { display:none; }
549
+ .ui-dialog .ui-dialog-titlebar-close:hover span { background-position: -16px -16px; }
550
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; border:none; background:none; }
551
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
552
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
553
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
554
+ .ui-dialog .ui-dialog-buttonpane button {
555
+ margin: .5em .4em .5em 0;
556
+ cursor: pointer;
557
+ outline: none;
558
+ color: #ffffff;
559
+ border-color: #21759b #21759b #1e6a8d;
560
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
561
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
562
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
563
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
564
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
565
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
566
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
567
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
568
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
569
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
570
+ }
571
+ .ui-dialog .ui-dialog-buttonpane .ui-button-text {
572
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
573
+ }
574
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
575
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
576
+ /*
577
+ * jQuery UI Slider 1.8.16
578
+ *
579
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
580
+ * Dual licensed under the MIT or GPL Version 2 licenses.
581
+ * http://jquery.org/license
582
+ *
583
+ * http://docs.jquery.com/UI/Slider#theming
584
+ */
585
+ .ui-slider { position: relative; text-align: left; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; display: inline-block; *display: inline !important; *zoom: 1; }
586
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 17px; height: 21px; cursor: default; background: url(images/slider_handles.png) 0 0 no-repeat; outline: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; border: none; }
587
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; }
588
+ .ui-slider .ui-slider-handle.ui-state-active { background-position: -17px 0; }
589
+
590
+ .ui-slider-horizontal { height: 7px; }
591
+ .ui-slider-horizontal .ui-slider-handle { top: -5px; margin-left: -.6em; }
592
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
593
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
594
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
595
+
596
+ .ui-slider-vertical { width: 7px; height: 100px; }
597
+ .ui-slider-vertical .ui-slider-handle { left: -.4em; margin-left: 0; margin-bottom: -.6em; }
598
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
599
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
600
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
601
+ * jQuery UI Tabs 1.8.7
602
+ *
603
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
604
+ * Dual licensed under the MIT or GPL Version 2 licenses.
605
+ * http://jquery.org/license
606
+ *
607
+ * http://docs.jquery.com/UI/Tabs#theming
608
+ */
609
+ .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") */
610
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: 0; background: transparent; border-width: 0 0 1px 0; }
611
+ .ui-tabs .ui-tabs-nav {
612
+ -moz-border-radius: 0;
613
+ -webkit-border-radius: 0;
614
+ border-radius: 0;
615
+ }
616
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;}
617
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; font-size: 12px; font-weight: normal; outline: none; }
618
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; background: #fff; border-color: #dfdfdf; }
619
+ .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; color:#333; }
620
+ .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... */
621
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0 1px 1px 1px; padding: 1em 1.4em; background: none; }
622
+ .ui-tabs .ui-tabs-panel { background: #FFF;
623
+ -moz-border-radius: 0;
624
+ -webkit-border-radius: 0;
625
+ border-radius: 0;
626
+ }
627
+ .ui-tabs .ui-tabs-hide { display: none !important; }
628
+ /*
629
+ * jQuery UI Datepicker 1.8.7
630
+ *
631
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
632
+ * Dual licensed under the MIT or GPL Version 2 licenses.
633
+ * http://jquery.org/license
634
+ *
635
+ * http://docs.jquery.com/UI/Datepicker#theming
636
+ */
637
+ .ui-datepicker { width: 17em; padding: 0; display: none; border-color: #DDDDDD; }
638
+ .ui-datepicker {
639
+ -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
640
+ -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
641
+ box-shadow: 0 4px 8px rgba(0,0,0,0.5);
642
+ }
643
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
644
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 6px; width: 1.8em; height: 1.8em; }
645
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { border: 1px none; }
646
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
647
+ .ui-datepicker .ui-datepicker-next { right:2px; }
648
+ .ui-datepicker .ui-datepicker-prev span { background-position: 0px -32px !important; }
649
+ .ui-datepicker .ui-datepicker-next span { background-position: -16px -32px !important; }
650
+ .ui-datepicker .ui-datepicker-prev-hover span { background-position: 0px -48px !important; }
651
+ .ui-datepicker .ui-datepicker-next-hover span { background-position: -16px -48px !important; }
652
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; background: url(images/icon_sprite.png) no-repeat; }
653
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
654
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
655
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
656
+ .ui-datepicker select.ui-datepicker-month,
657
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
658
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; background:#fff; }
659
+ .ui-datepicker.ui-widget-content { background:#fff; }
660
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: normal; border: 0; }
661
+ .ui-datepicker td { border: 0; padding: 1px; }
662
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: center; text-decoration: none; }
663
+ .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; }
664
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; width:auto; overflow:visible; height:25px; line-height:22px; padding: 0 10px 1px; }
665
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
666
+ .ui-datepicker table .ui-state-highlight { }
667
+ .ui-datepicker table .ui-state-hover {
668
+ border: 1px solid #dfdfdf;
669
+ background: #f9f9f9 url(images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
670
+ background: -moz-linear-gradient(top, #f9f9f9 0%, #ececec 100%); /* FF3.6+ */
671
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#ececec)); /* Chrome,Safari4+ */
672
+ background: -webkit-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Chrome10+,Safari5.1+ */
673
+ background: -o-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* Opera11.10+ */
674
+ background: -ms-linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* IE10+ */
675
+ background: linear-gradient(top, #f9f9f9 0%,#ececec 100%); /* W3C */
676
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
677
+ -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
678
+ box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
679
+ }
680
+ .ui-datepicker-calendar .ui-state-default { background:none; border-color:#fff; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
681
+ .ui-datepicker-calendar .ui-state-active, .ui-datepicker-calendar .ui-state-active.ui-state-hover {
682
+ outline: none;
683
+ color: #ffffff;
684
+ border-color: #21759b #21759b #1e6a8d;
685
+ background: #f9f9f9 url(images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
686
+ background: -moz-linear-gradient(top, #2e9fd2 0%, #21759B 100%); /* FF3.6+ */
687
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e9fd2), color-stop(100%,#21759B)); /* Chrome,Safari4+ */
688
+ background: -webkit-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Chrome10+,Safari5.1+ */
689
+ background: -o-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* Opera11.10+ */
690
+ background: -ms-linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* IE10+ */
691
+ background: linear-gradient(top, #2e9fd2 0%,#21759B 100%); /* W3C */
692
+ -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
693
+ -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
694
+ box-shadow: 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255,255,255,0.4) inset;
695
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
696
+ font-weight: normal;
697
+ }
698
+
699
+ /* with multiple calendars */
700
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
701
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
702
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
703
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
704
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
705
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
706
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
707
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
708
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
709
+ .ui-datepicker-row-break { clear:both; width:100%; }
710
+
711
+ /* RTL support */
712
+ .ui-datepicker-rtl { direction: rtl; }
713
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
714
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
715
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
716
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
717
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
718
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
719
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
720
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
721
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
722
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
723
+
724
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
725
+ .ui-datepicker-cover {
726
+ display: none; /*sorry for IE5*/
727
+ display/**/: block; /*sorry for IE5*/
728
+ position: absolute; /*must have*/
729
+ z-index: -1; /*must have*/
730
+ filter: mask(); /*must have*/
731
+ top: -4px; /*must have*/
732
+ left: -4px; /*must have*/
733
+ width: 200px; /*must have*/
734
+ height: 200px; /*must have*/
735
+ }
736
+ /*
737
+ * jQuery UI Progressbar 1.8.16
738
+ *
739
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
740
+ * Dual licensed under the MIT or GPL Version 2 licenses.
741
+ * http://jquery.org/license
742
+ *
743
+ * http://docs.jquery.com/UI/Progressbar#theming
744
+ */
745
+ .ui-progressbar { height: 10px; text-align: left; border: 0 none; background: #f1f1f1; border: none; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
746
+ }
747
+ .ui-progressbar .ui-progressbar-value { margin: -1px; height:100%; border: 0 none; }
748
+ .ui-progressbar .ui-progressbar-value { background: #2e9fd2; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset; box-shadow: 0 1px 3px rgba(0,0,0,0.4) inset;
749
+ }
750
+
751
+ /* Extra Input Field Styling */
752
+ .ui-form textarea, .ui-form input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
753
+ color:#333;
754
+ padding: 3px;
755
+ -webkit-border-radius: 2px;
756
+ -moz-border-radius: 2px;
757
+ border-radius: 2px;
758
+ border: 1px solid #dfdfdf;
759
+ outline: none;
760
+ -webkit-transition: all 0.25s ease-in-out;
761
+ -moz-transition: all 0.25 ease-in-out;
762
+ -o-transition: all 0.25s ease-in-out;
763
+ -moz-box-sizing: border-box;
764
+ font-family:Arial, Helvetica, sans-serif;
765
+ font-size:12px;
766
+ }
767
+ .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 {
768
+ border: 1px solid #dfdfdf;
769
+ }
770
+ .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 {
771
+ border: 1px solid #aaa;
772
+ -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
773
+ -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
774
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
775
+ }
776
+
777
+ /* Time picker Addon */
778
+ .ui-timepicker-div .ui-widget-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #dfdfdf; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
779
+ .ui-timepicker-div dl { padding:0 7px; }
780
+ .ui-timepicker-div dl { border-collapse: collapse; font-size: 0.9em; }
781
+ .ui_tpicker_hour_slider, .ui_tpicker_minute_slider { width:100%;}
782
  .ui-timepicker-div .ui-slider .ui-slider-handle { background: url("images/slider_handles.png") no-repeat scroll 0 0 transparent; border:none; }
image-watermark.php CHANGED
@@ -1,1281 +1,879 @@
1
- <?php
2
- /*
3
- Plugin Name: Image Watermark
4
- Description: Image Watermark allows you to automatically watermark images uploaded to the WordPress Media Library and bulk watermark previously uploaded images.
5
- Version: 1.5.2
6
- Author: dFactory
7
- Author URI: http://www.dfactory.eu/
8
- Plugin URI: http://www.dfactory.eu/plugins/image-watermark/
9
- License: MIT License
10
- License URI: http://opensource.org/licenses/MIT
11
- Text Domain: image-watermark
12
- Domain Path: /languages
13
-
14
- Image Watermark
15
- Copyright (C) 2013-2015, Digital Factory - info@digitalfactory.pl
16
-
17
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
-
19
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- */
23
-
24
- // exit if accessed directly
25
- if ( ! defined( 'ABSPATH' ) )
26
- exit;
27
-
28
- /**
29
- * Image Watermark class.
30
- *
31
- * @class Image_Watermark
32
- * @version 1.5.2
33
- */
34
- class Image_Watermark {
35
-
36
- private $is_admin = true;
37
- private $image_sizes = array();
38
- private $watermark_positions = array(
39
- 'x' => array( 'left', 'center', 'right' ),
40
- 'y' => array( 'top', 'middle', 'bottom' ),
41
- );
42
- private $allowed_mime_types = array(
43
- 'image/jpeg',
44
- 'image/pjpeg',
45
- 'image/png'
46
- );
47
- protected $defaults = array(
48
- 'options' => array(
49
- 'watermark_on' => array(),
50
- 'watermark_cpt_on' => array( 'everywhere' ),
51
- 'watermark_image' => array(
52
- 'url' => 0,
53
- 'width' => 80,
54
- 'plugin_off' => 0,
55
- 'frontend_active' => false,
56
- 'manual_watermarking' => 0,
57
- 'position' => 'bottom_right',
58
- 'watermark_size_type' => 2,
59
- 'offset_width' => 0,
60
- 'offset_height' => 0,
61
- 'absolute_width' => 0,
62
- 'absolute_height' => 0,
63
- 'transparent' => 50,
64
- 'quality' => 90,
65
- 'jpeg_format' => 'baseline',
66
- 'deactivation_delete' => false,
67
- 'media_library_notice' => true
68
- ),
69
- 'image_protection' => array(
70
- 'rightclick' => 0,
71
- 'draganddrop' => 0,
72
- 'forlogged' => 0,
73
- ),
74
- ),
75
- 'version' => '1.5.2'
76
- );
77
- public $options = array();
78
-
79
- public function __construct() {
80
- // installer
81
- register_activation_hook( __FILE__, array( &$this, 'activate_watermark' ) );
82
- register_deactivation_hook( __FILE__, array( &$this, 'deactivate_watermark' ) );
83
-
84
- // settings
85
- $this->options = array_merge( $this->defaults['options'], (array) get_option( 'image_watermark_options' ) );
86
-
87
- // actions
88
- add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) );
89
- add_action( 'wp_loaded', array( &$this, 'load_image_sizes' ) );
90
- add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
91
- add_action( 'admin_print_scripts', array( &$this, 'admin_print_scripts' ), 20 );
92
- add_action( 'wp_enqueue_scripts', array( &$this, 'wp_enqueue_scripts' ) );
93
- add_action( 'admin_menu', array( &$this, 'options_page' ) );
94
- add_action( 'load-upload.php', array( &$this, 'apply_watermark_bulk_action' ) );
95
- add_action( 'admin_init', array( &$this, 'update_watermark' ) );
96
- add_action( 'admin_init', array( &$this, 'register_settings' ) );
97
- add_action( 'admin_notices', array( &$this, 'bulk_admin_notices' ) );
98
-
99
- // filters
100
- add_filter( 'plugin_row_meta', array( &$this, 'plugin_extend_links' ), 10, 2 );
101
- add_filter( 'plugin_action_links', array( &$this, 'plugin_settings_link' ), 10, 2 );
102
- add_filter( 'wp_handle_upload', array( &$this, 'handle_upload_files' ) );
103
- }
104
-
105
- /**
106
- * Plugin activation.
107
- */
108
- public function activate_watermark() {
109
- add_option( 'image_watermark_options', $this->defaults['options'], '', 'no' );
110
- add_option( 'image_watermark_version', $this->defaults['version'], '', 'no' );
111
- }
112
-
113
- /**
114
- * Plugin deactivation.
115
- */
116
- public function deactivate_watermark() {
117
- // remove options from database?
118
- if ( $this->options['image_watermark_image']['deactivation_delete'] === true ) {
119
- delete_option( 'image_watermark_options' );
120
- delete_option( 'image_watermark_version' );
121
- }
122
- }
123
-
124
- /**
125
- * Plugin update, fix for version < 1.5.0
126
- */
127
- public function update_watermark() {
128
- if ( ! current_user_can( 'install_plugins' ) )
129
- return;
130
-
131
- $db_version = get_option( 'image_watermark_version' );
132
- $db_version = ! ( $db_version ) && ( get_option( 'df_watermark_installed' ) != false ) ? get_option( 'version' ) : $db_version;
133
-
134
- if ( $db_version != false ) {
135
- if ( version_compare( $db_version, '1.5.0', '<' ) ) {
136
- $options = array();
137
-
138
- $old_new = array(
139
- 'df_watermark_on' => 'watermark_on',
140
- 'df_watermark_cpt_on' => 'watermark_cpt_on',
141
- 'df_watermark_image' => 'watermark_image',
142
- 'df_image_protection' => 'image_protection',
143
- 'df_watermark_installed' => '',
144
- 'version' => '',
145
- 'image_watermark_version' => '',
146
- );
147
-
148
- foreach ( $old_new as $old => $new ) {
149
- if ( $new ) {
150
- $options[$new] = get_option( $old );
151
- }
152
- delete_option( $old );
153
- }
154
-
155
- add_option( 'image_watermark_options', $options, '', 'no' );
156
- add_option( 'image_watermark_version', $this->defaults['version'], '', 'no' );
157
- }
158
- }
159
- }
160
-
161
- /**
162
- * Load textdomain.
163
- */
164
- public function load_textdomain() {
165
- load_plugin_textdomain( 'image-watermark', false, basename( dirname( __FILE__ ) ) . '/languages' );
166
- }
167
-
168
- /**
169
- * Load available image sizes.
170
- */
171
- public function load_image_sizes() {
172
- $this->image_sizes = get_intermediate_image_sizes();
173
- $this->image_sizes[] = 'full';
174
-
175
- sort( $this->image_sizes, SORT_STRING );
176
- }
177
-
178
- /**
179
- * Get post types.
180
- */
181
- private function get_post_types() {
182
- return array_merge( array( 'post', 'page' ), get_post_types( array( '_builtin' => false ), 'names' ) );
183
- }
184
-
185
- /**
186
- * Admin inline scripts.
187
- */
188
- public function admin_print_scripts() {
189
- global $pagenow;
190
-
191
- if ( $pagenow === 'upload.php' ) {
192
- if ( $this->options['watermark_image']['manual_watermarking'] == 1 ) {
193
- ?>
194
- <script type="text/javascript">
195
- jQuery( function( $ ) {
196
- $( document ).ready( function() {
197
- $( "<option>" ).val( "applywatermark" ).text( "<?php _e( 'Apply watermark', 'image-watermark' ); ?>" ).appendTo( "select[name='action']" );
198
- $( "<option>" ).val( "applywatermark" ).text( "<?php _e( 'Apply watermark', 'image-watermark' ); ?>" ).appendTo( "select[name='action2']" );
199
- });
200
- });
201
- </script>
202
- <?php
203
- }
204
- }
205
- }
206
-
207
- /**
208
- * Enqueue admin scripts and styles.
209
- */
210
- public function admin_enqueue_scripts( $page ) {
211
- if ( $page === 'settings_page_watermark-options' ) {
212
- wp_enqueue_media();
213
-
214
- wp_register_script(
215
- 'upload-manager', plugins_url( '/js/admin-upload.js', __FILE__ ), array(), $this->defaults['version']
216
- );
217
-
218
- wp_enqueue_script( 'upload-manager' );
219
-
220
- wp_localize_script(
221
- 'upload-manager', 'upload_manager_args', array(
222
- 'title' => __( 'Select watermark', 'image-watermark' ),
223
- 'originalSize' => __( 'Original size', 'image-watermark' ),
224
- 'noSelectedImg' => __( 'Watermak has not been selected yet.', 'image-watermark' ),
225
- 'notAllowedImg' => __( 'This image is not supported as watermark. Use JPEG, PNG or GIF.', 'image-watermark' ),
226
- 'frame' => 'select',
227
- 'button' => array( 'text' => __( 'Add watermark', 'image-watermark' ) ),
228
- 'multiple' => false,
229
- )
230
- );
231
-
232
- wp_register_script(
233
- 'watermark-admin-script', plugins_url( 'js/admin-settings.js', __FILE__ ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-button', 'jquery-ui-slider' ), $this->defaults['version']
234
- );
235
-
236
- wp_enqueue_script( 'watermark-admin-script' );
237
-
238
- wp_localize_script(
239
- 'watermark-admin-script', 'iwArgs', array(
240
- 'resetToDefaults' => __( 'Are you sure you want to reset settings to defaults?', 'image-watermark' )
241
- )
242
- );
243
-
244
- wp_register_style(
245
- 'watermark-style', plugins_url( 'css/image-watermark.css', __FILE__ ), array(), $this->defaults['version']
246
- );
247
-
248
- wp_enqueue_style( 'watermark-style' );
249
-
250
- wp_register_style(
251
- 'wp-like-ui-theme', plugins_url( 'css/wp-like-ui-theme.css', __FILE__ ), array(), $this->defaults['version']
252
- );
253
-
254
- wp_enqueue_style( 'wp-like-ui-theme' );
255
- }
256
- }
257
-
258
- /**
259
- * Enqueue frontend script with 'no right click' and 'drag and drop' functions.
260
- */
261
- public function wp_enqueue_scripts() {
262
- if ( ($this->options['image_protection']['forlogged'] == 0 && is_user_logged_in()) || ($this->options['image_protection']['draganddrop'] == 0 && $this->options['image_protection']['rightclick'] == 0) )
263
- return;
264
-
265
- wp_enqueue_script(
266
- 'no-right-click', plugins_url( 'js/no-right-click.js', __FILE__ ), array(), $this->defaults['version']
267
- );
268
-
269
- wp_localize_script(
270
- 'no-right-click', 'norightclick_args', array(
271
- 'rightclick' => ($this->options['image_protection']['rightclick'] == 1 ? 'Y' : 'N'),
272
- 'draganddrop' => ($this->options['image_protection']['draganddrop'] == 1 ? 'Y' : 'N')
273
- )
274
- );
275
- }
276
-
277
- /**
278
- * Apply watermark everywhere or for specific post types.
279
- *
280
- * @param resource $file
281
- * @return resource
282
- */
283
- public function handle_upload_files( $file ) {
284
-
285
- // admin
286
- if ( is_admin() && ! ( defined( 'DOING_AJAX' && DOING_AJAX ) ) ) {
287
-
288
- $this->is_admin = true;
289
-
290
- // apply watermark if backend is active and watermark image is set
291
- if ( $this->options['watermark_image']['plugin_off'] == 1 && $this->options['watermark_image']['url'] != 0 && in_array( $file['type'], $this->allowed_mime_types ) ) {
292
- add_filter( 'wp_generate_attachment_metadata', array( &$this, 'apply_watermark' ), 10, 2 );
293
- }
294
- } else {
295
-
296
- // frontend
297
- $this->is_admin = false;
298
-
299
- // apply watermark if frontend is active and watermark image is set
300
- if ( $this->options['watermark_image']['frontend_active'] == 1 && $this->options['watermark_image']['url'] != 0 && in_array( $file['type'], $this->allowed_mime_types ) ) {
301
- add_filter( 'wp_generate_attachment_metadata', array( &$this, 'apply_watermark' ), 10, 2 );
302
- }
303
- }
304
-
305
- return $file;
306
- }
307
-
308
- /**
309
- * Apply watermark for selected images on media page.
310
- */
311
- public function apply_watermark_bulk_action() {
312
- global $pagenow;
313
-
314
- if ( $pagenow == 'upload.php' ) {
315
-
316
- $wp_list_table = _get_list_table( 'WP_Media_List_Table' );
317
-
318
- // only if manual watermarking is turned on and image watermark is set
319
- if ( $wp_list_table->current_action() === 'applywatermark' && $this->options['watermark_image']['manual_watermarking'] == 1 && $this->options['watermark_image']['url'] != 0 ) {
320
- // security check
321
- check_admin_referer( 'bulk-media' );
322
-
323
- $location = esc_url( remove_query_arg( array( 'watermarked', 'skipped', 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), wp_get_referer() ) );
324
-
325
- if ( ! $location ) {
326
- $location = 'upload.php';
327
- }
328
-
329
- $location = esc_url( add_query_arg( 'paged', $wp_list_table->get_pagenum(), $location ) );
330
-
331
- // make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'
332
- if ( isset( $_REQUEST['media'] ) ) {
333
- $post_ids = array_map( 'intval', $_REQUEST['media'] );
334
- }
335
-
336
- // do we have selected attachments?
337
- if ( $post_ids ) {
338
- $watermarked = $skipped = 0;
339
-
340
- foreach ( $post_ids as $post_id ) {
341
- $data = wp_get_attachment_metadata( $post_id, false );
342
-
343
- // is this really an image?
344
- if ( in_array( get_post_mime_type( $post_id ), $this->allowed_mime_types ) && is_array( $data ) ) {
345
- $this->apply_watermark( $data, 'manual' );
346
- $watermarked ++;
347
- } else
348
- $skipped ++;
349
- }
350
-
351
- $location = esc_url( add_query_arg( array( 'watermarked' => $watermarked, 'skipped' => $skipped ), $location ), null, '' );
352
- }
353
-
354
- wp_redirect( $location );
355
- exit();
356
- } else
357
- return;
358
- }
359
- }
360
-
361
- /**
362
- * Display admin notices.
363
- */
364
- public function bulk_admin_notices() {
365
- global $post_type, $pagenow;
366
-
367
- if ( $pagenow === 'upload.php' ) {
368
-
369
- if ( ! current_user_can( 'upload_files' ) )
370
- return;
371
-
372
- // hide media library notice
373
- if ( isset( $_GET['iw_action'] ) && $_GET['iw_action'] == 'hide_library_notice' ) {
374
- $this->options['watermark_image']['media_library_notice'] = false;
375
- update_option( 'image_watermark_options', $this->options );
376
- }
377
-
378
- // check if manual watermarking is enabled
379
- if ( ! empty( $this->options['watermark_image']['manual_watermarking'] ) && ( ! isset( $this->options['watermark_image']['media_library_notice']) || $this->options['watermark_image']['media_library_notice'] === true ) ) {
380
- $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
381
-
382
- if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], array( 'grid', 'list' ) ) ) {
383
- $mode = $_GET['mode'];
384
- }
385
-
386
- // display notice in grid mode only
387
- if ( $mode === 'grid' ) {
388
- // get current admin url
389
- $query_string = array();
390
- parse_str( $_SERVER['QUERY_STRING'], $query_string );
391
- $current_url = esc_url( add_query_arg( array_merge( (array) $query_string, array( 'iw_action' => 'hide_library_notice' ) ), '', admin_url( trailingslashit( $pagenow ) ) ) );
392
-
393
- echo '<div class="error notice"><p>' . sprintf( __( '<strong>Image Watermark:</strong> Bulk watermarking is available in list mode only, under <em>Bulk Actions</em> dropdown. <a href="%1$s">Got to List Mode</a> or <a href="%2$s">Hide this notice</a>', 'image-watermark' ), esc_url( admin_url( 'upload.php?mode=list' ) ), esc_url( $current_url ) ) . '</p></div>';
394
- }
395
- }
396
-
397
- if ( isset( $_REQUEST['watermarked'], $_REQUEST['skipped'] ) && $post_type === 'attachment' ) {
398
- $watermarked = (int) $_REQUEST['watermarked'];
399
- $skipped = (int) $_REQUEST['skipped'];
400
-
401
- if ( $watermarked === 0 ) {
402
- echo '<div class="error"><p>' . __( 'Watermark could not be applied to selected files or no valid images (JPEG, PNG) were selected.', 'image-watermark' ) . ($skipped > 0 ? ' ' . __( 'Images skipped', 'image-watermark' ) . ': ' . $skipped . '.' : '') . '</p></div>';
403
- } else {
404
- echo '<div class="updated"><p>' . sprintf( _n( 'Watermark was succesfully applied to 1 image.', 'Watermark was succesfully applied to %s images.', $watermarked, 'image-watermark' ), number_format_i18n( $watermarked ) ) . ($skipped > 0 ? ' ' . __( 'Skipped files', 'image-watermark' ) . ': ' . $skipped . '.' : '') . '</p></div>';
405
- }
406
-
407
- $_SERVER['REQUEST_URI'] = esc_url( remove_query_arg( array( 'watermarked', 'skipped' ), $_SERVER['REQUEST_URI'] ) );
408
- }
409
- }
410
- }
411
-
412
- /**
413
- * Create options page in menu.
414
- */
415
- public function options_page() {
416
- add_options_page(
417
- __( 'Image Watermark Options', 'image-watermark' ), __( 'Watermark', 'image-watermark' ), 'manage_options', 'watermark-options', array( &$this, 'options_page_output' )
418
- );
419
- }
420
-
421
- /**
422
- * Options page output.
423
- */
424
- public function options_page_output() {
425
-
426
- if ( ! current_user_can( 'manage_options' ) )
427
- return;
428
-
429
- echo '
430
- <div class="wrap">
431
- <h2>' . __( 'Image Watermark', 'image-watermark' ) . '</h2>';
432
-
433
- echo '
434
- <div class="image-watermark-settings">
435
- <div class="df-sidebar">
436
- <div class="df-credits">
437
- <h3 class="hndle">' . __( 'Image Watermark', 'image-watermark' ) . ' ' . $this->defaults['version'] . '</h3>
438
- <div class="inside">
439
- <h4 class="inner">' . __( 'Need support?', 'image-watermark' ) . '</h4>
440
- <p class="inner">' . __( 'If you are having problems with this plugin, checkout plugin', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/docs/image-watermark-plugin/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=documentation" target="_blank" title="' . __( 'Documentation', 'image-watermark' ) . '">' . __( 'Documentation', 'image-watermark' ) . '</a> ' . __( 'or talk about them in the', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/support/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=support" target="_blank" title="' . __( 'Support forum', 'image-watermark' ) . '">' . __( 'Support forum', 'image-watermark' ) . '</a></p>
441
- <hr />
442
- <h4 class="inner">' . __( 'Do you like this plugin?', 'image-watermark' ) . '</h4>
443
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" class="inner">
444
- <input type="hidden" name="cmd" value="_s-xclick">
445
- <input type="hidden" name="hosted_button_id" value="DCF3AXC9A5A88">
446
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
447
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
448
- </form>
449
- <p class="inner"><a href="http://wordpress.org/support/view/plugin-reviews/image-watermark" target="_blank" title="' . __( 'Rate it 5', 'image-watermark' ) . '">' . __( 'Rate it 5', 'image-watermark' ) . '</a> ' . __( 'on WordPress.org', 'image-watermark' ) . '<br />' .
450
- __( 'Blog about it & link to the', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/plugins/image-watermark/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=blog-about" target="_blank" title="' . __( 'plugin page', 'image-watermark' ) . '">' . __( 'plugin page', 'image-watermark' ) . '</a><br />' .
451
- __( 'Check out our other', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/plugins/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=other-plugins" target="_blank" title="' . __( 'WordPress plugins', 'image-watermark' ) . '">' . __( 'WordPress plugins', 'image-watermark' ) . '</a>
452
- </p>
453
- <hr />
454
- <p class="df-link inner">' . __( 'Created by', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=created-by" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="' . plugins_url( '/images/logo-dfactory.png', __FILE__ ) . '/images/logo-dfactory.png' . '" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress" /></a></p>
455
- </div>
456
- </div>
457
- <form action="options.php" method="post">';
458
-
459
- settings_fields( 'image_watermark_options' );
460
- do_settings_sections( 'image_watermark_options' );
461
-
462
- echo '
463
- <p class="submit">';
464
- submit_button( '', 'primary', 'save_image_watermark_options', false );
465
- echo ' ';
466
- submit_button( __( 'Reset to defaults', 'image-watermark' ), 'secondary', 'reset_image_watermark_options', false );
467
-
468
- echo ' </p>
469
- </form>
470
- </div>
471
- <div class="clear"></div>
472
- </div>';
473
- }
474
-
475
- /**
476
- * Register settings.
477
- */
478
- public function register_settings() {
479
- register_setting( 'image_watermark_options', 'image_watermark_options', array( $this, 'validate_options' ) );
480
-
481
- add_settings_section( 'image_watermark_general', __( 'General settings', 'image-watermark' ), '', 'image_watermark_options' );
482
- add_settings_field( 'iw_automatic_watermarking', __( 'Automatic watermarking', 'image-watermark' ), array( $this, 'iw_automatic_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
483
- add_settings_field( 'iw_manual_watermarking', __( 'Manual watermarking', 'image-watermark' ), array( $this, 'iw_manual_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
484
- add_settings_field( 'iw_enable_for', __( 'Enable watermark for', 'image-watermark' ), array( $this, 'iw_enable_for' ), 'image_watermark_options', 'image_watermark_general' );
485
- add_settings_field( 'iw_frontend_watermarking', __( 'Frontend watermarking', 'image-watermark' ), array( $this, 'iw_frontend_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
486
- add_settings_field( 'iw_deactivation', __( 'Deactivation', 'image-watermark' ), array( $this, 'iw_deactivation' ), 'image_watermark_options', 'image_watermark_general' );
487
-
488
- add_settings_section( 'image_watermark_position', __( 'Watermark position', 'image-watermark' ), '', 'image_watermark_options' );
489
- add_settings_field( 'iw_alignment', __( 'Watermark alignment', 'image-watermark' ), array( $this, 'iw_alignment' ), 'image_watermark_options', 'image_watermark_position' );
490
- add_settings_field( 'iw_offset', __( 'Watermark offset', 'image-watermark' ), array( $this, 'iw_offset' ), 'image_watermark_options', 'image_watermark_position' );
491
-
492
- add_settings_section( 'image_watermark_image', __( 'Watermark image', 'image-watermark' ), '', 'image_watermark_options' );
493
- add_settings_field( 'iw_watermark_image', __( 'Watermark image', 'image-watermark' ), array( $this, 'iw_watermark_image' ), 'image_watermark_options', 'image_watermark_image' );
494
- add_settings_field( 'iw_watermark_preview', __( 'Watermark preview', 'image-watermark' ), array( $this, 'iw_watermark_preview' ), 'image_watermark_options', 'image_watermark_image' );
495
- add_settings_field( 'iw_watermark_size', __( 'Watermark size', 'image-watermark' ), array( $this, 'iw_watermark_size' ), 'image_watermark_options', 'image_watermark_image' );
496
- add_settings_field( 'iw_watermark_size_custom', __( 'Watermark custom size', 'image-watermark' ), array( $this, 'iw_watermark_size_custom' ), 'image_watermark_options', 'image_watermark_image' );
497
- add_settings_field( 'iw_watermark_size_scaled', __( 'Scale of watermark in relation to image width', 'image-watermark' ), array( $this, 'iw_watermark_size_scaled' ), 'image_watermark_options', 'image_watermark_image' );
498
- add_settings_field( 'iw_watermark_opacity', __( 'Watermark transparency / opacity', 'image-watermark' ), array( $this, 'iw_watermark_opacity' ), 'image_watermark_options', 'image_watermark_image' );
499
- add_settings_field( 'iw_image_quality', __( 'Image quality', 'image-watermark' ), array( $this, 'iw_image_quality' ), 'image_watermark_options', 'image_watermark_image' );
500
- add_settings_field( 'iw_image_format', __( 'Image format', 'image-watermark' ), array( $this, 'iw_image_format' ), 'image_watermark_options', 'image_watermark_image' );
501
-
502
- add_settings_section( 'image_watermark_protection', __( 'Image protection', 'image-watermark' ), '', 'image_watermark_options' );
503
- add_settings_field( 'iw_protection_right_click', __( 'Right click', 'image-watermark' ), array( $this, 'iw_protection_right_click' ), 'image_watermark_options', 'image_watermark_protection' );
504
- add_settings_field( 'iw_protection_drag_drop', __( 'Drag and drop', 'image-watermark' ), array( $this, 'iw_protection_drag_drop' ), 'image_watermark_options', 'image_watermark_protection' );
505
- add_settings_field( 'iw_protection_logged', __( 'Logged-in users', 'image-watermark' ), array( $this, 'iw_protection_logged' ), 'image_watermark_options', 'image_watermark_protection' );
506
- }
507
-
508
- /**
509
- * Automatic watermarking option.
510
- */
511
- public function iw_automatic_watermarking() {
512
- ?>
513
- <label for="iw_automatic_watermarking">
514
- <input id="iw_automatic_watermarking" type="checkbox" <?php checked( ( ! empty( $this->options['watermark_image']['plugin_off'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][plugin_off]">
515
- <?php echo __( 'Enable watermark for uploaded images.', 'image-watermark' ); ?>
516
- </label>
517
- <?php
518
- }
519
-
520
- /**
521
- * Manual watermarking option.
522
- */
523
- public function iw_manual_watermarking() {
524
- ?>
525
- <label for="iw_manual_watermarking">
526
- <input id="iw_manual_watermarking" type="checkbox" <?php checked( ( ! empty( $this->options['watermark_image']['manual_watermarking'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][manual_watermarking]">
527
- <?php echo __( 'Enable Apply Watermark option for images in Media Library.', 'image-watermark' ); ?>
528
- </label>
529
- <?php
530
- }
531
-
532
- /**
533
- * Enable watermark for option.
534
- */
535
- public function iw_enable_for() {
536
- ?>
537
- <fieldset id="iw_enable_for">
538
- <div id="thumbnail-select">
539
- <?php
540
- foreach ( $this->image_sizes as $image_size ) {
541
- ?>
542
- <input name="iw_options[watermark_on][<?php echo $image_size; ?>]" type="checkbox" id="<?php echo $image_size; ?>" value="1" <?php echo (in_array( $image_size, array_keys( $this->options['watermark_on'] ) ) ? ' checked="checked"' : ''); ?> />
543
- <label for="<?php echo $image_size; ?>"><?php echo $image_size; ?></label>
544
- <?php
545
- }
546
- ?>
547
- </div>
548
- <p class="description">
549
- <?php echo __( 'Check image sizes on which watermark should appear.<br /><strong>IMPORTANT:</strong> checking full size is NOT recommended as it\'s the original image. You may need it later - for removing or changing watermark, image sizes regeneration or any other image manipulations. Use it only if you know what you are doing.', 'image-watermark' ); ?>
550
- </p>
551
-
552
- <?php
553
- $watermark_cpt_on = array_keys( $this->options['watermark_cpt_on'] );
554
-
555
- if ( in_array( 'everywhere', $watermark_cpt_on ) && count( $watermark_cpt_on ) === 1 ) {
556
- $first_checked = true;
557
- $second_checked = false;
558
- $watermark_cpt_on = array();
559
- } else {
560
- $first_checked = false;
561
- $second_checked = true;
562
- }
563
- ?>
564
-
565
- <div id="cpt-specific">
566
- <input id="df_option_everywhere" type="radio" name="iw_options[watermark_cpt_on]" value="everywhere" <?php echo ($first_checked === true ? 'checked="checked"' : ''); ?>/><label for="df_option_everywhere"><?php _e( 'everywhere', 'image-watermark' ); ?></label>
567
- <input id="df_option_cpt" type="radio" name="iw_options[watermark_cpt_on]" value="specific" <?php echo ($second_checked === true ? 'checked="checked"' : ''); ?> /><label for="df_option_cpt"><?php _e( 'on selected post types only', 'image-watermark' ); ?></label>
568
- </div>
569
-
570
- <div id="cpt-select" <?php echo ($second_checked === false ? 'style="display: none;"' : ''); ?>>
571
- <?php
572
- foreach ( $this->get_post_types() as $cpt ) {
573
- ?>
574
- <input name="iw_options[watermark_cpt_on_type][<?php echo $cpt; ?>]" type="checkbox" id="<?php echo $cpt; ?>" value="1" <?php echo (in_array( $cpt, $watermark_cpt_on ) ? ' checked="checked"' : ''); ?> />
575
- <label for="<?php echo $cpt; ?>"><?php echo $cpt; ?></label>
576
- <?php
577
- }
578
- ?>
579
- </div>
580
-
581
- <p class="description"><?php echo __( 'Check custom post types on which watermark should be applied to uploaded images.', 'image-watermark' ); ?></p>
582
- </fieldset>
583
- <?php
584
- }
585
-
586
- /**
587
- * Frontend watermarking option.
588
- */
589
- public function iw_frontend_watermarking() {
590
- ?>
591
- <label for="iw_frontend_watermarking">
592
- <input id="iw_frontend_watermarking" type="checkbox" <?php checked( ( ! empty( $this->options['watermark_image']['frontend_active'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][frontend_active]">
593
- <?php echo __( 'Enable frontend image uploading. (uploading script is not included, but you may use a plugin or custom code).', 'image-watermark' ); ?>
594
- </label>
595
- <span class="description"><?php echo __( '<br /><strong>Notice:</strong> This functionality works only if uploaded images are processed using WordPress native upload methods.', 'image-watermark' ); ?></span>
596
- <?php
597
- }
598
-
599
- /**
600
- * Remove data on deactivation option.
601
- */
602
- public function iw_deactivation() {
603
- ?>
604
- <label for="iw_deactivation">
605
- <input id="iw_deactivation" type="checkbox" <?php checked( ( ! empty( $this->options['watermark_image']['deactivation_delete'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][deactivation_delete]">
606
- <?php echo __( 'Delete all database settings on plugin deactivation.', 'image-watermark' ); ?>
607
- </label>
608
- <?php
609
- }
610
-
611
- /**
612
- * Watermark alignment option.
613
- */
614
- public function iw_alignment() {
615
- ?>
616
- <fieldset id="iw_alignment">
617
- <table id="watermark_position" border="1">
618
- <?php
619
- $watermark_position = $this->options['watermark_image']['position'];
620
-
621
- foreach ( $this->watermark_positions['y'] as $y ) {
622
- ?>
623
- <tr>
624
- <?php
625
- foreach ( $this->watermark_positions['x'] as $x ) {
626
- ?>
627
- <td title="<?php echo ucfirst( $y . ' ' . $x ); ?>">
628
- <input name="iw_options[watermark_image][position]" type="radio" value="<?php echo $y . '_' . $x; ?>"<?php echo ($watermark_position == $y . '_' . $x ? ' checked="checked"' : NULL); ?> />
629
- </td>
630
- <?php }
631
- ?>
632
- </tr>
633
- <?php
634
- }
635
- ?>
636
- </table>
637
- <p class="description"><?php echo __( 'Choose the position of watermark image.', 'image-watermark' ); ?></p>
638
- </fieldset>
639
- <?php
640
- }
641
-
642
- /**
643
- * Watermark offset option.
644
- */
645
- public function iw_offset() {
646
- ?>
647
- <fieldset id="iw_offset">
648
- <?php echo __( 'x:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][offset_width]" value="<?php echo $this->options['watermark_image']['offset_width']; ?>"> <?php echo __( 'px', 'image-watermark' ); ?>
649
- <br />
650
- <?php echo __( 'y:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][offset_height]" value="<?php echo $this->options['watermark_image']['offset_height']; ?>"> <?php echo __( 'px', 'image-watermark' ); ?>
651
- </fieldset>
652
- <?php
653
- }
654
-
655
- /**
656
- * Watermark image option.
657
- */
658
- public function iw_watermark_image() {
659
- if ( $this->options['watermark_image']['url'] !== NULL && $this->options['watermark_image']['url'] != 0 ) {
660
- $image = wp_get_attachment_image_src( $this->options['watermark_image']['url'], array( 300, 300 ), false );
661
- $image_selected = true;
662
- } else {
663
- $image_selected = false;
664
- }
665
- ?>
666
- <div class="iw_watermark_image">
667
- <input id="upload_image" type="hidden" name="iw_options[watermark_image][url]" value="<?php echo (int) $this->options['watermark_image']['url']; ?>" />
668
- <input id="upload_image_button" type="button" class="button button-secondary" value="<?php echo __( 'Select image', 'image-watermark' ); ?>" />
669
- <input id="turn_off_image_button" type="button" class="button button-secondary" value="<?php echo __( 'Remove image', 'image-watermark' ); ?>" <?php if ( $image_selected === false ) echo 'disabled="disabled"'; ?>/>
670
- <p class="description"><?php _e( 'You have to save changes after the selection or removal of the image.', 'image-watermark' ); ?></p>
671
- </div>
672
- <?php
673
- }
674
-
675
- /**
676
- * Watermark image preview.
677
- */
678
- public function iw_watermark_preview() {
679
- if ( $this->options['watermark_image']['url'] !== NULL && $this->options['watermark_image']['url'] != 0 ) {
680
- $image = wp_get_attachment_image_src( $this->options['watermark_image']['url'], array( 300, 300 ), false );
681
- $image_selected = true;
682
- } else {
683
- $image_selected = false;
684
- }
685
- ?>
686
- <fieldset id="iw_watermark_preview">
687
- <div id="previewImg_imageDiv">
688
- <?php
689
- if ( $image_selected === true ) {
690
- $image = wp_get_attachment_image_src( $this->options['watermark_image']['url'], array( 300, 300 ), false );
691
- ?>
692
- <img id="previewImg_image" src="<?php echo $image[0]; ?>" alt="" width="300" />
693
- <?php } else { ?>
694
- <img id="previewImg_image" src="" alt="" width="300" style="display: none;" />
695
- <?php }
696
- ?>
697
- </div>
698
- <p id="previewImageInfo" class="description">
699
- <?php
700
- if ( $image_selected === false ) {
701
- _e( 'Watermak has not been selected yet.', 'image-watermark' );
702
- } else {
703
- $image_full_size = wp_get_attachment_image_src( $this->options['watermark_image']['url'], 'full', false );
704
-
705
- _e( 'Original size', 'image-watermark' ) . ': ' . $image_full_size[1] . ' px / ' . $image_full_size[2] . ' px';
706
- }
707
- ?>
708
- </p>
709
- </fieldset>
710
- <?php
711
- }
712
-
713
- /**
714
- * Watermark size option.
715
- */
716
- public function iw_watermark_size() {
717
- ?>
718
- <fieldset id="iw_watermark_size">
719
- <div id="watermark-type">
720
- <label for="type1"><?php _e( 'original', 'image-watermark' ); ?></label>
721
- <input type="radio" id="type1" value="0" name="iw_options[watermark_image][watermark_size_type]" <?php checked( $this->options['watermark_image']['watermark_size_type'], 0, true ); ?> />
722
- <label for="type2"><?php _e( 'custom', 'image-watermark' ); ?></label>
723
- <input type="radio" id="type2" value="1" name="iw_options[watermark_image][watermark_size_type]" <?php checked( $this->options['watermark_image']['watermark_size_type'], 1, true ); ?> />
724
- <label for="type3"><?php _e( 'scaled', 'image-watermark' ); ?></label>
725
- <input type="radio" id="type3" value="2" name="iw_options[watermark_image][watermark_size_type]" <?php checked( $this->options['watermark_image']['watermark_size_type'], 2, true ); ?> />
726
- </div>
727
- <p class="description"><?php _e( 'Select method of aplying watermark size.', 'image-watermark' ); ?></p>
728
- </fieldset>
729
- <?php
730
- }
731
-
732
- /**
733
- * Watermark custom size option.
734
- */
735
- public function iw_watermark_size_custom() {
736
- ?>
737
- <fieldset id="iw_watermark_size_custom">
738
- <?php _e( 'x:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][absolute_width]" value="<?php echo $this->options['watermark_image']['absolute_width']; ?>"> <?php _e( 'px', 'image-watermark' ); ?>
739
- <br />
740
- <?php _e( 'y:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][absolute_height]" value="<?php echo $this->options['watermark_image']['absolute_height']; ?>"> <?php _e( 'px', 'image-watermark' ); ?>
741
- </fieldset>
742
- <p class="description"><?php _e( 'Those dimensions will be used if "custom" method is selected above.', 'image-watermark' ); ?></p>
743
- <?php
744
- }
745
-
746
- /**
747
- * Watermark scaled size option.
748
- */
749
- public function iw_watermark_size_scaled() {
750
- ?>
751
- <fieldset id="iw_watermark_size_scaled">
752
- <div>
753
- <input type="text" id="iw_size_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][width]" value="<?php echo $this->options['watermark_image']['width']; ?>" />
754
- <div class="wplike-slider">
755
- <span class="left hide-if-no-js">0</span><span class="middle" id="iw_size_span" title="<?php echo $this->options['watermark_image']['width']; ?>"></span><span class="right hide-if-no-js">100</span>
756
- </div>
757
- </div>
758
- </fieldset>
759
- <p class="description"><?php _e( 'This value will be used if "scaled" method if selected above. <br />Enter a number ranging from 0 to 100. 100 makes width of watermark image equal to width of the image it is applied to.', 'image-watermark' ); ?></p>
760
- <?php
761
- }
762
-
763
- /**
764
- * Watermark custom size option.
765
- */
766
- public function iw_watermark_opacity() {
767
- ?>
768
- <fieldset id="iw_watermark_opacity">
769
- <div>
770
- <input type="text" id="iw_opacity_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][transparent]" value="<?php echo $this->options['watermark_image']['transparent']; ?>" />
771
- <div class="wplike-slider">
772
- <span class="left hide-if-no-js">0</span><span class="middle" id="iw_opacity_span" title="<?php echo $this->options['watermark_image']['transparent']; ?>"></span><span class="right hide-if-no-js">100</span>
773
- </div>
774
- </div>
775
- </fieldset>
776
- <p class="description"><?php _e( 'Enter a number ranging from 0 to 100. 0 makes watermark image completely transparent, 100 shows it as is.', 'image-watermark' ); ?></p>
777
- <?php
778
- }
779
-
780
- /**
781
- * Image quality option.
782
- */
783
- public function iw_image_quality() {
784
- ?>
785
- <fieldset id="iw_image_quality">
786
- <div>
787
- <input type="text" id="iw_quality_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][quality]" value="<?php echo $this->options['watermark_image']['quality']; ?>" />
788
- <div class="wplike-slider">
789
- <span class="left hide-if-no-js">0</span><span class="middle" id="iw_quality_span" title="<?php echo $this->options['watermark_image']['quality']; ?>"></span><span class="right hide-if-no-js">100</span>
790
- </div>
791
- </div>
792
- </fieldset>
793
- <p class="description"><?php _e( 'Set output image quality.', 'image-watermark' ); ?></p>
794
- <?php
795
- }
796
-
797
- /**
798
- * Image format option.
799
- */
800
- public function iw_image_format() {
801
- ?>
802
- <fieldset id="iw_image_format">
803
- <div id="jpeg-format">
804
- <label for="baseline"><?php _e( 'baseline', 'image-watermark' ); ?></label>
805
- <input type="radio" id="baseline" value="baseline" name="iw_options[watermark_image][jpeg_format]" <?php checked( $this->options['watermark_image']['jpeg_format'], 'baseline', true ); ?> />
806
- <label for="progressive"><?php _e( 'progressive', 'image-watermark' ); ?></label>
807
- <input type="radio" id="progressive" value="progressive" name="iw_options[watermark_image][jpeg_format]" <?php checked( $this->options['watermark_image']['jpeg_format'], 'progressive', true ); ?> />
808
- </div>
809
- </fieldset>
810
- <p class="description"><?php _e( 'Select baseline or progressive image format.', 'image-watermark' ); ?></p>
811
- <?php
812
- }
813
-
814
- /**
815
- * Right click image protection option.
816
- */
817
- public function iw_protection_right_click() {
818
- ?>
819
- <label for="iw_protection_right_click">
820
- <input id="iw_protection_right_click" type="checkbox" <?php checked( ( ! empty( $this->options['image_protection']['rightclick'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][rightclick]">
821
- <?php _e( 'Disable right mouse click on images', 'image-watermark' ); ?>
822
- </label>
823
- <?php
824
- }
825
-
826
- /**
827
- * Drag and drop image protection option.
828
- */
829
- public function iw_protection_drag_drop() {
830
- ?>
831
- <label for="iw_protection_drag_drop">
832
- <input id="iw_protection_drag_drop" type="checkbox" <?php checked( ( ! empty( $this->options['image_protection']['draganddrop'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][draganddrop]">
833
- <?php _e( 'Prevent drag and drop', 'image-watermark' ); ?>
834
- </label>
835
- <?php
836
- }
837
-
838
- /**
839
- * Logged-in users image protection option.
840
- */
841
- public function iw_protection_logged() {
842
- ?>
843
- <label for="iw_protection_logged">
844
- <input id="iw_protection_logged" type="checkbox" <?php checked( ( ! empty( $this->options['image_protection']['forlogged'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][forlogged]">
845
- <?php _e( 'Enable image protection for logged-in users also', 'image-watermark' ); ?>
846
- </label>
847
- <?php
848
- }
849
-
850
- /**
851
- * Validate options.
852
- *
853
- * @param array $input
854
- * @return array
855
- */
856
- public function validate_options( $input ) {
857
-
858
- if ( ! current_user_can( 'manage_options' ) )
859
- return $input;
860
-
861
- if ( isset( $_POST['save_image_watermark_options'] ) ) {
862
-
863
- $input['watermark_image']['plugin_off'] = isset( $_POST['iw_options']['watermark_image']['plugin_off'] ) ? ((bool) $_POST['iw_options']['watermark_image']['plugin_off'] == 1 ? true : false) : $this->defaults['options']['watermark_image']['plugin_off'];
864
- $input['watermark_image']['manual_watermarking'] = isset( $_POST['iw_options']['watermark_image']['manual_watermarking'] ) ? ((bool) $_POST['iw_options']['watermark_image']['manual_watermarking'] == 1 ? true : false) : $this->defaults['options']['watermark_image']['manual_watermarking'];
865
-
866
- $watermark_on = array();
867
-
868
- if ( isset( $_POST['iw_options']['watermark_on'] ) && is_array( $_POST['iw_options']['watermark_on'] ) ) {
869
- foreach ( $this->image_sizes as $size ) {
870
- if ( in_array( $size, array_keys( $_POST['iw_options']['watermark_on'] ) ) ) {
871
- $watermark_on[$size] = 1;
872
- }
873
- }
874
- }
875
- $input['watermark_on'] = $watermark_on;
876
-
877
- $input['watermark_cpt_on'] = $this->defaults['options']['watermark_cpt_on'];
878
-
879
- if ( isset( $_POST['iw_options']['watermark_cpt_on'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_cpt_on'] ), array( 'everywhere', 'specific' ) ) ) {
880
- if ( $_POST['iw_options']['watermark_cpt_on'] === 'specific' ) {
881
- if ( isset( $_POST['iw_options']['watermark_cpt_on_type'] ) ) {
882
- $tmp = array();
883
-
884
- foreach ( $this->get_post_types() as $cpt ) {
885
- if ( in_array( $cpt, array_keys( $_POST['iw_options']['watermark_cpt_on_type'] ) ) ) {
886
- $tmp[$cpt] = 1;
887
- }
888
- }
889
-
890
- if ( count( $tmp ) > 0 ) {
891
- $input['watermark_cpt_on'] = $tmp;
892
- }
893
- }
894
- }
895
- }
896
-
897
- $input['watermark_image']['frontend_active'] = isset( $_POST['iw_options']['watermark_image']['frontend_active'] ) ? ((bool) $_POST['iw_options']['watermark_image']['frontend_active'] == 1 ? true : false) : $this->defaults['options']['watermark_image']['frontend_active'];
898
- $input['watermark_image']['deactivation_delete'] = isset( $_POST['iw_options']['watermark_image']['deactivation_delete'] ) ? ((bool) $_POST['iw_options']['watermark_image']['deactivation_delete'] == 1 ? true : false) : $this->defaults['options']['watermark_image']['deactivation_delete'];
899
-
900
- $positions = array();
901
-
902
- foreach ( $this->watermark_positions['y'] as $position_y ) {
903
- foreach ( $this->watermark_positions['x'] as $position_x ) {
904
- $positions[] = $position_y . '_' . $position_x;
905
- }
906
- }
907
- $input['watermark_image']['position'] = isset( $_POST['iw_options']['watermark_image']['position'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_image']['position'] ), $positions ) ? esc_attr( $_POST['iw_options']['watermark_image']['position'] ) : $this->defaults['options']['watermark_image']['position'];
908
-
909
- $input['watermark_image']['offset_width'] = isset( $_POST['iw_options']['watermark_image']['offset_width'] ) ? (int) $_POST['iw_options']['watermark_image']['offset_width'] : $this->defaults['options']['watermark_image']['offset_width'];
910
- $input['watermark_image']['offset_height'] = isset( $_POST['iw_options']['watermark_image']['offset_height'] ) ? (int) $_POST['iw_options']['watermark_image']['offset_height'] : $this->defaults['options']['watermark_image']['offset_height'];
911
- $input['watermark_image']['url'] = isset( $_POST['iw_options']['watermark_image']['url'] ) ? (int) $_POST['iw_options']['watermark_image']['url'] : $this->defaults['options']['watermark_image']['url'];
912
- $input['watermark_image']['watermark_size_type'] = isset( $_POST['iw_options']['watermark_image']['watermark_size_type'] ) ? (int) $_POST['iw_options']['watermark_image']['watermark_size_type'] : $this->defaults['options']['watermark_image']['watermark_size_type'];
913
- $input['watermark_image']['absolute_width'] = isset( $_POST['iw_options']['watermark_image']['absolute_width'] ) ? (int) $_POST['iw_options']['watermark_image']['absolute_width'] : $this->defaults['options']['watermark_image']['absolute_width'];
914
- $input['watermark_image']['absolute_height'] = isset( $_POST['iw_options']['watermark_image']['absolute_height'] ) ? (int) $_POST['iw_options']['watermark_image']['absolute_height'] : $this->defaults['options']['watermark_image']['absolute_height'];
915
- $input['watermark_image']['width'] = isset( $_POST['iw_options']['watermark_image']['width'] ) ? (int) $_POST['iw_options']['watermark_image']['width'] : $this->defaults['options']['watermark_image']['width'];
916
- $input['watermark_image']['transparent'] = isset( $_POST['iw_options']['watermark_image']['transparent'] ) ? (int) $_POST['iw_options']['watermark_image']['transparent'] : $this->defaults['options']['watermark_image']['transparent'];
917
- $input['watermark_image']['quality'] = isset( $_POST['iw_options']['watermark_image']['quality'] ) ? (int) $_POST['iw_options']['watermark_image']['quality'] : $this->defaults['options']['watermark_image']['quality'];
918
- $input['watermark_image']['jpeg_format'] = isset( $_POST['iw_options']['watermark_image']['jpeg_format'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_image']['jpeg_format'] ), array( 'baseline', 'progressive' ) ) ? esc_attr( $_POST['iw_options']['watermark_image']['jpeg_format'] ) : $this->defaults['options']['watermark_image']['jpeg_format'];
919
-
920
- $input['image_protection']['rightclick'] = isset( $_POST['iw_options']['image_protection']['rightclick'] ) ? ((bool) $_POST['iw_options']['image_protection']['rightclick'] == 1 ? true : false) : $this->defaults['options']['image_protection']['rightclick'];
921
- $input['image_protection']['draganddrop'] = isset( $_POST['iw_options']['image_protection']['draganddrop'] ) ? ((bool) $_POST['iw_options']['image_protection']['draganddrop'] == 1 ? true : false) : $this->defaults['options']['image_protection']['draganddrop'];
922
- $input['image_protection']['forlogged'] = isset( $_POST['iw_options']['image_protection']['forlogged'] ) ? ((bool) $_POST['iw_options']['image_protection']['forlogged'] == 1 ? true : false) : $this->defaults['options']['image_protection']['forlogged'];
923
-
924
- add_settings_error( 'iw_settings_errors', 'iw_settings_saved', __( 'Settings saved.', 'image-watermark' ), 'updated' );
925
- } elseif ( isset( $_POST['reset_image_watermark_options'] ) ) {
926
-
927
- $input = $this->defaults['options'];
928
-
929
- add_settings_error( 'iw_settings_errors', 'iw_settings_reset', __( 'Settings restored to defaults.', 'image-watermark' ), 'updated' );
930
- }
931
-
932
- if ( $input['watermark_image']['plugin_off'] != 0 || $input['watermark_image']['manual_watermarking'] != 0 ) {
933
- if ( empty( $input['watermark_image']['url'] ) )
934
- add_settings_error( 'iw_settings_errors', 'iw_image_not_set', __( 'Watermark will not be applied when watermark image is not set.', 'image-watermark' ), 'error' );
935
-
936
- if ( empty( $input['watermark_on'] ) )
937
- add_settings_error( 'iw_settings_errors', 'iw_sizes_not_set', __( 'Watermark will not be applied when no image sizes are selected.', 'image-watermark' ), 'error' );
938
- }
939
-
940
- return $input;
941
- }
942
-
943
- /**
944
- * Apply watermark to selected image sizes.
945
- *
946
- * @param array $data
947
- * @param int $attachment_id
948
- * @return array
949
- */
950
- public function apply_watermark( $data, $attachment_id ) {
951
-
952
- $post = get_post( (int) $attachment_id );
953
- $post_id = ( ! empty( $post ) ? (int) $post->post_parent : 0);
954
-
955
- // something went wrong or is it automatic mode?
956
- if ( $attachment_id !== 'manual' && ($this->is_admin === true && ! ((isset( $this->options['watermark_cpt_on'][0] ) && $this->options['watermark_cpt_on'][0] === 'everywhere') || ($post_id > 0 && in_array( get_post_type( $post_id ), array_keys( $this->options['watermark_cpt_on'] ) ) === true))) )
957
- return $data;
958
-
959
- if ( apply_filters( 'iw_watermark_display', $attachment_id ) === false )
960
- return $data;
961
-
962
- $upload_dir = wp_upload_dir();
963
-
964
- // is this really an iamge?
965
- if ( getimagesize( $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $data['file'] ) !== false ) {
966
- // loop through active image sizes
967
- foreach ( $this->options['watermark_on'] as $image_size => $active_size ) {
968
- if ( $active_size === 1 ) {
969
- switch ( $image_size ) {
970
- case 'full':
971
- $filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $data['file'];
972
- break;
973
-
974
- default:
975
- if ( ! empty( $data['sizes'] ) && array_key_exists( $image_size, $data['sizes'] ) ) {
976
- $filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . dirname( $data['file'] ) . DIRECTORY_SEPARATOR . $data['sizes'][$image_size]['file'];
977
- } else {
978
- // early getaway
979
- continue 2;
980
- }
981
- }
982
-
983
- do_action( 'iw_before_apply_watermark' );
984
-
985
- // apply watermark
986
- $this->do_watermark( $filepath );
987
-
988
- do_action( 'iw_after_apply_watermark' );
989
- }
990
- }
991
- }
992
-
993
- // pass forward attachment metadata
994
- return $data;
995
- }
996
-
997
- /**
998
- * Apply watermark to image.
999
- *
1000
- * @param string $filepath
1001
- */
1002
- public function do_watermark( $filepath ) {
1003
-
1004
- $options = apply_filters( 'iw_watermark_options', $this->options );
1005
-
1006
- // get image mime type
1007
- $mime_type = wp_check_filetype( $filepath );
1008
-
1009
- // get image resource
1010
- if ( ($image = $this->get_image_resource( $filepath, $mime_type['type'] )) !== false ) {
1011
- // add watermark image to image
1012
- if ( $this->add_watermark_image( $image, $options ) !== false ) {
1013
-
1014
- if ( $options['watermark_image']['jpeg_format'] === 'progressive' ) {
1015
- imageinterlace( $image, true );
1016
- }
1017
-
1018
- // save watermarked image
1019
- $this->save_image_file( $image, $mime_type['type'], $filepath, $options['watermark_image']['quality'] );
1020
- }
1021
- }
1022
- }
1023
-
1024
- /**
1025
- * Add watermark image to image.
1026
- *
1027
- * @param resource $image
1028
- * @param array $opt
1029
- * @return resource
1030
- */
1031
- private function add_watermark_image( $image, $opt ) {
1032
- // due to allow_url_fopen restrictions on some servers in getimagesize() we need to use server path (not URL)
1033
- $upload_dir = wp_upload_dir();
1034
- $watermark_file = wp_get_attachment_metadata( $opt['watermark_image']['url'], true );
1035
- $url = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $watermark_file['file'];
1036
- $watermark_file_info = getimagesize( $url );
1037
-
1038
- switch ( $watermark_file_info['mime'] ) {
1039
- case 'image/jpeg':
1040
- case 'image/pjpeg':
1041
- $watermark = imagecreatefromjpeg( $url );
1042
- break;
1043
-
1044
- case 'image/gif':
1045
- $watermark = imagecreatefromgif( $url );
1046
- break;
1047
-
1048
- case 'image/png':
1049
- $watermark = imagecreatefrompng( $url );
1050
- break;
1051
-
1052
- default:
1053
- return false;
1054
- }
1055
-
1056
- $watermark_width = imagesx( $watermark );
1057
- $watermark_height = imagesy( $watermark );
1058
- $img_width = imagesx( $image );
1059
- $img_height = imagesy( $image );
1060
- $size_type = $opt['watermark_image']['watermark_size_type'];
1061
-
1062
- if ( $size_type === 1 ) { // custom
1063
- $w = $opt['watermark_image']['absolute_width'];
1064
- $h = $opt['watermark_image']['absolute_height'];
1065
- } elseif ( $size_type === 2 ) { // scale
1066
- $ratio = $img_width * $opt['watermark_image']['width'] / 100 / $watermark_width;
1067
-
1068
- $w = (int) ($watermark_width * $ratio);
1069
- $h = (int) ($watermark_height * $ratio);
1070
-
1071
- // if watermark scaled height is bigger then image watermark
1072
- if ( $h > $img_height ) {
1073
- $w = (int) ($img_height * $w / $h);
1074
- $h = $img_height;
1075
- }
1076
- } else { // original
1077
- $w = $watermark_width;
1078
- $h = $watermark_height;
1079
- }
1080
-
1081
- switch ( $opt['watermark_image']['position'] ) {
1082
- case 'top_left':
1083
- $dest_x = $dest_y = 0;
1084
- break;
1085
-
1086
- case 'top_center':
1087
- $dest_x = ($img_width / 2) - ($w / 2);
1088
- $dest_y = 0;
1089
- break;
1090
-
1091
- case 'top_right':
1092
- $dest_x = $img_width - $w;
1093
- $dest_y = 0;
1094
- break;
1095
-
1096
- case 'middle_left':
1097
- $dest_x = 0;
1098
- $dest_y = ($img_height / 2) - ($h / 2);
1099
- break;
1100
-
1101
- case 'middle_right':
1102
- $dest_x = $img_width - $w;
1103
- $dest_y = ($img_height / 2) - ($h / 2);
1104
- break;
1105
-
1106
- case 'bottom_left':
1107
- $dest_x = 0;
1108
- $dest_y = $img_height - $h;
1109
- break;
1110
-
1111
- case 'bottom_center':
1112
- $dest_x = ($img_width / 2) - ($w / 2);
1113
- $dest_y = $img_height - $h;
1114
- break;
1115
-
1116
- case 'bottom_right':
1117
- $dest_x = $img_width - $w;
1118
- $dest_y = $img_height - $h;
1119
- break;
1120
-
1121
- default:
1122
- $dest_x = ($img_width / 2) - ($w / 2);
1123
- $dest_y = ($img_height / 2) - ($h / 2);
1124
- }
1125
-
1126
- $dest_x += $opt['watermark_image']['offset_width'];
1127
- $dest_y += $opt['watermark_image']['offset_height'];
1128
-
1129
- $this->imagecopymerge_alpha( $image, $this->resize( $watermark, $url, $w, $h, $watermark_file_info ), $dest_x, $dest_y, 0, 0, $w, $h, $opt['watermark_image']['transparent'] );
1130
-
1131
- return $image;
1132
- }
1133
-
1134
- /**
1135
- * Create new image function.
1136
- *
1137
- * @param resource $dst_im
1138
- * @param resource $src_im
1139
- * @param int $dst_x
1140
- * @param int $dst_y
1141
- * @param int $src_x
1142
- * @param int $src_y
1143
- * @param int $src_w
1144
- * @param int $src_h
1145
- * @param int $pct
1146
- */
1147
- private function imagecopymerge_alpha( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct ) {
1148
- // create a cut resource
1149
- $cut = imagecreatetruecolor( $src_w, $src_h );
1150
-
1151
- // copy relevant section from background to the cut resource
1152
- imagecopy( $cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h );
1153
-
1154
- // copy relevant section from watermark to the cut resource
1155
- imagecopy( $cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h );
1156
-
1157
- // insert cut resource to destination image
1158
- imagecopymerge( $dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct );
1159
- }
1160
-
1161
- /**
1162
- * Resize image function.
1163
- *
1164
- * @param resource $Im
1165
- * @param string $path
1166
- * @param int $nWidth
1167
- * @param int $nHeight
1168
- * @param array $imgInfo
1169
- * @return resource
1170
- */
1171
- private function resize( $im, $path, $nWidth, $nHeight, $imgInfo ) {
1172
- $newImg = imagecreatetruecolor( $nWidth, $nHeight );
1173
-
1174
- // check if this image is PNG, then set if transparent
1175
- if ( $imgInfo[2] === 3 ) {
1176
- imagealphablending( $newImg, false );
1177
- imagesavealpha( $newImg, true );
1178
- $transparent = imagecolorallocatealpha( $newImg, 255, 255, 255, 127 );
1179
- imagefilledrectangle( $newImg, 0, 0, $nWidth, $nHeight, $transparent );
1180
- }
1181
-
1182
- imagecopyresampled( $newImg, $im, 0, 0, 0, 0, $nWidth, $nHeight, $imgInfo[0], $imgInfo[1] );
1183
-
1184
- return $newImg;
1185
- }
1186
-
1187
- /**
1188
- * Get image resource accordingly to mimetype.
1189
- *
1190
- * @param string $filepath
1191
- * @param string $mime_type
1192
- * @return resource
1193
- */
1194
- private function get_image_resource( $filepath, $mime_type ) {
1195
- switch ( $mime_type ) {
1196
- case 'image/jpeg':
1197
- case 'image/pjpeg':
1198
- return imagecreatefromjpeg( $filepath );
1199
-
1200
- case 'image/png':
1201
- $res = imagecreatefrompng( $filepath );
1202
- imagesavealpha( $res, true );
1203
- $transparent = imagecolorallocatealpha( $res, 255, 255, 255, 127 );
1204
- imagefilledrectangle( $res, 0, 0, imagesx( $res ), imagesy( $res ), $transparent );
1205
-
1206
- return $res;
1207
-
1208
- default:
1209
- return false;
1210
- }
1211
- }
1212
-
1213
- /**
1214
- * Save image from image resource.
1215
- *
1216
- * @param resource $image
1217
- * @param string $mime_type
1218
- * @param string $filepath
1219
- * @return boolean
1220
- */
1221
- private function save_image_file( $image, $mime_type, $filepath, $quality ) {
1222
- switch ( $mime_type ) {
1223
- case 'image/jpeg':
1224
- case 'image/pjpeg':
1225
- imagejpeg( $image, $filepath, $quality );
1226
- break;
1227
-
1228
- case 'image/png':
1229
- imagepng( $image, $filepath, (int) round( 9 * $quality / 100 ) );
1230
- break;
1231
- }
1232
- }
1233
-
1234
- /**
1235
- * Add links to Support Forum.
1236
- *
1237
- * @param array $links
1238
- * @param string $file
1239
- * @return array
1240
- */
1241
- public function plugin_extend_links( $links, $file ) {
1242
- if ( ! current_user_can( 'install_plugins' ) )
1243
- return $links;
1244
-
1245
- $plugin = plugin_basename( __FILE__ );
1246
-
1247
- if ( $file == $plugin ) {
1248
- return array_merge(
1249
- $links, array( sprintf( '<a href="http://www.dfactory.eu/support/forum/image-watermark/" target="_blank">%s</a>', __( 'Support', 'image-watermark' ) ) )
1250
- );
1251
- }
1252
-
1253
- return $links;
1254
- }
1255
-
1256
- /**
1257
- * Add links to Settings page.
1258
- *
1259
- * @param array $links
1260
- * @param string $file
1261
- * @return array
1262
- */
1263
- function plugin_settings_link( $links, $file ) {
1264
- if ( ! is_admin() || ! current_user_can( 'manage_options' ) )
1265
- return $links;
1266
-
1267
- static $plugin;
1268
-
1269
- $plugin = plugin_basename( __FILE__ );
1270
-
1271
- if ( $file == $plugin ) {
1272
- $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php' ) . '?page=watermark-options', __( 'Settings', 'image-watermark' ) );
1273
- array_unshift( $links, $settings_link );
1274
- }
1275
-
1276
- return $links;
1277
- }
1278
-
1279
- }
1280
-
1281
- $image_watermark = new Image_Watermark();
1
+ <?php
2
+ /*
3
+ Plugin Name: Image Watermark
4
+ Description: Image Watermark allows you to automatically watermark images uploaded to the WordPress Media Library and bulk watermark previously uploaded images.
5
+ Version: 1.5.3
6
+ Author: dFactory
7
+ Author URI: http://www.dfactory.eu/
8
+ Plugin URI: http://www.dfactory.eu/plugins/image-watermark/
9
+ License: MIT License
10
+ License URI: http://opensource.org/licenses/MIT
11
+ Text Domain: image-watermark
12
+ Domain Path: /languages
13
+
14
+ Image Watermark
15
+ Copyright (C) 2013-2015, Digital Factory - info@digitalfactory.pl
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ // exit if accessed directly
25
+ if ( ! defined( 'ABSPATH' ) )
26
+ exit;
27
+
28
+ define( 'IMAGE_WATERMARK_URL', plugins_url( '', __FILE__ ) );
29
+ define( 'IMAGE_WATERMARK_PATH', plugin_dir_path( __FILE__ ) );
30
+
31
+ /**
32
+ * Image Watermark class.
33
+ *
34
+ * @class Image_Watermark
35
+ * @version 1.5.3
36
+ */
37
+ final class Image_Watermark {
38
+
39
+ /**
40
+ * Main plugin instance.
41
+ */
42
+ private static $instance;
43
+
44
+ private $is_admin = true;
45
+ private $extension = false;
46
+ private $allowed_mime_types = array(
47
+ 'image/jpeg',
48
+ 'image/pjpeg',
49
+ 'image/png'
50
+ );
51
+ public $defaults = array(
52
+ 'options' => array(
53
+ 'watermark_on' => array(),
54
+ 'watermark_cpt_on' => array( 'everywhere' ),
55
+ 'watermark_image' => array(
56
+ 'url' => 0,
57
+ 'width' => 80,
58
+ 'plugin_off' => 0,
59
+ 'frontend_active' => false,
60
+ 'manual_watermarking' => 0,
61
+ 'position' => 'bottom_right',
62
+ 'watermark_size_type' => 2,
63
+ 'offset_width' => 0,
64
+ 'offset_height' => 0,
65
+ 'absolute_width' => 0,
66
+ 'absolute_height' => 0,
67
+ 'transparent' => 50,
68
+ 'quality' => 90,
69
+ 'jpeg_format' => 'baseline',
70
+ 'deactivation_delete' => false,
71
+ 'media_library_notice' => true
72
+ ),
73
+ 'image_protection' => array(
74
+ 'rightclick' => 0,
75
+ 'draganddrop' => 0,
76
+ 'forlogged' => 0,
77
+ ),
78
+ ),
79
+ 'version' => '1.5.3'
80
+ );
81
+ public $options = array();
82
+
83
+ public function __construct() {
84
+ // installer
85
+ register_activation_hook( __FILE__, array( $this, 'activate_watermark' ) );
86
+ register_deactivation_hook( __FILE__, array( $this, 'deactivate_watermark' ) );
87
+
88
+ // settings
89
+ $this->options = array_merge( $this->defaults['options'], get_option( 'image_watermark_options', $this->defaults['options'] ) );
90
+
91
+ include_once( IMAGE_WATERMARK_PATH . 'includes/class-update.php' );
92
+ include_once( IMAGE_WATERMARK_PATH . 'includes/class-settings.php' );
93
+
94
+ // actions
95
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
96
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
97
+ add_action( 'admin_print_scripts', array( $this, 'admin_print_scripts' ), 20 );
98
+ add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
99
+ add_action( 'load-upload.php', array( $this, 'apply_watermark_bulk_action' ) );
100
+ add_action( 'admin_init', array( $this, 'update_plugin' ) );
101
+ add_action( 'admin_init', array( $this, 'check_extensions' ) );
102
+ add_action( 'admin_notices', array( $this, 'bulk_admin_notices' ) );
103
+
104
+ // filters
105
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_extend_links' ), 10, 2 );
106
+ add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ), 10, 2 );
107
+ add_filter( 'wp_handle_upload', array( $this, 'handle_upload_files' ) );
108
+ }
109
+
110
+ /**
111
+ * Create single instance.
112
+ *
113
+ * @return object Main plugin instance
114
+ */
115
+ public static function instance() {
116
+ if ( self::$instance === null )
117
+ self::$instance = new self();
118
+
119
+ return self::$instance;
120
+ }
121
+
122
+ /**
123
+ * Plugin activation.
124
+ */
125
+ public function activate_watermark() {
126
+ add_option( 'image_watermark_options', $this->defaults['options'], '', 'no' );
127
+ add_option( 'image_watermark_version', $this->defaults['version'], '', 'no' );
128
+ }
129
+
130
+ /**
131
+ * Plugin deactivation.
132
+ */
133
+ public function deactivate_watermark() {
134
+ // remove options from database?
135
+ if ( $this->options['image_watermark_image']['deactivation_delete'] ) {
136
+ delete_option( 'image_watermark_options' );
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Plugin update, fix for version < 1.5.0
142
+ */
143
+ public function update_plugin() {
144
+ if ( ! current_user_can( 'install_plugins' ) )
145
+ return;
146
+
147
+ $db_version = get_option( 'image_watermark_version' );
148
+ $db_version = ! ( $db_version ) && ( get_option( 'df_watermark_installed' ) != false ) ? get_option( 'version' ) : $db_version;
149
+
150
+ if ( $db_version != false ) {
151
+ if ( version_compare( $db_version, '1.5.0', '<' ) ) {
152
+ $options = array();
153
+
154
+ $old_new = array(
155
+ 'df_watermark_on' => 'watermark_on',
156
+ 'df_watermark_cpt_on' => 'watermark_cpt_on',
157
+ 'df_watermark_image' => 'watermark_image',
158
+ 'df_image_protection' => 'image_protection',
159
+ 'df_watermark_installed' => '',
160
+ 'version' => '',
161
+ 'image_watermark_version' => '',
162
+ );
163
+
164
+ foreach ( $old_new as $old => $new ) {
165
+ if ( $new ) {
166
+ $options[$new] = get_option( $old );
167
+ }
168
+ delete_option( $old );
169
+ }
170
+
171
+ add_option( 'image_watermark_options', $options, '', 'no' );
172
+ add_option( 'image_watermark_version', $this->defaults['version'], '', 'no' );
173
+ }
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Load textdomain.
179
+ */
180
+ public function load_textdomain() {
181
+ load_plugin_textdomain( 'image-watermark', false, basename( dirname( __FILE__ ) ) . '/languages' );
182
+ }
183
+
184
+ /**
185
+ * Admin inline scripts.
186
+ */
187
+ public function admin_print_scripts() {
188
+ global $pagenow;
189
+
190
+ if ( $pagenow === 'upload.php' ) {
191
+ if ( $this->options['watermark_image']['manual_watermarking'] == 1 ) {
192
+ ?>
193
+ <script type="text/javascript">
194
+ jQuery( function( $ ) {
195
+ $( document ).ready( function() {
196
+ $( "<option>" ).val( "applywatermark" ).text( "<?php _e( 'Apply watermark', 'image-watermark' ); ?>" ).appendTo( "select[name='action']" );
197
+ $( "<option>" ).val( "applywatermark" ).text( "<?php _e( 'Apply watermark', 'image-watermark' ); ?>" ).appendTo( "select[name='action2']" );
198
+ });
199
+ });
200
+ </script>
201
+ <?php
202
+ }
203
+ }
204
+ }
205
+
206
+ /**
207
+ * Enqueue admin scripts and styles.
208
+ */
209
+ public function admin_enqueue_scripts( $page ) {
210
+ if ( $page === 'settings_page_watermark-options' ) {
211
+ wp_enqueue_media();
212
+
213
+ wp_enqueue_script( 'upload-manager', plugins_url( '/js/admin-upload.js', __FILE__ ), array(), $this->defaults['version'] );
214
+
215
+ wp_localize_script(
216
+ 'upload-manager',
217
+ 'iwUploadArgs',
218
+ array(
219
+ 'title' => __( 'Select watermark', 'image-watermark' ),
220
+ 'originalSize' => __( 'Original size', 'image-watermark' ),
221
+ 'noSelectedImg' => __( 'Watermak has not been selected yet.', 'image-watermark' ),
222
+ 'notAllowedImg' => __( 'This image is not supported as watermark. Use JPEG, PNG or GIF.', 'image-watermark' ),
223
+ 'px' => __( 'px', 'image-watermark' ),
224
+ 'frame' => 'select',
225
+ 'button' => array( 'text' => __( 'Add watermark', 'image-watermark' ) ),
226
+ 'multiple' => false
227
+ )
228
+ );
229
+
230
+ wp_enqueue_script( 'watermark-admin-script', plugins_url( 'js/admin-settings.js', __FILE__ ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-button', 'jquery-ui-slider' ), $this->defaults['version'] );
231
+
232
+ wp_localize_script(
233
+ 'watermark-admin-script',
234
+ 'iwArgs',
235
+ array(
236
+ 'resetToDefaults' => __( 'Are you sure you want to reset settings to defaults?', 'image-watermark' )
237
+ )
238
+ );
239
+
240
+ wp_enqueue_style( 'watermark-style', plugins_url( 'css/image-watermark.css', __FILE__ ), array(), $this->defaults['version'] );
241
+ wp_enqueue_style( 'wp-like-ui-theme', plugins_url( 'css/wp-like-ui-theme.css', __FILE__ ), array(), $this->defaults['version'] );
242
+ }
243
+ }
244
+
245
+ /**
246
+ * Enqueue frontend script with 'no right click' and 'drag and drop' functions.
247
+ */
248
+ public function wp_enqueue_scripts() {
249
+ if ( ($this->options['image_protection']['forlogged'] == 0 && is_user_logged_in()) || ($this->options['image_protection']['draganddrop'] == 0 && $this->options['image_protection']['rightclick'] == 0) )
250
+ return;
251
+
252
+ wp_enqueue_script( 'no-right-click', plugins_url( 'js/no-right-click.js', __FILE__ ), array(), $this->defaults['version'] );
253
+
254
+ wp_localize_script(
255
+ 'no-right-click', 'norightclick_args', array(
256
+ 'rightclick' => ($this->options['image_protection']['rightclick'] == 1 ? 'Y' : 'N'),
257
+ 'draganddrop' => ($this->options['image_protection']['draganddrop'] == 1 ? 'Y' : 'N')
258
+ )
259
+ );
260
+ }
261
+
262
+ /**
263
+ * Check which extension is available and set it.
264
+ *
265
+ * @return void
266
+ */
267
+ public function check_extensions() {
268
+ if ( $this->check_imagick() )
269
+ $this->extension = 'imagick';
270
+ elseif ( $this->check_gd() )
271
+ $this->extension = 'gd';
272
+ }
273
+
274
+ /**
275
+ * Apply watermark everywhere or for specific post types.
276
+ *
277
+ * @param resource $file
278
+ * @return resource
279
+ */
280
+ public function handle_upload_files( $file ) {
281
+ // is extension available?
282
+ if ( $this->extension ) {
283
+ // admin
284
+ if ( is_admin() && ! ( defined( 'DOING_AJAX' && DOING_AJAX ) ) ) {
285
+
286
+ $this->is_admin = true;
287
+
288
+ // apply watermark if backend is active and watermark image is set
289
+ if ( $this->options['watermark_image']['plugin_off'] == 1 && $this->options['watermark_image']['url'] != 0 && in_array( $file['type'], $this->allowed_mime_types ) ) {
290
+ add_filter( 'wp_generate_attachment_metadata', array( $this, 'apply_watermark' ), 10, 2 );
291
+ }
292
+ } else {
293
+
294
+ // frontend
295
+ $this->is_admin = false;
296
+
297
+ // apply watermark if frontend is active and watermark image is set
298
+ if ( $this->options['watermark_image']['frontend_active'] == 1 && $this->options['watermark_image']['url'] != 0 && in_array( $file['type'], $this->allowed_mime_types ) ) {
299
+ add_filter( 'wp_generate_attachment_metadata', array( $this, 'apply_watermark' ), 10, 2 );
300
+ }
301
+ }
302
+ }
303
+
304
+ return $file;
305
+ }
306
+
307
+ /**
308
+ * Apply watermark for selected images on media page.
309
+ */
310
+ public function apply_watermark_bulk_action() {
311
+ global $pagenow;
312
+
313
+ if ( $pagenow == 'upload.php' && $this->extension) {
314
+
315
+ $wp_list_table = _get_list_table( 'WP_Media_List_Table' );
316
+
317
+ // only if manual watermarking is turned on and image watermark is set
318
+ if ( $wp_list_table->current_action() === 'applywatermark' && $this->options['watermark_image']['manual_watermarking'] == 1 && $this->options['watermark_image']['url'] != 0 ) {
319
+ // security check
320
+ check_admin_referer( 'bulk-media' );
321
+
322
+ $location = esc_url( remove_query_arg( array( 'watermarked', 'skipped', 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), wp_get_referer() ) );
323
+
324
+ if ( ! $location ) {
325
+ $location = 'upload.php';
326
+ }
327
+
328
+ $location = esc_url( add_query_arg( 'paged', $wp_list_table->get_pagenum(), $location ) );
329
+
330
+ // make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'
331
+ if ( isset( $_REQUEST['media'] ) ) {
332
+ $post_ids = array_map( 'intval', $_REQUEST['media'] );
333
+ }
334
+
335
+ // do we have selected attachments?
336
+ if ( $post_ids ) {
337
+ $watermarked = $skipped = 0;
338
+
339
+ foreach ( $post_ids as $post_id ) {
340
+ $data = wp_get_attachment_metadata( $post_id, false );
341
+
342
+ // is this really an image?
343
+ if ( in_array( get_post_mime_type( $post_id ), $this->allowed_mime_types ) && is_array( $data ) ) {
344
+ $this->apply_watermark( $data, 'manual' );
345
+ $watermarked ++;
346
+ } else
347
+ $skipped ++;
348
+ }
349
+
350
+ $location = esc_url( add_query_arg( array( 'watermarked' => $watermarked, 'skipped' => $skipped ), $location ), null, '' );
351
+ }
352
+
353
+ wp_redirect( $location );
354
+ exit();
355
+ } else
356
+ return;
357
+ }
358
+ }
359
+
360
+ /**
361
+ * Display admin notices.
362
+ */
363
+ public function bulk_admin_notices() {
364
+ global $post_type, $pagenow;
365
+
366
+ if ( $pagenow === 'upload.php' ) {
367
+
368
+ if ( ! current_user_can( 'upload_files' ) )
369
+ return;
370
+
371
+ // hide media library notice
372
+ if ( isset( $_GET['iw_action'] ) && $_GET['iw_action'] == 'hide_library_notice' ) {
373
+ $this->options['watermark_image']['media_library_notice'] = false;
374
+ update_option( 'image_watermark_options', $this->options );
375
+ }
376
+
377
+ // check if manual watermarking is enabled
378
+ if ( ! empty( $this->options['watermark_image']['manual_watermarking'] ) && ( ! isset( $this->options['watermark_image']['media_library_notice']) || $this->options['watermark_image']['media_library_notice'] === true ) ) {
379
+ $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid';
380
+
381
+ if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], array( 'grid', 'list' ) ) ) {
382
+ $mode = $_GET['mode'];
383
+ }
384
+
385
+ // display notice in grid mode only
386
+ if ( $mode === 'grid' ) {
387
+ // get current admin url
388
+ $query_string = array();
389
+ parse_str( $_SERVER['QUERY_STRING'], $query_string );
390
+ $current_url = esc_url( add_query_arg( array_merge( (array) $query_string, array( 'iw_action' => 'hide_library_notice' ) ), '', admin_url( trailingslashit( $pagenow ) ) ) );
391
+
392
+ echo '<div class="error notice"><p>' . sprintf( __( '<strong>Image Watermark:</strong> Bulk watermarking is available in list mode only, under <em>Bulk Actions</em> dropdown. <a href="%1$s">Got to List Mode</a> or <a href="%2$s">Hide this notice</a>', 'image-watermark' ), esc_url( admin_url( 'upload.php?mode=list' ) ), esc_url( $current_url ) ) . '</p></div>';
393
+ }
394
+ }
395
+
396
+ if ( isset( $_REQUEST['watermarked'], $_REQUEST['skipped'] ) && $post_type === 'attachment' ) {
397
+ $watermarked = (int) $_REQUEST['watermarked'];
398
+ $skipped = (int) $_REQUEST['skipped'];
399
+
400
+ if ( $watermarked === 0 ) {
401
+ echo '<div class="error"><p>' . __( 'Watermark could not be applied to selected files or no valid images (JPEG, PNG) were selected.', 'image-watermark' ) . ($skipped > 0 ? ' ' . __( 'Images skipped', 'image-watermark' ) . ': ' . $skipped . '.' : '') . '</p></div>';
402
+ } else {
403
+ echo '<div class="updated"><p>' . sprintf( _n( 'Watermark was succesfully applied to 1 image.', 'Watermark was succesfully applied to %s images.', $watermarked, 'image-watermark' ), number_format_i18n( $watermarked ) ) . ($skipped > 0 ? ' ' . __( 'Skipped files', 'image-watermark' ) . ': ' . $skipped . '.' : '') . '</p></div>';
404
+ }
405
+
406
+ $_SERVER['REQUEST_URI'] = esc_url( remove_query_arg( array( 'watermarked', 'skipped' ), $_SERVER['REQUEST_URI'] ) );
407
+ }
408
+ }
409
+ }
410
+
411
+
412
+
413
+ /**
414
+ * Check whether ImageMagick extension is available.
415
+ *
416
+ * @return boolean True if extension is available.
417
+ */
418
+ public function check_imagick() {
419
+ // check Imagick's extension and classes
420
+ if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) )
421
+ return false;
422
+
423
+ // check version
424
+ if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) )
425
+ return false;
426
+
427
+ // check for deep requirements within Imagick
428
+ if ( ! defined( 'imagick::COMPRESSION_JPEG' ) || ! defined( 'imagick::COMPOSITE_OVERLAY' ) || ! defined( 'Imagick::INTERLACE_PLANE' ) || ! defined( 'imagick::FILTER_CATROM' ) || ! defined( 'Imagick::CHANNEL_ALL' ) )
429
+ return false;
430
+
431
+ // check methods
432
+ if ( array_diff( array( 'clear', 'destroy', 'valid', 'getimage', 'writeimage', 'getimagegeometry', 'getimageformat', 'setimageformat', 'setimagecompression', 'setimagecompressionquality', 'scaleimage' ), get_class_methods( 'Imagick' ) ) )
433
+ return false;
434
+
435
+ return true;
436
+ }
437
+
438
+ /**
439
+ * Check whether GD extension is available.
440
+ *
441
+ * @return boolean True if extension is available.
442
+ */
443
+ public function check_gd( $args = array() ) {
444
+ // check extension
445
+ if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) )
446
+ return false;
447
+
448
+ return true;
449
+ }
450
+
451
+ /**
452
+ * Apply watermark to selected image sizes.
453
+ *
454
+ * @param array $data
455
+ * @param int|string $attachment_id Attachment ID or 'manual'
456
+ * @return array
457
+ */
458
+ public function apply_watermark( $data, $attachment_id ) {
459
+ $post = get_post( (int) $attachment_id );
460
+ $post_id = ( ! empty( $post ) ? (int) $post->post_parent : 0 );
461
+
462
+ // something went wrong or is it automatic mode?
463
+ if ( $attachment_id !== 'manual' && ( $this->is_admin === true && ! ( ( isset( $this->options['watermark_cpt_on'][0] ) && $this->options['watermark_cpt_on'][0] === 'everywhere') || ( $post_id > 0 && in_array( get_post_type( $post_id ), array_keys( $this->options['watermark_cpt_on'] ) ) === true) ) ) )
464
+ return $data;
465
+
466
+ if ( apply_filters( 'iw_watermark_display', $attachment_id ) === false )
467
+ return $data;
468
+
469
+ $upload_dir = wp_upload_dir();
470
+
471
+ // is this really an iamge?
472
+ if ( getimagesize( $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $data['file'] ) !== false ) {
473
+ // loop through active image sizes
474
+ foreach ( $this->options['watermark_on'] as $image_size => $active_size ) {
475
+ if ( $active_size === 1 ) {
476
+ switch ( $image_size ) {
477
+ case 'full':
478
+ $filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $data['file'];
479
+ break;
480
+
481
+ default:
482
+ if ( ! empty( $data['sizes'] ) && array_key_exists( $image_size, $data['sizes'] ) )
483
+ $filepath = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . dirname( $data['file'] ) . DIRECTORY_SEPARATOR . $data['sizes'][$image_size]['file'];
484
+ else
485
+ // early getaway
486
+ continue 2;
487
+ }
488
+
489
+ do_action( 'iw_before_apply_watermark' );
490
+
491
+ // apply watermark
492
+ $this->do_watermark( $attachment_id, $filepath, $image_size, $upload_dir );
493
+
494
+ do_action( 'iw_after_apply_watermark' );
495
+ }
496
+ }
497
+ }
498
+
499
+ // pass forward attachment metadata
500
+ return $data;
501
+ }
502
+
503
+ /**
504
+ * Apply watermark to image.
505
+ *
506
+ * @param int $attachment_id Attachment ID
507
+ * @param string $image_path Path to the file
508
+ * @param string $image_size Image size
509
+ * @param array $upload_dir Upload media data
510
+ * @return void
511
+ */
512
+ public function do_watermark( $attachment_id, $image_path, $image_size, $upload_dir ) {
513
+ $options = apply_filters( 'iw_watermark_options', $this->options );
514
+
515
+ // get image mime type
516
+ $mime = wp_check_filetype( $image_path );
517
+
518
+ // get watermark path
519
+ $watermark_file = wp_get_attachment_metadata( $options['watermark_image']['url'], true );
520
+ $watermark_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $watermark_file['file'];
521
+
522
+ // imagick extension
523
+ if ( $this->extension === 'imagick' ) {
524
+ // create image resource
525
+ $image = new Imagick( $image_path );
526
+
527
+ // create watermark resource
528
+ $watermark = new Imagick( $watermark_path );
529
+
530
+ // set transparency
531
+ $image->setImageOpacity( round( 1 - (float)( $options['watermark_image']['transparent'] / 100 ), 2 ) );
532
+
533
+ // set compression quality
534
+ if ( $mime['type'] === 'image/jpeg' ) {
535
+ $image->setImageCompressionQuality( $options['watermark_image']['quality'] );
536
+ $image->setImageCompression( imagick::COMPRESSION_JPEG );
537
+ } else
538
+ $image->setImageCompressionQuality( $options['watermark_image']['quality'] );
539
+
540
+ // set image output to progressive
541
+ if ( $options['watermark_image']['jpeg_format'] === 'progressive' )
542
+ $image->setImageInterlaceScheme( Imagick::INTERLACE_PLANE );
543
+
544
+ // get image dimensions
545
+ $image_dim = $image->getImageGeometry();
546
+
547
+ // get watermark dimensions
548
+ $watermark_dim = $watermark->getImageGeometry();
549
+
550
+ // calculate watermark new dimensions
551
+ list( $width, $height ) = $this->calculate_watermark_dimensions( $image_dim['width'], $image_dim['height'], $watermark_dim['width'], $watermark_dim['height'], $options );
552
+
553
+ // resize watermark
554
+ $watermark->resizeImage( $width, $height, imagick::FILTER_CATROM, 1 );
555
+
556
+ // calculate image coordinates
557
+ list( $dest_x, $dest_y ) = $this->calculate_image_coordinates( $image_dim['width'], $image_dim['height'], $width, $height, $options );
558
+
559
+ // combine two images together
560
+ $image->compositeImage( $watermark, Imagick::COMPOSITE_OVERLAY, $dest_x, $dest_y, Imagick::CHANNEL_ALL );
561
+
562
+ // save watermarked image
563
+ $image->writeImage( $image_path );
564
+
565
+ // clear image memory
566
+ $image->clear();
567
+ $image->destroy();
568
+ $image = null;
569
+
570
+ // clear watermark memory
571
+ $watermark->clear();
572
+ $watermark->destroy();
573
+ $watermark = null;
574
+ // gd extension
575
+ } else {
576
+ // get image resource
577
+ $image = load_image_to_edit( $attachment_id, $mime['type'], $image_size );
578
+
579
+ if ( $image !== false ) {
580
+ // add watermark image to image
581
+ $image = $this->add_watermark_image( $image, $options, $upload_dir );
582
+
583
+ if ( $image !== false ) {
584
+ // save watermarked image
585
+ $this->save_image_file( $image, $mime['type'], $image_path, $options['watermark_image']['quality'] );
586
+
587
+ // clear watermark memory
588
+ imagedestroy( $image );
589
+
590
+ $image = null;
591
+ }
592
+ }
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Calculate watermark dimensions.
598
+ *
599
+ * @param $image_width Image width
600
+ * @param $image_height Image height
601
+ * @param $watermark_width Watermark width
602
+ * @param $watermark_height Watermark height
603
+ * @param $options Options
604
+ * @return array Watermark new dimensions
605
+ */
606
+ private function calculate_watermark_dimensions( $image_width, $image_height, $watermark_width, $watermark_height, $options ) {
607
+ // custom
608
+ if ( $options['watermark_image']['watermark_size_type'] === 1 ) {
609
+ $width = $options['watermark_image']['absolute_width'];
610
+ $height = $options['watermark_image']['absolute_height'];
611
+ // scale
612
+ } elseif ( $options['watermark_image']['watermark_size_type'] === 2 ) {
613
+ $ratio = $image_width * $options['watermark_image']['width'] / 100 / $watermark_width;
614
+
615
+ $width = (int) ( $watermark_width * $ratio );
616
+ $height = (int) ( $watermark_height * $ratio );
617
+
618
+ // if watermark scaled height is bigger then image watermark
619
+ if ( $height > $image_height ) {
620
+ $width = (int) ( $image_height * $width / $height );
621
+ $height = $image_height;
622
+ }
623
+ // original
624
+ } else {
625
+ $width = $watermark_width;
626
+ $height = $watermark_height;
627
+ }
628
+
629
+ return array( $width, $height );
630
+ }
631
+
632
+ /**
633
+ * Calculate image coordinates for watermark.
634
+ *
635
+ * @param $image_width Image width
636
+ * @param $image_height Image height
637
+ * @param $watermark_width Watermark width
638
+ * @param $watermark_height Watermark height
639
+ * @param $options Options
640
+ * @return array Image coordinates
641
+ */
642
+ private function calculate_image_coordinates( $image_width, $image_height, $watermark_width, $watermark_height, $options ) {
643
+ switch ( $options['watermark_image']['position'] ) {
644
+ case 'top_left':
645
+ $dest_x = $dest_y = 0;
646
+ break;
647
+
648
+ case 'top_center':
649
+ $dest_x = ( $image_width / 2 ) - ( $watermark_width / 2 );
650
+ $dest_y = 0;
651
+ break;
652
+
653
+ case 'top_right':
654
+ $dest_x = $image_width - $watermark_width;
655
+ $dest_y = 0;
656
+ break;
657
+
658
+ case 'middle_left':
659
+ $dest_x = 0;
660
+ $dest_y = ( $image_height / 2 ) - ( $watermark_height / 2 );
661
+ break;
662
+
663
+ case 'middle_right':
664
+ $dest_x = $image_width - $watermark_width;
665
+ $dest_y = ( $image_height / 2 ) - ( $watermark_height / 2 );
666
+ break;
667
+
668
+ case 'bottom_left':
669
+ $dest_x = 0;
670
+ $dest_y = $image_height - $watermark_height;
671
+ break;
672
+
673
+ case 'bottom_center':
674
+ $dest_x = ( $image_width / 2 ) - ( $watermark_width / 2 );
675
+ $dest_y = $image_height - $watermark_height;
676
+ break;
677
+
678
+ case 'bottom_right':
679
+ $dest_x = $image_width - $watermark_width;
680
+ $dest_y = $image_height - $watermark_height;
681
+ break;
682
+
683
+ case 'middle_center':
684
+ default:
685
+ $dest_x = ( $image_width / 2 ) - ( $watermark_width / 2 );
686
+ $dest_y = ( $image_height / 2 ) - ( $watermark_height / 2 );
687
+ }
688
+
689
+ $dest_x += $options['watermark_image']['offset_width'];
690
+ $dest_y += $options['watermark_image']['offset_height'];
691
+
692
+ return array( $dest_x, $dest_y );
693
+ }
694
+
695
+ /**
696
+ * Add watermark image to image.
697
+ *
698
+ * @param resource $image Image resource
699
+ * @param array $options Plugin options
700
+ * @param array $upload_dir WP upload dir data
701
+ * @return resource Watermarked image
702
+ */
703
+ private function add_watermark_image( $image, $options, $upload_dir ) {
704
+ $watermark_file = wp_get_attachment_metadata( $options['watermark_image']['url'], true );
705
+ $url = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $watermark_file['file'];
706
+ $watermark_file_info = getimagesize( $url );
707
+
708
+ switch ( $watermark_file_info['mime'] ) {
709
+ case 'image/jpeg':
710
+ case 'image/pjpeg':
711
+ $watermark = imagecreatefromjpeg( $url );
712
+ break;
713
+
714
+ case 'image/gif':
715
+ $watermark = imagecreatefromgif( $url );
716
+ break;
717
+
718
+ case 'image/png':
719
+ $watermark = imagecreatefrompng( $url );
720
+ break;
721
+
722
+ default:
723
+ return false;
724
+ }
725
+
726
+ // get image dimensions
727
+ $image_width = imagesx( $image );
728
+ $image_height = imagesy( $image );
729
+
730
+ // calculate watermark new dimensions
731
+ list( $w, $h ) = $this->calculate_watermark_dimensions( $image_width, $image_height, imagesx( $watermark ), imagesy( $watermark ), $options );
732
+
733
+ // calculate image coordinates
734
+ list( $dest_x, $dest_y ) = $this->calculate_image_coordinates( $image_width, $image_height, $w, $h, $options );
735
+
736
+ // combine two images together
737
+ $this->imagecopymerge_alpha( $image, $this->resize( $watermark, $w, $h, $watermark_file_info ), $dest_x, $dest_y, 0, 0, $w, $h, $options['watermark_image']['transparent'] );
738
+
739
+ if ( $options['watermark_image']['jpeg_format'] === 'progressive' )
740
+ imageinterlace( $image, true );
741
+
742
+ return $image;
743
+ }
744
+
745
+ /**
746
+ * Create new image function.
747
+ *
748
+ * @param resource $dst_im
749
+ * @param resource $src_im
750
+ * @param int $dst_x
751
+ * @param int $dst_y
752
+ * @param int $src_x
753
+ * @param int $src_y
754
+ * @param int $src_w
755
+ * @param int $src_h
756
+ * @param int $pct
757
+ */
758
+ private function imagecopymerge_alpha( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct ) {
759
+ // create a cut resource
760
+ $cut = imagecreatetruecolor( $src_w, $src_h );
761
+
762
+ // copy relevant section from background to the cut resource
763
+ imagecopy( $cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h );
764
+
765
+ // copy relevant section from watermark to the cut resource
766
+ imagecopy( $cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h );
767
+
768
+ // insert cut resource to destination image
769
+ imagecopymerge( $dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct );
770
+ }
771
+
772
+ /**
773
+ * Resize image.
774
+ *
775
+ * @param resource $image Image resource
776
+ * @param int $width Image width
777
+ * @param int $height Image height
778
+ * @param array $info Image data
779
+ * @return resource Resized image
780
+ */
781
+ private function resize( $image, $width, $height, $info ) {
782
+ $new_image = imagecreatetruecolor( $width, $height );
783
+
784
+ // check if this image is PNG, then set if transparent
785
+ if ( $info[2] === 3 ) {
786
+ imagealphablending( $new_image, false );
787
+ imagesavealpha( $new_image, true );
788
+ imagefilledrectangle( $new_image, 0, 0, $width, $height, imagecolorallocatealpha( $new_image, 255, 255, 255, 127 ) );
789
+ }
790
+
791
+ imagecopyresampled( $new_image, $image, 0, 0, 0, 0, $width, $height, $info[0], $info[1] );
792
+
793
+ return $new_image;
794
+ }
795
+
796
+ /**
797
+ * Save image from image resource.
798
+ *
799
+ * @param resource $image Image resource
800
+ * @param string $mime_type Image mime type
801
+ * @param string $filepath Path where image should be saved
802
+ * @return void
803
+ */
804
+ private function save_image_file( $image, $mime_type, $filepath, $quality ) {
805
+ switch ( $mime_type ) {
806
+ case 'image/jpeg':
807
+ case 'image/pjpeg':
808
+ imagejpeg( $image, $filepath, $quality );
809
+ break;
810
+
811
+ case 'image/png':
812
+ imagepng( $image, $filepath, (int) round( 9 - ( 9 * $quality / 100 ), 0 ) );
813
+ break;
814
+ }
815
+ }
816
+
817
+ /**
818
+ * Add links to Support Forum.
819
+ *
820
+ * @param array $links
821
+ * @param string $file
822
+ * @return array
823
+ */
824
+ public function plugin_extend_links( $links, $file ) {
825
+ if ( ! current_user_can( 'install_plugins' ) )
826
+ return $links;
827
+
828
+ $plugin = plugin_basename( __FILE__ );
829
+
830
+ if ( $file == $plugin ) {
831
+ return array_merge(
832
+ $links, array( sprintf( '<a href="http://www.dfactory.eu/support/forum/image-watermark/" target="_blank">%s</a>', __( 'Support', 'image-watermark' ) ) )
833
+ );
834
+ }
835
+
836
+ return $links;
837
+ }
838
+
839
+ /**
840
+ * Add links to Settings page.
841
+ *
842
+ * @param array $links
843
+ * @param string $file
844
+ * @return array
845
+ */
846
+ function plugin_settings_link( $links, $file ) {
847
+ if ( ! is_admin() || ! current_user_can( 'manage_options' ) )
848
+ return $links;
849
+
850
+ static $plugin;
851
+
852
+ $plugin = plugin_basename( __FILE__ );
853
+
854
+ if ( $file == $plugin ) {
855
+ $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php' ) . '?page=watermark-options', __( 'Settings', 'image-watermark' ) );
856
+ array_unshift( $links, $settings_link );
857
+ }
858
+
859
+ return $links;
860
+ }
861
+ }
862
+
863
+
864
+ /**
865
+ * Get instance of main class.
866
+ *
867
+ * @return object Instance
868
+ */
869
+ function Image_Watermark() {
870
+ static $instance;
871
+
872
+ // first call to instance() initializes the plugin
873
+ if ( $instance === null || ! ( $instance instanceof Image_Watermark ) )
874
+ $instance = Image_Watermark::instance();
875
+
876
+ return $instance;
877
+ }
878
+
879
+ Image_Watermark();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-settings.php ADDED
@@ -0,0 +1,580 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // exit if accessed directly
3
+ if ( ! defined( 'ABSPATH' ) )
4
+ exit;
5
+
6
+ new Image_Watermark_Settings( );
7
+
8
+ class Image_Watermark_Settings {
9
+
10
+ private $image_sizes = array();
11
+
12
+ private $watermark_positions = array(
13
+ 'x' => array( 'left', 'center', 'right' ),
14
+ 'y' => array( 'top', 'middle', 'bottom' )
15
+ );
16
+
17
+ /**
18
+ *
19
+ */
20
+ public function __construct( ) {
21
+ // actions
22
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
23
+ add_action( 'admin_menu', array( $this, 'options_page' ) );
24
+ add_action( 'wp_loaded', array( $this, 'load_image_sizes' ) );
25
+ }
26
+
27
+ /**
28
+ * Load available image sizes.
29
+ */
30
+ public function load_image_sizes() {
31
+ $this->image_sizes = get_intermediate_image_sizes();
32
+ $this->image_sizes[] = 'full';
33
+
34
+ sort( $this->image_sizes, SORT_STRING );
35
+ }
36
+
37
+ /**
38
+ * Get post types.
39
+ */
40
+ private function get_post_types() {
41
+ return array_merge( array( 'post', 'page' ), get_post_types( array( '_builtin' => false ), 'names' ) );
42
+ }
43
+
44
+ /**
45
+ * Register settings.
46
+ */
47
+ public function register_settings() {
48
+ register_setting( 'image_watermark_options', 'image_watermark_options', array( $this, 'validate_options' ) );
49
+
50
+ // general
51
+ add_settings_section( 'image_watermark_general', __( 'General settings', 'image-watermark' ), '', 'image_watermark_options' );
52
+ add_settings_field( 'iw_automatic_watermarking', __( 'Automatic watermarking', 'image-watermark' ), array( $this, 'iw_automatic_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
53
+ add_settings_field( 'iw_manual_watermarking', __( 'Manual watermarking', 'image-watermark' ), array( $this, 'iw_manual_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
54
+ add_settings_field( 'iw_enable_for', __( 'Enable watermark for', 'image-watermark' ), array( $this, 'iw_enable_for' ), 'image_watermark_options', 'image_watermark_general' );
55
+ add_settings_field( 'iw_frontend_watermarking', __( 'Frontend watermarking', 'image-watermark' ), array( $this, 'iw_frontend_watermarking' ), 'image_watermark_options', 'image_watermark_general' );
56
+ add_settings_field( 'iw_deactivation', __( 'Deactivation', 'image-watermark' ), array( $this, 'iw_deactivation' ), 'image_watermark_options', 'image_watermark_general' );
57
+
58
+ // watermark position
59
+ add_settings_section( 'image_watermark_position', __( 'Watermark position', 'image-watermark' ), '', 'image_watermark_options' );
60
+ add_settings_field( 'iw_alignment', __( 'Watermark alignment', 'image-watermark' ), array( $this, 'iw_alignment' ), 'image_watermark_options', 'image_watermark_position' );
61
+ add_settings_field( 'iw_offset', __( 'Watermark offset', 'image-watermark' ), array( $this, 'iw_offset' ), 'image_watermark_options', 'image_watermark_position' );
62
+
63
+ // watermark image
64
+ add_settings_section( 'image_watermark_image', __( 'Watermark image', 'image-watermark' ), '', 'image_watermark_options' );
65
+ add_settings_field( 'iw_watermark_image', __( 'Watermark image', 'image-watermark' ), array( $this, 'iw_watermark_image' ), 'image_watermark_options', 'image_watermark_image' );
66
+ add_settings_field( 'iw_watermark_preview', __( 'Watermark preview', 'image-watermark' ), array( $this, 'iw_watermark_preview' ), 'image_watermark_options', 'image_watermark_image' );
67
+ add_settings_field( 'iw_watermark_size', __( 'Watermark size', 'image-watermark' ), array( $this, 'iw_watermark_size' ), 'image_watermark_options', 'image_watermark_image' );
68
+ add_settings_field( 'iw_watermark_size_custom', __( 'Watermark custom size', 'image-watermark' ), array( $this, 'iw_watermark_size_custom' ), 'image_watermark_options', 'image_watermark_image' );
69
+ add_settings_field( 'iw_watermark_size_scaled', __( 'Scale of watermark in relation to image width', 'image-watermark' ), array( $this, 'iw_watermark_size_scaled' ), 'image_watermark_options', 'image_watermark_image' );
70
+ add_settings_field( 'iw_watermark_opacity', __( 'Watermark transparency / opacity', 'image-watermark' ), array( $this, 'iw_watermark_opacity' ), 'image_watermark_options', 'image_watermark_image' );
71
+ add_settings_field( 'iw_image_quality', __( 'Image quality', 'image-watermark' ), array( $this, 'iw_image_quality' ), 'image_watermark_options', 'image_watermark_image' );
72
+ add_settings_field( 'iw_image_format', __( 'Image format', 'image-watermark' ), array( $this, 'iw_image_format' ), 'image_watermark_options', 'image_watermark_image' );
73
+
74
+ // watermark protection
75
+ add_settings_section( 'image_watermark_protection', __( 'Image protection', 'image-watermark' ), '', 'image_watermark_options' );
76
+ add_settings_field( 'iw_protection_right_click', __( 'Right click', 'image-watermark' ), array( $this, 'iw_protection_right_click' ), 'image_watermark_options', 'image_watermark_protection' );
77
+ add_settings_field( 'iw_protection_drag_drop', __( 'Drag and drop', 'image-watermark' ), array( $this, 'iw_protection_drag_drop' ), 'image_watermark_options', 'image_watermark_protection' );
78
+ add_settings_field( 'iw_protection_logged', __( 'Logged-in users', 'image-watermark' ), array( $this, 'iw_protection_logged' ), 'image_watermark_options', 'image_watermark_protection' );
79
+ }
80
+
81
+ /**
82
+ * Create options page in menu.
83
+ */
84
+ public function options_page() {
85
+ add_options_page(
86
+ __( 'Image Watermark Options', 'image-watermark' ), __( 'Watermark', 'image-watermark' ), 'manage_options', 'watermark-options', array( $this, 'options_page_output' )
87
+ );
88
+ }
89
+
90
+ /**
91
+ * Options page output.
92
+ */
93
+ public function options_page_output() {
94
+
95
+ if ( ! current_user_can( 'manage_options' ) )
96
+ return;
97
+
98
+ echo '
99
+ <div class="wrap">
100
+ <h2>' . __( 'Image Watermark', 'image-watermark' ) . '</h2>';
101
+
102
+ echo '
103
+ <div class="image-watermark-settings">
104
+ <div class="df-sidebar">
105
+ <div class="df-credits">
106
+ <h3 class="hndle">' . __( 'Image Watermark', 'image-watermark' ) . ' ' . Image_Watermark()->defaults['version'] . '</h3>
107
+ <div class="inside">
108
+ <h4 class="inner">' . __( 'Need support?', 'image-watermark' ) . '</h4>
109
+ <p class="inner">' . __( 'If you are having problems with this plugin, checkout plugin', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/docs/image-watermark-plugin/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=documentation" target="_blank" title="' . __( 'Documentation', 'image-watermark' ) . '">' . __( 'Documentation', 'image-watermark' ) . '</a> ' . __( 'or talk about them in the', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/support/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=support" target="_blank" title="' . __( 'Support forum', 'image-watermark' ) . '">' . __( 'Support forum', 'image-watermark' ) . '</a></p>
110
+ <hr />
111
+ <h4 class="inner">' . __( 'Do you like this plugin?', 'image-watermark' ) . '</h4>
112
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" class="inner">
113
+ <input type="hidden" name="cmd" value="_s-xclick">
114
+ <input type="hidden" name="hosted_button_id" value="DCF3AXC9A5A88">
115
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
116
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
117
+ </form>
118
+ <p class="inner"><a href="http://wordpress.org/support/view/plugin-reviews/image-watermark" target="_blank" title="' . __( 'Rate it 5', 'image-watermark' ) . '">' . __( 'Rate it 5', 'image-watermark' ) . '</a> ' . __( 'on WordPress.org', 'image-watermark' ) . '<br />' .
119
+ __( 'Blog about it & link to the', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/plugins/image-watermark/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=blog-about" target="_blank" title="' . __( 'plugin page', 'image-watermark' ) . '">' . __( 'plugin page', 'image-watermark' ) . '</a><br />' .
120
+ __( 'Check out our other', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/plugins/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=other-plugins" target="_blank" title="' . __( 'WordPress plugins', 'image-watermark' ) . '">' . __( 'WordPress plugins', 'image-watermark' ) . '</a>
121
+ </p>
122
+ <hr />
123
+ <p class="df-link inner">' . __( 'Created by', 'image-watermark' ) . ' <a href="http://www.dfactory.eu/?utm_source=image-watermark-settings&utm_medium=link&utm_campaign=created-by" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="' . plugins_url( '/images/logo-dfactory.png', __FILE__ ) . '" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress" /></a></p>
124
+ </div>
125
+ </div>
126
+ <form action="options.php" method="post">';
127
+
128
+ settings_fields( 'image_watermark_options' );
129
+ do_settings_sections( 'image_watermark_options' );
130
+
131
+ echo '
132
+ <p class="submit">';
133
+ submit_button( '', 'primary', 'save_image_watermark_options', false );
134
+
135
+ echo ' ';
136
+
137
+ submit_button( __( 'Reset to defaults', 'image-watermark' ), 'secondary', 'reset_image_watermark_options', false );
138
+
139
+ echo '
140
+ </p>
141
+ </form>
142
+ </div>
143
+ <div class="clear"></div>
144
+ </div>';
145
+ }
146
+
147
+ /**
148
+ * Validate options.
149
+ *
150
+ * @param array $input
151
+ * @return array
152
+ */
153
+ public function validate_options( $input ) {
154
+
155
+ if ( ! current_user_can( 'manage_options' ) )
156
+ return $input;
157
+
158
+ if ( isset( $_POST['save_image_watermark_options'] ) ) {
159
+
160
+ $input['watermark_image']['plugin_off'] = isset( $_POST['iw_options']['watermark_image']['plugin_off'] ) ? ((bool) $_POST['iw_options']['watermark_image']['plugin_off'] == 1 ? true : false) : Image_Watermark()->defaults['options']['watermark_image']['plugin_off'];
161
+ $input['watermark_image']['manual_watermarking'] = isset( $_POST['iw_options']['watermark_image']['manual_watermarking'] ) ? ((bool) $_POST['iw_options']['watermark_image']['manual_watermarking'] == 1 ? true : false) : Image_Watermark()->defaults['options']['watermark_image']['manual_watermarking'];
162
+
163
+ $watermark_on = array();
164
+
165
+ if ( isset( $_POST['iw_options']['watermark_on'] ) && is_array( $_POST['iw_options']['watermark_on'] ) ) {
166
+ foreach ( $this->image_sizes as $size ) {
167
+ if ( in_array( $size, array_keys( $_POST['iw_options']['watermark_on'] ) ) ) {
168
+ $watermark_on[$size] = 1;
169
+ }
170
+ }
171
+ }
172
+ $input['watermark_on'] = $watermark_on;
173
+
174
+ $input['watermark_cpt_on'] = Image_Watermark()->defaults['options']['watermark_cpt_on'];
175
+
176
+ if ( isset( $_POST['iw_options']['watermark_cpt_on'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_cpt_on'] ), array( 'everywhere', 'specific' ) ) ) {
177
+ if ( $_POST['iw_options']['watermark_cpt_on'] === 'specific' ) {
178
+ if ( isset( $_POST['iw_options']['watermark_cpt_on_type'] ) ) {
179
+ $tmp = array();
180
+
181
+ foreach ( $this->get_post_types() as $cpt ) {
182
+ if ( in_array( $cpt, array_keys( $_POST['iw_options']['watermark_cpt_on_type'] ) ) ) {
183
+ $tmp[$cpt] = 1;
184
+ }
185
+ }
186
+
187
+ if ( count( $tmp ) > 0 ) {
188
+ $input['watermark_cpt_on'] = $tmp;
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ $input['watermark_image']['frontend_active'] = isset( $_POST['iw_options']['watermark_image']['frontend_active'] ) ? ((bool) $_POST['iw_options']['watermark_image']['frontend_active'] == 1 ? true : false) : Image_Watermark()->defaults['options']['watermark_image']['frontend_active'];
195
+ $input['watermark_image']['deactivation_delete'] = isset( $_POST['iw_options']['watermark_image']['deactivation_delete'] ) ? ((bool) $_POST['iw_options']['watermark_image']['deactivation_delete'] == 1 ? true : false) : Image_Watermark()->defaults['options']['watermark_image']['deactivation_delete'];
196
+
197
+ $positions = array();
198
+
199
+ foreach ( $this->watermark_positions['y'] as $position_y ) {
200
+ foreach ( $this->watermark_positions['x'] as $position_x ) {
201
+ $positions[] = $position_y . '_' . $position_x;
202
+ }
203
+ }
204
+ $input['watermark_image']['position'] = isset( $_POST['iw_options']['watermark_image']['position'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_image']['position'] ), $positions ) ? esc_attr( $_POST['iw_options']['watermark_image']['position'] ) : Image_Watermark()->defaults['options']['watermark_image']['position'];
205
+
206
+ $input['watermark_image']['offset_width'] = isset( $_POST['iw_options']['watermark_image']['offset_width'] ) ? (int) $_POST['iw_options']['watermark_image']['offset_width'] : Image_Watermark()->defaults['options']['watermark_image']['offset_width'];
207
+ $input['watermark_image']['offset_height'] = isset( $_POST['iw_options']['watermark_image']['offset_height'] ) ? (int) $_POST['iw_options']['watermark_image']['offset_height'] : Image_Watermark()->defaults['options']['watermark_image']['offset_height'];
208
+ $input['watermark_image']['url'] = isset( $_POST['iw_options']['watermark_image']['url'] ) ? (int) $_POST['iw_options']['watermark_image']['url'] : Image_Watermark()->defaults['options']['watermark_image']['url'];
209
+ $input['watermark_image']['watermark_size_type'] = isset( $_POST['iw_options']['watermark_image']['watermark_size_type'] ) ? (int) $_POST['iw_options']['watermark_image']['watermark_size_type'] : Image_Watermark()->defaults['options']['watermark_image']['watermark_size_type'];
210
+ $input['watermark_image']['absolute_width'] = isset( $_POST['iw_options']['watermark_image']['absolute_width'] ) ? (int) $_POST['iw_options']['watermark_image']['absolute_width'] : Image_Watermark()->defaults['options']['watermark_image']['absolute_width'];
211
+ $input['watermark_image']['absolute_height'] = isset( $_POST['iw_options']['watermark_image']['absolute_height'] ) ? (int) $_POST['iw_options']['watermark_image']['absolute_height'] : Image_Watermark()->defaults['options']['watermark_image']['absolute_height'];
212
+ $input['watermark_image']['width'] = isset( $_POST['iw_options']['watermark_image']['width'] ) ? (int) $_POST['iw_options']['watermark_image']['width'] : Image_Watermark()->defaults['options']['watermark_image']['width'];
213
+ $input['watermark_image']['transparent'] = isset( $_POST['iw_options']['watermark_image']['transparent'] ) ? (int) $_POST['iw_options']['watermark_image']['transparent'] : Image_Watermark()->defaults['options']['watermark_image']['transparent'];
214
+ $input['watermark_image']['quality'] = isset( $_POST['iw_options']['watermark_image']['quality'] ) ? (int) $_POST['iw_options']['watermark_image']['quality'] : Image_Watermark()->defaults['options']['watermark_image']['quality'];
215
+ $input['watermark_image']['jpeg_format'] = isset( $_POST['iw_options']['watermark_image']['jpeg_format'] ) && in_array( esc_attr( $_POST['iw_options']['watermark_image']['jpeg_format'] ), array( 'baseline', 'progressive' ) ) ? esc_attr( $_POST['iw_options']['watermark_image']['jpeg_format'] ) : Image_Watermark()->defaults['options']['watermark_image']['jpeg_format'];
216
+
217
+ $input['image_protection']['rightclick'] = isset( $_POST['iw_options']['image_protection']['rightclick'] ) ? ((bool) $_POST['iw_options']['image_protection']['rightclick'] == 1 ? true : false) : Image_Watermark()->defaults['options']['image_protection']['rightclick'];
218
+ $input['image_protection']['draganddrop'] = isset( $_POST['iw_options']['image_protection']['draganddrop'] ) ? ((bool) $_POST['iw_options']['image_protection']['draganddrop'] == 1 ? true : false) : Image_Watermark()->defaults['options']['image_protection']['draganddrop'];
219
+ $input['image_protection']['forlogged'] = isset( $_POST['iw_options']['image_protection']['forlogged'] ) ? ((bool) $_POST['iw_options']['image_protection']['forlogged'] == 1 ? true : false) : Image_Watermark()->defaults['options']['image_protection']['forlogged'];
220
+
221
+ add_settings_error( 'iw_settings_errors', 'iw_settings_saved', __( 'Settings saved.', 'image-watermark' ), 'updated' );
222
+ } elseif ( isset( $_POST['reset_image_watermark_options'] ) ) {
223
+
224
+ $input = Image_Watermark()->defaults['options'];
225
+
226
+ add_settings_error( 'iw_settings_errors', 'iw_settings_reset', __( 'Settings restored to defaults.', 'image-watermark' ), 'updated' );
227
+ }
228
+
229
+ if ( $input['watermark_image']['plugin_off'] != 0 || $input['watermark_image']['manual_watermarking'] != 0 ) {
230
+ if ( empty( $input['watermark_image']['url'] ) )
231
+ add_settings_error( 'iw_settings_errors', 'iw_image_not_set', __( 'Watermark will not be applied when watermark image is not set.', 'image-watermark' ), 'error' );
232
+
233
+ if ( empty( $input['watermark_on'] ) )
234
+ add_settings_error( 'iw_settings_errors', 'iw_sizes_not_set', __( 'Watermark will not be applied when no image sizes are selected.', 'image-watermark' ), 'error' );
235
+ }
236
+
237
+ return $input;
238
+ }
239
+
240
+ /**
241
+ * Automatic watermarking option.
242
+ */
243
+ public function iw_automatic_watermarking() {
244
+ ?>
245
+ <label for="iw_automatic_watermarking">
246
+ <input id="iw_automatic_watermarking" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['watermark_image']['plugin_off'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][plugin_off]">
247
+ <?php echo __( 'Enable watermark for uploaded images.', 'image-watermark' ); ?>
248
+ </label>
249
+ <?php
250
+ }
251
+
252
+ /**
253
+ * Manual watermarking option.
254
+ */
255
+ public function iw_manual_watermarking() {
256
+ ?>
257
+ <label for="iw_manual_watermarking">
258
+ <input id="iw_manual_watermarking" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['watermark_image']['manual_watermarking'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][manual_watermarking]">
259
+ <?php echo __( 'Enable Apply Watermark option for images in Media Library.', 'image-watermark' ); ?>
260
+ </label>
261
+ <?php
262
+ }
263
+
264
+ /**
265
+ * Enable watermark for option.
266
+ */
267
+ public function iw_enable_for() {
268
+ ?>
269
+ <fieldset id="iw_enable_for">
270
+ <div id="thumbnail-select">
271
+ <?php
272
+ foreach ( $this->image_sizes as $image_size ) {
273
+ ?>
274
+ <input name="iw_options[watermark_on][<?php echo $image_size; ?>]" type="checkbox" id="<?php echo $image_size; ?>" value="1" <?php echo (in_array( $image_size, array_keys( Image_Watermark()->options['watermark_on'] ) ) ? ' checked="checked"' : ''); ?> />
275
+ <label for="<?php echo $image_size; ?>"><?php echo $image_size; ?></label>
276
+ <?php
277
+ }
278
+ ?>
279
+ </div>
280
+ <p class="description">
281
+ <?php echo __( 'Check image sizes on which watermark should appear.<br /><strong>IMPORTANT:</strong> checking full size is NOT recommended as it\'s the original image. You may need it later - for removing or changing watermark, image sizes regeneration or any other image manipulations. Use it only if you know what you are doing.', 'image-watermark' ); ?>
282
+ </p>
283
+
284
+ <?php
285
+ $watermark_cpt_on = array_keys( Image_Watermark()->options['watermark_cpt_on'] );
286
+
287
+ if ( in_array( 'everywhere', $watermark_cpt_on ) && count( $watermark_cpt_on ) === 1 ) {
288
+ $first_checked = true;
289
+ $second_checked = false;
290
+ $watermark_cpt_on = array();
291
+ } else {
292
+ $first_checked = false;
293
+ $second_checked = true;
294
+ }
295
+ ?>
296
+
297
+ <div id="cpt-specific">
298
+ <input id="df_option_everywhere" type="radio" name="iw_options[watermark_cpt_on]" value="everywhere" <?php echo ($first_checked === true ? 'checked="checked"' : ''); ?>/><label for="df_option_everywhere"><?php _e( 'everywhere', 'image-watermark' ); ?></label>
299
+ <input id="df_option_cpt" type="radio" name="iw_options[watermark_cpt_on]" value="specific" <?php echo ($second_checked === true ? 'checked="checked"' : ''); ?> /><label for="df_option_cpt"><?php _e( 'on selected post types only', 'image-watermark' ); ?></label>
300
+ </div>
301
+
302
+ <div id="cpt-select" <?php echo ($second_checked === false ? 'style="display: none;"' : ''); ?>>
303
+ <?php
304
+ foreach ( $this->get_post_types() as $cpt ) {
305
+ ?>
306
+ <input name="iw_options[watermark_cpt_on_type][<?php echo $cpt; ?>]" type="checkbox" id="<?php echo $cpt; ?>" value="1" <?php echo (in_array( $cpt, $watermark_cpt_on ) ? ' checked="checked"' : ''); ?> />
307
+ <label for="<?php echo $cpt; ?>"><?php echo $cpt; ?></label>
308
+ <?php
309
+ }
310
+ ?>
311
+ </div>
312
+
313
+ <p class="description"><?php echo __( 'Check custom post types on which watermark should be applied to uploaded images.', 'image-watermark' ); ?></p>
314
+ </fieldset>
315
+ <?php
316
+ }
317
+
318
+ /**
319
+ * Frontend watermarking option.
320
+ */
321
+ public function iw_frontend_watermarking() {
322
+ ?>
323
+ <label for="iw_frontend_watermarking">
324
+ <input id="iw_frontend_watermarking" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['watermark_image']['frontend_active'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][frontend_active]">
325
+ <?php echo __( 'Enable frontend image uploading. (uploading script is not included, but you may use a plugin or custom code).', 'image-watermark' ); ?>
326
+ </label>
327
+ <span class="description"><?php echo __( '<br /><strong>Notice:</strong> This functionality works only if uploaded images are processed using WordPress native upload methods.', 'image-watermark' ); ?></span>
328
+ <?php
329
+ }
330
+
331
+ /**
332
+ * Remove data on deactivation option.
333
+ */
334
+ public function iw_deactivation() {
335
+ ?>
336
+ <label for="iw_deactivation">
337
+ <input id="iw_deactivation" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['watermark_image']['deactivation_delete'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[watermark_image][deactivation_delete]">
338
+ <?php echo __( 'Delete all database settings on plugin deactivation.', 'image-watermark' ); ?>
339
+ </label>
340
+ <?php
341
+ }
342
+
343
+ /**
344
+ * Watermark alignment option.
345
+ */
346
+ public function iw_alignment() {
347
+ ?>
348
+ <fieldset id="iw_alignment">
349
+ <table id="watermark_position" border="1">
350
+ <?php
351
+ $watermark_position = Image_Watermark()->options['watermark_image']['position'];
352
+
353
+ foreach ( $this->watermark_positions['y'] as $y ) {
354
+ ?>
355
+ <tr>
356
+ <?php
357
+ foreach ( $this->watermark_positions['x'] as $x ) {
358
+ ?>
359
+ <td title="<?php echo ucfirst( $y . ' ' . $x ); ?>">
360
+ <input name="iw_options[watermark_image][position]" type="radio" value="<?php echo $y . '_' . $x; ?>"<?php echo ($watermark_position == $y . '_' . $x ? ' checked="checked"' : NULL); ?> />
361
+ </td>
362
+ <?php }
363
+ ?>
364
+ </tr>
365
+ <?php
366
+ }
367
+ ?>
368
+ </table>
369
+ <p class="description"><?php echo __( 'Choose the position of watermark image.', 'image-watermark' ); ?></p>
370
+ </fieldset>
371
+ <?php
372
+ }
373
+
374
+ /**
375
+ * Watermark offset option.
376
+ */
377
+ public function iw_offset() {
378
+ ?>
379
+ <fieldset id="iw_offset">
380
+ <?php echo __( 'x:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][offset_width]" value="<?php echo Image_Watermark()->options['watermark_image']['offset_width']; ?>"> <?php echo __( 'px', 'image-watermark' ); ?>
381
+ <br />
382
+ <?php echo __( 'y:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][offset_height]" value="<?php echo Image_Watermark()->options['watermark_image']['offset_height']; ?>"> <?php echo __( 'px', 'image-watermark' ); ?>
383
+ </fieldset>
384
+ <?php
385
+ }
386
+
387
+ /**
388
+ * Watermark image option.
389
+ */
390
+ public function iw_watermark_image() {
391
+ if ( Image_Watermark()->options['watermark_image']['url'] !== NULL && Image_Watermark()->options['watermark_image']['url'] != 0 ) {
392
+ $image = wp_get_attachment_image_src( Image_Watermark()->options['watermark_image']['url'], array( 300, 300 ), false );
393
+ $image_selected = true;
394
+ } else {
395
+ $image_selected = false;
396
+ }
397
+ ?>
398
+ <div class="iw_watermark_image">
399
+ <input id="upload_image" type="hidden" name="iw_options[watermark_image][url]" value="<?php echo (int) Image_Watermark()->options['watermark_image']['url']; ?>" />
400
+ <input id="upload_image_button" type="button" class="button button-secondary" value="<?php echo __( 'Select image', 'image-watermark' ); ?>" />
401
+ <input id="turn_off_image_button" type="button" class="button button-secondary" value="<?php echo __( 'Remove image', 'image-watermark' ); ?>" <?php if ( $image_selected === false ) echo 'disabled="disabled"'; ?>/>
402
+ <p class="description"><?php _e( 'You have to save changes after the selection or removal of the image.', 'image-watermark' ); ?></p>
403
+ </div>
404
+ <?php
405
+ }
406
+
407
+ /**
408
+ * Watermark image preview.
409
+ */
410
+ public function iw_watermark_preview() {
411
+ if ( Image_Watermark()->options['watermark_image']['url'] !== NULL && Image_Watermark()->options['watermark_image']['url'] != 0 ) {
412
+ $image = wp_get_attachment_image_src( Image_Watermark()->options['watermark_image']['url'], array( 300, 300 ), false );
413
+ $image_selected = true;
414
+ } else
415
+ $image_selected = false;
416
+ ?>
417
+ <fieldset id="iw_watermark_preview">
418
+ <div id="previewImg_imageDiv">
419
+ <?php
420
+ if ( $image_selected ) {
421
+ $image = wp_get_attachment_image_src( Image_Watermark()->options['watermark_image']['url'], array( 300, 300 ), false );
422
+ ?>
423
+ <img id="previewImg_image" src="<?php echo $image[0]; ?>" alt="" width="300" />
424
+ <?php } else { ?>
425
+ <img id="previewImg_image" src="" alt="" width="300" style="display: none;" />
426
+ <?php }
427
+ ?>
428
+ </div>
429
+ <p id="previewImageInfo" class="description">
430
+ <?php
431
+ if ( ! $image_selected ) {
432
+ _e( 'Watermak has not been selected yet.', 'image-watermark' );
433
+ } else {
434
+ $image_full_size = wp_get_attachment_image_src( Image_Watermark()->options['watermark_image']['url'], 'full', false );
435
+
436
+ echo __( 'Original size', 'image-watermark' ) . ': ' . $image_full_size[1] . ' ' . __( 'px', 'image-watermark' ) . ' / ' . $image_full_size[2] . ' ' . __( 'px', 'image-watermark' );
437
+ }
438
+ ?>
439
+ </p>
440
+ </fieldset>
441
+ <?php
442
+ }
443
+
444
+ /**
445
+ * Watermark size option.
446
+ */
447
+ public function iw_watermark_size() {
448
+ ?>
449
+ <fieldset id="iw_watermark_size">
450
+ <div id="watermark-type">
451
+ <label for="type1"><?php _e( 'original', 'image-watermark' ); ?></label>
452
+ <input type="radio" id="type1" value="0" name="iw_options[watermark_image][watermark_size_type]" <?php checked( Image_Watermark()->options['watermark_image']['watermark_size_type'], 0, true ); ?> />
453
+ <label for="type2"><?php _e( 'custom', 'image-watermark' ); ?></label>
454
+ <input type="radio" id="type2" value="1" name="iw_options[watermark_image][watermark_size_type]" <?php checked( Image_Watermark()->options['watermark_image']['watermark_size_type'], 1, true ); ?> />
455
+ <label for="type3"><?php _e( 'scaled', 'image-watermark' ); ?></label>
456
+ <input type="radio" id="type3" value="2" name="iw_options[watermark_image][watermark_size_type]" <?php checked( Image_Watermark()->options['watermark_image']['watermark_size_type'], 2, true ); ?> />
457
+ </div>
458
+ <p class="description"><?php _e( 'Select method of aplying watermark size.', 'image-watermark' ); ?></p>
459
+ </fieldset>
460
+ <?php
461
+ }
462
+
463
+ /**
464
+ * Watermark custom size option.
465
+ */
466
+ public function iw_watermark_size_custom() {
467
+ ?>
468
+ <fieldset id="iw_watermark_size_custom">
469
+ <?php _e( 'x:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][absolute_width]" value="<?php echo Image_Watermark()->options['watermark_image']['absolute_width']; ?>"> <?php _e( 'px', 'image-watermark' ); ?>
470
+ <br />
471
+ <?php _e( 'y:', 'image-watermark' ); ?> <input type="text" size="5" name="iw_options[watermark_image][absolute_height]" value="<?php echo Image_Watermark()->options['watermark_image']['absolute_height']; ?>"> <?php _e( 'px', 'image-watermark' ); ?>
472
+ </fieldset>
473
+ <p class="description"><?php _e( 'Those dimensions will be used if "custom" method is selected above.', 'image-watermark' ); ?></p>
474
+ <?php
475
+ }
476
+
477
+ /**
478
+ * Watermark scaled size option.
479
+ */
480
+ public function iw_watermark_size_scaled() {
481
+ ?>
482
+ <fieldset id="iw_watermark_size_scaled">
483
+ <div>
484
+ <input type="text" id="iw_size_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][width]" value="<?php echo Image_Watermark()->options['watermark_image']['width']; ?>" />
485
+ <div class="wplike-slider">
486
+ <span class="left hide-if-no-js">0</span><span class="middle" id="iw_size_span" title="<?php echo Image_Watermark()->options['watermark_image']['width']; ?>"></span><span class="right hide-if-no-js">100</span>
487
+ </div>
488
+ </div>
489
+ </fieldset>
490
+ <p class="description"><?php _e( 'This value will be used if "scaled" method if selected above. <br />Enter a number ranging from 0 to 100. 100 makes width of watermark image equal to width of the image it is applied to.', 'image-watermark' ); ?></p>
491
+ <?php
492
+ }
493
+
494
+ /**
495
+ * Watermark custom size option.
496
+ */
497
+ public function iw_watermark_opacity() {
498
+ ?>
499
+ <fieldset id="iw_watermark_opacity">
500
+ <div>
501
+ <input type="text" id="iw_opacity_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][transparent]" value="<?php echo Image_Watermark()->options['watermark_image']['transparent']; ?>" />
502
+ <div class="wplike-slider">
503
+ <span class="left hide-if-no-js">0</span><span class="middle" id="iw_opacity_span" title="<?php echo Image_Watermark()->options['watermark_image']['transparent']; ?>"></span><span class="right hide-if-no-js">100</span>
504
+ </div>
505
+ </div>
506
+ </fieldset>
507
+ <p class="description"><?php _e( 'Enter a number ranging from 0 to 100. 0 makes watermark image completely transparent, 100 shows it as is.', 'image-watermark' ); ?></p>
508
+ <?php
509
+ }
510
+
511
+ /**
512
+ * Image quality option.
513
+ */
514
+ public function iw_image_quality() {
515
+ ?>
516
+ <fieldset id="iw_image_quality">
517
+ <div>
518
+ <input type="text" id="iw_quality_input" maxlength="3" class="hide-if-js" name="iw_options[watermark_image][quality]" value="<?php echo Image_Watermark()->options['watermark_image']['quality']; ?>" />
519
+ <div class="wplike-slider">
520
+ <span class="left hide-if-no-js">0</span><span class="middle" id="iw_quality_span" title="<?php echo Image_Watermark()->options['watermark_image']['quality']; ?>"></span><span class="right hide-if-no-js">100</span>
521
+ </div>
522
+ </div>
523
+ </fieldset>
524
+ <p class="description"><?php _e( 'Set output image quality.', 'image-watermark' ); ?></p>
525
+ <?php
526
+ }
527
+
528
+ /**
529
+ * Image format option.
530
+ */
531
+ public function iw_image_format() {
532
+ ?>
533
+ <fieldset id="iw_image_format">
534
+ <div id="jpeg-format">
535
+ <label for="baseline"><?php _e( 'baseline', 'image-watermark' ); ?></label>
536
+ <input type="radio" id="baseline" value="baseline" name="iw_options[watermark_image][jpeg_format]" <?php checked( Image_Watermark()->options['watermark_image']['jpeg_format'], 'baseline', true ); ?> />
537
+ <label for="progressive"><?php _e( 'progressive', 'image-watermark' ); ?></label>
538
+ <input type="radio" id="progressive" value="progressive" name="iw_options[watermark_image][jpeg_format]" <?php checked( Image_Watermark()->options['watermark_image']['jpeg_format'], 'progressive', true ); ?> />
539
+ </div>
540
+ </fieldset>
541
+ <p class="description"><?php _e( 'Select baseline or progressive image format.', 'image-watermark' ); ?></p>
542
+ <?php
543
+ }
544
+
545
+ /**
546
+ * Right click image protection option.
547
+ */
548
+ public function iw_protection_right_click() {
549
+ ?>
550
+ <label for="iw_protection_right_click">
551
+ <input id="iw_protection_right_click" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['image_protection']['rightclick'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][rightclick]">
552
+ <?php _e( 'Disable right mouse click on images', 'image-watermark' ); ?>
553
+ </label>
554
+ <?php
555
+ }
556
+
557
+ /**
558
+ * Drag and drop image protection option.
559
+ */
560
+ public function iw_protection_drag_drop() {
561
+ ?>
562
+ <label for="iw_protection_drag_drop">
563
+ <input id="iw_protection_drag_drop" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['image_protection']['draganddrop'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][draganddrop]">
564
+ <?php _e( 'Prevent drag and drop', 'image-watermark' ); ?>
565
+ </label>
566
+ <?php
567
+ }
568
+
569
+ /**
570
+ * Logged-in users image protection option.
571
+ */
572
+ public function iw_protection_logged() {
573
+ ?>
574
+ <label for="iw_protection_logged">
575
+ <input id="iw_protection_logged" type="checkbox" <?php checked( ( ! empty( Image_Watermark()->options['image_protection']['forlogged'] ) ? 1 : 0 ), 1, true ); ?> value="1" name="iw_options[image_protection][forlogged]">
576
+ <?php _e( 'Enable image protection for logged-in users also', 'image-watermark' ); ?>
577
+ </label>
578
+ <?php
579
+ }
580
+ }
includes/class-update.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // exit if accessed directly
3
+ if ( ! defined( 'ABSPATH' ) )
4
+ exit;
5
+
6
+ new Image_Watermark_Update( );
7
+
8
+ class Image_Watermark_Update {
9
+
10
+ public function __construct( ) {
11
+ // actions
12
+ add_action( 'admin_init', array( $this, 'check_update' ) );
13
+ }
14
+
15
+ public function check_update() {
16
+ if( ! current_user_can( 'manage_options' ) || ! current_user_can( 'install_plugins' ) )
17
+ return;
18
+
19
+ // gets current database version
20
+ $current_db_version = get_option( 'image_watermark_version', '1.0.0' );
21
+
22
+ // new version?
23
+ if ( version_compare( $current_db_version, Image_Watermark()->defaults['version'], '<' ) ) {
24
+ // update plugin version
25
+ update_option( 'image_watermark_version', Image_Watermark()->defaults['version'] );
26
+ }
27
+ }
28
+ }
js/admin-settings.js CHANGED
@@ -1,55 +1,55 @@
1
- jQuery( document ).ready( function ( $ ) {
2
-
3
- // enable watermark for
4
- $( document ).on( 'change', '#df_option_everywhere, #df_option_cpt', function () {
5
- if ( $( '#cpt-specific input[type=radio]:checked' ).val() === 'everywhere' ) {
6
- $( '#cpt-select' ).fadeOut( 300 );
7
- } else if ( $( '#cpt-specific input[type=radio]:checked' ).val() === 'specific' ) {
8
- $( '#cpt-select' ).fadeIn( 300 );
9
- }
10
- } );
11
-
12
- $( document ).on( 'click', 'input#watermark-reset', function () {
13
- return confirm( iwArgs.resetToDefaults );
14
- } );
15
-
16
- // size slider
17
- $( '#iw_size_span' ).slider( {
18
- value: $( '#iw_size_input' ).val(),
19
- min: 0,
20
- max: 100,
21
- step: 1,
22
- orientation: 'horizontal',
23
- slide: function ( e, ui ) {
24
- $( '#iw_size_input' ).attr( 'value', ui.value );
25
- $( '#iw_size_span' ).attr( 'title', ui.value );
26
- }
27
- } );
28
-
29
- // opacity slider
30
- $( '#iw_opacity_span' ).slider( {
31
- value: $( '#iw_opacity_input' ).val(),
32
- min: 0,
33
- max: 100,
34
- step: 1,
35
- orientation: 'horizontal',
36
- slide: function ( e, ui ) {
37
- $( '#iw_opacity_input' ).attr( 'value', ui.value );
38
- $( '#iw_opacity_span' ).attr( 'title', ui.value );
39
- }
40
- } );
41
-
42
- // quality slider
43
- $( '#iw_quality_span' ).slider( {
44
- value: $( '#iw_quality_input' ).val(),
45
- min: 0,
46
- max: 100,
47
- step: 1,
48
- orientation: 'horizontal',
49
- slide: function ( e, ui ) {
50
- $( '#iw_quality_input' ).attr( 'value', ui.value );
51
- $( '#iw_quality_span' ).attr( 'title', ui.value );
52
- }
53
- } );
54
-
55
  } );
1
+ jQuery( document ).ready( function ( $ ) {
2
+
3
+ // enable watermark for
4
+ $( document ).on( 'change', '#df_option_everywhere, #df_option_cpt', function () {
5
+ if ( $( '#cpt-specific input[type=radio]:checked' ).val() === 'everywhere' ) {
6
+ $( '#cpt-select' ).fadeOut( 300 );
7
+ } else if ( $( '#cpt-specific input[type=radio]:checked' ).val() === 'specific' ) {
8
+ $( '#cpt-select' ).fadeIn( 300 );
9
+ }
10
+ } );
11
+
12
+ $( document ).on( 'click', '#reset_image_watermark_options', function () {
13
+ return confirm( iwArgs.resetToDefaults );
14
+ } );
15
+
16
+ // size slider
17
+ $( '#iw_size_span' ).slider( {
18
+ value: $( '#iw_size_input' ).val(),
19
+ min: 0,
20
+ max: 100,
21
+ step: 1,
22
+ orientation: 'horizontal',
23
+ slide: function ( e, ui ) {
24
+ $( '#iw_size_input' ).attr( 'value', ui.value );
25
+ $( '#iw_size_span' ).attr( 'title', ui.value );
26
+ }
27
+ } );
28
+
29
+ // opacity slider
30
+ $( '#iw_opacity_span' ).slider( {
31
+ value: $( '#iw_opacity_input' ).val(),
32
+ min: 0,
33
+ max: 100,
34
+ step: 1,
35
+ orientation: 'horizontal',
36
+ slide: function ( e, ui ) {
37
+ $( '#iw_opacity_input' ).attr( 'value', ui.value );
38
+ $( '#iw_opacity_span' ).attr( 'title', ui.value );
39
+ }
40
+ } );
41
+
42
+ // quality slider
43
+ $( '#iw_quality_span' ).slider( {
44
+ value: $( '#iw_quality_input' ).val(),
45
+ min: 0,
46
+ max: 100,
47
+ step: 1,
48
+ orientation: 'horizontal',
49
+ slide: function ( e, ui ) {
50
+ $( '#iw_quality_input' ).attr( 'value', ui.value );
51
+ $( '#iw_quality_span' ).attr( 'title', ui.value );
52
+ }
53
+ } );
54
+
55
  } );
js/admin-upload.js CHANGED
@@ -1,70 +1,70 @@
1
- jQuery( document ).ready( function ( $ ) {
2
-
3
- watermarkFileUpload = {
4
- frame: function () {
5
- if ( this._frameWatermark )
6
- return this._frameWatermark;
7
-
8
- this._frameWatermark = wp.media( {
9
- title: upload_manager_args.title,
10
- frame: upload_manager_args.frame,
11
- button: upload_manager_args.button,
12
- multiple: upload_manager_args.multiple,
13
- library: {
14
- type: 'image'
15
- }
16
- } );
17
-
18
- this._frameWatermark.on( 'open', this.updateFrame ).state( 'library' ).on( 'select', this.select );
19
- return this._frameWatermark;
20
- },
21
- select: function () {
22
- var attachment = this.frame.state().get( 'selection' ).first();
23
-
24
- if ( jQuery.inArray( attachment.attributes.mime, ['image/gif', 'image/jpg', 'image/jpeg', 'image/png'] ) !== -1 ) {
25
-
26
- $( '#upload_image' ).val( attachment.attributes.id );
27
-
28
- if ( $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src' ) !== '' ) {
29
- $( 'div#previewImg_imageDiv img#previewImg_image' ).replaceWith( '<img id="previewImg_image" src="' + attachment.attributes.url + '" alt="" width="300" />' );
30
- } else {
31
- $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', attachment.attributes.url );
32
- }
33
-
34
- $( '#turn_off_image_button' ).removeAttr( 'disabled' );
35
- $( 'div#previewImg_imageDiv img#previewImg_image' ).show();
36
-
37
- var img = new Image();
38
- img.src = attachment.attributes.url;
39
-
40
- img.onload = function () {
41
- $( 'p#previewImageInfo' ).html( upload_manager_args.originalSize + ': ' + this.width + ' px / ' + this.height + ' px' );
42
- }
43
-
44
- } else {
45
-
46
- $( '#turn_off_image_button' ).attr( 'disabled', 'true' );
47
- $( '#upload_image' ).val( 0 );
48
- $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', '' ).hide();
49
- $( 'p#previewImageInfo' ).html( '<strong>' + upload_manager_args.notAllowedImg + '</strong>' );
50
-
51
- }
52
- },
53
- init: function () {
54
- $( '#wpbody' ).on( 'click', 'input#upload_image_button', function ( e ) {
55
- e.preventDefault();
56
- watermarkFileUpload.frame().open();
57
- } );
58
- }
59
- };
60
-
61
- watermarkFileUpload.init();
62
-
63
- $( document ).on( 'click', '#turn_off_image_button', function ( event ) {
64
- $( this ).attr( 'disabled', 'true' );
65
- $( '#upload_image' ).val( 0 );
66
- $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', '' ).hide();
67
- $( 'p#previewImageInfo' ).html( upload_manager_args.noSelectedImg );
68
- } );
69
-
70
  } );
1
+ jQuery( document ).ready( function ( $ ) {
2
+
3
+ watermarkFileUpload = {
4
+ frame: function () {
5
+ if ( this._frameWatermark )
6
+ return this._frameWatermark;
7
+
8
+ this._frameWatermark = wp.media( {
9
+ title: iwUploadArgs.title,
10
+ frame: iwUploadArgs.frame,
11
+ button: iwUploadArgs.button,
12
+ multiple: iwUploadArgs.multiple,
13
+ library: {
14
+ type: 'image'
15
+ }
16
+ } );
17
+
18
+ this._frameWatermark.on( 'open', this.updateFrame ).state( 'library' ).on( 'select', this.select );
19
+ return this._frameWatermark;
20
+ },
21
+ select: function () {
22
+ var attachment = this.frame.state().get( 'selection' ).first();
23
+
24
+ if ( jQuery.inArray( attachment.attributes.mime, ['image/gif', 'image/jpg', 'image/jpeg', 'image/png'] ) !== -1 ) {
25
+
26
+ $( '#upload_image' ).val( attachment.attributes.id );
27
+
28
+ if ( $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src' ) !== '' ) {
29
+ $( 'div#previewImg_imageDiv img#previewImg_image' ).replaceWith( '<img id="previewImg_image" src="' + attachment.attributes.url + '" alt="" width="300" />' );
30
+ } else {
31
+ $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', attachment.attributes.url );
32
+ }
33
+
34
+ $( '#turn_off_image_button' ).removeAttr( 'disabled' );
35
+ $( 'div#previewImg_imageDiv img#previewImg_image' ).show();
36
+
37
+ var img = new Image();
38
+ img.src = attachment.attributes.url;
39
+
40
+ img.onload = function () {
41
+ $( 'p#previewImageInfo' ).html( iwUploadArgs.originalSize + ': ' + this.width + ' ' + iwUploadArgs.px + ' / ' + this.height + ' ' + iwUploadArgs.px );
42
+ }
43
+
44
+ } else {
45
+
46
+ $( '#turn_off_image_button' ).attr( 'disabled', 'true' );
47
+ $( '#upload_image' ).val( 0 );
48
+ $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', '' ).hide();
49
+ $( 'p#previewImageInfo' ).html( '<strong>' + iwUploadArgs.notAllowedImg + '</strong>' );
50
+
51
+ }
52
+ },
53
+ init: function () {
54
+ $( '#wpbody' ).on( 'click', 'input#upload_image_button', function ( e ) {
55
+ e.preventDefault();
56
+ watermarkFileUpload.frame().open();
57
+ } );
58
+ }
59
+ };
60
+
61
+ watermarkFileUpload.init();
62
+
63
+ $( document ).on( 'click', '#turn_off_image_button', function ( event ) {
64
+ $( this ).attr( 'disabled', 'true' );
65
+ $( '#upload_image' ).val( 0 );
66
+ $( 'div#previewImg_imageDiv img#previewImg_image' ).attr( 'src', '' ).hide();
67
+ $( 'p#previewImageInfo' ).html( iwUploadArgs.noSelectedImg );
68
+ } );
69
+
70
  } );
js/no-right-click.js CHANGED
@@ -1,257 +1,257 @@
1
- /*
2
- This javascript is used by the no-right-click-images plugin for wordpress.
3
- Version 2.2
4
- Please give credit as no-right-click-images.js by Keith P. Graham
5
- http://www.blogseye.com
6
- */
7
-
8
- var df_nrc_targImg = null;
9
- var df_nrc_targSrc = null;
10
- var df_nrc_inContext = false;
11
- var df_nrc_notimage = new Image();
12
- var df_nrc_limit = 0;
13
- var df_nrc_extra = norightclick_args.rightclick;
14
- var df_nrc_drag = norightclick_args.draganddrop;
15
-
16
- function df_nrc_dragdropAll( event ) {
17
- try {
18
- var ev = event || window.event;
19
- var targ = ev.srcElement || ev.target;
20
- if ( targ.tagName.toUpperCase() == "A" ) {
21
- // is this IE and are we dragging a link to the image?
22
- var hr = targ.href;
23
- hr = hr.toUpperCase();
24
- if ( hr.indexOf( '.JPG' ) || hr.indexOf( '.PNG' ) || hr.indexOf( '.GIF' ) ) {
25
- ev.returnValue = false;
26
- if ( ev.preventDefault ) {
27
- ev.preventDefault();
28
- }
29
- df_nrc_inContext = false;
30
- return false;
31
- }
32
- }
33
- if ( targ.tagName.toUpperCase() != "IMG" )
34
- return true;
35
- ev.returnValue = false;
36
- if ( ev.preventDefault ) {
37
- ev.preventDefault();
38
- }
39
- df_nrc_inContext = false;
40
- return false;
41
- } catch ( er ) {
42
- // alert(er);
43
- }
44
- return true;
45
- }
46
-
47
- function df_nrc_dragdrop( event ) {
48
- // I am beginning to doubt if this event ever fires
49
- try {
50
- var ev = event || window.event;
51
- var targ = ev.srcElement || ev.target;
52
- ev.returnValue = false;
53
- if ( ev.preventDefault ) {
54
- ev.preventDefault();
55
- }
56
- ev.returnValue = false;
57
- df_nrc_inContext = false;
58
- return false;
59
- } catch ( er ) {
60
- // alert(er);
61
- }
62
- return true;
63
- }
64
-
65
- function df_nrc_context( event ) {
66
- try {
67
- df_nrc_inContext = true;
68
- var ev = event || window.event;
69
- var targ = ev.srcElement || ev.target;
70
- df_nrc_replace( targ );
71
- ev.returnValue = false;
72
- if ( ev.preventDefault ) {
73
- ev.preventDefault();
74
- }
75
- ev.returnValue = false;
76
- df_nrc_targImg = targ;
77
- } catch ( er ) {
78
- // alert(er);
79
- }
80
- return false;
81
- }
82
-
83
- function df_nrc_contextAll( event ) {
84
- try {
85
- if ( df_nrc_targImg == null ) {
86
- return true;
87
- }
88
- df_nrc_inContext = true;
89
- var ev = event || window.event;
90
- var targ = ev.srcElement || ev.target;
91
- if ( targ.tagName.toUpperCase() == "IMG" ) {
92
- ev.returnValue = false;
93
- if ( ev.preventDefault ) {
94
- ev.preventDefault();
95
- }
96
- ev.returnValue = false;
97
- df_nrc_replace( targ );
98
- return false;
99
- }
100
- return true;
101
- } catch ( er ) {
102
- // alert(er);
103
- }
104
- return false;
105
- }
106
-
107
- function kpg_nrc1_mousedown( event ) {
108
- try {
109
- df_nrc_inContext = false;
110
- var ev = event || window.event;
111
- var targ = ev.srcElement || ev.target;
112
- if ( ev.button == 2 ) {
113
- df_nrc_replace( targ );
114
- return false;
115
- }
116
- df_nrc_targImg = targ;
117
- if ( df_nrc_drag == 'Y' ) {
118
- if ( ev.preventDefault ) {
119
- ev.preventDefault();
120
- }
121
- }
122
- return true;
123
- } catch ( er ) {
124
- // alert(er);
125
- }
126
- return true;
127
- }
128
-
129
- function kpg_nrc1_mousedownAll( event ) {
130
- try {
131
- df_nrc_inContext = false;
132
- var ev = event || window.event;
133
- var targ = ev.srcElement || ev.target;
134
- if ( targ.style.backgroundImage != '' && ev.button == 2 ) {
135
- targ.oncontextmenu = function ( event ) {
136
- return false;
137
- } // iffy - might not work
138
- }
139
- if ( targ.tagName.toUpperCase() == "IMG" ) {
140
- if ( ev.button == 2 ) {
141
- df_nrc_replace( targ );
142
- return false;
143
- }
144
- if ( df_nrc_drag == 'Y' ) {
145
- if ( ev.preventDefault ) {
146
- ev.preventDefault();
147
- }
148
- }
149
- df_nrc_targImg = targ;
150
- }
151
- return true;
152
- } catch ( er ) {
153
- // alert(er);
154
- }
155
- return true;
156
- }
157
-
158
- function df_nrc_replace( targ ) {
159
- return false;
160
- if ( df_nrc_targImg != null && df_nrc_targImg.src == df_nrc_notimage.src ) {
161
- // restore the old image before hiding this one
162
- df_nrc_targImg.src = df_nrc_targSrc;
163
- df_nrc_targImg = null;
164
- df_nrc_targSrc = null;
165
- }
166
- df_nrc_targImg = targ;
167
- if ( df_nrc_extra != 'Y' )
168
- return;
169
- var w = targ.width + '';
170
- var h = targ.height + '';
171
- if ( w.indexOf( 'px' ) <= 0 )
172
- w = w + 'px';
173
- if ( h.indexOf( 'px' ) <= 0 )
174
- h = h + 'px';
175
- df_nrc_targSrc = targ.src;
176
- targ.src = df_nrc_notimage.src;
177
- targ.style.width = w;
178
- targ.style.height = h;
179
- df_nrc_limit = 0;
180
- var t = setTimeout( "df_nrc_restore()", 500 );
181
- return false;
182
- }
183
-
184
- function df_nrc_restore() {
185
- if ( df_nrc_inContext ) {
186
- if ( df_nrc_limit <= 20 ) {
187
- df_nrc_limit++;
188
- var t = setTimeout( "df_nrc_restore()", 500 );
189
- return;
190
- }
191
- }
192
- df_nrc_limit = 0;
193
- if ( df_nrc_targImg == null )
194
- return;
195
- if ( df_nrc_targSrc == null )
196
- return;
197
- df_nrc_targImg.src = df_nrc_targSrc;
198
- df_nrc_targImg = null;
199
- df_nrc_targSrc = null;
200
- return;
201
- }
202
-
203
- // set the image onclick event
204
- // need to check for dblclick to see if there is a right double click in IE
205
- function df_nrc_action( event ) {
206
- try {
207
- document.onmousedown = function ( event ) {
208
- return kpg_nrc1_mousedownAll( event );
209
- }
210
- document.oncontextmenu = function ( event ) {
211
- return df_nrc_contextAll( event );
212
- }
213
- document.oncopy = function ( event ) {
214
- return df_nrc_contextAll( event );
215
- }
216
- if ( df_nrc_drag == 'Y' )
217
- document.ondragstart = function ( event ) {
218
- return df_nrc_dragdropAll( event );
219
- }
220
- var b = document.getElementsByTagName( "IMG" );
221
- for ( var i = 0; i < b.length; i++ ) {
222
- b[i].oncontextmenu = function ( event ) {
223
- return df_nrc_context( event );
224
- }
225
- b[i].oncopy = function ( event ) {
226
- return df_nrc_context( event );
227
- }
228
- b[i].onmousedown = function ( event ) {
229
- return kpg_nrc1_mousedown( event );
230
- }
231
- if ( df_nrc_drag == 'Y' )
232
- b[i].ondragstart = function ( event ) {
233
- return df_nrc_dragdrop( event );
234
- }
235
- }
236
- } catch ( er ) {
237
- return false;
238
- }
239
- }
240
-
241
- if ( document.addEventListener ) {
242
- document.addEventListener( "DOMContentLoaded", function ( event ) {
243
- df_nrc_action( event );
244
- }, false );
245
- } else if ( window.attachEvent ) {
246
- window.attachEvent( "onload", function ( event ) {
247
- df_nrc_action( event );
248
- } );
249
- } else {
250
- var oldFunc = window.onload;
251
- window.onload = function () {
252
- if ( oldFunc ) {
253
- oldFunc();
254
- }
255
- df_nrc_action( 'load' );
256
- };
257
  }
1
+ /*
2
+ This javascript is used by the no-right-click-images plugin for wordpress.
3
+ Version 2.2
4
+ Please give credit as no-right-click-images.js by Keith P. Graham
5
+ http://www.blogseye.com
6
+ */
7
+
8
+ var df_nrc_targImg = null;
9
+ var df_nrc_targSrc = null;
10
+ var df_nrc_inContext = false;
11
+ var df_nrc_notimage = new Image();
12
+ var df_nrc_limit = 0;
13
+ var df_nrc_extra = norightclick_args.rightclick;
14
+ var df_nrc_drag = norightclick_args.draganddrop;
15
+
16
+ function df_nrc_dragdropAll( event ) {
17
+ try {
18
+ var ev = event || window.event;
19
+ var targ = ev.srcElement || ev.target;
20
+ if ( targ.tagName.toUpperCase() == "A" ) {
21
+ // is this IE and are we dragging a link to the image?
22
+ var hr = targ.href;
23
+ hr = hr.toUpperCase();
24
+ if ( hr.indexOf( '.JPG' ) || hr.indexOf( '.PNG' ) || hr.indexOf( '.GIF' ) ) {
25
+ ev.returnValue = false;
26
+ if ( ev.preventDefault ) {
27
+ ev.preventDefault();
28
+ }
29
+ df_nrc_inContext = false;
30
+ return false;
31
+ }
32
+ }
33
+ if ( targ.tagName.toUpperCase() != "IMG" )
34
+ return true;
35
+ ev.returnValue = false;
36
+ if ( ev.preventDefault ) {
37
+ ev.preventDefault();
38
+ }
39
+ df_nrc_inContext = false;
40
+ return false;
41
+ } catch ( er ) {
42
+ // alert(er);
43
+ }
44
+ return true;
45
+ }
46
+
47
+ function df_nrc_dragdrop( event ) {
48
+ // I am beginning to doubt if this event ever fires
49
+ try {
50
+ var ev = event || window.event;
51
+ var targ = ev.srcElement || ev.target;
52
+ ev.returnValue = false;
53
+ if ( ev.preventDefault ) {
54
+ ev.preventDefault();
55
+ }
56
+ ev.returnValue = false;
57
+ df_nrc_inContext = false;
58
+ return false;
59
+ } catch ( er ) {
60
+ // alert(er);
61
+ }
62
+ return true;
63
+ }
64
+
65
+ function df_nrc_context( event ) {
66
+ try {
67
+ df_nrc_inContext = true;
68
+ var ev = event || window.event;
69
+ var targ = ev.srcElement || ev.target;
70
+ df_nrc_replace( targ );
71
+ ev.returnValue = false;
72
+ if ( ev.preventDefault ) {
73
+ ev.preventDefault();
74
+ }
75
+ ev.returnValue = false;
76
+ df_nrc_targImg = targ;
77
+ } catch ( er ) {
78
+ // alert(er);
79
+ }
80
+ return false;
81
+ }
82
+
83
+ function df_nrc_contextAll( event ) {
84
+ try {
85
+ if ( df_nrc_targImg == null ) {
86
+ return true;
87
+ }
88
+ df_nrc_inContext = true;
89
+ var ev = event || window.event;
90
+ var targ = ev.srcElement || ev.target;
91
+ if ( targ.tagName.toUpperCase() == "IMG" ) {
92
+ ev.returnValue = false;
93
+ if ( ev.preventDefault ) {
94
+ ev.preventDefault();
95
+ }
96
+ ev.returnValue = false;
97
+ df_nrc_replace( targ );
98
+ return false;
99
+ }
100
+ return true;
101
+ } catch ( er ) {
102
+ // alert(er);
103
+ }
104
+ return false;
105
+ }
106
+
107
+ function kpg_nrc1_mousedown( event ) {
108
+ try {
109
+ df_nrc_inContext = false;
110
+ var ev = event || window.event;
111
+ var targ = ev.srcElement || ev.target;
112
+ if ( ev.button == 2 ) {
113
+ df_nrc_replace( targ );
114
+ return false;
115
+ }
116
+ df_nrc_targImg = targ;
117
+ if ( df_nrc_drag == 'Y' ) {
118
+ if ( ev.preventDefault ) {
119
+ ev.preventDefault();
120
+ }
121
+ }
122
+ return true;
123
+ } catch ( er ) {
124
+ // alert(er);
125
+ }
126
+ return true;
127
+ }
128
+
129
+ function kpg_nrc1_mousedownAll( event ) {
130
+ try {
131
+ df_nrc_inContext = false;
132
+ var ev = event || window.event;
133
+ var targ = ev.srcElement || ev.target;
134
+ if ( targ.style.backgroundImage != '' && ev.button == 2 ) {
135
+ targ.oncontextmenu = function ( event ) {
136
+ return false;
137
+ } // iffy - might not work
138
+ }
139
+ if ( targ.tagName.toUpperCase() == "IMG" ) {
140
+ if ( ev.button == 2 ) {
141
+ df_nrc_replace( targ );
142
+ return false;
143
+ }
144
+ if ( df_nrc_drag == 'Y' ) {
145
+ if ( ev.preventDefault ) {
146
+ ev.preventDefault();
147
+ }
148
+ }
149
+ df_nrc_targImg = targ;
150
+ }
151
+ return true;
152
+ } catch ( er ) {
153
+ // alert(er);
154
+ }
155
+ return true;
156
+ }
157
+
158
+ function df_nrc_replace( targ ) {
159
+ return false;
160
+ if ( df_nrc_targImg != null && df_nrc_targImg.src == df_nrc_notimage.src ) {
161
+ // restore the old image before hiding this one
162
+ df_nrc_targImg.src = df_nrc_targSrc;
163
+ df_nrc_targImg = null;
164
+ df_nrc_targSrc = null;
165
+ }
166
+ df_nrc_targImg = targ;
167
+ if ( df_nrc_extra != 'Y' )
168
+ return;
169
+ var w = targ.width + '';
170
+ var h = targ.height + '';
171
+ if ( w.indexOf( 'px' ) <= 0 )
172
+ w = w + 'px';
173
+ if ( h.indexOf( 'px' ) <= 0 )
174
+ h = h + 'px';
175
+ df_nrc_targSrc = targ.src;
176
+ targ.src = df_nrc_notimage.src;
177
+ targ.style.width = w;
178
+ targ.style.height = h;
179
+ df_nrc_limit = 0;
180
+ var t = setTimeout( "df_nrc_restore()", 500 );
181
+ return false;
182
+ }
183
+
184
+ function df_nrc_restore() {
185
+ if ( df_nrc_inContext ) {
186
+ if ( df_nrc_limit <= 20 ) {
187
+ df_nrc_limit++;
188
+ var t = setTimeout( "df_nrc_restore()", 500 );
189
+ return;
190
+ }
191
+ }
192
+ df_nrc_limit = 0;
193
+ if ( df_nrc_targImg == null )
194
+ return;
195
+ if ( df_nrc_targSrc == null )
196
+ return;
197
+ df_nrc_targImg.src = df_nrc_targSrc;
198
+ df_nrc_targImg = null;
199
+ df_nrc_targSrc = null;
200
+ return;
201
+ }
202
+
203
+ // set the image onclick event
204
+ // need to check for dblclick to see if there is a right double click in IE
205
+ function df_nrc_action( event ) {
206
+ try {
207
+ document.onmousedown = function ( event ) {
208
+ return kpg_nrc1_mousedownAll( event );
209
+ }
210
+ document.oncontextmenu = function ( event ) {
211
+ return df_nrc_contextAll( event );
212
+ }
213
+ document.oncopy = function ( event ) {
214
+ return df_nrc_contextAll( event );
215
+ }
216
+ if ( df_nrc_drag == 'Y' )
217
+ document.ondragstart = function ( event ) {
218
+ return df_nrc_dragdropAll( event );
219
+ }
220
+ var b = document.getElementsByTagName( "IMG" );
221
+ for ( var i = 0; i < b.length; i++ ) {
222
+ b[i].oncontextmenu = function ( event ) {
223
+ return df_nrc_context( event );
224
+ }
225
+ b[i].oncopy = function ( event ) {
226
+ return df_nrc_context( event );
227
+ }
228
+ b[i].onmousedown = function ( event ) {
229
+ return kpg_nrc1_mousedown( event );
230
+ }
231
+ if ( df_nrc_drag == 'Y' )
232
+ b[i].ondragstart = function ( event ) {
233
+ return df_nrc_dragdrop( event );
234
+ }
235
+ }
236
+ } catch ( er ) {
237
+ return false;
238
+ }
239
+ }
240
+
241
+ if ( document.addEventListener ) {
242
+ document.addEventListener( "DOMContentLoaded", function ( event ) {
243
+ df_nrc_action( event );
244
+ }, false );
245
+ } else if ( window.attachEvent ) {
246
+ window.attachEvent( "onload", function ( event ) {
247
+ df_nrc_action( event );
248
+ } );
249
+ } else {
250
+ var oldFunc = window.onload;
251
+ window.onload = function () {
252
+ if ( oldFunc ) {
253
+ oldFunc();
254
+ }
255
+ df_nrc_action( 'load' );
256
+ };
257
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: image, images, picture, photo, watermark, watermarking, protection, image protection, image security, plugin
5
  Requires at least: 3.5
6
- Tested up to: 4.4.1
7
- Stable tag: 1.5.2
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -20,6 +20,7 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
20
 
21
  * Bulk watermark - Apply watermark option in Media Library actions
22
  * Watermark images already uploaded to Media Library
 
23
  * Choose the position of watermark image
24
  * Upload custom watermark image
25
  * Watermark image preview
@@ -61,6 +62,9 @@ No questions yet.
61
 
62
  == Changelog ==
63
 
 
 
 
64
  = 1.5.2 =
65
  * Tweak: Switch from wp_get_referer() to DOING_AJAX and is_admin().
66
 
@@ -150,5 +154,5 @@ Initial release
150
 
151
  == Upgrade Notice ==
152
 
153
- = 1.5.2 =
154
- * Tweak: Switch from wp_get_referer() to DOING_AJAX and is_admin().
3
  Donate link: http://www.dfactory.eu/
4
  Tags: image, images, picture, photo, watermark, watermarking, protection, image protection, image security, plugin
5
  Requires at least: 3.5
6
+ Tested up to: 4.5
7
+ Stable tag: 1.5.3
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
20
 
21
  * Bulk watermark - Apply watermark option in Media Library actions
22
  * Watermark images already uploaded to Media Library
23
+ * GD LIbrary and ImageMagic support
24
  * Choose the position of watermark image
25
  * Upload custom watermark image
26
  * Watermark image preview
62
 
63
  == Changelog ==
64
 
65
+ = 1.5.3 =
66
+ * New: ImageMagic support
67
+
68
  = 1.5.2 =
69
  * Tweak: Switch from wp_get_referer() to DOING_AJAX and is_admin().
70
 
154
 
155
  == Upgrade Notice ==
156
 
157
+ = 1.5.3 =
158
+ * New: ImageMagic support