geolocation added on offerCar and travel page

This commit is contained in:
arnaucode
2017-01-27 17:49:04 +01:00
parent d76ea5ca19
commit 2b36c80084
727 changed files with 299906 additions and 18 deletions

View File

@@ -0,0 +1,85 @@
{
"name": "ui-leaflet",
"author": "https://github.com/angular-ui/ui-leaflet/graphs/contributors",
"description": "ui-leaflet - An AngularJS directive to easily interact with Leaflet maps",
"version": "2.0.0",
"homepage": "http://angular-ui.github.io/ui-leaflet/",
"keywords": [
"angularjs",
"javascript",
"directive",
"leaflet",
"angular-ui"
],
"main": [
"dist/ui-leaflet.js"
],
"dependencies": {
"angular": "1.x",
"angular-simple-logger": "~0.1.4",
"leaflet": "~0.7.x"
},
"resolutions": {
"angular": "~1.5.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": "~0.5.0",
"leaflet.draw": "*",
"Leaflet.label": "*",
"leaflet-tilelayer-geojson": "*",
"Leaflet.utfgrid": "danzel/Leaflet.utfgrid",
"Leaflet.awesome-markers": "*",
"leaflet-providers": "~1.1.5",
"leaflet.vector-markers": "0.0.4",
"webgl-heatmap-leaflet": "*",
"leaflet-plugins": "*",
"esri-leaflet": "~1.0.4",
"proj4": "*",
"font-awesome": "~4.3.x",
"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",
"leaflet-minimap": "~2.2.0",
"esri-leaflet-clustered-feature-layer": "~1.0.x",
"esri-leaflet-heatmap-feature-layer": "~1.0.x",
"leaflet-search": "~1.5.8",
"highlightjs": "~8.8.0",
"angular-highlightjs": "~0.4.3"
},
"ignore": [
"dist/coverage/",
"dist/src/",
"website/",
"**/.*",
"src",
"doc",
"examples",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"dist/coverage/",
"logo.svg"
],
"_release": "2.0.0",
"_resolution": {
"type": "version",
"tag": "v2.0.0",
"commit": "919b862389ddddc85c197746f3126fd24de0dc42"
},
"_source": "https://github.com/angular-ui/ui-leaflet.git",
"_target": "^2.0.0",
"_originalSource": "ui-leaflet",
"_direct": true
}

View File

@@ -0,0 +1,23 @@
The MIT License
Copyright (c) https://github.com/angular-ui/ui-leaflet
Original 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,75 @@
{
"name": "ui-leaflet",
"author": "https://github.com/angular-ui/ui-leaflet/graphs/contributors",
"description": "ui-leaflet - An AngularJS directive to easily interact with Leaflet maps",
"version": "2.0.0",
"homepage": "http://angular-ui.github.io/ui-leaflet/",
"keywords": [
"angularjs",
"javascript",
"directive",
"leaflet",
"angular-ui"
],
"main": [
"dist/ui-leaflet.js"
],
"dependencies": {
"angular": "1.x",
"angular-simple-logger": "~0.1.4",
"leaflet": "~0.7.x"
},
"resolutions": {
"angular": "~1.5.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": "~0.5.0",
"leaflet.draw": "*",
"Leaflet.label": "*",
"leaflet-tilelayer-geojson": "*",
"Leaflet.utfgrid": "danzel/Leaflet.utfgrid",
"Leaflet.awesome-markers": "*",
"leaflet-providers": "~1.1.5",
"leaflet.vector-markers": "0.0.4",
"webgl-heatmap-leaflet": "*",
"leaflet-plugins": "*",
"esri-leaflet": "~1.0.4",
"proj4": "*",
"font-awesome": "~4.3.x",
"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",
"leaflet-minimap": "~2.2.0",
"esri-leaflet-clustered-feature-layer": "~1.0.x",
"esri-leaflet-heatmap-feature-layer": "~1.0.x",
"leaflet-search": "~1.5.8",
"highlightjs": "~8.8.0",
"angular-highlightjs": "~0.4.3"
},
"ignore": [
"dist/coverage/",
"dist/src/",
"website/",
"**/.*",
"src",
"doc",
"examples",
"test",
"*.md",
"Gruntfile.js",
"package.json",
"dist/coverage/",
"logo.svg"
]
}

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": "ignore",
"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"
}
}

