Moving away from ionic to pure angular for popup. Setup gulpfile and some tasks

This commit is contained in:
Kyle Spearrin 2016-09-07 18:51:36 -04:00
parent 4092e2ecc3
commit 68f87b67b0
10 changed files with 152 additions and 14 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.vs
node_modules
npm-debug.log
lib/
css/

109
src/gulpfile.js Normal file
View File

@ -0,0 +1,109 @@
var gulp = require('gulp'),
rimraf = require('rimraf'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
less = require('gulp-less'),
preprocess = require('gulp-preprocess'),
runSequence = require('run-sequence'),
jshint = require('gulp-jshint'),
merge = require('merge-stream');
var paths = {};
paths.dist = '../dist/';
paths.libDir = './lib/';
paths.npmDir = './node_modules/';
paths.popupDir = './popup/';
paths.lessDir = paths.popupDir + 'less/';
paths.cssDir = paths.popupDir + 'css/';
gulp.task('lint', function () {
return gulp.src(paths.popupDir + 'app/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('build', function (cb) {
return runSequence(
'clean',
['lib', 'less', 'lint'],
cb);
});
gulp.task('clean:css', function (cb) {
return rimraf(paths.cssDir, cb);
});
gulp.task('clean:lib', function (cb) {
return rimraf(paths.libDir, cb);
});
gulp.task('clean', ['clean:css', 'clean:lib']);
gulp.task('lib', ['clean:lib'], function () {
var libs = [
{
src: [
paths.npmDir + 'bootstrap/dist/**/*',
'!' + paths.npmDir + 'bootstrap/dist/**/npm.js',
'!' + paths.npmDir + 'bootstrap/dist/**/css/*theme*'
],
dest: paths.libDir + 'bootstrap'
},
{
src: paths.npmDir + 'font-awesome/css/*',
dest: paths.libDir + 'font-awesome/css'
},
{
src: paths.npmDir + 'font-awesome/fonts/*',
dest: paths.libDir + 'font-awesome/fonts'
},
{
src: paths.npmDir + 'jquery/dist/*.js',
dest: paths.libDir + 'jquery'
},
{
src: paths.npmDir + 'angular/angular*.js',
dest: paths.libDir + 'angular'
},
{
src: paths.npmDir + 'angular-ui-bootstrap/dist/*tpls*.js',
dest: paths.libDir + 'angular-ui-bootstrap'
},
{
src: paths.npmDir + 'angular-jwt/dist/*.js',
dest: paths.libDir + 'angular-jwt'
},
{
src: paths.npmDir + 'angular-ui-router/release/*.js',
dest: paths.libDir + 'angular-ui-router'
},
{
src: [paths.npmDir + 'sjcl/core/cbc.js', paths.npmDir + 'sjcl/core/bitArray.js', paths.npmDir + 'sjcl/sjcl.js'],
dest: paths.libDir + 'sjcl'
},
{
src: paths.npmDir + 'ngclipboard/dist/ngclipboard*.js',
dest: paths.libDir + 'ngclipboard'
},
{
src: paths.npmDir + 'clipboard/dist/clipboard*.js',
dest: paths.libDir + 'clipboard'
}
];
var tasks = libs.map(function (lib) {
return gulp.src(lib.src).pipe(gulp.dest(lib.dest));
});
return merge(tasks);
});
gulp.task('less', function () {
return gulp.src(paths.lessDir + 'popup.less')
.pipe(less())
.pipe(gulp.dest(paths.cssDir));
});
gulp.task('watch', function () {
gulp.watch(paths.lessDir + '*.less', ['less']);
});

View File

@ -13,10 +13,10 @@
},
"background": {
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/sjcl/sjcl.js",
"node_modules/sjcl/core/cbc.js",
"node_modules/sjcl/core/bitArray.js",
"lib/jquery/jquery.js",
"lib/sjcl/sjcl.js",
"lib/sjcl/cbc.js",
"lib/sjcl/bitArray.js",
"models/api/requestModels.js",
"models/api/responseModels.js",
"models/dataModels.js",

View File

@ -2,9 +2,26 @@
"name": "bitwarden",
"version": "0.0.1",
"devDependencies": {
"ionic-framework-v1": "1.3.1",
"sjcl": "1.0.3",
"angular-jwt": "0.0.9",
"jquery": "3.1.0"
"jquery": "2.2.4",
"bootstrap": "3.3.7",
"font-awesome": "4.6.3",
"angular": "1.5.8",
"angular-ui-bootstrap": "2.1.3",
"angular-ui-router": "0.3.1",
"angular-animate": "1.5.8",
"gulp": "3.9.1",
"gulp-less": "3.1.0",
"gulp-preprocess": "2.0.0",
"gulp-concat": "2.6.0",
"gulp-rename": "1.2.2",
"rimraf": "2.5.4",
"jshint": "2.9.3",
"gulp-jshint": "2.0.1",
"run-sequence": "1.2.2",
"ngclipboard": "1.1.1",
"clipboard": "1.5.12",
"merge-stream": "1.0.0"
}
}

View File

@ -1,6 +1,6 @@
angular
.module('bit', [
'ionic',
'ui.router',
'angular-jwt',
'bit.services',

View File

@ -1,2 +1,2 @@
angular
.module('bit.services', ['ngResource', 'angular-jwt']);
.module('bit.services', ['angular-jwt']);

View File

@ -1,7 +1,7 @@
angular
.module('bit.vault')
.controller('vaultController', function ($scope, $ionicModal, siteService, folderService, $q, cipherService) {
.controller('vaultController', function ($scope, siteService, folderService, $q, cipherService) {
$scope.parentScope = $scope;
$scope.sites = [];
$scope.folders = [];
@ -70,6 +70,7 @@
return item.name.toLowerCase();
};
/*
$scope.viewSite = function (site) {
$scope.focusedSiteId = site.id;
$ionicModal.fromTemplateUrl('app/vault/views/vaultViewSite.html', {
@ -101,6 +102,7 @@
modal.show();
});
};
*/
$scope.closeAddSite = function () {
$scope.addSiteModal.hide();

View File

@ -1,2 +1,2 @@
angular
.module('bit.vault', ['ionic']);
.module('bit.vault', []);

View File

@ -5,10 +5,15 @@
<title>bitwarden</title>
<link rel="stylesheet" href="../node_modules/ionic-framework-v1/css/ionic.min.css">
<script src="../node_modules/ionic-framework-v1/js/ionic.bundle.min.js"></script>
<script src="../node_modules/ionic-framework-v1/js/angular/angular-resource.min.js"></script>
<script src="../node_modules/angular-jwt/dist/angular-jwt.min.js"></script>
<link rel="stylesheet" href="../lib/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="css/popup.css">
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
<script src="../lib/angular/angular.js"></script>
<script src="../lib/angular-ui-router/angular-ui-router.js"></script>
<script src="../lib/angular-jwt/angular-jwt.js"></script>
<script src="app/app.js"></script>
<script src="app/settings.js"></script>

View File

@ -0,0 +1,3 @@
body {
}