Browse Source

Bump pressbooks-build-tools from 0.11.0 to 0.12.0 (#124)

* Bump pressbooks-build-tools from 0.11.0 to 0.12.0

Bumps [pressbooks-build-tools](https://github.com/pressbooks/pressbooks-build-tools) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/pressbooks/pressbooks-build-tools/releases)
- [Commits](https://github.com/pressbooks/pressbooks-build-tools/compare/0.11.0...0.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Fix lint errors.
pull/125/head
dependabot[bot] 7 years ago committed by Ned Zimmerman
parent
commit
3ac33c688e
  1. 14
      assets/scripts/call-to-action.js
  2. 73
      assets/scripts/catalog-admin.js
  3. 45
      assets/scripts/page-section.js
  4. 13647
      package-lock.json
  5. 2
      package.json
  6. 831
      yarn.lock

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

@ -2,21 +2,21 @@
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',
title: aldine.call_to_action.title,
icon: 'icon dashicons-flag',
onclick: function () {
editor.windowManager.open( {
title: aldine.call_to_action.title,
body: [
body: [
{
type: 'textbox',
name: 'text',
type: 'textbox',
name: 'text',
label: aldine.call_to_action.text,
value: aldine.call_to_action.title,
},
{
type: 'textbox',
name: 'link',
type: 'textbox',
name: 'link',
label: aldine.call_to_action.link,
value: '#',
},

73
assets/scripts/catalog-admin.js

@ -2,40 +2,85 @@
( function ( $ ) {
$( document ).ready( function () {
$( '.wrap' ).on( 'click', '.notice-dismiss', function () {
$( this ).parent( '#message' ).fadeOut( 500, function () {
$( this ).remove();
} );
$( this )
.parent( '#message' )
.fadeOut( 500, function () {
$( this ).remove();
} );
} );
$( 'input.in-catalog' ).on( 'change', function () {
let book_id = $( this ).parent( 'td' ).siblings( 'th' ).children( 'input' ).val();
let book_id = $( this )
.parent( 'td' )
.siblings( 'th' )
.children( 'input' )
.val();
let in_catalog = $( this ).prop( 'checked' );
$.ajax( {
url: ajaxurl,
url: ajaxurl,
type: 'POST',
data: {
action: 'pressbooks_aldine_update_catalog',
book_id: book_id,
in_catalog: in_catalog,
action: 'pressbooks_aldine_update_catalog',
book_id: book_id,
in_catalog: in_catalog,
_ajax_nonce: PB_Aldine_Admin.aldineAdminNonce,
},
success: function (){
success: function () {
if ( $( '#message' ).length < 1 ) {
$( '<div id="message" class="updated notice is-dismissible">' ).html( '<p><strong>'+PB_Aldine_Admin.catalog_updated+'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">'+PB_Aldine_Admin.dismiss_notice+'</span></button>' ).hide().insertAfter( '.wrap h1' ).fadeIn( 500 );
$( '<div id="message" class="updated notice is-dismissible">' )
.html(
'<p><strong>' +
PB_Aldine_Admin.catalog_updated +
'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' +
PB_Aldine_Admin.dismiss_notice +
'</span></button>'
)
.hide()
.insertAfter( '.wrap h1' )
.fadeIn( 500 );
} else {
$( '#message' ).fadeOut( 500, function () {
$( this ).remove();
$( '<div id="message" class="updated notice is-dismissible">' ).html( '<p><strong>'+PB_Aldine_Admin.catalog_updated+'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">'+PB_Aldine_Admin.dismiss_notice+'</span></button>' ).hide().insertAfter( '.wrap h1' ).fadeIn( 500 );
$( '<div id="message" class="updated notice is-dismissible">' )
.html(
'<p><strong>' +
PB_Aldine_Admin.catalog_updated +
'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' +
PB_Aldine_Admin.dismiss_notice +
'</span></button>'
)
.hide()
.insertAfter( '.wrap h1' )
.fadeIn( 500 );
} );
}
},
error: function ( jqXHR, textStatus, errorThrown ) {
if ( $( '#message' ).length < 1 ) {
$( '<div id="message" class="error notice is-dismissible">' ).html( '<p><strong>'+PB_Aldine_Admin.catalog_not_updated+'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">'+PB_Aldine_Admin.dismiss_notice+'</span></button>' ).hide().insertAfter( '.wrap h1' ).fadeIn( 500 );
$( '<div id="message" class="error notice is-dismissible">' )
.html(
'<p><strong>' +
PB_Aldine_Admin.catalog_not_updated +
'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' +
PB_Aldine_Admin.dismiss_notice +
'</span></button>'
)
.hide()
.insertAfter( '.wrap h1' )
.fadeIn( 500 );
} else {
$( '#message' ).fadeOut( 500, function () {
$( this ).remove();
$( '<div id="message" class="error notice is-dismissible">' ).html( '<p><strong>'+PB_Aldine_Admin.catalog_not_updated+'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">'+PB_Aldine_Admin.dismiss_notice+'</span></button>' ).hide().insertAfter( '.wrap h1' ).fadeIn( 500 );
$( '<div id="message" class="error notice is-dismissible">' )
.html(
'<p><strong>' +
PB_Aldine_Admin.catalog_not_updated +
'</strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">' +
PB_Aldine_Admin.dismiss_notice +
'</span></button>'
)
.hide()
.insertAfter( '.wrap h1' )
.fadeIn( 500 );
} );
}
},

45
assets/scripts/page-section.js

@ -2,33 +2,47 @@
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',
title: aldine.page_section.title,
icon: 'icon dashicons-layout',
onclick: function () {
editor.windowManager.open( {
title: aldine.page_section.title,
body: [
body: [
{
type: 'textbox',
name: 'title',
type: 'textbox',
name: 'title',
label: aldine.page_section.title_label,
value: aldine.page_section.title,
},
{
type: 'listbox',
name: 'variant',
label: 'Variant',
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' },
{
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 + '"]<p>Insert your page section content here.</p>[/aldine_page_section]' );
editor.insertContent(
'[aldine_page_section title="' +
e.data.title +
'" variant="' +
e.data.variant +
'"]<p>Insert your page section content here.</p>[/aldine_page_section]'
);
},
} );
},
@ -38,5 +52,8 @@
return null;
},
} );
tinymce.PluginManager.add( 'aldine_page_section', tinymce.plugins.aldine_page_section );
tinymce.PluginManager.add(
'aldine_page_section',
tinymce.plugins.aldine_page_section
);
} )();

13647
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
package.json

@ -56,7 +56,7 @@
"node": ">= 6.9.4"
},
"devDependencies": {
"pressbooks-build-tools": "^0.11.0"
"pressbooks-build-tools": "^0.12.0"
},
"dependencies": {
"aetna": "^1.0.0-alpha.17",

831
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save