Complete refactoring and add style settings
This commit is contained in:
@@ -68,9 +68,58 @@
|
||||
.sportspress table.form-table, .sportspress table.form-table .forminp-radio ul {
|
||||
margin: 0;
|
||||
}
|
||||
.sportspress table.form-table fieldset {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.sportspress table.form-table fieldset:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.sportspress table.form-table fieldset p.description {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.sportspress table.sp-admin-config-table .edit {
|
||||
text-align: right;
|
||||
}
|
||||
.sportspress table.form-table .sp-color-box {
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
padding: 4px 6px;
|
||||
float: left;
|
||||
width: 90px;
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
.sportspress table.form-table .sp-color-box strong {
|
||||
text-align: left;
|
||||
display: block;
|
||||
padding: 0 0 2px;
|
||||
font-size: .92em;
|
||||
}
|
||||
.sportspress table.form-table .sp-color-box input.colorpick {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
font-family: monospace;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.sportspress table.form-table .sp-color-box .iris-picker {
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
display: none;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2);
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
margin: 15px 0 0 -7px;
|
||||
}
|
||||
|
||||
/* Messages */
|
||||
.sportspress-message {
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
.sp-responsive-table .data-number,
|
||||
.sp-responsive-table .data-name,
|
||||
.sp-responsive-table .data-rank,
|
||||
.sp-responsive-table .data-date,
|
||||
.sp-responsive-.sp-pinned-table td {
|
||||
display: none;
|
||||
}
|
||||
|
||||
11
assets/js/admin/dashboard.js
Normal file
11
assets/js/admin/dashboard.js
Normal 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"));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
64
assets/js/admin/settings.js
Normal file
64
assets/js/admin/settings.js
Normal 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);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user