Merge branch 'saas-showbuilder-fade-editor-restyling' into saas-dev
This commit is contained in:
commit
84a1f9071b
5 changed files with 51 additions and 26 deletions
|
@ -24,7 +24,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function isFadeValid(fade) {
|
||||
var regExpr = new RegExp("^\\d{1}(\\d{1})?([.]\\d{1})?$");
|
||||
var regExpr = new RegExp("^[0-9]+(\\.\\d+)?$");
|
||||
|
||||
return regExpr.test(fade);
|
||||
}
|
||||
|
@ -246,8 +246,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
showError(span, $.i18n._("Please enter a valid time in seconds. Eg. 0.5"));
|
||||
return;
|
||||
} else {
|
||||
hideError(span);
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
|
@ -284,8 +286,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
showError(span, $.i18n._("Please enter a valid time in seconds. Eg. 0.5"));
|
||||
return;
|
||||
} else {
|
||||
hideError(span);
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
|
@ -773,15 +777,18 @@ var AIRTIME = (function(AIRTIME){
|
|||
playlistError(json);
|
||||
}
|
||||
else {
|
||||
var fadeIn = $pl.find("span.spl_main_fade_in");
|
||||
var fadeIn = $pl.find("input.spl_main_fade_in");
|
||||
var fadeOut = $pl.find("span.spl_main_fade_out");
|
||||
if (json.fadeIn == null) {
|
||||
fadeIn.parent().prev().hide();
|
||||
fadeIn.hide();
|
||||
} else {
|
||||
console.log(json.fadeIn);
|
||||
//console.log(fadeIn.val());
|
||||
fadeIn.parent().prev().show();
|
||||
fadeIn.show();
|
||||
fadeIn.empty().append(json.fadeIn);
|
||||
fadeIn.val(json.fadeIn);
|
||||
fadeIn.text(json.fadeIn);
|
||||
}
|
||||
if (json.fadeOut == null) {
|
||||
fadeOut.parent().prev().hide();
|
||||
|
@ -799,48 +806,51 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
});
|
||||
|
||||
$pl.on("blur", "span.spl_main_fade_in", function(event){
|
||||
$pl.on("blur", "input.spl_main_fade_in", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = baseUrl+"playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeIn = $.trim(span.text()),
|
||||
input = $(this),
|
||||
fadeIn = $.trim(input.val()),
|
||||
lastMod = mod.getModified(),
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
showError(input, $.i18n._("Please enter a valid time in seconds. Eg. 0.5"));
|
||||
return;
|
||||
} else {
|
||||
hideError(input);
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
{format: "json", fadeIn: fadeIn, modified: lastMod, type: type},
|
||||
function(json){
|
||||
hideError(span);
|
||||
hideError(input);
|
||||
if (json.modified !== undefined) {
|
||||
mod.setModified(json.modified);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$pl.on("blur", "span.spl_main_fade_out", function(event){
|
||||
$pl.on("blur", "input.spl_main_fade_out", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = baseUrl+"playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeOut = $.trim(span.text()),
|
||||
input = $(this),
|
||||
fadeOut = $.trim(input.val()),
|
||||
lastMod = mod.getModified(),
|
||||
type = $pl.find('.obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
showError(input, $.i18n._("Please enter a valid time in seconds. Eg. 0.5"));
|
||||
return;
|
||||
} else {
|
||||
hideError(input);
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
{format: "json", fadeOut: fadeOut, modified: lastMod, type: type},
|
||||
function(json){
|
||||
hideError(span);
|
||||
hideError(input);
|
||||
if (json.modified !== undefined) {
|
||||
mod.setModified(json.modified);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue