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
ee6d082a
Commit
ee6d082a
authored
Feb 05, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make analog progress bar show color and value in ajax
parent
4a1431a7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
22 deletions
+99
-22
analog.php
Web/htdocs/gui/buttons/analog.php
+8
-4
combined.min.js
Web/htdocs/gui/js/combined.min.js
+38
-2
domotika.js
Web/htdocs/gui/js/domotika.js
+37
-1
graph.php
Web/htdocs/gui/panels/content/graph.php
+1
-1
jquery.alterclass.js
Web/resources/js/jquery.alterclass.js
+15
-14
No files found.
Web/htdocs/gui/buttons/analog.php
View file @
ee6d082a
...
@@ -34,8 +34,9 @@ $perc=(floatval($button['status'])-floatval($button['minval']))*100/(floatval($b
...
@@ -34,8 +34,9 @@ $perc=(floatval($button['status'])-floatval($button['minval']))*100/(floatval($b
data-dmcolor-med=
"
<?=
$pbcoln
.
$dmcolors
[
$button
[
'color_medium'
]]
?>
"
data-dmcolor-high=
"
<?=
$pbcoln
.
$dmcolors
[
$button
[
'color_high'
]]
?>
"
data-dmcolor-med=
"
<?=
$pbcoln
.
$dmcolors
[
$button
[
'color_medium'
]]
?>
"
data-dmcolor-high=
"
<?=
$pbcoln
.
$dmcolors
[
$button
[
'color_high'
]]
?>
"
data-dmval-min=
"
<?=
floatval
(
$button
[
'minval'
])
?>
"
data-dmval-low=
"
<?=
floatval
(
$button
[
'lowval'
])
?>
"
data-dmval-min=
"
<?=
floatval
(
$button
[
'minval'
])
?>
"
data-dmval-low=
"
<?=
floatval
(
$button
[
'lowval'
])
?>
"
data-dmval-high=
"
<?=
floatval
(
$button
[
'highval'
])
?>
"
data-dmval-max=
"
<?=
floatval
(
$button
[
'maxval'
])
?>
"
data-dmval-high=
"
<?=
floatval
(
$button
[
'highval'
])
?>
"
data-dmval-max=
"
<?=
floatval
(
$button
[
'maxval'
])
?>
"
data-dmval-divider=
"
<?=
floatval
(
$button
[
'divider'
])
?>
"
data-domotika-anaprog=
"
<?=
$button
[
'id'
]
?>
"
>
data-domotika-anaprog=
"
<?=
$button
[
'id'
]
?>
"
>
<span
class=
"sr-only"
>
<?=
floatval
(
$button
[
'status'
])
/
$button
[
'divider'
]
?>
</span>
<span
class=
"sr-only"
data-domotika-anat=
"
<?=
$button
[
'id'
]
?>
"
data-dmval-divider=
"
<?=
floatval
(
$button
[
'divider'
])
?>
"
>
<?=
floatval
(
$button
[
'status'
])
/
$button
[
'divider'
]
?>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -43,7 +44,10 @@ $perc=(floatval($button['status'])-floatval($button['minval']))*100/(floatval($b
...
@@ -43,7 +44,10 @@ $perc=(floatval($button['status'])-floatval($button['minval']))*100/(floatval($b
<button
class=
"btn devlist-button
<?=
$btncol
?>
"
data-domotika-anaid=
"
<?=
$button
[
'id'
]
?>
"
<button
class=
"btn devlist-button
<?=
$btncol
?>
"
data-domotika-anaid=
"
<?=
$button
[
'id'
]
?>
"
data-dmcolor-min=
"btn-
<?=
$dmcolors
[
$button
[
'color_min'
]]
?>
"
data-dmcolor-low=
"btn-
<?=
$dmcolors
[
$button
[
'color_low'
]]
?>
"
data-dmcolor-min=
"btn-
<?=
$dmcolors
[
$button
[
'color_min'
]]
?>
"
data-dmcolor-low=
"btn-
<?=
$dmcolors
[
$button
[
'color_low'
]]
?>
"
data-dmcolor-med=
"btn-
<?=
$dmcolors
[
$button
[
'color_medium'
]]
?>
"
data-dmcolor-high=
"btn-
<?=
$dmcolors
[
$button
[
'color_high'
]]
?>
"
data-dmcolor-med=
"btn-
<?=
$dmcolors
[
$button
[
'color_medium'
]]
?>
"
data-dmcolor-high=
"btn-
<?=
$dmcolors
[
$button
[
'color_high'
]]
?>
"
><span>
<?=
$button
[
'unit'
]
?>
:
</span>
<span>
<?=
floatval
(
$button
[
'status'
])
/
$button
[
'divider'
]
?>
</span></button>
data-dmval-min=
"
<?=
floatval
(
$button
[
'minval'
])
?>
"
data-dmval-low=
"
<?=
floatval
(
$button
[
'lowval'
])
?>
"
data-dmval-high=
"
<?=
floatval
(
$button
[
'highval'
])
?>
"
data-dmval-max=
"
<?=
floatval
(
$button
[
'maxval'
])
?>
"
><span>
<?=
$button
[
'unit'
]
?>
:
</span>
<span
data-dmval-divider=
"
<?=
floatval
(
$button
[
'divider'
])
?>
"
data-domotika-anab=
"
<?=
$button
[
'id'
]
?>
"
>
<?=
floatval
(
$button
[
'status'
])
/
$button
[
'divider'
]
?>
</span></button>
</div>
<!-- devlist-rightpart-->
</div>
<!-- devlist-rightpart-->
</div>
<!-- devlist-row -->
</div>
<!-- devlist-row -->
</div>
<!-- devlist item -->
</div>
<!-- devlist item -->
Web/htdocs/gui/js/combined.min.js
View file @
ee6d082a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Web/htdocs/gui/js/domotika.js
View file @
ee6d082a
...
@@ -478,9 +478,45 @@
...
@@ -478,9 +478,45 @@
);
);
$
(
"[data-domotika-anaid="
+
val
[
0
]
+
"]"
).
each
(
$
(
"[data-domotika-anaid="
+
val
[
0
]
+
"]"
).
each
(
function
()
{
function
()
{
console
.
debug
(
"anaid"
);
if
(
val
[
1
]
<=
$
(
this
).
attr
(
'data-dmval-min'
))
{
$
(
this
).
alterClass
(
'btn-*'
,
$
(
this
).
attr
(
'data-dmcolor-min'
));
}
else
if
(
val
[
1
]
<=
$
(
this
).
attr
(
'data-dmval-low'
))
{
$
(
this
).
alterClass
(
'btn-*'
,
$
(
this
).
attr
(
'data-dmcolor-low'
));
}
else
if
(
val
[
1
]
<
$
(
this
).
attr
(
'data-dmval-high'
))
{
$
(
this
).
alterClass
(
'btn-*'
,
$
(
this
).
attr
(
'data-dmcolor-med'
));
}
else
if
(
val
[
1
]
>=
$
(
this
).
attr
(
'data-dmval-high'
))
{
$
(
this
).
alterClass
(
'btn-*'
,
$
(
this
).
attr
(
'data-dmcolor-high'
));
}
}
);
$
(
"[data-domotika-anaprog="
+
val
[
0
]
+
"]"
).
each
(
function
()
{
if
(
val
[
1
]
<=
$
(
this
).
attr
(
'data-dmval-min'
))
{
$
(
this
).
alterClass
(
'progress-bar-*'
,
$
(
this
).
attr
(
'data-dmcolor-min'
));
}
else
if
(
val
[
1
]
<=
$
(
this
).
attr
(
'data-dmval-low'
))
{
$
(
this
).
alterClass
(
'progress-bar-*'
,
$
(
this
).
attr
(
'data-dmcolor-low'
));
}
else
if
(
val
[
1
]
<
$
(
this
).
attr
(
'data-dmval-high'
))
{
$
(
this
).
alterClass
(
'progress-bar-*'
,
$
(
this
).
attr
(
'data-dmcolor-med'
));
}
else
if
(
val
[
1
]
>=
$
(
this
).
attr
(
'data-dmval-high'
))
{
$
(
this
).
alterClass
(
'progress-bar-*'
,
$
(
this
).
attr
(
'data-dmcolor-high'
));
}
}
}
);
);
$
(
"[data-domotika-anat="
+
val
[
0
]
+
"]"
).
each
(
function
()
{
v
=
val
[
1
]
/
$
(
this
).
attr
(
'data-dmval-divider'
);
$
(
this
).
text
(
v
);
}
);
$
(
"[data-domotika-anab="
+
val
[
0
]
+
"]"
).
each
(
function
()
{
v
=
val
[
1
]
/
$
(
this
).
attr
(
'data-dmval-divider'
);
$
(
this
).
text
(
v
);
}
);
break
;
break
;
case
'action'
:
case
'action'
:
...
...
Web/htdocs/gui/panels/content/graph.php
View file @
ee6d082a
...
@@ -42,7 +42,7 @@ if($panel && is_array($panel)) {
...
@@ -42,7 +42,7 @@ if($panel && is_array($panel)) {
//print_r($chart);
//print_r($chart);
$_SESSION
[
'PANELS_CHARTS'
][
$chart
[
'name'
]
.
"-"
.
$panel
[
'id'
]]
=
$chart
;
$_SESSION
[
'PANELS_CHARTS'
][
$chart
[
'name'
]
.
"-"
.
$panel
[
'id'
]]
=
$chart
;
?>
?>
<div
id=
"
<?=
$chart
[
'name'
]
.
"-"
.
$panel
[
'id'
]
?>
"
style=
"height:200px;width:550px"
>
<
?=
$chart
[
'name'
]
?>
<
/div>
<div
id=
"
<?=
$chart
[
'name'
]
.
"-"
.
$panel
[
'id'
]
?>
"
style=
"height:200px;width:550px"
></div>
<?
<?
}
?>
}
?>
</div>
</div>
...
...
Web/resources/js/jquery.alterclass.js
View file @
ee6d082a
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
$
.
fn
.
alterClass
=
function
(
removals
,
additions
)
{
$
.
fn
.
alterClass
=
function
(
removals
,
additions
)
{
var
self
=
this
;
var
self
=
this
;
if
(
typeof
(
removals
)
!=
'undefined'
)
{
if
(
removals
.
indexOf
(
'*'
)
===
-
1
)
{
if
(
removals
.
indexOf
(
'*'
)
===
-
1
)
{
// Use native jQuery methods if there is no wildcard matching
// Use native jQuery methods if there is no wildcard matching
self
.
removeClass
(
removals
);
self
.
removeClass
(
removals
);
...
@@ -34,6 +34,7 @@ $.fn.alterClass = function ( removals, additions ) {
...
@@ -34,6 +34,7 @@ $.fn.alterClass = function ( removals, additions ) {
}
}
it
.
className
=
$
.
trim
(
cn
);
it
.
className
=
$
.
trim
(
cn
);
});
});
}
return
!
additions
?
self
:
self
.
addClass
(
additions
);
return
!
additions
?
self
:
self
.
addClass
(
additions
);
};
};
...
...
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