Skip to content

Commit 0df8770

Browse files
committed
added drag and drop module and added to lists
1 parent 5e480a3 commit 0df8770

File tree

11 files changed

+556
-85
lines changed

11 files changed

+556
-85
lines changed

www/css/sepiaFW-cards.css

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@
5959

6060
/* ------ Lists ------ */
6161

62+
/* commons */
63+
.sepiaFW-list-drag-dummy {
64+
position: fixed;
65+
pointer-events: none;
66+
background: rgba(125, 125, 125, 0.5);
67+
margin: 0;
68+
padding: 0;
69+
z-index: 999;
70+
}
71+
.sepiaFW-list-hover-over {
72+
opacity: 0.5;
73+
}
74+
6275
/* header */
6376
.sepiaFW-cards-list-title {
6477
display: flex;
@@ -94,9 +107,9 @@
94107
padding: 4px 12px !important;
95108
}
96109
.sepiaFW-cards-list-contextMenu {
97-
position: absolute;
110+
/*position: absolute;
98111
top: 38px;
99-
right: 0px;
112+
right: 0px;*/
100113
line-height: 17px;
101114
font-size: 13px;
102115
display: none;
@@ -148,7 +161,7 @@
148161
.sepiaFW-cards-list-body {
149162
margin: 0px;
150163
padding: 0px;
151-
min-height: 5px;
164+
min-height: 25px;
152165
padding-bottom: 5px;
153166
}
154167
.sepiaFW-cards-list-body .listElement {
@@ -159,6 +172,20 @@
159172
.sepiaFW-cards-list-body .listElement:first-child {
160173
margin-top: 3px;
161174
}
175+
.sepiaFW-cards-list-body .listElement.draggable-toggle {
176+
opacity: 0.6;
177+
}
178+
.sepiaFW-cards-list-body .listElement.dragging {
179+
opacity: 0.2;
180+
}
181+
.sepiaFW-cards-list-body .listElement.new-position {
182+
animation: list-pulse .500s 1;
183+
}
184+
@keyframes list-pulse {
185+
0% { opacity: 0.2; }
186+
33% { opacity: 0.05; }
187+
100% { opacity: 1.0; }
188+
}
162189
.sepiaFW-cards-list-body .listElement div {
163190
background: rgba(255, 255, 255, 0.90);
164191
border-radius: 0px;
@@ -207,7 +234,7 @@
207234
background: rgba(0, 255, 255, 0.50);
208235
}
209236
.sepiaFW-cards-list-body .listElement .unchecked {
210-
background: rgba(255, 255, 255, 0.90);
237+
/*background: rgba(255, 255, 255, 0.90);*/
211238
}
212239
.sepiaFW-notouch-device .sepiaFW-cards-list-body .listElement .unchecked:hover {
213240
background: rgba(0, 255, 0, 0.50);

www/css/sepiaFW-style.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ body {
651651
padding: 4px 8px 59px 8px;
652652
height: calc(100% - 50px);
653653
width: calc(100% - 0px);
654-
overflow: auto;
654+
overflow: hidden; /*scrolling happens inside the carousel*/
655655
-webkit-overflow-scrolling: touch;
656656
font-size: 21px;
657657
text-align: center;
@@ -767,7 +767,8 @@ body {
767767
position: relative;
768768
height: 100%;
769769
width: 100%;
770-
overflow: auto;
770+
overflow-y: auto;
771+
overflow-y: overlay;
771772
}
772773
#sepiaFW-chat-menu ul {
773774
/*display: inline-block;*/
@@ -1429,7 +1430,8 @@ body {
14291430
#sepiaFW-chat-output {
14301431
/*height: calc(100vh - 146px);*/
14311432
width: 100%;
1432-
overflow: auto;
1433+
overflow-y: auto;
1434+
overflow-y: overlay;
14331435
-webkit-overflow-scrolling: touch;
14341436
padding: 8px 2px 2px 2px;
14351437
/*padding-bottom: 62px;*/
@@ -1447,7 +1449,8 @@ body {
14471449
flex-direction: column;*/
14481450
padding: 2px 2px;
14491451
/*padding-bottom: 62px;*/
1450-
overflow: auto;
1452+
overflow-y: auto;
1453+
overflow-y: overlay;
14511454
-webkit-overflow-scrolling: touch;
14521455
}
14531456
.sepiaFW-results-container:after {

www/index.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ <h2>Active users</h2>
204204
</div>
205205
<!-- Swipe bars -->
206206
<div id='sepiaFW-swipeBar-container-left' class='sepiaFW-swipeBar-container'>
207-
<div id='sepiaFW-swipeBar-chat-left' class='sepiaFW-swipeBar-switchable'></div>
208-
<div id='sepiaFW-swipeBar-menu-left' class='sepiaFW-swipeBar-switchable'></div>
209-
<div id='sepiaFW-swipeBar-teach-left' class='sepiaFW-swipeBar-switchable'></div>
210-
<div id='sepiaFW-swipeBar-frames-left' class='sepiaFW-swipeBar-switchable'></div>
207+
<div id='sepiaFW-swipeBar-chat-left' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
208+
<div id='sepiaFW-swipeBar-menu-left' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
209+
<div id='sepiaFW-swipeBar-teach-left' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
210+
<div id='sepiaFW-swipeBar-frames-left' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
211211
</div>
212212
<div id='sepiaFW-swipeBar-container-right' class='sepiaFW-swipeBar-container'>
213-
<div id='sepiaFW-swipeBar-chat-right' class='sepiaFW-swipeBar-switchable'></div>
214-
<div id='sepiaFW-swipeBar-menu-right' class='sepiaFW-swipeBar-switchable'></div>
215-
<div id='sepiaFW-swipeBar-teach-right' class='sepiaFW-swipeBar-switchable'></div>
216-
<div id='sepiaFW-swipeBar-frames-right' class='sepiaFW-swipeBar-switchable'></div>
213+
<div id='sepiaFW-swipeBar-chat-right' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
214+
<div id='sepiaFW-swipeBar-menu-right' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
215+
<div id='sepiaFW-swipeBar-teach-right' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
216+
<div id='sepiaFW-swipeBar-frames-right' class='sepiaFW-swipeBar-switchable' oncontextmenu='return false;'></div>
217217
</div>
218218
<!-- top and bottom swipe bars are usually in conflict with OS
219219
<div id="sepiaFW-swipeBar-container-top" class='sepiaFW-swipeBar-container'></div>
@@ -276,6 +276,7 @@ <h2>Active users</h2>
276276
<script src="scripts/sepiaFW.ui.animate.js"></script>
277277
<script src="scripts/sepiaFW.ui.notify.js"></script>
278278
<script src="scripts/sepiaFW.ui.carousel.js"></script>
279+
<script src="scripts/sepiaFW.ui.dragDrop.js"></script>
279280
<script src="scripts/sepiaFW.ui.events.js"></script>
280281
<script src="scripts/sepiaFW.ui.actions.js"></script>
281282
<script src="scripts/sepiaFW.ui.cards.js"></script>

www/scripts/sepiaFW.account.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,13 @@ function sepiaFW_build_account(){
816816
//set, get or delete data
817817
function dataTransfer(apiUrl, key, data, successCallback, errorCallback, debugCallback){
818818
SepiaFW.ui.showLoader();
819+
//Demo mode?
820+
if (SepiaFW.client.isDemoMode()){
821+
SepiaFW.ui.showPopup(SepiaFW.local.g('notPossibleInDemoMode'));
822+
SepiaFW.ui.hideLoader();
823+
return;
824+
}
825+
//Authenticated?
819826
if (key){
820827
data.KEY = key;
821828
}else if (userId && userToken){

www/scripts/sepiaFW.app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SepiaFW.buildSepiaFwPlugins = function(){
1313
SepiaFW.ui = sepiaFW_build_ui();
1414
SepiaFW.animate = sepiaFW_build_animate();
1515
SepiaFW.ui.Carousel = sepiaFW_build_ui_carousel();
16+
SepiaFW.ui.dragDrop = sepiaFW_build_ui_drag_and_drop();
1617
SepiaFW.ui.notification = sepiaFW_build_ui_notifications();
1718
SepiaFW.ui.build = sepiaFW_build_ui_build();
1819
SepiaFW.ui.cards = sepiaFW_build_ui_cards();

www/scripts/sepiaFW.local.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function sepiaFW_build_strings(){
8989
StringsDE.data_privacy = 'Datenschutz';
9090
StringsDE.tutorial = 'Tutorial';
9191
//Offline demo texts
92-
StringsDE.demoMode = 'Du befindest dich im Demo-Modus! In diesem Modus kannst du die Einstellungen ändern (z.B. host-name) und das Tutorial anschauen. Um auf deinen Assistenten zuzugreifen melde dich bitte zuerst an.';
92+
StringsDE.demoMode = 'Du befindest dich im Demo-Modus! In diesem Modus kannst du die Einstellungen ändern (z.B. host-name), das Tutorial anschauen und mit dem Interface spielen. Um auf deinen Assistenten zuzugreifen melde dich bitte zuerst an.';
93+
StringsDE.notPossibleInDemoMode = 'Sorry aber das geht nicht im Demo-Modus.';
9394
StringsDE.demoModeBtn = 'Demo-Modus';
9495
StringsDE.myNewsDemoBtn = 'Öffne meine persönlichen News';
9596
StringsDE.myRadioDemoBtn = 'Starte mein Lieblingsradio';
@@ -178,7 +179,8 @@ function sepiaFW_build_strings(){
178179
StringsEN.data_privacy = 'Data privacy';
179180
StringsEN.tutorial = 'Tutorial';
180181
//Offline demo texts
181-
StringsEN.demoMode = 'You are in demo-mode! This mode only allows you to change settings (e.g. host-name) and check out the tutorial. To get access to your assistant please log-in first.';
182+
StringsEN.demoMode = 'You are in demo-mode! This mode only allows you to change settings (e.g. host-name), check out the tutorial and play a bit with the UI. To get access to your assistant please log-in first.';
183+
StringsEN.notPossibleInDemoMode = 'Sorry this is not possible in demo-mode.';
182184
StringsEN.demoModeBtn = 'Demo-Mode';
183185
StringsEN.myNewsDemoBtn = 'Open my personal news';
184186
StringsEN.myRadioDemoBtn = 'Start my favorite radio station';

www/scripts/sepiaFW.offline.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,15 @@ function sepiaFW_build_offline(){
7676
var dateAdded = new Date().getTime();
7777
var id = id || ("ABCD" + dateAdded); //usually this is defined by database id generator
7878
var data = listData || [{
79-
"name": "Checked entry 1",
80-
"checked": true,
81-
"dateAdded": dateAdded
79+
"name": "Checked entry 1", "checked": true, "dateAdded": dateAdded
8280
}, {
83-
"name": "Open entry 1",
84-
"checked": false,
85-
"dateAdded": dateAdded
81+
"name": "Open entry 1", "checked": false, "dateAdded": dateAdded
8682
}, {
87-
"name": "Open entry 2",
88-
"checked": false,
89-
"dateAdded": dateAdded
83+
"name": "Open entry 2", "checked": false, "dateAdded": dateAdded
84+
}, {
85+
"name": "Checked entry 2", "checked": false, "dateAdded": dateAdded
86+
}, {
87+
"name": "Open entry 3", "checked": false, "dateAdded": dateAdded
9088
}];
9189
var user = "userid";
9290

@@ -150,7 +148,7 @@ function sepiaFW_build_offline(){
150148
if (SepiaFW.embedded && SepiaFW.embedded.services){
151149
serviceResult = SepiaFW.embedded.services.answerMessage(input, nluResult);
152150
}
153-
console.log(serviceResult); //DEBUG
151+
//console.log(serviceResult); //DEBUG
154152
}
155153
if (!serviceResult || !serviceResult.result == "success"){
156154
//just repeat input

0 commit comments

Comments
 (0)