Lots of updates

This commit is contained in:
baldo 2016-05-16 13:33:49 +02:00
parent e3cfff8310
commit 39e7af6238
454 changed files with 221168 additions and 36622 deletions

View file

@ -1,6 +1,9 @@
{
"name": "angular-leaflet-directive",
"description": "AngularJS directive to embed an interact with maps managed by Leaflet library",
"author": "https://github.com/tombatossals/angular-leaflet-directive/graphs/contributors",
"description": "angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps",
"version": "0.10.0",
"homepage": "http://tombatossals.github.io/angular-leaflet-directive/",
"keywords": [
"angularjs",
"javascript",
@ -11,23 +14,41 @@
"dist/angular-leaflet-directive.js"
],
"dependencies": {
"angular": "1.2.x",
"leaflet-dist": "0.7.x"
"angular": "1.x",
"leaflet": "0.7.x"
},
"devDependencies": {
"jquery": "2.1.x",
"bootstrap": "3.1.x",
"angular-route": "1.2.x",
"angular-animate": "1.2.x",
"angular-mocks": "1.2.x",
"leaflet.markerclusterer": "0.4",
"leaflet.draw": "0.2.2",
"Leaflet.label": "0.2.1",
"jquery": "*",
"semantic-ui": "*",
"bootstrap": "*",
"prism": "*",
"angular-route": "1.x",
"angular-animate": "1.x",
"angular-mocks": "1.x",
"leaflet.markercluster": "*",
"leaflet.draw": "*",
"Leaflet.label": "*",
"leaflet-tilelayer-geojson": "*",
"Leaflet.utfgrid": "danzel/Leaflet.utfgrid",
"Leaflet.awesome-markers": "*",
"leaflet-providers": "*",
"leaflet.vector-markers": "*",
"webgl-heatmap-leaflet": "*",
"leaflet-plugins": "1.0.1",
"esri-leaflet": "0.0.1-beta.4"
"leaflet-plugins": "*",
"esri-leaflet": "*",
"proj4": "*",
"font-awesome": "*",
"proj4leaflet": "*",
"Leaflet.MakiMarkers": "*",
"Leaflet.heat": "https://github.com/Leaflet/Leaflet.heat/archive/gh-pages.tar.gz",
"Leaflet.ExtraMarkers": "https://github.com/coryasilva/Leaflet.ExtraMarkers/archive/v1.0.1.tar.gz",
"Leaflet.fullscreen": "http://github.com/Leaflet/Leaflet.fullscreen/archive/v0.0.4.tar.gz",
"Leaflet.PolylineDecorator": "bbecquet/Leaflet.PolylineDecorator",
"ionrangeslider": "*",
"leaflet-minimap": "*",
"esri-leaflet-clustered-feature-layer": "~1.0.x",
"esri-leaflet-heatmap-feature-layer": "~1.0.x",
"leaflet-search": "*"
},
"ignore": [
"**/.*",
@ -40,15 +61,13 @@
"package.json",
"bower.json"
],
"homepage": "https://github.com/tombatossals/angular-leaflet-directive",
"version": "0.7.7",
"_release": "0.7.7",
"_release": "0.10.0",
"_resolution": {
"type": "version",
"tag": "v0.7.7",
"commit": "f2b426b3daf3a3753bb76a3526956f14818f358c"
"tag": "v0.10.0",
"commit": "15323bc8c3bad3f2dedafbcfebb6772dc0813cfb"
},
"_source": "git://github.com/tombatossals/angular-leaflet-directive.git",
"_target": "~0.7.7",
"_source": "https://github.com/tombatossals/angular-leaflet-directive.git",
"_target": "~0.10.0",
"_originalSource": "angular-leaflet-directive"
}

View file

