summaryrefslogtreecommitdiffstats
path: root/afb-client/app/Frontend/pages/Sample
diff options
context:
space:
mode:
Diffstat (limited to 'afb-client/app/Frontend/pages/Sample')
-rw-r--r--afb-client/app/Frontend/pages/Sample/Sample.html22
-rw-r--r--afb-client/app/Frontend/pages/Sample/SampleModule.js48
-rw-r--r--afb-client/app/Frontend/pages/Sample/SampleModule.scss41
3 files changed, 111 insertions, 0 deletions
diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html
new file mode 100644
index 0000000..00a6f3b
--- /dev/null
+++ b/afb-client/app/Frontend/pages/Sample/Sample.html
@@ -0,0 +1,22 @@
+<!-- comment -->
+
+---
+name: mysample
+url: /sample
+controller: SampleController as ctrl
+animationIn: slideInRight
+---
+
+<h1><img class="logo" src="images/logo/triskel_iot_bzhx250.png" alt="IoT.bzh Logo" style="height:150px;"> Sample Page</h1>
+
+<div class="sample-box box-content">
+
+ <upload-file name="avatar" category="avatars" icon="tux-visitor.png"></upload-file>
+
+ <submit-button class="sample-button" icon="fi-zoom-in" label="Vol+" clicked="ctrl.MuteOn" ></submit-button>
+ <submit-button class="sample-button" icon="fi-zoom-out" label="Vol-" clicked="ctrl.MuteOff" ></submit-button>
+ <submit-button class="home-button" icon="fi-upload" label="Refresh" clicked="ctrl.UploadFile" ></submit-button>
+
+</div>
+
+<link-button href="home" icon="fi-home" label="home"></link-button>
diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.js b/afb-client/app/Frontend/pages/Sample/SampleModule.js
new file mode 100644
index 0000000..2a2e777
--- /dev/null
+++ b/afb-client/app/Frontend/pages/Sample/SampleModule.js
@@ -0,0 +1,48 @@
+(function() {
+'use strict';
+
+// list all rependencies within the page + controler if needed
+angular.module('SampleModule', ['SubmitButton','UploadFile'])
+
+ .controller('SampleController', function ($http) {
+ var self = this; // I hate JavaScript
+ this.status='muted-off';
+
+ console.log ("sample controller");
+
+ this.MuteOn = function() {
+ console.log ("Muted");
+ // send AJAX request to server
+ var handler = $http.post('/api/dbus/ping', {type:'mute', action: "on"});
+
+ handler.success(function(response, errcode, headers, config) {
+ self.status = 'muted-on';
+ });
+
+ handler.error(function(status, errcode, headers) {
+ console.log ("Oops /api/dbus/pring err=" + errcode);
+ self.status = 'muted-error';
+ });
+ };
+
+ this.MuteOff = function() {
+ console.log ("UnMuted");
+ // send AJAX request to server
+ var handler = $http.post('/api/dbus/ping', {type:'mute', action: "off"});
+
+ handler.success(function(response, errcode, headers, config) {
+ self.status = 'muted-off';
+ });
+
+ handler.error(function(status, errcode, headers) {
+ console.log ("Oops /api/dbus/ping err=" + errcode);
+ self.status = 'muted-error';
+ });
+
+ };
+
+
+ });
+
+console.log ("SampleControler Loaded");
+})(); \ No newline at end of file
diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.scss b/afb-client/app/Frontend/pages/Sample/SampleModule.scss
new file mode 100644
index 0000000..2e54c53
--- /dev/null
+++ b/afb-client/app/Frontend/pages/Sample/SampleModule.scss
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 "IoT.bzh"
+ * Author "Fulup Ar Foll"
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+@import "app/ibz-mixins";
+
+
+.sample-box {
+ display: block;
+ height : 4.5rem;
+
+ .sample-button {
+ float: left;
+ width: 5rem;
+ };
+
+ .muted-on-on,.muted-off-off{
+ background: blueviolet;
+ };
+
+ .muted-error{
+ background: red;
+ };
+};
+
+
+