Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit c6b4b08c authored by Vincent Dubois's avatar Vincent Dubois

Verification connection obligatoire pour une requete + add de messageBox

parent bba03705
/// <reference path="typings/tsd.d.ts" />
/// <reference path="myTypings/tsd.d.ts" />
declare function osmtogeojson(any): any
/**
*
*
......@@ -23,11 +21,13 @@ class Geocropping {
/** Osm data user */
_user: Geocropping.USER = Geocropping.DEFAULT.USER;
_userMarker: L.Marker;
/** Groupe de layer des élément affiché */
_geoJSONLayers: L.GeoJSON;
/** Dernière position de l'utilisateur enregistré */
_lastUserLocation?: L.LatLng = null;
_featureDisplayed: { layer: L.Layer, note?: any }[] = [];
//
_featureDisplayed: IDictionary<{ layer: L.Layer, note?: any }> = {};
__locationFoundClick: L.EventHandlerFn;
......@@ -801,11 +801,10 @@ class Geocropping {
if (data.elements.length > 0) {
let geojson = osmtogeojson(data);
//Ajouter les donners sur la carte
this._geoJSONLayers.addData(geojson);
this._featureDisplayed = [];
this._featureDisplayed = {};
this._geoJSONLayers.getLayers().forEach((layer: any, index, array) => {
/**
......@@ -968,7 +967,7 @@ class Geocropping {
osm['tags'][tag["@attributes"].k] = tag["@attributes"].v;
}
}
feature.layer.feature = osmtogeojson({ elements: [osm] }).features[0];
(feature.layer as any).feature = osmtogeojson({ elements: [osm] }).features[0];
this._geoJSONLayers.resetStyle(feature.layer);
}
}
......
......@@ -51,11 +51,13 @@ class OauthOsm {
request: 'GetServerCapabilities',
params: {}
},
// online=true
GetPermissions: {
method: 'GET',
url: '/',
request: 'GetPermissions',
params: {}
params: {},
need_connection: true
},
GetDataBoundsBox: {
method: 'GET',
......@@ -68,17 +70,21 @@ class OauthOsm {
top: 0.5
}
},
// online=true
GetUserDetails: {
method: 'GET',
url: '/',
request: 'GetUserDetails',
params: {}
params: {},
need_connection: true
},
// online=true
GetUserPreference: {
method: 'GET',
url: '/',
request: 'GetUserPreferences',
params: {}
params: {},
need_connection: true
},
GetUserId: {
method: 'GET',
......@@ -371,7 +377,7 @@ class OauthOsm {
}).done((data) => {
//console.trace('myGeocropping', 'request ok connected:', this._connected);
if (this._connected == false) {
if (this._connected === false && apiRequest.need_connection === true) {
this._connected = true;
this.connect();
}
......
/// <reference path="Geocropping.d.ts" />
/// <reference path="OauthOsm.d.ts" />
\ No newline at end of file
/// <reference path="OauthOsm.d.ts" />
declare function osmtogeojson(any): any
interface IDictionary<TValue> {
[key: string]: TValue
}
\ No newline at end of file
......@@ -2,7 +2,6 @@
/// <reference path="../myTypings/tsd.d.ts" />
/// <reference types="leaflet" />
/// <reference types="jquery" />
declare function osmtogeojson(any: any): any;
/**
*
*
......@@ -16,12 +15,14 @@ declare class Geocropping {
/** Osm data user */
_user: Geocropping.USER;
_userMarker: L.Marker;
/** Groupe de layer des élément affiché */
_geoJSONLayers: L.GeoJSON;
/** Dernière position de l'utilisateur enregistré */
_lastUserLocation?: L.LatLng;
_featureDisplayed: {
_featureDisplayed: IDictionary<{
layer: L.Layer;
note?: any;
}[];
}>;
__locationFoundClick: L.EventHandlerFn;
_map_minZoom: number;
_map_maxZoom: number;
......
......@@ -32,6 +32,7 @@ declare class OauthOsm {
url: string;
request: string;
params: {};
need_connection: boolean;
};
GetDataBoundsBox: {
method: string;
......@@ -49,12 +50,14 @@ declare class OauthOsm {
url: string;
request: string;
params: {};
need_connection: boolean;
};
GetUserPreference: {
method: string;
url: string;
request: string;
params: {};
need_connection: boolean;
};
GetUserId: {
method: string;
......
Copyright (c) 2015, Martijn Grendelman
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of leaflet-messagebox nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
......@@ -143,7 +143,7 @@ class Geocropping
$headers['Content-Type'] = 'application/json';
$str = simplexml_load_string($str);
}
return [res => [body => $str, headers => $headers], req => [body => $content/*, header=>$options['http']['header']*/]];
return [res => [body => $str, headers => $headers], req => [body => $content, header=>$options['http']['header'], url=> $url]];
}
static function getMime($data)
......
......@@ -70,9 +70,9 @@ switch ($_REQUEST['action']) {
die();
}*/
if ($_SESSION['devMode'] && $data['res']['headers']['response_code'] == 401) {
/*if ($_SESSION['devMode'] && $data['res']['headers']['response_code'] == 401) {
$data['res']['headers']['response_code'] = 400;
}
}*/
http_response_code($data['res']['headers']['response_code']);
// réponse ok
......
......@@ -40,12 +40,14 @@ if (empty($_SERVER['HTTPS'])) {
-->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="leaflet-messagebox.css" />
<script src="js/osmtogeojson.js"></script>
<script src="js/leaflet.pattern.js"></script>
<script src="js/fr.js"></script>
<script src="js/OauthOsm.js"></script>
<script src="js/Geocropping.js"></script>
<script src="js/index.js"></script>
<script src="js/leaflet-messagebox.js"></script>
</head>
<body>
......
......@@ -13,8 +13,10 @@ var Geocropping = (function () {
this._map = null;
/** Osm data user */
this._user = Geocropping.DEFAULT.USER;
/** Dernière position de l'utilisateur enregistré */
this._lastUserLocation = null;
this._featureDisplayed = [];
//
this._featureDisplayed = {};
/*
* MAP SETTINGS
*/
......@@ -686,7 +688,7 @@ var Geocropping = (function () {
var geojson = osmtogeojson(data);
//Ajouter les donners sur la carte
_this._geoJSONLayers.addData(geojson);
_this._featureDisplayed = [];
_this._featureDisplayed = {};
_this._geoJSONLayers.getLayers().forEach(function (layer, index, array) {
/**
* Supprimer les éléments distant
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -43,11 +43,13 @@ var OauthOsm = (function () {
request: 'GetServerCapabilities',
params: {}
},
// online=true
GetPermissions: {
method: 'GET',
url: '/',
request: 'GetPermissions',
params: {}
params: {},
need_connection: true
},
GetDataBoundsBox: {
method: 'GET',
......@@ -60,17 +62,21 @@ var OauthOsm = (function () {
top: 0.5
}
},
// online=true
GetUserDetails: {
method: 'GET',
url: '/',
request: 'GetUserDetails',
params: {}
params: {},
need_connection: true
},
// online=true
GetUserPreference: {
method: 'GET',
url: '/',
request: 'GetUserPreferences',
params: {}
params: {},
need_connection: true
},
GetUserId: {
method: 'GET',
......@@ -351,7 +357,7 @@ var OauthOsm = (function () {
data: data
}).done(function (data) {
//console.trace('myGeocropping', 'request ok connected:', this._connected);
if (_this._connected == false) {
if (_this._connected === false && apiRequest.need_connection === true) {
_this._connected = true;
_this.connect();
}
......
This diff is collapsed.
L.Control.Messagebox = L.Control.extend({
options: {
position: 'topright',
timeout: 3000
},
onAdd: function (map) {
this._container = L.DomUtil.create('div', 'leaflet-control-messagebox');
//L.DomEvent.disableClickPropagation(this._container);
return this._container;
},
show: function (message, timeout) {
var elem = this._container;
elem.innerHTML = message;
elem.style.display = 'block';
timeout = timeout || this.options.timeout;
if (typeof this.timeoutID == 'number') {
clearTimeout(this.timeoutID);
}
this.timeoutID = setTimeout(function () {
elem.style.display = 'none';
}, timeout);
}
});
L.Map.mergeOptions({
messagebox: false
});
L.Map.addInitHook(function () {
if (this.options.messagebox) {
this.messagebox = new L.Control.Messagebox();
this.addControl(this.messagebox);
}
});
L.control.messagebox = function (options) {
return new L.Control.Messagebox(options);
};
.leaflet-control-messagebox {
display: none; /* Initially hidden */
border: 2px solid red;
background-color: white;
padding: 3px 10px;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment