diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 84f6624..1a7f957 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -7,6 +7,7 @@ module.exports = (grunt) -> meta: src: 'src' test: 'test' + target: 'lib/<%= pkg.name %>.js' banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + @@ -25,21 +26,21 @@ module.exports = (grunt) -> files: src: ['Gruntfile.coffee'] coffee: src: files: - '<%= pkg.name %>.js': [ + '<%= meta.target %>': [ '<%= meta.src %>/**/*.coffee' ] karma: - # unit: configFile: 'config/karma-unit.coffee' - e2e: configFile: 'config/karma-e2e.coffee' - # unit_ci: - # configFile: 'config/karma-unit.coffee' - # singleRun: true - # browsers: ['PhantomJS'] + unit: configFile: 'test/config-unit.coffee' + e2e: configFile: 'test/config-e2e.coffee' + unit_ci: + configFile: 'test/config-unit.coffee' + singleRun: true + browsers: ['PhantomJS'] e2e_ci: - configFile: 'config/karma-e2e.coffee' + configFile: 'test/config-e2e.coffee' singleRun: true browsers: ['PhantomJS'] - jshint: target: ['<%= pkg.name %>.js'] + jshint: target: ['<%= meta.target %>'] require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks diff --git a/bower.json b/bower.json index 3039619..02ea369 100644 --- a/bower.json +++ b/bower.json @@ -1,4 +1,4 @@ -{ "name": "radians" +{ "name": "angular-contenteditable" , "version": "0.0.0" , "main": "angular-radians.js" , "ignore": @@ -6,8 +6,6 @@ , "Gruntfile.coffee" , "package.json" , "components" - , "config" - , "examples" , "node_modules" , "src" , "test" diff --git a/angular-radians.js b/lib/angular-contenteditable.js similarity index 90% rename from angular-radians.js rename to lib/angular-contenteditable.js index aed9390..f6899eb 100644 --- a/angular-radians.js +++ b/lib/angular-contenteditable.js @@ -1,8 +1,3 @@ -(function() { - angular.module('radians', ['radians.contenteditable']); - -}).call(this); - (function() { var escapeRegexp, noImg; @@ -14,7 +9,7 @@ return str.replace(/]*>/g, ''); }; - angular.module('radians.contenteditable', []).directive('contenteditable', function() { + angular.module('contenteditable', []).directive('contenteditable', function() { return { require: 'ngModel', link: function(scope, elmt, attrs, ctrl) { diff --git a/package.json b/package.json index a4760aa..20b8b97 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "angular-radians", + "name": "angular-contenteditable", "version": "0.0.0", "description": "angular extensions", - "main": "angular-radians.js", + "main": "lib/angular-radians.js", "directories": { "test": "test" }, diff --git a/src/radians/contenteditable.coffee b/src/contenteditable.coffee similarity index 96% rename from src/radians/contenteditable.coffee rename to src/contenteditable.coffee index 6b3dafa..84e79b0 100644 --- a/src/radians/contenteditable.coffee +++ b/src/contenteditable.coffee @@ -6,7 +6,7 @@ escapeRegexp = (str) -> str.replace /([.?*+^$[\]\\(){}|-])/g, "\\$1" # @param str a string possibly containing img tags noImg = (str) -> str.replace /]*>/g, '' -angular.module('radians.contenteditable', []) +angular.module('contenteditable', []) .directive('contenteditable', -> require: 'ngModel', link: (scope, elmt, attrs, ctrl) -> diff --git a/src/radians.coffee b/src/radians.coffee deleted file mode 100644 index bf25b80..0000000 --- a/src/radians.coffee +++ /dev/null @@ -1 +0,0 @@ -angular.module('radians', ['radians.contenteditable']) diff --git a/config/karma-e2e.coffee b/test/config-e2e.coffee similarity index 70% rename from config/karma-e2e.coffee rename to test/config-e2e.coffee index 06e7587..c373950 100644 --- a/config/karma-e2e.coffee +++ b/test/config-e2e.coffee @@ -6,15 +6,15 @@ toServe = [ 'components/angular/angular.js' 'components/angular-bootstrap/ui-bootstrap.js' 'components/angular-bootstrap/ui-bootstrap-tpls.js' - 'angular-radians.js' - 'examples/simple.html' - 'examples/typeahead1.html' - 'examples/typeahead2.html' - 'examples/typeahead3.html' - 'examples/states.json' - 'examples/img/ru.gif' - 'examples/img/gb.gif' - 'examples/img/us.gif' + 'lib/angular-contenteditable.js' + 'test/fixtures/simple.html' + 'test/fixtures/typeahead1.html' + 'test/fixtures/typeahead2.html' + 'test/fixtures/typeahead3.html' + 'test/fixtures/states.json' + 'test/fixtures/img/ru.gif' + 'test/fixtures/img/gb.gif' + 'test/fixtures/img/us.gif' ] toServe = diff --git a/config/karma-unit.coffee b/test/config-unit.coffee similarity index 100% rename from config/karma-unit.coffee rename to test/config-unit.coffee diff --git a/test/e2e/scenarios.coffee b/test/e2e/scenarios.coffee index 93bb114..b35ee70 100644 --- a/test/e2e/scenarios.coffee +++ b/test/e2e/scenarios.coffee @@ -18,7 +18,7 @@ angular.scenario.dsl 'contenteditable', -> , ($window, $document, done) -> elmt = $document.elements @name elmt.html args - elmt.trigger 'change' + elmt.trigger 'input' done(null, elmt.html(args)) angular.scenario.dsl 'scope', -> @@ -51,7 +51,7 @@ describe 'radians', -> describe 'contenteditable', -> describe 'simple application', -> beforeEach -> - browser().navigateTo 'base/examples/simple.html' + browser().navigateTo 'base/test/fixtures/simple.html' it 'should update the model from the view (simple text)', -> contenteditable('#input').enter('abc') diff --git a/examples/img/gb.gif b/test/fixtures/img/gb.gif similarity index 100% rename from examples/img/gb.gif rename to test/fixtures/img/gb.gif diff --git a/examples/img/ru.gif b/test/fixtures/img/ru.gif similarity index 100% rename from examples/img/ru.gif rename to test/fixtures/img/ru.gif diff --git a/examples/img/us.gif b/test/fixtures/img/us.gif similarity index 100% rename from examples/img/us.gif rename to test/fixtures/img/us.gif diff --git a/examples/simple.html b/test/fixtures/simple.html similarity index 76% rename from examples/simple.html rename to test/fixtures/simple.html index 41be196..66e376f 100644 --- a/examples/simple.html +++ b/test/fixtures/simple.html @@ -3,11 +3,11 @@ Simple - - - + + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + +