Skip to content

Commit

Permalink
Merge pull request #32 from WordPress-Phoenix/bug/wp-hooks
Browse files Browse the repository at this point in the history
Fix wp.hooks conflict
  • Loading branch information
scarstens authored Jan 7, 2019
2 parents 9cfd023 + ccb8789 commit 9f0b735
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
18 changes: 9 additions & 9 deletions inc/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ public static function inline_js_header() {
<?php self::selectize_js(); ?>
!function( t, o ) {
"use strict";
t.wp = t.wp || {}, t.wp.hooks = t.wp.hooks || new function() {
t.wpop = t.wpop || {}, t.wpop.hooks = t.wpop.hooks || new function() {
function t( t, o, i, n ) {
var e, r, p;
if ( a[t][o] ) if ( i ) if ( e = a[t][o], n ) for ( p = e.length; p--; ) (r = e[p]).callback === i && r.context === n && e.splice( p, 1 ); else for ( p = e.length; p--; ) e[p].callback === i && e.splice( p, 1 ); else a[t][o] = []
Expand Down Expand Up @@ -937,7 +937,7 @@ function i( t, o, i ) {
}
}( window ), jQuery( document ).ready( function( t ) {
var o;
wp.hooks.addAction( "wpopPreInit", p ), wp.hooks.addAction( "wpopInit", r, 5 ), wp.hooks.addAction( "wpopFooterScripts", c ), wp.hooks.addAction( "wpopInit", l ), wp.hooks.addAction( "wpopInit", f ), wp.hooks.addAction( "wpopInit", e, 100 ), wp.hooks.addAction( "wpopSectionNav", n ), wp.hooks.addAction( "wpopPwdClear", d ), wp.hooks.addAction( "wpopImgUpload", u ), wp.hooks.addAction( "wpopImgRemove", w ), wp.hooks.addAction( "wpopSubmit", a ), wp.hooks.doAction( "wpopPreInit" );
wpop.hooks.addAction( "wpopPreInit", p ), wpop.hooks.addAction( "wpopInit", r, 5 ), wpop.hooks.addAction( "wpopFooterScripts", c ), wpop.hooks.addAction( "wpopInit", l ), wpop.hooks.addAction( "wpopInit", f ), wpop.hooks.addAction( "wpopInit", e, 100 ), wpop.hooks.addAction( "wpopSectionNav", n ), wpop.hooks.addAction( "wpopPwdClear", d ), wpop.hooks.addAction( "wpopImgUpload", u ), wpop.hooks.addAction( "wpopImgRemove", w ), wpop.hooks.addAction( "wpopSubmit", a ), wpop.hooks.doAction( "wpopPreInit" );

var i = wp.template( "wpop-media-stats" );

Expand Down Expand Up @@ -1026,15 +1026,15 @@ function w( o, i ) {
}

t( "#wpopNav li a" ).click( function( t ) {
wp.hooks.doAction( "wpopSectionNav", this, t )
} ), wp.hooks.doAction( "wpopInit" ), t( 'input[type="submit"]' ).click( function( t ) {
wp.hooks.doAction( "wpopSubmit", this, t )
wpop.hooks.doAction( "wpopSectionNav", this, t )
} ), wpop.hooks.doAction( "wpopInit" ), t( 'input[type="submit"]' ).click( function( t ) {
wpop.hooks.doAction( "wpopSubmit", this, t )
} ), t( ".pwd-clear" ).click( function( t ) {
wp.hooks.doAction( "wpopPwdClear", this, t )
wpop.hooks.doAction( "wpopPwdClear", this, t )
} ), t( ".img-upload" ).on( "click", function( t ) {
wp.hooks.doAction( "wpopImgUpload", this, t )
wpop.hooks.doAction( "wpopImgUpload", this, t )
} ), t( ".img-remove" ).on( "click", function( t ) {
wp.hooks.doAction( "wpopImgRemove", this, t )
wpop.hooks.doAction( "wpopImgRemove", this, t )
} )
} );
</script>
Expand Down Expand Up @@ -1083,7 +1083,7 @@ public static function inline_js_footer() {

<script type="text/javascript">
jQuery( document ).ready( function() {
wp.hooks.doAction( 'wpopFooterScripts' );
wpop.hooks.doAction( 'wpopFooterScripts' );
} );
</script>
<?php
Expand Down
38 changes: 19 additions & 19 deletions unminified-assets-v3/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
! function( t, n ) {
"use strict";
t.wp = t.wp || {}, t.wp.hooks = t.wp.hooks || new function() {
t.wp = t.wp || {}, t.wpop.hooks = t.wpop.hooks || new function() {
function t( t, n, r, i ) {
var e, o, c;
if ( f[t][n] ) {
Expand Down Expand Up @@ -74,57 +74,57 @@ jQuery( document ).ready(
function( $ ) {
var wpModal;
registerAllActions();
wp.hooks.doAction( 'wpopPreInit' );
wpop.hooks.doAction( 'wpopPreInit' );
var mediaStats = wp.template( 'wpop-media-stats' );

$( '#wpopNav li a' ).click(
function( evt ) {
wp.hooks.doAction( 'wpopSectionNav', this, evt ); // reg. here to allow "click" from hash to select a section
wpop.hooks.doAction( 'wpopSectionNav', this, evt ); // reg. here to allow "click" from hash to select a section
}
);

wp.hooks.doAction( 'wpopInit' ); // main init
wpop.hooks.doAction( 'wpopInit' ); // main init

$( 'input[type="submit"]' ).click(
function( evt ) {
wp.hooks.doAction( 'wpopSubmit', this, evt );
wpop.hooks.doAction( 'wpopSubmit', this, evt );
}
);

$( '.pwd-clear' ).click(
function( evt ) {
wp.hooks.doAction( 'wpopPwdClear', this, evt );
wpop.hooks.doAction( 'wpopPwdClear', this, evt );
}
);

$( '.img-upload' ).on(
'click', function( event ) {
wp.hooks.doAction( 'wpopImgUpload', this, event );
wpop.hooks.doAction( 'wpopImgUpload', this, event );
}
);

$( '.img-remove' ).on(
'click', function( event ) {
wp.hooks.doAction( 'wpopImgRemove', this, event );
wpop.hooks.doAction( 'wpopImgRemove', this, event );
}
);

function registerAllActions() {
wp.hooks.addAction( 'wpopPreInit', nixHashJumpJank );
wp.hooks.addAction( 'wpopInit', handleInitHashSelection, 5 );
wp.hooks.addAction( 'wpopFooterScripts', initIrisColorSwatches );
wp.hooks.addAction( 'wpopInit', initSelectizeInputs );
wp.hooks.addAction( 'wpopInit', initMediaUploadField );
wpop.hooks.addAction( 'wpopPreInit', nixHashJumpJank );
wpop.hooks.addAction( 'wpopInit', handleInitHashSelection, 5 );
wpop.hooks.addAction( 'wpopFooterScripts', initIrisColorSwatches );
wpop.hooks.addAction( 'wpopInit', initSelectizeInputs );
wpop.hooks.addAction( 'wpopInit', initMediaUploadField );

wp.hooks.addAction( 'wpopInit', wpopDisableSpinner, 100 );
wpop.hooks.addAction( 'wpopInit', wpopDisableSpinner, 100 );

wp.hooks.addAction( 'wpopSectionNav', handleSectionNavigation );
wpop.hooks.addAction( 'wpopSectionNav', handleSectionNavigation );

wp.hooks.addAction( 'wpopPwdClear', doPwdFieldClear );
wp.hooks.addAction( 'wpopImgUpload', doMediaUpload );
wp.hooks.addAction( 'wpopImgRemove', doMediaRemove );
wpop.hooks.addAction( 'wpopPwdClear', doPwdFieldClear );
wpop.hooks.addAction( 'wpopImgUpload', doMediaUpload );
wpop.hooks.addAction( 'wpopImgRemove', doMediaRemove );

wp.hooks.addAction( 'wpopSubmit', wpopShowSpinner );
wpop.hooks.addAction( 'wpopSubmit', wpopShowSpinner );
}

/* CORE */
Expand Down
2 changes: 1 addition & 1 deletion wpop-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @authors 🌵 WordPress Phoenix 🌵 / Seth Carstens, David Ryan
* @package wpop
* @version 4.1.7
* @version 4.1.8
* @license GPL-2.0+ - please retain comments that express original build of this file by the author.
*/

Expand Down

0 comments on commit 9f0b735

Please sign in to comment.