WPtouch - Version 4.3.26

Version Description

Download this release

Release Info

Developer wptouch
Plugin Icon 128x128 WPtouch
Version 4.3.26
Comparing to
See all releases

Code changes from version 4.3.25 to 4.3.26

admin/customizer/color-thief/color-thief.js ADDED
@@ -0,0 +1,610 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Color Thief v2.0
3
+ * by Lokesh Dhakar - http://www.lokeshdhakar.com
4
+ *
5
+ * Thanks
6
+ * ------
7
+ * Nick Rabinowitz - For creating quantize.js.
8
+ * John Schulz - For clean up and optimization. @JFSIII
9
+ * Nathan Spady - For adding drag and drop support to the demo page.
10
+ *
11
+ * License
12
+ * -------
13
+ * Copyright 2011, 2015 Lokesh Dhakar
14
+ * Released under the MIT license
15
+ * https://raw.githubusercontent.com/lokesh/color-thief/master/LICENSE
16
+ *
17
+ */
18
+
19
+
20
+ /*
21
+ CanvasImage Class
22
+ Class that wraps the html image element and canvas.
23
+ It also simplifies some of the canvas context manipulation
24
+ with a set of helper functions.
25
+ */
26
+ var CanvasImage = function (image) {
27
+ this.canvas = document.createElement('canvas');
28
+ this.context = this.canvas.getContext('2d');
29
+
30
+ document.body.appendChild(this.canvas);
31
+
32
+ this.width = this.canvas.width = image.width;
33
+ this.height = this.canvas.height = image.height;
34
+
35
+ this.context.drawImage(image, 0, 0, this.width, this.height);
36
+ };
37
+
38
+ CanvasImage.prototype.clear = function () {
39
+ this.context.clearRect(0, 0, this.width, this.height);
40
+ };
41
+
42
+ CanvasImage.prototype.update = function (imageData) {
43
+ this.context.putImageData(imageData, 0, 0);
44
+ };
45
+
46
+ CanvasImage.prototype.getPixelCount = function () {
47
+ return this.width * this.height;
48
+ };
49
+
50
+ CanvasImage.prototype.getImageData = function () {
51
+ return this.context.getImageData(0, 0, this.width, this.height);
52
+ };
53
+
54
+ CanvasImage.prototype.removeCanvas = function () {
55
+ this.canvas.parentNode.removeChild(this.canvas);
56
+ };
57
+
58
+
59
+ var ColorThief = function () {};
60
+
61
+ /*
62
+ * getColor(sourceImage[, quality])
63
+ * returns {r: num, g: num, b: num}
64
+ *
65
+ * Use the median cut algorithm provided by quantize.js to cluster similar
66
+ * colors and return the base color from the largest cluster.
67
+ *
68
+ * Quality is an optional argument. It needs to be an integer. 1 is the highest quality settings.
69
+ * 10 is the default. There is a trade-off between quality and speed. The bigger the number, the
70
+ * faster a color will be returned but the greater the likelihood that it will not be the visually
71
+ * most dominant color.
72
+ *
73
+ * */
74
+ ColorThief.prototype.getColor = function(sourceImage, quality) {
75
+ var palette = this.getPalette(sourceImage, 5, quality);
76
+ var dominantColor = palette[0];
77
+ return dominantColor;
78
+ };
79
+
80
+
81
+ /*
82
+ * getPalette(sourceImage[, colorCount, quality])
83
+ * returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...]
84
+ *
85
+ * Use the median cut algorithm provided by quantize.js to cluster similar colors.
86
+ *
87
+ * colorCount determines the size of the palette; the number of colors returned. If not set, it
88
+ * defaults to 10.
89
+ *
90
+ * BUGGY: Function does not always return the requested amount of colors. It can be +/- 2.
91
+ *
92
+ * quality is an optional argument. It needs to be an integer. 1 is the highest quality settings.
93
+ * 10 is the default. There is a trade-off between quality and speed. The bigger the number, the
94
+ * faster the palette generation but the greater the likelihood that colors will be missed.
95
+ *
96
+ *
97
+ */
98
+ ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) {
99
+
100
+ if (typeof colorCount === 'undefined') {
101
+ colorCount = 10;
102
+ }
103
+ if (typeof quality === 'undefined' || quality < 1) {
104
+ quality = 10;
105
+ }
106
+
107
+ // Create custom CanvasImage object
108
+ var image = new CanvasImage(sourceImage);
109
+ var imageData = image.getImageData();
110
+ var pixels = imageData.data;
111
+ var pixelCount = image.getPixelCount();
112
+
113
+ // Store the RGB values in an array format suitable for quantize function
114
+ var pixelArray = [];
115
+ for (var i = 0, offset, r, g, b, a; i < pixelCount; i = i + quality) {
116
+ offset = i * 4;
117
+ r = pixels[offset + 0];
118
+ g = pixels[offset + 1];
119
+ b = pixels[offset + 2];
120
+ a = pixels[offset + 3];
121
+ // If pixel is mostly opaque and not white
122
+ if (a >= 125) {
123
+ if (!(r > 250 && g > 250 && b > 250)) {
124
+ pixelArray.push([r, g, b]);
125
+ }
126
+ }
127
+ }
128
+
129
+ // Send array to quantize function which clusters values
130
+ // using median cut algorithm
131
+ var cmap = MMCQ.quantize(pixelArray, colorCount);
132
+ var palette = cmap? cmap.palette() : null;
133
+
134
+ // Clean up
135
+ image.removeCanvas();
136
+
137
+ return palette;
138
+ };
139
+
140
+
141
+
142
+
143
+ /*!
144
+ * quantize.js Copyright 2008 Nick Rabinowitz.
145
+ * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
146
+ */
147
+
148
+ // fill out a couple protovis dependencies
149
+ /*!
150
+ * Block below copied from Protovis: http://mbostock.github.com/protovis/
151
+ * Copyright 2010 Stanford Visualization Group
152
+ * Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
153
+ */
154
+ if (!pv) {
155
+ var pv = {
156
+ map: function(array, f) {
157
+ var o = {};
158
+ return f ? array.map(function(d, i) { o.index = i; return f.call(o, d); }) : array.slice();
159
+ },
160
+ naturalOrder: function(a, b) {
161
+ return (a < b) ? -1 : ((a > b) ? 1 : 0);
162
+ },
163
+ sum: function(array, f) {
164
+ var o = {};
165
+ return array.reduce(f ? function(p, d, i) { o.index = i; return p + f.call(o, d); } : function(p, d) { return p + d; }, 0);
166
+ },
167
+ max: function(array, f) {
168
+ return Math.max.apply(null, f ? pv.map(array, f) : array);
169
+ }
170
+ };
171
+ }
172
+
173
+
174
+
175
+ /**
176
+ * Basic Javascript port of the MMCQ (modified median cut quantization)
177
+ * algorithm from the Leptonica library (http://www.leptonica.com/).
178
+ * Returns a color map you can use to map original pixels to the reduced
179
+ * palette. Still a work in progress.
180
+ *
181
+ * @author Nick Rabinowitz
182
+ * @example
183
+
184
+ // array of pixels as [R,G,B] arrays
185
+ var myPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207]
186
+ // etc
187
+ ];
188
+ var maxColors = 4;
189
+
190
+ var cmap = MMCQ.quantize(myPixels, maxColors);
191
+ var newPalette = cmap.palette();
192
+ var newPixels = myPixels.map(function(p) {
193
+ return cmap.map(p);
194
+ });
195
+
196
+ */
197
+ var MMCQ = (function() {
198
+ // private constants
199
+ var sigbits = 5,
200
+ rshift = 8 - sigbits,
201
+ maxIterations = 1000,
202
+ fractByPopulations = 0.75;
203
+
204
+ // get reduced-space color index for a pixel
205
+ function getColorIndex(r, g, b) {
206
+ return (r << (2 * sigbits)) + (g << sigbits) + b;
207
+ }
208
+
209
+ // Simple priority queue
210
+ function PQueue(comparator) {
211
+ var contents = [],
212
+ sorted = false;
213
+
214
+ function sort() {
215
+ contents.sort(comparator);
216
+ sorted = true;
217
+ }
218
+
219
+ return {
220
+ push: function(o) {
221
+ contents.push(o);
222
+ sorted = false;
223
+ },
224
+ peek: function(index) {
225
+ if (!sorted) sort();
226
+ if (index===undefined) index = contents.length - 1;
227
+ return contents[index];
228
+ },
229
+ pop: function() {
230
+ if (!sorted) sort();
231
+ return contents.pop();
232
+ },
233
+ size: function() {
234
+ return contents.length;
235
+ },
236
+ map: function(f) {
237
+ return contents.map(f);
238
+ },
239
+ debug: function() {
240
+ if (!sorted) sort();
241
+ return contents;
242
+ }
243
+ };
244
+ }
245
+
246
+ // 3d color space box
247
+ function VBox(r1, r2, g1, g2, b1, b2, histo) {
248
+ var vbox = this;
249
+ vbox.r1 = r1;
250
+ vbox.r2 = r2;
251
+ vbox.g1 = g1;
252
+ vbox.g2 = g2;
253
+ vbox.b1 = b1;
254
+ vbox.b2 = b2;
255
+ vbox.histo = histo;
256
+ }
257
+ VBox.prototype = {
258
+ volume: function(force) {
259
+ var vbox = this;
260
+ if (!vbox._volume || force) {
261
+ vbox._volume = ((vbox.r2 - vbox.r1 + 1) * (vbox.g2 - vbox.g1 + 1) * (vbox.b2 - vbox.b1 + 1));
262
+ }
263
+ return vbox._volume;
264
+ },
265
+ count: function(force) {
266
+ var vbox = this,
267
+ histo = vbox.histo;
268
+ if (!vbox._count_set || force) {
269
+ var npix = 0,
270
+ i, j, k;
271
+ for (i = vbox.r1; i <= vbox.r2; i++) {
272
+ for (j = vbox.g1; j <= vbox.g2; j++) {
273
+ for (k = vbox.b1; k <= vbox.b2; k++) {
274
+ index = getColorIndex(i,j,k);
275
+ npix += (histo[index] || 0);
276
+ }
277
+ }
278
+ }
279
+ vbox._count = npix;
280
+ vbox._count_set = true;
281
+ }
282
+ return vbox._count;
283
+ },
284
+ copy: function() {
285
+ var vbox = this;
286
+ return new VBox(vbox.r1, vbox.r2, vbox.g1, vbox.g2, vbox.b1, vbox.b2, vbox.histo);
287
+ },
288
+ avg: function(force) {
289
+ var vbox = this,
290
+ histo = vbox.histo;
291
+ if (!vbox._avg || force) {
292
+ var ntot = 0,
293
+ mult = 1 << (8 - sigbits),
294
+ rsum = 0,
295
+ gsum = 0,
296
+ bsum = 0,
297
+ hval,
298
+ i, j, k, histoindex;
299
+ for (i = vbox.r1; i <= vbox.r2; i++) {
300
+ for (j = vbox.g1; j <= vbox.g2; j++) {
301
+ for (k = vbox.b1; k <= vbox.b2; k++) {
302
+ histoindex = getColorIndex(i,j,k);
303
+ hval = histo[histoindex] || 0;
304
+ ntot += hval;
305
+ rsum += (hval * (i + 0.5) * mult);
306
+ gsum += (hval * (j + 0.5) * mult);
307
+ bsum += (hval * (k + 0.5) * mult);
308
+ }
309
+ }
310
+ }
311
+ if (ntot) {
312
+ vbox._avg = [~~(rsum/ntot), ~~(gsum/ntot), ~~(bsum/ntot)];
313
+ } else {
314
+ // console.log('empty box');
315
+ vbox._avg = [
316
+ ~~(mult * (vbox.r1 + vbox.r2 + 1) / 2),
317
+ ~~(mult * (vbox.g1 + vbox.g2 + 1) / 2),
318
+ ~~(mult * (vbox.b1 + vbox.b2 + 1) / 2)
319
+ ];
320
+ }
321
+ }
322
+ return vbox._avg;
323
+ },
324
+ contains: function(pixel) {
325
+ var vbox = this,
326
+ rval = pixel[0] >> rshift;
327
+ gval = pixel[1] >> rshift;
328
+ bval = pixel[2] >> rshift;
329
+ return (rval >= vbox.r1 && rval <= vbox.r2 &&
330
+ gval >= vbox.g1 && gval <= vbox.g2 &&
331
+ bval >= vbox.b1 && bval <= vbox.b2);
332
+ }
333
+ };
334
+
335
+ // Color map
336
+ function CMap() {
337
+ this.vboxes = new PQueue(function(a,b) {
338
+ return pv.naturalOrder(
339
+ a.vbox.count()*a.vbox.volume(),
340
+ b.vbox.count()*b.vbox.volume()
341
+ );
342
+ });
343
+ }
344
+ CMap.prototype = {
345
+ push: function(vbox) {
346
+ this.vboxes.push({
347
+ vbox: vbox,
348
+ color: vbox.avg()
349
+ });
350
+ },
351
+ palette: function() {
352
+ return this.vboxes.map(function(vb) { return vb.color; });
353
+ },
354
+ size: function() {
355
+ return this.vboxes.size();
356
+ },
357
+ map: function(color) {
358
+ var vboxes = this.vboxes;
359
+ for (var i=0; i<vboxes.size(); i++) {
360
+ if (vboxes.peek(i).vbox.contains(color)) {
361
+ return vboxes.peek(i).color;
362
+ }
363
+ }
364
+ return this.nearest(color);
365
+ },
366
+ nearest: function(color) {
367
+ var vboxes = this.vboxes,
368
+ d1, d2, pColor;
369
+ for (var i=0; i<vboxes.size(); i++) {
370
+ d2 = Math.sqrt(
371
+ Math.pow(color[0] - vboxes.peek(i).color[0], 2) +
372
+ Math.pow(color[1] - vboxes.peek(i).color[1], 2) +
373
+ Math.pow(color[2] - vboxes.peek(i).color[2], 2)
374
+ );
375
+ if (d2 < d1 || d1 === undefined) {
376
+ d1 = d2;
377
+ pColor = vboxes.peek(i).color;
378
+ }
379
+ }
380
+ return pColor;
381
+ },
382
+ forcebw: function() {
383
+ // XXX: won't work yet
384
+ var vboxes = this.vboxes;
385
+ vboxes.sort(function(a,b) { return pv.naturalOrder(pv.sum(a.color), pv.sum(b.color));});
386
+
387
+ // force darkest color to black if everything < 5
388
+ var lowest = vboxes[0].color;
389
+ if (lowest[0] < 5 && lowest[1] < 5 && lowest[2] < 5)
390
+ vboxes[0].color = [0,0,0];
391
+
392
+ // force lightest color to white if everything > 251
393
+ var idx = vboxes.length-1,
394
+ highest = vboxes[idx].color;
395
+ if (highest[0] > 251 && highest[1] > 251 && highest[2] > 251)
396
+ vboxes[idx].color = [255,255,255];
397
+ }
398
+ };
399
+
400
+ // histo (1-d array, giving the number of pixels in
401
+ // each quantized region of color space), or null on error
402
+ function getHisto(pixels) {
403
+ var histosize = 1 << (3 * sigbits),
404
+ histo = new Array(histosize),
405
+ index, rval, gval, bval;
406
+ pixels.forEach(function(pixel) {
407
+ rval = pixel[0] >> rshift;
408
+ gval = pixel[1] >> rshift;
409
+ bval = pixel[2] >> rshift;
410
+ index = getColorIndex(rval, gval, bval);
411
+ histo[index] = (histo[index] || 0) + 1;
412
+ });
413
+ return histo;
414
+ }
415
+
416
+ function vboxFromPixels(pixels, histo) {
417
+ var rmin=1000000, rmax=0,
418
+ gmin=1000000, gmax=0,
419
+ bmin=1000000, bmax=0,
420
+ rval, gval, bval;
421
+ // find min/max
422
+ pixels.forEach(function(pixel) {
423
+ rval = pixel[0] >> rshift;
424
+ gval = pixel[1] >> rshift;
425
+ bval = pixel[2] >> rshift;
426
+ if (rval < rmin) rmin = rval;
427
+ else if (rval > rmax) rmax = rval;
428
+ if (gval < gmin) gmin = gval;
429
+ else if (gval > gmax) gmax = gval;
430
+ if (bval < bmin) bmin = bval;
431
+ else if (bval > bmax) bmax = bval;
432
+ });
433
+ return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, histo);
434
+ }
435
+
436
+ function medianCutApply(histo, vbox) {
437
+ if (!vbox.count()) return;
438
+
439
+ var rw = vbox.r2 - vbox.r1 + 1,
440
+ gw = vbox.g2 - vbox.g1 + 1,
441
+ bw = vbox.b2 - vbox.b1 + 1,
442
+ maxw = pv.max([rw, gw, bw]);
443
+ // only one pixel, no split
444
+ if (vbox.count() == 1) {
445
+ return [vbox.copy()];
446
+ }
447
+ /* Find the partial sum arrays along the selected axis. */
448
+ var total = 0,
449
+ partialsum = [],
450
+ lookaheadsum = [],
451
+ i, j, k, sum, index;
452
+ if (maxw == rw) {
453
+ for (i = vbox.r1; i <= vbox.r2; i++) {
454
+ sum = 0;
455
+ for (j = vbox.g1; j <= vbox.g2; j++) {
456
+ for (k = vbox.b1; k <= vbox.b2; k++) {
457
+ index = getColorIndex(i,j,k);
458
+ sum += (histo[index] || 0);
459
+ }
460
+ }
461
+ total += sum;
462
+ partialsum[i] = total;
463
+ }
464
+ }
465
+ else if (maxw == gw) {
466
+ for (i = vbox.g1; i <= vbox.g2; i++) {
467
+ sum = 0;
468
+ for (j = vbox.r1; j <= vbox.r2; j++) {
469
+ for (k = vbox.b1; k <= vbox.b2; k++) {
470
+ index = getColorIndex(j,i,k);
471
+ sum += (histo[index] || 0);
472
+ }
473
+ }
474
+ total += sum;
475
+ partialsum[i] = total;
476
+ }
477
+ }
478
+ else { /* maxw == bw */
479
+ for (i = vbox.b1; i <= vbox.b2; i++) {
480
+ sum = 0;
481
+ for (j = vbox.r1; j <= vbox.r2; j++) {
482
+ for (k = vbox.g1; k <= vbox.g2; k++) {
483
+ index = getColorIndex(j,k,i);
484
+ sum += (histo[index] || 0);
485
+ }
486
+ }
487
+ total += sum;
488
+ partialsum[i] = total;
489
+ }
490
+ }
491
+ partialsum.forEach(function(d,i) {
492
+ lookaheadsum[i] = total-d;
493
+ });
494
+ function doCut(color) {
495
+ var dim1 = color + '1',
496
+ dim2 = color + '2',
497
+ left, right, vbox1, vbox2, d2, count2=0;
498
+ for (i = vbox[dim1]; i <= vbox[dim2]; i++) {
499
+ if (partialsum[i] > total / 2) {
500
+ vbox1 = vbox.copy();
501
+ vbox2 = vbox.copy();
502
+ left = i - vbox[dim1];
503
+ right = vbox[dim2] - i;
504
+ if (left <= right)
505
+ d2 = Math.min(vbox[dim2] - 1, ~~(i + right / 2));
506
+ else d2 = Math.max(vbox[dim1], ~~(i - 1 - left / 2));
507
+ // avoid 0-count boxes
508
+ while (!partialsum[d2]) d2++;
509
+ count2 = lookaheadsum[d2];
510
+ while (!count2 && partialsum[d2-1]) count2 = lookaheadsum[--d2];
511
+ // set dimensions
512
+ vbox1[dim2] = d2;
513
+ vbox2[dim1] = vbox1[dim2] + 1;
514
+ // console.log('vbox counts:', vbox.count(), vbox1.count(), vbox2.count());
515
+ return [vbox1, vbox2];
516
+ }
517
+ }
518
+
519
+ }
520
+ // determine the cut planes
521
+ return maxw == rw ? doCut('r') :
522
+ maxw == gw ? doCut('g') :
523
+ doCut('b');
524
+ }
525
+
526
+ function quantize(pixels, maxcolors) {
527
+ // short-circuit
528
+ if (!pixels.length || maxcolors < 2 || maxcolors > 256) {
529
+ // console.log('wrong number of maxcolors');
530
+ return false;
531
+ }
532
+
533
+ // XXX: check color content and convert to grayscale if insufficient
534
+
535
+ var histo = getHisto(pixels),
536
+ histosize = 1 << (3 * sigbits);
537
+
538
+ // check that we aren't below maxcolors already
539
+ var nColors = 0;
540
+ histo.forEach(function() { nColors++; });
541
+ if (nColors <= maxcolors) {
542
+ // XXX: generate the new colors from the histo and return
543
+ }
544
+
545
+ // get the beginning vbox from the colors
546
+ var vbox = vboxFromPixels(pixels, histo),
547
+ pq = new PQueue(function(a,b) { return pv.naturalOrder(a.count(), b.count()); });
548
+ pq.push(vbox);
549
+
550
+ // inner function to do the iteration
551
+ function iter(lh, target) {
552
+ var ncolors = 1,
553
+ niters = 0,
554
+ vbox;
555
+ while (niters < maxIterations) {
556
+ vbox = lh.pop();
557
+ if (!vbox.count()) { /* just put it back */
558
+ lh.push(vbox);
559
+ niters++;
560
+ continue;
561
+ }
562
+ // do the cut
563
+ var vboxes = medianCutApply(histo, vbox),
564
+ vbox1 = vboxes[0],
565
+ vbox2 = vboxes[1];
566
+
567
+ if (!vbox1) {
568
+ // console.log("vbox1 not defined; shouldn't happen!");
569
+ return;
570
+ }
571
+ lh.push(vbox1);
572
+ if (vbox2) { /* vbox2 can be null */
573
+ lh.push(vbox2);
574
+ ncolors++;
575
+ }
576
+ if (ncolors >= target) return;
577
+ if (niters++ > maxIterations) {
578
+ // console.log("infinite loop; perhaps too few pixels!");
579
+ return;
580
+ }
581
+ }
582
+ }
583
+
584
+ // first set of colors, sorted by population
585
+ iter(pq, fractByPopulations * maxcolors);
586
+
587
+ // Re-sort by the product of pixel occupancy times the size in color space.
588
+ var pq2 = new PQueue(function(a,b) {
589
+ return pv.naturalOrder(a.count()*a.volume(), b.count()*b.volume());
590
+ });
591
+ while (pq.size()) {
592
+ pq2.push(pq.pop());
593
+ }
594
+
595
+ // next set - generate the median cuts using the (npix * vol) sorting.
596
+ iter(pq2, maxcolors - pq2.size());
597
+
598
+ // calculate the actual colors
599
+ var cmap = new CMap();
600
+ while (pq2.size()) {
601
+ cmap.push(pq2.pop());
602
+ }
603
+
604
+ return cmap;
605
+ }
606
+
607
+ return {
608
+ quantize: quantize
609
+ };
610
+ })();
admin/customizer/color-thief/color-thief.min.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Color Thief v2.0
3
+ * by Lokesh Dhakar - http://www.lokeshdhakar.com
4
+ *
5
+ * Thanks
6
+ * ------
7
+ * Nick Rabinowitz - For creating quantize.js.
8
+ * John Schulz - For clean up and optimization. @JFSIII
9
+ * Nathan Spady - For adding drag and drop support to the demo page.
10
+ *
11
+ * License
12
+ * -------
13
+ * Copyright 2011, 2015 Lokesh Dhakar
14
+ * Released under the MIT license
15
+ * https://raw.githubusercontent.com/lokesh/color-thief/master/LICENSE
16
+ *
17
+ */
18
+ var CanvasImage=function(a){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=a.width,this.height=this.canvas.height=a.height,this.context.drawImage(a,0,0,this.width,this.height)};CanvasImage.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},CanvasImage.prototype.update=function(a){this.context.putImageData(a,0,0)},CanvasImage.prototype.getPixelCount=function(){return this.width*this.height},CanvasImage.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},CanvasImage.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var ColorThief=function(){};/*!
19
+ * quantize.js Copyright 2008 Nick Rabinowitz.
20
+ * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
21
+ */
22
+ /*!
23
+ * Block below copied from Protovis: http://mbostock.github.com/protovis/
24
+ * Copyright 2010 Stanford Visualization Group
25
+ * Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
26
+ */
27
+ if(ColorThief.prototype.getColor=function(a,b){var c=this.getPalette(a,5,b),d=c[0];return d},ColorThief.prototype.getPalette=function(a,b,c){"undefined"==typeof b&&(b=10),("undefined"==typeof c||1>c)&&(c=10);for(var d,e,f,g,h,i=new CanvasImage(a),j=i.getImageData(),k=j.data,l=i.getPixelCount(),m=[],n=0;l>n;n+=c)d=4*n,e=k[d+0],f=k[d+1],g=k[d+2],h=k[d+3],h>=125&&(e>250&&f>250&&g>250||m.push([e,f,g]));var o=MMCQ.quantize(m,b),p=o?o.palette():null;return i.removeCanvas(),p},!pv)var pv={map:function(a,b){var c={};return b?a.map(function(a,d){return c.index=d,b.call(c,a)}):a.slice()},naturalOrder:function(a,b){return b>a?-1:a>b?1:0},sum:function(a,b){var c={};return a.reduce(b?function(a,d,e){return c.index=e,a+b.call(c,d)}:function(a,b){return a+b},0)},max:function(a,b){return Math.max.apply(null,b?pv.map(a,b):a)}};var MMCQ=function(){function a(a,b,c){return(a<<2*i)+(b<<i)+c}function b(a){function b(){c.sort(a),d=!0}var c=[],d=!1;return{push:function(a){c.push(a),d=!1},peek:function(a){return d||b(),void 0===a&&(a=c.length-1),c[a]},pop:function(){return d||b(),c.pop()},size:function(){return c.length},map:function(a){return c.map(a)},debug:function(){return d||b(),c}}}function c(a,b,c,d,e,f,g){var h=this;h.r1=a,h.r2=b,h.g1=c,h.g2=d,h.b1=e,h.b2=f,h.histo=g}function d(){this.vboxes=new b(function(a,b){return pv.naturalOrder(a.vbox.count()*a.vbox.volume(),b.vbox.count()*b.vbox.volume())})}function e(b){var c,d,e,f,g=1<<3*i,h=new Array(g);return b.forEach(function(b){d=b[0]>>j,e=b[1]>>j,f=b[2]>>j,c=a(d,e,f),h[c]=(h[c]||0)+1}),h}function f(a,b){var d,e,f,g=1e6,h=0,i=1e6,k=0,l=1e6,m=0;return a.forEach(function(a){d=a[0]>>j,e=a[1]>>j,f=a[2]>>j,g>d?g=d:d>h&&(h=d),i>e?i=e:e>k&&(k=e),l>f?l=f:f>m&&(m=f)}),new c(g,h,i,k,l,m,b)}function g(b,c){function d(a){var b,d,e,f,g,h=a+"1",j=a+"2",k=0;for(i=c[h];i<=c[j];i++)if(o[i]>n/2){for(e=c.copy(),f=c.copy(),b=i-c[h],d=c[j]-i,g=d>=b?Math.min(c[j]-1,~~(i+d/2)):Math.max(c[h],~~(i-1-b/2));!o[g];)g++;for(k=p[g];!k&&o[g-1];)k=p[--g];return e[j]=g,f[h]=e[j]+1,[e,f]}}if(c.count()){var e=c.r2-c.r1+1,f=c.g2-c.g1+1,g=c.b2-c.b1+1,h=pv.max([e,f,g]);if(1==c.count())return[c.copy()];var i,j,k,l,m,n=0,o=[],p=[];if(h==e)for(i=c.r1;i<=c.r2;i++){for(l=0,j=c.g1;j<=c.g2;j++)for(k=c.b1;k<=c.b2;k++)m=a(i,j,k),l+=b[m]||0;n+=l,o[i]=n}else if(h==f)for(i=c.g1;i<=c.g2;i++){for(l=0,j=c.r1;j<=c.r2;j++)for(k=c.b1;k<=c.b2;k++)m=a(j,i,k),l+=b[m]||0;n+=l,o[i]=n}else for(i=c.b1;i<=c.b2;i++){for(l=0,j=c.r1;j<=c.r2;j++)for(k=c.g1;k<=c.g2;k++)m=a(j,k,i),l+=b[m]||0;n+=l,o[i]=n}return o.forEach(function(a,b){p[b]=n-a}),d(h==e?"r":h==f?"g":"b")}}function h(a,c){function h(a,b){for(var c,d=1,e=0;k>e;)if(c=a.pop(),c.count()){var f=g(i,c),h=f[0],j=f[1];if(!h)return;if(a.push(h),j&&(a.push(j),d++),d>=b)return;if(e++>k)return}else a.push(c),e++}if(!a.length||2>c||c>256)return!1;var i=e(a),j=0;i.forEach(function(){j++});var m=f(a,i),n=new b(function(a,b){return pv.naturalOrder(a.count(),b.count())});n.push(m),h(n,l*c);for(var o=new b(function(a,b){return pv.naturalOrder(a.count()*a.volume(),b.count()*b.volume())});n.size();)o.push(n.pop());h(o,c-o.size());for(var p=new d;o.size();)p.push(o.pop());return p}var i=5,j=8-i,k=1e3,l=.75;return c.prototype={volume:function(a){var b=this;return(!b._volume||a)&&(b._volume=(b.r2-b.r1+1)*(b.g2-b.g1+1)*(b.b2-b.b1+1)),b._volume},count:function(b){var c=this,d=c.histo;if(!c._count_set||b){var e,f,g,h=0;for(e=c.r1;e<=c.r2;e++)for(f=c.g1;f<=c.g2;f++)for(g=c.b1;g<=c.b2;g++)index=a(e,f,g),h+=d[index]||0;c._count=h,c._count_set=!0}return c._count},copy:function(){var a=this;return new c(a.r1,a.r2,a.g1,a.g2,a.b1,a.b2,a.histo)},avg:function(b){var c=this,d=c.histo;if(!c._avg||b){var e,f,g,h,j,k=0,l=1<<8-i,m=0,n=0,o=0;for(f=c.r1;f<=c.r2;f++)for(g=c.g1;g<=c.g2;g++)for(h=c.b1;h<=c.b2;h++)j=a(f,g,h),e=d[j]||0,k+=e,m+=e*(f+.5)*l,n+=e*(g+.5)*l,o+=e*(h+.5)*l;k?c._avg=[~~(m/k),~~(n/k),~~(o/k)]:c._avg=[~~(l*(c.r1+c.r2+1)/2),~~(l*(c.g1+c.g2+1)/2),~~(l*(c.b1+c.b2+1)/2)]}return c._avg},contains:function(a){var b=this,c=a[0]>>j;return gval=a[1]>>j,bval=a[2]>>j,c>=b.r1&&c<=b.r2&&gval>=b.g1&&gval<=b.g2&&bval>=b.b1&&bval<=b.b2}},d.prototype={push:function(a){this.vboxes.push({vbox:a,color:a.avg()})},palette:function(){return this.vboxes.map(function(a){return a.color})},size:function(){return this.vboxes.size()},map:function(a){for(var b=this.vboxes,c=0;c<b.size();c++)if(b.peek(c).vbox.contains(a))return b.peek(c).color;return this.nearest(a)},nearest:function(a){for(var b,c,d,e=this.vboxes,f=0;f<e.size();f++)c=Math.sqrt(Math.pow(a[0]-e.peek(f).color[0],2)+Math.pow(a[1]-e.peek(f).color[1],2)+Math.pow(a[2]-e.peek(f).color[2],2)),(b>c||void 0===b)&&(b=c,d=e.peek(f).color);return d},forcebw:function(){var a=this.vboxes;a.sort(function(a,b){return pv.naturalOrder(pv.sum(a.color),pv.sum(b.color))});var b=a[0].color;b[0]<5&&b[1]<5&&b[2]<5&&(a[0].color=[0,0,0]);var c=a.length-1,d=a[c].color;d[0]>251&&d[1]>251&&d[2]>251&&(a[c].color=[255,255,255])}},{quantize:h}}();
admin/customizer/wptouch-customizer.php CHANGED
@@ -120,7 +120,7 @@ function wptouch_customizer_reset_settings() {
120
  $current_theme = wptouch_get_current_theme_name();
121
  delete_option( 'wptouch_customizer_initialized_' . $current_theme );
122
 
123
- // Delete theme mods – because we're not actively customizing here, WP believes the desktop theme is active, so override the value for the duration of the action. Disable the override once we're done so later requests execute normally.
124
  wptouch_customizer_begin_theme_override();
125
  remove_theme_mods();
126
  wptouch_customizer_end_theme_override();
@@ -540,6 +540,27 @@ function wptouch_customizer_scripts() {
540
  true
541
  );
542
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  global $wptouch_pro;
544
  $theme = $wptouch_pro->get_current_theme_info();
545
  $pro_or_free = ( !defined( 'WPTOUCH_IS_FREE' ) ) ? 'yes' : 'no';
@@ -590,7 +611,7 @@ function wptouch_customizer_scripts() {
590
  }
591
 
592
  function wptouch_customizer_ajax_callbacks() {
593
- ?>
594
  <script type="text/javascript">
595
  function wptouchCustomizerGetLuma( hexvalue ) {
596
  var c = hexvalue.substring(1); // strip #
@@ -602,40 +623,40 @@ function wptouch_customizer_ajax_callbacks() {
602
  return 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709'
603
  }
604
 
605
- ( function( jQuery ){
606
- <?php
607
- if ( foundation_has_theme_colors() ) {
608
- $colors = foundation_get_theme_colors();
609
- foreach( $colors as $color ) {
610
- ?>
611
  wp.customize('wptouch_<?php echo $color->setting; ?>',function( value ) {
612
  value.bind( function( to ) {
613
  <?php if ( $color->fg_selectors ) { ?>
614
- jQuery( '<?php echo $color->fg_selectors; ?>' ).css('color', to ? to : '' );
615
  <?php } ?>
616
 
617
  <?php if ( $color->bg_selectors ) { ?>
618
- jQuery( '<?php echo $color->bg_selectors; ?>' ).css('background-color', to ? to : '' );
619
  <?php } ?>
620
 
621
  <?php if ( $color->luma_threshold ) { ?>
622
- if ( wptouchCustomizerGetLuma( to ) < <?php echo $color->luma_threshold; ?> ) {
623
- jQuery( 'body' ).removeClass( 'light-<?php echo $color->luma_class; ?>' );
624
- jQuery( 'body' ).addClass( 'dark-<?php echo $color->luma_class; ?>' );
625
- } else {
626
- jQuery( 'body' ).addClass( 'light-<?php echo $color->luma_class; ?>' );
627
- jQuery( 'body' ).removeClass( 'dark-<?php echo $color->luma_class; ?>' );
628
- }
629
  <?php } ?>
630
  });
631
  });
632
- <?php
633
- }
634
- }
635
- ?>
636
- } )( jQuery )
637
  </script>
638
- <?php
639
  }
640
 
641
  function wptouch_customizer_override_settings( $settings, $domain ) {
120
  $current_theme = wptouch_get_current_theme_name();
121
  delete_option( 'wptouch_customizer_initialized_' . $current_theme );
122
 
123
+ // Delete theme mods – because we're not actively customizing here, WP believes the desktop theme is active, so override the value for the duration of the action. Disable the override once we're done so later requests execute normally.
124
  wptouch_customizer_begin_theme_override();
125
  remove_theme_mods();
126
  wptouch_customizer_end_theme_override();
540
  true
541
  );
542
 
543
+ /**
544
+ * WPtouch Load color extraction js library.
545
+ *
546
+ * Whether to load the necessary js to use in the customizer
547
+ * for getting colors from an image, allowing this to be set
548
+ * on a per theme basis.
549
+ *
550
+ * @since 4.3.25
551
+ *
552
+ * @param boolean
553
+ */
554
+ if ( apply_filters( 'wptouch_load_color_extraction_lib', false ) ) {
555
+ wp_enqueue_script(
556
+ 'color-extraction-customizer-js',
557
+ WPTOUCH_URL . '/admin/customizer/color-thief/color-thief.min.js',
558
+ array(),
559
+ md5( WPTOUCH_VERSION ),
560
+ true
561
+ );
562
+ }
563
+
564
  global $wptouch_pro;
565
  $theme = $wptouch_pro->get_current_theme_info();
566
  $pro_or_free = ( !defined( 'WPTOUCH_IS_FREE' ) ) ? 'yes' : 'no';
611
  }
612
 
613
  function wptouch_customizer_ajax_callbacks() {
614
+ ?>
615
  <script type="text/javascript">
616
  function wptouchCustomizerGetLuma( hexvalue ) {
617
  var c = hexvalue.substring(1); // strip #
623
  return 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709'
624
  }
625
 
626
+ ( function( jQuery ){
627
+ <?php
628
+ if ( foundation_has_theme_colors() ) {
629
+ $colors = foundation_get_theme_colors();
630
+ foreach( $colors as $color ) {
631
+ ?>
632
  wp.customize('wptouch_<?php echo $color->setting; ?>',function( value ) {
633
  value.bind( function( to ) {
634
  <?php if ( $color->fg_selectors ) { ?>
635
+ jQuery( '<?php echo esc_attr( $color->fg_selectors ); ?>' ).css('color', to ? to : '' );
636
  <?php } ?>
637
 
638
  <?php if ( $color->bg_selectors ) { ?>
639
+ jQuery( '<?php echo esc_attr( $color->bg_selectors ); ?>' ).css('background-color', to ? to : '' );
640
  <?php } ?>
641
 
642
  <?php if ( $color->luma_threshold ) { ?>
643
+ if ( wptouchCustomizerGetLuma( to ) < <?php echo esc_attr( $color->luma_threshold ); ?> ) {
644
+ jQuery( 'body' ).removeClass( 'light-<?php echo esc_attr( $color->luma_class ); ?>' );
645
+ jQuery( 'body' ).addClass( 'dark-<?php echo esc_attr( $color->luma_class ); ?>' );
646
+ } else {
647
+ jQuery( 'body' ).addClass( 'light-<?php echo esc_attr( $color->luma_class ); ?>' );
648
+ jQuery( 'body' ).removeClass( 'dark-<?php echo esc_attr( $color->luma_class ); ?>' );
649
+ }
650
  <?php } ?>
651
  });
652
  });
653
+ <?php
654
+ }
655
+ }
656
+ ?>
657
+ } )( jQuery )
658
  </script>
659
+ <?php
660
  }
661
 
662
  function wptouch_customizer_override_settings( $settings, $domain ) {
admin/pages/wptouch-admin-general-settings.php CHANGED
@@ -276,6 +276,42 @@ function wptouch_render_general_page( $page_options ) {
276
  'wptouch_pro'
277
  );
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  wptouch_add_page_section(
280
  WPTOUCH_ADMIN_SETUP_GENERAL,
281
  wptouchize_it( __( 'WPtouch Pro Love', 'wptouch-pro' ) ),
276
  'wptouch_pro'
277
  );
278
 
279
+ /**
280
+ * WPtouch load Google maps settings.
281
+ *
282
+ * Whether to load the necessary Google maps settings,
283
+ * allowing this to be set on a per theme basis.
284
+ *
285
+ * @since 4.3.23
286
+ *
287
+ * @param boolean
288
+ */
289
+ if ( apply_filters( 'wptouch_load_google_maps_settings', false ) ) {
290
+
291
+ $google_maps_settings = array(
292
+ wptouch_add_pro_setting(
293
+ 'text',
294
+ 'maps_google_api_key',
295
+ __( 'Google Maps API Key &mdash; <a href="https://developers.google.com/maps/documentation/static-maps/get-api-key" target="_new">Get a key</a>', 'wptouch-pro' ),
296
+ false,
297
+ WPTOUCH_SETTING_BASIC,
298
+ '4.3.23'
299
+ ),
300
+ );
301
+
302
+ $google_maps_settings = apply_filters( 'wptouch_pro_google_maps_settings', $google_maps_settings );
303
+
304
+ wptouch_add_page_section(
305
+ WPTOUCH_ADMIN_SETUP_GENERAL,
306
+ __( 'Google Maps', 'wptouch-pro' ),
307
+ 'setup-google-maps',
308
+ $google_maps_settings,
309
+ $page_options,
310
+ 'wptouch_pro'
311
+ );
312
+
313
+ }
314
+
315
  wptouch_add_page_section(
316
  WPTOUCH_ADMIN_SETUP_GENERAL,
317
  wptouchize_it( __( 'WPtouch Pro Love', 'wptouch-pro' ) ),
core/class-wptouch-pro-settings.php CHANGED
@@ -48,6 +48,9 @@ class WPtouchDefaultSettings30 extends WPtouchSettings {
48
  $this->analytics_google_id = '';
49
  $this->custom_stats_code = '';
50
 
 
 
 
51
  // Setup - Home Page Redirect
52
  $this->homepage_landing = 'none';
53
  $this->homepage_redirect_wp_target = 0;
48
  $this->analytics_google_id = '';
49
  $this->custom_stats_code = '';
50
 
51
+ // Setup - Google Maps
52
+ $this->maps_google_api_key = '';
53
+
54
  // Setup - Home Page Redirect
55
  $this->homepage_landing = 'none';
56
  $this->homepage_redirect_wp_target = 0;
lang/wptouch.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPtouch Mobile Plugin 4.3.25\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
- "POT-Creation-Date: 2018-02-02 15:30:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,15 +12,15 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: admin/customizer/wptouch-customizer.php:547
16
  msgid "Device Orientation"
17
  msgstr ""
18
 
19
- #: admin/customizer/wptouch-customizer.php:574
20
  msgid "Switch to Mobile Theme"
21
  msgstr ""
22
 
23
- #: admin/customizer/wptouch-customizer.php:575
24
  msgid "Switch to Desktop Theme"
25
  msgstr ""
26
 
@@ -679,7 +679,7 @@ msgid "Analytics Code"
679
  msgstr ""
680
 
681
  #: admin/pages/wptouch-admin-general-settings.php:235
682
- #: admin/pages/wptouch-admin-general-settings.php:660
683
  msgid "None"
684
  msgstr ""
685
 
@@ -695,147 +695,157 @@ msgstr ""
695
  msgid "Analytics"
696
  msgstr ""
697
 
698
- #: admin/pages/wptouch-admin-general-settings.php:281
 
 
 
 
 
 
 
 
 
 
699
  msgid "WPtouch Pro Love"
700
  msgstr ""
701
 
702
- #: admin/pages/wptouch-admin-general-settings.php:287
703
  msgid "Show powered by WPtouch Pro link in theme footer"
704
  msgstr ""
705
 
706
- #: admin/pages/wptouch-admin-general-settings.php:299
707
  msgid "Language"
708
  msgstr ""
709
 
710
- #: admin/pages/wptouch-admin-general-settings.php:305
711
  msgid "Theme Language"
712
  msgstr ""
713
 
714
- #: admin/pages/wptouch-admin-general-settings.php:314
715
  msgid "Also applies to admin"
716
  msgstr ""
717
 
718
- #: admin/pages/wptouch-admin-general-settings.php:333
719
  msgctxt ""
720
  "shortcodes are pieces of code [like_this] that users can drop into textareas "
721
  "that will convert to longer pieces of code"
722
  msgid "Shortcodes"
723
  msgstr ""
724
 
725
- #: admin/pages/wptouch-admin-general-settings.php:339
726
  msgid "Process desktop theme shortcodes"
727
  msgstr ""
728
 
729
- #: admin/pages/wptouch-admin-general-settings.php:347
730
  msgid "Filter out shortcodes"
731
  msgstr ""
732
 
733
- #: admin/pages/wptouch-admin-general-settings.php:348
734
  msgid "Filters out shortcodes from displaying when WPtouch Pro is active."
735
  msgstr ""
736
 
737
- #: admin/pages/wptouch-admin-general-settings.php:359
738
  msgctxt ""
739
  "caching services like Varnish can sometimes cause issues with WPtouch."
740
  msgid "Caching"
741
  msgstr ""
742
 
743
- #: admin/pages/wptouch-admin-general-settings.php:365
744
  msgid "Stop sending \"no cache\" request headers for mobile site."
745
  msgstr ""
746
 
747
- #: admin/pages/wptouch-admin-general-settings.php:366
748
  msgid ""
749
  "By default WPtouch requests that mobile pages are not cached. This helps "
750
  "prevent the mobile site from being served to desktop users and the desktop "
751
  "site from being served to mobile users."
752
  msgstr ""
753
 
754
- #: admin/pages/wptouch-admin-general-settings.php:380
755
  msgid "Active Plugins"
756
  msgstr ""
757
 
758
- #: admin/pages/wptouch-admin-general-settings.php:391
759
  msgid ""
760
  "Attempts to disable plugins for mobile visitors. Some plugins don‘t support "
761
  "this feature due to the way they load in WordPress."
762
  msgstr ""
763
 
764
- #: admin/pages/wptouch-admin-general-settings.php:403
765
  msgid "Mobile Devices & Browsers"
766
  msgstr ""
767
 
768
- #: admin/pages/wptouch-admin-general-settings.php:463
769
  msgid "Tablets"
770
  msgstr ""
771
 
772
- #: admin/pages/wptouch-admin-general-settings.php:521
773
  msgid "Tablet Devices & Browsers"
774
  msgstr ""
775
 
776
- #: admin/pages/wptouch-admin-general-settings.php:536
777
  msgid ""
778
  "If your theme supports tablets, devices and browsers WPtouch Pro can be "
779
  "enabled for will be listed below."
780
  msgstr ""
781
 
782
- #: admin/pages/wptouch-admin-general-settings.php:542
783
  msgid "Additional User Agents"
784
  msgstr ""
785
 
786
- #: admin/pages/wptouch-admin-general-settings.php:548
787
  msgid "User agents to add"
788
  msgstr ""
789
 
790
- #: admin/pages/wptouch-admin-general-settings.php:549
791
  msgid "You can enter partial i.e. \"nokia\" or full agent strings"
792
  msgstr ""
793
 
794
- #: admin/pages/wptouch-admin-general-settings.php:566
795
  msgid "Menu Setup"
796
  msgstr ""
797
 
798
- #: admin/pages/wptouch-admin-general-settings.php:584
799
  msgid "Menu Options"
800
  msgstr ""
801
 
802
- #: admin/pages/wptouch-admin-general-settings.php:590
803
  msgid "Enable parent items as links"
804
  msgstr ""
805
 
806
- #: admin/pages/wptouch-admin-general-settings.php:591
807
  msgid "If disabled, parent menu items will only toggle child items."
808
  msgstr ""
809
 
810
- #: admin/pages/wptouch-admin-general-settings.php:598
811
  msgid "Use menu icons"
812
  msgstr ""
813
 
814
- #: admin/pages/wptouch-admin-general-settings.php:599
815
  msgid "Adds the ability to associate icons with menu items"
816
  msgstr ""
817
 
818
- #: admin/pages/wptouch-admin-general-settings.php:610
819
  msgid "Menu Icon Sets"
820
  msgstr ""
821
 
822
- #: admin/pages/wptouch-admin-general-settings.php:623
823
  #: admin/settings/html/installed_icon_sets_ajax.php:4
824
  #: core/class-wptouch-pro.php:2187 core/class-wptouch-pro.php:2188
825
  #: core/config.php:54
826
  msgid "Custom Icons"
827
  msgstr ""
828
 
829
- #: admin/pages/wptouch-admin-general-settings.php:654
830
  msgid "WordPress Pages"
831
  msgstr ""
832
 
833
- #: admin/pages/wptouch-admin-general-settings.php:672 core/admin-render.php:78
834
  #: core/admin-render.php:110 core/config.php:94
835
  msgid "Customize Theme"
836
  msgstr ""
837
 
838
- #: admin/pages/wptouch-admin-general-settings.php:739
839
  msgctxt "wptouch-pro"
840
  msgid "Subscribe to updates about new releases and tips"
841
  msgstr ""
@@ -2523,9 +2533,9 @@ msgstr ""
2523
  msgid "WPtouch Mobile Plugin"
2524
  msgstr ""
2525
 
2526
- #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.25) #-#-#-#-#
2527
  #. Plugin URI of the plugin/theme
2528
- #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.25) #-#-#-#-#
2529
  #. Author URI of the plugin/theme
2530
  msgid "http://www.wptouch.com/"
2531
  msgstr ""
2
  # This file is distributed under the same license as the WPtouch Mobile Plugin package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPtouch Mobile Plugin 4.3.26\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wptouch\n"
7
+ "POT-Creation-Date: 2018-02-08 18:34:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: admin/customizer/wptouch-customizer.php:568
16
  msgid "Device Orientation"
17
  msgstr ""
18
 
19
+ #: admin/customizer/wptouch-customizer.php:595
20
  msgid "Switch to Mobile Theme"
21
  msgstr ""
22
 
23
+ #: admin/customizer/wptouch-customizer.php:596
24
  msgid "Switch to Desktop Theme"
25
  msgstr ""
26
 
679
  msgstr ""
680
 
681
  #: admin/pages/wptouch-admin-general-settings.php:235
682
+ #: admin/pages/wptouch-admin-general-settings.php:696
683
  msgid "None"
684
  msgstr ""
685
 
695
  msgid "Analytics"
696
  msgstr ""
697
 
698
+ #: admin/pages/wptouch-admin-general-settings.php:295
699
+ msgid ""
700
+ "Google Maps API Key &mdash; <a href=\"https://developers.google.com/maps/"
701
+ "documentation/static-maps/get-api-key\" target=\"_new\">Get a key</a>"
702
+ msgstr ""
703
+
704
+ #: admin/pages/wptouch-admin-general-settings.php:306
705
+ msgid "Google Maps"
706
+ msgstr ""
707
+
708
+ #: admin/pages/wptouch-admin-general-settings.php:317
709
  msgid "WPtouch Pro Love"
710
  msgstr ""
711
 
712
+ #: admin/pages/wptouch-admin-general-settings.php:323
713
  msgid "Show powered by WPtouch Pro link in theme footer"
714
  msgstr ""
715
 
716
+ #: admin/pages/wptouch-admin-general-settings.php:335
717
  msgid "Language"
718
  msgstr ""
719
 
720
+ #: admin/pages/wptouch-admin-general-settings.php:341
721
  msgid "Theme Language"
722
  msgstr ""
723
 
724
+ #: admin/pages/wptouch-admin-general-settings.php:350
725
  msgid "Also applies to admin"
726
  msgstr ""
727
 
728
+ #: admin/pages/wptouch-admin-general-settings.php:369
729
  msgctxt ""
730
  "shortcodes are pieces of code [like_this] that users can drop into textareas "
731
  "that will convert to longer pieces of code"
732
  msgid "Shortcodes"
733
  msgstr ""
734
 
735
+ #: admin/pages/wptouch-admin-general-settings.php:375
736
  msgid "Process desktop theme shortcodes"
737
  msgstr ""
738
 
739
+ #: admin/pages/wptouch-admin-general-settings.php:383
740
  msgid "Filter out shortcodes"
741
  msgstr ""
742
 
743
+ #: admin/pages/wptouch-admin-general-settings.php:384
744
  msgid "Filters out shortcodes from displaying when WPtouch Pro is active."
745
  msgstr ""
746
 
747
+ #: admin/pages/wptouch-admin-general-settings.php:395
748
  msgctxt ""
749
  "caching services like Varnish can sometimes cause issues with WPtouch."
750
  msgid "Caching"
751
  msgstr ""
752
 
753
+ #: admin/pages/wptouch-admin-general-settings.php:401
754
  msgid "Stop sending \"no cache\" request headers for mobile site."
755
  msgstr ""
756
 
757
+ #: admin/pages/wptouch-admin-general-settings.php:402
758
  msgid ""
759
  "By default WPtouch requests that mobile pages are not cached. This helps "
760
  "prevent the mobile site from being served to desktop users and the desktop "
761
  "site from being served to mobile users."
762
  msgstr ""
763
 
764
+ #: admin/pages/wptouch-admin-general-settings.php:416
765
  msgid "Active Plugins"
766
  msgstr ""
767
 
768
+ #: admin/pages/wptouch-admin-general-settings.php:427
769
  msgid ""
770
  "Attempts to disable plugins for mobile visitors. Some plugins don‘t support "
771
  "this feature due to the way they load in WordPress."
772
  msgstr ""
773
 
774
+ #: admin/pages/wptouch-admin-general-settings.php:439
775
  msgid "Mobile Devices & Browsers"
776
  msgstr ""
777
 
778
+ #: admin/pages/wptouch-admin-general-settings.php:499
779
  msgid "Tablets"
780
  msgstr ""
781
 
782
+ #: admin/pages/wptouch-admin-general-settings.php:557
783
  msgid "Tablet Devices & Browsers"
784
  msgstr ""
785
 
786
+ #: admin/pages/wptouch-admin-general-settings.php:572
787
  msgid ""
788
  "If your theme supports tablets, devices and browsers WPtouch Pro can be "
789
  "enabled for will be listed below."
790
  msgstr ""
791
 
792
+ #: admin/pages/wptouch-admin-general-settings.php:578
793
  msgid "Additional User Agents"
794
  msgstr ""
795
 
796
+ #: admin/pages/wptouch-admin-general-settings.php:584
797
  msgid "User agents to add"
798
  msgstr ""
799
 
800
+ #: admin/pages/wptouch-admin-general-settings.php:585
801
  msgid "You can enter partial i.e. \"nokia\" or full agent strings"
802
  msgstr ""
803
 
804
+ #: admin/pages/wptouch-admin-general-settings.php:602
805
  msgid "Menu Setup"
806
  msgstr ""
807
 
808
+ #: admin/pages/wptouch-admin-general-settings.php:620
809
  msgid "Menu Options"
810
  msgstr ""
811
 
812
+ #: admin/pages/wptouch-admin-general-settings.php:626
813
  msgid "Enable parent items as links"
814
  msgstr ""
815
 
816
+ #: admin/pages/wptouch-admin-general-settings.php:627
817
  msgid "If disabled, parent menu items will only toggle child items."
818
  msgstr ""
819
 
820
+ #: admin/pages/wptouch-admin-general-settings.php:634
821
  msgid "Use menu icons"
822
  msgstr ""
823
 
824
+ #: admin/pages/wptouch-admin-general-settings.php:635
825
  msgid "Adds the ability to associate icons with menu items"
826
  msgstr ""
827
 
828
+ #: admin/pages/wptouch-admin-general-settings.php:646
829
  msgid "Menu Icon Sets"
830
  msgstr ""
831
 
832
+ #: admin/pages/wptouch-admin-general-settings.php:659
833
  #: admin/settings/html/installed_icon_sets_ajax.php:4
834
  #: core/class-wptouch-pro.php:2187 core/class-wptouch-pro.php:2188
835
  #: core/config.php:54
836
  msgid "Custom Icons"
837
  msgstr ""
838
 
839
+ #: admin/pages/wptouch-admin-general-settings.php:690
840
  msgid "WordPress Pages"
841
  msgstr ""
842
 
843
+ #: admin/pages/wptouch-admin-general-settings.php:708 core/admin-render.php:78
844
  #: core/admin-render.php:110 core/config.php:94
845
  msgid "Customize Theme"
846
  msgstr ""
847
 
848
+ #: admin/pages/wptouch-admin-general-settings.php:775
849
  msgctxt "wptouch-pro"
850
  msgid "Subscribe to updates about new releases and tips"
851
  msgstr ""
2533
  msgid "WPtouch Mobile Plugin"
2534
  msgstr ""
2535
 
2536
+ #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.26) #-#-#-#-#
2537
  #. Plugin URI of the plugin/theme
2538
+ #. #-#-#-#-# wptouch.pot (WPtouch Mobile Plugin 4.3.26) #-#-#-#-#
2539
  #. Author URI of the plugin/theme
2540
  msgid "http://www.wptouch.com/"
2541
  msgstr ""
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: wptouch, sureswiftcapital, duanestorey, dalemugford, adamdipardo, oxymoron
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
- Stable tag: 4.3.25
6
  Tested up to: 4.9
7
  License: GPLv2
8
 
@@ -33,6 +33,11 @@ For more information visit [WPtouch.com](http://www.wptouch.com/?utm_campaign=wp
33
 
34
  == Changelog ==
35
 
 
 
 
 
 
36
  = Version 4.3.25 (Feb 2nd, 2018) =
37
 
38
  * Fixed: Double escaping on post content which caused certain shortcodes not to work properly.
2
  Contributors: wptouch, sureswiftcapital, duanestorey, dalemugford, adamdipardo, oxymoron
3
  Tags: wptouch, iphone, ipod, bravenewcode, mobile, mobile-friendly, android, blackberry, smartphone, responsive, design, mobile plugin, ios, mobile theme
4
  Requires at least: 4.2
5
+ Stable tag: 4.3.26
6
  Tested up to: 4.9
7
  License: GPLv2
8
 
33
 
34
  == Changelog ==
35
 
36
+ = Version 4.3.26 (Feb 8th, 2018) =
37
+
38
+ * Added: Additional escaping for JS output.
39
+ * Added: Additional core theme support items.
40
+
41
  = Version 4.3.25 (Feb 2nd, 2018) =
42
 
43
  * Fixed: Double escaping on post content which caused certain shortcodes not to work properly.
wptouch.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
- Version: 4.3.25
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks.
7
  Author: WPtouch
8
  Author URI: http://www.wptouch.com/
@@ -14,7 +14,7 @@
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
- define( 'WPTOUCH_VERSION', '4.3.25' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );
2
  /*
3
  Plugin Name: WPtouch Mobile Plugin
4
  Plugin URI: http://www.wptouch.com/
5
+ Version: 4.3.26
6
  Description: Make a beautiful mobile-friendly version of your website with just a few clicks.
7
  Author: WPtouch
8
  Author URI: http://www.wptouch.com/
14
 
15
  function wptouch_create_four_object() {
16
  if ( !defined( 'WPTOUCH_IS_PRO' ) ) {
17
+ define( 'WPTOUCH_VERSION', '4.3.26' );
18
 
19
  define( 'WPTOUCH_BASE_NAME', basename( __FILE__, '.php' ) . '.php' );
20
  define( 'WPTOUCH_DIR', WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . basename( __FILE__, '.php' ) );