Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mindless refactoring.

  • Loading branch information...
commit 569998670c92607476ae770db0006023424498e7 1 parent aa8f874
Michael Sisk authored
View
80 -/js/admin-config.js
@@ -1,72 +1,72 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Update collection slug previews. */
- $( '#webcomic_slugs_archive,#webcomic_slugs_webcomic,#webcomic_slugs_storyline,#webcomic_slugs_character' ).on( 'change', function() {
+ $( "#webcomic_slugs_archive,#webcomic_slugs_webcomic,#webcomic_slugs_storyline,#webcomic_slugs_character" ).on( "change", function() {
$.getJSON( url, {
slug: $( this ).val(),
- preview: '#' + $( this ).attr( 'id' ),
- collection: $( '[name=webcomic_collection]' ).val(),
- webcomic_admin_ajax: 'WebcomicConfig::ajax_slug_preview'
+ preview: "#" + $( this ).attr( "id" ),
+ collection: $( "[name=webcomic_collection]" ).val(),
+ webcomic_admin_ajax: "WebcomicConfig::ajax_slug_preview"
}, function( data ) {
- $( data.container ).val( data.slug ).siblings( '.description' ).children( 'b' ).html( data.slug )
+ $( data.container ).val( data.slug ).siblings( ".description" ).children( "b" ).html( data.slug )
} );
} );
/** Enable or disable print defaults. */
- $( '#webcomic_commerce_business' ).on( 'change', function() {
+ $( "#webcomic_commerce_business" ).on( "change", function() {
$.getJSON( url, {
business: $( this ).val(),
- webcomic_admin_ajax: 'WebcomicConfig::ajax_commerce_defaults'
+ webcomic_admin_ajax: "WebcomicConfig::ajax_commerce_defaults"
}, function ( data ) {
if ( data.clear ) {
- $( '#webcomic_commerce_prints,#webcomic_commerce_originals' ).removeAttr( 'disabled' ).siblings( 'span' ).removeClass( 'description' );
+ $( "#webcomic_commerce_prints,#webcomic_commerce_originals" ).removeAttr( "disabled" ).siblings( "span" ).removeClass( "description" );
} else {
- $( '#webcomic_commerce_prints,#webcomic_commerce_originals' ).removeAttr( 'checked' ).attr( 'disabled', true ).siblings( 'span' ).addClass( 'description' );
+ $( "#webcomic_commerce_prints,#webcomic_commerce_originals" ).removeAttr( "checked" ).attr( "disabled", true ).siblings( "span" ).addClass( "description" );
}
} );
- } ).trigger( 'change' );
+ } ).trigger( "change" );
/** Update Twitter authorized account. */
- $( '#webcomic_twitter_consumer_key,#webcomic_twitter_consumer_secret' ).on( 'change', function() {
+ $( "#webcomic_twitter_consumer_key,#webcomic_twitter_consumer_secret" ).on( "change", function() {
$.get( url, {
- consumer_key: $( '#webcomic_twitter_consumer_key' ).val(),
- consumer_secret: $( '#webcomic_twitter_consumer_secret' ).val(),
- collection: $( '[name=webcomic_collection]' ).val(),
- webcomic_admin_ajax: 'WebcomicConfig::ajax_twitter_account'
+ consumer_key: $( "#webcomic_twitter_consumer_key" ).val(),
+ consumer_secret: $( "#webcomic_twitter_consumer_secret" ).val(),
+ collection: $( "[name=webcomic_collection]" ).val(),
+ webcomic_admin_ajax: "WebcomicConfig::ajax_twitter_account"
}, function ( data ) {
- $( '#webcomic_twitter_account' ).html( data );
+ $( "#webcomic_twitter_account" ).html( data );
} );
} );
/** Remove the webcomic image. */
- $( document ).on( 'click', '.webcomic-image-x', function() {
+ $( document ).on( "click", ".webcomic-image-x", function() {
$e = $( this );
$.get( url, {
id: 0,
- webcomic_admin_ajax: $e.data( 'callback' )
+ webcomic_admin_ajax: $e.data( "callback" )
}, function( data ) {
- $( $e.data( 'target' ) ).html( data );
+ $( $e.data( "target" ) ).html( data );
} );
} );
/** Toggle collection setting sections. */
- $( '.wrap h3' ).css( {
- 'border-top': 'thin solid #dfdfdf',
- color: '#21759b',
- cursor: 'pointer',
- padding: '.5em 0 0'
- } ).nextAll( 'table' ).hide();
+ $( ".wrap h3" ).css( {
+ "border-top": "thin solid #ddd",
+ color: "#0074a2",
+ cursor: "pointer",
+ padding: ".5em 0 0"
+ } ).nextAll( "table" ).hide();
- $( '.wrap h3' ).on( 'mouseenter', function() { $( this ).css( 'color', '#d54e21' ); } );
- $( '.wrap h3' ).on( 'mouseleave', function() { $( this ).css( 'color', '#21759b' ); } );
+ $( ".wrap h3" ).on( "mouseenter", function() { $( this ).css( "color", "#2ea2cc" ); } );
+ $( ".wrap h3" ).on( "mouseleave", function() { $( this ).css( "color", "#0074a2" ); } );
- $( '.wrap h3' ).on( 'click', function() {
- $( this ).nextAll( 'table:first' ).toggle();
+ $( ".wrap h3" ).on( "click", function() {
+ $( this ).nextAll( "table:first" ).toggle();
} );
- $( '.wrap :not(table) + h3:first' ).trigger( 'click' );
+ $( ".wrap :not(table) + h3:first" ).trigger( "click" );
} );
/** Enable fancy image selection. */
@@ -74,7 +74,7 @@ jQuery( function( $ ) {
var frame;
$( function() {
- $( document ). on( 'click', '.webcomic-image', function( e ) {
+ $( document ). on( "click", ".webcomic-image", function( e ) {
var $e = $( this );
e.preventDefault();
@@ -86,21 +86,21 @@ jQuery( function( $ ) {
}
frame = wp.media.frames.webcomicPoster = wp.media( {
- title: $e.data( 'title' ),
+ title: $e.data( "title" ),
library: {
- type: 'image'
+ type: "image"
},
button: {
- text: $e.data( 'update' )
+ text: $e.data( "update" )
}
} );
- frame.on( 'select', function() {
- $.get( $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' ), {
- id: frame.state().get( 'selection' ).first().id,
- webcomic_admin_ajax: $e.data( 'callback' )
+ frame.on( "select", function() {
+ $.get( $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" ), {
+ id: frame.state().get( "selection" ).first().id,
+ webcomic_admin_ajax: $e.data( "callback" )
}, function( data ) {
- $( $e.data( 'target' ) ).html( data );
+ $( $e.data( "target" ) ).html( data );
} );
} );
View
6 -/js/admin-legacy.js
@@ -1,12 +1,12 @@
/** Automatically continue legacy upgrades. */
jQuery( function( $ ) {
setTimeout( function() {
- $( '.webcomic-auto #upgrade_legacy' ).trigger( 'click' );
+ $( ".webcomic-auto #upgrade_legacy" ).trigger( "click" );
}, 5000 );
- $( '.webcomic-auto #upgrade_legacy' ).on( 'click', function() {
+ $( ".webcomic-auto #upgrade_legacy" ).on( "click", function() {
$( this ).hide();
- $( '.webcomic-auto-message' ).html( $( '[data-webcomic-upgrade-continue]' ).data( 'webcomic-upgrade-continue' ) );
+ $( ".webcomic-auto-message" ).html( $( "[data-webcomic-upgrade-continue]" ).data( "webcomic-upgrade-continue" ) );
} );
} );
View
54 -/js/admin-media.js
@@ -1,14 +1,14 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Warn if no selected days match the start date. */
- $( 'form.webcomic-generator' ).on( 'submit', function() {
- var v = $( 'input[name="webcomic_generate_start"]' ).val().split( '-' ),
+ $( "form.webcomic-generator" ).on( "submit", function() {
+ var v = $( "input[name='webcomic_generate_start']" ).val().split( "-" ),
d = new Date( v[ 0 ], parseInt( v[ 1 ] ) - 1, v[ 2 ] ),
x = false,
d1 = d2 = 0;
- $.each( $( 'input[name="webcomic_generate_days[]"]:checked' ), function( i, e ) {
+ $.each( $( "input[name='webcomic_generate_days[]']:checked" ), function( i, e ) {
d1 = parseInt( $( e ).val() );
d2 = parseInt( d.getDay() );
@@ -20,56 +20,56 @@ jQuery( function( $ ) {
} );
if ( !x ) {
- return window.confirm( $( '[data-webcomic-daycheck]' ).data( 'webcomic-daycheck' ) );
+ return window.confirm( $( "[data-webcomic-daycheck]" ).data( "webcomic-daycheck" ) );
}
} );
/** Allow media to be reordered when using the generator. */
- $( '.webcomic-generator .wp-list-table tbody' ).sortable();
+ $( ".webcomic-generator .wp-list-table tbody" ).sortable();
/** Handle webcomic media reordering. */
- $( '.webcomic-media-sort' ).sortable( {
+ $( ".webcomic-media-sort" ).sortable( {
update: function() {
$.post( url, {
- ids: $( '[name="ids[]"]' ).serializeArray(),
- webcomic_admin_ajax: 'WebcomicMedia::ajax_sort_media'
+ ids: $( "[name='ids[]']" ).serializeArray(),
+ webcomic_admin_ajax: "WebcomicMedia::ajax_sort_media"
}, function( data ) {
- var message = $( 'div p' ).html();
+ var message = $( "div p" ).html();
- $( 'div p' ).html( data );
+ $( "div p" ).html( data );
setTimeout( function() {
- $( 'div p' ).html( message );
+ $( "div p" ).html( message );
}, 3000 );
} );
}
} );
/** Add regenerate and detach bulk actions. */
- $( 'body.wp-admin.upload-php [name="action"],body.wp-admin.upload-php [name="action2"]' ).append( '<option value="webcomic_regenerate">'
- + $( '[data-webcomic-regenerate]' ).data( 'webcomic-regenerate' )
- + '</option><option value="webcomic_detach">'
- + $( '[data-webcomic-detach]' ).data( 'webcomic-detach' )
- + '</option>'
+ $( "body.wp-admin.upload-php [name='action'],body.wp-admin.upload-php [name='action2']" ).append( "<option value='webcomic_regenerate'>"
+ + $( "[data-webcomic-regenerate]" ).data( "webcomic-regenerate" )
+ + "</option><option value='webcomic_detach'>"
+ + $( "[data-webcomic-detach]" ).data( "webcomic-detach" )
+ + "</option>"
);
- $( 'body.wp-admin.upload-php #doaction' ).on( 'click', function( e ) {
- if ( 'webcomic_regenerate' === $( '[name="action"]' ).val() || 'webcomic_detach' === $( '[name="action"]' ).val() ) {
- webcomic_bulk_action( $( '[name="action"]' ) );
+ $( "body.wp-admin.upload-php #doaction" ).on( "click", function( e ) {
+ if ( "webcomic_regenerate" === $( "[name='action']" ).val() || "webcomic_detach" === $( "[name='action']" ).val() ) {
+ webcomic_bulk_action( $( "[name='action']" ) );
}
} );
- $( 'body.wp-admin.upload-php #doaction2' ).on( 'click', function( e ) {
- if ( 'webcomic_regenerate' === $( '[name="action2"]' ).val() || 'webcomic_detach' === $( '[name="action2"]' ).val() ) {
- webcomic_bulk_action( $( '[name="action2"]' ) );
+ $( "body.wp-admin.upload-php #doaction2" ).on( "click", function( e ) {
+ if ( "webcomic_regenerate" === $( "[name='action2']" ).val() || "webcomic_detach" === $( "[name='action2']" ).val() ) {
+ webcomic_bulk_action( $( "[name='action2']" ) );
}
} );
function webcomic_bulk_action( $el ) {
- var $form = $el.parents( 'form' );
+ var $form = $el.parents( "form" );
- $el.attr( 'name', 'webcomic_action' );
- $form.attr( 'method', 'post' );
- $form.attr( 'action', url );
+ $el.attr( "name", "webcomic_action" );
+ $form.attr( "method", "post" );
+ $form.attr( "action", url );
}
} );
View
34 -/js/admin-meta.js
@@ -2,45 +2,45 @@ var wpActiveEditor;
jQuery( function( $ ) {
/** Refresh the webcomic media meta box. */
- $( document ).on( 'mousedown', '.media-modal-close,.media-modal-backdrop,.media-button-insert', function() {
+ $( document ).on( "mousedown", ".media-modal-close,.media-modal-backdrop,.media-button-insert", function() {
setTimeout( function() {
- $.get( $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' ), {
- post: $( '#post_ID' ).val(),
- webcomic_admin_ajax: 'WebcomicPosts::ajax_media_preview'
+ $.get( $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" ), {
+ post: $( "#post_ID" ).val(),
+ webcomic_admin_ajax: "WebcomicPosts::ajax_media_preview"
}, function( data ) {
- $( '#webcomic_media_preview' ).html( data );
+ $( "#webcomic_media_preview" ).html( data );
} );
}, 500 );
} );
/** Dynamically update the price preview for prints. */
- $( '#webcomic_commerce_adjust_prices_domestic,#webcomic_commerce_adjust_shipping_domestic' ).on( 'change', function() {
- calculate_total( 'domestic' );
+ $( "#webcomic_commerce_adjust_prices_domestic,#webcomic_commerce_adjust_shipping_domestic" ).on( "change", function() {
+ calculate_total( "domestic" );
} );
- $( '#webcomic_commerce_adjust_prices_international,#webcomic_commerce_adjust_shipping_international' ).on( 'change', function() {
- calculate_total( 'international' );
+ $( "#webcomic_commerce_adjust_prices_international,#webcomic_commerce_adjust_shipping_international" ).on( "change", function() {
+ calculate_total( "international" );
} );
- $( '#webcomic_commerce_adjust_prices_original,#webcomic_commerce_adjust_shipping_original' ).on( 'change', function() {
- calculate_total( 'original' );
+ $( "#webcomic_commerce_adjust_prices_original,#webcomic_commerce_adjust_shipping_original" ).on( "change", function() {
+ calculate_total( "original" );
} );
- $( '#webcomic_commerce_original_available' ).on( 'click', function() {
- calculate_total( 'original' );
+ $( "#webcomic_commerce_original_available" ).on( "click", function() {
+ calculate_total( "original" );
} );
/** Calculate and update print prices. */
function calculate_total( id ) {
var total;
- if ( 'original' === id && !$( '#webcomic_commerce_original_available' ).attr( 'checked' ) ) {
- $( '#webcomic_original_total' ).html( $( '[data-webcomic-original]' ).data( 'webcomic-original' ) );
+ if ( "original" === id && !$( "#webcomic_commerce_original_available" ).attr( "checked" ) ) {
+ $( "#webcomic_original_total" ).html( $( "[data-webcomic-original]" ).data( "webcomic-original" ) );
} else {
- total = ( parseFloat( $( '#webcomic_commerce_' + id + '_price' ).html() ) * ( 1 + ( parseFloat( $( '#webcomic_commerce_adjust_prices_' + id ).val() ) * .01 ) ) ) + ( parseFloat( $( '#webcomic_commerce_' + id + '_shipping' ).html() ) * ( 1 + ( parseFloat( $( '#webcomic_commerce_adjust_shipping_' + id ).val() ) * .01 ) ) );
+ total = ( parseFloat( $( "#webcomic_commerce_" + id + "_price" ).html() ) * ( 1 + ( parseFloat( $( "#webcomic_commerce_adjust_prices_" + id ).val() ) * .01 ) ) ) + ( parseFloat( $( "#webcomic_commerce_" + id + "_shipping" ).html() ) * ( 1 + ( parseFloat( $( "#webcomic_commerce_adjust_shipping_" + id ).val() ) * .01 ) ) );
- $( '#webcomic_' + id + '_total' ).html( total.toFixed( 2 ) + ' ' + $( '[data-webcomic-currency]' ).data( 'webcomic-currency' ) );
+ $( "#webcomic_" + id + "_total" ).html( total.toFixed( 2 ) + " " + $( "[data-webcomic-currency]" ).data( "webcomic-currency" ) );
}
}
} );
View
20 -/js/admin-pages.js
@@ -1,23 +1,23 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Update meta data values in the quick edit box for pages. */
- $( document ).on( 'click', 'a.editinline', function() {
+ $( document ).on( "click", "a.editinline", function() {
$.getJSON( url, {
- post: $( this ).parents( 'tr' ).attr( 'id' ).substr( 5, $( this ).parents( 'tr' ).attr( 'id' ).length ),
- webcomic_admin_ajax: 'WebcomicPages::ajax_quick_edit'
+ post: $( this ).parents( "tr" ).attr( "id" ).substr( 5, $( this ).parents( "tr" ).attr( "id" ).length ),
+ webcomic_admin_ajax: "WebcomicPages::ajax_quick_edit"
}, function ( data ) {
- $( '#webcomic_page_collection' ).val( data.collection );
+ $( "#webcomic_page_collection" ).val( data.collection );
} );
} );
/** Save meta data values from the quick edit box for pages. */
- $( '.save' ).on( 'click', function() {
+ $( ".save" ).on( "click", function() {
$.get( url, {
- post: $( this ).parents( 'tr' ).attr( 'id' ).substr( 5, $( this ).parents( 'tr' ).attr( 'id' ).length ),
- collection: $( '#webcomic_page_collection' ).val(),
- webcomic_page_inline_save: $( '#webcomic_page_inline_save' ).val(),
- webcomic_admin_ajax: 'WebcomicPages::ajax_quick_save'
+ post: $( this ).parents( "tr" ).attr( "id" ).substr( 5, $( this ).parents( "tr" ).attr( "id" ).length ),
+ collection: $( "#webcomic_page_collection" ).val(),
+ webcomic_page_inline_save: $( "#webcomic_page_inline_save" ).val(),
+ webcomic_admin_ajax: "WebcomicPages::ajax_quick_save"
} );
} );
} );
View
28 -/js/admin-posts.js
@@ -1,27 +1,27 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Update meta data values in the quick edit box for webcomic posts. */
- $( document ).on( 'click', 'a.editinline', function() {
+ $( document ).on( "click", "a.editinline", function() {
$.getJSON( url, {
- post: $( this ).parents( 'tr' ).attr( 'id' ).substr( 5, $( this ).parents( 'tr' ).attr( 'id' ).length ),
- webcomic_admin_ajax: 'WebcomicPosts::ajax_quick_edit'
+ post: $( this ).parents( "tr" ).attr( "id" ).substr( 5, $( this ).parents( "tr" ).attr( "id" ).length ),
+ webcomic_admin_ajax: "WebcomicPosts::ajax_quick_edit"
}, function ( data ) {
- $( '#webcomic_prints' ).attr( 'checked', data.prints ).attr( 'disabled', data.prints_disabled );
- $( '#webcomic_original' ).attr( 'checked', data.original );
- $( '#webcomic_transcripts' ).attr( 'checked', data.transcripts );
+ $( "#webcomic_prints" ).attr( "checked", data.prints ).attr( "disabled", data.prints_disabled );
+ $( "#webcomic_original" ).attr( "checked", data.original );
+ $( "#webcomic_transcripts" ).attr( "checked", data.transcripts );
} );
} );
/** Save meta data values from the quick edit box for webcomic posts. */
- $( '.save' ).on( 'click', function() {
+ $( ".save" ).on( "click", function() {
$.get( url, {
- post: $( this ).parents( 'tr' ).attr( 'id' ).substr( 5, $( this ).parents( 'tr' ).attr( 'id' ).length ),
- prints: $( '#webcomic_prints:checked' ).val() ? 1 : 0,
- original: $( '#webcomic_original:checked' ).val() ? 1 : 0,
- transcripts: $( '#webcomic_transcripts:checked' ).val() ? 1 : 0,
- webcomic_inline_save: $( '#webcomic_inline_save' ).val(),
- webcomic_admin_ajax: 'WebcomicPosts::ajax_quick_save'
+ post: $( this ).parents( "tr" ).attr( "id" ).substr( 5, $( this ).parents( "tr" ).attr( "id" ).length ),
+ prints: $( "#webcomic_prints:checked" ).val() ? 1 : 0,
+ original: $( "#webcomic_original:checked" ).val() ? 1 : 0,
+ transcripts: $( "#webcomic_transcripts:checked" ).val() ? 1 : 0,
+ webcomic_inline_save: $( "#webcomic_inline_save" ).val(),
+ webcomic_admin_ajax: "WebcomicPosts::ajax_quick_save"
} );
} );
} );
View
22 -/js/admin-showcase.js
@@ -9,18 +9,18 @@ a.pauseControls&&d.hover(function(){clearInterval(p)},function(){m()})}}if("unde
jQuery( function( $ ) {
/** Handle the Webcomic Showcase slideshow. */
- $( '#webcomic-showcase .slideshow div' ).responsiveSlides( {
- 'nav': true,
- 'auto': false,
- 'speed': 0,
- 'nextText': '&raquo;',
- 'prevText': '&laquo;',
- 'namespace': 'webcomic-showcase-slides',
- 'before': function() {
- $( '#webcomic-showcase .slideshow div' ).children( '[class=""]' ).css( 'display', 'block' );
+ $( "#webcomic-showcase .slideshow div" ).responsiveSlides( {
+ nav: true,
+ auto: false,
+ speed: 0,
+ nextText: "&raquo;",
+ prevText: "&laquo;",
+ namespace: "webcomic-showcase-slides",
+ before: function() {
+ $( "#webcomic-showcase .slideshow div" ).children( "[class='']" ).css( "display", "block" );
},
- 'after': function() {
- $( '#webcomic-showcase .slideshow div' ).children( '[class=""]' ).css( 'display', 'none' );
+ after: function() {
+ $( "#webcomic-showcase .slideshow div" ).children( "[class='']" ).css( "display", "none" );
}
} );
} );
View
46 -/js/admin-taxonomy.js
@@ -1,28 +1,28 @@
jQuery( function( $ ) {
/** Remove the term image. */
- $( document ).on( 'click', '.webcomic-image-x', function() {
- $.get( $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' ), {
+ $( document ).on( "click", ".webcomic-image-x", function() {
+ $.get( $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" ), {
id: 0,
- taxonomy: $( '[data-webcomic-taxonomy]' ).data( 'webcomic-taxonomy' ),
- webcomic_admin_ajax: 'WebcomicTaxonomy::ajax_term_image'
+ taxonomy: $( "[data-webcomic-taxonomy]" ).data( "webcomic-taxonomy" ),
+ webcomic_admin_ajax: "WebcomicTaxonomy::ajax_term_image"
}, function( data ) {
- $( '#webcomic_term_image' ).html( data );
+ $( "#webcomic_term_image" ).html( data );
} );
} );
/** Enable dynamic term sorting. */
- $( '.webcomic-sort' ).nestedSortable( {
- handle: 'b',
- items: 'li',
+ $( ".webcomic-sort" ).nestedSortable( {
+ handle: "b",
+ items: "li",
tabSize: 36,
- toleranceElement: '> b',
- placeholder: 'webcomic-drop',
+ toleranceElement: "> b",
+ placeholder: "webcomic-drop",
update: function( e, ui ) {
- $( '[name="webcomic_terms"]' ).val( $( '.webcomic-sort' ).nestedSortable( 'serialize' ) );
+ $( "[name='webcomic_terms']" ).val( $( ".webcomic-sort" ).nestedSortable( "serialize" ) );
}
} );
- $( '[name="webcomic_terms"]' ).val( $( '.webcomic-sort' ).nestedSortable( 'serialize' ) );
+ $( "[name='webcomic_terms']" ).val( $( ".webcomic-sort" ).nestedSortable( "serialize" ) );
} );
/** Enable fancy taxonomy images. */
@@ -30,7 +30,7 @@ jQuery( function( $ ) {
var frame;
$( function() {
- $( document ). on( 'click', '.webcomic-image', function( e ) {
+ $( document ). on( "click", ".webcomic-image", function( e ) {
var $e = $( this );
e.preventDefault();
@@ -42,23 +42,23 @@ jQuery( function( $ ) {
}
frame = wp.media.frames.webcomicTermImage = wp.media( {
- title: $e.data( 'title' ),
+ title: $e.data( "title" ),
library: {
- type: 'image'
+ type: "image"
},
button: {
- text: $e.data( 'update' )
+ text: $e.data( "update" )
}
} );
- frame.on( 'select', function() {
- $.get( $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' ), {
- id: frame.state().get( 'selection' ).first().id,
- taxonomy: $( '[data-webcomic-taxonomy]' ).data( 'webcomic-taxonomy' ),
- term: $( 'data-webcomic-term' ).data( 'webcomic-term' ),
- webcomic_admin_ajax: 'WebcomicTaxonomy::ajax_term_image'
+ frame.on( "select", function() {
+ $.get( $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" ), {
+ id: frame.state().get( "selection" ).first().id,
+ taxonomy: $( "[data-webcomic-taxonomy]" ).data( "webcomic-taxonomy" ),
+ term: $( "data-webcomic-term" ).data( "webcomic-term" ),
+ webcomic_admin_ajax: "WebcomicTaxonomy::ajax_term_image"
}, function( data ) {
- $( '#webcomic_term_image' ).html( data );
+ $( "#webcomic_term_image" ).html( data );
} );
} );
View
36 -/js/admin-transcripts.js
@@ -1,47 +1,47 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Update the post list when the collection is changed. */
- $( '#webcomic_collection' ).attr( 'disabled', false ).on( 'change', function() {
+ $( "#webcomic_collection" ).attr( "disabled", false ).on( "change", function() {
$.get( url, {
- collection: $( '#webcomic_collection' ).val(),
- parent: $( '#webcomic_parent' ).val(),
- webcomic_admin_ajax: 'WebcomicTranscripts::ajax_posts'
+ collection: $( "#webcomic_collection" ).val(),
+ parent: $( "#webcomic_parent" ).val(),
+ webcomic_admin_ajax: "WebcomicTranscripts::ajax_posts"
}, function( data ) {
- $( '#webcomic_post_list' ).html( data );
- $( '#webcomic_post' ).trigger( 'change' );
+ $( "#webcomic_post_list" ).html( data );
+ $( "#webcomic_post" ).trigger( "change" );
} );
} );
/** Update the webcomic preview when the post is changed. */
- $( document ).on( 'change', '#webcomic_post', function() {
+ $( document ).on( "change", "#webcomic_post", function() {
$.get( url, {
- parent: $( '#webcomic_post' ).val() ? $( '#webcomic_post' ).val() : 0,
- webcomic_admin_ajax: 'WebcomicTranscripts::ajax_post_transcripts'
+ parent: $( "#webcomic_post" ).val() ? $( "#webcomic_post" ).val() : 0,
+ webcomic_admin_ajax: "WebcomicTranscripts::ajax_post_transcripts"
}, function( data ) {
- $( '#webcomic_post_transcripts' ).html( data );
+ $( "#webcomic_post_transcripts" ).html( data );
} );
$.get( url, {
- post: $( '#webcomic_post' ).val() ? $( '#webcomic_post' ).val() : 0,
- webcomic_admin_ajax: 'WebcomicTranscripts::ajax_preview'
+ post: $( "#webcomic_post" ).val() ? $( "#webcomic_post" ).val() : 0,
+ webcomic_admin_ajax: "WebcomicTranscripts::ajax_preview"
}, function( data ) {
- $( '#webcomic_post_preview' ).html( data );
+ $( "#webcomic_post_preview" ).html( data );
} );
} );
/** Add a new row for custom authors. */
- $( '#webcomic_author_add' ).on( 'click', function() {
+ $( "#webcomic_author_add" ).on( "click", function() {
var key = ( new Date() ).getTime();
- $( '#webcomic_author_table tbody' ).append( '<tr><td><button class="delete">-</button></td><td><input type="text" name="webcomic_author_new[' + key + '][name]"></td><td><input type="email" name="webcomic_author_new[' + key + '][email]"></td><td><input type="url" name="webcomic_author_new[' + key + '][url]"></td><td><input type="text" name="webcomic_author_new[' + key + '][ip]"></td><td><input type="text" name="webcomic_author_new[' + key + '][time]"></td></tr>' );
+ $( "#webcomic_author_table tbody" ).append( "<tr><td><button class='delete'>-</button></td><td><input type='text' name='webcomic_author_new[" + key + "][name]'></td><td><input type='email' name='webcomic_author_new[" + key + "][email]'></td><td><input type='url' name='webcomic_author_new[" + key + "][url]'></td><td><input type='text' name='webcomic_author_new[" + key + "][ip]'></td><td><input type='text' name='webcomic_author_new[" + key + "][time]'></td></tr>" );
return false;
} );
/** Delete an existing author row. */
- $( document ).on( 'click', '#webcomic_author_table .delete', function() {
- $( this ).parents( 'tr' ).remove();
+ $( document ).on( "click", "#webcomic_author_table .delete", function() {
+ $( this ).parents( "tr" ).remove();
return false;
} );
View
34 -/js/admin-widgets.js
@@ -1,17 +1,17 @@
jQuery( function( $ ) {
- var url = $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' );
+ var url = $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" );
/** Remove the webcomic image. */
- $( document ).on( 'click', '.webcomic-image-x', function() {
+ $( document ).on( "click", ".webcomic-image-x", function() {
var $e = $( this );
$.get( url, {
id: 0,
- name: $e.data( 'name' ),
- target: $e.data( 'target' ),
- webcomic_admin_ajax: $e.data( 'callback' )
+ name: $e.data( "name" ),
+ target: $e.data( "target" ),
+ webcomic_admin_ajax: $e.data( "callback" )
}, function( data ) {
- $( $e.closest( $e.data( 'target' ) ) ).html( data );
+ $( $e.closest( $e.data( "target" ) ) ).html( data );
} );
} );
} );
@@ -21,29 +21,29 @@ jQuery( function( $ ) {
var frame;
$( function() {
- $( document ).on( 'click', '.webcomic-image', function( e ) {
+ $( document ).on( "click", ".webcomic-image", function( e ) {
var $e = $( this );
e.preventDefault();
frame = wp.media.frames.webcomicWidgetImage = wp.media( {
- title: $e.data( 'title' ),
+ title: $e.data( "title" ),
library: {
- type: 'image'
+ type: "image"
},
button: {
- text: $e.data( 'update' )
+ text: $e.data( "update" )
}
} );
- frame.on( 'select', function() {
- $.get( $( '[data-webcomic-admin-url]' ).data( 'webcomic-admin-url' ), {
- id: frame.state().get( 'selection' ).first().id,
- name: $e.data( 'name' ),
- target: $e.data( 'target' ),
- webcomic_admin_ajax: $e.data( 'callback' )
+ frame.on( "select", function() {
+ $.get( $( "[data-webcomic-admin-url]" ).data( "webcomic-admin-url" ), {
+ id: frame.state().get( "selection" ).first().id,
+ name: $e.data( "name" ),
+ target: $e.data( "target" ),
+ webcomic_admin_ajax: $e.data( "callback" )
}, function( data ) {
- $( $e.closest( $e.data( 'target' ) ) ).html( data );
+ $( $e.closest( $e.data( "target" ) ) ).html( data );
} );
} );
View
4 -/js/dropdown.js
@@ -1,7 +1,7 @@
/** Enable webcomic dropdown navigation. */
jQuery( function( $ ) {
- $( 'select.webcomic-terms,select.webcomic-collections,select.webcomic-transcript-terms' ).on( 'change', function() {
- var url = $( this ).find( 'option:selected' ).data( 'webcomic-url' );
+ $( "select.webcomic-terms,select.webcomic-collections,select.webcomic-transcript-terms" ).on( "change", function() {
+ var url = $( this ).find( "option:selected" ).data( "webcomic-url" );
if ( url ) {
window.location.href = url;
View
18 -/js/dynamic.js
@@ -1,12 +1,12 @@
/** Enable dynamic webcomic navigation. */
jQuery( function( $ ) {
- if ( $( '[data-webcomic-container]' ) ) {
+ if ( $( "[data-webcomic-container]" ) ) {
var defaults = [];
- $( '[data-webcomic-container]' ).each( function() {
+ $( "[data-webcomic-container]" ).each( function() {
defaults.push( {
- parent: $( this ).find( '[data-webcomic-parent]' ).data( 'webcomic-parent' ),
- container: $( this ).data( 'webcomic-container' )
+ parent: $( this ).find( "[data-webcomic-parent]" ).data( "webcomic-parent" ),
+ container: $( this ).data( "webcomic-container" )
} );
} );
@@ -16,11 +16,11 @@ jQuery( function( $ ) {
function dynamic_webcomic( url, container ) {
$.get( url, { webcomic_dynamic: container }, function( data ) {
- $( '[data-webcomic-container="' + container + '"]' ).html( data ).show();
+ $( "[data-webcomic-container='" + container + "']" ).html( data ).show();
} );
}
- $( window ).on( 'popstate', function( e ) {
+ $( window ).on( "popstate", function( e ) {
if ( e.originalEvent.state ) {
if ( e.originalEvent.state.webcomicReset ) {
$.each( defaults, function( i, v ) {
@@ -34,11 +34,11 @@ jQuery( function( $ ) {
}
} );
- $( document ).on( 'click', '[data-webcomic-container] [href].webcomic-link', function( e ) {
+ $( document ).on( "click", "[data-webcomic-container] [href].webcomic-link", function( e ) {
e.preventDefault();
- var url = $( this ).attr( 'href' );
- var container = $( this ).closest( '[data-webcomic-container]' ).data( 'webcomic-container' );
+ var url = $( this ).attr( "href" );
+ var container = $( this ).closest( "[data-webcomic-container]" ).data( "webcomic-container" );
dynamic_webcomic( url, container );
View
56 -/js/gestures.js
@@ -2,7 +2,7 @@
jQuery( function( $ ) {
var canvas, end, start, scroll;
- $( '[data-webcomic-gestures]' ).on( 'touchstart', function( e ) {
+ $( "[data-webcomic-gestures]" ).on( "touchstart", function( e ) {
canvas = $( this );
start = e.originalEvent;
scroll = $( e.target );
@@ -16,7 +16,7 @@ jQuery( function( $ ) {
};
while ( scroll.e = scroll.e.parent() ) {
- if ( scroll.e.prop( 'scrollWidth' ) > scroll.e.width() || scroll.e.prop( 'scrollHeight' ) > scroll.e.height() ) {
+ if ( scroll.e.prop( "scrollWidth" ) > scroll.e.width() || scroll.e.prop( "scrollHeight" ) > scroll.e.height() ) {
break;
}
@@ -31,11 +31,11 @@ jQuery( function( $ ) {
}
} );
- $( '[data-webcomic-gestures]' ).on( 'touchmove', function( e ) {
+ $( "[data-webcomic-gestures]" ).on( "touchmove", function( e ) {
end = e.originalEvent;
} );
- $( '[data-webcomic-gestures]' ).on( 'touchend', function( e ) {
+ $( "[data-webcomic-gestures]" ).on( "touchend", function( e ) {
if ( end ) {
var x, y, a, b, d, $e;
@@ -45,56 +45,56 @@ jQuery( function( $ ) {
b = Math.abs( y );
if ( a > b ) {
- d = 0 > x ? 'left' : 'right';
+ d = 0 > x ? "left" : "right";
} else {
- d = 0 > y ? 'up' : 'down';
+ d = 0 > y ? "up" : "down";
}
if ( !webcomic_scrolling( d ) ) {
if ( 1 === end.touches.length ) {
- if ( 'left' === d ) {
- $e = $( '.previous-webcomic-link[href]:first', canvas );
- } else if ( 'right' === d ) {
- $e = $( '.next-webcomic-link[href]:first', canvas );
+ if ( "left" === d ) {
+ $e = $( ".previous-webcomic-link[href]:first", canvas );
+ } else if ( "right" === d ) {
+ $e = $( ".next-webcomic-link[href]:first", canvas );
}
} else if ( 2 == end.touches.length ) {
- if ( 'left' === d ) {
- $e = $( '.first-webcomic-link[href]:first', canvas );
- } else if ( 'right' === d ) {
- $e = $( '.last-webcomic-link[href]:first', canvas );
- } else if ( 'up' === d ) {
- $e = $( '.purchase-webcomic-link[href]:first', canvas );
- } else if ( 'down' === d ) {
- $e = $( '.random-webcomic-link[href]:first', canvas );
+ if ( "left" === d ) {
+ $e = $( ".first-webcomic-link[href]:first", canvas );
+ } else if ( "right" === d ) {
+ $e = $( ".last-webcomic-link[href]:first", canvas );
+ } else if ( "up" === d ) {
+ $e = $( ".purchase-webcomic-link[href]:first", canvas );
+ } else if ( "down" === d ) {
+ $e = $( ".random-webcomic-link[href]:first", canvas );
}
}
if ( $e && $e.length ) {
e.preventDefault();
- if ( $.fn.webcomicDynamicNavigation && $e.closest( '[data-webcomic-container]' ).length ) {
- $e.trigger( 'click' );
+ if ( $.fn.webcomicDynamicNavigation && $e.closest( "[data-webcomic-container]" ).length ) {
+ $e.trigger( "click" );
} else {
- window.location.href = $e.attr( 'href' );
+ window.location.href = $e.attr( "href" );
}
}
}
}
} );
- $( '[data-webcomic-gestures]' ).on( 'touchcancel', function( e ) {
+ $( "[data-webcomic-gestures]" ).on( "touchcancel", function( e ) {
end = start = scroll = false;
} );
function webcomic_scrolling( direction ) {
if ( scroll && 1 === end.touches.length ) {
- if ( 'left' === direction && scroll.x ) {
- return scroll.e.prop( 'scrollWidth' ) - scroll.e.scrollLeft() !== scroll.e.outerWidth();
- } else if ( 'right' === direction && scroll.x ) {
+ if ( "left" === direction && scroll.x ) {
+ return scroll.e.prop( "scrollWidth" ) - scroll.e.scrollLeft() !== scroll.e.outerWidth();
+ } else if ( "right" === direction && scroll.x ) {
return 0 !== scroll.e.scrollLeft();
- } else if ( 'up' === direction && scroll.y ) {
- return scroll.e.prop( 'scrollHeight' ) - scroll.e.scrollTop() === scroll.e.outerHeight();
- } else if ( 'down' === direction && scroll.y ) {
+ } else if ( "up" === direction && scroll.y ) {
+ return scroll.e.prop( "scrollHeight" ) - scroll.e.scrollTop() === scroll.e.outerHeight();
+ } else if ( "down" === direction && scroll.y ) {
return 0 !== scroll.e.scrollTop();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.