…jQuery/jQuery.js" type="text/javascript"></script> <script src="build/squire-raw.js" type="text/javascript"></script> <script src="build/Squire-UI.js" type="text/javascript"></script> It also offers static html for a textarea in the body <div class="container"> <div class="row"> <div class="col-centered"> <textarea id="foo"></textarea> </div> </div>But on load, its JQuery $(document).ready function replaces the static #foo textarea with its SquireUI. <script> $(document).ready(function () { UI = new…
…jQuery, you don't need to register it; just enqueue it as follows:function register_my_scripts() { wp_enqueue_script( 'my_script', plugins_url( '/js/script.js', __FILE__ ), 'jquery', , 'true' ); } add_action( 'wp_enqueue_scripts', 'register_my_scripts' );Read more about the wp_enqueue_scripts hook in this tutorial on including JavaScript and CSS in your themes and plugins.SummaryHopefully I've convinced you…
…jQuery plugins, and the theme folder will contain your own theme's JavaScript code.If you want to minify them too, you can include the gulp-uglify plugin. And let's update our default task to:gulp.task('default', ['sass', 'js']);Optimize ImagesThe most commonly used gulp plugin for this task is gulp-imagemin. Install it by using:npm install…
…jQuery and Bootstrap scripts in index.html.<script src="https://code.jquery.com/jquery-2.0.1.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>Once the scripts references are included, add the following popup HTML code to app/welcome/welcome.html.<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span> </button> <h4 class="modal-title" id="editModalLabel">Update Post</h4> </div> <div class="modal-body"> <form…
…jQuery to run, and you need to enqueue it conditionally. Here's what you do: <?php // source: http://codex.wordpress.org/Function_Reference/is_active_widget if ( is_active_widget( false, false, $this->id_base, true ) ) { wp_enqueue_script( 'jquery' ); } ?> 8. Checking Whether the Page Is a Single Blog Post's Page: is_single() Want to check if the…
…jquery/2.1.3/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script> </body> </html>Securing Your RoutesTo secure your routes and allow only logged-in users to be able to access them, you need to make use of the auth middleware which is provided by Laravel. The auth middleware can be found at app\Http\Middleware\Authenticate.php. Here are a few examples of how…
…jQuery(document).ready(function($) { $('#author').on( 'blur', function( e ){ var value = $(this).val(); if( !value ){ if( $('#author-error').length > 0 ){ $('#author-error').remove(); } $( '<p id="author-error" class="alert alert-error" role="alert"></p>' ) .insertAfter( $('#author') ) .text( 'Name field error: Please provide a name' ); }else if( $('#author-error').length > 0 ){ $('#author-error').remove(); } }); });The…
…jquery/1.11.2/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> <style> body { padding-top: 50px; } #divTotal{ background-color: green; } .affix{ right: 0px; } .affix-top{ right: 0px; position: fixed; } </style> </head> <body> <div class="container"> </div> </body> </html>Inside the .container div, create a .row div. <div class="row"> </div>In the index.html page, we'll have two columns. One will…
…jquery' ) ); } ?> 42. Checking Whether the Specified Plugin Is Active in Multisite: is_plugin_active_for_network() Similar to is_plugin_active(), the Conditional Tag is_plugin_active_for_network() will detect whether the given plugin is active... in a Multisite installation. This might be useful if your code needs to know whether another plugin is active…
…jQuery );Next we need to create a function which, given any two colours (in hex) format, returns the contrast ratio between them. Details of calculating this ratio can be found on the W3C website, but it is done by first calculating the "relative luminance" (roughly speaking a measure of "brightness".…