Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | Popup Maker – Popup Forms, Optins & More |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- assets/images/admin/dashboard-icon-green.png +0 -0
- assets/images/admin/dashboard-icon.png +0 -0
- assets/images/admin/icon-advanced-theme-builder.png +0 -0
- assets/images/admin/icon-info-21x21.png +0 -0
- assets/images/admin/icon-unlimited-themes.png +0 -0
- assets/images/admin/knowledge-base.png +0 -0
- assets/images/admin/member-forums.png +0 -0
- assets/images/admin/newsletter-banner.png +0 -0
- assets/images/admin/popup-maker-icon.png +0 -0
- assets/images/admin/powered-by-popup-maker.png +0 -0
- assets/images/admin/wordpress-forums.png +0 -0
- assets/images/extensions/advanced-theme-builder.jpg +0 -0
- assets/images/extensions/age-verification-modals.jpg +0 -0
- assets/images/extensions/ajax-login-modals.jpg +0 -0
- assets/images/extensions/auto-open-popups.jpg +0 -0
- assets/images/extensions/exit-intent-popups.jpg +0 -0
- assets/images/extensions/forced-interaction.jpg +0 -0
- assets/images/extensions/popup-analytics.jpg +0 -0
- assets/images/extensions/priority-support.jpg +0 -0
- assets/images/extensions/scroll-triggered-popups.jpg +0 -0
- assets/images/extensions/unlimited-themes.jpg +0 -0
- assets/images/welcome/cf7.jpg +0 -0
- assets/images/welcome/easy-theme-builder.png +0 -0
- assets/images/welcome/getting-started-1.jpg +0 -0
- assets/images/welcome/gravity.jpg +0 -0
- assets/images/welcome/logo.png +0 -0
- assets/images/welcome/mailchimp.jpg +0 -0
- assets/images/welcome/ninja.jpg +0 -0
- assets/images/welcome/targeting-conditions.png +0 -0
- assets/scripts/gsap/TimelineLite.min.js +12 -0
- assets/scripts/gsap/TimelineMax.min.js +12 -0
- assets/scripts/gsap/TweenLite.min.js +12 -0
- assets/scripts/gsap/TweenMax.min.js +17 -0
- assets/scripts/gsap/jquery.gsap.min.js +14 -0
- assets/scripts/jquery.cookie.js +117 -0
- assets/scripts/jquery.cookie.min.js +1 -0
- assets/scripts/popup-maker-admin.js +955 -0
- assets/scripts/popup-maker-admin.min.js +1 -0
- assets/scripts/popup-maker-site.js +1013 -0
- assets/scripts/popup-maker-site.min.js +4 -0
- assets/styles/popup-maker-admin.css +415 -0
- assets/styles/popup-maker-admin.min.css +1 -0
- assets/styles/popup-maker-site.css +125 -0
- assets/styles/popup-maker-site.min.css +1 -0
- contributors.txt +1 -0
- includes/admin/admin-functions.php +39 -0
- includes/admin/admin-notices.php +35 -0
- includes/admin/admin-pages.php +205 -0
- includes/admin/admin-setup.php +49 -0
- includes/admin/extensions/extensions-page.php +124 -0
- includes/admin/help/help-page.php +54 -0
- includes/admin/metabox-share.php +57 -0
- includes/admin/metabox-support.php +44 -0
- includes/admin/popups/dashboard-columns.php +256 -0
- includes/admin/popups/metabox-close-fields.php +41 -0
- includes/admin/popups/metabox-display-fields.php +318 -0
- includes/admin/popups/metabox-loading-fields.php +134 -0
- includes/admin/popups/metabox.php +349 -0
- includes/admin/popups/post-type-item-metaboxes.php +438 -0
- includes/admin/post-editor.php +31 -0
- includes/admin/settings/register-settings.php +781 -0
- includes/admin/settings/settings-page.php +98 -0
- includes/admin/themes/metabox-close-fields.php +556 -0
- includes/admin/themes/metabox-container-fields.php +261 -0
- includes/admin/themes/metabox-content-fields.php +73 -0
- includes/admin/themes/metabox-overlay-fields.php +47 -0
- includes/admin/themes/metabox-preview.php +7 -0
- includes/admin/themes/metabox-title-fields.php +204 -0
- includes/admin/themes/metabox.php +435 -0
- includes/admin/welcome.php +52 -0
- includes/admin/welcome/about.php +97 -0
- includes/admin/welcome/changelog.php +46 -0
- includes/admin/welcome/credits.php +28 -0
- includes/admin/welcome/getting-started.php +134 -0
- includes/ajax-calls.php +24 -0
- includes/defaults.php +150 -0
- includes/extensions-functions.php +37 -0
- includes/general-functions.php +167 -0
- includes/google-fonts.php +49 -0
- includes/input-options.php +167 -0
- includes/install.php +127 -0
- includes/integrations/google-fonts.php +40 -0
- includes/integrations/gravityforms.php +14 -0
- includes/license-handler.php +247 -0
- includes/load-popups.php +87 -0
- includes/plugin-updater.php +168 -0
- includes/popup-functions.php +402 -0
- includes/post-types.php +283 -0
- includes/scripts.php +131 -0
- includes/shortcodes.php +84 -0
- includes/templates.php +109 -0
- includes/theme-functions.php +170 -0
- popup-maker.php +287 -0
- readme.txt +67 -0
- templates/popup.php +18 -0
assets/images/admin/dashboard-icon-green.png
ADDED
Binary file
|
assets/images/admin/dashboard-icon.png
ADDED
Binary file
|
assets/images/admin/icon-advanced-theme-builder.png
ADDED
Binary file
|
assets/images/admin/icon-info-21x21.png
ADDED
Binary file
|
assets/images/admin/icon-unlimited-themes.png
ADDED
Binary file
|
assets/images/admin/knowledge-base.png
ADDED
Binary file
|
assets/images/admin/member-forums.png
ADDED
Binary file
|
assets/images/admin/newsletter-banner.png
ADDED
Binary file
|
assets/images/admin/popup-maker-icon.png
ADDED
Binary file
|
assets/images/admin/powered-by-popup-maker.png
ADDED
Binary file
|
assets/images/admin/wordpress-forums.png
ADDED
Binary file
|
assets/images/extensions/advanced-theme-builder.jpg
ADDED
Binary file
|
assets/images/extensions/age-verification-modals.jpg
ADDED
Binary file
|
assets/images/extensions/ajax-login-modals.jpg
ADDED
Binary file
|
assets/images/extensions/auto-open-popups.jpg
ADDED
Binary file
|
assets/images/extensions/exit-intent-popups.jpg
ADDED
Binary file
|
assets/images/extensions/forced-interaction.jpg
ADDED
Binary file
|
assets/images/extensions/popup-analytics.jpg
ADDED
Binary file
|
assets/images/extensions/priority-support.jpg
ADDED
Binary file
|
assets/images/extensions/scroll-triggered-popups.jpg
ADDED
Binary file
|
assets/images/extensions/unlimited-themes.jpg
ADDED
Binary file
|
assets/images/welcome/cf7.jpg
ADDED
Binary file
|
assets/images/welcome/easy-theme-builder.png
ADDED
Binary file
|
assets/images/welcome/getting-started-1.jpg
ADDED
Binary file
|
assets/images/welcome/gravity.jpg
ADDED
Binary file
|
assets/images/welcome/logo.png
ADDED
Binary file
|
assets/images/welcome/mailchimp.jpg
ADDED
Binary file
|
assets/images/welcome/ninja.jpg
ADDED
Binary file
|
assets/images/welcome/targeting-conditions.png
ADDED
Binary file
|
assets/scripts/gsap/TimelineLite.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* VERSION: 1.14.2
|
3 |
+
* DATE: 2014-10-18
|
4 |
+
* UPDATES AND DOCS AT: http://www.greensock.com
|
5 |
+
*
|
6 |
+
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
7 |
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
8 |
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
9 |
+
*
|
10 |
+
* @author: Jack Doyle, jack@greensock.com
|
11 |
+
*/
|
12 |
+
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],o(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));o(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals,a=n.isSelector,o=n.isArray,h=n.lazyTweens,l=n.lazyRender,_=[],u=_gsScope._gsDefine.globals,c=function(t){var e,i={};for(e in t)i[e]=t[e];return i},p=function(t,e,i,s){var r=t._timeline._totalTime;(e||!this._forcingPlayhead)&&(t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||_),this._forcingPlayhead&&t._timeline.seek(r))},f=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=s.prototype=new e;return s.version="1.14.2",m.constructor=s,m.kill()._gc=m._forcingPlayhead=!1,m.to=function(t,e,s,r){var n=s.repeat&&u.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},m.from=function(t,e,s,r){return this.add((s.repeat&&u.TweenMax||i).from(t,e,s),r)},m.fromTo=function(t,e,s,r,n){var a=r.repeat&&u.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},m.staggerTo=function(t,e,r,n,o,h,l,_){var u,p=new s({onComplete:h,onCompleteParams:l,onCompleteScope:_,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),t=t||[],a(t)&&(t=f(t)),n=n||0,0>n&&(t=f(t),t.reverse(),n*=-1),u=0;t.length>u;u++)r.startAt&&(r.startAt=c(r.startAt)),p.to(t[u],e,c(r),u*n);return this.add(p,o)},m.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},m.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},m.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},m.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},m.add=function(r,n,a,h){var l,_,u,c,p,f;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&o(r)){for(a=a||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)o(c=r[u])&&(c=new s({tweens:c})),this.add(c,l),"string"!=typeof c&&"function"!=typeof c&&("sequence"===a?l=c._startTime+c.totalDuration()/c._timeScale:"start"===a&&(c._startTime-=c.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(p=this,f=p.rawTime()>r._startTime;p._timeline;)f&&p._timeline.smoothChildTiming?p.totalTime(p._totalTime,!0):p._gc&&p._enabled(!0,!1),p=p._timeline;return this},m.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&o(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},m._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},m.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},m.insert=m.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},m.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},m.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},m.addPause=function(t,e,i,s){return this.call(p,["{self}",e,i,s],this,t)},m.removeLabel=function(t){return delete this._labels[t],this},m.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},m._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&o(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},m.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},m.stop=function(){return this.paused(!0)},m.gotoAndPlay=function(t,e){return this.play(t,e)},m.gotoAndStop=function(t,e){return this.pause(t,e)},m.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,o,u,c=this._dirty?this.totalDuration():this._totalDuration,p=this._time,f=this._startTime,m=this._timeScale,d=this._paused;if(t>=c?(this._totalTime=this._time=c,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(u=!0,this._rawPrevTime>r&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=c+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==p||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(o="onReverseComplete",n=this._reversed),0>t?(this._active=!1,this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==p&&this._first||i||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==p&&t>0&&(this._active=!0),0===p&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_)),this._time>=p)for(s=this._first;s&&(a=s._next,!this._paused||d);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||d);)(s._active||p>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||(h.length&&l(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_))),o&&(this._gc||(f===this._startTime||m!==this._timeScale)&&(0===this._time||c>=this.totalDuration())&&(n&&(h.length&&l(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this.vars[o].apply(this.vars[o+"Scope"]||this,this.vars[o+"Params"]||_)))}},m._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},m.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},m.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},m.recent=function(){return this._recent},m._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},m.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},m._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},m.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},m.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},m._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},m.totalTime=function(){this._forcingPlayhead=!0;var e=t.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},m.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},m.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},m.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},m.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t){"use strict";var e=function(){return(_gsScope.GreenSockGlobals||_gsScope)[t]};"function"==typeof define&&define.amd?define(["TweenLite"],e):"undefined"!=typeof module&&module.exports&&(require("./TweenLite.js"),module.exports=e())}("TimelineLite");
|
assets/scripts/gsap/TimelineMax.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* VERSION: 1.14.2
|
3 |
+
* DATE: 2014-10-18
|
4 |
+
* UPDATES AND DOCS AT: http://www.greensock.com
|
5 |
+
*
|
6 |
+
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
7 |
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
8 |
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
9 |
+
*
|
10 |
+
* @author: Jack Doyle, jack@greensock.com
|
11 |
+
*/
|
12 |
+
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=e._internals,o=a.lazyTweens,h=a.lazyRender,l=new i(null,null,1,0),_=s.prototype=new t;return _.constructor=s,_.kill()._gc=!1,s.version="1.14.2",_.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},_.addCallback=function(t,i,s,r){return this.add(e.delayedCall(0,t,s,r),i)},_.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);--s>-1;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},_.tweenTo=function(t,i){i=i||{};var s,r,a,o={ease:l,overwrite:i.delay?2:1,useFrames:this.usesFrames(),immediateRender:!1};for(r in i)o[r]=i[r];return o.time=this._parseTimeOrLabel(t),s=Math.abs(Number(o.time)-this._time)/this._timeScale||.001,a=new e(this,s,o),o.onStart=function(){a.target.paused(!0),a.vars.time!==a.target.time()&&s===a.duration()&&a.duration(Math.abs(a.vars.time-a.target.time())/a.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||a,i.onStartParams||n)},a},_.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],onCompleteScope:this},i.immediateRender=i.immediateRender!==!1;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},_.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,l,_,u,c,f=this._dirty?this.totalDuration():this._totalDuration,p=this._duration,m=this._time,d=this._totalTime,g=this._startTime,v=this._timeScale,y=this._rawPrevTime,T=this._paused,w=this._cycle;if(t>=f?(this._locked||(this._totalTime=f,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(a=!0,_="onComplete",0===this._duration&&(0===t||0>y||y===r)&&y!==t&&this._first&&(u=!0,y>r&&(_="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=p,t=p+1e-4)):1e-7>t?(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==m||0===p&&y!==r&&(y>0||0>t&&y>=0)&&!this._locked)&&(_="onReverseComplete",a=this._reversed),0>t?(this._active=!1,y>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=p||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):(0===p&&0>y&&(u=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(c=p+this._repeatDelay,this._cycle=this._totalTime/c>>0,0!==this._cycle&&this._cycle===this._totalTime/c&&this._cycle--,this._time=this._totalTime-this._cycle*c,this._yoyo&&0!==(1&this._cycle)&&(this._time=p-this._time),this._time>p?(this._time=p,t=p+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==w&&!this._locked){var b=this._yoyo&&0!==(1&w),x=b===(this._yoyo&&0!==(1&this._cycle)),P=this._totalTime,S=this._cycle,k=this._rawPrevTime,R=this._time;if(this._totalTime=w*p,w>this._cycle?b=!b:this._totalTime+=p,this._time=m,this._rawPrevTime=0===p?y-1e-4:y,this._cycle=w,this._locked=!0,m=b?0:p,this.render(m,e,0===p),e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||n),x&&(m=b?p+1e-4:-1e-4,this.render(m,!0,!1)),this._locked=!1,this._paused&&!T)return;this._time=R,this._totalTime=P,this._cycle=S,this._rawPrevTime=k}if(!(this._time!==m&&this._first||i||u))return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==d&&t>0&&(this._active=!0),0===d&&this.vars.onStart&&0!==this._totalTime&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||n)),this._time>=m)for(s=this._first;s&&(l=s._next,!this._paused||T);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;else for(s=this._last;s&&(l=s._prev,!this._paused||T);)(s._active||m>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;this._onUpdate&&(e||(o.length&&h(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n))),_&&(this._locked||this._gc||(g===this._startTime||v!==this._timeScale)&&(0===this._time||f>=this.totalDuration())&&(a&&(o.length&&h(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[_]&&this.vars[_].apply(this.vars[_+"Scope"]||this,this.vars[_+"Params"]||n)))},_.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isActive()&&(n[o++]=r);return n},_.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},_.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},_.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},_.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()},_.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()},_.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},_.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},_.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},_.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},_.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},_.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},s},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],o(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));o(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals,a=n.isSelector,o=n.isArray,h=n.lazyTweens,l=n.lazyRender,_=[],u=_gsScope._gsDefine.globals,c=function(t){var e,i={};for(e in t)i[e]=t[e];return i},f=function(t,e,i,s){var r=t._timeline._totalTime;(e||!this._forcingPlayhead)&&(t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||_),this._forcingPlayhead&&t._timeline.seek(r))},p=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=s.prototype=new e;return s.version="1.14.2",m.constructor=s,m.kill()._gc=m._forcingPlayhead=!1,m.to=function(t,e,s,r){var n=s.repeat&&u.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},m.from=function(t,e,s,r){return this.add((s.repeat&&u.TweenMax||i).from(t,e,s),r)},m.fromTo=function(t,e,s,r,n){var a=r.repeat&&u.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},m.staggerTo=function(t,e,r,n,o,h,l,_){var u,f=new s({onComplete:h,onCompleteParams:l,onCompleteScope:_,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),a(t)&&(t=p(t)),n=n||0,0>n&&(t=p(t),t.reverse(),n*=-1),u=0;t.length>u;u++)r.startAt&&(r.startAt=c(r.startAt)),f.to(t[u],e,c(r),u*n);return this.add(f,o)},m.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},m.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},m.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},m.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},m.add=function(r,n,a,h){var l,_,u,c,f,p;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&o(r)){for(a=a||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)o(c=r[u])&&(c=new s({tweens:c})),this.add(c,l),"string"!=typeof c&&"function"!=typeof c&&("sequence"===a?l=c._startTime+c.totalDuration()/c._timeScale:"start"===a&&(c._startTime-=c.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(f=this,p=f.rawTime()>r._startTime;f._timeline;)p&&f._timeline.smoothChildTiming?f.totalTime(f._totalTime,!0):f._gc&&f._enabled(!0,!1),f=f._timeline;return this},m.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&o(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},m._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},m.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},m.insert=m.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},m.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},m.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},m.addPause=function(t,e,i,s){return this.call(f,["{self}",e,i,s],this,t)},m.removeLabel=function(t){return delete this._labels[t],this},m.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},m._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&o(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},m.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},m.stop=function(){return this.paused(!0)},m.gotoAndPlay=function(t,e){return this.play(t,e)},m.gotoAndStop=function(t,e){return this.pause(t,e)},m.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,o,u,c=this._dirty?this.totalDuration():this._totalDuration,f=this._time,p=this._startTime,m=this._timeScale,d=this._paused;if(t>=c?(this._totalTime=this._time=c,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(u=!0,this._rawPrevTime>r&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=c+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==f||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(o="onReverseComplete",n=this._reversed),0>t?(this._active=!1,this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==f&&this._first||i||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==f&&t>0&&(this._active=!0),0===f&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_)),this._time>=f)for(s=this._first;s&&(a=s._next,!this._paused||d);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||d);)(s._active||f>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||(h.length&&l(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_))),o&&(this._gc||(p===this._startTime||m!==this._timeScale)&&(0===this._time||c>=this.totalDuration())&&(n&&(h.length&&l(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this.vars[o].apply(this.vars[o+"Scope"]||this,this.vars[o+"Params"]||_)))}},m._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},m.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},m.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},m.recent=function(){return this._recent},m._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},m.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},m._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},m.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},m.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},m._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},m.totalTime=function(){this._forcingPlayhead=!0;var e=t.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},m.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},m.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},m.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},m.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t){"use strict";var e=function(){return(_gsScope.GreenSockGlobals||_gsScope)[t]};"function"==typeof define&&define.amd?define(["TweenLite"],e):"undefined"!=typeof module&&module.exports&&(require("./TweenLite.js"),module.exports=e())}("TimelineMax");
|
assets/scripts/gsap/TweenLite.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* VERSION: 1.14.2
|
3 |
+
* DATE: 2014-10-28
|
4 |
+
* UPDATES AND DOCS AT: http://www.greensock.com
|
5 |
+
*
|
6 |
+
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
7 |
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
8 |
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
9 |
+
*
|
10 |
+
* @author: Jack Doyle, jack@greensock.com
|
11 |
+
*/
|
12 |
+
(function(t,e){"use strict";var i=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!i.TweenLite){var s,r,n,a,o,l=function(t){var e,s=t.split("."),r=i;for(e=0;s.length>e;e++)r[s[e]]=r=r[s[e]]||{};return r},h=l("com.greensock"),_=1e-10,u=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=function(){},f=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),c={},p=function(s,r,n,a){this.sc=c[s]?c[s].sc:[],c[s]=this,this.gsClass=null,this.func=n;var o=[];this.check=function(h){for(var _,u,m,f,d=r.length,v=d;--d>-1;)(_=c[r[d]]||new p(r[d],[])).gsClass?(o[d]=_.gsClass,v--):h&&_.sc.push(this);if(0===v&&n)for(u=("com.greensock."+s).split("."),m=u.pop(),f=l(u.join("."))[m]=this.gsClass=n.apply(n,o),a&&(i[m]=f,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return f}):s===e&&"undefined"!=typeof module&&module.exports&&(module.exports=f)),d=0;this.sc.length>d;d++)this.sc[d].check()},this.check(!0)},d=t._gsDefine=function(t,e,i,s){return new p(t,e,i,s)},v=h._class=function(t,e,i){return e=e||function(){},d(t,[],function(){return e},i),e};d.globals=i;var g=[0,0,1,1],T=[],y=v("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?g.concat(e):g},!0),w=y.map={},P=y.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),_=l.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=l[_],r=s?v("easing."+n,null,!0):h.easing[n]||{},a=u.length;--a>-1;)o=u[a],w[n+"."+o]=w[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(n=y.prototype,n._calcEnd=!1,n.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},s=["Linear","Quad","Cubic","Quart","Quint,Strong"],r=s.length;--r>-1;)n=s[r]+",Power"+r,P(new y(null,null,1,r),n,"easeOut",!0),P(new y(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),P(new y(null,null,3,r),n,"easeInOut");w.linear=h.easing.Linear.easeIn,w.swing=h.easing.Quad.easeInOut;var b=v("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});n=b.prototype,n.addEventListener=function(t,e,i,s,r){r=r||0;var n,l,h=this._listeners[t],_=0;for(null==h&&(this._listeners[t]=h=[]),l=h.length;--l>-1;)n=h[l],n.c===e&&n.s===i?h.splice(l,1):0===_&&r>n.pr&&(_=l+1);h.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==a||o||a.wake()},n.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},n.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s&&(s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i))};var k=t.requestAnimationFrame,A=t.cancelAnimationFrame,S=Date.now||function(){return(new Date).getTime()},x=S();for(s=["ms","moz","webkit","o"],r=s.length;--r>-1&&!k;)k=t[s[r]+"RequestAnimationFrame"],A=t[s[r]+"CancelAnimationFrame"]||t[s[r]+"CancelRequestAnimationFrame"];v("Ticker",function(t,e){var i,s,r,n,l,h=this,u=S(),f=e!==!1&&k,c=500,p=33,d=function(t){var e,a,o=S()-x;o>c&&(u+=o-p),x+=o,h.time=(x-u)/1e3,e=h.time-l,(!i||e>0||t===!0)&&(h.frame++,l+=e+(e>=n?.004:n-e),a=!0),t!==!0&&(r=s(d)),a&&h.dispatchEvent("tick")};b.call(h),h.time=h.frame=0,h.tick=function(){d(!0)},h.lagSmoothing=function(t,e){c=t||1/_,p=Math.min(e,c,0)},h.sleep=function(){null!=r&&(f&&A?A(r):clearTimeout(r),s=m,r=null,h===a&&(o=!1))},h.wake=function(){null!==r?h.sleep():h.frame>10&&(x=S()-c+5),s=0===i?m:f&&k?k:function(t){return setTimeout(t,0|1e3*(l-h.time)+1)},h===a&&(o=!0),d(2)},h.fps=function(t){return arguments.length?(i=t,n=1/(i||60),l=this.time+n,h.wake(),void 0):i},h.useRAF=function(t){return arguments.length?(h.sleep(),f=t,h.fps(i),void 0):f},h.fps(t),setTimeout(function(){f&&(!r||5>h.frame)&&h.useRAF(!1)},1500)}),n=h.Ticker.prototype=new h.events.EventDispatcher,n.constructor=h.Ticker;var R=v("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,B){o||a.wake();var i=this.vars.useFrames?q:B;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});a=R.ticker=new h.Ticker,n=R.prototype,n._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var C=function(){o&&S()-x>2e3&&a.wake(),setTimeout(C,2e3)};C(),n.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},n.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},n.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},n.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},n.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},n.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},n.render=function(){},n.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},n.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},n._enabled=function(t,e){return o||a.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(){return this._enabled(!1,!1)},n.kill=function(t,e){return this._kill(t,e),this},n._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},n._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},n.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=f(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},n.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},n.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},n.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},n.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(o||a.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(this.render(t,e,!1),z.length&&M())}return this},n.progress=n.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},n.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},n.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},n.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||_,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},n.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){o||t||a.wake();var e=this._timeline,i=e.rawTime(),s=i-this._pauseTime;!t&&e.smoothChildTiming&&(this._startTime+=s,this._uncache(!1)),this._pauseTime=t?i:null,this._paused=t,this._active=this.isActive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothChildTiming?this._totalTime:(i-this._startTime)/this._timeScale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var D=v("core.SimpleTimeline",function(t){R.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});n=D.prototype=new R,n.constructor=D,n.kill()._gc=!1,n._first=n._last=n._recent=null,n._sortChildren=!1,n.add=n.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},n.rawTime=function(){return o||a.wake(),this._totalTime};var I=v("TweenLite",function(e,i,s){if(R.call(this,i,s),this.render=I.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:I.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),l=this.vars.overwrite;if(this._overwrite=l=null==l?Q[I.defaultOverwrite]:"number"==typeof l?l>>0:Q[l],(o||e instanceof Array||e.push&&f(e))&&"number"!=typeof e[0])for(this._targets=a=u(e),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(u(n))):(this._siblings[r]=$(n,this,!1),1===l&&this._siblings[r].length>1&&H(n,this,null,1,this._siblings[r])):(n=a[r--]=I.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=$(e,this,!1),1===l&&this._siblings.length>1&&H(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-_,this.render(-this._delay))},!0),E=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},O=function(t,e){var i,s={};for(i in t)G[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!U[i]||U[i]&&U[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};n=I.prototype=new R,n.constructor=I,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,I.version="1.14.2",I.defaultEase=n._ease=new y(null,null,1,1),I.defaultOverwrite="auto",I.ticker=a,I.autoSleep=!0,I.lagSmoothing=function(t,e){a.lagSmoothing(t,e)},I.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(I.selector=i,i(e)):"undefined"==typeof document?e:document.querySelectorAll?document.querySelectorAll(e):document.getElementById("#"===e.charAt(0)?e.substr(1):e)};var z=[],L={},N=I._internals={isArray:f,isSelector:E,lazyTweens:z},U=I._plugins={},F=N.tweenLookup={},j=0,G=N.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1},Q={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},q=R._rootFramesTimeline=new D,B=R._rootTimeline=new D,M=N.lazyRender=function(){var t,e=z.length;for(L={};--e>-1;)t=z[e],t&&t._lazy!==!1&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);z.length=0};B._startTime=a.time,q._startTime=a.frame,B._active=q._active=!0,setTimeout(M,1),R._updateRoot=I.render=function(){var t,e,i;if(z.length&&M(),B.render((a.time-B._startTime)*B._timeScale,!1,!1),q.render((a.frame-q._startTime)*q._timeScale,!1,!1),z.length&&M(),!(a.frame%120)){for(i in F){for(e=F[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete F[i]}if(i=B._first,(!i||i._paused)&&I.autoSleep&&!q._first&&1===a._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||a.sleep()}}},a.addEventListener("tick",R._updateRoot);var $=function(t,e,i){var s,r,n=t._gsTweenID;if(F[n||(t._gsTweenID=n="t"+j++)]||(F[n]={target:t,tweens:[]}),e&&(s=F[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return F[n].tweens},K=function(t,e,i,s){var r,n,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,s)),a=I.onOverwrite,a&&(n=a(t,e,i,s)),r!==!1&&n!==!1},H=function(t,e,i,s,r){var n,a,o,l;if(1===s||s>=4){for(l=r.length,n=0;l>n;n++)if((o=r[n])!==e)o._gc||K(o,e)&&o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var h,u=e._startTime+_,m=[],f=0,c=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(h=h||J(e,0,c),0===J(o,h,c)&&(m[f++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((c||!o._initted)&&2e-10>=u-o._startTime||(m[f++]=o)));for(n=f;--n>-1;)if(o=m[n],2===s&&o._kill(i,t,e)&&(a=!0),2!==s||!o._firstPT&&o._initted){if(2!==s&&!K(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},J=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*_>n-e?_:(n+=t.totalDuration()/t._timeScale/r)>e+_?0:n-e-_};n._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,l=!!n.immediateRender,h=n.ease;if(n.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(s in n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=l&&n.lazy!==!1,r.startAt=r.delay=null,this._startAt=I.to(this.target,0,r),l)if(this._time>0)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(l=!1),i={};for(s in n)G[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=l&&n.lazy!==!1,i.immediateRender=l,this._startAt=I.to(this.target,0,i),l){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=h=h?h instanceof y?h:"function"==typeof h?new y(h,n.easeParams):w[h]||I.defaultEase:I.defaultEase,n.easeParams instanceof Array&&h.config&&(this._ease=h.config.apply(h,n.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&I._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0},n._initProps=function(e,i,s,r){var n,a,o,l,h,_;if(null==e)return!1;L[e._gsTweenID]&&M(),this.vars.css||e.style&&e!==t&&e.nodeType&&U.css&&this.vars.autoCSS!==!1&&O(this.vars,e);for(n in this.vars){if(_=this.vars[n],G[n])_&&(_ instanceof Array||_.push&&f(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(U[n]&&(l=new U[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=h={_next:this._firstPT,t:l,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:l._priority},a=l._overwriteProps.length;--a>-1;)i[l._overwriteProps[a]]=this._firstPT;(l._priority||l._onInitAllProps)&&(o=!0),(l._onDisable||l._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=h={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},h.s=h.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),h.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-h.s||0;h&&h._next&&(h._next._prev=h)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&H(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(L[e._gsTweenID]=!0),o)},n.render=function(t,e,i){var s,r,n,a,o=this._time,l=this._duration,h=this._rawPrevTime;if(t>=l)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete"),0===l&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>h||h===_)&&h!==t&&(i=!0,h>_&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||h===t?t:_);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===l&&h>0&&h!==_)&&(r="onReverseComplete",s=this._reversed),0>t&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||i)&&(h>=0&&(i=!0),this._rawPrevTime=a=!e||t||h===t?t:_)),this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var u=t/l,m=this._easeType,f=this._easePower;(1===m||3===m&&u>=.5)&&(u=1-u),3===m&&(u*=2),1===f?u*=u:2===f?u*=u*u:3===f?u*=u*u*u:4===f&&(u*=u*u*u*u),this.ratio=1===m?1-u:2===m?u:.5>t/l?u/2:1-u/2}else this.ratio=this._ease.getRatio(t/l);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=h,z.push(this),this._lazy=[t,e],void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/l):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===l)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||T))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&t!==-1e-4&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||T)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&t!==-1e-4&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||T),0===l&&this._rawPrevTime===_&&a!==_&&(this._rawPrevTime=0))}},n._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:I.selector(e)||e;var s,r,n,a,o,l,h,_,u;if((f(e)||E(e))&&"number"!=typeof e[0])for(s=e.length;--s>-1;)this._kill(t,e[s])&&(l=!0);else{if(this._targets){for(s=this._targets.length;--s>-1;)if(e===this._targets[s]){o=this._propLookup[s]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[s]=t?this._overwrittenProps[s]||{}:"all";break}}else{if(e!==this.target)return!1;o=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(o){if(h=t||o,_=t!==r&&"all"!==r&&t!==o&&("object"!=typeof t||!t._tempKill),i&&(I.onOverwrite||this.vars.onOverwrite)){for(n in h)o[n]&&(u||(u=[]),u.push(n));if(!K(this,i,e,u))return!1}for(n in h)(a=o[n])&&(a.pg&&a.t._kill(h)&&(l=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete o[n]),_&&(r[n]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},n.invalidate=function(){return this._notifyPluginsOfEnabled&&I._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],R.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-_,this.render(-this._delay)),this},n._enabled=function(t,e){if(o||a.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=$(s[i],this,!0);else this._siblings=$(this.target,this,!0)}return R.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?I._onPluginEvent(t?"_onEnable":"_onDisable",this):!1},I.to=function(t,e,i){return new I(t,e,i)},I.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new I(t,e,i)},I.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new I(t,e,s)},I.delayedCall=function(t,e,i,s,r){return new I(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:r,overwrite:0})},I.set=function(t,e){return new I(t,0,e)},I.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:I.selector(t)||t;var i,s,r,n;if((f(t)||E(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(I.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=$(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},I.killTweensOf=I.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=I.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var V=v("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=V.prototype},!0);if(n=V.prototype,V.version="1.10.1",V.API=2,n._firstPT=null,n._addTween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},n.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=Math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},n._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},n._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},I._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},V.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===V.API&&(U[(new t[e])._propName]=t[e]);return!0},d.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=v("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){V.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new V(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,V.activate([a]),a},s=t._gsQueue){for(r=0;s.length>r;r++)s[r]();for(n in c)c[n].func||t.console.log("GSAP encountered missing dependency: com.greensock."+n)}o=!1}})("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenLite");
|
assets/scripts/gsap/TweenMax.min.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* VERSION: 1.14.2
|
3 |
+
* DATE: 2014-10-29
|
4 |
+
* UPDATES AND DOCS AT: http://www.greensock.com
|
5 |
+
*
|
6 |
+
* Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
|
7 |
+
*
|
8 |
+
* @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
|
9 |
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
10 |
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
11 |
+
*
|
12 |
+
* @author: Jack Doyle, jack@greensock.com
|
13 |
+
**/
|
14 |
+
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},r=function(t,e,s){i.call(this,t,e,s),this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=r.prototype.render},n=1e-10,a=i._internals,o=a.isSelector,h=a.isArray,l=r.prototype=i.to({},.1,{}),_=[];r.version="1.14.2",l.constructor=r,l.kill()._gc=!1,r.killTweensOf=r.killDelayedCallsTo=i.killTweensOf,r.getTweensOf=i.getTweensOf,r.lagSmoothing=i.lagSmoothing,r.ticker=i.ticker,r.render=i.render,l.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),i.prototype.invalidate.call(this)},l.updateTo=function(t,e){var s,r=this.ratio,n=this.vars.immediateRender||t.immediateRender;e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(s in t)this.vars[s]=t[s];if(this._initted||n)if(e)this._initted=!1;else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&i._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var a=this._time;this.render(0,!0,!1),this._initted=!1,this.render(a,!0,!1)}else if(this._time>0||n){this._initted=!1,this._init();for(var o,h=1/(1-r),l=this._firstPT;l;)o=l.s+l.c,l.c*=h,l.s=o-l.c,l=l._next}return this},l.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,o,h,l,u,p,c,f=this._dirty?this.totalDuration():this._totalDuration,m=this._time,d=this._totalTime,g=this._cycle,v=this._duration,y=this._rawPrevTime;if(t>=f?(this._totalTime=f,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=v,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete"),0===v&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>y||y===n)&&y!==t&&(i=!0,y>n&&(r="onReverseComplete")),this._rawPrevTime=c=!e||t||y===t?t:n)):1e-7>t?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==d||0===v&&y>0&&y!==n)&&(r="onReverseComplete",s=this._reversed),0>t&&(this._active=!1,0===v&&(this._initted||!this.vars.lazy||i)&&(y>=0&&(i=!0),this._rawPrevTime=c=!e||t||y===t?t:n)),this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(h=v+this._repeatDelay,this._cycle=this._totalTime/h>>0,0!==this._cycle&&this._cycle===this._totalTime/h&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!==(1&this._cycle)&&(this._time=v-this._time),this._time>v?this._time=v:0>this._time&&(this._time=0)),this._easeType?(l=this._time/v,u=this._easeType,p=this._easePower,(1===u||3===u&&l>=.5)&&(l=1-l),3===u&&(l*=2),1===p?l*=l:2===p?l*=l*l:3===p?l*=l*l*l:4===p&&(l*=l*l*l*l),this.ratio=1===u?1-l:2===u?l:.5>this._time/v?l/2:1-l/2):this.ratio=this._ease.getRatio(this._time/v)),m===this._time&&!i&&g===this._cycle)return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),void 0;if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=m,this._totalTime=d,this._rawPrevTime=y,this._cycle=g,a.lazyTweens.push(this),this._lazy=[t,e],void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/v):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==m&&t>=0&&(this._active=!0),0===d&&(2===this._initted&&t>0&&this._init(),this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===v)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==d||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),this._cycle!==g&&(e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||_)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||_),0===v&&this._rawPrevTime===n&&c!==n&&(this._rawPrevTime=0))},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(t,e,i)},r.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new r(t,e,s)},r.staggerTo=r.allTo=function(t,e,n,a,l,u,p){a=a||0;var c,f,m,d,g=n.delay||0,v=[],y=function(){n.onComplete&&n.onComplete.apply(n.onCompleteScope||this,arguments),l.apply(p||this,u||_)};for(h(t)||("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s(t))),t=t||[],0>a&&(t=s(t),t.reverse(),a*=-1),c=t.length-1,m=0;c>=m;m++){f={};for(d in n)f[d]=n[d];f.delay=g,m===c&&l&&(f.onComplete=y),v[m]=new r(t[m],e,f),g+=a}return v},r.staggerFrom=r.allFrom=function(t,e,i,s,n,a,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,r.staggerTo(t,e,i,s,n,a,o)},r.staggerFromTo=r.allFromTo=function(t,e,i,s,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,r.staggerTo(t,e,s,n,a,o,h)},r.delayedCall=function(t,e,i,s,n){return new r(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:n,overwrite:0})},r.set=function(t,e){return new r(t,0,e)},r.isTweening=function(t){return i.getTweensOf(t,!0).length>0};var u=function(t,e){for(var s=[],r=0,n=t._first;n;)n instanceof i?s[r++]=n:(e&&(s[r++]=n),s=s.concat(u(n,e)),r=s.length),n=n._next;return s},p=r.getAllTweens=function(e){return u(t._rootTimeline,e).concat(u(t._rootFramesTimeline,e))};r.killAll=function(t,i,s,r){null==i&&(i=!0),null==s&&(s=!0);var n,a,o,h=p(0!=r),l=h.length,_=i&&s&&r;for(o=0;l>o;o++)a=h[o],(_||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&(t?a.totalTime(a._reversed?0:a.totalDuration()):a._enabled(!1,!1))},r.killChildTweensOf=function(t,e){if(null!=t){var n,l,_,u,p,c=a.tweenLookup;if("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s(t)),h(t))for(u=t.length;--u>-1;)r.killChildTweensOf(t[u],e);else{n=[];for(_ in c)for(l=c[_].target.parentNode;l;)l===t&&(n=n.concat(c[_].tweens)),l=l.parentNode;for(p=n.length,u=0;p>u;u++)e&&n[u].totalTime(n[u].totalDuration()),n[u]._enabled(!1,!1)}}};var c=function(t,i,s,r){i=i!==!1,s=s!==!1,r=r!==!1;for(var n,a,o=p(r),h=i&&s&&r,l=o.length;--l>-1;)a=o[l],(h||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&a.paused(t)};return r.pauseAll=function(t,e,i){c(!0,t,e,i)},r.resumeAll=function(t,e,i){c(!1,t,e,i)},r.globalTimeScale=function(e){var s=t._rootTimeline,r=i.ticker.time;return arguments.length?(e=e||n,s._startTime=r-(r-s._startTime)*s._timeScale/e,s=t._rootFramesTimeline,r=i.ticker.frame,s._startTime=r-(r-s._startTime)*s._timeScale/e,s._timeScale=t._rootTimeline._timeScale=e,e):s._timeScale},l.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},l.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},l.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},l.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},l.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},l.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},l.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},l.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],o(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));o(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals,a=n.isSelector,o=n.isArray,h=n.lazyTweens,l=n.lazyRender,_=[],u=_gsScope._gsDefine.globals,p=function(t){var e,i={};for(e in t)i[e]=t[e];return i},c=function(t,e,i,s){var r=t._timeline._totalTime;(e||!this._forcingPlayhead)&&(t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||_),this._forcingPlayhead&&t._timeline.seek(r))},f=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=s.prototype=new e;return s.version="1.14.2",m.constructor=s,m.kill()._gc=m._forcingPlayhead=!1,m.to=function(t,e,s,r){var n=s.repeat&&u.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},m.from=function(t,e,s,r){return this.add((s.repeat&&u.TweenMax||i).from(t,e,s),r)},m.fromTo=function(t,e,s,r,n){var a=r.repeat&&u.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},m.staggerTo=function(t,e,r,n,o,h,l,_){var u,c=new s({onComplete:h,onCompleteParams:l,onCompleteScope:_,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),t=t||[],a(t)&&(t=f(t)),n=n||0,0>n&&(t=f(t),t.reverse(),n*=-1),u=0;t.length>u;u++)r.startAt&&(r.startAt=p(r.startAt)),c.to(t[u],e,p(r),u*n);return this.add(c,o)},m.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},m.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},m.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},m.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},m.add=function(r,n,a,h){var l,_,u,p,c,f;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&o(r)){for(a=a||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)o(p=r[u])&&(p=new s({tweens:p})),this.add(p,l),"string"!=typeof p&&"function"!=typeof p&&("sequence"===a?l=p._startTime+p.totalDuration()/p._timeScale:"start"===a&&(p._startTime-=p.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(c=this,f=c.rawTime()>r._startTime;c._timeline;)f&&c._timeline.smoothChildTiming?c.totalTime(c._totalTime,!0):c._gc&&c._enabled(!0,!1),c=c._timeline;return this},m.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&o(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},m._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},m.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},m.insert=m.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},m.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},m.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},m.addPause=function(t,e,i,s){return this.call(c,["{self}",e,i,s],this,t)},m.removeLabel=function(t){return delete this._labels[t],this},m.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},m._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&o(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},m.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},m.stop=function(){return this.paused(!0)},m.gotoAndPlay=function(t,e){return this.play(t,e)},m.gotoAndStop=function(t,e){return this.pause(t,e)},m.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,o,u,p=this._dirty?this.totalDuration():this._totalDuration,c=this._time,f=this._startTime,m=this._timeScale,d=this._paused;if(t>=p?(this._totalTime=this._time=p,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(u=!0,this._rawPrevTime>r&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=p+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==c||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(o="onReverseComplete",n=this._reversed),0>t?(this._active=!1,this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==c&&this._first||i||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==c&&t>0&&(this._active=!0),0===c&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_)),this._time>=c)for(s=this._first;s&&(a=s._next,!this._paused||d);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||d);)(s._active||c>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||(h.length&&l(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_))),o&&(this._gc||(f===this._startTime||m!==this._timeScale)&&(0===this._time||p>=this.totalDuration())&&(n&&(h.length&&l(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this.vars[o].apply(this.vars[o+"Scope"]||this,this.vars[o+"Params"]||_)))}},m._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},m.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},m.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},m.recent=function(){return this._recent},m._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},m.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},m._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},m.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},m.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},m._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},m.totalTime=function(){this._forcingPlayhead=!0;var e=t.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},m.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},m.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},m.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},m.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=e._internals,o=a.lazyTweens,h=a.lazyRender,l=new i(null,null,1,0),_=s.prototype=new t;return _.constructor=s,_.kill()._gc=!1,s.version="1.14.2",_.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},_.addCallback=function(t,i,s,r){return this.add(e.delayedCall(0,t,s,r),i)},_.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);--s>-1;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},_.tweenTo=function(t,i){i=i||{};var s,r,a,o={ease:l,overwrite:i.delay?2:1,useFrames:this.usesFrames(),immediateRender:!1};for(r in i)o[r]=i[r];return o.time=this._parseTimeOrLabel(t),s=Math.abs(Number(o.time)-this._time)/this._timeScale||.001,a=new e(this,s,o),o.onStart=function(){a.target.paused(!0),a.vars.time!==a.target.time()&&s===a.duration()&&a.duration(Math.abs(a.vars.time-a.target.time())/a.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||a,i.onStartParams||n)},a},_.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],onCompleteScope:this},i.immediateRender=i.immediateRender!==!1;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},_.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,l,_,u,p,c=this._dirty?this.totalDuration():this._totalDuration,f=this._duration,m=this._time,d=this._totalTime,g=this._startTime,v=this._timeScale,y=this._rawPrevTime,T=this._paused,w=this._cycle;if(t>=c?(this._locked||(this._totalTime=c,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(a=!0,_="onComplete",0===this._duration&&(0===t||0>y||y===r)&&y!==t&&this._first&&(u=!0,y>r&&(_="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=f,t=f+1e-4)):1e-7>t?(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==m||0===f&&y!==r&&(y>0||0>t&&y>=0)&&!this._locked)&&(_="onReverseComplete",a=this._reversed),0>t?(this._active=!1,y>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=f||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):(0===f&&0>y&&(u=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(p=f+this._repeatDelay,this._cycle=this._totalTime/p>>0,0!==this._cycle&&this._cycle===this._totalTime/p&&this._cycle--,this._time=this._totalTime-this._cycle*p,this._yoyo&&0!==(1&this._cycle)&&(this._time=f-this._time),this._time>f?(this._time=f,t=f+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==w&&!this._locked){var x=this._yoyo&&0!==(1&w),b=x===(this._yoyo&&0!==(1&this._cycle)),P=this._totalTime,S=this._cycle,k=this._rawPrevTime,R=this._time;if(this._totalTime=w*f,w>this._cycle?x=!x:this._totalTime+=f,this._time=m,this._rawPrevTime=0===f?y-1e-4:y,this._cycle=w,this._locked=!0,m=x?0:f,this.render(m,e,0===f),e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||n),b&&(m=x?f+1e-4:-1e-4,this.render(m,!0,!1)),this._locked=!1,this._paused&&!T)return;this._time=R,this._totalTime=P,this._cycle=S,this._rawPrevTime=k}if(!(this._time!==m&&this._first||i||u))return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==d&&t>0&&(this._active=!0),0===d&&this.vars.onStart&&0!==this._totalTime&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||n)),this._time>=m)for(s=this._first;s&&(l=s._next,!this._paused||T);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;else for(s=this._last;s&&(l=s._prev,!this._paused||T);)(s._active||m>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;this._onUpdate&&(e||(o.length&&h(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n))),_&&(this._locked||this._gc||(g===this._startTime||v!==this._timeScale)&&(0===this._time||c>=this.totalDuration())&&(a&&(o.length&&h(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[_]&&this.vars[_].apply(this.vars[_+"Scope"]||this,this.vars[_+"Params"]||n)))},_.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isActive()&&(n[o++]=r);return n},_.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},_.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},_.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},_.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()},_.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()},_.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},_.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},_.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},_.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},_.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},_.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},s},!0),function(){var t=180/Math.PI,e=[],i=[],s=[],r={},n=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",o=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},h=(t+e)/2,l=(e+i)/2,_=(i+s)/2,u=(h+l)/2,p=(l+_)/2,c=(p-u)/8;return r.b=h+(t-h)/4,n.b=u+c,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+p)/2,a.b=p-c,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},h=function(t,r,n,a,h){var l,_,u,p,c,f,m,d,g,v,y,T,w,x=t.length-1,b=0,P=t[0].a;for(l=0;x>l;l++)c=t[b],_=c.a,u=c.d,p=t[b+1].d,h?(y=e[l],T=i[l],w=.25*(T+y)*r/(a?.5:s[l]||.5),f=u-(u-_)*(a?.5*r:0!==y?w/y:0),m=u+(p-u)*(a?.5*r:0!==T?w/T:0),d=u-(f+((m-f)*(3*y/(y+T)+.5)/4||0))):(f=u-.5*(u-_)*r,m=u+.5*(p-u)*r,d=u-(f+m)/2),f+=d,m+=d,c.c=g=f,c.b=0!==l?P:P=c.a+.6*(c.c-c.a),c.da=u-_,c.ca=g-_,c.ba=P-_,n?(v=o(_,P,g,u),t.splice(b,1,v[0],v[1],v[2],v[3]),b+=4):b++,P=m;c=t[b],c.b=P,c.c=P+.4*(c.d-P),c.da=c.d-c.a,c.ca=c.c-c.a,c.ba=P-c.a,n&&(v=o(c.a,P,c.c,c.d),t.splice(b,1,v[0],v[1],v[2],v[3]))},l=function(t,s,r,a){var o,h,l,_,u,p,c=[];if(a)for(t=[a].concat(t),h=t.length;--h>-1;)"string"==typeof(p=t[h][s])&&"="===p.charAt(1)&&(t[h][s]=a[s]+Number(p.charAt(0)+p.substr(2)));if(o=t.length-2,0>o)return c[0]=new n(t[0][s],0,0,t[-1>o?0:1][s]),c;for(h=0;o>h;h++)l=t[h][s],_=t[h+1][s],c[h]=new n(l,0,0,_),r&&(u=t[h+2][s],e[h]=(e[h]||0)+(_-l)*(_-l),i[h]=(i[h]||0)+(u-_)*(u-_));return c[h]=new n(t[h][s],0,0,t[h+1][s]),c},_=function(t,n,o,_,u,p){var c,f,m,d,g,v,y,T,w={},x=[],b=p||t[0];u="string"==typeof u?","+u+",":a,null==n&&(n=1);for(f in t[0])x.push(f);if(t.length>1){for(T=t[t.length-1],y=!0,c=x.length;--c>-1;)if(f=x[c],Math.abs(b[f]-T[f])>.05){y=!1;break}y&&(t=t.concat(),p&&t.unshift(p),t.push(t[1]),p=t[t.length-3])}for(e.length=i.length=s.length=0,c=x.length;--c>-1;)f=x[c],r[f]=-1!==u.indexOf(","+f+","),w[f]=l(t,f,r[f],p);for(c=e.length;--c>-1;)e[c]=Math.sqrt(e[c]),i[c]=Math.sqrt(i[c]);if(!_){for(c=x.length;--c>-1;)if(r[f])for(m=w[x[c]],v=m.length-1,d=0;v>d;d++)g=m[d+1].da/i[d]+m[d].da/e[d],s[d]=(s[d]||0)+g*g;for(c=s.length;--c>-1;)s[c]=Math.sqrt(s[c])}for(c=x.length,d=o?4:1;--c>-1;)f=x[c],m=w[f],h(m,n,o,_,r[f]),y&&(m.splice(0,d),m.splice(m.length-d,d));return w},u=function(t,e,i){e=e||"soft";var s,r,a,o,h,l,_,u,p,c,f,m={},d="cubic"===e?3:2,g="soft"===e,v=[];if(g&&i&&(t=[i].concat(t)),null==t||d+1>t.length)throw"invalid Bezier data";for(p in t[0])v.push(p);for(l=v.length;--l>-1;){for(p=v[l],m[p]=h=[],c=0,u=t.length,_=0;u>_;_++)s=null==i?t[_][p]:"string"==typeof(f=t[_][p])&&"="===f.charAt(1)?i[p]+Number(f.charAt(0)+f.substr(2)):Number(f),g&&_>1&&u-1>_&&(h[c++]=(s+h[c-2])/2),h[c++]=s;for(u=c-d+1,c=0,_=0;u>_;_+=d)s=h[_],r=h[_+1],a=h[_+2],o=2===d?0:h[_+3],h[c++]=f=3===d?new n(s,r,a,o):new n(s,(2*r+s)/3,(2*r+a)/3,a);h.length=c}return m},p=function(t,e,i){for(var s,r,n,a,o,h,l,_,u,p,c,f=1/i,m=t.length;--m>-1;)for(p=t[m],n=p.a,a=p.d-n,o=p.c-n,h=p.b-n,s=r=0,_=1;i>=_;_++)l=f*_,u=1-l,s=r-(r=(l*l*a+3*u*(l*o+u*h))*l),c=m*i+_-1,e[c]=(e[c]||0)+s*s},c=function(t,e){e=e>>0||6;var i,s,r,n,a=[],o=[],h=0,l=0,_=e-1,u=[],c=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;r>s;s++)h+=Math.sqrt(a[s]),n=s%e,c[n]=h,n===_&&(l+=h,n=s/e>>0,u[n]=c,o[n]=l,h=0,c=[]);return{length:l,lengths:o,segments:u}},f=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.3",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var s,r,n,a,o,h=e.values||[],l={},p=h[0],f=e.autoRotate||i.vars.orientToBezier;this._autoRotate=f?f instanceof Array?f:[["x","y","rotation",f===!0?0:Number(f)||0]]:null;for(s in p)this._props.push(s);for(n=this._props.length;--n>-1;)s=this._props[n],this._overwriteProps.push(s),r=this._func[s]="function"==typeof t[s],l[s]=r?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parseFloat(t[s]),o||l[s]!==h[0][s]&&(o=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?_(h,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,o):u(h,e.type,l),this._segCount=this._beziers[s].length,this._timeRes){var m=c(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(f=this._autoRotate)for(this._initialRotations=[],f[0]instanceof Array||(this._autoRotate=f=[f]),n=f.length;--n>-1;){for(a=0;3>a;a++)s=f[n][a],this._func[s]="function"==typeof t[s]?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]:!1;s=f[n][2],this._initialRotations[n]=this._func[s]?this._func[s].call(this._target):this._target[s]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(e){var i,s,r,n,a,o,h,l,_,u,p=this._segCount,c=this._func,f=this._target,m=e!==this._startRatio;if(this._timeRes){if(_=this._lengths,u=this._curSeg,e*=this._length,r=this._li,e>this._l2&&p-1>r){for(l=p-1;l>r&&e>=(this._l2=_[++r]););this._l1=_[r-1],this._li=r,this._curSeg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(this._l1>e&&r>0){for(;r>0&&(this._l1=_[--r])>=e;);0===r&&this._l1>e?this._l1=0:r++,this._l2=_[r],this._li=r,this._curSeg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&u.length-1>r){for(l=u.length-1;l>r&&e>=(this._s2=u[++r]););this._s1=u[r-1],this._si=r
|
15 |
+
}else if(this._s1>e&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&this._s1>e?this._s1=0:r++,this._s2=u[r],this._si=r}o=(r+(e-this._s1)/(this._s2-this._s1))*this._prec}else i=0>e?0:e>=1?p-1:p*e>>0,o=(e-i*(1/p))*p;for(s=1-o,r=this._props.length;--r>-1;)n=this._props[r],a=this._beziers[n][i],h=(o*o*a.da+3*s*(o*a.ca+s*a.ba))*o+a.a,this._round[n]&&(h=Math.round(h)),c[n]?f[n](h):f[n]=h;if(this._autoRotate){var d,g,v,y,T,w,x,b=this._autoRotate;for(r=b.length;--r>-1;)n=b[r][2],w=b[r][3]||0,x=b[r][4]===!0?1:t,a=this._beziers[b[r][0]],d=this._beziers[b[r][1]],a&&d&&(a=a[i],d=d[i],g=a.a+(a.b-a.a)*o,y=a.b+(a.c-a.b)*o,g+=(y-g)*o,y+=(a.c+(a.d-a.c)*o-y)*o,v=d.a+(d.b-d.a)*o,T=d.b+(d.c-d.b)*o,v+=(T-v)*o,T+=(d.c+(d.d-d.c)*o-T)*o,h=m?Math.atan2(T-v,y-g)*x+w:this._initialRotations[r],c[n]?f[n](h):f[n]=h)}}}),m=f.prototype;f.bezierThrough=_,f.cubicToQuadratic=o,f._autoCSS=!0,f.quadraticToCubic=function(t,e,i){return new n(t,(2*e+t)/3,(2*e+i)/3,i)},f._cssRegister=function(){var t=_gsScope._gsDefine.globals.CSSPlugin;if(t){var e=t._internals,i=e._parseToProxy,s=e._setPluginRatio,r=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,n,a,o,h){e instanceof Array&&(e={values:e}),h=new f;var l,_,u,p=e.values,c=p.length-1,m=[],d={};if(0>c)return o;for(l=0;c>=l;l++)u=i(t,p[l],a,o,h,c!==l),m[l]=u.end;for(_ in e)d[_]=e[_];return d.values=m,o=new r(t,"bezier",0,0,u.pt,2),o.data=u,o.plugin=h,o.setRatio=s,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(l=d.autoRotate===!0?0:Number(d.autoRotate),d.autoRotate=null!=u.end.left?[["left","top","rotation",l,!1]]:null!=u.end.x?[["x","y","rotation",l,!1]]:!1),d.autoRotate&&(a._transform||a._enableTransforms(!1),u.autoRotate=a._target._gsTransform),h._onInitTween(u.proxy,d,a._tween),o}})}},m._roundProps=function(t,e){for(var i=this._overwriteProps,s=i.length;--s>-1;)(t[i[s]]||t.bezier||t.bezierThrough)&&(this._round[i[s]]=e)},m._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;--i>-1;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,s,r,n,a=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=a.prototype.setRatio},o={},h=a.prototype=new t("css");h.constructor=a,a.version="1.14.2",a.API=2,a.defaultTransformPerspective=0,a.defaultSkewType="compensated",h="px",a.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var l,_,u,p,c,f,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,d=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,g=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/(?![+-]?\d*\.?\d+|e[+-]\d+)[^0-9]/g,y=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,x=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,P=/([A-Z])/g,S=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,R=function(t,e){return e.toUpperCase()},A=/(?:Left|Right|Width)/i,C=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,O=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,D=/,(?=[^\)]*(?:\(|$))/gi,M=Math.PI/180,z=180/Math.PI,I={},E=document,F=E.createElement("div"),L=E.createElement("img"),N=a._internals={_specialProps:o},X=navigator.userAgent,U=function(){var t,e=X.indexOf("Android"),i=E.createElement("div");return u=-1!==X.indexOf("Safari")&&-1===X.indexOf("Chrome")&&(-1===e||Number(X.substr(e+8,1))>3),c=u&&6>Number(X.substr(X.indexOf("Version/")+8,1)),p=-1!==X.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(X)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(X))&&(f=parseFloat(RegExp.$1)),i.innerHTML="<a style='top:1px;opacity:.55;'>a</a>",t=i.getElementsByTagName("a")[0],t?/^0.55/.test(t.style.opacity):!1}(),Y=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},j=function(t){window.console&&console.log(t)},B="",q="",V=function(t,e){e=e||F;var i,s,r=e.style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],s=5;--s>-1&&void 0===r[i[s]+t];);return s>=0?(q=3===s?"ms":i[s],B="-"+q.toLowerCase()+"-",q+t):null},G=E.defaultView?E.defaultView.getComputedStyle:function(){},W=a.getStyle=function(t,e,i,s,r){var n;return U||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||G(t))?n=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(P,"-$1").toLowerCase()):t.currentStyle&&(n=t.currentStyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):Y(t)},Z=N.convertToPixels=function(t,i,s,r,n){if("px"===r||!r)return s;if("auto"===r||!s)return 0;var o,h,l,_=A.test(i),u=t,p=F.style,c=0>s;if(c&&(s=-s),"%"===r&&-1!==i.indexOf("border"))o=s/100*(_?t.clientWidth:t.clientHeight);else{if(p.cssText="border:0 solid red;position:"+W(t,"position")+";line-height:0;","%"!==r&&u.appendChild)p[_?"borderLeftWidth":"borderTopWidth"]=s+r;else{if(u=t.parentNode||E.body,h=u._gsCache,l=e.ticker.frame,h&&_&&h.time===l)return h.width*s/100;p[_?"width":"height"]=s+r}u.appendChild(F),o=parseFloat(F[_?"offsetWidth":"offsetHeight"]),u.removeChild(F),_&&"%"===r&&a.cacheWidths!==!1&&(h=u._gsCache=u._gsCache||{},h.time=l,h.width=100*(o/s)),0!==o||n||(o=Z(t,i,s,r,!0))}return c?-o:o},Q=N.calculateOffset=function(t,e,i){if("absolute"!==W(t,"position",i))return 0;var s="left"===e?"Left":"Top",r=W(t,"margin"+s,i);return t["offset"+s]-(Z(t,e,parseFloat(r),r.replace(y,""))||0)},$=function(t,e){var i,s,r={};if(e=e||G(t,null))if(i=e.length)for(;--i>-1;)r[e[i].replace(S,R)]=e.getPropertyValue(e[i]);else for(i in e)r[i]=e[i];else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===r[i]&&(r[i.replace(S,R)]=e[i]);return U||(r.opacity=Y(t)),s=Oe(t,e,!1),r.rotation=s.rotation,r.skewX=s.skewX,r.scaleX=s.scaleX,r.scaleY=s.scaleY,r.x=s.x,r.y=s.y,be&&(r.z=s.z,r.rotationX=s.rotationX,r.rotationY=s.rotationY,r.scaleZ=s.scaleZ),r.filters&&delete r.filters,r},H=function(t,e,i,s,r){var n,a,o,h={},l=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(h[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(v,"")?n:0:Q(t,a),void 0!==l[a]&&(o=new ue(l,a,l[a],o)));if(s)for(a in s)"className"!==a&&(h[a]=s[a]);return{difs:h,firstMPT:o}},K={width:["Left","Right"],height:["Top","Bottom"]},J=["marginLeft","marginRight","marginTop","marginBottom"],te=function(t,e,i){var s=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=K[e],n=r.length;for(i=i||G(t,null);--n>-1;)s-=parseFloat(W(t,"padding"+r[n],i,!0))||0,s-=parseFloat(W(t,"border"+r[n]+"Width",i,!0))||0;return s},ee=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],r=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==r?r="0":"center"===r&&(r="50%"),("center"===s||isNaN(parseFloat(s))&&-1===(s+"").indexOf("="))&&(s="50%"),e&&(e.oxp=-1!==s.indexOf("%"),e.oyp=-1!==r.indexOf("%"),e.oxr="="===s.charAt(1),e.oyr="="===r.charAt(1),e.ox=parseFloat(s.replace(v,"")),e.oy=parseFloat(r.replace(v,""))),s+" "+r+(i.length>2?" "+i[2]:"")},ie=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},se=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)},re=function(t,e,i,s){var r,n,a,o,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(r=360,n=t.split("_"),a=Number(n[0].replace(v,""))*(-1===t.indexOf("rad")?1:z)-("="===t.charAt(1)?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexOf("short")&&(a%=r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+9999999999*r)%r-(0|a/r)*r:-1!==t.indexOf("ccw")&&a>0&&(a=(a-9999999999*r)%r-(0|a/r)*r)),o=e+a),h>o&&o>-h&&(o=0),o},ne={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ae=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},oe=a.parseColor=function(t){var e,i,s,r,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ne[t]?ne[t]:"#"===t.charAt(0)?(4===t.length&&(e=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+e+e+i+i+s+s),t=parseInt(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),r=Number(t[0])%360/360,n=Number(t[1])/100,a=Number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=Number(t[3])),t[0]=ae(r+1/3,e,i),t[1]=ae(r,e,i),t[2]=ae(r-1/3,e,i),t):(t=t.match(m)||ne.transparent,t[0]=Number(t[0]),t[1]=Number(t[1]),t[2]=Number(t[2]),t.length>3&&(t[3]=Number(t[3])),t)):ne.black},he="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(h in ne)he+="|"+h+"\\b";he=RegExp(he+")","gi");var le=function(t,e,i,s){if(null==t)return function(t){return t};var r,n=e?(t.match(he)||[""])[0]:"",a=t.split(n).join("").match(g)||[],o=t.substr(0,t.indexOf(a[0])),h=")"===t.charAt(t.length-1)?")":"",l=-1!==t.indexOf(" ")?" ":",",_=a.length,u=_>0?a[0].replace(m,""):"";return _?r=e?function(t){var e,p,c,f;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(f=t.replace(D,"|").split("|"),c=0;f.length>c;c++)f[c]=r(f[c]);return f.join(",")}if(e=(t.match(he)||[n])[0],p=t.split(e).join("").match(g)||[],c=p.length,_>c--)for(;_>++c;)p[c]=i?p[0|(c-1)/2]:a[c];return o+p.join(l)+l+e+h+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,n,p;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(n=t.replace(D,"|").split("|"),p=0;n.length>p;p++)n[p]=r(n[p]);return n.join(",")}if(e=t.match(g)||[],p=e.length,_>p--)for(;_>++p;)e[p]=i?e[0|(p-1)/2]:a[p];return o+e.join(l)+h}:function(t){return t}},_e=function(t){return t=t.split(","),function(e,i,s,r,n,a,o){var h,l=(i+"").split(" ");for(o={},h=0;4>h;h++)o[t[h]]=l[h]=l[h]||l[(h-1)/2>>0];return r.parse(e,o,n,a)}},ue=(N._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstMPT,h=1e-6;o;)e=a[o.v],o.r?e=Math.round(e):h>e&&e>-h&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if(i=o.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&(s._prev=this,this._next=s)}),pe=(N._parseToProxy=function(t,e,i,s,r,n){var a,o,h,l,_,u=s,p={},c={},f=i._transform,m=I;for(i._transform=null,I=e,s=_=i.parse(t,e,s,r),I=m,n&&(i._transform=f,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(1>=s.type&&(o=s.p,c[o]=s.s+s.c,p[o]=s.s,n||(l=new ue(s,"s",o,l,s.r),s.c=0),1===s.type))for(a=s.l;--a>0;)h="xn"+a,o=s.p+"_"+h,c[o]=s.data[h],p[o]=s[h],n||(l=new ue(s,h,o,l,s.rxp[h]));s=s._next}return{proxy:p,end:c,firstMPT:l,pt:_}},N.CSSPropTween=function(t,e,s,r,a,o,h,l,_,u,p){this.t=t,this.p=e,this.s=s,this.c=r,this.n=h||e,t instanceof pe||n.push(this.n),this.r=l,this.type=o||0,_&&(this.pr=_,i=!0),this.b=void 0===u?s:u,this.e=void 0===p?s+r:p,a&&(this._next=a,a._prev=this)}),ce=a.parseComplex=function(t,e,i,s,r,n,a,o,h,_){i=i||n||"",a=new pe(t,e,0,0,a,_?2:1,null,!1,o,i,s),s+="";var u,p,c,f,g,v,y,T,w,x,P,S,k=i.split(", ").join(",").split(" "),R=s.split(", ").join(",").split(" "),A=k.length,C=l!==!1;for((-1!==s.indexOf(",")||-1!==i.indexOf(","))&&(k=k.join(" ").replace(D,", ").split(" "),R=R.join(" ").replace(D,", ").split(" "),A=k.length),A!==R.length&&(k=(n||"").split(" "),A=k.length),a.plugin=h,a.setRatio=_,u=0;A>u;u++)if(f=k[u],g=R[u],T=parseFloat(f),T||0===T)a.appendXtra("",T,ie(g,T),g.replace(d,""),C&&-1!==g.indexOf("px"),!0);else if(r&&("#"===f.charAt(0)||ne[f]||b.test(f)))S=","===g.charAt(g.length-1)?"),":")",f=oe(f),g=oe(g),w=f.length+g.length>6,w&&!U&&0===g[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(R[u]).join("transparent")):(U||(w=!1),a.appendXtra(w?"rgba(":"rgb(",f[0],g[0]-f[0],",",!0,!0).appendXtra("",f[1],g[1]-f[1],",",!0).appendXtra("",f[2],g[2]-f[2],w?",":S,!0),w&&(f=4>f.length?1:f[3],a.appendXtra("",f,(4>g.length?1:g[3])-f,S,!1)));else if(v=f.match(m)){if(y=g.match(d),!y||y.length!==v.length)return a;for(c=0,p=0;v.length>p;p++)P=v[p],x=f.indexOf(P,c),a.appendXtra(f.substr(c,x-c),Number(P),ie(y[p],P),"",C&&"px"===f.substr(x+P.length,2),0===p),c=x+P.length;a["xs"+a.l]+=f.substr(c)}else a["xs"+a.l]+=a.l?" "+f:f;if(-1!==s.indexOf("=")&&a.data){for(S=a.xs0+a.data.s,u=1;a.l>u;u++)S+=a["xs"+u]+a.data["xn"+u];a.e=S+a["xs"+u]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},fe=9;for(h=pe.prototype,h.l=h.pr=0;--fe>0;)h["xn"+fe]=0,h["xs"+fe]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=s||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new pe(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r,a)):(a["xs"+o]+=e+(s||""),a)};var me=function(t,e){e=e||{},this.p=e.prefix?V(t)||t:t,o[t]=o[this.p]=this,this.format=e.formatter||le(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},de=N._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r,n=t.split(","),a=e.defaultValue;for(i=i||[a],s=0;n.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultValue=i[s]||a,r=new me(n[s],e)},ge=function(t){if(!o[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";de(t,{parser:function(t,i,s,r,n,a,h){var l=(_gsScope.GreenSockGlobals||_gsScope).com.greensock.plugins[e];return l?(l._cssRegister(),o[s].parse(t,i,s,r,n,a,h)):(j("Error: "+e+" js file not loaded."),n)}})}};h=me.prototype,h.parseComplex=function(t,e,i,s,r,n){var a,o,h,l,_,u,p=this.keyword;if(this.multi&&(D.test(i)||D.test(e)?(o=e.replace(D,"|").split("|"),h=i.replace(D,"|").split("|")):p&&(o=[e],h=[i])),h){for(l=h.length>o.length?h.length:o.length,a=0;l>a;a++)e=o[a]=o[a]||this.dflt,i=h[a]=h[a]||this.dflt,p&&(_=e.indexOf(p),u=i.indexOf(p),_!==u&&(i=-1===u?h:o,i[a]+=" "+p));e=o.join(", "),i=h.join(", ")}return ce(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)},h.parse=function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(W(t,this.p,r,!1,this.dflt)),this.format(e),n,a)},a.registerSpecialProp=function(t,e,i){de(t,{parser:function(t,s,r,n,a,o){var h=new pe(t,r,0,0,a,2,r,!1,i);return h.plugin=o,h.setRatio=e(t,s,n._tween,r),h},priority:i})};var ve,ye="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Te=V("transform"),we=B+"transform",xe=V("transformOrigin"),be=null!==V("perspective"),Pe=N.Transform=function(){this.skewY=0},Se=window.SVGElement,ke=function(t,e,i){var s,r=E.createElementNS("http://www.w3.org/2000/svg",t),n=/([a-z])([A-Z])/g;for(s in i)r.setAttributeNS(null,s.replace(n,"$1-$2").toLowerCase(),i[s]);return e.appendChild(r),r},Re=document.documentElement,Ae=function(){var t,e,i,s=f||/Android/i.test(X)&&!window.chrome;return E.createElementNS&&!s&&(t=ke("svg",Re),e=ke("rect",t,{width:100,height:50,x:100}),i=e.getBoundingClientRect().left,e.style[xe]="50% 50%",e.style[Te]="scale(0.5,0.5)",s=i===e.getBoundingClientRect().left,Re.removeChild(t)),s}(),Ce=function(t,e,i){var s=t.getBBox();e=ee(e).split(" "),i.xOrigin=(-1!==e[0].indexOf("%")?parseFloat(e[0])/100*s.width:parseFloat(e[0]))+s.x,i.yOrigin=(-1!==e[1].indexOf("%")?parseFloat(e[1])/100*s.height:parseFloat(e[1]))+s.y},Oe=N.getTransform=function(t,e,i,s){if(t._gsTransform&&i&&!s)return t._gsTransform;var n,o,h,l,_,u,p,c,f,m,d,g,v,y=i?t._gsTransform||new Pe:new Pe,T=0>y.scaleX,w=2e-5,x=1e5,b=179.99,P=b*M,S=be?parseFloat(W(t,xe,e,!1,"0 0 0").split(" ")[2])||y.zOrigin||0:0,k=parseFloat(a.defaultTransformPerspective)||0;if(Te?n=W(t,we,e,!0):t.currentStyle&&(n=t.currentStyle.filter.match(C),n=n&&4===n.length?[n[0].substr(4),Number(n[2].substr(4)),Number(n[1].substr(4)),n[3].substr(4),y.x||0,y.y||0].join(","):""),n&&"none"!==n&&"matrix(1, 0, 0, 1, 0, 0)"!==n){for(o=(n||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],h=o.length;--h>-1;)l=Number(o[h]),o[h]=(_=l-(l|=0))?(0|_*x+(0>_?-.5:.5))/x+l:l;if(16===o.length){var R=o[8],A=o[9],O=o[10],D=o[12],I=o[13],E=o[14];if(y.zOrigin&&(E=-y.zOrigin,D=R*E-o[12],I=A*E-o[13],E=O*E+y.zOrigin-o[14]),!i||s||null==y.rotationX){var F,L,N,X,U,Y,j,B=o[0],q=o[1],V=o[2],G=o[3],Z=o[4],Q=o[5],$=o[6],H=o[7],K=o[11],J=Math.atan2($,O),te=-P>J||J>P;y.rotationX=J*z,J&&(X=Math.cos(-J),U=Math.sin(-J),F=Z*X+R*U,L=Q*X+A*U,N=$*X+O*U,R=Z*-U+R*X,A=Q*-U+A*X,O=$*-U+O*X,K=H*-U+K*X,Z=F,Q=L,$=N),J=Math.atan2(R,B),y.rotationY=J*z,J&&(Y=-P>J||J>P,X=Math.cos(-J),U=Math.sin(-J),F=B*X-R*U,L=q*X-A*U,N=V*X-O*U,A=q*U+A*X,O=V*U+O*X,K=G*U+K*X,B=F,q=L,V=N),J=Math.atan2(q,Q),y.rotation=J*z,J&&(j=-P>J||J>P,X=Math.cos(-J),U=Math.sin(-J),B=B*X+Z*U,L=q*X+Q*U,Q=q*-U+Q*X,$=V*-U+$*X,q=L),j&&te?y.rotation=y.rotationX=0:j&&Y?y.rotation=y.rotationY=0:Y&&te&&(y.rotationY=y.rotationX=0),y.scaleX=(0|Math.sqrt(B*B+q*q)*x+.5)/x,y.scaleY=(0|Math.sqrt(Q*Q+A*A)*x+.5)/x,y.scaleZ=(0|Math.sqrt($*$+O*O)*x+.5)/x,y.skewX=0,y.perspective=K?1/(0>K?-K:K):0,y.x=D,y.y=I,y.z=E}}else if(!(be&&!s&&o.length&&y.x===o[4]&&y.y===o[5]&&(y.rotationX||y.rotationY)||void 0!==y.x&&"none"===W(t,"display",e))){var ee=o.length>=6,ie=ee?o[0]:1,se=o[1]||0,re=o[2]||0,ne=ee?o[3]:1;y.x=o[4]||0,y.y=o[5]||0,u=Math.sqrt(ie*ie+se*se),p=Math.sqrt(ne*ne+re*re),c=ie||se?Math.atan2(se,ie)*z:y.rotation||0,f=re||ne?Math.atan2(re,ne)*z+c:y.skewX||0,m=u-Math.abs(y.scaleX||0),d=p-Math.abs(y.scaleY||0),Math.abs(f)>90&&270>Math.abs(f)&&(T?(u*=-1,f+=0>=c?180:-180,c+=0>=c?180:-180):(p*=-1,f+=0>=f?180:-180)),g=(c-y.rotation)%180,v=(f-y.skewX)%180,(void 0===y.skewX||m>w||-w>m||d>w||-w>d||g>-b&&b>g&&false|g*x||v>-b&&b>v&&false|v*x)&&(y.scaleX=u,y.scaleY=p,y.rotation=c,y.skewX=f),be&&(y.rotationX=y.rotationY=y.z=0,y.perspective=k,y.scaleZ=1)}y.zOrigin=S;for(h in y)w>y[h]&&y[h]>-w&&(y[h]=0)}else y={x:0,y:0,z:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,perspective:k,rotation:0,rotationX:0,rotationY:0,zOrigin:0};return i&&(t._gsTransform=y),y.svg=Se&&t instanceof Se&&t.parentNode instanceof Se,y.svg&&(Ce(t,W(t,xe,r,!1,"50% 50%")+"",y),ve=a.useSVGTransformAttr||Ae),y.xPercent=y.yPercent=0,y},De=function(t){var e,i,s=this.data,r=-s.rotation*M,n=r+s.skewX*M,a=1e5,o=(0|Math.cos(r)*s.scaleX*a)/a,h=(0|Math.sin(r)*s.scaleX*a)/a,l=(0|Math.sin(n)*-s.scaleY*a)/a,_=(0|Math.cos(n)*s.scaleY*a)/a,u=this.t.style,p=this.t.currentStyle;if(p){i=h,h=-l,l=-i,e=p.filter,u.filter="";var c,m,d=this.t.offsetWidth,g=this.t.offsetHeight,v="absolute"!==p.position,w="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+h+", M21="+l+", M22="+_,x=s.x+d*s.xPercent/100,b=s.y+g*s.yPercent/100;if(null!=s.ox&&(c=(s.oxp?.01*d*s.ox:s.ox)-d/2,m=(s.oyp?.01*g*s.oy:s.oy)-g/2,x+=c-(c*o+m*h),b+=m-(c*l+m*_)),v?(c=d/2,m=g/2,w+=", Dx="+(c-(c*o+m*h)+x)+", Dy="+(m-(c*l+m*_)+b)+")"):w+=", sizingMethod='auto expand')",u.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(O,w):w+" "+e,(0===t||1===t)&&1===o&&0===h&&0===l&&1===_&&(v&&-1===w.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf("gradient("&&e.indexOf("Alpha"))&&u.removeAttribute("filter")),!v){var P,S,k,R=8>f?1:-1;for(c=s.ieOffsetX||0,m=s.ieOffsetY||0,s.ieOffsetX=Math.round((d-((0>o?-o:o)*d+(0>h?-h:h)*g))/2+x),s.ieOffsetY=Math.round((g-((0>_?-_:_)*g+(0>l?-l:l)*d))/2+b),fe=0;4>fe;fe++)S=J[fe],P=p[S],i=-1!==P.indexOf("px")?parseFloat(P):Z(this.t,S,parseFloat(P),P.replace(y,""))||0,k=i!==s[S]?2>fe?-s.ieOffsetX:-s.ieOffsetY:2>fe?c-s.ieOffsetX:m-s.ieOffsetY,u[S]=(s[S]=Math.round(i-k*(0===fe||2===fe?1:R)))+"px"}}},Me=N.set3DTransformRatio=function(t){var e,i,s,r,n,a,o,h,l,_,u,c,f,m,d,g,v,y,T,w,x,b,P,S=this.data,k=this.t.style,R=S.rotation*M,A=S.scaleX,C=S.scaleY,O=S.scaleZ,D=S.x,z=S.y,I=S.z,E=S.perspective;if(!(1!==t&&0!==t||"auto"!==S.force3D||S.rotationY||S.rotationX||1!==O||E||I))return ze.call(this,t),void 0;if(p){var F=1e-4;F>A&&A>-F&&(A=O=2e-5),F>C&&C>-F&&(C=O=2e-5),!E||S.z||S.rotationX||S.rotationY||(E=0)}if(R||S.skewX)y=Math.cos(R),T=Math.sin(R),e=y,n=T,S.skewX&&(R-=S.skewX*M,y=Math.cos(R),T=Math.sin(R),"simple"===S.skewType&&(w=Math.tan(S.skewX*M),w=Math.sqrt(1+w*w),y*=w,T*=w)),i=-T,a=y;else{if(!(S.rotationY||S.rotationX||1!==O||E||S.svg))return k[Te]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) translate3d(":"translate3d(")+D+"px,"+z+"px,"+I+"px)"+(1!==A||1!==C?" scale("+A+","+C+")":""),void 0;e=a=1,i=n=0}u=1,s=r=o=h=l=_=c=f=m=0,d=E?-1/E:0,g=S.zOrigin,v=1e5,R=S.rotationY*M,R&&(y=Math.cos(R),T=Math.sin(R),l=u*-T,f=d*-T,s=e*T,o=n*T,u*=y,d*=y,e*=y,n*=y),R=S.rotationX*M,R&&(y=Math.cos(R),T=Math.sin(R),w=i*y+s*T,x=a*y+o*T,b=_*y+u*T,P=m*y+d*T,s=i*-T+s*y,o=a*-T+o*y,u=_*-T+u*y,d=m*-T+d*y,i=w,a=x,_=b,m=P),1!==O&&(s*=O,o*=O,u*=O,d*=O),1!==C&&(i*=C,a*=C,_*=C,m*=C),1!==A&&(e*=A,n*=A,l*=A,f*=A),g&&(c-=g,r=s*c,h=o*c,c=u*c+g),S.svg&&(r+=S.xOrigin-(S.xOrigin*e+S.yOrigin*i),h+=S.yOrigin-(S.xOrigin*n+S.yOrigin*a)),r=(w=(r+=D)-(r|=0))?(0|w*v+(0>w?-.5:.5))/v+r:r,h=(w=(h+=z)-(h|=0))?(0|w*v+(0>w?-.5:.5))/v+h:h,c=(w=(c+=I)-(c|=0))?(0|w*v+(0>w?-.5:.5))/v+c:c,k[Te]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) matrix3d(":"matrix3d(")+[(0|e*v)/v,(0|n*v)/v,(0|l*v)/v,(0|f*v)/v,(0|i*v)/v,(0|a*v)/v,(0|_*v)/v,(0|m*v)/v,(0|s*v)/v,(0|o*v)/v,(0|u*v)/v,(0|d*v)/v,r,h,c,E?1+-c/E:1].join(",")+")"},ze=N.set2DTransformRatio=function(t){var e,i,s,r,n,a,o,h,l,_,u,p=this.data,c=this.t,f=c.style,m=p.x,d=p.y;return!(p.rotationX||p.rotationY||p.z||p.force3D===!0||"auto"===p.force3D&&1!==t&&0!==t)||p.svg&&ve||!be?(r=p.scaleX,n=p.scaleY,p.rotation||p.skewX||p.svg?(e=p.rotation*M,i=e-p.skewX*M,s=1e5,a=Math.cos(e)*r,o=Math.sin(e)*r,h=Math.sin(i)*-n,l=Math.cos(i)*n,p.svg&&(m+=p.xOrigin-(p.xOrigin*a+p.yOrigin*h),d+=p.yOrigin-(p.xOrigin*o+p.yOrigin*l),u=1e-6,u>m&&m>-u&&(m=0),u>d&&d>-u&&(d=0)),_=(0|a*s)/s+","+(0|o*s)/s+","+(0|h*s)/s+","+(0|l*s)/s+","+m+","+d+")",p.svg&&ve?c.setAttribute("transform","matrix("+_):f[Te]=(p.xPercent||p.yPercent?"translate("+p.xPercent+"%,"+p.yPercent+"%) matrix(":"matrix(")+_):f[Te]=(p.xPercent||p.yPercent?"translate("+p.xPercent+"%,"+p.yPercent+"%) matrix(":"matrix(")+r+",0,0,"+n+","+m+","+d+")",void 0):(this.setRatio=Me,Me.call(this,t),void 0)};de("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent",{parser:function(t,e,i,s,n,o,h){if(s._transform)return n;var l,_,u,p,c,f,m,d=s._transform=Oe(t,r,!0,h.parseTransform),g=t.style,v=1e-6,y=ye.length,T=h,w={};if("string"==typeof T.transform&&Te)u=F.style,u[Te]=T.transform,u.display="block",u.position="absolute",E.body.appendChild(F),l=Oe(F,null,!1),E.body.removeChild(F);else if("object"==typeof T){if(l={scaleX:se(null!=T.scaleX?T.scaleX:T.scale,d.scaleX),scaleY:se(null!=T.scaleY?T.scaleY:T.scale,d.scaleY),scaleZ:se(T.scaleZ,d.scaleZ),x:se(T.x,d.x),y:se(T.y,d.y),z:se(T.z,d.z),xPercent:se(T.xPercent,d.xPercent),yPercent:se(T.yPercent,d.yPercent),perspective:se(T.transformPerspective,d.perspective)},m=T.directionalRotation,null!=m)if("object"==typeof m)for(u in m)T[u]=m[u];else T.rotation=m;"string"==typeof T.x&&-1!==T.x.indexOf("%")&&(l.x=0,l.xPercent=se(T.x,d.xPercent)),"string"==typeof T.y&&-1!==T.y.indexOf("%")&&(l.y=0,l.yPercent=se(T.y,d.yPercent)),l.rotation=re("rotation"in T?T.rotation:"shortRotation"in T?T.shortRotation+"_short":"rotationZ"in T?T.rotationZ:d.rotation,d.rotation,"rotation",w),be&&(l.rotationX=re("rotationX"in T?T.rotationX:"shortRotationX"in T?T.shortRotationX+"_short":d.rotationX||0,d.rotationX,"rotationX",w),l.rotationY=re("rotationY"in T?T.rotationY:"shortRotationY"in T?T.shortRotationY+"_short":d.rotationY||0,d.rotationY,"rotationY",w)),l.skewX=null==T.skewX?d.skewX:re(T.skewX,d.skewX),l.skewY=null==T.skewY?d.skewY:re(T.skewY,d.skewY),(_=l.skewY-d.skewY)&&(l.skewX+=_,l.rotation+=_)}for(be&&null!=T.force3D&&(d.force3D=T.force3D,f=!0),d.skewType=T.skewType||d.skewType||a.defaultSkewType,c=d.force3D||d.z||d.rotationX||d.rotationY||l.z||l.rotationX||l.rotationY||l.perspective,c||null==T.scale||(l.scaleZ=1);--y>-1;)i=ye[y],p=l[i]-d[i],(p>v||-v>p||null!=T[i]||null!=I[i])&&(f=!0,n=new pe(d,i,d[i],p,n),i in w&&(n.e=w[i]),n.xs0=0,n.plugin=o,s._overwriteProps.push(n.n));return p=T.transformOrigin,p&&d.svg&&(Ce(t,p,l),n=new pe(d,"xOrigin",d.xOrigin,l.xOrigin-d.xOrigin,n,-1,"transformOrigin"),n.b=d.xOrigin,n.e=n.xs0=l.xOrigin,n=new pe(d,"yOrigin",d.yOrigin,l.yOrigin-d.yOrigin,n,-1,"transformOrigin"),n.b=d.yOrigin,n.e=n.xs0=l.yOrigin,p="0px 0px"),(p||be&&c&&d.zOrigin)&&(Te?(f=!0,i=xe,p=(p||W(t,i,r,!1,"50% 50%"))+"",n=new pe(g,i,0,0,n,-1,"transformOrigin"),n.b=g[i],n.plugin=o,be?(u=d.zOrigin,p=p.split(" "),d.zOrigin=(p.length>2&&(0===u||"0px"!==p[2])?parseFloat(p[2]):u)||0,n.xs0=n.e=p[0]+" "+(p[1]||"50%")+" 0px",n=new pe(d,"zOrigin",0,0,n,-1,n.n),n.b=u,n.xs0=n.e=d.zOrigin):n.xs0=n.e=p):ee(p+"",d)),f&&(s._transformType=d.svg&&ve||!c&&3!==this._transformType?2:3),n},prefix:!0}),de("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),de("borderRadius",{defaultValue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,h,l,_,u,p,c,f,m,d,g,v,y,T,w,x,b=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],P=t.style;for(m=parseFloat(t.offsetWidth),d=parseFloat(t.offsetHeight),o=e.split(" "),h=0;b.length>h;h++)this.p.indexOf("border")&&(b[h]=V(b[h])),u=_=W(t,b[h],r,!1,"0px"),-1!==u.indexOf(" ")&&(_=u.split(" "),u=_[0],_=_[1]),p=l=o[h],c=parseFloat(u),v=u.substr((c+"").length),y="="===p.charAt(1),y?(f=parseInt(p.charAt(0)+"1",10),p=p.substr(2),f*=parseFloat(p),g=p.substr((f+"").length-(0>f?1:0))||""):(f=parseFloat(p),g=p.substr((f+"").length)),""===g&&(g=s[i]||v),g!==v&&(T=Z(t,"borderLeft",c,v),w=Z(t,"borderTop",c,v),"%"===g?(u=100*(T/m)+"%",_=100*(w/d)+"%"):"em"===g?(x=Z(t,"borderLeft",1,"em"),u=T/x+"em",_=w/x+"em"):(u=T+"px",_=w+"px"),y&&(p=parseFloat(u)+f+g,l=parseFloat(_)+f+g)),a=ce(P,b[h],u+" "+_,p+" "+l,!1,"0px",a);return a},prefix:!0,formatter:le("0px 0px 0px 0px",!1,!0)}),de("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,s,n,a){var o,h,l,_,u,p,c="background-position",m=r||G(t,null),d=this.format((m?f?m.getPropertyValue(c+"-x")+" "+m.getPropertyValue(c+"-y"):m.getPropertyValue(c):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),g=this.format(e);if(-1!==d.indexOf("%")!=(-1!==g.indexOf("%"))&&(p=W(t,"backgroundImage").replace(k,""),p&&"none"!==p)){for(o=d.split(" "),h=g.split(" "),L.setAttribute("src",p),l=2;--l>-1;)d=o[l],_=-1!==d.indexOf("%"),_!==(-1!==h[l].indexOf("%"))&&(u=0===l?t.offsetWidth-L.width:t.offsetHeight-L.height,o[l]=_?parseFloat(d)/100*u+"px":100*(parseFloat(d)/u)+"%");d=o.join(" ")}return this.parseComplex(t.style,d,g,n,a)},formatter:ee}),de("backgroundSize",{defaultValue:"0 0",formatter:ee}),de("perspective",{defaultValue:"0px",prefix:!0}),de("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),de("transformStyle",{prefix:!0}),de("backfaceVisibility",{prefix:!0}),de("userSelect",{prefix:!0}),de("margin",{parser:_e("marginTop,marginRight,marginBottom,marginLeft")}),de("padding",{parser:_e("paddingTop,paddingRight,paddingBottom,paddingLeft")}),de("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,n,a){var o,h,l;return 9>f?(h=t.currentStyle,l=8>f?" ":",",o="rect("+h.clipTop+l+h.clipRight+l+h.clipBottom+l+h.clipLeft+")",e=this.format(e).split(",").join(l)):(o=this.format(W(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),de("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),de("autoRound,strictUnits",{parser:function(t,e,i,s,r){return r}}),de("border",{defaultValue:"0px solid #000",parser:function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(W(t,"borderTopWidth",r,!1,"0px")+" "+W(t,"borderTopStyle",r,!1,"solid")+" "+W(t,"borderTopColor",r,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(he)||["#000"])[0]}}),de("borderWidth",{parser:_e("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),de("float,cssFloat,styleFloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new pe(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var Ie=function(t){var e,i=this.t,s=i.filter||W(this.data,"filter")||"",r=0|this.s+this.c*t;100===r&&(-1===s.indexOf("atrix(")&&-1===s.indexOf("radient(")&&-1===s.indexOf("oader(")?(i.removeAttribute("filter"),e=!W(this.data,"filter")):(i.filter=s.replace(x,""),e=!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexOf("pacity")?0===r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(T,"opacity="+r))};de("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,s,n,a){var o=parseFloat(W(t,"opacity",r,!1,"1")),h=t.style,l="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),l&&1===o&&"hidden"===W(t,"visibility",r)&&0!==e&&(o=0),U?n=new pe(h,"opacity",o,e-o,n):(n=new pe(h,"opacity",100*o,100*(e-o),n),n.xn1=l?1:0,h.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=Ie),l&&(n=new pe(h,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",s._overwriteProps.push(n.n),s._overwriteProps.push(i)),n}});var Ee=function(t,e){e&&(t.removeProperty?("ms"===e.substr(0,2)&&(e="M"+e.substr(1)),t.removeProperty(e.replace(P,"-$1").toLowerCase())):t.removeAttribute(e))},Fe=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Ee(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};de("className",{parser:function(t,e,s,n,a,o,h){var l,_,u,p,c,f=t.getAttribute("class")||"",m=t.style.cssText;if(a=n._classNamePT=new pe(t,s,0,0,a,2),a.setRatio=Fe,a.pr=-11,i=!0,a.b=f,_=$(t,r),u=t._gsClassPT){for(p={},c=u.data;c;)p[c.p]=1,c=c._next;u.setRatio(1)}return t._gsClassPT=a,a.e="="!==e.charAt(1)?e:f.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),n._tween._duration&&(t.setAttribute("class",a.e),l=H(t,_,$(t),h,p),t.setAttribute("class",f),a.data=l.firstMPT,t.style.cssText=m,a=a.xfirst=n.parse(t,l.difs,a,o)),a}});var Le=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,s,r,n=this.t.style,a=o.transform.parse;if("all"===this.e)n.cssText="",r=!0;else for(e=this.e.split(" ").join("").split(","),s=e.length;--s>-1;)i=e[s],o[i]&&(o[i].parse===a?r=!0:i="transformOrigin"===i?xe:o[i].p),Ee(n,i);r&&(Ee(n,Te),this.t._gsTransform&&delete this.t._gsTransform)}};for(de("clearProps",{parser:function(t,e,s,r,n){return n=new pe(t,s,0,0,n,2),n.setRatio=Le,n.e=e,n.pr=-10,n.data=r._tween,i=!0,n}}),h="bezier,throwProps,physicsProps,physics2D".split(","),fe=h.length;fe--;)ge(h[fe]);h=a.prototype,h._firstPT=null,h._onInitTween=function(t,e,o){if(!t.nodeType)return!1;this._target=t,this._tween=o,this._vars=e,l=e.autoRound,i=!1,s=e.suffixMap||a.suffixMap,r=G(t,""),n=this._overwriteProps;var h,p,f,m,d,g,v,y,T,x=t.style;
|
16 |
+
if(_&&""===x.zIndex&&(h=W(t,"zIndex",r),("auto"===h||""===h)&&this._addLazySet(x,"zIndex",0)),"string"==typeof e&&(m=x.cssText,h=$(t,r),x.cssText=m+";"+e,h=H(t,h,$(t)).difs,!U&&w.test(e)&&(h.opacity=parseFloat(RegExp.$1)),e=h,x.cssText=m),this._firstPT=p=this.parse(t,e,null),this._transformType){for(T=3===this._transformType,Te?u&&(_=!0,""===x.zIndex&&(v=W(t,"zIndex",r),("auto"===v||""===v)&&this._addLazySet(x,"zIndex",0)),c&&this._addLazySet(x,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(T?"visible":"hidden"))):x.zoom=1,f=p;f&&f._next;)f=f._next;y=new pe(t,"transform",0,0,null,2),this._linkCSSP(y,null,f),y.setRatio=T&&be?Me:Te?ze:De,y.data=this._transform||Oe(t,r,!0),n.pop()}if(i){for(;p;){for(g=p._next,f=m;f&&f.pr>p.pr;)f=f._next;(p._prev=f?f._prev:d)?p._prev._next=p:m=p,(p._next=f)?f._prev=p:d=p,p=g}this._firstPT=m}return!0},h.parse=function(t,e,i,n){var a,h,_,u,p,c,f,m,d,g,v=t.style;for(a in e)c=e[a],h=o[a],h?i=h.parse(t,c,a,this,i,n,e):(p=W(t,a,r)+"",d="string"==typeof c,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexOf("Color")||d&&b.test(c)?(d||(c=oe(c),c=(c.length>3?"rgba(":"rgb(")+c.join(",")+")"),i=ce(v,a,p,c,!0,"transparent",i,0,n)):!d||-1===c.indexOf(" ")&&-1===c.indexOf(",")?(_=parseFloat(p),f=_||0===_?p.substr((_+"").length):"",(""===p||"auto"===p)&&("width"===a||"height"===a?(_=te(t,a,r),f="px"):"left"===a||"top"===a?(_=Q(t,a,r),f="px"):(_="opacity"!==a?0:1,f="")),g=d&&"="===c.charAt(1),g?(u=parseInt(c.charAt(0)+"1",10),c=c.substr(2),u*=parseFloat(c),m=c.replace(y,"")):(u=parseFloat(c),m=d?c.substr((u+"").length)||"":""),""===m&&(m=a in s?s[a]:f),c=u||0===u?(g?u+_:u)+m:e[a],f!==m&&""!==m&&(u||0===u)&&_&&(_=Z(t,a,_,f),"%"===m?(_/=Z(t,a,100,"%")/100,e.strictUnits!==!0&&(p=_+"%")):"em"===m?_/=Z(t,a,1,"em"):"px"!==m&&(u=Z(t,a,u,m),m="px"),g&&(u||0===u)&&(c=u+_+m)),g&&(u+=_),!_&&0!==_||!u&&0!==u?void 0!==v[a]&&(c||"NaN"!=c+""&&null!=c)?(i=new pe(v,a,u||_||0,0,i,-1,a,!1,0,p,c),i.xs0="none"!==c||"display"!==a&&-1===a.indexOf("Style")?c:p):j("invalid "+a+" tween value: "+e[a]):(i=new pe(v,a,_,u-_,i,0,a,l!==!1&&("px"===m||"zIndex"===a),0,p,c),i.xs0=m)):i=ce(v,a,p,c,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n);return i},h.setRatio=function(t){var e,i,s,r=this._firstPT,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=Math.round(e):n>e&&e>-n&&(e=0),r.type)if(1===r.type)if(s=r.l,2===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;)2!==r.type?r.t[r.p]=r.e:r.setRatio(t),r=r._next},h._enableTransforms=function(t){this._transform=this._transform||Oe(this._target,r,!0),this._transformType=this._transform.svg&&ve||!t&&3!==this._transformType?2:3};var Ne=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};h._addLazySet=function(t,e,i){var s=this._firstPT=new pe(t,e,0,0,this._firstPT,2);s.e=i,s.setRatio=Ne,s.data=this},h._linkCSSP=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,s=!0),i?i._next=t:s||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,s,r,n=e;if(e.autoAlpha||e.alpha){n={};for(s in e)n[s]=e[s];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return e.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),t.prototype._kill.call(this,n)};var Xe=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;--r>-1;)Xe(t[r],e,i);else for(s=t.childNodes,r=s.length;--r>-1;)n=s[r],a=n.type,n.style&&(e.push($(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||Xe(n,e,i)};return a.cascadeTo=function(t,i,s){var r,n,a,o=e.to(t,i,s),h=[o],l=[],_=[],u=[],p=e._internals.reservedProps;for(t=o._targets||o.target,Xe(t,l,u),o.render(i,!0),Xe(t,_),o.render(0,!0),o._enabled(!0),r=u.length;--r>-1;)if(n=H(u[r],l[r],_[r]),n.firstMPT){n=n.difs;for(a in s)p[a]&&(n[a]=s[a]);h.push(e.to(u[r],i,n))}return h},t.activate([a]),a},!0),function(){var t=_gsScope._gsDefine.plugin({propName:"roundProps",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),e=t.prototype;e._onInitAllProps=function(){for(var t,e,i,s=this._tween,r=s.vars.roundProps instanceof Array?s.vars.roundProps:s.vars.roundProps.split(","),n=r.length,a={},o=s._propLookup.roundProps;--n>-1;)a[r[n]]=1;for(n=r.length;--n>-1;)for(t=r[n],e=s._firstPT;e;)i=e._next,e.pg?e.t._roundProps(a,!0):e.n===t&&(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstPT===e&&(s._firstPT=i),e._next=e._prev=null,s._propLookup[t]=o),e=i;return!1},e._add=function(t,e,i,s){this._addTween(t,e,i,i+s,e,!0),this._overwriteProps.push(e)}}(),_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.3.3",init:function(t,e){var i,s,r;if("function"!=typeof t.setAttribute)return!1;this._target=t,this._proxy={},this._start={},this._end={};for(i in e)this._start[i]=this._proxy[i]=s=t.getAttribute(i),r=this._addTween(this._proxy,i,parseFloat(s),e[i],i),this._end[i]=r?r.s+r.c:e[i],this._overwriteProps.push(i);return!0},set:function(t){this._super.setRatio.call(this,t);for(var e,i=this._overwriteProps,s=i.length,r=1===t?this._end:t?this._proxy:this._start;--s>-1;)e=i[s],this._target.setAttribute(e,r[e]+"")}}),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.2.1",API:2,init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,h=e.useRadians===!0?2*Math.PI:360,l=1e-6;for(i in e)"useRadians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexOf("short")&&(a%=h,a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h)%h-(0|a/h)*h:-1!==s.indexOf("ccw")&&a>0&&(a=(a-9999999999*h)%h-(0|a/h)*h)),(a>l||-l>a)&&(this._addTween(t,i,r,r+a,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=_gsScope.GreenSockGlobals||_gsScope,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},c=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},f=u("Back",c("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),c("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),c("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),c=u,f=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--c>-1;)i=f?Math.random():1/u*c,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),f?s+=Math.random()*r-.5*r:c%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new p(1,1,null),c=u;--c>-1;)a=l[c],o=new p(a.x,a.y,o);this._prev=new p(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(Math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*a/this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*a/this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),f},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t,e){"use strict";var i=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!i.TweenLite){var s,r,n,a,o,h=function(t){var e,s=t.split("."),r=i;for(e=0;s.length>e;e++)r[s[e]]=r=r[s[e]]||{};return r},l=h("com.greensock"),_=1e-10,u=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},p=function(){},c=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),f={},m=function(s,r,n,a){this.sc=f[s]?f[s].sc:[],f[s]=this,this.gsClass=null,this.func=n;var o=[];this.check=function(l){for(var _,u,p,c,d=r.length,g=d;--d>-1;)(_=f[r[d]]||new m(r[d],[])).gsClass?(o[d]=_.gsClass,g--):l&&_.sc.push(this);if(0===g&&n)for(u=("com.greensock."+s).split("."),p=u.pop(),c=h(u.join("."))[p]=this.gsClass=n.apply(n,o),a&&(i[p]=c,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return c}):s===e&&"undefined"!=typeof module&&module.exports&&(module.exports=c)),d=0;this.sc.length>d;d++)this.sc[d].check()},this.check(!0)},d=t._gsDefine=function(t,e,i,s){return new m(t,e,i,s)},g=l._class=function(t,e,i){return e=e||function(){},d(t,[],function(){return e},i),e};d.globals=i;var v=[0,0,1,1],y=[],T=g("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?v.concat(e):v},!0),w=T.map={},x=T.register=function(t,e,i,s){for(var r,n,a,o,h=e.split(","),_=h.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=h[_],r=s?g("easing."+n,null,!0):l.easing[n]||{},a=u.length;--a>-1;)o=u[a],w[n+"."+o]=w[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(n=T.prototype,n._calcEnd=!1,n.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},s=["Linear","Quad","Cubic","Quart","Quint,Strong"],r=s.length;--r>-1;)n=s[r]+",Power"+r,x(new T(null,null,1,r),n,"easeOut",!0),x(new T(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),x(new T(null,null,3,r),n,"easeInOut");w.linear=l.easing.Linear.easeIn,w.swing=l.easing.Quad.easeInOut;var b=g("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});n=b.prototype,n.addEventListener=function(t,e,i,s,r){r=r||0;var n,h,l=this._listeners[t],_=0;for(null==l&&(this._listeners[t]=l=[]),h=l.length;--h>-1;)n=l[h],n.c===e&&n.s===i?l.splice(h,1):0===_&&r>n.pr&&(_=h+1);l.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==a||o||a.wake()},n.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},n.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s&&(s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i))};var P=t.requestAnimationFrame,S=t.cancelAnimationFrame,k=Date.now||function(){return(new Date).getTime()},R=k();for(s=["ms","moz","webkit","o"],r=s.length;--r>-1&&!P;)P=t[s[r]+"RequestAnimationFrame"],S=t[s[r]+"CancelAnimationFrame"]||t[s[r]+"CancelRequestAnimationFrame"];g("Ticker",function(t,e){var i,s,r,n,h,l=this,u=k(),c=e!==!1&&P,f=500,m=33,d=function(t){var e,a,o=k()-R;o>f&&(u+=o-m),R+=o,l.time=(R-u)/1e3,e=l.time-h,(!i||e>0||t===!0)&&(l.frame++,h+=e+(e>=n?.004:n-e),a=!0),t!==!0&&(r=s(d)),a&&l.dispatchEvent("tick")};b.call(l),l.time=l.frame=0,l.tick=function(){d(!0)},l.lagSmoothing=function(t,e){f=t||1/_,m=Math.min(e,f,0)},l.sleep=function(){null!=r&&(c&&S?S(r):clearTimeout(r),s=p,r=null,l===a&&(o=!1))},l.wake=function(){null!==r?l.sleep():l.frame>10&&(R=k()-f+5),s=0===i?p:c&&P?P:function(t){return setTimeout(t,0|1e3*(h-l.time)+1)},l===a&&(o=!0),d(2)},l.fps=function(t){return arguments.length?(i=t,n=1/(i||60),h=this.time+n,l.wake(),void 0):i},l.useRAF=function(t){return arguments.length?(l.sleep(),c=t,l.fps(i),void 0):c},l.fps(t),setTimeout(function(){c&&(!r||5>l.frame)&&l.useRAF(!1)},1500)}),n=l.Ticker.prototype=new l.events.EventDispatcher,n.constructor=l.Ticker;var A=g("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,B){o||a.wake();var i=this.vars.useFrames?j:B;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});a=A.ticker=new l.Ticker,n=A.prototype,n._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var C=function(){o&&k()-R>2e3&&a.wake(),setTimeout(C,2e3)};C(),n.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},n.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},n.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},n.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},n.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},n.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},n.render=function(){},n.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},n.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},n._enabled=function(t,e){return o||a.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(){return this._enabled(!1,!1)},n.kill=function(t,e){return this._kill(t,e),this},n._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},n._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},n.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=c(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},n.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},n.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},n.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},n.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(o||a.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(this.render(t,e,!1),I.length&&q())}return this},n.progress=n.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},n.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},n.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},n.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||_,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},n.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){o||t||a.wake();var e=this._timeline,i=e.rawTime(),s=i-this._pauseTime;!t&&e.smoothChildTiming&&(this._startTime+=s,this._uncache(!1)),this._pauseTime=t?i:null,this._paused=t,this._active=this.isActive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothChildTiming?this._totalTime:(i-this._startTime)/this._timeScale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var O=g("core.SimpleTimeline",function(t){A.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});n=O.prototype=new A,n.constructor=O,n.kill()._gc=!1,n._first=n._last=n._recent=null,n._sortChildren=!1,n.add=n.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},n.rawTime=function(){return o||a.wake(),this._totalTime};var D=g("TweenLite",function(e,i,s){if(A.call(this,i,s),this.render=D.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:D.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),h=this.vars.overwrite;if(this._overwrite=h=null==h?Y[D.defaultOverwrite]:"number"==typeof h?h>>0:Y[h],(o||e instanceof Array||e.push&&c(e))&&"number"!=typeof e[0])for(this._targets=a=u(e),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(u(n))):(this._siblings[r]=V(n,this,!1),1===h&&this._siblings[r].length>1&&W(n,this,null,1,this._siblings[r])):(n=a[r--]=D.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=V(e,this,!1),1===h&&this._siblings.length>1&&W(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-_,this.render(-this._delay))},!0),M=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},z=function(t,e){var i,s={};for(i in t)U[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!L[i]||L[i]&&L[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};n=D.prototype=new A,n.constructor=D,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,D.version="1.14.2",D.defaultEase=n._ease=new T(null,null,1,1),D.defaultOverwrite="auto",D.ticker=a,D.autoSleep=!0,D.lagSmoothing=function(t,e){a.lagSmoothing(t,e)},D.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(D.selector=i,i(e)):"undefined"==typeof document?e:document.querySelectorAll?document.querySelectorAll(e):document.getElementById("#"===e.charAt(0)?e.substr(1):e)};var I=[],E={},F=D._internals={isArray:c,isSelector:M,lazyTweens:I},L=D._plugins={},N=F.tweenLookup={},X=0,U=F.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1},Y={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},j=A._rootFramesTimeline=new O,B=A._rootTimeline=new O,q=F.lazyRender=function(){var t,e=I.length;for(E={};--e>-1;)t=I[e],t&&t._lazy!==!1&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);I.length=0};B._startTime=a.time,j._startTime=a.frame,B._active=j._active=!0,setTimeout(q,1),A._updateRoot=D.render=function(){var t,e,i;if(I.length&&q(),B.render((a.time-B._startTime)*B._timeScale,!1,!1),j.render((a.frame-j._startTime)*j._timeScale,!1,!1),I.length&&q(),!(a.frame%120)){for(i in N){for(e=N[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete N[i]}if(i=B._first,(!i||i._paused)&&D.autoSleep&&!j._first&&1===a._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||a.sleep()}}},a.addEventListener("tick",A._updateRoot);var V=function(t,e,i){var s,r,n=t._gsTweenID;if(N[n||(t._gsTweenID=n="t"+X++)]||(N[n]={target:t,tweens:[]}),e&&(s=N[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return N[n].tweens},G=function(t,e,i,s){var r,n,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,s)),a=D.onOverwrite,a&&(n=a(t,e,i,s)),r!==!1&&n!==!1},W=function(t,e,i,s,r){var n,a,o,h;if(1===s||s>=4){for(h=r.length,n=0;h>n;n++)if((o=r[n])!==e)o._gc||G(o,e)&&o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var l,u=e._startTime+_,p=[],c=0,f=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(l=l||Z(e,0,f),0===Z(o,l,f)&&(p[c++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((f||!o._initted)&&2e-10>=u-o._startTime||(p[c++]=o)));for(n=c;--n>-1;)if(o=p[n],2===s&&o._kill(i,t,e)&&(a=!0),2!==s||!o._firstPT&&o._initted){if(2!==s&&!G(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},Z=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*_>n-e?_:(n+=t.totalDuration()/t._timeScale/r)>e+_?0:n-e-_};n._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,h=!!n.immediateRender,l=n.ease;if(n.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(s in n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=h&&n.lazy!==!1,r.startAt=r.delay=null,this._startAt=D.to(this.target,0,r),h)if(this._time>0)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(h=!1),i={};for(s in n)U[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&n.lazy!==!1,i.immediateRender=h,this._startAt=D.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=l=l?l instanceof T?l:"function"==typeof l?new T(l,n.easeParams):w[l]||D.defaultEase:D.defaultEase,n.easeParams instanceof Array&&l.config&&(this._ease=l.config.apply(l,n.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&D._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0},n._initProps=function(e,i,s,r){var n,a,o,h,l,_;if(null==e)return!1;E[e._gsTweenID]&&q(),this.vars.css||e.style&&e!==t&&e.nodeType&&L.css&&this.vars.autoCSS!==!1&&z(this.vars,e);for(n in this.vars){if(_=this.vars[n],U[n])_&&(_ instanceof Array||_.push&&c(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(L[n]&&(h=new L[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=l={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:h._priority},a=h._overwriteProps.length;--a>-1;)i[h._overwriteProps[a]]=this._firstPT;(h._priority||h._onInitAllProps)&&(o=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=l={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},l.s=l.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),l.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-l.s||0;l&&l._next&&(l._next._prev=l)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&W(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(E[e._gsTweenID]=!0),o)},n.render=function(t,e,i){var s,r,n,a,o=this._time,h=this._duration,l=this._rawPrevTime;if(t>=h)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete"),0===h&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>l||l===_)&&l!==t&&(i=!0,l>_&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||l===t?t:_);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===h&&l>0&&l!==_)&&(r="onReverseComplete",s=this._reversed),0>t&&(this._active=!1,0===h&&(this._initted||!this.vars.lazy||i)&&(l>=0&&(i=!0),this._rawPrevTime=a=!e||t||l===t?t:_)),this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var u=t/h,p=this._easeType,c=this._easePower;(1===p||3===p&&u>=.5)&&(u=1-u),3===p&&(u*=2),1===c?u*=u:2===c?u*=u*u:3===c?u*=u*u*u:4===c&&(u*=u*u*u*u),this.ratio=1===p?1-u:2===p?u:.5>t/h?u/2:1-u/2}else this.ratio=this._ease.getRatio(t/h);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=l,I.push(this),this._lazy=[t,e],void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/h):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===h)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||y))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&t!==-1e-4&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||y)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&t!==-1e-4&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||y),0===h&&this._rawPrevTime===_&&a!==_&&(this._rawPrevTime=0))}},n._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:D.selector(e)||e;
|
17 |
+
var s,r,n,a,o,h,l,_,u;if((c(e)||M(e))&&"number"!=typeof e[0])for(s=e.length;--s>-1;)this._kill(t,e[s])&&(h=!0);else{if(this._targets){for(s=this._targets.length;--s>-1;)if(e===this._targets[s]){o=this._propLookup[s]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[s]=t?this._overwrittenProps[s]||{}:"all";break}}else{if(e!==this.target)return!1;o=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(o){if(l=t||o,_=t!==r&&"all"!==r&&t!==o&&("object"!=typeof t||!t._tempKill),i&&(D.onOverwrite||this.vars.onOverwrite)){for(n in l)o[n]&&(u||(u=[]),u.push(n));if(!G(this,i,e,u))return!1}for(n in l)(a=o[n])&&(a.pg&&a.t._kill(l)&&(h=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete o[n]),_&&(r[n]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return h},n.invalidate=function(){return this._notifyPluginsOfEnabled&&D._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],A.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-_,this.render(-this._delay)),this},n._enabled=function(t,e){if(o||a.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=V(s[i],this,!0);else this._siblings=V(this.target,this,!0)}return A.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?D._onPluginEvent(t?"_onEnable":"_onDisable",this):!1},D.to=function(t,e,i){return new D(t,e,i)},D.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new D(t,e,i)},D.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new D(t,e,s)},D.delayedCall=function(t,e,i,s,r){return new D(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:r,overwrite:0})},D.set=function(t,e){return new D(t,0,e)},D.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:D.selector(t)||t;var i,s,r,n;if((c(t)||M(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(D.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=V(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},D.killTweensOf=D.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=D.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var Q=g("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=Q.prototype},!0);if(n=Q.prototype,Q.version="1.10.1",Q.API=2,n._firstPT=null,n._addTween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},n.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=Math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},n._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},n._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},D._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},Q.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===Q.API&&(L[(new t[e])._propName]=t[e]);return!0},d.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=g("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){Q.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new Q(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,Q.activate([a]),a},s=t._gsQueue){for(r=0;s.length>r;r++)s[r]();for(n in f)f[n].func||t.console.log("GSAP encountered missing dependency: com.greensock."+n)}o=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenMax");
|
assets/scripts/gsap/jquery.gsap.min.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* VERSION: 0.1.9
|
3 |
+
* DATE: 2014-07-22
|
4 |
+
* UPDATES AND DOCS AT: http://www.greensock.com/jquery-gsap-plugin/
|
5 |
+
*
|
6 |
+
* Requires TweenLite version 1.8.0 or higher and CSSPlugin.
|
7 |
+
*
|
8 |
+
* @license Copyright (c) 2014, GreenSock. All rights reserved.
|
9 |
+
* This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
|
10 |
+
* Club GreenSock members, the software agreement that was issued with your membership.
|
11 |
+
*
|
12 |
+
* @author: Jack Doyle, jack@greensock.com
|
13 |
+
*/
|
14 |
+
(function(t){"use strict";var e,i,s,r=t.fn.animate,n=t.fn.stop,a=!0,o=function(t){var e,i={};for(e in t)i[e]=t[e];return i},h={overwrite:1,delay:1,useFrames:1,runBackwards:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,autoCSS:1},l=function(t,e){for(var i in h)h[i]&&void 0!==t[i]&&(e[i]=t[i])},_=function(t){return function(e){return t.getRatio(e)}},u={},c=function(){var r,n,a,o=window.GreenSockGlobals||window;if(e=o.TweenMax||o.TweenLite,e&&(r=(e.version+".0.0").split("."),n=!(Number(r[0])>0&&Number(r[1])>7),o=o.com.greensock,i=o.plugins.CSSPlugin,u=o.easing.Ease.map||{}),!e||!i||n)return e=null,!s&&window.console&&(window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s)."+(n?" Version "+r.join(".")+" is too old.":"")),s=!0),void 0;if(t.easing){for(a in u)t.easing[a]=_(u[a]);c=!1}};t.fn.animate=function(s,n,h,_){if(s=s||{},c&&(c(),!e||!i))return r.call(this,s,n,h,_);if(!a||s.skipGSAP===!0||"object"==typeof n&&"function"==typeof n.step||null!=s.scrollTop||null!=s.scrollLeft)return r.call(this,s,n,h,_);var f,p,m,d,g=t.speed(n,h,_),v={ease:u[g.easing]||(g.easing===!1?u.linear:u.swing)},y=this,T="object"==typeof n?n.specialEasing:null;for(p in s){if(f=s[p],f instanceof Array&&u[f[1]]&&(T=T||{},T[p]=f[1],f=f[0]),"toggle"===f||"hide"===f||"show"===f)return r.call(this,s,n,h,_);v[-1===p.indexOf("-")?p:t.camelCase(p)]=f}if(T){v=o(v),d=[];for(p in T)f=d[d.length]={},l(v,f),f.ease=u[T[p]]||v.ease,-1!==p.indexOf("-")&&(p=t.camelCase(p)),f[p]=v[p],delete v[p];0===d.length&&(d=null)}return m=function(i){var s,r=o(v);if(d)for(s=d.length;--s>-1;)e.to(this,t.fx.off?0:g.duration/1e3,d[s]);r.onComplete=function(){i?i():g.old&&t(this).each(g.old)},e.to(this,t.fx.off?0:g.duration/1e3,r)},g.queue!==!1?(y.queue(g.queue,m),"function"==typeof g.old&&y.queue(g.queue,function(t){g.old.call(this),t()})):m.call(y),y},t.fn.stop=function(t,i){if(n.call(this,t,i),e){if(i)for(var s,r=e.getTweensOf(this),a=r.length;--a>-1;)s=r[a].totalTime()/r[a].totalDuration(),s>0&&1>s&&r[a].seek(r[a].totalDuration());e.killTweensOf(this)}return this},t.gsap={enabled:function(t){a=t},version:"0.1.9"}})(jQuery);
|
assets/scripts/jquery.cookie.js
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery Cookie Plugin v1.4.1
|
3 |
+
* https://github.com/carhartl/jquery-cookie
|
4 |
+
*
|
5 |
+
* Copyright 2013 Klaus Hartl
|
6 |
+
* Released under the MIT license
|
7 |
+
*/
|
8 |
+
(function (factory) {
|
9 |
+
if (typeof define === 'function' && define.amd) {
|
10 |
+
// AMD
|
11 |
+
define(['jquery'], factory);
|
12 |
+
} else if (typeof exports === 'object') {
|
13 |
+
// CommonJS
|
14 |
+
factory(require('jquery'));
|
15 |
+
} else {
|
16 |
+
// Browser globals
|
17 |
+
factory(jQuery);
|
18 |
+
}
|
19 |
+
}(function ($) {
|
20 |
+
|
21 |
+
var pluses = /\+/g;
|
22 |
+
|
23 |
+
function encode(s) {
|
24 |
+
return config.raw ? s : encodeURIComponent(s);
|
25 |
+
}
|
26 |
+
|
27 |
+
function decode(s) {
|
28 |
+
return config.raw ? s : decodeURIComponent(s);
|
29 |
+
}
|
30 |
+
|
31 |
+
function stringifyCookieValue(value) {
|
32 |
+
return encode(config.json ? JSON.stringify(value) : String(value));
|
33 |
+
}
|
34 |
+
|
35 |
+
function parseCookieValue(s) {
|
36 |
+
if (s.indexOf('"') === 0) {
|
37 |
+
// This is a quoted cookie as according to RFC2068, unescape...
|
38 |
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
39 |
+
}
|
40 |
+
|
41 |
+
try {
|
42 |
+
// Replace server-side written pluses with spaces.
|
43 |
+
// If we can't decode the cookie, ignore it, it's unusable.
|
44 |
+
// If we can't parse the cookie, ignore it, it's unusable.
|
45 |
+
s = decodeURIComponent(s.replace(pluses, ' '));
|
46 |
+
return config.json ? JSON.parse(s) : s;
|
47 |
+
} catch(e) {}
|
48 |
+
}
|
49 |
+
|
50 |
+
function read(s, converter) {
|
51 |
+
var value = config.raw ? s : parseCookieValue(s);
|
52 |
+
return $.isFunction(converter) ? converter(value) : value;
|
53 |
+
}
|
54 |
+
|
55 |
+
var config = $.cookie = function (key, value, options) {
|
56 |
+
|
57 |
+
// Write
|
58 |
+
|
59 |
+
if (value !== undefined && !$.isFunction(value)) {
|
60 |
+
options = $.extend({}, config.defaults, options);
|
61 |
+
|
62 |
+
if (typeof options.expires === 'number') {
|
63 |
+
var days = options.expires, t = options.expires = new Date();
|
64 |
+
t.setTime(+t + days * 864e+5);
|
65 |
+
}
|
66 |
+
|
67 |
+
return (document.cookie = [
|
68 |
+
encode(key), '=', stringifyCookieValue(value),
|
69 |
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
70 |
+
options.path ? '; path=' + options.path : '',
|
71 |
+
options.domain ? '; domain=' + options.domain : '',
|
72 |
+
options.secure ? '; secure' : ''
|
73 |
+
].join(''));
|
74 |
+
}
|
75 |
+
|
76 |
+
// Read
|
77 |
+
|
78 |
+
var result = key ? undefined : {};
|
79 |
+
|
80 |
+
// To prevent the for loop in the first place assign an empty array
|
81 |
+
// in case there are no cookies at all. Also prevents odd result when
|
82 |
+
// calling $.cookie().
|
83 |
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
84 |
+
|
85 |
+
for (var i = 0, l = cookies.length; i < l; i++) {
|
86 |
+
var parts = cookies[i].split('=');
|
87 |
+
var name = decode(parts.shift());
|
88 |
+
var cookie = parts.join('=');
|
89 |
+
|
90 |
+
if (key && key === name) {
|
91 |
+
// If second argument (value) is a function it's a converter...
|
92 |
+
result = read(cookie, value);
|
93 |
+
break;
|
94 |
+
}
|
95 |
+
|
96 |
+
// Prevent storing a cookie that we couldn't decode.
|
97 |
+
if (!key && (cookie = read(cookie)) !== undefined) {
|
98 |
+
result[name] = cookie;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
return result;
|
103 |
+
};
|
104 |
+
|
105 |
+
config.defaults = {};
|
106 |
+
|
107 |
+
$.removeCookie = function (key, options) {
|
108 |
+
if ($.cookie(key) === undefined) {
|
109 |
+
return false;
|
110 |
+
}
|
111 |
+
|
112 |
+
// Must not alter options, thus extending a fresh object...
|
113 |
+
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
114 |
+
return !$.cookie(key);
|
115 |
+
};
|
116 |
+
|
117 |
+
}));
|
assets/scripts/jquery.cookie.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(c){"function"===typeof define&&define.amd?define(["jquery"],c):"object"===typeof exports?c(require("jquery")):c(jQuery)})(function(c){function n(b){b=f.json?JSON.stringify(b):String(b);return f.raw?b:encodeURIComponent(b)}function m(b,e){var a;if(f.raw)a=b;else a:{var d=b;0===d.indexOf('"')&&(d=d.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{d=decodeURIComponent(d.replace(l," "));a=f.json?JSON.parse(d):d;break a}catch(g){}a=void 0}return c.isFunction(e)?e(a):a}var l=/\+/g,f= c.cookie=function(b,e,a){if(void 0!==e&&!c.isFunction(e)){a=c.extend({},f.defaults,a);if("number"===typeof a.expires){var d=a.expires,g=a.expires=new Date;g.setTime(+g+864E5*d)}return document.cookie=[f.raw?b:encodeURIComponent(b),"=",n(e),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}a=b?void 0:{};for(var d=document.cookie?document.cookie.split("; "):[],g=0,l=d.length;g<l;g++){var h=d[g].split("="),k; k=h.shift();k=f.raw?k:decodeURIComponent(k);h=h.join("=");if(b&&b===k){a=m(h,e);break}b||void 0===(h=m(h))||(a[k]=h)}return a};f.defaults={};c.removeCookie=function(b,e){if(void 0===c.cookie(b))return!1;c.cookie(b,"",c.extend({},e,{expires:-1}));return!c.cookie(b)}});
|
assets/scripts/popup-maker-admin.js
ADDED
@@ -0,0 +1,955 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var PopMakeAdmin;
|
2 |
+
(function () {
|
3 |
+
"use strict";
|
4 |
+
PopMakeAdmin = {
|
5 |
+
init: function () {
|
6 |
+
//PopMakeAdmin.initialize_tabs();
|
7 |
+
if (jQuery('body.post-type-popup form#post').length) {
|
8 |
+
PopMakeAdmin.initialize_popup_page();
|
9 |
+
PopMakeAdmin.attachQuickSearchListeners();
|
10 |
+
PopMakeAdmin.attachTabsPanelListeners();
|
11 |
+
}
|
12 |
+
if (jQuery('body.post-type-popup_theme form#post').length) {
|
13 |
+
PopMakeAdmin.initialize_theme_page();
|
14 |
+
}
|
15 |
+
PopMakeAdmin.initialize_color_pickers();
|
16 |
+
PopMakeAdmin.initialize_range_sliders();
|
17 |
+
|
18 |
+
PopMakeAdmin.initialize_marketing();
|
19 |
+
|
20 |
+
|
21 |
+
jQuery(document).keydown(function (event) {
|
22 |
+
if ((event.which === '115' || event.which === '83') && (event.ctrlKey || event.metaKey)) {
|
23 |
+
event.preventDefault();
|
24 |
+
jQuery('body.post-type-popup form#post, body.post-type-popup_theme form#post').submit();
|
25 |
+
return false;
|
26 |
+
}
|
27 |
+
return true;
|
28 |
+
});
|
29 |
+
|
30 |
+
},
|
31 |
+
initialize_marketing: function () {
|
32 |
+
jQuery('#menu-posts-popup ul li:eq(-1)').addClass('popmake-menu-highlight');
|
33 |
+
|
34 |
+
jQuery('.popmake-newsletter-optin').show();
|
35 |
+
|
36 |
+
jQuery('#popmake_popup_share').removeClass('postbox');
|
37 |
+
|
38 |
+
// Modal & Theme Indexes
|
39 |
+
if (jQuery('#posts-filter').length) {
|
40 |
+
jQuery('#wpbody-content > .wrap > h2:first').after(jQuery('.popmake-newsletter-optin'));
|
41 |
+
|
42 |
+
// Modal & Theme Editors
|
43 |
+
} else if (jQuery('#titlediv').length) {
|
44 |
+
jQuery('#titlediv').append(jQuery('.popmake-newsletter-optin'));
|
45 |
+
|
46 |
+
// Welcome & Similar Pages
|
47 |
+
} else if (jQuery('.about-text').length && jQuery('.popmake-badge').length) {
|
48 |
+
jQuery('.nav-tab-wrapper').after(jQuery('.popmake-newsletter-optin'));
|
49 |
+
|
50 |
+
// Settings & Other Tabbed Pages
|
51 |
+
} else if (jQuery('#poststuff .tabwrapper').length) {
|
52 |
+
jQuery('#poststuff .tabwrapper').prepend(jQuery('.popmake-newsletter-optin'));
|
53 |
+
|
54 |
+
// Settings & Other Tabbed Pages
|
55 |
+
} else if (jQuery('#poststuff').length) {
|
56 |
+
jQuery('#poststuff').prepend(jQuery('.popmake-newsletter-optin'));
|
57 |
+
}
|
58 |
+
|
59 |
+
jQuery('.popmake-optin-dismiss').on('click', function (event) {
|
60 |
+
var $this = jQuery(this);
|
61 |
+
event.preventDefault();
|
62 |
+
jQuery
|
63 |
+
.ajax({
|
64 |
+
url: ajaxurl,
|
65 |
+
type: 'POST',
|
66 |
+
dataType: 'json',
|
67 |
+
data: {
|
68 |
+
action: "popmake_optin",
|
69 |
+
popmake_nonce: popmake_admin_ajax_nonce,
|
70 |
+
optin_dismiss: true,
|
71 |
+
optin_name: $this.data('optin-name'),
|
72 |
+
optin_type: $this.data('optin-type')
|
73 |
+
}
|
74 |
+
})
|
75 |
+
.done(function (data) {
|
76 |
+
if (data.success) {
|
77 |
+
$this.parents('.popmake-optin').slideUp(function () {
|
78 |
+
jQuery(this).remove();
|
79 |
+
});
|
80 |
+
}
|
81 |
+
});
|
82 |
+
});
|
83 |
+
},
|
84 |
+
attachTabsPanelListeners : function () {
|
85 |
+
|
86 |
+
jQuery('#poststuff').bind('click', function (event) {
|
87 |
+
var selectAreaMatch, panelId, wrapper, items,
|
88 |
+
target = jQuery(event.target),
|
89 |
+
$parent,
|
90 |
+
$items,
|
91 |
+
$textarea,
|
92 |
+
$tag_area,
|
93 |
+
current_ids,
|
94 |
+
i,
|
95 |
+
$item,
|
96 |
+
id,
|
97 |
+
name,
|
98 |
+
removeItem;
|
99 |
+
|
100 |
+
|
101 |
+
if (target.hasClass('nav-tab-link')) {
|
102 |
+
|
103 |
+
panelId = target.data('type');
|
104 |
+
|
105 |
+
wrapper = target.parents('.posttypediv, .taxonomydiv').first();
|
106 |
+
|
107 |
+
// upon changing tabs, we want to uncheck all checkboxes
|
108 |
+
jQuery('input', wrapper).removeAttr('checked');
|
109 |
+
|
110 |
+
jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
|
111 |
+
jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
|
112 |
+
|
113 |
+
jQuery('.tabs', wrapper).removeClass('tabs');
|
114 |
+
target.parent().addClass('tabs');
|
115 |
+
|
116 |
+
// select the search bar
|
117 |
+
jQuery('.quick-search', wrapper).focus();
|
118 |
+
|
119 |
+
event.preventDefault();
|
120 |
+
} else if (target.hasClass('select-all')) {
|
121 |
+
selectAreaMatch = /#(.*)$/.exec(event.target.href);
|
122 |
+
if (selectAreaMatch && selectAreaMatch[1]) {
|
123 |
+
items = jQuery('#' + selectAreaMatch[1] + ' .tabs-panel-active .menu-item-title input');
|
124 |
+
if (items.length === items.filter(':checked').length) {
|
125 |
+
items.removeAttr('checked');
|
126 |
+
} else {
|
127 |
+
items.prop('checked', true);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
} else if (target.hasClass('submit-add-to-menu')) {
|
131 |
+
$parent = target.parents('.options');
|
132 |
+
$items = jQuery('.tabs-panel-active input[type="checkbox"]:checked', $parent);
|
133 |
+
$textarea = jQuery('textarea', $parent);
|
134 |
+
$tag_area = jQuery('.tagchecklist', $parent);
|
135 |
+
current_ids = $textarea.val().split(',');
|
136 |
+
|
137 |
+
for (i = 0; i < current_ids.length; i += 1) {
|
138 |
+
current_ids[i] = parseInt(current_ids[i], 10);
|
139 |
+
}
|
140 |
+
|
141 |
+
$items.each(function () {
|
142 |
+
$item = jQuery(this);
|
143 |
+
id = parseInt($item.val(), 10);
|
144 |
+
name = $item.parent('label').siblings('.menu-item-title').val();
|
145 |
+
|
146 |
+
if (jQuery.inArray(id, current_ids) === -1) {
|
147 |
+
current_ids.push(id);
|
148 |
+
}
|
149 |
+
|
150 |
+
$tag_area.append('<span><a class="ntdelbutton" data-id="' + id + '">X</a> ' + name + '</span>');
|
151 |
+
});
|
152 |
+
$textarea.text(current_ids.join(','));
|
153 |
+
|
154 |
+
} else if (target.hasClass('ntdelbutton')) {
|
155 |
+
$item = target;
|
156 |
+
removeItem = parseInt($item.data('id'), 10);
|
157 |
+
$parent = target.parents('.options');
|
158 |
+
$textarea = jQuery('textarea', $parent);
|
159 |
+
$tag_area = jQuery('.tagchecklist', $parent);
|
160 |
+
current_ids = $textarea.val().split(',');
|
161 |
+
|
162 |
+
current_ids = jQuery.grep(current_ids, function (value) {
|
163 |
+
return value !== removeItem;
|
164 |
+
});
|
165 |
+
|
166 |
+
$item.parent('span').remove();
|
167 |
+
$textarea.text(current_ids.join(','));
|
168 |
+
}
|
169 |
+
|
170 |
+
});
|
171 |
+
|
172 |
+
},
|
173 |
+
attachQuickSearchListeners : function () {
|
174 |
+
var searchTimer;
|
175 |
+
|
176 |
+
jQuery('.quick-search').keypress(function (event) {
|
177 |
+
var t = jQuery(this);
|
178 |
+
|
179 |
+
if (13 === event.which) {
|
180 |
+
PopMakeAdmin.updateQuickSearchResults(t);
|
181 |
+
return false;
|
182 |
+
}
|
183 |
+
|
184 |
+
if (searchTimer) {
|
185 |
+
clearTimeout(searchTimer);
|
186 |
+
}
|
187 |
+
|
188 |
+
searchTimer = setTimeout(function () {
|
189 |
+
PopMakeAdmin.updateQuickSearchResults(t);
|
190 |
+
}, 400);
|
191 |
+
}).attr('autocomplete', 'off');
|
192 |
+
},
|
193 |
+
updateQuickSearchResults : function (input) {
|
194 |
+
var panel, params,
|
195 |
+
minSearchLength = 2,
|
196 |
+
q = input.val();
|
197 |
+
|
198 |
+
if (q.length < minSearchLength) {
|
199 |
+
return;
|
200 |
+
}
|
201 |
+
|
202 |
+
panel = input.parents('.tabs-panel');
|
203 |
+
params = {
|
204 |
+
'action': 'menu-quick-search',
|
205 |
+
'response-format': 'markup',
|
206 |
+
'menu': null,
|
207 |
+
'menu-settings-column-nonce': jQuery('#menu-settings-column-nonce').val(),
|
208 |
+
'q': q,
|
209 |
+
'type': input.attr('name')
|
210 |
+
};
|
211 |
+
|
212 |
+
jQuery('.spinner', panel).show();
|
213 |
+
|
214 |
+
jQuery.post(ajaxurl, params, function (menuMarkup) {
|
215 |
+
PopMakeAdmin.processQuickSearchQueryResponse(menuMarkup, params, panel);
|
216 |
+
});
|
217 |
+
},
|
218 |
+
processQuickSearchQueryResponse : function (resp, req, panel) {
|
219 |
+
var matched, newID,
|
220 |
+
form = jQuery('form#post'),
|
221 |
+
takenIDs = {},
|
222 |
+
pattern = /menu-item[(\[\^]\]*/,
|
223 |
+
$items = jQuery('<div>').html(resp).find('li'),
|
224 |
+
$item;
|
225 |
+
|
226 |
+
if (!$items.length) {
|
227 |
+
jQuery('.categorychecklist', panel).html('<li><p>' + 'noResultsFound' + '</p></li>');
|
228 |
+
jQuery('.spinner', panel).hide();
|
229 |
+
return;
|
230 |
+
}
|
231 |
+
|
232 |
+
$items.each(function () {
|
233 |
+
$item = jQuery(this);
|
234 |
+
|
235 |
+
// make a unique DB ID number
|
236 |
+
matched = pattern.exec($item.html());
|
237 |
+
|
238 |
+
if (matched && matched[1]) {
|
239 |
+
newID = matched[1];
|
240 |
+
while (form.elements['menu-item[' + newID + '][menu-item-type]'] || takenIDs[newID]) {
|
241 |
+
newID = newID - 1;
|
242 |
+
}
|
243 |
+
|
244 |
+
takenIDs[newID] = true;
|
245 |
+
if (newID !== matched[1]) {
|
246 |
+
$item.html($item.html().replace(new RegExp(
|
247 |
+
'menu-item\\[' + matched[1] + '\\]',
|
248 |
+
'g'
|
249 |
+
),
|
250 |
+
'menu-item[' + newID + ']'
|
251 |
+
)
|
252 |
+
);
|
253 |
+
}
|
254 |
+
}
|
255 |
+
});
|
256 |
+
|
257 |
+
jQuery('.categorychecklist', panel).html($items);
|
258 |
+
jQuery('.spinner', panel).hide();
|
259 |
+
jQuery('[name^="menu-item"]').removeAttr('name');
|
260 |
+
},
|
261 |
+
initialize_color_pickers: function () {
|
262 |
+
var self = this;
|
263 |
+
jQuery('.color-picker').wpColorPicker({
|
264 |
+
clear: function (event) {
|
265 |
+
self.update_theme();
|
266 |
+
var $input = jQuery(event.currentTarget).prev();
|
267 |
+
if ($input.hasClass('background-color')) {
|
268 |
+
$input.parents('table').find('.background-opacity').hide();
|
269 |
+
}
|
270 |
+
}
|
271 |
+
});
|
272 |
+
},
|
273 |
+
initialize_range_sliders: function () {
|
274 |
+
|
275 |
+
var input,
|
276 |
+
$input,
|
277 |
+
$slider,
|
278 |
+
$plus,
|
279 |
+
$minus,
|
280 |
+
slider = jQuery('<input type="range"/>'),
|
281 |
+
plus = jQuery('<button class="popmake-range-plus">+</button>'),
|
282 |
+
minus = jQuery('<button class="popmake-range-minus">-</button>');
|
283 |
+
|
284 |
+
jQuery(document).on('input', 'input[type="range"]', function () {
|
285 |
+
var $this = jQuery(this);
|
286 |
+
$this.siblings('.popmake-range-manual').val($this.val());
|
287 |
+
});
|
288 |
+
jQuery('.popmake-range-manual').each(function () {
|
289 |
+
var $this = jQuery(this),
|
290 |
+
force = $this.data('force-minmax'),
|
291 |
+
min = parseInt($this.prop('min'), 0),
|
292 |
+
max = parseInt($this.prop('max'), 0),
|
293 |
+
step = parseInt($this.prop('step'), 0),
|
294 |
+
value = parseInt($this.val(), 0);
|
295 |
+
|
296 |
+
$slider = slider.clone();
|
297 |
+
$plus = plus.clone();
|
298 |
+
$minus = minus.clone();
|
299 |
+
|
300 |
+
if (force && value > max) {
|
301 |
+
value = max;
|
302 |
+
$this.val(value);
|
303 |
+
}
|
304 |
+
|
305 |
+
$slider
|
306 |
+
.prop({
|
307 |
+
'min': min || 0,
|
308 |
+
'max': force || (max && max > value) ? max : value * 1.5,
|
309 |
+
'step': step || value * 1.5 / 100,
|
310 |
+
'value': value
|
311 |
+
})
|
312 |
+
.on('change input', function () {
|
313 |
+
$this.trigger('input');
|
314 |
+
});
|
315 |
+
$this.next().after($minus, $plus);
|
316 |
+
$this.before($slider);
|
317 |
+
|
318 |
+
});
|
319 |
+
|
320 |
+
jQuery(document)
|
321 |
+
.on('click', '.popmake-range-manual', function () {
|
322 |
+
var $this = jQuery(this);
|
323 |
+
$this.removeProp('readonly');
|
324 |
+
})
|
325 |
+
.on('focusout', '.popmake-range-manual', function () {
|
326 |
+
var $this = jQuery(this);
|
327 |
+
$this.prop('readonly', true);
|
328 |
+
})
|
329 |
+
.on('change', '.popmake-range-manual', function () {
|
330 |
+
|
331 |
+
var $this = jQuery(this),
|
332 |
+
max = parseInt($this.prop('max'), 0),
|
333 |
+
step = parseInt($this.prop('step'), 0),
|
334 |
+
force = $this.data('force-minmax'),
|
335 |
+
value = parseInt($this.val(), 0);
|
336 |
+
|
337 |
+
$slider = $this.prev();
|
338 |
+
|
339 |
+
if (force && value > max) {
|
340 |
+
value = max;
|
341 |
+
$this.val(value);
|
342 |
+
}
|
343 |
+
|
344 |
+
$slider.prop({
|
345 |
+
'max': force || (max && max > value) ? max : value * 1.5,
|
346 |
+
'step': step || value * 1.5 / 100,
|
347 |
+
'value': value
|
348 |
+
});
|
349 |
+
|
350 |
+
})
|
351 |
+
.on('click', '.popmake-range-plus', function (event) {
|
352 |
+
|
353 |
+
event.preventDefault();
|
354 |
+
|
355 |
+
var $this = jQuery(this).siblings('.popmake-range-manual'),
|
356 |
+
step = parseInt($this.prop('step'), 0),
|
357 |
+
value = parseInt($this.val(), 0),
|
358 |
+
val = value + step;
|
359 |
+
|
360 |
+
$slider = $this.prev();
|
361 |
+
|
362 |
+
$this.val(val).trigger('input');
|
363 |
+
$slider.val(val);
|
364 |
+
|
365 |
+
})
|
366 |
+
.on('click', '.popmake-range-minus', function (event) {
|
367 |
+
|
368 |
+
event.preventDefault();
|
369 |
+
|
370 |
+
var $this = jQuery(this).siblings('.popmake-range-manual'),
|
371 |
+
step = parseInt($this.prop('step'), 0),
|
372 |
+
value = parseInt($this.val(), 0),
|
373 |
+
val = value - step;
|
374 |
+
|
375 |
+
$slider = $this.prev();
|
376 |
+
|
377 |
+
$this.val(val).trigger('input');
|
378 |
+
$slider.val(val);
|
379 |
+
|
380 |
+
});
|
381 |
+
|
382 |
+
|
383 |
+
input = document.createElement('input');
|
384 |
+
input.setAttribute('type', 'range');
|
385 |
+
if (input.type === 'text') {
|
386 |
+
jQuery('input[type=range]').each(function (index, input) {
|
387 |
+
$input = jQuery(input);
|
388 |
+
$slider = jQuery('<div />').slider({
|
389 |
+
min: parseInt($input.attr('min'), 10) || 0,
|
390 |
+
max: parseInt($input.attr('max'), 10) || 100,
|
391 |
+
value: parseInt($input.attr('value'), 10) || 0,
|
392 |
+
step: parseInt($input.attr('step'), 10) || 1,
|
393 |
+
slide: function (event, ui) {
|
394 |
+
jQuery(this).prev('input').val(ui.value);
|
395 |
+
}
|
396 |
+
});
|
397 |
+
$input.after($slider).hide();
|
398 |
+
});
|
399 |
+
}
|
400 |
+
},/*
|
401 |
+
initialize_tabs: function () {
|
402 |
+
//var active_tab = window.location.hash.replace('#top#','');
|
403 |
+
var active_tab = window.location.hash;
|
404 |
+
if (active_tab === '') {
|
405 |
+
active_tab = '#' + jQuery('.popmake-tab-content').eq(0).attr('id');
|
406 |
+
}
|
407 |
+
|
408 |
+
jQuery('.popmake-tab-content').hide();
|
409 |
+
jQuery(active_tab).show();
|
410 |
+
jQuery(active_tab + '-tab').addClass('nav-tab-active');
|
411 |
+
jQuery(window).scrollTop(0);
|
412 |
+
|
413 |
+
|
414 |
+
jQuery('#popmake-tabs .nav-tab').click(function (event) {
|
415 |
+
event.preventDefault();
|
416 |
+
|
417 |
+
jQuery('.popmake-tab-content').hide();
|
418 |
+
jQuery('.popmake-tab').removeClass('nav-tab-active');
|
419 |
+
|
420 |
+
var id = jQuery(this).attr('href');
|
421 |
+
jQuery(id).show();
|
422 |
+
jQuery(this).addClass('nav-tab-active');
|
423 |
+
|
424 |
+
if (history.pushState) {
|
425 |
+
history.pushState(null, null, id);
|
426 |
+
} else {
|
427 |
+
location.hash = id;
|
428 |
+
jQuery(window).scrollTop(0);
|
429 |
+
}
|
430 |
+
});
|
431 |
+
},*/
|
432 |
+
initialize_popup_page: function () {
|
433 |
+
|
434 |
+
var update_type_options = function ($this) {
|
435 |
+
var $options = $this.siblings('.options'),
|
436 |
+
excludes,
|
437 |
+
others;
|
438 |
+
|
439 |
+
if ($this.is(':checked')) {
|
440 |
+
$options.show();
|
441 |
+
|
442 |
+
if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
|
443 |
+
excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
|
444 |
+
others = $this.parents('.targeting_condition').siblings('.targeting_condition');
|
445 |
+
others.hide();
|
446 |
+
jQuery('> *', others).prop('disabled', true);
|
447 |
+
excludes.show();
|
448 |
+
jQuery('> *', excludes).removeProp('disabled');
|
449 |
+
} else {
|
450 |
+
jQuery('*', $options).removeProp('disabled');
|
451 |
+
}
|
452 |
+
} else {
|
453 |
+
$options.hide();
|
454 |
+
if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
|
455 |
+
excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
|
456 |
+
others = $this.parents('.targeting_condition').siblings('.targeting_condition');
|
457 |
+
others.show();
|
458 |
+
jQuery('> *', others).removeProp('disabled');
|
459 |
+
excludes.hide();
|
460 |
+
jQuery('> *', excludes).prop('disabled', true);
|
461 |
+
} else {
|
462 |
+
jQuery('*', $options).prop('disabled', true);
|
463 |
+
}
|
464 |
+
}
|
465 |
+
},
|
466 |
+
update_specific_checkboxes = function ($this) {
|
467 |
+
var $option = $this.parent().siblings('input[type="checkbox"]:first'),
|
468 |
+
exclude = $option.attr('name').indexOf("exclude") >= 0,
|
469 |
+
type = exclude ? $option.attr('name').replace('popup_targeting_condition_exclude_on_specific_', '') : $option.attr('name').replace('popup_targeting_condition_on_specific_', ''),
|
470 |
+
type_box = exclude ? jQuery('#exclude_on_specific_' + type) : jQuery('#on_specific_' + type);
|
471 |
+
if ($this.is(':checked')) {
|
472 |
+
if ($this.val() === 'true') {
|
473 |
+
$option.prop('checked', true);
|
474 |
+
type_box.show();
|
475 |
+
jQuery('*', type_box).removeProp('disabled');
|
476 |
+
} else if ($this.val() === '') {
|
477 |
+
$option.removeProp('checked');
|
478 |
+
type_box.hide();
|
479 |
+
jQuery('*', type_box).prop('disabled', true);
|
480 |
+
}
|
481 |
+
}
|
482 |
+
},
|
483 |
+
update_size = function () {
|
484 |
+
if (jQuery("#popup_display_size").val() === 'custom') {
|
485 |
+
jQuery('.custom-size-only').show();
|
486 |
+
jQuery('.responsive-size-only').hide();
|
487 |
+
if (jQuery('#popup_display_custom_height_auto').is(':checked')) {
|
488 |
+
jQuery('.custom-size-height-only').hide();
|
489 |
+
} else {
|
490 |
+
jQuery('.custom-size-height-only').show();
|
491 |
+
}
|
492 |
+
} else {
|
493 |
+
jQuery('.custom-size-only').hide();
|
494 |
+
if (jQuery("#popup_display_size").val() !== 'auto') {
|
495 |
+
jQuery('.responsive-size-only').show();
|
496 |
+
} else {
|
497 |
+
jQuery('.responsive-size-only').hide();
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
},
|
502 |
+
update_animation = function () {
|
503 |
+
jQuery('.animation-speed, .animation-origin').hide();
|
504 |
+
if (jQuery("#popup_display_animation_type").val() === 'fade') {
|
505 |
+
jQuery('.animation-speed').show();
|
506 |
+
} else {
|
507 |
+
if (jQuery("#popup_display_animation_type").val() !== 'none') {
|
508 |
+
jQuery('.animation-speed, .animation-origin').show();
|
509 |
+
}
|
510 |
+
}
|
511 |
+
},
|
512 |
+
update_location = function () {
|
513 |
+
var $this = jQuery('#popup_display_location'),
|
514 |
+
table = $this.parents('table'),
|
515 |
+
val = $this.val();
|
516 |
+
jQuery('tr.top, tr.right, tr.left, tr.bottom', table).hide();
|
517 |
+
if (val.indexOf("top") >= 0) {
|
518 |
+
jQuery('tr.top').show();
|
519 |
+
}
|
520 |
+
if (val.indexOf("left") >= 0) {
|
521 |
+
jQuery('tr.left').show();
|
522 |
+
}
|
523 |
+
if (val.indexOf("bottom") >= 0) {
|
524 |
+
jQuery('tr.bottom').show();
|
525 |
+
}
|
526 |
+
if (val.indexOf("right") >= 0) {
|
527 |
+
jQuery('tr.right').show();
|
528 |
+
}
|
529 |
+
};
|
530 |
+
|
531 |
+
jQuery('#popuptitlediv').insertAfter('#titlediv');
|
532 |
+
jQuery('[name^="menu-item"]').removeAttr('name');
|
533 |
+
|
534 |
+
jQuery(document)
|
535 |
+
.on('keydown', '#popuptitle', function (event) {
|
536 |
+
var keyCode = event.keyCode || event.which;
|
537 |
+
if (9 === keyCode) {
|
538 |
+
event.preventDefault();
|
539 |
+
jQuery('#title').focus();
|
540 |
+
}
|
541 |
+
})
|
542 |
+
.on('keydown', '#title, #popuptitle', function (event) {
|
543 |
+
var keyCode = event.keyCode || event.which,
|
544 |
+
target;
|
545 |
+
if (!event.shiftKey && 9 === keyCode) {
|
546 |
+
event.preventDefault();
|
547 |
+
target = jQuery(this).attr('id') === 'title' ? '#popuptitle' : '#insert-media-button';
|
548 |
+
jQuery(target).focus();
|
549 |
+
}
|
550 |
+
})
|
551 |
+
.on('keydown', '#popuptitle, #insert-media-button', function (event) {
|
552 |
+
var keyCode = event.keyCode || event.which,
|
553 |
+
target;
|
554 |
+
if (event.shiftKey && 9 === keyCode) {
|
555 |
+
event.preventDefault();
|
556 |
+
target = jQuery(this).attr('id') === 'popuptitle' ? '#title' : '#popuptitle';
|
557 |
+
jQuery(target).focus();
|
558 |
+
}
|
559 |
+
})
|
560 |
+
.on('submit', '#post', function (event) {
|
561 |
+
var title = jQuery('#title').val();
|
562 |
+
if (title.length === 0 || title.replace(/\s/g, '').length === 0) {
|
563 |
+
event.preventDefault();
|
564 |
+
jQuery('div#notice').remove();
|
565 |
+
jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter('h2');
|
566 |
+
jQuery('#title').focus();
|
567 |
+
jQuery('#ajax-loading').hide();
|
568 |
+
jQuery('#publish').removeClass('button-primary-disabled');
|
569 |
+
jQuery('#title').prop('required', 'required');
|
570 |
+
}
|
571 |
+
})
|
572 |
+
.on('change', "#popup_display_size", function () { update_size(); })
|
573 |
+
.on('click', '#popup_display_custom_height_auto', function () { update_size(); })
|
574 |
+
.on('change', "#popup_display_animation_type", function () { update_animation(); })
|
575 |
+
.on('change', '#popup_display_location', function () { update_location(); });
|
576 |
+
|
577 |
+
|
578 |
+
|
579 |
+
jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]')
|
580 |
+
.on('click', function () { update_type_options(jQuery(this)); })
|
581 |
+
.each(function () { update_type_options(jQuery(this)); });
|
582 |
+
|
583 |
+
jQuery('input[type="radio"][name*="radio_checkbox_"]')
|
584 |
+
.on('click', function () { update_specific_checkboxes(jQuery(this)); })
|
585 |
+
.each(function () { update_specific_checkboxes(jQuery(this)); });
|
586 |
+
|
587 |
+
jQuery('.posttypediv, .taxonomydiv').each(function () {
|
588 |
+
var $this = jQuery(this),
|
589 |
+
$tabs = jQuery('> ul li'),
|
590 |
+
$sections = jQuery('.tabs-panel', $this);
|
591 |
+
|
592 |
+
$tabs.removeClass('tabs');
|
593 |
+
$tabs.eq(0).addClass('tabs');
|
594 |
+
$sections.removeClass('tabs-panel-active').addClass('tabs-panel-inactive').removeAttr('style');
|
595 |
+
$sections.eq(0).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
|
596 |
+
});
|
597 |
+
|
598 |
+
update_size();
|
599 |
+
update_animation();
|
600 |
+
update_location();
|
601 |
+
},
|
602 |
+
|
603 |
+
theme_page_listeners: function () {
|
604 |
+
var self = this;
|
605 |
+
jQuery(document)
|
606 |
+
.on('change', 'select.font-family', function () {
|
607 |
+
jQuery('select.font-weight option, select.font-style option', jQuery(this).parents('table')).removeProp('selected');
|
608 |
+
self.update_font_selectboxes();
|
609 |
+
})
|
610 |
+
.on('change', 'select.font-weight, select.font-style', function () {
|
611 |
+
self.update_font_selectboxes();
|
612 |
+
})
|
613 |
+
.on('change input focusout', 'select, input:not(.color-picker)', function () {
|
614 |
+
self.update_theme();
|
615 |
+
})
|
616 |
+
.on('change', 'select.border-style', function () {
|
617 |
+
var $this = jQuery(this);
|
618 |
+
if ($this.val() === 'none') {
|
619 |
+
$this.parents('table').find('.border-options').hide();
|
620 |
+
} else {
|
621 |
+
$this.parents('table').find('.border-options').show();
|
622 |
+
}
|
623 |
+
})
|
624 |
+
.on('change', '#popup_theme_close_location', function () {
|
625 |
+
var $this = jQuery(this),
|
626 |
+
table = $this.parents('table');
|
627 |
+
jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
|
628 |
+
jQuery('tr.' + $this.val(), table).show();
|
629 |
+
})
|
630 |
+
.on('change, irischange', '.color-picker', function (event) {
|
631 |
+
self.update_theme();
|
632 |
+
var $input = jQuery(event.currentTarget);
|
633 |
+
if ($input.hasClass('background-color')) {
|
634 |
+
$input.parents('table').find('.background-opacity').show();
|
635 |
+
}
|
636 |
+
});
|
637 |
+
},
|
638 |
+
update_theme: function () {
|
639 |
+
var form_values = jQuery("[name^='popup_theme_']").serializeArray(),
|
640 |
+
theme = {},
|
641 |
+
i;
|
642 |
+
for (i = 0; form_values.length > i; i += 1) {
|
643 |
+
if (form_values[i].name.indexOf('popup_theme_') === 0) {
|
644 |
+
theme[form_values[i].name.replace('popup_theme_', '')] = form_values[i].value;
|
645 |
+
}
|
646 |
+
}
|
647 |
+
this.retheme_popup(theme);
|
648 |
+
},
|
649 |
+
theme_preview_scroll: function () {
|
650 |
+
var $preview = jQuery('#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview'),
|
651 |
+
$parent = $preview.parent(),
|
652 |
+
startscroll = $preview.offset().top - 50;
|
653 |
+
jQuery(window).on('scroll', function () {
|
654 |
+
if (jQuery('> .postbox:visible', $parent).index($preview) === (jQuery('> .postbox:visible', $parent).length - 1) && jQuery(window).scrollTop() >= startscroll) {
|
655 |
+
$preview.css({
|
656 |
+
left: $preview.offset().left,
|
657 |
+
width: $preview.width(),
|
658 |
+
height: $preview.height(),
|
659 |
+
position: 'fixed',
|
660 |
+
top: 50
|
661 |
+
});
|
662 |
+
} else {
|
663 |
+
$preview.removeAttr('style');
|
664 |
+
}
|
665 |
+
});
|
666 |
+
},
|
667 |
+
update_font_selectboxes: function () {
|
668 |
+
return jQuery('select.font-family').each(function () {
|
669 |
+
var $this = jQuery(this),
|
670 |
+
$font_weight = $this.parents('table').find('select.font-weight'),
|
671 |
+
$font_style = $this.parents('table').find('select.font-style'),
|
672 |
+
$font_weight_options = $font_weight.find('option'),
|
673 |
+
$font_style_options = $font_style.find('option'),
|
674 |
+
font,
|
675 |
+
i;
|
676 |
+
|
677 |
+
|
678 |
+
// Google Font Chosen
|
679 |
+
if (popmake_google_fonts[$this.val()] !== undefined) {
|
680 |
+
font = popmake_google_fonts[$this.val()];
|
681 |
+
|
682 |
+
$font_weight_options.hide();
|
683 |
+
$font_style_options.hide();
|
684 |
+
|
685 |
+
if (font.variants.length) {
|
686 |
+
for (i = 0; font.variants.length > i; i += 1) {
|
687 |
+
if (font.variants[i] === 'regular') {
|
688 |
+
jQuery('option[value="normal"]', $font_weight).show();
|
689 |
+
jQuery('option[value="normal"]', $font_style).show();
|
690 |
+
} else {
|
691 |
+
if (font.variants[i].indexOf('italic') >= 0) {
|
692 |
+
jQuery('option[value="italic"]', $font_style).show();
|
693 |
+
}
|
694 |
+
jQuery('option[value="' + parseInt(font.variants[i], 10) + '"]', $font_weight).show();
|
695 |
+
}
|
696 |
+
}
|
697 |
+
}
|
698 |
+
// Standard Font Chosen
|
699 |
+
} else {
|
700 |
+
$font_weight_options.show();
|
701 |
+
$font_style_options.show();
|
702 |
+
}
|
703 |
+
|
704 |
+
$font_weight.parents('tr:first').show();
|
705 |
+
if ($font_weight.find('option:visible').length <= 1) {
|
706 |
+
$font_weight.parents('tr:first').hide();
|
707 |
+
} else {
|
708 |
+
$font_weight.parents('tr:first').show();
|
709 |
+
}
|
710 |
+
|
711 |
+
$font_style.parents('tr:first').show();
|
712 |
+
if ($font_style.find('option:visible').length <= 1) {
|
713 |
+
$font_style.parents('tr:first').hide();
|
714 |
+
} else {
|
715 |
+
$font_style.parents('tr:first').show();
|
716 |
+
}
|
717 |
+
});
|
718 |
+
},
|
719 |
+
|
720 |
+
initialize_theme_page: function () {
|
721 |
+
jQuery('#popuptitlediv').insertAfter('#titlediv');
|
722 |
+
|
723 |
+
var self = this,
|
724 |
+
table = jQuery('#popup_theme_close_location').parents('table');
|
725 |
+
self.update_theme();
|
726 |
+
self.theme_page_listeners();
|
727 |
+
self.theme_preview_scroll();
|
728 |
+
self.update_font_selectboxes();
|
729 |
+
|
730 |
+
jQuery('select.border-style').each(function () {
|
731 |
+
var $this = jQuery(this);
|
732 |
+
if ($this.val() === 'none') {
|
733 |
+
$this.parents('table').find('.border-options').hide();
|
734 |
+
} else {
|
735 |
+
$this.parents('table').find('.border-options').show();
|
736 |
+
}
|
737 |
+
});
|
738 |
+
|
739 |
+
jQuery('.color-picker.background-color').each(function () {
|
740 |
+
var $this = jQuery(this);
|
741 |
+
if ($this.val() === '') {
|
742 |
+
$this.parents('table').find('.background-opacity').hide();
|
743 |
+
} else {
|
744 |
+
$this.parents('table').find('.background-opacity').show();
|
745 |
+
}
|
746 |
+
});
|
747 |
+
|
748 |
+
jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
|
749 |
+
switch (jQuery('#popup_theme_close_location').val()) {
|
750 |
+
case "topleft":
|
751 |
+
jQuery('tr.topleft', table).show();
|
752 |
+
break;
|
753 |
+
case "topright":
|
754 |
+
jQuery('tr.topright', table).show();
|
755 |
+
break;
|
756 |
+
case "bottomleft":
|
757 |
+
jQuery('tr.bottomleft', table).show();
|
758 |
+
break;
|
759 |
+
case "bottomright":
|
760 |
+
jQuery('tr.bottomright', table).show();
|
761 |
+
break;
|
762 |
+
}
|
763 |
+
|
764 |
+
},
|
765 |
+
retheme_popup: function (theme) {
|
766 |
+
var $overlay = jQuery('.empreview .example-popup-overlay'),
|
767 |
+
$container = jQuery('.empreview .example-popup'),
|
768 |
+
$title = jQuery('.title', $container),
|
769 |
+
$content = jQuery('.content', $container),
|
770 |
+
$close = jQuery('.close-popup', $container),
|
771 |
+
container_inset = theme.container_boxshadow_inset === 'yes' ? 'inset ' : '',
|
772 |
+
close_inset = theme.close_boxshadow_inset === 'yes' ? 'inset ' : '',
|
773 |
+
link;
|
774 |
+
|
775 |
+
if (popmake_google_fonts[theme.title_font_family] !== undefined) {
|
776 |
+
|
777 |
+
link = "//fonts.googleapis.com/css?family=" + theme.title_font_family;
|
778 |
+
|
779 |
+
if (theme.title_font_weight !== 'normal') {
|
780 |
+
link += ":" + theme.title_font_weight;
|
781 |
+
}
|
782 |
+
if (theme.title_font_style === 'italic') {
|
783 |
+
if (link.indexOf(':') === -1) {
|
784 |
+
link += ":";
|
785 |
+
}
|
786 |
+
link += "italic";
|
787 |
+
}
|
788 |
+
jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
|
789 |
+
}
|
790 |
+
if (popmake_google_fonts[theme.content_font_family] !== undefined) {
|
791 |
+
|
792 |
+
link = "//fonts.googleapis.com/css?family=" + theme.content_font_family;
|
793 |
+
|
794 |
+
if (theme.content_font_weight !== 'normal') {
|
795 |
+
link += ":" + theme.content_font_weight;
|
796 |
+
}
|
797 |
+
if (theme.content_font_style === 'italic') {
|
798 |
+
if (link.indexOf(':') === -1) {
|
799 |
+
link += ":";
|
800 |
+
}
|
801 |
+
link += "italic";
|
802 |
+
}
|
803 |
+
jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
|
804 |
+
}
|
805 |
+
if (popmake_google_fonts[theme.close_font_family] !== undefined) {
|
806 |
+
|
807 |
+
link = "//fonts.googleapis.com/css?family=" + theme.close_font_family;
|
808 |
+
|
809 |
+
if (theme.close_font_weight !== 'normal') {
|
810 |
+
link += ":" + theme.close_font_weight;
|
811 |
+
}
|
812 |
+
if (theme.close_font_style === 'italic') {
|
813 |
+
if (link.indexOf(':') === -1) {
|
814 |
+
link += ":";
|
815 |
+
}
|
816 |
+
link += "italic";
|
817 |
+
}
|
818 |
+
jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
|
819 |
+
}
|
820 |
+
|
821 |
+
|
822 |
+
|
823 |
+
$overlay.removeAttr('style').css({
|
824 |
+
backgroundColor: this.convert_hex(theme.overlay_background_color, theme.overlay_background_opacity)
|
825 |
+
});
|
826 |
+
$container.removeAttr('style').css({
|
827 |
+
padding: theme.container_padding + 'px',
|
828 |
+
backgroundColor: this.convert_hex(theme.container_background_color, theme.container_background_opacity),
|
829 |
+
borderStyle: theme.container_border_style,
|
830 |
+
borderColor: theme.container_border_color,
|
831 |
+
borderWidth: theme.container_border_width + 'px',
|
832 |
+
borderRadius: theme.container_border_radius + 'px',
|
833 |
+
boxShadow: container_inset + theme.container_boxshadow_horizontal + 'px ' + theme.container_boxshadow_vertical + 'px ' + theme.container_boxshadow_blur + 'px ' + theme.container_boxshadow_spread + 'px ' + this.convert_hex(theme.container_boxshadow_color, theme.container_boxshadow_opacity)
|
834 |
+
});
|
835 |
+
$title.removeAttr('style').css({
|
836 |
+
color: theme.title_font_color,
|
837 |
+
lineHeight: theme.title_line_height + 'px',
|
838 |
+
fontSize: theme.title_font_size + 'px',
|
839 |
+
fontFamily: theme.title_font_family,
|
840 |
+
fontStyle: theme.title_font_style,
|
841 |
+
fontWeight: theme.title_font_weight,
|
842 |
+
textAlign: theme.title_text_align,
|
843 |
+
textShadow: theme.title_textshadow_horizontal + 'px ' + theme.title_textshadow_vertical + 'px ' + theme.title_textshadow_blur + 'px ' + this.convert_hex(theme.title_textshadow_color, theme.title_textshadow_opacity)
|
844 |
+
});
|
845 |
+
$content.removeAttr('style').css({
|
846 |
+
color: theme.content_font_color,
|
847 |
+
//fontSize: theme.content_font_size+'px',
|
848 |
+
fontFamily: theme.content_font_family,
|
849 |
+
fontStyle: theme.content_font_style,
|
850 |
+
fontWeight: theme.content_font_weight
|
851 |
+
});
|
852 |
+
$close.html(theme.close_text).removeAttr('style').css({
|
853 |
+
padding: theme.close_padding + 'px',
|
854 |
+
backgroundColor: this.convert_hex(theme.close_background_color, theme.close_background_opacity),
|
855 |
+
color: theme.close_font_color,
|
856 |
+
lineHeight: theme.close_line_height + 'px',
|
857 |
+
fontSize: theme.close_font_size + 'px',
|
858 |
+
fontFamily: theme.close_font_family,
|
859 |
+
fontWeight: theme.close_font_weight,
|
860 |
+
fontStyle: theme.close_font_style,
|
861 |
+
borderStyle: theme.close_border_style,
|
862 |
+
borderColor: theme.close_border_color,
|
863 |
+
borderWidth: theme.close_border_width + 'px',
|
864 |
+
borderRadius: theme.close_border_radius + 'px',
|
865 |
+
boxShadow: close_inset + theme.close_boxshadow_horizontal + 'px ' + theme.close_boxshadow_vertical + 'px ' + theme.close_boxshadow_blur + 'px ' + theme.close_boxshadow_spread + 'px ' + this.convert_hex(theme.close_boxshadow_color, theme.close_boxshadow_opacity),
|
866 |
+
textShadow: theme.close_textshadow_horizontal + 'px ' + theme.close_textshadow_vertical + 'px ' + theme.close_textshadow_blur + 'px ' + this.convert_hex(theme.close_textshadow_color, theme.close_textshadow_opacity)
|
867 |
+
});
|
868 |
+
switch (theme.close_location) {
|
869 |
+
case "topleft":
|
870 |
+
$close.css({
|
871 |
+
top: theme.close_position_top + 'px',
|
872 |
+
left: theme.close_position_left + 'px'
|
873 |
+
});
|
874 |
+
break;
|
875 |
+
case "topright":
|
876 |
+
$close.css({
|
877 |
+
top: theme.close_position_top + 'px',
|
878 |
+
right: theme.close_position_right + 'px'
|
879 |
+
});
|
880 |
+
break;
|
881 |
+
case "bottomleft":
|
882 |
+
$close.css({
|
883 |
+
bottom: theme.close_position_bottom + 'px',
|
884 |
+
left: theme.close_position_left + 'px'
|
885 |
+
});
|
886 |
+
break;
|
887 |
+
case "bottomright":
|
888 |
+
$close.css({
|
889 |
+
bottom: theme.close_position_bottom + 'px',
|
890 |
+
right: theme.close_position_right + 'px'
|
891 |
+
});
|
892 |
+
break;
|
893 |
+
}
|
894 |
+
jQuery(document).trigger('popmake-admin-retheme', [theme]);
|
895 |
+
},
|
896 |
+
serialize_form: function ($form) {
|
897 |
+
var serialized = {};
|
898 |
+
jQuery("[name]", $form).each(function () {
|
899 |
+
var name = jQuery(this).attr('name'),
|
900 |
+
value = jQuery(this).val(),
|
901 |
+
nameBits = name.split('['),
|
902 |
+
previousRef = serialized,
|
903 |
+
i,
|
904 |
+
l = nameBits.length,
|
905 |
+
nameBit;
|
906 |
+
for (i = 0; i < l; i += 1) {
|
907 |
+
nameBit = nameBits[i].replace(']', '');
|
908 |
+
if (!previousRef[nameBit]) {
|
909 |
+
previousRef[nameBit] = {};
|
910 |
+
}
|
911 |
+
if (i !== nameBits.length - 1) {
|
912 |
+
previousRef = previousRef[nameBit];
|
913 |
+
} else if (i === nameBits.length - 1) {
|
914 |
+
previousRef[nameBit] = value;
|
915 |
+
}
|
916 |
+
}
|
917 |
+
});
|
918 |
+
return serialized;
|
919 |
+
},
|
920 |
+
convert_hex: function (hex, opacity) {
|
921 |
+
hex = hex.replace('#', '');
|
922 |
+
var r = parseInt(hex.substring(0, 2), 16),
|
923 |
+
g = parseInt(hex.substring(2, 4), 16),
|
924 |
+
b = parseInt(hex.substring(4, 6), 16),
|
925 |
+
result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
|
926 |
+
return result;
|
927 |
+
},
|
928 |
+
debounce: function (callback, threshold) {
|
929 |
+
var timeout;
|
930 |
+
return function () {
|
931 |
+
var context = this, params = arguments;
|
932 |
+
window.clearTimeout(timeout);
|
933 |
+
timeout = window.setTimeout(function () {
|
934 |
+
callback.apply(context, params);
|
935 |
+
}, threshold);
|
936 |
+
};
|
937 |
+
},
|
938 |
+
throttle: function (callback, threshold) {
|
939 |
+
var suppress = false,
|
940 |
+
clear = function () {
|
941 |
+
suppress = false;
|
942 |
+
};
|
943 |
+
return function () {
|
944 |
+
if (!suppress) {
|
945 |
+
callback();
|
946 |
+
window.setTimeout(clear, threshold);
|
947 |
+
suppress = true;
|
948 |
+
}
|
949 |
+
};
|
950 |
+
}
|
951 |
+
};
|
952 |
+
jQuery(document).ready(function () {
|
953 |
+
PopMakeAdmin.init();
|
954 |
+
});
|
955 |
+
}());
|
assets/scripts/popup-maker-admin.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var PopMakeAdmin; (function(){PopMakeAdmin={init:function(){jQuery("body.post-type-popup form#post").length&&(PopMakeAdmin.initialize_popup_page(),PopMakeAdmin.attachQuickSearchListeners(),PopMakeAdmin.attachTabsPanelListeners());jQuery("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page();PopMakeAdmin.initialize_color_pickers();PopMakeAdmin.initialize_range_sliders();PopMakeAdmin.initialize_marketing();jQuery(document).keydown(function(a){return"115"!==a.which&&"83"!==a.which||!a.ctrlKey&& !a.metaKey?!0:(a.preventDefault(),jQuery("body.post-type-popup form#post, body.post-type-popup_theme form#post").submit(),!1)})},initialize_marketing:function(){jQuery("#menu-posts-popup ul li:eq(-1)").addClass("popmake-menu-highlight");jQuery(".popmake-newsletter-optin").show();jQuery("#popmake_popup_share").removeClass("postbox");jQuery("#posts-filter").length?jQuery("#wpbody-content > .wrap > h2:first").after(jQuery(".popmake-newsletter-optin")):jQuery("#titlediv").length?jQuery("#titlediv").append(jQuery(".popmake-newsletter-optin")): jQuery(".about-text").length&&jQuery(".popmake-badge").length?jQuery(".nav-tab-wrapper").after(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff .tabwrapper").length?jQuery("#poststuff .tabwrapper").prepend(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff").length&&jQuery("#poststuff").prepend(jQuery(".popmake-newsletter-optin"));jQuery(".popmake-optin-dismiss").on("click",function(a){var b=jQuery(this);a.preventDefault();jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin", popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:b.data("optin-name"),optin_type:b.data("optin-type")}}).done(function(a){a.success&&b.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(a){var b,c,d=jQuery(a.target),f,g,h,k,e,n;if(d.hasClass("nav-tab-link"))b=d.data("type"),c=d.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",c).removeAttr("checked"),jQuery(".tabs-panel-active", c).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+b,c).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",c).removeClass("tabs"),d.parent().addClass("tabs"),jQuery(".quick-search",c).focus(),a.preventDefault();else if(d.hasClass("select-all"))(a=/#(.*)$/.exec(a.target.href))&&a[1]&&(a=jQuery("#"+a[1]+" .tabs-panel-active .menu-item-title input"),a.length===a.filter(":checked").length?a.removeAttr("checked"):a.prop("checked",!0));else if(d.hasClass("submit-add-to-menu")){c= d.parents(".options");a=jQuery('.tabs-panel-active input[type="checkbox"]:checked',c);b=jQuery("textarea",c);f=jQuery(".tagchecklist",c);g=b.val().split(",");for(c=0;c<g.length;c+=1)g[c]=parseInt(g[c],10);a.each(function(){h=jQuery(this);k=parseInt(h.val(),10);e=h.parent("label").siblings(".menu-item-title").val();-1===jQuery.inArray(k,g)&&g.push(k);f.append('<span><a class="ntdelbutton" data-id="'+k+'">X</a> '+e+"</span>")});b.text(g.join(","))}else d.hasClass("ntdelbutton")&&(h=d,n=parseInt(h.data("id"), 10),c=d.parents(".options"),b=jQuery("textarea",c),f=jQuery(".tagchecklist",c),g=b.val().split(","),g=jQuery.grep(g,function(a){return a!==n}),h.parent("span").remove(),b.text(g.join(",")))})},attachQuickSearchListeners:function(){var a;jQuery(".quick-search").keypress(function(b){var c=jQuery(this);if(13===b.which)return PopMakeAdmin.updateQuickSearchResults(c),!1;a&&clearTimeout(a);a=setTimeout(function(){PopMakeAdmin.updateQuickSearchResults(c)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(a){var b, c,d=a.val();2>d.length||(b=a.parents(".tabs-panel"),c={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:d,type:a.attr("name")},jQuery(".spinner",b).show(),jQuery.post(ajaxurl,c,function(a){PopMakeAdmin.processQuickSearchQueryResponse(a,c,b)}))},processQuickSearchQueryResponse:function(a,b,c){var d,f,g=jQuery("form#post"),h={},k=/menu-item[(\[\^]\]*/;a=jQuery("<div>").html(a).find("li");var e;a.length?(a.each(function(){e= jQuery(this);if((d=k.exec(e.html()))&&d[1]){for(f=d[1];g.elements["menu-item["+f+"][menu-item-type]"]||h[f];)--f;h[f]=!0;f!==d[1]&&e.html(e.html().replace(new RegExp("menu-item\\["+d[1]+"\\]","g"),"menu-item["+f+"]"))}}),jQuery(".categorychecklist",c).html(a),jQuery(".spinner",c).hide(),jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",c).html("<li><p>noResultsFound</p></li>"),jQuery(".spinner",c).hide())},initialize_color_pickers:function(){var a=this;jQuery(".color-picker").wpColorPicker({clear:function(b){a.update_theme(); b=jQuery(b.currentTarget).prev();b.hasClass("background-color")&&b.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var a,b,c,d,f,g=jQuery('<input type="range"/>'),h=jQuery('<button class="popmake-range-plus">+</button>'),k=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var a=jQuery(this);a.siblings(".popmake-range-manual").val(a.val())});jQuery(".popmake-range-manual").each(function(){var a= jQuery(this),b=a.data("force-minmax"),p=parseInt(a.prop("min"),0),m=parseInt(a.prop("max"),0),q=parseInt(a.prop("step"),0),l=parseInt(a.val(),0);c=g.clone();d=h.clone();f=k.clone();b&&l>m&&(l=m,a.val(l));c.prop({min:p||0,max:b||m&&m>l?m:1.5*l,step:q||1.5*l/100,value:l}).on("change input",function(){a.trigger("input")});a.next().after(f,d);a.before(c)});jQuery(document).on("click",".popmake-range-manual",function(){jQuery(this).removeProp("readonly")}).on("focusout",".popmake-range-manual",function(){jQuery(this).prop("readonly", !0)}).on("change",".popmake-range-manual",function(){var a=jQuery(this),b=parseInt(a.prop("max"),0),g=parseInt(a.prop("step"),0),d=a.data("force-minmax"),h=parseInt(a.val(),0);c=a.prev();d&&h>b&&(h=b,a.val(h));c.prop({max:d||b&&b>h?b:1.5*h,step:g||1.5*h/100,value:h})}).on("click",".popmake-range-plus",function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)+b;c=a.prev();a.val(b).trigger("input");c.val(b)}).on("click",".popmake-range-minus", function(a){a.preventDefault();a=jQuery(this).siblings(".popmake-range-manual");var b=parseInt(a.prop("step"),0),b=parseInt(a.val(),0)-b;c=a.prev();a.val(b).trigger("input");c.val(b)});a=document.createElement("input");a.setAttribute("type","range");"text"===a.type&&jQuery("input[type=range]").each(function(a,g){b=jQuery(g);c=jQuery("<div />").slider({min:parseInt(b.attr("min"),10)||0,max:parseInt(b.attr("max"),10)||100,value:parseInt(b.attr("value"),10)||0,step:parseInt(b.attr("step"),10)||1,slide:function(a, b){jQuery(this).prev("input").val(b.value)}});b.after(c).hide()})},initialize_popup_page:function(){var a=function(a){var b=a.siblings(".options");a.is(":checked")?(b.show(),"popup_targeting_condition_on_entire_site"===a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),a=a.parents(".targeting_condition").siblings(".targeting_condition"),a.hide(),jQuery("> *",a).prop("disabled",!0),b.show(),jQuery("> *",b).removeProp("disabled")): jQuery("*",b).removeProp("disabled")):(b.hide(),"popup_targeting_condition_on_entire_site"===a.attr("id")?(b=a.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),a=a.parents(".targeting_condition").siblings(".targeting_condition"),a.show(),jQuery("> *",a).removeProp("disabled"),b.hide(),jQuery("> *",b).prop("disabled",!0)):jQuery("*",b).prop("disabled",!0))},b=function(a){var b=a.parent().siblings('input[type="checkbox"]:first'),c=0<=b.attr("name").indexOf("exclude"), d=c?b.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):b.attr("name").replace("popup_targeting_condition_on_specific_",""),c=c?jQuery("#exclude_on_specific_"+d):jQuery("#on_specific_"+d);a.is(":checked")&&("true"===a.val()?(b.prop("checked",!0),c.show(),jQuery("*",c).removeProp("disabled")):""===a.val()&&(b.removeProp("checked"),c.hide(),jQuery("*",c).prop("disabled",!0)))},c=function(){"custom"===jQuery("#popup_display_size").val()?(jQuery(".custom-size-only").show(),jQuery(".responsive-size-only").hide(), jQuery("#popup_display_custom_height_auto").is(":checked")?jQuery(".custom-size-height-only").hide():jQuery(".custom-size-height-only").show()):(jQuery(".custom-size-only").hide(),"auto"!==jQuery("#popup_display_size").val()?jQuery(".responsive-size-only").show():jQuery(".responsive-size-only").hide())},d=function(){jQuery(".animation-speed, .animation-origin").hide();"fade"===jQuery("#popup_display_animation_type").val()?jQuery(".animation-speed").show():"none"!==jQuery("#popup_display_animation_type").val()&& jQuery(".animation-speed, .animation-origin").show()},f=function(){var a=jQuery("#popup_display_location"),b=a.parents("table"),a=a.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",b).hide();0<=a.indexOf("top")&&jQuery("tr.top").show();0<=a.indexOf("left")&&jQuery("tr.left").show();0<=a.indexOf("bottom")&&jQuery("tr.bottom").show();0<=a.indexOf("right")&&jQuery("tr.right").show()};jQuery("#popuptitlediv").insertAfter("#titlediv");jQuery('[name^="menu-item"]').removeAttr("name");jQuery(document).on("keydown", "#popuptitle",function(a){9===(a.keyCode||a.which)&&(a.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(a){var b=a.keyCode||a.which;a.shiftKey||9!==b||(a.preventDefault(),a="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(a).focus())}).on("keydown","#popuptitle, #insert-media-button",function(a){var b=a.keyCode||a.which;a.shiftKey&&9===b&&(a.preventDefault(),a="popuptitle"===jQuery(this).attr("id")?"#title":"#popuptitle",jQuery(a).focus())}).on("submit", "#post",function(a){var b=jQuery("#title").val();if(0===b.length||0===b.replace(/\s/g,"").length)a.preventDefault(),jQuery("div#notice").remove(),jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter("h2"),jQuery("#title").focus(),jQuery("#ajax-loading").hide(),jQuery("#publish").removeClass("button-primary-disabled"),jQuery("#title").prop("required","required")}).on("change","#popup_display_size",function(){c()}).on("click","#popup_display_custom_height_auto", function(){c()}).on("change","#popup_display_animation_type",function(){d()}).on("change","#popup_display_location",function(){f()});jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){a(jQuery(this))}).each(function(){a(jQuery(this))});jQuery('input[type="radio"][name*="radio_checkbox_"]').on("click",function(){b(jQuery(this))}).each(function(){b(jQuery(this))});jQuery(".posttypediv, .taxonomydiv").each(function(){var a=jQuery(this), b=jQuery("> ul li"),a=jQuery(".tabs-panel",a);b.removeClass("tabs");b.eq(0).addClass("tabs");a.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style");a.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});c();d();f()},theme_page_listeners:function(){var a=this;jQuery(document).on("change","select.font-family",function(){jQuery("select.font-weight option, select.font-style option",jQuery(this).parents("table")).removeProp("selected");a.update_font_selectboxes()}).on("change", "select.font-weight, select.font-style",function(){a.update_font_selectboxes()}).on("change input focusout","select, input:not(.color-picker)",function(){a.update_theme()}).on("change","select.border-style",function(){var a=jQuery(this);"none"===a.val()?a.parents("table").find(".border-options").hide():a.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var a=jQuery(this),c=a.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright", c).hide();jQuery("tr."+a.val(),c).show()}).on("change, irischange",".color-picker",function(b){a.update_theme();b=jQuery(b.currentTarget);b.hasClass("background-color")&&b.parents("table").find(".background-opacity").show()})},update_theme:function(){var a=jQuery("[name^='popup_theme_']").serializeArray(),b={},c;for(c=0;a.length>c;c+=1)0===a[c].name.indexOf("popup_theme_")&&(b[a[c].name.replace("popup_theme_","")]=a[c].value);this.retheme_popup(b)},theme_preview_scroll:function(){var a=jQuery("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"), b=a.parent(),c=a.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",b).index(a)===jQuery("> .postbox:visible",b).length-1&&jQuery(window).scrollTop()>=c?a.css({left:a.offset().left,width:a.width(),height:a.height(),position:"fixed",top:50}):a.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var a=jQuery(this),b=a.parents("table").find("select.font-weight"),c=a.parents("table").find("select.font-style"),d=b.find("option"), f=c.find("option");if(void 0!==popmake_google_fonts[a.val()]){if(a=popmake_google_fonts[a.val()],d.hide(),f.hide(),a.variants.length)for(d=0;a.variants.length>d;d+=1)"regular"===a.variants[d]?(jQuery('option[value="normal"]',b).show(),jQuery('option[value="normal"]',c).show()):(0<=a.variants[d].indexOf("italic")&&jQuery('option[value="italic"]',c).show(),jQuery('option[value="'+parseInt(a.variants[d],10)+'"]',b).show())}else d.show(),f.show();b.parents("tr:first").show();1>=b.find("option:visible").length? b.parents("tr:first").hide():b.parents("tr:first").show();c.parents("tr:first").show();1>=c.find("option:visible").length?c.parents("tr:first").hide():c.parents("tr:first").show()})},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var a=jQuery("#popup_theme_close_location").parents("table");this.update_theme();this.theme_page_listeners();this.theme_preview_scroll();this.update_font_selectboxes();jQuery("select.border-style").each(function(){var a=jQuery(this);"none"=== a.val()?a.parents("table").find(".border-options").hide():a.parents("table").find(".border-options").show()});jQuery(".color-picker.background-color").each(function(){var a=jQuery(this);""===a.val()?a.parents("table").find(".background-opacity").hide():a.parents("table").find(".background-opacity").show()});jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",a).hide();switch(jQuery("#popup_theme_close_location").val()){case "topleft":jQuery("tr.topleft",a).show();break;case "topright":jQuery("tr.topright", a).show();break;case "bottomleft":jQuery("tr.bottomleft",a).show();break;case "bottomright":jQuery("tr.bottomright",a).show()}},retheme_popup:function(a){var b=jQuery(".empreview .example-popup-overlay"),c=jQuery(".empreview .example-popup"),d=jQuery(".title",c),f=jQuery(".content",c),g=jQuery(".close-popup",c),h="yes"===a.container_boxshadow_inset?"inset ":"",k="yes"===a.close_boxshadow_inset?"inset ":"",e;void 0!==popmake_google_fonts[a.title_font_family]&&(e="//fonts.googleapis.com/css?family="+ a.title_font_family,"normal"!==a.title_font_weight&&(e+=":"+a.title_font_weight),"italic"===a.title_font_style&&(-1===e.indexOf(":")&&(e+=":"),e+="italic"),jQuery("body").append('<link href="'+e+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.content_font_family]&&(e="//fonts.googleapis.com/css?family="+a.content_font_family,"normal"!==a.content_font_weight&&(e+=":"+a.content_font_weight),"italic"===a.content_font_style&&(-1===e.indexOf(":")&&(e+=":"),e+="italic"),jQuery("body").append('<link href="'+ e+'" rel="stylesheet" type="text/css">'));void 0!==popmake_google_fonts[a.close_font_family]&&(e="//fonts.googleapis.com/css?family="+a.close_font_family,"normal"!==a.close_font_weight&&(e+=":"+a.close_font_weight),"italic"===a.close_font_style&&(-1===e.indexOf(":")&&(e+=":"),e+="italic"),jQuery("body").append('<link href="'+e+'" rel="stylesheet" type="text/css">'));b.removeAttr("style").css({backgroundColor:this.convert_hex(a.overlay_background_color,a.overlay_background_opacity)});c.removeAttr("style").css({padding:a.container_padding+ "px",backgroundColor:this.convert_hex(a.container_background_color,a.container_background_opacity),borderStyle:a.container_border_style,borderColor:a.container_border_color,borderWidth:a.container_border_width+"px",borderRadius:a.container_border_radius+"px",boxShadow:h+a.container_boxshadow_horizontal+"px "+a.container_boxshadow_vertical+"px "+a.container_boxshadow_blur+"px "+a.container_boxshadow_spread+"px "+this.convert_hex(a.container_boxshadow_color,a.container_boxshadow_opacity)});d.removeAttr("style").css({color:a.title_font_color, lineHeight:a.title_line_height+"px",fontSize:a.title_font_size+"px",fontFamily:a.title_font_family,fontStyle:a.title_font_style,fontWeight:a.title_font_weight,textAlign:a.title_text_align,textShadow:a.title_textshadow_horizontal+"px "+a.title_textshadow_vertical+"px "+a.title_textshadow_blur+"px "+this.convert_hex(a.title_textshadow_color,a.title_textshadow_opacity)});f.removeAttr("style").css({color:a.content_font_color,fontFamily:a.content_font_family,fontStyle:a.content_font_style,fontWeight:a.content_font_weight}); g.html(a.close_text).removeAttr("style").css({padding:a.close_padding+"px",backgroundColor:this.convert_hex(a.close_background_color,a.close_background_opacity),color:a.close_font_color,lineHeight:a.close_line_height+"px",fontSize:a.close_font_size+"px",fontFamily:a.close_font_family,fontWeight:a.close_font_weight,fontStyle:a.close_font_style,borderStyle:a.close_border_style,borderColor:a.close_border_color,borderWidth:a.close_border_width+"px",borderRadius:a.close_border_radius+"px",boxShadow:k+ a.close_boxshadow_horizontal+"px "+a.close_boxshadow_vertical+"px "+a.close_boxshadow_blur+"px "+a.close_boxshadow_spread+"px "+this.convert_hex(a.close_boxshadow_color,a.close_boxshadow_opacity),textShadow:a.close_textshadow_horizontal+"px "+a.close_textshadow_vertical+"px "+a.close_textshadow_blur+"px "+this.convert_hex(a.close_textshadow_color,a.close_textshadow_opacity)});switch(a.close_location){case "topleft":g.css({top:a.close_position_top+"px",left:a.close_position_left+"px"});break;case "topright":g.css({top:a.close_position_top+ "px",right:a.close_position_right+"px"});break;case "bottomleft":g.css({bottom:a.close_position_bottom+"px",left:a.close_position_left+"px"});break;case "bottomright":g.css({bottom:a.close_position_bottom+"px",right:a.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[a])},serialize_form:function(a){var b={};jQuery("[name]",a).each(function(){var a=jQuery(this).attr("name"),d=jQuery(this).val(),a=a.split("["),f=b,g,h=a.length,k;for(g=0;g<h;g+=1)k=a[g].replace("]",""),f[k]|| (f[k]={}),g!==a.length-1?f=f[k]:g===a.length-1&&(f[k]=d)});return b},convert_hex:function(a,b){a=a.replace("#","");var c=parseInt(a.substring(0,2),16),d=parseInt(a.substring(2,4),16),f=parseInt(a.substring(4,6),16);return"rgba("+c+","+d+","+f+","+b/100+")"},debounce:function(a,b){var c;return function(){var d=this,f=arguments;window.clearTimeout(c);c=window.setTimeout(function(){a.apply(d,f)},b)}},throttle:function(a,b){var c=!1,d=function(){c=!1};return function(){c||(a(),window.setTimeout(d,b), c=!0)}}};jQuery(document).ready(function(){PopMakeAdmin.init()})})();
|
assets/scripts/popup-maker-site.js
ADDED
@@ -0,0 +1,1013 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Popup Maker v1.0
|
3 |
+
*/
|
4 |
+
(function (jQuery) {
|
5 |
+
"use strict";
|
6 |
+
if (!jQuery.isFunction(jQuery.fn.on)) {
|
7 |
+
jQuery.fn.on = function (types, sel, fn) {
|
8 |
+
return this.delegate(sel, types, fn);
|
9 |
+
};
|
10 |
+
jQuery.fn.off = function (types, sel, fn) {
|
11 |
+
return this.undelegate(sel, types, fn);
|
12 |
+
};
|
13 |
+
}
|
14 |
+
|
15 |
+
jQuery.fn.popmake = function (method) {
|
16 |
+
// Method calling logic
|
17 |
+
if (jQuery.fn.popmake.methods[method]) {
|
18 |
+
return jQuery.fn.popmake.methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
19 |
+
}
|
20 |
+
if (typeof method === 'object' || !method) {
|
21 |
+
return jQuery.fn.popmake.methods.init.apply(this, arguments);
|
22 |
+
}
|
23 |
+
jQuery.error('Method ' + method + ' does not exist on jQuery.fn.popmake');
|
24 |
+
};
|
25 |
+
|
26 |
+
jQuery.fn.popmake.last_open_trigger = null;
|
27 |
+
jQuery.fn.popmake.last_close_trigger = null;
|
28 |
+
|
29 |
+
jQuery.fn.popmake.methods = {
|
30 |
+
init: function (options) {
|
31 |
+
return this.each(function () {
|
32 |
+
var $this = jQuery(this),
|
33 |
+
settings = jQuery.extend(true, {}, jQuery.fn.popmake.defaults, $this.data('popmake'), options);
|
34 |
+
|
35 |
+
if (!$this.parent().is('body')) {
|
36 |
+
$this.appendTo('body');
|
37 |
+
}
|
38 |
+
|
39 |
+
if (!jQuery('#' + settings.overlay.attr.id).length) {
|
40 |
+
jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
|
41 |
+
}
|
42 |
+
|
43 |
+
jQuery(window).on('resize', function () {
|
44 |
+
if ($this.hasClass('active')) {
|
45 |
+
jQuery.fn.popmake.utilities.throttle(setTimeout(function () {
|
46 |
+
$this.popmake('reposition');
|
47 |
+
}, 25), 500, false);
|
48 |
+
}
|
49 |
+
});
|
50 |
+
|
51 |
+
if (typeof popmake_powered_by === 'string' && popmake_powered_by !== '') {
|
52 |
+
jQuery('.popmake-content', $this).append(jQuery(popmake_powered_by));
|
53 |
+
}
|
54 |
+
|
55 |
+
$this
|
56 |
+
.data('popmake', settings)
|
57 |
+
.on('popmakeBeforeOpen.hide_popup', function () {
|
58 |
+
jQuery(this)
|
59 |
+
.css({ visibility: "visible" })
|
60 |
+
.hide()
|
61 |
+
.addClass(settings.container.active_class);
|
62 |
+
|
63 |
+
if (!settings.meta.display.stackable) {
|
64 |
+
$this.popmake('close_all');
|
65 |
+
}
|
66 |
+
})
|
67 |
+
.on('popmakeAfterClose.close_overlay', function () {
|
68 |
+
var $overlay = jQuery('#' + settings.overlay.attr.id);
|
69 |
+
if ($overlay.length && $overlay.is(":visible")) {
|
70 |
+
$overlay.fadeOut(settings.close.close_speed);
|
71 |
+
}
|
72 |
+
})
|
73 |
+
.on('popmakeAfterClose.reset_videos', function () {
|
74 |
+
jQuery('iframe', $this).filter('[src*="youtube"],[src*="vimeo"]').each(function () {
|
75 |
+
var src = jQuery(this).attr('src');
|
76 |
+
jQuery(this).attr('src', '').attr('src', src);
|
77 |
+
});
|
78 |
+
})
|
79 |
+
.on('popmakeBeforeOpen.setup_close', function () {
|
80 |
+
$this.popmake('setup_close');
|
81 |
+
})
|
82 |
+
.on('popmakeBeforeOpen.retheme', function () {
|
83 |
+
$this.popmake('retheme');
|
84 |
+
})
|
85 |
+
.on('popmakeBeforeOpen.reposition', function () {
|
86 |
+
$this.popmake('reposition');
|
87 |
+
})
|
88 |
+
.trigger('popmakeInit');
|
89 |
+
return this;
|
90 |
+
});
|
91 |
+
},
|
92 |
+
setup_close: function () {
|
93 |
+
var $this = jQuery(this),
|
94 |
+
settings = $this.data('popmake'),
|
95 |
+
$overlay = jQuery('#' + settings.overlay.attr.id),
|
96 |
+
$close = jQuery('.' + settings.close.attr.class, $this);
|
97 |
+
|
98 |
+
$close
|
99 |
+
.off('click.popmake')
|
100 |
+
.on("click.popmake", function (e) {
|
101 |
+
e.preventDefault();
|
102 |
+
e.stopPropagation();
|
103 |
+
|
104 |
+
jQuery.fn.popmake.last_close_trigger = 'Close Button';
|
105 |
+
$this.popmake('close');
|
106 |
+
});
|
107 |
+
if (settings.meta.close.esc_press || settings.meta.close.f4_press) {
|
108 |
+
jQuery(window)
|
109 |
+
.off('keyup.popmake')
|
110 |
+
.on('keyup.popmake', function (e) {
|
111 |
+
if (e.keyCode === 27 && settings.meta.close.esc_press) {
|
112 |
+
jQuery.fn.popmake.last_close_trigger = 'ESC Key';
|
113 |
+
$this.popmake('close');
|
114 |
+
}
|
115 |
+
if (e.keyCode === 115 && settings.meta.close.f4_press) {
|
116 |
+
jQuery.fn.popmake.last_close_trigger = 'F4 Key';
|
117 |
+
$this.popmake('close');
|
118 |
+
}
|
119 |
+
});
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
if (settings.meta.close.overlay_click) {
|
124 |
+
$overlay
|
125 |
+
.off('click.popmake')
|
126 |
+
.on('click.popmake', function (e) {
|
127 |
+
e.preventDefault();
|
128 |
+
e.stopPropagation();
|
129 |
+
|
130 |
+
jQuery.fn.popmake.last_close_trigger = 'Overlay Click';
|
131 |
+
$this.popmake('close');
|
132 |
+
|
133 |
+
});
|
134 |
+
}
|
135 |
+
|
136 |
+
$this
|
137 |
+
.on('popmakeAfterClose', function () {
|
138 |
+
jQuery(window).off('keyup.popmake');
|
139 |
+
$overlay.off('click.popmake');
|
140 |
+
$close.off('click.popmake');
|
141 |
+
})
|
142 |
+
.trigger('popmakeSetupClose');
|
143 |
+
},
|
144 |
+
open: function (callback) {
|
145 |
+
var $this = jQuery(this),
|
146 |
+
settings = $this.data('popmake');
|
147 |
+
|
148 |
+
$this
|
149 |
+
.trigger('popmakeBeforeOpen')
|
150 |
+
.popmake('animate', settings.meta.display.animation_type, function () {
|
151 |
+
$this
|
152 |
+
.addClass('active')
|
153 |
+
.trigger('popmakeAfterOpen');
|
154 |
+
if (callback !== undefined) {
|
155 |
+
callback();
|
156 |
+
}
|
157 |
+
});
|
158 |
+
return this;
|
159 |
+
},
|
160 |
+
close: function () {
|
161 |
+
return this.each(function () {
|
162 |
+
var $this = jQuery(this),
|
163 |
+
settings = $this.data('popmake');
|
164 |
+
$this
|
165 |
+
.trigger('popmakeBeforeClose')
|
166 |
+
.fadeOut(settings.close.close_speed, function () {
|
167 |
+
$this
|
168 |
+
.removeClass('active')
|
169 |
+
.trigger('popmakeAfterClose');
|
170 |
+
});
|
171 |
+
return this;
|
172 |
+
});
|
173 |
+
},
|
174 |
+
close_all: function () {
|
175 |
+
var settings = jQuery(this).data('popmake');
|
176 |
+
jQuery('.' + settings.container.attr.class).removeClass('active').hide(0);
|
177 |
+
return this;
|
178 |
+
},
|
179 |
+
reposition: function (callback) {
|
180 |
+
jQuery(this).trigger('popmakeBeforeReposition');
|
181 |
+
var $this = jQuery(this),
|
182 |
+
settings = $this.data('popmake'),
|
183 |
+
display = settings.meta.display,
|
184 |
+
location = display.location,
|
185 |
+
reposition = {
|
186 |
+
my: "",
|
187 |
+
at: ""
|
188 |
+
},
|
189 |
+
opacity = false;
|
190 |
+
|
191 |
+
if (location.indexOf('left') >= 0) {
|
192 |
+
reposition = {
|
193 |
+
my: reposition.my + " left" + (display.position_left !== 0 ? "+" + display.position_left : ""),
|
194 |
+
at: reposition.at + " left"
|
195 |
+
};
|
196 |
+
}
|
197 |
+
if (location.indexOf('right') >= 0) {
|
198 |
+
reposition = {
|
199 |
+
my: reposition.my + " right" + (display.position_right !== 0 ? "-" + display.position_right : ""),
|
200 |
+
at: reposition.at + " right"
|
201 |
+
};
|
202 |
+
}
|
203 |
+
if (location.indexOf('center') >= 0) {
|
204 |
+
if (location === 'center') {
|
205 |
+
reposition = {
|
206 |
+
my: "center",
|
207 |
+
at: "center"
|
208 |
+
};
|
209 |
+
} else {
|
210 |
+
reposition = {
|
211 |
+
my: reposition.my + " center",
|
212 |
+
at: reposition.at + " center"
|
213 |
+
};
|
214 |
+
}
|
215 |
+
}
|
216 |
+
if (location.indexOf('top') >= 0) {
|
217 |
+
reposition = {
|
218 |
+
my: reposition.my + " top" + (display.position_top !== 0 ? "+" + display.position_top : ""),
|
219 |
+
at: reposition.at + " top"
|
220 |
+
};
|
221 |
+
}
|
222 |
+
if (location.indexOf('bottom') >= 0) {
|
223 |
+
reposition = {
|
224 |
+
my: reposition.my + " bottom" + (display.position_bottom !== 0 ? "-" + display.position_bottom : ""),
|
225 |
+
at: reposition.at + " bottom"
|
226 |
+
};
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
reposition.my = jQuery.trim(reposition.my);
|
231 |
+
reposition.at = jQuery.trim(reposition.at);
|
232 |
+
reposition.of = window;
|
233 |
+
reposition.collision = 'fit';
|
234 |
+
reposition.using = typeof callback === "function" ? callback : jQuery.fn.popmake.callbacks.reposition_using;
|
235 |
+
|
236 |
+
if ($this.is(':hidden')) {
|
237 |
+
opacity = $this.css("opacity");
|
238 |
+
$this.css({
|
239 |
+
opacity: 0
|
240 |
+
}).show();
|
241 |
+
}
|
242 |
+
|
243 |
+
if (display.position_fixed) {
|
244 |
+
$this.addClass('fixed');
|
245 |
+
} else {
|
246 |
+
$this.removeClass('fixed');
|
247 |
+
}
|
248 |
+
if (settings.meta.display.size === 'custom') {
|
249 |
+
$this.css({
|
250 |
+
width: settings.meta.display.custom_width + settings.meta.display.custom_width_unit,
|
251 |
+
height: settings.meta.display.custom_height_auto ? 'auto' : settings.meta.display.custom_height + settings.meta.display.custom_height_unit
|
252 |
+
});
|
253 |
+
} else {
|
254 |
+
if (settings.meta.display.size !== 'auto') {
|
255 |
+
if (settings.meta.display.responsive_min_width !== '') {
|
256 |
+
$this.css({
|
257 |
+
maxWidth: settings.meta.display.responsive_min_width + settings.meta.display.responsive_min_width_unit
|
258 |
+
});
|
259 |
+
}
|
260 |
+
if (settings.meta.display.responsive_max_width !== '') {
|
261 |
+
$this.css({
|
262 |
+
maxWidth: settings.meta.display.responsive_max_width + settings.meta.display.responsive_max_width_unit
|
263 |
+
});
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
$this
|
269 |
+
.addClass('custom-position')
|
270 |
+
.position(reposition)
|
271 |
+
.trigger('popmakeAfterReposition');
|
272 |
+
|
273 |
+
if (opacity) {
|
274 |
+
$this.css({
|
275 |
+
opacity: opacity
|
276 |
+
}).hide();
|
277 |
+
}
|
278 |
+
return this;
|
279 |
+
},
|
280 |
+
retheme: function (theme) {
|
281 |
+
jQuery(this).trigger('popmakeBeforeRetheme');
|
282 |
+
var $this = jQuery(this),
|
283 |
+
settings = $this.data('popmake'),
|
284 |
+
$overlay = jQuery('#' + settings.overlay.attr.id),
|
285 |
+
$container = $this,
|
286 |
+
$title = jQuery('.' + settings.title.attr.class, $container),
|
287 |
+
$content = jQuery('> .' + settings.content.attr.class, $container),
|
288 |
+
$close = jQuery('> .' + settings.close.attr.class, $container),
|
289 |
+
container_inset,
|
290 |
+
close_inset;
|
291 |
+
|
292 |
+
if (theme === undefined) {
|
293 |
+
theme = jQuery.fn.popmake.themes[settings.theme_id];
|
294 |
+
if (theme === undefined) {
|
295 |
+
theme = jQuery.fn.popmake.themes[1];
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
container_inset = theme.container.boxshadow_inset === 'yes' ? 'inset ' : '';
|
300 |
+
close_inset = theme.close.boxshadow_inset === 'yes' ? 'inset ' : '';
|
301 |
+
|
302 |
+
$overlay.removeAttr('style').css({
|
303 |
+
backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.overlay.background_color, theme.overlay.background_opacity)
|
304 |
+
});
|
305 |
+
$container.css({
|
306 |
+
padding: theme.container.padding + 'px',
|
307 |
+
backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.container.background_color, theme.container.background_opacity),
|
308 |
+
borderStyle: theme.container.border_style,
|
309 |
+
borderColor: theme.container.border_color,
|
310 |
+
borderWidth: theme.container.border_width + 'px',
|
311 |
+
borderRadius: theme.container.border_radius + 'px',
|
312 |
+
boxShadow: container_inset + theme.container.boxshadow_horizontal + 'px ' + theme.container.boxshadow_vertical + 'px ' + theme.container.boxshadow_blur + 'px ' + theme.container.boxshadow_spread + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.container.boxshadow_color, theme.container.boxshadow_opacity)
|
313 |
+
});
|
314 |
+
$title.css({
|
315 |
+
color: theme.title.font_color,
|
316 |
+
lineHeight: theme.title.line_height + 'px',
|
317 |
+
fontSize: theme.title.font_size + 'px',
|
318 |
+
fontFamily: theme.title.font_family,
|
319 |
+
fontWeight: theme.title.font_weight,
|
320 |
+
fontStyle: theme.title.font_style,
|
321 |
+
textAlign: theme.title.text_align,
|
322 |
+
textShadow: theme.title.textshadow_horizontal + 'px ' + theme.title.textshadow_vertical + 'px ' + theme.title.textshadow_blur + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.title.textshadow_color, theme.title.textshadow_opacity)
|
323 |
+
});
|
324 |
+
$content.css({
|
325 |
+
color: theme.content.font_color,
|
326 |
+
//fontSize: theme.content.font_size+'px',
|
327 |
+
fontFamily: theme.content.font_family,
|
328 |
+
fontWeight: theme.content.font_weight,
|
329 |
+
fontStyle: theme.content.font_style
|
330 |
+
});
|
331 |
+
jQuery('p, label', $content).css({
|
332 |
+
color: theme.content.font_color,
|
333 |
+
//fontSize: theme.content.font_size+'px',
|
334 |
+
fontFamily: theme.content.font_family
|
335 |
+
});
|
336 |
+
$close.html(theme.close.text).css({
|
337 |
+
padding: theme.close.padding + 'px',
|
338 |
+
backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.close.background_color, theme.close.background_opacity),
|
339 |
+
color: theme.close.font_color,
|
340 |
+
lineHeight: theme.close.line_height + 'px',
|
341 |
+
fontSize: theme.close.font_size + 'px',
|
342 |
+
fontWeight: theme.close.font_weight,
|
343 |
+
fontStyle: theme.close.font_style,
|
344 |
+
fontFamily: theme.close.font_family,
|
345 |
+
borderStyle: theme.close.border_style,
|
346 |
+
borderColor: theme.close.border_color,
|
347 |
+
borderWidth: theme.close.border_width + 'px',
|
348 |
+
borderRadius: theme.close.border_radius + 'px',
|
349 |
+
boxShadow: close_inset + theme.close.boxshadow_horizontal + 'px ' + theme.close.boxshadow_vertical + 'px ' + theme.close.boxshadow_blur + 'px ' + theme.close.boxshadow_spread + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.close.boxshadow_color, theme.close.boxshadow_opacity),
|
350 |
+
textShadow: theme.close.textshadow_horizontal + 'px ' + theme.close.textshadow_vertical + 'px ' + theme.close.textshadow_blur + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.close.textshadow_color, theme.close.textshadow_opacity)
|
351 |
+
});
|
352 |
+
switch (theme.close.location) {
|
353 |
+
case "topleft":
|
354 |
+
$close.css({
|
355 |
+
top: theme.close.position_top + 'px',
|
356 |
+
left: theme.close.position_left + 'px'
|
357 |
+
});
|
358 |
+
break;
|
359 |
+
case "topright":
|
360 |
+
$close.css({
|
361 |
+
top: theme.close.position_top + 'px',
|
362 |
+
right: theme.close.position_right + 'px'
|
363 |
+
});
|
364 |
+
break;
|
365 |
+
case "bottomleft":
|
366 |
+
$close.css({
|
367 |
+
bottom: theme.close.position_bottom + 'px',
|
368 |
+
left: theme.close.position_left + 'px'
|
369 |
+
});
|
370 |
+
break;
|
371 |
+
case "bottomright":
|
372 |
+
$close.css({
|
373 |
+
bottom: theme.close.position_bottom + 'px',
|
374 |
+
right: theme.close.position_right + 'px'
|
375 |
+
});
|
376 |
+
break;
|
377 |
+
}
|
378 |
+
$this.trigger('popmakeAfterRetheme', [theme]);
|
379 |
+
return this;
|
380 |
+
},
|
381 |
+
animate_overlay: function (style, duration, callback) {
|
382 |
+
// Method calling logic
|
383 |
+
var $this = jQuery(this),
|
384 |
+
settings = $this.data('popmake');
|
385 |
+
if (settings.meta.display.overlay_disabled) {
|
386 |
+
callback();
|
387 |
+
} else {
|
388 |
+
if (jQuery.fn.popmake.overlay_animations[style]) {
|
389 |
+
return jQuery.fn.popmake.overlay_animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
|
390 |
+
}
|
391 |
+
jQuery.error('Animation style ' + jQuery.fn.popmake.overlay_animations + ' does not exist.');
|
392 |
+
}
|
393 |
+
return this;
|
394 |
+
},
|
395 |
+
animate: function (style, callback) {
|
396 |
+
// Method calling logic
|
397 |
+
if (jQuery.fn.popmake.animations[style]) {
|
398 |
+
return jQuery.fn.popmake.animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
|
399 |
+
}
|
400 |
+
jQuery.error('Animation style ' + jQuery.fn.popmake.animations + ' does not exist.');
|
401 |
+
return this;
|
402 |
+
},
|
403 |
+
animation_origin: function (origin) {
|
404 |
+
var $this = jQuery(this),
|
405 |
+
start = {
|
406 |
+
my: "",
|
407 |
+
at: ""
|
408 |
+
};
|
409 |
+
|
410 |
+
switch (origin) {
|
411 |
+
case 'top':
|
412 |
+
start = {
|
413 |
+
my: "left+" + $this.offset().left + " bottom-100",
|
414 |
+
at: "left top"
|
415 |
+
};
|
416 |
+
break;
|
417 |
+
case 'bottom':
|
418 |
+
start = {
|
419 |
+
my: "left+" + $this.offset().left + " top+100",
|
420 |
+
at: "left bottom"
|
421 |
+
};
|
422 |
+
break;
|
423 |
+
case 'left':
|
424 |
+
start = {
|
425 |
+
my: "right top+" + $this.offset().top,
|
426 |
+
at: "left top"
|
427 |
+
};
|
428 |
+
break;
|
429 |
+
case 'right':
|
430 |
+
start = {
|
431 |
+
my: "left top+" + $this.offset().top,
|
432 |
+
at: "right top"
|
433 |
+
};
|
434 |
+
break;
|
435 |
+
default:
|
436 |
+
if (origin.indexOf('left') >= 0) {
|
437 |
+
start = {
|
438 |
+
my: start.my + " right",
|
439 |
+
at: start.at + " left"
|
440 |
+
};
|
441 |
+
}
|
442 |
+
if (origin.indexOf('right') >= 0) {
|
443 |
+
start = {
|
444 |
+
my: start.my + " left",
|
445 |
+
at: start.at + " right"
|
446 |
+
};
|
447 |
+
}
|
448 |
+
if (origin.indexOf('center') >= 0) {
|
449 |
+
start = {
|
450 |
+
my: start.my + " center",
|
451 |
+
at: start.at + " center"
|
452 |
+
};
|
453 |
+
}
|
454 |
+
if (origin.indexOf('top') >= 0) {
|
455 |
+
start = {
|
456 |
+
my: start.my + " bottom-100",
|
457 |
+
at: start.at + " top"
|
458 |
+
};
|
459 |
+
}
|
460 |
+
if (origin.indexOf('bottom') >= 0) {
|
461 |
+
start = {
|
462 |
+
my: start.my + " top+100",
|
463 |
+
at: start.at + " bottom"
|
464 |
+
};
|
465 |
+
}
|
466 |
+
start.my = jQuery.trim(start.my);
|
467 |
+
start.at = jQuery.trim(start.at);
|
468 |
+
break;
|
469 |
+
}
|
470 |
+
start.of = window;
|
471 |
+
start.collision = 'none';
|
472 |
+
return start;
|
473 |
+
}
|
474 |
+
};
|
475 |
+
|
476 |
+
jQuery.fn.popmake.callbacks = {
|
477 |
+
reposition_using: function (position) {
|
478 |
+
jQuery(this).css(position);
|
479 |
+
}
|
480 |
+
};
|
481 |
+
|
482 |
+
jQuery.fn.popmake.utilities = {
|
483 |
+
convert_hex: function (hex, opacity) {
|
484 |
+
hex = hex.replace('#', '');
|
485 |
+
var r = parseInt(hex.substring(0, 2), 16),
|
486 |
+
g = parseInt(hex.substring(2, 4), 16),
|
487 |
+
b = parseInt(hex.substring(4, 6), 16),
|
488 |
+
result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
|
489 |
+
return result;
|
490 |
+
},
|
491 |
+
debounce: function (callback, threshold) {
|
492 |
+
var timeout;
|
493 |
+
return function () {
|
494 |
+
var context = this, params = arguments;
|
495 |
+
window.clearTimeout(timeout);
|
496 |
+
timeout = window.setTimeout(function () {
|
497 |
+
callback.apply(context, params);
|
498 |
+
}, threshold);
|
499 |
+
};
|
500 |
+
},
|
501 |
+
throttle: function (callback, threshold) {
|
502 |
+
var suppress = false,
|
503 |
+
clear = function () {
|
504 |
+
suppress = false;
|
505 |
+
};
|
506 |
+
return function () {
|
507 |
+
if (!suppress) {
|
508 |
+
callback.apply(this, arguments);
|
509 |
+
window.setTimeout(clear, threshold);
|
510 |
+
suppress = true;
|
511 |
+
}
|
512 |
+
};
|
513 |
+
},
|
514 |
+
getXPath: function (element) {
|
515 |
+
var path = [],
|
516 |
+
current,
|
517 |
+
id,
|
518 |
+
classes,
|
519 |
+
tag,
|
520 |
+
eq;
|
521 |
+
|
522 |
+
jQuery.each(jQuery(element).parents(), function (index, value) {
|
523 |
+
current = jQuery(value);
|
524 |
+
id = current.attr("id") || '';
|
525 |
+
classes = current.attr("class") || '';
|
526 |
+
tag = current.get(0).tagName.toLowerCase();
|
527 |
+
eq = current.parent().children(tag).index(current);
|
528 |
+
if (tag === 'body') {
|
529 |
+
return false;
|
530 |
+
}
|
531 |
+
if (classes.length > 0) {
|
532 |
+
classes = classes.split(' ');
|
533 |
+
classes = classes[0];
|
534 |
+
}
|
535 |
+
path.push(tag + (id.length > 0 ? "#" + id : (classes.length > 0 ? "." + classes.split(' ').join('.') : ':eq(' + eq + ')')));
|
536 |
+
});
|
537 |
+
return path.reverse().join(' > ');
|
538 |
+
},
|
539 |
+
strtotime: function (text, now) {
|
540 |
+
// discuss at: http://phpjs.org/functions/strtotime/
|
541 |
+
// version: 1109.2016
|
542 |
+
// original by: Caio Ariede (http://caioariede.com)
|
543 |
+
// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
544 |
+
// improved by: Caio Ariede (http://caioariede.com)
|
545 |
+
// improved by: A. Matías Quezada (http://amatiasq.com)
|
546 |
+
// improved by: preuter
|
547 |
+
// improved by: Brett Zamir (http://brett-zamir.me)
|
548 |
+
// improved by: Mirko Faber
|
549 |
+
// input by: David
|
550 |
+
// bugfixed by: Wagner B. Soares
|
551 |
+
// bugfixed by: Artur Tchernychev
|
552 |
+
// note: Examples all have a fixed timestamp to prevent tests to fail because of variable time(zones)
|
553 |
+
// example 1: strtotime('+1 day', 1129633200);
|
554 |
+
// returns 1: 1129719600
|
555 |
+
// example 2: strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200);
|
556 |
+
// returns 2: 1130425202
|
557 |
+
// example 3: strtotime('last month', 1129633200);
|
558 |
+
// returns 3: 1127041200
|
559 |
+
// example 4: strtotime('2009-05-04 08:30:00 GMT');
|
560 |
+
// returns 4: 1241425800
|
561 |
+
var parsed, match, today, year, date, days, ranges, len, times, regex, i, fail = false;
|
562 |
+
if (!text) {
|
563 |
+
return fail;
|
564 |
+
}
|
565 |
+
// Unecessary spaces
|
566 |
+
text = text.replace(/^\s+|\s+$/g, '')
|
567 |
+
.replace(/\s{2,}/g, ' ')
|
568 |
+
.replace(/[\t\r\n]/g, '')
|
569 |
+
.toLowerCase();
|
570 |
+
// in contrast to php, js Date.parse function interprets:
|
571 |
+
// dates given as yyyy-mm-dd as in timezone: UTC,
|
572 |
+
// dates with "." or "-" as MDY instead of DMY
|
573 |
+
// dates with two-digit years differently
|
574 |
+
// etc...etc...
|
575 |
+
// ...therefore we manually parse lots of common date formats
|
576 |
+
match = text.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/);
|
577 |
+
if (match && match[2] === match[4]) {
|
578 |
+
if (match[1] > 1901) {
|
579 |
+
switch (match[2]) {
|
580 |
+
case '-':
|
581 |
+
// YYYY-M-D
|
582 |
+
if (match[3] > 12 || match[5] > 31) {
|
583 |
+
return fail;
|
584 |
+
}
|
585 |
+
return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
|
586 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
587 |
+
case '.':
|
588 |
+
// YYYY.M.D is not parsed by strtotime()
|
589 |
+
return fail;
|
590 |
+
case '/':
|
591 |
+
// YYYY/M/D
|
592 |
+
if (match[3] > 12 || match[5] > 31) {
|
593 |
+
return fail;
|
594 |
+
}
|
595 |
+
return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
|
596 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
597 |
+
}
|
598 |
+
} else if (match[5] > 1901) {
|
599 |
+
switch (match[2]) {
|
600 |
+
case '-':
|
601 |
+
// D-M-YYYY
|
602 |
+
if (match[3] > 12 || match[1] > 31) {
|
603 |
+
return fail;
|
604 |
+
}
|
605 |
+
return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
|
606 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
607 |
+
case '.':
|
608 |
+
// D.M.YYYY
|
609 |
+
if (match[3] > 12 || match[1] > 31) {
|
610 |
+
return fail;
|
611 |
+
}
|
612 |
+
return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
|
613 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
614 |
+
case '/':
|
615 |
+
// M/D/YYYY
|
616 |
+
if (match[1] > 12 || match[3] > 31) {
|
617 |
+
return fail;
|
618 |
+
}
|
619 |
+
return new Date(match[5], parseInt(match[1], 10) - 1, match[3],
|
620 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
621 |
+
}
|
622 |
+
} else {
|
623 |
+
switch (match[2]) {
|
624 |
+
case '-':
|
625 |
+
// YY-M-D
|
626 |
+
if (match[3] > 12 || match[5] > 31 || (match[1] < 70 && match[1] > 38)) {
|
627 |
+
return fail;
|
628 |
+
}
|
629 |
+
year = match[1] >= 0 && match[1] <= 38 ? +match[1] + 2000 : match[1];
|
630 |
+
return new Date(year, parseInt(match[3], 10) - 1, match[5],
|
631 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
632 |
+
case '.':
|
633 |
+
// D.M.YY or H.MM.SS
|
634 |
+
if (match[5] >= 70) { // D.M.YY
|
635 |
+
if (match[3] > 12 || match[1] > 31) {
|
636 |
+
return fail;
|
637 |
+
}
|
638 |
+
return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
|
639 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
640 |
+
}
|
641 |
+
if (match[5] < 60 && !match[6]) { // H.MM.SS
|
642 |
+
if (match[1] > 23 || match[3] > 59) {
|
643 |
+
return fail;
|
644 |
+
}
|
645 |
+
today = new Date();
|
646 |
+
return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
|
647 |
+
match[1] || 0, match[3] || 0, match[5] || 0, match[9] || 0) / 1000;
|
648 |
+
}
|
649 |
+
return fail; // invalid format, cannot be parsed
|
650 |
+
case '/':
|
651 |
+
// M/D/YY
|
652 |
+
if (match[1] > 12 || match[3] > 31 || (match[5] < 70 && match[5] > 38)) {
|
653 |
+
return fail;
|
654 |
+
}
|
655 |
+
year = match[5] >= 0 && match[5] <= 38 ? +match[5] + 2000 : match[5];
|
656 |
+
return new Date(year, parseInt(match[1], 10) - 1, match[3],
|
657 |
+
match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
|
658 |
+
case ':':
|
659 |
+
// HH:MM:SS
|
660 |
+
if (match[1] > 23 || match[3] > 59 || match[5] > 59) {
|
661 |
+
return fail;
|
662 |
+
}
|
663 |
+
today = new Date();
|
664 |
+
return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
|
665 |
+
match[1] || 0, match[3] || 0, match[5] || 0) / 1000;
|
666 |
+
}
|
667 |
+
}
|
668 |
+
}
|
669 |
+
// other formats and "now" should be parsed by Date.parse()
|
670 |
+
if (text === 'now') {
|
671 |
+
return now === null || isNaN(now) ? new Date()
|
672 |
+
.getTime() / 1000 || 0 : now || 0;
|
673 |
+
}
|
674 |
+
parsed = Date.parse(text);
|
675 |
+
if (!isNaN(parsed)) {
|
676 |
+
return parsed / 1000 || 0;
|
677 |
+
}
|
678 |
+
date = now ? new Date(now * 1000) : new Date();
|
679 |
+
days = {
|
680 |
+
'sun': 0,
|
681 |
+
'mon': 1,
|
682 |
+
'tue': 2,
|
683 |
+
'wed': 3,
|
684 |
+
'thu': 4,
|
685 |
+
'fri': 5,
|
686 |
+
'sat': 6
|
687 |
+
};
|
688 |
+
ranges = {
|
689 |
+
'yea': 'FullYear',
|
690 |
+
'mon': 'Month',
|
691 |
+
'day': 'Date',
|
692 |
+
'hou': 'Hours',
|
693 |
+
'min': 'Minutes',
|
694 |
+
'sec': 'Seconds'
|
695 |
+
};
|
696 |
+
|
697 |
+
function lastNext(type, range, modifier) {
|
698 |
+
var diff, day = days[range];
|
699 |
+
if (day !== undefined) {
|
700 |
+
diff = day - date.getDay();
|
701 |
+
if (diff === 0) {
|
702 |
+
diff = 7 * modifier;
|
703 |
+
} else if (diff > 0 && type === 'last') {
|
704 |
+
diff -= 7;
|
705 |
+
} else if (diff < 0 && type === 'next') {
|
706 |
+
diff += 7;
|
707 |
+
}
|
708 |
+
date.setDate(date.getDate() + diff);
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
function process(val) {
|
713 |
+
var splt = val.split(' '),
|
714 |
+
type = splt[0],
|
715 |
+
range = splt[1].substring(0, 3),
|
716 |
+
typeIsNumber = /\d+/.test(type),
|
717 |
+
ago = splt[2] === 'ago',
|
718 |
+
num = (type === 'last' ? -1 : 1) * (ago ? -1 : 1);
|
719 |
+
if (typeIsNumber) {
|
720 |
+
num *= parseInt(type, 10);
|
721 |
+
}
|
722 |
+
if (ranges.hasOwnProperty(range) && !splt[1].match(/^mon(day|\.)?$/i)) {
|
723 |
+
return date['set' + ranges[range]](date['get' + ranges[range]]() + num);
|
724 |
+
}
|
725 |
+
if (range === 'wee') {
|
726 |
+
return date.setDate(date.getDate() + (num * 7));
|
727 |
+
}
|
728 |
+
if (type === 'next' || type === 'last') {
|
729 |
+
lastNext(type, range, num);
|
730 |
+
} else if (!typeIsNumber) {
|
731 |
+
return false;
|
732 |
+
}
|
733 |
+
return true;
|
734 |
+
}
|
735 |
+
times = '(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec' +
|
736 |
+
'|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?' +
|
737 |
+
'|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)';
|
738 |
+
regex = '([+-]?\\d+\\s' + times + '|' + '(last|next)\\s' + times + ')(\\sago)?';
|
739 |
+
match = text.match(new RegExp(regex, 'gi'));
|
740 |
+
if (!match) {
|
741 |
+
return fail;
|
742 |
+
}
|
743 |
+
for (i = 0, len = match.length; i < len; i += 1) {
|
744 |
+
if (!process(match[i])) {
|
745 |
+
return fail;
|
746 |
+
}
|
747 |
+
}
|
748 |
+
// ECMAScript 5 only
|
749 |
+
// if (!match.every(process))
|
750 |
+
// return false;
|
751 |
+
return (date.getTime() / 1000);
|
752 |
+
}
|
753 |
+
};
|
754 |
+
// Deprecated fix. utilies was renamed because of typo.
|
755 |
+
jQuery.fn.popmake.utilies = jQuery.fn.popmake.utilities;
|
756 |
+
|
757 |
+
jQuery.fn.popmake.defaults = {
|
758 |
+
theme_id: popmake_default_theme,
|
759 |
+
meta: {
|
760 |
+
display: {
|
761 |
+
stackable: 0,
|
762 |
+
overlay_disabled: 0,
|
763 |
+
size: 'medium',
|
764 |
+
responsive_max_width: '',
|
765 |
+
responsive_max_width_unit: '%',
|
766 |
+
responsive_min_width: '',
|
767 |
+
responsive_min_width_unit: '%',
|
768 |
+
custom_width: '',
|
769 |
+
custom_width_unit: '%',
|
770 |
+
custom_height: '',
|
771 |
+
custom_height_unit: 'em',
|
772 |
+
custom_height_auto: 0,
|
773 |
+
location: 'center top',
|
774 |
+
position_top: 100,
|
775 |
+
position_left: 0,
|
776 |
+
position_bottom: 0,
|
777 |
+
position_right: 0,
|
778 |
+
position_fixed: 0,
|
779 |
+
animation_type: 'fade',
|
780 |
+
animation_speed: 350,
|
781 |
+
animation_origin: 'center top'
|
782 |
+
},
|
783 |
+
close: {
|
784 |
+
overlay_click: 0,
|
785 |
+
esc_press: 0,
|
786 |
+
f4_press: 0
|
787 |
+
}
|
788 |
+
},
|
789 |
+
|
790 |
+
|
791 |
+
container: {
|
792 |
+
active_class: 'active',
|
793 |
+
attr: {
|
794 |
+
class: "popmake"
|
795 |
+
}
|
796 |
+
},
|
797 |
+
title: {
|
798 |
+
attr: {
|
799 |
+
class: "popmake-title"
|
800 |
+
}
|
801 |
+
},
|
802 |
+
content: {
|
803 |
+
attr: {
|
804 |
+
class: "popmake-content"
|
805 |
+
}
|
806 |
+
},
|
807 |
+
close: {
|
808 |
+
close_speed: 0,
|
809 |
+
attr: {
|
810 |
+
class: "popmake-close"
|
811 |
+
}
|
812 |
+
},
|
813 |
+
overlay: {
|
814 |
+
attr: {
|
815 |
+
id: "popmake-overlay",
|
816 |
+
class: "popmake-overlay"
|
817 |
+
}
|
818 |
+
}
|
819 |
+
};
|
820 |
+
|
821 |
+
jQuery.fn.popmake.themes = popmake_themes;
|
822 |
+
|
823 |
+
jQuery.fn.popmake.overlay_animations = {
|
824 |
+
none: function (duration, callback) {
|
825 |
+
var $this = jQuery(this),
|
826 |
+
settings = $this.data('popmake');
|
827 |
+
jQuery('#' + settings.overlay.attr.id).show(duration, callback);
|
828 |
+
},
|
829 |
+
fade: function (duration, callback) {
|
830 |
+
var $this = jQuery(this),
|
831 |
+
settings = $this.data('popmake');
|
832 |
+
jQuery('#' + settings.overlay.attr.id).fadeIn(duration, callback);
|
833 |
+
},
|
834 |
+
slide: function (duration, callback) {
|
835 |
+
var $this = jQuery(this),
|
836 |
+
settings = $this.data('popmake');
|
837 |
+
jQuery('#' + settings.overlay.attr.id).slideDown(duration, callback);
|
838 |
+
}
|
839 |
+
};
|
840 |
+
|
841 |
+
jQuery.fn.popmake.animations = {
|
842 |
+
none: function (callback) {
|
843 |
+
var $this = jQuery(this);
|
844 |
+
$this.popmake('animate_overlay', 'none', 0, function () {
|
845 |
+
$this.css({display: 'block'});
|
846 |
+
if (callback !== undefined) {
|
847 |
+
callback();
|
848 |
+
}
|
849 |
+
});
|
850 |
+
return this;
|
851 |
+
},
|
852 |
+
slide: function (callback) {
|
853 |
+
var $this = jQuery(this).show(0).css({ opacity: 0 }),
|
854 |
+
settings = $this.data('popmake'),
|
855 |
+
speed = settings.meta.display.animation_speed / 2000,
|
856 |
+
start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
|
857 |
+
|
858 |
+
jQuery('html').css('overflow-x', 'hidden');
|
859 |
+
|
860 |
+
$this
|
861 |
+
.position(start)
|
862 |
+
.css({ opacity: 1 })
|
863 |
+
.popmake('animate_overlay', 'fade', speed * 1000, function () {
|
864 |
+
$this.popmake('reposition', function (position) {
|
865 |
+
|
866 |
+
TweenLite.to($this, speed, jQuery.extend(position, {
|
867 |
+
onComplete: function () {
|
868 |
+
jQuery('html').css('overflow-x', 'inherit');
|
869 |
+
if (callback !== undefined) {
|
870 |
+
callback();
|
871 |
+
}
|
872 |
+
}
|
873 |
+
}));
|
874 |
+
|
875 |
+
});
|
876 |
+
});
|
877 |
+
return this;
|
878 |
+
},
|
879 |
+
fade: function (callback) {
|
880 |
+
var $this = jQuery(this).show(0).css({ opacity: 0 }),
|
881 |
+
settings = $this.data('popmake'),
|
882 |
+
speed = settings.meta.display.animation_speed / 2000;
|
883 |
+
|
884 |
+
$this
|
885 |
+
.popmake('animate_overlay', 'fade', speed * 1000, function () {
|
886 |
+
|
887 |
+
TweenLite.to($this, speed, {
|
888 |
+
opacity: 1,
|
889 |
+
onComplete: function () {
|
890 |
+
if (callback !== undefined) {
|
891 |
+
callback();
|
892 |
+
}
|
893 |
+
}
|
894 |
+
});
|
895 |
+
|
896 |
+
});
|
897 |
+
return this;
|
898 |
+
},
|
899 |
+
fadeAndSlide: function (callback) {
|
900 |
+
var $this = jQuery(this).show(0).css({ opacity: 0 }),
|
901 |
+
settings = $this.data('popmake'),
|
902 |
+
speed = settings.meta.display.animation_speed / 2000,
|
903 |
+
start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
|
904 |
+
|
905 |
+
jQuery('html').css('overflow-x', 'hidden');
|
906 |
+
|
907 |
+
$this
|
908 |
+
.position(start)
|
909 |
+
.popmake('animate_overlay', 'fade', speed * 1000, function () {
|
910 |
+
$this.popmake('reposition', function (position) {
|
911 |
+
|
912 |
+
TweenLite.to($this, speed, jQuery.extend(position, {
|
913 |
+
opacity: 1,
|
914 |
+
onComplete: function () {
|
915 |
+
jQuery('html').css('overflow-x', 'inherit');
|
916 |
+
if (callback !== undefined) {
|
917 |
+
callback();
|
918 |
+
}
|
919 |
+
}
|
920 |
+
}));
|
921 |
+
|
922 |
+
});
|
923 |
+
});
|
924 |
+
return this;
|
925 |
+
},
|
926 |
+
grow: function (callback) {
|
927 |
+
var $this = jQuery(this).show(0).css({ opacity: 0 }),
|
928 |
+
settings = $this.data('popmake'),
|
929 |
+
speed = settings.meta.display.animation_speed / 2000,
|
930 |
+
origin = settings.meta.display.animation_origin;
|
931 |
+
|
932 |
+
if (origin === 'top' || origin === 'bottom') {
|
933 |
+
origin = 'center ' + origin;
|
934 |
+
}
|
935 |
+
if (origin === 'left' || origin === 'right') {
|
936 |
+
origin = origin + ' center';
|
937 |
+
}
|
938 |
+
|
939 |
+
TweenLite.to($this, 0, {
|
940 |
+
transformOrigin: origin,
|
941 |
+
scale: 0,
|
942 |
+
opacity: 1
|
943 |
+
});
|
944 |
+
|
945 |
+
$this.popmake('animate_overlay', 'fade', speed * 1000, function () {
|
946 |
+
// Reposition with callback. position returns default positioning.
|
947 |
+
$this.popmake('reposition', function (position) {
|
948 |
+
|
949 |
+
TweenLite.to($this, speed, {
|
950 |
+
scale: 1,
|
951 |
+
onComplete: function () {
|
952 |
+
if (callback !== undefined) {
|
953 |
+
callback();
|
954 |
+
}
|
955 |
+
}
|
956 |
+
});
|
957 |
+
});
|
958 |
+
});
|
959 |
+
return this;
|
960 |
+
},
|
961 |
+
growAndSlide: function (callback) {
|
962 |
+
var $this = jQuery(this).show(0).css({ opacity: 0 }),
|
963 |
+
settings = $this.data('popmake'),
|
964 |
+
speed = settings.meta.display.animation_speed / 2000,
|
965 |
+
origin = settings.meta.display.animation_origin,
|
966 |
+
start = $this.popmake('animation_origin', origin);
|
967 |
+
|
968 |
+
jQuery('html').css('overflow-x', 'hidden');
|
969 |
+
|
970 |
+
$this.position(start);
|
971 |
+
|
972 |
+
TweenLite.to($this, 0, { scale: 0, opacity: 1, transformOrigin: '0 0' });
|
973 |
+
|
974 |
+
$this.popmake('animate_overlay', 'fade', speed * 1000, function () {
|
975 |
+
$this.popmake('reposition', function (position) {
|
976 |
+
|
977 |
+
TweenLite.to($this, speed, jQuery.extend(position, {
|
978 |
+
scale: 1,
|
979 |
+
transformOrigin: '50% 50%',
|
980 |
+
onComplete: function () {
|
981 |
+
jQuery('html').css('overflow-x', 'inherit');
|
982 |
+
if (callback !== undefined) {
|
983 |
+
callback();
|
984 |
+
}
|
985 |
+
}
|
986 |
+
}));
|
987 |
+
|
988 |
+
});
|
989 |
+
});
|
990 |
+
return this;
|
991 |
+
}
|
992 |
+
};
|
993 |
+
|
994 |
+
jQuery('.popmake').css({ visibility: "visible" }).hide();
|
995 |
+
|
996 |
+
jQuery(document).ready(function () {
|
997 |
+
jQuery('.popmake')
|
998 |
+
.popmake()
|
999 |
+
.each(function () {
|
1000 |
+
var $this = jQuery(this),
|
1001 |
+
settings = $this.data('popmake'),
|
1002 |
+
trigger_selector = '.popmake-' + settings.id + ', .popmake-' + settings.slug;
|
1003 |
+
|
1004 |
+
jQuery(trigger_selector).css({cursor: "pointer"});
|
1005 |
+
jQuery(document).on('click', trigger_selector, function (event) {
|
1006 |
+
event.preventDefault();
|
1007 |
+
event.stopPropagation();
|
1008 |
+
jQuery.fn.popmake.last_open_trigger = jQuery.fn.popmake.utilities.getXPath(this);
|
1009 |
+
$this.popmake('open');
|
1010 |
+
});
|
1011 |
+
});
|
1012 |
+
});
|
1013 |
+
}(jQuery));
|
assets/scripts/popup-maker-site.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Popup Maker v1.0
|
3 |
+
*/
|
4 |
+
(function(d){d.isFunction(d.fn.on)||(d.fn.on=function(a,e,c){return this.delegate(e,a,c)},d.fn.off=function(a,e,c){return this.undelegate(e,a,c)});d.fn.popmake=function(a){if(d.fn.popmake.methods[a])return d.fn.popmake.methods[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof a||!a)return d.fn.popmake.methods.init.apply(this,arguments);d.error("Method "+a+" does not exist on jQuery.fn.popmake")};d.fn.popmake.last_open_trigger=null;d.fn.popmake.last_close_trigger=null;d.fn.popmake.methods= {init:function(a){return this.each(function(){var e=d(this),c=d.extend(!0,{},d.fn.popmake.defaults,e.data("popmake"),a);e.parent().is("body")||e.appendTo("body");d("#"+c.overlay.attr.id).length||d("<div>").attr(c.overlay.attr).appendTo("body");d(window).on("resize",function(){e.hasClass("active")&&d.fn.popmake.utilities.throttle(setTimeout(function(){e.popmake("reposition")},25),500,!1)});"string"===typeof popmake_powered_by&&""!==popmake_powered_by&&d(".popmake-content",e).append(d(popmake_powered_by)); e.data("popmake",c).on("popmakeBeforeOpen.hide_popup",function(){d(this).css({visibility:"visible"}).hide().addClass(c.container.active_class);c.meta.display.stackable||e.popmake("close_all")}).on("popmakeAfterClose.close_overlay",function(){var a=d("#"+c.overlay.attr.id);a.length&&a.is(":visible")&&a.fadeOut(c.close.close_speed)}).on("popmakeAfterClose.reset_videos",function(){d("iframe",e).filter('[src*="youtube"],[src*="vimeo"]').each(function(){var a=d(this).attr("src");d(this).attr("src","").attr("src", a)})}).on("popmakeBeforeOpen.setup_close",function(){e.popmake("setup_close")}).on("popmakeBeforeOpen.retheme",function(){e.popmake("retheme")}).on("popmakeBeforeOpen.reposition",function(){e.popmake("reposition")}).trigger("popmakeInit");return this})},setup_close:function(){var a=d(this),e=a.data("popmake"),c=d("#"+e.overlay.attr.id),b=d("."+e.close.attr["class"],a);b.off("click.popmake").on("click.popmake",function(b){b.preventDefault();b.stopPropagation();d.fn.popmake.last_close_trigger="Close Button"; a.popmake("close")});if(e.meta.close.esc_press||e.meta.close.f4_press)d(window).off("keyup.popmake").on("keyup.popmake",function(b){27===b.keyCode&&e.meta.close.esc_press&&(d.fn.popmake.last_close_trigger="ESC Key",a.popmake("close"));115===b.keyCode&&e.meta.close.f4_press&&(d.fn.popmake.last_close_trigger="F4 Key",a.popmake("close"))});if(e.meta.close.overlay_click)c.off("click.popmake").on("click.popmake",function(b){b.preventDefault();b.stopPropagation();d.fn.popmake.last_close_trigger="Overlay Click"; a.popmake("close")});a.on("popmakeAfterClose",function(){d(window).off("keyup.popmake");c.off("click.popmake");b.off("click.popmake")}).trigger("popmakeSetupClose")},open:function(a){var e=d(this),c=e.data("popmake");e.trigger("popmakeBeforeOpen").popmake("animate",c.meta.display.animation_type,function(){e.addClass("active").trigger("popmakeAfterOpen");void 0!==a&&a()});return this},close:function(){return this.each(function(){var a=d(this),e=a.data("popmake");a.trigger("popmakeBeforeClose").fadeOut(e.close.close_speed, function(){a.removeClass("active").trigger("popmakeAfterClose")});return this})},close_all:function(){var a=d(this).data("popmake");d("."+a.container.attr["class"]).removeClass("active").hide(0);return this},reposition:function(a){d(this).trigger("popmakeBeforeReposition");var e=d(this),c=e.data("popmake"),b=c.meta.display,g=b.location,f={my:"",at:""},h=!1;0<=g.indexOf("left")&&(f={my:f.my+" left"+(0!==b.position_left?"+"+b.position_left:""),at:f.at+" left"});0<=g.indexOf("right")&&(f={my:f.my+" right"+ (0!==b.position_right?"-"+b.position_right:""),at:f.at+" right"});0<=g.indexOf("center")&&(f="center"===g?{my:"center",at:"center"}:{my:f.my+" center",at:f.at+" center"});0<=g.indexOf("top")&&(f={my:f.my+" top"+(0!==b.position_top?"+"+b.position_top:""),at:f.at+" top"});0<=g.indexOf("bottom")&&(f={my:f.my+" bottom"+(0!==b.position_bottom?"-"+b.position_bottom:""),at:f.at+" bottom"});f.my=d.trim(f.my);f.at=d.trim(f.at);f.of=window;f.collision="fit";f.using="function"===typeof a?a:d.fn.popmake.callbacks.reposition_using; e.is(":hidden")&&(h=e.css("opacity"),e.css({opacity:0}).show());b.position_fixed?e.addClass("fixed"):e.removeClass("fixed");"custom"===c.meta.display.size?e.css({width:c.meta.display.custom_width+c.meta.display.custom_width_unit,height:c.meta.display.custom_height_auto?"auto":c.meta.display.custom_height+c.meta.display.custom_height_unit}):"auto"!==c.meta.display.size&&(""!==c.meta.display.responsive_min_width&&e.css({maxWidth:c.meta.display.responsive_min_width+c.meta.display.responsive_min_width_unit}), ""!==c.meta.display.responsive_max_width&&e.css({maxWidth:c.meta.display.responsive_max_width+c.meta.display.responsive_max_width_unit}));e.addClass("custom-position").position(f).trigger("popmakeAfterReposition");h&&e.css({opacity:h}).hide();return this},retheme:function(a){d(this).trigger("popmakeBeforeRetheme");var e=d(this),c=e.data("popmake"),b=d("#"+c.overlay.attr.id),g=d("."+c.title.attr["class"],e),f=d("> ."+c.content.attr["class"],e),h=d("> ."+c.close.attr["class"],e),k;void 0===a&&(a=d.fn.popmake.themes[c.theme_id], void 0===a&&(a=d.fn.popmake.themes[1]));c="yes"===a.container.boxshadow_inset?"inset ":"";k="yes"===a.close.boxshadow_inset?"inset ":"";b.removeAttr("style").css({backgroundColor:d.fn.popmake.utilities.convert_hex(a.overlay.background_color,a.overlay.background_opacity)});e.css({padding:a.container.padding+"px",backgroundColor:d.fn.popmake.utilities.convert_hex(a.container.background_color,a.container.background_opacity),borderStyle:a.container.border_style,borderColor:a.container.border_color,borderWidth:a.container.border_width+ "px",borderRadius:a.container.border_radius+"px",boxShadow:c+a.container.boxshadow_horizontal+"px "+a.container.boxshadow_vertical+"px "+a.container.boxshadow_blur+"px "+a.container.boxshadow_spread+"px "+d.fn.popmake.utilities.convert_hex(a.container.boxshadow_color,a.container.boxshadow_opacity)});g.css({color:a.title.font_color,lineHeight:a.title.line_height+"px",fontSize:a.title.font_size+"px",fontFamily:a.title.font_family,fontWeight:a.title.font_weight,fontStyle:a.title.font_style,textAlign:a.title.text_align, textShadow:a.title.textshadow_horizontal+"px "+a.title.textshadow_vertical+"px "+a.title.textshadow_blur+"px "+d.fn.popmake.utilities.convert_hex(a.title.textshadow_color,a.title.textshadow_opacity)});f.css({color:a.content.font_color,fontFamily:a.content.font_family,fontWeight:a.content.font_weight,fontStyle:a.content.font_style});d("p, label",f).css({color:a.content.font_color,fontFamily:a.content.font_family});h.html(a.close.text).css({padding:a.close.padding+"px",backgroundColor:d.fn.popmake.utilities.convert_hex(a.close.background_color, a.close.background_opacity),color:a.close.font_color,lineHeight:a.close.line_height+"px",fontSize:a.close.font_size+"px",fontWeight:a.close.font_weight,fontStyle:a.close.font_style,fontFamily:a.close.font_family,borderStyle:a.close.border_style,borderColor:a.close.border_color,borderWidth:a.close.border_width+"px",borderRadius:a.close.border_radius+"px",boxShadow:k+a.close.boxshadow_horizontal+"px "+a.close.boxshadow_vertical+"px "+a.close.boxshadow_blur+"px "+a.close.boxshadow_spread+"px "+d.fn.popmake.utilities.convert_hex(a.close.boxshadow_color, a.close.boxshadow_opacity),textShadow:a.close.textshadow_horizontal+"px "+a.close.textshadow_vertical+"px "+a.close.textshadow_blur+"px "+d.fn.popmake.utilities.convert_hex(a.close.textshadow_color,a.close.textshadow_opacity)});switch(a.close.location){case "topleft":h.css({top:a.close.position_top+"px",left:a.close.position_left+"px"});break;case "topright":h.css({top:a.close.position_top+"px",right:a.close.position_right+"px"});break;case "bottomleft":h.css({bottom:a.close.position_bottom+"px", left:a.close.position_left+"px"});break;case "bottomright":h.css({bottom:a.close.position_bottom+"px",right:a.close.position_right+"px"})}e.trigger("popmakeAfterRetheme",[a]);return this},animate_overlay:function(a,e,c){if(d(this).data("popmake").meta.display.overlay_disabled)c();else{if(d.fn.popmake.overlay_animations[a])return d.fn.popmake.overlay_animations[a].apply(this,Array.prototype.slice.call(arguments,1));d.error("Animation style "+d.fn.popmake.overlay_animations+" does not exist.")}return this}, animate:function(a,e){if(d.fn.popmake.animations[a])return d.fn.popmake.animations[a].apply(this,Array.prototype.slice.call(arguments,1));d.error("Animation style "+d.fn.popmake.animations+" does not exist.");return this},animation_origin:function(a){var e=d(this),c={my:"",at:""};switch(a){case "top":c={my:"left+"+e.offset().left+" bottom-100",at:"left top"};break;case "bottom":c={my:"left+"+e.offset().left+" top+100",at:"left bottom"};break;case "left":c={my:"right top+"+e.offset().top,at:"left top"}; break;case "right":c={my:"left top+"+e.offset().top,at:"right top"};break;default:0<=a.indexOf("left")&&(c={my:c.my+" right",at:c.at+" left"}),0<=a.indexOf("right")&&(c={my:c.my+" left",at:c.at+" right"}),0<=a.indexOf("center")&&(c={my:c.my+" center",at:c.at+" center"}),0<=a.indexOf("top")&&(c={my:c.my+" bottom-100",at:c.at+" top"}),0<=a.indexOf("bottom")&&(c={my:c.my+" top+100",at:c.at+" bottom"}),c.my=d.trim(c.my),c.at=d.trim(c.at)}c.of=window;c.collision="none";return c}};d.fn.popmake.callbacks= {reposition_using:function(a){d(this).css(a)}};d.fn.popmake.utilities={convert_hex:function(a,e){a=a.replace("#","");var c=parseInt(a.substring(0,2),16),b=parseInt(a.substring(2,4),16),d=parseInt(a.substring(4,6),16);return"rgba("+c+","+b+","+d+","+e/100+")"},debounce:function(a,e){var c;return function(){var b=this,d=arguments;window.clearTimeout(c);c=window.setTimeout(function(){a.apply(b,d)},e)}},throttle:function(a,d){var c=!1,b=function(){c=!1};return function(){c||(a.apply(this,arguments),window.setTimeout(b, d),c=!0)}},getXPath:function(a){var e=[],c,b,g,f,h;d.each(d(a).parents(),function(a,l){c=d(l);b=c.attr("id")||"";g=c.attr("class")||"";f=c.get(0).tagName.toLowerCase();h=c.parent().children(f).index(c);if("body"===f)return!1;0<g.length&&(g=g.split(" "),g=g[0]);e.push(f+(0<b.length?"#"+b:0<g.length?"."+g.split(" ").join("."):":eq("+h+")"))});return e.reverse().join(" > ")},strtotime:function(a,d){function c(a){var b=a.split(" ");a=b[0];var c=b[1].substring(0,3),d=/\d+/.test(a),e=("last"===a?-1:1)* ("ago"===b[2]?-1:1);d&&(e*=parseInt(a,10));if(k.hasOwnProperty(c)&&!b[1].match(/^mon(day|\.)?$/i))return f["set"+k[c]](f["get"+k[c]]()+e);if("wee"===c)return f.setDate(f.getDate()+7*e);if("next"===a||"last"===a)b=e,c=h[c],void 0!==c&&(c-=f.getDay(),0===c?c=7*b:0<c&&"last"===a?c-=7:0>c&&"next"===a&&(c+=7),f.setDate(f.getDate()+c));else if(!d)return!1;return!0}var b,g,f,h,k,l;if(!a)return!1;a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase();if((b=a.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&& b[2]===b[4])if(1901<b[1])switch(b[2]){case "-":return 12<b[3]||31<b[5]?!1:new Date(b[1],parseInt(b[3],10)-1,b[5],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3;case ".":return!1;case "/":return 12<b[3]||31<b[5]?!1:new Date(b[1],parseInt(b[3],10)-1,b[5],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3}else if(1901<b[5])switch(b[2]){case "-":return 12<b[3]||31<b[1]?!1:new Date(b[5],parseInt(b[3],10)-1,b[1],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3;case ".":return 12<b[3]||31<b[1]?!1:new Date(b[5],parseInt(b[3],10)-1,b[1],b[6]|| 0,b[7]||0,b[8]||0,b[9]||0)/1E3;case "/":return 12<b[1]||31<b[3]?!1:new Date(b[5],parseInt(b[1],10)-1,b[3],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3}else switch(b[2]){case "-":if(12<b[3]||31<b[5]||70>b[1]&&38<b[1])return!1;g=0<=b[1]&&38>=b[1]?+b[1]+2E3:b[1];return new Date(g,parseInt(b[3],10)-1,b[5],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3;case ".":if(70<=b[5])return 12<b[3]||31<b[1]?!1:new Date(b[5],parseInt(b[3],10)-1,b[1],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3;if(60>b[5]&&!b[6]){if(23<b[1]||59<b[3])return!1; g=new Date;return new Date(g.getFullYear(),g.getMonth(),g.getDate(),b[1]||0,b[3]||0,b[5]||0,b[9]||0)/1E3}return!1;case "/":if(12<b[1]||31<b[3]||70>b[5]&&38<b[5])return!1;g=0<=b[5]&&38>=b[5]?+b[5]+2E3:b[5];return new Date(g,parseInt(b[1],10)-1,b[3],b[6]||0,b[7]||0,b[8]||0,b[9]||0)/1E3;case ":":if(23<b[1]||59<b[3]||59<b[5])return!1;g=new Date;return new Date(g.getFullYear(),g.getMonth(),g.getDate(),b[1]||0,b[3]||0,b[5]||0)/1E3}if("now"===a)return null===d||isNaN(d)?(new Date).getTime()/1E3||0:d||0; b=Date.parse(a);if(!isNaN(b))return b/1E3||0;f=d?new Date(1E3*d):new Date;h={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};k={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"};b=a.match(RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?", "gi"));if(!b)return!1;l=0;for(g=b.length;l<g;l+=1)if(!c(b[l]))return!1;return f.getTime()/1E3}};d.fn.popmake.utilies=d.fn.popmake.utilities;d.fn.popmake.defaults={theme_id:popmake_default_theme,meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100, position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}};d.fn.popmake.themes=popmake_themes;d.fn.popmake.overlay_animations= {none:function(a,e){var c=d(this).data("popmake");d("#"+c.overlay.attr.id).show(a,e)},fade:function(a,e){var c=d(this).data("popmake");d("#"+c.overlay.attr.id).fadeIn(a,e)},slide:function(a,e){var c=d(this).data("popmake");d("#"+c.overlay.attr.id).slideDown(a,e)}};d.fn.popmake.animations={none:function(a){var e=d(this);e.popmake("animate_overlay","none",0,function(){e.css({display:"block"});void 0!==a&&a()});return this},slide:function(a){var e=d(this).show(0).css({opacity:0}),c=e.data("popmake"), b=c.meta.display.animation_speed/2E3,c=e.popmake("animation_origin",c.meta.display.animation_origin);d("html").css("overflow-x","hidden");e.position(c).css({opacity:1}).popmake("animate_overlay","fade",1E3*b,function(){e.popmake("reposition",function(c){TweenLite.to(e,b,d.extend(c,{onComplete:function(){d("html").css("overflow-x","inherit");void 0!==a&&a()}}))})});return this},fade:function(a){var e=d(this).show(0).css({opacity:0}),c=e.data("popmake").meta.display.animation_speed/2E3;e.popmake("animate_overlay", "fade",1E3*c,function(){TweenLite.to(e,c,{opacity:1,onComplete:function(){void 0!==a&&a()}})});return this},fadeAndSlide:function(a){var e=d(this).show(0).css({opacity:0}),c=e.data("popmake"),b=c.meta.display.animation_speed/2E3,c=e.popmake("animation_origin",c.meta.display.animation_origin);d("html").css("overflow-x","hidden");e.position(c).popmake("animate_overlay","fade",1E3*b,function(){e.popmake("reposition",function(c){TweenLite.to(e,b,d.extend(c,{opacity:1,onComplete:function(){d("html").css("overflow-x", "inherit");void 0!==a&&a()}}))})});return this},grow:function(a){var e=d(this).show(0).css({opacity:0}),c=e.data("popmake"),b=c.meta.display.animation_speed/2E3,c=c.meta.display.animation_origin;if("top"===c||"bottom"===c)c="center "+c;if("left"===c||"right"===c)c+=" center";TweenLite.to(e,0,{transformOrigin:c,scale:0,opacity:1});e.popmake("animate_overlay","fade",1E3*b,function(){e.popmake("reposition",function(c){TweenLite.to(e,b,{scale:1,onComplete:function(){void 0!==a&&a()}})})});return this}, growAndSlide:function(a){var e=d(this).show(0).css({opacity:0}),c=e.data("popmake"),b=c.meta.display.animation_speed/2E3,c=e.popmake("animation_origin",c.meta.display.animation_origin);d("html").css("overflow-x","hidden");e.position(c);TweenLite.to(e,0,{scale:0,opacity:1,transformOrigin:"0 0"});e.popmake("animate_overlay","fade",1E3*b,function(){e.popmake("reposition",function(c){TweenLite.to(e,b,d.extend(c,{scale:1,transformOrigin:"50% 50%",onComplete:function(){d("html").css("overflow-x","inherit"); void 0!==a&&a()}}))})});return this}};d(".popmake").css({visibility:"visible"}).hide();d(document).ready(function(){d(".popmake").popmake().each(function(){var a=d(this),e=a.data("popmake"),e=".popmake-"+e.id+", .popmake-"+e.slug;d(e).css({cursor:"pointer"});d(document).on("click",e,function(c){c.preventDefault();c.stopPropagation();d.fn.popmake.last_open_trigger=d.fn.popmake.utilities.getXPath(this);a.popmake("open")})})})})(jQuery);
|
assets/styles/popup-maker-admin.css
ADDED
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* UI */
|
2 |
+
h3.title {
|
3 |
+
color: #9aba27;
|
4 |
+
}
|
5 |
+
#popuptitlediv #popuptitle {
|
6 |
+
background-color: #fff;
|
7 |
+
font-size: 1.5em;
|
8 |
+
height: 1.8em;
|
9 |
+
line-height: 100%;
|
10 |
+
margin: 0;
|
11 |
+
outline: medium none;
|
12 |
+
padding: 2px 8px;
|
13 |
+
width: 100%;
|
14 |
+
}
|
15 |
+
#popuptitlediv #popuptitle input {
|
16 |
+
color: #777;
|
17 |
+
font-size: 1.7em;
|
18 |
+
padding: 11px 10px;
|
19 |
+
position: absolute;
|
20 |
+
}
|
21 |
+
#popuptitlediv #popuptitle-prompt-text {
|
22 |
+
font-size: 1.4em;
|
23 |
+
padding: 8px 10px;
|
24 |
+
}
|
25 |
+
#titlediv #title {
|
26 |
+
margin: 0 0 1em;
|
27 |
+
}
|
28 |
+
.posttypediv, .taxonomydiv {
|
29 |
+
margin-bottom:10px;
|
30 |
+
clear:both;
|
31 |
+
overflow:auto;
|
32 |
+
}
|
33 |
+
|
34 |
+
option.bold {
|
35 |
+
font-weight:bold;
|
36 |
+
font-size: 1.125em;
|
37 |
+
}
|
38 |
+
|
39 |
+
/* Range Slider Adjusters */
|
40 |
+
.popmake-range-manual {
|
41 |
+
padding-right:25px;
|
42 |
+
text-align: right;
|
43 |
+
width:80px;
|
44 |
+
}
|
45 |
+
.range-value-unit {
|
46 |
+
position: relative;
|
47 |
+
display: inline-block;
|
48 |
+
margin-left:-30px;
|
49 |
+
margin-right:10px;
|
50 |
+
width:20px;
|
51 |
+
text-align: left;
|
52 |
+
}
|
53 |
+
|
54 |
+
/* Form Table Dividers */
|
55 |
+
.title-divider th {
|
56 |
+
border-top:1px solid #ccc;
|
57 |
+
padding:0;
|
58 |
+
}
|
59 |
+
.form-table td, .form-table tr {
|
60 |
+
padding-top:10px;
|
61 |
+
}
|
62 |
+
.title-divider .title {
|
63 |
+
font-size:1.125em;
|
64 |
+
padding-left:0!important;
|
65 |
+
padding-top:20px!important;
|
66 |
+
padding-bottom:0!important;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
/* Marketing & Standouts */
|
73 |
+
/* Menu Highlight */
|
74 |
+
#menu-posts-popup ul.wp-submenu li:nth-child(0n+8) a {
|
75 |
+
color: #9ABA27;
|
76 |
+
}
|
77 |
+
|
78 |
+
/* Upgrade Tips */
|
79 |
+
.popmake-upgrade-tip {
|
80 |
+
color:#333;
|
81 |
+
}
|
82 |
+
.popmake-upgrade-tip hr {
|
83 |
+
margin-bottom:25px;
|
84 |
+
}
|
85 |
+
.popmake-upgrade-tip img {
|
86 |
+
float:left;
|
87 |
+
margin-right:15px;
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
/* Newsletter Banner Optin */
|
95 |
+
.popmake-newsletter-optin {
|
96 |
+
display: none;
|
97 |
+
position:relative;
|
98 |
+
width: 100%;
|
99 |
+
margin-bottom: 10px;
|
100 |
+
}
|
101 |
+
.popmake-newsletter-optin img {
|
102 |
+
max-width: 100%;
|
103 |
+
width: 100%;
|
104 |
+
}
|
105 |
+
.popmake-newsletter-optin .popmake-optin-dismiss {
|
106 |
+
display: inline-block;
|
107 |
+
position: absolute;
|
108 |
+
right: 5px;
|
109 |
+
bottom: 5px;
|
110 |
+
cursor: pointer;
|
111 |
+
color: #6B8129;
|
112 |
+
font-family: "Open Sans",sans-serif;
|
113 |
+
text-transform: uppercase;
|
114 |
+
font-size: 0.875em;
|
115 |
+
}
|
116 |
+
.popmake-newsletter-optin .popmake-optin-dismiss:hover {
|
117 |
+
color: #9ABA27;
|
118 |
+
}
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
|
124 |
+
/* Theme Builder */
|
125 |
+
#popmake_popup_theme_preview {
|
126 |
+
z-index:100;
|
127 |
+
}
|
128 |
+
#popmake_popup_theme_preview .inside {
|
129 |
+
margin-top:0;
|
130 |
+
background: url(http://s.wordpress.com/mshots/v1/http://www.wordpress.org) no-repeat center top;
|
131 |
+
}
|
132 |
+
#popmake_popup_theme_preview .empreview {
|
133 |
+
padding-top: 25px;
|
134 |
+
}
|
135 |
+
.example-popup, .example-popup:before, .example-popup:after {
|
136 |
+
-moz-box-sizing: border-box;
|
137 |
+
}
|
138 |
+
.empreview .example-popup-overlay{
|
139 |
+
position:absolute;
|
140 |
+
display:block;
|
141 |
+
width:100%;
|
142 |
+
height:100%;
|
143 |
+
top:0;
|
144 |
+
left:0
|
145 |
+
}
|
146 |
+
.empreview .example-popup {
|
147 |
+
display:block;
|
148 |
+
position:relative;
|
149 |
+
width:95%;
|
150 |
+
max-width:400px;
|
151 |
+
margin:0 auto 25px;
|
152 |
+
font-size:16px;
|
153 |
+
position: relative;
|
154 |
+
z-index: 99;
|
155 |
+
}
|
156 |
+
.empreview .example-popup .close-popup {
|
157 |
+
text-decoration:none;
|
158 |
+
text-align:center;
|
159 |
+
line-height: 1;
|
160 |
+
position: absolute;
|
161 |
+
font-weight: bold;
|
162 |
+
cursor: pointer;
|
163 |
+
min-width: 1em;
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
+
/* Sidebar */
|
175 |
+
.popmake-support-links {
|
176 |
+
list-style: none;
|
177 |
+
}
|
178 |
+
.popmake-support-links li {
|
179 |
+
margin-bottom: 10px;
|
180 |
+
}
|
181 |
+
.popmake-support-links a {
|
182 |
+
color: #20252b;
|
183 |
+
font-family: "Montserrat";
|
184 |
+
font-size: 1.25em;
|
185 |
+
text-transform: uppercase;
|
186 |
+
text-decoration: none;
|
187 |
+
}
|
188 |
+
.popmake-support-links a span {
|
189 |
+
margin-left: 10px;
|
190 |
+
}
|
191 |
+
.popmake-support-links a img {
|
192 |
+
top: 6px;
|
193 |
+
position: relative;
|
194 |
+
min-width: 24px;
|
195 |
+
max-width: 24px;
|
196 |
+
min-height: 24px;
|
197 |
+
max-height: 24px;
|
198 |
+
}
|
199 |
+
|
200 |
+
.button.rounded {
|
201 |
+
box-shadow: none;
|
202 |
+
border:0;
|
203 |
+
border-radius:2px;
|
204 |
+
background:#9aba27;
|
205 |
+
color:#fff;
|
206 |
+
padding-left:18px;
|
207 |
+
padding-right:18px;
|
208 |
+
transition:transform .5s;
|
209 |
+
margin-bottom:10px;
|
210 |
+
}
|
211 |
+
.button.rounded:hover, .button.rounded:focus {
|
212 |
+
color:#fff;
|
213 |
+
background:#20252b;
|
214 |
+
transform:scale(1.125);
|
215 |
+
}
|
216 |
+
#popmake_popup_support {
|
217 |
+
margin-bottom:10px;
|
218 |
+
}
|
219 |
+
#popmake_popup_share .handlediv {
|
220 |
+
display:none;
|
221 |
+
}
|
222 |
+
#popmake_popup_share .hndle {
|
223 |
+
display:none;
|
224 |
+
}
|
225 |
+
#popmake_popup_share .inside {
|
226 |
+
margin:0 0 20px;
|
227 |
+
}
|
228 |
+
.loveit-shareit {
|
229 |
+
font-weight: 700!important;
|
230 |
+
font-size: 28px!important;
|
231 |
+
color:#333;
|
232 |
+
text-transform: uppercase;
|
233 |
+
}
|
234 |
+
.loveit-shareit span {
|
235 |
+
color:#9ABA27;
|
236 |
+
}
|
237 |
+
.follow-box {
|
238 |
+
text-align: center;
|
239 |
+
padding:14px 36px;
|
240 |
+
background:#fff;
|
241 |
+
border:1px solid #e5e5e5;
|
242 |
+
}
|
243 |
+
|
244 |
+
.share-buttons {
|
245 |
+
margin:0 auto;
|
246 |
+
width:68%;
|
247 |
+
display:block;
|
248 |
+
clear:both;
|
249 |
+
}
|
250 |
+
.share-buttons li {
|
251 |
+
text-align:center;
|
252 |
+
width:32%;
|
253 |
+
display:inline-block;
|
254 |
+
float:left;
|
255 |
+
margin-right:1%;
|
256 |
+
margin-bottom:0;
|
257 |
+
}
|
258 |
+
.share-buttons li:last-child {
|
259 |
+
margin-right:0;
|
260 |
+
}
|
261 |
+
|
262 |
+
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
/* Welcome Page */
|
267 |
+
.popmake-badge {
|
268 |
+
padding-top: 150px;
|
269 |
+
height: 52px;
|
270 |
+
width: 185px;
|
271 |
+
color: #666;
|
272 |
+
font-weight: bold;
|
273 |
+
font-size: 14px;
|
274 |
+
text-align: center;
|
275 |
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
|
276 |
+
margin: 0 -5px;
|
277 |
+
background: url('../images/welcome/logo.png') no-repeat center center;
|
278 |
+
}
|
279 |
+
.about-wrap .popmake-badge {
|
280 |
+
position: absolute;
|
281 |
+
top: 0;
|
282 |
+
right: 0;
|
283 |
+
}
|
284 |
+
.popmake-welcome-screenshots {
|
285 |
+
float: right;
|
286 |
+
margin-left: 10px!important;
|
287 |
+
padding: 0 7.5em;
|
288 |
+
}
|
289 |
+
.popmake-wrap .feature-section {
|
290 |
+
margin-top: 20px;
|
291 |
+
}
|
292 |
+
.tab-box {
|
293 |
+
margin-top:40px;
|
294 |
+
position:relative;
|
295 |
+
border:1px solid #ccc;
|
296 |
+
max-width:500px;
|
297 |
+
padding:20px 10px 5px;
|
298 |
+
}
|
299 |
+
.tab-box h4 {
|
300 |
+
font:13px/30px "Open Sans",sans-serif;
|
301 |
+
font-weight: bold;
|
302 |
+
position:absolute;
|
303 |
+
background:#ccc;
|
304 |
+
display:inline-block;
|
305 |
+
padding:0 10px;
|
306 |
+
top:-48px;
|
307 |
+
left:-1px;
|
308 |
+
}
|
309 |
+
.tab-box a {
|
310 |
+
font:300 18px/1.125 "Oswald";
|
311 |
+
color:#00b7cd;
|
312 |
+
}
|
313 |
+
.tab-box button {
|
314 |
+
font:300 18px/1.125 "Oswald";
|
315 |
+
color:#fff;
|
316 |
+
background:#00b7cd;
|
317 |
+
box-shadow: none;
|
318 |
+
border:0;
|
319 |
+
padding:5px 10px 7px;
|
320 |
+
cursor:pointer;
|
321 |
+
transition:transform .5s;
|
322 |
+
}
|
323 |
+
.tab-box button:hover {
|
324 |
+
transform:scale(1.125);
|
325 |
+
}
|
326 |
+
|
327 |
+
|
328 |
+
|
329 |
+
|
330 |
+
|
331 |
+
/* Extensions Page */
|
332 |
+
.extensions-available {
|
333 |
+
display:block;
|
334 |
+
}
|
335 |
+
.extensions-available img {
|
336 |
+
width:100%;
|
337 |
+
display:block;
|
338 |
+
height:auto;
|
339 |
+
max-width: 100%;
|
340 |
+
}
|
341 |
+
.extensions-available li {
|
342 |
+
box-sizing: border-box;
|
343 |
+
border: .25%px solid #ccc;
|
344 |
+
padding:10px 8px 6px;
|
345 |
+
background:#fff;
|
346 |
+
vertical-align: top;
|
347 |
+
width: 280px;
|
348 |
+
margin:0 10px 10px;
|
349 |
+
display:inline;
|
350 |
+
float:left;
|
351 |
+
}
|
352 |
+
.extensions-available h3 {
|
353 |
+
font: 16px/1.5 "Montserrat" !important;
|
354 |
+
text-align: center;
|
355 |
+
text-transform: uppercase;
|
356 |
+
}
|
357 |
+
.extensions-available li > .action-links {
|
358 |
+
margin:0 10px;
|
359 |
+
text-align: center;
|
360 |
+
display:block;
|
361 |
+
}
|
362 |
+
.extensions-available .action-links .button {
|
363 |
+
display:inline-block;
|
364 |
+
margin-bottom: 10px;
|
365 |
+
margin-top:8px;
|
366 |
+
background:#9ABA27;
|
367 |
+
color:#fff;
|
368 |
+
border-radius: 0;
|
369 |
+
border:0;
|
370 |
+
box-shadow: none;
|
371 |
+
font-weight: bold;
|
372 |
+
padding:7px 30px;
|
373 |
+
height:auto;
|
374 |
+
text-transform: uppercase;
|
375 |
+
transition:transform .5s;
|
376 |
+
}
|
377 |
+
.extensions-available .action-links .button.install {
|
378 |
+
background:#00a651;
|
379 |
+
}
|
380 |
+
.extensions-available .action-links .button:hover {
|
381 |
+
transform:scale(1.125);
|
382 |
+
}
|
383 |
+
.extensions-available p {
|
384 |
+
margin:10px;
|
385 |
+
color:#717171;
|
386 |
+
font-size:14px;
|
387 |
+
text-align: center;
|
388 |
+
font-style: italic;
|
389 |
+
min-height: 4.5em;
|
390 |
+
}
|
391 |
+
.extensions-available a {
|
392 |
+
display:block;
|
393 |
+
text-align: center;
|
394 |
+
text-decoration: none;
|
395 |
+
}
|
396 |
+
|
397 |
+
@media only screen and (max-width: 360px){
|
398 |
+
.extensions-available li {
|
399 |
+
display:block;
|
400 |
+
margin: 0 0 10px;
|
401 |
+
width:100%;
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
@media only screen and (min-width: 361px) and (max-width: 768px){
|
406 |
+
.extensions-available li {
|
407 |
+
width:320px;
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
@media only screen and (min-width: 769px) and (max-width: 980px) {
|
412 |
+
.extensions-available li {
|
413 |
+
width:240px;
|
414 |
+
}
|
415 |
+
}
|
assets/styles/popup-maker-admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
h3.title{color:#9aba27}#popuptitlediv #popuptitle{background-color:#fff;font-size:1.5em;height:1.8em;line-height:100%;margin:0;outline:medium none;padding:2px 8px;width:100%}#popuptitlediv #popuptitle input{color:#777;font-size:1.7em;padding:11px 10px;position:absolute}#popuptitlediv #popuptitle-prompt-text{font-size:1.4em;padding:8px 10px}#titlediv #title{margin:0 0 1em}.posttypediv,.taxonomydiv{margin-bottom:10px;clear:both;overflow:auto}option.bold{font-weight:700;font-size:1.125em}.popmake-range-manual{padding-right:25px;text-align:right;width:80px}.range-value-unit{position:relative;display:inline-block;margin-left:-30px;margin-right:10px;width:20px;text-align:left}.title-divider th{border-top:1px solid #ccc;padding:0}.form-table td,.form-table tr{padding-top:10px}.title-divider .title{font-size:1.125em;padding-left:0!important;padding-top:20px!important;padding-bottom:0!important}#menu-posts-popup ul.wp-submenu li:nth-child(0n+8) a{color:#9ABA27}.popmake-upgrade-tip{color:#333}.popmake-upgrade-tip hr{margin-bottom:25px}.popmake-upgrade-tip img{float:left;margin-right:15px}.popmake-newsletter-optin{display:none;position:relative;width:100%;margin-bottom:10px}.popmake-newsletter-optin img{max-width:100%;width:100%}.popmake-newsletter-optin .popmake-optin-dismiss{display:inline-block;position:absolute;right:5px;bottom:5px;cursor:pointer;color:#6B8129;font-family:"Open Sans",sans-serif;text-transform:uppercase;font-size:.875em}.popmake-newsletter-optin .popmake-optin-dismiss:hover{color:#9ABA27}#popmake_popup_theme_preview{z-index:100}#popmake_popup_theme_preview .inside{margin-top:0;background:url(http://s.wordpress.com/mshots/v1/http://www.wordpress.org) no-repeat center top}#popmake_popup_theme_preview .empreview{padding-top:25px}.example-popup,.example-popup:before,.example-popup:after{-moz-box-sizing:border-box}.empreview .example-popup-overlay{position:absolute;display:block;width:100%;height:100%;top:0;left:0}.empreview .example-popup{display:block;position:relative;width:95%;max-width:400px;margin:0 auto 25px;font-size:16px;position:relative;z-index:99}.empreview .example-popup .close-popup{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake-support-links{list-style:none}.popmake-support-links li{margin-bottom:10px}.popmake-support-links a{color:#20252b;font-family:"Montserrat";font-size:1.25em;text-transform:uppercase;text-decoration:none}.popmake-support-links a span{margin-left:10px}.popmake-support-links a img{top:6px;position:relative;min-width:24px;max-width:24px;min-height:24px;max-height:24px}.button.rounded{box-shadow:none;border:0;border-radius:2px;background:#9aba27;color:#fff;padding-left:18px;padding-right:18px;transition:transform .5s;margin-bottom:10px}.button.rounded:hover,.button.rounded:focus{color:#fff;background:#20252b;transform:scale(1.125)}#popmake_popup_support{margin-bottom:10px}#popmake_popup_share .handlediv{display:none}#popmake_popup_share .hndle{display:none}#popmake_popup_share .inside{margin:0 0 20px}.loveit-shareit{font-weight:700!important;font-size:28px!important;color:#333;text-transform:uppercase}.loveit-shareit span{color:#9ABA27}.follow-box{text-align:center;padding:14px 36px;background:#fff;border:1px solid #e5e5e5}.share-buttons{margin:0 auto;width:68%;display:block;clear:both}.share-buttons li{text-align:center;width:32%;display:inline-block;float:left;margin-right:1%;margin-bottom:0}.share-buttons li:last-child{margin-right:0}.popmake-badge{padding-top:150px;height:52px;width:185px;color:#666;font-weight:700;font-size:14px;text-align:center;text-shadow:0 1px 0 rgba(255,255,255,.8);margin:0 -5px;background:url(../images/welcome/logo.png) no-repeat center center}.about-wrap .popmake-badge{position:absolute;top:0;right:0}.popmake-welcome-screenshots{float:right;margin-left:10px!important;padding:0 7.5em}.popmake-wrap .feature-section{margin-top:20px}.tab-box{margin-top:40px;position:relative;border:1px solid #ccc;max-width:500px;padding:20px 10px 5px}.tab-box h4{font:13px/30px "Open Sans",sans-serif;font-weight:700;position:absolute;background:#ccc;display:inline-block;padding:0 10px;top:-48px;left:-1px}.tab-box a{font:300 18px/1.125 "Oswald";color:#00b7cd}.tab-box button{font:300 18px/1.125 "Oswald";color:#fff;background:#00b7cd;box-shadow:none;border:0;padding:5px 10px 7px;cursor:pointer;transition:transform .5s}.tab-box button:hover{transform:scale(1.125)}.extensions-available{display:block}.extensions-available img{width:100%;display:block;height:auto;max-width:100%}.extensions-available li{box-sizing:border-box;border:.25%px solid #ccc;padding:10px 8px 6px;background:#fff;vertical-align:top;width:280px;margin:0 10px 10px;display:inline;float:left}.extensions-available h3{font:16px/1.5 "Montserrat" !important;text-align:center;text-transform:uppercase}.extensions-available li>.action-links{margin:0 10px;text-align:center;display:block}.extensions-available .action-links .button{display:inline-block;margin-bottom:10px;margin-top:8px;background:#9ABA27;color:#fff;border-radius:0;border:0;box-shadow:none;font-weight:700;padding:7px 30px;height:auto;text-transform:uppercase;transition:transform .5s}.extensions-available .action-links .button.install{background:#00a651}.extensions-available .action-links .button:hover{transform:scale(1.125)}.extensions-available p{margin:10px;color:#717171;font-size:14px;text-align:center;font-style:italic;min-height:4.5em}.extensions-available a{display:block;text-align:center;text-decoration:none}@media only screen and (max-width:360px){.extensions-available li{display:block;margin:0 0 10px;width:100%}}@media only screen and (min-width:361px) and (max-width:768px){.extensions-available li{width:320px}}@media only screen and (min-width:769px) and (max-width:980px){.extensions-available li{width:240px}}
|
assets/styles/popup-maker-site.css
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.popmake, .popmake:before, .popmake:after {
|
2 |
+
-moz-box-sizing: border-box;
|
3 |
+
}
|
4 |
+
.popmake-overlay {
|
5 |
+
position:fixed;
|
6 |
+
display:none;
|
7 |
+
width:100%;
|
8 |
+
height:100%;
|
9 |
+
top:0;
|
10 |
+
left:0;
|
11 |
+
z-index:998!important;
|
12 |
+
}
|
13 |
+
|
14 |
+
.popmake {
|
15 |
+
top:100px;
|
16 |
+
visibility: hidden;
|
17 |
+
position: absolute;
|
18 |
+
display:none;
|
19 |
+
z-index: 999!important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.popmake > .popmake-close {
|
23 |
+
text-decoration:none;
|
24 |
+
text-align:center;
|
25 |
+
line-height: 1;
|
26 |
+
position: absolute;
|
27 |
+
font-weight: bold;
|
28 |
+
cursor: pointer;
|
29 |
+
min-width: 1em;
|
30 |
+
}
|
31 |
+
|
32 |
+
.popmake.responsive {
|
33 |
+
left: 50%;
|
34 |
+
margin-left: -40%;
|
35 |
+
width: 80%;
|
36 |
+
height: auto;
|
37 |
+
overflow:visible;
|
38 |
+
}
|
39 |
+
|
40 |
+
@media only screen and (min-width: 768px){
|
41 |
+
.popmake.size-nano {
|
42 |
+
margin-left: -5%;
|
43 |
+
width: 10%;
|
44 |
+
}
|
45 |
+
.popmake.size-micro {
|
46 |
+
margin-left: -10%;
|
47 |
+
width: 20%;
|
48 |
+
}
|
49 |
+
.popmake.size-tiny {
|
50 |
+
margin-left: -15%;
|
51 |
+
width: 30%;
|
52 |
+
}
|
53 |
+
.popmake.size-small {
|
54 |
+
margin-left: -20%;
|
55 |
+
width: 40%;
|
56 |
+
}
|
57 |
+
.popmake.size-medium {
|
58 |
+
margin-left: -30%;
|
59 |
+
width: 60%;
|
60 |
+
}
|
61 |
+
.popmake.size-large {
|
62 |
+
margin-left: -35%;
|
63 |
+
width: 70%;
|
64 |
+
}
|
65 |
+
.popmake.size-xlarge {
|
66 |
+
margin-left: -47.5%;
|
67 |
+
width: 95%;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
.popmake.fixed {
|
73 |
+
position:fixed;
|
74 |
+
}
|
75 |
+
.popmake.custom-position {
|
76 |
+
left: auto;
|
77 |
+
top: auto;
|
78 |
+
margin-left: inherit;
|
79 |
+
}
|
80 |
+
|
81 |
+
.popmake.scrollable .popmake-content {
|
82 |
+
overflow: auto;
|
83 |
+
overflow-y: scroll;
|
84 |
+
}
|
85 |
+
|
86 |
+
.popmake .popmake-content :last-child {
|
87 |
+
margin-bottom:0;
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
.popmake iframe.formidable {
|
92 |
+
width:100%;
|
93 |
+
overflow:visible;
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
.powered-by-popmake {
|
98 |
+
bottom: -28px;
|
99 |
+
display: block;
|
100 |
+
left: 0;
|
101 |
+
margin: 0 auto;
|
102 |
+
position: absolute;
|
103 |
+
text-align: center;
|
104 |
+
width: 100%;
|
105 |
+
}
|
106 |
+
.powered-by-popmake > a {
|
107 |
+
display: inline-block;
|
108 |
+
max-width: 205px;
|
109 |
+
}
|
110 |
+
.powered-by-popmake img {
|
111 |
+
max-width: 100%;
|
112 |
+
width: 100%;
|
113 |
+
}
|
114 |
+
.powered-by-popmake.small {
|
115 |
+
bottom: -22px;
|
116 |
+
}
|
117 |
+
.powered-by-popmake.small > a {
|
118 |
+
max-width: 125px;
|
119 |
+
}
|
120 |
+
.powered-by-popmake.large {
|
121 |
+
bottom: -30px;
|
122 |
+
}
|
123 |
+
.powered-by-popmake.large > a {
|
124 |
+
max-width: 285px;
|
125 |
+
}
|
assets/styles/popup-maker-site.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.popmake,.popmake:before,.popmake:after{-moz-box-sizing:border-box}.popmake-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;z-index:998!important}.popmake{top:100px;visibility:hidden;position:absolute;display:none;z-index:999!important}.popmake>.popmake-close{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake.responsive{left:50%;margin-left:-40%;width:80%;height:auto;overflow:visible}@media only screen and (min-width:768px){.popmake.size-nano{margin-left:-5%;width:10%}.popmake.size-micro{margin-left:-10%;width:20%}.popmake.size-tiny{margin-left:-15%;width:30%}.popmake.size-small{margin-left:-20%;width:40%}.popmake.size-medium{margin-left:-30%;width:60%}.popmake.size-large{margin-left:-35%;width:70%}.popmake.size-xlarge{margin-left:-47.5%;width:95%}}.popmake.fixed{position:fixed}.popmake.custom-position{left:auto;top:auto;margin-left:inherit}.popmake.scrollable .popmake-content{overflow:auto;overflow-y:scroll}.popmake .popmake-content:last-child{margin-bottom:0}.popmake iframe.formidable{width:100%;overflow:visible}.powered-by-popmake{bottom:-28px;display:block;left:0;margin:0 auto;position:absolute;text-align:center;width:100%}.powered-by-popmake>a{display:inline-block;max-width:205px}.powered-by-popmake img{max-width:100%;width:100%}.powered-by-popmake.small{bottom:-22px}.powered-by-popmake.small>a{max-width:125px}.powered-by-popmake.large{bottom:-30px}.powered-by-popmake.large>a{max-width:285px}
|
contributors.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
danieliser
|
includes/admin/admin-functions.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Returns $_POST key.
|
5 |
+
*
|
6 |
+
* @since 1.0
|
7 |
+
* @param string $name is the key you are looking for. Can use dot notation for arrays such as my_meta.field1 which will resolve to $_POST['my_meta']['field1'].
|
8 |
+
* @return mixed results of lookup
|
9 |
+
*/
|
10 |
+
function popmake_post( $name, $do_stripslashes = true ) {
|
11 |
+
$value = popmake_resolve($_POST, $name, false);
|
12 |
+
return $do_stripslashes ? stripslashes_deep($value) : $value;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Returns cleaned value.
|
18 |
+
*
|
19 |
+
* @since 1.0
|
20 |
+
* @param int $popup_id ID number of the popup to retrieve a name for
|
21 |
+
* @return mixed cleaned value.
|
22 |
+
*/
|
23 |
+
function popmake_post_clean( $value, $type = 'text' ) {
|
24 |
+
return apply_filters('popmake_post_clean_'.$type, $value);
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Returns the name of a popup.
|
30 |
+
*
|
31 |
+
* @since 1.0
|
32 |
+
* @param int $popup_id ID number of the popup to retrieve a name for
|
33 |
+
* @return mixed string|int Price of the popup
|
34 |
+
*/
|
35 |
+
function popmake_is_all_numeric( $array ) {
|
36 |
+
if(!is_array($array)) return false;
|
37 |
+
foreach($array as $val) if(!is_numeric($val)) return false;
|
38 |
+
return true;
|
39 |
+
}
|
includes/admin/admin-notices.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class PopMake_Admin_Notice {
|
2 |
+
protected static $messages = array();
|
3 |
+
public static function factory()
|
4 |
+
{
|
5 |
+
if ( !session_id() )
|
6 |
+
session_start();
|
7 |
+
add_action('admin_notices',array('PopMake_Admin_Notice','render_notices'));
|
8 |
+
}
|
9 |
+
public static function get_messages($type = NULL)
|
10 |
+
{
|
11 |
+
if(empty($_SESSION[POPMAKE_SLUG.'_notices']))
|
12 |
+
return array();
|
13 |
+
$messages = $_SESSION[POPMAKE_SLUG.'_notices'];
|
14 |
+
return $messages;
|
15 |
+
}
|
16 |
+
public static function render_notices()
|
17 |
+
{
|
18 |
+
foreach(PopMake_Admin_Notice::get_messages() as $key => $message)
|
19 |
+
{
|
20 |
+
?><div class="<?php esc_html_e($message['type']);?>">
|
21 |
+
<p><?php esc_html_e($message['message']);?></p>
|
22 |
+
</div><?php
|
23 |
+
unset($_SESSION[POPMAKE_SLUG.'_notices'][$key]);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
public static function add($message, $type = 'updated')
|
27 |
+
{
|
28 |
+
if ( !session_id() ) session_start();
|
29 |
+
$_SESSION[POPMAKE_SLUG.'_notices'][] = array(
|
30 |
+
'message' => $message,
|
31 |
+
'type' => $type
|
32 |
+
);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
PopMake_Admin_Notice::factory();
|
includes/admin/admin-pages.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Pages
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Admin/Pages
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Creates the admin submenu pages under the Popup Maker menu and assigns their
|
17 |
+
* links to global variables
|
18 |
+
*
|
19 |
+
* @since 1.0
|
20 |
+
* @global $popmake_popup_themes_page
|
21 |
+
* @global $popmake_settings_page
|
22 |
+
* @global $popmake_add_ons_page
|
23 |
+
* @global $popmake_help_page
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
function popmake_admin_submenu_pages() {
|
27 |
+
global $popmake_settings_page, $popmake_add_ons_page, $popmake_help_page, $popmake_about_page, $popmake_changelog_page, $popmake_getting_started_page, $popmake_credits_page;
|
28 |
+
|
29 |
+
$popmake_settings_page = add_submenu_page(
|
30 |
+
'edit.php?post_type=popup',
|
31 |
+
apply_filters( 'popmake_admin_submenu_settings_page_title', __( 'Settings', 'popup-maker' ) ),
|
32 |
+
apply_filters( 'popmake_admin_submenu_settings_menu_title', __( 'Settings', 'popup-maker' ) ),
|
33 |
+
apply_filters( 'popmake_admin_submenu_settings_capability', 'manage_options' ),
|
34 |
+
'settings',
|
35 |
+
apply_filters( 'popmake_admin_submenu_settings_function', 'popmake_settings_page' )
|
36 |
+
);
|
37 |
+
|
38 |
+
$popmake_add_ons_page = add_submenu_page(
|
39 |
+
'edit.php?post_type=popup',
|
40 |
+
apply_filters( 'popmake_admin_submenu_extensions_page_title', __( 'Extensions', 'popup-maker' ) ),
|
41 |
+
apply_filters( 'popmake_admin_submenu_extensions_menu_title', __( 'Extensions', 'popup-maker' ) ),
|
42 |
+
apply_filters( 'popmake_admin_submenu_extensions_capability', 'manage_options' ),
|
43 |
+
'extensions',
|
44 |
+
apply_filters( 'popmake_admin_submenu_extensions_function', 'popmake_extensions_page' )
|
45 |
+
);
|
46 |
+
|
47 |
+
$popmake_help_page = add_submenu_page(
|
48 |
+
'edit.php?post_type=popup',
|
49 |
+
apply_filters( 'popmake_admin_submenu_help_page_title', __( 'Help', 'popup-maker' ) ),
|
50 |
+
apply_filters( 'popmake_admin_submenu_help_menu_title', __( 'Help', 'popup-maker' ) ),
|
51 |
+
apply_filters( 'popmake_admin_submenu_help_capability', 'edit_posts' ),
|
52 |
+
'help',
|
53 |
+
apply_filters( 'popmake_admin_submenu_help_function', 'popmake_help_page' )
|
54 |
+
);
|
55 |
+
|
56 |
+
// About Page
|
57 |
+
$popmake_about_page = add_dashboard_page(
|
58 |
+
__( 'Welcome to Popup Maker', 'popup-maker' ),
|
59 |
+
__( 'Welcome to Popup Maker', 'popup-maker' ),
|
60 |
+
'manage_options',
|
61 |
+
'popmake-about',
|
62 |
+
'popmake_about_page'
|
63 |
+
);
|
64 |
+
|
65 |
+
// Changelog Page
|
66 |
+
$popmake_changelog_page = add_dashboard_page(
|
67 |
+
__( 'Popup Maker Changelog', 'popup-maker' ),
|
68 |
+
__( 'Popup Maker Changelog', 'popup-maker' ),
|
69 |
+
'manage_options',
|
70 |
+
'popmake-changelog',
|
71 |
+
'popmake_changelog_page'
|
72 |
+
);
|
73 |
+
|
74 |
+
// Getting Started Page
|
75 |
+
$popmake_getting_started_page = add_dashboard_page(
|
76 |
+
__( 'Getting started with Popup Maker', 'popup-maker' ),
|
77 |
+
__( 'Getting started with Popup Maker', 'popup-maker' ),
|
78 |
+
'manage_options',
|
79 |
+
'popmake-getting-started',
|
80 |
+
'popmake_getting_started_page'
|
81 |
+
);
|
82 |
+
|
83 |
+
// Credits Page
|
84 |
+
$popmake_credits_page = add_dashboard_page(
|
85 |
+
__( 'The people that build Popup Maker', 'popup-maker' ),
|
86 |
+
__( 'The people that build Popup Maker', 'popup-maker' ),
|
87 |
+
'manage_options',
|
88 |
+
'popmake-credits',
|
89 |
+
'popmake_credits_page'
|
90 |
+
);
|
91 |
+
|
92 |
+
}
|
93 |
+
add_action( 'admin_menu', 'popmake_admin_submenu_pages', 11 );
|
94 |
+
|
95 |
+
|
96 |
+
function popmake_remove_admin_subpages() {
|
97 |
+
remove_submenu_page( 'index.php', 'popmake-about' );
|
98 |
+
remove_submenu_page( 'index.php', 'popmake-changelog' );
|
99 |
+
remove_submenu_page( 'index.php', 'popmake-getting-started' );
|
100 |
+
remove_submenu_page( 'index.php', 'popmake-credits' );
|
101 |
+
}
|
102 |
+
//add_action( 'admin_head', 'popmake_remove_admin_subpages' );
|
103 |
+
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Creates the admin submenu pages for theme editor in the Popup Maker menu and assigns its
|
108 |
+
* link to global variables
|
109 |
+
*
|
110 |
+
* @since 1.0
|
111 |
+
* @global $popmake_popup_themes_page
|
112 |
+
* @return void
|
113 |
+
*/
|
114 |
+
function popmake_admin_submenu_theme_pages() {
|
115 |
+
global $submenu, $popmake_popup_themes_page;
|
116 |
+
|
117 |
+
$popmake_popup_themes_page = admin_url( 'post.php?post='. popmake_get_default_popup_theme() .'&action=edit' );
|
118 |
+
$submenu['edit.php?post_type=popup'][] = array(
|
119 |
+
apply_filters( 'popmake_admin_submenu_themes_page_title', __( 'Theme', 'popup-maker' ) ),
|
120 |
+
apply_filters( 'popmake_admin_submenu_themes_capability', 'edit_themes' ),
|
121 |
+
$popmake_popup_themes_page
|
122 |
+
);
|
123 |
+
}
|
124 |
+
add_action( 'admin_menu', 'popmake_admin_submenu_theme_pages', 10 );
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Determines whether the current admin page is an POPMAKE admin page.
|
128 |
+
*
|
129 |
+
* Only works after the `wp_loaded` hook, & most effective
|
130 |
+
* starting on `admin_menu` hook.
|
131 |
+
*
|
132 |
+
* @since 1.0
|
133 |
+
* @return bool True if POPMAKE admin page.
|
134 |
+
*/
|
135 |
+
function popmake_is_admin_page() {
|
136 |
+
|
137 |
+
if ( ! is_admin() || ! did_action( 'wp_loaded' ) ) {
|
138 |
+
return false;
|
139 |
+
}
|
140 |
+
|
141 |
+
global $pagenow, $typenow, $popmake_popup_themes_page, $popmake_settings_page, $popmake_add_ons_page, $popmake_help_page;
|
142 |
+
|
143 |
+
if ( 'popup' == $typenow || 'popup_theme' == $typenow ) {
|
144 |
+
return true;
|
145 |
+
}
|
146 |
+
|
147 |
+
if ( 'index.php' == $pagenow && isset($_GET['page']) && in_array($_GET['page'], array('popmake-about', 'popmake-changelog', 'popmake-getting-started', 'popmake-credits')) ) {
|
148 |
+
return true;
|
149 |
+
}
|
150 |
+
|
151 |
+
$popmake_admin_pages = apply_filters( 'popmake_admin_pages', array( $popmake_popup_themes_page, $popmake_settings_page, $popmake_add_ons_page, $popmake_help_page ) );
|
152 |
+
|
153 |
+
if ( in_array( $pagenow, $popmake_admin_pages ) ) {
|
154 |
+
return true;
|
155 |
+
} else {
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Determines whether the current admin page is an POPMAKE admin popup page.
|
163 |
+
*
|
164 |
+
*
|
165 |
+
* @since 1.0
|
166 |
+
* @return bool True if POPMAKE admin popup page.
|
167 |
+
*/
|
168 |
+
function popmake_is_admin_popup_page() {
|
169 |
+
|
170 |
+
if ( ! is_admin() || ! popmake_is_admin_page() ) {
|
171 |
+
return false;
|
172 |
+
}
|
173 |
+
|
174 |
+
global $pagenow, $typenow;
|
175 |
+
|
176 |
+
if ( 'popup' == $typenow && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' || $pagenow == 'edit.php' )) {
|
177 |
+
return true;
|
178 |
+
}
|
179 |
+
else {
|
180 |
+
return false;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Determines whether the current admin page is an POPMAKE admin theme page.
|
186 |
+
*
|
187 |
+
*
|
188 |
+
* @since 1.0
|
189 |
+
* @return bool True if POPMAKE admin theme page.
|
190 |
+
*/
|
191 |
+
function popmake_is_admin_popup_theme_page() {
|
192 |
+
|
193 |
+
if ( ! is_admin() || ! popmake_is_admin_page() ) {
|
194 |
+
return false;
|
195 |
+
}
|
196 |
+
|
197 |
+
global $pagenow, $typenow;
|
198 |
+
|
199 |
+
if ( 'popup_theme' == $typenow && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' || $pagenow == 'edit.php' )) {
|
200 |
+
return true;
|
201 |
+
}
|
202 |
+
else {
|
203 |
+
return false;
|
204 |
+
}
|
205 |
+
}
|
includes/admin/admin-setup.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_plugin_action_links($links, $file) {
|
3 |
+
if($file == plugin_basename(POPMAKE)) {
|
4 |
+
$settings_page_url = admin_url('edit.php?post_type=popup&page=settings');
|
5 |
+
$plugin_action_links = apply_filters('popmake_action_links', array(
|
6 |
+
//'settings' => '<a href="'. $settings_page_url .'">'.__( 'Settings', 'popup-maker' ).'</a>',
|
7 |
+
'extensions' => '<a href="https://wppopupmaker.com/extensions?utm_source=em-free&utm_medium=plugins+page&utm_campaign=extensions" target="_blank">'.__('Extensions', 'popup-maker' ).'</a>',
|
8 |
+
));
|
9 |
+
foreach($plugin_action_links as $link) {
|
10 |
+
array_unshift( $links, $link );
|
11 |
+
}
|
12 |
+
}
|
13 |
+
return $links;
|
14 |
+
}
|
15 |
+
add_filter('plugin_action_links', 'popmake_plugin_action_links', 10, 2);
|
16 |
+
|
17 |
+
|
18 |
+
function popmake_admin_header() {
|
19 |
+
if(popmake_is_admin_page()) {
|
20 |
+
do_action('popmake_admin_header');
|
21 |
+
}
|
22 |
+
}
|
23 |
+
add_action('admin_header', 'popmake_admin_header');
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
function popmake_admin_notice() {
|
28 |
+
if(popmake_is_admin_page()) {
|
29 |
+
if(!get_usermeta( get_current_user_id(), '_popmake_dismiss_optin_newsletter_promo_banner' )) {?>
|
30 |
+
<div class="popmake-optin popmake-newsletter-optin">
|
31 |
+
<a href="https://wppopupmaker.com/newsletter-sign-up" target="_blank" class="newsletter-banner">
|
32 |
+
<img src="<?php echo POPMAKE_URL; ?>/assets/images/admin/newsletter-banner.png"/>
|
33 |
+
</a>
|
34 |
+
<a class="popmake-optin-dismiss" data-optin-name="newsletter_promo_banner" data-optin-type="user"><?php _e( 'No Thanks', 'popup-maker' ); ?></a>
|
35 |
+
</div><?php
|
36 |
+
}
|
37 |
+
do_action('popmake_admin_notice');
|
38 |
+
}
|
39 |
+
}
|
40 |
+
add_action( 'admin_notices', 'popmake_admin_notice' );
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
function popmake_admin_footer() {
|
45 |
+
if(popmake_is_admin_page()) {
|
46 |
+
do_action('popmake_admin_footer');
|
47 |
+
}
|
48 |
+
}
|
49 |
+
add_action('admin_print_footer_scripts', 'popmake_admin_footer', 1000);
|
includes/admin/extensions/extensions-page.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Addons Page
|
4 |
+
*
|
5 |
+
* Renders the extensions page contents.
|
6 |
+
*
|
7 |
+
* @access private
|
8 |
+
* @since 1.0
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
function popmake_extensions_page() {?>
|
12 |
+
<div class="wrap">
|
13 |
+
<h2><?php _e( 'Popup Maker Extensions', 'popup-maker' ) ?></h2>
|
14 |
+
<div id="poststuff">
|
15 |
+
<div id="post-body" class="metabox-holder">
|
16 |
+
<div id="post-body-content"><?php
|
17 |
+
$extensions = popmake_available_extensions();?>
|
18 |
+
<ul class="extensions-available">
|
19 |
+
<?php
|
20 |
+
$plugins = get_plugins();
|
21 |
+
$installed_plugins = array();
|
22 |
+
foreach($plugins as $key => $plugin){
|
23 |
+
$is_active = is_plugin_active($key);
|
24 |
+
$installed_plugin = array(
|
25 |
+
'is_active' => $is_active
|
26 |
+
);
|
27 |
+
$installerUrl = add_query_arg(
|
28 |
+
array(
|
29 |
+
'action' => 'activate',
|
30 |
+
'plugin' => $key,
|
31 |
+
'em' => 1
|
32 |
+
),
|
33 |
+
network_admin_url('plugins.php')
|
34 |
+
//admin_url('update.php')
|
35 |
+
);
|
36 |
+
$installed_plugin["activation_url"] = $is_active ? "" : wp_nonce_url($installerUrl, 'activate-plugin_' . $key);
|
37 |
+
|
38 |
+
|
39 |
+
$installerUrl = add_query_arg(
|
40 |
+
array(
|
41 |
+
'action' => 'deactivate',
|
42 |
+
'plugin' => $key,
|
43 |
+
'em' => 1
|
44 |
+
),
|
45 |
+
network_admin_url('plugins.php')
|
46 |
+
//admin_url('update.php')
|
47 |
+
);
|
48 |
+
$installed_plugin["deactivation_url"] = !$is_active ? "" : wp_nonce_url($installerUrl, 'deactivate-plugin_' . $key);
|
49 |
+
$installed_plugins[$key] = $installed_plugin;
|
50 |
+
}
|
51 |
+
$existing_extension_images = apply_filters('popmake_existing_extension_images', array());
|
52 |
+
if(!empty($extensions))
|
53 |
+
{
|
54 |
+
foreach($extensions as $extension) :?>
|
55 |
+
<li class="available-extension-inner">
|
56 |
+
<h3><?php esc_html_e($extension->name)?></h3>
|
57 |
+
<?php $image = in_array($extension->slug, $existing_extension_images) ? POPMAKE_URL .'/assets/images/extensions/' . $extension->slug .'.jpg' : $extension->image;?>
|
58 |
+
<img class="extension-thumbnail" src="<?php esc_attr_e($image)?>">
|
59 |
+
<p><?php esc_html_e($extension->excerpt)?></p>
|
60 |
+
<hr/><?php
|
61 |
+
/*
|
62 |
+
if(!empty($extension->download_link) && !isset($installed_plugins[$extension->slug.'/'.$extension->slug.'.php']))
|
63 |
+
{
|
64 |
+
$installerUrl = add_query_arg(
|
65 |
+
array(
|
66 |
+
'action' => 'install-plugin',
|
67 |
+
'plugin' => $extension->slug,
|
68 |
+
'edd_sample_plugin' => 1
|
69 |
+
),
|
70 |
+
network_admin_url('update.php')
|
71 |
+
//admin_url('update.php')
|
72 |
+
);
|
73 |
+
$installerUrl = wp_nonce_url($installerUrl, 'install-plugin_' . $extension->slug)?>
|
74 |
+
<span class="action-links"><?php
|
75 |
+
printf(
|
76 |
+
'<a class="button install" href="%s">%s</a>',
|
77 |
+
esc_attr($installerUrl),
|
78 |
+
__('Install')
|
79 |
+
);?>
|
80 |
+
</span><?php
|
81 |
+
}
|
82 |
+
elseif(isset($installed_plugins[$extension->slug.'/'.$extension->slug.'.php']['is_active']))
|
83 |
+
{?>
|
84 |
+
<span class="action-links"><?php
|
85 |
+
if(!$installed_plugins[$extension->slug.'/'.$extension->slug.'.php']['is_active'])
|
86 |
+
{
|
87 |
+
printf(
|
88 |
+
'<a class="button install" href="%s">%s</a>',
|
89 |
+
esc_attr($installed_plugins[$extension->slug.'/'.$extension->slug.'.php']["activation_url"]),
|
90 |
+
__('Activate')
|
91 |
+
);
|
92 |
+
|
93 |
+
}
|
94 |
+
else
|
95 |
+
{
|
96 |
+
printf(
|
97 |
+
'<a class="button install" href="%s">%s</a>',
|
98 |
+
esc_attr($installed_plugins[$extension->slug.'/'.$extension->slug.'.php']["deactivation_url"]),
|
99 |
+
__('Deactivate')
|
100 |
+
);
|
101 |
+
}?>
|
102 |
+
</span><?php
|
103 |
+
}
|
104 |
+
else
|
105 |
+
{
|
106 |
+
?><span class="action-links"><a class="button" target="_blank" href="<?php esc_attr_e($extension->homepage);?>"><?php _e('Get It Now');?></a></span><?php
|
107 |
+
}
|
108 |
+
*/
|
109 |
+
?>
|
110 |
+
<span class="action-links">
|
111 |
+
<!--<a class="button" target="_blank" href="<?php esc_attr_e($extension->homepage);?>"><?php _e( 'Get It Now', 'popup-maker' );?></a>-->
|
112 |
+
<span class="button"><?php _e( 'Coming Soon!', 'popup-maker' );?></span>
|
113 |
+
</span>
|
114 |
+
<!--<a href="<?php echo esc_url($extension->homepage);?>#features" target="_blank"><?php _e( 'View all the features.', 'popup-maker' );?></a>-->
|
115 |
+
</li>
|
116 |
+
<?php endforeach;
|
117 |
+
}?>
|
118 |
+
</ul>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
<br class="clear"/>
|
122 |
+
</div>
|
123 |
+
</div><?php
|
124 |
+
}
|
includes/admin/help/help-page.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Help Page
|
4 |
+
*
|
5 |
+
* Renders the extensions page contents.
|
6 |
+
*
|
7 |
+
* @access private
|
8 |
+
* @since 1.0
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
function popmake_help_page() {?>
|
12 |
+
<div class="wrap">
|
13 |
+
<h2><?php esc_html_e( __( 'Popup Maker Help & Documentation', 'popup-maker' ) );?></h2>
|
14 |
+
<h2 id="popmake-tabs" class="nav-tab-wrapper">
|
15 |
+
|
16 |
+
<a href="#general" id="general-tab" class="nav-tab popmake-tab"><?php _e( 'General Usage', 'popup-maker' ); ?></a>
|
17 |
+
|
18 |
+
</h2>
|
19 |
+
<div id="poststuff">
|
20 |
+
<div id="post-body" class="metabox-holder columns-2">
|
21 |
+
<div id="post-body-content">
|
22 |
+
<div class="tabwrapper">
|
23 |
+
|
24 |
+
<div id="general" class="popmake-tab-content">
|
25 |
+
<h4><?php _e( 'Copy the class to the link/button you want to open this popup.', 'popup-maker' );?><span class="desc"><?php _e( 'Will start with popmake- and end with a # of the popup you want to open.', 'popup-maker' );?></span></h4>
|
26 |
+
<div class="tab-box">
|
27 |
+
<h4><?php _e( 'Link Example', 'popup-maker' );?></h4>
|
28 |
+
<a href="#" onclick="return false;" class="popmake-1"><?php _e( 'Open Popup', 'popup-maker' );?></a>
|
29 |
+
<pre><a href="#" class="popmake-1"><?php _e( 'Open Popup', 'popup-maker' );?></a></pre>
|
30 |
+
</div>
|
31 |
+
<div class="tab-box">
|
32 |
+
<h4><?php _e( 'Button Example', 'popup-maker' );?></h4>
|
33 |
+
<button onclick="return false;" class="popmake-1"><?php _e( 'Open Popup', 'popup-maker' );?></button>
|
34 |
+
<pre><button class="popmake-1"><?php _e( 'Open Popup', 'popup-maker' );?></button></pre>
|
35 |
+
</div>
|
36 |
+
<div class="tab-box">
|
37 |
+
<h4><?php _e( 'Image Example', 'popup-maker' );?></h4>
|
38 |
+
<img style="cursor:pointer;" src="<?php echo POPMAKE_URL?>/assets/images/admin/popup-maker-icon.png" onclick="return false;" class="popmake-1" />
|
39 |
+
<pre><img src="popup-maker-icon.png" class="popmake-1" /></pre>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
<div id="postbox-container-1" class="postbox-container">
|
46 |
+
<div class="meta-box-sortables ui-sortable" id="side-sortables">
|
47 |
+
<?php do_action('popmake_admin_sidebar');?>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<br class="clear"/>
|
52 |
+
</div>
|
53 |
+
</div><?php
|
54 |
+
}
|
includes/admin/metabox-share.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Popup Maker Support Metabox
|
5 |
+
*
|
6 |
+
* Extensions (as well as the core plugin) can add items to the popup support
|
7 |
+
* metabox via the `popmake_support_meta_box_fields` action.
|
8 |
+
*
|
9 |
+
* @since 1.0
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
function popmake_render_share_meta_box() {
|
13 |
+
global $post; ?>
|
14 |
+
<div id="popmake_share_fields" class="popmake_meta_table_wrap">
|
15 |
+
<?php do_action( 'popmake_share_meta_box_fields', $post->ID ); ?>
|
16 |
+
</div><?php
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
add_action('popmake_share_meta_box_fields', 'popmake_share_meta_box_links', 10);
|
22 |
+
function popmake_share_meta_box_links( $popup_id ) { ?>
|
23 |
+
<h3 class="loveit-shareit" style="text-align:center">Love It? <span>Share It!</span></h3>
|
24 |
+
<ul class="share-buttons">
|
25 |
+
<li><div class="fb-like" data-href="https://wppopupmaker.com" data-width="100" data-ref="true" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div></li>
|
26 |
+
<li><a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-text="<?php _e( 'Want to destroy your old conversion rates? Create high performing popups now! #WPPopupMaker', 'popup-maker' );?>" data-count="vertical" data-url="https://wppopupmaker.com" data-via="wppopupmaker" data-related="wppopupmaker"><?php _e( 'Tweet', 'popup-maker' ); ?></a></li>
|
27 |
+
<li><div class="g-plusone" data-href="https://wppopupmaker.com" data-size="tall"></div></li>
|
28 |
+
</ul>
|
29 |
+
<br class="clear" />
|
30 |
+
<br class="clear" />
|
31 |
+
<div style="text-align:center">
|
32 |
+
<a class="button rounded" target="_blank" href="http://wordpress.org/support/view/plugin-reviews/popup-maker#postform"><?php _e( 'Rate Popup Maker on WP!', 'popup-maker' ); ?></a>
|
33 |
+
</div><?php
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
add_action('popmake_admin_footer', 'popmake_admin_footer_social_scripts');
|
38 |
+
function popmake_admin_footer_social_scripts() {?>
|
39 |
+
<div id="fb-root"></div>
|
40 |
+
<script>
|
41 |
+
jQuery(document).ready(function(){
|
42 |
+
(function(d, s, id) {
|
43 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
44 |
+
if (d.getElementById(id)) return;
|
45 |
+
js = d.createElement(s); js.id = id;
|
46 |
+
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=191746824208314";
|
47 |
+
fjs.parentNode.insertBefore(js, fjs);
|
48 |
+
}(document, 'script', 'facebook-jssdk'));
|
49 |
+
(function() {
|
50 |
+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
51 |
+
po.src = 'https://apis.google.com/js/plusone.js';
|
52 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
53 |
+
})();
|
54 |
+
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
|
55 |
+
});
|
56 |
+
</script><?php
|
57 |
+
}
|
includes/admin/metabox-support.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Popup Maker Support Metabox
|
5 |
+
*
|
6 |
+
* Extensions (as well as the core plugin) can add items to the popup support
|
7 |
+
* metabox via the `popmake_support_meta_box_fields` action.
|
8 |
+
*
|
9 |
+
* @since 1.0
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
function popmake_render_support_meta_box() {
|
13 |
+
global $post; ?>
|
14 |
+
<div id="popmake_support_fields" class="popmake_meta_table_wrap">
|
15 |
+
<?php do_action( 'popmake_support_meta_box_fields', $post->ID ); ?>
|
16 |
+
</div><?php
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
add_action('popmake_support_meta_box_fields', 'popmake_support_meta_box_links', 10);
|
22 |
+
function popmake_support_meta_box_links( $popup_id ) { ?>
|
23 |
+
<ul class="popmake-support-links">
|
24 |
+
<li>
|
25 |
+
<a href="https://wppopupmaker.com/kb">
|
26 |
+
<img src="<?php echo POPMAKE_URL; ?>/assets/images/admin/knowledge-base.png"/>
|
27 |
+
<span><?php _e( 'Knowledge Base', 'popup-maker' ); ?></span>
|
28 |
+
</a>
|
29 |
+
</li>
|
30 |
+
<li>
|
31 |
+
<a href="https://wppopupmaker.com/support">
|
32 |
+
<img src="<?php echo POPMAKE_URL; ?>/assets/images/admin/member-forums.png"/>
|
33 |
+
<span><?php _e( 'Member Forums', 'popup-maker' ); ?></span>
|
34 |
+
</a>
|
35 |
+
</li>
|
36 |
+
<li>
|
37 |
+
<a href="https://wordpress.org/support/plugin/popup-maker">
|
38 |
+
<img src="<?php echo POPMAKE_URL; ?>/assets/images/admin/wordpress-forums.png"/>
|
39 |
+
<span><?php _e( 'WordPress Forums', 'popup-maker' ); ?></span>
|
40 |
+
</a>
|
41 |
+
</li>
|
42 |
+
</ul>
|
43 |
+
<?php
|
44 |
+
}
|
includes/admin/popups/dashboard-columns.php
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dashboard Columns
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Admin/Popups
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Popups Columns
|
17 |
+
*
|
18 |
+
* Defines the custom columns and their order
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @param array $popup_columns Array of popup columns
|
22 |
+
* @return array $popup_columns Updated array of popup columns for Popups
|
23 |
+
* Post Type List Table
|
24 |
+
*/
|
25 |
+
function popmake_popup_columns( $popup_columns ) {
|
26 |
+
$popup_columns = array(
|
27 |
+
'cb' => '<input type="checkbox"/>',
|
28 |
+
'title' => __( 'Name', 'popup-maker' ),
|
29 |
+
'class' => __( 'CSS Classes', 'popup-maker' ),
|
30 |
+
'popup_title' => __( 'Title', 'popup-maker' ),
|
31 |
+
'popup_category' => __( 'Categories', 'popup-maker' ),
|
32 |
+
'popup_tag' => __( 'Tags', 'popup-maker' ),
|
33 |
+
//'date' => __( 'Date', 'popup-maker' )
|
34 |
+
);
|
35 |
+
return apply_filters( 'popmake_popup_columns', $popup_columns );
|
36 |
+
}
|
37 |
+
add_filter( 'manage_edit-popup_columns', 'popmake_popup_columns' );
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Render Popup Columns
|
41 |
+
*
|
42 |
+
* @since 1.0
|
43 |
+
* @param string $column_name Column name
|
44 |
+
* @param int $post_id Popup (Post) ID
|
45 |
+
* @return void
|
46 |
+
*/
|
47 |
+
function popmake_render_popup_columns( $column_name, $post_id ) {
|
48 |
+
if ( get_post_type( $post_id ) == 'popup' ) {
|
49 |
+
global $popmake_options;
|
50 |
+
|
51 |
+
$post = get_post( $post_id );
|
52 |
+
setup_postdata( $post );
|
53 |
+
|
54 |
+
$post_type_object = get_post_type_object( $post->post_type );
|
55 |
+
$can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
|
56 |
+
|
57 |
+
switch ( $column_name ) {
|
58 |
+
case 'popup_title': echo '<strong>'. popmake_get_the_popup_title( $post_id ) .'</strong>';
|
59 |
+
break;
|
60 |
+
case 'popup_category':
|
61 |
+
echo get_the_term_list( $post_id, 'popup_category', '', ', ', '');
|
62 |
+
break;
|
63 |
+
case 'popup_tag':
|
64 |
+
echo get_the_term_list( $post_id, 'popup_tag', '', ', ', '');
|
65 |
+
break;
|
66 |
+
case 'class':
|
67 |
+
echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . absint( $post_id ) . '</code></pre>';
|
68 |
+
if($post->post_name != $post->ID) {
|
69 |
+
echo '|';
|
70 |
+
echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . $post->post_name . '</code></pre>';
|
71 |
+
}
|
72 |
+
break;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
add_action( 'manage_posts_custom_column', 'popmake_render_popup_columns', 10, 2 );
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Registers the sortable columns in the list table
|
80 |
+
*
|
81 |
+
* @since 1.0
|
82 |
+
* @param array $columns Array of the columns
|
83 |
+
* @return array $columns Array of sortable columns
|
84 |
+
*/
|
85 |
+
function popmake_sortable_popup_columns( $columns ) {
|
86 |
+
$columns['popup_title'] = 'popup_title';
|
87 |
+
return $columns;
|
88 |
+
}
|
89 |
+
add_filter( 'manage_edit-popup_sortable_columns', 'popmake_sortable_popup_columns' );
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Sorts Columns in the Popups List Table
|
93 |
+
*
|
94 |
+
* @since 1.0
|
95 |
+
* @param array $vars Array of all the sort variables
|
96 |
+
* @return array $vars Array of all the sort variables
|
97 |
+
*/
|
98 |
+
function popmake_sort_popups( $vars ) {
|
99 |
+
// Check if we're viewing the "popup" post type
|
100 |
+
if ( isset( $vars['post_type'] ) && 'popup' == $vars['post_type'] ) {
|
101 |
+
// Check if 'orderby' is set to "name"
|
102 |
+
if ( isset( $vars['orderby'] ) && 'popup_title' == $vars['orderby'] ) {
|
103 |
+
$vars = array_merge(
|
104 |
+
$vars,
|
105 |
+
array(
|
106 |
+
'meta_key' => 'popup_title',
|
107 |
+
'orderby' => 'meta_value',
|
108 |
+
)
|
109 |
+
);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
return $vars;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Popup Load
|
118 |
+
*
|
119 |
+
* Sorts the popups.
|
120 |
+
*
|
121 |
+
* @since 1.0
|
122 |
+
* @return void
|
123 |
+
*/
|
124 |
+
function popmake_popup_load() {
|
125 |
+
add_filter( 'request', 'popmake_sort_popups' );
|
126 |
+
}
|
127 |
+
add_action( 'load-edit.php', 'popmake_popup_load', 9999 );
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Add Popup Filters
|
131 |
+
*
|
132 |
+
* Adds taxonomy drop down filters for popups.
|
133 |
+
*
|
134 |
+
* @since 1.0
|
135 |
+
* @return void
|
136 |
+
*/
|
137 |
+
function popmake_add_popup_filters() {
|
138 |
+
global $typenow;
|
139 |
+
|
140 |
+
// Checks if the current post type is 'popup'
|
141 |
+
if ( $typenow == 'popup') {
|
142 |
+
$terms = get_terms( 'popup_category' );
|
143 |
+
if ( count( $terms ) > 0 ) {
|
144 |
+
echo "<select name='popup_category' id='popup_category' class='postform'>";
|
145 |
+
echo "<option value=''>" . __( 'Show all categories', 'popup-maker' ) . "</option>";
|
146 |
+
foreach ( $terms as $term ) {
|
147 |
+
$selected = isset( $_GET['popup_category'] ) && $_GET['popup_category'] == $term->slug ? ' selected="selected"' : '';
|
148 |
+
echo '<option value="' . esc_attr( $term->slug ) . '"' . $selected . '>' . esc_html( $term->name ) .' (' . $term->count .')</option>';
|
149 |
+
}
|
150 |
+
echo "</select>";
|
151 |
+
}
|
152 |
+
|
153 |
+
$terms = get_terms( 'popup_tag' );
|
154 |
+
if ( count( $terms ) > 0) {
|
155 |
+
echo "<select name='popup_tag' id='popup_tag' class='postform'>";
|
156 |
+
echo "<option value=''>" . __( 'Show all tags', 'popup-maker' ) . "</option>";
|
157 |
+
foreach ( $terms as $term ) {
|
158 |
+
$selected = isset( $_GET['popup_tag']) && $_GET['popup_tag'] == $term->slug ? ' selected="selected"' : '';
|
159 |
+
echo '<option value="' . esc_attr( $term->slug ) . '"' . $selected . '>' . esc_html( $term->name ) .' (' . $term->count .')</option>';
|
160 |
+
}
|
161 |
+
echo "</select>";
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
add_action( 'restrict_manage_posts', 'popmake_add_popup_filters', 100 );
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Remove Popup Month Filter
|
170 |
+
*
|
171 |
+
* Removes the drop down filter for popups by date.
|
172 |
+
*
|
173 |
+
* @author Daniel Iser
|
174 |
+
* @since 1.0
|
175 |
+
* @param array $dates The preset array of dates
|
176 |
+
* @global $typenow The post type we are viewing
|
177 |
+
* @return array Empty array disables the dropdown
|
178 |
+
*/
|
179 |
+
function popmake_remove_month_filter( $dates ) {
|
180 |
+
global $typenow;
|
181 |
+
|
182 |
+
if ( $typenow == 'popup' ) {
|
183 |
+
$dates = array();
|
184 |
+
}
|
185 |
+
|
186 |
+
return $dates;
|
187 |
+
}
|
188 |
+
add_filter( 'months_dropdown_results', 'popmake_remove_month_filter', 99 );
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Adds price field to Quick Edit options
|
192 |
+
*
|
193 |
+
* @since 1.0
|
194 |
+
* @param string $column_name Name of the column
|
195 |
+
* @param string $post_type Current Post Type (i.e. popup)
|
196 |
+
* @return void
|
197 |
+
*/
|
198 |
+
function popmake_price_field_quick_edit( $column_name, $post_type ) {
|
199 |
+
if ( $column_name != 'price' || $post_type != 'popup' ) return;
|
200 |
+
?>
|
201 |
+
<fieldset class="inline-edit-col-left">
|
202 |
+
<div id="edd-popup-data" class="inline-edit-col">
|
203 |
+
<h4><?php echo sprintf( __( '%s Configuration', 'popup-maker' ), popmake_get_label_singular() ); ?></h4>
|
204 |
+
<label>
|
205 |
+
<span class="title"><?php _e( 'Price', 'popup-maker' ); ?></span>
|
206 |
+
<span class="input-text-wrap">
|
207 |
+
<input type="text" name="_popmake_regprice" class="text regprice" />
|
208 |
+
</span>
|
209 |
+
</label>
|
210 |
+
<br class="clear" />
|
211 |
+
</div>
|
212 |
+
</fieldset>
|
213 |
+
<?php
|
214 |
+
}
|
215 |
+
add_action( 'quick_edit_custom_box', 'popmake_price_field_quick_edit', 10, 2 );
|
216 |
+
add_action( 'bulk_edit_custom_box', 'popmake_price_field_quick_edit', 10, 2 );
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Updates price when saving post
|
220 |
+
*
|
221 |
+
* @since 1.0
|
222 |
+
* @param int $post_id Popup (Post) ID
|
223 |
+
* @return void
|
224 |
+
*/
|
225 |
+
function popmake_price_save_quick_edit( $post_id ) {
|
226 |
+
if ( ! isset( $_POST['post_type']) || 'popup' !== $_POST['post_type'] ) return;
|
227 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) return $post_id;
|
228 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id;
|
229 |
+
|
230 |
+
if ( isset( $_REQUEST['_popmake_regprice'] ) ) {
|
231 |
+
update_post_meta( $post_id, 'popmake_price', strip_tags( stripslashes( $_REQUEST['_popmake_regprice'] ) ) );
|
232 |
+
}
|
233 |
+
}
|
234 |
+
add_action( 'save_post', 'popmake_price_save_quick_edit' );
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Process bulk edit actions via AJAX
|
238 |
+
*
|
239 |
+
* @since 1.0
|
240 |
+
* @return void
|
241 |
+
*/
|
242 |
+
function popmake_save_bulk_edit() {
|
243 |
+
$post_ids = ( isset( $_POST[ 'post_ids' ] ) && ! empty( $_POST[ 'post_ids' ] ) ) ? $_POST[ 'post_ids' ] : array();
|
244 |
+
|
245 |
+
if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
|
246 |
+
$price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0;
|
247 |
+
foreach ( $post_ids as $post_id ) {
|
248 |
+
if ( ! empty( $price ) ) {
|
249 |
+
update_post_meta( $post_id, 'popmake_price', popmake_sanitize_amount( $price ) );
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
die();
|
255 |
+
}
|
256 |
+
add_action( 'wp_ajax_popmake_save_bulk_edit', 'popmake_save_bulk_edit' );
|
includes/admin/popups/metabox-close-fields.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders popup display fields
|
4 |
+
* @since 1.0
|
5 |
+
* @param $post_id
|
6 |
+
*/
|
7 |
+
|
8 |
+
add_action('popmake_popup_close_meta_box_fields', 'popmake_popup_close_meta_box_field_overlay_click', 10);
|
9 |
+
function popmake_popup_close_meta_box_field_overlay_click( $popup_id ) {
|
10 |
+
?><tr>
|
11 |
+
<th scope="row"><?php _e('Click Overlay to Close', 'popup-maker' );?></th>
|
12 |
+
<td>
|
13 |
+
<input type="checkbox" value="true" name="popup_close_overlay_click" id="popup_close_overlay_click" <?php echo popmake_get_popup_close( $popup_id, 'overlay_click' ) ? 'checked="checked" ' : '';?>/>
|
14 |
+
<label for="popup_close_overlay_click" class="description"><?php _e('Checking this will cause popup to close when user clicks on overlay.', 'popup-maker' );?></label>
|
15 |
+
</td>
|
16 |
+
</tr><?php
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
add_action('popmake_popup_close_meta_box_fields', 'popmake_popup_close_meta_box_field_esc_press', 20);
|
21 |
+
function popmake_popup_close_meta_box_field_esc_press( $popup_id ) {
|
22 |
+
?><tr>
|
23 |
+
<th scope="row"><?php _e('Press ESC to Close', 'popup-maker' );?></th>
|
24 |
+
<td>
|
25 |
+
<input type="checkbox" value="true" name="popup_close_esc_press" id="popup_close_esc_press" <?php echo popmake_get_popup_close( $popup_id, 'esc_press' ) ? 'checked="checked" ' : '';?>/>
|
26 |
+
<label for="popup_close_esc_press" class="description"><?php _e('Checking this will cause popup to close when user presses ESC key.', 'popup-maker' );?></label>
|
27 |
+
</td>
|
28 |
+
</tr><?php
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
add_action('popmake_popup_close_meta_box_fields', 'popmake_popup_close_meta_box_field_f4_press', 30);
|
33 |
+
function popmake_popup_close_meta_box_field_f4_press( $popup_id ) {
|
34 |
+
?><tr>
|
35 |
+
<th scope="row"><?php _e('Press F4 to Close', 'popup-maker' );?></th>
|
36 |
+
<td>
|
37 |
+
<input type="checkbox" value="true" name="popup_close_f4_press" id="popup_close_f4_press" <?php echo popmake_get_popup_close( $popup_id, 'f4_press' ) ? 'checked="checked" ' : '';?>/>
|
38 |
+
<label for="popup_close_f4_press" class="description"><?php _e('Checking this will cause popup to close when user presses F4 key.', 'popup-maker' );?></label>
|
39 |
+
</td>
|
40 |
+
</tr><?php
|
41 |
+
}
|
includes/admin/popups/metabox-display-fields.php
ADDED
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders popup display fields
|
4 |
+
* @since 1.0
|
5 |
+
* @param $post_id
|
6 |
+
*/
|
7 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_popup_display_meta_box_field_size', 10);
|
8 |
+
function popmake_popup_display_meta_box_field_size( $popup_id )
|
9 |
+
{
|
10 |
+
?><tr>
|
11 |
+
<th scope="row">
|
12 |
+
<label for="popup_display_size">
|
13 |
+
<?php _e( 'Size', 'popup-maker' );?>
|
14 |
+
</label>
|
15 |
+
</th>
|
16 |
+
<td>
|
17 |
+
<select name="popup_display_size" id="popup_display_size">
|
18 |
+
<?php foreach(apply_filters('popmake_popup_display_size_options', array()) as $option => $value) : ?>
|
19 |
+
<option
|
20 |
+
value="<?php echo $value;?>"
|
21 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'size') ? ' selected="selected"' : '';?>
|
22 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
23 |
+
><?php echo $option;?></option>
|
24 |
+
<?php endforeach ?>
|
25 |
+
</select>
|
26 |
+
<p class="description"><?php _e( 'Select the size of the popup.', 'popup-maker' ); ?></p>
|
27 |
+
</td>
|
28 |
+
</tr><?php
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_popup_display_meta_box_field_responsive_sizes', 20);
|
33 |
+
function popmake_popup_display_meta_box_field_responsive_sizes( $popup_id ) {
|
34 |
+
?><tr class="responsive-size-only">
|
35 |
+
<th scope="row">
|
36 |
+
<label for="popup_display_responsive_min_width"><?php _e( 'Min Width', 'popup-maker' );?></label>
|
37 |
+
</th>
|
38 |
+
<td>
|
39 |
+
<input type="text" value="<?php esc_html_e(popmake_get_popup_display( $popup_id, 'responsive_min_width' ));?>" size="5" name="popup_display_responsive_min_width" id="popup_display_responsive_min_width"/>
|
40 |
+
<select name="popup_display_responsive_min_width_unit" id="popup_display_responsive_min_width_unit">
|
41 |
+
<?php foreach(apply_filters('popmake_size_unit_options', array()) as $option => $value) : ?>
|
42 |
+
<option
|
43 |
+
value="<?php echo $value;?>"
|
44 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'responsive_min_width_unit' ) ? ' selected="selected"' : '';?>
|
45 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
46 |
+
><?php echo $option;?></option>
|
47 |
+
<?php endforeach ?>
|
48 |
+
</select>
|
49 |
+
<p class="description"><?php _e( 'Set a minimum width for the popup.', 'popup-maker' );?></p>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
<tr class="responsive-size-only">
|
53 |
+
<th scope="row">
|
54 |
+
<label for="popup_display_responsive_max_width"><?php _e( 'Max Width', 'popup-maker' );?></label>
|
55 |
+
</th>
|
56 |
+
<td>
|
57 |
+
<input type="text" value="<?php esc_html_e(popmake_get_popup_display( $popup_id, 'responsive_max_width' ));?>" size="5" name="popup_display_responsive_max_width" id="popup_display_responsive_max_width"/>
|
58 |
+
<select name="popup_display_responsive_max_width_unit" id="popup_display_responsive_max_width_unit">
|
59 |
+
<?php foreach(apply_filters('popmake_size_unit_options', array()) as $option => $value) : ?>
|
60 |
+
<option
|
61 |
+
value="<?php echo $value;?>"
|
62 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'responsive_max_width_unit' ) ? ' selected="selected"' : '';?>
|
63 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
64 |
+
><?php echo $option;?></option>
|
65 |
+
<?php endforeach ?>
|
66 |
+
</select>
|
67 |
+
<p class="description"><?php _e( 'Set a maximum width for the popup.', 'popup-maker' );?></p>
|
68 |
+
</td>
|
69 |
+
</tr><?php
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_popup_display_meta_box_field_custom_sizes', 30);
|
75 |
+
function popmake_popup_display_meta_box_field_custom_sizes( $popup_id ) {
|
76 |
+
?><tr class="custom-size-only">
|
77 |
+
<th scope="row">
|
78 |
+
<label for="popup_display_custom_width"><?php _e( 'Width', 'popup-maker' );?></label>
|
79 |
+
</th>
|
80 |
+
<td>
|
81 |
+
<input type="text" value="<?php esc_html_e(popmake_get_popup_display( $popup_id, 'custom_width' ));?>" size="5" name="popup_display_custom_width" id="popup_display_custom_width"/>
|
82 |
+
<select name="popup_display_custom_width_unit" id="popup_display_custom_width_unit">
|
83 |
+
<?php foreach(apply_filters('popmake_size_unit_options', array()) as $option => $value) : ?>
|
84 |
+
<option
|
85 |
+
value="<?php echo $value;?>"
|
86 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'custom_width_unit' ) ? ' selected="selected"' : '';?>
|
87 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
88 |
+
><?php echo $option;?></option>
|
89 |
+
<?php endforeach ?>
|
90 |
+
</select>
|
91 |
+
<p class="description"><?php _e( 'Set a custom width for the popup.', 'popup-maker' );?></p>
|
92 |
+
</td>
|
93 |
+
</tr>
|
94 |
+
|
95 |
+
|
96 |
+
<tr class="custom-size-only">
|
97 |
+
<th scope="row"><?php _e( 'Auto Adjusted Height', 'popup-maker' );?></th>
|
98 |
+
<td>
|
99 |
+
<input type="checkbox" value="true" name="popup_display_custom_height_auto" id="popup_display_custom_height_auto" <?php echo popmake_get_popup_display( $popup_id, 'custom_height_auto') ? 'checked="checked" ' : '';?>/>
|
100 |
+
<label for="popup_display_custom_height_auto" class="description"><?php _e( 'Checking this option will set height to fit the content.', 'popup-maker' );?></label>
|
101 |
+
</td>
|
102 |
+
</tr>
|
103 |
+
|
104 |
+
|
105 |
+
<tr class="custom-size-only custom-size-height-only">
|
106 |
+
<th scope="row"><?php _e( 'Scrollable Content', 'popup-maker' );?></th>
|
107 |
+
<td>
|
108 |
+
<input type="checkbox" value="true" name="popup_display_scrollable_content" id="popup_display_scrollable_content" <?php echo popmake_get_popup_display( $popup_id, 'scrollable_content') ? 'checked="checked" ' : '';?>/>
|
109 |
+
<label for="popup_display_scrollable_content" class="description"><?php _e( 'Checking this option will add a scroll bar to your content.', 'popup-maker' );?></label>
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
|
113 |
+
|
114 |
+
<tr class="custom-size-only custom-size-height-only"<?php echo popmake_get_popup_display( $popup_id, 'custom_height_auto') ? ' style="display:none"' : '';?>>
|
115 |
+
<th scope="row">
|
116 |
+
<?php _e( 'Height', 'popup-maker' );?>
|
117 |
+
</th>
|
118 |
+
<td>
|
119 |
+
<input type="text" value="<?php esc_html_e(popmake_get_popup_display( $popup_id, 'custom_height'));?>" size="5" name="popup_display_custom_height" id="popup_display_custom_height"/>
|
120 |
+
<select name="popup_display_custom_height_unit" id="popup_display_custom_height_unit">
|
121 |
+
<?php foreach(apply_filters('popmake_size_unit_options', array()) as $option => $value) : ?>
|
122 |
+
<option
|
123 |
+
value="<?php echo $value;?>"
|
124 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'custom_height_unit') ? ' selected="selected"' : '';?>
|
125 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
126 |
+
><?php echo $option;?></option>
|
127 |
+
<?php endforeach ?>
|
128 |
+
</select>
|
129 |
+
<p class="description"><?php _e( 'Set a custom height for the popup.', 'popup-maker' );?></p>
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
<?php
|
133 |
+
}
|
134 |
+
|
135 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_popup_display_meta_box_field_overlay_disabled', 40);
|
136 |
+
function popmake_popup_display_meta_box_field_overlay_disabled( $popup_id )
|
137 |
+
{
|
138 |
+
?><tr class="title-divider">
|
139 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Overlay', 'popup-maker' );?></h3></th>
|
140 |
+
</tr>
|
141 |
+
<tr>
|
142 |
+
<th scope="row"><?php _e( 'Disable Overlay', 'popup-maker' );?></th>
|
143 |
+
<td>
|
144 |
+
<input type="checkbox" value="true" name="popup_display_overlay_disabled" id="popup_display_overlay_disabled" <?php echo popmake_get_popup_display( $popup_id, 'overlay_disabled') ? 'checked="checked" ' : '';?>/>
|
145 |
+
<label for="popup_display_overlay_disabled" class="description"><?php _e( 'Checking this will disable and hide the overlay for this popup.', 'popup-maker' );?></label>
|
146 |
+
</td>
|
147 |
+
</tr><?php
|
148 |
+
}
|
149 |
+
|
150 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_popup_display_meta_box_field_animation', 50);
|
151 |
+
function popmake_popup_display_meta_box_field_animation( $popup_id )
|
152 |
+
{
|
153 |
+
?><tr class="title-divider">
|
154 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Animation', 'popup-maker' );?></h3></th>
|
155 |
+
</tr>
|
156 |
+
<tr>
|
157 |
+
<th scope="row">
|
158 |
+
<label for="popup_display_animation_type">
|
159 |
+
<?php _e( 'Animation Type', 'popup-maker' );?>
|
160 |
+
</label>
|
161 |
+
</th>
|
162 |
+
<td>
|
163 |
+
<select name="popup_display_animation_type" id="popup_display_animation_type">
|
164 |
+
<?php foreach(apply_filters('popmake_popup_display_animation_type_options', array()) as $option => $value) : ?>
|
165 |
+
<option
|
166 |
+
value="<?php echo $value;?>"
|
167 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'animation_type') ? ' selected="selected"' : '';?>
|
168 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
169 |
+
><?php echo $option;?></option>
|
170 |
+
<?php endforeach ?>
|
171 |
+
</select>
|
172 |
+
<p class="description"><?php _e( 'Select an animation type for your popup.', 'popup-maker' ); ?></p>
|
173 |
+
</td>
|
174 |
+
</tr>
|
175 |
+
<tr class="animation-speed">
|
176 |
+
<th scope="row">
|
177 |
+
<label for="popup_display_animation_speed">
|
178 |
+
<?php _e( 'Animation Speed', 'popup-maker' );?>
|
179 |
+
</label>
|
180 |
+
</th>
|
181 |
+
<td>
|
182 |
+
<input type="text" readonly
|
183 |
+
value="<?php esc_attr_e(popmake_get_popup_display( $popup_id, 'animation_speed')); ?>"
|
184 |
+
name="popup_display_animation_speed"
|
185 |
+
id="popup_display_animation_speed"
|
186 |
+
class="popmake-range-manual"
|
187 |
+
step="10"
|
188 |
+
min="<?php esc_html_e(apply_filters('popmake_admin_popup_min_animation_speed', 50));?>"
|
189 |
+
max="<?php esc_html_e(apply_filters('popmake_admin_popup_max_animation_speed', 1000));?>"
|
190 |
+
/>
|
191 |
+
<span class="range-value-unit regular-text">ms</span>
|
192 |
+
<p class="description"><?php _e( 'Set the animation speed for the popup.', 'popup-maker' ); ?></p>
|
193 |
+
</td>
|
194 |
+
</tr>
|
195 |
+
<tr class="animation-origin">
|
196 |
+
<th scope="row">
|
197 |
+
<label for="popup_display_animation_origin">
|
198 |
+
<?php _e( 'Animation Origin', 'popup-maker' );?>
|
199 |
+
</label>
|
200 |
+
</th>
|
201 |
+
<td>
|
202 |
+
<select name="popup_display_animation_origin" id="popup_display_animation_origin">
|
203 |
+
<?php foreach(apply_filters('popmake_popup_display_animation_origin_options', array()) as $option => $value) : ?>
|
204 |
+
<option
|
205 |
+
value="<?php echo $value;?>"
|
206 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'animation_origin') ? ' selected="selected"' : '';?>
|
207 |
+
><?php echo $option;?></option>
|
208 |
+
<?php endforeach ?>
|
209 |
+
</select>
|
210 |
+
<p class="description"><?php _e( 'Choose where the animation will begin.', 'popup-maker' ); ?></p>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
<?php
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
+
add_action('popmake_popup_display_meta_box_fields', 'popmake_admin_popup_form_display_tab_settings_position', 60);
|
218 |
+
function popmake_admin_popup_form_display_tab_settings_position( $popup_id )
|
219 |
+
{
|
220 |
+
?><tr class="title-divider">
|
221 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Position', 'popup-maker' );?></h3></th>
|
222 |
+
</tr>
|
223 |
+
<tr>
|
224 |
+
<th scope="row">
|
225 |
+
<label for="popup_display_location"><?php _e( 'Location', 'popup-maker' );?></label>
|
226 |
+
</th>
|
227 |
+
<td>
|
228 |
+
<select name="popup_display_location" id="popup_display_location">
|
229 |
+
<?php foreach(apply_filters('popmake_popup_display_location_options', array()) as $option => $value) : ?>
|
230 |
+
<option
|
231 |
+
value="<?php echo $value;?>"
|
232 |
+
<?php echo $value == popmake_get_popup_display( $popup_id, 'location' ) ? ' selected="selected"' : '';?>
|
233 |
+
><?php echo $option;?></option>
|
234 |
+
<?php endforeach ?>
|
235 |
+
</select>
|
236 |
+
<p class="description"><?php _e( 'Choose which corner the close button will be positioned.', 'popup-maker' ); ?></p>
|
237 |
+
</td>
|
238 |
+
</tr>
|
239 |
+
<tr>
|
240 |
+
<th scope="row"><?php _e( 'Fixed Postioning', 'popup-maker' );?></th>
|
241 |
+
<td>
|
242 |
+
<input type="checkbox" value="true" name="popup_display_position_fixed" id="popup_display_position_fixed" <?php echo popmake_get_popup_display( $popup_id, 'position_fixed') ? 'checked="checked" ' : '';?>/>
|
243 |
+
<label for="popup_display_position_fixed" class="description"><?php _e( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' );?></label>
|
244 |
+
</td>
|
245 |
+
</tr>
|
246 |
+
<tr class="top">
|
247 |
+
<th scope="row">
|
248 |
+
<label for="popup_display_position_top"><?php _e( 'Top', 'popup-maker' );?></label>
|
249 |
+
</th>
|
250 |
+
<td>
|
251 |
+
<input type="text" readonly
|
252 |
+
value="<?php esc_attr_e(popmake_get_popup_display( $popup_id, 'position_top')); ?>"
|
253 |
+
name="popup_display_position_top"
|
254 |
+
id="popup_display_position_top"
|
255 |
+
class="popmake-range-manual"
|
256 |
+
min="0"
|
257 |
+
max="500"
|
258 |
+
step="1"
|
259 |
+
/>
|
260 |
+
<span class="range-value-unit regular-text">px</span>
|
261 |
+
<p class="description"><?php _e( 'Distance from the top edge of the screen.', 'popup-maker' ); ?></p>
|
262 |
+
</td>
|
263 |
+
</tr>
|
264 |
+
<tr class="bottom">
|
265 |
+
<th scope="row">
|
266 |
+
<label for="popup_display_position_bottom"><?php _e( 'Bottom', 'popup-maker' );?></label>
|
267 |
+
</th>
|
268 |
+
<td>
|
269 |
+
<input type="text" readonly
|
270 |
+
value="<?php esc_attr_e(popmake_get_popup_display( $popup_id, 'position_bottom')); ?>"
|
271 |
+
name="popup_display_position_bottom"
|
272 |
+
id="popup_display_position_bottom"
|
273 |
+
class="popmake-range-manual"
|
274 |
+
min="0"
|
275 |
+
max="500"
|
276 |
+
step="1"
|
277 |
+
/>
|
278 |
+
<span class="range-value-unit regular-text">px</span>
|
279 |
+
<p class="description"><?php _e( 'Distance from the bottom edge of the screen.', 'popup-maker' ); ?></p>
|
280 |
+
</td>
|
281 |
+
</tr>
|
282 |
+
<tr class="left">
|
283 |
+
<th scope="row">
|
284 |
+
<label for="popup_display_position_left"><?php _e( 'Left', 'popup-maker' );?></label>
|
285 |
+
</th>
|
286 |
+
<td>
|
287 |
+
<input type="text" readonly
|
288 |
+
value="<?php esc_attr_e(popmake_get_popup_display( $popup_id, 'position_left')); ?>"
|
289 |
+
name="popup_display_position_left"
|
290 |
+
id="popup_display_position_left"
|
291 |
+
class="popmake-range-manual"
|
292 |
+
min="0"
|
293 |
+
max="500"
|
294 |
+
step="1"
|
295 |
+
/>
|
296 |
+
<span class="range-value-unit regular-text">px</span>
|
297 |
+
<p class="description"><?php _e( 'Distance from the left edge of the screen.', 'popup-maker' ); ?></p>
|
298 |
+
</td>
|
299 |
+
</tr>
|
300 |
+
<tr class="right">
|
301 |
+
<th scope="row">
|
302 |
+
<label for="popup_display_position_right"><?php _e( 'Right', 'popup-maker' );?></label>
|
303 |
+
</th>
|
304 |
+
<td>
|
305 |
+
<input type="text" readonly
|
306 |
+
value="<?php esc_attr_e(popmake_get_popup_display( $popup_id, 'position_right')); ?>"
|
307 |
+
name="popup_display_position_right"
|
308 |
+
id="popup_display_position_right"
|
309 |
+
class="popmake-range-manual"
|
310 |
+
min="0"
|
311 |
+
max="500"
|
312 |
+
step="1"
|
313 |
+
/>
|
314 |
+
<span class="range-value-unit regular-text">px</span>
|
315 |
+
<p class="description"><?php _e( 'Distance from the right edge of the screen.', 'popup-maker' ); ?></p>
|
316 |
+
</td>
|
317 |
+
</tr><?php
|
318 |
+
}
|
includes/admin/popups/metabox-loading-fields.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Renders popup load settings fields
|
4 |
+
* @since 1.0
|
5 |
+
* @param $post_id
|
6 |
+
*/
|
7 |
+
|
8 |
+
if(!function_exists('get_term_name')) {
|
9 |
+
function get_term_name( $term_id , $taxonomy ) {
|
10 |
+
$term = get_term_by( 'id', absint( $term_id ), $taxonomy );
|
11 |
+
return $term->name;
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
add_action('popmake_popup_targeting_condition_meta_box_fields', 'popmake_popup_targeting_condition_meta_box_fields', 10);
|
17 |
+
function popmake_popup_targeting_condition_meta_box_fields( $popup_id ) {
|
18 |
+
$targeting_condition = popmake_get_popup_targeting_condition( $popup_id );
|
19 |
+
/**
|
20 |
+
* Create nonce used for post type and taxonomy ajax searches. Copied from wp-admin/includes/nav-menu.php
|
21 |
+
*/
|
22 |
+
wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Render Load on entire site toggle.
|
26 |
+
*/?>
|
27 |
+
<div id="targeting_condition-on_entire_site" class="targeting_condition form-table">
|
28 |
+
<input type="checkbox"
|
29 |
+
id="popup_targeting_condition_on_entire_site"
|
30 |
+
name="popup_targeting_condition_on_entire_site"
|
31 |
+
value="true"
|
32 |
+
<?php if(!empty($targeting_condition['on_entire_site'])) echo 'checked="checked" '; ?>
|
33 |
+
/>
|
34 |
+
<label for="popup_targeting_condition_on_entire_site"><?php _e( 'On Entire Site', 'popup-maker' ); ?></label>
|
35 |
+
<div class="options">
|
36 |
+
<?php do_action("popmake_popup_targeting_condition_on_entire_site_options", $targeting_condition); ?>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
<div id="targeting_condition-on_home" class="targeting_condition form-table">
|
40 |
+
<input type="checkbox"
|
41 |
+
id="popup_targeting_condition_on_home"
|
42 |
+
name="popup_targeting_condition_on_home"
|
43 |
+
value="true"
|
44 |
+
<?php if(!empty($targeting_condition['on_home'])) echo 'checked="checked" '; ?>
|
45 |
+
/>
|
46 |
+
<label for="popup_targeting_condition_on_home"><?php _e( 'On Home Page', 'popup-maker' ); ?></label>
|
47 |
+
<div class="options">
|
48 |
+
<?php do_action("popmake_popup_targeting_condition_on_home_options", $targeting_condition); ?>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<div id="targeting_condition-exclude_on_home" class="targeting_condition form-table">
|
52 |
+
<input type="checkbox"
|
53 |
+
id="popup_targeting_condition_exclude_on_home"
|
54 |
+
name="popup_targeting_condition_exclude_on_home"
|
55 |
+
value="true"
|
56 |
+
<?php if(!empty($targeting_condition['exclude_on_home'])) echo 'checked="checked" '; ?>
|
57 |
+
/>
|
58 |
+
<label for="popup_targeting_condition_exclude_on_home"><?php _e( 'Exclude on Home Page', 'popup-maker' ); ?></label>
|
59 |
+
<div class="options">
|
60 |
+
<?php do_action("popmake_popup_targeting_condition_exclude_on_home_options", $targeting_condition); ?>
|
61 |
+
</div>
|
62 |
+
</div><?php
|
63 |
+
|
64 |
+
$includes = popmake_get_popup_targeting_condition_includes( $popup_id );
|
65 |
+
$excludes = popmake_get_popup_targeting_condition_excludes( $popup_id );
|
66 |
+
|
67 |
+
foreach( popmake_get_supported_types() as $pt ) {
|
68 |
+
$is_post_type = get_post_type_object( $pt );
|
69 |
+
$labels = $is_post_type ? $is_post_type : get_taxonomy( $pt );
|
70 |
+
$plural = esc_attr( strtolower( $labels->labels->name ) );
|
71 |
+
|
72 |
+
foreach(array('include', 'exclude') as $include_exclude) {
|
73 |
+
$key = ($include_exclude != 'include' ? 'exclude_' : '') . "on_{$pt}s";
|
74 |
+
$current = $include_exclude == 'include' ?
|
75 |
+
(!empty($includes[$pt]) ? $includes[$pt] : array()) :
|
76 |
+
(!empty($excludes[$pt]) ? $excludes[$pt] : array()); ?>
|
77 |
+
<div id="targeting_condition-<?php echo $key; ?>" class="targeting_condition form-table">
|
78 |
+
<input type="checkbox"
|
79 |
+
id="popup_targeting_condition_<?php echo $key; ?>"
|
80 |
+
name="popup_targeting_condition_<?php echo $key; ?>"
|
81 |
+
value="true"
|
82 |
+
<?php if(!empty($targeting_condition[$key])) echo 'checked="checked" '; ?>
|
83 |
+
/><?php
|
84 |
+
$label = ($include_exclude != 'include' ? 'Exclude ' : '') . 'On ';?>
|
85 |
+
<label for="popup_targeting_condition_<?php echo $key; ?>"><?php echo __( $label, 'popup-maker' ) . $labels->labels->name; ?></label>
|
86 |
+
<div class="options">
|
87 |
+
<p style="margin:0;"><?php
|
88 |
+
$key = ($include_exclude != 'include' ? 'exclude_' : '') . "on_specific_{$pt}s";?>
|
89 |
+
<input type="checkbox" style="display:none" name="popup_targeting_condition_<?php echo $key; ?>" value="true" <?php if(isset($targeting_condition[$key])) echo 'checked'; ?>/>
|
90 |
+
<label><?php
|
91 |
+
$label = ($include_exclude == 'include' ? 'Load' : 'Exclude') . ' on All ';
|
92 |
+
echo __( $label, 'popup-maker' ) . $labels->labels->name; ?>
|
93 |
+
<input type="radio"
|
94 |
+
name="radio_checkbox_<?php echo $key; ?>"
|
95 |
+
value=""
|
96 |
+
<?php if(!isset($targeting_condition[$key])) echo 'checked'; ?>
|
97 |
+
/>
|
98 |
+
</label><br/>
|
99 |
+
<label><?php
|
100 |
+
$label = ($include_exclude == 'include' ? 'Load' : 'Exclude') . ' on Specific ';
|
101 |
+
echo __( $label, 'popup-maker' ) . $labels->labels->name; ?>
|
102 |
+
<input type="radio"
|
103 |
+
name="radio_checkbox_<?php echo $key; ?>"
|
104 |
+
value="true"
|
105 |
+
<?php if(isset($targeting_condition[$key])) echo 'checked'; ?>
|
106 |
+
/>
|
107 |
+
</label>
|
108 |
+
</p>
|
109 |
+
<div id="<?php echo $key; ?>">
|
110 |
+
<div class="nojs-tags hide-if-js">
|
111 |
+
<textarea
|
112 |
+
name="popup_targeting_condition_<?php echo $include_exclude == 'exclude' ? 'exclude_' : '';?>on_<?php echo $pt; ?>"
|
113 |
+
rows="3" cols="20"
|
114 |
+
id="popup_targeting_condition_<?php echo $include_exclude == 'exclude' ? 'exclude_' : '';?>on_<?php echo $pt; ?>"
|
115 |
+
><?php esc_html_e( trim( implode(',', $current) ) );?></textarea>
|
116 |
+
</div>
|
117 |
+
<div class="hide-if-no-js"><?php
|
118 |
+
if($is_post_type) popmake_post_type_item_metabox( $pt );
|
119 |
+
else popmake_taxonomy_item_metabox( $pt );?>
|
120 |
+
<div class="tagchecklist"><?php
|
121 |
+
foreach($current as $post_id) { ?>
|
122 |
+
<span><a class="ntdelbutton" data-id="<?php echo $post_id;?>">X</a>
|
123 |
+
<?php echo $is_post_type ? get_the_title( $post_id ) : get_term_name( $post_id, $pt );?>
|
124 |
+
</span><?php
|
125 |
+
}?>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
<hr/>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
</div><?php
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
includes/admin/popups/metabox.php
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Metabox Functions
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Admin/Popups
|
7 |
+
* @copyright Copyright (c) 2014, Wizard Internet Solutions
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/** All Popups *****************************************************************/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Register all the meta boxes for the Popup custom post type
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function popmake_add_popup_meta_box() {
|
24 |
+
/** Display Meta **/
|
25 |
+
add_meta_box( 'popmake_popup_display', __( 'Display Settings', 'popup-maker' ), 'popmake_render_popup_display_meta_box', 'popup', 'normal', 'high' );
|
26 |
+
/** Close Meta **/
|
27 |
+
add_meta_box( 'popmake_popup_close', __( 'Close Settings', 'popup-maker' ), 'popmake_render_popup_close_meta_box', 'popup', 'normal', 'high' );
|
28 |
+
/** Loading Meta **/
|
29 |
+
add_meta_box( 'popmake_popup_targeting_condition', __( 'Targeting Conditions', 'popup-maker' ), 'popmake_render_popup_targeting_condition_meta_box', 'popup', 'side', 'high' );
|
30 |
+
|
31 |
+
/** Support Meta **/
|
32 |
+
add_meta_box( 'popmake_popup_support', __( 'Support', 'popup-maker' ), 'popmake_render_support_meta_box', 'popup', 'side', 'default' );
|
33 |
+
/** Share Meta **/
|
34 |
+
add_meta_box( 'popmake_popup_share', __( 'Share', 'popup-maker' ), 'popmake_render_share_meta_box', 'popup', 'side', 'default' );
|
35 |
+
}
|
36 |
+
add_action( 'add_meta_boxes', 'popmake_add_popup_meta_box' );
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
function popmake_popup_meta_fields() {
|
43 |
+
$fields = array(
|
44 |
+
'popup_defaults_set',
|
45 |
+
'popup_title',
|
46 |
+
'popup_targeting_condition_on_entire_site',
|
47 |
+
'popup_targeting_condition_on_home',
|
48 |
+
'popup_targeting_condition_exclude_on_home',
|
49 |
+
);
|
50 |
+
foreach(popmake_popup_meta_field_groups() as $group) {
|
51 |
+
foreach(apply_filters( 'popmake_popup_meta_field_group_' . $group, $fields ) as $field) {
|
52 |
+
$fields[] = 'popup_' . $group . '_' . $field;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
foreach(popmake_get_supported_types() as $pt) {
|
56 |
+
var_dump($pt);
|
57 |
+
$labels = get_post_type_object( $pt ) ? get_post_type_object( $pt ) : get_taxonomy( $pt );
|
58 |
+
$plural = $pt . 's';
|
59 |
+
$fields[] = "popup_targeting_condition_on_{$plural}";
|
60 |
+
$fields[] = "popup_targeting_condition_exclude_on_{$plural}";
|
61 |
+
$fields[] = "popup_targeting_condition_on_specific_{$plural}";
|
62 |
+
$fields[] = "popup_targeting_condition_exclude_on_specific_{$plural}";
|
63 |
+
}
|
64 |
+
return apply_filters( 'popmake_popup_meta_fields', $fields );
|
65 |
+
}
|
66 |
+
|
67 |
+
function popmake_popup_meta_field_groups() {
|
68 |
+
$groups = array(
|
69 |
+
'display',
|
70 |
+
'close'
|
71 |
+
);
|
72 |
+
return apply_filters( 'popmake_popup_meta_field_groups', $groups );
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
function popmake_popup_meta_field_group_display() {
|
77 |
+
return array(
|
78 |
+
'scrollable_content',
|
79 |
+
'overlay_disabled',
|
80 |
+
'size',
|
81 |
+
'responsive_min_width',
|
82 |
+
'responsive_min_width_unit',
|
83 |
+
'responsive_max_width',
|
84 |
+
'responsive_max_width_unit',
|
85 |
+
'custom_width',
|
86 |
+
'custom_width_unit',
|
87 |
+
'custom_height',
|
88 |
+
'custom_height_unit',
|
89 |
+
'custom_height_auto',
|
90 |
+
'location',
|
91 |
+
'position_top',
|
92 |
+
'position_left',
|
93 |
+
'position_bottom',
|
94 |
+
'position_right',
|
95 |
+
'position_fixed',
|
96 |
+
'animation_type',
|
97 |
+
'animation_speed',
|
98 |
+
'animation_origin',
|
99 |
+
);
|
100 |
+
}
|
101 |
+
add_filter('popmake_popup_meta_field_group_display', 'popmake_popup_meta_field_group_display', 0);
|
102 |
+
|
103 |
+
|
104 |
+
function popmake_popup_meta_field_group_close() {
|
105 |
+
return array(
|
106 |
+
'overlay_click',
|
107 |
+
'esc_press',
|
108 |
+
'f4_press',
|
109 |
+
);
|
110 |
+
}
|
111 |
+
add_filter('popmake_popup_meta_field_group_close', 'popmake_popup_meta_field_group_close', 0);
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Save post meta when the save_post action is called
|
117 |
+
*
|
118 |
+
* @since 1.0
|
119 |
+
* @param int $post_id Popup (Post) ID
|
120 |
+
* @global array $post All the data of the the current post
|
121 |
+
* @return void
|
122 |
+
*/
|
123 |
+
function popmake_popup_meta_box_save( $post_id, $post ) {
|
124 |
+
|
125 |
+
if ( isset( $post->post_type ) && 'popup' != $post->post_type ) {
|
126 |
+
return;
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( ! isset( $_POST['popmake_popup_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['popmake_popup_meta_box_nonce'], basename( __FILE__ ) ) ) {
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
|
133 |
+
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX') && DOING_AJAX ) || isset( $_REQUEST['bulk_edit'] ) ) {
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
|
137 |
+
if ( isset( $post->post_type ) && 'revision' == $post->post_type ) {
|
138 |
+
return;
|
139 |
+
}
|
140 |
+
|
141 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
foreach ( popmake_popup_meta_fields() as $field ) {
|
145 |
+
if ( isset( $_POST[ $field ] ) ) {
|
146 |
+
$new = apply_filters( 'popmake_metabox_save_' . $field, $_POST[ $field ] );
|
147 |
+
update_post_meta( $post_id, $field, $new );
|
148 |
+
} else {
|
149 |
+
delete_post_meta( $post_id, $field );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
$includes = popmake_get_popup_targeting_condition_includes( $post_id );
|
154 |
+
$excludes = popmake_get_popup_targeting_condition_excludes( $post_id );
|
155 |
+
|
156 |
+
foreach(popmake_get_supported_types() as $pt) {
|
157 |
+
|
158 |
+
foreach(array('include', 'exclude') as $type) {
|
159 |
+
$prefix = "popup_targeting_condition_" . ($type == 'exclude' ? 'exclude_' : '') . "on_{$pt}";
|
160 |
+
$current = $type == 'include' ? (!empty($includes[$pt]) ? $includes[$pt] : array() ) : (!empty($excludes[$pt]) ? $excludes[$pt] : array() );
|
161 |
+
$type_field = $prefix;
|
162 |
+
$type_prefix = $prefix .'_';
|
163 |
+
|
164 |
+
$temp_ids = array();
|
165 |
+
if( !empty($_POST[$type_field]) ) {
|
166 |
+
foreach(explode(',', trim($_POST[$type_field])) as $id) {
|
167 |
+
if(is_int( intval( $id ) ) ) {
|
168 |
+
$temp_ids[] = intval( $id );
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
/**
|
173 |
+
* Remove existing meta that no longer exist in $_POST field.
|
174 |
+
*/
|
175 |
+
if(!empty($current)) {
|
176 |
+
foreach($current as $id) {
|
177 |
+
if(!in_array($id, $temp_ids)) {
|
178 |
+
delete_post_meta( $post_id, $type_prefix.$id );
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
/**
|
183 |
+
* Adds post meta for non existing post type ids in $_POST.
|
184 |
+
*/
|
185 |
+
foreach($temp_ids as $id) {
|
186 |
+
if(!in_array($id, $current) && $id > 0) {
|
187 |
+
update_post_meta( $post_id, $type_prefix.$id, true );
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
192 |
+
do_action( 'popmake_save_popup', $post_id, $post );
|
193 |
+
}
|
194 |
+
add_action( 'save_post', 'popmake_popup_meta_box_save', 10, 2 );
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
function popmake_set_popup_slug( $data , $postarr ) {
|
199 |
+
if($data['post_type'] == 'popup') {
|
200 |
+
$popup_name = popmake_post('popup_name');
|
201 |
+
$post_slug = sanitize_title_with_dashes( $popup_name, NULL, 'save' );
|
202 |
+
$data['post_name'] = wp_unique_post_slug( sanitize_title( popmake_post('popup_name') ), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent'] );
|
203 |
+
}
|
204 |
+
return $data;
|
205 |
+
}
|
206 |
+
add_filter( 'wp_insert_post_data' , 'popmake_set_popup_slug' , 99, 2 );
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
/** Popup Configuration *****************************************************************/
|
211 |
+
|
212 |
+
function popmake_popup_title_meta() {
|
213 |
+
global $post;
|
214 |
+
if(popmake_is_admin_popup_page()) { ?>
|
215 |
+
<div id="popuptitlediv">
|
216 |
+
<div id="popuptitlewrap">
|
217 |
+
<label class="screen-reader-text" id="popuptitle-prompt-text" for="popuptitle"><?php _e( 'Enter popup title here', 'popup-maker' ); ?></label>
|
218 |
+
<input type="text" tabindex="2" name="popup_title" size="30" value="<?php esc_attr_e( popmake_get_the_popup_title( $post->ID ) );?>" id="popuptitle" autocomplete="off" placeholder="<?php _e( 'Enter popup title here', 'popup-maker' ); ?>"/>
|
219 |
+
</div>
|
220 |
+
<div class="inside">
|
221 |
+
</div>
|
222 |
+
</div><?php
|
223 |
+
}
|
224 |
+
}
|
225 |
+
add_action( 'edit_form_advanced', 'popmake_popup_title_meta' );
|
226 |
+
add_action( 'edit_page_form', 'popmake_popup_title_meta' );
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Popup Display Metabox
|
231 |
+
*
|
232 |
+
* Extensions (as well as the core plugin) can add items to the popup display
|
233 |
+
* configuration metabox via the `popmake_popup_display_meta_box_fields` action.
|
234 |
+
*
|
235 |
+
* @since 1.0
|
236 |
+
* @return void
|
237 |
+
*/
|
238 |
+
function popmake_render_popup_display_meta_box() {
|
239 |
+
global $post, $popmake_options;
|
240 |
+
wp_nonce_field( basename( __FILE__ ), 'popmake_popup_meta_box_nonce' ); ?>
|
241 |
+
<input type="hidden" name="popup_defaults_set" value="true" />
|
242 |
+
<div id="popmake_popup_display_fields" class="popmake_meta_table_wrap">
|
243 |
+
<table class="form-table">
|
244 |
+
<tbody>
|
245 |
+
<?php do_action( 'popmake_popup_display_meta_box_fields', $post->ID );?>
|
246 |
+
</tbody>
|
247 |
+
</table>
|
248 |
+
</div><?php
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Popup Close Metabox
|
255 |
+
*
|
256 |
+
* Extensions (as well as the core plugin) can add items to the popup close
|
257 |
+
* configuration metabox via the `popmake_popup_close_meta_box_fields` action.
|
258 |
+
*
|
259 |
+
* @since 1.0
|
260 |
+
* @return void
|
261 |
+
*/
|
262 |
+
function popmake_render_popup_close_meta_box() {
|
263 |
+
global $post, $popmake_options;?>
|
264 |
+
<div id="popmake_popup_close_fields" class="popmake_meta_table_wrap">
|
265 |
+
<table class="form-table">
|
266 |
+
<tbody>
|
267 |
+
<?php do_action( 'popmake_popup_close_meta_box_fields', $post->ID );?>
|
268 |
+
</tbody>
|
269 |
+
</table>
|
270 |
+
</div><?php
|
271 |
+
}
|
272 |
+
|
273 |
+
|
274 |
+
|
275 |
+
|
276 |
+
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Popup Load Settings Metabox
|
280 |
+
*
|
281 |
+
* Extensions (as well as the core plugin) can add items to the popup targeting_condition
|
282 |
+
* metabox via the `popmake_popup_targeting_condition_meta_box_fields` action.
|
283 |
+
*
|
284 |
+
* @since 1.0
|
285 |
+
* @return void
|
286 |
+
*/
|
287 |
+
function popmake_render_popup_targeting_condition_meta_box() {
|
288 |
+
global $post; ?>
|
289 |
+
<div id="popmake_popup_targeting_condition_fields" class="popmake_meta_table_wrap">
|
290 |
+
<?php do_action( 'popmake_popup_targeting_condition_meta_box_fields', $post->ID ); ?>
|
291 |
+
</div><?php
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Adds Popup Theme meta fields to revisions.
|
299 |
+
*
|
300 |
+
* @since 1.0
|
301 |
+
* @return array $fields Array of fields.
|
302 |
+
*/
|
303 |
+
function popmake_popup_post_revision_fields( $fields ) {
|
304 |
+
$popup_fields = popmake_popup_meta_fields();
|
305 |
+
foreach($popup_fields as $field) {
|
306 |
+
$fields[$field] = __( ucwords( str_replace('_', ' ', str_replace('popup_', '', $field) ) ), 'popup-maker' );
|
307 |
+
}
|
308 |
+
return $fields;
|
309 |
+
}
|
310 |
+
//add_filter( '_wp_post_revision_fields', 'popmake_popup_post_revision_fields' );
|
311 |
+
|
312 |
+
|
313 |
+
function popmake_popup_revision_field( $value, $field, $revision) {
|
314 |
+
return get_metadata( 'post', $revision->ID, $field, true );
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
function popmake_add_popup_revision_fields() {
|
319 |
+
foreach(popmake_popup_meta_fields() as $field) {
|
320 |
+
add_filter( '_wp_post_revision_field_' . $field, 'popmake_popup_revision_field', 10, 3 );
|
321 |
+
}
|
322 |
+
}
|
323 |
+
//add_action('plugins_loaded', 'popmake_add_popup_revision_fields');
|
324 |
+
|
325 |
+
|
326 |
+
function popmake_popup_meta_restore_revision( $post_id, $revision_id ) {
|
327 |
+
$post = get_post( $post_id );
|
328 |
+
$revision = get_post( $revision_id );
|
329 |
+
foreach(popmake_popup_meta_fields() as $field) {
|
330 |
+
$meta = get_metadata( 'post', $revision->ID, $field, true );
|
331 |
+
if ( false === $meta )
|
332 |
+
delete_post_meta( $post_id, $field );
|
333 |
+
else
|
334 |
+
update_post_meta( $post_id, $field, $meta );
|
335 |
+
}
|
336 |
+
}
|
337 |
+
//add_action( 'wp_restore_post_revision', 'popmake_popup_meta_restore_revision', 10, 2 );
|
338 |
+
|
339 |
+
function popmake_popup_meta_save_revision( $post_id, $post ) {
|
340 |
+
if ( $parent_id = wp_is_post_revision( $post_id ) ) {
|
341 |
+
foreach(popmake_popup_meta_fields() as $field) {
|
342 |
+
$meta = get_post_meta( $parent_id, $field, true );
|
343 |
+
if ( false !== $meta )
|
344 |
+
add_metadata( 'post', $post_id, $field, $meta );
|
345 |
+
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
//add_action( 'save_post', 'popmake_popup_meta_save_revision', 11, 2 );
|
includes/admin/popups/post-type-item-metaboxes.php
ADDED
@@ -0,0 +1,438 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Displays a metabox for a post type menu item.
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
*
|
7 |
+
* @param string $object Not used.
|
8 |
+
* @param string $post_type The post type object.
|
9 |
+
*/
|
10 |
+
function popmake_post_type_item_metabox( $post_type_name ) {
|
11 |
+
if(!function_exists('wp_nav_menu_item_post_type_meta_box')) {
|
12 |
+
include ABSPATH . 'wp-admin/includes/nav-menu.php';
|
13 |
+
}
|
14 |
+
global $_nav_menu_placeholder, $nav_menu_selected_id;
|
15 |
+
|
16 |
+
$post_type = get_post_type_object( $post_type_name );
|
17 |
+
|
18 |
+
|
19 |
+
// Paginate browsing for large numbers of post objects.
|
20 |
+
$per_page = 50;
|
21 |
+
$pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
|
22 |
+
$offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
|
23 |
+
|
24 |
+
$args = array(
|
25 |
+
'offset' => $offset,
|
26 |
+
'order' => 'ASC',
|
27 |
+
'orderby' => 'title',
|
28 |
+
'posts_per_page' => $per_page,
|
29 |
+
'post_type' => $post_type_name,
|
30 |
+
'suppress_filters' => true,
|
31 |
+
'update_post_term_cache' => false,
|
32 |
+
'update_post_meta_cache' => false
|
33 |
+
);
|
34 |
+
|
35 |
+
if ( isset( $post_type->_default_query ) )
|
36 |
+
$args = array_merge($args, (array) $post_type->_default_query );
|
37 |
+
|
38 |
+
// @todo transient caching of these results with proper invalidation on updating of a post of this type
|
39 |
+
$get_posts = new WP_Query;
|
40 |
+
$posts = $get_posts->query( $args );
|
41 |
+
if ( ! $get_posts->post_count ) {
|
42 |
+
echo '<p>' . __( 'No items.' ) . '</p>';
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
$num_pages = $get_posts->max_num_pages;
|
47 |
+
|
48 |
+
$page_links = paginate_links( array(
|
49 |
+
'base' => add_query_arg(
|
50 |
+
array(
|
51 |
+
$post_type_name . '-tab' => 'all',
|
52 |
+
'paged' => '%#%',
|
53 |
+
'item-type' => 'post_type',
|
54 |
+
'item-object' => $post_type_name,
|
55 |
+
)
|
56 |
+
),
|
57 |
+
'format' => '',
|
58 |
+
'prev_text' => __('«'),
|
59 |
+
'next_text' => __('»'),
|
60 |
+
'total' => $num_pages,
|
61 |
+
'current' => $pagenum
|
62 |
+
));
|
63 |
+
|
64 |
+
$db_fields = false;
|
65 |
+
if ( is_post_type_hierarchical( $post_type_name ) ) {
|
66 |
+
$db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
|
67 |
+
}
|
68 |
+
|
69 |
+
$walker = new Walker_Nav_Menu_Checklist( $db_fields );
|
70 |
+
|
71 |
+
$current_tab = 'most-recent';
|
72 |
+
if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) {
|
73 |
+
$current_tab = $_REQUEST[$post_type_name . '-tab'];
|
74 |
+
}
|
75 |
+
|
76 |
+
if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
|
77 |
+
$current_tab = 'search';
|
78 |
+
}
|
79 |
+
|
80 |
+
$removed_args = array(
|
81 |
+
'action',
|
82 |
+
'customlink-tab',
|
83 |
+
'edit-menu-item',
|
84 |
+
'menu-item',
|
85 |
+
'page-tab',
|
86 |
+
'_wpnonce',
|
87 |
+
);
|
88 |
+
|
89 |
+
?>
|
90 |
+
<div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
|
91 |
+
<ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs category-tabs add-menu-item-tabs">
|
92 |
+
<li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
93 |
+
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
|
94 |
+
<?php _e( 'Most Recent' ); ?>
|
95 |
+
</a>
|
96 |
+
</li>
|
97 |
+
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
98 |
+
<a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
|
99 |
+
<?php _e( 'View All' ); ?>
|
100 |
+
</a>
|
101 |
+
</li>
|
102 |
+
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
103 |
+
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
|
104 |
+
<?php _e( 'Search'); ?>
|
105 |
+
</a>
|
106 |
+
</li>
|
107 |
+
</ul><!-- .posttype-tabs -->
|
108 |
+
|
109 |
+
<div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
|
110 |
+
echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
111 |
+
?>">
|
112 |
+
<ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
|
113 |
+
<?php
|
114 |
+
$recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) );
|
115 |
+
$most_recent = $get_posts->query( $recent_args );
|
116 |
+
$args['walker'] = $walker;
|
117 |
+
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
|
118 |
+
?>
|
119 |
+
</ul>
|
120 |
+
</div><!-- /.tabs-panel -->
|
121 |
+
|
122 |
+
<div class="tabs-panel <?php
|
123 |
+
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
124 |
+
?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
|
125 |
+
<?php
|
126 |
+
if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
|
127 |
+
$searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
|
128 |
+
$search_results = get_posts( array( 's' => $searched, 'post_type' => $post_type_name, 'fields' => 'all', 'order' => 'DESC', ) );
|
129 |
+
} else {
|
130 |
+
$searched = '';
|
131 |
+
$search_results = array();
|
132 |
+
}
|
133 |
+
?>
|
134 |
+
<p class="quick-search-wrap">
|
135 |
+
<input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
|
136 |
+
<span class="spinner"></span>
|
137 |
+
<?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
|
138 |
+
</p>
|
139 |
+
|
140 |
+
<ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
|
141 |
+
<?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
|
142 |
+
<?php
|
143 |
+
$args['walker'] = $walker;
|
144 |
+
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
|
145 |
+
?>
|
146 |
+
<?php elseif ( is_wp_error( $search_results ) ) : ?>
|
147 |
+
<li><?php echo $search_results->get_error_message(); ?></li>
|
148 |
+
<?php elseif ( ! empty( $searched ) ) : ?>
|
149 |
+
<li><?php _e('No results found.'); ?></li>
|
150 |
+
<?php endif; ?>
|
151 |
+
</ul>
|
152 |
+
</div><!-- /.tabs-panel -->
|
153 |
+
|
154 |
+
<div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
|
155 |
+
echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
156 |
+
?>">
|
157 |
+
<?php if ( ! empty( $page_links ) ) : ?>
|
158 |
+
<div class="add-menu-item-pagelinks">
|
159 |
+
<?php echo $page_links; ?>
|
160 |
+
</div>
|
161 |
+
<?php endif; ?>
|
162 |
+
<ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name?>" class="categorychecklist form-no-clear">
|
163 |
+
<?php
|
164 |
+
$args['walker'] = $walker;
|
165 |
+
|
166 |
+
/*
|
167 |
+
* If we're dealing with pages, let's put a checkbox for the front
|
168 |
+
* page at the top of the list.
|
169 |
+
*/
|
170 |
+
if ( 'page' == $post_type_name ) {
|
171 |
+
$front_page = 'page' == get_option('show_on_front') ? (int) get_option( 'page_on_front' ) : 0;
|
172 |
+
if ( ! empty( $front_page ) ) {
|
173 |
+
$front_page_obj = get_post( $front_page );
|
174 |
+
$front_page_obj->front_or_home = true;
|
175 |
+
array_unshift( $posts, $front_page_obj );
|
176 |
+
} else {
|
177 |
+
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
|
178 |
+
array_unshift( $posts, (object) array(
|
179 |
+
'front_or_home' => true,
|
180 |
+
'ID' => 0,
|
181 |
+
'object_id' => $_nav_menu_placeholder,
|
182 |
+
'post_content' => '',
|
183 |
+
'post_excerpt' => '',
|
184 |
+
'post_parent' => '',
|
185 |
+
'post_title' => _x('Home', 'nav menu home label'),
|
186 |
+
'post_type' => 'nav_menu_item',
|
187 |
+
'type' => 'custom',
|
188 |
+
'url' => home_url('/'),
|
189 |
+
) );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Filter the posts displayed in the 'View All' tab of the current
|
195 |
+
* post type's menu items meta box.
|
196 |
+
*
|
197 |
+
* The dynamic portion of the hook name, $post_type_name,
|
198 |
+
* refers to the slug of the current post type.
|
199 |
+
*
|
200 |
+
* @since 3.2.0
|
201 |
+
*
|
202 |
+
* @see WP_Query::query()
|
203 |
+
*
|
204 |
+
* @param array $posts The posts for the current post type.
|
205 |
+
* @param array $args An array of WP_Query arguments.
|
206 |
+
* @param object $post_type The current post type object for this menu item meta box.
|
207 |
+
*/
|
208 |
+
$posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );
|
209 |
+
$checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
|
210 |
+
|
211 |
+
if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
|
212 |
+
$checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
|
213 |
+
|
214 |
+
}
|
215 |
+
|
216 |
+
echo $checkbox_items;
|
217 |
+
?>
|
218 |
+
</ul>
|
219 |
+
<?php if ( ! empty( $page_links ) ) : ?>
|
220 |
+
<div class="add-menu-item-pagelinks">
|
221 |
+
<?php echo $page_links; ?>
|
222 |
+
</div>
|
223 |
+
<?php endif; ?>
|
224 |
+
</div><!-- /.tabs-panel -->
|
225 |
+
|
226 |
+
<p class="button-controls">
|
227 |
+
<span class="list-controls">
|
228 |
+
<a href="<?php
|
229 |
+
echo esc_url( add_query_arg(
|
230 |
+
array(
|
231 |
+
$post_type_name . '-tab' => 'all',
|
232 |
+
'selectall' => 1,
|
233 |
+
),
|
234 |
+
remove_query_arg( $removed_args )
|
235 |
+
));
|
236 |
+
?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
|
237 |
+
</span>
|
238 |
+
|
239 |
+
<span class="add-to-list">
|
240 |
+
<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add Selected' ); ?>" name="add-post-type-menu-item" id="<?php echo esc_attr( 'submit-posttype-' . $post_type_name ); ?>" />
|
241 |
+
<span class="spinner"></span>
|
242 |
+
</span>
|
243 |
+
</p>
|
244 |
+
|
245 |
+
</div><!-- /.posttypediv -->
|
246 |
+
<?php
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Displays a metabox for a taxonomy menu item.
|
251 |
+
*
|
252 |
+
* @since 1.0.0
|
253 |
+
*
|
254 |
+
* @param string $taxonomy The taxonomy object.
|
255 |
+
*/
|
256 |
+
function popmake_taxonomy_item_metabox( $taxonomy_name ) {
|
257 |
+
if(!function_exists('wp_nav_menu_item_post_type_meta_box')) {
|
258 |
+
include ABSPATH . 'wp-admin/includes/nav-menu.php';
|
259 |
+
}
|
260 |
+
global $nav_menu_selected_id;
|
261 |
+
|
262 |
+
$taxonomy = get_taxonomy( $taxonomy_name );
|
263 |
+
|
264 |
+
// Paginate browsing for large numbers of objects.
|
265 |
+
$per_page = 50;
|
266 |
+
$pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
|
267 |
+
$offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
|
268 |
+
|
269 |
+
$args = array(
|
270 |
+
'child_of' => 0,
|
271 |
+
'exclude' => '',
|
272 |
+
'hide_empty' => false,
|
273 |
+
'hierarchical' => 1,
|
274 |
+
'include' => '',
|
275 |
+
'number' => $per_page,
|
276 |
+
'offset' => $offset,
|
277 |
+
'order' => 'ASC',
|
278 |
+
'orderby' => 'name',
|
279 |
+
'pad_counts' => false,
|
280 |
+
);
|
281 |
+
|
282 |
+
$terms = get_terms( $taxonomy_name, $args );
|
283 |
+
|
284 |
+
if ( ! $terms || is_wp_error($terms) ) {
|
285 |
+
echo '<p>' . __( 'No items.' ) . '</p>';
|
286 |
+
return;
|
287 |
+
}
|
288 |
+
|
289 |
+
$num_pages = ceil( wp_count_terms( $taxonomy_name , array_merge( $args, array('number' => '', 'offset' => '') ) ) / $per_page );
|
290 |
+
|
291 |
+
$page_links = paginate_links( array(
|
292 |
+
'base' => add_query_arg(
|
293 |
+
array(
|
294 |
+
$taxonomy_name . '-tab' => 'all',
|
295 |
+
'paged' => '%#%',
|
296 |
+
'item-type' => 'taxonomy',
|
297 |
+
'item-object' => $taxonomy_name,
|
298 |
+
)
|
299 |
+
),
|
300 |
+
'format' => '',
|
301 |
+
'prev_text' => __('«'),
|
302 |
+
'next_text' => __('»'),
|
303 |
+
'total' => $num_pages,
|
304 |
+
'current' => $pagenum
|
305 |
+
));
|
306 |
+
|
307 |
+
$db_fields = false;
|
308 |
+
if ( is_taxonomy_hierarchical( $taxonomy_name ) ) {
|
309 |
+
$db_fields = array( 'parent' => 'parent', 'id' => 'term_id' );
|
310 |
+
}
|
311 |
+
|
312 |
+
$walker = new Walker_Nav_Menu_Checklist( $db_fields );
|
313 |
+
|
314 |
+
$current_tab = 'most-used';
|
315 |
+
if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) {
|
316 |
+
$current_tab = $_REQUEST[$taxonomy_name . '-tab'];
|
317 |
+
}
|
318 |
+
|
319 |
+
if ( ! empty( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
|
320 |
+
$current_tab = 'search';
|
321 |
+
}
|
322 |
+
|
323 |
+
$removed_args = array(
|
324 |
+
'action',
|
325 |
+
'customlink-tab',
|
326 |
+
'edit-menu-item',
|
327 |
+
'menu-item',
|
328 |
+
'page-tab',
|
329 |
+
'_wpnonce',
|
330 |
+
);
|
331 |
+
|
332 |
+
?>
|
333 |
+
<div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
|
334 |
+
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
|
335 |
+
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
336 |
+
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
|
337 |
+
<?php _e( 'Most Used' ); ?>
|
338 |
+
</a>
|
339 |
+
</li>
|
340 |
+
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
341 |
+
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
|
342 |
+
<?php _e( 'View All' ); ?>
|
343 |
+
</a>
|
344 |
+
</li>
|
345 |
+
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
|
346 |
+
<a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
|
347 |
+
<?php _e( 'Search' ); ?>
|
348 |
+
</a>
|
349 |
+
</li>
|
350 |
+
</ul><!-- .taxonomy-tabs -->
|
351 |
+
|
352 |
+
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
|
353 |
+
echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
354 |
+
?>">
|
355 |
+
<ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
|
356 |
+
<?php
|
357 |
+
$popular_terms = get_terms( $taxonomy_name, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
|
358 |
+
$args['walker'] = $walker;
|
359 |
+
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
|
360 |
+
?>
|
361 |
+
</ul>
|
362 |
+
</div><!-- /.tabs-panel -->
|
363 |
+
|
364 |
+
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
|
365 |
+
echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
366 |
+
?>">
|
367 |
+
<?php if ( ! empty( $page_links ) ) : ?>
|
368 |
+
<div class="add-menu-item-pagelinks">
|
369 |
+
<?php echo $page_links; ?>
|
370 |
+
</div>
|
371 |
+
<?php endif; ?>
|
372 |
+
<ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
|
373 |
+
<?php
|
374 |
+
$args['walker'] = $walker;
|
375 |
+
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
|
376 |
+
?>
|
377 |
+
</ul>
|
378 |
+
<?php if ( ! empty( $page_links ) ) : ?>
|
379 |
+
<div class="add-menu-item-pagelinks">
|
380 |
+
<?php echo $page_links; ?>
|
381 |
+
</div>
|
382 |
+
<?php endif; ?>
|
383 |
+
</div><!-- /.tabs-panel -->
|
384 |
+
|
385 |
+
<div class="tabs-panel <?php
|
386 |
+
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
|
387 |
+
?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
|
388 |
+
<?php
|
389 |
+
if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
|
390 |
+
$searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
|
391 |
+
$search_results = get_terms( $taxonomy_name, array( 'name__like' => $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) );
|
392 |
+
} else {
|
393 |
+
$searched = '';
|
394 |
+
$search_results = array();
|
395 |
+
}
|
396 |
+
?>
|
397 |
+
<p class="quick-search-wrap">
|
398 |
+
<input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
|
399 |
+
<span class="spinner"></span>
|
400 |
+
<?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
|
401 |
+
</p>
|
402 |
+
|
403 |
+
<ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name?>" class="categorychecklist form-no-clear">
|
404 |
+
<?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
|
405 |
+
<?php
|
406 |
+
$args['walker'] = $walker;
|
407 |
+
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $search_results), 0, (object) $args );
|
408 |
+
?>
|
409 |
+
<?php elseif ( is_wp_error( $search_results ) ) : ?>
|
410 |
+
<li><?php echo $search_results->get_error_message(); ?></li>
|
411 |
+
<?php elseif ( ! empty( $searched ) ) : ?>
|
412 |
+
<li><?php _e('No results found.'); ?></li>
|
413 |
+
<?php endif; ?>
|
414 |
+
</ul>
|
415 |
+
</div><!-- /.tabs-panel -->
|
416 |
+
|
417 |
+
<p class="button-controls">
|
418 |
+
<span class="list-controls">
|
419 |
+
<a href="<?php
|
420 |
+
echo esc_url(add_query_arg(
|
421 |
+
array(
|
422 |
+
$taxonomy_name . '-tab' => 'all',
|
423 |
+
'selectall' => 1,
|
424 |
+
),
|
425 |
+
remove_query_arg($removed_args)
|
426 |
+
));
|
427 |
+
?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
|
428 |
+
</span>
|
429 |
+
|
430 |
+
<span class="add-to-menu">
|
431 |
+
<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-taxonomy-menu-item" id="<?php echo esc_attr( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
|
432 |
+
<span class="spinner"></span>
|
433 |
+
</span>
|
434 |
+
</p>
|
435 |
+
|
436 |
+
</div><!-- /.taxonomydiv -->
|
437 |
+
<?php
|
438 |
+
}
|
includes/admin/post-editor.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_enable_popup_classes_in_post_editor_styles_dropdown() {
|
3 |
+
// Ultimate MCE Compatibility Check
|
4 |
+
$ultmce = get_option('jwl_options_group1');
|
5 |
+
$row = isset($ultmce['jwl_styleselect_field_id']) ? intval($ultmce['jwl_styleselect_dropdown']) : 2;
|
6 |
+
add_filter("mce_buttons_$row", 'popmake_tiny_mce_buttons', 999);
|
7 |
+
add_filter('tiny_mce_before_init', 'popmake_tiny_mce_styles_dropdown_options', 999);
|
8 |
+
}
|
9 |
+
add_action('admin_init', 'popmake_enable_popup_classes_in_post_editor_styles_dropdown');
|
10 |
+
|
11 |
+
|
12 |
+
function popmake_tiny_mce_buttons( $buttons ) {
|
13 |
+
if(!in_array('styleselect', $buttons))
|
14 |
+
$buttons[] = 'styleselect';
|
15 |
+
return $buttons;
|
16 |
+
}
|
17 |
+
|
18 |
+
function popmake_tiny_mce_styles_dropdown_options( $initArray ) {
|
19 |
+
// Add Popup styles to styles dropdown
|
20 |
+
$styles = !empty($initArray['style_formats']) && is_array(json_decode($initArray['style_formats'])) ? json_decode($initArray['style_formats']) : array();
|
21 |
+
foreach(get_all_popups()->posts as $popup)
|
22 |
+
{
|
23 |
+
$styles[] = array(
|
24 |
+
'title' => "Open Popup - {$popup->post_title}",
|
25 |
+
'inline' => 'span',
|
26 |
+
'classes' => "popmake-{$popup->ID}"
|
27 |
+
);
|
28 |
+
}
|
29 |
+
$initArray['style_formats'] = json_encode($styles);
|
30 |
+
return $initArray;
|
31 |
+
}
|
includes/admin/settings/register-settings.php
ADDED
@@ -0,0 +1,781 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Register Settings
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Admin/Settings
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 3
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( !defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get an option
|
18 |
+
*
|
19 |
+
* Looks to see if the specified setting exists, returns default if not
|
20 |
+
*
|
21 |
+
* @since 1.0
|
22 |
+
* @return mixed
|
23 |
+
*/
|
24 |
+
function popmake_get_option( $key = '', $default = false ) {
|
25 |
+
global $popmake_options;
|
26 |
+
$value = ! empty( $popmake_options[ $key ] ) ? $popmake_options[ $key ] : $default;
|
27 |
+
$value = apply_filters( 'popmake_get_option', $value, $key, $default );
|
28 |
+
return apply_filters( 'popmake_get_option_' . $key, $value, $key, $default );
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Get Settings
|
33 |
+
*
|
34 |
+
* Retrieves all plugin settings
|
35 |
+
*
|
36 |
+
* @since 1.0
|
37 |
+
* @return array POPMAKE settings
|
38 |
+
*/
|
39 |
+
function popmake_get_settings() {
|
40 |
+
|
41 |
+
$settings = get_option( 'popmake_settings' );
|
42 |
+
|
43 |
+
if( empty( $settings ) ) {
|
44 |
+
|
45 |
+
// Update old settings with new single option
|
46 |
+
|
47 |
+
$license_settings = is_array( get_option( 'popmake_settings_licenses' ) ) ? get_option( 'popmake_settings_licenses' ) : array();
|
48 |
+
|
49 |
+
$settings = array_merge( $license_settings );
|
50 |
+
|
51 |
+
update_option( 'popmake_settings', $settings );
|
52 |
+
|
53 |
+
}
|
54 |
+
return apply_filters( 'popmake_get_settings', $settings );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Add all settings sections and fields
|
59 |
+
*
|
60 |
+
* @since 1.0
|
61 |
+
* @return void
|
62 |
+
*/
|
63 |
+
function popmake_register_settings() {
|
64 |
+
|
65 |
+
if ( false == get_option( 'popmake_settings' ) ) {
|
66 |
+
add_option( 'popmake_settings' );
|
67 |
+
}
|
68 |
+
|
69 |
+
foreach( popmake_get_registered_settings() as $tab => $settings ) {
|
70 |
+
|
71 |
+
add_settings_section(
|
72 |
+
'popmake_settings_' . $tab,
|
73 |
+
__return_null(),
|
74 |
+
'__return_false',
|
75 |
+
'popmake_settings_' . $tab
|
76 |
+
);
|
77 |
+
|
78 |
+
foreach ( $settings as $option ) {
|
79 |
+
|
80 |
+
$name = isset( $option['name'] ) ? $option['name'] : '';
|
81 |
+
|
82 |
+
add_settings_field(
|
83 |
+
'popmake_settings[' . $option['id'] . ']',
|
84 |
+
$name,
|
85 |
+
function_exists( 'popmake_' . $option['type'] . '_callback' ) ? 'popmake_' . $option['type'] . '_callback' : 'popmake_missing_callback',
|
86 |
+
'popmake_settings_' . $tab,
|
87 |
+
'popmake_settings_' . $tab,
|
88 |
+
array(
|
89 |
+
'section' => $tab,
|
90 |
+
'id' => isset( $option['id'] ) ? $option['id'] : null,
|
91 |
+
'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
|
92 |
+
'name' => isset( $option['name'] ) ? $option['name'] : null,
|
93 |
+
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
94 |
+
'options' => isset( $option['options'] ) ? $option['options'] : '',
|
95 |
+
'std' => isset( $option['std'] ) ? $option['std'] : '',
|
96 |
+
'min' => isset( $option['min'] ) ? $option['min'] : null,
|
97 |
+
'max' => isset( $option['max'] ) ? $option['max'] : null,
|
98 |
+
'step' => isset( $option['step'] ) ? $option['step'] : null
|
99 |
+
)
|
100 |
+
);
|
101 |
+
}
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
// Creates our settings in the options table
|
106 |
+
register_setting( 'popmake_settings', 'popmake_settings', 'popmake_settings_sanitize' );
|
107 |
+
|
108 |
+
}
|
109 |
+
add_action('admin_init', 'popmake_register_settings');
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Retrieve the array of plugin settings
|
113 |
+
*
|
114 |
+
* @since 1.0
|
115 |
+
* @return array
|
116 |
+
*/
|
117 |
+
function popmake_get_registered_settings() {
|
118 |
+
|
119 |
+
/**
|
120 |
+
* 'Whitelisted' POPMAKE settings, filters are provided for each settings
|
121 |
+
* section to allow extensions and other plugins to add their own settings
|
122 |
+
*/
|
123 |
+
$popmake_settings = array(
|
124 |
+
/** General Settings */
|
125 |
+
'general' => apply_filters( 'popmake_settings_general',
|
126 |
+
array(
|
127 |
+
/*
|
128 |
+
'custom_post_type_support_heading' => array(
|
129 |
+
'id' => 'custom_post_type_support_heading',
|
130 |
+
'name' => '<strong>' . __( 'Support for CPTs', 'popup-maker' ) . '</strong>',
|
131 |
+
'desc' => '',
|
132 |
+
'type' => 'header'
|
133 |
+
),
|
134 |
+
'supported_post_types' => array(
|
135 |
+
'id' => 'supported_post_types',
|
136 |
+
'name' => __( 'Supported Post Types?', 'popup-maker' ),
|
137 |
+
//'desc' => __( 'Check this to defy how awesome Popup Maker is. <strong>For those who like to make little kids cry or are compulsive liers.</strong>.', 'popup-maker' ),
|
138 |
+
'type' => 'multicheck',
|
139 |
+
'options' => get_post_types(array('_builtin' => false, 'public' => true))
|
140 |
+
),
|
141 |
+
'supported_taxonomies' => array(
|
142 |
+
'id' => 'supported_taxonomies',
|
143 |
+
'name' => __( 'Supported Taxonomies?', 'popup-maker' ),
|
144 |
+
//'desc' => __( 'Check this to defy how awesome Popup Maker is. <strong>For those who like to make little kids cry or are compulsive liers.</strong>.', 'popup-maker' ),
|
145 |
+
'type' => 'multicheck',
|
146 |
+
'options' => get_taxonomies(array('_builtin' => false, 'public' => true))
|
147 |
+
),
|
148 |
+
*/
|
149 |
+
'powered_by' => array(
|
150 |
+
'id' => 'powered_by',
|
151 |
+
'name' => '<strong>' . __( 'Powered By', 'popup-maker' ) . '</strong>',
|
152 |
+
'desc' => '',
|
153 |
+
'type' => 'header'
|
154 |
+
),
|
155 |
+
'popmake_powered_by_opt_out' => array(
|
156 |
+
'id' => 'popmake_powered_by_opt_out',
|
157 |
+
'name' => __( 'Hide Powered By Link?', 'popup-maker' ),
|
158 |
+
'desc' => __( 'Check this to defy how awesome Popup Maker is. <strong>For those who like to make little kids cry or are compulsive liers.</strong>.', 'popup-maker' ),
|
159 |
+
'type' => 'checkbox'
|
160 |
+
),
|
161 |
+
'popmake_powered_by_size' => array(
|
162 |
+
'id' => 'popmake_powered_by_size',
|
163 |
+
'name' => __( 'How much do you love it?', 'popup-maker' ),
|
164 |
+
'desc' => __( 'This affects the size of the credit link below your popups.', 'popup-maker' ),
|
165 |
+
'type' => 'select',
|
166 |
+
'options' => array(
|
167 |
+
'small' => 'A Little.',
|
168 |
+
'' => 'It\'s Pretty Good',
|
169 |
+
'large' => 'I Love It!',
|
170 |
+
)
|
171 |
+
),
|
172 |
+
/*
|
173 |
+
'tracking_settings' => array(
|
174 |
+
'id' => 'tracking_settings',
|
175 |
+
'name' => '<strong>' . __( 'Tracking Settings', 'popup-maker' ) . '</strong>',
|
176 |
+
'desc' => '',
|
177 |
+
'type' => 'header'
|
178 |
+
),
|
179 |
+
'allow_tracking' => array(
|
180 |
+
'id' => 'allow_tracking',
|
181 |
+
'name' => __( 'Allow Usage Tracking?', 'popup-maker' ),
|
182 |
+
'desc' => __( 'Allow Easy Digital Downloads to anonymously track how this plugin is used and help us make the plugin better. Opt-in and receive a 20% discount code for any purchase from the <a href="https://easydigitaldownloads.com/extensions" target="_blank">Easy Digital Downloads store</a>. Your discount code will be emailed to you.', 'popup-maker' ),
|
183 |
+
'type' => 'checkbox'
|
184 |
+
),
|
185 |
+
'uninstall_on_delete' => array(
|
186 |
+
'id' => 'uninstall_on_delete',
|
187 |
+
'name' => __( 'Remove Data on Uninstall?', 'popup-maker' ),
|
188 |
+
'desc' => __( 'Check this box if you would like POPMAKE to completely remove all of its data when the plugin is deleted.', 'popup-maker' ),
|
189 |
+
'type' => 'checkbox'
|
190 |
+
)
|
191 |
+
*/
|
192 |
+
)
|
193 |
+
),
|
194 |
+
'assets' => apply_filters( 'popmake_settings_assets',
|
195 |
+
array(
|
196 |
+
'disable_google_font_loading' => array(
|
197 |
+
'id' => 'disable_google_font_loading',
|
198 |
+
'name' => __( 'Don\'t Load Google Fonts', 'popup-maker' ),
|
199 |
+
'desc' => __( 'Check this disable loading of google fonts, useful if the fonts you chose are already loaded with your theme.', 'popup-maker' ),
|
200 |
+
'type' => 'checkbox'
|
201 |
+
),
|
202 |
+
)
|
203 |
+
),
|
204 |
+
|
205 |
+
/** Extension Settings */
|
206 |
+
'extensions' => apply_filters('popmake_settings_extensions',
|
207 |
+
array()
|
208 |
+
),
|
209 |
+
'licenses' => apply_filters('popmake_settings_licenses',
|
210 |
+
array()
|
211 |
+
),
|
212 |
+
);
|
213 |
+
|
214 |
+
return apply_filters( 'popmake_registered_settings', $popmake_settings );
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Retrieve a list of all published pages
|
221 |
+
*
|
222 |
+
* On large sites this can be expensive, so only load if on the settings page or $force is set to true
|
223 |
+
*
|
224 |
+
* @since 1.0
|
225 |
+
* @param bool $force Force the pages to be loaded even if not on settings
|
226 |
+
* @return array $pages_options An array of the pages
|
227 |
+
*/
|
228 |
+
function popmake_get_pages( $force = false ) {
|
229 |
+
|
230 |
+
$pages_options = array( 0 => '' ); // Blank option
|
231 |
+
|
232 |
+
if( ( ! isset( $_GET['page'] ) || 'popmake-settings' != $_GET['page'] ) && ! $force ) {
|
233 |
+
return $pages_options;
|
234 |
+
}
|
235 |
+
|
236 |
+
$pages = get_pages();
|
237 |
+
if ( $pages ) {
|
238 |
+
foreach ( $pages as $page ) {
|
239 |
+
$pages_options[ $page->ID ] = $page->post_title;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
return $pages_options;
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Settings Sanitization
|
250 |
+
*
|
251 |
+
* Adds a settings error (for the updated message)
|
252 |
+
* At some point this will validate input
|
253 |
+
*
|
254 |
+
* @since 1.0
|
255 |
+
*
|
256 |
+
* @param array $input The value inputted in the field
|
257 |
+
*
|
258 |
+
* @return string $input Sanitizied value
|
259 |
+
*/
|
260 |
+
function popmake_settings_sanitize( $input = array() ) {
|
261 |
+
|
262 |
+
global $popmake_options;
|
263 |
+
|
264 |
+
if ( empty( $_POST['_wp_http_referer'] ) ) {
|
265 |
+
return $input;
|
266 |
+
}
|
267 |
+
|
268 |
+
parse_str( $_POST['_wp_http_referer'], $referrer );
|
269 |
+
|
270 |
+
$settings = popmake_get_registered_settings();
|
271 |
+
$tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';
|
272 |
+
|
273 |
+
$input = $input ? $input : array();
|
274 |
+
$input = apply_filters( 'popmake_settings_' . $tab . '_sanitize', $input );
|
275 |
+
|
276 |
+
// Loop through each setting being saved and pass it through a sanitization filter
|
277 |
+
foreach ( $input as $key => $value ) {
|
278 |
+
|
279 |
+
// Get the setting type (checkbox, select, etc)
|
280 |
+
$type = isset( $settings[$tab][$key]['type'] ) ? $settings[$tab][$key]['type'] : false;
|
281 |
+
if ( $type ) {
|
282 |
+
// Field type specific filter
|
283 |
+
$input[$key] = apply_filters( 'popmake_settings_sanitize_' . $type, $value, $key );
|
284 |
+
}
|
285 |
+
|
286 |
+
// General filter
|
287 |
+
$input[$key] = apply_filters( 'popmake_settings_sanitize', $value, $key );
|
288 |
+
}
|
289 |
+
|
290 |
+
// Loop through the whitelist and unset any that are empty for the tab being saved
|
291 |
+
if ( ! empty( $settings[$tab] ) ) {
|
292 |
+
foreach ( $settings[$tab] as $key => $value ) {
|
293 |
+
|
294 |
+
// settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work
|
295 |
+
if ( is_numeric( $key ) ) {
|
296 |
+
$key = $value['id'];
|
297 |
+
}
|
298 |
+
|
299 |
+
if ( empty( $input[$key] ) ) {
|
300 |
+
unset( $popmake_options[$key] );
|
301 |
+
}
|
302 |
+
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
// Merge our new settings with the existing
|
307 |
+
$output = array_merge( $popmake_options, $input );
|
308 |
+
add_settings_error( 'popmake-notices', '', __( 'Settings updated.', 'popup-maker' ), 'updated' );
|
309 |
+
|
310 |
+
return $output;
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Sanitize text fields
|
315 |
+
*
|
316 |
+
* @since 1.0
|
317 |
+
* @param array $input The field value
|
318 |
+
* @return string $input Sanitizied value
|
319 |
+
*/
|
320 |
+
function popmake_sanitize_text_field( $input ) {
|
321 |
+
return trim( $input );
|
322 |
+
}
|
323 |
+
add_filter( 'popmake_settings_sanitize_text', 'popmake_sanitize_text_field' );
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Retrieve settings tabs
|
327 |
+
*
|
328 |
+
* @since 1.0
|
329 |
+
* @return array $tabs
|
330 |
+
*/
|
331 |
+
function popmake_get_settings_tabs() {
|
332 |
+
|
333 |
+
$settings = popmake_get_registered_settings();
|
334 |
+
|
335 |
+
$tabs = array();
|
336 |
+
$tabs['general'] = __( 'General', 'popup-maker' );
|
337 |
+
$tabs['assets'] = __( 'Assets', 'popup-maker' );
|
338 |
+
|
339 |
+
if( ! empty( $settings['extensions'] ) ) {
|
340 |
+
$tabs['extensions'] = __( 'Extensions', 'popup-maker' );
|
341 |
+
}
|
342 |
+
if( ! empty( $settings['licenses'] ) ) {
|
343 |
+
$tabs['licenses'] = __( 'Licenses', 'popup-maker' );
|
344 |
+
}
|
345 |
+
if( ! empty( $settings['misc'] ) ) {
|
346 |
+
$tabs['misc'] = __( 'Misc', 'popup-maker' );
|
347 |
+
}
|
348 |
+
|
349 |
+
return apply_filters( 'popmake_settings_tabs', $tabs );
|
350 |
+
}
|
351 |
+
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Header Callback
|
355 |
+
*
|
356 |
+
* Renders the header.
|
357 |
+
*
|
358 |
+
* @since 1.0
|
359 |
+
* @param array $args Arguments passed by the setting
|
360 |
+
* @return void
|
361 |
+
*/
|
362 |
+
function popmake_header_callback( $args ) {
|
363 |
+
echo '<hr/>';
|
364 |
+
}
|
365 |
+
|
366 |
+
/**
|
367 |
+
* Checkbox Callback
|
368 |
+
*
|
369 |
+
* Renders checkboxes.
|
370 |
+
*
|
371 |
+
* @since 1.0
|
372 |
+
* @param array $args Arguments passed by the setting
|
373 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
374 |
+
* @return void
|
375 |
+
*/
|
376 |
+
function popmake_checkbox_callback( $args ) {
|
377 |
+
global $popmake_options;
|
378 |
+
|
379 |
+
$checked = isset( $popmake_options[ $args[ 'id' ] ] ) ? checked( 1, $popmake_options[ $args[ 'id' ] ], false ) : '';
|
380 |
+
$html = '<input type="checkbox" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="1" ' . $checked . '/>';
|
381 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
382 |
+
|
383 |
+
echo $html;
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Multicheck Callback
|
388 |
+
*
|
389 |
+
* Renders multiple checkboxes.
|
390 |
+
*
|
391 |
+
* @since 1.0
|
392 |
+
* @param array $args Arguments passed by the setting
|
393 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
394 |
+
* @return void
|
395 |
+
*/
|
396 |
+
function popmake_multicheck_callback( $args ) {
|
397 |
+
global $popmake_options;
|
398 |
+
|
399 |
+
if ( ! empty( $args['options'] ) ) {
|
400 |
+
foreach( $args['options'] as $key => $option ):
|
401 |
+
if( isset( $popmake_options[$args['id']][$key] ) ) { $enabled = $option; } else { $enabled = NULL; }
|
402 |
+
echo '<input name="popmake_settings[' . $args['id'] . '][' . $key . ']" id="popmake_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked($option, $enabled, false) . '/> ';
|
403 |
+
echo '<label for="popmake_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
|
404 |
+
endforeach;
|
405 |
+
echo '<p class="description">' . $args['desc'] . '</p>';
|
406 |
+
}
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Radio Callback
|
411 |
+
*
|
412 |
+
* Renders radio boxes.
|
413 |
+
*
|
414 |
+
* @since 1.0
|
415 |
+
* @param array $args Arguments passed by the setting
|
416 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
417 |
+
* @return void
|
418 |
+
*/
|
419 |
+
function popmake_radio_callback( $args ) {
|
420 |
+
global $popmake_options;
|
421 |
+
|
422 |
+
foreach ( $args['options'] as $key => $option ) :
|
423 |
+
$checked = false;
|
424 |
+
|
425 |
+
if ( isset( $popmake_options[ $args['id'] ] ) && $popmake_options[ $args['id'] ] == $key )
|
426 |
+
$checked = true;
|
427 |
+
elseif( isset( $args['std'] ) && $args['std'] == $key && ! isset( $popmake_options[ $args['id'] ] ) )
|
428 |
+
$checked = true;
|
429 |
+
|
430 |
+
echo '<input name="popmake_settings[' . $args['id'] . ']"" id="popmake_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked(true, $checked, false) . '/> ';
|
431 |
+
echo '<label for="popmake_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
|
432 |
+
endforeach;
|
433 |
+
|
434 |
+
echo '<p class="description">' . $args['desc'] . '</p>';
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Text Callback
|
440 |
+
*
|
441 |
+
* Renders text fields.
|
442 |
+
*
|
443 |
+
* @since 1.0
|
444 |
+
* @param array $args Arguments passed by the setting
|
445 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
446 |
+
* @return void
|
447 |
+
*/
|
448 |
+
function popmake_text_callback( $args ) {
|
449 |
+
global $popmake_options;
|
450 |
+
|
451 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
452 |
+
$value = $popmake_options[ $args['id'] ];
|
453 |
+
else
|
454 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
455 |
+
|
456 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
457 |
+
$html = '<input type="text" class="' . $size . '-text" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
|
458 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
459 |
+
|
460 |
+
echo $html;
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Number Callback
|
465 |
+
*
|
466 |
+
* Renders number fields.
|
467 |
+
*
|
468 |
+
* @since 1.0
|
469 |
+
* @param array $args Arguments passed by the setting
|
470 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
471 |
+
* @return void
|
472 |
+
*/
|
473 |
+
function popmake_number_callback( $args ) {
|
474 |
+
global $popmake_options;
|
475 |
+
|
476 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
477 |
+
$value = $popmake_options[ $args['id'] ];
|
478 |
+
else
|
479 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
480 |
+
|
481 |
+
$max = isset( $args['max'] ) ? $args['max'] : 999999;
|
482 |
+
$min = isset( $args['min'] ) ? $args['min'] : 0;
|
483 |
+
$step = isset( $args['step'] ) ? $args['step'] : 1;
|
484 |
+
|
485 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
486 |
+
$html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $size . '-text" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
|
487 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
488 |
+
|
489 |
+
echo $html;
|
490 |
+
}
|
491 |
+
|
492 |
+
/**
|
493 |
+
* Textarea Callback
|
494 |
+
*
|
495 |
+
* Renders textarea fields.
|
496 |
+
*
|
497 |
+
* @since 1.0
|
498 |
+
* @param array $args Arguments passed by the setting
|
499 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
500 |
+
* @return void
|
501 |
+
*/
|
502 |
+
function popmake_textarea_callback( $args ) {
|
503 |
+
global $popmake_options;
|
504 |
+
|
505 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
506 |
+
$value = $popmake_options[ $args['id'] ];
|
507 |
+
else
|
508 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
509 |
+
|
510 |
+
$html = '<textarea class="large-text" cols="50" rows="5" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
|
511 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
512 |
+
|
513 |
+
echo $html;
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Password Callback
|
518 |
+
*
|
519 |
+
* Renders password fields.
|
520 |
+
*
|
521 |
+
* @since 1.0
|
522 |
+
* @param array $args Arguments passed by the setting
|
523 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
524 |
+
* @return void
|
525 |
+
*/
|
526 |
+
function popmake_password_callback( $args ) {
|
527 |
+
global $popmake_options;
|
528 |
+
|
529 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
530 |
+
$value = $popmake_options[ $args['id'] ];
|
531 |
+
else
|
532 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
533 |
+
|
534 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
535 |
+
$html = '<input type="password" class="' . $size . '-text" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
|
536 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
537 |
+
|
538 |
+
echo $html;
|
539 |
+
}
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Missing Callback
|
543 |
+
*
|
544 |
+
* If a function is missing for settings callbacks alert the user.
|
545 |
+
*
|
546 |
+
* @since 1.0
|
547 |
+
* @param array $args Arguments passed by the setting
|
548 |
+
* @return void
|
549 |
+
*/
|
550 |
+
function popmake_missing_callback($args) {
|
551 |
+
printf( __( 'The callback function used for the <strong>%s</strong> setting is missing.', 'popup-maker' ), $args['id'] );
|
552 |
+
}
|
553 |
+
|
554 |
+
/**
|
555 |
+
* Select Callback
|
556 |
+
*
|
557 |
+
* Renders select fields.
|
558 |
+
*
|
559 |
+
* @since 1.0
|
560 |
+
* @param array $args Arguments passed by the setting
|
561 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
562 |
+
* @return void
|
563 |
+
*/
|
564 |
+
function popmake_select_callback($args) {
|
565 |
+
global $popmake_options;
|
566 |
+
|
567 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
568 |
+
$value = $popmake_options[ $args['id'] ];
|
569 |
+
else
|
570 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
571 |
+
|
572 |
+
$html = '<select id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']"/>';
|
573 |
+
|
574 |
+
foreach ( $args['options'] as $option => $name ) :
|
575 |
+
$selected = selected( $option, $value, false );
|
576 |
+
$html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
|
577 |
+
endforeach;
|
578 |
+
|
579 |
+
$html .= '</select>';
|
580 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
581 |
+
|
582 |
+
echo $html;
|
583 |
+
}
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Color select Callback
|
587 |
+
*
|
588 |
+
* Renders color select fields.
|
589 |
+
*
|
590 |
+
* @since 1.0
|
591 |
+
* @param array $args Arguments passed by the setting
|
592 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
593 |
+
* @return void
|
594 |
+
*/
|
595 |
+
function popmake_color_select_callback( $args ) {
|
596 |
+
global $popmake_options;
|
597 |
+
|
598 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
599 |
+
$value = $popmake_options[ $args['id'] ];
|
600 |
+
else
|
601 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
602 |
+
|
603 |
+
$html = '<select id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']"/>';
|
604 |
+
|
605 |
+
foreach ( $args['options'] as $option => $color ) :
|
606 |
+
$selected = selected( $option, $value, false );
|
607 |
+
$html .= '<option value="' . $option . '" ' . $selected . '>' . $color['label'] . '</option>';
|
608 |
+
endforeach;
|
609 |
+
|
610 |
+
$html .= '</select>';
|
611 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
612 |
+
|
613 |
+
echo $html;
|
614 |
+
}
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Rich Editor Callback
|
618 |
+
*
|
619 |
+
* Renders rich editor fields.
|
620 |
+
*
|
621 |
+
* @since 1.0
|
622 |
+
* @param array $args Arguments passed by the setting
|
623 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
624 |
+
* @global $wp_version WordPress Version
|
625 |
+
*/
|
626 |
+
function popmake_rich_editor_callback( $args ) {
|
627 |
+
global $popmake_options, $wp_version;
|
628 |
+
|
629 |
+
if ( isset( $popmake_options[ $args['id'] ] ) ) {
|
630 |
+
$value = $popmake_options[ $args['id'] ];
|
631 |
+
} else {
|
632 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
633 |
+
}
|
634 |
+
|
635 |
+
$rows = isset( $args['size'] ) ? $args['size'] : 20;
|
636 |
+
|
637 |
+
if ( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
|
638 |
+
ob_start();
|
639 |
+
wp_editor( stripslashes( $value ), 'popmake_settings_' . $args['id'], array( 'textarea_name' => 'popmake_settings[' . $args['id'] . ']', 'textarea_rows' => $rows ) );
|
640 |
+
$html = ob_get_clean();
|
641 |
+
} else {
|
642 |
+
$html = '<textarea class="large-text" rows="10" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
|
643 |
+
}
|
644 |
+
|
645 |
+
$html .= '<br/><label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
646 |
+
|
647 |
+
echo $html;
|
648 |
+
}
|
649 |
+
|
650 |
+
/**
|
651 |
+
* Upload Callback
|
652 |
+
*
|
653 |
+
* Renders upload fields.
|
654 |
+
*
|
655 |
+
* @since 1.0
|
656 |
+
* @param array $args Arguments passed by the setting
|
657 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
658 |
+
* @return void
|
659 |
+
*/
|
660 |
+
function popmake_upload_callback( $args ) {
|
661 |
+
global $popmake_options;
|
662 |
+
|
663 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
664 |
+
$value = $popmake_options[$args['id']];
|
665 |
+
else
|
666 |
+
$value = isset($args['std']) ? $args['std'] : '';
|
667 |
+
|
668 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
669 |
+
$html = '<input type="text" class="' . $size . '-text" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
|
670 |
+
$html .= '<span> <input type="button" class="popmake_settings_upload_button button-secondary" value="' . __( 'Upload File', 'popup-maker' ) . '"/></span>';
|
671 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
672 |
+
|
673 |
+
echo $html;
|
674 |
+
}
|
675 |
+
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Color picker Callback
|
679 |
+
*
|
680 |
+
* Renders color picker fields.
|
681 |
+
*
|
682 |
+
* @since 1.0
|
683 |
+
* @param array $args Arguments passed by the setting
|
684 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
685 |
+
* @return void
|
686 |
+
*/
|
687 |
+
function popmake_color_callback( $args ) {
|
688 |
+
global $popmake_options;
|
689 |
+
|
690 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
691 |
+
$value = $popmake_options[ $args['id'] ];
|
692 |
+
else
|
693 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
694 |
+
|
695 |
+
$default = isset( $args['std'] ) ? $args['std'] : '';
|
696 |
+
|
697 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
698 |
+
$html = '<input type="text" class="popmake-color-picker" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
|
699 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
700 |
+
|
701 |
+
echo $html;
|
702 |
+
}
|
703 |
+
|
704 |
+
|
705 |
+
/**
|
706 |
+
* Descriptive text callback.
|
707 |
+
*
|
708 |
+
* Renders descriptive text onto the settings field.
|
709 |
+
*
|
710 |
+
* @since 1.0
|
711 |
+
* @param array $args Arguments passed by the setting
|
712 |
+
* @return void
|
713 |
+
*/
|
714 |
+
function popmake_descriptive_text_callback( $args ) {
|
715 |
+
echo esc_html( $args['desc'] );
|
716 |
+
}
|
717 |
+
|
718 |
+
/**
|
719 |
+
* Registers the license field callback for Software Licensing
|
720 |
+
*
|
721 |
+
* @since 1.0
|
722 |
+
* @param array $args Arguments passed by the setting
|
723 |
+
* @global $popmake_options Array of all the POPMAKE Options
|
724 |
+
* @return void
|
725 |
+
*/
|
726 |
+
if ( ! function_exists( 'popmake_license_key_callback' ) ) {
|
727 |
+
function popmake_license_key_callback( $args ) {
|
728 |
+
global $popmake_options;
|
729 |
+
|
730 |
+
if ( isset( $popmake_options[ $args['id'] ] ) )
|
731 |
+
$value = $popmake_options[ $args['id'] ];
|
732 |
+
else
|
733 |
+
$value = isset( $args['std'] ) ? $args['std'] : '';
|
734 |
+
|
735 |
+
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
736 |
+
|
737 |
+
$html = '<input type="'. ($value == '' ? 'text' : 'password') . '" class="' . $size . '-text" id="popmake_settings[' . $args['id'] . ']" name="popmake_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
|
738 |
+
|
739 |
+
if ( 'valid' == get_option( $args['options']['is_valid_license_option'] ) ) {
|
740 |
+
$html .= '<input type="submit" class="button-secondary" name="' . $args['id'] . '_deactivate" value="' . __( 'Deactivate License', 'popup-maker' ) . '"/>';
|
741 |
+
}
|
742 |
+
$html .= '<label for="popmake_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
|
743 |
+
|
744 |
+
echo $html;
|
745 |
+
}
|
746 |
+
}
|
747 |
+
|
748 |
+
|
749 |
+
function popmake_sanitize_license_key_field( $new, $key ) {
|
750 |
+
global $popmake_options;
|
751 |
+
$old = !empty($popmake_options[$key]) ? $popmake_options[$key] : null;
|
752 |
+
if( $old && $old != $new ) {
|
753 |
+
unset($popmake_options[$key]); // new license has been entered, so must reactivate
|
754 |
+
}
|
755 |
+
if($new != '')
|
756 |
+
{
|
757 |
+
if($old === null || $old == '')
|
758 |
+
{
|
759 |
+
$new = SHA1($new);
|
760 |
+
}
|
761 |
+
elseif($old && $old != $new && $old != SHA1($new))
|
762 |
+
{
|
763 |
+
$new = SHA1($new);
|
764 |
+
}
|
765 |
+
}
|
766 |
+
return $new;
|
767 |
+
}
|
768 |
+
//add_filter('popmake_settings_sanitize_license_key', 'popmake_sanitize_license_key_field', 10, 2);
|
769 |
+
|
770 |
+
/**
|
771 |
+
* Hook Callback
|
772 |
+
*
|
773 |
+
* Adds a do_action() hook in place of the field
|
774 |
+
*
|
775 |
+
* @since 1.0
|
776 |
+
* @param array $args Arguments passed by the setting
|
777 |
+
* @return void
|
778 |
+
*/
|
779 |
+
function popmake_hook_callback( $args ) {
|
780 |
+
do_action( 'popmake_' . $args['id'] );
|
781 |
+
}
|
includes/admin/settings/settings-page.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings Page
|
4 |
+
*
|
5 |
+
* Renders the settings page contents.
|
6 |
+
*
|
7 |
+
* @access private
|
8 |
+
* @since 1.0
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
function popmake_settings_page() {
|
12 |
+
global $popmake_options;
|
13 |
+
$active_tab = isset( $_GET[ 'tab' ] ) && array_key_exists( $_GET['tab'], popmake_get_settings_tabs() ) ? $_GET[ 'tab' ] : 'general';
|
14 |
+
ob_start();?>
|
15 |
+
<div class="wrap">
|
16 |
+
<h2><?php esc_html_e( __( 'Popup Maker Settings', 'popup-maker' ) );?></h2>
|
17 |
+
<h2 id="popmake-tabs" class="nav-tab-wrapper"><?php
|
18 |
+
foreach( popmake_get_settings_tabs() as $tab_id => $tab_name ) {
|
19 |
+
|
20 |
+
$tab_url = add_query_arg( array(
|
21 |
+
'settings-updated' => false,
|
22 |
+
'tab' => $tab_id
|
23 |
+
) );
|
24 |
+
|
25 |
+
$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
|
26 |
+
|
27 |
+
echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '">';
|
28 |
+
echo esc_html( $tab_name );
|
29 |
+
echo '</a>';
|
30 |
+
}?>
|
31 |
+
</h2>
|
32 |
+
<form id="popmake-settings-editor" method="post" action="options.php">
|
33 |
+
<?php do_action('popmake_form_nonce');?>
|
34 |
+
<div id="poststuff">
|
35 |
+
<div id="post-body" class="metabox-holder columns-2">
|
36 |
+
<div id="post-body-content">
|
37 |
+
<div id="tab_container">
|
38 |
+
<table class="form-table">
|
39 |
+
<?php
|
40 |
+
settings_fields( 'popmake_settings' );
|
41 |
+
do_settings_fields( 'popmake_settings_' . $active_tab, 'popmake_settings_' . $active_tab );
|
42 |
+
?>
|
43 |
+
</table>
|
44 |
+
<?php submit_button(); ?>
|
45 |
+
</div><!-- #tab_container-->
|
46 |
+
</div>
|
47 |
+
<div id="postbox-container-1" class="postbox-container">
|
48 |
+
<div class="postbox " id="submitdiv">
|
49 |
+
<h3 class="hndle"><span><?php _e( 'Save', 'popup-maker' );?></span></h3>
|
50 |
+
<div class="inside">
|
51 |
+
<div id="submitpost" class="submitbox">
|
52 |
+
<div id="major-publishing-actions" class="submitbox">
|
53 |
+
<div id="publishing-action">
|
54 |
+
<span class="spinner"></span>
|
55 |
+
<input type="submit" accesskey="p" value="<?php _e( 'Save', 'popup-maker' );?>" class="button button-primary button-large" id="publish" name="publish">
|
56 |
+
</div>
|
57 |
+
<div class="clear"></div>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<div class="clear"></div>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<div class="postbox " id="supportdiv">
|
64 |
+
<h3 class="hndle"><span><?php _e( 'Support', 'popup-maker' );?></span></h3>
|
65 |
+
<div class="inside">
|
66 |
+
<?php popmake_render_support_meta_box();?>
|
67 |
+
<div class="clear"></div>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
<div id="sharediv">
|
71 |
+
<div class="inside">
|
72 |
+
<?php popmake_render_share_meta_box();?>
|
73 |
+
<div class="clear"></div>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<?php do_action('popmake_admin_sidebar');?>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<br class="clear"/>
|
80 |
+
</div>
|
81 |
+
</form>
|
82 |
+
</div><?php
|
83 |
+
echo ob_get_clean();
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
//add_action('popmake_settings_page_licenses_tab_settings', 'popmake_settings_page_licenses_tab_access_key', 10);
|
88 |
+
function popmake_settings_page_licenses_tab_access_key() { ?>
|
89 |
+
<tr class="form-field">
|
90 |
+
<th scope="row">
|
91 |
+
<label for="access_key"><?php _e( 'Access Key', 'popup-maker' );?></label>
|
92 |
+
</th>
|
93 |
+
<td>
|
94 |
+
<input type="<?php echo popmake_get_option('access_key') ? 'password' : 'text'?>" id="access_key" name="access_key" value="<?php esc_attr_e(popmake_get_option('access_key'))?>" class="regular-text"/>
|
95 |
+
<p class="description"><?php _e( 'Enter your access key to unlock extensions.', 'popup-maker' )?></p>
|
96 |
+
</td>
|
97 |
+
</tr><?php
|
98 |
+
}
|
includes/admin/themes/metabox-close-fields.php
ADDED
@@ -0,0 +1,556 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_description', 0);
|
3 |
+
function popmake_popup_theme_close_meta_box_field_description( $popup_theme_id )
|
4 |
+
{
|
5 |
+
?></tbody></table><p><?php _e( 'Theme the close button for the popups.', 'popup-maker' ); ?></p><table class="form-table"><tbody><?php
|
6 |
+
}
|
7 |
+
|
8 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_text', 10);
|
9 |
+
function popmake_popup_theme_close_meta_box_field_text( $popup_theme_id )
|
10 |
+
{
|
11 |
+
?><tr>
|
12 |
+
<th scope="row">
|
13 |
+
<label for="popup_theme_close_text"><?php _e( 'Text', 'popup-maker' );?></label>
|
14 |
+
</th>
|
15 |
+
<td>
|
16 |
+
<input type="text" name="popup_theme_close_text" id="popup_theme_close_text" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'text' ))?>" />
|
17 |
+
<p class="description"><?php _e( 'Enter the close button text.', 'popup-maker' )?></p>
|
18 |
+
</td>
|
19 |
+
</tr><?php
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_padding', 20);
|
24 |
+
function popmake_popup_theme_close_meta_box_field_padding( $popup_theme_id )
|
25 |
+
{
|
26 |
+
?><tr>
|
27 |
+
<th scope="row">
|
28 |
+
<label for="popup_theme_close_padding"><?php _e( 'Padding', 'popup-maker' );?></label>
|
29 |
+
</th>
|
30 |
+
<td>
|
31 |
+
<input type="text" readonly
|
32 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'padding' ))?>"
|
33 |
+
name="popup_theme_close_padding"
|
34 |
+
id="popup_theme_close_padding"
|
35 |
+
class="popmake-range-manual"
|
36 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_padding', 1));?>"
|
37 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_padding', 0));?>"
|
38 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_padding', 100));?>"
|
39 |
+
/>
|
40 |
+
<span class="range-value-unit regular-text">px</span>
|
41 |
+
</td>
|
42 |
+
</tr><?php
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_location', 30);
|
47 |
+
function popmake_popup_theme_close_meta_box_field_location( $popup_theme_id )
|
48 |
+
{
|
49 |
+
?><tr>
|
50 |
+
<th scope="row">
|
51 |
+
<label for="popup_theme_close_location"><?php _e( 'Location', 'popup-maker' );?></label>
|
52 |
+
</th>
|
53 |
+
<td>
|
54 |
+
<select name="popup_theme_close_location" id="popup_theme_close_location">
|
55 |
+
<?php foreach(apply_filters('popmake_theme_close_location_options', array()) as $option => $value) : ?>
|
56 |
+
<option
|
57 |
+
value="<?php echo $value;?>"
|
58 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'location' ) ? ' selected="selected"' : '';?>
|
59 |
+
><?php echo $option;?></option>
|
60 |
+
<?php endforeach ?>
|
61 |
+
</select>
|
62 |
+
<p class="description"><?php _e( 'Choose which corner the close button will be positioned.', 'popup-maker' )?></p>
|
63 |
+
</td>
|
64 |
+
</tr>
|
65 |
+
<tr class="title-divider">
|
66 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Position', 'popup-maker' );?></h3></th>
|
67 |
+
</tr>
|
68 |
+
<tr class="topright topleft">
|
69 |
+
<th scope="row">
|
70 |
+
<label for="popup_theme_close_position_top"><?php _e( 'Top', 'popup-maker' );?></label>
|
71 |
+
</th>
|
72 |
+
<td>
|
73 |
+
<input type="text" readonly
|
74 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'position_top' ))?>"
|
75 |
+
name="popup_theme_close_position_top"
|
76 |
+
id="popup_theme_close_position_top"
|
77 |
+
class="popmake-range-manual"
|
78 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_position_offset', 1));?>"
|
79 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_position_offset', -100));?>"
|
80 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_position_offset', 100));?>"
|
81 |
+
/>
|
82 |
+
<span class="range-value-unit regular-text">px</span>
|
83 |
+
</td>
|
84 |
+
</tr>
|
85 |
+
<tr class="topleft bottomleft">
|
86 |
+
<th scope="row">
|
87 |
+
<label for="popup_theme_close_position_left"><?php _e( 'Left', 'popup-maker' );?></label>
|
88 |
+
</th>
|
89 |
+
<td>
|
90 |
+
<input type="text" readonly
|
91 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'position_left' ))?>"
|
92 |
+
name="popup_theme_close_position_left"
|
93 |
+
id="popup_theme_close_position_left"
|
94 |
+
class="popmake-range-manual"
|
95 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_position_offset', 1));?>"
|
96 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_position_offset', -100));?>"
|
97 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_position_offset', 100));?>"
|
98 |
+
/>
|
99 |
+
<span class="range-value-unit regular-text">px</span>
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
+
<tr class="bottomleft bottomright">
|
103 |
+
<th scope="row">
|
104 |
+
<label for="popup_theme_close_position_bottom"><?php _e( 'Bottom', 'popup-maker' );?></label>
|
105 |
+
</th>
|
106 |
+
<td>
|
107 |
+
<input type="text" readonly
|
108 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'position_bottom' ))?>"
|
109 |
+
name="popup_theme_close_position_bottom"
|
110 |
+
id="popup_theme_close_position_bottom"
|
111 |
+
class="popmake-range-manual"
|
112 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_position_offset', 1));?>"
|
113 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_position_offset', -100));?>"
|
114 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_position_offset', 100));?>"
|
115 |
+
/>
|
116 |
+
<span class="range-value-unit regular-text">px</span>
|
117 |
+
</td>
|
118 |
+
</tr>
|
119 |
+
<tr class="topright bottomright">
|
120 |
+
<th scope="row">
|
121 |
+
<label for="popup_theme_close_position_right"><?php _e( 'Right', 'popup-maker' );?></label>
|
122 |
+
</th>
|
123 |
+
<td>
|
124 |
+
<input type="text" readonly
|
125 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'position_right' ))?>"
|
126 |
+
name="popup_theme_close_position_right"
|
127 |
+
id="popup_theme_close_position_right"
|
128 |
+
class="popmake-range-manual"
|
129 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_position_offset', 1));?>"
|
130 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_position_offset', -100));?>"
|
131 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_position_offset', 100));?>"
|
132 |
+
/>
|
133 |
+
<span class="range-value-unit regular-text">px</span>
|
134 |
+
</td>
|
135 |
+
</tr><?php
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_font', 40);
|
141 |
+
function popmake_popup_theme_close_meta_box_field_font( $popup_theme_id )
|
142 |
+
{
|
143 |
+
?><tr class="title-divider">
|
144 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Font', 'popup-maker' );?></h3></th>
|
145 |
+
</tr>
|
146 |
+
<tr>
|
147 |
+
<th scope="row">
|
148 |
+
<label for="popup_theme_close_font_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
149 |
+
</th>
|
150 |
+
<td>
|
151 |
+
<input type="text" name="popup_theme_close_font_color" id="popup_theme_close_font_color" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'font_color' ))?>" class="color-picker" />
|
152 |
+
</td>
|
153 |
+
</tr>
|
154 |
+
|
155 |
+
<tr>
|
156 |
+
<th scope="row">
|
157 |
+
<label for="popup_theme_close_font_size"><?php _e( 'Size', 'popup-maker' );?></label>
|
158 |
+
</th>
|
159 |
+
<td>
|
160 |
+
<input type="text" readonly
|
161 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'font_size' ))?>"
|
162 |
+
name="popup_theme_close_font_size"
|
163 |
+
id="popup_theme_close_font_size"
|
164 |
+
class="popmake-range-manual"
|
165 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_font_size', 1));?>"
|
166 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_font_size', 8));?>"
|
167 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_font_size', 32));?>"
|
168 |
+
/>
|
169 |
+
<span class="range-value-unit regular-text">px</span>
|
170 |
+
</td>
|
171 |
+
</tr>
|
172 |
+
<tr>
|
173 |
+
<th scope="row">
|
174 |
+
<label for="popup_theme_close_line_height"><?php _e( 'Line Height', 'popup-maker' );?></label>
|
175 |
+
</th>
|
176 |
+
<td>
|
177 |
+
<input type="text" readonly
|
178 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'line_height' ))?>"
|
179 |
+
name="popup_theme_close_line_height"
|
180 |
+
id="popup_theme_close_line_height"
|
181 |
+
class="popmake-range-manual"
|
182 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_line_height', 1));?>"
|
183 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_line_height', 8));?>"
|
184 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_line_height', 32));?>"
|
185 |
+
/>
|
186 |
+
<span class="range-value-unit regular-text">px</span>
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
<tr>
|
190 |
+
<th scope="row">
|
191 |
+
<label for="popup_theme_close_font_family"><?php _e( 'Family', 'popup-maker' );?></label>
|
192 |
+
</th>
|
193 |
+
<td>
|
194 |
+
<select name="popup_theme_close_font_family" id="popup_theme_close_font_family" class="font-family">
|
195 |
+
<?php foreach(apply_filters('popmake_font_family_options', array()) as $option => $value) : ?>
|
196 |
+
<option
|
197 |
+
value="<?php echo $value;?>"
|
198 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'font_family' ) ? ' selected="selected"' : '';?>
|
199 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
200 |
+
><?php echo $option;?></option>
|
201 |
+
<?php endforeach ?>
|
202 |
+
</select>
|
203 |
+
</td>
|
204 |
+
</tr>
|
205 |
+
<tr>
|
206 |
+
<th scope="row">
|
207 |
+
<label for="popup_theme_close_font_weight"><?php _e( 'Weight', 'popup-maker' );?></label>
|
208 |
+
</th>
|
209 |
+
<td>
|
210 |
+
<select name="popup_theme_close_font_weight" id="popup_theme_close_font_weight" class="font-weight">
|
211 |
+
<?php foreach(apply_filters('popmake_font_weight_options', array()) as $option => $value) : ?>
|
212 |
+
<option
|
213 |
+
value="<?php echo $value;?>"
|
214 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'font_weight') ? ' selected="selected"' : '';?>
|
215 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
216 |
+
><?php echo $option;?></option>
|
217 |
+
<?php endforeach ?>
|
218 |
+
</select>
|
219 |
+
</td>
|
220 |
+
</tr>
|
221 |
+
<tr>
|
222 |
+
<th scope="row font-style-only">
|
223 |
+
<label for="popup_theme_close_font_style"><?php _e( 'Style', 'popup-maker' );?></label>
|
224 |
+
</th>
|
225 |
+
<td>
|
226 |
+
<select name="popup_theme_close_font_style" id="popup_theme_close_font_style" class="font-style">
|
227 |
+
<?php foreach(apply_filters('popmake_font_style_options', array()) as $option => $value) : ?>
|
228 |
+
<option
|
229 |
+
value="<?php echo $value;?>"
|
230 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'font_style') ? ' selected="selected"' : '';?>
|
231 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
232 |
+
><?php echo $option;?></option>
|
233 |
+
<?php endforeach ?>
|
234 |
+
</select>
|
235 |
+
</td>
|
236 |
+
</tr><?php
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_background', 50);
|
241 |
+
function popmake_popup_theme_close_meta_box_field_background( $popup_theme_id )
|
242 |
+
{
|
243 |
+
?><tr class="title-divider">
|
244 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Background', 'popup-maker' );?></ h3></th>
|
245 |
+
</tr>
|
246 |
+
<tr>
|
247 |
+
<th scope="row">
|
248 |
+
<label for="popup_theme_close_background_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
249 |
+
</th>
|
250 |
+
<td>
|
251 |
+
<input type="text" name="popup_theme_close_background_color" id="popup_theme_close_background_color" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'background_color' ))?>" class="color-picker background-color" />
|
252 |
+
</td>
|
253 |
+
</tr>
|
254 |
+
<tr class="background-opacity">
|
255 |
+
<th scope="row">
|
256 |
+
<label for="popup_theme_close_background_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
257 |
+
</th>
|
258 |
+
<td>
|
259 |
+
<input type="text" readonly
|
260 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'background_opacity' ))?>"
|
261 |
+
name="popup_theme_close_background_opacity"
|
262 |
+
id="popup_theme_close_background_opacity"
|
263 |
+
class="popmake-range-manual"
|
264 |
+
step="1"
|
265 |
+
min="0"
|
266 |
+
max="100"
|
267 |
+
data-force-minmax=true
|
268 |
+
/>
|
269 |
+
<span class="range-value-unit regular-text">%</span>
|
270 |
+
</td>
|
271 |
+
</tr><?php
|
272 |
+
}
|
273 |
+
|
274 |
+
|
275 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_atb_extension_promotion', 60);
|
276 |
+
function popmake_popup_theme_close_meta_box_field_atb_extension_promotion( $popup_theme_id ) { ?>
|
277 |
+
<tr>
|
278 |
+
<th colspan="2" class="pro-upgrade-tip">
|
279 |
+
<img style="" src="<?php echo POPMAKE_URL;?>/assets/images/admin/icon-info-21x21.png"/> <?php _e( 'Wanna use background images?', 'popup-maker' ); ?> <a href="https://wppopupmaker.com/extensions/advanced-theme-builder" target="_blank"><?php _e( 'Check out Advanced Theme Builder!', 'popup-maker' ); ?></a>.
|
280 |
+
</th>
|
281 |
+
</tr><?php
|
282 |
+
}
|
283 |
+
|
284 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_border', 70);
|
285 |
+
function popmake_popup_theme_close_meta_box_field_border( $popup_theme_id )
|
286 |
+
{
|
287 |
+
?><tr class="title-divider">
|
288 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Border', 'popup-maker' );?></h3></th>
|
289 |
+
</tr>
|
290 |
+
<tr>
|
291 |
+
<th scope="row">
|
292 |
+
<label for="popup_theme_close_border_radius"><?php _e( 'Radius', 'popup-maker' );?></label>
|
293 |
+
</th>
|
294 |
+
<td>
|
295 |
+
<input type="text" readonly
|
296 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'border_radius' ))?>"
|
297 |
+
name="popup_theme_close_border_radius"
|
298 |
+
id="popup_theme_close_border_radius"
|
299 |
+
class="popmake-range-manual"
|
300 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_border_radius', 1));?>"
|
301 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_border_radius', 0));?>"
|
302 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_border_radius', 28));?>"
|
303 |
+
/>
|
304 |
+
<span class="range-value-unit regular-text">px</span>
|
305 |
+
<p class="description"><?php _e( 'Choose a corner radius for your close button.',POPMAKE_SLUG)?></p>
|
306 |
+
</td>
|
307 |
+
</tr>
|
308 |
+
<tr>
|
309 |
+
<th scope="row">
|
310 |
+
<label for="popup_theme_close_border_style"><?php _e( 'Style', 'popup-maker' );?></label>
|
311 |
+
</th>
|
312 |
+
<td>
|
313 |
+
<select name="popup_theme_close_border_style" id="popup_theme_close_border_style" class="border-style">
|
314 |
+
<?php foreach(apply_filters('popmake_border_style_options', array()) as $option => $value) : ?>
|
315 |
+
<option
|
316 |
+
value="<?php echo $value;?>"
|
317 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'border_style' ) ? ' selected="selected"' : '';?>
|
318 |
+
><?php echo $option;?></option>
|
319 |
+
<?php endforeach ?>
|
320 |
+
</select>
|
321 |
+
<p class="description"><?php _e( 'Choose a border style for your close button.', 'popup-maker' )?></p>
|
322 |
+
</td>
|
323 |
+
</tr>
|
324 |
+
<tr class="border-options">
|
325 |
+
<th scope="row">
|
326 |
+
<label for="popup_theme_close_border_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
327 |
+
</th>
|
328 |
+
<td>
|
329 |
+
<input type="text" name="popup_theme_close_border_color" id="popup_theme_close_border_color" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'border_color' ))?>" class="color-picker" />
|
330 |
+
</td>
|
331 |
+
</tr>
|
332 |
+
<tr class="border-options">
|
333 |
+
<th scope="row">
|
334 |
+
<label for="popup_theme_close_border_width"><?php _e( 'Thickness', 'popup-maker' );?></label>
|
335 |
+
</th>
|
336 |
+
<td>
|
337 |
+
<input type="text" readonly
|
338 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'border_width' ))?>"
|
339 |
+
name="popup_theme_close_border_width"
|
340 |
+
id="popup_theme_close_border_width"
|
341 |
+
class="popmake-range-manual"
|
342 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_border_width', 1));?>"
|
343 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_border_width', 0));?>"
|
344 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_border_width', 10));?>"
|
345 |
+
/>
|
346 |
+
<span class="range-value-unit regular-text">px</span>
|
347 |
+
</td>
|
348 |
+
</tr><?php
|
349 |
+
}
|
350 |
+
|
351 |
+
|
352 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_boxshadow', 80);
|
353 |
+
function popmake_popup_theme_close_meta_box_field_boxshadow( $popup_theme_id )
|
354 |
+
{
|
355 |
+
?><tr class="title-divider">
|
356 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Drop Shadow', 'popup-maker' );?></h3></th>
|
357 |
+
</tr>
|
358 |
+
<tr>
|
359 |
+
<th scope="row">
|
360 |
+
<label for="popup_theme_close_boxshadow_inset"><?php _e( 'Inset', 'popup-maker' );?></label>
|
361 |
+
</th>
|
362 |
+
<td>
|
363 |
+
<select name="popup_theme_close_boxshadow_inset" id="popup_theme_close_boxshadow_inset">
|
364 |
+
<?php foreach(array(
|
365 |
+
__('No', 'popup-maker' ) => 'no',
|
366 |
+
__('Yes', 'popup-maker' ) => 'yes'
|
367 |
+
) as $option => $value) : ?>
|
368 |
+
<option
|
369 |
+
value="<?php echo $value;?>"
|
370 |
+
<?php echo $value == popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_inset' ) ? ' selected="selected"' : '';?>
|
371 |
+
><?php echo $option;?></option>
|
372 |
+
<?php endforeach ?>
|
373 |
+
</select>
|
374 |
+
<p class="description"><?php _e( 'Set the box shadow to inset (inner shadow).', 'popup-maker' )?></p>
|
375 |
+
</td>
|
376 |
+
</tr>
|
377 |
+
<tr>
|
378 |
+
<th scope="row">
|
379 |
+
<label for="popup_theme_close_boxshadow_horizontal"><?php _e( 'Horizontal Position', 'popup-maker' );?></label>
|
380 |
+
</th>
|
381 |
+
<td>
|
382 |
+
<input type="text" readonly
|
383 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_horizontal' ))?>"
|
384 |
+
name="popup_theme_close_boxshadow_horizontal"
|
385 |
+
id="popup_theme_close_boxshadow_horizontal"
|
386 |
+
class="popmake-range-manual"
|
387 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_boxshadow_horizontal', 1));?>"
|
388 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_boxshadow_horizontal', -50));?>"
|
389 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_boxshadow_horizontal', 50));?>"
|
390 |
+
/>
|
391 |
+
<span class="range-value-unit regular-text">px</span>
|
392 |
+
</td>
|
393 |
+
</tr>
|
394 |
+
<tr>
|
395 |
+
<th scope="row">
|
396 |
+
<label for="popup_theme_close_boxshadow_vertical"><?php _e( 'Vertical Position', 'popup-maker' );?></label>
|
397 |
+
</th>
|
398 |
+
<td>
|
399 |
+
<input type="text" readonly
|
400 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_vertical' ))?>"
|
401 |
+
name="popup_theme_close_boxshadow_vertical"
|
402 |
+
id="popup_theme_close_boxshadow_vertical"
|
403 |
+
class="popmake-range-manual"
|
404 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_boxshadow_vertical', 1));?>"
|
405 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_boxshadow_vertical', -50));?>"
|
406 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_boxshadow_vertical', 50));?>"
|
407 |
+
/>
|
408 |
+
<span class="range-value-unit regular-text">px</span>
|
409 |
+
</td>
|
410 |
+
</tr>
|
411 |
+
<tr>
|
412 |
+
<th scope="row">
|
413 |
+
<label for="popup_theme_close_boxshadow_blur"><?php _e( 'Blur Radius', 'popup-maker' );?></label>
|
414 |
+
</th>
|
415 |
+
<td>
|
416 |
+
<input type="text" readonly
|
417 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_blur' ))?>"
|
418 |
+
name="popup_theme_close_boxshadow_blur"
|
419 |
+
id="popup_theme_close_boxshadow_blur"
|
420 |
+
class="popmake-range-manual"
|
421 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_boxshadow_blur', 1));?>"
|
422 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_boxshadow_blur', 0));?>"
|
423 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_boxshadow_blur', 100));?>"
|
424 |
+
/>
|
425 |
+
<span class="range-value-unit regular-text">px</span>
|
426 |
+
</td>
|
427 |
+
</tr>
|
428 |
+
<tr>
|
429 |
+
<th scope="row">
|
430 |
+
<label for="popup_theme_close_boxshadow_spread"><?php _e( 'Spread', 'popup-maker' );?></label>
|
431 |
+
</th>
|
432 |
+
<td>
|
433 |
+
<input type="text" readonly
|
434 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_spread' ))?>"
|
435 |
+
name="popup_theme_close_boxshadow_spread"
|
436 |
+
id="popup_theme_close_boxshadow_spread"
|
437 |
+
class="popmake-range-manual"
|
438 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_boxshadow_spread', 1));?>"
|
439 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_boxshadow_spread', 0));?>"
|
440 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_boxshadow_spread', 100));?>"
|
441 |
+
/>
|
442 |
+
<span class="range-value-unit regular-text">px</span>
|
443 |
+
</td>
|
444 |
+
</tr>
|
445 |
+
<tr>
|
446 |
+
<th scope="row">
|
447 |
+
<label for="popup_theme_close_boxshadow_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
448 |
+
</th>
|
449 |
+
<td>
|
450 |
+
<input type="text" name="popup_theme_close_boxshadow_color" id="popup_theme_close_boxshadow_color" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_color' ))?>" class="color-picker boxshadow-color" />
|
451 |
+
</td>
|
452 |
+
</tr>
|
453 |
+
<tr>
|
454 |
+
<th scope="row">
|
455 |
+
<label for="popup_theme_close_boxshadow_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
456 |
+
</th>
|
457 |
+
<td>
|
458 |
+
<input type="text" readonly
|
459 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'boxshadow_opacity' ))?>"
|
460 |
+
name="popup_theme_close_boxshadow_opacity"
|
461 |
+
id="popup_theme_close_boxshadow_opacity"
|
462 |
+
class="popmake-range-manual"
|
463 |
+
step="1"
|
464 |
+
min="0"
|
465 |
+
max="100"
|
466 |
+
data-force-minmax=true
|
467 |
+
/>
|
468 |
+
<span class="range-value-unit regular-text">%</span>
|
469 |
+
</td>
|
470 |
+
</tr><?php
|
471 |
+
}
|
472 |
+
|
473 |
+
add_action('popmake_popup_theme_close_meta_box_fields', 'popmake_popup_theme_close_meta_box_field_textshadow', 90);
|
474 |
+
function popmake_popup_theme_close_meta_box_field_textshadow( $popup_theme_id )
|
475 |
+
{
|
476 |
+
?><tr class="title-divider">
|
477 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Text Shadow', 'popup-maker' );?></h3></th>
|
478 |
+
</tr>
|
479 |
+
<tr>
|
480 |
+
<th scope="row">
|
481 |
+
<label for="popup_theme_close_textshadow_horizontal"><?php _e( 'Horizontal Position', 'popup-maker' );?></label>
|
482 |
+
</th>
|
483 |
+
<td>
|
484 |
+
<input type="text" readonly
|
485 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'textshadow_horizontal' ))?>"
|
486 |
+
name="popup_theme_close_textshadow_horizontal"
|
487 |
+
id="popup_theme_close_textshadow_horizontal"
|
488 |
+
class="popmake-range-manual"
|
489 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_textshadow_horizontal', 1));?>"
|
490 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_textshadow_horizontal', -50));?>"
|
491 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_textshadow_horizontal', 50));?>"
|
492 |
+
/>
|
493 |
+
<span class="range-value-unit regular-text">px</span>
|
494 |
+
</td>
|
495 |
+
</tr>
|
496 |
+
<tr>
|
497 |
+
<th scope="row">
|
498 |
+
<label for="popup_theme_close_textshadow_vertical"><?php _e( 'Vertical Position', 'popup-maker' );?></label>
|
499 |
+
</th>
|
500 |
+
<td>
|
501 |
+
<input type="text" readonly
|
502 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'textshadow_vertical' ))?>"
|
503 |
+
name="popup_theme_close_textshadow_vertical"
|
504 |
+
id="popup_theme_close_textshadow_vertical"
|
505 |
+
class="popmake-range-manual"
|
506 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_textshadow_vertical', 1));?>"
|
507 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_textshadow_vertical', -50));?>"
|
508 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_textshadow_vertical', 50));?>"
|
509 |
+
/>
|
510 |
+
<span class="range-value-unit regular-text">px</span>
|
511 |
+
</td>
|
512 |
+
</tr>
|
513 |
+
<tr>
|
514 |
+
<th scope="row">
|
515 |
+
<label for="popup_theme_close_textshadow_blur"><?php _e( 'Blur Radius', 'popup-maker' );?></label>
|
516 |
+
</th>
|
517 |
+
<td>
|
518 |
+
<input type="text" readonly
|
519 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'textshadow_blur' ))?>"
|
520 |
+
name="popup_theme_close_textshadow_blur"
|
521 |
+
id="popup_theme_close_textshadow_blur"
|
522 |
+
class="popmake-range-manual"
|
523 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_close_textshadow_blur', 1));?>"
|
524 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_close_textshadow_blur', 0));?>"
|
525 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_close_textshadow_blur', 100));?>"
|
526 |
+
/>
|
527 |
+
<span class="range-value-unit regular-text">px</span>
|
528 |
+
</td>
|
529 |
+
</tr>
|
530 |
+
<tr>
|
531 |
+
<th scope="row">
|
532 |
+
<label for="popup_theme_close_textshadow_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
533 |
+
</th>
|
534 |
+
<td>
|
535 |
+
<input type="text" name="popup_theme_close_textshadow_color" id="popup_theme_close_textshadow_color" value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'textshadow_color' ))?>" class="color-picker textshadow-color" />
|
536 |
+
</td>
|
537 |
+
</tr>
|
538 |
+
<tr>
|
539 |
+
<th scope="row">
|
540 |
+
<label for="popup_theme_close_textshadow_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
541 |
+
</th>
|
542 |
+
<td>
|
543 |
+
<input type="text" readonly
|
544 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_close( $popup_theme_id, 'textshadow_opacity' ))?>"
|
545 |
+
name="popup_theme_close_textshadow_opacity"
|
546 |
+
id="popup_theme_close_textshadow_opacity"
|
547 |
+
class="popmake-range-manual"
|
548 |
+
step="1"
|
549 |
+
min="0"
|
550 |
+
max="100"
|
551 |
+
data-force-minmax=true
|
552 |
+
/>
|
553 |
+
<span class="range-value-unit regular-text">%</span>
|
554 |
+
</td>
|
555 |
+
</tr><?php
|
556 |
+
}
|
includes/admin/themes/metabox-container-fields.php
ADDED
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_description', 0);
|
3 |
+
function popmake_popup_theme_container_meta_box_field_description( $popup_theme_id )
|
4 |
+
{
|
5 |
+
?></tbody></table><p><?php _e( 'Theme the container inside the popups.', 'popup-maker' ); ?></p><table class="form-table"><tbody><?php
|
6 |
+
}
|
7 |
+
|
8 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_padding', 10);
|
9 |
+
function popmake_popup_theme_container_meta_box_field_padding( $popup_theme_id )
|
10 |
+
{
|
11 |
+
?><tr>
|
12 |
+
<th scope="row">
|
13 |
+
<label for="popup_theme_container_padding"><?php _e( 'Padding', 'popup-maker' );?></label>
|
14 |
+
</th>
|
15 |
+
<td>
|
16 |
+
<input type="text" readonly
|
17 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'padding' ))?>"
|
18 |
+
name="popup_theme_container_padding"
|
19 |
+
id="popup_theme_container_padding"
|
20 |
+
class="popmake-range-manual"
|
21 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_padding', 1));?>"
|
22 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_padding', 0));?>"
|
23 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_padding', 100));?>"
|
24 |
+
/>
|
25 |
+
<span class="range-value-unit regular-text">px</span>
|
26 |
+
</td>
|
27 |
+
</tr><?php
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_background', 20);
|
32 |
+
function popmake_popup_theme_container_meta_box_field_background( $popup_theme_id )
|
33 |
+
{
|
34 |
+
?><tr class="title-divider">
|
35 |
+
<th colspan="2">
|
36 |
+
<h3 class="title"><?php _e( 'Background', 'popup-maker' );?></h3></th>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<th scope="row">
|
40 |
+
<label for="popup_theme_container_background_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
41 |
+
</th>
|
42 |
+
<td>
|
43 |
+
<input type="text" name="popup_theme_container_background_color" id="popup_theme_container_background_color" value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'background_color' ))?>" class="color-picker background-color" />
|
44 |
+
</td>
|
45 |
+
</tr>
|
46 |
+
<tr class="background-opacity">
|
47 |
+
<th scope="row">
|
48 |
+
<label for="popup_theme_container_background_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
49 |
+
</th>
|
50 |
+
<td>
|
51 |
+
<input type="text" readonly
|
52 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'background_opacity' ))?>"
|
53 |
+
name="popup_theme_container_background_opacity"
|
54 |
+
id="popup_theme_container_background_opacity"
|
55 |
+
class="popmake-range-manual"
|
56 |
+
step="1"
|
57 |
+
min="0"
|
58 |
+
max="100"
|
59 |
+
data-force-minmax=true
|
60 |
+
/>
|
61 |
+
<span class="range-value-unit regular-text">%</span>
|
62 |
+
</td>
|
63 |
+
</tr><?php
|
64 |
+
}
|
65 |
+
|
66 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_atb_extension_promotion', 30);
|
67 |
+
function popmake_popup_theme_container_meta_box_field_atb_extension_promotion( $popup_theme_id ) { ?>
|
68 |
+
<tr>
|
69 |
+
<th colspan="2" class="pro-upgrade-tip">
|
70 |
+
<img style="" src="<?php echo POPMAKE_URL;?>/assets/images/admin/icon-info-21x21.png"/> <?php _e( 'Wanna use background images?', 'popup-maker' ); ?> <a href="https://wppopupmaker.com/extensions/advanced-theme-builder" target="_blank"><?php _e( 'Check out Advanced Theme Builder!', 'popup-maker' ); ?></a>.
|
71 |
+
</th>
|
72 |
+
</tr><?php
|
73 |
+
}
|
74 |
+
|
75 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_border', 40);
|
76 |
+
function popmake_popup_theme_container_meta_box_field_border( $popup_theme_id )
|
77 |
+
{
|
78 |
+
?><tr class="title-divider">
|
79 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Border', 'popup-maker' );?></h3></th>
|
80 |
+
</tr>
|
81 |
+
<tr>
|
82 |
+
<th scope="row">
|
83 |
+
<label for="popup_theme_container_border_radius"><?php _e( 'Radius', 'popup-maker' );?></label>
|
84 |
+
</th>
|
85 |
+
<td>
|
86 |
+
<input type="text" readonly
|
87 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'border_radius' ))?>"
|
88 |
+
name="popup_theme_container_border_radius"
|
89 |
+
id="popup_theme_container_border_radius"
|
90 |
+
class="popmake-range-manual"
|
91 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_border_radius', 1));?>"
|
92 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_border_radius', 0));?>"
|
93 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_border_radius', 80));?>"
|
94 |
+
/>
|
95 |
+
<span class="range-value-unit regular-text">px</span>
|
96 |
+
<p class="description"><?php _e('Choose a corner radius for your container button.', 'popup-maker' )?></p>
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
<tr>
|
100 |
+
<th scope="row">
|
101 |
+
<label for="popup_theme_container_border_style"><?php _e( 'Style', 'popup-maker' );?></label>
|
102 |
+
</th>
|
103 |
+
<td>
|
104 |
+
<select name="popup_theme_container_border_style" id="popup_theme_container_border_style" class="border-style">
|
105 |
+
<?php foreach(apply_filters('popmake_border_style_options', array()) as $option => $value) : ?>
|
106 |
+
<option
|
107 |
+
value="<?php echo $value;?>"
|
108 |
+
<?php echo $value == popmake_get_popup_theme_container( $popup_theme_id, 'border_style') ? ' selected="selected"' : '';?>
|
109 |
+
><?php echo $option;?></option>
|
110 |
+
<?php endforeach ?>
|
111 |
+
</select>
|
112 |
+
<p class="description"><?php _e( 'Choose a border style for your container button.', 'popup-maker' )?></p>
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
<tr class="border-options">
|
116 |
+
<th scope="row">
|
117 |
+
<label for="popup_theme_container_border_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
118 |
+
</th>
|
119 |
+
<td>
|
120 |
+
<input type="text" name="popup_theme_container_border_color" id="popup_theme_container_border_color" value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'border_color'))?>" class="color-picker" />
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
<tr class="border-options">
|
124 |
+
<th scope="row">
|
125 |
+
<label for="popup_theme_container_border_width"><?php _e( 'Thickness', 'popup-maker' );?></label>
|
126 |
+
</th>
|
127 |
+
<td>
|
128 |
+
<input type="text" readonly
|
129 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'border_width' ))?>"
|
130 |
+
name="popup_theme_container_border_width"
|
131 |
+
id="popup_theme_container_border_width"
|
132 |
+
class="popmake-range-manual"
|
133 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_border_width', 1));?>"
|
134 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_border_width', 0));?>"
|
135 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_border_width', 5));?>"
|
136 |
+
/>
|
137 |
+
<span class="range-value-unit regular-text">px</span>
|
138 |
+
</td>
|
139 |
+
</tr><?php
|
140 |
+
}
|
141 |
+
|
142 |
+
add_action('popmake_popup_theme_container_meta_box_fields', 'popmake_popup_theme_container_meta_box_field_boxshadow', 50);
|
143 |
+
function popmake_popup_theme_container_meta_box_field_boxshadow( $popup_theme_id )
|
144 |
+
{
|
145 |
+
?><tr class="title-divider">
|
146 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Drop Shadow', 'popup-maker' );?></h3></th>
|
147 |
+
</tr>
|
148 |
+
<tr>
|
149 |
+
<th scope="row">
|
150 |
+
<label for="popup_theme_container_boxshadow_inset"><?php _e( 'Inset', 'popup-maker' );?></label>
|
151 |
+
</th>
|
152 |
+
<td>
|
153 |
+
<select name="popup_theme_container_boxshadow_inset" id="popup_theme_container_boxshadow_inset">
|
154 |
+
<?php foreach(array(
|
155 |
+
__('No', 'popup-maker' ) => 'no',
|
156 |
+
__('Yes', 'popup-maker' ) => 'yes'
|
157 |
+
) as $option => $value) : ?>
|
158 |
+
<option
|
159 |
+
value="<?php echo $value;?>"
|
160 |
+
<?php echo $value == popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_inset') ? ' selected="selected"' : '';?>
|
161 |
+
><?php echo $option;?></option>
|
162 |
+
<?php endforeach ?>
|
163 |
+
</select>
|
164 |
+
<p class="description"><?php _e( 'Set the box shadow to inset (inner shadow).', 'popup-maker' )?></p>
|
165 |
+
</td>
|
166 |
+
</tr>
|
167 |
+
<tr>
|
168 |
+
<th scope="row">
|
169 |
+
<label for="popup_theme_container_boxshadow_horizontal"><?php _e( 'Horizontal Position', 'popup-maker' );?></label>
|
170 |
+
</th>
|
171 |
+
<td>
|
172 |
+
<input type="text" readonly
|
173 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_horizontal' ))?>"
|
174 |
+
name="popup_theme_container_boxshadow_horizontal"
|
175 |
+
id="popup_theme_container_boxshadow_horizontal"
|
176 |
+
class="popmake-range-manual"
|
177 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_boxshadow_horizontal', 1));?>"
|
178 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_boxshadow_horizontal', -50));?>"
|
179 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_boxshadow_horizontal', 50));?>"
|
180 |
+
/>
|
181 |
+
<span class="range-value-unit regular-text">px</span>
|
182 |
+
</td>
|
183 |
+
</tr>
|
184 |
+
<tr>
|
185 |
+
<th scope="row">
|
186 |
+
<label for="popup_theme_container_boxshadow_vertical"><?php _e( 'Vertical Position', 'popup-maker' );?></label>
|
187 |
+
</th>
|
188 |
+
<td>
|
189 |
+
<input type="text" readonly
|
190 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_vertical' ))?>"
|
191 |
+
name="popup_theme_container_boxshadow_vertical"
|
192 |
+
id="popup_theme_container_boxshadow_vertical"
|
193 |
+
class="popmake-range-manual"
|
194 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_boxshadow_vertical', 1));?>"
|
195 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_boxshadow_vertical', -50));?>"
|
196 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_boxshadow_vertical', 50));?>"
|
197 |
+
/>
|
198 |
+
<span class="range-value-unit regular-text">px</span>
|
199 |
+
</td>
|
200 |
+
</tr>
|
201 |
+
<tr>
|
202 |
+
<th scope="row">
|
203 |
+
<label for="popup_theme_container_boxshadow_blur"><?php _e( 'Blur Radius', 'popup-maker' );?></label>
|
204 |
+
</th>
|
205 |
+
<td>
|
206 |
+
<input type="text" readonly
|
207 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_blur' ))?>"
|
208 |
+
name="popup_theme_container_boxshadow_blur"
|
209 |
+
id="popup_theme_container_boxshadow_blur"
|
210 |
+
class="popmake-range-manual"
|
211 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_boxshadow_blur', 1));?>"
|
212 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_boxshadow_blur', 0));?>"
|
213 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_boxshadow_blur', 100));?>"
|
214 |
+
/>
|
215 |
+
<span class="range-value-unit regular-text">px</span>
|
216 |
+
</td>
|
217 |
+
</tr>
|
218 |
+
<tr>
|
219 |
+
<th scope="row">
|
220 |
+
<label for="popup_theme_container_boxshadow_spread"><?php _e( 'Spread', 'popup-maker' );?></label>
|
221 |
+
</th>
|
222 |
+
<td>
|
223 |
+
<input type="text" readonly
|
224 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_spread' ))?>"
|
225 |
+
name="popup_theme_container_boxshadow_spread"
|
226 |
+
id="popup_theme_container_boxshadow_spread"
|
227 |
+
class="popmake-range-manual"
|
228 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_container_boxshadow_spread', 1));?>"
|
229 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_container_boxshadow_spread', -100));?>"
|
230 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_container_boxshadow_spread', 100));?>"
|
231 |
+
/>
|
232 |
+
<span class="range-value-unit regular-text">px</span>
|
233 |
+
</td>
|
234 |
+
</tr>
|
235 |
+
<tr>
|
236 |
+
<th scope="row">
|
237 |
+
<label for="popup_theme_container_boxshadow_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
238 |
+
</th>
|
239 |
+
<td>
|
240 |
+
<input type="text" name="popup_theme_container_boxshadow_color" id="popup_theme_container_boxshadow_color" value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_color'))?>" class="color-picker boxshadow-color" />
|
241 |
+
</td>
|
242 |
+
</tr>
|
243 |
+
<tr>
|
244 |
+
<th scope="row">
|
245 |
+
<label for="popup_theme_container_boxshadow_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
246 |
+
</th>
|
247 |
+
<td>
|
248 |
+
<input type="text" readonly
|
249 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_container( $popup_theme_id, 'boxshadow_opacity' ))?>"
|
250 |
+
name="popup_theme_container_boxshadow_opacity"
|
251 |
+
id="popup_theme_container_boxshadow_opacity"
|
252 |
+
class="popmake-range-manual"
|
253 |
+
step="1"
|
254 |
+
min="0"
|
255 |
+
max="100"
|
256 |
+
data-force-minmax=true
|
257 |
+
/>
|
258 |
+
<span class="range-value-unit regular-text">%</span>
|
259 |
+
</td>
|
260 |
+
</tr><?php
|
261 |
+
}
|
includes/admin/themes/metabox-content-fields.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action('popmake_popup_theme_content_meta_box_fields', 'popmake_popup_theme_content_meta_box_field_description', 0);
|
3 |
+
function popmake_popup_theme_content_meta_box_field_description( $popup_theme_id )
|
4 |
+
{
|
5 |
+
?></tbody></table><p><?php _e( 'Theme the content inside the popups.', 'popup-maker' ); ?></p><table class="form-table"><tbody><?php
|
6 |
+
}
|
7 |
+
|
8 |
+
add_action('popmake_popup_theme_content_meta_box_fields', 'popmake_popup_theme_content_meta_box_field_font', 10);
|
9 |
+
function popmake_popup_theme_content_meta_box_field_font( $popup_theme_id )
|
10 |
+
{
|
11 |
+
?>
|
12 |
+
<tr>
|
13 |
+
<th scope="row">
|
14 |
+
<label for="popup_theme_content_font_color"><strong class="title"><?php _e( 'Font', 'popup-maker' );?></strong></label>
|
15 |
+
</th>
|
16 |
+
<td></td>
|
17 |
+
</tr>
|
18 |
+
<tr>
|
19 |
+
<th scope="row">
|
20 |
+
<label for="popup_theme_content_font_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
21 |
+
</th>
|
22 |
+
<td>
|
23 |
+
<input type="text" name="popup_theme_content_font_color" id="popup_theme_content_font_color" value="<?php esc_attr_e(popmake_get_popup_theme_content( $popup_theme_id, 'font_color' ))?>" class="color-picker" />
|
24 |
+
</td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<th scope="row">
|
28 |
+
<label for="popup_theme_content_font_family"><?php _e( 'Family', 'popup-maker' );?></label>
|
29 |
+
</th>
|
30 |
+
<td>
|
31 |
+
<select name="popup_theme_content_font_family" id="popup_theme_content_font_family" class="font-family">
|
32 |
+
<?php foreach(apply_filters('popmake_font_family_options', array()) as $option => $value) : ?>
|
33 |
+
<option value="<?php echo $value;?>"
|
34 |
+
<?php echo $value == popmake_get_popup_theme_content( $popup_theme_id, 'font_family' ) ? ' selected="selected"' : '';?>
|
35 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
36 |
+
><?php echo $option;?></option>
|
37 |
+
<?php endforeach ?>
|
38 |
+
</select>
|
39 |
+
</td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<th scope="row font-weight-only">
|
43 |
+
<label for="popup_theme_content_font_weight"><?php _e( 'Weight', 'popup-maker' );?></label>
|
44 |
+
</th>
|
45 |
+
<td>
|
46 |
+
<select name="popup_theme_content_font_weight" id="popup_theme_content_font_weight" class="font-weight">
|
47 |
+
<?php foreach(apply_filters('popmake_font_weight_options', array()) as $option => $value) : ?>
|
48 |
+
<option
|
49 |
+
value="<?php echo $value;?>"
|
50 |
+
<?php echo $value == popmake_get_popup_theme_content( $popup_theme_id, 'font_weight') ? ' selected="selected"' : '';?>
|
51 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
52 |
+
><?php echo $option;?></option>
|
53 |
+
<?php endforeach ?>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<th scope="row font-style-only">
|
59 |
+
<label for="popup_theme_content_font_style"><?php _e( 'Style', 'popup-maker' );?></label>
|
60 |
+
</th>
|
61 |
+
<td>
|
62 |
+
<select name="popup_theme_content_font_style" id="popup_theme_content_font_style" class="font-style">
|
63 |
+
<?php foreach(apply_filters('popmake_font_style_options', array()) as $option => $value) : ?>
|
64 |
+
<option
|
65 |
+
value="<?php echo $value;?>"
|
66 |
+
<?php echo $value == popmake_get_popup_theme_content( $popup_theme_id, 'font_style') ? ' selected="selected"' : '';?>
|
67 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
68 |
+
><?php echo $option;?></option>
|
69 |
+
<?php endforeach ?>
|
70 |
+
</select>
|
71 |
+
</td>
|
72 |
+
</tr><?php
|
73 |
+
}
|
includes/admin/themes/metabox-overlay-fields.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_popup_theme_overlay_meta_box_field_description( $popup_theme_id )
|
3 |
+
{
|
4 |
+
?></tbody></table><p><?php _e( 'Theme the overlay behind the popups.', 'popup-maker' ); ?></p><table class="form-table"><tbody><?php
|
5 |
+
}
|
6 |
+
add_action('popmake_popup_theme_overlay_meta_box_fields', 'popmake_popup_theme_overlay_meta_box_field_description', 0);
|
7 |
+
|
8 |
+
function popmake_popup_theme_overlay_meta_box_field_background( $popup_theme_id ) { ?>
|
9 |
+
<tr>
|
10 |
+
<th scope="row">
|
11 |
+
<label for="popup_theme_overlay_background_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
12 |
+
</th>
|
13 |
+
<td>
|
14 |
+
<input type="text" name="popup_theme_overlay_background_color" id="popup_theme_overlay_background_color" value="<?php esc_attr_e(popmake_get_popup_theme_overlay( $popup_theme_id, 'background_color'))?>" class="color-picker background-color" />
|
15 |
+
<p class="description"><?php _e( 'Choose the overlay color.', 'popup-maker' )?></p>
|
16 |
+
</td>
|
17 |
+
</tr>
|
18 |
+
<tr class="background-opacity">
|
19 |
+
<th scope="row">
|
20 |
+
<label for="popup_theme_overlay_background_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
21 |
+
</th>
|
22 |
+
<td>
|
23 |
+
<input type="text" readonly
|
24 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_overlay( $popup_theme_id, 'background_opacity' ))?>"
|
25 |
+
name="popup_theme_overlay_background_opacity"
|
26 |
+
id="popup_theme_overlay_background_opacity"
|
27 |
+
class="popmake-range-manual"
|
28 |
+
step="1"
|
29 |
+
min="0"
|
30 |
+
max="100"
|
31 |
+
data-force-minmax=true
|
32 |
+
/>
|
33 |
+
<span class="range-value-unit regular-text">%</span>
|
34 |
+
<p class="description"><?php _e('The opacity value for the overlay.',POPMAKE_SLUG)?></p>
|
35 |
+
</td>
|
36 |
+
</tr><?php
|
37 |
+
}
|
38 |
+
add_action('popmake_popup_theme_overlay_meta_box_fields', 'popmake_popup_theme_overlay_meta_box_field_background', 10);
|
39 |
+
|
40 |
+
function popmake_popup_theme_overlay_meta_box_field_atb_extension_promotion( $popup_theme_id ) { ?>
|
41 |
+
<tr>
|
42 |
+
<th colspan="2" class="pro-upgrade-tip">
|
43 |
+
<img style="" src="<?php echo POPMAKE_URL;?>/assets/images/admin/icon-info-21x21.png"/> <?php _e( 'Wanna use background images?', 'popup-maker' ); ?> <a href="https://wppopupmaker.com/extensions/advanced-theme-builder" target="_blank"><?php _e( 'Check out Advanced Theme Builder!', 'popup-maker' ); ?></a>.
|
44 |
+
</th>
|
45 |
+
</tr><?php
|
46 |
+
}
|
47 |
+
add_action('popmake_popup_theme_overlay_meta_box_fields', 'popmake_popup_theme_overlay_meta_box_field_atb_extension_promotion', 20);
|
includes/admin/themes/metabox-preview.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
add_action('popmake_example_popup_content', 'popmake_default_example_popup_content',1);
|
4 |
+
function popmake_default_example_popup_content()
|
5 |
+
{?>
|
6 |
+
<p>Suspendisse ipsum eros, tincidunt sed commodo ut, viverra vitae ipsum. Etiam non porta neque. Pellentesque nulla elit, aliquam in ullamcorper at, bibendum sed eros. Morbi non sapien tellus, ac vestibulum eros. In hac habitasse platea dictumst. Nulla vestibulum, diam vel porttitor placerat, eros tortor ultrices lectus, eget faucibus arcu justo eget massa. Maecenas id tellus vitae justo posuere hendrerit aliquet ut dolor.</p>
|
7 |
+
<?php }
|
includes/admin/themes/metabox-title-fields.php
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action('popmake_popup_theme_title_meta_box_fields', 'popmake_popup_theme_title_meta_box_field_description', 0);
|
3 |
+
function popmake_popup_theme_title_meta_box_field_description( $popup_theme_id )
|
4 |
+
{
|
5 |
+
?></tbody></table><p><?php _e( 'Theme the title of the popups.', 'popup-maker' ); ?></p><table class="form-table"><tbody><?php
|
6 |
+
}
|
7 |
+
|
8 |
+
add_action('popmake_popup_theme_title_meta_box_fields', 'popmake_popup_theme_title_meta_box_field_font', 10);
|
9 |
+
function popmake_popup_theme_title_meta_box_field_font( $popup_theme_id )
|
10 |
+
{
|
11 |
+
?><tr class="title-divider">
|
12 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Font', 'popup-maker' );?></h3></th>
|
13 |
+
</tr>
|
14 |
+
<tr>
|
15 |
+
<th scope="row">
|
16 |
+
<label for="popup_theme_title_font_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
17 |
+
</th>
|
18 |
+
<td>
|
19 |
+
<input type="text" name="popup_theme_title_font_color" id="popup_theme_title_font_color" value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'font_color'))?>" class="color-picker" />
|
20 |
+
</td>
|
21 |
+
</tr>
|
22 |
+
<tr>
|
23 |
+
<th scope="row">
|
24 |
+
<label for="popup_theme_title_font_size"><?php _e( 'Size', 'popup-maker' );?></label>
|
25 |
+
</th>
|
26 |
+
<td>
|
27 |
+
<input type="text" readonly
|
28 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'font_size' ))?>"
|
29 |
+
name="popup_theme_title_font_size"
|
30 |
+
id="popup_theme_title_font_size"
|
31 |
+
class="popmake-range-manual"
|
32 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_title_font_size', 1));?>"
|
33 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_title_font_size', 8));?>"
|
34 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_title_font_size', 32));?>"
|
35 |
+
/>
|
36 |
+
<span class="range-value-unit regular-text">px</span>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<th scope="row">
|
41 |
+
<label for="popup_theme_title_line_height"><?php _e( 'Line Height', 'popup-maker' );?></label>
|
42 |
+
</th>
|
43 |
+
<td>
|
44 |
+
<input type="text" readonly
|
45 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'line_height' ))?>"
|
46 |
+
name="popup_theme_title_line_height"
|
47 |
+
id="popup_theme_title_line_height"
|
48 |
+
class="popmake-range-manual"
|
49 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_title_line_height', 1));?>"
|
50 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_title_line_height', 8));?>"
|
51 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_title_line_height', 32));?>"
|
52 |
+
/>
|
53 |
+
<span class="range-value-unit regular-text">px</span>
|
54 |
+
</td>
|
55 |
+
</tr>
|
56 |
+
<tr>
|
57 |
+
<th scope="row">
|
58 |
+
<label for="popup_theme_title_font_family"><?php _e( 'Family', 'popup-maker' );?></label>
|
59 |
+
</th>
|
60 |
+
<td>
|
61 |
+
<select name="popup_theme_title_font_family" id="popup_theme_title_font_family" class="font-family">
|
62 |
+
<?php foreach(apply_filters('popmake_font_family_options', array()) as $option => $value) : ?>
|
63 |
+
<option
|
64 |
+
value="<?php echo $value;?>"
|
65 |
+
<?php echo $value == popmake_get_popup_theme_title( $popup_theme_id, 'font_family') ? ' selected="selected"' : '';?>
|
66 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
67 |
+
><?php echo $option;?></option>
|
68 |
+
<?php endforeach ?>
|
69 |
+
</select>
|
70 |
+
</td>
|
71 |
+
</tr>
|
72 |
+
<tr>
|
73 |
+
<th scope="row font-weight-only">
|
74 |
+
<label for="popup_theme_title_font_weight"><?php _e( 'Weight', 'popup-maker' );?></label>
|
75 |
+
</th>
|
76 |
+
<td>
|
77 |
+
<select name="popup_theme_title_font_weight" id="popup_theme_title_font_weight" class="font-weight">
|
78 |
+
<?php foreach(apply_filters('popmake_font_weight_options', array()) as $option => $value) : ?>
|
79 |
+
<option
|
80 |
+
value="<?php echo $value;?>"
|
81 |
+
<?php echo $value == popmake_get_popup_theme_title( $popup_theme_id, 'font_weight') ? ' selected="selected"' : '';?>
|
82 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
83 |
+
><?php echo $option;?></option>
|
84 |
+
<?php endforeach ?>
|
85 |
+
</select>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
<tr>
|
89 |
+
<th scope="row font-style-only">
|
90 |
+
<label for="popup_theme_title_font_style"><?php _e( 'Style', 'popup-maker' );?></label>
|
91 |
+
</th>
|
92 |
+
<td>
|
93 |
+
<select name="popup_theme_title_font_style" id="popup_theme_title_font_style" class="font-style">
|
94 |
+
<?php foreach(apply_filters('popmake_font_style_options', array()) as $option => $value) : ?>
|
95 |
+
<option
|
96 |
+
value="<?php echo $value;?>"
|
97 |
+
<?php echo $value == popmake_get_popup_theme_title( $popup_theme_id, 'font_style') ? ' selected="selected"' : '';?>
|
98 |
+
<?php echo $value == '' ? ' class="bold"' : '';?>
|
99 |
+
><?php echo $option;?></option>
|
100 |
+
<?php endforeach ?>
|
101 |
+
</select>
|
102 |
+
</td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<th scope="row">
|
106 |
+
<label for="popup_theme_title_text_align"><?php _e( 'Align', 'popup-maker' );?></label>
|
107 |
+
</th>
|
108 |
+
<td>
|
109 |
+
<select name="popup_theme_title_text_align" id="popup_theme_title_text_align">
|
110 |
+
<?php foreach(apply_filters('popmake_text_align_options', array()) as $option => $value) : ?>
|
111 |
+
<option
|
112 |
+
value="<?php echo $value;?>"
|
113 |
+
<?php echo $value == popmake_get_popup_theme_title( $popup_theme_id, 'text_align') ? ' selected="selected"' : '';?>
|
114 |
+
><?php echo $option;?></option>
|
115 |
+
<?php endforeach ?>
|
116 |
+
</select>
|
117 |
+
</td>
|
118 |
+
</tr><?php
|
119 |
+
}
|
120 |
+
|
121 |
+
add_action('popmake_popup_theme_title_meta_box_fields', 'popmake_popup_theme_title_meta_box_field_textshadow', 20);
|
122 |
+
function popmake_popup_theme_title_meta_box_field_textshadow( $popup_theme_id )
|
123 |
+
{
|
124 |
+
?><tr class="title-divider">
|
125 |
+
<th colspan="2"><h3 class="title"><?php _e( 'Text Shadow', 'popup-maker' );?></h3></th>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<th scope="row">
|
129 |
+
<label for="popup_theme_title_textshadow_horizontal"><?php _e( 'Horizontal Position', 'popup-maker' );?></label>
|
130 |
+
</th>
|
131 |
+
<td>
|
132 |
+
<input type="text" readonly
|
133 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'textshadow_horizontal' ))?>"
|
134 |
+
name="popup_theme_title_textshadow_horizontal"
|
135 |
+
id="popup_theme_title_textshadow_horizontal"
|
136 |
+
class="popmake-range-manual"
|
137 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_title_textshadow_horizontal', 1));?>"
|
138 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_title_textshadow_horizontal', -50));?>"
|
139 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_title_textshadow_horizontal', 50));?>"
|
140 |
+
/>
|
141 |
+
<span class="range-value-unit regular-text">px</span>
|
142 |
+
</td>
|
143 |
+
</tr>
|
144 |
+
<tr>
|
145 |
+
<th scope="row">
|
146 |
+
<label for="popup_theme_title_textshadow_vertical"><?php _e( 'Vertical Position', 'popup-maker' );?></label>
|
147 |
+
</th>
|
148 |
+
<td>
|
149 |
+
<input type="text" readonly
|
150 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'textshadow_vertical' ))?>"
|
151 |
+
name="popup_theme_title_textshadow_vertical"
|
152 |
+
id="popup_theme_title_textshadow_vertical"
|
153 |
+
class="popmake-range-manual"
|
154 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_title_textshadow_vertical', 1));?>"
|
155 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_title_textshadow_vertical', -50));?>"
|
156 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_title_textshadow_vertical', 50));?>"
|
157 |
+
/>
|
158 |
+
<span class="range-value-unit regular-text">px</span>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<th scope="row">
|
163 |
+
<label for="popup_theme_title_textshadow_blur"><?php _e( 'Blur Radius', 'popup-maker' );?></label>
|
164 |
+
</th>
|
165 |
+
<td>
|
166 |
+
<input type="text" readonly
|
167 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'textshadow_blur' ))?>"
|
168 |
+
name="popup_theme_title_textshadow_blur"
|
169 |
+
id="popup_theme_title_textshadow_blur"
|
170 |
+
class="popmake-range-manual"
|
171 |
+
step="<?php esc_html_e(apply_filters('popmake_popup_theme_step_title_textshadow_blur', 1));?>"
|
172 |
+
min="<?php esc_html_e(apply_filters('popmake_popup_theme_min_title_textshadow_blur', 0));?>"
|
173 |
+
max="<?php esc_html_e(apply_filters('popmake_popup_theme_max_title_textshadow_blur', 100));?>"
|
174 |
+
/>
|
175 |
+
<span class="range-value-unit regular-text">px</span>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
<tr>
|
179 |
+
<th scope="row">
|
180 |
+
<label for="popup_theme_title_textshadow_color"><?php _e( 'Color', 'popup-maker' );?></label>
|
181 |
+
</th>
|
182 |
+
<td>
|
183 |
+
<input type="text" name="popup_theme_title_textshadow_color" id="popup_theme_title_textshadow_color" value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'textshadow_color'))?>" class="color-picker textshadow-color" />
|
184 |
+
</td>
|
185 |
+
</tr>
|
186 |
+
<tr>
|
187 |
+
<th scope="row">
|
188 |
+
<label for="popup_theme_title_textshadow_opacity"><?php _e( 'Opacity', 'popup-maker' );?></label>
|
189 |
+
</th>
|
190 |
+
<td>
|
191 |
+
<input type="text" readonly
|
192 |
+
value="<?php esc_attr_e(popmake_get_popup_theme_title( $popup_theme_id, 'textshadow_opacity' ))?>"
|
193 |
+
name="popup_theme_title_textshadow_opacity"
|
194 |
+
id="popup_theme_title_textshadow_opacity"
|
195 |
+
class="popmake-range-manual"
|
196 |
+
step="1"
|
197 |
+
min="0"
|
198 |
+
max="100"
|
199 |
+
data-force-minmax=true
|
200 |
+
/>
|
201 |
+
<span class="range-value-unit regular-text">%</span>
|
202 |
+
</td>
|
203 |
+
</tr><?php
|
204 |
+
}
|
includes/admin/themes/metabox.php
ADDED
@@ -0,0 +1,435 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Metabox Functions
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Admin/Themes
|
7 |
+
* @copyright Copyright (c) 2014, Wizard Internet Solutions
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/** All Themes *****************************************************************/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Register all the meta boxes for the Theme custom post type
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function popmake_add_popup_theme_meta_box() {
|
24 |
+
|
25 |
+
$singular = popmake_get_label_singular('popup_theme');
|
26 |
+
$plural = popmake_get_label_plural('popup_theme');
|
27 |
+
|
28 |
+
/** Preview Window **/
|
29 |
+
add_meta_box( 'popmake_popup_theme_preview', __( 'Theme Preview', 'popup-maker' ), 'popmake_render_popup_theme_preview_meta_box', 'popup_theme', 'side', 'high' );
|
30 |
+
|
31 |
+
/** Overlay Meta **/
|
32 |
+
add_meta_box( 'popmake_popup_theme_overlay', __( 'Overlay Settings', 'popup-maker' ), 'popmake_render_popup_theme_overlay_meta_box', 'popup_theme', 'normal', 'high' );
|
33 |
+
|
34 |
+
/** Container Meta **/
|
35 |
+
add_meta_box( 'popmake_popup_theme_container', __( 'Container Settings', 'popup-maker' ), 'popmake_render_popup_theme_container_meta_box', 'popup_theme', 'normal', 'high' );
|
36 |
+
|
37 |
+
/** Title Meta **/
|
38 |
+
add_meta_box( 'popmake_popup_theme_title', __( 'Title Settings', 'popup-maker' ), 'popmake_render_popup_theme_title_meta_box', 'popup_theme', 'normal', 'high' );
|
39 |
+
|
40 |
+
/** Content Meta **/
|
41 |
+
add_meta_box( 'popmake_popup_theme_content', __( 'Content Settings', 'popup-maker' ), 'popmake_render_popup_theme_content_meta_box', 'popup_theme', 'normal', 'high' );
|
42 |
+
|
43 |
+
/** Close Meta **/
|
44 |
+
add_meta_box( 'popmake_popup_theme_close', __( 'Close Settings', 'popup-maker' ), 'popmake_render_popup_theme_close_meta_box', 'popup_theme', 'normal', 'high' );
|
45 |
+
/** Support Meta **/
|
46 |
+
add_meta_box( 'popmake_popup_support', __( 'Support', 'popup-maker' ), 'popmake_render_support_meta_box', 'popup_theme', 'side', 'default' );
|
47 |
+
/** Share Meta **/
|
48 |
+
add_meta_box( 'popmake_popup_share', __( 'Share', 'popup-maker' ), 'popmake_render_share_meta_box', 'popup_theme', 'side', 'default' );
|
49 |
+
|
50 |
+
}
|
51 |
+
add_action( 'add_meta_boxes', 'popmake_add_popup_theme_meta_box' );
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
function popmake_popup_theme_meta_fields() {
|
56 |
+
$fields = array(
|
57 |
+
'popup_theme_defaults_set'
|
58 |
+
);
|
59 |
+
foreach(popmake_popup_theme_meta_field_groups() as $group) {
|
60 |
+
foreach(apply_filters( 'popmake_popup_theme_meta_field_group_' . $group, $fields ) as $field) {
|
61 |
+
$fields[] = 'popup_theme_' . $group . '_' . $field;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
return apply_filters( 'popmake_popup_theme_meta_fields', $fields );
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
function popmake_popup_theme_meta_field_groups() {
|
69 |
+
$groups = array(
|
70 |
+
'overlay',
|
71 |
+
'container',
|
72 |
+
'title',
|
73 |
+
'content',
|
74 |
+
'close'
|
75 |
+
);
|
76 |
+
return apply_filters( 'popmake_popup_theme_meta_field_groups', $groups );
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
function popmake_popup_theme_meta_field_group_overlay() {
|
81 |
+
return array(
|
82 |
+
'background_color',
|
83 |
+
'background_opacity'
|
84 |
+
);
|
85 |
+
}
|
86 |
+
add_filter('popmake_popup_theme_meta_field_group_overlay', 'popmake_popup_theme_meta_field_group_overlay', 0);
|
87 |
+
|
88 |
+
|
89 |
+
function popmake_popup_theme_meta_field_group_container() {
|
90 |
+
return array(
|
91 |
+
'padding',
|
92 |
+
'background_color',
|
93 |
+
'background_opacity',
|
94 |
+
'border_radius',
|
95 |
+
'border_style',
|
96 |
+
'border_color',
|
97 |
+
'border_width',
|
98 |
+
'boxshadow_inset',
|
99 |
+
'boxshadow_horizontal',
|
100 |
+
'boxshadow_vertical',
|
101 |
+
'boxshadow_blur',
|
102 |
+
'boxshadow_spread',
|
103 |
+
'boxshadow_color',
|
104 |
+
'boxshadow_opacity',
|
105 |
+
);
|
106 |
+
}
|
107 |
+
add_filter('popmake_popup_theme_meta_field_group_container', 'popmake_popup_theme_meta_field_group_container', 0);
|
108 |
+
|
109 |
+
|
110 |
+
function popmake_popup_theme_meta_field_group_title() {
|
111 |
+
return array(
|
112 |
+
'font_color',
|
113 |
+
'line_height',
|
114 |
+
'font_size',
|
115 |
+
'font_family',
|
116 |
+
'font_weight',
|
117 |
+
'font_style',
|
118 |
+
'text_align',
|
119 |
+
'textshadow_horizontal',
|
120 |
+
'textshadow_vertical',
|
121 |
+
'textshadow_blur',
|
122 |
+
'textshadow_color',
|
123 |
+
'textshadow_opacity',
|
124 |
+
);
|
125 |
+
}
|
126 |
+
add_filter('popmake_popup_theme_meta_field_group_title', 'popmake_popup_theme_meta_field_group_title', 0);
|
127 |
+
|
128 |
+
|
129 |
+
function popmake_popup_theme_meta_field_group_content() {
|
130 |
+
return array(
|
131 |
+
'font_color',
|
132 |
+
'font_family',
|
133 |
+
'font_weight',
|
134 |
+
'font_style',
|
135 |
+
);
|
136 |
+
}
|
137 |
+
add_filter('popmake_popup_theme_meta_field_group_content', 'popmake_popup_theme_meta_field_group_content', 0);
|
138 |
+
|
139 |
+
|
140 |
+
function popmake_popup_theme_meta_field_group_close() {
|
141 |
+
return array(
|
142 |
+
'text',
|
143 |
+
'padding',
|
144 |
+
'location',
|
145 |
+
'position_top',
|
146 |
+
'position_left',
|
147 |
+
'position_bottom',
|
148 |
+
'position_right',
|
149 |
+
'line_height',
|
150 |
+
'font_color',
|
151 |
+
'font_size',
|
152 |
+
'font_family',
|
153 |
+
'font_weight',
|
154 |
+
'font_style',
|
155 |
+
'background_color',
|
156 |
+
'background_opacity',
|
157 |
+
'border_radius',
|
158 |
+
'border_style',
|
159 |
+
'border_color',
|
160 |
+
'border_width',
|
161 |
+
'boxshadow_inset',
|
162 |
+
'boxshadow_horizontal',
|
163 |
+
'boxshadow_vertical',
|
164 |
+
'boxshadow_blur',
|
165 |
+
'boxshadow_spread',
|
166 |
+
'boxshadow_color',
|
167 |
+
'boxshadow_opacity',
|
168 |
+
'textshadow_horizontal',
|
169 |
+
'textshadow_vertical',
|
170 |
+
'textshadow_blur',
|
171 |
+
'textshadow_color',
|
172 |
+
'textshadow_opacity',
|
173 |
+
);
|
174 |
+
}
|
175 |
+
add_filter('popmake_popup_theme_meta_field_group_close', 'popmake_popup_theme_meta_field_group_close', 0);
|
176 |
+
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Save post meta when the save_post action is called
|
183 |
+
*
|
184 |
+
* @since 1.0
|
185 |
+
* @param int $post_id Theme (Post) ID
|
186 |
+
* @global array $post All the data of the the current post
|
187 |
+
* @return void
|
188 |
+
*/
|
189 |
+
function popmake_popup_theme_meta_box_save( $post_id, $post ) {
|
190 |
+
|
191 |
+
if ( isset( $post->post_type ) && 'popup_theme' != $post->post_type ) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
if ( ! isset( $_POST['popmake_popup_theme_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['popmake_popup_theme_meta_box_nonce'], basename( __FILE__ ) ) ) {
|
196 |
+
return;
|
197 |
+
}
|
198 |
+
|
199 |
+
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX') && DOING_AJAX ) || isset( $_REQUEST['bulk_edit'] ) ) {
|
200 |
+
return;
|
201 |
+
}
|
202 |
+
|
203 |
+
if ( isset( $post->post_type ) && 'revision' == $post->post_type ) {
|
204 |
+
return;
|
205 |
+
}
|
206 |
+
|
207 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
208 |
+
return;
|
209 |
+
}
|
210 |
+
|
211 |
+
foreach ( popmake_popup_theme_meta_fields() as $field ) {
|
212 |
+
if ( isset( $_POST[ $field ] ) ) {
|
213 |
+
$new = apply_filters( 'popmake_metabox_save_' . $field, $_POST[ $field ] );
|
214 |
+
update_post_meta( $post_id, $field, $new );
|
215 |
+
} else {
|
216 |
+
delete_post_meta( $post_id, $field );
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
do_action( 'popmake_save_popup_theme', $post_id, $post );
|
221 |
+
}
|
222 |
+
add_action( 'save_post', 'popmake_popup_theme_meta_box_save', 10, 2 );
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
/** Theme Configuration *****************************************************************/
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
function popmake_popup_thmem_ut_extension_promotion() {
|
231 |
+
if(popmake_is_admin_popup_theme_page()) { ?>
|
232 |
+
<div id="popuptitlediv">
|
233 |
+
<div class="pro-upgrade-tip">
|
234 |
+
<img style="" src="<?php echo POPMAKE_URL;?>/assets/images/admin/icon-info-21x21.png"/> <?php _e( 'Need more than one (1) theme?', 'popup-maker' ); ?> <a href="https://wppopupmaker.com/extensions/unlimited-themes" target="_blank"><?php _e( 'Check out Unlimited Themes!', 'popup-maker' ); ?></a>.
|
235 |
+
</div>
|
236 |
+
</div><?php
|
237 |
+
}
|
238 |
+
}
|
239 |
+
add_action( 'edit_form_advanced', 'popmake_popup_thmem_ut_extension_promotion', 1 );
|
240 |
+
add_action( 'edit_page_form', 'popmake_popup_thmem_ut_extension_promotion', 1 );
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
+
function popmake_popup_theme_setup() {
|
245 |
+
if('popup_theme' == get_post_type())
|
246 |
+
echo '<style type="text/css">#visibility, #favorite-actions, .add-new-h2, .tablenav, #delete-action {display:none;}</style>';
|
247 |
+
}
|
248 |
+
add_action('admin_head', 'popmake_popup_theme_setup');
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Theme Preview Metabox
|
252 |
+
*
|
253 |
+
* Extensions (as well as the core plugin) can add items to the theme preview
|
254 |
+
* configuration metabox via the `popmake_popup_theme_preview_meta_box_fields` action.
|
255 |
+
*
|
256 |
+
* @since 1.0
|
257 |
+
* @return void
|
258 |
+
*/
|
259 |
+
function popmake_render_popup_theme_preview_meta_box() { ?>
|
260 |
+
<div class="empreview">
|
261 |
+
<div id="PopMake-Preview">
|
262 |
+
<div class="example-popup-overlay"></div>
|
263 |
+
<div class="example-popup">
|
264 |
+
<div class="title"><?php _e('Title Text', 'popup-maker' );?></div>
|
265 |
+
<div class="content"><?php do_action('popmake_example_popup_content');?></div>
|
266 |
+
<a class="close-popup"><?php _e('×', 'popup-maker' );?></a>
|
267 |
+
</div>
|
268 |
+
</div>
|
269 |
+
</div><?php
|
270 |
+
}
|
271 |
+
|
272 |
+
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Theme Overlay Metabox
|
276 |
+
*
|
277 |
+
* Extensions (as well as the core plugin) can add items to the theme overlay
|
278 |
+
* configuration metabox via the `popmake_popup_theme_overlay_meta_box_fields` action.
|
279 |
+
*
|
280 |
+
* @since 1.0
|
281 |
+
* @return void
|
282 |
+
*/
|
283 |
+
function popmake_render_popup_theme_overlay_meta_box() {
|
284 |
+
global $post, $popmake_options;
|
285 |
+
wp_nonce_field( basename( __FILE__ ), 'popmake_popup_theme_meta_box_nonce' ); ?>
|
286 |
+
<input type="hidden" name="popup_theme_defaults_set" value="true" />
|
287 |
+
<div id="popmake_popup_theme_overlay_fields" class="popmake_meta_table_wrap">
|
288 |
+
<table class="form-table">
|
289 |
+
<tbody>
|
290 |
+
<?php do_action( 'popmake_popup_theme_overlay_meta_box_fields', $post->ID );?>
|
291 |
+
</tbody>
|
292 |
+
</table>
|
293 |
+
</div><?php
|
294 |
+
}
|
295 |
+
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Theme Container Metabox
|
299 |
+
*
|
300 |
+
* Extensions (as well as the core plugin) can add items to the theme container
|
301 |
+
* configuration metabox via the `popmake_popup_theme_container_meta_box_fields` action.
|
302 |
+
*
|
303 |
+
* @since 1.0
|
304 |
+
* @return void
|
305 |
+
*/
|
306 |
+
function popmake_render_popup_theme_container_meta_box() {
|
307 |
+
global $post, $popmake_options;?>
|
308 |
+
<div id="popmake_popup_theme_container_fields" class="popmake_meta_table_wrap">
|
309 |
+
<table class="form-table">
|
310 |
+
<tbody>
|
311 |
+
<?php do_action( 'popmake_popup_theme_container_meta_box_fields', $post->ID );?>
|
312 |
+
</tbody>
|
313 |
+
</table>
|
314 |
+
</div><?php
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Theme Title Metabox
|
320 |
+
*
|
321 |
+
* Extensions (as well as the core plugin) can add items to the theme title
|
322 |
+
* configuration metabox via the `popmake_popup_theme_title_meta_box_fields` action.
|
323 |
+
*
|
324 |
+
* @since 1.0
|
325 |
+
* @return void
|
326 |
+
*/
|
327 |
+
function popmake_render_popup_theme_title_meta_box() {
|
328 |
+
global $post, $popmake_options;?>
|
329 |
+
<div id="popmake_popup_theme_title_fields" class="popmake_meta_table_wrap">
|
330 |
+
<table class="form-table">
|
331 |
+
<tbody>
|
332 |
+
<?php do_action( 'popmake_popup_theme_title_meta_box_fields', $post->ID );?>
|
333 |
+
</tbody>
|
334 |
+
</table>
|
335 |
+
</div><?php
|
336 |
+
}
|
337 |
+
|
338 |
+
|
339 |
+
/**
|
340 |
+
* Theme Content Metabox
|
341 |
+
*
|
342 |
+
* Extensions (as well as the core plugin) can add items to the theme content
|
343 |
+
* configuration metabox via the `popmake_popup_theme_content_meta_box_fields` action.
|
344 |
+
*
|
345 |
+
* @since 1.0
|
346 |
+
* @return void
|
347 |
+
*/
|
348 |
+
function popmake_render_popup_theme_content_meta_box() {
|
349 |
+
global $post, $popmake_options;?>
|
350 |
+
<div id="popmake_popup_theme_content_fields" class="popmake_meta_table_wrap">
|
351 |
+
<table class="form-table">
|
352 |
+
<tbody>
|
353 |
+
<?php do_action( 'popmake_popup_theme_content_meta_box_fields', $post->ID );?>
|
354 |
+
</tbody>
|
355 |
+
</table>
|
356 |
+
</div><?php
|
357 |
+
}
|
358 |
+
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Theme Close Metabox
|
362 |
+
*
|
363 |
+
* Extensions (as well as the core plugin) can add items to the popup close
|
364 |
+
* configuration metabox via the `popmake_popup_theme_close_meta_box_fields` action.
|
365 |
+
*
|
366 |
+
* @since 1.0
|
367 |
+
* @return void
|
368 |
+
*/
|
369 |
+
function popmake_render_popup_theme_close_meta_box() {
|
370 |
+
global $post, $popmake_options;?>
|
371 |
+
<div id="popmake_popup_theme_close_fields" class="popmake_meta_table_wrap">
|
372 |
+
<table class="form-table">
|
373 |
+
<tbody>
|
374 |
+
<?php do_action( 'popmake_popup_theme_close_meta_box_fields', $post->ID );?>
|
375 |
+
</tbody>
|
376 |
+
</table>
|
377 |
+
</div><?php
|
378 |
+
}
|
379 |
+
|
380 |
+
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Adds Popup Theme meta fields to revisions.
|
384 |
+
*
|
385 |
+
* @since 1.0
|
386 |
+
* @return array $fields Array of fields.
|
387 |
+
*/
|
388 |
+
function popmake_popup_theme_post_revision_fields( $fields ) {
|
389 |
+
$theme_fields = popmake_popup_theme_meta_fields();
|
390 |
+
foreach($theme_fields as $field) {
|
391 |
+
$fields[$field] = __( 'Theme Overlay', ucwords( str_replace('_', ' ', str_replace('popup_theme_', '', $field) ) ), 'popup-maker' );
|
392 |
+
}
|
393 |
+
return $fields;
|
394 |
+
}
|
395 |
+
//add_filter( '_wp_post_revision_fields', 'popmake_popup_theme_post_revision_fields' );
|
396 |
+
|
397 |
+
|
398 |
+
function popmake_popup_theme_revision_field( $value, $field, $revision) {
|
399 |
+
return get_metadata( 'post', $revision->ID, $field, true );
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
function popmake_add_popup_theme_revision_fields() {
|
404 |
+
foreach(popmake_popup_theme_meta_fields() as $field) {
|
405 |
+
add_filter( '_wp_post_revision_field_' . $field, 'popmake_popup_theme_revision_field', 10, 3 );
|
406 |
+
}
|
407 |
+
}
|
408 |
+
//add_action('plugins_loaded', 'popmake_add_popup_theme_revision_fields');
|
409 |
+
|
410 |
+
|
411 |
+
function popmake_popup_theme_meta_restore_revision( $post_id, $revision_id ) {
|
412 |
+
$post = get_post( $post_id );
|
413 |
+
$revision = get_post( $revision_id );
|
414 |
+
foreach(popmake_popup_theme_meta_fields() as $field) {
|
415 |
+
$meta = get_metadata( 'post', $revision->ID, $field, true );
|
416 |
+
if ( false === $meta )
|
417 |
+
delete_post_meta( $post_id, $field );
|
418 |
+
else
|
419 |
+
update_post_meta( $post_id, $field, $meta );
|
420 |
+
}
|
421 |
+
}
|
422 |
+
//add_action( 'wp_restore_post_revision', 'popmake_popup_theme_meta_restore_revision', 10, 2 );
|
423 |
+
|
424 |
+
function popmake_popup_theme_meta_save_revision( $post_id, $post ) {
|
425 |
+
if ( $parent_id = wp_is_post_revision( $post_id ) ) {
|
426 |
+
foreach(popmake_popup_theme_meta_fields() as $field) {
|
427 |
+
$meta = get_post_meta( $parent_id, $field, true );
|
428 |
+
if ( false !== $meta )
|
429 |
+
add_metadata( 'post', $post_id, $field, $meta );
|
430 |
+
|
431 |
+
}
|
432 |
+
}
|
433 |
+
}
|
434 |
+
//add_action( 'save_post', 'popmake_popup_theme_meta_save_revision', 11, 2 );
|
435 |
+
|
includes/admin/welcome.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Sends user to the Welcome page on first activation of Popup Maker as well as each
|
5 |
+
* time Popup Maker is upgraded to a new version
|
6 |
+
*
|
7 |
+
* @access public
|
8 |
+
* @since 1.4
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
function popmake_welcome_redirect() {
|
12 |
+
|
13 |
+
// Bail if no activation redirect
|
14 |
+
if ( ! get_transient( '_popmake_activation_redirect' ) )
|
15 |
+
return;
|
16 |
+
|
17 |
+
// Delete the redirect transient
|
18 |
+
delete_transient( '_popmake_activation_redirect' );
|
19 |
+
|
20 |
+
// Bail if activating from network, or bulk
|
21 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) )
|
22 |
+
return;
|
23 |
+
|
24 |
+
$upgrade = get_option( 'popmake_version_upgraded_from' );
|
25 |
+
|
26 |
+
if( ! $upgrade ) { // First time install
|
27 |
+
wp_safe_redirect( admin_url( 'index.php?page=popmake-getting-started' ) ); exit;
|
28 |
+
} else { // Update
|
29 |
+
wp_safe_redirect( admin_url( 'index.php?page=popmake-about' ) ); exit;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
add_action( 'admin_init', 'popmake_welcome_redirect' );
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
function popmake_welcome_page_tabs() {
|
37 |
+
$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'popmake-about';
|
38 |
+
?>
|
39 |
+
<h2 class="nav-tab-wrapper">
|
40 |
+
<a class="nav-tab <?php echo $selected == 'popmake-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'popmake-about' ), 'index.php' ) ) ); ?>">
|
41 |
+
<?php _e( "What's New", 'popup-maker' ); ?>
|
42 |
+
</a>
|
43 |
+
<a class="nav-tab <?php echo $selected == 'popmake-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'popmake-getting-started' ), 'index.php' ) ) ); ?>">
|
44 |
+
<?php _e( 'Getting Started', 'popup-maker' ); ?>
|
45 |
+
</a>
|
46 |
+
<a class="nav-tab <?php echo $selected == 'popmake-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'popmake-credits' ), 'index.php' ) ) ); ?>">
|
47 |
+
<?php _e( 'Credits', 'popup-maker' ); ?>
|
48 |
+
</a>
|
49 |
+
</h2>
|
50 |
+
<?php
|
51 |
+
}
|
52 |
+
|
includes/admin/welcome/about.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_about_page() {
|
3 |
+
list( $display_version ) = explode( '-', POPMAKE_VERSION );
|
4 |
+
?>
|
5 |
+
<div class="wrap about-wrap">
|
6 |
+
<h1><?php printf( __( 'Welcome to Popup Maker %s', 'popup-maker' ), $display_version ); ?></h1>
|
7 |
+
<div class="about-text"><?php _e( 'Thank you for updating to the latest version! Are you ready to destroy your old conversion rates and transform your website? We sure are!', 'popup-maker' ); ?></div>
|
8 |
+
<div class="popmake-badge"><?php printf( __( 'Version %s', 'popup-maker' ), $display_version ); ?></div>
|
9 |
+
|
10 |
+
<?php popmake_welcome_page_tabs(); ?>
|
11 |
+
|
12 |
+
<div class="changelog">
|
13 |
+
<h3><?php _e( 'Targeting Conditions', 'popup-maker' );?></h3>
|
14 |
+
<img src="<?php echo POPMAKE_URL . '/assets/images/welcome/targeting-conditions.png'; ?>" class="popmake-welcome-screenshots"/>
|
15 |
+
<div class="feature-section">
|
16 |
+
<h4><?php _e( 'Target specific users for your popups!', 'popup-maker' );?></h4>
|
17 |
+
<p><?php printf( __( 'Our %sTargeting Conditions%s feature allows you to tailor your popups to specific users by giving you the ability to use popups exactly where you want within your website.', 'popup-maker' ), '<strong>', '</strong>'); ?></p>
|
18 |
+
<h4><?php _e( 'Drive Conversions!', 'popup-maker' );?></h4>
|
19 |
+
<p>
|
20 |
+
<?php printf(
|
21 |
+
__( 'Use %sAuto Open%s, %sScroll Triggered%s & %sExit Intent Popup%s Extensions to enhance your popups’ effectiveness and easily convert users into cash.', 'popup-maker' ),
|
22 |
+
'<a href="https://wppopupmaker.com/extensions/auto-open-popups" target="_blank">', '</a>',
|
23 |
+
'<a href="https://wppopupmaker.com/extensions/scroll-triggered-popups" target="_blank">', '</a>',
|
24 |
+
'<a href="https://wppopupmaker.com/extensions/exit-intent-popups" target="_blank">', '</a>'
|
25 |
+
); ?>
|
26 |
+
</p>
|
27 |
+
</div>
|
28 |
+
<h3><?php _e( 'Google Font Integration', 'popup-maker' );?></h3>
|
29 |
+
<div class="feature-section">
|
30 |
+
<p><?php _e( 'Easily plug and play all of your favorite fonts from Google Fonts all within a few clicks!', 'popup-maker' );?></p>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
<div class="changelog">
|
34 |
+
</div>
|
35 |
+
|
36 |
+
|
37 |
+
<div class="changelog">
|
38 |
+
<h3><?php _e( 'WordPress Form Plug-In Integrations', 'popup-maker' );?></h3>
|
39 |
+
<div class="feature-section">
|
40 |
+
<p><?php _e( 'Use any of your forms from the most popular form plugins out-of-the-box inside your popups with ease and efficiency. 100% seamless compatibility with:', 'popup-maker' );?></p>
|
41 |
+
<ul class="inline">
|
42 |
+
<img src="<?php echo POPMAKE_URL . '/assets/images/welcome/ninja.jpg'; ?>"/>
|
43 |
+
<img src="<?php echo POPMAKE_URL . '/assets/images/welcome/gravity.jpg'; ?>"/>
|
44 |
+
<img src="<?php echo POPMAKE_URL . '/assets/images/welcome/cf7.jpg'; ?>"/>
|
45 |
+
</ul>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<div class="changelog">
|
50 |
+
<h3><?php _e( 'Easy Theme Builder', 'popup-maker' );?></h3>
|
51 |
+
<div class="feature-section">
|
52 |
+
<img src="<?php echo POPMAKE_URL . '/assets/images/welcome/easy-theme-builder.png'; ?>" class="popmake-welcome-screenshots"/>
|
53 |
+
<p><?php _e( 'Our theme builder allows you to create a high performing theme in no time for your popups. Use our color picker to grab the perfect colors to meet your needs and find pixel perfect sizes with ease for a plethora of additional theme settings.', 'popup-maker' ); ?></p>
|
54 |
+
<h4><?php _e( 'Make it Your Own!', 'popup-maker' );?></h4>
|
55 |
+
<p>
|
56 |
+
<?php printf(
|
57 |
+
__( 'If you need to create an unlimited number of themes and customize your popups, check out our %sUnlimited Themes%s Extension. Also, you may be interested in our %sAdvanced Theme Builder%s Extension, which allows you to add background images to many elements of your popup within a couple of clicks.', 'popup-maker' ),
|
58 |
+
'<a href="https://wppopupmaker.com/extensions/unlimited-themes" target="_blank">', '</a>',
|
59 |
+
'<a href="https://wppopupmaker.com/extensions/advanced-theme-builder" target="_blank">', '</a>'
|
60 |
+
); ?>
|
61 |
+
</p>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="changelog">
|
66 |
+
<h3><?php _e( 'Further Enhancements & Updates', 'popup-maker' );?></h3>
|
67 |
+
|
68 |
+
<div class="feature-section col three-col">
|
69 |
+
<div>
|
70 |
+
<h4><?php _e( 'Exit Intent', 'popup-maker' );?></h4>
|
71 |
+
<p>
|
72 |
+
<?php printf(
|
73 |
+
__( 'Easily convert abandoning users into cash with our Exit Intent Extension. Exit Intent now comes with Hard Exit Technology. Learn more %shere%s.', 'popup-maker' ),
|
74 |
+
'<a href="https://wppopupmaker.com/extensions/exit-intent-popups" target="_blank">', '</a>'
|
75 |
+
); ?>
|
76 |
+
</p>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
<div>
|
80 |
+
<h4><?php _e( 'Lightweight & Dependable', 'popup-maker' );?></h4>
|
81 |
+
<p><?php _e( 'Speed matters, and at only 5.9kb, our popups won’t slow you down. Our optimization techniques and program enhancement means your popups will perform at a consistently high level with 100% uptime.' ,'popup-maker' );?></p>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<div class="last-feature">
|
85 |
+
<h4><?php _e( 'Popup Tags & Categories', 'popup-maker' );?></h4>
|
86 |
+
<p><?php _e( 'Popup Maker allows you to categorize and tag your popups for easy organization and recognition.', 'popup-maker' );?></p>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<div class="return-to-dashboard">
|
92 |
+
<a href="<?php echo esc_url( admin_url( 'post.php?post='. popmake_get_default_popup_theme() .'&action=edit' ) ); ?>"><?php _e( 'Customize Your First Theme', 'popup-maker' ); ?></a> ·
|
93 |
+
<a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=popup' ) ); ?>"><?php _e( 'Create a Modal', 'popup-maker' ); ?></a> ·
|
94 |
+
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'popmake-changelog' ), 'index.php' ) ) ); ?>"><?php _e( 'View the Full Changelog', 'popup-maker' ); ?></a>
|
95 |
+
</div>
|
96 |
+
</div><?php
|
97 |
+
}
|
includes/admin/welcome/changelog.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_changelog_page() {
|
3 |
+
list( $display_version ) = explode( '-', POPMAKE_VERSION );
|
4 |
+
?>
|
5 |
+
<div class="wrap about-wrap">
|
6 |
+
<h1><?php _e( 'Popup Maker Changelog', 'popup-maker' ); ?></h1>
|
7 |
+
<div class="about-text"><?php _e( 'Thank you for updating to the latest version! Are you ready to destroy your old conversion rates and transform your website? We sure are!', 'popup-maker' ); ?></div>
|
8 |
+
<div class="popmake-badge"><?php printf( __( 'Version %s', 'popup-maker' ), $display_version ); ?></div>
|
9 |
+
|
10 |
+
<?php popmake_welcome_page_tabs(); ?>
|
11 |
+
|
12 |
+
<div class="changelog">
|
13 |
+
<h3><?php _e( 'Full Changelog', 'popup-maker' );?></h3>
|
14 |
+
|
15 |
+
<div class="feature-section">
|
16 |
+
<?php echo popmake_parse_readme(); ?>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
<?php
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Parse the POPMAKE readme.txt file
|
25 |
+
*
|
26 |
+
* @since 1.0
|
27 |
+
* @return string $readme HTML formatted readme file
|
28 |
+
*/
|
29 |
+
function popmake_parse_readme() {
|
30 |
+
$file = file_exists( POPMAKE_DIR . '/readme.txt' ) ? POPMAKE_DIR . '/readme.txt' : null;
|
31 |
+
if ( ! $file ) {
|
32 |
+
$readme = '<p>' . __( 'No valid changlog was found.', 'popup-maker' ) . '</p>';
|
33 |
+
} else {
|
34 |
+
$readme = file_get_contents( $file );
|
35 |
+
$readme = nl2br( esc_html( $readme ) );
|
36 |
+
$readme = explode( '== Changelog ==', $readme );
|
37 |
+
$readme = end( $readme );
|
38 |
+
|
39 |
+
$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
|
40 |
+
$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
|
41 |
+
$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
|
42 |
+
$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
|
43 |
+
$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
|
44 |
+
}
|
45 |
+
return $readme;
|
46 |
+
}
|
includes/admin/welcome/credits.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_credits_page() {
|
3 |
+
list( $display_version ) = explode( '-', POPMAKE_VERSION );
|
4 |
+
?>
|
5 |
+
<div class="wrap about-wrap">
|
6 |
+
<h1><?php printf( __( 'Welcome to Popup Maker %s', 'popup-maker' ), $display_version ); ?></h1>
|
7 |
+
<div class="about-text"><?php _e( 'Thank you for updating to the latest version! Are you ready to destroy your old conversion rates and transform your website? We sure are!', 'popup-maker' ); ?></div>
|
8 |
+
<div class="popmake-badge"><?php printf( __( 'Version %s', 'popup-maker' ), $display_version ); ?></div>
|
9 |
+
|
10 |
+
<?php popmake_welcome_page_tabs(); ?>
|
11 |
+
|
12 |
+
<p class="about-description"><?php _e( 'Popup Maker is created by expert WordPress developers who aim to provide the #1 popup marketing platform for converting more users with WordPress.', 'popup-maker' ); ?></p>
|
13 |
+
<ul class="wp-people-group">
|
14 |
+
<li class="wp-person">
|
15 |
+
<a href="https://profiles.wordpress.org/danieliser" title="View danieliser">
|
16 |
+
<img src="http://www.gravatar.com/avatar/<?php echo md5( "danieliser@wizardinternetsolutions.com" );?>" width="64" height="64" class="gravatar" alt="danieliser" />
|
17 |
+
</a>
|
18 |
+
<a class="web" href="https://profiles.wordpress.org/danieliser" target="_blank">danieliser</a>
|
19 |
+
</li>
|
20 |
+
<li class="wp-person">
|
21 |
+
<a href="https://profiles.wordpress.org/waltmesser/" title="View waltmesser">
|
22 |
+
<img src="http://www.gravatar.com/avatar/<?php echo md5( "walt@wizardinternetsolutions.com" );?>" width="64" height="64" class="gravatar" alt="waltmesser" />
|
23 |
+
</a>
|
24 |
+
<a class="web" href="https://profiles.wordpress.org/waltmesser/" target="_blank">waltmesser</a>
|
25 |
+
</li>
|
26 |
+
</ul>
|
27 |
+
</div><?php
|
28 |
+
}
|
includes/admin/welcome/getting-started.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_getting_started_page() {
|
3 |
+
list( $display_version ) = explode( '-', POPMAKE_VERSION );
|
4 |
+
?>
|
5 |
+
<div class="wrap about-wrap">
|
6 |
+
<h1><?php printf( __( 'Welcome to Popup Maker %s', 'popup-maker' ), $display_version ); ?></h1>
|
7 |
+
<div class="about-text"><?php _e( 'Thank you for updating to the latest version! Are you ready to destroy your old conversion rates and transform your website? We sure are!', 'popup-maker' ); ?></div>
|
8 |
+
<div class="popmake-badge"><?php printf( __( 'Version %s', 'popup-maker' ), $display_version ); ?></div>
|
9 |
+
|
10 |
+
<?php popmake_welcome_page_tabs(); ?>
|
11 |
+
|
12 |
+
|
13 |
+
<p class="about-description"><?php _e( 'Use the tips below to get started using Popup Maker. You will have those high performance popups up and running in no time!', 'popup-maker' ); ?></p>
|
14 |
+
|
15 |
+
<div class="changelog">
|
16 |
+
<h3><?php _e( 'Creating Your First Popup Maker Popup', 'popup-maker' );?></h3>
|
17 |
+
|
18 |
+
<div class="feature-section">
|
19 |
+
|
20 |
+
<img src="<?php echo POPMAKE_URL . 'assets/images/screenshots/edit-popup.png'; ?>" class="popmake-welcome-screenshots"/>
|
21 |
+
|
22 |
+
<h4><?php printf( __( '<a href="%s">%s → Add New</a>', 'popup-maker' ), admin_url( 'post-new.php?post_type=popup' ), popmake_get_label_plural() ); ?></h4>
|
23 |
+
<p><?php printf( __( 'The %s menu is your access point for all aspects of your Popup Maker product creation and setup. To create your first popup, simply click Add New and then choose from many available options to get it just right.', 'popup-maker' ), popmake_get_label_plural() ); ?></p>
|
24 |
+
|
25 |
+
<h4><?php _e( 'Display Options', 'popup-maker' );?></h4>
|
26 |
+
<p><?php _e( 'Display options control how your popup shows and how it behaves, respectively. Set the size, how the background operates, animation options, and positioning positioning.', 'popup-maker' );?></p>
|
27 |
+
|
28 |
+
<h4><?php _e( 'Close Option', 'popup-maker' );?></h4>
|
29 |
+
<p><?php _e( 'These settings allow you to control how a user is able to close your popups: clicking on the background overlay, pressing ESC, or pressing F4. You can enable or disable all of these settings, or pick and choose based on your preference. Also, you can prevent users from closing your popups using our Forced Interaction Extension.', 'popup-maker' );?></p>
|
30 |
+
|
31 |
+
<h4><?php _e( 'Targeting Conditions', 'popup-maker' );?></h4>
|
32 |
+
<p><?php _e( 'Use Targeting Conditions to load your popups wherever you please! If you’re not running some type of auto open popup extension (Scroll Triggered, Exit Intent, or Auto Open), then remember, you have to call your popup using the <em>popmake class</em> on your HTML element (more information below.)', 'popup-maker' );?></p>
|
33 |
+
|
34 |
+
<h4><?php _e( 'Theme Settings', 'popup-maker' );?></h4>
|
35 |
+
<p><?php _e( 'Choose your theme from the drop down to customize how your popup looks. Without Unlimited Themes, only the Default Theme will appear, which you can customize and change the name to suit your needs.', 'popup-maker' );?></p>
|
36 |
+
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="changelog">
|
41 |
+
<h3><?php _e( 'Calling Your Popups Anywhere', 'popup-maker' );?></h3>
|
42 |
+
|
43 |
+
<div class="feature-section">
|
44 |
+
|
45 |
+
<img src="<?php echo POPMAKE_URL . 'assets/images/screenshots/edit-popup.png'; ?>" class="popmake-welcome-screenshots"/>
|
46 |
+
|
47 |
+
<h4><?php _e( 'Using the Popup Maker CSS Tag', 'popup-maker' );?></h4>
|
48 |
+
<p><?php _e( 'In the <em>All Popups Menu</em>, you can find all of your popups and their various attributes. One of the most important attributes is the CSS Class of your popups. You will use this class wherever you want to call your popups!', 'popup-maker' );?></p>
|
49 |
+
<p>Examples:</p>
|
50 |
+
<ul class="inline">
|
51 |
+
<li><code><a class=”popmake-####”><?php _e( 'Read More', 'popup-maker' ); ?></a></code></li>
|
52 |
+
<li><code><button class=”popmake-####”><?php _e( 'Sign Up Now!', 'popup-maker' ); ?></button></code></li>
|
53 |
+
<li><code><img class=”popmake-####”/></code></li>
|
54 |
+
</ul>
|
55 |
+
|
56 |
+
<h4><?php _e( 'Using Popup Maker Short Codes', 'popup-maker' );?></h4>
|
57 |
+
<p><?php _e( 'You can also use shortcodes to create popups directly inline with the content of your posts and pages. This is useful if you wanna have unique content in your popups for each page/post.', 'popup-maker' );?></p>
|
58 |
+
<p>For Example:</p>
|
59 |
+
<ul class="inline">
|
60 |
+
<li><code>[popup id=The-Pop-Up-Name size="small"]Put your content and other [shortcodes] here.[/modal]</code></li>
|
61 |
+
</ul>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="changelog">
|
66 |
+
<h3><?php _e( 'Need Help?', 'popup-maker' );?></h3>
|
67 |
+
|
68 |
+
<div class="feature-section">
|
69 |
+
|
70 |
+
<h4><?php _e( 'Top-Notch Support','popup-maker' );?></h4>
|
71 |
+
<p><?php _e( 'We provide top-notch support! If you encounter a problem or have a question, post a question in the WordPress Support Forums, or if you’ve purchased a membership or extension, the Members Only Forums.', 'popup-maker' );?></p>
|
72 |
+
|
73 |
+
<h4><?php _e( 'Need a Solution Now?', 'popup-maker' );?></h4>
|
74 |
+
<p><?php
|
75 |
+
printf(
|
76 |
+
__( 'Our <a href="%s" target="_blank">Priority Support Forums</a> are there for customers that need a solution and/or more in-depth assistance immediately.', 'popup-maker' ),
|
77 |
+
'https://wppopupmaker.com/support/pricing'
|
78 |
+
);?>
|
79 |
+
</p>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div class="changelog">
|
84 |
+
<h3><?php _e( 'Stay Up-to-Date', 'popup-maker' );?></h3>
|
85 |
+
|
86 |
+
<div class="feature-section">
|
87 |
+
|
88 |
+
<h4><?php _e( 'Get Notified of Extension Releases','popup-maker' );?></h4>
|
89 |
+
<p><?php
|
90 |
+
printf(
|
91 |
+
__( 'New extensions that make Popup Maker even more powerful are released nearly every single week. <a href="%s" target="_blank">Subscribe to the newsletter</a> to stay up to date with our latest releases. Signup now to ensure you do not miss a release!', 'popup-maker' ),
|
92 |
+
'https://wppopupmaker.com/newsletter-sign-up'
|
93 |
+
);?>
|
94 |
+
</p>
|
95 |
+
|
96 |
+
<h4><?php _e( 'Get Alerted About New Tutorials', 'popup-maker' );?></h4>
|
97 |
+
<p><?php
|
98 |
+
printf(
|
99 |
+
__( '<a href="%s" target="_blank">Signup now</a> to hear about the latest tutorial releases that explain how to take Popup Maker further.', 'popup-maker' ),
|
100 |
+
'https://wppopupmaker.com/newsletter-sign-up'
|
101 |
+
);?>
|
102 |
+
</p>
|
103 |
+
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<div class="changelog">
|
108 |
+
<h3><?php _e( 'Extensions for Everything', 'popup-maker' );?></h3>
|
109 |
+
|
110 |
+
<div class="feature-section">
|
111 |
+
|
112 |
+
<h4><?php _e( '9 Extensions and Counting...','popup-maker' );?></h4>
|
113 |
+
<p><?php _e( 'Add-on plugins are available that greatly extend the default functionality of Popup Maker. There are extensions enhancing the Theme Builder capabilities, extensions for marketing your most precious content like Auto Open and Exit Intent, plus much more now, and even more to come.', 'popup-maker' );?></p>
|
114 |
+
<p><?php _e( 'We have over 25 more extensions in works, and over 35 integration extensions in the works as well. Stay updated and tuned in to be a part of what is going to be the robust Popup Maker tool on the market.', 'popup-maker' );?></p>
|
115 |
+
|
116 |
+
<h4><?php _e( 'Visit the Extension Store', 'popup-maker' );?></h4>
|
117 |
+
<p><?php
|
118 |
+
printf(
|
119 |
+
__( '<a href="%s" target="_blank">The Extensions store</a> has a list of all available extensions, including convenient category filters so you can find exactly what you are looking for.', 'popup-maker' ),
|
120 |
+
'https://wppopupmaker.com/extensions'
|
121 |
+
);?>
|
122 |
+
</p>
|
123 |
+
<p><?php _e;?></p>
|
124 |
+
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<div class="return-to-dashboard">
|
129 |
+
<a href="<?php echo esc_url( admin_url( 'post.php?post='. popmake_get_default_popup_theme() .'&action=edit' ) ); ?>"><?php _e( 'Customize Your First Theme', 'popup-maker' ); ?></a> ·
|
130 |
+
<a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=popup' ) ); ?>"><?php _e( 'Create a Modal', 'popup-maker' ); ?></a> ·
|
131 |
+
<a href="<?php echo esc_url( 'https://wppopupmaker.com/getting-started' ); ?>" target="_blank"><?php _e( 'View the Full Getting Started Guide', 'popup-maker' ); ?></a>
|
132 |
+
</div>
|
133 |
+
</div><?php
|
134 |
+
}
|
includes/ajax-calls.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
function popmake_optin_ajax_call() {
|
5 |
+
// Check our nonce and make sure it's correct.
|
6 |
+
check_ajax_referer(POPMAKE_NONCE, POPMAKE_NONCE);
|
7 |
+
if ( isset( $_REQUEST['optin_dismiss'] ) ) {
|
8 |
+
$optin = $_REQUEST['optin_name'];
|
9 |
+
$type = $_REQUEST['optin_type'];
|
10 |
+
if($type == 'user') {
|
11 |
+
update_user_meta( get_current_user_id(), '_popmake_dismiss_optin_' . $optin, true );
|
12 |
+
}
|
13 |
+
else {
|
14 |
+
update_option( '_popmake_dismiss_optin_' . $optin, true );
|
15 |
+
}
|
16 |
+
$response['success'] = true;
|
17 |
+
}
|
18 |
+
$response['new_nonce'] = wp_create_nonce(POPMAKE_NONCE);
|
19 |
+
echo json_encode($response);
|
20 |
+
die();
|
21 |
+
}
|
22 |
+
|
23 |
+
add_action('wp_ajax_popmake_optin', 'popmake_optin_ajax_call');
|
24 |
+
add_action('wp_ajax_nopriv_popmake_optin', 'popmake_optin_ajax_call');
|
includes/defaults.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Default Settings, Popup Settings, Theme Settings.
|
4 |
+
*/
|
5 |
+
|
6 |
+
add_filter('popmake_popup_display_defaults', 'popmake_popup_display_defaults', 0);
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Returns default display settings for popups.
|
10 |
+
* @param array $defaults
|
11 |
+
* @return array
|
12 |
+
*/
|
13 |
+
function popmake_popup_display_defaults( $defaults = array() ) {
|
14 |
+
return array_merge( $defaults, array(
|
15 |
+
'overlay_disabled' => false,
|
16 |
+
'scrollable_content' => false,
|
17 |
+
'size' => 'medium',
|
18 |
+
'responsive_min_width' => '',
|
19 |
+
'responsive_min_width_unit' => 'px',
|
20 |
+
'responsive_max_width' => '',
|
21 |
+
'responsive_max_width_unit' => 'px',
|
22 |
+
'custom_width' => 640,
|
23 |
+
'custom_width_unit' => 'px',
|
24 |
+
'custom_width_unit' => 'px',
|
25 |
+
'custom_height' => 380,
|
26 |
+
'custom_height_unit' => 'px',
|
27 |
+
'custom_height_auto' => true,
|
28 |
+
'location' => 'center top',
|
29 |
+
'position_top' => 100,
|
30 |
+
'position_left' => 0,
|
31 |
+
'position_bottom' => 0,
|
32 |
+
'position_right' => 0,
|
33 |
+
'position_fixed' => true,
|
34 |
+
'animation_type' => 'fade',
|
35 |
+
'animation_speed' => 350,
|
36 |
+
'animation_origin' => 'center top',
|
37 |
+
));
|
38 |
+
}
|
39 |
+
|
40 |
+
add_filter('popmake_popup_close_defaults', 'popmake_popup_close_defaults', 0);
|
41 |
+
|
42 |
+
|
43 |
+
function popmake_popup_close_defaults( $defaults ) {
|
44 |
+
return array_merge( $defaults, array(
|
45 |
+
'overlay_click' => false,
|
46 |
+
'esc_press' => false,
|
47 |
+
'f4_press' => false,
|
48 |
+
));
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
add_filter('popmake_popup_theme_overlay_defaults', 'popmake_popup_theme_overlay_defaults', 0);
|
53 |
+
function popmake_popup_theme_overlay_defaults( $defaults ) {
|
54 |
+
return array_merge( $defaults, array(
|
55 |
+
'background_color' => '#ffffff',
|
56 |
+
'background_opacity' => 100,
|
57 |
+
));
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
add_filter('popmake_popup_theme_container_defaults', 'popmake_popup_theme_container_defaults', 0);
|
62 |
+
function popmake_popup_theme_container_defaults( $defaults ) {
|
63 |
+
return array_merge( $defaults, array(
|
64 |
+
'padding' => 18,
|
65 |
+
'background_color' => '#f9f9f9',
|
66 |
+
'background_opacity' => 100,
|
67 |
+
'border_style' => 'none',
|
68 |
+
'border_color' => '#000000',
|
69 |
+
'border_width' => 1,
|
70 |
+
'border_radius' => 0,
|
71 |
+
'boxshadow_inset' => 'no',
|
72 |
+
'boxshadow_horizontal' => 1,
|
73 |
+
'boxshadow_vertical' => 1,
|
74 |
+
'boxshadow_blur' => 3,
|
75 |
+
'boxshadow_spread' => 0,
|
76 |
+
'boxshadow_color' => '#020202',
|
77 |
+
'boxshadow_opacity' => 23,
|
78 |
+
));
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
add_filter('popmake_popup_theme_title_defaults', 'popmake_popup_theme_title_defaults', 0);
|
83 |
+
function popmake_popup_theme_title_defaults( $defaults ) {
|
84 |
+
return array_merge( $defaults, array(
|
85 |
+
'font_color' => '#000000',
|
86 |
+
'line_height' => 36,
|
87 |
+
'font_size' => 32,
|
88 |
+
'font_family' => 'inherit',
|
89 |
+
'font_weight' => 'inherit',
|
90 |
+
'font_style' => 'normal',
|
91 |
+
'font_align' => 'left',
|
92 |
+
'textshadow_horizontal' => 0,
|
93 |
+
'textshadow_vertical' => 0,
|
94 |
+
'textshadow_blur' => 0,
|
95 |
+
'textshadow_color' => '#020202',
|
96 |
+
'textshadow_opacity' => 23,
|
97 |
+
));
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
add_filter('popmake_popup_theme_content_defaults', 'popmake_popup_theme_content_defaults', 0);
|
104 |
+
function popmake_popup_theme_content_defaults( $defaults ) {
|
105 |
+
return array_merge( $defaults, array(
|
106 |
+
'font_color' => '#8c8c8c',
|
107 |
+
'font_family' => 'inherit',
|
108 |
+
'font_weight' => 'inherit',
|
109 |
+
'font_style' => 'normal',
|
110 |
+
));
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
add_filter('popmake_popup_theme_close_defaults', 'popmake_popup_theme_close_defaults', 0);
|
116 |
+
function popmake_popup_theme_close_defaults( $defaults ) {
|
117 |
+
return array_merge( $defaults, array(
|
118 |
+
'text' => __( 'CLOSE', 'popup-maker' ),
|
119 |
+
'location' => 'topright',
|
120 |
+
'position_top' => 0,
|
121 |
+
'position_left' => 0,
|
122 |
+
'position_bottom' => 0,
|
123 |
+
'position_right' => 0,
|
124 |
+
'padding' => 8,
|
125 |
+
'background_color' => '#00b7cd',
|
126 |
+
'background_opacity' => 100,
|
127 |
+
'font_color' => '#ffffff',
|
128 |
+
'line_height' => 14,
|
129 |
+
'font_size' => 12,
|
130 |
+
'font_family' => 'inherit',
|
131 |
+
'font_weight' => 'inherit',
|
132 |
+
'font_style' => 'normal',
|
133 |
+
'border_style' => 'none',
|
134 |
+
'border_color' => '#ffffff',
|
135 |
+
'border_width' => 1,
|
136 |
+
'border_radius' => 0,
|
137 |
+
'boxshadow_inset' => 'no',
|
138 |
+
'boxshadow_horizontal' => 0,
|
139 |
+
'boxshadow_vertical' => 0,
|
140 |
+
'boxshadow_blur' => 0,
|
141 |
+
'boxshadow_spread' => 0,
|
142 |
+
'boxshadow_color' => '#020202',
|
143 |
+
'boxshadow_opacity' => 23,
|
144 |
+
'textshadow_horizontal' => 0,
|
145 |
+
'textshadow_vertical' => 0,
|
146 |
+
'textshadow_blur' => 0,
|
147 |
+
'textshadow_color' => '#000000',
|
148 |
+
'textshadow_opacity' => 23,
|
149 |
+
));
|
150 |
+
}
|
includes/extensions-functions.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function popmake_available_extensions() {
|
4 |
+
if(($extensions = get_site_transient('popup-maker-extension-list')) === false) {
|
5 |
+
|
6 |
+
// data to send in our API request
|
7 |
+
$api_params = array(
|
8 |
+
'edd_action' => 'extension_list',
|
9 |
+
'url' => home_url()
|
10 |
+
);
|
11 |
+
// Call the custom API.
|
12 |
+
$response = wp_remote_get( add_query_arg( $api_params, POPMAKE_API_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
|
13 |
+
|
14 |
+
// make sure the response came back okay
|
15 |
+
if ( is_wp_error( $response ) )
|
16 |
+
return array();
|
17 |
+
|
18 |
+
$extensions = json_decode( wp_remote_retrieve_body( $response ) );
|
19 |
+
set_site_transient( 'popup-maker-extension-list', $extensions, 86400 );
|
20 |
+
}
|
21 |
+
return $extensions;
|
22 |
+
}
|
23 |
+
|
24 |
+
add_filter('popmake_existing_extension_images', 'popmake_core_extension_images', 10);
|
25 |
+
function popmake_core_extension_images($array) {
|
26 |
+
return array_merge($array, array(
|
27 |
+
'premium-support',
|
28 |
+
'unlimited-themes',
|
29 |
+
'scroll-triggered-popups',
|
30 |
+
'forced-interaction',
|
31 |
+
'age-verification-modals',
|
32 |
+
'advanced-theme-builder',
|
33 |
+
'exit-intent-popups',
|
34 |
+
'auto-open-popups',
|
35 |
+
'ajax-login-modals',
|
36 |
+
));
|
37 |
+
}
|
includes/general-functions.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Returns array key from dot notated array key..
|
4 |
+
*
|
5 |
+
* @since 1.0
|
6 |
+
* @param string $a is the array you are searching.
|
7 |
+
* @param string $path is the dot notated path.
|
8 |
+
* @param string $default is the default returned if key empty or not found.
|
9 |
+
* @return mixed results of lookup
|
10 |
+
*/
|
11 |
+
function popmake_resolve(array $a, $path, $default = null){
|
12 |
+
$current = $a;
|
13 |
+
$p = strtok($path, '.');
|
14 |
+
while ($p !== false) {
|
15 |
+
if (!isset($current[$p])) {
|
16 |
+
return $default;
|
17 |
+
}
|
18 |
+
$current = $current[$p];
|
19 |
+
$p = strtok('.');
|
20 |
+
}
|
21 |
+
return $current;
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
if(!function_exists("enqueue_popup")){
|
27 |
+
function enqueue_popup($id)
|
28 |
+
{
|
29 |
+
if(!is_array($id))
|
30 |
+
PopMake_Popups::enqueue_popup($id);
|
31 |
+
else
|
32 |
+
foreach($id as $i)
|
33 |
+
PopMake_Popups::enqueue_popup($i);
|
34 |
+
}}
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
function popmake_get_license($key = NULL) {
|
39 |
+
$license = popmake_get_option(POPMAKE_SLUG.'-license');
|
40 |
+
if(!$license)
|
41 |
+
{
|
42 |
+
$license = array(
|
43 |
+
'valid' => false,
|
44 |
+
'key' => '',
|
45 |
+
'status' => array(
|
46 |
+
'code' => NULL,
|
47 |
+
'message' => NULL,
|
48 |
+
'expires' => NULL,
|
49 |
+
'domains' => NULL
|
50 |
+
)
|
51 |
+
);
|
52 |
+
popmake_update_option(POPMAKE_SLUG.'-license', $license);
|
53 |
+
}
|
54 |
+
return $license && $key ? emresolve($license, $key) : $license;
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
function popmake_get_site_option( $key )
|
60 |
+
{
|
61 |
+
global $blog_id;
|
62 |
+
if(function_exists('is_multisite') && is_multisite() && $blog_id)
|
63 |
+
return get_blog_option($blog_id, $key);
|
64 |
+
else
|
65 |
+
return get_site_option($key);
|
66 |
+
}
|
67 |
+
|
68 |
+
|
69 |
+
function popmake_update_site_option( $key, $value ) {
|
70 |
+
global $blog_id;
|
71 |
+
if(function_exists('is_multisite') && is_multisite() && $blog_id)
|
72 |
+
return update_blog_option($blog_id, $key, $value);
|
73 |
+
else
|
74 |
+
return update_site_option($key, $value);
|
75 |
+
}
|
76 |
+
|
77 |
+
function popmake_delete_site_option( $key ) {
|
78 |
+
global $blog_id;
|
79 |
+
if(function_exists('is_multisite') && is_multisite() && $blog_id)
|
80 |
+
return delete_blog_option($blog_id, $key);
|
81 |
+
else
|
82 |
+
return delete_site_option($key);
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
function popmake_debug( $var ) {
|
87 |
+
echo '<pre>'; var_dump($var); echo '</pre>';
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Deprecated PHP v5.3 functions.
|
93 |
+
*/
|
94 |
+
|
95 |
+
if (!function_exists('array_replace_recursive'))
|
96 |
+
{
|
97 |
+
function array_replace_recursive($array, $array1)
|
98 |
+
{
|
99 |
+
// handle the arguments, merge one by one
|
100 |
+
$args = func_get_args();
|
101 |
+
$array = $args[0];
|
102 |
+
if (!is_array($array))
|
103 |
+
{
|
104 |
+
return $array;
|
105 |
+
}
|
106 |
+
for ($i = 1; $i < count($args); $i++)
|
107 |
+
{
|
108 |
+
if (is_array($args[$i]))
|
109 |
+
{
|
110 |
+
$array = recurse($array, $args[$i]);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
return $array;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
if (!function_exists('recurse')) {
|
117 |
+
function recurse($array, $array1) {
|
118 |
+
foreach ($array1 as $key => $value)
|
119 |
+
{
|
120 |
+
// create new key in $array, if it is empty or not an array
|
121 |
+
if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
|
122 |
+
{
|
123 |
+
$array[$key] = array();
|
124 |
+
}
|
125 |
+
|
126 |
+
// overwrite the value in the base array
|
127 |
+
if (is_array($value))
|
128 |
+
{
|
129 |
+
$value = recurse($array[$key], $value);
|
130 |
+
}
|
131 |
+
$array[$key] = $value;
|
132 |
+
}
|
133 |
+
return $array;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
|
138 |
+
// For WP versions before 3.6
|
139 |
+
if (!function_exists('has_shortcode')) {
|
140 |
+
function has_shortcode( $content, $tag ) {
|
141 |
+
if ( false === strpos( $content, '[' ) ) {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
if ( shortcode_exists( $tag ) ) {
|
146 |
+
preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
|
147 |
+
if ( empty( $matches ) )
|
148 |
+
return false;
|
149 |
+
|
150 |
+
foreach ( $matches as $shortcode ) {
|
151 |
+
if ( $tag === $shortcode[2] ) {
|
152 |
+
return true;
|
153 |
+
} elseif ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {
|
154 |
+
return true;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
return false;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
if (!function_exists('shortcode_exists')) {
|
163 |
+
function shortcode_exists( $tag ) {
|
164 |
+
global $shortcode_tags;
|
165 |
+
return array_key_exists( $tag, $shortcode_tags );
|
166 |
+
}
|
167 |
+
}
|
includes/google-fonts.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Google Web Font Integrations.
|
5 |
+
*/
|
6 |
+
|
7 |
+
function popmake_get_google_webfonts_list( $key = 'AIzaSyAqXbKCykzxMy2-fnmGBjiwI_-LdfoFxAU', $sort = 'alpha' ) {
|
8 |
+
/*
|
9 |
+
$key = Web Fonts Developer API
|
10 |
+
$sort=
|
11 |
+
alpha: Sort the list alphabetically
|
12 |
+
date: Sort the list by date added (most recent font added or updated first)
|
13 |
+
popularity: Sort the list by popularity (most popular family first)
|
14 |
+
style: Sort the list by number of styles available (family with most styles first)
|
15 |
+
trending: Sort the list by families seeing growth in usage (family seeing the most growth first)
|
16 |
+
*/
|
17 |
+
|
18 |
+
if($font_list = get_transient( 'popmake-google-fonts-list' )) {
|
19 |
+
return $font_list;
|
20 |
+
}
|
21 |
+
|
22 |
+
$google_api_url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=' . $key . '&sort=' . $sort;
|
23 |
+
$response = wp_remote_retrieve_body( wp_remote_get($google_api_url, array('sslverify' => false )) );
|
24 |
+
if( !is_wp_error( $response ) ) {
|
25 |
+
$data = json_decode($response, true);
|
26 |
+
$items = $data['items'];
|
27 |
+
$font_list = array();
|
28 |
+
foreach($items as $item) {
|
29 |
+
$font_list[$item['family']] = $item;
|
30 |
+
}
|
31 |
+
set_transient( 'popmake-google-fonts-list', $font_list, WEEK_IN_SECONDS );
|
32 |
+
return $font_list;
|
33 |
+
}
|
34 |
+
|
35 |
+
return array();
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
add_filter('popmake_font_family_options', 'popmake_google_font_font_family_options', 20);
|
40 |
+
function popmake_google_font_font_family_options( $options ) {
|
41 |
+
$options = array_merge($options, array(
|
42 |
+
// option => value
|
43 |
+
__( 'Google Web Fonts⤵', 'popup-maker' ) => '',
|
44 |
+
));
|
45 |
+
foreach(popmake_get_google_webfonts_list() as $font_family => $font) {
|
46 |
+
$options[ __( $font_family, 'popup-maker' ) ] = $font_family;
|
47 |
+
}
|
48 |
+
return $options;
|
49 |
+
}
|
includes/input-options.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Selectbox options,and other array based data sets used for options.
|
4 |
+
*/
|
5 |
+
|
6 |
+
add_filter('popmake_size_unit_options', 'popmake_core_size_unit_options',10);
|
7 |
+
function popmake_core_size_unit_options( $options ) {
|
8 |
+
return array_merge($options, array(
|
9 |
+
// option => value
|
10 |
+
__( 'PX', 'popup-maker' ) => 'px',
|
11 |
+
__( '%', 'popup-maker' ) => '%',
|
12 |
+
__( 'EM', 'popup-maker' ) => 'em',
|
13 |
+
__( 'REM', 'popup-maker' ) => 'rem',
|
14 |
+
));
|
15 |
+
}
|
16 |
+
|
17 |
+
add_filter('popmake_border_style_options', 'popmake_core_border_style_options',10);
|
18 |
+
function popmake_core_border_style_options( $options ) {
|
19 |
+
return array_merge($options, array(
|
20 |
+
// option => value
|
21 |
+
__( 'None', 'popup-maker' ) => 'none',
|
22 |
+
__( 'Solid', 'popup-maker' ) => 'solid',
|
23 |
+
__( 'Dotted', 'popup-maker' ) => 'dotted',
|
24 |
+
__( 'Dashed', 'popup-maker' ) => 'dashed',
|
25 |
+
__( 'Double', 'popup-maker' ) => 'double',
|
26 |
+
__( 'Groove', 'popup-maker' ) => 'groove',
|
27 |
+
__( 'Inset', 'popup-maker' ) => 'inset',
|
28 |
+
__( 'Outset', 'popup-maker' ) => 'outset',
|
29 |
+
__( 'Ridge', 'popup-maker' ) => 'ridge',
|
30 |
+
));
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
add_filter('popmake_font_family_options', 'popmake_core_font_family_options',10);
|
35 |
+
function popmake_core_font_family_options( $options ) {
|
36 |
+
return array_merge($options, array(
|
37 |
+
// option => value
|
38 |
+
__( 'Use Your Themes', 'popup-maker' ) => 'inherit',
|
39 |
+
__( 'Sans-Serif', 'popup-maker' ) => 'Sans-Serif',
|
40 |
+
__( 'Tahoma', 'popup-maker' ) => 'Tahoma',
|
41 |
+
__( 'Georgia', 'popup-maker' ) => 'Georgia',
|
42 |
+
__( 'Comic Sans MS', 'popup-maker' ) => 'Comic Sans MS',
|
43 |
+
__( 'Arial', 'popup-maker' ) => 'Arial',
|
44 |
+
__( 'Lucida Grande', 'popup-maker' ) => 'Lucida Grande',
|
45 |
+
__( 'Times New Roman', 'popup-maker' ) => 'Times New Roman',
|
46 |
+
));
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
add_filter('popmake_font_weight_options', 'popmake_core_font_weight_options',10);
|
51 |
+
function popmake_core_font_weight_options( $options ) {
|
52 |
+
return array_merge($options, array(
|
53 |
+
__( 'Normal', 'popup-maker' ) => 'normal',
|
54 |
+
__( '100 ', 'popup-maker' ) => '100',
|
55 |
+
__( '200 ', 'popup-maker' ) => '200',
|
56 |
+
__( '300 ', 'popup-maker' ) => '300',
|
57 |
+
__( '400 ', 'popup-maker' ) => '400',
|
58 |
+
__( '500 ', 'popup-maker' ) => '500',
|
59 |
+
__( '600 ', 'popup-maker' ) => '600',
|
60 |
+
__( '700 ', 'popup-maker' ) => '700',
|
61 |
+
__( '800 ', 'popup-maker' ) => '800',
|
62 |
+
__( '900 ', 'popup-maker' ) => '900',
|
63 |
+
));
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
add_filter('popmake_font_style_options', 'popmake_core_font_style_options',10);
|
68 |
+
function popmake_core_font_style_options( $options ) {
|
69 |
+
return array_merge($options, array(
|
70 |
+
__( 'Normal', 'popup-maker' ) => 'normal',
|
71 |
+
__( 'Italic', 'popup-maker' ) => 'italic',
|
72 |
+
));
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
add_filter('popmake_text_align_options', 'popmake_core_text_align_options',10);
|
77 |
+
function popmake_core_text_align_options( $options ) {
|
78 |
+
return array_merge($options, array(
|
79 |
+
// option => value
|
80 |
+
__( 'Left', 'popup-maker' ) => 'left',
|
81 |
+
__( 'Center', 'popup-maker' ) => 'center',
|
82 |
+
__( 'Right', 'popup-maker' ) => 'right'
|
83 |
+
));
|
84 |
+
}
|
85 |
+
|
86 |
+
add_filter('popmake_popup_display_size_options', 'popmake_popup_display_size_options_responsive',10);
|
87 |
+
function popmake_popup_display_size_options_responsive( $options ) {
|
88 |
+
return array_merge($options, array(
|
89 |
+
// option => value
|
90 |
+
__( 'Responsive Sizes⤵', 'popup-maker' ) => '',
|
91 |
+
__( 'Nano', 'popup-maker' ) => 'nano',
|
92 |
+
__( 'Micro', 'popup-maker' ) => 'micro',
|
93 |
+
__( 'Tiny', 'popup-maker' ) => 'tiny',
|
94 |
+
__( 'Small', 'popup-maker' ) => 'small',
|
95 |
+
__( 'Medium', 'popup-maker' ) => 'medium',
|
96 |
+
__( 'Normal', 'popup-maker' ) => 'normal',
|
97 |
+
__( 'Large', 'popup-maker' ) => 'large',
|
98 |
+
__( 'X Large', 'popup-maker' ) => 'xlarge',
|
99 |
+
__( 'Non Responsive Sizes⤵', 'popup-maker' ) => '',
|
100 |
+
__( 'Auto', 'popup-maker' ) => 'auto',
|
101 |
+
__( 'Custom', 'popup-maker' ) => 'custom',
|
102 |
+
));
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
add_filter('popmake_popup_display_animation_type_options', 'popmake_core_popup_display_animation_type_options',10);
|
107 |
+
function popmake_core_popup_display_animation_type_options( $options ) {
|
108 |
+
return array_merge($options, array(
|
109 |
+
// option => value
|
110 |
+
__( 'None', 'popup-maker' ) => 'none',
|
111 |
+
__( 'Slide', 'popup-maker' ) => 'slide',
|
112 |
+
__( 'Fade', 'popup-maker' ) => 'fade',
|
113 |
+
__( 'Fade and Slide', 'popup-maker' ) => 'fadeAndSlide',
|
114 |
+
__( 'Grow', 'popup-maker' ) => 'grow',
|
115 |
+
__( 'Grow and Slide', 'popup-maker' ) => 'growAndSlide',
|
116 |
+
));
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
add_filter('popmake_popup_display_animation_origin_options', 'popmake_core_popup_display_animation_origins_options',10);
|
121 |
+
function popmake_core_popup_display_animation_origins_options( $options ) {
|
122 |
+
return array_merge($options, array(
|
123 |
+
// option => value
|
124 |
+
__( 'Top', 'popup-maker' ) => 'top',
|
125 |
+
__( 'Left', 'popup-maker' ) => 'left',
|
126 |
+
__( 'Bottom', 'popup-maker' ) => 'bottom',
|
127 |
+
__( 'Right', 'popup-maker' ) => 'right',
|
128 |
+
__( 'Top Left', 'popup-maker' ) => 'left top',
|
129 |
+
__( 'Top Center', 'popup-maker' ) => 'center top',
|
130 |
+
__( 'Top Right', 'popup-maker' ) => 'right top',
|
131 |
+
__( 'Middle Left', 'popup-maker' ) => 'left center',
|
132 |
+
__( 'Middle Center', 'popup-maker' ) => 'center center',
|
133 |
+
__( 'Middle Right', 'popup-maker' ) => 'right center',
|
134 |
+
__( 'Bottom Left', 'popup-maker' ) => 'left bottom',
|
135 |
+
__( 'Bottom Center', 'popup-maker' ) => 'center bottom',
|
136 |
+
__( 'Bottom Right', 'popup-maker' ) => 'right bottom',
|
137 |
+
//__( 'Mouse', 'popup-maker' ) => 'mouse',
|
138 |
+
));
|
139 |
+
}
|
140 |
+
|
141 |
+
add_filter('popmake_popup_display_location_options', 'popmake_core_popup_display_location_options',10);
|
142 |
+
function popmake_core_popup_display_location_options( $options ) {
|
143 |
+
return array_merge($options, array(
|
144 |
+
// option => value
|
145 |
+
__( 'Top Left', 'popup-maker' ) => 'left top',
|
146 |
+
__( 'Top Center', 'popup-maker' ) => 'center top',
|
147 |
+
__( 'Top Right', 'popup-maker' ) => 'right top',
|
148 |
+
__( 'Middle Left', 'popup-maker' ) => 'left center',
|
149 |
+
__( 'Middle Center', 'popup-maker' ) => 'center ',
|
150 |
+
__( 'Middle Right', 'popup-maker' ) => 'right center',
|
151 |
+
__( 'Bottom Left', 'popup-maker' ) => 'left bottom',
|
152 |
+
__( 'Bottom Center', 'popup-maker' ) => 'center bottom',
|
153 |
+
__( 'Bottom Right', 'popup-maker' ) => 'right bottom',
|
154 |
+
));
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
+
add_filter('popmake_theme_close_location_options', 'popmake_core_theme_close_location_options',10);
|
159 |
+
function popmake_core_theme_close_location_options( $options ) {
|
160 |
+
return array_merge($options, array(
|
161 |
+
// option => value
|
162 |
+
__( 'Top Left', 'popup-maker' ) => 'topleft',
|
163 |
+
__( 'Top Right', 'popup-maker' ) => 'topright',
|
164 |
+
__( 'Bottom Left', 'popup-maker' ) => 'bottomleft',
|
165 |
+
__( 'Bottom Right', 'popup-maker' ) => 'bottomright',
|
166 |
+
));
|
167 |
+
}
|
includes/install.php
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Install Function
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Functions/Install
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Install
|
17 |
+
*
|
18 |
+
* Runs on plugin install by setting up the post types, custom taxonomies,
|
19 |
+
* flushing rewrite rules also creates the plugin and populates the settings
|
20 |
+
* fields for those plugin pages. After successful install, the user is
|
21 |
+
* redirected to the POPMAKE Welcome screen.
|
22 |
+
*
|
23 |
+
* @since 1.0
|
24 |
+
* @global $wpdb
|
25 |
+
* @global $popmake_options
|
26 |
+
* @global $wp_version
|
27 |
+
* @return void
|
28 |
+
*/
|
29 |
+
function popmake_install() {
|
30 |
+
global $wpdb, $popmake_options, $wp_version;
|
31 |
+
|
32 |
+
// Setup the Popup & Theme Custom Post Type
|
33 |
+
popmake_setup_post_types();
|
34 |
+
|
35 |
+
// Setup the Popup Taxonomies
|
36 |
+
popmake_setup_taxonomies();
|
37 |
+
|
38 |
+
// Clear the permalinks
|
39 |
+
flush_rewrite_rules();
|
40 |
+
|
41 |
+
// Add Upgraded From Option
|
42 |
+
$current_version = get_option( 'popmake_version' );
|
43 |
+
if ( $current_version ) {
|
44 |
+
update_option( 'popmake_version_upgraded_from', $current_version );
|
45 |
+
}
|
46 |
+
|
47 |
+
// Setup some default options
|
48 |
+
$options = array();
|
49 |
+
|
50 |
+
// Checks if the purchase page option exists
|
51 |
+
if ( ! get_option('popmake_default_theme') ) {
|
52 |
+
// Default Theme
|
53 |
+
popmake_install_default_theme();
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
update_option( 'popmake_settings', array_merge( $popmake_options, $options ) );
|
58 |
+
update_option( 'popmake_version', POPMAKE_VERSION );
|
59 |
+
|
60 |
+
// Add a temporary option to note that POPMAKE theme is ready for customization
|
61 |
+
set_transient( '_popmake_installed', $options, 30 );
|
62 |
+
|
63 |
+
// Bail if activating from network, or bulk
|
64 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
// Add the transient to redirect to welcome page.
|
68 |
+
set_transient( '_popmake_activation_redirect', true, 30 );
|
69 |
+
}
|
70 |
+
register_activation_hook( POPMAKE , 'popmake_install' );
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Install Default Theme
|
76 |
+
*
|
77 |
+
* Installs the default theme and updates the option.
|
78 |
+
*
|
79 |
+
* @since 1.0
|
80 |
+
* @return void
|
81 |
+
*/
|
82 |
+
function popmake_install_default_theme() {
|
83 |
+
$default_theme = wp_insert_post(
|
84 |
+
array(
|
85 |
+
'post_title' => __( 'Default Theme', 'popup-maker' ),
|
86 |
+
'post_status' => 'publish',
|
87 |
+
'post_author' => 1,
|
88 |
+
'post_type' => 'popup_theme',
|
89 |
+
'comment_status' => 'closed'
|
90 |
+
)
|
91 |
+
);
|
92 |
+
foreach(popmake_get_popup_theme_default_meta() as $meta_key => $meta_value) {
|
93 |
+
update_post_meta( $default_theme, $meta_key, $meta_value );
|
94 |
+
}
|
95 |
+
update_post_meta( $default_theme, 'popup_theme_defaults_set', true );
|
96 |
+
update_option('popmake_default_theme', $default_theme);
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Post-installation
|
102 |
+
*
|
103 |
+
* Runs just after plugin installation and exposes the
|
104 |
+
* popmake_after_install hook.
|
105 |
+
*
|
106 |
+
* @since 1.0
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
function popmake_after_install() {
|
110 |
+
|
111 |
+
if ( ! is_admin() ) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
$popmake_options = get_transient( '_popmake_installed' );
|
116 |
+
|
117 |
+
// Exit if not in admin or the transient doesn't exist
|
118 |
+
if ( false === $popmake_options ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
// Delete the transient
|
123 |
+
delete_transient( '_popmake_installed' );
|
124 |
+
|
125 |
+
do_action( 'popmake_after_install', $popmake_options );
|
126 |
+
}
|
127 |
+
add_action( 'admin_init', 'popmake_after_install' );
|
includes/integrations/google-fonts.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function popmake_enqueue_google_fonts_during_preload( $data_attr, $popup_theme_id ) {
|
4 |
+
global $popmake_needed_google_fonts;
|
5 |
+
if(!is_array($popmake_needed_google_fonts)) {
|
6 |
+
$popmake_needed_google_fonts = array();
|
7 |
+
}
|
8 |
+
|
9 |
+
$google_fonts = popmake_get_google_webfonts_list();
|
10 |
+
if(array_key_exists($data_attr['title']['font_family'], $google_fonts)) {
|
11 |
+
$variant = $data_attr['title']['font_weight'] != 'normal' ? $data_attr['title']['font_family'] : '';
|
12 |
+
if($data_attr['title']['font_style'] == 'italic') {
|
13 |
+
$variant .= 'italic';
|
14 |
+
}
|
15 |
+
$popmake_needed_google_fonts[$data_attr['title']['font_family']][$variant] = $variant;
|
16 |
+
}
|
17 |
+
if(array_key_exists($data_attr['content']['font_family'], $google_fonts)) {
|
18 |
+
$variant = $data_attr['content']['font_weight'] != 'normal' ? $data_attr['content']['font_family'] : '';
|
19 |
+
if($data_attr['content']['font_style'] == 'italic') {
|
20 |
+
$variant .= 'italic';
|
21 |
+
}
|
22 |
+
$popmake_needed_google_fonts[$data_attr['content']['font_family']][$variant] = $variant;
|
23 |
+
}
|
24 |
+
if(array_key_exists($data_attr['close']['font_family'], $google_fonts)) {
|
25 |
+
$variant = $data_attr['close']['font_weight'] != 'normal' ? $data_attr['close']['font_family'] : '';
|
26 |
+
if($data_attr['close']['font_style'] == 'italic') {
|
27 |
+
$variant .= 'italic';
|
28 |
+
}
|
29 |
+
$popmake_needed_google_fonts[$data_attr['close']['font_family']][$variant] = $variant;
|
30 |
+
}
|
31 |
+
|
32 |
+
return $data_attr;
|
33 |
+
}
|
34 |
+
add_action('popmake_get_popup_theme_data_attr', 'popmake_enqueue_google_fonts_during_preload', 10, 2);
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
includes/integrations/gravityforms.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function popmake_enqueue_gravityforms_during_preload( $popup_id ) {
|
3 |
+
if(function_exists('gravity_form_enqueue_scripts')) {
|
4 |
+
$regex = "/\[gravityform.*id=[\'\"]?([0-9]*)[\'\"]?.*/";
|
5 |
+
$popup = get_post( $popup_id);
|
6 |
+
preg_match_all($regex, $popup->post_content, $matches);
|
7 |
+
foreach($matches[1] as $form_id)
|
8 |
+
{
|
9 |
+
add_filter("gform_confirmation_anchor_{$form_id}", create_function("","return false;"));
|
10 |
+
gravity_form_enqueue_scripts($form_id, true);
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
14 |
+
add_action('popmake_preload_popup', 'popmake_enqueue_gravityforms_during_preload');
|
includes/license-handler.php
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* License handler for Popup Maker
|
4 |
+
*
|
5 |
+
* This class should simplify the process of adding license information to new Popup Maker extensions.
|
6 |
+
*
|
7 |
+
* Note for wordpress.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
|
8 |
+
* @version 1.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
+
|
13 |
+
if ( ! class_exists( 'PopMake_License' ) ) :
|
14 |
+
|
15 |
+
/**
|
16 |
+
* PopMake_License Class
|
17 |
+
*/
|
18 |
+
class PopMake_License {
|
19 |
+
private $file;
|
20 |
+
private $license;
|
21 |
+
private $item_name;
|
22 |
+
private $item_shortname;
|
23 |
+
private $version;
|
24 |
+
private $author;
|
25 |
+
private $api_url = 'https://wppopupmaker.com';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Class constructor
|
29 |
+
*
|
30 |
+
* @global array $popmake_options
|
31 |
+
* @param string $_file
|
32 |
+
* @param string $_item_name
|
33 |
+
* @param string $_version
|
34 |
+
* @param string $_author
|
35 |
+
* @param string $_api_url
|
36 |
+
*/
|
37 |
+
function __construct( $_file, $_item_name, $_version, $_author, $_api_url = null ) {
|
38 |
+
global $popmake_options;
|
39 |
+
|
40 |
+
$this->file = $_file;
|
41 |
+
$this->item_name = $_item_name;
|
42 |
+
$this->item_shortname = 'popmake_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->item_name ) ) );
|
43 |
+
$this->version = $_version;
|
44 |
+
$this->license = isset( $popmake_options[ $this->item_shortname . '_license_key' ] ) ? trim( $popmake_options[ $this->item_shortname . '_license_key' ] ) : '';
|
45 |
+
$this->author = $_author;
|
46 |
+
$this->api_url = is_null( $_api_url ) ? $this->api_url : $_api_url;
|
47 |
+
|
48 |
+
// Setup hooks
|
49 |
+
$this->includes();
|
50 |
+
$this->hooks();
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Include the updater class
|
55 |
+
*
|
56 |
+
* @access private
|
57 |
+
* @return void
|
58 |
+
*/
|
59 |
+
private function includes() {
|
60 |
+
if ( ! class_exists( 'PopumpMaker_Plugin_Updater' ) ) require_once 'plugin-updater.php';
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Setup hooks
|
65 |
+
*
|
66 |
+
* @access private
|
67 |
+
* @return void
|
68 |
+
*/
|
69 |
+
private function hooks() {
|
70 |
+
// Register settings
|
71 |
+
add_filter( 'popmake_settings_licenses', array( $this, 'settings' ), 1 );
|
72 |
+
|
73 |
+
// Activate license key on settings save
|
74 |
+
add_action( 'admin_init', array( $this, 'activate_license' ) );
|
75 |
+
|
76 |
+
// Deactivate license key
|
77 |
+
add_action( 'admin_init', array( $this, 'deactivate_license' ) );
|
78 |
+
|
79 |
+
// Updater
|
80 |
+
add_action( 'admin_init', array( $this, 'auto_updater' ), 1000 );
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Auto updater
|
85 |
+
*
|
86 |
+
* @access private
|
87 |
+
* @global array $popmake_options
|
88 |
+
* @return void
|
89 |
+
*/
|
90 |
+
public function auto_updater() {
|
91 |
+
|
92 |
+
if ( 'valid' !== get_option( $this->item_shortname . '_license_active' ) )
|
93 |
+
return;
|
94 |
+
|
95 |
+
// Setup the updater
|
96 |
+
$popmake_updater = new PopumpMaker_Plugin_Updater(
|
97 |
+
$this->api_url,
|
98 |
+
$this->file,
|
99 |
+
array(
|
100 |
+
'version' => $this->version,
|
101 |
+
'license' => $this->license,
|
102 |
+
'item_name' => $this->item_name,
|
103 |
+
'author' => $this->author
|
104 |
+
)
|
105 |
+
);
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Add license field to settings
|
111 |
+
*
|
112 |
+
* @access public
|
113 |
+
* @param array $settings
|
114 |
+
* @return array
|
115 |
+
*/
|
116 |
+
public function settings( $settings ) {
|
117 |
+
$popmake_license_settings = array(
|
118 |
+
$this->item_shortname . '_license_key' => array(
|
119 |
+
'id' => $this->item_shortname . '_license_key',
|
120 |
+
'name' => sprintf( __( '%1$s License Key', 'popmake' ), $this->item_name ),
|
121 |
+
'desc' => '',
|
122 |
+
'type' => 'license_key',
|
123 |
+
'options' => array( 'is_valid_license_option' => $this->item_shortname . '_license_active' ),
|
124 |
+
'size' => 'regular'
|
125 |
+
)
|
126 |
+
);
|
127 |
+
|
128 |
+
return array_merge( $settings, $popmake_license_settings );
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Activate the license key
|
134 |
+
*
|
135 |
+
* @access public
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
public function activate_license() {
|
139 |
+
global $popmake_options;
|
140 |
+
if ( ! isset( $_POST['popmake_settings'] ) ) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
if ( ! isset( $_POST['popmake_settings'][ $this->item_shortname . '_license_key' ] ) ) {
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
|
147 |
+
foreach( $_POST as $key => $value ) {
|
148 |
+
if( false !== strpos( $key, 'license_key_deactivate' ) ) {
|
149 |
+
// Don't activate a key when deactivating a different key
|
150 |
+
return;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
if( ! current_user_can( 'manage_options' ) ) {
|
155 |
+
return;
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( 'valid' == get_option( $this->item_shortname . '_license_active' ) ) {
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
|
162 |
+
$license = sanitize_text_field( $_POST['popmake_settings'][ $this->item_shortname . '_license_key' ] );
|
163 |
+
|
164 |
+
// Data to send to the API
|
165 |
+
$api_params = array(
|
166 |
+
'edd_action' => 'activate_license',
|
167 |
+
'license' => $license,
|
168 |
+
'item_name' => urlencode( $this->item_name ),
|
169 |
+
'url' => home_url()
|
170 |
+
);
|
171 |
+
|
172 |
+
// Call the API
|
173 |
+
$response = wp_remote_post(
|
174 |
+
$this->api_url,
|
175 |
+
array(
|
176 |
+
'timeout' => 15,
|
177 |
+
'sslverify' => false,
|
178 |
+
'body' => $api_params
|
179 |
+
)
|
180 |
+
);
|
181 |
+
//echo '<pre>'; print_R( $response ); echo '</pre>'; exit;
|
182 |
+
|
183 |
+
// Make sure there are no errors
|
184 |
+
if ( is_wp_error( $response ) )
|
185 |
+
return;
|
186 |
+
|
187 |
+
// Tell WordPress to look for updates
|
188 |
+
set_site_transient( 'update_plugins', null );
|
189 |
+
|
190 |
+
// Decode license data
|
191 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
192 |
+
|
193 |
+
update_option( $this->item_shortname . '_license_active', $license_data->license );
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Deactivate the license key
|
199 |
+
*
|
200 |
+
* @access public
|
201 |
+
* @return void
|
202 |
+
*/
|
203 |
+
public function deactivate_license() {
|
204 |
+
|
205 |
+
if ( ! isset( $_POST['popmake_settings'] ) )
|
206 |
+
return;
|
207 |
+
|
208 |
+
if ( ! isset( $_POST['popmake_settings'][ $this->item_shortname . '_license_key' ] ) )
|
209 |
+
return;
|
210 |
+
|
211 |
+
if( ! current_user_can( 'manage_options' ) ) {
|
212 |
+
return;
|
213 |
+
}
|
214 |
+
|
215 |
+
// Run on deactivate button press
|
216 |
+
if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {
|
217 |
+
|
218 |
+
// Data to send to the API
|
219 |
+
$api_params = array(
|
220 |
+
'edd_action' => 'deactivate_license',
|
221 |
+
'license' => $this->license,
|
222 |
+
'item_name' => urlencode( $this->item_name ),
|
223 |
+
'url' => home_url()
|
224 |
+
);
|
225 |
+
|
226 |
+
// Call the API
|
227 |
+
$response = wp_remote_post(
|
228 |
+
$this->api_url,
|
229 |
+
array(
|
230 |
+
'timeout' => 15,
|
231 |
+
'sslverify' => false,
|
232 |
+
'body' => $api_params
|
233 |
+
)
|
234 |
+
);
|
235 |
+
|
236 |
+
// Make sure there are no errors
|
237 |
+
if ( is_wp_error( $response ) )
|
238 |
+
return;
|
239 |
+
|
240 |
+
// Decode the license data
|
241 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
242 |
+
|
243 |
+
delete_option( $this->item_shortname . '_license_active' );
|
244 |
+
}
|
245 |
+
}
|
246 |
+
}
|
247 |
+
endif; // end class_exists check
|
includes/load-popups.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
function popmake_init_popups() {
|
5 |
+
global $popmake_loaded_popups, $popmake_loaded_popup_ids, $popmake_enqueued_popups;
|
6 |
+
|
7 |
+
if(!$popmake_loaded_popups instanceof WP_Query) {
|
8 |
+
$popmake_loaded_popups = new WP_Query();
|
9 |
+
$popmake_loaded_popups->posts = array();
|
10 |
+
}
|
11 |
+
if(!$popmake_loaded_popup_ids || !is_array($popmake_loaded_popup_ids)) {
|
12 |
+
$popmake_loaded_popup_ids = array();
|
13 |
+
}
|
14 |
+
if(!$popmake_enqueued_popups || !is_array($popmake_enqueued_popups)) {
|
15 |
+
$popmake_enqueued_popups = array();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
add_action('plugins_loaded', 'popmake_init_popups');
|
19 |
+
|
20 |
+
|
21 |
+
function popmake_load_popup( int $id ) {
|
22 |
+
global $popmake_loaded_popups, $popmake_loaded_popup_ids, $popmake_enqueued_popups;
|
23 |
+
if( did_action( 'wp_head' ) && !in_array( $id, $popmake_loaded_popup_ids ) ) {
|
24 |
+
$args1 = array_merge($base_args, array(
|
25 |
+
'post_type' => 'popup',
|
26 |
+
'p' => $id
|
27 |
+
));
|
28 |
+
$query1 = new WP_Query( $args1 );
|
29 |
+
if ( $query1->have_posts() ) {
|
30 |
+
while ( $query1->have_posts() ) : $query1->next_post();
|
31 |
+
do_action( 'popmake_preload_popup', $query1->post->ID );
|
32 |
+
$popmake_loaded_popups->posts[] = $query1->post;
|
33 |
+
$popmake_loaded_popups->post_count++;
|
34 |
+
endwhile;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
elseif( !did_action( 'wp_head' ) && !in_array( $id, $popmake_enqueued_popups ) ) {
|
38 |
+
$popmake_enqueued_popups[] = $id;
|
39 |
+
}
|
40 |
+
return;
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
function popmake_enqueue_popup( int $id ) {
|
45 |
+
return popmake_load_popup( $id );
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
function get_enqueued_popups() {
|
50 |
+
global $popmake_enqueued_popups;
|
51 |
+
$popmake_enqueued_popups = apply_filters('popmake_get_enqueued_popups', $popmake_enqueued_popups);
|
52 |
+
return $popmake_enqueued_popups;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
function popmake_preload_popups() {
|
57 |
+
global $popmake_loaded_popups, $popmake_loaded_popup_ids;
|
58 |
+
|
59 |
+
$query = new WP_Query( array(
|
60 |
+
'post_type' => 'popup',
|
61 |
+
'posts_per_page' => -1
|
62 |
+
) );
|
63 |
+
|
64 |
+
if ( $query->have_posts() ) {
|
65 |
+
while ( $query->have_posts() ) : $query->next_post();
|
66 |
+
if( popmake_popup_is_loadable( $query->post->ID ) ) {
|
67 |
+
do_action( 'popmake_preload_popup', $query->post->ID );
|
68 |
+
$popmake_loaded_popups->posts[] = $query->post;
|
69 |
+
$popmake_loaded_popups->post_count++;
|
70 |
+
}
|
71 |
+
endwhile;
|
72 |
+
|
73 |
+
}
|
74 |
+
}
|
75 |
+
add_action('wp_head', 'popmake_preload_popups', 1000);
|
76 |
+
add_action('wp_footer', 'popmake_render_popups', 1);
|
77 |
+
|
78 |
+
|
79 |
+
function popmake_render_popups() {
|
80 |
+
global $popmake_loaded_popups;
|
81 |
+
if ( $popmake_loaded_popups->have_posts() ) {
|
82 |
+
while ( $popmake_loaded_popups->have_posts() ) : $popmake_loaded_popups->the_post();
|
83 |
+
popmake_get_template_part('popup');
|
84 |
+
endwhile;
|
85 |
+
wp_reset_postdata();
|
86 |
+
}
|
87 |
+
}
|
includes/plugin-updater.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Allows plugins to use their own update API.
|
5 |
+
*
|
6 |
+
* Note for wordpress.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
|
7 |
+
* @author Pippin Williamson
|
8 |
+
* @version 1.2
|
9 |
+
*/
|
10 |
+
class PopumpMaker_Plugin_Updater {
|
11 |
+
private $api_url = '';
|
12 |
+
private $api_data = array();
|
13 |
+
private $name = '';
|
14 |
+
private $slug = '';
|
15 |
+
private $do_check = false;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class constructor.
|
19 |
+
*
|
20 |
+
* @uses plugin_basename()
|
21 |
+
* @uses hook()
|
22 |
+
*
|
23 |
+
* @param string $_api_url The URL pointing to the custom API endpoint.
|
24 |
+
* @param string $_plugin_file Path to the plugin file.
|
25 |
+
* @param array $_api_data Optional data to send with API calls.
|
26 |
+
* @return void
|
27 |
+
*/
|
28 |
+
function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
|
29 |
+
$this->api_url = trailingslashit( $_api_url );
|
30 |
+
$this->api_data = urlencode_deep( $_api_data );
|
31 |
+
$this->name = plugin_basename( $_plugin_file );
|
32 |
+
$this->slug = basename( $_plugin_file, '.php');
|
33 |
+
$this->version = $_api_data['version'];
|
34 |
+
|
35 |
+
// Set up hooks.
|
36 |
+
$this->hook();
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Set up WordPress filters to hook into WP's update process.
|
41 |
+
*
|
42 |
+
* @uses add_filter()
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
private function hook() {
|
47 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
|
48 |
+
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
|
49 |
+
add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Check for Updates at the defined API endpoint and modify the update array.
|
54 |
+
*
|
55 |
+
* This function dives into the update API just when WordPress creates its update array,
|
56 |
+
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
57 |
+
* It is reassembled from parts of the native WordPress plugin update code.
|
58 |
+
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
59 |
+
*
|
60 |
+
* @uses api_request()
|
61 |
+
*
|
62 |
+
* @param array $_transient_data Update array build by WordPress.
|
63 |
+
* @return array Modified update array with custom plugin data.
|
64 |
+
*/
|
65 |
+
function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
|
66 |
+
|
67 |
+
if( empty( $_transient_data ) || ! $this->do_check ) {
|
68 |
+
|
69 |
+
// This ensures that the custom API request only runs on the second time that WP fires the update check
|
70 |
+
$this->do_check = true;
|
71 |
+
|
72 |
+
return $_transient_data;
|
73 |
+
}
|
74 |
+
|
75 |
+
$to_send = array( 'slug' => $this->slug );
|
76 |
+
|
77 |
+
$api_response = $this->api_request( 'plugin_latest_version', $to_send );
|
78 |
+
|
79 |
+
if( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
|
80 |
+
|
81 |
+
if( version_compare( $this->version, $api_response->new_version, '<' ) ) {
|
82 |
+
$_transient_data->response[$this->name] = $api_response;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
return $_transient_data;
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Updates information on the "View version x.x details" page with custom data.
|
91 |
+
*
|
92 |
+
* @uses api_request()
|
93 |
+
*
|
94 |
+
* @param mixed $_data
|
95 |
+
* @param string $_action
|
96 |
+
* @param object $_args
|
97 |
+
* @return object $_data
|
98 |
+
*/
|
99 |
+
function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
100 |
+
if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
|
101 |
+
|
102 |
+
$to_send = array( 'slug' => $this->slug );
|
103 |
+
|
104 |
+
$api_response = $this->api_request( 'plugin_information', $to_send );
|
105 |
+
if ( false !== $api_response ) $_data = $api_response;
|
106 |
+
|
107 |
+
return $_data;
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Disable SSL verification in order to prevent download update failures
|
113 |
+
*
|
114 |
+
* @param array $args
|
115 |
+
* @param string $url
|
116 |
+
* @return object $array
|
117 |
+
*/
|
118 |
+
function http_request_args( $args, $url ) {
|
119 |
+
// If it is an https request and we are performing a package download, disable ssl verification
|
120 |
+
if( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
121 |
+
$args['sslverify'] = false;
|
122 |
+
}
|
123 |
+
return $args;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Calls the API and, if successfull, returns the object delivered by the API.
|
128 |
+
*
|
129 |
+
* @uses get_bloginfo()
|
130 |
+
* @uses wp_remote_post()
|
131 |
+
* @uses is_wp_error()
|
132 |
+
*
|
133 |
+
* @param string $_action The requested action.
|
134 |
+
* @param array $_data Parameters for the API action.
|
135 |
+
* @return false||object
|
136 |
+
*/
|
137 |
+
private function api_request( $_action, $_data ) {
|
138 |
+
|
139 |
+
global $wp_version;
|
140 |
+
|
141 |
+
$data = array_merge( $this->api_data, $_data );
|
142 |
+
|
143 |
+
if( $data['slug'] != $this->slug )
|
144 |
+
return;
|
145 |
+
|
146 |
+
if( empty( $data['license'] ) )
|
147 |
+
return;
|
148 |
+
|
149 |
+
$api_params = array(
|
150 |
+
'edd_action' => 'get_version',
|
151 |
+
'license' => $data['license'],
|
152 |
+
'name' => $data['item_name'],
|
153 |
+
'slug' => $this->slug,
|
154 |
+
'author' => $data['author'],
|
155 |
+
'url' => home_url()
|
156 |
+
);
|
157 |
+
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
158 |
+
|
159 |
+
if ( ! is_wp_error( $request ) ):
|
160 |
+
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
161 |
+
if( $request && isset( $request->sections ) )
|
162 |
+
$request->sections = maybe_unserialize( $request->sections );
|
163 |
+
return $request;
|
164 |
+
else:
|
165 |
+
return false;
|
166 |
+
endif;
|
167 |
+
}
|
168 |
+
}
|
includes/popup-functions.php
ADDED
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Popup Functions
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Functions
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
|
16 |
+
function popmake_get_the_popup_classes( $popup_id = null ) {
|
17 |
+
if( !$popup_id ) $popup_id = get_the_ID();
|
18 |
+
return implode( ' ', apply_filters( 'popmake_get_the_popup_classes', array( 'popmake' ), $popup_id ) );
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
function popmake_the_popup_classes( $popup_id = null ) {
|
23 |
+
esc_attr_e( popmake_get_the_popup_classes( $popup_id ) );
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
function popmake_add_popup_size_classes( $classes, $popup_id ) {
|
28 |
+
$popup_size = popmake_get_popup_display( $popup_id, 'size' );
|
29 |
+
if( in_array( $popup_size, array('nano','micro','tiny','small','medium','normal','large','xlarge') ) ) {
|
30 |
+
$classes[] = 'responsive';
|
31 |
+
$classes[] = 'size-' . $popup_size;
|
32 |
+
}
|
33 |
+
elseif($popup_size == 'custom') {
|
34 |
+
$classes[] = 'size-custom';
|
35 |
+
}
|
36 |
+
|
37 |
+
if(!popmake_get_popup_display( $popup_id, 'custom_height_auto' ) && popmake_get_popup_display( $popup_id, 'scrollable_content' )) {
|
38 |
+
$classes[] = 'scrollable';
|
39 |
+
}
|
40 |
+
|
41 |
+
return $classes;
|
42 |
+
}
|
43 |
+
add_filter('popmake_get_the_popup_classes', 'popmake_add_popup_size_classes', 5, 2);
|
44 |
+
|
45 |
+
|
46 |
+
function popmake_get_the_popup_data_attr( $popup_id = null ) {
|
47 |
+
if( !$popup_id ) $popup_id = get_the_ID();
|
48 |
+
$post = get_post( $popup_id );
|
49 |
+
$data_attr = array(
|
50 |
+
'id' => $popup_id,
|
51 |
+
'slug' => $post->post_name,
|
52 |
+
'meta' => array(
|
53 |
+
'display' => popmake_get_popup_display( $popup_id ),
|
54 |
+
'close' => popmake_get_popup_close( $popup_id )
|
55 |
+
)
|
56 |
+
);
|
57 |
+
return apply_filters('popmake_get_the_popup_data_attr', $data_attr, $popup_id );
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
function popmake_the_popup_data_attr( $popup_id = null ) {
|
62 |
+
echo 'data-popmake="'. esc_attr( json_encode( popmake_get_the_popup_data_attr( $popup_id ) ) ) .'"';
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Returns the meta group of a popup or value if key is set.
|
69 |
+
*
|
70 |
+
* @since 1.0
|
71 |
+
* @param int $popup_id ID number of the popup to retrieve a overlay meta for
|
72 |
+
* @return mixed array|string
|
73 |
+
*/
|
74 |
+
function popmake_get_popup_meta_group( $group, $popup_id = NULL, $key = NULL ) {
|
75 |
+
global $pagenow;
|
76 |
+
if(!$popup_id) $popup_id = get_the_ID();
|
77 |
+
|
78 |
+
$post_meta = get_post_custom( $popup_id );
|
79 |
+
$default_check_key = 'popup_defaults_set';
|
80 |
+
if(!in_array($group, array('close','display','targeting_condition'))) {
|
81 |
+
$default_check_key = "popup_{$group}_defaults_set";
|
82 |
+
}
|
83 |
+
|
84 |
+
$group_values = array_key_exists($default_check_key, $post_meta) ? array() : apply_filters("popmake_popup_{$group}_defaults", array());
|
85 |
+
foreach($post_meta as $meta_key => $value) {
|
86 |
+
if(strpos($meta_key, "popup_{$group}_") !== false) {
|
87 |
+
$new_key = str_replace("popup_{$group}_", '', $meta_key);
|
88 |
+
if(count($value) == 1)
|
89 |
+
$group_values[$new_key] = $value[0];
|
90 |
+
else
|
91 |
+
$group_values[$new_key] = $value;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
if($key) {
|
95 |
+
$key = str_replace('.', '_', $key);
|
96 |
+
if(!isset($group_values[$key])) {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
$value = $group_values[$key];
|
100 |
+
return apply_filters( "popmake_get_popup_{$group}_$key", $value, $popup_id );
|
101 |
+
}
|
102 |
+
else {
|
103 |
+
return apply_filters( "popmake_get_popup_{$group}", $group_values, $popup_id );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Returns the load settings meta of a popup.
|
110 |
+
*
|
111 |
+
* @since 1.0
|
112 |
+
* @param int $popup_id ID number of the popup to retrieve a overlay meta for
|
113 |
+
* @return mixed array|string of the popup load settings meta
|
114 |
+
*/
|
115 |
+
function popmake_get_popup_targeting_condition( $popup_id = NULL, $key = NULL ) {
|
116 |
+
return popmake_get_popup_meta_group( 'targeting_condition', $popup_id, $key );
|
117 |
+
}
|
118 |
+
|
119 |
+
function popmake_get_popup_targeting_condition_includes( $popup_id, $post_type = NULL ) {
|
120 |
+
$post_meta = get_post_custom_keys( $popup_id );
|
121 |
+
$includes = array();
|
122 |
+
if(!empty($post_meta)) {
|
123 |
+
foreach( $post_meta as $meta_key ) {
|
124 |
+
if(strpos($meta_key, 'popup_targeting_condition_on_') !== false) {
|
125 |
+
$id = intval( substr( strrchr( $meta_key, "_" ), 1 ) );
|
126 |
+
|
127 |
+
if($id > 0) {
|
128 |
+
$remove = strrchr( $meta_key , strrchr( $meta_key, "_" ));
|
129 |
+
$name = str_replace( 'popup_targeting_condition_on_', "", str_replace( $remove, "", $meta_key ) );
|
130 |
+
|
131 |
+
$includes[$name][] = intval( $id );
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
if($post_type) {
|
137 |
+
if(!isset($includes[$post_type]) || empty($includes[$post_type])) {
|
138 |
+
$includes[$post_type] = array();
|
139 |
+
}
|
140 |
+
return $includes[$post_type];
|
141 |
+
}
|
142 |
+
return $includes;
|
143 |
+
}
|
144 |
+
|
145 |
+
function popmake_get_popup_targeting_condition_excludes( $popup_id, $post_type = NULL ) {
|
146 |
+
$post_meta = get_post_custom_keys( $popup_id );
|
147 |
+
$excludes = array();
|
148 |
+
if(!empty($post_meta)) {
|
149 |
+
foreach( $post_meta as $meta_key ) {
|
150 |
+
if(strpos($meta_key, 'popup_targeting_condition_exclude_on_') !== false) {
|
151 |
+
$id = intval( substr( strrchr( $meta_key, "_" ), 1 ) );
|
152 |
+
|
153 |
+
if($id > 0) {
|
154 |
+
$remove = strrchr( $meta_key , strrchr( $meta_key, "_" ));
|
155 |
+
$name = str_replace( 'popup_targeting_condition_exclude_on_', "", str_replace( $remove, "", $meta_key ) );
|
156 |
+
|
157 |
+
$excludes[$name][] = intval( $id );
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
if($post_type) {
|
163 |
+
if(!isset($excludes[$post_type]) || empty($excludes[$post_type])) {
|
164 |
+
$excludes[$post_type] = array();
|
165 |
+
}
|
166 |
+
return $excludes[$post_type];
|
167 |
+
}
|
168 |
+
return $excludes;
|
169 |
+
}
|
170 |
+
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Returns the title of a popup.
|
174 |
+
*
|
175 |
+
* @since 1.0
|
176 |
+
* @param int $popup_id ID number of the popup to retrieve a title for
|
177 |
+
* @return mixed string|int
|
178 |
+
*/
|
179 |
+
function popmake_get_the_popup_title( $popup_id = NULL ) {
|
180 |
+
if( !$popup_id ) $popup_id = get_the_ID();
|
181 |
+
$title = get_post_meta( $popup_id, 'popup_title', true );
|
182 |
+
return apply_filters( 'popmake_get_the_popup_title', $title, $popup_id );
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
function popmake_the_popup_title( $popup_id = NULL ) {
|
187 |
+
echo esc_html( popmake_get_the_popup_title( $popup_id ) );
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
function popmake_get_the_popup_content( $popup_id = NULL ) {
|
192 |
+
if( !$popup_id ) $popup_id = get_the_ID();
|
193 |
+
return apply_filters( 'popmake_get_the_popup_content', get_the_content( $popup_id ), $popup_id );
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
function popmake_apply_the_content( $content ) {
|
198 |
+
return apply_filters( 'the_content', $content );
|
199 |
+
}
|
200 |
+
add_filter('popmake_get_the_popup_content', 'popmake_apply_the_content', 100);
|
201 |
+
|
202 |
+
|
203 |
+
function popmake_the_popup_content( $popup_id = NULL ) {
|
204 |
+
echo popmake_get_the_popup_content( $popup_id );
|
205 |
+
}
|
206 |
+
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Returns the display meta of a popup.
|
210 |
+
*
|
211 |
+
* @since 1.0
|
212 |
+
* @param int $popup_id ID number of the popup to retrieve a display meta for
|
213 |
+
* @return mixed array|string of the popup display meta
|
214 |
+
*/
|
215 |
+
function popmake_get_popup_display( $popup_id = NULL, $key = NULL ) {
|
216 |
+
return popmake_get_popup_meta_group( 'display', $popup_id, $key );
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Returns the close meta of a popup.
|
222 |
+
*
|
223 |
+
* @since 1.0
|
224 |
+
* @param int $popup_id ID number of the popup to retrieve a close meta for
|
225 |
+
* @return mixed array|string of the popup close meta
|
226 |
+
*/
|
227 |
+
function popmake_get_popup_close( $popup_id = NULL, $key = NULL ) {
|
228 |
+
return popmake_get_popup_meta_group( 'close', $popup_id, $key );
|
229 |
+
}
|
230 |
+
|
231 |
+
|
232 |
+
function popmake_popup_content_container( $content ) {
|
233 |
+
global $post;
|
234 |
+
if ($post->post_type == 'popup') {
|
235 |
+
$content = '<div class="popmake-content">' . $content;
|
236 |
+
$content .= '</div>';
|
237 |
+
$content .= '<a class="popmake-close">'. apply_filters( 'popmake_popup_default_close_text', __( '×', 'popup-maker'), $post->ID ) .'</a>';
|
238 |
+
}
|
239 |
+
return $content;
|
240 |
+
}
|
241 |
+
add_filter('the_content', 'popmake_popup_content_container', 10000);
|
242 |
+
|
243 |
+
|
244 |
+
|
245 |
+
function popmake_popup_is_loadable( $popup_id ) {
|
246 |
+
global $post, $wp_query;
|
247 |
+
|
248 |
+
$popmake_enqueued_popups = get_enqueued_popups();
|
249 |
+
$conditions = popmake_get_popup_targeting_condition( $popup_id );
|
250 |
+
|
251 |
+
$return = false;
|
252 |
+
|
253 |
+
/**
|
254 |
+
* on_home
|
255 |
+
*
|
256 |
+
* on_entire_site
|
257 |
+
*
|
258 |
+
* on_entire_site
|
259 |
+
* exclude_on_home
|
260 |
+
*/
|
261 |
+
if( is_home() && ( array_key_exists('on_home', $conditions) || ( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_home', $conditions) ) ) ) {
|
262 |
+
$return = true;
|
263 |
+
}
|
264 |
+
|
265 |
+
/*
|
266 |
+
on_pages
|
267 |
+
|
268 |
+
on_pages
|
269 |
+
on_specific_pages
|
270 |
+
on_page_235
|
271 |
+
|
272 |
+
on_entire_site
|
273 |
+
exclude_on_pages
|
274 |
+
|
275 |
+
on_entire_site
|
276 |
+
exclude_on_pages
|
277 |
+
|
278 |
+
|
279 |
+
on_entire_site
|
280 |
+
exclude_on_specific_pages
|
281 |
+
exclude_on_page_235
|
282 |
+
*/
|
283 |
+
elseif( is_page() ) {
|
284 |
+
|
285 |
+
// Load on all pages
|
286 |
+
if( array_key_exists('on_pages', $conditions) && !array_key_exists('on_specific_pages', $conditions) ) {
|
287 |
+
$return = true;
|
288 |
+
}
|
289 |
+
// Load on specific pages
|
290 |
+
if( array_key_exists('on_specific_pages', $conditions) && array_key_exists('on_page_' . $post->ID, $conditions) ) {
|
291 |
+
$return = true;
|
292 |
+
}
|
293 |
+
// Load on entire site not excluding all pages.
|
294 |
+
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_pages', $conditions) ) {
|
295 |
+
$return = true;
|
296 |
+
}
|
297 |
+
// Load on entire site not excluding specific pages.
|
298 |
+
if( array_key_exists('on_entire_site', $conditions) && array_key_exists('exclude_on_specific_pages', $conditions) && !array_key_exists('exclude_on_page_' . $post->ID, $conditions) ) {
|
299 |
+
$return = true;
|
300 |
+
}
|
301 |
+
|
302 |
+
}
|
303 |
+
elseif( is_category() ) {
|
304 |
+
$category_id = $wp_query->get_queried_object_id();
|
305 |
+
|
306 |
+
// Load on all categories
|
307 |
+
if( array_key_exists('on_categories', $conditions) && !array_key_exists('on_specific_categories', $conditions) ) {
|
308 |
+
$return = true;
|
309 |
+
}
|
310 |
+
// Load on specific categories
|
311 |
+
if( array_key_exists('on_specific_categories', $conditions) && array_key_exists('on_category_' . $category_id, $conditions) ) {
|
312 |
+
$return = true;
|
313 |
+
}
|
314 |
+
// Load on entire site not excluding all categories.
|
315 |
+
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_categories', $conditions) ) {
|
316 |
+
$return = true;
|
317 |
+
}
|
318 |
+
// Load on entire site not excluding specific categories.
|
319 |
+
if( array_key_exists('on_entire_site', $conditions) && array_key_exists('exclude_on_specific_categories', $conditions) && !array_key_exists('exclude_on_category_' . $category_id, $conditions) ) {
|
320 |
+
$return = true;
|
321 |
+
}
|
322 |
+
|
323 |
+
}
|
324 |
+
elseif( is_tag() ) {
|
325 |
+
|
326 |
+
// Load on all tags
|
327 |
+
if( array_key_exists('on_tags', $conditions) && !array_key_exists('on_specific_tags', $conditions) ) {
|
328 |
+
$return = true;
|
329 |
+
}
|
330 |
+
// Load on specific tags
|
331 |
+
if( array_key_exists('on_specific_tags', $conditions) && array_key_exists('on_post_tag_' . $category_id, $conditions) ) {
|
332 |
+
$return = true;
|
333 |
+
}
|
334 |
+
// Load on entire site not excluding all tags.
|
335 |
+
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_tags', $conditions) ) {
|
336 |
+
$return = true;
|
337 |
+
}
|
338 |
+
// Load on entire site not excluding specific tags.
|
339 |
+
if( array_key_exists('on_entire_site', $conditions) && array_key_exists('exclude_on_specific_tags', $conditions) && !array_key_exists('exclude_on_post_tag_' . $category_id, $conditions) ) {
|
340 |
+
$return = true;
|
341 |
+
}
|
342 |
+
|
343 |
+
}
|
344 |
+
elseif( is_single() && $post->post_type == 'post' ) {
|
345 |
+
|
346 |
+
// Load on all pages
|
347 |
+
if( array_key_exists('on_posts', $conditions) && !array_key_exists('on_specific_posts', $conditions) ) {
|
348 |
+
$return = true;
|
349 |
+
}
|
350 |
+
// Load on specific pages
|
351 |
+
if( array_key_exists('on_specific_posts', $conditions) && array_key_exists('on_post_' . $post->ID, $conditions) ) {
|
352 |
+
$return = true;
|
353 |
+
}
|
354 |
+
// Load on entire site not excluding all pages.
|
355 |
+
if( array_key_exists('on_entire_site', $conditions) && !array_key_exists('exclude_on_posts', $conditions) ) {
|
356 |
+
$return = true;
|
357 |
+
}
|
358 |
+
// Load on entire site not excluding specific pages.
|
359 |
+
if( array_key_exists('on_entire_site', $conditions) && array_key_exists('exclude_on_specific_posts', $conditions) && !array_key_exists('exclude_on_post_' . $post->ID, $conditions) ) {
|
360 |
+
$return = true;
|
361 |
+
}
|
362 |
+
|
363 |
+
}
|
364 |
+
// Add support for custom post types
|
365 |
+
elseif( is_single() && $post->post_type != 'post' ) {
|
366 |
+
$pt = $post->post_type;
|
367 |
+
// Load on all pages
|
368 |
+
if( array_key_exists("on_{$pt}s", $conditions) && !array_key_exists("on_specific_{$pt}s", $conditions) ) {
|
369 |
+
$return = true;
|
370 |
+
}
|
371 |
+
// Load on specific pages
|
372 |
+
if( array_key_exists("on_specific_{$pt}s", $conditions) && array_key_exists("on_{$pt}_" . $post->ID, $conditions) ) {
|
373 |
+
$return = true;
|
374 |
+
}
|
375 |
+
// Load on entire site not excluding all pages.
|
376 |
+
if( array_key_exists("on_entire_site", $conditions) && !array_key_exists("exclude_on_{$pt}s", $conditions) ) {
|
377 |
+
$return = true;
|
378 |
+
}
|
379 |
+
// Load on entire site not excluding specific pages.
|
380 |
+
if( array_key_exists("on_entire_site", $conditions) && array_key_exists("exclude_on_specific_{$pt}s", $conditions) && !array_key_exists("exclude_on_{$pt}_" . $post->ID, $conditions) ) {
|
381 |
+
$return = true;
|
382 |
+
}
|
383 |
+
|
384 |
+
}
|
385 |
+
elseif( is_tax() ) {
|
386 |
+
$term_id = $wp_query->get_queried_object_id();
|
387 |
+
}
|
388 |
+
|
389 |
+
// An Archive is a Category, Tag, Author or a Date based pages.
|
390 |
+
elseif( is_archive() ) {}
|
391 |
+
|
392 |
+
return apply_filters('popmake_popup_is_loadable', $return, $post->ID);
|
393 |
+
}
|
394 |
+
|
395 |
+
|
396 |
+
function get_all_popups() {
|
397 |
+
$query = new WP_Query( array(
|
398 |
+
'post_type' => 'popup',
|
399 |
+
'posts_per_page' => -1
|
400 |
+
) );
|
401 |
+
return $query;
|
402 |
+
}
|
includes/post-types.php
ADDED
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Post Type Functions
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Functions
|
7 |
+
* @copyright Copyright (c) 2014, Wizard Internet Solutions
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
function popmake_setup_post_types() {
|
16 |
+
global $popup_post_type, $popup_theme_post_type;
|
17 |
+
|
18 |
+
$popup_labels = apply_filters( 'popmake_popup_labels', array(
|
19 |
+
'name' => '%2$s',
|
20 |
+
'singular_name' => '%1$s',
|
21 |
+
'add_new' => __( 'Add New', 'popup-maker' ),
|
22 |
+
'add_new_item' => __( 'Add New %1$s', 'popup-maker' ),
|
23 |
+
'edit_item' => __( 'Edit %1$s', 'popup-maker' ),
|
24 |
+
'new_item' => __( 'New %1$s', 'popup-maker' ),
|
25 |
+
'all_items' => __( 'All %2$s', 'popup-maker' ),
|
26 |
+
'view_item' => __( 'View %1$s', 'popup-maker' ),
|
27 |
+
'search_items' => __( 'Search %2$s', 'popup-maker' ),
|
28 |
+
'not_found' => __( 'No %2$s found', 'popup-maker' ),
|
29 |
+
'not_found_in_trash'=> __( 'No %2$s found in Trash', 'popup-maker' ),
|
30 |
+
'parent_item_colon' => '',
|
31 |
+
'menu_name' => __( POPMAKE_NAME, 'popup-maker' )
|
32 |
+
) );
|
33 |
+
|
34 |
+
foreach ( $popup_labels as $key => $value ) {
|
35 |
+
$popup_labels[ $key ] = sprintf( $value, popmake_get_label_singular('popup'), popmake_get_label_plural('popup') );
|
36 |
+
}
|
37 |
+
|
38 |
+
$popup_args = array(
|
39 |
+
'labels' => $popup_labels,
|
40 |
+
'show_ui' => true,
|
41 |
+
'query_var' => false,
|
42 |
+
'menu_icon' => POPMAKE_URL.'/assets/images/admin/dashboard-icon.png',
|
43 |
+
'menu_position' => 20,
|
44 |
+
'supports' => apply_filters( 'popmake_popup_supports', array( 'title', 'editor', 'revisions', 'author' ) ),
|
45 |
+
);
|
46 |
+
$popup_post_type = register_post_type( 'popup', apply_filters( 'popmake_popup_post_type_args', $popup_args ) );
|
47 |
+
|
48 |
+
$popup_theme_labels = apply_filters( 'popmake_popup_theme_labels', array(
|
49 |
+
'name' => '%2$s',
|
50 |
+
'singular_name' => '%1$s',
|
51 |
+
'add_new' => __( 'Add New', 'popup-maker' ),
|
52 |
+
'add_new_item' => __( 'Add New %1$s', 'popup-maker' ),
|
53 |
+
'edit_item' => __( 'Edit %1$s', 'popup-maker' ),
|
54 |
+
'new_item' => __( 'New %1$s', 'popup-maker' ),
|
55 |
+
'all_items' => __( 'All %2$s', 'popup-maker' ),
|
56 |
+
'view_item' => __( 'View %1$s', 'popup-maker' ),
|
57 |
+
'search_items' => __( 'Search %2$s', 'popup-maker' ),
|
58 |
+
'not_found' => __( 'No %2$s found', 'popup-maker' ),
|
59 |
+
'not_found_in_trash'=> __( 'No %2$s found in Trash', 'popup-maker' ),
|
60 |
+
'parent_item_colon' => '',
|
61 |
+
) );
|
62 |
+
|
63 |
+
foreach ( $popup_theme_labels as $key => $value ) {
|
64 |
+
$popup_theme_labels[ $key ] = sprintf( $value, popmake_get_label_singular('popup_theme'), popmake_get_label_plural('popup_theme') );
|
65 |
+
}
|
66 |
+
|
67 |
+
$popup_theme_args = array(
|
68 |
+
'labels' => $popup_theme_labels,
|
69 |
+
'show_ui' => true,
|
70 |
+
'show_in_nav_menus' => false,
|
71 |
+
'show_in_menu' => false,
|
72 |
+
'show_in_admin_bar' => false,
|
73 |
+
'query_var' => false,
|
74 |
+
'supports' => apply_filters( 'popmake_popup_theme_supports', array( 'title', 'revisions', 'author' ) ),
|
75 |
+
);
|
76 |
+
$popup_theme_post_type = register_post_type( 'popup_theme', apply_filters( 'popmake_popup_theme_post_type_args', $popup_theme_args ) );
|
77 |
+
|
78 |
+
|
79 |
+
}
|
80 |
+
add_action( 'init', 'popmake_setup_post_types', 1 );
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get Default Labels
|
84 |
+
*
|
85 |
+
* @since 1.0
|
86 |
+
* @return array $defaults Default labels
|
87 |
+
*/
|
88 |
+
function popmake_get_default_labels($post_type = 'popup') {
|
89 |
+
$defaults = apply_filters( 'popmake_default_post_type_name', array(
|
90 |
+
'popup' => array(
|
91 |
+
'singular' => __( 'Popup', 'popup-maker' ),
|
92 |
+
'plural' => __( 'Popups', 'popup-maker' )
|
93 |
+
),
|
94 |
+
'popup_theme' => array(
|
95 |
+
'singular' => __( 'Theme', 'popup-maker' ),
|
96 |
+
'plural' => __( 'Themes', 'popup-maker' )
|
97 |
+
)
|
98 |
+
));
|
99 |
+
return isset($defaults[$post_type]) ? $defaults[$post_type] : $defaults['popup'];
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Get Singular Label
|
104 |
+
*
|
105 |
+
* @since 1.0
|
106 |
+
*
|
107 |
+
* @param bool $lowercase
|
108 |
+
* @return string $defaults['singular'] Singular label
|
109 |
+
*/
|
110 |
+
function popmake_get_label_singular( $post_type = 'popup', $lowercase = false ) {
|
111 |
+
$defaults = popmake_get_default_labels($post_type);
|
112 |
+
return ($lowercase) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Get Plural Label
|
117 |
+
*
|
118 |
+
* @since 1.0
|
119 |
+
* @return string $defaults['plural'] Plural label
|
120 |
+
*/
|
121 |
+
function popmake_get_label_plural( $post_type = 'popup', $lowercase = false ) {
|
122 |
+
$defaults = popmake_get_default_labels($post_type);
|
123 |
+
return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Change default "Enter title here" input
|
128 |
+
*
|
129 |
+
* @since 1.0
|
130 |
+
* @param string $title Default title placeholder text
|
131 |
+
* @return string $title New placeholder text
|
132 |
+
*/
|
133 |
+
function popmake_change_default_title( $title ) {
|
134 |
+
|
135 |
+
if ( !is_admin() ) {
|
136 |
+
return $title;
|
137 |
+
}
|
138 |
+
|
139 |
+
$screen = get_current_screen();
|
140 |
+
|
141 |
+
if ( 'popup' == $screen->post_type || 'popup_theme' == $screen->post_type ) {
|
142 |
+
$label = popmake_get_label_singular($screen->post_type, false);
|
143 |
+
if( 'popup' == $screen->post_type ) {
|
144 |
+
$title = sprintf( __( '%s Name', 'popup-maker' ), $label );
|
145 |
+
} else {
|
146 |
+
$title = sprintf( __( 'Enter %s name here', 'popup-maker' ), $label );
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
return $title;
|
151 |
+
}
|
152 |
+
add_filter( 'enter_title_here', 'popmake_change_default_title' );
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Registers the custom taxonomies for the downloads custom post type
|
156 |
+
*
|
157 |
+
* @since 1.0
|
158 |
+
* @return void
|
159 |
+
*/
|
160 |
+
function popmake_setup_taxonomies() {
|
161 |
+
|
162 |
+
/** Categories */
|
163 |
+
$category_labels = array(
|
164 |
+
'name' => sprintf( _x( '%s Categories', 'taxonomy general name', 'popup-maker' ), popmake_get_label_singular() ),
|
165 |
+
'singular_name' => _x( 'Category', 'taxonomy singular name', 'popup-maker' ),
|
166 |
+
'search_items' => __( 'Search Categories', 'popup-maker' ),
|
167 |
+
'all_items' => __( 'All Categories', 'popup-maker' ),
|
168 |
+
'parent_item' => __( 'Parent Category', 'popup-maker' ),
|
169 |
+
'parent_item_colon' => __( 'Parent Category:', 'popup-maker' ),
|
170 |
+
'edit_item' => __( 'Edit Category', 'popup-maker' ),
|
171 |
+
'update_item' => __( 'Update Category', 'popup-maker' ),
|
172 |
+
'add_new_item' => sprintf( __( 'Add New %s Category', 'popup-maker' ), popmake_get_label_singular() ),
|
173 |
+
'new_item_name' => __( 'New Category Name', 'popup-maker' ),
|
174 |
+
'menu_name' => __( 'Categories', 'popup-maker' ),
|
175 |
+
'choose_from_most_used' => sprintf( __( 'Choose from most used %s categories', 'popup-maker' ), popmake_get_label_singular() ),
|
176 |
+
);
|
177 |
+
|
178 |
+
$category_args = apply_filters( 'popmake_category_args', array(
|
179 |
+
'hierarchical' => true,
|
180 |
+
'labels' => apply_filters('popmake_category_labels', $category_labels),
|
181 |
+
'public' => false,
|
182 |
+
'show_ui' => true,
|
183 |
+
)
|
184 |
+
);
|
185 |
+
register_taxonomy( 'popup_category', array('popup', 'popup_theme'), $category_args );
|
186 |
+
register_taxonomy_for_object_type( 'popup_category', 'popup' );
|
187 |
+
register_taxonomy_for_object_type( 'popup_category', 'popup_theme' );
|
188 |
+
|
189 |
+
/** Tags */
|
190 |
+
$tag_labels = array(
|
191 |
+
'name' => sprintf( _x( '%s Tags', 'taxonomy general name', 'popup-maker' ), popmake_get_label_singular() ),
|
192 |
+
'singular_name' => _x( 'Tag', 'taxonomy singular name', 'popup-maker' ),
|
193 |
+
'search_items' => __( 'Search Tags', 'popup-maker' ),
|
194 |
+
'all_items' => __( 'All Tags', 'popup-maker' ),
|
195 |
+
'parent_item' => __( 'Parent Tag', 'popup-maker' ),
|
196 |
+
'parent_item_colon' => __( 'Parent Tag:', 'popup-maker' ),
|
197 |
+
'edit_item' => __( 'Edit Tag', 'popup-maker' ),
|
198 |
+
'update_item' => __( 'Update Tag', 'popup-maker' ),
|
199 |
+
'add_new_item' => __( 'Add New Tag', 'popup-maker' ),
|
200 |
+
'new_item_name' => __( 'New Tag Name', 'popup-maker' ),
|
201 |
+
'menu_name' => __( 'Tags', 'popup-maker' ),
|
202 |
+
'choose_from_most_used' => sprintf( __( 'Choose from most used %s tags', 'popup-maker' ), popmake_get_label_singular() ),
|
203 |
+
);
|
204 |
+
|
205 |
+
$tag_args = apply_filters( 'popmake_tag_args', array(
|
206 |
+
'hierarchical' => false,
|
207 |
+
'labels' => apply_filters( 'popmake_tag_labels', $tag_labels ),
|
208 |
+
'public' => false,
|
209 |
+
'show_ui' => true,
|
210 |
+
)
|
211 |
+
);
|
212 |
+
register_taxonomy( 'popup_tag', array('popup', 'popup_theme'), $tag_args );
|
213 |
+
register_taxonomy_for_object_type( 'popup_tag', 'popup' );
|
214 |
+
register_taxonomy_for_object_type( 'popup_tag', 'popup_theme' );
|
215 |
+
}
|
216 |
+
add_action( 'init', 'popmake_setup_taxonomies', 0 );
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Registers Custom Post Statuses
|
220 |
+
*
|
221 |
+
* @since 1.0
|
222 |
+
* @return void
|
223 |
+
*/
|
224 |
+
function popmake_register_post_type_statuses() {
|
225 |
+
register_post_status( 'inactive', array(
|
226 |
+
'label' => _x( 'Inactive', 'Inactive status', 'popup-maker' ),
|
227 |
+
'public' => true,
|
228 |
+
'exclude_from_search' => false,
|
229 |
+
'show_in_admin_all_list' => true,
|
230 |
+
'show_in_admin_status_list' => true,
|
231 |
+
'label_count' => _n_noop( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', 'popup-maker' )
|
232 |
+
) );
|
233 |
+
}
|
234 |
+
//add_action( 'init', 'popmake_register_post_type_statuses' );
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Updated Messages
|
238 |
+
*
|
239 |
+
* Returns an array of with all updated messages.
|
240 |
+
*
|
241 |
+
* @since 1.0
|
242 |
+
* @param array $messages Post updated message
|
243 |
+
* @return array $messages New post updated messages
|
244 |
+
*/
|
245 |
+
function popmake_updated_messages( $messages ) {
|
246 |
+
global $post, $post_ID;
|
247 |
+
|
248 |
+
$label = popmake_get_label_singular();
|
249 |
+
$messages['popup'] = array(
|
250 |
+
1 => sprintf( __( '%1$s updated.', 'popup-maker' ), $label ),
|
251 |
+
4 => sprintf( __( '%1$s updated.', 'popup-maker' ), $label ),
|
252 |
+
6 => sprintf( __( '%1$s published.', 'popup-maker' ), $label ),
|
253 |
+
7 => sprintf( __( '%1$s saved.', 'popup-maker' ), $label ),
|
254 |
+
8 => sprintf( __( '%1$s submitted.', 'popup-maker' ), $label )
|
255 |
+
);
|
256 |
+
|
257 |
+
$label = popmake_get_label_singular('popup_theme');
|
258 |
+
$messages['popup_theme'] = array(
|
259 |
+
1 => sprintf( __( '%1$s updated.', 'popup-maker' ), $label ),
|
260 |
+
4 => sprintf( __( '%1$s updated.', 'popup-maker' ), $label ),
|
261 |
+
6 => sprintf( __( '%1$s published.', 'popup-maker' ), $label ),
|
262 |
+
7 => sprintf( __( '%1$s saved.', 'popup-maker' ), $label ),
|
263 |
+
8 => sprintf( __( '%1$s submitted.', 'popup-maker' ), $label )
|
264 |
+
);
|
265 |
+
|
266 |
+
return $messages;
|
267 |
+
}
|
268 |
+
add_filter( 'post_updated_messages', 'popmake_updated_messages' );
|
269 |
+
|
270 |
+
function popmake_get_supported_types( $type = null, $collapse = true ) {
|
271 |
+
$types = array(
|
272 |
+
'post_type' => apply_filters('popmake_supported_post_types', array('post', 'page')),
|
273 |
+
'taxonomy' => apply_filters('popmake_supported_taxonomies', array('category', 'post_tag'))
|
274 |
+
);
|
275 |
+
|
276 |
+
if($type) {
|
277 |
+
return $types[$type];
|
278 |
+
}
|
279 |
+
elseif($collapse) {
|
280 |
+
return array_merge($types['post_type'], $types['taxonomy']);
|
281 |
+
}
|
282 |
+
return $types;
|
283 |
+
}
|
includes/scripts.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Scripts
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Functions
|
7 |
+
* @copyright Copyright (c) 2014, Wizard Internet Solutions
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Load Scripts
|
17 |
+
*
|
18 |
+
* Loads the Popup Maker scripts.
|
19 |
+
*
|
20 |
+
* @since 1.0
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
function popmake_load_site_scripts() {
|
24 |
+
global $popmake_options;
|
25 |
+
$js_dir = POPMAKE_URL . '/assets/scripts/';
|
26 |
+
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.js' : '.min.js';
|
27 |
+
wp_register_script('TweenMax', $js_dir . '/gsap/TweenMax.min.js', false, '1.14.2', true);
|
28 |
+
wp_register_script('jquery-gsap', $js_dir . '/gsap/jquery.gsap.min.js', array('jquery', 'TweenMax'), '0.1.9', true);
|
29 |
+
wp_register_script('jquery-cookie', $js_dir . 'jquery.cookie' . $suffix, array('jquery'), '1.4.1', true);
|
30 |
+
wp_enqueue_script('popup-maker-site', $js_dir . 'popup-maker-site' . $suffix . '?defer', array('jquery', 'jquery-ui-core', 'jquery-ui-position', 'jquery-gsap'), '1.0', true);
|
31 |
+
wp_localize_script('popup-maker-site', 'ajaxurl', admin_url('admin-ajax.php') );
|
32 |
+
wp_localize_script('popup-maker-site', 'popmake_default_theme', popmake_get_default_popup_theme() );
|
33 |
+
wp_localize_script('popup-maker-site', 'popmake_themes', array('l10n_print_after' => 'popmake_themes = ' . json_encode( popmake_get_popup_themes_data() ) . ';'));
|
34 |
+
if(empty($popmake_options['popmake_powered_by_opt_out']) || !$popmake_options['popmake_powered_by_opt_out']) {
|
35 |
+
$size = $popmake_options['popmake_powered_by_size'];
|
36 |
+
wp_localize_script('popup-maker-site', 'popmake_powered_by', '<div class="powered-by-popmake '. $size .'"><a href="https://wppopupmaker.com" target="_blank"><img src="' . POPMAKE_URL . '/assets/images/admin/powered-by-popup-maker.png" alt="'. __( 'Powered By Popup Maker', 'popup-maker' ) .'"/></a></div>' );
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
add_action( 'wp_enqueue_scripts', 'popmake_load_site_scripts' );
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Load Styles
|
44 |
+
*
|
45 |
+
* Loads the Popup Maker stylesheet.
|
46 |
+
*
|
47 |
+
* @since 1.0
|
48 |
+
* @return void
|
49 |
+
*/
|
50 |
+
function popmake_load_site_styles() {
|
51 |
+
global $popmake_options, $popmake_needed_google_fonts;
|
52 |
+
$css_dir = POPMAKE_URL . '/assets/styles/';
|
53 |
+
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
|
54 |
+
wp_enqueue_style('popup-maker-site', $css_dir . 'popup-maker-site' . $suffix, false, '1.0');
|
55 |
+
if(!empty($popmake_needed_google_fonts) && !isset($popmake_options['disable_google_font_loading'])) {
|
56 |
+
$link = "//fonts.googleapis.com/css?family=";
|
57 |
+
foreach($popmake_needed_google_fonts as $font_family => $variants) {
|
58 |
+
if($link != "//fonts.googleapis.com/css?family=") {
|
59 |
+
$link .= "|";
|
60 |
+
}
|
61 |
+
$link .= $font_family;
|
62 |
+
if(!empty($variants)) {
|
63 |
+
$link .= ":";
|
64 |
+
$link .= implode(',', $variants);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
wp_enqueue_style('popup-maker-google-fonts', $link);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
add_action( 'wp_enqueue_scripts', 'popmake_load_site_styles' );
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Load Admin Scripts
|
74 |
+
*
|
75 |
+
* Enqueues the required admin scripts.
|
76 |
+
*
|
77 |
+
* @since 1.0
|
78 |
+
* @param string $hook Page hook
|
79 |
+
* @return void
|
80 |
+
*/
|
81 |
+
function popmake_load_admin_scripts( $hook ) {
|
82 |
+
$js_dir = POPMAKE_URL . '/assets/scripts/';
|
83 |
+
// Use minified libraries if SCRIPT_DEBUG is turned off
|
84 |
+
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.js' : '.min.js';
|
85 |
+
if(popmake_is_admin_page()) {
|
86 |
+
wp_enqueue_script('popup-maker-admin', $js_dir . 'popup-maker-admin' . $suffix, array('jquery', 'wp-color-picker', 'jquery-ui-slider'), '1.0');
|
87 |
+
wp_localize_script('popup-maker-admin', 'popmake_admin_ajax_nonce', wp_create_nonce( POPMAKE_NONCE ));
|
88 |
+
}
|
89 |
+
if(popmake_is_admin_popup_theme_page()) {
|
90 |
+
wp_localize_script('popup-maker-admin', 'popmake_google_fonts', popmake_get_google_webfonts_list());
|
91 |
+
}
|
92 |
+
}
|
93 |
+
add_action( 'admin_enqueue_scripts', 'popmake_load_admin_scripts', 100 );
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Load Admin Styles
|
97 |
+
*
|
98 |
+
* Enqueues the required admin styles.
|
99 |
+
*
|
100 |
+
* @since 1.0
|
101 |
+
* @param string $hook Page hook
|
102 |
+
* @return void
|
103 |
+
*/
|
104 |
+
function popmake_load_admin_styles( $hook ) {
|
105 |
+
$css_dir = POPMAKE_URL . '/assets/styles/';
|
106 |
+
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
|
107 |
+
if(popmake_is_admin_page()) {
|
108 |
+
wp_enqueue_style('wp-color-picker');
|
109 |
+
wp_enqueue_style('popup-maker-admin', $css_dir . 'popup-maker-admin' . $suffix, false, '1.0');
|
110 |
+
}
|
111 |
+
}
|
112 |
+
add_action( 'admin_enqueue_scripts', 'popmake_load_admin_styles', 100 );
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Load Admin Styles
|
116 |
+
*
|
117 |
+
* Defers loading of scripts with ?defer parameter in url.
|
118 |
+
*
|
119 |
+
* @since 1.0
|
120 |
+
* @param string $url URL being cleaned
|
121 |
+
* @return Variable $url
|
122 |
+
*/
|
123 |
+
function popmake_defer_js_url( $url )
|
124 |
+
{
|
125 |
+
if ( FALSE === strpos( $url, '.js?defer' ) ) {
|
126 |
+
// not our file
|
127 |
+
return $url;
|
128 |
+
}
|
129 |
+
return "$url' defer='defer";
|
130 |
+
}
|
131 |
+
add_filter( 'clean_url', 'popmake_defer_js_url', 11, 1 );
|
includes/shortcodes.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_shortcode( 'popup', 'popmake_shortcode_popup');
|
3 |
+
function popmake_shortcode_popup($atts, $content = NULL)
|
4 |
+
{
|
5 |
+
$atts = shortcode_atts(
|
6 |
+
apply_filters('popmake_shortcode_popup_default_atts', array(
|
7 |
+
'id' => "",
|
8 |
+
'theme_id' => 1,
|
9 |
+
'title' => "",
|
10 |
+
'overlay_disabled' => 0,
|
11 |
+
'size' => "auto",
|
12 |
+
'width' => "",
|
13 |
+
'widthUnit' => "px",
|
14 |
+
'height' => "",
|
15 |
+
'heightUnit' => "px",
|
16 |
+
'location' => "center top",
|
17 |
+
'positionTop' => 100,
|
18 |
+
'positionLeft' => 0,
|
19 |
+
'positionBottom' => 0,
|
20 |
+
'positionRight' => 0,
|
21 |
+
'positionFixed' => 0,
|
22 |
+
'animation' => "slide",
|
23 |
+
'animationSpeed' => 350,
|
24 |
+
'animationOrigin' => 'top',
|
25 |
+
'overlayClose' => 0,
|
26 |
+
'escClose' => 1,
|
27 |
+
// Deprecated
|
28 |
+
'theme' => NULL,
|
29 |
+
'duration' => NULL,
|
30 |
+
'direction' => NULL,
|
31 |
+
'overlayEscClose' => NULL,
|
32 |
+
)),
|
33 |
+
apply_filters('popmake_shortcode_popup_atts', $atts)
|
34 |
+
);
|
35 |
+
|
36 |
+
$popup_fields = array(
|
37 |
+
'id' => $atts['id'],
|
38 |
+
'theme' => $atts['theme_id'],
|
39 |
+
'meta' => array(
|
40 |
+
'display' => array(
|
41 |
+
'size' => $atts['size'],
|
42 |
+
'overlay_disabled' => $atts['overlay_disabled'],
|
43 |
+
'custom_width' => $atts['width'],
|
44 |
+
'custom_width_unit' => $atts['widthUnit'],
|
45 |
+
'custom_height' => $atts['height'],
|
46 |
+
'custom_height_unit' => $atts['heightUnit'],
|
47 |
+
'custom_height_auto' => $atts['width'] > 0 ? 0 : 1,
|
48 |
+
'location' => $atts['location'],
|
49 |
+
'position_top' => $atts['positionTop'],
|
50 |
+
'position_left' => $atts['positionLeft'],
|
51 |
+
'position_bottom' => $atts['positionBottom'],
|
52 |
+
'position_right' => $atts['positionRight'],
|
53 |
+
'position_fixed' => $atts['positionFixed'],
|
54 |
+
'animation_type' => $atts['animation'],
|
55 |
+
'animation_speed' => $atts['animationSpeed'],
|
56 |
+
'animation_origin' => $atts['animationOrigin'],
|
57 |
+
),
|
58 |
+
'close' => array(
|
59 |
+
'overlay_click' => $atts['overlayClose'],
|
60 |
+
'esc_press' => $atts['escClose']
|
61 |
+
),
|
62 |
+
),
|
63 |
+
);
|
64 |
+
|
65 |
+
$classes = array('popmake', 'theme-'. $atts['theme_id']);
|
66 |
+
if( in_array( $atts['size'], array('normal', 'nano', 'tiny', 'small', 'medium', 'large', 'xlarge') ) )
|
67 |
+
{
|
68 |
+
$classes[] = 'responsive';
|
69 |
+
$classes[] = 'size-' . $atts['size'];
|
70 |
+
}
|
71 |
+
elseif($atts['size'] == 'custom')
|
72 |
+
{
|
73 |
+
$classes[] = 'size-custom';
|
74 |
+
}
|
75 |
+
|
76 |
+
$return = "<div id='popmake-". $atts['id'] ."' class='". implode(' ', $classes) ."' data-popmake='". json_encode($popup_fields) ."'>";
|
77 |
+
if( $atts['title'] != '' ) :
|
78 |
+
$return .= '<div class="popmake-title">'. $atts['title'] .'</div>';
|
79 |
+
endif;
|
80 |
+
$return .= '<div class="popmake-content">'. do_shortcode($content) . '</div>';
|
81 |
+
$return .= '<a class="popmake-close">'. __( '×', 'popup-maker') .'</a>';
|
82 |
+
$return .= '</div>';
|
83 |
+
return $return;
|
84 |
+
}
|
includes/templates.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template Loader for Plugins.
|
4 |
+
*
|
5 |
+
* @package PopMake_Template_Loader
|
6 |
+
* @author Daniel Iser
|
7 |
+
* @author Gary Jones
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Returns the path to the Popup Maker templates directory
|
12 |
+
*/
|
13 |
+
function popmake_get_templates_dir() {
|
14 |
+
return POPMAKE_DIR . 'templates';
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Returns the URL to the Popup Maker templates directory
|
19 |
+
*/
|
20 |
+
function popmake_get_templates_url() {
|
21 |
+
return POPMAKE_URL . 'templates';
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Retrieves a template part
|
26 |
+
*/
|
27 |
+
function popmake_get_template_part( $slug, $name = null, $load = true ) {
|
28 |
+
// Execute code for this part
|
29 |
+
do_action( 'get_template_part_' . $slug, $slug, $name );
|
30 |
+
|
31 |
+
// Setup possible parts
|
32 |
+
$templates = array();
|
33 |
+
if ( isset( $name ) )
|
34 |
+
$templates[] = $slug . '-' . $name . '.php';
|
35 |
+
$templates[] = $slug . '.php';
|
36 |
+
|
37 |
+
// Allow template parts to be filtered
|
38 |
+
$templates = apply_filters( 'popmake_get_template_part', $templates, $slug, $name );
|
39 |
+
|
40 |
+
// Return the part that is found
|
41 |
+
return popmake_locate_template( $templates, $load, false );
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Retrieve the name of the highest priority template file that exists.
|
46 |
+
*/
|
47 |
+
function popmake_locate_template( $template_names, $load = false, $require_once = true ) {
|
48 |
+
// No file found yet
|
49 |
+
$located = false;
|
50 |
+
|
51 |
+
// Try to find a template file
|
52 |
+
foreach ( (array) $template_names as $template_name ) {
|
53 |
+
|
54 |
+
// Continue if template is empty
|
55 |
+
if ( empty( $template_name ) )
|
56 |
+
continue;
|
57 |
+
|
58 |
+
// Trim off any slashes from the template name
|
59 |
+
$template_name = ltrim( $template_name, '/' );
|
60 |
+
|
61 |
+
// try locating this template file by looping through the template paths
|
62 |
+
foreach( popmake_get_theme_template_paths() as $template_path ) {
|
63 |
+
|
64 |
+
if( file_exists( $template_path . $template_name ) ) {
|
65 |
+
$located = $template_path . $template_name;
|
66 |
+
break;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
if( $located ) {
|
71 |
+
break;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ( true == $load ) && ! empty( $located ) )
|
76 |
+
load_template( $located, $require_once );
|
77 |
+
|
78 |
+
return $located;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns a list of paths to check for template locations
|
83 |
+
*/
|
84 |
+
function popmake_get_theme_template_paths() {
|
85 |
+
|
86 |
+
$template_dir = popmake_get_theme_template_dir_name();
|
87 |
+
|
88 |
+
$file_paths = array(
|
89 |
+
1 => trailingslashit( get_stylesheet_directory() ) . $template_dir,
|
90 |
+
10 => trailingslashit( get_template_directory() ) . $template_dir,
|
91 |
+
100 => popmake_get_templates_dir()
|
92 |
+
);
|
93 |
+
|
94 |
+
$file_paths = apply_filters( 'popmake_template_paths', $file_paths );
|
95 |
+
|
96 |
+
// sort the file paths based on priority
|
97 |
+
ksort( $file_paths, SORT_NUMERIC );
|
98 |
+
|
99 |
+
return array_map( 'trailingslashit', $file_paths );
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Returns the template directory name.
|
104 |
+
*
|
105 |
+
* Themes can filter this by using the popmake_templates_dir filter.
|
106 |
+
*/
|
107 |
+
function popmake_get_theme_template_dir_name() {
|
108 |
+
return trailingslashit( apply_filters( 'popmake_templates_dir', 'popmake_templates' ) );
|
109 |
+
}
|
includes/theme-functions.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Popup Theme Functions
|
4 |
+
*
|
5 |
+
* @package POPMAKE
|
6 |
+
* @subpackage Functions
|
7 |
+
* @copyright Copyright (c) 2014, Daniel Iser
|
8 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
function popmake_get_default_popup_theme() {
|
18 |
+
$default_theme = get_option('popmake_default_theme');
|
19 |
+
if( FALSE === get_post_status( $default_theme ) ) {
|
20 |
+
popmake_install_default_theme();
|
21 |
+
$default_theme = get_option('popmake_default_theme');
|
22 |
+
}
|
23 |
+
return $default_theme;
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Returns the meta group of a theme or value if key is set.
|
29 |
+
*
|
30 |
+
* @since 1.0
|
31 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a overlay meta for
|
32 |
+
* @return mixed array|string of the popup overlay meta
|
33 |
+
*/
|
34 |
+
function popmake_get_popup_theme_meta_group( $group, $popup_theme_id = NULL, $key = NULL ) {
|
35 |
+
if(!$popup_theme_id) $popup_theme_id = get_the_ID();
|
36 |
+
|
37 |
+
$post_meta = get_post_custom( $popup_theme_id );
|
38 |
+
$group_values = $post_meta ? array() : apply_filters("popmake_popup_theme_{$group}_defaults", array());
|
39 |
+
if($post_meta) {
|
40 |
+
foreach($post_meta as $meta_key => $value) {
|
41 |
+
if(strpos($meta_key, "popup_theme_{$group}_") !== false) {
|
42 |
+
$new_key = str_replace("popup_theme_{$group}_", '', $meta_key);
|
43 |
+
if(count($value) == 1)
|
44 |
+
$group_values[$new_key] = $value[0];
|
45 |
+
else
|
46 |
+
$group_values[$new_key] = $value;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
if($key) {
|
52 |
+
$key = str_replace('.', '_', $key);
|
53 |
+
if(!isset($group_values[$key])) {
|
54 |
+
return false;
|
55 |
+
}
|
56 |
+
$value = $group_values[$key];
|
57 |
+
return apply_filters( "popmake_get_popup_theme_{$group}_$key", $value, $popup_theme_id );
|
58 |
+
}
|
59 |
+
else {
|
60 |
+
return apply_filters( "popmake_get_popup_theme_{$group}", $group_values, $popup_theme_id );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns the overlay meta of a theme.
|
67 |
+
*
|
68 |
+
* @since 1.0
|
69 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a overlay meta for
|
70 |
+
* @return mixed array|string of the popup overlay meta
|
71 |
+
*/
|
72 |
+
function popmake_get_popup_theme_overlay( $popup_theme_id = NULL, $key = NULL ) {
|
73 |
+
return popmake_get_popup_theme_meta_group( 'overlay', $popup_theme_id, $key );
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Returns the container meta of a theme.
|
79 |
+
*
|
80 |
+
* @since 1.0
|
81 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a container meta for
|
82 |
+
* @return mixed array|string of the popup container meta
|
83 |
+
*/
|
84 |
+
function popmake_get_popup_theme_container( $popup_theme_id = NULL, $key = NULL ) {
|
85 |
+
return popmake_get_popup_theme_meta_group( 'container', $popup_theme_id, $key );
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Returns the title meta of a theme.
|
91 |
+
*
|
92 |
+
* @since 1.0
|
93 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a title meta for
|
94 |
+
* @return mixed array|string of the popup title meta
|
95 |
+
*/
|
96 |
+
function popmake_get_popup_theme_title( $popup_theme_id = NULL, $key = NULL ) {
|
97 |
+
return popmake_get_popup_theme_meta_group( 'title', $popup_theme_id, $key );
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Returns the content meta of a theme.
|
103 |
+
*
|
104 |
+
* @since 1.0
|
105 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a content meta for
|
106 |
+
* @return mixed array|string of the popup content meta
|
107 |
+
*/
|
108 |
+
function popmake_get_popup_theme_content( $popup_theme_id = NULL, $key = NULL ) {
|
109 |
+
return popmake_get_popup_theme_meta_group( 'content', $popup_theme_id, $key );
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns the close meta of a theme.
|
115 |
+
*
|
116 |
+
* @since 1.0
|
117 |
+
* @param int $popup_theme_id ID number of the popup to retrieve a close meta for
|
118 |
+
* @return mixed array|string of the popup close meta
|
119 |
+
*/
|
120 |
+
function popmake_get_popup_theme_close( $popup_theme_id = NULL, $key = NULL ) {
|
121 |
+
return popmake_get_popup_theme_meta_group( 'close', $popup_theme_id, $key );
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
function popmake_get_popup_theme_data_attr( $popup_theme_id = NULL ) {
|
128 |
+
if(!$popup_theme_id) $popup_theme_id = get_the_ID();
|
129 |
+
$data_attr = array(
|
130 |
+
'overlay' => popmake_get_popup_theme_overlay( $popup_theme_id ),
|
131 |
+
'container' => popmake_get_popup_theme_container( $popup_theme_id ),
|
132 |
+
'title' => popmake_get_popup_theme_title( $popup_theme_id ),
|
133 |
+
'content' => popmake_get_popup_theme_content( $popup_theme_id ),
|
134 |
+
'close' => popmake_get_popup_theme_close( $popup_theme_id ),
|
135 |
+
);
|
136 |
+
return apply_filters('popmake_get_popup_theme_data_attr', $data_attr, $popup_theme_id );
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
function popmake_get_popup_theme_default_meta() {
|
141 |
+
$default_meta = array();
|
142 |
+
$defaults = popmake_get_popup_theme_data_attr( 0 );
|
143 |
+
foreach($defaults as $group => $fields) {
|
144 |
+
$prefix = 'popup_theme_' . $group . '_';
|
145 |
+
foreach($fields as $field => $value) {
|
146 |
+
$default_meta[$prefix . $field] = $value;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
return $default_meta;
|
150 |
+
}
|
151 |
+
|
152 |
+
function popmake_get_popup_themes_data() {
|
153 |
+
|
154 |
+
$query = new WP_Query( array(
|
155 |
+
'post_type' => 'popup_theme',
|
156 |
+
'posts_per_page' => -1
|
157 |
+
) );
|
158 |
+
|
159 |
+
$popmake_themes = array();
|
160 |
+
|
161 |
+
if ( $query->have_posts() ) {
|
162 |
+
while ( $query->have_posts() ) : $query->the_post();
|
163 |
+
$popmake_themes[$query->post->ID] = popmake_get_popup_theme_data_attr();
|
164 |
+
endwhile;
|
165 |
+
wp_reset_postdata();
|
166 |
+
}
|
167 |
+
|
168 |
+
return apply_filters( 'popmake_get_popup_themes_data', $popmake_themes );
|
169 |
+
|
170 |
+
}
|
popup-maker.php
ADDED
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Popup Maker
|
4 |
+
* Plugin URI: https://wppopupmaker.com
|
5 |
+
* Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
|
6 |
+
* Author: Wizard Internet Solutions
|
7 |
+
* Version: 1.0
|
8 |
+
* Author URI: http://wizardinternetsolutions.com
|
9 |
+
* Text Domain: popup-maker
|
10 |
+
*
|
11 |
+
* @package POPMAKE
|
12 |
+
* @category Core
|
13 |
+
* @author Daniel Iser
|
14 |
+
* @copyright Copyright (c) 2014, Wizard Internet Solutions
|
15 |
+
* @since 1.0
|
16 |
+
*/
|
17 |
+
|
18 |
+
//if ( ! defined( 'SCRIPT_DEBUG' ) ) define('SCRIPT_DEBUG', true);
|
19 |
+
|
20 |
+
|
21 |
+
// Exit if accessed directly
|
22 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
23 |
+
|
24 |
+
if ( ! class_exists( 'Popup_Maker' ) ) :
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Main Popup_Maker Class
|
28 |
+
*
|
29 |
+
* @since 1.0
|
30 |
+
*/
|
31 |
+
final class Popup_Maker {
|
32 |
+
/** Singleton *************************************************************/
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var Popup_Maker The one true Popup_Maker
|
36 |
+
* @since 1.0
|
37 |
+
*/
|
38 |
+
private static $instance;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* POPMAKE Roles Object
|
42 |
+
*
|
43 |
+
* @var object
|
44 |
+
* @since 1.0
|
45 |
+
*/
|
46 |
+
public $roles;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* POPMAKE HTML Session Object
|
50 |
+
*
|
51 |
+
* This holds cart items, purchase sessions, and anything else stored in the session
|
52 |
+
*
|
53 |
+
*
|
54 |
+
* @var object
|
55 |
+
* @since 1.0
|
56 |
+
*/
|
57 |
+
public $session;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Main Popup_Maker Instance
|
61 |
+
*
|
62 |
+
* Insures that only one instance of Popup_Maker exists in memory at any one
|
63 |
+
* time. Also prevents needing to define globals all over the place.
|
64 |
+
*
|
65 |
+
* @since 1.0
|
66 |
+
* @static
|
67 |
+
* @staticvar array $instance
|
68 |
+
* @uses Popup_Maker::setup_constants() Setup the constants needed
|
69 |
+
* @uses Popup_Maker::includes() Include the required files
|
70 |
+
* @uses Popup_Maker::load_textdomain() load the language files
|
71 |
+
* @see PopMake()
|
72 |
+
* @return The one true Popup_Maker
|
73 |
+
*/
|
74 |
+
public static function instance() {
|
75 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Popup_Maker ) ) {
|
76 |
+
self::$instance = new Popup_Maker;
|
77 |
+
self::$instance->setup_constants();
|
78 |
+
self::$instance->includes();
|
79 |
+
self::$instance->load_textdomain();
|
80 |
+
|
81 |
+
register_activation_hook( __FILE__ , 'popmake_install' );
|
82 |
+
}
|
83 |
+
return self::$instance;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Throw error on object clone
|
88 |
+
*
|
89 |
+
* The whole idea of the singleton design pattern is that there is a single
|
90 |
+
* object therefore, we don't want the object to be cloned.
|
91 |
+
*
|
92 |
+
* @since 1.0
|
93 |
+
* @access protected
|
94 |
+
* @return void
|
95 |
+
*/
|
96 |
+
public function __clone() {
|
97 |
+
// Cloning instances of the class is forbidden
|
98 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'popup-maker' ), '3' );
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Disable unserializing of the class
|
103 |
+
*
|
104 |
+
* @since 1.0
|
105 |
+
* @access protected
|
106 |
+
* @return void
|
107 |
+
*/
|
108 |
+
public function __wakeup() {
|
109 |
+
// Unserializing instances of the class is forbidden
|
110 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'popup-maker' ), '3' );
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Setup plugin constants
|
115 |
+
*
|
116 |
+
* @access private
|
117 |
+
* @since 1.0
|
118 |
+
* @return void
|
119 |
+
*/
|
120 |
+
private function setup_constants() {
|
121 |
+
|
122 |
+
if ( !defined('POPMAKE') ) {
|
123 |
+
define('POPMAKE', __FILE__);
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( !defined('POPMAKE_NAME') ) {
|
127 |
+
define('POPMAKE_NAME', 'Popup Maker');
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( !defined('POPMAKE_SLUG') ) {
|
131 |
+
define('POPMAKE_SLUG', trim(dirname(plugin_basename(__FILE__)), '/'));
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( !defined('POPMAKE_DIR') ) {
|
135 |
+
define('POPMAKE_DIR', WP_PLUGIN_DIR . '/' . POPMAKE_SLUG . '/');
|
136 |
+
}
|
137 |
+
|
138 |
+
if ( !defined('POPMAKE_URL') ) {
|
139 |
+
define('POPMAKE_URL', plugins_url() . '/' . POPMAKE_SLUG);
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( !defined('POPMAKE_NONCE') ) {
|
143 |
+
define('POPMAKE_NONCE', 'popmake_nonce' );
|
144 |
+
}
|
145 |
+
|
146 |
+
if ( !defined('POPMAKE_VERSION') ) {
|
147 |
+
define('POPMAKE_VERSION', '1.0' );
|
148 |
+
}
|
149 |
+
|
150 |
+
if ( !defined('POPMAKE_DB_VERSION') ) {
|
151 |
+
define('POPMAKE_DB_VERSION', '1.0' );
|
152 |
+
}
|
153 |
+
|
154 |
+
if ( !defined('POPMAKE_API_URL') ) {
|
155 |
+
define('POPMAKE_API_URL', 'https://wppopupmaker.com');
|
156 |
+
}
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Include required files
|
162 |
+
*
|
163 |
+
* @access private
|
164 |
+
* @since 1.0
|
165 |
+
* @return void
|
166 |
+
*/
|
167 |
+
private function includes() {
|
168 |
+
global $popmake_options;
|
169 |
+
|
170 |
+
require_once POPMAKE_DIR . 'includes/admin/settings/register-settings.php';
|
171 |
+
$popmake_options = popmake_get_settings();
|
172 |
+
|
173 |
+
|
174 |
+
|
175 |
+
require_once POPMAKE_DIR . 'includes/post-types.php';
|
176 |
+
require_once POPMAKE_DIR . 'includes/scripts.php';
|
177 |
+
require_once POPMAKE_DIR . 'includes/shortcodes.php';
|
178 |
+
require_once POPMAKE_DIR . 'includes/defaults.php';
|
179 |
+
require_once POPMAKE_DIR . 'includes/google-fonts.php';
|
180 |
+
require_once POPMAKE_DIR . 'includes/general-functions.php';
|
181 |
+
require_once POPMAKE_DIR . 'includes/extensions-functions.php';
|
182 |
+
require_once POPMAKE_DIR . 'includes/input-options.php';
|
183 |
+
require_once POPMAKE_DIR . 'includes/popup-functions.php';
|
184 |
+
require_once POPMAKE_DIR . 'includes/theme-functions.php';
|
185 |
+
require_once POPMAKE_DIR . 'includes/ajax-calls.php';
|
186 |
+
|
187 |
+
|
188 |
+
require_once POPMAKE_DIR . 'includes/integrations/gravityforms.php';
|
189 |
+
require_once POPMAKE_DIR . 'includes/integrations/google-fonts.php';
|
190 |
+
|
191 |
+
if ( is_admin() ) {
|
192 |
+
require_once POPMAKE_DIR . 'includes/admin/welcome.php';
|
193 |
+
require_once POPMAKE_DIR . 'includes/admin/welcome/about.php';
|
194 |
+
require_once POPMAKE_DIR . 'includes/admin/welcome/credits.php';
|
195 |
+
require_once POPMAKE_DIR . 'includes/admin/welcome/changelog.php';
|
196 |
+
require_once POPMAKE_DIR . 'includes/admin/welcome/getting-started.php';
|
197 |
+
require_once POPMAKE_DIR . 'includes/admin/admin-setup.php';
|
198 |
+
require_once POPMAKE_DIR . 'includes/admin/admin-functions.php';
|
199 |
+
require_once POPMAKE_DIR . 'includes/admin/admin-pages.php';
|
200 |
+
require_once POPMAKE_DIR . 'includes/admin/admin-notices.php';
|
201 |
+
require_once POPMAKE_DIR . 'includes/admin/post-editor.php';
|
202 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/metabox.php';
|
203 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/dashboard-columns.php';
|
204 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/metabox-close-fields.php';
|
205 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/metabox-display-fields.php';
|
206 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/metabox-loading-fields.php';
|
207 |
+
require_once POPMAKE_DIR . 'includes/admin/popups/post-type-item-metaboxes.php';
|
208 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox.php';
|
209 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-close-fields.php';
|
210 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-container-fields.php';
|
211 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-content-fields.php';
|
212 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-overlay-fields.php';
|
213 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-title-fields.php';
|
214 |
+
require_once POPMAKE_DIR . 'includes/admin/themes/metabox-preview.php';
|
215 |
+
require_once POPMAKE_DIR . 'includes/admin/settings/settings-page.php';
|
216 |
+
require_once POPMAKE_DIR . 'includes/admin/extensions/extensions-page.php';
|
217 |
+
require_once POPMAKE_DIR . 'includes/admin/help/help-page.php';
|
218 |
+
require_once POPMAKE_DIR . 'includes/admin/metabox-support.php';
|
219 |
+
require_once POPMAKE_DIR . 'includes/admin/metabox-share.php';
|
220 |
+
require_once POPMAKE_DIR . 'includes/license-handler.php';
|
221 |
+
} else {
|
222 |
+
require_once POPMAKE_DIR . 'includes/templates.php';
|
223 |
+
require_once POPMAKE_DIR . 'includes/load-popups.php';
|
224 |
+
}
|
225 |
+
|
226 |
+
require_once POPMAKE_DIR . 'includes/install.php';
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Loads the plugin language files
|
231 |
+
*
|
232 |
+
* @access public
|
233 |
+
* @since 1.0
|
234 |
+
* @return void
|
235 |
+
*/
|
236 |
+
public function load_textdomain() {
|
237 |
+
// Set filter for plugin's languages directory
|
238 |
+
$popmake_lang_dir = dirname( plugin_basename( POPMAKE ) ) . '/languages/';
|
239 |
+
$popmake_lang_dir = apply_filters( 'popmake_languages_directory', $popmake_lang_dir );
|
240 |
+
|
241 |
+
// Traditional WordPress plugin locale filter
|
242 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'popup-maker' );
|
243 |
+
$mofile = sprintf( '%1$s-%2$s.mo', 'popup-maker', $locale );
|
244 |
+
|
245 |
+
// Setup paths to current locale file
|
246 |
+
$mofile_local = $popmake_lang_dir . $mofile;
|
247 |
+
$mofile_global = WP_LANG_DIR . '/popup-maker/' . $mofile;
|
248 |
+
|
249 |
+
if ( file_exists( $mofile_global ) ) {
|
250 |
+
// Look in global /wp-content/languages/popup-maker folder
|
251 |
+
load_textdomain( 'popup-maker', $mofile_global );
|
252 |
+
} elseif ( file_exists( $mofile_local ) ) {
|
253 |
+
// Look in local /wp-content/plugins/popup-maker/languages/ folder
|
254 |
+
load_textdomain( 'popup-maker', $mofile_local );
|
255 |
+
} else {
|
256 |
+
// Load the default language files
|
257 |
+
load_plugin_textdomain( 'popup-maker', false, $popmake_lang_dir );
|
258 |
+
}
|
259 |
+
}
|
260 |
+
}
|
261 |
+
|
262 |
+
endif; // End if class_exists check
|
263 |
+
|
264 |
+
|
265 |
+
/**
|
266 |
+
* The main function responsible for returning the one true Popup_Maker
|
267 |
+
* Instance to functions everywhere.
|
268 |
+
*
|
269 |
+
* Use this function like you would a global variable, except without needing
|
270 |
+
* to declare the global.
|
271 |
+
*
|
272 |
+
* Example: <?php $popmake = PopMake(); ?>
|
273 |
+
*
|
274 |
+
* @since 1.0
|
275 |
+
* @return object The one true Popup_Maker Instance
|
276 |
+
*/
|
277 |
+
|
278 |
+
function PopMake() {
|
279 |
+
return Popup_Maker::instance();
|
280 |
+
}
|
281 |
+
PopMake();
|
282 |
+
|
283 |
+
function popmake_initialize() {
|
284 |
+
// Get POPMAKE Running
|
285 |
+
do_action('popmake_initialize');
|
286 |
+
}
|
287 |
+
add_action('plugins_loaded', 'popmake_initialize', 0);
|
readme.txt
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Popup Maker ===
|
2 |
+
Contributors: danieliser, waltmesser
|
3 |
+
Author URI: http://wizardinternetsolutions.com
|
4 |
+
Plugin URI: https://wppopupmaker.com
|
5 |
+
Donate link:
|
6 |
+
Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms, lightbox, login modals
|
7 |
+
Requires at least: 3.4
|
8 |
+
Tested up to: 4.0
|
9 |
+
Stable tag: 1.0
|
10 |
+
Easily turn users into cash using Popup Maker - the most versatile & expansive popup plugin for WordPress!
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
Increase your site's leads generated, usability & conversion rates using our unlimited WYSIWIG content editor - put any content you can imagine inside your popups! Plus, Popup Maker gives you the ability to streamline, transform your website, and promote & market your content like never before using our ultimate theme capabilities & customization options!
|
14 |
+
|
15 |
+
After installing Popup maker, use it like a Pro! Read the About & Getting Started Tabs in the Popup Maker Welcome Center.
|
16 |
+
|
17 |
+
Use any of your forms from the most popular form plugins, out-of-the-box, inside your popups with ease and efficiency. 100% seamless compatibility with:
|
18 |
+
* Gravity Forms
|
19 |
+
* Ninja Forms
|
20 |
+
* Contact Form 7
|
21 |
+
|
22 |
+
[Subscribe to our Newsletter](https://wppopupmaker.com/newsletter-sign-up "Popup Maker Newsletter Sign Up") and receive tutorials and guides tailored to teaching you how to drastically improve your conversion rates using Popup Maker.
|
23 |
+
|
24 |
+
* If you like the plugin please rate & review it! If you love the plugin and want news & updates, follow us on [Twitter](https://twitter.com/wppopupmaker "Popup Maker on Twitter")!
|
25 |
+
* Check out the [Popup Maker Website](https://wppopupmaker.com "Popup Maker Website") for everything Popup Maker.
|
26 |
+
|
27 |
+
= Core Features =
|
28 |
+
* Unlimited Content Customization
|
29 |
+
* Use the Popup Maker WYSIWIG Content Editor to easily create as many popups as you like with any content you like! Plus, use Short Codes, HTML, and other code to give your popups ultimate power! Adding content in Popup Maker is just like adding content in WordPress.
|
30 |
+
* Use Popups Conditionally
|
31 |
+
* Target specific users for your popups! Our Targeting Conditions feature allows you to tailor your popups to specific users by giving you the ability to use popups exactly where you want. Use Auto Open, Scroll Triggered & Exit Intent Popup Extensions to enhance your popups� effectiveness.
|
32 |
+
* One (1) Customizable Popup Theme
|
33 |
+
* Customize every aspect of our default theme to match your needs. To differentiate your popup themes, you can create unlimited themes by upgrading to the Unlimited Themes Extension.
|
34 |
+
* Popup Opening Animations
|
35 |
+
* Give your popup more power and customize how it pops up by choosing from several opening animations. Need more power? Check out our Animation Pack Extensions!
|
36 |
+
* Complete Positioning Control
|
37 |
+
* Popup Maker offers you pixel perfect positioning settings to match your needs and fit your website perfectly.
|
38 |
+
* Theme Builder
|
39 |
+
* Create high performing themes in minutes with our user friendly Theme Builder. Want more options? Get our Advanced Theme Builder now!
|
40 |
+
* Scrollable Content
|
41 |
+
* Use the Scrollable Content Feature to add more content to your popups and ensure all of your content is visible to users!
|
42 |
+
* Responsive Popups
|
43 |
+
* Create popups ready for any device in seconds by simply selecting an option from our robust Responsive Popups tool set.
|
44 |
+
* Lightweight, Dependable & Versatile
|
45 |
+
* Speed matters, and at only 5.9kb, our popups won�t slow you down. Our optimization techniques and program enhancement means your popups will perform at a consistently high level with 100% uptime.
|
46 |
+
|
47 |
+
= Our extensions enhance your popups and drastically improve your conversion rates =
|
48 |
+
* Exit Intent Popups (coming soon)
|
49 |
+
* Auto Open Popups (coming soon)
|
50 |
+
* Analytics (coming soon)
|
51 |
+
* Forced Interaction (coming soon)
|
52 |
+
* AJAX Login Modals (coming soon)
|
53 |
+
* Scroll Triggered Popups (coming soon)
|
54 |
+
* Age Verification Modals (coming soon)
|
55 |
+
* Advanced Theme Builder (coming soon)
|
56 |
+
* Unlimited Themes (coming soon)
|
57 |
+
|
58 |
+
For more information, visit [Popup Maker](https://wppopupmaker.com "WordPress Popup Maker")!
|
59 |
+
|
60 |
+
[Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
|
61 |
+
|
62 |
+
== Installation ==
|
63 |
+
1. Login to WordPress and Popup Maker.
|
64 |
+
|
65 |
+
== Changelog ==
|
66 |
+
= v1.0.0 =
|
67 |
+
* Initial Release
|
templates/popup.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
<div id="popmake-<?php the_ID(); ?>" class="<?php popmake_the_popup_classes(); ?>" <?php popmake_the_popup_data_attr(); ?>>
|
7 |
+
|
8 |
+
<?php do_action('popmake_popup_before_inner'); ?>
|
9 |
+
|
10 |
+
<?php if( popmake_get_the_popup_title() != '' ) : ?>
|
11 |
+
<div class="popmake-title"><?php popmake_the_popup_title(); ?></div>
|
12 |
+
<?php endif; ?>
|
13 |
+
|
14 |
+
<?php popmake_the_popup_content(); ?>
|
15 |
+
|
16 |
+
<?php do_action('popmake_popup_after_inner'); ?>
|
17 |
+
|
18 |
+
</div>
|