Skip to content

Commit 2537c7c

Browse files
committed
fixed ' ' bug in manual timer-card edit; smaller fixes;
1 parent 7f824a5 commit 2537c7c

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

www/css/sepiaFW-skin-flaming-squirrel.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ html {
4545
#sepiaFW-nav-menu-go-right {
4646
color: #ffdd64 !important;
4747
}
48+
#sepiaFW-nav-users-btn.marked::after {
49+
color: #5957e8;
50+
}
4851

4952
#sepiaFW-login-box button {
5053
background: linear-gradient(to right, #ffdd64 0%, #ff983a 100%);

www/scripts/sepiaFW.client.controls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ function sepiaFW_build_client_controls(sepiaSessionId){
490490
if (shortcutFun){
491491
cmdData = shortcutFun(cmdData);
492492
}else{
493-
cmdData = undefined;
494493
SepiaFW.debug.error("Client controls - Runtime-Commands missing shortcut for: " + cmdData.shortcut);
494+
cmdData = undefined;
495495
}
496496
}
497497
//console.error(cmdData); //DEBUG

www/scripts/sepiaFW.ui.cards.js

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,17 @@ function sepiaFW_build_ui_cards(){
555555
$(this).on('focusout', function(){
556556
//update data
557557
var newName = $(this).text().trim();
558+
var eleData = JSON.parse($listEle.attr('data-element'));
558559
if (newName){
559-
var eleData = JSON.parse($listEle.attr('data-element'));
560+
newName = (newName.length > 320)? (newName.substring(0,319) + "...") : newName; //brutally shorten name - TODO: improve
560561
eleData.name = newName;
561-
$(this).text(newName);
562+
$(this).text(eleData.name);
562563
$listEle.attr('data-element', JSON.stringify(eleData));
563564
//activate save button
564565
var $saveBtn = $listBody.parent().find('.sepiaFW-cards-list-saveBtn'); //note: we need to load the button here
565566
$saveBtn.addClass('active'); //saveBtn.css({"opacity": 0.92, "color": saveBtn.parent().css("color")});
567+
}else{
568+
$(this).text(eleData.name);
566569
}
567570
});
568571
$(this).keypress(function(event){
@@ -759,24 +762,27 @@ function sepiaFW_build_ui_cards(){
759762
var dataString = $(timeEvent).attr('data-element');
760763
if (dataString){
761764
var eleData = JSON.parse(dataString);
762-
var newName = $(this).html();
763-
newName = newName.replace(/<br>|<div>|<\/div>/g, "").trim(); //happens when the user presses enter(?)
764-
newName = newName.replace(/-|_|!|\?|,|\.|'/g, " ").trim(); //remove some special chars
765-
newName = (newName.length > 100)? newName.substring(0,99) : newName; //brutally shorten name - TODO: improve
766-
eleData.name = newName.trim();
767-
$(this).html(eleData.name);
768-
$(timeEvent).attr('data-element', JSON.stringify(eleData));
769-
//update stored TIMER
770-
var Timer = SepiaFW.events.getRunningOrActivatedTimeEventById(eleData.eventId);
771-
if (Timer){
772-
eleData.lastChange = new Date().getTime();
773-
Timer.data = eleData;
774-
//trigger auto-save
775-
SepiaFW.events.scheduleTimeEventsSync(eleData.eleType);
765+
var newName = $(this).text().trim();
766+
if (newName){
767+
//newName = newName.replace(/-|_|!|\?|,|\.|'/g, " ").trim(); //remove some special chars (?)
768+
newName = (newName.length > 100)? (newName.substring(0,99) + "..."): newName; //brutally shorten name - TODO: improve
769+
eleData.name = newName.trim();
770+
$(this).text(eleData.name);
771+
$(timeEvent).attr('data-element', JSON.stringify(eleData));
772+
//update stored TIMER
773+
var Timer = SepiaFW.events.getRunningOrActivatedTimeEventById(eleData.eventId);
774+
if (Timer){
775+
eleData.lastChange = new Date().getTime();
776+
Timer.data = eleData;
777+
//trigger auto-save
778+
SepiaFW.events.scheduleTimeEventsSync(eleData.eleType);
779+
}
780+
//activate save button
781+
var saveBtn = $(this).closest('.sepiaFW-cards-flexSize-container').find('.sepiaFW-cards-list-saveBtn');
782+
saveBtn.addClass('active');
783+
}else{
784+
$(this).text(eleData.name);
776785
}
777-
//activate save button
778-
var saveBtn = $(this).closest('.sepiaFW-cards-flexSize-container').find('.sepiaFW-cards-list-saveBtn');
779-
saveBtn.addClass('active');
780786
}
781787
});
782788
timerEventName.keypress(function(event){

0 commit comments

Comments
 (0)