diff --git a/assets/css/activation.css b/assets/css/activation.css index 528e88a1..b38b40ef 100644 --- a/assets/css/activation.css +++ b/assets/css/activation.css @@ -6,7 +6,9 @@ .sportspress-message a.button-primary, .sportspress-message a.button-secondary, p.sportspress-actions input.button-primary, -p.sportspress-actions input.button-primary:active { +p.sportspress-actions input.button-primary:active, +p.sportspress-actions a.button-primary, +p.sportspress-actions a.button-primary:active { background: #3bbab3; border-color: #15a29a; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); @@ -18,7 +20,9 @@ p.sportspress-actions input.button-primary:active { .sportspress-message a.button-primary:hover, .sportspress-message a.button-secondary:hover, p.sportspress-actions input.button-primary:hover, -p.sportspress-actions input.button-primary:focus { +p.sportspress-actions input.button-primary:focus, +p.sportspress-actions a.button-primary:hover, +p.sportspress-actions a.button-primary:focus { background: #00a69c; border-color: #009187; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.1); @@ -61,8 +65,29 @@ p.sportspress-actions input.button-primary:focus { background: transparent!important; } +.sportspress-steps:before, +.sportspress-steps:after { + content: " "; + display: table; +} + +.sportspress-steps:after { + clear: both; +} + +.sportspress-steps { + *zoom: 1; +} + +.sportspress-steps ul { + width: 45%; + margin-right: 5%; + float: left; + margin-bottom: 0; +} + .sportspress-steps .welcome-icon:before { - font: 400 20px/1 "sportspress"; + font: 400 20px/1 dashicons; speak: none; display: inline-block; padding: 0 10px 0 0; @@ -75,14 +100,6 @@ p.sportspress-actions input.button-primary:focus { color: #888; } -.sportspress-steps .welcome-add-team:before { - content: "\f334"; -} - -.sportspress-steps .welcome-add-player:before { - content: "\f307"; -} - -.sportspress-steps .welcome-add-event:before { - content: "\f145"; +.sportspress-steps .sp-welcome-icon:before { + font-family: sportspress; } \ No newline at end of file diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot index f0be3e60..f932b567 100755 Binary files a/assets/fonts/sportspress.eot and b/assets/fonts/sportspress.eot differ diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg index 28d53d23..8d283c15 100755 --- a/assets/fonts/sportspress.svg +++ b/assets/fonts/sportspress.svg @@ -7,14 +7,15 @@ - + + - + diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf index 7939835e..e5cb8c8f 100755 Binary files a/assets/fonts/sportspress.ttf and b/assets/fonts/sportspress.ttf differ diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff index 0416ea96..5a7b698c 100755 Binary files a/assets/fonts/sportspress.woff and b/assets/fonts/sportspress.woff differ diff --git a/assets/js/admin/sportspress-admin.js b/assets/js/admin/sportspress-admin.js index 6a6cf3d7..086d986c 100644 --- a/assets/js/admin/sportspress-admin.js +++ b/assets/js/admin/sportspress-admin.js @@ -517,4 +517,7 @@ jQuery(document).ready(function($){ }); } }); + + // Fitvids + $(".sp-fitvids").fitVids(); }); \ No newline at end of file diff --git a/assets/js/jquery.fitvids.js b/assets/js/jquery.fitvids.js new file mode 100644 index 00000000..231d3b5d --- /dev/null +++ b/assets/js/jquery.fitvids.js @@ -0,0 +1,83 @@ +/*global jQuery */ +/*jshint browser:true */ +/*! +* FitVids 1.1 +* +* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com +* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ +* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ +* +*/ + +(function( $ ){ + + 'use strict'; + + $.fn.fitVids = function( options ) { + var settings = { + customSelector: null, + ignore: null + }; + + if(!document.getElementById('fit-vids-style')) { + // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js + var head = document.head || document.getElementsByTagName('head')[0]; + var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'; + var div = document.createElement("div"); + div.innerHTML = '

x

'; + head.appendChild(div.childNodes[1]); + } + + if ( options ) { + $.extend( settings, options ); + } + + return this.each(function(){ + var selectors = [ + 'iframe[src*="player.vimeo.com"]', + 'iframe[src*="youtube.com"]', + 'iframe[src*="youtube-nocookie.com"]', + 'iframe[src*="kickstarter.com"][src*="video.html"]', + 'object', + 'embed' + ]; + + if (settings.customSelector) { + selectors.push(settings.customSelector); + } + + var ignoreList = '.fitvidsignore'; + + if(settings.ignore) { + ignoreList = ignoreList + ', ' + settings.ignore; + } + + var $allVideos = $(this).find(selectors.join(',')); + $allVideos = $allVideos.not('object object'); // SwfObj conflict patch + $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. + + $allVideos.each(function(){ + var $this = $(this); + if($this.parents(ignoreList).length > 0) { + return; // Disable FitVids on this video. + } + if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } + if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) + { + $this.attr('height', 9); + $this.attr('width', 16); + } + var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), + width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), + aspectRatio = height / width; + if(!$this.attr('id')){ + var videoID = 'fitvid' + Math.floor(Math.random()*999999); + $this.attr('id', videoID); + } + $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%'); + $this.removeAttr('height').removeAttr('width'); + }); + }); + }; +// Works with either jQuery or Zepto +})( window.jQuery || window.Zepto ); diff --git a/includes/admin/class-sp-admin-welcome.php b/includes/admin/class-sp-admin-welcome.php index 3aa93011..bac78ab6 100644 --- a/includes/admin/class-sp-admin-welcome.php +++ b/includes/admin/class-sp-admin-welcome.php @@ -42,12 +42,27 @@ class SP_Admin_Welcome { * @return void */ public function admin_menus() { + if ( empty( $_GET['page'] ) ) { + return; + } + + $welcome_page_name = __( 'About SportsPress', 'sportspress' ); $welcome_page_title = __( 'Welcome to SportsPress', 'sportspress' ); - // About - $about = add_dashboard_page( $welcome_page_title, $welcome_page_title, 'manage_options', 'sp-about', array( $this, 'about_screen' ) ); - - add_action( 'admin_print_styles-'. $about, array( $this, 'admin_css' ) ); + switch ( $_GET['page'] ) { + case 'sp-about' : + $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-about', array( $this, 'about_screen' ) ); + add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); + break; + case 'sp-credits' : + $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-credits', array( $this, 'credits_screen' ) ); + add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); + break; + case 'sp-translators' : + $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-translators', array( $this, 'translators_screen' ) ); + add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); + break; + } } /** @@ -68,6 +83,7 @@ class SP_Admin_Welcome { */ public function admin_head() { remove_submenu_page( 'index.php', 'sp-about' ); + remove_submenu_page( 'index.php', 'sp-credits' ); remove_submenu_page( 'index.php', 'sp-translators' ); // Badge for welcome page @@ -96,9 +112,10 @@ class SP_Admin_Welcome { -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2); box-shadow: 0 1px 3px rgba(0,0,0,.2); } - .about-sportspress-wrap .sp-actions { - text-align: right; - margin-right: 200px; + .about-sportspress-wrap .sportspress-actions .twitter-share-button { + margin-top: -3px; + margin-left: 3px; + vertical-align: middle; } .about-sportspress-wrap .sp-feature { overflow: visible !important; @@ -112,6 +129,30 @@ class SP_Admin_Welcome { .about-sportspress-wrap .sp-feature:after { clear: both; } + .about-sportspress-wrap div.icon { + width: 0 !important; + padding: 0; + margin: 0; + } + .about-sportspress-wrap .sp-feature div.icon:before { + font-family: sportspress !important; + font-weight: normal; + width: 100%; + font-size: 170px; + line-height: 125px; + color: #9c5d90; + display: inline-block; + position: relative; + text-align: center; + speak: none; + margin: ; + content: "\f111"; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + .about-sportspress-wrap .form-table th { + width: auto; + } @media only screen and (max-width: 500px) { .about-sportspress-wrap h1 { padding-top: 240px; @@ -137,7 +178,7 @@ class SP_Admin_Welcome { // Drop minor version if 0 $major_version = substr( SP()->version, 0, 3 ); ?> -

+

version ); ?>
-

+

+ +

@@ -162,6 +205,10 @@ class SP_Admin_Welcome { intro(); ?> - - -
-

-
-
+
+
+ +

+ $name ): + if ( $sport === $slug ): + $sport = $name; + continue; + endif; + endforeach; + endforeach; + echo $sport; + ?> +
+

+

+
+
    +
  • +
  • +
  • +
+
    +
  • +
  • +
  • +
+
+
+ +
+
-

- + - -

- 'sportspress_sport', - 'default' => 'soccer', - 'type' => 'groupselect', - 'class' => $class, - 'options' => $sport_options, - )); - SP_Admin_Settings::output_fields( $settings ); - ?> + if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists + $check_zone_info = false; + if ( 0 == $current_offset ) + $tzstring = 'UTC+0'; + elseif ($current_offset < 0) + $tzstring = 'UTC' . $current_offset; + else + $tzstring = 'UTC+' . $current_offset; + } + echo wp_timezone_choice($tzstring); + ?> + + + + 'sportspress_sport', + 'default' => 'custom', + 'type' => 'groupselect', + 'title' => __( 'Sport', 'sportspress' ), + 'class' => $class, + 'options' => $sport_options, + )); + SP_Admin_Settings::output_fields( $settings ); + ?> + +

-
-
-

-

-
    -
  • -
  • -
  • -
-
-
-

-

Translate SportsPress.', 'sportspress' ); ?>

- ' . $handle . ''; - endforeach; - ?> -

- -

-
+ +
+
+

+
-
- -
-
+
+ + intro(); ?> + +

Contribute to SportsPress.', 'sportspress' ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?>

+ + contributors(); ?> +
+ +
+ + intro(); ?> + +

Translate SportsPress.', 'sportspress' ), 'https://www.transifex.com/projects/p/sportspress/' ); ?>

+ ' . $handle . ''; + endforeach; + ?> +

+ +

+
+ get_contributors(); + + if ( empty( $contributors ) ) { + return ''; + } + + $contributor_list = ''; + + return $contributor_list; + } + + /** + * Retrieve list of contributors from GitHub. + * + * @access public + * @return mixed + */ + public function get_contributors() { + $contributors = get_transient( 'sportspress_contributors' ); + + if ( false !== $contributors ) { + return $contributors; + } + + $response = wp_remote_get( 'https://api.github.com/repos/ThemeBoy/SportsPress/contributors', array( 'sslverify' => false ) ); + + if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { + return array(); + } + + $contributors = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( ! is_array( $contributors ) ) { + return array(); + } + + set_transient( 'sportspress_contributors', $contributors, HOUR_IN_SECONDS ); + + return $contributors; + } + /** * Sends user to the welcome page on first activation */