WP Maintenance - Version 2.7.2

Version Description

Cette version est stable / This version is stable

=

Download this release

Release Info

Developer Florent73
Plugin Icon 128x128 WP Maintenance
Version 2.7.2
Comparing to
See all releases

Code changes from version 2.7.1 to 2.7.2

js/fontselect/fontselect.css ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ This css and associated images borrow heavily from the fantastic
3
+ chosen select box plugin.
4
+
5
+ Copyright (c) 2011 Harvest http://getharvest.com
6
+
7
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
8
+ */
9
+
10
+ .font-select {
11
+ font-size: 16px;
12
+ width: 210px;
13
+ position: relative;
14
+ display: inline-block;
15
+ zoom: 1;
16
+ *display: inline;
17
+ }
18
+
19
+ .font-select .fs-drop {
20
+ background: #fff;
21
+ border: 1px solid #aaa;
22
+ border-top: 0;
23
+ position: absolute;
24
+ top: 29px;
25
+ left: 0;
26
+ -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
27
+ -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
28
+ -o-box-shadow : 0 4px 5px rgba(0,0,0,.15);
29
+ box-shadow : 0 4px 5px rgba(0,0,0,.15);
30
+ z-index: 999;
31
+ }
32
+
33
+ .font-select > a {
34
+ background-color: #fff;
35
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
36
+ background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
37
+ background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
38
+ background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
39
+ background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
40
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
41
+ background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%);
42
+ -webkit-border-radius: 4px;
43
+ -moz-border-radius : 4px;
44
+ border-radius : 4px;
45
+ -moz-background-clip : padding;
46
+ -webkit-background-clip: padding-box;
47
+ background-clip : padding-box;
48
+ border: 1px solid #aaa;
49
+ display: block;
50
+ overflow: hidden;
51
+ white-space: nowrap;
52
+ position: relative;
53
+ height: 26px;
54
+ line-height: 26px;
55
+ padding: 0 0 0 8px;
56
+ color: #444;
57
+ text-decoration: none;
58
+ }
59
+
60
+ .font-select > a span {
61
+ margin-right: 26px;
62
+ display: block;
63
+ overflow: hidden;
64
+ white-space: nowrap;
65
+ line-height: 1.8;
66
+ -o-text-overflow: ellipsis;
67
+ -ms-text-overflow: ellipsis;
68
+ text-overflow: ellipsis;
69
+ cursor: pointer;
70
+ }
71
+
72
+ .font-select > a div {
73
+ -webkit-border-radius: 0 4px 4px 0;
74
+ -moz-border-radius : 0 4px 4px 0;
75
+ border-radius : 0 4px 4px 0;
76
+ -moz-background-clip : padding;
77
+ -webkit-background-clip: padding-box;
78
+ background-clip : padding-box;
79
+ background: #ccc;
80
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
81
+ background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
82
+ background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
83
+ background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
84
+ background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%);
85
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 );
86
+ background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%);
87
+ border-left: 1px solid #aaa;
88
+ position: absolute;
89
+ right: 0;
90
+ top: 0;
91
+ display: block;
92
+ height: 100%;
93
+ width: 18px;
94
+ }
95
+
96
+ .font-select > a div b {
97
+ background: url('fs-sprite.png') no-repeat 0 1px;
98
+ display: block;
99
+ width: 100%;
100
+ height: 100%;
101
+ cursor: pointer;
102
+ }
103
+
104
+ .font-select .fs-drop {
105
+ -webkit-border-radius: 0 0 4px 4px;
106
+ -moz-border-radius : 0 0 4px 4px;
107
+ border-radius : 0 0 4px 4px;
108
+ -moz-background-clip : padding;
109
+ -webkit-background-clip: padding-box;
110
+ background-clip : padding-box;
111
+ }
112
+
113
+ .font-select .fs-results {
114
+ margin: 0 4px 4px 0;
115
+ max-height: 190px;
116
+ width: 200px;
117
+ padding: 0 0 0 4px;
118
+ position: relative;
119
+ overflow-x: hidden;
120
+ overflow-y: auto;
121
+ }
122
+
123
+ .font-select .fs-results li {
124
+ line-height: 80%;
125
+ padding: 7px 7px 8px;
126
+ margin: 0;
127
+ list-style: none;
128
+ font-size: 18px;
129
+ }
130
+
131
+ .font-select .fs-results li.active {
132
+ background: #3875d7;
133
+ color: #fff;
134
+ cursor: pointer;
135
+ }
136
+ .font-select .fs-results li em {
137
+ background: #feffde;
138
+ font-style: normal;
139
+ }
140
+
141
+ .font-select .fs-results li.active em {
142
+ background: transparent;
143
+ }
144
+
145
+ .font-select-active > a {
146
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
147
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
148
+ -o-box-shadow : 0 0 5px rgba(0,0,0,.3);
149
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
150
+ border: 1px solid #5897fb;
151
+ }
152
+
153
+ .font-select-active > a {
154
+ border: 1px solid #aaa;
155
+ -webkit-box-shadow: 0 1px 0 #fff inset;
156
+ -moz-box-shadow : 0 1px 0 #fff inset;
157
+ -o-box-shadow : 0 1px 0 #fff inset;
158
+ box-shadow : 0 1px 0 #fff inset;
159
+ background-color: #eee;
160
+ background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
161
+ background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
162
+ background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
163
+ background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
164
+ background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
165
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
166
+ background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
167
+ -webkit-border-bottom-left-radius : 0;
168
+ -webkit-border-bottom-right-radius: 0;
169
+ -moz-border-radius-bottomleft : 0;
170
+ -moz-border-radius-bottomright: 0;
171
+ border-bottom-left-radius : 0;
172
+ border-bottom-right-radius: 0;
173
+ }
174
+
175
+ .font-select-active > a div {
176
+ background: transparent;
177
+ border-left: none;
178
+ }
179
+
180
+ .font-select-active > a div b {
181
+ background-position: -18px 1px;
182
+ }
js/fontselect/fs-sprite.png ADDED
Binary file
js/fontselect/jquery.fontselect.js ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery.fontselect - A font selector for the Google Web Fonts api
3
+ * Tom Moor, http://tommoor.com
4
+ * Copyright (c) 2011 Tom Moor
5
+ * MIT Licensed
6
+ * @version 0.1
7
+ */
8
+
9
+ (function($){
10
+
11
+ $.fn.fontselect = function(options) {
12
+
13
+ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
14
+
15
+ var fonts = [
16
+ "Aclonica",
17
+ "Allan",
18
+ "Annie+Use+Your+Telescope",
19
+ "Anonymous+Pro",
20
+ "Allerta+Stencil",
21
+ "Allerta",
22
+ "Amaranth",
23
+ "Anton",
24
+ "Architects+Daughter",
25
+ "Arimo",
26
+ "Artifika",
27
+ "Arvo",
28
+ "Asset",
29
+ "Astloch",
30
+ "Bangers",
31
+ "Bentham",
32
+ "Bevan",
33
+ "Bigshot+One",
34
+ "Bowlby+One",
35
+ "Bowlby+One+SC",
36
+ "Brawler",
37
+ "Buda:300",
38
+ "Cabin",
39
+ "Calligraffitti",
40
+ "Candal",
41
+ "Cantarell",
42
+ "Cardo",
43
+ "Carter One",
44
+ "Caudex",
45
+ "Cedarville+Cursive",
46
+ "Cherry+Cream+Soda",
47
+ "Chewy",
48
+ "Coda",
49
+ "Coming+Soon",
50
+ "Copse",
51
+ "Corben:700",
52
+ "Cousine",
53
+ "Covered+By+Your+Grace",
54
+ "Crafty+Girls",
55
+ "Crimson+Text",
56
+ "Crushed",
57
+ "Cuprum",
58
+ "Damion",
59
+ "Dancing+Script",
60
+ "Dawning+of+a+New+Day",
61
+ "Didact+Gothic",
62
+ "Droid+Sans",
63
+ "Droid+Sans+Mono",
64
+ "Droid+Serif",
65
+ "EB+Garamond",
66
+ "Expletus+Sans",
67
+ "Fontdiner+Swanky",
68
+ "Forum",
69
+ "Francois+One",
70
+ "Geo",
71
+ "Give+You+Glory",
72
+ "Goblin+One",
73
+ "Goudy+Bookletter+1911",
74
+ "Gravitas+One",
75
+ "Gruppo",
76
+ "Hammersmith+One",
77
+ "Holtwood+One+SC",
78
+ "Homemade+Apple",
79
+ "Inconsolata",
80
+ "Indie+Flower",
81
+ "IM+Fell+DW+Pica",
82
+ "IM+Fell+DW+Pica+SC",
83
+ "IM+Fell+Double+Pica",
84
+ "IM+Fell+Double+Pica+SC",
85
+ "IM+Fell+English",
86
+ "IM+Fell+English+SC",
87
+ "IM+Fell+French+Canon",
88
+ "IM+Fell+French+Canon+SC",
89
+ "IM+Fell+Great+Primer",
90
+ "IM+Fell+Great+Primer+SC",
91
+ "Irish+Grover",
92
+ "Irish+Growler",
93
+ "Istok+Web",
94
+ "Josefin+Sans",
95
+ "Josefin+Slab",
96
+ "Judson",
97
+ "Jura",
98
+ "Jura:500",
99
+ "Jura:600",
100
+ "Just+Another+Hand",
101
+ "Just+Me+Again+Down+Here",
102
+ "Kameron",
103
+ "Kenia",
104
+ "Kranky",
105
+ "Kreon",
106
+ "Kristi",
107
+ "La+Belle+Aurore",
108
+ "Lato:100",
109
+ "Lato:100italic",
110
+ "Lato:300",
111
+ "Lato",
112
+ "Lato:bold",
113
+ "Lato:900",
114
+ "League+Script",
115
+ "Lekton",
116
+ "Limelight",
117
+ "Lobster",
118
+ "Lobster Two",
119
+ "Lora",
120
+ "Love+Ya+Like+A+Sister",
121
+ "Loved+by+the+King",
122
+ "Luckiest+Guy",
123
+ "Maiden+Orange",
124
+ "Mako",
125
+ "Maven+Pro",
126
+ "Maven+Pro:500",
127
+ "Maven+Pro:700",
128
+ "Maven+Pro:900",
129
+ "Meddon",
130
+ "MedievalSharp",
131
+ "Megrim",
132
+ "Merriweather",
133
+ "Metrophobic",
134
+ "Michroma",
135
+ "Miltonian Tattoo",
136
+ "Miltonian",
137
+ "Modern Antiqua",
138
+ "Monofett",
139
+ "Molengo",
140
+ "Mountains of Christmas",
141
+ "Muli:300",
142
+ "Muli",
143
+ "Neucha",
144
+ "Neuton",
145
+ "News+Cycle",
146
+ "Nixie+One",
147
+ "Nobile",
148
+ "Nova+Cut",
149
+ "Nova+Flat",
150
+ "Nova+Mono",
151
+ "Nova+Oval",
152
+ "Nova+Round",
153
+ "Nova+Script",
154
+ "Nova+Slim",
155
+ "Nova+Square",
156
+ "Nunito:light",
157
+ "Nunito",
158
+ "OFL+Sorts+Mill+Goudy+TT",
159
+ "Old+Standard+TT",
160
+ "Open+Sans:300",
161
+ "Open+Sans",
162
+ "Open+Sans:600",
163
+ "Open+Sans:800",
164
+ "Open+Sans+Condensed:300",
165
+ "Orbitron",
166
+ "Orbitron:500",
167
+ "Orbitron:700",
168
+ "Orbitron:900",
169
+ "Oswald",
170
+ "Over+the+Rainbow",
171
+ "Reenie+Beanie",
172
+ "Pacifico",
173
+ "Patrick+Hand",
174
+ "Paytone+One",
175
+ "Permanent+Marker",
176
+ "Philosopher",
177
+ "Play",
178
+ "Playfair+Display",
179
+ "Podkova",
180
+ "PT+Sans",
181
+ "PT+Sans+Narrow",
182
+ "PT+Sans+Narrow:regular,bold",
183
+ "PT+Serif",
184
+ "PT+Serif Caption",
185
+ "Puritan",
186
+ "Quattrocento",
187
+ "Quattrocento+Sans",
188
+ "Radley",
189
+ "Raleway:100",
190
+ "Redressed",
191
+ "Rock+Salt",
192
+ "Rokkitt",
193
+ "Ruslan+Display",
194
+ "Schoolbell",
195
+ "Shadows+Into+Light",
196
+ "Shanti",
197
+ "Sigmar+One",
198
+ "Six+Caps",
199
+ "Slackey",
200
+ "Smythe",
201
+ "Sniglet:800",
202
+ "Special+Elite",
203
+ "Stardos+Stencil",
204
+ "Sue+Ellen+Francisco",
205
+ "Sunshiney",
206
+ "Swanky+and+Moo+Moo",
207
+ "Syncopate",
208
+ "Tangerine",
209
+ "Tenor+Sans",
210
+ "Terminal+Dosis+Light",
211
+ "The+Girl+Next+Door",
212
+ "Tinos",
213
+ "Ubuntu",
214
+ "Ultra",
215
+ "Unkempt",
216
+ "UnifrakturCook:bold",
217
+ "UnifrakturMaguntia",
218
+ "Varela",
219
+ "Varela Round",
220
+ "Vibur",
221
+ "Vollkorn",
222
+ "VT323",
223
+ "Waiting+for+the+Sunrise",
224
+ "Wallpoet",
225
+ "Walter+Turncoat",
226
+ "Wire+One",
227
+ "Yanone+Kaffeesatz",
228
+ "Yanone+Kaffeesatz:300",
229
+ "Yanone+Kaffeesatz:400",
230
+ "Yanone+Kaffeesatz:700",
231
+ "Yeseva+One",
232
+ "Zeyada"];
233
+
234
+ var settings = {
235
+ style: 'font-select',
236
+ placeholder: 'Select a font',
237
+ lookahead: 2,
238
+ api: 'http://fonts.googleapis.com/css?family='
239
+ };
240
+
241
+ var Fontselect = (function(){
242
+
243
+ function Fontselect(original, o){
244
+ this.$original = $(original);
245
+ this.options = o;
246
+ this.active = false;
247
+ this.setupHtml();
248
+ this.getVisibleFonts();
249
+ this.bindEvents();
250
+
251
+ var font = this.$original.val();
252
+ if (font) {
253
+ this.updateSelected();
254
+ this.addFontLink(font);
255
+ }
256
+ }
257
+
258
+ Fontselect.prototype.bindEvents = function(){
259
+
260
+ $('li', this.$results)
261
+ .click(__bind(this.selectFont, this))
262
+ .mouseenter(__bind(this.activateFont, this))
263
+ .mouseleave(__bind(this.deactivateFont, this));
264
+
265
+ $('span', this.$select).click(__bind(this.toggleDrop, this));
266
+ this.$arrow.click(__bind(this.toggleDrop, this));
267
+ };
268
+
269
+ Fontselect.prototype.toggleDrop = function(ev){
270
+
271
+ if(this.active){
272
+ this.$element.removeClass('font-select-active');
273
+ this.$drop.hide();
274
+ clearInterval(this.visibleInterval);
275
+
276
+ } else {
277
+ this.$element.addClass('font-select-active');
278
+ this.$drop.show();
279
+ this.moveToSelected();
280
+ this.visibleInterval = setInterval(__bind(this.getVisibleFonts, this), 500);
281
+ }
282
+
283
+ this.active = !this.active;
284
+ };
285
+
286
+ Fontselect.prototype.selectFont = function(){
287
+
288
+ var font = $('li.active', this.$results).data('value');
289
+ this.$original.val(font).change();
290
+ this.updateSelected();
291
+ this.toggleDrop();
292
+ };
293
+
294
+ Fontselect.prototype.moveToSelected = function(){
295
+
296
+ var $li, font = this.$original.val();
297
+
298
+ if (font){
299
+ $li = $("li[data-value='"+ font +"']", this.$results);
300
+ } else {
301
+ $li = $("li", this.$results).first();
302
+ }
303
+
304
+ this.$results.scrollTop($li.addClass('active').position().top);
305
+ };
306
+
307
+ Fontselect.prototype.activateFont = function(ev){
308
+ $('li.active', this.$results).removeClass('active');
309
+ $(ev.currentTarget).addClass('active');
310
+ };
311
+
312
+ Fontselect.prototype.deactivateFont = function(ev){
313
+
314
+ $(ev.currentTarget).removeClass('active');
315
+ };
316
+
317
+ Fontselect.prototype.updateSelected = function(){
318
+
319
+ var font = this.$original.val();
320
+ $('span', this.$element).text(this.toReadable(font)).css(this.toStyle(font));
321
+ };
322
+
323
+ Fontselect.prototype.setupHtml = function(){
324
+
325
+ this.$original.empty().hide();
326
+ this.$element = $('<div>', {'class': this.options.style});
327
+ this.$arrow = $('<div><b></b></div>');
328
+ this.$select = $('<a><span>'+ this.options.placeholder +'</span></a>');
329
+ this.$drop = $('<div>', {'class': 'fs-drop'});
330
+ this.$results = $('<ul>', {'class': 'fs-results'});
331
+ this.$original.after(this.$element.append(this.$select.append(this.$arrow)).append(this.$drop));
332
+ this.$drop.append(this.$results.append(this.fontsAsHtml())).hide();
333
+ };
334
+
335
+ Fontselect.prototype.fontsAsHtml = function(){
336
+
337
+ var l = fonts.length;
338
+ var r, s, h = '';
339
+
340
+ for(var i=0; i<l; i++){
341
+ r = this.toReadable(fonts[i]);
342
+ s = this.toStyle(fonts[i]);
343
+ h += '<li data-value="'+ fonts[i] +'" style="font-family: '+s['font-family'] +'; font-weight: '+s['font-weight'] +'">'+ r +'</li>';
344
+ }
345
+
346
+ return h;
347
+ };
348
+
349
+ Fontselect.prototype.toReadable = function(font){
350
+ return font.replace(/[\+|:]/g, ' ');
351
+ };
352
+
353
+ Fontselect.prototype.toStyle = function(font){
354
+ var t = font.split(':');
355
+ return {'font-family': this.toReadable(t[0]), 'font-weight': (t[1] || 400)};
356
+ };
357
+
358
+ Fontselect.prototype.getVisibleFonts = function(){
359
+
360
+ if(this.$results.is(':hidden')) return;
361
+
362
+ var fs = this;
363
+ var top = this.$results.scrollTop();
364
+ var bottom = top + this.$results.height();
365
+
366
+ if(this.options.lookahead){
367
+ var li = $('li', this.$results).first().height();
368
+ bottom += li*this.options.lookahead;
369
+ }
370
+
371
+ $('li', this.$results).each(function(){
372
+
373
+ var ft = $(this).position().top+top;
374
+ var fb = ft + $(this).height();
375
+
376
+ if ((fb >= top) && (ft <= bottom)){
377
+ var font = $(this).data('value');
378
+ fs.addFontLink(font);
379
+ }
380
+
381
+ });
382
+ };
383
+
384
+ Fontselect.prototype.addFontLink = function(font){
385
+
386
+ var link = this.options.api + font;
387
+
388
+ if ($("link[href*='" + font + "']").length === 0){
389
+ $('link:last').after('<link href="' + link + '" rel="stylesheet" type="text/css">');
390
+ }
391
+ };
392
+
393
+ return Fontselect;
394
+ })();
395
+
396
+ return this.each(function(options) {
397
+ // If options exist, lets merge them
398
+ if (options) $.extend( settings, options );
399
+
400
+ return new Fontselect(this, settings);
401
+ });
402
+
403
+ };
404
+ })(jQuery);
js/fontselect/jquery.fontselect.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery.fontselect - A font selector for the Google Web Fonts api
3
+ * Tom Moor, http://tommoor.com
4
+ * Copyright (c) 2011 Tom Moor
5
+ * MIT Licensed
6
+ * @version 0.1
7
+ */(function(a){a.fn.fontselect=function(b){var c=function(a,b){return function(){return a.apply(b,arguments)}},d=["Aclonica","Allan","Annie+Use+Your+Telescope","Anonymous+Pro","Allerta+Stencil","Allerta","Amaranth","Anton","Architects+Daughter","Arimo","Artifika","Arvo","Asset","Astloch","Bangers","Bentham","Bevan","Bigshot+One","Bowlby+One","Bowlby+One+SC","Brawler","Buda:300","Cabin","Calligraffitti","Candal","Cantarell","Cardo","Carter One","Caudex","Cedarville+Cursive","Cherry+Cream+Soda","Chewy","Coda","Coming+Soon","Copse","Corben:700","Cousine","Covered+By+Your+Grace","Crafty+Girls","Crimson+Text","Crushed","Cuprum","Damion","Dancing+Script","Dawning+of+a+New+Day","Didact+Gothic","Droid+Sans","Droid+Sans+Mono","Droid+Serif","EB+Garamond","Expletus+Sans","Fontdiner+Swanky","Forum","Francois+One","Geo","Give+You+Glory","Goblin+One","Goudy+Bookletter+1911","Gravitas+One","Gruppo","Hammersmith+One","Holtwood+One+SC","Homemade+Apple","Inconsolata","Indie+Flower","IM+Fell+DW+Pica","IM+Fell+DW+Pica+SC","IM+Fell+Double+Pica","IM+Fell+Double+Pica+SC","IM+Fell+English","IM+Fell+English+SC","IM+Fell+French+Canon","IM+Fell+French+Canon+SC","IM+Fell+Great+Primer","IM+Fell+Great+Primer+SC","Irish+Grover","Irish+Growler","Istok+Web","Josefin+Sans","Josefin+Slab","Judson","Jura","Jura:500","Jura:600","Just+Another+Hand","Just+Me+Again+Down+Here","Kameron","Kenia","Kranky","Kreon","Kristi","La+Belle+Aurore","Lato:100","Lato:100italic","Lato:300","Lato","Lato:bold","Lato:900","League+Script","Lekton","Limelight","Lobster","Lobster Two","Lora","Love+Ya+Like+A+Sister","Loved+by+the+King","Luckiest+Guy","Maiden+Orange","Mako","Maven+Pro","Maven+Pro:500","Maven+Pro:700","Maven+Pro:900","Meddon","MedievalSharp","Megrim","Merriweather","Metrophobic","Michroma","Miltonian Tattoo","Miltonian","Modern Antiqua","Monofett","Molengo","Mountains of Christmas","Muli:300","Muli","Neucha","Neuton","News+Cycle","Nixie+One","Nobile","Nova+Cut","Nova+Flat","Nova+Mono","Nova+Oval","Nova+Round","Nova+Script","Nova+Slim","Nova+Square","Nunito:light","Nunito","OFL+Sorts+Mill+Goudy+TT","Old+Standard+TT","Open+Sans:300","Open+Sans","Open+Sans:600","Open+Sans:800","Open+Sans+Condensed:300","Orbitron","Orbitron:500","Orbitron:700","Orbitron:900","Oswald","Over+the+Rainbow","Reenie+Beanie","Pacifico","Patrick+Hand","Paytone+One","Permanent+Marker","Philosopher","Play","Playfair+Display","Podkova","PT+Sans","PT+Sans+Narrow","PT+Sans+Narrow:regular,bold","PT+Serif","PT+Serif Caption","Puritan","Quattrocento","Quattrocento+Sans","Radley","Raleway:100","Redressed","Rock+Salt","Rokkitt","Ruslan+Display","Schoolbell","Shadows+Into+Light","Shanti","Sigmar+One","Six+Caps","Slackey","Smythe","Sniglet:800","Special+Elite","Stardos+Stencil","Sue+Ellen+Francisco","Sunshiney","Swanky+and+Moo+Moo","Syncopate","Tangerine","Tenor+Sans","Terminal+Dosis+Light","The+Girl+Next+Door","Tinos","Ubuntu","Ultra","Unkempt","UnifrakturCook:bold","UnifrakturMaguntia","Varela","Varela Round","Vibur","Vollkorn","VT323","Waiting+for+the+Sunrise","Wallpoet","Walter+Turncoat","Wire+One","Yanone+Kaffeesatz","Yanone+Kaffeesatz:300","Yanone+Kaffeesatz:400","Yanone+Kaffeesatz:700","Yeseva+One","Zeyada"],e={style:"font-select",placeholder:"Select a font",lookahead:2,api:"http://fonts.googleapis.com/css?family="},f=function(){function b(b,c){this.$original=a(b);this.options=c;this.active=!1;this.setupHtml();this.getVisibleFonts();this.bindEvents();var d=this.$original.val();if(d){this.updateSelected();this.addFontLink(d)}}b.prototype.bindEvents=function(){a("li",this.$results).click(c(this.selectFont,this)).mouseenter(c(this.activateFont,this)).mouseleave(c(this.deactivateFont,this));a("span",this.$select).click(c(this.toggleDrop,this));this.$arrow.click(c(this.toggleDrop,this))};b.prototype.toggleDrop=function(a){if(this.active){this.$element.removeClass("font-select-active");this.$drop.hide();clearInterval(this.visibleInterval)}else{this.$element.addClass("font-select-active");this.$drop.show();this.moveToSelected();this.visibleInterval=setInterval(c(this.getVisibleFonts,this),500)}this.active=!this.active};b.prototype.selectFont=function(){var b=a("li.active",this.$results).data("value");this.$original.val(b).change();this.updateSelected();this.toggleDrop()};b.prototype.moveToSelected=function(){var b,c=this.$original.val();c?b=a("li[data-value='"+c+"']",this.$results):b=a("li",this.$results).first();this.$results.scrollTop(b.addClass("active").position().top)};b.prototype.activateFont=function(b){a("li.active",this.$results).removeClass("active");a(b.currentTarget).addClass("active")};b.prototype.deactivateFont=function(b){a(b.currentTarget).removeClass("active")};b.prototype.updateSelected=function(){var b=this.$original.val();a("span",this.$element).text(this.toReadable(b)).css(this.toStyle(b))};b.prototype.setupHtml=function(){this.$original.empty().hide();this.$element=a("<div>",{"class":this.options.style});this.$arrow=a("<div><b></b></div>");this.$select=a("<a><span>"+this.options.placeholder+"</span></a>");this.$drop=a("<div>",{"class":"fs-drop"});this.$results=a("<ul>",{"class":"fs-results"});this.$original.after(this.$element.append(this.$select.append(this.$arrow)).append(this.$drop));this.$drop.append(this.$results.append(this.fontsAsHtml())).hide()};b.prototype.fontsAsHtml=function(){var a=d.length,b,c,e="";for(var f=0;f<a;f++){b=this.toReadable(d[f]);c=this.toStyle(d[f]);e+='<li data-value="'+d[f]+'" style="font-family: '+c["font-family"]+"; font-weight: "+c["font-weight"]+'">'+b+"</li>"}return e};b.prototype.toReadable=function(a){return a.replace(/[\+|:]/g," ")};b.prototype.toStyle=function(a){var b=a.split(":");return{"font-family":this.toReadable(b[0]),"font-weight":b[1]||400}};b.prototype.getVisibleFonts=function(){if(this.$results.is(":hidden"))return;var b=this,c=this.$results.scrollTop(),d=c+this.$results.height();if(this.options.lookahead){var e=a("li",this.$results).first().height();d+=e*this.options.lookahead}a("li",this.$results).each(function(){var e=a(this).position().top+c,f=e+a(this).height();if(f>=c&&e<=d){var g=a(this).data("value");b.addFontLink(g)}})};b.prototype.addFontLink=function(b){var c=this.options.api+b;a("link[href*='"+b+"']").length===0&&a("link:last").after('<link href="'+c+'" rel="stylesheet" type="text/css">')};return b}();return this.each(function(b){b&&a.extend(e,b);return new f(this,e)})}})(jQuery);
js/wpm-cpt-script.js CHANGED
@@ -47,7 +47,7 @@ function CountBack(secs) {
47
  }
48
 
49
  function putspan(BackColor, ForeColor) {
50
- document.write("<div class='cptR-rec_countdown'><span id='cntdwn' style='background-color:" + BackColor + "; color:" + ForeColor + ";'></span></div>");
51
  }
52
 
53
  if (typeof(BackColor)=="undefined")
@@ -70,6 +70,8 @@ if (typeof(LeadingZero)=="undefined")
70
  LeadingZero = true;
71
  if (typeof(Disable)=="undefined")
72
  Disable = "";
 
 
73
 
74
 
75
  CountStepper = Math.ceil(CountStepper);
47
  }
48
 
49
  function putspan(BackColor, ForeColor) {
50
+ document.write("<div class='cptR-rec_countdown'><span id='cntdwn' style='font-family:" + FontFamily + ";background-color:" + BackColor + "; color:" + ForeColor + ";'></span></div>");
51
  }
52
 
53
  if (typeof(BackColor)=="undefined")
70
  LeadingZero = true;
71
  if (typeof(Disable)=="undefined")
72
  Disable = "";
73
+ if (typeof(FontFamily)=="undefined")
74
+ Disable = "Oxygen";
75
 
76
 
77
  CountStepper = Math.ceil(CountStepper);
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Plugin Name ===
2
  Contributors: Florent73
3
  Donate link: https://wpmaintenance.shost.ca/a-propos/
4
  Tags: WordPress.com, maintenance, atttente, pause, travaux, construction, launch, coming soon
5
  Requires at least: 3.0
6
  Tested up to: 4.4.1
7
- Stable tag: 2.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -67,11 +67,14 @@ Oui mais merci de me soumettre les modifications souhaitées afin de mettre à j
67
 
68
  == Upgrade Notice ==
69
 
70
- = 2.7.1 =
71
  Cette version est stable / This version is stable
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 2.7.1 =
76
  * Correction de bugs. Ajout d'un calendrier. Compatible version 4.4.1 / Fixed bugs. Add calendar. Version 4.4.1 compatible
77
 
1
+ === Plugin Name ===
2
  Contributors: Florent73
3
  Donate link: https://wpmaintenance.shost.ca/a-propos/
4
  Tags: WordPress.com, maintenance, atttente, pause, travaux, construction, launch, coming soon
5
  Requires at least: 3.0
6
  Tested up to: 4.4.1
7
+ Stable tag: 2.7.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
67
 
68
  == Upgrade Notice ==
69
 
70
+ = 2.7.2 =
71
  Cette version est stable / This version is stable
72
 
73
  == Changelog ==
74
 
75
+ = 2.7.2 =
76
+ * Correction du bug du compte à rebours. Ajout sélection Google font / Fixed countdown bug. Add Google font select.
77
+
78
  = 2.7.1 =