@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2012-2013 https://github.com/tombatossals/angular-leaflet-directive
Copyright (c) https://github.com/tombatossals/angular-leaflet-directive
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -0,0 +1,64 @@
{
"name": "angular-leaflet-directive",
"author": "https://github.com/tombatossals/angular-leaflet-directive/graphs/contributors",
"description": "angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps",
"version": "0.9.0",
"homepage": "http://tombatossals.github.io/angular-leaflet-directive/",
"keywords": [
"angularjs",
"javascript",
"directive",
"leaflet"
],
"main": [
"dist/angular-leaflet-directive.js"
],
"dependencies": {
"angular": "1.x",
"leaflet": "0.7.x"
},
"devDependencies": {
"jquery": "*",
"semantic-ui": "*",
"bootstrap": "*",
"prism": "*",
"angular-route": "1.x",
"angular-animate": "1.x",
"angular-mocks": "1.x",
"leaflet.markercluster": "*",
"leaflet.draw": "*",
"Leaflet.label": "*",
"leaflet-tilelayer-geojson": "*",
"Leaflet.utfgrid": "danzel/Leaflet.utfgrid",
"Leaflet.awesome-markers": "*",
"leaflet-providers": "*",
"leaflet.vector-markers": "*",
"webgl-heatmap-leaflet": "*",
"leaflet-plugins": "*",
"esri-leaflet": "*",
"proj4": "*",
"font-awesome": "*",
"proj4leaflet": "*",
"Leaflet.MakiMarkers": "*",
"Leaflet.heat": "https://github.com/Leaflet/Leaflet.heat/archive/gh-pages.tar.gz",
"Leaflet.ExtraMarkers": "https://github.com/coryasilva/Leaflet.ExtraMarkers/archive/v1.0.1.tar.gz",
"Leaflet.fullscreen": "http://github.com/Leaflet/Leaflet.fullscreen/archive/v0.0.4.tar.gz",
"Leaflet.PolylineDecorator": "bbecquet/Leaflet.PolylineDecorator",
"ionrangeslider": "*",
"leaflet-minimap": "*",
"esri-leaflet-clustered-feature-layer": "~1.0.x",
"esri-leaflet-heatmap-feature-layer": "~1.0.x",
"leaflet-search": "*"
},
"ignore": [
"**/.*",
"src",
"doc",
"examples",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"bower.json"
]
}

View file

@ -0,0 +1,114 @@
{
"coffeescript_error": {
"level": "error"
},
"arrow_spacing": {
"name": "arrow_spacing",
"level": "warn"
},
"no_tabs": {
"name": "no_tabs",
"level": "error"
},
"no_trailing_whitespace": {
"name": "no_trailing_whitespace",
"level": "warn",
"allowed_in_comments": false,
"allowed_in_empty_lines": true
},
"max_line_length": {
"name": "max_line_length",
"value": 125,
"level": "warn",
"limitComments": true
},
"line_endings": {
"name": "line_endings",
"level": "ignore",
"value": "unix"
},
"no_trailing_semicolons": {
"name": "no_trailing_semicolons",
"level": "error"
},
"indentation": {
"name": "indentation",
"value": 4,
"level": "error"
},
"camel_case_classes": {
"name": "camel_case_classes",
"level": "error"
},
"colon_assignment_spacing": {
"name": "colon_assignment_spacing",
"level": "warn",
"spacing": {
"left": 0,
"right": 1
}
},
"no_implicit_braces": {
"name": "no_implicit_braces",
"level": "ignore",
"strict": true
},
"no_plusplus": {
"name": "no_plusplus",
"level": "ignore"
},
"no_throwing_strings": {
"name": "no_throwing_strings",
"level": "error"
},
"no_backticks": {
"name": "no_backticks",
"level": "error"
},
"no_implicit_parens": {
"name": "no_implicit_parens",
"level": "ignore"
},
"no_empty_param_list": {
"name": "no_empty_param_list",
"level": "warn"
},
"no_stand_alone_at": {
"name": "no_stand_alone_at",
"level": "ignore"
},
"space_operators": {
"name": "space_operators",
"level": "warn"
},
"duplicate_key": {
"name": "duplicate_key",
"level": "error"
},
"empty_constructor_needs_parens": {
"name": "empty_constructor_needs_parens",
"level": "ignore"
},
"cyclomatic_complexity": {
"name": "cyclomatic_complexity",
"value": 10,
"level": "ignore"
},
"newlines_after_classes": {
"name": "newlines_after_classes",
"value": 3,
"level": "ignore"
},
"no_unnecessary_fat_arrows": {
"name": "no_unnecessary_fat_arrows",
"level": "warn"
},
"missing_fat_arrows": {
"name": "missing_fat_arrows",
"level": "ignore"
},
"non_empty_constructor_needs_parens": {
"name": "non_empty_constructor_needs_parens",
"level": "ignore"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,205 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var path = require('path');
var mkdirp = require('mkdirp');
var jsdom = require('jsdom');
var Q = require('q');
var onlyStandAlone = [
"0117-basic-routing-show-hide-map-example.html"
];
var isAnExample = function(filename) {
if (filename === '0000-viewer.html') {
return false;
}
return /[0-9][0-9][0-9][0-9].*\.html/.test(filename);
};
var isJavascript = function(filename) {
return /.*\.js/.test(filename);
};
var deleteFileIfJavascript = function(filename) {
var df = Q.defer();
if (isJavascript(filename)) {
fs.unlink(filename, function() {
df.resolve();
});
} else {
df.resolve();
}
return df.promise;
};
var cleanJavascriptFilesFromControllersDirectory = function(dir) {
var df = Q.defer();
fs.readdir(dir, function(err, list) {
var l = [];
var files = list.map(function(file) {
return path.join(dir, file);
});
files.forEach(deleteFileIfJavascript);
Q.allSettled(l).then(function(result) {
df.resolve();
});
});
return df.promise;
};
var writeController = function(script, examplefile, controllers_directory) {
var df = Q.defer();
var scriptLines = script.split('\n');
var outfilename;
var outScript = [];
for (var i = 0; i < scriptLines.length; i++) {
var line = scriptLines[i];
// Remove empty lines
if (line.replace(/^\s+|\s+$/g, '') === '') {
continue;
}
// Remove the module initializacion line
if (line.search('angular.module') !== -1) {
continue;
}
// Extract controller name
if (line.search('app.controller') !== -1 && !outfilename) {
var controller = line.match(/app.controller\((\'|\")([^'"]*)/);
if (controller && controller.length > 2 && controller[2]) {
outfilename = controller[2] + '.js';
}
}
outScript.push(line);
}
if (outfilename) {
outfilename = path.join(controllers_directory, outfilename);
if (!fs.existsSync(outfilename)) {
fs.writeFile(outfilename, outScript.join('\n'), function() {
df.resolve();
});
} else {
console.log('The controller name is duplicated: ' + outfilename)
df.reject();
}
} else {
console.log('Can\'t identify the controller name in the example ' + examplefile)
df.reject();
}
return df.promise;
};
var generateControllersFromExamples = function(examples_directory, controllers_directory) {
var df = Q.defer();
fs.readdir(examples_directory, function(err, list) {
var l = [];
list.forEach(function(filename) {
if (isAnExample(filename)) {
var html = fs.readFileSync(path.join(__dirname, 'examples', filename));
jsdom.env({
html: html.toString(),
done: function(err, window) {
var scripts = window.document.getElementsByTagName('script');
var last = scripts.length -1;
var script = scripts[last].innerHTML;
l.push(writeController(script, filename, controllers_directory));
}
});
}
});
Q.allSettled(l).then(function() {
df.resolve();
});
});
return df.promise;
};
var extractId = function(filename) {
var arr = filename.replace('.html', '').split('-');
arr.splice(0,2);
return arr.join('-');
};
var extractTitle = function(filename) {
var html = fs.readFileSync(path.join(__dirname, 'examples', filename));
var title;
var arr = html.toString().split('\n');
for (var i = 0; i< arr.length; i++) {
var line = arr[i];
if (line.search('<h1>') !== -1) {
title = line.replace('<h1>', '').replace('</h1>', '').replace(/^ */, '');
}
}
return title;
};
var extractDescription = function(filename) {
};
var extractDate = function(filename) {
var stats = fs.statSync(filename);
return stats.mtime;
};
var generateExamplesJSONFile = function(examples_directory, json_file) {
var df = Q.defer();
var examples = {};
fs.readdir(examples_directory, function(err, list) {
list.forEach(function(filename) {
if (isAnExample(filename)) {
var section = filename.split('-')[1];
var id = extractId(filename);
var extUrl = filename;
var title = extractTitle(filename);
var description = extractDescription(filename);
var date = extractDate(path.join(examples_directory, filename));
if (!(section in examples)) {
examples[section] = [];
}
examples[section].push({
date: date,
section: section,
onlyStandAlone: onlyStandAlone.indexOf(extUrl) !== -1,
id: '/' + section + '/' + id,
extUrl: extUrl,
title: title,
description: description
});
}
});
fs.writeFile(json_file, JSON.stringify(examples, null, 4), function(err) {
df.resolve();
});
});
return df.promise;
};
var controllers_directory = path.join(__dirname, 'examples', 'js', 'controllers');
mkdirp(controllers_directory, function(err) {
cleanJavascriptFilesFromControllersDirectory(controllers_directory).then(function() {
var examples_directory = path.join(__dirname, 'examples');
generateControllersFromExamples(examples_directory, controllers_directory).then(function() {
var json_file = path.join(__dirname, 'examples', 'json', 'examples.json');
generateExamplesJSONFile(examples_directory, json_file);
});
});
});

View file

@ -0,0 +1,54 @@
test:
- 'jshint'
- 'test-unit'
- 'test-e2e'
test-unit:
- 'karma:unit'
test-e2e:
- 'shell:protractor_update'
- 'connect:testserver'
- 'protractor:run'
test-e2e-firefox:
- 'shell:protractor_update'
- 'connect:testserver'
- 'protractor:firefox'
coverage:
- 'karma:unit_coverage'
- 'open:coverage'
- 'connect:coverage'
install:
- 'shell:npm_install'
- 'bower:install'
- 'shell:protractor_update'
default:
- 'build'
fast-build:
- 'clean:dist'
- 'jshint'
- 'jscs'
- 'concat:dist'
- 'ngAnnotate'
- 'uglify'
- 'concat:license'
- 'concat:license-minified'
build:
- 'fast-build'
- 'test-unit'
- 'clean:pre'
travis:
- 'fast-build'
- 'bower:install'
- 'test-unit'
examples:
- 'shell:examples'
- 'concat:examples'

View file

@ -0,0 +1,4 @@
{
"dist": ["dist"],
"pre": ["dist/*.pre.js"]
}

View file

@ -0,0 +1,36 @@
{
"dist": {
"options": {
"banner": "/*!\n* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today(\"yyyy-mm-dd\") %>\n* <%= pkg.description %>\n* <%= pkg.repository.type %>: <%= pkg.repository.url %>\n*/\n(function(angular){\n'use strict';\n",
"footer": "\n}(angular));"
},
"src": [
"src/directives/leaflet.js",
"src/services/*.js",
"src/**/*.js"
],
"dest": "dist/angular-leaflet-directive.pre.js"
},
"license": {
"src": [
"src/header-MIT-license.txt",
"dist/angular-leaflet-directive.no-header.js"
],
"dest": "dist/angular-leaflet-directive.js"
},
"license-minified": {
"src": [
"src/header-MIT-license.txt",
"dist/angular-leaflet-directive.min.no-header.js"
],
"dest": "dist/angular-leaflet-directive.min.js"
},
"examples": {
"options": {
"banner": "(function(angular){ \nvar app = angular.module('webapp');\n",
"footer": "}(angular));"
},
"src": ["examples/js/controllers/*.js"],
"dest": "examples/js/controllers.js"
}
}

View file

@ -0,0 +1,18 @@
{
"options": {
"base": ""
},
"testserver": {
"options": {
"port": 9999
}
},
"coverage": {
"options": {
"base": "coverage/",
"directory": "coverage/",
"port": 5555,
"keepalive": true
}
}
}

View file

@ -0,0 +1,7 @@
{
"src": ["src/directives/*.js", "src/services/**/*.js"],
"options": {
"config": ".jscsrc",
"fix": true
}
}

View file

@ -0,0 +1,14 @@
{
"options": {
"jshintrc": true
},
"source": {
"src": ["src/directives/*.js", "src/services/**/*.js"]
},
"tests": {
"src": ["test/unit/*.js", "test/e2e/*.js"]
},
"grunt": {
"src": ["Gruntfile.js"]
}
}

View file

@ -0,0 +1,7 @@
{
"unit": {
"configFile": "test/karma-unit.conf.js",
"autoWatch": false,
"singleRun": true
}
}

View file

@ -0,0 +1,8 @@
{
"options": {},
"dist": {
"files": {
"dist/angular-leaflet-directive.no-header.js": [ "dist/angular-leaflet-directive.pre.js" ]
}
}
}

View file

@ -0,0 +1,8 @@
{
"devserver": {
"path": "http://localhost:8888"
},
"coverage": {
"path": "http://localhost:5555"
}
}

View file

@ -0,0 +1,20 @@
{
"options": {
"keepAlive": false,
"configFile": "test/protractor.conf.js",
"nocolor": false,
"args": {
"specs": [ "test/e2e/*.js" ]
}
},
"run": {},
"saucelabs": {
"options": {
"args": {
"baseUrl": "http://tombatossals.github.io/angular-leaflet-directive/examples/",
"sauceUser": "<%= saucelabs.SAUCE_USERNAME %>",
"sauceKey": "<% saucelabs.SAUCE_ACCESS_KEY %>"
}
}
}
}

View file

@ -0,0 +1,21 @@
{
"options": {
"stdout": true
},
"selenium": {
"command": "node node_modules/protractor/bin/webdriver-manager start",
"options": {
"stdout": false,
"async": true
}
},
"protractor_update": {
"command": "node node_modules/protractor/bin/webdriver-manager update"
},
"npm_install": {
"command": "npm install"
},
"examples": {
"command": "node generate-examples.js"
}
}

View file

@ -0,0 +1,11 @@
{
"dist": {
"options": {
"banner": "/*!\n* <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today(\"yyyy-mm-dd\") %>\n* <%= pkg.description %>\n* <%= pkg.repository.type %>: <%= pkg.repository.url %>\n*/\n(function(angular){\n'use strict';\n",
"footer": "\n}(angular));"
},
"files": {
"dist/<%= pkg.name %>.min.no-header.js": ["dist/<%= pkg.name %>.no-header.js"]
}
}
}

View file

@ -0,0 +1,9 @@
{
"options": {
"livereload": 7777
},
"fast": {
"files": [ "src/**/*.js", "test/unit/**.js", "test/unit/**.coffee", "test/e2e/**.js" ],
"tasks": [ "fast-build" ]
}
}