Complete refactoring and add style settings

This commit is contained in:
Brian Miyaji
2014-03-28 01:48:52 +11:00
parent d3b27c8c73
commit 7e6b4adb9b
83 changed files with 2063 additions and 7028 deletions

View File

@@ -0,0 +1,11 @@
jQuery(document).ready(function($){
// Dashboard countdown
$("#sportspress_dashboard_status .sp_status_list li.countdown").each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.find('strong').html(event.strftime("%D "+localized_strings.days+" %H:%M:%S"));
});
});
});

View File

@@ -0,0 +1,64 @@
jQuery(document).ready(function($){
// Display custom sport name field as needed
$("body.settings_page_sportspress #sportspress_sport").change(function() {
$target = $("#sportspress_custom_sport_name");
if ( $(this).val() == "custom" )
$target.show();
else
$target.hide();
});
// Color picker
$('.colorpick').iris( {
change: function(event, ui){
$(this).css( { backgroundColor: ui.color.toString() } );
},
hide: true,
border: true
} ).each( function() {
$(this).css( { backgroundColor: $(this).val() } );
})
.click(function(){
$('.iris-picker').hide();
$(this).closest('.sp-color-box, td').find('.iris-picker').show();
});
$('body').click(function() {
$('.iris-picker').hide();
});
$('.sp-color-box, .colorpick').click(function(event){
event.stopPropagation();
});
// Chosen select
$(".chosen-select").chosen({
allow_single_deselect: true,
single_backstroke_delete: false,
placeholder_text_multiple: localized_strings.none
});
// Preset field modifier
$(".sp-custom-input-wrapper .preset").click(function() {
val = $(this).val();
if(val == "\\c\\u\\s\\t\\o\\m") return true;
example = $(this).attr("data-example");
$(this).closest(".sp-custom-input-wrapper").find(".value").val(val).siblings(".example").html(example);
});
// Select custom preset when field is brought to focus
$(".sp-custom-input-wrapper .value").focus(function() {
$(this).siblings("label").find(".preset").prop("checked", true);
});
// Adjust example field when custom preset is entered
$(".sp-custom-input-wrapper .value").on("keyup", function() {
val = $(this).val();
if ( val === undefined ) return true;
format = $(this).attr("data-example-format");
example = format.replace("__val__", val);
$(this).siblings(".example").html(example);
});
});

View File

@@ -83,7 +83,7 @@ function viewport() {
original.wrap("<div class='sp-responsive-table-wrapper' />");
var copy = original.clone();
copy.find("td:not(.data-number):not(.data-name):not(.data-rank), th:not(.data-number):not(.data-name):not(.data-rank)").css("display", "none");
copy.find("td:not(.data-number):not(.data-name):not(.data-rank):not(.data-date), th:not(.data-number):not(.data-name):not(.data-rank):not(.data-date)").css("display", "none");
copy.removeClass("sp-responsive-table");
original.closest(".sp-responsive-table-wrapper").append(copy);