79
  * Correction de bugs. Ajout d'un calendrier. Compatible version 4.4.1 / Fixed bugs. Add calendar. Version 4.4.1 compatible
80
 
wp-maintenance-admin.php CHANGED
@@ -62,6 +62,16 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
62
  </style>
63
  <style type="text/css">.postbox h3 { cursor:pointer; }</style>
64
  <!--<script src="<?php echo WP_PLUGIN_URL; ?>/wp-maintenance/js/jquery-ui-timepicker-addon.js"></script>-->
 
 
 
 
 
 
 
 
 
 
65
  <div class="wrap">
66
 
67
  <h2 style="font-size: 23px;font-weight: 400;padding: 9px 15px 4px 0px;line-height: 29px;">
@@ -187,7 +197,9 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
187
  <li>&nbsp;</li>
188
 
189
  <li>
190
- <a href="#general" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
191
  </li>
192
  </ul>
193
  </div>
@@ -213,7 +225,16 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
213
  <em><stong><?php _e('Title font settings', 'wp-maintenance'); ?></stong></em>
214
  <table cellspacing="10">
215
  <tr>
216
- <td valign="top" align="left"><?php echo wpm_getFontsList('wp_maintenance_settings[font_title]', $paramMMode['font_title']); ?></td>
 
 
 
 
 
 
 
 
 
217
  <td>
218
  <?php _e('Size:', 'wp-maintenance'); ?>
219
  <input type="text" size="3" name="wp_maintenance_settings[font_title_size]" value="<?php echo stripslashes($paramMMode['font_title_size']); ?>" />px
@@ -234,7 +255,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
234
  <br /><em><?php _e('Text font settings', 'wp-maintenance'); ?></em>
235
  <table cellspacing="10">
236
  <tr>
237
- <td valign="top" align="left"><?php echo wpm_getFontsList('wp_maintenance_settings[font_text]', $paramMMode['font_text']); ?></td>
238
  <td>
239
  <?php _e('Size:', 'wp-maintenance'); ?>
240
  <input type="text" size="3" name="wp_maintenance_settings[font_text_size]" value="<?php echo stripslashes($paramMMode['font_text_size']); ?>" />px
@@ -263,7 +284,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
263
  <em><?php _e('Text font settings', 'wp-maintenance'); ?></em>
264
  <table cellspacing="10">
265
  <tr>
266
- <td valign="top" align="left"><?php echo wpm_getFontsList('wp_maintenance_settings[font_text_bottom]', $paramMMode['font_text_bottom']); ?></td>
267
  <td>
268
  <?php _e('Size:', 'wp-maintenance'); ?>
269
  <input type="text" size="3" name="wp_maintenance_settings[font_bottom_size]" value="<?php echo stripslashes($paramMMode['font_bottom_size']); ?>" />px
@@ -285,7 +306,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
285
 
286
  <li>
287
  <h3><?php _e('Choice countdown fonts and colors:', 'wp-maintenance'); ?></h3>
288
- <em><?php _e('Countdown text color:', 'wp-maintenance'); ?></em> <br /><input type="text" value="<?php echo $paramMMode['color_cpt']; ?>" name="wp_maintenance_settings[color_cpt]" class="wpm-color-field" data-default-color="#FFFFFF" /><br />
289
  <em><?php _e('Countdown background color:', 'wp-maintenance'); ?></em> <br /><input type="text" value="<?php echo $paramMMode['color_cpt_bg']; ?>" name="wp_maintenance_settings[color_cpt_bg]" class="wpm-color-field" data-default-color="#888888" /><br /><br />
290
  </li>
291
 
@@ -294,10 +315,10 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
294
  <em><?php _e('Countdown font settings', 'wp-maintenance'); ?></em>
295
  <table cellspacing="10">
296
  <tr>
297
- <td valign="top" align="left"><?php echo wpm_getFontsList('wp_maintenance_settings[font_cpt]', $paramMMode['font_cpt']); ?></td>
298
  <td>
299
  <?php _e('Size:', 'wp-maintenance'); ?>
300
- <input type="text" size="3" name="wp_maintenance_settings[date_cpt_size]" value="<?php echo stripslashes($paramMMode['date_cpt_size']); ?>" />px
301
 
302
  </td>
303
  </tr>
@@ -313,7 +334,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
313
  <!-- COULEUR WYJIYA -->
314
  <table cellspacing="10">
315
  <tr>
316
- <td valign="top" align="left"><?php echo wpm_getFontsList('wp_maintenance_settings[newletter_font_text]', $paramMMode['newletter_font_text']); ?></td>
317
  <td>
318
  <?php _e('Size:', 'wp-maintenance'); ?>
319
  <input type="text" size="3" name="wp_maintenance_settings[newletter_size]" value="<?php if( isset($paramMMode['newletter_size']) && $paramMMode['newletter_size']) { echo stripslashes($paramMMode['newletter_size']); } else { echo 14; } ?>" />px
@@ -346,7 +367,9 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
346
  <li>&nbsp;</li>
347
 
348
  <li>
349
- <a href="#couleurs" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
350
  </li>
351
 
352
  </ul>
@@ -370,8 +393,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
370
  <?php _e('You use this picture:', 'wp-maintenance'); ?><br /> <img src="<?php echo $paramMMode['image']; ?>" width="<?php echo $logoWidth; ?>" height="<?php echo $logoHeight; ?>" id="image_visuel" style="border:1px solid #333;padding:3px;" /><br />
371
  <?php } ?>
372
  <br /><small><?php _e('Enter a URL or upload an image.', 'wp-maintenance'); ?></small><br />
373
- <input id="upload_image" size="36" name="wp_maintenance_settings[image]" value="<?php echo $paramMMode['image']; ?>" type="text" /> <a href="#" id="upload_image_button" class="button" OnClick="this.blur();"><span> <?php _e('Select or Upload your picture', 'wp-maintenance'); ?> </span></a>
374
-
375
  </li>
376
  <li>&nbsp;</li>
377
 
@@ -387,14 +409,14 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
387
  <?php _e('You use this pattern:', 'wp-maintenance'); ?><br />
388
  <div style="background: url('<?php echo WP_PLUGIN_URL ?>/wp-maintenance/images/pattern<?php echo $paramMMode['b_pattern']; ?>.png');width:250px;height:250px;border:1px solid #333;"></div>
389
  <?php } ?>
390
- <input id="upload_b_image" size="36" name="wp_maintenance_settings[b_image]" value="<?php echo $paramMMode['b_image']; ?>" type="text" /> <a href="#" id="upload_b_image_button" class="button" OnClick="this.blur();"><span> <?php _e('Select or Upload your picture', 'wp-maintenance'); ?> </span></a>
391
  <br /><small><?php _e('Enter a URL or upload an image.', 'wp-maintenance'); ?></small><br /><br />
392
  <?php _e('Or choose a pattern:', 'wp-maintenance'); ?>
393
 
394
  <ul id="pattern">
395
  <li>
396
  <div style="width:50px;height:50px;border:1px solid #333;background-color:#ffffff;font-size:0.8em;"><?php _e('NO PATTERN', 'wp-maintenance'); ?></div>
397
- <input type="radio" value="0" <?php if(!$paramMMode['b_pattern'] or $paramMMode['b_pattern']==0) { echo 'checked'; } ?> name="wp_maintenance_settings[b_pattern]" />
398
  </li>
399
  <?php for ($p = 1; $p <= 12; $p++) { ?>
400
  <li>
@@ -417,7 +439,9 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
417
  <li>&nbsp;</li>
418
 
419
  <li>
420
- <a href="#image" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
421
  </li>
422
 
423
  </ul>
@@ -435,35 +459,28 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
435
  // Old version compte à rebours
436
  if( isset($paramMMode['date_cpt_jj']) && empty($paramMMode['cptdate']) ) {
437
  $paramMMode['cptdate'] = $paramMMode['date_cpt_aa'].'/'.$paramMMode['date_cpt_mm'].'/'.$paramMMode['date_cpt_jj'];
 
 
438
  }
 
439
  if( isset($paramMMode['date_cpt_hh']) && empty($paramMMode['cpttime']) ) {
440
  $paramMMode['cpttime'] = $paramMMode['date_cpt_hh'].':'.$paramMMode['date_cpt_mn'];
 
 
441
  }
442
 
443
  ?>
444
  <li><h3><?php _e('Enable a countdown ?', 'wp-maintenance'); ?></h3>
445
  <input type= "checkbox" name="wp_maintenance_settings[active_cpt]" value="1" <?php if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1 ) { echo ' checked'; } ?>>&nbsp;<?php _e('Yes', 'wp-maintenance'); ?><br /><br />
446
- <small><?php _e('Select the launch date/time', 'wp-maintenance'); ?></small><br /><img src="<?php echo WP_PLUGIN_URL.'/wp-maintenance/images/schedule_clock.png'; ?>" class="datepicker" width="48" height="48" style="vertical-align: middle;margin-right:5px;">&nbsp;<input id="cptdate" class="datepicker" name="wp_maintenance_settings[cptdate]" type="text" autofocuss data-value="<?php if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) ) { echo $paramMMode['cptdate']; } else { echo date('d').'/'.date('m').'/'.date('Y'); } ?>"> à <input id="cpttime" class="timepicker" type="time" name="wp_maintenance_settings[cpttime]" value="<?php if( isset($paramMMode['cpttime']) && !empty($paramMMode['cpttime']) ) { echo $paramMMode['cpttime']; } else { echo date('H:m'); }?>" size="4" autofocuss>
447
  <div id="wpmdatecontainer"></div>
448
  <br /><br />
449
  <input type= "checkbox" name="wp_maintenance_settings[active_cpt_s]" value="1" <?php if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1) { echo ' checked'; } ?>>&nbsp;<?php _e('Enable seconds ?', 'wp-maintenance'); ?><br /><br />
450
  <input type= "checkbox" name="wp_maintenance_settings[disable]" value="1" <?php if( isset($paramMMode['disable']) && $paramMMode['disable']==1) { echo ' checked'; } ?>>&nbsp;<?php _e('Disable maintenance mode at the end of the countdown?', 'wp-maintenance'); ?><br /><br />
451
- <?php _e('End message:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[message_cpt_fin]" COLS=70 ROWS=4><?php echo stripslashes($paramMMode['message_cpt_fin']); ?></TEXTAREA><br /><?php _e('Font size:', 'wp-maintenance'); ?> <select name="wp_maintenance_settings[date_cpt_size]">
452
- <?php
453
- $ctpSize = array('18', '24', '36', '48', '52', '56', '60', '64', '68', '72', '76');
454
- foreach($ctpSize as $c) {
455
- if( isset($paramMMode['date_cpt_size']) && $paramMMode['date_cpt_size']==$c) {
456
- $addsizeSelected = 'selected';
457
- } else {
458
- $addsizeSelected = '';
459
- }
460
- echo '<option value="'.$c.'" '.$addsizeSelected.'>'.$c.'px</option>';
461
- }
462
- ?>
463
- </select>
464
-
465
- <script type="text/javascript">
466
-
467
  jQuery(document).ready(function() {
468
 
469
  var $input = jQuery( '.datepicker' ).pickadate({
@@ -494,37 +511,28 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
494
 
495
  var picker = $input.pickadate('picker')
496
 
497
- // picker.set('select', '14 October, 2014')
498
- // picker.open()
499
-
500
- // $('button').on('click', function() {
501
- // picker.set('disable', true);
502
- // });
503
  var $input = jQuery( '.timepicker' ).pickatime({
504
  //container: '#wpmtimecontainer',
505
  clear: '<?php _e('Close', 'wp-maintenance'); ?>',
506
- interval: 30,
 
507
  format: 'HH:i', // retour ce format dans le input
508
  formatSubmit: 'HH:i', // return ce format en post
509
  formatLabel: '<b>HH</b>:i', // Affichage
510
- //min: -0.5, // heure minimum
511
- /*formatLabel: function(time) {
512
- var hours = ( time.pick - this.get('now').pick ) / 60,
513
- label = hours < 0 ? ' !hours to now' : hours > 0 ? ' !heures' : ''
514
- return 'HH:i <sm!all>(->' + ( hours ? Math.abs(hours) : '' ) + label +')</sm!all>'
515
- }*/
516
  })
517
  var picker = $input.pickatime('picker')
518
- // picker.open()
519
-
520
-
521
  });
522
 
523
  </script>
524
  </li>
525
  <li>&nbsp;</li>
526
  <li>
527
- <a href="#compte" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
528
  </li>
529
  </ul>
530
  </div>
@@ -580,7 +588,9 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
580
  <li>&nbsp;</li>
581
 
582
  <li>
583
- <a href="#styles" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
584
  </li>
585
  </ul>
586
  </div>
@@ -631,7 +641,7 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
631
 
632
  <li><h3><?php _e('Header Code:', 'wp-maintenance'); ?></h3>
633
  <?php _e('The following code will add to the <head> tag. Useful if you need to add additional scripts such as CSS or JS.', 'wp-maintenance'); ?>&nbsp;<br /><br />
634
- <TEXTAREA NAME="wp_maintenance_settings[headercode]" COLS=70 ROWS=14 style="width:80%;"><?php echo stripslashes($paramMMode['headercode']); ?></TEXTAREA>
635
  </li>
636
  <li>&nbsp;</li>
637
 
@@ -644,7 +654,9 @@ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) {
644
  <?php } // End secure for demo mode ?>
645
 
646
  <li>
647
- <a href="#options" id="submitbutton" OnClick="document.forms['valide_maintenance'].submit();this.blur();" name="Save" class="button-primary"><span> <?php _e('Save this settings', 'wp-maintenance'); ?> </span></a>
 
 
648
  </li>
649
 
650
  </ul>
62
  </style>
63
  <style type="text/css">.postbox h3 { cursor:pointer; }</style>
64
  <!--<script src="<?php echo WP_PLUGIN_URL; ?>/wp-maintenance/js/jquery-ui-timepicker-addon.js"></script>-->
65
+ <script>
66
+ jQuery(document).ready(function() {
67
+ jQuery('#font_title').fontselect();
68
+ jQuery('#font_text').fontselect();
69
+ jQuery('#font_text_bottom').fontselect();
70
+ jQuery('#font_text_cpt').fontselect();
71
+ jQuery('newletter_font_text').fontselect();
72
+ });
73
+
74
+ </script>
75
  <div class="wrap">
76
 
77
  <h2 style="font-size: 23px;font-weight: 400;padding: 9px 15px 4px 0px;line-height: 29px;">
197
  <li>&nbsp;</li>
198
 
199
  <li>
200
+ <p>
201
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
202
+ </p>
203
  </li>
204
  </ul>
205
  </div>
225
  <em><stong><?php _e('Title font settings', 'wp-maintenance'); ?></stong></em>
226
  <table cellspacing="10">
227
  <tr>
228
+ <td valign="top" align="left"><input name="wp_maintenance_settings[font_title]" id="font_title" type="text" value="<?php echo $paramMMode['font_title']; ?>" />
229
+
230
+ <div id="fontSelect" class="fontSelect">
231
+ <div class="arrow-down"></div>
232
+ </div>
233
+
234
+ <div id="fontSelect2" class="fontSelect">
235
+ <div class="arrow-down"></div>
236
+ </div>
237
+ </td>
238
  <td>
239
  <?php _e('Size:', 'wp-maintenance'); ?>
240
  <input type="text" size="3" name="wp_maintenance_settings[font_title_size]" value="<?php echo stripslashes($paramMMode['font_title_size']); ?>" />px
255
  <br /><em><?php _e('Text font settings', 'wp-maintenance'); ?></em>
256
  <table cellspacing="10">
257
  <tr>
258
+ <td valign="top" align="left"><input name="wp_maintenance_settings[font_text]" id="font_text" type="text" value="<?php echo $paramMMode['font_text']; ?>" /></td>
259
  <td>
260
  <?php _e('Size:', 'wp-maintenance'); ?>
261
  <input type="text" size="3" name="wp_maintenance_settings[font_text_size]" value="<?php echo stripslashes($paramMMode['font_text_size']); ?>" />px
284
  <em><?php _e('Text font settings', 'wp-maintenance'); ?></em>
285
  <table cellspacing="10">
286
  <tr>
287
+ <td valign="top" align="left"><input name="wp_maintenance_settings[font_text_bottom]" id="font_text_bottom" type="text" value="<?php echo $paramMMode['font_text_bottom']; ?>" /></td>
288
  <td>
289
  <?php _e('Size:', 'wp-maintenance'); ?>
290
  <input type="text" size="3" name="wp_maintenance_settings[font_bottom_size]" value="<?php echo stripslashes($paramMMode['font_bottom_size']); ?>" />px
306
 
307
  <li>
308
  <h3><?php _e('Choice countdown fonts and colors:', 'wp-maintenance'); ?></h3>
309
+ <em><?php _e('Countdown text color:', 'wp-maintenance'); ?></em> <br /><input type="text" value="<?php echo $paramMMode['color_cpt']; ?>" name="wp_maintenance_settings[color_cpt]" class="wpm-color-field" data-default-color="#888888" /><br />
310
  <em><?php _e('Countdown background color:', 'wp-maintenance'); ?></em> <br /><input type="text" value="<?php echo $paramMMode['color_cpt_bg']; ?>" name="wp_maintenance_settings[color_cpt_bg]" class="wpm-color-field" data-default-color="#888888" /><br /><br />
311
  </li>
312
 
315
  <em><?php _e('Countdown font settings', 'wp-maintenance'); ?></em>
316
  <table cellspacing="10">
317
  <tr>
318
+ <td valign="top" align="left"><input name="wp_maintenance_settings[font_cpt]" id="font_text_cpt" type="text" value="<?php echo $paramMMode['font_cpt']; ?>" /></td>
319
  <td>
320
  <?php _e('Size:', 'wp-maintenance'); ?>
321
+ <input type="text" size="3" id="date_cpt_size" name="wp_maintenance_settings[date_cpt_size]" value="<?php echo trim($paramMMode['date_cpt_size']); ?>" />px
322
 
323
  </td>
324
  </tr>
334
  <!-- COULEUR WYJIYA -->
335
  <table cellspacing="10">
336
  <tr>
337
+ <td valign="top" align="left"><input name="wp_maintenance_settings[newletter_font_text]" id="font_text_bottom" type="text" value="<?php echo $paramMMode['newletter_font_text']; ?>" /></td>
338
  <td>
339
  <?php _e('Size:', 'wp-maintenance'); ?>
340
  <input type="text" size="3" name="wp_maintenance_settings[newletter_size]" value="<?php if( isset($paramMMode['newletter_size']) && $paramMMode['newletter_size']) { echo stripslashes($paramMMode['newletter_size']); } else { echo 14; } ?>" />px
367
  <li>&nbsp;</li>
368
 
369
  <li>
370
+ <p>
371
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
372
+ </p>
373
  </li>
374
 
375
  </ul>
393
  <?php _e('You use this picture:', 'wp-maintenance'); ?><br /> <img src="<?php echo $paramMMode['image']; ?>" width="<?php echo $logoWidth; ?>" height="<?php echo $logoHeight; ?>" id="image_visuel" style="border:1px solid #333;padding:3px;" /><br />
394
  <?php } ?>
395
  <br /><small><?php _e('Enter a URL or upload an image.', 'wp-maintenance'); ?></small><br />
396
+ <input id="upload_image" size="36" name="wp_maintenance_settings[image]" value="<?php echo $paramMMode['image']; ?>" type="text" /> <a href="#" id="upload_image_button" class="button" OnClick="this.blur();"><span> <?php _e('Select or Upload your picture', 'wp-maintenance'); ?> </span></a>
 
397
  </li>
398
  <li>&nbsp;</li>
399
 
409
  <?php _e('You use this pattern:', 'wp-maintenance'); ?><br />
410
  <div style="background: url('<?php echo WP_PLUGIN_URL ?>/wp-maintenance/images/pattern<?php echo $paramMMode['b_pattern']; ?>.png');width:250px;height:250px;border:1px solid #333;"></div>
411
  <?php } ?>
