diff --git a/assets/scripts/call-to-action.js b/assets/scripts/call-to-action.js
new file mode 100644
index 0000000..9138dd4
--- /dev/null
+++ b/assets/scripts/call-to-action.js
@@ -0,0 +1,36 @@
+( function () {
+ tinymce.create( 'tinymce.plugins.aldine_call_to_action', {
+ init: function ( editor, url ) {
+ editor.addButton( 'aldine_call_to_action', {
+ title: aldine.call_to_action.title,
+ icon: 'icon dashicons-flag',
+ onclick: function () {
+ editor.windowManager.open( {
+ title: aldine.call_to_action.title,
+ body: [
+ {
+ type: 'textbox',
+ name: 'text',
+ label: aldine.call_to_action.text,
+ value: aldine.call_to_action.title,
+ },
+ {
+ type: 'textbox',
+ name: 'url',
+ label: aldine.call_to_action.url,
+ value: '#',
+ },
+ ],
+ onsubmit: function ( e ) {
+ editor.insertContent( '[aldine_call_to_action text="' + e.data.text + '" url="' + e.data.url + '"]' );
+ },
+ } );
+ },
+ } );
+ },
+ createControl: function ( n, cm ) {
+ return null;
+ },
+ } );
+ tinymce.PluginManager.add( 'aldine_call_to_action', tinymce.plugins.aldine_call_to_action );
+} )();
diff --git a/assets/scripts/page-section.js b/assets/scripts/page-section.js
new file mode 100644
index 0000000..289ea4b
--- /dev/null
+++ b/assets/scripts/page-section.js
@@ -0,0 +1,42 @@
+( function () {
+ tinymce.create( 'tinymce.plugins.aldine_page_section', {
+ init: function ( editor, url ) {
+ editor.addButton( 'aldine_page_section', {
+ title: aldine.page_section.title,
+ icon: 'icon dashicons-layout',
+ onclick: function () {
+ editor.windowManager.open( {
+ title: aldine.page_section.title,
+ body: [
+ {
+ type: 'textbox',
+ name: 'title',
+ label: aldine.page_section.title_label,
+ value: aldine.page_section.title,
+ },
+ {
+ type: 'listbox',
+ name: 'variant',
+ label: 'Variant',
+ values: [
+ { text: aldine.page_section.standard, value: '' },
+ { text: aldine.page_section.accent, value: 'accent' },
+ { text: aldine.page_section.bordered, value: 'bordered' },
+ { text: aldine.page_section.borderless, value: 'borderless' },
+ ],
+ value: '', // Sets the default
+ },
+ ],
+ onsubmit: function ( e ) {
+ editor.insertContent( '[aldine_page_section title="' + e.data.title + '" variant="' + e.data.variant + '"]
Insert your page section content here.
[/aldine_page_section]' );
+ },
+ } );
+ },
+ } );
+ },
+ createControl: function ( n, cm ) {
+ return null;
+ },
+ } );
+ tinymce.PluginManager.add( 'aldine_page_section', tinymce.plugins.aldine_page_section );
+} )();
diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json
index 895d3c6..83e34f4 100644
--- a/dist/mix-manifest.json
+++ b/dist/mix-manifest.json
@@ -2,6 +2,8 @@
"/scripts/aldine.js": "/scripts/aldine.js?id=e222d7e1e1c71c6bdb98",
"/styles/aldine.css": "/styles/aldine.css?id=2648daa49889948f53c9",
"/styles/editor.css": "/styles/editor.css?id=e96b3d10ea63fa07d09b",
- "/scripts/customizer.js": "/scripts/customizer.js?id=1b0d3cfc1d85f460af53",
- "/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=d25f1240496bd3607338"
+ "/scripts/customizer.js": "/scripts/customizer.js?id=0a52a1e0117b2902b145",
+ "/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=4ee1f7f0640e28791cf2",
+ "/scripts/page-section.js": "/scripts/page-section.js?id=2f9e970e43107c0ba14a",
+ "/scripts/call-to-action.js": "/scripts/call-to-action.js?id=42d4e3bac4388623cd04"
}
\ No newline at end of file
diff --git a/dist/scripts/call-to-action.js b/dist/scripts/call-to-action.js
new file mode 100644
index 0000000..202044d
--- /dev/null
+++ b/dist/scripts/call-to-action.js
@@ -0,0 +1 @@
+!function(t){var n={};function e(l){if(n[l])return n[l].exports;var o=n[l]={i:l,l:!1,exports:{}};return t[l].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,l){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:l})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}({1:function(t,n,e){t.exports=e("eL/z")},"eL/z":function(t,n){tinymce.create("tinymce.plugins.aldine_call_to_action",{init:function(t,n){t.addButton("aldine_call_to_action",{title:aldine.call_to_action.title,icon:"icon dashicons-flag",onclick:function(){t.windowManager.open({title:aldine.call_to_action.title,body:[{type:"textbox",name:"text",label:aldine.call_to_action.text,value:aldine.call_to_action.title},{type:"textbox",name:"url",label:aldine.call_to_action.url,value:"#"}],onsubmit:function(n){t.insertContent('[aldine_call_to_action text="'+n.data.text+'" url="'+n.data.url+'"]')}})}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}});
\ No newline at end of file
diff --git a/dist/scripts/catalog-admin.js b/dist/scripts/catalog-admin.js
index ca1e55d..2b92a70 100644
--- a/dist/scripts/catalog-admin.js
+++ b/dist/scripts/catalog-admin.js
@@ -1 +1 @@
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}({1:function(e,t,n){e.exports=n("ftI0")},"7t+N":function(e,t,n){var r;!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],s=n.document,a=Object.getPrototypeOf,u=o.slice,l=o.concat,c=o.push,f=o.indexOf,p={},d=p.toString,h=p.hasOwnProperty,g=h.toString,m=g.call(Object),v={};function y(e,t){var n=(t=t||s).createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}var x=function(e,t){return new x.fn.init(e,t)},b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^-ms-/,T=/-([a-z])/g,C=function(e,t){return t.toUpperCase()};function k(e){var t=!!e&&"length"in e&&e.length,n=x.type(e);return"function"!==n&&!x.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}x.fn=x.prototype={jquery:"3.2.1",constructor:x,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+P+")"+P+"*"),z=new RegExp("="+P+"*([^\\]'\"]*?)"+P+"*\\]","g"),X=new RegExp(I),U=new RegExp("^"+_+"$"),V={ID:new RegExp("^#("+_+")"),CLASS:new RegExp("^\\.("+_+")"),TAG:new RegExp("^("+_+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=ye(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(j=H.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(e){L={apply:j.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,a,l,c,f,h,v,y=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(y&&(l=y.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!E[e+" "]&&(!m||!m.test(e))){if(1!==T)y=t,v=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),a=(h=s(e)).length;a--;)h[a]="#"+c+" "+ve(h[a]);v=h.join(","),y=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,y.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,r,i)}function se(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ae(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ae(function(t){return t=+t,ae(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,s=e?e.ownerDocument||e:w;return s!==d&&9===s.nodeType&&s.documentElement?(h=(d=s).documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+P+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+P+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Q.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",I)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[r]===a[r];)r++;return r?ce(s[r],a[r]):s[r]===w?-1:a[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!E[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:ae,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&k(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(M," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(m){if(o){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(x=(d=(l=(c=(f=(p=m)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&m.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(y&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ae(function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=O(e,o[s])]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ae(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?ae(function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ae(function(e){return function(t){return oe(e,t).length>0}}),contains:ae(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ae(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a-1&&(o[l]=!(s[l]=f))}}else v=be(v===s?v.splice(h,v.length):v),i?i(null,s,v,u):L.apply(s,v)})}function Te(e){for(var t,n,i,o=e.length,s=r.relative[e[0].type],a=s||r.relative[" "],u=s?1:0,c=ye(function(e){return e===t},a,!0),f=ye(function(e){return O(t,e)>-1},a,!0),p=[function(e,n,r){var i=!s&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u0,i=e.length>0,o=function(o,s,a,u,c){var f,h,m,v=0,y="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),k=T+=null==w?1:Math.random()||.1,A=C.length;for(c&&(l=s===d||s||c);y!==A&&null!=(f=C[y]);y++){if(i&&f){for(h=0,s||f.ownerDocument===d||(p(f),a=!g);m=e[h++];)if(m(f,s||d,a)){u.push(f);break}c&&(T=k)}n&&((f=!m&&f)&&v--,o&&x.push(f))}if(v+=y,n&&y!==v){for(h=0;m=t[h++];)m(x,b,s,a);if(o){if(v>0)for(;y--;)x[y]||b[y]||(b[y]=D.call(u));b=be(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=k,l=w),x};return n?ae(o):o}(o,i))).selector=e}return a},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&s(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=V.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}return(p||a(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(F,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(n);x.find=A,x.expr=A.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=A.uniqueSort,x.text=A.getText,x.isXMLDoc=A.isXML,x.contains=A.contains,x.escapeSelector=A.escape;var E=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=x.expr.match.needsContext;function j(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,q=/^.[^:#\[\.,]*$/;function L(e,t,n){return x.isFunction(t)?x.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?x.grep(e,function(e){return e===t!==n}):"string"!=typeof t?x.grep(e,function(e){return f.call(t,e)>-1!==n}):q.test(t)?x.filter(t,e,n):(t=x.filter(t,e),x.grep(e,function(e){return f.call(t,e)>-1!==n&&1===e.nodeType}))}x.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},x.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;t1?x.uniqueSort(n):n},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&N.test(e)?x(e):e||[],!1).length}});var H,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||H,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:O.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:s,!0)),D.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=s.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):x.isFunction(e)?void 0!==n.ready?n.ready(e):e(x):x.makeArray(e,this)}).prototype=x.fn,H=x(s);var F=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function _(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}x.fn.extend({has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&x.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?f.call(x(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,n){return E(e,"parentNode",n)},next:function(e){return _(e,"nextSibling")},prev:function(e){return _(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,n){return E(e,"nextSibling",n)},prevUntil:function(e,t,n){return E(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return j(e,"iframe")?e.contentDocument:(j(e,"template")&&(e=e.content||e),x.merge([],e.childNodes))}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(P[e]||x.uniqueSort(i),F.test(e)&&i.reverse()),this.pushStack(i)}});var R=/[^\x20\t\r\n\f]+/g;function I(e){return e}function M(e){throw e}function W(e,t,n,r){var i;try{e&&x.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&x.isFunction(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}x.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return x.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):x.extend({},e);var t,n,r,i,o=[],s=[],a=-1,u=function(){for(i=i||e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?x.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},x.extend({Deferred:function(e){var t=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,r){var i=x.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function s(e,t,r,i){return function(){var a=this,u=arguments,l=function(){var n,l;if(!(e=o&&(r!==M&&(a=void 0,u=[n]),t.rejectWith(a,u))}};e?c():(x.Deferred.getStackHook&&(c.stackTrace=x.Deferred.getStackHook()),n.setTimeout(c))}}return x.Deferred(function(n){t[0][3].add(s(0,n,x.isFunction(i)?i:I,n.notifyWith)),t[1][3].add(s(0,n,x.isFunction(e)?e:I)),t[2][3].add(s(0,n,x.isFunction(r)?r:M))}).promise()},promise:function(e){return null!=e?x.extend(e,i):i}},o={};return x.each(t,function(e,n){var s=n[2],a=n[5];i[n[1]]=s.add,a&&s.add(function(){r=a},t[3-e][2].disable,t[0][2].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=u.call(arguments),o=x.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?u.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(W(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||x.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)W(i[n],s(n),o.reject);return o.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&B.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},x.readyException=function(e){n.setTimeout(function(){throw e})};var $=x.Deferred();function z(){s.removeEventListener("DOMContentLoaded",z),n.removeEventListener("load",z),x.ready()}x.fn.ready=function(e){return $.then(e).catch(function(e){x.readyException(e)}),this},x.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==e&&--x.readyWait>0||$.resolveWith(s,[x]))}}),x.ready.then=$.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(x.ready):(s.addEventListener("DOMContentLoaded",z),n.addEventListener("load",z));var X=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n))for(a in i=!0,n)X(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),x.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){x.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:x.Callbacks("once memory").add(function(){G.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,ce=/^$|\/(?:java|ecma)script/i,fe={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function pe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&j(e,t)?x.merge([e],n):n}function de(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=x.contains(o.ownerDocument,o),s=pe(f.appendChild(o),"script"),l&&de(s),n)for(c=0;o=s[c++];)ce.test(o.type||"")&&n.push(o);return f}he=s.createDocumentFragment().appendChild(s.createElement("div")),(ge=s.createElement("input")).setAttribute("type","radio"),ge.setAttribute("checked","checked"),ge.setAttribute("name","t"),he.appendChild(ge),v.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="",v.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue;var ye=s.documentElement,xe=/^key/,be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,we=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ce(){return!1}function ke(){try{return s.activeElement}catch(e){}}function Ae(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ce;else if(!i)return e;return 1===o&&(s=i,(i=function(e){return x().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=x.guid++)),e.each(function(){x.event.add(this,t,i,r,n)})}x.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=G.get(e);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(ye,i),n.guid||(n.guid=x.guid++),(u=m.events)||(u=m.events={}),(s=m.handle)||(s=m.handle=function(t){return void 0!==x&&x.event.triggered!==t.type?x.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(R)||[""]).length;l--;)d=g=(a=we.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},c=x.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(d,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),x.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,d,h,g,m=G.hasData(e)&&G.get(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(R)||[""]).length;l--;)if(d=g=(a=we.exec(t[l])||[])[1],h=(a[2]||"").split(".").sort(),d){for(f=x.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||x.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)x.event.remove(e,d+t[l],n,r,!0);x.isEmptyObject(u)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=x.event.fix(e),u=new Array(arguments.length),l=(G.get(this,"events")||{})[a.type]||[],c=x.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n-1:x.find(i,this,null,[l]).length),s[i]&&o.push(r);o.length&&a.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Se=/
+' . __( 'Continued', 'pressbooks-aldine' ) . '';
}
-/**
- * Add style select dropdown to TinyMCE.
- *
- * @param array $buttons The default button array.
- * @return array The modified array.
- */
-function add_style_select( $buttons ) {
- array_unshift( $buttons, 'styleselect' );
- return $buttons;
-}
-
-/**
- * Add custom block formats to TinyMCE.
- *
- * @param array $init_array The default array.
- * @return array The modified array.
- **/
-
-function add_blocks( $init_array ) {
- $style_formats = [
- [
- 'title' => __( 'Page Section', 'pressbooks-aldine' ),
- 'block' => 'div',
- 'classes' => [ 'page-section' ],
- 'wrapper' => true,
- ],
- [
- 'title' => __( 'Page Section (Accent)', 'pressbooks-aldine' ),
- 'block' => 'div',
- 'classes' => [ 'page-section', 'page-section--accent' ],
- 'wrapper' => true,
- ],
- [
- 'title' => __( 'Page Section (Bordered)', 'pressbooks-aldine' ),
- 'block' => 'div',
- 'classes' => [ 'page-section', 'page-section--bordered' ],
- 'wrapper' => true,
- ],
- [
- 'title' => __( 'Page Section (Borderless)', 'pressbooks-aldine' ),
- 'block' => 'div',
- 'classes' => [ 'page-section', 'page-section--borderless' ],
- 'wrapper' => true,
- ],
- [
- 'title' => __( 'Call to Action', 'pressbooks-aldine' ),
- 'inline' => 'a',
- 'classes' => [ 'call-to-action' ],
- ],
- ];
-
- $init_array['style_formats'] = json_encode( $style_formats );
-
- return $init_array;
-}
-
/**
* Add things to the menu.
*
@@ -131,3 +76,30 @@ function adjust_menu( $items, $args ) {
return $items;
}
+
+/**
+ * Add TinyMCE Buttons.
+ *
+ * @since 1.1.0
+ */
+function add_buttons( $plugin_array ) {
+ $assets = new Assets( 'pressbooks-aldine', 'theme' );
+ $assets->setSrcDirectory( 'assets' )->setDistDirectory( 'dist' );
+
+ $plugin_array['aldine_call_to_action'] = $assets->getPath( 'scripts/call-to-action.js' );
+ $plugin_array['aldine_page_section'] = $assets->getPath( 'scripts/page-section.js' );
+ return $plugin_array;
+}
+
+/**
+ * Register TinyMCE Buttons.
+ *
+ * @since 1.1.0
+ */
+function register_buttons( $buttons ) {
+ $c = count( $buttons );
+ $i = $c - 2;
+ $new_items = [ 'aldine_page_section', 'aldine_call_to_action' ];
+ array_splice( $buttons, $i, 0, $new_items );
+ return $buttons;
+}
diff --git a/package.json b/package.json
index d20b4d8..b2aeb45 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,9 @@
"extends": "./node_modules/pressbooks-build-tools/config/eslint.js",
"globals": {
"$": true,
- "PB_A11y": true
+ "aldine": true,
+ "PB_A11y": true,
+ "tinymce": true
}
},
"stylelint": {
diff --git a/partials/contact-form.php b/partials/contact-form.php
index 7db2353..14506f2 100644
--- a/partials/contact-form.php
+++ b/partials/contact-form.php
@@ -8,7 +8,8 @@
diff --git a/partials/content-front-page.php b/partials/content-front-page.php
index c4da977..73c7920 100644
--- a/partials/content-front-page.php
+++ b/partials/content-front-page.php
@@ -15,7 +15,8 @@ use function Aldine\Helpers\get_catalog_data;
use function Aldine\Helpers\has_sections;
$front_page_catalog = get_option( 'pb_front_page_catalog' );
-$latest_books_title = get_option( 'pb_front_page_catalog_title', __( 'Our Latest Titles', 'pressbooks-aldine' ) );
+$pb_front_page_catalog_title = get_option( 'pb_front_page_catalog_title' );
+$latest_books_title = ( ! empty( $pb_front_page_catalog_title ) ) ? $pb_front_page_catalog_title : __( 'Our Latest Titles', 'pressbooks-aldine' );
if ( get_option( 'pb_front_page_catalog' ) ) {
$page = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;
$catalog_data = get_catalog_data( $page, 3, 'latest' );
diff --git a/webpack.mix.js b/webpack.mix.js
index c054526..cc4e83e 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -1,4 +1,4 @@
-let mix = require('laravel-mix');
+let mix = require( 'laravel-mix' );
/*
|--------------------------------------------------------------------------
@@ -16,14 +16,14 @@ const partials = 'partials';
const assets = 'assets';
const dist = 'dist';
-mix.setPublicPath(dist);
-mix.setResourceRoot('../');
+mix.setPublicPath( dist );
+mix.setResourceRoot( '../' );
// BrowserSync
-mix.browserSync({
- host: 'localhost',
+mix.browserSync( {
+ host: 'localhost',
proxy: 'https://pressbooks.test',
- port: 3100,
+ port: 3100,
files: [
'*.php',
`${inc}/**/*.php`,
@@ -31,44 +31,46 @@ mix.browserSync({
`${dist}/**/*.css`,
`${dist}/**/*.js`,
],
-});
+} );
// Sass
-mix.sass(`${assets}/styles/aldine.scss`, `${dist}/styles/aldine.css`);
-mix.sass(`${assets}/styles/editor.scss`, `${dist}/styles/editor.css`);
+mix.sass( `${assets}/styles/aldine.scss`, `${dist}/styles/aldine.css` );
+mix.sass( `${assets}/styles/editor.scss`, `${dist}/styles/editor.css` );
// Javascript
-mix.autoload({ jquery: ['$', 'window.jQuery', 'jQuery'] });
+mix.autoload( { jquery: [ '$', 'window.jQuery', 'jQuery' ] } );
mix
- .js(`${assets}/scripts/aldine.js`, `${dist}/scripts`)
- .js(`${assets}/scripts/catalog-admin.js`, `${dist}/scripts`)
- .js(`${assets}/scripts/customizer.js`, `${dist}/scripts`);
+ .js( `${assets}/scripts/aldine.js`, `${dist}/scripts` )
+ .js( `${assets}/scripts/call-to-action.js`, `${dist}/scripts` )
+ .js( `${assets}/scripts/catalog-admin.js`, `${dist}/scripts` )
+ .js( `${assets}/scripts/customizer.js`, `${dist}/scripts` )
+ .js( `${assets}/scripts/page-section.js`, `${dist}/scripts` );
// Assets
mix
- .copy(`${assets}/fonts`, `${dist}/fonts`, false)
- .copy(`${assets}/images`, `${dist}/images`, false);
+ .copy( `${assets}/fonts`, `${dist}/fonts`, false )
+ .copy( `${assets}/images`, `${dist}/images`, false );
// Options
-mix.options({ processCssUrls: false });
+mix.options( { processCssUrls: false } );
// Source maps when not in production.
-if (!mix.inProduction()) {
+if ( ! mix.inProduction() ) {
mix.sourceMaps();
}
// Hash and version files in production.
-if (mix.inProduction()) {
+if ( mix.inProduction() ) {
mix.version();
}
// Add Isotope support.
-mix.webpackConfig({
+mix.webpackConfig( {
resolve: {
alias: {
masonry: 'masonry-layout',
isotope: 'isotope-layout',
},
},
-});
+} );