Browse Source

Use correct property for CTA link (fix #118). (#119)

pull/120/head
Ned Zimmerman 7 years ago committed by GitHub
parent
commit
675941b406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      assets/scripts/call-to-action.js
  2. 2
      dist/mix-manifest.json
  3. 2
      dist/scripts/call-to-action.js
  4. 2
      inc/actions/namespace.php

17
assets/scripts/call-to-action.js

@ -16,13 +16,19 @@
}, },
{ {
type: 'textbox', type: 'textbox',
name: 'url', name: 'link',
label: aldine.call_to_action.url, label: aldine.call_to_action.link,
value: '#', value: '#',
}, },
], ],
onsubmit: function ( e ) { onsubmit: function ( e ) {
editor.insertContent( '[aldine_call_to_action text="' + e.data.text + '" url="' + e.data.url + '"]' ); editor.insertContent(
'[aldine_call_to_action text="' +
e.data.text +
'" link="' +
e.data.link +
'"]'
);
}, },
} ); } );
}, },
@ -32,5 +38,8 @@
return null; return null;
}, },
} ); } );
tinymce.PluginManager.add( 'aldine_call_to_action', tinymce.plugins.aldine_call_to_action ); tinymce.PluginManager.add(
'aldine_call_to_action',
tinymce.plugins.aldine_call_to_action
);
} )(); } )();

2
dist/mix-manifest.json vendored

@ -5,5 +5,5 @@
"/scripts/customizer.js": "/scripts/customizer.js?id=0a52a1e0117b2902b145", "/scripts/customizer.js": "/scripts/customizer.js?id=0a52a1e0117b2902b145",
"/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=4ee1f7f0640e28791cf2", "/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=4ee1f7f0640e28791cf2",
"/scripts/page-section.js": "/scripts/page-section.js?id=2f9e970e43107c0ba14a", "/scripts/page-section.js": "/scripts/page-section.js?id=2f9e970e43107c0ba14a",
"/scripts/call-to-action.js": "/scripts/call-to-action.js?id=42d4e3bac4388623cd04" "/scripts/call-to-action.js": "/scripts/call-to-action.js?id=e74f1ea59f6ead88509d"
} }

2
dist/scripts/call-to-action.js vendored

@ -1 +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)}}); !function(t){var n={};function e(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return t[l].call(i.exports,i,i.exports,e),i.l=!0,i.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:"link",label:aldine.call_to_action.link,value:"#"}],onsubmit:function(n){t.insertContent('[aldine_call_to_action text="'+n.data.text+'" link="'+n.data.link+'"]')}})}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}});

2
inc/actions/namespace.php

@ -293,7 +293,7 @@ function tinymce_l18n() {
call_to_action: { call_to_action: {
'title': '<?php _e( 'Call to Action', 'pressbooks-aldine' ); ?>', 'title': '<?php _e( 'Call to Action', 'pressbooks-aldine' ); ?>',
'text': '<?php _e( 'Text', 'pressbooks-aldine' ); ?>', 'text': '<?php _e( 'Text', 'pressbooks-aldine' ); ?>',
'url': '<?php _e( 'URL', 'pressbooks-aldine' ); ?>' 'link': '<?php _e( 'Link', 'pressbooks-aldine' ); ?>'
} }
}; };
</script> </script>

Loading…
Cancel
Save