Merge branch 'saas-showbuilder' of github.com:sourcefabric/airtime into saas-showbuilder
This commit is contained in:
commit
f7a7d4c042
5 changed files with 37 additions and 11 deletions
|
@ -75,10 +75,17 @@ function setupStartTimeWidgets() {
|
|||
$('#add_show_start_date').removeProp('disabled');
|
||||
$('#add_show_start_time').removeProp('disabled');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function calculateShowColor() {
|
||||
var bgColorEle = $("#add_show_background_color");
|
||||
var textColorEle = $("#add_show_color");
|
||||
var colorCode = stringToColor($('#add_show_start_time').val());//$(this).val());
|
||||
//bgColorEle.val(colorCode);
|
||||
//textColorEle.val(getContrastYIQ(colorCode));
|
||||
}
|
||||
|
||||
//$el is DOM element #add-show-form
|
||||
//form is the new form contents to append to $el
|
||||
function redrawAddShowForm($el, form) {
|
||||
|
@ -226,7 +233,10 @@ function intToRGB(i){
|
|||
|
||||
function stringToColor(s)
|
||||
{
|
||||
var palette = ['d56f42', 'aad542', '7242d5', '42d563', 'd542be'];
|
||||
var palette = ['42d5a1', '56bd99', '65ab93', '7b938b',
|
||||
'42a4d5', '569bbd', '6594ab', '7b8b93',
|
||||
'4264d5', '566fbd', '6576ab', '7b8193'];
|
||||
//var palette = ['d56f42', 'aad542', '7242d5', '42d563', 'd542be'];
|
||||
return palette[Math.abs(hashCode(s)) % palette.length];
|
||||
//return intToRGB(hashCode(s));
|
||||
}
|
||||
|
@ -943,13 +953,12 @@ function setAddShowEvents(form) {
|
|||
|
||||
// Since Zend's setAttrib won't apply through the wrapper, set accept=image/* here
|
||||
$("#add_show_logo").prop("accept", "image/*");
|
||||
var bgColorEle = $("#add_show_background_color");
|
||||
var textColorEle = $("#add_show_color");
|
||||
$('#add_show_name').bind('input', 'change', function(){
|
||||
var colorCode = stringToColor($(this).val());
|
||||
bgColorEle.val(colorCode);
|
||||
textColorEle.val(getContrastYIQ(colorCode));
|
||||
|
||||
//$('#add_show_name').bind('input', 'change', function(){
|
||||
$('#add_show_start_time').bind('input', 'change', function(){
|
||||
calculateShowColor();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showErrorSections() {
|
||||
|
|
|
@ -113,6 +113,7 @@ function dayClick(date, allDay, jsEvent, view){
|
|||
$("#add_show_start_time").val(startTime_string)
|
||||
$("#add_show_end_time").val(endTimeString)
|
||||
}
|
||||
calculateShowColor();
|
||||
$("#schedule-show-when").show();
|
||||
|
||||
openAddShowForm();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue