From 22cce3f6b32632075bf4c888e192777403ffaba7 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 28 Apr 2016 15:58:16 +0300 Subject: [PATCH] add base build + demo --- public/modules/forms/base/.bowerrc | 4 ++ public/modules/forms/base/.gitignore | 2 + public/modules/forms/base/bower.json | 41 +++++++++++++ public/modules/forms/base/demo/boot.js | 51 ++++++++++++++++ public/modules/forms/base/demo/index.html | 74 +++++++++++++++++++++++ public/modules/forms/base/gruntfile.js | 47 ++++++++++++++ public/modules/forms/base/package.json | 33 ++++++++++ 7 files changed, 252 insertions(+) create mode 100644 public/modules/forms/base/.bowerrc create mode 100644 public/modules/forms/base/.gitignore create mode 100755 public/modules/forms/base/bower.json create mode 100644 public/modules/forms/base/demo/boot.js create mode 100644 public/modules/forms/base/demo/index.html create mode 100644 public/modules/forms/base/gruntfile.js create mode 100644 public/modules/forms/base/package.json diff --git a/public/modules/forms/base/.bowerrc b/public/modules/forms/base/.bowerrc new file mode 100644 index 00000000..dc56168b --- /dev/null +++ b/public/modules/forms/base/.bowerrc @@ -0,0 +1,4 @@ +{ + "directory": "demo/lib", + "analytics": false +} diff --git a/public/modules/forms/base/.gitignore b/public/modules/forms/base/.gitignore new file mode 100644 index 00000000..1b246098 --- /dev/null +++ b/public/modules/forms/base/.gitignore @@ -0,0 +1,2 @@ +dist +demo/lib diff --git a/public/modules/forms/base/bower.json b/public/modules/forms/base/bower.json new file mode 100755 index 00000000..f7fdb071 --- /dev/null +++ b/public/modules/forms/base/bower.json @@ -0,0 +1,41 @@ +{ + "name": "tellform Form UI", + "description": "Opensource alternative to TypeForm", + "version": "1.2.1", + "homepage": "https://github.com/whitef0x0/tellform", + "authors": [ + "David Baldwynn (http://baldwynn.me)", + "Samuel Laulhau (https://samuellaulhau.fr)" + ], + "license": "MIT", + "dependencies": { + "bootstrap": "~3", + "angular": "~1.4.7", + "angular-resource": "~1.4.7", + "angular-bootstrap": "~1.3.2", + "angular-ui-utils": "~3.0.0", + "ng-file-upload": "~10.0.2", + "angular-ui-date": "~0.0.8", + "lodash": "~3.10.0", + "angular-input-stars": "*", + "file-saver.js": "~1.20150507.2", + "angular-scroll": "^1.0.0", + "ui-select": "angular-ui-select#^0.16.1", + "angular-sanitize": "^1.5.3", + "v-button": "^1.1.1", + "angular-busy": "^4.1.3", + "font-awesome": "~4.6.1", + "components-font-awesome": "~4.6.1", + "angular-strap": "~2.3.8", + "restangular": "~1.5.2" + }, + "resolutions": { + "angular-bootstrap": "^0.14.0", + "angular": "1.4.x" + }, + "overrides": { + "BOWER-PACKAGE": { + "main": "**/*.min.js" + } + } +} diff --git a/public/modules/forms/base/demo/boot.js b/public/modules/forms/base/demo/boot.js new file mode 100644 index 00000000..2d6811e8 --- /dev/null +++ b/public/modules/forms/base/demo/boot.js @@ -0,0 +1,51 @@ + +angular.module('NodeForm', [ + 'duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', + 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven' +]); +angular.module('forms', ['ngResource', 'NodeForm.templates']); +angular.module('NodeForm').requires.push('forms'); + +angular.module('forms').factory('Auth', [ + function() { + var service = { + _currentUser: null, + get currentUser(){ + return this._currentUser; + }, + ensureHasCurrentUser: function() { + return null; + }, + isAuthenticated: function() { + return false; + }, + getUserState: function() { + return ''; + }, + login: function() { + }, + logout: function() { + }, + }; + return service; + } +]); +angular.module('forms').factory('$state', [function() { + return { + go: function() {} + }; +}]); +angular.module('forms').factory('myForm', ['Forms', function(Forms) { + var form = window.form; + form.visible_form_fields = _.filter(form.form_fields, function(field){ + return (field.deletePreserved === false); + }); + return form; +}]); +angular.module('forms').constant('FORM_URL', '/form/:formId'); + + +angular.element(document).ready(function() { + //Then init the app + angular.bootstrap(document, ['forms']); +}); diff --git a/public/modules/forms/base/demo/index.html b/public/modules/forms/base/demo/index.html new file mode 100644 index 00000000..6bb63bae --- /dev/null +++ b/public/modules/forms/base/demo/index.html @@ -0,0 +1,74 @@ + + + + + Mes avis + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/modules/forms/base/gruntfile.js b/public/modules/forms/base/gruntfile.js new file mode 100644 index 00000000..2de89827 --- /dev/null +++ b/public/modules/forms/base/gruntfile.js @@ -0,0 +1,47 @@ +'use strict'; + +module.exports = function(grunt) { + require('jit-grunt')(grunt); + + // Project Configuration + grunt.initConfig({ + ngAnnotate: { + production: { + files: { + 'dist/form.js': [ + 'config/**/*.js', 'controllers/**/*.js', + 'directives/**/*.js', 'services/**/*.js', + 'dist/template.js' + ] + } + } + }, + html2js: { + options: { + base: '', + module: 'NodeForm.templates', + singleModule: true, + rename: function (moduleName) { + return 'modules/forms/base/' + moduleName; + } + }, + form: { + src: ['views/**/*.html'], + dest: 'dist/template.js' + } + }, + cssmin: { + combine: { + files: { + 'dist/form.css': 'css/**/*.css' + } + } + }, + }); + + // Making grunt default to force in order not to break the project. + grunt.option('force', true); + + // Default task(s). + grunt.registerTask('default', ['html2js:form', 'ngAnnotate', 'cssmin']); +}; diff --git a/public/modules/forms/base/package.json b/public/modules/forms/base/package.json new file mode 100644 index 00000000..889b300f --- /dev/null +++ b/public/modules/forms/base/package.json @@ -0,0 +1,33 @@ +{ + "name": "angular-tellform", + "description": "Opensource alternative to TypeForm", + "version": "1.3.0", + "homepage": "https://github.com/whitef0x0/tellform", + "authors": [ + "David Baldwynn (http://baldwynn.me)", + "Samuel Laulhau (https://samuellaulhau.fr)" + ], + "private": true, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tellform/angular-tellform.git" + }, + "engines": { + "node": "~5.0.0", + "npm": "~2.11.2" + }, + "scripts": { + "postinstall": "node node_modules/.bin/bower install --config.interactive=false; node node_modules/.bin/grunt build" + }, + "dependencies": { + "bower": "~1.6.5", + "grunt": "~0.4.1", + "grunt-cli": "~0.1.13", + "grunt-contrib-cssmin": "~0.14.0", + "grunt-contrib-uglify": "~0.11.0", + "grunt-html2js": "~0.3.5", + "grunt-ng-annotate": "~1.0.1", + "jit-grunt": "^0.10.0" + } +}