Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions marketpulse/main/static/js/location.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
$(document).ready(function() {
"use strict";
'use strict';

var mapboxid = $("div#map").data("mapboxid");
var mapboxtoken = $("div#map").data("mapboxtoken");
var mapboxid = $('div#map').data('mapboxid');
var mapboxtoken = $('div#map').data('mapboxtoken');

L.mapbox.accessToken = mapboxtoken;
L.mapbox.config.FORCE_HTTPS = true;
var map = L.mapbox.map("map", mapboxid).setView([29, 22.5], 2);
var map = L.mapbox.map('map', mapboxid).setView([29, 22.5], 2);
var LocLayer = L.mapbox.featureLayer().addTo(map);
map.locate();

map.on("locationfound", function(e) {
map.on('locationfound', function(e) {
map.fitBounds(e.bounds);
LocLayer.setGeoJSON({
type: "Feature",
type: 'Feature',
geometry: {
type: "Point",
type: 'Point',
coordinates: [e.latlng.lng, e.latlng.lat]
},
properties: {
"marker-color": "#ff8888",
"marker-symbol": "star"
'marker-color': '#ff8888',
'marker-symbol': 'star'
}
});
$("#location-text").html("Click on map for adjusting location.");
$("#id_lat").val(e.latlng.lat);
$("#id_lng").val(e.latlng.lng);
$('#location-text').html('Click on map for adjusting location.');
$('#id_lat').val(e.latlng.lat);
$('#id_lng').val(e.latlng.lng);
});

map.on("click", function(e) {
$("#location-text").html("Click on map for adjusting location.");
map.on('click', function(e) {
$('#location-text').html('Click on map for adjusting location.');
LocLayer.setGeoJSON({
type: "Feature",
type: 'Feature',
geometry: {
type: "Point",
type: 'Point',
coordinates: [e.latlng.lng, e.latlng.lat]
},
properties: {
"marker-color": "#ff8888",
"marker-symbol": "star"
'marker-color': '#ff8888',
'marker-symbol': 'star'
}
});
$("#id_lat").val(e.latlng.lat);
$("#id_lng").val(e.latlng.lng);
$('#id_lat').val(e.latlng.lat);
$('#id_lng').val(e.latlng.lng);
});

map.on("locationerror", function() {
$("#location-text").html("Location error. Click on map for setting location");
map.on('locationerror', function() {
$('#location-text').html('Location error. Click on map for setting location');
});
});
32 changes: 16 additions & 16 deletions marketpulse/main/static/js/price_new.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
$(document).ready(function() {
"use strict";
'use strict';

$(function() {
$(".planprices").formset({
prefix: "plans",
deleteText: "Remove price",
addCssClass: "btn btn-default",
addText: "Add another price",
deleteCssClass: "btn btn-default"
$('.planprices').formset({
prefix: 'plans',
deleteText: 'Remove price',
addCssClass: 'btn btn-default',
addText: 'Add another price',
deleteCssClass: 'btn btn-default'
});
});

function displayLocationForm () {
var choice = $("#id_is_online:checked").val();
var choice = $('#id_is_online:checked').val();

if (choice === "on") {
$("#location").hide();
$("#onlineshop").show();
if (choice === 'on') {
$('#location').hide();
$('#onlineshop').show();
} else {
$("#location").show();
$("#onlineshop").hide();
$('#location').show();
$('#onlineshop').hide();
}
}

$(document).on("click", ".hasplan-check", function () {
$(document).on('click', '.hasplan-check', function () {
var n = $(this.checked).length;

if (n === 0) {
$(this).closest(".planprices").find(".hasplan").hide();
$(this).closest('.planprices').find('.hasplan').hide();
} else {
$(this).closest(".planprices").find(".hasplan").show();
$(this).closest('.planprices').find('.hasplan').show();
}
});

Expand Down