5189
www/lib/ui-leaflet/dist/ui-leaflet.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

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,51 @@
module.exports =
test:[ 'jshint', 'testunit', 'teste2e']
testunit: ['karma']
teste2e:[ 'shell:protractor_update', 'connect:testserver', 'protractor:run']
teste2efirefox:[ 'shell:protractor_update', 'connect:testserver', 'protractor:firefox']
testcoverage: ['karma']
coverage:['karma', 'open:coverage', 'connect:coverage']
install:[ 'shell:npm_install','bower:install','shell:protractor_update']
default:['build']
# cause zsh always puts me in grunt folder
d:['default']
#force:on to keep failing specs from killing grunt
dev:['force:on', 'connect:devserver', 'open:devserver', 'concurrent:dev' ]
#continuos running specs
spec: [ 'fastbuild', 'concurrent:unit' ]
serve:['concurrent:watchServe']
s:['serve']
fastbuild:[ 'clean:dist', 'jshint' ,'babel', 'concat:dist', 'concat:distMapped', 'ngAnnotate']
dwatch:[ 'fastbuild', 'concurrent:unit' ]
build:[ 'fastbuild', 'uglify', 'testunit', 'concat:license', 'clean:pre' ]
travis:[ 'fastbuild', 'bower:install', 'testunit' ]
changelog: ['conventionalChangelog']
'bump@':[ 'bumponly', 'default', 'changelog', 'bumpcommit' ]
'bump@minor':[ 'bumponly:minor', 'default', 'changelog', 'bumpcommit' ]
'bump@major':[ 'bumponly:major', 'default', 'changelog', 'bumpcommit' ]
#To Update examples for Viewer
examples:[ 'shell:examples', 'concat:examples' ]
graph:['angular_architecture_graph']
website:['concurrent:website']

View File

@@ -0,0 +1,11 @@
'use strict';
module.exports = function (grunt, options) {
return {
diagram: {
files: {
"dist/architecture": ["dist/<%= pkg.name %>.js"]
}
}
};
};

View File

@@ -0,0 +1,20 @@
'use strict';
module.exports = function (grunt, options) {
return {
options: {
sourceMap: false,
compact: false,
presets: ['es2015']
},
dist: {
files: [{
expand: true,
cwd: 'src',
src: ['**/*.js'],
dest: 'dist/src',
ext: '.js'
}]
}
};
};

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (grunt, options) {
return {
install: {
// options: {
// targetDir: './bower_components',
// cleanup: true
// }
}
};
};

View File

