Skip to content

Commit

Permalink
Refactored Game On to follow WordPress plugin coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
eballarin committed May 10, 2015
2 parents f760448 + 5ffa9e3 commit d957ebc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion game-on.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Description: Gamification tools for teachers.
Authors: Semar Yousif, Vincent Astolfi, Ezio Ballarin, Forest Hoffman, Austin Vuong, Spencer Nussbaum, Isaac Canada, Charles Leon
Author URI: http://maclab.guhsd.net/
Version: 2.3.9
Version: 2.4.0
*/

include( 'go_datatable.php' );
Expand Down
12 changes: 9 additions & 3 deletions scripts/go_everypage.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ function hideVid () {
function go_display_help_video ( url ) {
jQuery( '.dark' ).show();
if ( url.indexOf( 'youtube' ) != -1 || url.indexOf( 'vimeo' ) != -1 ) {
if ( url.indexOf( 'youtube' ) != -1 ) {
if ( url.indexOf( 'youtube' ) != -1 || url.indexOf( 'youtu.be' ) ) {
url = url.replace( 'watch?v=', 'v/' );
if ( url.indexOf( '&rel=0' ) == -1 ) {
url = url + '&rel=0';
}
jQuery( '#go_help_video_container' ).html( '<iframe id="go_video_iframe" width="100%" height="100%" src="' + url + '" frameborder="0" allowfullscreen></iframe>' );
}
if ( url.indexOf( 'vimeo' ) != -1) {
jQuery( '#go_help_video_container' ).html( '<iframe id="go_video_iframe" src="' + url + '" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>' );
if ( url.indexOf( 'vimeo' ) != -1 ) {
vimeo_vid_num = url.match( /\d+$/ )[0];
new_url = 'https://player.vimeo.com/video/' + vimeo_vid_num;
jQuery( '#go_help_video_container' ).html( '<iframe id="go_video_iframe" src="' + new_url + '" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>' );
}
}
jQuery( '#go_help_video_container' ).show();
Expand Down

0 comments on commit d957ebc

Please sign in to comment.