412
+ <input id="upload_b_image" size="36" name="wp_maintenance_settings[b_image]" value="<?php if( isset($paramMMode['b_image']) && !empty($paramMMode['b_image']) ) { echo $paramMMode['b_image']; } ?>" type="text" /> <a href="#" id="upload_b_image_button" class="button" OnClick="this.blur();"><span> <?php _e('Select or Upload your picture', 'wp-maintenance'); ?> </span></a>
413
  <br /><small><?php _e('Enter a URL or upload an image.', 'wp-maintenance'); ?></small><br /><br />
414
  <?php _e('Or choose a pattern:', 'wp-maintenance'); ?>
415
 
416
  <ul id="pattern">
417
  <li>
418
  <div style="width:50px;height:50px;border:1px solid #333;background-color:#ffffff;font-size:0.8em;"><?php _e('NO PATTERN', 'wp-maintenance'); ?></div>
419
+ <input type="radio" value="0" <?php if( empty($paramMMode['b_pattern']) or $paramMMode['b_pattern']==0) { echo 'checked'; } ?> name="wp_maintenance_settings[b_pattern]" />
420
  </li>
421
  <?php for ($p = 1; $p <= 12; $p++) { ?>
422
  <li>
439
  <li>&nbsp;</li>
440
 
441
  <li>
442
+ <p>
443
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
444
+ </p>
445
  </li>
446
 
447
  </ul>
459
  // Old version compte à rebours
460
  if( isset($paramMMode['date_cpt_jj']) && empty($paramMMode['cptdate']) ) {
461
  $paramMMode['cptdate'] = $paramMMode['date_cpt_aa'].'/'.$paramMMode['date_cpt_mm'].'/'.$paramMMode['date_cpt_jj'];
462
+ } else if ( empty($paramMMode['cptdate']) ) {
463
+ $paramMMode['cptdate'] = date('d').'/'.date('m').'/'.date('Y');
464
  }
465
+
466
  if( isset($paramMMode['date_cpt_hh']) && empty($paramMMode['cpttime']) ) {
467
  $paramMMode['cpttime'] = $paramMMode['date_cpt_hh'].':'.$paramMMode['date_cpt_mn'];
468
+ } else if ( empty($paramMMode['cpttime']) ) {
469
+ $paramMMode['cpttime'] = date( 'H:i', (time()+3600) );
470
  }
471
 
472
  ?>
473
  <li><h3><?php _e('Enable a countdown ?', 'wp-maintenance'); ?></h3>
474
  <input type= "checkbox" name="wp_maintenance_settings[active_cpt]" value="1" <?php if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1 ) { echo ' checked'; } ?>>&nbsp;<?php _e('Yes', 'wp-maintenance'); ?><br /><br />
475
+ <small><?php _e('Select the launch date/time', 'wp-maintenance'); ?></small><br /><img src="<?php echo WP_PLUGIN_URL.'/wp-maintenance/images/schedule_clock.png'; ?>" class="datepicker" width="48" height="48" style="vertical-align: middle;margin-right:5px;">&nbsp;<input id="cptdate" class="datepicker" name="wp_maintenance_settings[cptdate]" type="text" autofocuss data-value="<?php if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) ) { echo $paramMMode['cptdate']; } ?>"> à <input id="cpttime" class="timepicker" type="time" name="wp_maintenance_settings[cpttime]" value="<?php if( isset($paramMMode['cpttime']) && !empty($paramMMode['cpttime']) ) { echo $paramMMode['cpttime']; } ?>" size="4" autofocuss>
476
  <div id="wpmdatecontainer"></div>
477
  <br /><br />
478
  <input type= "checkbox" name="wp_maintenance_settings[active_cpt_s]" value="1" <?php if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1) { echo ' checked'; } ?>>&nbsp;<?php _e('Enable seconds ?', 'wp-maintenance'); ?><br /><br />
479
  <input type= "checkbox" name="wp_maintenance_settings[disable]" value="1" <?php if( isset($paramMMode['disable']) && $paramMMode['disable']==1) { echo ' checked'; } ?>>&nbsp;<?php _e('Disable maintenance mode at the end of the countdown?', 'wp-maintenance'); ?><br /><br />
480
+ <?php _e('End message:', 'wp-maintenance'); ?><br /><TEXTAREA NAME="wp_maintenance_settings[message_cpt_fin]" COLS=70 ROWS=4><?php echo stripslashes($paramMMode['message_cpt_fin']); ?></TEXTAREA><br />
481
+
482
+ <script type="text/javascript">
483
+
 
 
 
 
 
 
 
 
 
 
 
 
484
  jQuery(document).ready(function() {
485
 
486
  var $input = jQuery( '.datepicker' ).pickadate({
511
 
512
  var picker = $input.pickadate('picker')
513
 
514
+
 
 
 
 
 
515
  var $input = jQuery( '.timepicker' ).pickatime({
516
  //container: '#wpmtimecontainer',
517
  clear: '<?php _e('Close', 'wp-maintenance'); ?>',
518
+ interval: 5,
519
+ editable: undefined,
520
  format: 'HH:i', // retour ce format dans le input
521
  formatSubmit: 'HH:i', // return ce format en post
522
  formatLabel: '<b>HH</b>:i', // Affichage
523
+
 
 
 
 
 
524
  })
525
  var picker = $input.pickatime('picker')
526
+
 
 
527
  });
528
 
529
  </script>
530
  </li>
531
  <li>&nbsp;</li>
532
  <li>
533
+ <p>
534
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
535
+ </p>
536
  </li>
537
  </ul>
538
  </div>
588
  <li>&nbsp;</li>
589
 
590
  <li>
591
+ <p>
592
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
593
+ </p>
594
  </li>
595
  </ul>
596
  </div>
641
 
642
  <li><h3><?php _e('Header Code:', 'wp-maintenance'); ?></h3>
643
  <?php _e('The following code will add to the <head> tag. Useful if you need to add additional scripts such as CSS or JS.', 'wp-maintenance'); ?>&nbsp;<br /><br />
644
+ <TEXTAREA NAME="wp_maintenance_settings[headercode]" COLS=70 ROWS=14 style="width:80%;"><?php if( isset($paramMMode['headercode']) ) { echo stripslashes($paramMMode['headercode']); } ?></TEXTAREA>
645
  </li>
646
  <li>&nbsp;</li>
647
 
654
  <?php } // End secure for demo mode ?>
655
 
656
  <li>
657
+ <p>
658
+ <input type="submit" name="wpm_update_settings" class="button-primary" value="<?php _e('Save this settings', 'wp-maintenance'); ?>"/>
659
+ </p>
660
  </li>
661
 
662
  </ul>
wp-maintenance.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Le plugin WP Maintenance vous permet de mettre votre site en attente le temps pour vous de faire une maintenance ou du lancement de votre site. Personnalisez cette page de maintenance avec une image, un compte à rebours, etc... / The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
7
  * Author: Florent Maillefaud
8
  * Author URI: https://wpmaintenance.shost.ca
9
- * Version: 2.7.1
10
  * Text Domain: wp-maintenance
11
  * Domain Path: /languages/
12
  */
@@ -14,6 +14,7 @@
14
 
15
  /*
16
  Change Log
 
17
  11/12/2015 - Corrige le bug couleur de fond. Ajout DatePicker pour compteur
18
  06/12/2015 - Autorise certaines IP
19
  04/12/2015 - Correction notice php (undefined index)
@@ -90,7 +91,7 @@ function wpm_make_multilang() {
90
  }
91
 
92
  /* Ajoute la version dans les options */
93
- define('WPM_VERSION', '2.7.1');
94
  $option['wp_maintenance_version'] = WPM_VERSION;
95
  if( !get_option('wp_maintenance_version') ) {
96
  add_option('wp_maintenance_version', $option);
@@ -114,7 +115,7 @@ add_action( 'admin_bar_menu', 'wpm_add_menu_admin_bar', 999 );
114
  function wpm_add_menu_admin_bar( $wp_admin_bar ) {
115
 
116
  $checkActive = get_option('wp_maintenance_active');
117
- if(isset($checkActive) && $checkActive==1) {
118
  $textAdmin = '<img src="'.WP_PLUGIN_URL.'/wp-maintenance/images/lock.png" style="padding: 6px 0;float:left;margin-right: 6px;">'.__('Maintenance mode activated!', 'wp-maintenance');
119
  $args = array(
120
  'id' => 'wpm-info', // id of the existing child node (New > Post)
@@ -147,7 +148,7 @@ function wpm_get_ip() {
147
  function wpm_add_admin() {
148
 
149
  $wp_maintenanceAdminOptions = array(
150
- 'enable' => 0,
151
  'color_bg' => "#f1f1f1",
152
  'color_txt' => '#888888',
153
  'color_bg_bottom' => '#333333',
@@ -156,13 +157,20 @@ function wpm_add_admin() {
156
  'text_maintenance' => __('Come back quickly !', 'wp-maintenance'),
157
  'userlimit' => 'administrator',
158
  'image' => WP_PLUGIN_URL.'/wp-maintenance/images/default.png',
159
- 'font_title' => 'Oxygen',
160
  'font_title_size' => 40,
161
- 'font_text' => 'Oxygen',
162
- 'font_text_size' => 40,
163
- 'font_text_bottom' => 'Oxygen',
 
 
 
 
164
  'font_bottom_size' => 12,
165
- 'font_cpt' => 'Oxygen',
 
 
 
166
  'enable_demo' => 0,
167
  'color_text_button' => '#FFFFFF',
168
  'color_button' => '#1e73be',
@@ -170,14 +178,10 @@ function wpm_add_admin() {
170
  'image_height' => 100,
171
  'newletter' => 0,
172
  'active_cpt' => 0,
173
- 'newletter_font_text' => '#333333',
174
  'newletter_size' => 18,
175
  'newletter_font_style' => '',
176
  'newletter_font_weigth' => 'normal',
177
- 'newletter_font_text' => 20,
178
- 'font_title_style' => 'normal',
179
- 'font_text_style' => 'normal',
180
- 'font_bottom_style' => 'normal',
181
  'title_newletter' => '',
182
  'code_newletter' => '',
183
  'code_analytics' => '',
@@ -187,6 +191,13 @@ function wpm_add_admin() {
187
  'b_enable_image' => 0,
188
  'disable' => 0,
189
  'pageperso' => 0,
 
 
 
 
 
 
 
190
  );
191
  $getMaintenanceSettings = get_option('wp_maintenance_settings');
192
  if (!empty($getMaintenanceSettings)) {
@@ -225,7 +236,7 @@ function wpm_admin_scripts() {
225
  wp_enqueue_style('jquery-defaut-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.css');
226
  wp_enqueue_style('jquery-date-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.date.css');
227
  wp_enqueue_style('jquery-time-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.time.css');
228
-
229
  // If you're not including an image upload then you can leave this function call out
230
  wp_enqueue_media();
231
 
@@ -235,6 +246,8 @@ function wpm_admin_scripts() {
235
  'title' => __( 'Choose Image', 'wp-maintenance' ),
236
  ) );
237
 
 
 
238
 
239
  //if( wpm_protocole()=='' ) {
240
  wp_register_script('wpm-admin-settings', WP_PLUGIN_URL.'/wp-maintenance/js/wpm-admin-settings.js');
@@ -420,12 +433,18 @@ function wpm_maintenance_mode() {
420
  $statusActive = 0;
421
  }
422
 
 
 
 
 
 
 
 
 
 
423
  /* Si on désactive le mode maintenance en fin de compte à rebours */
424
  if( ( isset($paramMMode['disable']) && $paramMMode['disable']==1 ) && $statusActive == 1 ) {
425
 
426
- $dateNow = strtotime(date("d-m-Y H:i:s")) + 3600 * get_option('gmt_offset');
427
- $dateFinCpt = strtotime(date($paramMMode['date_cpt_jj'].'-'.$paramMMode['date_cpt_mm'].'-'.$paramMMode['date_cpt_aa'].' '.$paramMMode['date_cpt_hh'].':'.$paramMMode['date_cpt_mn'].':'.$paramMMode['date_cpt_ss']));
428
-
429
  if( $dateNow > $dateFinCpt ) {
430
  $ChangeStatus = wpm_change_active();
431
  $statusActive = 0;
@@ -460,14 +479,7 @@ function wpm_maintenance_mode() {
460
 
461
  /* Défninition des couleurs par défault */
462
  if( !isset($paramMMode['color_bg']) || $paramMMode['color_bg']=="") { $paramMMode['color_bg'] = "#f1f1f1"; }
463
- if( !isset($paramMMode['color_txt']) || $paramMMode['color_txt']=="") { $paramMMode['color_txt'] = "#888888"; }
464
-
465
- /* Date compte à rebours / Convertie en format US */
466
- if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) && isset($paramMMode['cpttime']) ) {
467
- $timestamp = strtotime($paramMMode['cptdate'].' '.$paramMMode['cpttime']);
468
- $dateCpt = date('m/d/Y h:i A', $timestamp);
469
- }
470
-
471
 
472
  /* Traitement de la feuille de style */
473
  $styleRemplacements = array (
@@ -510,7 +522,7 @@ function wpm_maintenance_mode() {
510
  } else {
511
  $BottomSocialIcons = '';
512
  }
513
- if( isset($paramMMode['image']) && $paramMMode['image']) {
514
  list($logoWidth, $logoHeight, $logoType, $logoAttr) = getimagesize($paramMMode['image']);
515
  $LogoImage = '<div id="logo"><img src="'.$paramMMode['image'].'" width="'.$logoWidth.'" height="'.$logoHeight.'" alt="'.get_bloginfo( 'name', 'display' ).' '.get_bloginfo( 'description', 'display' ).'" title="'.get_bloginfo( 'name', 'display' ).' '.get_bloginfo( 'description', 'display' ).'" /></div>';
516
  } else {
@@ -586,6 +598,7 @@ body {
586
  if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1) {
587
 
588
  if( isset($paramMMode['message_cpt_fin']) && $paramMMode['message_cpt_fin']!='' && (isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate'])) ) {
 
589
  $Counter = '
590
  <div id="countdown">
591
  <script language="JavaScript">
@@ -595,18 +608,19 @@ body {
595
  ForeColor = "'.$paramMMode['color_cpt'].'";
596
  Disable = "'.$paramMMode['disable'].'";
597
  UrlDisable = "'.get_option( 'siteurl').'";
 
598
  CountActive = true;
599
  CountStepper = -1;
600
  LeadingZero = true;
601
  ';
602
  $Counter .= " DisplayFormat = '<div id=\"wpm-cpt-day\">%%D%%<br /><span id=\"wpm-cpt-days-span\">".__('Days', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-hours\">%%H%%<br /><span id=\"wpm-cpt-hours-span\">".__('Hours', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-minutes\">%%M%%<br /><span id=\"wpm-cpt-minutes-span\">".__('Minutes', 'wp-maintenance')."</span></div>";
603
- if($paramMMode['active_cpt_s']==1) {
604
- $Counter .= '<div id="wpm-cpt-seconds">%%S%%<br /><span id="wpm-cpt-seconds-span">'.__('Seconds', 'wp-maintenance').'</span></div>';
605
  }
606
  $Counter .= "';";
607
- $Counter .='
608
- FinishMessage = "'.stripslashes($paramMMode['message_cpt_fin']).'";
609
- </script>';
610
  $Counter .= '
611
  <script language="JavaScript" src="'.WP_PLUGIN_URL.'/wp-maintenance/js/wpm-cpt-script.js"></script>
612
  </div>';
@@ -649,10 +663,10 @@ $wpmStyle .= '}';
649
 
650
  $wpmStyle .= '
651
  h3 {';
 
652
  if( isset($paramMMode['font_title_size']) ) { $wpmStyle .= 'font-size: '.$paramMMode['font_title_size'].'px;'; }
653
  if( isset($paramMMode['font_title_style']) ) { $wpmStyle .= 'font-style: '.$paramMMode['font_title_style'].';'; }
654
  if( isset($paramMMode['font_title_weigth']) ) { $wpmStyle .= 'font-weight: '.$paramMMode['font_title_weigth'].';'; }
655
- if( isset($paramMMode['font_title']) ) { $wpmStyle .= 'font-family: '.$paramMMode['font_title'].', serif;'; }
656
  if( isset($paramMMode['color_txt']) ) { $wpmStyle .= 'color:'.$paramMMode['color_txt'].';'; }
657
  $wpmStyle .= '
658
  line-height: 100%;
@@ -776,4 +790,4 @@ if(function_exists('register_deactivation_hook')) {
776
  //intègre le tout aux pages Admin de Wordpress
777
  add_action("admin_menu", "wpm_add_admin");
778
 
779
- ?>
6
  * Description: Le plugin WP Maintenance vous permet de mettre votre site en attente le temps pour vous de faire une maintenance ou du lancement de votre site. Personnalisez cette page de maintenance avec une image, un compte à rebours, etc... / The WP Maintenance plugin allows you to put your website on the waiting time for you to do maintenance or launch your website. Personalize this page with picture, countdown...
7
  * Author: Florent Maillefaud
8
  * Author URI: https://wpmaintenance.shost.ca
9
+ * Version: 2.7.2
10
  * Text Domain: wp-maintenance
11
  * Domain Path: /languages/
12
  */
14
 
15
  /*
16
  Change Log
17
+ 27/01/2016 - Corrige le bug compteur, ajout selection google font
18
  11/12/2015 - Corrige le bug couleur de fond. Ajout DatePicker pour compteur
19
  06/12/2015 - Autorise certaines IP
20
  04/12/2015 - Correction notice php (undefined index)
91
  }
92
 
93
  /* Ajoute la version dans les options */
94
+ define('WPM_VERSION', '2.7.2');
95
  $option['wp_maintenance_version'] = WPM_VERSION;
96
  if( !get_option('wp_maintenance_version') ) {
97
  add_option('wp_maintenance_version', $option);
115
  function wpm_add_menu_admin_bar( $wp_admin_bar ) {
116
 
117
  $checkActive = get_option('wp_maintenance_active');
118
+ if( isset($checkActive) && $checkActive==1 && !is_network_admin() ) {
119
  $textAdmin = '<img src="'.WP_PLUGIN_URL.'/wp-maintenance/images/lock.png" style="padding: 6px 0;float:left;margin-right: 6px;">'.__('Maintenance mode activated!', 'wp-maintenance');
120
  $args = array(
121
  'id' => 'wpm-info', // id of the existing child node (New > Post)
148
  function wpm_add_admin() {
149
 
150
  $wp_maintenanceAdminOptions = array(
151
+ 'enable' => 0,
152
  'color_bg' => "#f1f1f1",
153
  'color_txt' => '#888888',
154
  'color_bg_bottom' => '#333333',
157
  'text_maintenance' => __('Come back quickly !', 'wp-maintenance'),
158
  'userlimit' => 'administrator',
159
  'image' => WP_PLUGIN_URL.'/wp-maintenance/images/default.png',
160
+ 'font_title' => 'Pacifico',
161
  'font_title_size' => 40,
162
+ 'font_title_weigth' => 'normal',
163
+ 'font_title_style' => '',
164
+ 'font_text_style' => '',
165
+ 'font_text' => 'Metrophobic',
166
+ 'font_text_size' => 18,
167
+ 'font_text_bottom' => 'Pacifico',
168
+ 'font_text_weigth' => 'normal',
169
  'font_bottom_size' => 12,
170
+ 'font_bottom_weigth' => 'normal',
171
+ 'font_bottom_style' => '',
172
+ 'font_cpt' => 'Pacifico',
173
+ 'color_cpt' => '#333333',
174
  'enable_demo' => 0,
175
  'color_text_button' => '#FFFFFF',
176
  'color_button' => '#1e73be',
178
  'image_height' => 100,
179
  'newletter' => 0,
180
  'active_cpt' => 0,
181
+ 'newletter_font_text' => 'Pacifico',
182
  'newletter_size' => 18,
183
  'newletter_font_style' => '',
184
  'newletter_font_weigth' => 'normal',
 
 
 
 
185
  'title_newletter' => '',
186
  'code_newletter' => '',
187
  'code_analytics' => '',
191
  'b_enable_image' => 0,
192
  'disable' => 0,
193
  'pageperso' => 0,
194
+ 'date_cpt_size' => 40,
195
+ 'color_bg_header' => '#f1f1f1',
196
+ 'add_wplogin_title' => '',
197
+ 'headercode' => '',
198
+ 'message_cpt_fin' => '',
199
+ 'b_repeat_image' => '',
200
+ 'color_cpt_bg' => '',
201
  );
202
  $getMaintenanceSettings = get_option('wp_maintenance_settings');
203
  if (!empty($getMaintenanceSettings)) {
236
  wp_enqueue_style('jquery-defaut-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.css');
237
  wp_enqueue_style('jquery-date-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.date.css');
238
  wp_enqueue_style('jquery-time-style', WP_PLUGIN_URL.'/wp-maintenance/js/lib/themes/default.time.css');
239
+ wp_enqueue_style('jquery-fontselect-style', WP_PLUGIN_URL.'/wp-maintenance/js/fontselect/fontselect.css');
240
  // If you're not including an image upload then you can leave this function call out
241
  wp_enqueue_media();
242
 
246
  'title' => __( 'Choose Image', 'wp-maintenance' ),
247
  ) );
248
 
249
+ wp_register_script('wpm-admin-fontselect', WP_PLUGIN_URL.'/wp-maintenance/js/fontselect/jquery.fontselect.min.js');
250
+ wp_enqueue_script('wpm-admin-fontselect');
251
 
252
  //if( wpm_protocole()=='' ) {
253
  wp_register_script('wpm-admin-settings', WP_PLUGIN_URL.'/wp-maintenance/js/wpm-admin-settings.js');
433
  $statusActive = 0;
434
  }
435
 
436
+ /* on doit retourner 12/31/2020 5:00 AM */
437
+ $dateNow = strtotime(date("Y-m-d H:i:s")) + 3600 * get_option('gmt_offset');
438
+ if( get_option('wp_maintenance_version') <= '2.7.0') {
439
+ $dateFinCpt = strtotime( date($paramMMode['date_cpt_jj'].'-'.$paramMMode['date_cpt_mm'].'-'.$paramMMode['date_cpt_aa'].' '.$paramMMode['date_cpt_hh'].':'.$paramMMode['date_cpt_mn'].':'.$paramMMode['date_cpt_ss']) );
440
+ } else if( isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate']) ) {
441
+ $dateFinCpt = strtotime( date( str_replace('/', '-', $paramMMode['cptdate']).' '.$paramMMode['cpttime'].':00') );
442
+ $dateCpt = date( 'm/d/Y h:i A', strtotime( $paramMMode['cptdate'].' '.$paramMMode['cpttime'] ) );
443
+ }
444
+
445
  /* Si on désactive le mode maintenance en fin de compte à rebours */
446
  if( ( isset($paramMMode['disable']) && $paramMMode['disable']==1 ) && $statusActive == 1 ) {
447
 
 
 
 
448
  if( $dateNow > $dateFinCpt ) {
449
  $ChangeStatus = wpm_change_active();
450
  $statusActive = 0;
479
 
480
  /* Défninition des couleurs par défault */
481
  if( !isset($paramMMode['color_bg']) || $paramMMode['color_bg']=="") { $paramMMode['color_bg'] = "#f1f1f1"; }
482
+ if( !isset($paramMMode['color_txt']) || $paramMMode['color_txt']=="") { $paramMMode['color_txt'] = "#888888"; }
 
 
 
 
 
 
 
483
 
484
  /* Traitement de la feuille de style */
485
  $styleRemplacements = array (
522
  } else {
523
  $BottomSocialIcons = '';
524
  }
525
+ if( isset($paramMMode['image']) && $paramMMode['image'] ) {
526
  list($logoWidth, $logoHeight, $logoType, $logoAttr) = getimagesize($paramMMode['image']);
527
  $LogoImage = '<div id="logo"><img src="'.$paramMMode['image'].'" width="'.$logoWidth.'" height="'.$logoHeight.'" alt="'.get_bloginfo( 'name', 'display' ).' '.get_bloginfo( 'description', 'display' ).'" title="'.get_bloginfo( 'name', 'display' ).' '.get_bloginfo( 'description', 'display' ).'" /></div>';
528
  } else {
598
  if( isset($paramMMode['active_cpt']) && $paramMMode['active_cpt']==1) {
599
 
600
  if( isset($paramMMode['message_cpt_fin']) && $paramMMode['message_cpt_fin']!='' && (isset($paramMMode['cptdate']) && !empty($paramMMode['cptdate'])) ) {
601
+ if( !isset($paramMMode['disable']) ) { $paramMMode['disable'] = 0; }
602
  $Counter = '
603
  <div id="countdown">
604
  <script language="JavaScript">
608
  ForeColor = "'.$paramMMode['color_cpt'].'";
609
  Disable = "'.$paramMMode['disable'].'";
610
  UrlDisable = "'.get_option( 'siteurl').'";
611
+ FontFamily = "'.$paramMMode['font_cpt'].'";
612
  CountActive = true;
613
  CountStepper = -1;
614
  LeadingZero = true;
615
  ';
616
  $Counter .= " DisplayFormat = '<div id=\"wpm-cpt-day\">%%D%%<br /><span id=\"wpm-cpt-days-span\">".__('Days', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-hours\">%%H%%<br /><span id=\"wpm-cpt-hours-span\">".__('Hours', 'wp-maintenance')."</span></div><div id=\"wpm-cpt-minutes\">%%M%%<br /><span id=\"wpm-cpt-minutes-span\">".__('Minutes', 'wp-maintenance')."</span></div>";
617
+ if( isset($paramMMode['active_cpt_s']) && $paramMMode['active_cpt_s']==1 ) {
618
+ $Counter .= '<div id="wpm-cpt-seconds">%%S%%<br /><span id="wpm-cpt-seconds-span">'.__('Seconds', 'wp-maintenance').'</span></div>';
619
  }
620
  $Counter .= "';";
621
+ $Counter .= '
622
+ FinishMessage = "'.trim( stripslashes($paramMMode['message_cpt_fin']) ).'";
623
+ </script>';
624
  $Counter .= '
625
  <script language="JavaScript" src="'.WP_PLUGIN_URL.'/wp-maintenance/js/wpm-cpt-script.js"></script>
626
  </div>';
663
 
664
  $wpmStyle .= '
665
  h3 {';
666
+ if( isset($paramMMode['font_title']) ) { $wpmStyle .= 'font-family: '.$paramMMode['font_title'].', serif;'; }
667
  if( isset($paramMMode['font_title_size']) ) { $wpmStyle .= 'font-size: '.$paramMMode['font_title_size'].'px;'; }
668
  if( isset($paramMMode['font_title_style']) ) { $wpmStyle .= 'font-style: '.$paramMMode['font_title_style'].';'; }
669
  if( isset($paramMMode['font_title_weigth']) ) { $wpmStyle .= 'font-weight: '.$paramMMode['font_title_weigth'].';'; }
 
670
  if( isset($paramMMode['color_txt']) ) { $wpmStyle .= 'color:'.$paramMMode['color_txt'].';'; }
671
  $wpmStyle .= '
672
  line-height: 100%;
790
  //intègre le tout aux pages Admin de Wordpress
791
  add_action("admin_menu", "wpm_add_admin");
792
 
793
+ ?>