From a808486bae230c982a05980a0a28c00a43c05d3a Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 18 May 2017 17:49:35 +0200 Subject: Git repo can be used as submodules Clean templates files as they are useless for usage in submodules into a project. Change-Id: I24c71b64ab2b3a958494f3f190c014227a1da576 Signed-off-by: Romain Forlot --- .../widgets/ActionButtons/ActionButtons.scss | 40 ---- .../Frontend/widgets/ActionButtons/AppliButton.js | 205 --------------------- .../Frontend/widgets/ActionButtons/SubmitButton.js | 52 ------ 3 files changed, 297 deletions(-) delete mode 100644 templates/html5/app/Frontend/widgets/ActionButtons/ActionButtons.scss delete mode 100644 templates/html5/app/Frontend/widgets/ActionButtons/AppliButton.js delete mode 100644 templates/html5/app/Frontend/widgets/ActionButtons/SubmitButton.js (limited to 'templates/html5/app/Frontend/widgets/ActionButtons') diff --git a/templates/html5/app/Frontend/widgets/ActionButtons/ActionButtons.scss b/templates/html5/app/Frontend/widgets/ActionButtons/ActionButtons.scss deleted file mode 100644 index 6cb8338..0000000 --- a/templates/html5/app/Frontend/widgets/ActionButtons/ActionButtons.scss +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 . - */ - -@import "app/ibz-mixins"; - -// place here your submit buttons customization -appli-button { - @include ibz-button(grey,1rem) - img { - height: 3rem; - } - - - .disable>i { - text-decoration:none; // really not needed for the Top Bar, just for general technique - cursor: auto; - color: grey !important; - } -} - -.appli-menu-start { - .start-start, .stop-stop { - i {color: grey;} - } -} diff --git a/templates/html5/app/Frontend/widgets/ActionButtons/AppliButton.js b/templates/html5/app/Frontend/widgets/ActionButtons/AppliButton.js deleted file mode 100644 index 269ee81..0000000 --- a/templates/html5/app/Frontend/widgets/ActionButtons/AppliButton.js +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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 . - * - * Bugs: Input with Callback SHOULD BE get 'required' class - */ - -(function () { - 'use strict'; - - var tmplAppli = '
' + - '' + - '{{label}}' + - '
'; - - var tmplModal = - '×' + - '' + - 'Application {{label}}' + - '' + - ''; - - var tmplDetail = - '×' + - '' + - 'Application {{label}}' + - '
    ' + - '
  • Name : {{detail.name}}
  • ' + - '
  • Description {{detail.description}}
  • ' + - '
  • Author : {{detail.author}}
  • ' + - '
