Basic working application
parent
5e51139252
commit
40ddfb39fd
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#card-box .col {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(".card_qwikclock_punchinout").on("click", ".start_btn", function () {
|
||||||
|
var parent = $(this).parents(".card_app");
|
||||||
|
var url = parent.data("apiurl");
|
||||||
|
console.log(url + " " + getuser());
|
||||||
|
$.post(url, {
|
||||||
|
username: getuser(),
|
||||||
|
password: getAPIKey(),
|
||||||
|
action: "punchin"
|
||||||
|
}, function (resp) {
|
||||||
|
if (resp.status == "OK") {
|
||||||
|
showmsg(resp.msg, "success");
|
||||||
|
} else {
|
||||||
|
showmsg(resp.msg, "danger");
|
||||||
|
}
|
||||||
|
}, "json");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".card_qwikclock_punchinout").on("click", ".stop_btn", function () {
|
||||||
|
var parent = $(this).parents(".card_app");
|
||||||
|
var url = parent.data("apiurl");
|
||||||
|
console.log(url + " " + getuser());
|
||||||
|
$.post(url, {
|
||||||
|
username: getuser(),
|
||||||
|
password: getAPIKey(),
|
||||||
|
action: "punchout"
|
||||||
|
}, function (resp) {
|
||||||
|
if (resp.status == "OK") {
|
||||||
|
showmsg(resp.msg, "success");
|
||||||
|
} else {
|
||||||
|
showmsg(resp.msg, "danger");
|
||||||
|
}
|
||||||
|
}, "json");
|
||||||
|
});
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(".card_taskfloor_viewmessages").each(function () {
|
||||||
|
$(this).find(".card_title").append(" Messages");
|
||||||
|
var msglist = $(this).find(".message-list");
|
||||||
|
var url = $(this).data("apiurl");
|
||||||
|
$.post(url, {
|
||||||
|
username: getuser(),
|
||||||
|
password: getAPIKey(),
|
||||||
|
action: "getmsgs"
|
||||||
|
}, function (resp) {
|
||||||
|
if (resp.status == "OK") {
|
||||||
|
var msgs = resp.messages;
|
||||||
|
for (var msg in msgs) {
|
||||||
|
msglist.append(
|
||||||
|
'<div class="list-group-item">'
|
||||||
|
+ '<small>' + msgs[msg]['from']['name'] + ' <i class="fas fa-caret-right"></i> ' + msgs[msg]['to']['name'] + '</small>'
|
||||||
|
+ '<p class="mb-1">' + msgs[msg]['text'] + '</p>'
|
||||||
|
+ '<small>' + msgs[msg]['sent'] + '</small>'
|
||||||
|
+ '</div>');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showmsg(resp.msg, "danger");
|
||||||
|
}
|
||||||
|
}, "json");
|
||||||
|
});
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$(".card_taskfloor_viewtasks").each(function () {
|
||||||
|
$(this).find(".card_title").append(" Tasks");
|
||||||
|
var tasklist = $(this).find(".task-list");
|
||||||
|
var url = $(this).data("apiurl");
|
||||||
|
$.post(url, {
|
||||||
|
username: getuser(),
|
||||||
|
password: getAPIKey(),
|
||||||
|
action: "gettasks"
|
||||||
|
}, function (resp) {
|
||||||
|
if (resp.status == "OK") {
|
||||||
|
var tasks = resp.tasks;
|
||||||
|
for (var i = 0; i < tasks.length; i++) {
|
||||||
|
tasklist.append(
|
||||||
|
'<div class="list-group-item">'
|
||||||
|
+ '<div class="d-flex w-100 justify-content-between">'
|
||||||
|
+ '<h5 class="mb-1"><i class="fas fa-' + tasks[i]['icon'] + ' fa-fw"></i> ' + tasks[i]['title'] + '</h5>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<p>' + tasks[i]['description'] + '</p>'
|
||||||
|
+ '</div>');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showmsg(resp.msg, "danger");
|
||||||
|
}
|
||||||
|
}, "json");
|
||||||
|
});
|
@ -0,0 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
-->
|
||||||
|
<h3 class="card-header" style="background-color: #2196F3; color: white;"><i class="far fa-clock"></i> <span class="card_title">QwikClock</span></h3>
|
||||||
|
<div class="card-body">
|
||||||
|
<button class="btn btn-success btn-lg btn-block start_btn"><i class="fas fa-play"></i> Punch In</button>
|
||||||
|
<button class="btn btn-danger btn-lg btn-block stop_btn"><i class="fas fa-stop"></i> Punch Out</button>
|
||||||
|
</div>
|
@ -0,0 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
-->
|
||||||
|
<h3 class="card-header"><i class="far fa-comments"></i> <span class="card_title">TaskFloor Messages</span></h3>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="list-group message-list">
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
-->
|
||||||
|
<h3 class="card-header"><i class="fas fa-tasks"></i> <span class="card_title">TaskFloor Tasks</span></h3>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="list-group task-list">
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var loadedCardTypes = [];
|
||||||
|
|
||||||
|
var totalCardTypes = [];
|
||||||
|
|
||||||
|
function loadCard(type, apiurl, title) {
|
||||||
|
$.get("cards/" + type + ".html", {}, function (html) {
|
||||||
|
console.log(type + " " + apiurl + " " + title);
|
||||||
|
var box = $('<div class="col col-sm-12 col-md-6 col-lg-6 col-xl-4" id=""></div>');
|
||||||
|
var card = $('<div class="card card_app card_' + type + '" style="width: 100%;" data-title="' + title + '" data-apiurl="' + apiurl + '"></div>');
|
||||||
|
$(card).html(html);
|
||||||
|
$(box).html(card);
|
||||||
|
$("#card-box").append(box);
|
||||||
|
if (loadedCardTypes.indexOf(type) == -1) {
|
||||||
|
loadedCardTypes.push(type);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyCardTitles() {
|
||||||
|
$(".card_app").each(function () {
|
||||||
|
var title = $(this).data("title");
|
||||||
|
$(this).find(".card_title").text(title);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function waitForCardsToLoadThenInjectScripts() {
|
||||||
|
// How's *that* for self-documenting code?
|
||||||
|
for (var i = 0; i < totalCardTypes.length; i++) {
|
||||||
|
if (loadedCardTypes.indexOf(totalCardTypes[i]) == -1) {
|
||||||
|
setTimeout(waitForCardsToLoadThenInjectScripts, 50);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
applyCardTitles();
|
||||||
|
for (var i = 0; i < loadedCardTypes.length; i++) {
|
||||||
|
$.getScript('cards/js/' + loadedCardTypes[i] + '.js');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getApps(function (apps) {
|
||||||
|
console.log(apps);
|
||||||
|
for (var appname in apps) {
|
||||||
|
if (!apps.hasOwnProperty(appname)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var app = apps[appname];
|
||||||
|
console.log(app);
|
||||||
|
console.log(" " + app.url);
|
||||||
|
console.log(" " + app.title);
|
||||||
|
if (typeof app.station_features !== "undefined" && app.station_features.length > 0) {
|
||||||
|
for (var type in app.station_features) {
|
||||||
|
if (!app.station_features.hasOwnProperty(type)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
totalCardTypes.push(app.station_features[type]);
|
||||||
|
loadCard(app.station_features[type], app.url + "/api.php", app.title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
waitForCardsToLoadThenInjectScripts();
|
||||||
|
});
|
||||||
|
|
||||||
|
startSessionTimeout();
|
||||||
|
|
||||||
|
$("#sign-out-btn").css("display", "inline-block");
|
@ -1,6 +1,20 @@
|
|||||||
|
auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options=
|
||||||
|
auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false
|
||||||
|
auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css
|
||||||
|
auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options=
|
||||||
|
auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false
|
||||||
|
auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css
|
||||||
|
auxiliary.org-netbeans-modules-html-editor-lib.default-html-public-id=HTML5
|
||||||
|
auxiliary.org-netbeans-modules-javascript-nodejs.enabled=false
|
||||||
|
auxiliary.org-netbeans-modules-javascript-nodejs.node_2e_default=true
|
||||||
|
auxiliary.org-netbeans-modules-javascript-nodejs.run_2e_enabled=false
|
||||||
|
auxiliary.org-netbeans-modules-javascript-nodejs.sync_2e_enabled=true
|
||||||
|
browser.run=true
|
||||||
file.reference.BizApps-Station=.
|
file.reference.BizApps-Station=.
|
||||||
file.reference.Station-public_html=public_html
|
file.reference.Station-public_html=public_html
|
||||||
file.reference.Station-test=test
|
file.reference.Station-test=test
|
||||||
files.encoding=UTF-8
|
files.encoding=UTF-8
|
||||||
project.licensePath=./nbproject/mplheader.txt
|
project.licensePath=./nbproject/mplheader.txt
|
||||||
site.root.folder=${file.reference.BizApps-Station}
|
site.root.folder=${file.reference.BizApps-Station}
|
||||||
|
start.file=index.html
|
||||||
|
web.context.root=/Station
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<!--
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
-->
|
||||||
|
<div class="container">
|
||||||
|
<div class="row justify-content-center" id="card-box">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="js/home.js"></script>
|
Loading…
Reference in New Issue