Skip to content

Commit

Permalink
Validated dependencies and use them instead to load scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
toolstack authored and ocean90 committed Sep 4, 2016
1 parent bdd9742 commit ac5174d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions gp-includes/assets-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function gp_register_scripts() {
wp_register_script( 'tablesorter', $url . '/jquery.tablesorter.min.js', array( 'jquery' ), '1.10.4' );
wp_register_script( 'gp-common', $url . '/common.js', array( 'jquery' ), '20150430' );
wp_register_script( 'gp-editor', $url . '/editor.js', array( 'gp-common', 'jquery-ui-tooltip' ), '20160329' );
wp_register_script( 'gp-glossary', $url . '/glossary.js', array( 'gp-common', 'gp-editor' ), '20160329' );
wp_register_script( 'gp-translations-page', $url . '/translations-page.js', array( 'gp-common', 'gp-editor' ), '20150430' );
wp_register_script( 'gp-mass-create-sets-page', $url . '/mass-create-sets-page.js', array( 'gp-common', 'gp-editor' ), '20150430' );
wp_register_script( 'gp-glossary', $url . '/glossary.js', array( 'gp-editor' ), '20160329' );
wp_register_script( 'gp-translations-page', $url . '/translations-page.js', array( 'gp-editor' ), '20150430' );
wp_register_script( 'gp-mass-create-sets-page', $url . '/mass-create-sets-page.js', array( 'gp-editor' ), '20150430' );
}

add_action( 'init', 'gp_register_scripts' );
Expand Down
2 changes: 1 addition & 1 deletion gp-templates/locales.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
gp_title( __( 'Locales &lt; GlotPress', 'glotpress' ) );

gp_enqueue_script( array( 'gp-common', 'gp-editor', 'tablesorter' ) );
gp_enqueue_script( array( 'gp-common', 'tablesorter' ) );
gp_breadcrumb( array( __( 'Locales', 'glotpress' ) ) );
gp_tmpl_header();
?>
Expand Down
2 changes: 1 addition & 1 deletion gp-templates/project.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
gp_title( sprintf( __( '%s &lt; GlotPress', 'glotpress' ), esc_html( $project->name ) ) );
gp_breadcrumb_project( $project );
gp_enqueue_script( array( 'gp-common', 'gp-editor', 'tablesorter' ) );
gp_enqueue_script( array( 'gp-editor', 'tablesorter' ) );
$edit_link = gp_link_project_edit_get( $project, __( '(edit)', 'glotpress' ) );

if ( $project->active ) {
Expand Down
2 changes: 1 addition & 1 deletion gp-templates/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gp_project_links_from_root( $project ),
gp_link_get( $url, $translation_set->name ),
) );
gp_enqueue_script( array( 'jquery-ui-core', 'gp-common', 'gp-editor', 'gp-translations-page' ) );
gp_enqueue_script( array( 'gp-editor', 'gp-translations-page' ) );
wp_localize_script( 'gp-translations-page', '$gp_translations_options', array( 'sort' => __( 'Sort', 'glotpress' ), 'filter' => __( 'Filter', 'glotpress' ) ) );

// localizer adds var in front of the variable name, so we can't use $gp.editor.options
Expand Down

0 comments on commit ac5174d

Please sign in to comment.