- bundle exec rake i18n:js:export
script:
- bundle exec rubocop -f fuubar
- - bundle exec rake jshint
+ - bundle exec rake eslint:run_all
- bundle exec erblint .
- bundle exec rake test:db
gem "capybara", "~> 2.13"
gem "coveralls", :require => false
gem "erb_lint", :require => false
+ gem "eslint-rails-ee"
+ gem "execjs"
gem "factory_bot_rails"
- gem "jshint"
gem "poltergeist"
gem "puma", "~> 3.7"
+ gem "therubyracer", :platforms => :ruby
end
coffee-script-source
execjs
coffee-script-source (1.12.2)
+ colorize (0.8.1)
composite_primary_keys (11.1.0)
activerecord (~> 5.2.1)
concurrent-ruby (1.1.5)
rubocop (~> 0.51)
smart_properties
erubi (1.8.0)
+ eslint-rails-ee (1.0.2)
+ colorize
+ execjs
+ railties (>= 3.2)
execjs (2.7.0)
exifr (1.3.6)
factory_bot (5.0.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- jshint (1.5.0)
- execjs (>= 1.4.0)
- multi_json (~> 1.0)
- therubyracer (~> 0.12.1)
json (2.2.0)
jsonify (0.3.1)
multi_json (~> 1.0)
delayed_job_active_record
dynamic_form
erb_lint
+ eslint-rails-ee
+ execjs
factory_bot_rails
fakefs
faraday
i18n-js (>= 3.0.0)
image_optim_rails
jquery-rails
- jshint
json
jsonify-rails
kgio
sanitize
sassc-rails
secure_headers
+ therubyracer
uglifier (>= 1.3.0)
validates_email_format_of (>= 1.5.1)
vendorer
$(document).ready(function () {
var loaderTimeout;
+ var map = new L.OSM.Map("map", {
+ zoomControl: false,
+ layerControl: false,
+ contextmenu: true
+ });
+
OSM.loadSidebarContent = function(path, callback) {
map.setSidebarOverlaid(false);
var params = OSM.mapParams();
- var map = new L.OSM.Map("map", {
- zoomControl: false,
- layerControl: false,
- contextmenu: true
- });
-
map.attributionControl.setPrefix('');
map.updateLayers(params.layers);
var expiry = new Date();
expiry.setYear(expiry.getFullYear() + 10);
+ var engines = OSM.Directions.engines;
+
+ engines.sort(function (a, b) {
+ a = I18n.t('javascripts.directions.engines.' + a.id);
+ b = I18n.t('javascripts.directions.engines.' + b.id);
+ return a.localeCompare(b);
+ });
+
+ var select = $('select.routing_engines');
+
+ engines.forEach(function(engine, i) {
+ select.append("<option value='" + i + "'>" + I18n.t('javascripts.directions.engines.' + engine.id) + "</option>");
+ });
+
function Endpoint(input, iconUrl) {
var endpoint = {};
input.on("change", function (e) {
awaitingGeocode = true;
-
+
// make text the same in both text boxes
var value = e.target.value;
endpoint.setValue(value);
.html(html);
// Add each row
- var cumulative = 0;
route.steps.forEach(function (step) {
var ll = step[0],
direction = step[1],
dist = step[3],
lineseg = step[4];
- cumulative += dist;
-
if (dist < 5) {
dist = "";
} else if (dist < 200) {
});
}
- var engines = OSM.Directions.engines;
-
- engines.sort(function (a, b) {
- a = I18n.t('javascripts.directions.engines.' + a.id);
- b = I18n.t('javascripts.directions.engines.' + b.id);
- return a.localeCompare(b);
- });
-
- var select = $('select.routing_engines');
-
- engines.forEach(function(engine, i) {
- select.append("<option value='" + i + "'>" + I18n.t('javascripts.directions.engines.' + engine.id) + "</option>");
- });
-
var chosenEngineIndex = findEngine('fossgis_osrm_car');
if ($.cookie('_osm_directions_engine')) {
chosenEngineIndex = findEngine($.cookie('_osm_directions_engine'));
initialize(function() {
var data = $('.details').data(),
latLng = L.latLng(data.coordinates.split(','));
- if (!map.getBounds().contains(latLng)) moveToNote();
+ if (!map.getBounds().contains(latLng)) moveToNote();
});
});
};
});
});
+ var markers = L.layerGroup().addTo(map);
+
function clickSearchMore(e) {
e.preventDefault();
e.stopPropagation();
e.stopPropagation();
}
- var markers = L.layerGroup().addTo(map);
-
var page = {};
page.pushstate = page.popstate = function(path) {
cache: true,
success: function () {
piwikTracker = Piwik.getTracker(base + "piwik.php", OSM.PIWIK.site);
-
+
if (OSM.user) {
piwikTracker.setUserId(OSM.user.toString());
}
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
-
+
$("meta[name=piwik-goal]").each(function () {
piwikTracker.trackGoal($(this).attr("content"));
});
/* Hide the preview panes */
$(".richtext_preview").hide();
- /*
+ /*
* When the text in an edit pane is changed, clear the contents of
* the associated preview pne so that it will be regenerated when
* the user next switches to it.
*/
- $(".richtext_content textarea").change(function () {
+ $(".richtext_content textarea").change(function () {
$(this).parents(".richtext_container").find(".richtext_preview").empty();
});
--- /dev/null
+{
+ "env": {
+ "browser": true,
+ "jquery": true
+ },
+ "extends": [
+ "eslint:recommended"
+ ],
+ "globals": {
+ "bowser": "readonly",
+ "I18n": "readonly",
+ "L": "readonly",
+ "OSM": "writable",
+ "Piwik": "readonly",
+ "querystring": "readonly",
+ "require": "readonly",
+ "updateLinks": "readonly"
+ },
+ "rules": {
+ "eqeqeq": ["error", "smart"],
+ "no-caller": "error",
+ "no-extend-native": "error",
+ "no-new": "error",
+ "no-trailing-spaces": "error",
+ "no-undef": "error",
+ "no-unused-vars": "error",
+ "no-use-before-define": ["error", {"functions": false}],
+ "semi": ["error", "always"]
+ }
+}
+++ /dev/null
-files:
- - "**/*.js"
-exclude_paths:
- - "app/assets/javascripts/i18n"
- - "vendor/assets/javascripts"
-options:
- eqeqeq: true
- freeze: true
- latedef: "nofunc"
- noarg: true
- noempty: true
- nonew: true
- undef: true
- browser: true
- jquery: true
- unused: true
- trailing: true
- globals:
- I18n: false
- L: true
- OSM: true
- Piwik: false
- alert: false
- escape: false
- maximiseMap: false
- minimiseMap: false
- querystring: true
- require: false
- updateLinks: false
- bowser: false