Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
95e2e68c
Commit
95e2e68c
authored
Jan 28, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor dmblack theme fix + a notify broadcasting fix
parent
e16621c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
14 deletions
+36
-14
combined.min.css
Web/htdocs/gui/css/combined.min.css
+1
-1
style.css
Web/htdocs/gui/css/style.css
+7
-1
common.php
Web/htdocs/gui/includes/common.php
+2
-2
combined.min.js
Web/htdocs/gui/js/combined.min.js
+7
-2
domotika.js
Web/htdocs/gui/js/domotika.js
+7
-2
domotika.py
domotika/domotika.py
+12
-6
No files found.
Web/htdocs/gui/css/combined.min.css
View file @
95e2e68c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Web/htdocs/gui/css/style.css
View file @
95e2e68c
...
...
@@ -103,6 +103,7 @@
color
:
#888
;
}
.drawers
{
background-color
:
#2e2e2e
;
color
:
#2e2e2e
;
...
...
@@ -273,6 +274,11 @@ input::-webkit-input-speech-button {
.notifybutton
:hover
{
background-color
:
#fff
;
}
.notify-item-theme-dmblack
.list-group-item-heading
,
.notify-item-theme-dmblack
.list-group-item-text
{
color
:
#888
!important
;
}
.speechbutton
{
background-image
:
url(/resources/img/microphone-little.png)
;
background-repeat
:
no-repeat
;
...
...
@@ -376,7 +382,7 @@ input::-webkit-input-speech-button {
.notifypanel
{
position
:
absolute
;
right
:
5px
;
bottom
:
3
0px
;
bottom
:
5
0px
;
box-shadow
:
-6px
-6px
8px
#999
;
width
:
300px
;
height
:
500px
;
...
...
Web/htdocs/gui/includes/common.php
View file @
95e2e68c
...
...
@@ -109,9 +109,9 @@ function addRight($file, $sobstitute=false)
$GLOBALS
[
'PAGE_BUFFER'
][
'right_drawer'
]
=
""
;
}
function
notifyListItem
()
function
notifyListItem
(
$addclass
=
''
)
{
$ret
=
'<a class="list-group-item notify-swipe-deletable" id="notifyid-[NID]" href="#">'
;
$ret
=
'<a class="list-group-item notify-swipe-deletable
'
.
$addclass
.
'
" id="notifyid-[NID]" href="#">'
;
$ret
.=
' <h4 class="list-group-item-heading">From: [NSOURCE]<i class="glyphicon glyphicon-remove pull-right notify-deletable"></i></h4>'
;
$ret
.=
' <p class="list-group-item-text">[NDATE]</p>'
;
$ret
.=
' <p class="list-group-item-text">[TXT]</p>'
;
...
...
Web/htdocs/gui/js/combined.min.js
View file @
95e2e68c
...
...
@@ -96,6 +96,10 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
var slideEnabled=<?=$_DOMOTIKA['slide']?>;
var speechEnabled='<?=$_DOMOTIKA["webspeech"]?>';
var notifyColor='#fff';
if('<?=$_DOMOTIKA["gui_theme"]?>'=='dmblack')
notifyColor='#000';
//var scroller = new AppScroll({
// toolbar: $('#topbar')[0],
// scroller: $('#content')[0]
...
...
@@ -218,6 +222,7 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
container: el,
trigger: "manual"});
console.debug(el.popover);
el.addClass('text-on-white-theme-<?=$_DOMOTIKA["gui_theme"]?>');
el.popover("show");
el.find(".popover-content").html(cont);
setTimeout(function(){el.popover("destroy")}, timeout);
...
...
@@ -416,7 +421,7 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
{
var nd = new Date(parseInt(ndate*1000));
var ndate=nd.toLocaleString();
var nli='<?=notifyListItem();?>';
var nli='<?=notifyListItem(
"notify-item-theme-".$_DOMOTIKA["gui_theme"]
);?>';
nli=nli.replace('[TXT]', text);
nli=nli.replace('[NDATE]', ndate);
nli=nli.replace('[NSOURCE]', source);
...
...
@@ -588,7 +593,7 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
{
$("#notifications").prepend(notifylistitem(nt.msg, nt.source, nt.nid, ts));
$("#notifyid-"+nt.nid).animate({backgroundColor: "#0080ff"},200);
$("#notifyid-"+nt.nid).animate({backgroundColor:
"#fff"
},3500);
$("#notifyid-"+nt.nid).animate({backgroundColor:
notifyColor
},3500);
}
playTTS("nuova notifica,"+nt.msg);
...
...
Web/htdocs/gui/js/domotika.js
View file @
95e2e68c
...
...
@@ -11,6 +11,10 @@
var
slideEnabled
=<
?
=
$_DOMOTIKA
[
'slide'
]?
>
;
var
speechEnabled
=
'<?=$_DOMOTIKA["webspeech"]?>'
;
var
notifyColor
=
'#fff'
;
if
(
'<?=$_DOMOTIKA["gui_theme"]?>'
==
'dmblack'
)
notifyColor
=
'#000'
;
//var scroller = new AppScroll({
// toolbar: $('#topbar')[0],
// scroller: $('#content')[0]
...
...
@@ -133,6 +137,7 @@
container
:
el
,
trigger
:
"manual"
});
console
.
debug
(
el
.
popover
);
el
.
addClass
(
'text-on-white-theme-<?=$_DOMOTIKA["gui_theme"]?>'
);
el
.
popover
(
"show"
);
el
.
find
(
".popover-content"
).
html
(
cont
);
setTimeout
(
function
(){
el
.
popover
(
"destroy"
)},
timeout
);
...
...
@@ -331,7 +336,7 @@
{
var
nd
=
new
Date
(
parseInt
(
ndate
*
1000
));
var
ndate
=
nd
.
toLocaleString
();
var
nli
=
'<?=notifyListItem();?>'
;
var
nli
=
'<?=notifyListItem(
"notify-item-theme-".$_DOMOTIKA["gui_theme"]
);?>'
;
nli
=
nli
.
replace
(
'[TXT]'
,
text
);
nli
=
nli
.
replace
(
'[NDATE]'
,
ndate
);
nli
=
nli
.
replace
(
'[NSOURCE]'
,
source
);
...
...
@@ -503,7 +508,7 @@
{
$
(
"#notifications"
).
prepend
(
notifylistitem
(
nt
.
msg
,
nt
.
source
,
nt
.
nid
,
ts
));
$
(
"#notifyid-"
+
nt
.
nid
).
animate
({
backgroundColor
:
"#0080ff"
},
200
);
$
(
"#notifyid-"
+
nt
.
nid
).
animate
({
backgroundColor
:
"#fff"
},
3500
);
$
(
"#notifyid-"
+
nt
.
nid
).
animate
({
backgroundColor
:
notifyColor
},
3500
);
}
playTTS
(
"nuova notifica,"
+
nt
.
msg
);
...
...
domotika/domotika.py
View file @
95e2e68c
...
...
@@ -1214,17 +1214,23 @@ class domotikaService(service.Service):
for
c
in
self
.
clients
.
getAll
():
try
:
if
c
[
'session'
]
.
mind
.
perms
.
username
==
username
:
self
.
clientSend
(
'notify'
,{
'msg'
:
msg
,
'nid'
:
res
.
id
,
'source'
:
res
.
source
})
self
.
clientSend
(
'notify'
,{
'msg'
:
msg
,
'nid'
:
res
.
id
,
'source'
:
res
.
source
}
,
c
[
'session'
]
)
except
:
pass
dmdb
.
insertNotify
(
nsource
,
username
,
msg
,
expiretime
)
.
addCallback
(
_inserted
)
def
clientSend
(
self
,
event
,
data
):
for
c
in
self
.
clients
.
getAll
():
def
clientSend
(
self
,
event
,
data
,
session
=
False
):
if
not
session
:
for
c
in
self
.
clients
.
getAll
():
try
:
#if not 'ts' in data.keys():
# data['ts'] = float(time.time())
c
[
'session'
]
.
sse
.
sendJSON
(
event
=
event
,
data
=
data
)
except
:
pass
else
:
try
:
#if not 'ts' in data.keys():
# data['ts'] = float(time.time())
c
[
'session'
]
.
sse
.
sendJSON
(
event
=
event
,
data
=
data
)
session
.
sse
.
sendJSON
(
event
=
event
,
data
=
data
)
except
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment