This reverts commit d46f4babfa.
This commit is contained in:
Kai Kreuzer 2016-05-04 23:15:02 +02:00
Родитель dfdf479b92
Коммит fa1949c8e0
5 изменённых файлов: 76 добавлений и 133 удалений

Просмотреть файл

@ -20,23 +20,4 @@ The manifest generation could be triggered by:
The "nice manifest" option will add line breaks after every imported package. The "nice manifest" option will add line breaks after every imported package.
Now you can have a look at the manifest that would be generated by the bndtool using: Now you can have a look at the manifest that would be generated by the bndtool using:
cat target/classes/META-INF/MANIFEST.MF cat target/classes/META-INF/MANIFEST.MF
PaperUI development (JS/HTML)
---
The initial setup of PaperUI can be done in two ways:
1. By running the maven build.
2. Running an 'npm install' followed by 'gulp' build.
The JS/HTML files of PaperUI are packaged using the 'Gulp' plugin. There are two important gulp tasks needed for development. For normal development you need to run the following command on console:
gulp serve --development
This will automatically inject all the needed files to index.html and will launch a browsersync instance running on http://localhost:3000/ (default). The calls to rest end-point are also proxied by this gulp task. After running this, any changes made into the files of folder 'web-src' will be available in the browser after refreshing the page.
The distribution version of PaperUI can be seen using the command:
gulp
This will minify the files and copy all the sources to 'web' folder. The changes can be seen at 'http://localhost:8080/' (default port for smarthome web server).

Просмотреть файл

@ -2,4 +2,3 @@ node/
node_modules/ node_modules/
web-src/bower_components/ web-src/bower_components/
web/ web/
web-src/index.html

Просмотреть файл

@ -8,11 +8,7 @@ var angularFilesort = require('gulp-angular-filesort'),
ngAnnotate = require('gulp-ng-annotate'), ngAnnotate = require('gulp-ng-annotate'),
proxyMiddleware = require('http-proxy-middleware'), proxyMiddleware = require('http-proxy-middleware'),
rename = require("gulp-rename"), rename = require("gulp-rename"),
uglify = require('gulp-uglify'), uglify = require('gulp-uglify');
inject = require('gulp-inject'),
util = require('gulp-util');
var isDevelopment = !!util.env.development;
var paths = { var paths = {
scripts: [ scripts: [
@ -56,7 +52,7 @@ var paths = {
'./node_modules/masonry-layout/dist/masonry.pkgd.min.js', './node_modules/masonry-layout/dist/masonry.pkgd.min.js',
'./node_modules/sprintf-js/dist/sprintf.min.js', './node_modules/sprintf-js/dist/sprintf.min.js',
'./node_modules/bootstrap/dist/js/bootstrap.min.js', './node_modules/bootstrap/dist/js/bootstrap.min.js',
'./node_modules/tinycolor2/tinycolor.js' './node_modules/tinycolor2/tinycolor.js',
], ],
JQUI: [{ JQUI: [{
'src' : [ 'src' : [
@ -77,9 +73,8 @@ var paths = {
] ]
}; };
gulp.task('default', ['build']);
gulp.task('default', ['build','inject']); gulp.task('build', ['uglify', 'concat', 'copyCSSLibs', 'copyFontLibs', 'copyJSLibs', 'copyJQUI' , 'copyStatic', 'copyPartials']);
gulp.task('build', ['uglify', 'concat', 'copyCSSLibs', 'copyFontLibs', 'copyJSLibs', 'copyStatic', 'copyPartials']);
gulp.task('uglify', function () { gulp.task('uglify', function () {
return gulp.src(paths.scripts) return gulp.src(paths.scripts)
@ -149,8 +144,7 @@ gulp.task('clean', function () {
// Gulp Serve // Gulp Serve
function browserSyncInit(baseDir) { function browserSyncInit(baseDir) {
var server = { var server = {
baseDir: baseDir, baseDir: baseDir
index: "index.html"
}; };
server.middleware = proxyMiddleware(['/rest'], {target: 'http://localhost:8080'}); server.middleware = proxyMiddleware(['/rest'], {target: 'http://localhost:8080'});
@ -162,43 +156,6 @@ function browserSyncInit(baseDir) {
}); });
} }
gulp.task('serve', ['inject'], function () { gulp.task('serve', ['build'], function () {
browserSyncInit(['./web-src', './web']); browserSyncInit(['./web-src', './web']);
}); });
gulp.task('inject', ['build'], function () {
var target = gulp.src('./web/index.html');
// It's not necessary to read the files (will speed up things), we're only after their paths:
var files;
console.log("MODE:"+isDevelopment);
if(!isDevelopment){
files = [
'web/js/app.js',
'web/js/constants.js',
'web/js/services.min.js',
'web/js/controllers.min.js',
'web/js/extensions.js',
'web/js/main.js',
'web/js/shared.properties.js'
];
}
else
{
files = ['./web-src/js/*.js']
}
var sources = gulp.src(files, {read: false});
return target.pipe(inject(sources,{
addRootSlash : false,
ignorePath : './web-src/js/*.js',
transform : function ( filePath, file, i, length ) {
var newPath = isDevelopment ? filePath.replace('web-src/','') : filePath.replace( 'web/', '' );
console.log('inject script = '+ newPath);
return '<script src="' + newPath + '"></script>';
}
}))
.pipe(isDevelopment ? gulp.dest('./web-src'):gulp.dest('./web'));
});

Просмотреть файл

@ -38,7 +38,65 @@
<body ng-controller="BodyController"> <body ng-controller="BodyController">
<div id="authentication" data-access-token="{{ACCESS_TOKEN}}"></div> <div id="authentication" data-access-token="{{ACCESS_TOKEN}}"></div>
<div ng-include="'partials/include.extension.html'"></div> <div ng-include="'partials/include.extension.html'"></div>
<div ng-include="'partials/navigation.menu.html'"></div> <nav class="menu slide-menu-left" ng-controller="NavController">
<div class="top clickable" ng-click="navigateToRoot()">
<img id="logo" alt="Eclipse SmartHome Logo" src="img/logo.png" />
<h1 class="title">SmartHome</h1>
</div>
<ul>
<li ng-class="{active: isActive('control'), hidden: isHidden('control')}">
<a href="#control">
<span class="icon material-icons">dashboard</span>
<span class="side-menu">Control</span>
</a>
</li>
<li ng-class="{active: isActive('inbox')}">
<a href="#inbox" class="clickable">
<span class="icon material-icons">add_circle_outline</span>
<span class="side-menu">Inbox</span>
<span ng-show="getNumberOfNewDiscoveryResults() > 0" class="badge">{{getNumberOfNewDiscoveryResults()}}</span>
</a>
</li>
<li ng-class="{active: isActive('configuration'), hidden: isHidden('configuration')}">
<a ng-click="open('configuration')" class="clickable">
<span class="icon material-icons">settings</span>
<span class="side-menu">Configuration</span>
</a>
<ul ng-show="isActive('configuration')">
<li ng-class="{active: isSubActive('bindings')}">
<a href="#configuration/bindings">Bindings</a>
</li>
<li ng-class="{active: isSubActive('services')}">
<a href="#configuration/services">Services</a>
</li>
<li ng-class="{active: isSubActive('things')}">
<a href="#configuration/things">Things</a>
</li>
</ul>
</li>
<li ng-show="extensionEnabled" ng-class="{active: isActive('extensions'), hidden: isHidden('extensions')}">
<a href="#extensions">
<span class="icon material-icons">extension</span>
<span class="side-menu">Extensions</span>
</a>
</li>
<li ng-show="ruleEnabled" ng-class="{active: isActive('rules'), hidden: isHidden('rules')}">
<a href="#rules">
<span class="icon material-icons">movie_creation</span>
<span class="side-menu">Rules</span>
</a>
</li>
<li ng-class="{active: isActive('preferences'), hidden: isHidden('preferences')}">
<a href="#preferences">
<span class="icon material-icons">brightness_medium</span>
<span class="side-menu">Preferences</span>
</a>
</li>
</ul>
<div class="bottom">
<span>Paper UI</span>
</div>
</nav>
<div id="wrapper"> <div id="wrapper">
<header> <header>
@ -65,17 +123,24 @@
<script src="js/jquery-ui.min.js"></script> <script src="js/jquery-ui.min.js"></script>
<script src="js/angular-bundle.min.js"></script> <script src="js/angular-bundle.min.js"></script>
<script src="js/bootstrap.min.js"></script> <script src="js/bootstrap.min.js"></script>
<!-- TODO: Create custom variant to save space --> <!-- TODO: Create custom variant to save space -->
<script src="js/tinycolor.js"></script> <script src="js/tinycolor.js"></script>
<script src="js/masonry.pkgd.min.js"></script> <script src="js/masonry.pkgd.min.js"></script>
<!-- TODO: Use angularized version? -->
<script src="js/sprintf.min.js"></script> <script src="js/sprintf.min.js"></script>
<!-- inject:js --> <!-- custom js files -->
<!-- endinject --> <script src="js/app.js"></script>
<script src="js/constants.js"></script>
<script src="js/services.min.js"></script>
<script src="js/controllers.min.js"></script>
<script src="js/extensions.js"></script>
<script src="js/main.js"></script>
<script src="js/shared.properties.js"></script>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,59 +0,0 @@
<nav class="menu slide-menu-left" ng-controller="NavController">
<div class="top clickable" ng-click="navigateToRoot()">
<img id="logo" alt="Eclipse SmartHome Logo" src="img/logo.png" />
<h1 class="title">SmartHome</h1>
</div>
<ul>
<li ng-class="{active: isActive('control'), hidden: isHidden('control')}">
<a href="#control">
<span class="icon material-icons">dashboard</span>
<span class="side-menu">Control</span>
</a>
</li>
<li ng-class="{active: isActive('inbox')}">
<a href="#inbox" class="clickable">
<span class="icon material-icons">add_circle_outline</span>
<span class="side-menu">Inbox</span>
<span ng-show="getNumberOfNewDiscoveryResults() > 0" class="badge">{{getNumberOfNewDiscoveryResults()}}</span>
</a>
</li>
<li ng-class="{active: isActive('configuration'), hidden: isHidden('configuration')}">
<a ng-click="open('configuration')" class="clickable">
<span class="icon material-icons">settings</span>
<span class="side-menu">Configuration</span>
</a>
<ul ng-show="isActive('configuration')">
<li ng-class="{active: isSubActive('bindings')}">
<a href="#configuration/bindings">Bindings</a>
</li>
<li ng-class="{active: isSubActive('services')}">
<a href="#configuration/services">Services</a>
</li>
<li ng-class="{active: isSubActive('things')}">
<a href="#configuration/things">Things</a>
</li>
</ul>
</li>
<li ng-show="extensionEnabled" ng-class="{active: isActive('extensions'), hidden: isHidden('extensions')}">
<a href="#extensions">
<span class="icon material-icons">extension</span>
<span class="side-menu">Extensions</span>
</a>
</li>
<li ng-show="ruleEnabled" ng-class="{active: isActive('rules'), hidden: isHidden('rules')}">
<a href="#rules">
<span class="icon material-icons">movie_creation</span>
<span class="side-menu">Rules</span>
</a>
</li>
<li ng-class="{active: isActive('preferences'), hidden: isHidden('preferences')}">
<a href="#preferences">
<span class="icon material-icons">brightness_medium</span>
<span class="side-menu">Preferences</span>
</a>
</li>
</ul>
<div class="bottom">
<span>Paper UI</span>
</div>
</nav>