Skip to content

Commit

Permalink
Added jQuery cdn registration, added app-min.js and plugins.js files
Browse files Browse the repository at this point in the history
  • Loading branch information
menslow committed Oct 17, 2011
1 parent 9437ffc commit a471938
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Empty file added assets/js/app-min.js
Empty file.
Empty file added assets/js/plugins.js
Empty file.
19 changes: 16 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,22 @@ function add_site_scripts() {
<?php

if (!is_admin()) {
wp_enqueue_script( 'modernizr', JS . '/modernizr-1.7.min.js', array() ); // keep modernizer in header
wp_enqueue_script( 'jquery-cdn', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js', array(), FALSE, TRUE ); // Load in footer from Google CDN
wp_enqueue_script( 'app', JS . '/app.js', array('jquery-cdn'), FALSE, TRUE );
wp_enqueue_script( 'modernizr', JS . '/modernizr-1.7.min.js', array() ); // Load modernizer in header
// Re-register jquery in order to load jquery from CDN
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
wp_enqueue_script( 'jquery', FALSE, array(), FALSE, TRUE ); // Load in footer from Google CDN
if(ENVIRONMENT==='test')
{
// Un-minified app.js + separate plugin file for easier development
wp_enqueue_script( 'plugins', JS . '/plugins.js', array('jquery'), FALSE, TRUE ); // Load in footer
wp_enqueue_script( 'app', JS . '/app.js', array('jquery'), '1.02', TRUE ); // Load in footer
}
else
{
// minified app.js with plugins combined in one file.
wp_enqueue_script( 'app-min', JS . '/app-min.js', array('jquery'), '1.02', TRUE ); // Load in footer
}
}

}
Expand Down

0 comments on commit a471938

Please sign in to comment.