@@ -0,0 +1,30 @@
'use strict';
module.exports = function (grunt, options) {
return {
options: {
files: ['package.json', 'bower.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: [
'CHANGELOG.md',
'package.json',
'bower.json',
'dist/<%= pkg.name %>.js',
'dist/<%= pkg.name %>.min.js',
'dist/<%= pkg.name %>.min.no-header.js',
'dist/<%= pkg.name %>.js',
'dist/<%= pkg.name %>_dev_mapped.js',
'dist/<%= pkg.name %>_dev_mapped.js.map',
'dist/architecture/**/*'
],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
};
};

View File

@@ -0,0 +1,9 @@
'use strict';
var pkg = require('./pkg');
module.exports = function (grunt, options) {
return {
dist: ["dist/"],
pre: ['dist/*.pre.js']
};
};

View File

@@ -0,0 +1,54 @@
'use strict';
var concatDist, concatDistMapped = null;
concatDist = {
options: {
banner: require('./utils/banner') + "(function(angular){\n" + "'use strict';\n",
footer: '\n}(angular));'
},
src: [
'dist/src/directives/leaflet.js',
'dist/src/services/*.js',
'dist/src/**/*.js'
],
dest: 'dist/<%= pkg.name %>.pre.js'
};
concatDistMapped = _.clone(concatDist, true);
concatDistMapped.options.sourceMap = true;
concatDistMapped.options.sourceMapName = "dist/<%= pkg.name %>_dev_mapped.js.map";
concatDistMapped.dest = "dist/<%= pkg.name %>_dev_mapped.js";
module.exports = function (grunt, options) {
return {
dist: concatDist,
distMapped: concatDistMapped,
license: {
src: [
'src/header-MIT-license.txt',
'dist/<%= pkg.name %>.min.no-header.js'
],
dest: 'dist/<%= pkg.name %>.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'
},
website: {
options: {
//separator: ';',
banner: '(function (angular) {\n',
footer: '})(window.angular);'
},
src: ['website/src/js/app.js', 'website/src/js/**/*.js'],
dest: 'website/dist/js/<%= pkg.name %>-webpage.js',
}
};
};

View File

@@ -0,0 +1,30 @@
'use strict';
module.exports = function (grunt, options) {
return {
watchServe: {
tasks: ['watch:fast', 'connect:webserver'],
options: {
logConcurrentOutput: true
}
},
unit: {
tasks: ['karma', 'watch:unit'],
options: {
logConcurrentOutput: true
}
},
dev: {
tasks: ['karma', 'watch:unit', 'watch:source'],
options: {
logConcurrentOutput: true
}
},
website: {
tasks: ['concat:website', 'watch:website', 'connect:webserver'],
options: {
logConcurrentOutput: true
}
}
};
};

View File

@@ -0,0 +1,35 @@
'use strict';
var getAvailPort = require('./utils/getAvailPort');
var port = getAvailPort(8888);
module.exports = function (grunt, options) {
return {
options: {
base: ''
},
webserver: {
options: {
port: port,
keepalive: true
}
},
devserver: {
options: {
port: 8888
}
},
testserver: {
options: {
port: 9999
}
},
coverage: {
options: {
base: 'coverage/',
directory: 'coverage/',
port: 5555,
keepalive: true
}
}
};
};

View File

@@ -0,0 +1,33 @@
'use strict';
var _pkg = require('../package.json');
var argv = require('yargs').argv;
/*
_pkg.nextVersion only works for patch updates
Using changelog in the workflow is not really recommended right now as changelog is not really able to be modified until
a new tag is released.
Using Yargs as a workaround which grunt should be used in this way:
`grunt changelog --ui_leaflet_ver SOME_TAG_NUMBER`
*/
module.exports = function (grunt, options) {
console.log('version:', argv.ui_leaflet_ver || _pkg.version);
return {
options: {
changelogOpts: {
// conventional-changelog options go here
preset: 'angular',
releaseCount: 0
},
context: {
currentTag: 'v' + (argv.ui_leaflet_ver || _pkg.version)
}
},
release: {
src: 'CHANGELOG.md'
}
};
};

View File

@@ -0,0 +1,11 @@
'use strict';
module.exports = function (grunt, options) {
// Options
return {
options: {
debug: true,
coverage_dir: 'coverage'
}
};
};

View File

@@ -0,0 +1,17 @@
'use strict';
var fs = require('fs');
module.exports = function (grunt, options) {
return {
options: JSON.parse(fs.readFileSync('.jshintrc')),
source: {
src: ['src/directives/*.js', 'src/services/*.js', 'website/js/**/*.js']
},
tests: {
src: ['test/unit/*.js', 'test/e2e/*.js']
},
grunt: {
src: ['Gruntfile.js']
}
};
};

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function ngAnnotate(grunt, options) {
return {
options: {},
dist: {
files: {
'dist/<%= pkg.name %>.js': ['dist/<%= pkg.name %>.pre.js']
}
}
};
};

View File

@@ -0,0 +1,12 @@
'use strict';
module.exports = function (grunt, options) {
return {
devserver: {
path: 'http://localhost:8888'
},
coverage: {
path: 'http://localhost:5555'
}
};
};

View File

@@ -0,0 +1,13 @@
'use strict';
module.exports = function (grunt, options) {
var pkgFunction = function () {
return grunt.file.readJSON('package.json')
};
//THIS extension forces the banner or whatever uses pkgFunction to always get the latest version
//where as pkg is only done once at grunt init.
_.extend(options, {
pkgFunction: pkgFunction
});
return pkgFunction();
};

View File

@@ -0,0 +1,23 @@
'use strict';
module.exports = function (grunt, options) {
return {
options: {
keepAlive: false,
configFile: 'test/protractor.conf.js',
args: {
specs: ['test/e2e/*.js']
}
},
run: {},
saucelabs: {
options: {
args: {
baseUrl: "http://<%= pkg.org %>.github.io/<%= pkg.name %>/examples/",
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY
}
}
}
};
};

View File

@@ -0,0 +1,25 @@
'use strict';
module.exports = function (grunt, options) {
return {
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,14 @@
'use strict';
module.exports = function (grunt, options) {
return {
options: {
banner: require('./utils/banner')
},
dist: {
files: {
'dist/<%= pkg.name %>.min.no-header.js': ['dist/<%= pkg.name %>.js']
}
}
};
};

View File

@@ -0,0 +1,6 @@
module.exports =
'/*!\n' +
'* <%= pkg.name %> <%= pkgFunction().version %> <%= grunt.template.today(\"yyyy-mm-dd\") %>\n' +
'* <%= pkg.description %>\n' +
'* <%= pkg.repository.type %>: <%= pkg.repository.url %>\n' +
'*/\n'

View File

@@ -0,0 +1,23 @@
var exec = require('shelljs').exec;
var isWin = /^win/.test(process.platform);
var isPortOpen = function (port) {
var cmd;
if (isWin)
cmd = 'netstat -an | find /i ":' + port + '" | find /i "listening"';
else
cmd = 'lsof -i:' + port + " | tail -n 1 | awk '{print $2}'";
var portResponse = exec(cmd, {
silent: true
}).output;
return portResponse ? false : true;
}
module.exports = function (startPort) {
while (!isPortOpen(startPort)) {
startPort += 1;
}
return startPort;
}

View File

@@ -0,0 +1,33 @@
const karmaLib = require('karma');
//<=0.12 || //^0.13
const twelveKarma = karmaLib.server ? karmaLib.server.start : undefined;
const thirteenKarma = karmaLib.Server || undefined;
const Karma = thirteenKarma || twelveKarma;
// console.log(Karma,true);
module.exports = (pathToKarmaFile, grunt) => {
var log;
log = grunt.log.oklns;
return (done, karmaConf) => {
var e, server;
if (karmaConf == null) {
karmaConf = require.resolve(pathToKarmaFile);
}
log('-- Karma Setup --');
try {
server = new Karma({
configFile: karmaConf,
singleRun: true
}, (code) => {
log("Karma Callback Code: " + code);
done(!code ? void 0 : false);
});
if (server.start)
server.start(); //^0.13
} catch (_error) {
e = _error;
log("KARMA ERROR: " + e);
return done(false);
}
};
};

View File

@@ -0,0 +1,50 @@
'use strict';
var getAvailPort = require('./utils/getAvailPort');
var port = getAvailPort(7777);
var _files = ['src/**/*.js'];
var _testFiles = ['test/unit/**.js', 'test/unit/**.coffee',
'test/e2e/**.js', 'test/unit/**/**.js', 'test/unit/**/**.coffee', 'test/e2e/**/**.js'];
module.exports = function (grunt, options) {
return {
// NOT WORTH THE PINTA when having multiple watches
// options: {
// livereload: port
// },
fast: {
files: _files,
tasks: [
'fastbuild',
'uglify',
'concat:license'
]
},
source: {
files: _files,
tasks: [
'fastbuild',
'uglify',
'testunit',
'concat:license'
]
},
unit: {
files: _testFiles,
tasks: [
'fastbuild',
'karma'
]
},
examples: {
files: ['examples/*.html'],
tasks: [
'examples'
]
},
website: {
files: ['website/src/js/app.js', 'website/src/js/**/*.js'],
tasks: ['jshint', 'concat:website', 'uglify'] //'ngmin'
}
};
};

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html ng-app="mainPage" lang="en">
<head>
<meta charset="UTF-8">
<!--<meta name="fragment" content="!">-->
<meta name="keywords" content="angularjs,leaflet,openstreetmap,javascript,directive,plugin,google maps">
<meta name="description" content="Leaflet directive for AngularJS">
<title>Leaflet directive for AngularJS</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="bower_components/highlightjs/styles/github.css" />
<link rel="stylesheet" type="text/css" href="http://cloud.github.com/downloads/lafeber/world-flags-sprite/flags32.css" />
<link rel="stylesheet" href="website/css/style.css" />
</head>
<body ng-cloak ng-controller="MainController">
<div class="container" ng-controller="HeaderController">
<header class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<a href="#!/" class="navbar-brand">ui-leaflet</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li ng-class="{ active: activeTab == 'getting-started' || activeTab == '' }"><a href="#!/getting-started">Getting started</a></li>
<li ng-class="{ active: activeTab == 'examples' }"><a ng-href="#!/examples/simple-map">Examples</a></li>
<li ng-class="{ active: activeTab == 'howto-extend' }"><a ng-href="#!/howto-extend">How to extend</a></li>
<li><a href="http://github.com/angular-ui/ui-leaflet">Github repository</a></li>
</ul>
</header>
<div class="banner">
<a class="forkme" href="https://github.com/angular-ui/ui-leaflet" rel="external">
<img src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub">
</a>
<leaflet center="center" defaults="defaults" events="events" id="header"></leaflet>
</div>
<div class="bottom-banner">
<div class="container">
Simple to use directive for easy embedding and interacting with a map managed with the <a href="http://leafletjs.com/">leaflet map library</a> on an <a href="http://angularjs.org">AngularJS</a> application.
</div>
</div>
</div>
<div class="container content">
<ng-view></ng-view>
</div>
<div class="container footer">
<footer role="contentinfo">
<p class="pull-right">Page built with <a href="http://leafletjs.com">LeafletJS</a>, <a href="http://angularjs.org/">AngularJS</a> and <a href="http://getbootstrap.com/">Bootstrap</a></p>
</footer>
</div>
<script src="https://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/leaflet/dist/leaflet.js"></script>
<script src="bower_components/leaflet-plugins/layer/tile/Google.js"></script>
<script src="bower_components/highlightjs/highlight.pack.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.min.js"></script>
<script src="bower_components/angular-highlightjs/angular-highlightjs.min.js"></script>
<script src="bower_components/angular-simple-logger/dist/angular-simple-logger.js"></script>
<script src="dist/ui-leaflet.js"></script>
<script src="website/dist/js/ui-leaflet-webpage.js"></script>
</body>
</html>