Skip to content

Commit

Permalink
Merge cb0e570 into 14f8532
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre GIRAUD committed Jan 22, 2016
2 parents 14f8532 + cb0e570 commit 3842d96
Show file tree
Hide file tree
Showing 19 changed files with 884 additions and 222 deletions.
66 changes: 58 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ GMF_SRC_JS_FILES := $(shell find contribs/gmf/src -type f -name '*.js')
GMF_EXAMPLES_HTML_FILES := $(shell find contribs/gmf/examples -maxdepth 1 -type f -name '*.html')
GMF_EXAMPLES_JS_FILES := $(shell find contribs/gmf/examples -maxdepth 1 -type f -name '*.js')
GMF_APPS_MOBILE_JS_FILES := $(shell find contribs/gmf/apps/mobile/js -type f -name '*.js')
GMF_APPS_DESKTOP_JS_FILES := $(shell find contribs/gmf/apps/desktop/js -type f -name '*.js')
GMF_APPS_MOBILE_LESS_FILES := $(shell find contribs/gmf/less -type f -name '*.less')
GMF_APPS_DESKTOP_LESS_FILES := $(shell find contribs/gmf/less -type f -name '*.less')
GMF_APPS_LIBS_JS_FILES += \
node_modules/jquery/dist/jquery.min.js \
node_modules/angular/angular.min.js \
Expand All @@ -23,7 +25,8 @@ GMF_APPS_LIBS_JS_FILES += \

BUILD_EXAMPLES_CHECK_TIMESTAMP_FILES := $(patsubst examples/%.html,.build/%.check.timestamp,$(EXAMPLES_HTML_FILES)) \
$(patsubst contribs/gmf/examples/%.html,.build/contribs/gmf/%.check.timestamp,$(GMF_EXAMPLES_HTML_FILES)) \
.build/contribs/gmf/apps/mobile.check.timestamp
.build/contribs/gmf/apps/mobile.check.timestamp \
.build/contribs/gmf/apps/desktop.check.timestamp
EXAMPLE_HOSTED_REQUIREMENTS = .build/examples-hosted/lib/ngeo.js \
.build/examples-hosted/lib/ngeo-debug.js \
.build/examples-hosted/lib/ngeo.css \
Expand Down Expand Up @@ -106,7 +109,7 @@ apidoc: .build/apidoc
dist: dist/ngeo.js dist/ngeo-debug.js dist/gmf.js

.PHONY: check
check: lint dist check-examples test compile-examples build-gmf-mobile-app
check: lint dist check-examples test compile-examples build-gmf-mobile-app build-gmf-desktop-app

.PHONY: compile-examples
compile-examples: .build/examples/all.min.js
Expand All @@ -115,6 +118,10 @@ compile-examples: .build/examples/all.min.js
build-gmf-mobile-app: $(addprefix contribs/gmf/build/mobile,.js .css) \
$(addprefix contribs/gmf/build/gmf-,$(addsuffix .json, $(LANGUAGES)))

.PHONY: build-gmf-desktop-app
build-gmf-desktop-app: $(addprefix contribs/gmf/build/desktop,.js .css) \
$(addprefix contribs/gmf/build/gmf-,$(addsuffix .json, $(LANGUAGES)))

.PHONY: check-examples
check-examples: $(BUILD_EXAMPLES_CHECK_TIMESTAMP_FILES)

Expand All @@ -137,13 +144,15 @@ examples-hosted: $(EXAMPLE_HOSTED_REQUIREMENTS) \
$(patsubst examples/%.html,.build/examples-hosted/%.js,$(EXAMPLES_HTML_FILES)) \
$(patsubst contribs/gmf/examples/%.html,.build/examples-hosted/contribs/gmf/%.html,$(GMF_EXAMPLES_HTML_FILES)) \
$(patsubst contribs/gmf/examples/%.html,.build/examples-hosted/contribs/gmf/%.js,$(GMF_EXAMPLES_HTML_FILES)) \
.build/examples-hosted/contribs/gmf/apps/mobile/index.html
.build/examples-hosted/contribs/gmf/apps/mobile/index.html \
.build/examples-hosted/contribs/gmf/apps/desktop/index.html

.PHONY: gh-pages
gh-pages: .build/ngeo-$(GITHUB_USERNAME)-gh-pages \
.build/examples-hosted/index.html \
.build/examples-hosted/contribs/gmf/index.html \
.build/examples-hosted/contribs/gmf/apps/mobile/index.html \
.build/examples-hosted/contribs/gmf/apps/desktop/index.html \
.build/apidoc
cd $<; git fetch origin
cd $<; git merge --ff-only origin/gh-pages
Expand All @@ -162,11 +171,11 @@ gh-pages: .build/ngeo-$(GITHUB_USERNAME)-gh-pages \
.build/ngeo-$(GITHUB_USERNAME)-gh-pages:
git clone --branch gh-pages $(GIT_REMOTE_URL) $@

