Version Description
- New: Create custom values for open graph meta tag og:type, e.g video, product
- Fix: undefined var title
- Fix: Pinterest popup not opening when network add-on is not installed
- Fix: Remove deprecated code and make mashsb.js smaller
- Fix: Facebook access token validation function not working
Download this release
Release Info
Developer | ReneHermi |
Plugin | Social Media Share Buttons | MashShare |
Version | 3.4.5 |
Comparing to | |
See all releases |
Code changes from version 3.4.1 to 3.4.5
- assets/js/ElementQueries.js +0 -515
- assets/js/mashsb-admin.js +21 -7
- assets/js/mashsb-admin.min.js +1 -1
- assets/js/mashsb.js +119 -579
- assets/js/mashsb.min.js +1 -1
- includes/admin/settings/display-settings.php +3 -1
- includes/admin/settings/metabox-settings.php +13 -1
- includes/admin/settings/register-settings.php +17 -2
- includes/admin/welcome.php +61 -47
- includes/cron.php +2 -2
- includes/header-meta-tags.php +17 -1
- includes/install.php +7 -0
- includes/scripts.php +0 -1
- includes/template-functions.php +5 -3
- mashshare.php +2 -2
- readme.txt +27 -4
assets/js/ElementQueries.js
DELETED
@@ -1,515 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Copyright Marc J. Schmidt. See the LICENSE file at the top-level
|
3 |
-
* directory of this distribution and at
|
4 |
-
* https://github.com/marcj/css-element-queries/blob/master/LICENSE.
|
5 |
-
*/
|
6 |
-
;
|
7 |
-
(function (root, factory) {
|
8 |
-
if (typeof define === "function" && define.amd) {
|
9 |
-
define(['./ResizeSensor.js'], factory);
|
10 |
-
} else if (typeof exports === "object") {
|
11 |
-
module.exports = factory(require('./ResizeSensor.js'));
|
12 |
-
} else {
|
13 |
-
root.ElementQueries = factory(root.ResizeSensor);
|
14 |
-
}
|
15 |
-
}(this, function (ResizeSensor) {
|
16 |
-
|
17 |
-
/**
|
18 |
-
*
|
19 |
-
* @type {Function}
|
20 |
-
* @constructor
|
21 |
-
*/
|
22 |
-
var ElementQueries = function() {
|
23 |
-
|
24 |
-
var trackingActive = false;
|
25 |
-
var elements = [];
|
26 |
-
|
27 |
-
/**
|
28 |
-
*
|
29 |
-
* @param element
|
30 |
-
* @returns {Number}
|
31 |
-
*/
|
32 |
-
function getEmSize(element) {
|
33 |
-
if (!element) {
|
34 |
-
element = document.documentElement;
|
35 |
-
}
|
36 |
-
var fontSize = window.getComputedStyle(element, null).fontSize;
|
37 |
-
return parseFloat(fontSize) || 16;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
*
|
42 |
-
* @copyright https://github.com/Mr0grog/element-query/blob/master/LICENSE
|
43 |
-
*
|
44 |
-
* @param {HTMLElement} element
|
45 |
-
* @param {*} value
|
46 |
-
* @returns {*}
|
47 |
-
*/
|
48 |
-
function convertToPx(element, value) {
|
49 |
-
var numbers = value.split(/\d/);
|
50 |
-
var units = numbers[numbers.length-1];
|
51 |
-
value = parseFloat(value);
|
52 |
-
switch (units) {
|
53 |
-
case "px":
|
54 |
-
return value;
|
55 |
-
case "em":
|
56 |
-
return value * getEmSize(element);
|
57 |
-
case "rem":
|
58 |
-
return value * getEmSize();
|
59 |
-
// Viewport units!
|
60 |
-
// According to http://quirksmode.org/mobile/tableViewport.html
|
61 |
-
// documentElement.clientWidth/Height gets us the most reliable info
|
62 |
-
case "vw":
|
63 |
-
return value * document.documentElement.clientWidth / 100;
|
64 |
-
case "vh":
|
65 |
-
return value * document.documentElement.clientHeight / 100;
|
66 |
-
case "vmin":
|
67 |
-
case "vmax":
|
68 |
-
var vw = document.documentElement.clientWidth / 100;
|
69 |
-
var vh = document.documentElement.clientHeight / 100;
|
70 |
-
var chooser = Math[units === "vmin" ? "min" : "max"];
|
71 |
-
return value * chooser(vw, vh);
|
72 |
-
default:
|
73 |
-
return value;
|
74 |
-
// for now, not supporting physical units (since they are just a set number of px)
|
75 |
-
// or ex/ch (getting accurate measurements is hard)
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
*
|
81 |
-
* @param {HTMLElement} element
|
82 |
-
* @constructor
|
83 |
-
*/
|
84 |
-
function SetupInformation(element) {
|
85 |
-
this.element = element;
|
86 |
-
this.options = {};
|
87 |
-
var key, option, width = 0, height = 0, value, actualValue, attrValues, attrValue, attrName;
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @param {Object} option {mode: 'min|max', property: 'width|height', value: '123px'}
|
91 |
-
*/
|
92 |
-
this.addOption = function(option) {
|
93 |
-
var idx = [option.mode, option.property, option.value].join(',');
|
94 |
-
this.options[idx] = option;
|
95 |
-
};
|
96 |
-
|
97 |
-
var attributes = ['min-width', 'min-height', 'max-width', 'max-height'];
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Extracts the computed width/height and sets to min/max- attribute.
|
101 |
-
*/
|
102 |
-
this.call = function() {
|
103 |
-
// extract current dimensions
|
104 |
-
width = this.element.offsetWidth;
|
105 |
-
height = this.element.offsetHeight;
|
106 |
-
|
107 |
-
attrValues = {};
|
108 |
-
|
109 |
-
for (key in this.options) {
|
110 |
-
if (!this.options.hasOwnProperty(key)){
|
111 |
-
continue;
|
112 |
-
}
|
113 |
-
option = this.options[key];
|
114 |
-
|
115 |
-
value = convertToPx(this.element, option.value);
|
116 |
-
|
117 |
-
actualValue = option.property == 'width' ? width : height;
|
118 |
-
attrName = option.mode + '-' + option.property;
|
119 |
-
attrValue = '';
|
120 |
-
|
121 |
-
if (option.mode == 'min' && actualValue >= value) {
|
122 |
-
attrValue += option.value;
|
123 |
-
}
|
124 |
-
|
125 |
-
if (option.mode == 'max' && actualValue <= value) {
|
126 |
-
attrValue += option.value;
|
127 |
-
}
|
128 |
-
|
129 |
-
if (!attrValues[attrName]) attrValues[attrName] = '';
|
130 |
-
if (attrValue && -1 === (' '+attrValues[attrName]+' ').indexOf(' ' + attrValue + ' ')) {
|
131 |
-
attrValues[attrName] += ' ' + attrValue;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
for (var k in attributes) {
|
136 |
-
if(!attributes.hasOwnProperty(k)) continue;
|
137 |
-
|
138 |
-
if (attrValues[attributes[k]]) {
|
139 |
-
this.element.setAttribute(attributes[k], attrValues[attributes[k]].substr(1));
|
140 |
-
} else {
|
141 |
-
this.element.removeAttribute(attributes[k]);
|
142 |
-
}
|
143 |
-
}
|
144 |
-
};
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* @param {HTMLElement} element
|
149 |
-
* @param {Object} options
|
150 |
-
*/
|
151 |
-
function setupElement(element, options) {
|
152 |
-
if (element.elementQueriesSetupInformation) {
|
153 |
-
element.elementQueriesSetupInformation.addOption(options);
|
154 |
-
} else {
|
155 |
-
element.elementQueriesSetupInformation = new SetupInformation(element);
|
156 |
-
element.elementQueriesSetupInformation.addOption(options);
|
157 |
-
element.elementQueriesSensor = new ResizeSensor(element, function() {
|
158 |
-
element.elementQueriesSetupInformation.call();
|
159 |
-
});
|
160 |
-
}
|
161 |
-
element.elementQueriesSetupInformation.call();
|
162 |
-
|
163 |
-
if (trackingActive && elements.indexOf(element) < 0) {
|
164 |
-
elements.push(element);
|
165 |
-
}
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* @param {String} selector
|
170 |
-
* @param {String} mode min|max
|
171 |
-
* @param {String} property width|height
|
172 |
-
* @param {String} value
|
173 |
-
*/
|
174 |
-
var allQueries = {};
|
175 |
-
function queueQuery(selector, mode, property, value) {
|
176 |
-
if (typeof(allQueries[mode]) == 'undefined') allQueries[mode] = {};
|
177 |
-
if (typeof(allQueries[mode][property]) == 'undefined') allQueries[mode][property] = {};
|
178 |
-
if (typeof(allQueries[mode][property][value]) == 'undefined') allQueries[mode][property][value] = selector;
|
179 |
-
else allQueries[mode][property][value] += ','+selector;
|
180 |
-
}
|
181 |
-
|
182 |
-
function getQuery() {
|
183 |
-
var query;
|
184 |
-
if (document.querySelectorAll) query = document.querySelectorAll.bind(document);
|
185 |
-
if (!query && 'undefined' !== typeof $$) query = $$;
|
186 |
-
if (!query && 'undefined' !== typeof jQuery) query = jQuery;
|
187 |
-
|
188 |
-
if (!query) {
|
189 |
-
throw 'No document.querySelectorAll, jQuery or Mootools\'s $$ found.';
|
190 |
-
}
|
191 |
-
|
192 |
-
return query;
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Start the magic. Go through all collected rules (readRules()) and attach the resize-listener.
|
197 |
-
*/
|
198 |
-
function findElementQueriesElements() {
|
199 |
-
var query = getQuery();
|
200 |
-
|
201 |
-
for (var mode in allQueries) if (allQueries.hasOwnProperty(mode)) {
|
202 |
-
|
203 |
-
for (var property in allQueries[mode]) if (allQueries[mode].hasOwnProperty(property)) {
|
204 |
-
for (var value in allQueries[mode][property]) if (allQueries[mode][property].hasOwnProperty(value)) {
|
205 |
-
var elements = query(allQueries[mode][property][value]);
|
206 |
-
for (var i = 0, j = elements.length; i < j; i++) {
|
207 |
-
setupElement(elements[i], {
|
208 |
-
mode: mode,
|
209 |
-
property: property,
|
210 |
-
value: value
|
211 |
-
});
|
212 |
-
}
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
*
|
221 |
-
* @param {HTMLElement} element
|
222 |
-
*/
|
223 |
-
function attachResponsiveImage(element) {
|
224 |
-
var children = [];
|
225 |
-
var rules = [];
|
226 |
-
var sources = [];
|
227 |
-
var defaultImageId = 0;
|
228 |
-
var lastActiveImage = -1;
|
229 |
-
var loadedImages = [];
|
230 |
-
|
231 |
-
for (var i in element.children) {
|
232 |
-
if(!element.children.hasOwnProperty(i)) continue;
|
233 |
-
|
234 |
-
if (element.children[i].tagName && element.children[i].tagName.toLowerCase() === 'img') {
|
235 |
-
children.push(element.children[i]);
|
236 |
-
|
237 |
-
var minWidth = element.children[i].getAttribute('min-width') || element.children[i].getAttribute('data-min-width');
|
238 |
-
//var minHeight = element.children[i].getAttribute('min-height') || element.children[i].getAttribute('data-min-height');
|
239 |
-
var src = element.children[i].getAttribute('data-src') || element.children[i].getAttribute('url');
|
240 |
-
|
241 |
-
sources.push(src);
|
242 |
-
|
243 |
-
var rule = {
|
244 |
-
minWidth: minWidth
|
245 |
-
};
|
246 |
-
|
247 |
-
rules.push(rule);
|
248 |
-
|
249 |
-
if (!minWidth) {
|
250 |
-
defaultImageId = children.length - 1;
|
251 |
-
element.children[i].style.display = 'block';
|
252 |
-
} else {
|
253 |
-
element.children[i].style.display = 'none';
|
254 |
-
}
|
255 |
-
}
|
256 |
-
}
|
257 |
-
|
258 |
-
lastActiveImage = defaultImageId;
|
259 |
-
|
260 |
-
function check() {
|
261 |
-
var imageToDisplay = false, i;
|
262 |
-
|
263 |
-
for (i in children){
|
264 |
-
if(!children.hasOwnProperty(i)) continue;
|
265 |
-
|
266 |
-
if (rules[i].minWidth) {
|
267 |
-
if (element.offsetWidth > rules[i].minWidth) {
|
268 |
-
imageToDisplay = i;
|
269 |
-
}
|
270 |
-
}
|
271 |
-
}
|
272 |
-
|
273 |
-
if (!imageToDisplay) {
|
274 |
-
//no rule matched, show default
|
275 |
-
imageToDisplay = defaultImageId;
|
276 |
-
}
|
277 |
-
|
278 |
-
if (lastActiveImage != imageToDisplay) {
|
279 |
-
//image change
|
280 |
-
|
281 |
-
if (!loadedImages[imageToDisplay]){
|
282 |
-
//image has not been loaded yet, we need to load the image first in memory to prevent flash of
|
283 |
-
//no content
|
284 |
-
|
285 |
-
var image = new Image();
|
286 |
-
image.onload = function() {
|
287 |
-
children[imageToDisplay].src = sources[imageToDisplay];
|
288 |
-
|
289 |
-
children[lastActiveImage].style.display = 'none';
|
290 |
-
children[imageToDisplay].style.display = 'block';
|
291 |
-
|
292 |
-
loadedImages[imageToDisplay] = true;
|
293 |
-
|
294 |
-
lastActiveImage = imageToDisplay;
|
295 |
-
};
|
296 |
-
|
297 |
-
image.src = sources[imageToDisplay];
|
298 |
-
} else {
|
299 |
-
children[lastActiveImage].style.display = 'none';
|
300 |
-
children[imageToDisplay].style.display = 'block';
|
301 |
-
lastActiveImage = imageToDisplay;
|
302 |
-
}
|
303 |
-
} else {
|
304 |
-
//make sure for initial check call the .src is set correctly
|
305 |
-
children[imageToDisplay].src = sources[imageToDisplay];
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
element.resizeSensor = new ResizeSensor(element, check);
|
310 |
-
check();
|
311 |
-
|
312 |
-
if (trackingActive) {
|
313 |
-
elements.push(element);
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
function findResponsiveImages(){
|
318 |
-
var query = getQuery();
|
319 |
-
|
320 |
-
var elements = query('[data-responsive-image],[responsive-image]');
|
321 |
-
for (var i = 0, j = elements.length; i < j; i++) {
|
322 |
-
attachResponsiveImage(elements[i]);
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
var regex = /,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/mgi;
|
327 |
-
var attrRegex = /\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/mgi;
|
328 |
-
/**
|
329 |
-
* @param {String} css
|
330 |
-
*/
|
331 |
-
function extractQuery(css) {
|
332 |
-
var match;
|
333 |
-
var smatch;
|
334 |
-
css = css.replace(/'/g, '"');
|
335 |
-
while (null !== (match = regex.exec(css))) {
|
336 |
-
smatch = match[1] + match[3];
|
337 |
-
attrs = match[2];
|
338 |
-
|
339 |
-
while (null !== (attrMatch = attrRegex.exec(attrs))) {
|
340 |
-
queueQuery(smatch, attrMatch[1], attrMatch[2], attrMatch[3]);
|
341 |
-
}
|
342 |
-
}
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* @param {CssRule[]|String} rules
|
347 |
-
*/
|
348 |
-
function readRules(rules) {
|
349 |
-
var selector = '';
|
350 |
-
if (!rules) {
|
351 |
-
return;
|
352 |
-
}
|
353 |
-
if ('string' === typeof rules) {
|
354 |
-
rules = rules.toLowerCase();
|
355 |
-
if (-1 !== rules.indexOf('min-width') || -1 !== rules.indexOf('max-width')) {
|
356 |
-
extractQuery(rules);
|
357 |
-
}
|
358 |
-
} else {
|
359 |
-
for (var i = 0, j = rules.length; i < j; i++) {
|
360 |
-
if (1 === rules[i].type) {
|
361 |
-
selector = rules[i].selectorText || rules[i].cssText;
|
362 |
-
if (-1 !== selector.indexOf('min-height') || -1 !== selector.indexOf('max-height')) {
|
363 |
-
extractQuery(selector);
|
364 |
-
}else if(-1 !== selector.indexOf('min-width') || -1 !== selector.indexOf('max-width')) {
|
365 |
-
extractQuery(selector);
|
366 |
-
}
|
367 |
-
} else if (4 === rules[i].type) {
|
368 |
-
readRules(rules[i].cssRules || rules[i].rules);
|
369 |
-
}
|
370 |
-
}
|
371 |
-
}
|
372 |
-
}
|
373 |
-
|
374 |
-
var defaultCssInjected = false;
|
375 |
-
|
376 |
-
/**
|
377 |
-
* Searches all css rules and setups the event listener to all elements with element query rules..
|
378 |
-
*
|
379 |
-
* @param {Boolean} withTracking allows and requires you to use detach, since we store internally all used elements
|
380 |
-
* (no garbage collection possible if you don not call .detach() first)
|
381 |
-
*/
|
382 |
-
this.init = function(withTracking) {
|
383 |
-
trackingActive = typeof withTracking === 'undefined' ? false : withTracking;
|
384 |
-
|
385 |
-
for (var i = 0, j = document.styleSheets.length; i < j; i++) {
|
386 |
-
try {
|
387 |
-
readRules(document.styleSheets[i].cssRules || document.styleSheets[i].rules || document.styleSheets[i].cssText);
|
388 |
-
} catch(e) {
|
389 |
-
if (e.name !== 'SecurityError') {
|
390 |
-
throw e;
|
391 |
-
}
|
392 |
-
}
|
393 |
-
}
|
394 |
-
|
395 |
-
if (!defaultCssInjected) {
|
396 |
-
var style = document.createElement('style');
|
397 |
-
style.type = 'text/css';
|
398 |
-
style.innerHTML = '[responsive-image] > img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img { width: 100%;}';
|
399 |
-
document.getElementsByTagName('head')[0].appendChild(style);
|
400 |
-
defaultCssInjected = true;
|
401 |
-
}
|
402 |
-
|
403 |
-
findElementQueriesElements();
|
404 |
-
findResponsiveImages();
|
405 |
-
};
|
406 |
-
|
407 |
-
/**
|
408 |
-
*
|
409 |
-
* @param {Boolean} withTracking allows and requires you to use detach, since we store internally all used elements
|
410 |
-
* (no garbage collection possible if you don not call .detach() first)
|
411 |
-
*/
|
412 |
-
this.update = function(withTracking) {
|
413 |
-
this.init(withTracking);
|
414 |
-
};
|
415 |
-
|
416 |
-
this.detach = function() {
|
417 |
-
if (!this.withTracking) {
|
418 |
-
throw 'withTracking is not enabled. We can not detach elements since we don not store it.' +
|
419 |
-
'Use ElementQueries.withTracking = true; before domready or call ElementQueryes.update(true).';
|
420 |
-
}
|
421 |
-
|
422 |
-
var element;
|
423 |
-
while (element = elements.pop()) {
|
424 |
-
ElementQueries.detach(element);
|
425 |
-
}
|
426 |
-
|
427 |
-
elements = [];
|
428 |
-
};
|
429 |
-
};
|
430 |
-
|
431 |
-
/**
|
432 |
-
*
|
433 |
-
* @param {Boolean} withTracking allows and requires you to use detach, since we store internally all used elements
|
434 |
-
* (no garbage collection possible if you don not call .detach() first)
|
435 |
-
*/
|
436 |
-
ElementQueries.update = function(withTracking) {
|
437 |
-
ElementQueries.instance.update(withTracking);
|
438 |
-
};
|
439 |
-
|
440 |
-
/**
|
441 |
-
* Removes all sensor and elementquery information from the element.
|
442 |
-
*
|
443 |
-
* @param {HTMLElement} element
|
444 |
-
*/
|
445 |
-
ElementQueries.detach = function(element) {
|
446 |
-
if (element.elementQueriesSetupInformation) {
|
447 |
-
//element queries
|
448 |
-
element.elementQueriesSensor.detach();
|
449 |
-
delete element.elementQueriesSetupInformation;
|
450 |
-
delete element.elementQueriesSensor;
|
451 |
-
|
452 |
-
} else if (element.resizeSensor) {
|
453 |
-
//responsive image
|
454 |
-
|
455 |
-
element.resizeSensor.detach();
|
456 |
-
delete element.resizeSensor;
|
457 |
-
} else {
|
458 |
-
//console.log('detached already', element);
|
459 |
-
}
|
460 |
-
};
|
461 |
-
|
462 |
-
ElementQueries.withTracking = false;
|
463 |
-
|
464 |
-
ElementQueries.init = function() {
|
465 |
-
if (!ElementQueries.instance) {
|
466 |
-
ElementQueries.instance = new ElementQueries();
|
467 |
-
}
|
468 |
-
|
469 |
-
ElementQueries.instance.init(ElementQueries.withTracking);
|
470 |
-
};
|
471 |
-
|
472 |
-
var domLoaded = function (callback) {
|
473 |
-
/* Internet Explorer */
|
474 |
-
/*@cc_on
|
475 |
-
@if (@_win32 || @_win64)
|
476 |
-
document.write('<script id="ieScriptLoad" defer src="//:"><\/script>');
|
477 |
-
document.getElementById('ieScriptLoad').onreadystatechange = function() {
|
478 |
-
if (this.readyState == 'complete') {
|
479 |
-
callback();
|
480 |
-
}
|
481 |
-
};
|
482 |
-
@end @*/
|
483 |
-
/* Mozilla, Chrome, Opera */
|
484 |
-
if (document.addEventListener) {
|
485 |
-
document.addEventListener('DOMContentLoaded', callback, false);
|
486 |
-
}
|
487 |
-
/* Safari, iCab, Konqueror */
|
488 |
-
else if (/KHTML|WebKit|iCab/i.test(navigator.userAgent)) {
|
489 |
-
var DOMLoadTimer = setInterval(function () {
|
490 |
-
if (/loaded|complete/i.test(document.readyState)) {
|
491 |
-
callback();
|
492 |
-
clearInterval(DOMLoadTimer);
|
493 |
-
}
|
494 |
-
}, 10);
|
495 |
-
}
|
496 |
-
/* Other web browsers */
|
497 |
-
else window.onload = callback;
|
498 |
-
};
|
499 |
-
|
500 |
-
ElementQueries.listen = function() {
|
501 |
-
domLoaded(ElementQueries.init);
|
502 |
-
};
|
503 |
-
|
504 |
-
// make available to common module loader
|
505 |
-
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
506 |
-
module.exports = ElementQueries;
|
507 |
-
}
|
508 |
-
else {
|
509 |
-
window.ElementQueries = ElementQueries;
|
510 |
-
ElementQueries.listen();
|
511 |
-
}
|
512 |
-
|
513 |
-
return ElementQueries;
|
514 |
-
|
515 |
-
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/mashsb-admin.js
CHANGED
@@ -47,13 +47,27 @@ jQuery(document).ready(function ($) {
|
|
47 |
function check_access_token()
|
48 |
{
|
49 |
$.ajax("https://graph.facebook.com/v2.7/?id=http://www.google.com&access_token=" + $('#mashsb_settings\\[fb_access_token_new\\]').val())
|
50 |
-
.done(function (e) {
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
})
|
58 |
}
|
59 |
|
47 |
function check_access_token()
|
48 |
{
|
49 |
$.ajax("https://graph.facebook.com/v2.7/?id=http://www.google.com&access_token=" + $('#mashsb_settings\\[fb_access_token_new\\]').val())
|
50 |
+
.done(function (e) {
|
51 |
+
|
52 |
+
try {
|
53 |
+
if (e.share.share_count) {
|
54 |
+
$('#mashsb_token_notice').html('<strong>Token valid:</strong> Facebook share count for http://google.com: ' + e.share.share_count )
|
55 |
+
}
|
56 |
+
} catch(e) {
|
57 |
+
$('#mashsb_token_notice').html('<span style="color:red;"> <strong>Error:</strong> Access Token Invalid!</span>');
|
58 |
+
}
|
59 |
+
//
|
60 |
+
// console.log(e);
|
61 |
+
// if (e.share.share_count && "undefined" !== typeof (e.share.share_count)){
|
62 |
+
// $('#mashsb_token_notice').html('<strong>Token valid:</strong> Facebook share count for http://google.com: ' + e.share.share_count );
|
63 |
+
// } else {
|
64 |
+
// $('#mashsb_token_notice').html('<span style="color:red;"> <strong>Error:</strong> Access Token Invalid!</span>');
|
65 |
+
// //console.log(e);
|
66 |
+
// }
|
67 |
+
// })
|
68 |
+
// .fail(function (e) {
|
69 |
+
// $('#mashsb_token_notice').html('<span style="color:red;"> <strong>Error:</strong> Access Token Invalid!</span>');
|
70 |
+
// //console.log(e);
|
71 |
})
|
72 |
}
|
73 |
|
assets/js/mashsb-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){function b(){a.ajax("https://graph.facebook.com/v2.7/?id=http://www.google.com&access_token="+a("#mashsb_settings\\[fb_access_token_new\\]").val()).done(function(b){a("#mashsb_token_notice").html("<strong>Token valid:</strong> Facebook share count for http://google.com: "+b.share.share_count),console.log(b)}).fail(function(b){a("#mashsb_token_notice").html('<span style="color:red;"> <strong>Error:</strong> Access Token Invalid!</span>'),console.log(b)})}function c(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+24*c*60*60*1e3);var e="; expires="+d.toGMTString()}else var e="";document.cookie=a+"="+b+e+"; path=/"}function d(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var e=c[d];" "==e.charAt(0);)e=e.substring(1,e.length);if(0==e.indexOf(b))return e.substring(b.length,e.length)}return null}function e(){var a=jQuery(".mashsb-tabs.active").find("a").attr("href");c("mashsb_active_tab",a)}function f(){var a=d("mashsb_active_tab");return null==a&&(a="#mashsb_settingsgeneral_header"),a}function g(){var a,b;return a=jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(2)"),b=jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(3)"),a.length>0||b.length>0?void 0:f()+"-nav"}a(".mashsb-color-box").each(function(){a(this).colpick({layout:"hex",submit:0,colorScheme:"light",onChange:function(b,c,d,e,f){a(e).css("border-color","#"+c),f||a(e).val(c)}}).keyup(function(){a(this).colpickSetColor(this.value)}),a(this).colpick({layout:"hex",submit:0,colorScheme:"light",onChange:function(b,c,d,e,f){a(e).css("border-color","#"+c),f||a(e).val(c)}}).keyup(function(){a(this).colpickSetColor(this.value)})}),a("#mashsb_verify_fbtoken").on("click",function(c){c.preventDefault(),a("#mashsb_settings\\[fb_access_token_new\\]").val()&&b()}),a("#mashsb_fb_auth").click(function(b){b.preventDefault(),winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");mashsb_fb_auth=window.open(e,"mashsb_fb_auth","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")}),a("#mashsb_settings\\[responsive_buttons\\]").attr("checked")?a("#mashsb_settings\\[button_width\\]").closest(".row").css("display","none"):a("#mashsb_settings\\[button_width\\]").closest(".row").fadeIn(300).css("display","table-row"),a("#mashsb_settings\\[responsive_buttons\\]").click(function(){a(this).attr("checked")?a("#mashsb_settings\\[button_width\\]").closest(".row").css("display","none"):a("#mashsb_settings\\[button_width\\]").closest(".row").fadeIn(300).css("display","table-row")}),a(".mashsb-chosen-select").chosen({width:"400px"}),a("#mashsb_settings\\[caching_method\\]").change(function(){"refresh_loading"===a("#mashsb_settings\\[caching_method\\]").val()?a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").fadeIn(300).css("display","table-row"):a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").css("display","none")}),"refresh_loading"===a("#mashsb_settings\\[caching_method\\]").val()?a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").fadeIn(300).css("display","table-row"):a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").css("display","none"),a(".mashsb-tabs").length&&a("#mashsb_container").easytabs({animate:!0,updateHash:!0,defaultTab:g()}),a("#mashsb_container").bind("easytabs:after",function(){0==jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(2)").length&&e()}),a(".mashtab").length&&a(".tabcontent_container").easytabs({animate:!0}),a("#mashsb_network_list").sortable({items:".mashsb_list_item",opacity:.6,cursor:"move",axis:"y",update:function(){var b=a(this).sortable("serialize")+"&action=mashsb_update_order";a.post(ajaxurl,b,function(){})}}),a(".mashsb-helper").click(function(b){b.preventDefault();var c=a(this),d=a(this).next();a(".mashsb-message").not(d).hide();var e=c.position();d.css(d.hasClass("bottom")?{left:e.left-d.width()/2+"px",top:e.top+c.height()+9+"px"}:{left:e.left+c.width()+9+"px",top:e.top+c.height()/2-18+"px"}),d.toggle(),b.stopPropagation()}),a("body").click(function(){a(".mashsb-message").hide()}),a(".mashsb-message").click(function(a){a.stopPropagation()})}),function(a,b,c){function d(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var e,f="hashchange",g=document,h=a.event.special,i=g.documentMode,j="on"+f in b&&(i===c||i>7);a.fn[f]=function(a){return a?this.bind(f,a):this.trigger(f)},a.fn[f].delay=50,h[f]=a.extend(h[f],{setup:function(){return j?!1:void a(e.start)},teardown:function(){return j?!1:void a(e.stop)}}),e=function(){function e(){var c=d(),g=n(k);c!==k?(m(k=c,g),a(b).trigger(f)):g!==k&&(location.href=location.href.replace(/#.*/,"")+g),h=setTimeout(e,a.fn[f].delay)}var h,i={},k=d(),l=function(a){return a},m=l,n=l;return i.start=function(){h||e()},i.stop=function(){h&&clearTimeout(h),h=c},a.browser.msie&&!j&&function(){var b,c;i.start=function(){b||(c=a.fn[f].src,c=c&&c+d(),b=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){c||m(d()),e()}).attr("src",c||"javascript:0").insertAfter("body")[0].contentWindow,g.onpropertychange=function(){try{"title"===event.propertyName&&(b.document.title=g.title)}catch(a){}})},i.stop=l,n=function(){return d(b.location.href)},m=function(c,d){var e=b.document,h=a.fn[f].domain;c!==d&&(e.title=g.title,e.open(),h&&e.write('<script>document.domain="'+h+'"</script>'),e.close(),b.location.hash=c)}}(),i}()}(jQuery,this),function(a){a.easytabs=function(b,c){var d,e,f,g,h,i,j=this,k=a(b),l={animate:!0,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:!0,cycle:!1,collapsible:!1,collapsedClass:"collapsed",collapsedByDefault:!0,uiTabs:!1,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:!0,event:"click",panelContext:k},m={fast:200,normal:400,slow:600};j.init=function(){j.settings=i=a.extend({},l,c),i.bind_str=i.event+".easytabs",i.uiTabs&&(i.tabActiveClass="ui-tabs-selected",i.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all",i.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all",i.tabClass="ui-state-default ui-corner-top",i.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"),i.collapsible&&void 0!==c.defaultTab&&void 0===c.collpasedByDefault&&(i.collapsedByDefault=!1),"string"==typeof i.animationSpeed&&(i.animationSpeed=m[i.animationSpeed]),a("a.anchor").remove().prependTo("body"),k.data("easytabs",{}),j.setTransitions(),j.getTabs(),o(),p(),r(),v(),w(),k.attr("data-easytabs",!0)},j.setTransitions=function(){f=i.animate?{show:i.transitionIn,hide:i.transitionOut,speed:i.animationSpeed,collapse:i.transitionCollapse,uncollapse:i.transitionUncollapse,halfSpeed:i.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}},j.getTabs=function(){var b;j.tabs=k.find(i.tabs),j.panels=a(),j.tabs.each(function(){var c=a(this),d=c.children("a"),e=c.children("a").data("target");c.data("easytabs",{}),void 0!==e&&null!==e?c.data("easytabs").ajax=d.attr("href"):e=d.attr("href"),e=e.match(/#([^\?]+)/)[1],b=i.panelContext.find("#"+e),b.length?(b.data("easytabs",{position:b.css("position"),visibility:b.css("visibility")}),b.not(i.panelActiveClass).hide(),j.panels=j.panels.add(b),c.data("easytabs").panel=b):(j.tabs=j.tabs.not(c),"console"in window&&console.warn("Warning: tab without matching panel for selector '#"+e+"' removed from set"))})},j.selectTab=function(a,b){var c=window.location,d=(c.hash.match(/^[^\?]*/)[0],a.parent().data("easytabs").panel),e=a.parent().data("easytabs").ajax;i.collapsible&&!h&&(a.hasClass(i.tabActiveClass)||a.hasClass(i.collapsedClass))?j.toggleTabCollapse(a,d,e,b):a.hasClass(i.tabActiveClass)&&d.hasClass(i.panelActiveClass)?i.cache||s(a,d,e,b):s(a,d,e,b)},j.toggleTabCollapse=function(a,b,c,d){j.panels.stop(!0,!0),n(k,"easytabs:before",[a,b,i])&&(j.tabs.filter("."+i.tabActiveClass).removeClass(i.tabActiveClass).children().removeClass(i.tabActiveClass),a.hasClass(i.collapsedClass)?(!c||i.cache&&a.parent().data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[a,b]),b.load(c,function(c,d,e){a.parent().data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[a,b,c,d,e])})),a.parent().removeClass(i.collapsedClass).addClass(i.tabActiveClass).children().removeClass(i.collapsedClass).addClass(i.tabActiveClass),b.addClass(i.panelActiveClass)[f.uncollapse](f.speed,i.transitionUncollapseEasing,function(){k.trigger("easytabs:midTransition",[a,b,i]),"function"==typeof d&&d()})):(a.addClass(i.collapsedClass).parent().addClass(i.collapsedClass),b.removeClass(i.panelActiveClass)[f.collapse](f.speed,i.transitionCollapseEasing,function(){k.trigger("easytabs:midTransition",[a,b,i]),"function"==typeof d&&d()})))},j.matchTab=function(a){return j.tabs.find("[href='"+a+"'],[data-target='"+a+"']").first()},j.matchInPanel=function(a){return a&&j.validId(a)?j.panels.filter(":has("+a+")").first():[]},j.validId=function(a){return a.substr(1).match(/^[A-Za-z][A-Za-z0-9\-_:\.]*$/)},j.selectTabFromHashChange=function(){var a,b=window.location.hash.match(/^[^\?]*/)[0],c=j.matchTab(b);i.updateHash&&(c.length?(h=!0,j.selectTab(c)):(a=j.matchInPanel(b),a.length?(b="#"+a.attr("id"),c=j.matchTab(b),h=!0,j.selectTab(c)):d.hasClass(i.tabActiveClass)||i.cycle||(""===b||j.matchTab(g).length||k.closest(b).length)&&(h=!0,j.selectTab(e))))},j.cycleTabs=function(b){i.cycle&&(b%=j.tabs.length,$tab=a(j.tabs[b]).children("a").first(),h=!0,j.selectTab($tab,function(){setTimeout(function(){j.cycleTabs(b+1)},i.cycle)}))},j.publicMethods={select:function(b){var c;0===(c=j.tabs.filter(b)).length?0===(c=j.tabs.find("a[href='"+b+"']")).length&&0===(c=j.tabs.find("a"+b)).length&&0===(c=j.tabs.find("[data-target='"+b+"']")).length&&0===(c=j.tabs.find("a[href$='"+b+"']")).length&&a.error("Tab '"+b+"' does not exist in tab set"):c=c.children("a").first(),j.selectTab(c)}};var n=function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},o=function(){k.addClass(i.containerClass),j.tabs.parent().addClass(i.tabsClass),j.tabs.addClass(i.tabClass),j.panels.addClass(i.panelClass)},p=function(){var b,c=window.location.hash.match(/^[^\?]*/)[0],f=j.matchTab(c).parent();1===f.length?(d=f,i.cycle=!1):(b=j.matchInPanel(c),b.length?(c="#"+b.attr("id"),d=j.matchTab(c).parent()):(d=j.tabs.parent().find(i.defaultTab),0===d.length&&a.error("The specified default tab ('"+i.defaultTab+"') could not be found in the tab set ('"+i.tabs+"') out of "+j.tabs.length+" tabs."))),e=d.children("a").first(),q(f)},q=function(b){var c,f;i.collapsible&&0===b.length&&i.collapsedByDefault?d.addClass(i.collapsedClass).children().addClass(i.collapsedClass):(c=a(d.data("easytabs").panel),f=d.data("easytabs").ajax,!f||i.cache&&d.data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[e,c]),c.load(f,function(a,b,f){d.data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[e,c,a,b,f])})),d.data("easytabs").panel.show().addClass(i.panelActiveClass),d.addClass(i.tabActiveClass).children().addClass(i.tabActiveClass)),k.trigger("easytabs:initialised",[e,c])},r=function(){j.tabs.children("a").bind(i.bind_str,function(b){i.cycle=!1,h=!1,j.selectTab(a(this)),b.preventDefault?b.preventDefault():b.returnValue=!1})},s=function(a,b,c,d){if(j.panels.stop(!0,!0),n(k,"easytabs:before",[a,b,i])){var e,l,m,o,p=j.panels.filter(":visible"),q=b.parent(),r=window.location.hash.match(/^[^\?]*/)[0];i.animate&&(e=t(b),l=p.length?u(p):0,m=e-l),g=r,o=function(){k.trigger("easytabs:midTransition",[a,b,i]),i.animate&&"fadeIn"==i.transitionIn&&0>m&&q.animate({height:q.height()+m},f.halfSpeed).css({"min-height":""}),i.updateHash&&!h?window.history.pushState?window.history.pushState(null,null,"#"+b.attr("id")):window.location.hash="#"+b.attr("id"):h=!1,b[f.show](f.speed,i.transitionInEasing,function(){q.css({height:"","min-height":""}),k.trigger("easytabs:after",[a,b,i]),"function"==typeof d&&d()})},!c||i.cache&&a.parent().data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[a,b]),b.load(c,function(c,d,e){a.parent().data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[a,b,c,d,e])})),i.animate&&"fadeOut"==i.transitionOut&&(m>0?q.animate({height:q.height()+m},f.halfSpeed):q.css({"min-height":q.height()})),j.tabs.filter("."+i.tabActiveClass).removeClass(i.tabActiveClass).children().removeClass(i.tabActiveClass),j.tabs.filter("."+i.collapsedClass).removeClass(i.collapsedClass).children().removeClass(i.collapsedClass),a.parent().addClass(i.tabActiveClass).children().addClass(i.tabActiveClass),j.panels.filter("."+i.panelActiveClass).removeClass(i.panelActiveClass),b.addClass(i.panelActiveClass),p.length?p[f.hide](f.speed,i.transitionOutEasing,o):b[f.uncollapse](f.speed,i.transitionUncollapseEasing,o)}},t=function(b){if(b.data("easytabs")&&b.data("easytabs").lastHeight)return b.data("easytabs").lastHeight;var c,d,e=b.css("display");try{c=a("<div></div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})}catch(f){c=a("<div></div>",{visibility:"hidden",overflow:"hidden"})}return d=b.wrap(c).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight(),b.unwrap(),b.css({position:b.data("easytabs").position,visibility:b.data("easytabs").visibility,display:e}),b.data("easytabs").lastHeight=d,d},u=function(a){var b=a.outerHeight();return a.data("easytabs")?a.data("easytabs").lastHeight=b:a.data("easytabs",{lastHeight:b}),b},v=function(){"function"==typeof a(window).hashchange?a(window).hashchange(function(){j.selectTabFromHashChange()}):a.address&&"function"==typeof a.address.change&&a.address.change(function(){j.selectTabFromHashChange()})},w=function(){var a;i.cycle&&(a=j.tabs.index(d),setTimeout(function(){j.cycleTabs(a+1)},i.cycle))};j.init()},a.fn.easytabs=function(b){var c=arguments;return this.each(function(){var d=a(this),e=d.data("easytabs");return void 0===e&&(e=new a.easytabs(this,b),d.data("easytabs",e)),e.publicMethods[b]?e.publicMethods[b](Array.prototype.slice.call(c,1)):void 0})}}(jQuery),function(a){var b=function(){var b='<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',c={showEvent:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},colorScheme:"light",color:"3289c7",livePreview:!0,flat:!1,layout:"full",submit:1,submitText:"OK",height:156},g=function(b,c){var d=f(b);a(c).data("colpick").fields.eq(1).val(d.r).end().eq(2).val(d.g).end().eq(3).val(d.b).end()},i=function(b,c){a(c).data("colpick").fields.eq(4).val(Math.round(b.h)).end().eq(5).val(Math.round(b.s)).end().eq(6).val(Math.round(b.b)).end()},j=function(b,c){a(c).data("colpick").fields.eq(0).val(h(b))},k=function(b,c){a(c).data("colpick").selector.css("backgroundColor","#"+h({h:b.h,s:100,b:100})),a(c).data("colpick").selectorIndic.css({left:parseInt(a(c).data("colpick").height*b.s/100,10),top:parseInt(a(c).data("colpick").height*(100-b.b)/100,10)})},l=function(b,c){a(c).data("colpick").hue.css("top",parseInt(a(c).data("colpick").height-a(c).data("colpick").height*b.h/360,10))},m=function(b,c){a(c).data("colpick").currentColor.css("backgroundColor","#"+h(b))},n=function(b,c){a(c).data("colpick").newColor.css("backgroundColor","#"+h(b))},o=function(){var b,c=a(this).parent().parent();this.parentNode.className.indexOf("_hex")>0?(c.data("colpick").color=b=d(G(this.value)),g(b,c.get(0)),i(b,c.get(0))):this.parentNode.className.indexOf("_hsb")>0?(c.data("colpick").color=b=E({h:parseInt(c.data("colpick").fields.eq(4).val(),10),s:parseInt(c.data("colpick").fields.eq(5).val(),10),b:parseInt(c.data("colpick").fields.eq(6).val(),10)}),g(b,c.get(0)),j(b,c.get(0))):(c.data("colpick").color=b=e(F({r:parseInt(c.data("colpick").fields.eq(1).val(),10),g:parseInt(c.data("colpick").fields.eq(2).val(),10),b:parseInt(c.data("colpick").fields.eq(3).val(),10)})),j(b,c.get(0)),i(b,c.get(0))),k(b,c.get(0)),l(b,c.get(0)),n(b,c.get(0)),c.data("colpick").onChange.apply(c.parent(),[b,h(b),f(b),c.data("colpick").el,0])},p=function(){a(this).parent().removeClass("colpick_focus")},q=function(){a(this).parent().parent().data("colpick").fields.parent().removeClass("colpick_focus"),a(this).parent().addClass("colpick_focus")},r=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c=a(this).parent().find("input").focus(),d={el:a(this).parent().addClass("colpick_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:this.parentNode.className.indexOf("_hsb")>0?100:255,y:b.pageY,field:c,val:parseInt(c.val(),10),preview:a(this).parent().parent().data("colpick").livePreview};a(document).mouseup(d,t),a(document).mousemove(d,s)},s=function(a){return a.data.field.val(Math.max(0,Math.min(a.data.max,parseInt(a.data.val-a.pageY+a.data.y,10)))),a.data.preview&&o.apply(a.data.field.get(0),[!0]),!1},t=function(b){return o.apply(b.data.field.get(0),[!0]),b.data.el.removeClass("colpick_slider").find("input").focus(),a(document).off("mouseup",t),a(document).off("mousemove",s),!1},u=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c={cal:a(this).parent(),y:a(this).offset().top};a(document).on("mouseup touchend",c,w),a(document).on("mousemove touchmove",c,v);var d="touchstart"==b.type?b.originalEvent.changedTouches[0].pageY:b.pageY;return o.apply(c.cal.data("colpick").fields.eq(4).val(parseInt(360*(c.cal.data("colpick").height-(d-c.y))/c.cal.data("colpick").height,10)).get(0),[c.cal.data("colpick").livePreview]),!1},v=function(a){var b="touchmove"==a.type?a.originalEvent.changedTouches[0].pageY:a.pageY;return o.apply(a.data.cal.data("colpick").fields.eq(4).val(parseInt(360*(a.data.cal.data("colpick").height-Math.max(0,Math.min(a.data.cal.data("colpick").height,b-a.data.y)))/a.data.cal.data("colpick").height,10)).get(0),[a.data.preview]),!1},w=function(b){return g(b.data.cal.data("colpick").color,b.data.cal.get(0)),j(b.data.cal.data("colpick").color,b.data.cal.get(0)),a(document).off("mouseup touchend",w),a(document).off("mousemove touchmove",v),!1},x=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c={cal:a(this).parent(),pos:a(this).offset()};c.preview=c.cal.data("colpick").livePreview,a(document).on("mouseup touchend",c,z),a(document).on("mousemove touchmove",c,y);var d;return"touchstart"==b.type?(pageX=b.originalEvent.changedTouches[0].pageX,d=b.originalEvent.changedTouches[0].pageY):(pageX=b.pageX,d=b.pageY),o.apply(c.cal.data("colpick").fields.eq(6).val(parseInt(100*(c.cal.data("colpick").height-(d-c.pos.top))/c.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*(pageX-c.pos.left)/c.cal.data("colpick").height,10)).get(0),[c.preview]),!1},y=function(a){var b;return"touchmove"==a.type?(pageX=a.originalEvent.changedTouches[0].pageX,b=a.originalEvent.changedTouches[0].pageY):(pageX=a.pageX,b=a.pageY),o.apply(a.data.cal.data("colpick").fields.eq(6).val(parseInt(100*(a.data.cal.data("colpick").height-Math.max(0,Math.min(a.data.cal.data("colpick").height,b-a.data.pos.top)))/a.data.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*Math.max(0,Math.min(a.data.cal.data("colpick").height,pageX-a.data.pos.left))/a.data.cal.data("colpick").height,10)).get(0),[a.data.preview]),!1},z=function(b){return g(b.data.cal.data("colpick").color,b.data.cal.get(0)),j(b.data.cal.data("colpick").color,b.data.cal.get(0)),a(document).off("mouseup touchend",z),a(document).off("mousemove touchmove",y),!1},A=function(){var b=a(this).parent(),c=b.data("colpick").color;b.data("colpick").origColor=c,m(c,b.get(0)),b.data("colpick").onSubmit(c,h(c),f(c),b.data("colpick").el)},B=function(b){b.stopPropagation();var c=a("#"+a(this).data("colpickId"));c.data("colpick").onBeforeShow.apply(this,[c.get(0)]);var d=a(this).offset(),e=d.top+this.offsetHeight,f=d.left,g=D(),h=c.width();f+h>g.l+g.w&&(f-=h),c.css({left:f+"px",top:e+"px"}),0!=c.data("colpick").onShow.apply(this,[c.get(0)])&&c.show(),a("html").mousedown({cal:c},C),c.mousedown(function(a){a.stopPropagation()})},C=function(b){0!=b.data.cal.data("colpick").onHide.apply(this,[b.data.cal.get(0)])&&b.data.cal.hide(),a("html").off("mousedown",C)},D=function(){var a="CSS1Compat"==document.compatMode;return{l:window.pageXOffset||(a?document.documentElement.scrollLeft:document.body.scrollLeft),w:window.innerWidth||(a?document.documentElement.clientWidth:document.body.clientWidth)}},E=function(a){return{h:Math.min(360,Math.max(0,a.h)),s:Math.min(100,Math.max(0,a.s)),b:Math.min(100,Math.max(0,a.b))}},F=function(a){return{r:Math.min(255,Math.max(0,a.r)),g:Math.min(255,Math.max(0,a.g)),b:Math.min(255,Math.max(0,a.b))}},G=function(a){var b=6-a.length;if(b>0){for(var c=[],d=0;b>d;d++)c.push("0");c.push(a),a=c.join("")}return a},H=function(){var b=a(this).parent(),c=b.data("colpick").origColor;b.data("colpick").color=c,g(c,b.get(0)),j(c,b.get(0)),i(c,b.get(0)),k(c,b.get(0)),l(c,b.get(0)),n(c,b.get(0))};return{init:function(f){if(f=a.extend({},c,f||{}),"string"==typeof f.color)f.color=d(f.color);else if(void 0!=f.color.r&&void 0!=f.color.g&&void 0!=f.color.b)f.color=e(f.color);else{if(void 0==f.color.h||void 0==f.color.s||void 0==f.color.b)return this;f.color=E(f.color)}return this.each(function(){if(!a(this).data("colpickId")){var c=a.extend({},f);c.origColor=f.color;var d="collorpicker_"+parseInt(1e3*Math.random());a(this).data("colpickId",d);var e=a(b).attr("id",d);e.addClass("colpick_"+c.layout+(c.submit?"":" colpick_"+c.layout+"_ns")),"light"!=c.colorScheme&&e.addClass("colpick_"+c.colorScheme),e.find("div.colpick_submit").html(c.submitText).click(A),c.fields=e.find("input").change(o).blur(p).focus(q),e.find("div.colpick_field_arrs").mousedown(r).end().find("div.colpick_current_color").click(H),c.selector=e.find("div.colpick_color").on("mousedown touchstart",x),c.selectorIndic=c.selector.find("div.colpick_selector_outer"),c.el=this,c.hue=e.find("div.colpick_hue_arrs"),huebar=c.hue.parent();var h=navigator.userAgent.toLowerCase(),s="Microsoft Internet Explorer"===navigator.appName,t=s?parseFloat(h.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,v=s&&10>t,w=["#ff0000","#ff0080","#ff00ff","#8000ff","#0000ff","#0080ff","#00ffff","#00ff80","#00ff00","#80ff00","#ffff00","#ff8000","#ff0000"];if(v){var y,z;for(y=0;11>=y;y++)z=a("<div></div>").attr("style","height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr="+w[y]+", endColorstr="+w[y+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+w[y]+", endColorstr="+w[y+1]+')";'),huebar.append(z)}else stopList=w.join(","),huebar.attr("style","background:-webkit-linear-gradient(top,"+stopList+"); background: -o-linear-gradient(top,"+stopList+"); background: -ms-linear-gradient(top,"+stopList+"); background:-moz-linear-gradient(top,"+stopList+"); -webkit-linear-gradient(top,"+stopList+"); background:linear-gradient(to bottom,"+stopList+"); ");e.find("div.colpick_hue").on("mousedown touchstart",u),c.newColor=e.find("div.colpick_new_color"),c.currentColor=e.find("div.colpick_current_color"),e.data("colpick",c),g(c.color,e.get(0)),i(c.color,e.get(0)),j(c.color,e.get(0)),l(c.color,e.get(0)),k(c.color,e.get(0)),m(c.color,e.get(0)),n(c.color,e.get(0)),c.flat?(e.appendTo(this).show(),e.css({position:"relative",display:"block"})):(e.appendTo(document.body),a(this).on(c.showEvent,B),e.css({position:"absolute"}))}})},showPicker:function(){return this.each(function(){a(this).data("colpickId")&&B.apply(this)})},hidePicker:function(){return this.each(function(){a(this).data("colpickId")&&a("#"+a(this).data("colpickId")).hide()})},setColor:function(b,c){if(c="undefined"==typeof c?1:c,"string"==typeof b)b=d(b);else if(void 0!=b.r&&void 0!=b.g&&void 0!=b.b)b=e(b);else{if(void 0==b.h||void 0==b.s||void 0==b.b)return this;b=E(b)}return this.each(function(){if(a(this).data("colpickId")){var d=a("#"+a(this).data("colpickId"));d.data("colpick").color=b,d.data("colpick").origColor=b,g(b,d.get(0)),i(b,d.get(0)),j(b,d.get(0)),l(b,d.get(0)),k(b,d.get(0)),n(b,d.get(0)),d.data("colpick").onChange.apply(d.parent(),[b,h(b),f(b),d.data("colpick").el,1]),c&&m(b,d.get(0))}})}}}(),c=function(a){var a=parseInt(a.indexOf("#")>-1?a.substring(1):a,16);return{r:a>>16,g:(65280&a)>>8,b:255&a}},d=function(a){return e(c(a))},e=function(a){var b={h:0,s:0,b:0},c=Math.min(a.r,a.g,a.b),d=Math.max(a.r,a.g,a.b),e=d-c;return b.b=d,b.s=0!=d?255*e/d:0,b.h=0!=b.s?a.r==d?(a.g-a.b)/e:a.g==d?2+(a.b-a.r)/e:4+(a.r-a.g)/e:-1,b.h*=60,b.h<0&&(b.h+=360),b.s*=100/255,b.b*=100/255,b},f=function(a){var b={},c=a.h,d=255*a.s/100,e=255*a.b/100;if(0==d)b.r=b.g=b.b=e;else{var f=e,g=(255-d)*e/255,h=(f-g)*(c%60)/60;360==c&&(c=0),60>c?(b.r=f,b.b=g,b.g=g+h):120>c?(b.g=f,b.b=g,b.r=f-h):180>c?(b.g=f,b.r=g,b.b=g+h):240>c?(b.b=f,b.r=g,b.g=f-h):300>c?(b.b=f,b.g=g,b.r=g+h):360>c?(b.r=f,b.g=g,b.b=f-h):(b.r=0,b.g=0,b.b=0)}return{r:Math.round(b.r),g:Math.round(b.g),b:Math.round(b.b)}},g=function(b){var c=[b.r.toString(16),b.g.toString(16),b.b.toString(16)];return a.each(c,function(a,b){1==b.length&&(c[a]="0"+b)}),c.join("")},h=function(a){return g(f(a))};a.fn.extend({colpick:b.init,colpickHide:b.hidePicker,colpickShow:b.showPicker,colpickSetColor:b.setColor}),a.extend({colpick:{rgbToHex:g,rgbToHsb:e,hsbToHex:h,hsbToRgb:f,hexToHsb:d,hexToRgb:c}})}(jQuery),window.twttr=function(a,b,c){var d,e=a.getElementsByTagName(b)[0],f=window.twttr||{};return a.getElementById(c)?f:(d=a.createElement(b),d.id=c,d.src="https://platform.twitter.com/widgets.js",e.parentNode.insertBefore(d,e),f._e=[],f.ready=function(a){f._e.push(a)},f)}(document,"script","twitter-wjs");
|
1 |
+
jQuery(document).ready(function(a){function b(){a.ajax("https://graph.facebook.com/v2.7/?id=http://www.google.com&access_token="+a("#mashsb_settings\\[fb_access_token_new\\]").val()).done(function(b){try{b.share.share_count&&a("#mashsb_token_notice").html("<strong>Token valid:</strong> Facebook share count for http://google.com: "+b.share.share_count)}catch(b){a("#mashsb_token_notice").html('<span style="color:red;"> <strong>Error:</strong> Access Token Invalid!</span>')}})}function c(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+24*c*60*60*1e3);var e="; expires="+d.toGMTString()}else var e="";document.cookie=a+"="+b+e+"; path=/"}function d(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var e=c[d];" "==e.charAt(0);)e=e.substring(1,e.length);if(0==e.indexOf(b))return e.substring(b.length,e.length)}return null}function e(){var a=jQuery(".mashsb-tabs.active").find("a").attr("href");c("mashsb_active_tab",a)}function f(){var a=d("mashsb_active_tab");return null==a&&(a="#mashsb_settingsgeneral_header"),a}function g(){var a,b;return a=jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(2)"),b=jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(3)"),a.length>0||b.length>0?void 0:f()+"-nav"}a(".mashsb-color-box").each(function(){a(this).colpick({layout:"hex",submit:0,colorScheme:"light",onChange:function(b,c,d,e,f){a(e).css("border-color","#"+c),f||a(e).val(c)}}).keyup(function(){a(this).colpickSetColor(this.value)}),a(this).colpick({layout:"hex",submit:0,colorScheme:"light",onChange:function(b,c,d,e,f){a(e).css("border-color","#"+c),f||a(e).val(c)}}).keyup(function(){a(this).colpickSetColor(this.value)})}),a("#mashsb_verify_fbtoken").on("click",function(c){c.preventDefault(),a("#mashsb_settings\\[fb_access_token_new\\]").val()&&b()}),a("#mashsb_fb_auth").click(function(b){b.preventDefault(),winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");mashsb_fb_auth=window.open(e,"mashsb_fb_auth","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")}),a("#mashsb_settings\\[responsive_buttons\\]").attr("checked")?a("#mashsb_settings\\[button_width\\]").closest(".row").css("display","none"):a("#mashsb_settings\\[button_width\\]").closest(".row").fadeIn(300).css("display","table-row"),a("#mashsb_settings\\[responsive_buttons\\]").click(function(){a(this).attr("checked")?a("#mashsb_settings\\[button_width\\]").closest(".row").css("display","none"):a("#mashsb_settings\\[button_width\\]").closest(".row").fadeIn(300).css("display","table-row")}),a(".mashsb-chosen-select").chosen({width:"400px"}),a("#mashsb_settings\\[caching_method\\]").change(function(){"refresh_loading"===a("#mashsb_settings\\[caching_method\\]").val()?a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").fadeIn(300).css("display","table-row"):a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").css("display","none")}),"refresh_loading"===a("#mashsb_settings\\[caching_method\\]").val()?a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").fadeIn(300).css("display","table-row"):a("#mashsb_settings\\[mashsharer_cache\\]").closest(".row").css("display","none"),a(".mashsb-tabs").length&&a("#mashsb_container").easytabs({animate:!0,updateHash:!0,defaultTab:g()}),a("#mashsb_container").bind("easytabs:after",function(){0==jQuery(".mashsb.nav-tab-wrapper a.nav-tab-active:nth-child(2)").length&&e()}),a(".mashtab").length&&a(".tabcontent_container").easytabs({animate:!0}),a("#mashsb_network_list").sortable({items:".mashsb_list_item",opacity:.6,cursor:"move",axis:"y",update:function(){var b=a(this).sortable("serialize")+"&action=mashsb_update_order";a.post(ajaxurl,b,function(){})}}),a(".mashsb-helper").click(function(b){b.preventDefault();var c=a(this),d=a(this).next();a(".mashsb-message").not(d).hide();var e=c.position();d.css(d.hasClass("bottom")?{left:e.left-d.width()/2+"px",top:e.top+c.height()+9+"px"}:{left:e.left+c.width()+9+"px",top:e.top+c.height()/2-18+"px"}),d.toggle(),b.stopPropagation()}),a("body").click(function(){a(".mashsb-message").hide()}),a(".mashsb-message").click(function(a){a.stopPropagation()})}),function(a,b,c){function d(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var e,f="hashchange",g=document,h=a.event.special,i=g.documentMode,j="on"+f in b&&(i===c||i>7);a.fn[f]=function(a){return a?this.bind(f,a):this.trigger(f)},a.fn[f].delay=50,h[f]=a.extend(h[f],{setup:function(){return j?!1:void a(e.start)},teardown:function(){return j?!1:void a(e.stop)}}),e=function(){function e(){var c=d(),g=n(k);c!==k?(m(k=c,g),a(b).trigger(f)):g!==k&&(location.href=location.href.replace(/#.*/,"")+g),h=setTimeout(e,a.fn[f].delay)}var h,i={},k=d(),l=function(a){return a},m=l,n=l;return i.start=function(){h||e()},i.stop=function(){h&&clearTimeout(h),h=c},a.browser.msie&&!j&&function(){var b,c;i.start=function(){b||(c=a.fn[f].src,c=c&&c+d(),b=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){c||m(d()),e()}).attr("src",c||"javascript:0").insertAfter("body")[0].contentWindow,g.onpropertychange=function(){try{"title"===event.propertyName&&(b.document.title=g.title)}catch(a){}})},i.stop=l,n=function(){return d(b.location.href)},m=function(c,d){var e=b.document,h=a.fn[f].domain;c!==d&&(e.title=g.title,e.open(),h&&e.write('<script>document.domain="'+h+'"</script>'),e.close(),b.location.hash=c)}}(),i}()}(jQuery,this),function(a){a.easytabs=function(b,c){var d,e,f,g,h,i,j=this,k=a(b),l={animate:!0,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:!0,cycle:!1,collapsible:!1,collapsedClass:"collapsed",collapsedByDefault:!0,uiTabs:!1,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:!0,event:"click",panelContext:k},m={fast:200,normal:400,slow:600};j.init=function(){j.settings=i=a.extend({},l,c),i.bind_str=i.event+".easytabs",i.uiTabs&&(i.tabActiveClass="ui-tabs-selected",i.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all",i.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all",i.tabClass="ui-state-default ui-corner-top",i.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"),i.collapsible&&void 0!==c.defaultTab&&void 0===c.collpasedByDefault&&(i.collapsedByDefault=!1),"string"==typeof i.animationSpeed&&(i.animationSpeed=m[i.animationSpeed]),a("a.anchor").remove().prependTo("body"),k.data("easytabs",{}),j.setTransitions(),j.getTabs(),o(),p(),r(),v(),w(),k.attr("data-easytabs",!0)},j.setTransitions=function(){f=i.animate?{show:i.transitionIn,hide:i.transitionOut,speed:i.animationSpeed,collapse:i.transitionCollapse,uncollapse:i.transitionUncollapse,halfSpeed:i.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}},j.getTabs=function(){var b;j.tabs=k.find(i.tabs),j.panels=a(),j.tabs.each(function(){var c=a(this),d=c.children("a"),e=c.children("a").data("target");c.data("easytabs",{}),void 0!==e&&null!==e?c.data("easytabs").ajax=d.attr("href"):e=d.attr("href"),e=e.match(/#([^\?]+)/)[1],b=i.panelContext.find("#"+e),b.length?(b.data("easytabs",{position:b.css("position"),visibility:b.css("visibility")}),b.not(i.panelActiveClass).hide(),j.panels=j.panels.add(b),c.data("easytabs").panel=b):(j.tabs=j.tabs.not(c),"console"in window&&console.warn("Warning: tab without matching panel for selector '#"+e+"' removed from set"))})},j.selectTab=function(a,b){var c=window.location,d=(c.hash.match(/^[^\?]*/)[0],a.parent().data("easytabs").panel),e=a.parent().data("easytabs").ajax;i.collapsible&&!h&&(a.hasClass(i.tabActiveClass)||a.hasClass(i.collapsedClass))?j.toggleTabCollapse(a,d,e,b):a.hasClass(i.tabActiveClass)&&d.hasClass(i.panelActiveClass)?i.cache||s(a,d,e,b):s(a,d,e,b)},j.toggleTabCollapse=function(a,b,c,d){j.panels.stop(!0,!0),n(k,"easytabs:before",[a,b,i])&&(j.tabs.filter("."+i.tabActiveClass).removeClass(i.tabActiveClass).children().removeClass(i.tabActiveClass),a.hasClass(i.collapsedClass)?(!c||i.cache&&a.parent().data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[a,b]),b.load(c,function(c,d,e){a.parent().data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[a,b,c,d,e])})),a.parent().removeClass(i.collapsedClass).addClass(i.tabActiveClass).children().removeClass(i.collapsedClass).addClass(i.tabActiveClass),b.addClass(i.panelActiveClass)[f.uncollapse](f.speed,i.transitionUncollapseEasing,function(){k.trigger("easytabs:midTransition",[a,b,i]),"function"==typeof d&&d()})):(a.addClass(i.collapsedClass).parent().addClass(i.collapsedClass),b.removeClass(i.panelActiveClass)[f.collapse](f.speed,i.transitionCollapseEasing,function(){k.trigger("easytabs:midTransition",[a,b,i]),"function"==typeof d&&d()})))},j.matchTab=function(a){return j.tabs.find("[href='"+a+"'],[data-target='"+a+"']").first()},j.matchInPanel=function(a){return a&&j.validId(a)?j.panels.filter(":has("+a+")").first():[]},j.validId=function(a){return a.substr(1).match(/^[A-Za-z][A-Za-z0-9\-_:\.]*$/)},j.selectTabFromHashChange=function(){var a,b=window.location.hash.match(/^[^\?]*/)[0],c=j.matchTab(b);i.updateHash&&(c.length?(h=!0,j.selectTab(c)):(a=j.matchInPanel(b),a.length?(b="#"+a.attr("id"),c=j.matchTab(b),h=!0,j.selectTab(c)):d.hasClass(i.tabActiveClass)||i.cycle||(""===b||j.matchTab(g).length||k.closest(b).length)&&(h=!0,j.selectTab(e))))},j.cycleTabs=function(b){i.cycle&&(b%=j.tabs.length,$tab=a(j.tabs[b]).children("a").first(),h=!0,j.selectTab($tab,function(){setTimeout(function(){j.cycleTabs(b+1)},i.cycle)}))},j.publicMethods={select:function(b){var c;0===(c=j.tabs.filter(b)).length?0===(c=j.tabs.find("a[href='"+b+"']")).length&&0===(c=j.tabs.find("a"+b)).length&&0===(c=j.tabs.find("[data-target='"+b+"']")).length&&0===(c=j.tabs.find("a[href$='"+b+"']")).length&&a.error("Tab '"+b+"' does not exist in tab set"):c=c.children("a").first(),j.selectTab(c)}};var n=function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},o=function(){k.addClass(i.containerClass),j.tabs.parent().addClass(i.tabsClass),j.tabs.addClass(i.tabClass),j.panels.addClass(i.panelClass)},p=function(){var b,c=window.location.hash.match(/^[^\?]*/)[0],f=j.matchTab(c).parent();1===f.length?(d=f,i.cycle=!1):(b=j.matchInPanel(c),b.length?(c="#"+b.attr("id"),d=j.matchTab(c).parent()):(d=j.tabs.parent().find(i.defaultTab),0===d.length&&a.error("The specified default tab ('"+i.defaultTab+"') could not be found in the tab set ('"+i.tabs+"') out of "+j.tabs.length+" tabs."))),e=d.children("a").first(),q(f)},q=function(b){var c,f;i.collapsible&&0===b.length&&i.collapsedByDefault?d.addClass(i.collapsedClass).children().addClass(i.collapsedClass):(c=a(d.data("easytabs").panel),f=d.data("easytabs").ajax,!f||i.cache&&d.data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[e,c]),c.load(f,function(a,b,f){d.data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[e,c,a,b,f])})),d.data("easytabs").panel.show().addClass(i.panelActiveClass),d.addClass(i.tabActiveClass).children().addClass(i.tabActiveClass)),k.trigger("easytabs:initialised",[e,c])},r=function(){j.tabs.children("a").bind(i.bind_str,function(b){i.cycle=!1,h=!1,j.selectTab(a(this)),b.preventDefault?b.preventDefault():b.returnValue=!1})},s=function(a,b,c,d){if(j.panels.stop(!0,!0),n(k,"easytabs:before",[a,b,i])){var e,l,m,o,p=j.panels.filter(":visible"),q=b.parent(),r=window.location.hash.match(/^[^\?]*/)[0];i.animate&&(e=t(b),l=p.length?u(p):0,m=e-l),g=r,o=function(){k.trigger("easytabs:midTransition",[a,b,i]),i.animate&&"fadeIn"==i.transitionIn&&0>m&&q.animate({height:q.height()+m},f.halfSpeed).css({"min-height":""}),i.updateHash&&!h?window.history.pushState?window.history.pushState(null,null,"#"+b.attr("id")):window.location.hash="#"+b.attr("id"):h=!1,b[f.show](f.speed,i.transitionInEasing,function(){q.css({height:"","min-height":""}),k.trigger("easytabs:after",[a,b,i]),"function"==typeof d&&d()})},!c||i.cache&&a.parent().data("easytabs").cached||(k.trigger("easytabs:ajax:beforeSend",[a,b]),b.load(c,function(c,d,e){a.parent().data("easytabs").cached=!0,k.trigger("easytabs:ajax:complete",[a,b,c,d,e])})),i.animate&&"fadeOut"==i.transitionOut&&(m>0?q.animate({height:q.height()+m},f.halfSpeed):q.css({"min-height":q.height()})),j.tabs.filter("."+i.tabActiveClass).removeClass(i.tabActiveClass).children().removeClass(i.tabActiveClass),j.tabs.filter("."+i.collapsedClass).removeClass(i.collapsedClass).children().removeClass(i.collapsedClass),a.parent().addClass(i.tabActiveClass).children().addClass(i.tabActiveClass),j.panels.filter("."+i.panelActiveClass).removeClass(i.panelActiveClass),b.addClass(i.panelActiveClass),p.length?p[f.hide](f.speed,i.transitionOutEasing,o):b[f.uncollapse](f.speed,i.transitionUncollapseEasing,o)}},t=function(b){if(b.data("easytabs")&&b.data("easytabs").lastHeight)return b.data("easytabs").lastHeight;var c,d,e=b.css("display");try{c=a("<div></div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})}catch(f){c=a("<div></div>",{visibility:"hidden",overflow:"hidden"})}return d=b.wrap(c).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight(),b.unwrap(),b.css({position:b.data("easytabs").position,visibility:b.data("easytabs").visibility,display:e}),b.data("easytabs").lastHeight=d,d},u=function(a){var b=a.outerHeight();return a.data("easytabs")?a.data("easytabs").lastHeight=b:a.data("easytabs",{lastHeight:b}),b},v=function(){"function"==typeof a(window).hashchange?a(window).hashchange(function(){j.selectTabFromHashChange()}):a.address&&"function"==typeof a.address.change&&a.address.change(function(){j.selectTabFromHashChange()})},w=function(){var a;i.cycle&&(a=j.tabs.index(d),setTimeout(function(){j.cycleTabs(a+1)},i.cycle))};j.init()},a.fn.easytabs=function(b){var c=arguments;return this.each(function(){var d=a(this),e=d.data("easytabs");return void 0===e&&(e=new a.easytabs(this,b),d.data("easytabs",e)),e.publicMethods[b]?e.publicMethods[b](Array.prototype.slice.call(c,1)):void 0})}}(jQuery),function(a){var b=function(){var b='<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',c={showEvent:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},colorScheme:"light",color:"3289c7",livePreview:!0,flat:!1,layout:"full",submit:1,submitText:"OK",height:156},g=function(b,c){var d=f(b);a(c).data("colpick").fields.eq(1).val(d.r).end().eq(2).val(d.g).end().eq(3).val(d.b).end()},i=function(b,c){a(c).data("colpick").fields.eq(4).val(Math.round(b.h)).end().eq(5).val(Math.round(b.s)).end().eq(6).val(Math.round(b.b)).end()},j=function(b,c){a(c).data("colpick").fields.eq(0).val(h(b))},k=function(b,c){a(c).data("colpick").selector.css("backgroundColor","#"+h({h:b.h,s:100,b:100})),a(c).data("colpick").selectorIndic.css({left:parseInt(a(c).data("colpick").height*b.s/100,10),top:parseInt(a(c).data("colpick").height*(100-b.b)/100,10)})},l=function(b,c){a(c).data("colpick").hue.css("top",parseInt(a(c).data("colpick").height-a(c).data("colpick").height*b.h/360,10))},m=function(b,c){a(c).data("colpick").currentColor.css("backgroundColor","#"+h(b))},n=function(b,c){a(c).data("colpick").newColor.css("backgroundColor","#"+h(b))},o=function(){var b,c=a(this).parent().parent();this.parentNode.className.indexOf("_hex")>0?(c.data("colpick").color=b=d(G(this.value)),g(b,c.get(0)),i(b,c.get(0))):this.parentNode.className.indexOf("_hsb")>0?(c.data("colpick").color=b=E({h:parseInt(c.data("colpick").fields.eq(4).val(),10),s:parseInt(c.data("colpick").fields.eq(5).val(),10),b:parseInt(c.data("colpick").fields.eq(6).val(),10)}),g(b,c.get(0)),j(b,c.get(0))):(c.data("colpick").color=b=e(F({r:parseInt(c.data("colpick").fields.eq(1).val(),10),g:parseInt(c.data("colpick").fields.eq(2).val(),10),b:parseInt(c.data("colpick").fields.eq(3).val(),10)})),j(b,c.get(0)),i(b,c.get(0))),k(b,c.get(0)),l(b,c.get(0)),n(b,c.get(0)),c.data("colpick").onChange.apply(c.parent(),[b,h(b),f(b),c.data("colpick").el,0])},p=function(){a(this).parent().removeClass("colpick_focus")},q=function(){a(this).parent().parent().data("colpick").fields.parent().removeClass("colpick_focus"),a(this).parent().addClass("colpick_focus")},r=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c=a(this).parent().find("input").focus(),d={el:a(this).parent().addClass("colpick_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:this.parentNode.className.indexOf("_hsb")>0?100:255,y:b.pageY,field:c,val:parseInt(c.val(),10),preview:a(this).parent().parent().data("colpick").livePreview};a(document).mouseup(d,t),a(document).mousemove(d,s)},s=function(a){return a.data.field.val(Math.max(0,Math.min(a.data.max,parseInt(a.data.val-a.pageY+a.data.y,10)))),a.data.preview&&o.apply(a.data.field.get(0),[!0]),!1},t=function(b){return o.apply(b.data.field.get(0),[!0]),b.data.el.removeClass("colpick_slider").find("input").focus(),a(document).off("mouseup",t),a(document).off("mousemove",s),!1},u=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c={cal:a(this).parent(),y:a(this).offset().top};a(document).on("mouseup touchend",c,w),a(document).on("mousemove touchmove",c,v);var d="touchstart"==b.type?b.originalEvent.changedTouches[0].pageY:b.pageY;return o.apply(c.cal.data("colpick").fields.eq(4).val(parseInt(360*(c.cal.data("colpick").height-(d-c.y))/c.cal.data("colpick").height,10)).get(0),[c.cal.data("colpick").livePreview]),!1},v=function(a){var b="touchmove"==a.type?a.originalEvent.changedTouches[0].pageY:a.pageY;return o.apply(a.data.cal.data("colpick").fields.eq(4).val(parseInt(360*(a.data.cal.data("colpick").height-Math.max(0,Math.min(a.data.cal.data("colpick").height,b-a.data.y)))/a.data.cal.data("colpick").height,10)).get(0),[a.data.preview]),!1},w=function(b){return g(b.data.cal.data("colpick").color,b.data.cal.get(0)),j(b.data.cal.data("colpick").color,b.data.cal.get(0)),a(document).off("mouseup touchend",w),a(document).off("mousemove touchmove",v),!1},x=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c={cal:a(this).parent(),pos:a(this).offset()};c.preview=c.cal.data("colpick").livePreview,a(document).on("mouseup touchend",c,z),a(document).on("mousemove touchmove",c,y);var d;return"touchstart"==b.type?(pageX=b.originalEvent.changedTouches[0].pageX,d=b.originalEvent.changedTouches[0].pageY):(pageX=b.pageX,d=b.pageY),o.apply(c.cal.data("colpick").fields.eq(6).val(parseInt(100*(c.cal.data("colpick").height-(d-c.pos.top))/c.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*(pageX-c.pos.left)/c.cal.data("colpick").height,10)).get(0),[c.preview]),!1},y=function(a){var b;return"touchmove"==a.type?(pageX=a.originalEvent.changedTouches[0].pageX,b=a.originalEvent.changedTouches[0].pageY):(pageX=a.pageX,b=a.pageY),o.apply(a.data.cal.data("colpick").fields.eq(6).val(parseInt(100*(a.data.cal.data("colpick").height-Math.max(0,Math.min(a.data.cal.data("colpick").height,b-a.data.pos.top)))/a.data.cal.data("colpick").height,10)).end().eq(5).val(parseInt(100*Math.max(0,Math.min(a.data.cal.data("colpick").height,pageX-a.data.pos.left))/a.data.cal.data("colpick").height,10)).get(0),[a.data.preview]),!1},z=function(b){return g(b.data.cal.data("colpick").color,b.data.cal.get(0)),j(b.data.cal.data("colpick").color,b.data.cal.get(0)),a(document).off("mouseup touchend",z),a(document).off("mousemove touchmove",y),!1},A=function(){var b=a(this).parent(),c=b.data("colpick").color;b.data("colpick").origColor=c,m(c,b.get(0)),b.data("colpick").onSubmit(c,h(c),f(c),b.data("colpick").el)},B=function(b){b.stopPropagation();var c=a("#"+a(this).data("colpickId"));c.data("colpick").onBeforeShow.apply(this,[c.get(0)]);var d=a(this).offset(),e=d.top+this.offsetHeight,f=d.left,g=D(),h=c.width();f+h>g.l+g.w&&(f-=h),c.css({left:f+"px",top:e+"px"}),0!=c.data("colpick").onShow.apply(this,[c.get(0)])&&c.show(),a("html").mousedown({cal:c},C),c.mousedown(function(a){a.stopPropagation()})},C=function(b){0!=b.data.cal.data("colpick").onHide.apply(this,[b.data.cal.get(0)])&&b.data.cal.hide(),a("html").off("mousedown",C)},D=function(){var a="CSS1Compat"==document.compatMode;return{l:window.pageXOffset||(a?document.documentElement.scrollLeft:document.body.scrollLeft),w:window.innerWidth||(a?document.documentElement.clientWidth:document.body.clientWidth)}},E=function(a){return{h:Math.min(360,Math.max(0,a.h)),s:Math.min(100,Math.max(0,a.s)),b:Math.min(100,Math.max(0,a.b))}},F=function(a){return{r:Math.min(255,Math.max(0,a.r)),g:Math.min(255,Math.max(0,a.g)),b:Math.min(255,Math.max(0,a.b))}},G=function(a){var b=6-a.length;if(b>0){for(var c=[],d=0;b>d;d++)c.push("0");c.push(a),a=c.join("")}return a},H=function(){var b=a(this).parent(),c=b.data("colpick").origColor;b.data("colpick").color=c,g(c,b.get(0)),j(c,b.get(0)),i(c,b.get(0)),k(c,b.get(0)),l(c,b.get(0)),n(c,b.get(0))};return{init:function(f){if(f=a.extend({},c,f||{}),"string"==typeof f.color)f.color=d(f.color);else if(void 0!=f.color.r&&void 0!=f.color.g&&void 0!=f.color.b)f.color=e(f.color);else{if(void 0==f.color.h||void 0==f.color.s||void 0==f.color.b)return this;f.color=E(f.color)}return this.each(function(){if(!a(this).data("colpickId")){var c=a.extend({},f);c.origColor=f.color;var d="collorpicker_"+parseInt(1e3*Math.random());a(this).data("colpickId",d);var e=a(b).attr("id",d);e.addClass("colpick_"+c.layout+(c.submit?"":" colpick_"+c.layout+"_ns")),"light"!=c.colorScheme&&e.addClass("colpick_"+c.colorScheme),e.find("div.colpick_submit").html(c.submitText).click(A),c.fields=e.find("input").change(o).blur(p).focus(q),e.find("div.colpick_field_arrs").mousedown(r).end().find("div.colpick_current_color").click(H),c.selector=e.find("div.colpick_color").on("mousedown touchstart",x),c.selectorIndic=c.selector.find("div.colpick_selector_outer"),c.el=this,c.hue=e.find("div.colpick_hue_arrs"),huebar=c.hue.parent();var h=navigator.userAgent.toLowerCase(),s="Microsoft Internet Explorer"===navigator.appName,t=s?parseFloat(h.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,v=s&&10>t,w=["#ff0000","#ff0080","#ff00ff","#8000ff","#0000ff","#0080ff","#00ffff","#00ff80","#00ff00","#80ff00","#ffff00","#ff8000","#ff0000"];if(v){var y,z;for(y=0;11>=y;y++)z=a("<div></div>").attr("style","height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr="+w[y]+", endColorstr="+w[y+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+w[y]+", endColorstr="+w[y+1]+')";'),huebar.append(z)}else stopList=w.join(","),huebar.attr("style","background:-webkit-linear-gradient(top,"+stopList+"); background: -o-linear-gradient(top,"+stopList+"); background: -ms-linear-gradient(top,"+stopList+"); background:-moz-linear-gradient(top,"+stopList+"); -webkit-linear-gradient(top,"+stopList+"); background:linear-gradient(to bottom,"+stopList+"); ");e.find("div.colpick_hue").on("mousedown touchstart",u),c.newColor=e.find("div.colpick_new_color"),c.currentColor=e.find("div.colpick_current_color"),e.data("colpick",c),g(c.color,e.get(0)),i(c.color,e.get(0)),j(c.color,e.get(0)),l(c.color,e.get(0)),k(c.color,e.get(0)),m(c.color,e.get(0)),n(c.color,e.get(0)),c.flat?(e.appendTo(this).show(),e.css({position:"relative",display:"block"})):(e.appendTo(document.body),a(this).on(c.showEvent,B),e.css({position:"absolute"}))}})},showPicker:function(){return this.each(function(){a(this).data("colpickId")&&B.apply(this)})},hidePicker:function(){return this.each(function(){a(this).data("colpickId")&&a("#"+a(this).data("colpickId")).hide()})},setColor:function(b,c){if(c="undefined"==typeof c?1:c,"string"==typeof b)b=d(b);else if(void 0!=b.r&&void 0!=b.g&&void 0!=b.b)b=e(b);else{if(void 0==b.h||void 0==b.s||void 0==b.b)return this;b=E(b)}return this.each(function(){if(a(this).data("colpickId")){var d=a("#"+a(this).data("colpickId"));d.data("colpick").color=b,d.data("colpick").origColor=b,g(b,d.get(0)),i(b,d.get(0)),j(b,d.get(0)),l(b,d.get(0)),k(b,d.get(0)),n(b,d.get(0)),d.data("colpick").onChange.apply(d.parent(),[b,h(b),f(b),d.data("colpick").el,1]),c&&m(b,d.get(0))}})}}}(),c=function(a){var a=parseInt(a.indexOf("#")>-1?a.substring(1):a,16);return{r:a>>16,g:(65280&a)>>8,b:255&a}},d=function(a){return e(c(a))},e=function(a){var b={h:0,s:0,b:0},c=Math.min(a.r,a.g,a.b),d=Math.max(a.r,a.g,a.b),e=d-c;return b.b=d,b.s=0!=d?255*e/d:0,b.h=0!=b.s?a.r==d?(a.g-a.b)/e:a.g==d?2+(a.b-a.r)/e:4+(a.r-a.g)/e:-1,b.h*=60,b.h<0&&(b.h+=360),b.s*=100/255,b.b*=100/255,b},f=function(a){var b={},c=a.h,d=255*a.s/100,e=255*a.b/100;if(0==d)b.r=b.g=b.b=e;else{var f=e,g=(255-d)*e/255,h=(f-g)*(c%60)/60;360==c&&(c=0),60>c?(b.r=f,b.b=g,b.g=g+h):120>c?(b.g=f,b.b=g,b.r=f-h):180>c?(b.g=f,b.r=g,b.b=g+h):240>c?(b.b=f,b.r=g,b.g=f-h):300>c?(b.b=f,b.g=g,b.r=g+h):360>c?(b.r=f,b.g=g,b.b=f-h):(b.r=0,b.g=0,b.b=0)}return{r:Math.round(b.r),g:Math.round(b.g),b:Math.round(b.b)}},g=function(b){var c=[b.r.toString(16),b.g.toString(16),b.b.toString(16)];return a.each(c,function(a,b){1==b.length&&(c[a]="0"+b)}),c.join("")},h=function(a){return g(f(a))};a.fn.extend({colpick:b.init,colpickHide:b.hidePicker,colpickShow:b.showPicker,colpickSetColor:b.setColor}),a.extend({colpick:{rgbToHex:g,rgbToHsb:e,hsbToHex:h,hsbToRgb:f,hexToHsb:d,hexToRgb:c}})}(jQuery),window.twttr=function(a,b,c){var d,e=a.getElementsByTagName(b)[0],f=window.twttr||{};return a.getElementById(c)?f:(d=a.createElement(b),d.id=c,d.src="https://platform.twitter.com/widgets.js",e.parentNode.insertBefore(d,e),f._e=[],f.ready=function(a){f._e.push(a)},f)}(document,"script","twitter-wjs");
|
assets/js/mashsb.js
CHANGED
@@ -1,55 +1,97 @@
|
|
1 |
var strict;
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
(
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
self = this;
|
23 |
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
// is a class or tag selector
|
32 |
-
// so need to traverse
|
33 |
-
p = self.parentNode;
|
34 |
-
while (p) {
|
35 |
-
el = hasQsa ? p.querySelectorAll(s) : $(p).find(s);
|
36 |
-
if (el.length) {
|
37 |
-
update(el);
|
38 |
-
break;
|
39 |
-
}
|
40 |
-
p = p.parentNode;
|
41 |
-
}
|
42 |
-
}
|
43 |
});
|
|
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
50 |
|
51 |
-
jQuery(
|
|
|
|
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
mashsb_check_cache();
|
54 |
|
55 |
// Fix for the inline post plugin which removes the zero share count
|
@@ -70,58 +112,6 @@ jQuery(document).ready(function ($) {
|
|
70 |
}, 6000);
|
71 |
}
|
72 |
|
73 |
-
/**
|
74 |
-
*
|
75 |
-
* Deprecated
|
76 |
-
*/
|
77 |
-
/*if (typeof('mashsb') && mashsb.restapi == "1"){
|
78 |
-
mashsb_restapi_check_cache();
|
79 |
-
}
|
80 |
-
else if (typeof('mashsb') && mashsb.restapi == "0"){
|
81 |
-
mashsb_check_cache_ajax();
|
82 |
-
}*/
|
83 |
-
/**
|
84 |
-
* Check Cache via ajax endpoint
|
85 |
-
*
|
86 |
-
*/
|
87 |
-
function mashsb_check_cache_ajax() {
|
88 |
-
|
89 |
-
setTimeout(function () {
|
90 |
-
|
91 |
-
var data = {
|
92 |
-
action: 'mashsb_refresh_cache',
|
93 |
-
};
|
94 |
-
$.post(ajaxurl, data, function (resp, status, xhr) {
|
95 |
-
if (resp == "1") {
|
96 |
-
mashsb_update_cache();
|
97 |
-
//console.log('cache must be updated ' + + xhr.status + ' ' + xhr.statusText + xhr.statusText);
|
98 |
-
}
|
99 |
-
}).fail(function (xhr) {
|
100 |
-
console.log('Fatal Error:' + xhr.status + ' ' + xhr.statusText + xhr.statusText);
|
101 |
-
});
|
102 |
-
}, 4000);
|
103 |
-
}
|
104 |
-
/**
|
105 |
-
* Check Cache via rest api
|
106 |
-
*
|
107 |
-
*/
|
108 |
-
function mashsb_restapi_check_cache() {
|
109 |
-
|
110 |
-
setTimeout(function () {
|
111 |
-
|
112 |
-
var data = {};
|
113 |
-
var mash_rest_url = 'http://src.wordpress-develop.dev/wp-json/mashshare/v1/verifycache/';
|
114 |
-
$.get(mash_rest_url, data, function (resp, status, xhr) {
|
115 |
-
if (resp == "1") {
|
116 |
-
mashsb_update_cache();
|
117 |
-
//console.log('cache must be updated ');
|
118 |
-
}
|
119 |
-
}).fail(function (xhr) {
|
120 |
-
console.log('Fatal Error:' + xhr.status + ' ' + xhr.statusText + xhr.statusText);
|
121 |
-
});
|
122 |
-
}, 4000);
|
123 |
-
}
|
124 |
-
|
125 |
function mashsb_update_cache() {
|
126 |
var mashsb_url = window.location.href;
|
127 |
if (mashsb_url.indexOf("?") > -1) {
|
@@ -234,284 +224,6 @@ jQuery(document).ready(function ($) {
|
|
234 |
return value.toFixed(0);
|
235 |
}
|
236 |
|
237 |
-
/**
|
238 |
-
* Responsive Buttons
|
239 |
-
*/
|
240 |
-
function responsiveButtons()
|
241 |
-
{
|
242 |
-
// Responsive buttons are not in use
|
243 |
-
if (mashsb.dynamic_buttons != 1) return;
|
244 |
-
|
245 |
-
// Start our Listener
|
246 |
-
var listenerContainer = $(".mashsb-container.mashsb-main .mashsb-count");
|
247 |
-
if (listenerContainer.length){
|
248 |
-
new ResizeSensor(listenerContainer, function () {
|
249 |
-
calculate();
|
250 |
-
});
|
251 |
-
}
|
252 |
-
var listenerViews = $(".mashsb-container.mashsb-main .mashpv .count");
|
253 |
-
if (listenerViews.length){
|
254 |
-
new ResizeSensor(listenerViews, function () {
|
255 |
-
calculate();
|
256 |
-
});
|
257 |
-
}
|
258 |
-
|
259 |
-
// Ajax Listener
|
260 |
-
var ajaxListener = {},
|
261 |
-
interval = {};
|
262 |
-
//$primaryButtons = $("aside.mashsb-container.mashsb-main > .mashsb-box > .mashsb-buttons > a[class^='mashicon-']:visible:not(.secondary-shares a)"),
|
263 |
-
//$secondaryShareButtonsContainer = $("aside.mashsb-container .secondary-shares");
|
264 |
-
|
265 |
-
// Added listener so in case if somehow the ajax request is being made, the buttons will resize again.
|
266 |
-
// This is useful for good reasons for example;
|
267 |
-
// 1. No need to include responsiveButtons() in case if anything changes or ajax request needs to be added
|
268 |
-
// or modified.
|
269 |
-
// 2. If the ajax request is done outside of MashShare work such as theme customisations
|
270 |
-
ajaxListener.open = XMLHttpRequest.prototype.open;
|
271 |
-
ajaxListener.send = XMLHttpRequest.prototype.send;
|
272 |
-
ajaxListener.callback = function (pointer) {
|
273 |
-
// Request is not completed yet
|
274 |
-
if (pointer.readyState != 4 || pointer.status != 200) {
|
275 |
-
return;
|
276 |
-
}
|
277 |
-
|
278 |
-
var action = getAction(pointer.responseURL);
|
279 |
-
|
280 |
-
// Re-calculate the width of the buttons on Get View ajax call
|
281 |
-
if (action === "mashpv_get_views") {
|
282 |
-
// Adjust for animation
|
283 |
-
setTimeout(function() {
|
284 |
-
//calculate();
|
285 |
-
}, 1100);
|
286 |
-
}
|
287 |
-
|
288 |
-
//console.log(interval);
|
289 |
-
// Clear the interval for it
|
290 |
-
clearInterval(interval[action]);
|
291 |
-
};
|
292 |
-
|
293 |
-
// Executes 5 min later to clear IF any interval that's left
|
294 |
-
setTimeout(function() {
|
295 |
-
var key;
|
296 |
-
for (key in interval) {
|
297 |
-
if (interval.hasOwnProperty(key)) {
|
298 |
-
clearInterval(interval[key]);
|
299 |
-
}
|
300 |
-
}
|
301 |
-
|
302 |
-
}, 5 * (60 * 1000));
|
303 |
-
|
304 |
-
// When an ajax requests is opened
|
305 |
-
XMLHttpRequest.prototype.open = function(method, url) {
|
306 |
-
// In case if they are not defined
|
307 |
-
if (!method) method = '';
|
308 |
-
if (!url) url = '';
|
309 |
-
|
310 |
-
// Attach values
|
311 |
-
ajaxListener.open.apply(this, arguments);
|
312 |
-
ajaxListener.method = method;
|
313 |
-
ajaxListener.url = url;
|
314 |
-
|
315 |
-
// If that's the get method, attach data to our listener
|
316 |
-
if (method.toLowerCase() === "get") {
|
317 |
-
ajaxListener.data = url.split('?');
|
318 |
-
ajaxListener.data = ajaxListener.data[1];
|
319 |
-
ajaxListener.action = getAction(ajaxListener.data);
|
320 |
-
}
|
321 |
-
};
|
322 |
-
|
323 |
-
// When an ajax request is sent
|
324 |
-
XMLHttpRequest.prototype.send = function(data, params) {
|
325 |
-
ajaxListener.send.apply(this, arguments);
|
326 |
-
|
327 |
-
// If that's the post method, attach data to our listener
|
328 |
-
if (ajaxListener.method.toLowerCase() === "post") {
|
329 |
-
ajaxListener.data = data;
|
330 |
-
ajaxListener.action = getAction(ajaxListener.data);
|
331 |
-
}
|
332 |
-
|
333 |
-
// $ overwrites onstatechange (darn you jQuery!),
|
334 |
-
// we need to monitor readyState and the status
|
335 |
-
var pointer = this;
|
336 |
-
interval[ajaxListener.action] = window.setInterval(ajaxListener.callback, 100, pointer);
|
337 |
-
};
|
338 |
-
|
339 |
-
// Recalculate width of the buttons when plus / minus button is clicked
|
340 |
-
$("body")
|
341 |
-
.on("click", ".onoffswitch", function() {
|
342 |
-
//$secondaryShareButtonsContainer.css("display","block");
|
343 |
-
setTimeout(function() {calculate();}, 200);
|
344 |
-
})
|
345 |
-
.on("click", ".onoffswitch2", function() {
|
346 |
-
calculate();
|
347 |
-
});
|
348 |
-
|
349 |
-
// Window resize
|
350 |
-
$(window).resize(function() {
|
351 |
-
calculate();
|
352 |
-
});
|
353 |
-
|
354 |
-
// When there is no ajax call, this one is required to be here!
|
355 |
-
// No worries though, once ajax call is done, it will adjust
|
356 |
-
// Adjustment for animation
|
357 |
-
if (mashsb.animate_shares == 1) {
|
358 |
-
setTimeout(function() {
|
359 |
-
calculate();
|
360 |
-
}, 500);
|
361 |
-
}
|
362 |
-
// No need animation adjusting
|
363 |
-
else calculate();
|
364 |
-
|
365 |
-
/**
|
366 |
-
* Calculation for buttons
|
367 |
-
*/
|
368 |
-
function calculate()
|
369 |
-
{
|
370 |
-
var $container = $("aside.mashsb-container.mashsb-main");
|
371 |
-
|
372 |
-
if ($container.length > 0) {
|
373 |
-
$container.each(function() {
|
374 |
-
var $this = $(this),
|
375 |
-
$primaryButtons = $this.find(".mashsb-box > .mashsb-buttons > .mashsb-primary-shares > a[class^='mashicon-']:visible");
|
376 |
-
|
377 |
-
//$this.find(".mashsb-box > .mashsb-buttons > .secondary-shares").css("clear", "both");
|
378 |
-
|
379 |
-
// Variables
|
380 |
-
var averageWidth = getAverageWidth($primaryButtons);
|
381 |
-
|
382 |
-
// Do the styling...
|
383 |
-
$primaryButtons.css({
|
384 |
-
//"width" : averageWidth + "px", // Need to de-activate this for long labels
|
385 |
-
"min-width" : averageWidth + "px",
|
386 |
-
// Below this part is just to ensure the stability...
|
387 |
-
// Not all themes are apparently adding these rules
|
388 |
-
// thus messing up the whole width of the elements
|
389 |
-
"box-sizing" : "border-box",
|
390 |
-
"-moz-box-sizing" : "border-box",
|
391 |
-
"-webkit-box-sizing": "border-box"
|
392 |
-
});
|
393 |
-
});
|
394 |
-
}
|
395 |
-
}
|
396 |
-
|
397 |
-
/**
|
398 |
-
* Get action from URL string
|
399 |
-
* @param data
|
400 |
-
* @returns {*}
|
401 |
-
*/
|
402 |
-
function getAction(data)
|
403 |
-
{
|
404 |
-
// Split data
|
405 |
-
data = data.split('&');
|
406 |
-
|
407 |
-
// Let's work our magic here
|
408 |
-
// Split data
|
409 |
-
var dataLength = data.length,
|
410 |
-
i;
|
411 |
-
|
412 |
-
if (dataLength == 1) return data[0];
|
413 |
-
|
414 |
-
// Get the action
|
415 |
-
for (i = 0; i < dataLength; i++) {
|
416 |
-
if (data[i].startsWith("action=")) {
|
417 |
-
return data[i].replace("action=", '');
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
return '';
|
422 |
-
}
|
423 |
-
|
424 |
-
/**
|
425 |
-
* Floors / rounds down given number to its closest with allowed decimal points
|
426 |
-
* @param number
|
427 |
-
* @param decimals
|
428 |
-
* @returns {number}
|
429 |
-
*/
|
430 |
-
function floorDown(number, decimals)
|
431 |
-
{
|
432 |
-
decimals = decimals || 0;
|
433 |
-
return ( Math.floor( number * Math.pow(10, decimals) ) / Math.pow(10, decimals) );
|
434 |
-
}
|
435 |
-
|
436 |
-
/**
|
437 |
-
* Rounds up given number to is closest with allowed decimal points
|
438 |
-
* @param number
|
439 |
-
* @param decimals
|
440 |
-
* @returns {number}
|
441 |
-
*/
|
442 |
-
function round(number, decimals)
|
443 |
-
{
|
444 |
-
return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);
|
445 |
-
}
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Gets average widht of each primary button
|
449 |
-
* @returns {number|*}
|
450 |
-
*/
|
451 |
-
function getAverageWidth(primaryButtons)
|
452 |
-
{
|
453 |
-
// Variables
|
454 |
-
var $mashShareContainer = primaryButtons.parents("aside.mashsb-container.mashsb-main"),
|
455 |
-
$container = $mashShareContainer.find(".mashsb-buttons > .mashsb-primary-shares"),
|
456 |
-
$shareCountContainer = $mashShareContainer.find(".mashsb-box > .mashsb-count:not(.mashpv)"),
|
457 |
-
isShareCountContainerVisible = ($shareCountContainer.length > 0 && $shareCountContainer.is(":visible")),
|
458 |
-
$viewCounterContainer = $mashShareContainer.find(".mashsb-box > .mashpv.mashsb-count"),
|
459 |
-
isViewCounterContainerVisible = $viewCounterContainer.is(":visible"),
|
460 |
-
$plusButton = $container.find(".onoffswitch"),
|
461 |
-
isPlusButtonVisible = $plusButton.is(":visible"),
|
462 |
-
totalUsedWidth = 0,
|
463 |
-
averageWidth;
|
464 |
-
|
465 |
-
$plusButton.css("margin-right", 0);
|
466 |
-
|
467 |
-
// Share counter is visible
|
468 |
-
if (isShareCountContainerVisible === true) {
|
469 |
-
var shareCountContainerWidth = parseFloat($shareCountContainer.css("margin-right"));
|
470 |
-
if (isNaN(shareCountContainerWidth)) shareCountContainerWidth = 0;
|
471 |
-
shareCountContainerWidth = shareCountContainerWidth + $shareCountContainer[0].getBoundingClientRect().width;
|
472 |
-
shareCountContainerWidth = round(shareCountContainerWidth, 2);
|
473 |
-
|
474 |
-
totalUsedWidth += shareCountContainerWidth;
|
475 |
-
}
|
476 |
-
|
477 |
-
// View counter is visible
|
478 |
-
if (isViewCounterContainerVisible === true) {
|
479 |
-
var viewCountContainerWidth = parseFloat($viewCounterContainer.css("margin-right"));
|
480 |
-
if (isNaN(viewCountContainerWidth)) viewCountContainerWidth = 0;
|
481 |
-
viewCountContainerWidth = viewCountContainerWidth + $viewCounterContainer[0].getBoundingClientRect().width;
|
482 |
-
viewCountContainerWidth = round(viewCountContainerWidth, 2);
|
483 |
-
|
484 |
-
totalUsedWidth += viewCountContainerWidth;
|
485 |
-
}
|
486 |
-
|
487 |
-
// Plus button is visible
|
488 |
-
if (isPlusButtonVisible === true) {
|
489 |
-
var extraWidth = 5; // we use this to have some extra power in case weird layout is used
|
490 |
-
totalUsedWidth += $plusButton[0].getBoundingClientRect().width + extraWidth;
|
491 |
-
}
|
492 |
-
|
493 |
-
//var tempWidth = $container[0].getBoundingClientRect().width;
|
494 |
-
|
495 |
-
// Calculate average width of each button (including their margins)
|
496 |
-
// We need to get precise width of the container, jQuery's width() is rounding up the numbers
|
497 |
-
averageWidth = ($container[0].getBoundingClientRect().width - totalUsedWidth) / primaryButtons.length;
|
498 |
-
if (isNaN(averageWidth)) {
|
499 |
-
return;
|
500 |
-
}
|
501 |
-
|
502 |
-
// We're only interested in positive numbers
|
503 |
-
if (averageWidth < 0) averageWidth = Math.abs(averageWidth);
|
504 |
-
|
505 |
-
// Now get the right width without the margin
|
506 |
-
averageWidth = averageWidth - (primaryButtons.first().outerWidth(true) - primaryButtons.first().outerWidth());
|
507 |
-
// Floor it down
|
508 |
-
averageWidth = floorDown(averageWidth, 2);
|
509 |
-
|
510 |
-
return averageWidth;
|
511 |
-
}
|
512 |
-
}
|
513 |
-
// Deactivate it for now and check if we can reach the same but better with CSS Flex boxes
|
514 |
-
//responsiveButtons();
|
515 |
|
516 |
|
517 |
/* Count up script jquery-countTo
|
@@ -611,223 +323,51 @@ jQuery(document).ready(function ($) {
|
|
611 |
}
|
612 |
});
|
613 |
|
614 |
-
/**
|
615 |
-
* Copyright Marc J. Schmidt. See the LICENSE file at the top-level
|
616 |
-
* directory of this distribution and at
|
617 |
-
* https://github.com/marcj/css-element-queries/blob/master/LICENSE.
|
618 |
-
*/
|
619 |
-
;
|
620 |
-
(function (root, factory) {
|
621 |
-
if (typeof define === "function" && define.amd) {
|
622 |
-
define(factory);
|
623 |
-
} else if (typeof exports === "object") {
|
624 |
-
module.exports = factory();
|
625 |
-
} else {
|
626 |
-
root.ResizeSensor = factory();
|
627 |
-
}
|
628 |
-
}(this, function () {
|
629 |
-
|
630 |
-
// Only used for the dirty checking, so the event callback count is limted to max 1 call per fps per sensor.
|
631 |
-
// In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
|
632 |
-
// would generate too many unnecessary events.
|
633 |
-
var requestAnimationFrame = window.requestAnimationFrame ||
|
634 |
-
window.mozRequestAnimationFrame ||
|
635 |
-
window.webkitRequestAnimationFrame ||
|
636 |
-
function (fn) {
|
637 |
-
return window.setTimeout(fn, 20);
|
638 |
-
};
|
639 |
-
|
640 |
-
/**
|
641 |
-
* Iterate over each of the provided element(s).
|
642 |
-
*
|
643 |
-
* @param {HTMLElement|HTMLElement[]} elements
|
644 |
-
* @param {Function} callback
|
645 |
-
*/
|
646 |
-
function forEachElement(elements, callback){
|
647 |
-
var elementsType = Object.prototype.toString.call(elements);
|
648 |
-
var isCollectionTyped = ('[object Array]' === elementsType
|
649 |
-
|| ('[object NodeList]' === elementsType)
|
650 |
-
|| ('[object HTMLCollection]' === elementsType)
|
651 |
-
|| ('undefined' !== typeof jQuery && elements instanceof jQuery) //jquery
|
652 |
-
|| ('undefined' !== typeof Elements && elements instanceof Elements) //mootools
|
653 |
-
);
|
654 |
-
var i = 0, j = elements.length;
|
655 |
-
if (isCollectionTyped) {
|
656 |
-
for (; i < j; i++) {
|
657 |
-
callback(elements[i]);
|
658 |
-
}
|
659 |
-
} else {
|
660 |
-
callback(elements);
|
661 |
-
}
|
662 |
-
}
|
663 |
-
|
664 |
-
/**
|
665 |
-
* Class for dimension change detection.
|
666 |
-
*
|
667 |
-
* @param {Element|Element[]|Elements|jQuery} element
|
668 |
-
* @param {Function} callback
|
669 |
-
*
|
670 |
-
* @constructor
|
671 |
-
*/
|
672 |
-
var ResizeSensor = function(element, callback) {
|
673 |
-
/**
|
674 |
-
*
|
675 |
-
* @constructor
|
676 |
-
*/
|
677 |
-
function EventQueue() {
|
678 |
-
var q = [];
|
679 |
-
this.add = function(ev) {
|
680 |
-
q.push(ev);
|
681 |
-
};
|
682 |
-
|
683 |
-
var i, j;
|
684 |
-
this.call = function() {
|
685 |
-
for (i = 0, j = q.length; i < j; i++) {
|
686 |
-
q[i].call();
|
687 |
-
}
|
688 |
-
};
|
689 |
-
|
690 |
-
this.remove = function(ev) {
|
691 |
-
var newQueue = [];
|
692 |
-
for(i = 0, j = q.length; i < j; i++) {
|
693 |
-
if(q[i] !== ev) newQueue.push(q[i]);
|
694 |
-
}
|
695 |
-
q = newQueue;
|
696 |
-
}
|
697 |
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
|
703 |
-
|
704 |
-
|
705 |
-
* @param {String} prop
|
706 |
-
* @returns {String|Number}
|
707 |
-
*/
|
708 |
-
function getComputedStyle(element, prop) {
|
709 |
-
if (element.currentStyle) {
|
710 |
-
return element.currentStyle[prop];
|
711 |
-
} else if (window.getComputedStyle) {
|
712 |
-
return window.getComputedStyle(element, null).getPropertyValue(prop);
|
713 |
-
} else {
|
714 |
-
return element.style[prop];
|
715 |
-
}
|
716 |
}
|
717 |
|
718 |
-
|
719 |
-
|
720 |
-
* @param {HTMLElement} element
|
721 |
-
* @param {Function} resized
|
722 |
-
*/
|
723 |
-
function attachResizeEvent(element, resized) {
|
724 |
-
if (!element.resizedAttached) {
|
725 |
-
element.resizedAttached = new EventQueue();
|
726 |
-
element.resizedAttached.add(resized);
|
727 |
-
} else if (element.resizedAttached) {
|
728 |
-
element.resizedAttached.add(resized);
|
729 |
-
return;
|
730 |
-
}
|
731 |
-
|
732 |
-
element.resizeSensor = document.createElement('div');
|
733 |
-
element.resizeSensor.className = 'resize-sensor';
|
734 |
-
var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
|
735 |
-
var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;';
|
736 |
-
|
737 |
-
element.resizeSensor.style.cssText = style;
|
738 |
-
element.resizeSensor.innerHTML =
|
739 |
-
'<div class="resize-sensor-expand" style="' + style + '">' +
|
740 |
-
'<div style="' + styleChild + '"></div>' +
|
741 |
-
'</div>' +
|
742 |
-
'<div class="resize-sensor-shrink" style="' + style + '">' +
|
743 |
-
'<div style="' + styleChild + ' width: 200%; height: 200%"></div>' +
|
744 |
-
'</div>';
|
745 |
-
element.appendChild(element.resizeSensor);
|
746 |
-
|
747 |
-
if (getComputedStyle(element, 'position') == 'static') {
|
748 |
-
element.style.position = 'relative';
|
749 |
-
}
|
750 |
-
|
751 |
-
var expand = element.resizeSensor.childNodes[0];
|
752 |
-
var expandChild = expand.childNodes[0];
|
753 |
-
var shrink = element.resizeSensor.childNodes[1];
|
754 |
-
|
755 |
-
var reset = function() {
|
756 |
-
expandChild.style.width = 100000 + 'px';
|
757 |
-
expandChild.style.height = 100000 + 'px';
|
758 |
-
|
759 |
-
expand.scrollLeft = 100000;
|
760 |
-
expand.scrollTop = 100000;
|
761 |
-
|
762 |
-
shrink.scrollLeft = 100000;
|
763 |
-
shrink.scrollTop = 100000;
|
764 |
-
};
|
765 |
-
|
766 |
-
reset();
|
767 |
-
var dirty = false;
|
768 |
-
|
769 |
-
var dirtyChecking = function() {
|
770 |
-
if (!element.resizedAttached) return;
|
771 |
-
|
772 |
-
if (dirty) {
|
773 |
-
element.resizedAttached.call();
|
774 |
-
dirty = false;
|
775 |
-
}
|
776 |
-
|
777 |
-
requestAnimationFrame(dirtyChecking);
|
778 |
-
};
|
779 |
-
|
780 |
-
requestAnimationFrame(dirtyChecking);
|
781 |
-
var lastWidth, lastHeight;
|
782 |
-
var cachedWidth, cachedHeight; //useful to not query offsetWidth twice
|
783 |
-
|
784 |
-
var onScroll = function() {
|
785 |
-
if ((cachedWidth = element.offsetWidth) != lastWidth || (cachedHeight = element.offsetHeight) != lastHeight) {
|
786 |
-
dirty = true;
|
787 |
|
788 |
-
|
789 |
-
|
790 |
-
}
|
791 |
-
reset();
|
792 |
-
};
|
793 |
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
} else {
|
798 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
799 |
}
|
800 |
-
};
|
801 |
-
|
802 |
-
addEvent(expand, 'scroll', onScroll);
|
803 |
-
addEvent(shrink, 'scroll', onScroll);
|
804 |
-
}
|
805 |
|
806 |
-
forEachElement(element, function(elem){
|
807 |
-
attachResizeEvent(elem, callback);
|
808 |
});
|
809 |
|
810 |
-
|
811 |
-
ResizeSensor.detach(element, ev);
|
812 |
-
};
|
813 |
-
};
|
814 |
-
|
815 |
-
ResizeSensor.detach = function(element, ev) {
|
816 |
-
forEachElement(element, function(elem){
|
817 |
-
if(elem.resizedAttached && typeof ev == "function"){
|
818 |
-
elem.resizedAttached.remove(ev);
|
819 |
-
if(elem.resizedAttached.length()) return;
|
820 |
-
}
|
821 |
-
if (elem.resizeSensor) {
|
822 |
-
if (elem.contains(elem.resizeSensor)) {
|
823 |
-
elem.removeChild(elem.resizeSensor);
|
824 |
-
}
|
825 |
-
delete elem.resizeSensor;
|
826 |
-
delete elem.resizedAttached;
|
827 |
-
}
|
828 |
-
});
|
829 |
};
|
830 |
-
|
831 |
-
return ResizeSensor;
|
832 |
-
|
833 |
-
}));
|
1 |
var strict;
|
2 |
|
3 |
+
jQuery(document).ready(function ($) {
|
4 |
+
|
5 |
+
/* Show Whatsapp button on mobile devices iPhones and Android only */
|
6 |
+
if(navigator.userAgent.match(/(iPhone)/i) || navigator.userAgent.match(/(Android)/i)){
|
7 |
+
$('.mashicon-whatsapp').show();
|
8 |
+
}
|
9 |
+
|
10 |
+
// pinterest button logic
|
11 |
+
$('body')
|
12 |
+
.off('click', '.mashicon-pinterest')
|
13 |
+
.on('click', '.mashicon-pinterest', function (e) {
|
14 |
+
e.preventDefault();
|
15 |
+
console.log('preventDefault:' + e);
|
16 |
+
winWidth = 520;
|
17 |
+
winHeight = 350;
|
18 |
+
var winTop = (screen.height / 2) - (winHeight / 2);
|
19 |
+
var winLeft = (screen.width / 2) - (winWidth / 2);
|
20 |
+
var url = $(this).attr('data-mashsb-url');
|
21 |
+
|
22 |
+
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes');
|
23 |
|
24 |
+
});
|
25 |
+
|
26 |
+
/* Load Pinterest Popup window
|
27 |
+
*
|
28 |
+
* @param string html container
|
29 |
+
* @returns void
|
30 |
+
*/
|
31 |
+
function load_pinterest(html) {
|
32 |
|
33 |
+
mashnet_load_pinterest_body();
|
|
|
34 |
|
35 |
+
jQuery('.mashnet_pinterest_header').fadeIn(500);
|
36 |
+
jQuery('.mashnet_pinterest_inner').html(html);
|
37 |
|
38 |
+
/* Close Pinterest popup*/
|
39 |
+
jQuery('.mashnet_pinterest_close').click(function (e) {
|
40 |
+
e.preventDefault();
|
41 |
+
jQuery('.mashnet_pinterest_header').hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
});
|
43 |
+
}
|
44 |
|
45 |
+
/**
|
46 |
+
* Load pinterest wrapper
|
47 |
+
*
|
48 |
+
* @returns voids
|
49 |
+
*/
|
50 |
+
function load_pinterest_body() {
|
51 |
+
var winWidth = window.innerWidth;
|
52 |
+
var popupWidth = 350;
|
53 |
+
var popupHeight = 310;
|
54 |
+
|
55 |
+
/* Load Pinterest popup into body of page */
|
56 |
+
if (winWidth <= 330)
|
57 |
+
var popupWidth = 310;
|
58 |
+
if (winWidth > 400)
|
59 |
+
var popupWidth = 390;
|
60 |
+
if (winWidth > 500)
|
61 |
+
var popupWidth = 490;
|
62 |
+
|
63 |
+
var winTop = (window.innerHeight / 2) - (popupHeight / 2);
|
64 |
+
var winLeft = (window.innerWidth / 2) - (popupWidth / 2);
|
65 |
+
var struct = '<div class="mashnet_pinterest_header" style="position:fixed;z-index:999999;max-width:' + popupWidth + 'px; margin-left:' + winLeft + 'px;top:' + winTop + 'px;">\n\
|
66 |
+
<div class="mashnet_pinit_wrapper" style="background-color:white;"><span class="mashnet_pin_it">Pin it! </span><span class="mashnet_pinicon"></span> \n\
|
67 |
+
<div class="mashnet_pinterest_close" style="float:right;"><a href="#">X</a></div></div>\n\
|
68 |
+
<div class="mashnet_pinterest_inner"></div>\n\
|
69 |
+
</div>\n\
|
70 |
+
';
|
71 |
+
|
72 |
+
jQuery('body').append(struct);
|
73 |
+
}
|
74 |
|
75 |
+
/* Get all images on site
|
76 |
+
*
|
77 |
+
* @return html
|
78 |
+
* */
|
79 |
+
function get_images(url) {
|
80 |
|
81 |
+
var allImages = jQuery('img').not("[nopin='nopin']");
|
82 |
+
var html = '';
|
83 |
+
var url = '';
|
84 |
|
85 |
+
var largeImages = allImages.filter(function () {
|
86 |
+
return (jQuery(this).width() > 70) || (jQuery(this).height() > 70)
|
87 |
+
})
|
88 |
+
for (i = 0; i < largeImages.length; i++) {
|
89 |
+
html += '<li><a target="_blank" id="mashnetPinterestPopup" href="https://pinterest.com/pin/create/button/?url=' + encodeURIComponent(window.location.href) + '%2F&media=' + largeImages[i].src + '&description=' + largeImages[i].alt + '"><img src="' + largeImages[i].src + '"></a></li>';
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
// check the sharecount caching method
|
95 |
mashsb_check_cache();
|
96 |
|
97 |
// Fix for the inline post plugin which removes the zero share count
|
112 |
}, 6000);
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
function mashsb_update_cache() {
|
116 |
var mashsb_url = window.location.href;
|
117 |
if (mashsb_url.indexOf("?") > -1) {
|
224 |
return value.toFixed(0);
|
225 |
}
|
226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
|
229 |
/* Count up script jquery-countTo
|
323 |
}
|
324 |
});
|
325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
+
/*!------------------------------------------------------
|
328 |
+
* jQuery nearest v1.0.3
|
329 |
+
* http://github.com/jjenzz/jQuery.nearest
|
330 |
+
* ------------------------------------------------------
|
331 |
+
* Copyright (c) 2012 J. Smith (@jjenzz)
|
332 |
+
* Dual licensed under the MIT and GPL licenses:
|
333 |
+
* http://www.opensource.org/licenses/mit-license.php
|
334 |
+
* http://www.gnu.org/licenses/gpl.html
|
335 |
+
*/
|
336 |
+
(function ($, d) {
|
337 |
+
$.fn.nearest = function (selector) {
|
338 |
+
var self, nearest, el, s, p,
|
339 |
+
hasQsa = d.querySelectorAll;
|
340 |
|
341 |
+
function update(el) {
|
342 |
+
nearest = nearest ? nearest.add(el) : $(el);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
}
|
344 |
|
345 |
+
this.each(function () {
|
346 |
+
self = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
|
348 |
+
$.each(selector.split(','), function () {
|
349 |
+
s = $.trim(this);
|
|
|
|
|
|
|
350 |
|
351 |
+
if (!s.indexOf('#')) {
|
352 |
+
// selector starts with an ID
|
353 |
+
update((hasQsa ? d.querySelectorAll(s) : $(s)));
|
354 |
} else {
|
355 |
+
// is a class or tag selector
|
356 |
+
// so need to traverse
|
357 |
+
p = self.parentNode;
|
358 |
+
while (p) {
|
359 |
+
el = hasQsa ? p.querySelectorAll(s) : $(p).find(s);
|
360 |
+
if (el.length) {
|
361 |
+
update(el);
|
362 |
+
break;
|
363 |
+
}
|
364 |
+
p = p.parentNode;
|
365 |
+
}
|
366 |
}
|
367 |
+
});
|
|
|
|
|
|
|
|
|
368 |
|
|
|
|
|
369 |
});
|
370 |
|
371 |
+
return nearest || $();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
};
|
373 |
+
}(jQuery, document));
|
|
|
|
|
|
assets/js/mashsb.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var strict
|
1 |
+
var strict;jQuery(document).ready(function(a){function b(){setTimeout(function(){"1"==mashsb.refresh&&c()},6e3)}function c(){var a=window.location.href;a+=a.indexOf("?")>-1?"&mashsb-refresh":"?mashsb-refresh";var b=new XMLHttpRequest;b.open("GET",a,!0),b.send()}function d(a){if("undefined"!=typeof mashsb&&1==mashsb.round_shares){if(a>1e6)return shares=Math.round(a/1e6*10)/10+"M",shares;if(a>1e3)return shares=Math.round(a/1e3*10)/10+"k",shares}return a.toFixed(0)}(navigator.userAgent.match(/(iPhone)/i)||navigator.userAgent.match(/(Android)/i))&&a(".mashicon-whatsapp").show(),a("body").off("click",".mashicon-pinterest").on("click",".mashicon-pinterest",function(b){b.preventDefault(),console.log("preventDefault:"+b),winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("data-mashsb-url");window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight+",resizable=yes")}),b(),""==a(".mashsbcount").text()&&a(".mashsbcount").text(0),a(".onoffswitch").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").hide(),b.find(".secondary-shares").show(),b.find(".onoffswitch2").show()}),a(".onoffswitch2").on("click",function(){var b=a(this).parents(".mashsb-container");b.find(".onoffswitch").show(),b.find(".secondary-shares").hide()}),"undefined"==typeof lashare_fb&&"undefined"!=typeof mashsb&&a(".mashicon-facebook").click(function(b){winWidth=520,winHeight=550;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(b),!1}),"undefined"!=typeof mashsb&&a(".mashicon-twitter").click(function(b){winWidth=520,winHeight=350;var c=screen.height/2-winHeight/2,d=screen.width/2-winWidth/2,e=a(this).attr("href");return"1"===mashsb.twitter_popup&&window.open(e,"sharer","top="+c+",left="+d+",toolbar=0,status=0,width="+winWidth+",height="+winHeight),b.preventDefault(),!1}),"undefined"!=typeof mashsb&&"content"===mashsb.subscribe&&(a(".mashicon-subscribe").not(".trigger_active").nearest(".mashsb-toggle-container").hide(),a(".mashicon-subscribe").click(function(){var b=a(this);return b.hasClass("trigger_active")?(a(b).nearest(".mashsb-toggle-container").slideToggle("fast"),b.removeClass("trigger_active")):(a(".trigger_active").nearest(".mashsb-toggle-container").slideToggle("slow"),a(".trigger_active").removeClass("trigger_active"),a(b).nearest(".mashsb-toggle-container").slideToggle("fast"),b.addClass("trigger_active")),!1})),"undefined"!=typeof mashsb&&"link"===mashsb.subscribe&&a(".mashicon-subscribe").click(function(){var b=mashsb.subscribe_url;a(this).attr("href",b)}),function(a){a.fn.countTo=function(b){return b=b||{},a(this).each(function(){function c(){k+=g,j++,d(k),"function"==typeof e.onUpdate&&e.onUpdate.call(h,k),j>=f&&(i.removeData("countTo"),clearInterval(l.interval),k=e.to,"function"==typeof e.onComplete&&e.onComplete.call(h,k))}function d(a){var b=e.formatter.call(h,a,e);i.text(b)}var e=a.extend({},a.fn.countTo.defaults,{from:a(this).data("from"),to:a(this).data("to"),speed:a(this).data("speed"),refreshInterval:a(this).data("refresh-interval"),decimals:a(this).data("decimals")},b),f=Math.ceil(e.speed/e.refreshInterval),g=(e.to-e.from)/f,h=this,i=a(this),j=0,k=e.from,l=i.data("countTo")||{};i.data("countTo",l),l.interval&&clearInterval(l.interval),l.interval=setInterval(c,e.refreshInterval),d(k)})},a.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:d,onUpdate:null,onComplete:null}}(jQuery),"undefined"!=typeof mashsb&&1==mashsb.animate_shares&&a(".mashsbcount").length&&a(".mashsbcount").countTo({from:0,to:mashsb.shares,speed:1e3,refreshInterval:100})}),function(a,b){a.fn.nearest=function(c){function d(b){f=f?f.add(b):a(b)}var e,f,g,h,i,j=b.querySelectorAll;return this.each(function(){e=this,a.each(c.split(","),function(){if(h=a.trim(this),h.indexOf("#"))for(i=e.parentNode;i;){if(g=j?i.querySelectorAll(h):a(i).find(h),g.length){d(g);break}i=i.parentNode}else d(j?b.querySelectorAll(h):a(h))})}),f||a()}}(jQuery,document);
|
includes/admin/settings/display-settings.php
CHANGED
@@ -185,7 +185,7 @@ function mashsb_options_page() {
|
|
185 |
submit_button();
|
186 |
?>
|
187 |
</form>
|
188 |
-
|
189 |
</div> <!-- new //-->
|
190 |
</div><!-- #tab_container-->
|
191 |
<div class="mashsb-sidebar">
|
@@ -195,6 +195,8 @@ function mashsb_options_page() {
|
|
195 |
}
|
196 |
?>
|
197 |
</div> <!-- #sidebar-->
|
|
|
|
|
198 |
</div><!-- .mashsb_admin -->
|
199 |
<?php
|
200 |
echo ob_get_clean();
|
185 |
submit_button();
|
186 |
?>
|
187 |
</form>
|
188 |
+
<div><?php echo mashsb_admin_rate_us(); ?></div>
|
189 |
</div> <!-- new //-->
|
190 |
</div><!-- #tab_container-->
|
191 |
<div class="mashsb-sidebar">
|
195 |
}
|
196 |
?>
|
197 |
</div> <!-- #sidebar-->
|
198 |
+
<?php echo mashsb_get_debug_settings(); ?>
|
199 |
+
|
200 |
</div><!-- .mashsb_admin -->
|
201 |
<?php
|
202 |
echo ob_get_clean();
|
includes/admin/settings/metabox-settings.php
CHANGED
@@ -146,13 +146,25 @@ function mashsb_meta_boxes( $meta_boxes ) {
|
|
146 |
'both' => __('Above & Below Content','mashsb'),
|
147 |
)
|
148 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
array(
|
150 |
'helper'=> '<a class="mashsb-helper" href="#" style="margin-left:-4px;"></a><div class="mashsb-message" style="display: none;">'.__('Validate open graph meta tags on your site. Incorrect data can result in wrong share description, title or images and should be fixed! In the facebook debugger click the link "Fetch new scrape information" to purge the facebook cache.','mashsb').'</div>',
|
151 |
'id' => $prefix . 'validate_og',
|
152 |
-
'before' => '<div style="max-width:250px;
|
153 |
'after' => '</div>',
|
154 |
'type' => 'validate_og'
|
155 |
),
|
|
|
156 |
array(
|
157 |
'name' => 'divider',
|
158 |
'id' => 'divider',
|
146 |
'both' => __('Above & Below Content','mashsb'),
|
147 |
)
|
148 |
),
|
149 |
+
// Setup the og:type
|
150 |
+
array(
|
151 |
+
'name' => '<span class="mashicon mashicon-share"> </span> ' . __( 'Open Graph Type', 'mashsb' ),
|
152 |
+
'desc' => __( 'This is used by the open graph meta tag og:type. Leave this blank to use the default value "article". ', 'mashsb' ),
|
153 |
+
'id' => $prefix . 'og_type',
|
154 |
+
'type' => 'text',
|
155 |
+
'clone' => false,
|
156 |
+
'class' => 'mashsb-og-type',
|
157 |
+
'before' => '<div style="max-width:250px;float:left;">',
|
158 |
+
'after' => '</div>',
|
159 |
+
),
|
160 |
array(
|
161 |
'helper'=> '<a class="mashsb-helper" href="#" style="margin-left:-4px;"></a><div class="mashsb-message" style="display: none;">'.__('Validate open graph meta tags on your site. Incorrect data can result in wrong share description, title or images and should be fixed! In the facebook debugger click the link "Fetch new scrape information" to purge the facebook cache.','mashsb').'</div>',
|
162 |
'id' => $prefix . 'validate_og',
|
163 |
+
'before' => '<div style="max-width:250px;margin-top:45px;">',
|
164 |
'after' => '</div>',
|
165 |
'type' => 'validate_og'
|
166 |
),
|
167 |
+
|
168 |
array(
|
169 |
'name' => 'divider',
|
170 |
'id' => 'divider',
|
includes/admin/settings/register-settings.php
CHANGED
@@ -264,7 +264,7 @@ function mashsb_get_registered_settings() {
|
|
264 |
array(
|
265 |
'id' => 'fb_access_token_new',
|
266 |
'name' => __( 'Facebook User Access Token', 'mashsb' ),
|
267 |
-
'desc' => sprintf( __( '
|
268 |
'type' => 'fboauth',
|
269 |
'size' => 'large'
|
270 |
),
|
@@ -672,7 +672,7 @@ So the MashShare open graph data will be containing the same social meta data th
|
|
672 |
'delete_cache_objects' => array(
|
673 |
'id' => 'delete_cache_objects',
|
674 |
'name' => __( 'Attention: Purge DB Cache', 'mashsb' ),
|
675 |
-
'desc' => __( '<strong>
|
676 |
'type' => 'checkbox'
|
677 |
),
|
678 |
'debug_mode' => array(
|
@@ -1991,3 +1991,18 @@ function mashsb_ratelimit_callback() {
|
|
1991 |
function mashsb_hide_addons(){
|
1992 |
return apply_filters('mashsb_hide_addons', false);
|
1993 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
array(
|
265 |
'id' => 'fb_access_token_new',
|
266 |
'name' => __( 'Facebook User Access Token', 'mashsb' ),
|
267 |
+
'desc' => sprintf( __( 'Try this to be able to make up to 200 calls per hour to facebook api. <a href="%s" target="_blank">Read here</a> how to get the access token. If your access token is not working just leave this field empty. Shares are counted, though.', 'mashsb' ), 'http://docs.mashshare.net/article/132-how-to-create-a-facebook-access-token' ),
|
268 |
'type' => 'fboauth',
|
269 |
'size' => 'large'
|
270 |
),
|
672 |
'delete_cache_objects' => array(
|
673 |
'id' => 'delete_cache_objects',
|
674 |
'name' => __( 'Attention: Purge DB Cache', 'mashsb' ),
|
675 |
+
'desc' => __( '<strong>Caution </strong>Use this as last resort. This will delete all your share counts stored in mashshare post_meta objects and it takes hours to get them back. Usually this option is not needed! <br>' . mashsb_delete_cache_objects(), 'mashsb' ),
|
676 |
'type' => 'checkbox'
|
677 |
),
|
678 |
'debug_mode' => array(
|
1991 |
function mashsb_hide_addons(){
|
1992 |
return apply_filters('mashsb_hide_addons', false);
|
1993 |
}
|
1994 |
+
|
1995 |
+
/**
|
1996 |
+
* outout debug vars
|
1997 |
+
* @global array $mashsb_options
|
1998 |
+
*/
|
1999 |
+
function mashsb_get_debug_settings(){
|
2000 |
+
global $mashsb_options;
|
2001 |
+
if(isset($mashsb_options['debug_mode'])){
|
2002 |
+
echo '<div style="clear:both;">';
|
2003 |
+
var_dump($mashsb_options);
|
2004 |
+
echo 'Installed Networks:<br>';
|
2005 |
+
var_dump(get_option('mashsb_networks'));
|
2006 |
+
echo '</div>';
|
2007 |
+
}
|
2008 |
+
}
|
includes/admin/welcome.php
CHANGED
@@ -32,8 +32,8 @@ class MASHSB_Welcome {
|
|
32 |
* @since 1.0.1
|
33 |
*/
|
34 |
public function __construct() {
|
35 |
-
add_action( 'admin_menu', array($this, '
|
36 |
-
add_action( 'admin_head', array($this, 'admin_head') );
|
37 |
add_action( 'admin_init', array($this, 'welcome') );
|
38 |
}
|
39 |
|
@@ -45,25 +45,45 @@ class MASHSB_Welcome {
|
|
45 |
* @since 1.4
|
46 |
* @return void
|
47 |
*/
|
48 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
// About Page
|
50 |
-
|
51 |
-
__( 'Welcome to MashShare', 'mashsb' ), __( 'Welcome to MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-about', array($this, 'about_screen')
|
52 |
);
|
53 |
|
54 |
// Changelog Page
|
55 |
-
$mashsb_about =
|
56 |
-
__( 'MashShare Changelog', 'mashsb' ), __( 'MashShare Changelog', 'mashsb' ), $this->minimum_capability, 'mashsb-changelog', array($this, 'changelog_screen')
|
57 |
);
|
58 |
|
59 |
-
// Getting Started Page
|
60 |
-
$mashsb_quickstart = add_submenu_page(
|
61 |
-
'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
|
62 |
-
);
|
63 |
|
64 |
// Credits Page
|
65 |
-
$mashsb_credits =
|
66 |
-
__( 'The people that build MashShare', 'mashsb' ), __( 'The people that build MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-credits', array($this, 'credits_screen')
|
67 |
);
|
68 |
}
|
69 |
|
@@ -75,10 +95,11 @@ class MASHSB_Welcome {
|
|
75 |
* @return void
|
76 |
*/
|
77 |
public function admin_head() {
|
78 |
-
remove_submenu_page( '
|
79 |
-
remove_submenu_page( '
|
80 |
-
remove_submenu_page( '
|
81 |
-
remove_submenu_page( '
|
|
|
82 |
if ( !mashsb_is_admin_page() ){
|
83 |
return false;
|
84 |
}
|
@@ -121,7 +142,7 @@ class MASHSB_Welcome {
|
|
121 |
public function getting_started_screen() {
|
122 |
global $mashsb_redirect;
|
123 |
?>
|
124 |
-
<div class="wrap
|
125 |
<?php
|
126 |
// load welcome message and content tabs
|
127 |
$this->welcome_message();
|
@@ -131,7 +152,7 @@ class MASHSB_Welcome {
|
|
131 |
<p class="about-description mashsb-notice notice-success"><?php _e( 'Facebook and Twitter Share Buttons are successfully enabled on all your posts! <br> Now you can use the steps below to customize MashShare to your needs.', 'mashsb' ); ?></p>
|
132 |
<?php } ?>
|
133 |
<div class="changelog">
|
134 |
-
<
|
135 |
<div class="feature-section">
|
136 |
<div class="feature-section-media">
|
137 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/social-networks-settings.png'; ?>" class="mashsb-welcome-screenshots"/>
|
@@ -141,7 +162,7 @@ class MASHSB_Welcome {
|
|
141 |
<p><?php _e( 'The Social Network menu is your general access point for activating the desired share buttons and for customizing the share button label', 'mashsb' ); ?></p>
|
142 |
<h4>Step 2: Go to <a href="<?php echo admin_url( 'admin.php?page=mashsb-settings#mashsb_settingslocation_header' ) ?>" target="blank"><?php _e( 'Settings → Position', 'mashsb' ); ?></a></h4>
|
143 |
<p><?php _e( 'Select the location and exact position of the share buttons within your content', 'mashsb' ); ?></p>
|
144 |
-
<
|
145 |
<p></p>
|
146 |
|
147 |
</div>
|
@@ -149,15 +170,12 @@ class MASHSB_Welcome {
|
|
149 |
</div>
|
150 |
|
151 |
<div class="changelog">
|
152 |
-
<
|
153 |
<div class="feature-section">
|
154 |
-
<div class="feature-section-media">
|
155 |
-
|
156 |
-
</div>
|
157 |
<div class="feature-section-content">
|
158 |
-
<h4
|
159 |
|
160 |
-
<p><?php _e( 'Drag and drop the widget
|
161 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/most-shared-posts.png'; ?>"/>
|
162 |
|
163 |
</div>
|
@@ -165,44 +183,40 @@ class MASHSB_Welcome {
|
|
165 |
</div>
|
166 |
|
167 |
<div class="changelog">
|
168 |
-
<
|
169 |
<div class="feature-section">
|
170 |
<div class="feature-section-media">
|
171 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/shortcodes.png'; ?>"/>
|
172 |
</div>
|
173 |
<div class="feature-section-content">
|
174 |
<p>
|
175 |
-
<?php _e( 'Add Share buttons manually with using
|
176 |
</p>
|
177 |
<?php _e( 'Paste the shortcode in content of your posts or pages with the post editor at the place you want the share buttons appear', 'mashsb' ); ?>
|
178 |
<p>
|
179 |
-
<?php echo sprintf(__( 'There are
|
180 |
</p>
|
181 |
</div>
|
182 |
</div>
|
183 |
</div>
|
184 |
<div class="changelog">
|
185 |
-
<
|
186 |
<div class="feature-section">
|
187 |
<div class="feature-section-media">
|
188 |
-
|
189 |
<div class="feature-section-content">
|
190 |
<p>
|
191 |
<?php _e( 'Add MashShare directly into your theme template files with using the PHP code <i style="font-weight:bold;"><?php do_shortcode(\'[mashshare]\'); ?></i>', 'mashsb' ); ?>
|
192 |
</p>
|
193 |
-
|
194 |
-
<p>
|
195 |
-
<?php echo sprintf(__( 'There are various parameters you can use for the mashshare shortcode. Find a list of all available shortcode parameters <a href="%s" target="blank">here</a>', 'mashsb'), 'https://www.mashshare.net/documentation/shortcodes/'); ?><br>
|
196 |
-
</p>
|
197 |
</div>
|
198 |
</div>
|
199 |
</div>
|
200 |
|
201 |
<div class="changelog">
|
202 |
-
<
|
203 |
<div class="feature-section two-col">
|
204 |
<div>
|
205 |
-
<
|
206 |
<p><?php _e( 'We do our best to provide the best support we can. If you encounter a problem or have a question, simply open a ticket using our <a href="https://www.mashshare.net/contact-developer/" target="blank">support form</a>.', 'mashsb' ); ?></p>
|
207 |
<ul id="mash-social-admin-head">
|
208 |
<?php echo mashsb_share_buttons(); ?>
|
@@ -254,38 +268,38 @@ s </div>
|
|
254 |
<div class="feature-section">
|
255 |
<div class="feature-section-content">
|
256 |
<!--
|
257 |
-
<
|
258 |
<p><?php //_e( 'MashShare is the first Social Media plugin that uses the brandnew Facebook Connect Integration to bypass the regular facebook API limit which has been introduced recently. <p>It allows you up to 200 API calls per hour to the facebook server. This is more than enough for even huge traffic sites as MashShare is caching all share counts internally. <p>We are convinced that other social media plugins are going to copy our solution soon... and we will be proud of it;) <p> Your site becomes immediately better than the rest because you are the one whose website is running with full social sharing power. Other sites share count still stucks and are delayed and they do not know it;)', 'mashsb' ); ?></p>
|
259 |
<img src="<?php //echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/oauth.png'; ?>"/>
|
260 |
//-->
|
261 |
<p></p>
|
262 |
-
<
|
263 |
<p><?php _e( 'We have heard your wishes so the new widget contains the long requested post thumbnail and a beautiful css which gives your side bar sharing super power.', 'mashsb' ); ?></p>
|
264 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/widget.png'; ?>"/>
|
265 |
<p></p>
|
266 |
-
<
|
267 |
<p><?php _e( 'Select from 3 ready to use sizes to make sure that MashShare is looking great on your site. No matter if you prefer small, medium or large buttons.', 'mashsb' ); ?></p>
|
268 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/different_sizes.gif'; ?>"/>
|
269 |
<p></p>
|
270 |
-
<
|
271 |
<p><?php _e( 'With MashShare you get our biggest performance update. Use the new <i>Async Cache Refresh</i> method and your share counts will be aggregated only after page loading and never while page loads. This is a huge performance update.', 'mashsb' ); ?></p>
|
272 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/async_cache_refresh.png'; ?>"/>
|
273 |
<p></p>
|
274 |
-
<
|
275 |
<p><?php _e( 'Use open graph and twitter card to specify the content you like to share. If you are using Yoast, MashShare will use the Yoast open graph data instead and extend it with custom data to get the maximum out of your valuable content.', 'mashsb' ); ?></p>
|
276 |
<p></p>
|
277 |
|
278 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/social_sharing_settings.png'; ?>"/>
|
279 |
<p></p>
|
280 |
-
<
|
281 |
<p><?php _e( 'MashShare arrives you with excellent responsive support. So the buttons look great on mobile and desktop devices. If you want more customization options for mobile devices you can purchase the responsive Add-On', 'mashsb' ); ?></p>
|
282 |
<p></p>
|
283 |
-
<
|
284 |
<p><?php _e( 'See the shares of your posts at a glance on the admin posts listing:', 'mashsb' ); ?></p>
|
285 |
<p></p>
|
286 |
<img alt="Share count dashboard" title="Share count dashboard" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/dashboard.png'; ?>"/>
|
287 |
<p></p>
|
288 |
-
<
|
289 |
<p><?php _e( 'We spent a lot of time to make useful first time settings and improved the user interface for an easier experience.', 'mashsb' ); ?></p>
|
290 |
<p></p>
|
291 |
</div>
|
@@ -294,7 +308,7 @@ s </div>
|
|
294 |
|
295 |
|
296 |
<div class="changelog">
|
297 |
-
<
|
298 |
<div class="feature-section three-col">
|
299 |
<div class="col">
|
300 |
<h4><?php _e( 'Developer Friendly', 'mashsb' ); ?></h4>
|
@@ -479,7 +493,7 @@ s </div>
|
|
479 |
$this->tabs();
|
480 |
?>
|
481 |
<div class="changelog">
|
482 |
-
<
|
483 |
|
484 |
<div class="feature-section">
|
485 |
<?php echo $this->parse_readme(); ?>
|
32 |
* @since 1.0.1
|
33 |
*/
|
34 |
public function __construct() {
|
35 |
+
add_action( 'admin_menu', array($this, 'add_admin_menus') );
|
36 |
+
add_action( 'admin_head', array($this, 'admin_head'), 1000 );
|
37 |
add_action( 'admin_init', array($this, 'welcome') );
|
38 |
}
|
39 |
|
45 |
* @since 1.4
|
46 |
* @return void
|
47 |
*/
|
48 |
+
public function add_admin_menus() {
|
49 |
+
// // About Page
|
50 |
+
// add_dashboard_page(
|
51 |
+
// __( 'Welcome to MashShare', 'mashsb' ), __( 'Welcome to MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-about', array($this, 'about_screen')
|
52 |
+
// );
|
53 |
+
//
|
54 |
+
// // Changelog Page
|
55 |
+
// $mashsb_about = add_dashboard_page(
|
56 |
+
// __( 'MashShare Changelog', 'mashsb' ), __( 'MashShare Changelog', 'mashsb' ), $this->minimum_capability, 'mashsb-changelog', array($this, 'changelog_screen')
|
57 |
+
// );
|
58 |
+
//
|
59 |
+
// // Getting Started Page
|
60 |
+
// $mashsb_quickstart = add_submenu_page(
|
61 |
+
// 'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
|
62 |
+
// );
|
63 |
+
//
|
64 |
+
// // Credits Page
|
65 |
+
// $mashsb_credits = add_dashboard_page(
|
66 |
+
// __( 'The people that build MashShare', 'mashsb' ), __( 'The people that build MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-credits', array($this, 'credits_screen')
|
67 |
+
// );
|
68 |
+
//
|
69 |
+
// Getting Started Page
|
70 |
+
$mashsb_quickstart = add_submenu_page(
|
71 |
+
'mashsb-settings', __( 'Quickstart', 'mashsb' ), __( 'Quickstart', 'mashsb' ), $this->minimum_capability, 'mashsb-getting-started', array($this, 'getting_started_screen')
|
72 |
+
);
|
73 |
// About Page
|
74 |
+
add_submenu_page(
|
75 |
+
'mashsb-settings', __( 'Welcome to MashShare', 'mashsb' ), __( 'Welcome to MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-about', array($this, 'about_screen')
|
76 |
);
|
77 |
|
78 |
// Changelog Page
|
79 |
+
$mashsb_about = add_submenu_page(
|
80 |
+
'mashsb-settings',__( 'MashShare Changelog', 'mashsb' ), __( 'MashShare Changelog', 'mashsb' ), $this->minimum_capability, 'mashsb-changelog', array($this, 'changelog_screen')
|
81 |
);
|
82 |
|
|
|
|
|
|
|
|
|
83 |
|
84 |
// Credits Page
|
85 |
+
$mashsb_credits = add_submenu_page(
|
86 |
+
'mashsb-settings',__( 'The people that build MashShare', 'mashsb' ), __( 'The people that build MashShare', 'mashsb' ), $this->minimum_capability, 'mashsb-credits', array($this, 'credits_screen')
|
87 |
);
|
88 |
}
|
89 |
|
95 |
* @return void
|
96 |
*/
|
97 |
public function admin_head() {
|
98 |
+
remove_submenu_page( 'mashsb-settings', 'mashsb-about' );
|
99 |
+
remove_submenu_page( 'mashsb-settings', 'mashsb-changelog' );
|
100 |
+
remove_submenu_page( 'mashsb-settings', 'mashsb-getting-started' );
|
101 |
+
remove_submenu_page( 'mashsb-settings', 'mashsb-credits' );
|
102 |
+
|
103 |
if ( !mashsb_is_admin_page() ){
|
104 |
return false;
|
105 |
}
|
142 |
public function getting_started_screen() {
|
143 |
global $mashsb_redirect;
|
144 |
?>
|
145 |
+
<div class="wrap mashsb-about-wrap">
|
146 |
<?php
|
147 |
// load welcome message and content tabs
|
148 |
$this->welcome_message();
|
152 |
<p class="about-description mashsb-notice notice-success"><?php _e( 'Facebook and Twitter Share Buttons are successfully enabled on all your posts! <br> Now you can use the steps below to customize MashShare to your needs.', 'mashsb' ); ?></p>
|
153 |
<?php } ?>
|
154 |
<div class="changelog">
|
155 |
+
<h1><?php _e( 'Create Your First Social Sharing Button', 'mashsb' ); ?></h1>
|
156 |
<div class="feature-section">
|
157 |
<div class="feature-section-media">
|
158 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/social-networks-settings.png'; ?>" class="mashsb-welcome-screenshots"/>
|
162 |
<p><?php _e( 'The Social Network menu is your general access point for activating the desired share buttons and for customizing the share button label', 'mashsb' ); ?></p>
|
163 |
<h4>Step 2: Go to <a href="<?php echo admin_url( 'admin.php?page=mashsb-settings#mashsb_settingslocation_header' ) ?>" target="blank"><?php _e( 'Settings → Position', 'mashsb' ); ?></a></h4>
|
164 |
<p><?php _e( 'Select the location and exact position of the share buttons within your content', 'mashsb' ); ?></p>
|
165 |
+
<h4><?php _e('You are done! Easy, isn\'t it?', 'mashsb'); ?></h4>
|
166 |
<p></p>
|
167 |
|
168 |
</div>
|
170 |
</div>
|
171 |
|
172 |
<div class="changelog">
|
173 |
+
<h1><?php _e( 'Create Most Shared Posts Widget', 'mashsb' ); ?></h1>
|
174 |
<div class="feature-section">
|
|
|
|
|
|
|
175 |
<div class="feature-section-content">
|
176 |
+
<h4>Go to <a href="<?php echo admin_url( 'widgets.php' ) ?>" target="blank"><?php _e( 'Appearance → Widgets', 'mashsb' ); ?></a></h4>
|
177 |
|
178 |
+
<p><?php _e( 'Drag and drop the widget labeled "<i>MashShare - Most Shared Posts</i>" into the desired widget location and save it.', 'mashsb' ); ?></p>
|
179 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/most-shared-posts.png'; ?>"/>
|
180 |
|
181 |
</div>
|
183 |
</div>
|
184 |
|
185 |
<div class="changelog">
|
186 |
+
<h1><?php _e( 'Content Shortcodes', 'mashsb' ); ?></h1>
|
187 |
<div class="feature-section">
|
188 |
<div class="feature-section-media">
|
189 |
<img style="display:none;" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/shortcodes.png'; ?>"/>
|
190 |
</div>
|
191 |
<div class="feature-section-content">
|
192 |
<p>
|
193 |
+
<?php _e( 'Add Share buttons manually with using shortcode <i style="font-weight:bold;">[mashshare]</i>.', 'mashsb' ); ?>
|
194 |
</p>
|
195 |
<?php _e( 'Paste the shortcode in content of your posts or pages with the post editor at the place you want the share buttons appear', 'mashsb' ); ?>
|
196 |
<p>
|
197 |
+
<?php echo sprintf(__( 'There are several parameters you can use for the shortcode. Get a <a href="%s" target="blank">list of all available shortcode parameters</a>', 'mashsb'), 'http://docs.mashshare.net/article/67-shortcodes'); ?><br>
|
198 |
</p>
|
199 |
</div>
|
200 |
</div>
|
201 |
</div>
|
202 |
<div class="changelog">
|
203 |
+
<h1><?php _e( 'PHP Template Shortcode', 'mashsb' ); ?></h1>
|
204 |
<div class="feature-section">
|
205 |
<div class="feature-section-media">
|
206 |
+
</div>
|
207 |
<div class="feature-section-content">
|
208 |
<p>
|
209 |
<?php _e( 'Add MashShare directly into your theme template files with using the PHP code <i style="font-weight:bold;"><?php do_shortcode(\'[mashshare]\'); ?></i>', 'mashsb' ); ?>
|
210 |
</p>
|
|
|
|
|
|
|
|
|
211 |
</div>
|
212 |
</div>
|
213 |
</div>
|
214 |
|
215 |
<div class="changelog">
|
216 |
+
<h1><?php _e( 'Need Help?', 'mashsb' ); ?></h1>
|
217 |
<div class="feature-section two-col">
|
218 |
<div>
|
219 |
+
<h4><?php _e( 'Great Support', 'mashsb' ); ?></h4>
|
220 |
<p><?php _e( 'We do our best to provide the best support we can. If you encounter a problem or have a question, simply open a ticket using our <a href="https://www.mashshare.net/contact-developer/" target="blank">support form</a>.', 'mashsb' ); ?></p>
|
221 |
<ul id="mash-social-admin-head">
|
222 |
<?php echo mashsb_share_buttons(); ?>
|
268 |
<div class="feature-section">
|
269 |
<div class="feature-section-content">
|
270 |
<!--
|
271 |
+
<h1><?php //_e( 'Use Facebook Connect to Skyrocket Share Count', 'mashsb' ); ?></h1>
|
272 |
<p><?php //_e( 'MashShare is the first Social Media plugin that uses the brandnew Facebook Connect Integration to bypass the regular facebook API limit which has been introduced recently. <p>It allows you up to 200 API calls per hour to the facebook server. This is more than enough for even huge traffic sites as MashShare is caching all share counts internally. <p>We are convinced that other social media plugins are going to copy our solution soon... and we will be proud of it;) <p> Your site becomes immediately better than the rest because you are the one whose website is running with full social sharing power. Other sites share count still stucks and are delayed and they do not know it;)', 'mashsb' ); ?></p>
|
273 |
<img src="<?php //echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/oauth.png'; ?>"/>
|
274 |
//-->
|
275 |
<p></p>
|
276 |
+
<h1><?php _e( 'A New Beautiful Sharing Widget', 'mashsb' ); ?></h1>
|
277 |
<p><?php _e( 'We have heard your wishes so the new widget contains the long requested post thumbnail and a beautiful css which gives your side bar sharing super power.', 'mashsb' ); ?></p>
|
278 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/widget.png'; ?>"/>
|
279 |
<p></p>
|
280 |
+
<h1><?php _e( 'Better Customization Options', 'mashsb' ); ?></h1>
|
281 |
<p><?php _e( 'Select from 3 ready to use sizes to make sure that MashShare is looking great on your site. No matter if you prefer small, medium or large buttons.', 'mashsb' ); ?></p>
|
282 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/different_sizes.gif'; ?>"/>
|
283 |
<p></p>
|
284 |
+
<h1><?php _e( 'Asyncronous Share Count Aggregation', 'mashsb' ); ?></h1>
|
285 |
<p><?php _e( 'With MashShare you get our biggest performance update. Use the new <i>Async Cache Refresh</i> method and your share counts will be aggregated only after page loading and never while page loads. This is a huge performance update.', 'mashsb' ); ?></p>
|
286 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/async_cache_refresh.png'; ?>"/>
|
287 |
<p></p>
|
288 |
+
<h1><?php _e( 'Open Graph and Twitter Card Integration', 'mashsb' ); ?></h1>
|
289 |
<p><?php _e( 'Use open graph and twitter card to specify the content you like to share. If you are using Yoast, MashShare will use the Yoast open graph data instead and extend it with custom data to get the maximum out of your valuable content.', 'mashsb' ); ?></p>
|
290 |
<p></p>
|
291 |
|
292 |
<img src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/social_sharing_settings.png'; ?>"/>
|
293 |
<p></p>
|
294 |
+
<h1><?php _e( 'Great Responsive Buttons', 'mashsb' ); ?></h1>
|
295 |
<p><?php _e( 'MashShare arrives you with excellent responsive support. So the buttons look great on mobile and desktop devices. If you want more customization options for mobile devices you can purchase the responsive Add-On', 'mashsb' ); ?></p>
|
296 |
<p></p>
|
297 |
+
<h1><?php _e( 'Share Count Dashboard', 'mashsb' ); ?></h1>
|
298 |
<p><?php _e( 'See the shares of your posts at a glance on the admin posts listing:', 'mashsb' ); ?></p>
|
299 |
<p></p>
|
300 |
<img alt="Share count dashboard" title="Share count dashboard" src="<?php echo MASHSB_PLUGIN_URL . 'assets/images/screenshots/dashboard.png'; ?>"/>
|
301 |
<p></p>
|
302 |
+
<h1><?php _e( 'A much cleaner user interface', 'mashsb' ); ?></h1>
|
303 |
<p><?php _e( 'We spent a lot of time to make useful first time settings and improved the user interface for an easier experience.', 'mashsb' ); ?></p>
|
304 |
<p></p>
|
305 |
</div>
|
308 |
|
309 |
|
310 |
<div class="changelog">
|
311 |
+
<h1><?php _e( 'Additional Updates', 'mashsb' ); ?></h1>
|
312 |
<div class="feature-section three-col">
|
313 |
<div class="col">
|
314 |
<h4><?php _e( 'Developer Friendly', 'mashsb' ); ?></h4>
|
493 |
$this->tabs();
|
494 |
?>
|
495 |
<div class="changelog">
|
496 |
+
<h4><?php _e( 'Full Changelog', 'mashsb' ); ?></h4>
|
497 |
|
498 |
<div class="feature-section">
|
499 |
<?php echo $this->parse_readme(); ?>
|
includes/cron.php
CHANGED
@@ -37,13 +37,13 @@ function mashsb_check_fb_api_key() {
|
|
37 |
$data = json_decode( $buffer );
|
38 |
|
39 |
if( empty( $buffer ) ) {
|
40 |
-
update_option( 'mashsb_valid_fb_api_key', '
|
41 |
} else if( is_object($data) && !empty( $data->error->message ) ) {
|
42 |
update_option( 'mashsb_valid_fb_api_key', $data->error->message );
|
43 |
} else if( is_object($data) && isset( $data->share->share_count ) ) {
|
44 |
update_option( 'mashsb_valid_fb_api_key', 'success' );
|
45 |
} else {
|
46 |
-
update_option( 'mashsb_valid_fb_api_key', '
|
47 |
}
|
48 |
}
|
49 |
return false;
|
37 |
$data = json_decode( $buffer );
|
38 |
|
39 |
if( empty( $buffer ) ) {
|
40 |
+
update_option( 'mashsb_valid_fb_api_key', 'The access token is not working because facebook is returning unknown error. Delete the token or create a new one.' );
|
41 |
} else if( is_object($data) && !empty( $data->error->message ) ) {
|
42 |
update_option( 'mashsb_valid_fb_api_key', $data->error->message );
|
43 |
} else if( is_object($data) && isset( $data->share->share_count ) ) {
|
44 |
update_option( 'mashsb_valid_fb_api_key', 'success' );
|
45 |
} else {
|
46 |
+
update_option( 'mashsb_valid_fb_api_key', 'The access token is not working because faceboook is returning unknown error. Delete the token or create a new one.' );
|
47 |
}
|
48 |
}
|
49 |
return false;
|
includes/header-meta-tags.php
CHANGED
@@ -18,6 +18,7 @@ class MASHSB_HEADER_META_TAGS {
|
|
18 |
protected $og_title = '';
|
19 |
protected $og_description;
|
20 |
protected $og_image;
|
|
|
21 |
protected $fb_author_url;
|
22 |
protected $fb_app_id;
|
23 |
protected $twitter_title;
|
@@ -82,6 +83,7 @@ class MASHSB_HEADER_META_TAGS {
|
|
82 |
$this->og_title = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_og_title', true ) );
|
83 |
$this->og_description = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_og_description', true ) );
|
84 |
$this->og_image = $this->get_image_url();
|
|
|
85 |
$this->twitter_title = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_custom_tweet', true ) );
|
86 |
$this->twitter_creator = $this->get_twitter_creator();
|
87 |
$this->twitter_site = mashsb_get_twitter_username();
|
@@ -187,6 +189,20 @@ class MASHSB_HEADER_META_TAGS {
|
|
187 |
// Default return value
|
188 |
return $this->post_title;
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
/**
|
192 |
* Get the og description
|
@@ -544,7 +560,7 @@ class MASHSB_HEADER_META_TAGS {
|
|
544 |
}
|
545 |
|
546 |
$opengraph = PHP_EOL . '<!-- Open Graph Meta Tags generated by MashShare ' . MASHSB_VERSION . ' - https://mashshare.net -->';
|
547 |
-
$opengraph .= PHP_EOL . '<meta property="og:type" content="
|
548 |
if( $this->get_og_title() ) {
|
549 |
$opengraph .= PHP_EOL . '<meta property="og:title" content="' . $this->get_og_title() . '" />';
|
550 |
}
|
18 |
protected $og_title = '';
|
19 |
protected $og_description;
|
20 |
protected $og_image;
|
21 |
+
protected $og_type;
|
22 |
protected $fb_author_url;
|
23 |
protected $fb_app_id;
|
24 |
protected $twitter_title;
|
83 |
$this->og_title = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_og_title', true ) );
|
84 |
$this->og_description = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_og_description', true ) );
|
85 |
$this->og_image = $this->get_image_url();
|
86 |
+
$this->og_type = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_og_type', true ) );
|
87 |
$this->twitter_title = $this->sanitize_data( get_post_meta( $this->postID, 'mashsb_custom_tweet', true ) );
|
88 |
$this->twitter_creator = $this->get_twitter_creator();
|
89 |
$this->twitter_site = mashsb_get_twitter_username();
|
189 |
// Default return value
|
190 |
return $this->post_title;
|
191 |
}
|
192 |
+
/**
|
193 |
+
* Get the og type
|
194 |
+
*
|
195 |
+
* @return string
|
196 |
+
*/
|
197 |
+
public function get_og_type() {
|
198 |
+
|
199 |
+
if( !empty( $this->og_type ) ) {
|
200 |
+
return $this->og_type;
|
201 |
+
}
|
202 |
+
|
203 |
+
// Default return value
|
204 |
+
return 'article';
|
205 |
+
}
|
206 |
|
207 |
/**
|
208 |
* Get the og description
|
560 |
}
|
561 |
|
562 |
$opengraph = PHP_EOL . '<!-- Open Graph Meta Tags generated by MashShare ' . MASHSB_VERSION . ' - https://mashshare.net -->';
|
563 |
+
$opengraph .= PHP_EOL . '<meta property="og:type" content="'.$this->get_og_type().'" /> ';
|
564 |
if( $this->get_og_title() ) {
|
565 |
$opengraph .= PHP_EOL . '<meta property="og:title" content="' . $this->get_og_title() . '" />';
|
566 |
}
|
includes/install.php
CHANGED
@@ -70,6 +70,9 @@ function mashsb_install() {
|
|
70 |
// Try to load some settings. If there are no ones we write some default settings:
|
71 |
$settings = get_option( 'mashsb_settings' );
|
72 |
|
|
|
|
|
|
|
73 |
// Write default settings. Check first if there are no settings
|
74 |
if( !$settings || count( $settings ) === 0 ) {
|
75 |
$settings_default = array(
|
@@ -142,6 +145,10 @@ function mashsb_install() {
|
|
142 |
}
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
145 |
/**
|
146 |
* Post-installation
|
147 |
*
|
70 |
// Try to load some settings. If there are no ones we write some default settings:
|
71 |
$settings = get_option( 'mashsb_settings' );
|
72 |
|
73 |
+
// Check if default networks are existing
|
74 |
+
|
75 |
+
|
76 |
// Write default settings. Check first if there are no settings
|
77 |
if( !$settings || count( $settings ) === 0 ) {
|
78 |
$settings_default = array(
|
145 |
}
|
146 |
}
|
147 |
|
148 |
+
//function mashsb_is_default_networks($settings){
|
149 |
+
// if
|
150 |
+
//}
|
151 |
+
|
152 |
/**
|
153 |
* Post-installation
|
154 |
*
|
includes/scripts.php
CHANGED
@@ -63,7 +63,6 @@ function mashsb_load_scripts( $hook ) {
|
|
63 |
|
64 |
wp_enqueue_script( 'mashsb', $js_dir . 'mashsb' . $suffix . '.js', array('jquery'), MASHSB_VERSION, $in_footer );
|
65 |
//wp_enqueue_script( 'element-queries', $js_dir . 'ElementQueries' . '.js', array('jquery'), MASHSB_VERSION, $in_footer );
|
66 |
-
//wp_enqueue_script( 'resize-sensor', $js_dir . 'ResizeSensor' . '.js', array('jquery'), MASHSB_VERSION, $in_footer );
|
67 |
|
68 |
!isset( $mashsb_options['disable_sharecount'] ) ? $shareresult = getSharedcount( $url ) : $shareresult = 0;
|
69 |
wp_localize_script( 'mashsb', 'mashsb', array(
|
63 |
|
64 |
wp_enqueue_script( 'mashsb', $js_dir . 'mashsb' . $suffix . '.js', array('jquery'), MASHSB_VERSION, $in_footer );
|
65 |
//wp_enqueue_script( 'element-queries', $js_dir . 'ElementQueries' . '.js', array('jquery'), MASHSB_VERSION, $in_footer );
|
|
|
66 |
|
67 |
!isset( $mashsb_options['disable_sharecount'] ) ? $shareresult = getSharedcount( $url ) : $shareresult = 0;
|
68 |
wp_localize_script( 'mashsb', 'mashsb', array(
|
includes/template-functions.php
CHANGED
@@ -445,8 +445,8 @@ function mashsb_getNetworks( $is_shortcode = false, $services = 0 ) {
|
|
445 |
/* our list of available services, includes the disabled ones!
|
446 |
* We have to clean this array first!
|
447 |
*/
|
448 |
-
|
449 |
-
|
450 |
|
451 |
/* Delete disabled services from array. Use callback function here. Do this only once because array_filter is slow!
|
452 |
* Use the newly created array and bypass the callback function
|
@@ -483,7 +483,7 @@ function mashsb_getNetworks( $is_shortcode = false, $services = 0 ) {
|
|
483 |
$endsecondaryshares = '';
|
484 |
}
|
485 |
}
|
486 |
-
|
487 |
if( isset($enablednetworks[$key]['name']) && !empty($enablednetworks[$key]['name']) ) {
|
488 |
/* replace all spaces with $nbsp; This prevents error in css style content: text-intend */
|
489 |
$name = preg_replace( '/\040{1,}/', ' ', $enablednetworks[$key]['name'] ); // The custom share label
|
@@ -1154,6 +1154,8 @@ function mashsb_get_document_title() {
|
|
1154 |
*
|
1155 |
* @param string $title The document title. Default empty string.
|
1156 |
*/
|
|
|
|
|
1157 |
|
1158 |
// If it's a 404 page, use a "Page not found" title.
|
1159 |
if( is_404() ) {
|
445 |
/* our list of available services, includes the disabled ones!
|
446 |
* We have to clean this array first!
|
447 |
*/
|
448 |
+
//$getnetworks = isset( $mashsb_options['networks'] ) ? $mashsb_options['networks'] : '';
|
449 |
+
$getnetworks = isset( $mashsb_options['networks'] ) ? apply_filters('mashsb_filter_networks', $mashsb_options['networks']) : apply_filters('mashsb_filter_networks', '');
|
450 |
|
451 |
/* Delete disabled services from array. Use callback function here. Do this only once because array_filter is slow!
|
452 |
* Use the newly created array and bypass the callback function
|
483 |
$endsecondaryshares = '';
|
484 |
}
|
485 |
}
|
486 |
+
|
487 |
if( isset($enablednetworks[$key]['name']) && !empty($enablednetworks[$key]['name']) ) {
|
488 |
/* replace all spaces with $nbsp; This prevents error in css style content: text-intend */
|
489 |
$name = preg_replace( '/\040{1,}/', ' ', $enablednetworks[$key]['name'] ); // The custom share label
|
1154 |
*
|
1155 |
* @param string $title The document title. Default empty string.
|
1156 |
*/
|
1157 |
+
|
1158 |
+
$title = '';
|
1159 |
|
1160 |
// If it's a 404 page, use a "Page not found" title.
|
1161 |
if( is_404() ) {
|
mashshare.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* Description: Mashshare is a Share functionality inspired by the the great website Mashable for Facebook and Twitter. More networks available.
|
7 |
* Author: René Hermenau
|
8 |
* Author URI: https://www.mashshare.net
|
9 |
-
* Version: 3.4.
|
10 |
* Text Domain: mashsb
|
11 |
* Domain Path: /languages
|
12 |
* Credits: Thanks go to Pippin Williamson and the edd team. When we started with Mashshare we decided to use the EDD code base and
|
@@ -37,7 +37,7 @@ if( !defined( 'ABSPATH' ) )
|
|
37 |
|
38 |
// Plugin version
|
39 |
if( !defined( 'MASHSB_VERSION' ) ) {
|
40 |
-
define( 'MASHSB_VERSION', '3.4.
|
41 |
}
|
42 |
|
43 |
// Debug mode
|
6 |
* Description: Mashshare is a Share functionality inspired by the the great website Mashable for Facebook and Twitter. More networks available.
|
7 |
* Author: René Hermenau
|
8 |
* Author URI: https://www.mashshare.net
|
9 |
+
* Version: 3.4.5
|
10 |
* Text Domain: mashsb
|
11 |
* Domain Path: /languages
|
12 |
* Credits: Thanks go to Pippin Williamson and the edd team. When we started with Mashshare we decided to use the EDD code base and
|
37 |
|
38 |
// Plugin version
|
39 |
if( !defined( 'MASHSB_VERSION' ) ) {
|
40 |
+
define( 'MASHSB_VERSION', '3.4.5' );
|
41 |
}
|
42 |
|
43 |
// Debug mode
|
readme.txt
CHANGED
@@ -8,8 +8,8 @@ License: GPLv2 or later
|
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email
|
10 |
Requires at least: 3.6+
|
11 |
-
Tested up to: 4.
|
12 |
-
Stable tag: 3.4.
|
13 |
|
14 |
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
|
15 |
|
@@ -246,6 +246,29 @@ Read here more about this: http://docs.mashshare.net/article/10-facebook-is-show
|
|
246 |
|
247 |
== Changelog ==
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
= 3.4.1 =
|
250 |
* Cleaning up readme.txt. MashShare plugin has been disabled on wordpress.org for using too many keywords and a few other issues with its readme.txt
|
251 |
|
@@ -263,5 +286,5 @@ https://www.mashshare.net/changelog/
|
|
263 |
|
264 |
== Upgrade Notice ==
|
265 |
|
266 |
-
= 3.
|
267 |
-
3.1.9
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Tags: Share buttons, Social Sharing, social media, Facebook, Twitter, Subscribe, Traffic posts, pages, widget, social share buttons, analytics, email
|
10 |
Requires at least: 3.6+
|
11 |
+
Tested up to: 4.8
|
12 |
+
Stable tag: 3.4.5
|
13 |
|
14 |
Social Media Share Buttons for Twitter, Facebook and other social networks. Highly customizable Social Media ecosystem
|
15 |
|
246 |
|
247 |
== Changelog ==
|
248 |
|
249 |
+
= 3.4.5 =
|
250 |
+
* New: Create custom values for open graph meta tag og:type, e.g video, product
|
251 |
+
* Fix: undefined var title
|
252 |
+
* Fix: Pinterest popup not opening when network add-on is not installed
|
253 |
+
* Fix: Remove deprecated code and make mashsb.js smaller
|
254 |
+
* Fix: Facebook access token validation function not working
|
255 |
+
|
256 |
+
= 3.4.4 =
|
257 |
+
* Fix: Check fb access token not working properly
|
258 |
+
|
259 |
+
= 3.4.3 =
|
260 |
+
* Fix: Facebook and twitter buttons missing on multisite activations when bimber theme is used
|
261 |
+
* Fix: Whatsapp button not shown on sticky sharebar add-on when network add-on is not installed
|
262 |
+
* Tweak: Return a more clear error notice when access token is not valid.
|
263 |
+
|
264 |
+
= 3.4.2 =
|
265 |
+
* Tweak: Better admin descriptions
|
266 |
+
* New: Tested up to WP 4.8
|
267 |
+
|
268 |
+
= 3.4.1 =
|
269 |
+
* New: Support for PHPUnit 6
|
270 |
+
* Fix: Move invisible sub menus from dashboard to MashShare menu section to prevent confusion if a plugin like Menu Editor Pro is active which makes even invisible menu entries visible
|
271 |
+
|
272 |
= 3.4.1 =
|
273 |
* Cleaning up readme.txt. MashShare plugin has been disabled on wordpress.org for using too many keywords and a few other issues with its readme.txt
|
274 |
|
286 |
|
287 |
== Upgrade Notice ==
|
288 |
|
289 |
+
= 3.4.4 =
|
290 |
+
3.1.9 * Fix: Check fb access token not working properly
|