' + - ''; - - angular.module('AppliButton', []) - .directive('appliButton', function (AppConfig, AppCall, ModalFactory, Notification, $timeout, $window, $location, urlquery) { - - function mymethods(scope, elem, attrs) { - scope.runstatus = "stop"; - scope.runmode = urlquery.runmode || "auto"; - scope.clicked = function () { - - var notifyError = function(action, response) { - Notification.error ({message: "Fail /api/afm-main" + action + "=" + scope.label + " RunID="+ scope.appID, delay: 5000}); - elem.addClass ("fail"); - elem.removeClass ("success"); - scope.callback (scope.appID, action, response); - }; - - var notifySuccess = function (action, response) { - elem.removeClass ("fail"); - scope.runID = response.data.response.runid; - scope.callback (scope.appID, action, response); - }; - - var closeModApp = function() { - scope.modApp.deactivate(); - $timeout (function() {scope.modApp.destroy();}, 1000); - }; - - var closeModInfo = function() { - scope.modInfo.deactivate(); - $timeout (function() {scope.modInfo.destroy();}, 1000); - }; - - var actionModal = function(action) { - console.log ("Modal Action=%s", action); - switch (action) { - - case "start": - if (scope.runstatus !== "stop") return; - AppCall.get ("afm-main", "start", {id: scope.appID, mode: scope.runmode}, function(response) { - if (response.status !== 200 || response.data.jtype !== "afb-reply") { - notifyError ("start", response); - return; - } - scope.runstatus="start"; - notifySuccess (action, response); - if(response.data.response.uri) - scope.winapp= $window.open(response.data.response.uri.replace("%h", $location.host())); - }); - break; - - case "stop": - if (scope.runstatus !== "start") return; - - AppCall.get ("afm-main", "terminate", {runid: scope.runID}, function(response) { - if (response.status !== 200 || response.data.jtype !== "afb-reply") { - notifyError ("stop", response); - return; - } - scope.runstatus="stop"; - - // if a remote window app was open let's close it - if (scope.winapp) { - console.log ("Closing Application Window label=%s id=%s", scope.label, scope.appID); - scope.winapp.close(); - scope.winapp=false; - } - notifySuccess (action, response); - }); - break; - - case "info": - AppCall.get ("afm-main", "detail", {id: scope.appID}, function(response) { - if (response.status !== 200 || response.data.jtype !== "afb-reply") { - notifyError ("detail", response); - return; - } - - // reference http://foundation.zurb.com/apps/docs/#!/angular-modules - var config = { - animationIn: 'slideInFromTop', - contentScope: { - close : closeModInfo, - icon : scope.icon, - label : scope.appID, - detail : response.data.response - }, template : tmplDetail - }; - // Popup Modal to render application data - scope.modInfo = new ModalFactory(config); - scope.modInfo.activate (); - - }); - break; - - case "uninstall": - if (scope.runstatus !== "stop") return; - AppCall.get ("afm-main", "uninstall", {id: scope.appID}, function(response) { - if (response.status !== 200 || response.data.jtype !== "afb-reply") { - notifyError ("uninstall", response); - return; - } - - notifySuccess (action, response); - }); - break; - - default: - console.log ("ActionModal unknown action=[%s]", action); - break; - } - - closeModApp(); - }; - - // reference http://foundation.zurb.com/apps/docs/#!/angular-modules - var config = { - animationIn: 'slideInFromTop', - contentScope: { - action : actionModal, - runstatus: scope.runstatus, - close : closeModApp, - icon : scope.icon, - label : scope.label - }, template : tmplModal - }; - // Popup Modal to render application data - scope.modApp = new ModalFactory(config); - scope.modApp.activate (); - }; - - // extract application information from AppID+Store - if (attrs.handle && scope.store [attrs.handle].name) { - scope.icon = AppConfig.paths.icons + attrs.handle; //scope.store [attrs.handle].name.toLowerCase() + '-ico.png'; - scope.label = scope.store [attrs.handle].name; - scope.appID= attrs.handle; - } else { - scope.icon = AppConfig.paths.icons + 'w3c-ico.png'; - scope.label = attrs.handle; - } - - // add label as class - elem.addClass (scope.label.toLowerCase()); - - // note: clicked in imported and when template is clicked - // it will call clicked method passed in param. - } - - return { - restrict: 'E', - template: tmplAppli, - link: mymethods, - scope: {callback: '=', store: '='} - }; - }); -})(); diff --git a/templates/html5/app/Frontend/widgets/ActionButtons/SubmitButton.js b/templates/html5/app/Frontend/widgets/ActionButtons/SubmitButton.js deleted file mode 100644 index 323cd46..0000000 --- a/templates/html5/app/Frontend/widgets/ActionButtons/SubmitButton.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 . - * - * Bugs: Input with Callback SHOULD BE get 'required' class - */ - -(function () { - 'use strict'; - - var tmpl = '
' + - '' + - '{{label}}' + - '
'; - - angular.module('SubmitButton', []) - .directive('submitButton', function () { - - function mymethods(scope, elem, attrs) { - - // ajust icon or use default - scope.icon = attrs.icon || 'fi-foot'; - scope.label = attrs.label || 'Next'; - - // add label as class - elem.addClass (scope.label.toLowerCase()); - - // note: clicked in imported and when template is clicked - // it will call clicked method passed in param. - } - - return { - restrict: 'E', - template: tmpl, - link: mymethods, - scope: {clicked : '='} - }; - }); -})(); -- cgit 1.2.3-korg