.build/gjslint.timestamp: $(SRC_JS_FILES) $(EXPORTS_JS_FILES) $(EXAMPLES_JS_FILES) $(GMF_SRC_JS_FILES) $(GMF_EXAMPLES_JS_FILES) $(GMF_APPS_MOBILE_JS_FILES)
.build/gjslint.timestamp: $(SRC_JS_FILES) $(EXPORTS_JS_FILES) $(EXAMPLES_JS_FILES) $(GMF_SRC_JS_FILES) $(GMF_EXAMPLES_JS_FILES) $(GMF_APPS_MOBILE_JS_FILES) $(GMF_APPS_DESKTOP_JS_FILES)
.build/python-venv/bin/gjslint --jslint_error=all --strict --custom_jsdoc_tags=event,fires,function,classdesc,api,observable,example,module,ngdoc,ngname,htmlAttribute $?
touch $@

.build/jshint.timestamp: $(SRC_JS_FILES) $(EXPORTS_JS_FILES) $(EXAMPLES_JS_FILES) $(GMF_SRC_JS_FILES) $(GMF_EXAMPLES_JS_FILES) $(GMF_APPS_MOBILE_JS_FILES)
.build/jshint.timestamp: $(SRC_JS_FILES) $(EXPORTS_JS_FILES) $(EXAMPLES_JS_FILES) $(GMF_SRC_JS_FILES) $(GMF_EXAMPLES_JS_FILES) $(GMF_APPS_DESKTOP_JS_FILES) $(GMF_APPS_MOBILE_JS_FILES)
./node_modules/.bin/jshint --verbose $?
touch $@

Expand Down Expand Up @@ -307,18 +316,22 @@ dist/gmf.js: buildtools/gmf.json \
mkdir -p $@
cp contribs/gmf/examples/data/* $@

.build/examples-hosted/contribs/gmf/fonts: contribs/gmf/fonts build-gmf-mobile-app
.build/examples-hosted/contribs/gmf/fonts: contribs/gmf/fonts build-gmf-mobile-app build-gmf-desktop-app
mkdir -p $(dir $@)
cp -r $< $(dir $@)

.build/examples-hosted/contribs/gmf/build: build-gmf-mobile-app
.build/examples-hosted/contribs/gmf/build: build-gmf-mobile-app build-gmf-desktop-app
mkdir -p $(dir $@)
cp -r contribs/gmf/build $(dir $@)

.build/examples-hosted/contribs/gmf/apps/mobile/js/mobile.js: contribs/gmf/apps/mobile/js/mobile.js
mkdir -p $(dir $@)
cp $< $(dir $@)

.build/examples-hosted/contribs/gmf/apps/desktop/js/desktop.js: contribs/gmf/apps/desktop/js/desktop.js
mkdir -p $(dir $@)
cp $< $(dir $@)

node_modules/angular/angular.min.js: .build/node_modules.timestamp

.PRECIOUS: .build/examples-hosted/%.html
Expand Down Expand Up @@ -373,6 +386,20 @@ node_modules/angular/angular.min.js: .build/node_modules.timestamp
-e 's|/@?main=mobile/js/mobile\.js|../../build/mobile.js|' \
-e '/mobile.js/i\ <script src="../../../../lib/Function.prototype.bind.js"></script>' $< > $@

.PRECIOUS: .build/examples-hosted/contribs/gmf/apps/desktop/index.html
.build/examples-hosted/contribs/gmf/apps/desktop/index.html: contribs/gmf/apps/desktop/index.html \
.build/examples-hosted/contribs/gmf/build \
.build/examples-hosted/contribs/gmf/fonts \
.build/examples-hosted/contribs/gmf/data \
.build/examples-hosted/contribs/gmf/apps/desktop/js/desktop.js
mkdir -p $(dir $@)
sed -e '/stylesheet\/less" href="..\/..\//d' \
-e '/\/node_modules\//d' \
-e '/default\.js/d' \
-e 's|utils/watchwatchers\.js|lib/watchwatchers.js|' \
-e 's|/@?main=desktop/js/desktop\.js|../../build/desktop.js|' \
-e '/desktop.js/i\ <script src="../../../../lib/Function.prototype.bind.js"></script>' $< > $@

.PRECIOUS: .build/examples-hosted/%.js
.build/examples-hosted/%.js: examples/%.js
mkdir -p $(dir $@)
Expand All @@ -391,6 +418,7 @@ node_modules/angular/angular.min.js: .build/node_modules.timestamp
mkdir -p $(dir $@)
.build/python-venv/bin/python buildtools/generate-examples-index.py \
--app 'Mobile application' apps/mobile/index.html 'The mobile example application for GeoMapFish.' \
--app 'Desktop application' apps/desktop/index.html 'The desktop example application for GeoMapFish.' \
$< $(GMF_EXAMPLES_HTML_FILES) > $@

.build/%.check.timestamp: .build/examples-hosted/%.html \
Expand All @@ -406,6 +434,11 @@ node_modules/angular/angular.min.js: .build/node_modules.timestamp
./node_modules/phantomjs/bin/phantomjs buildtools/check-example.js $<
touch $@

.build/contribs/gmf/apps/desktop.check.timestamp: .build/examples-hosted/contribs/gmf/apps/desktop/index.html
mkdir -p $(dir $@)
./node_modules/phantomjs/bin/phantomjs buildtools/check-example.js $<
touch $@

.build/node_modules.timestamp: package.json
npm install
mkdir -p $(dir $@)
Expand Down Expand Up @@ -520,18 +553,35 @@ contribs/gmf/build/mobile.closure.js: contribs/gmf/apps/mobile/build.json \
mkdir -p $(dir $@)
./node_modules/openlayers/node_modules/.bin/closure-util build $< $@

contribs/gmf/build/desktop.closure.js: contribs/gmf/apps/desktop/build.json \
$(EXTERNS_FILES) \
$(GMF_APPS_DESKTOP_JS_FILES) \
.build/gmftemplatecache.js \
.build/node_modules.timestamp
mkdir -p $(dir $@)
./node_modules/openlayers/node_modules/.bin/closure-util build $< $@

contribs/gmf/build/mobile.js: contribs/gmf/build/mobile.closure.js $(GMF_APPS_LIBS_JS_FILES)
awk 'FNR==1{print ""}1' $(GMF_APPS_LIBS_JS_FILES) $< > $@

contribs/gmf/build/desktop.js: contribs/gmf/build/desktop.closure.js $(GMF_APPS_LIBS_JS_FILES)
awk 'FNR==1{print ""}1' $(GMF_APPS_LIBS_JS_FILES) $< > $@

.PHONY: compile-css
compile-css: contribs/gmf/build/mobile.css
compile-css: contribs/gmf/build/mobile.css contribs/gmf/build/desktop.css

contribs/gmf/build/mobile.css: $(GMF_APPS_MOBILE_LESS_FILES) \
.build/node_modules.timestamp \
.build/font_awesome.timestamp
mkdir -p $(dir $@)
./node_modules/.bin/lessc contribs/gmf/apps/mobile/less/mobile.less $@ --autoprefix

contribs/gmf/build/desktop.css: $(GMF_APPS_DESKTOP_LESS_FILES) \
.build/node_modules.timestamp \
.build/font_awesome.timestamp
mkdir -p $(dir $@)
./node_modules/.bin/lessc contribs/gmf/apps/desktop/less/desktop.less $@ --autoprefix


# i18n

Expand Down
File renamed without changes.
69 changes: 69 additions & 0 deletions contribs/gmf/apps/desktop/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"src": [
"node_modules/openlayers/src/**/*.js",
"node_modules/openlayers/build/ol.ext/**/*.js",
"src/**/*.js",
"contribs/gmf/src/**/*.js",
"contribs/gmf/apps/appmodule.js",
"contribs/gmf/apps/desktop/js/desktop.js",
".build/gmftemplatecache.js"
],
"compile": {
"closure_entry_point": "app_desktop",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/esrijson.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
"node_modules/openlayers/externs/topojson.js",
"externs/angular-gettext.js",
"externs/d3.js",
"externs/typeahead.js",
"externs/mapfish-print-v3.js",
"externs/twbootstrap.js",
"externs/closure-compiler.js",
".build/externs/angular-1.4.js",
".build/externs/angular-1.4-q_templated.js",
".build/externs/angular-1.4-http-promise_templated.js",
".build/externs/jquery-1.9.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
],
"js": [
"contribs/gmf/apps/desktop/js/desktop.js",
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js",
"externs/ngeox.js",
"contribs/gmf/externs/gmf-themes.js",
"contribs/gmf/externs/gmfx.js"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"useOfGoogBase",
"unnecessaryCasts",
"lintChecks"
],
"extra_annotation_name": [
"api", "observable", "ngdoc", "ngname", "htmlAttribute"
],
"angular_pass": true,
"compilation_level": "ADVANCED",
"export_local_property_definitions": true,
"warning_level": "VERBOSE",
"generate_exports": true,
"language_in": "ECMASCRIPT5_STRICT",
"output_wrapper": "(function(){%output%}).call(window);",
"use_types_for_optimization": true,
"manage_closure_dependencies": true
}
}
12 changes: 12 additions & 0 deletions contribs/gmf/apps/desktop/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* The default ngeo template based URL, used as it by the template cache.
* @type {string}
*/
ngeo.baseTemplateUrl = '../../../../src/directives/partials';


/**
* The default gmf template based URL, used as it by the template cache.
* @type {string}
*/
gmf.baseTemplateUrl = '../../src/directives/partials';
91 changes: 91 additions & 0 deletions contribs/gmf/apps/desktop/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="{{desktopCtrl.lang}}" ng-app="app" ng-controller="DesktopController as mainCtrl">
<head>
<title translate>Desktop Application</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../build/desktop.css">
</head>
<body>
<header>
<div>
Put your logos or menus here
</div>
</header>
<main>
<div class="data-panel">
<div class="header">
</div>
</div>
<div class="tools" ngeo-resizemap="mainCtrl.map"
ngeo-resizemap-state="mainCtrl.toolsActive">
<div ngeo-btn-group class="bar btn-group-vertical" ngeo-btn-group-active="mainCtrl.toolsActive">
<button ngeo-btn class="btn btn-default" ng-model="loginActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Login'|translate}}">
<span class="fa fa-user"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="printActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Print'|translate}}">
<span class="fa fa-print"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="measureActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Measure tools'|translate}}">
<span class="fa fa-circle">
</button>
</div>
<div class="tools-content" ng-class="{active: mainCtrl.toolsActive}">
<div ng-show="loginActive">
<a class="btn close" ng-click="loginActive = false">&times;</a>
<div class="tools-content-heading">
Login
</div>
<gmf-authentication></gmf-authentication>
<br>
</div>
<div ng-show="printActive">
<a class="btn close" ng-click="printActive = false">&times;</a>
<div class="tools-content-heading">
Print
</div>
</div>
<div ng-show="measureActive">
<a class="btn close" ng-click="measureActive = false">&times;</a>
<div class="tools-content-heading">
Measure
</div>
</div>
</div>
</div>
<div class="map-container">
<div class="search">
<gmf-search gmf-search-map="mainCtrl.map"
gmf-search-datasources="mainCtrl.searchDatasources"
gmf-search-clearbutton="true">
</gmf-search>
</div>
<gmf-map class="gmf-map" gmf-map-map="mainCtrl.map"></gmf-map>
</div>
</main>
<script src="../../../../node_modules/jquery/dist/jquery.js"></script>
<script src="../../../../node_modules/angular/angular.js"></script>
<script src="../../../../node_modules/typeahead.js/dist/typeahead.bundle.js"></script>
<script src="../../../../node_modules/proj4/dist/proj4-src.js" type="text/javascript"></script>
<script src="../../../../node_modules/angular-gettext/dist/angular-gettext.js" type="text/javascript"></script>
<script src="../../../../node_modules/bootstrap/dist/js/bootstrap.js" type="text/javascript"></script>
<script src="../../../../node_modules/d3/d3.min.js" type="text/javascript"></script>
<script src="../../../../node_modules/less/dist/less.min.js"></script>
<script src="/@?main=desktop/js/desktop.js"></script>
<script src="default.js"></script>
<script src="../../../../utils/watchwatchers.js"></script>
<script>
(function() {
var module = angular.module('app');
var serverVars = {
serviceUrls: {
fulltextsearch: 'http://geomapfish-demo.camptocamp.net/2.0/wsgi/fulltextsearch?query=%QUERY'
}
};
module.constant('serverVars', serverVars);
})();
</script>
</body>
</html>
41 changes: 41 additions & 0 deletions contribs/gmf/apps/desktop/js/desktop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @fileoverview Application entry point.
*
* This file defines the "app_desktop" Closure namespace, which is be used as
* the Closure entry point (see "closure_entry_point" in the "build.json"
* file).
*
* This file includes `goog.require`'s for all the components/directives used
* by the HTML page and the controller to provide the configuration.
*/
goog.provide('app.DesktopController');
goog.provide('app_desktop');

goog.require('app');
goog.require('gmf.AbstractDesktopController');
/** @suppress {extraRequire} */
goog.require('gmf.authenticationDirective');


appModule.constant(
'authenticationBaseUrl',
'https://geomapfish-demo.camptocamp.net/2.0/wsgi');



/**
* @param {ngeo.FeatureOverlayMgr} ngeoFeatureOverlayMgr The ngeo feature
* overlay manager service.
* @param {Object} serverVars vars from GMF
* @constructor
* @extends {gmf.AbstractDesktopController}
* @ngInject
* @export
*/
app.DesktopController = function(ngeoFeatureOverlayMgr, serverVars) {
goog.base(this, ngeoFeatureOverlayMgr, serverVars);
};
goog.inherits(app.DesktopController, gmf.AbstractDesktopController);


appModule.controller('DesktopController', app.DesktopController);
1 change: 1 addition & 0 deletions contribs/gmf/apps/desktop/less/desktop.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import '../../../less/desktop.less';

0 comments on commit 3842d96

Please sign in to comment.