c80_map_floors 0.1.0.12 → 0.1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/buttons/admin_buttons/button_update_json.js +40 -0
- data/app/assets/javascripts/src/main.js +4 -1
- data/app/assets/javascripts/ui/tabs/tabs.js +2 -2
- data/app/assets/stylesheets/map.scss +14 -0
- data/app/controllers/c80_map_floors/ajax_controller.rb +5 -0
- data/app/views/c80_map_floors/ajax/map_edit_buttons.js.erb +6 -1
- data/app/views/c80_map_floors/ajax/update_map_json.js.erb +2 -0
- data/config/routes.rb +1 -0
- data/lib/c80_map_floors/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50f534c6084f5c188d5f141ef6d0f18ebd8df9c7
|
4
|
+
data.tar.gz: eb692e9196cde1ddfe4173815b988bb3e8fbcc5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10683282932bc7141992c1496c03303974a116b437d8b87ebf6a646620f926b0112fc0941675a19c3f6185c74a778ee7317ef60c865472ba4fb550d0af4f21b1
|
7
|
+
data.tar.gz: 82746892067cc5f2202d42628ec3138c3a15e0eafbff87222fcd3dc6be59fe16e4626702c31a8259b1b792d9b194508937f29bcbdb01495828f3e2ee2cc82867
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
// с помощью это кнопки можно перегенерировать locations.json
|
4
|
+
|
5
|
+
function UpdateJsonButton() {
|
6
|
+
|
7
|
+
var _this = this;
|
8
|
+
_this.el = null;
|
9
|
+
var _map = null;
|
10
|
+
|
11
|
+
// слушаем клик по кнопке
|
12
|
+
this.onClick = function (e) {
|
13
|
+
e.preventDefault();
|
14
|
+
|
15
|
+
_map.save_preloader_klass.show();
|
16
|
+
|
17
|
+
$.ajax({
|
18
|
+
url: '/ajax/update_map_json',
|
19
|
+
type: 'POST',
|
20
|
+
dataType: 'script'
|
21
|
+
}).done(this._on_map_json_updated);
|
22
|
+
|
23
|
+
};
|
24
|
+
|
25
|
+
this._on_map_json_updated = function () {
|
26
|
+
_map.save_preloader_klass.hide();
|
27
|
+
};
|
28
|
+
|
29
|
+
// инициализация
|
30
|
+
this.init = function (button_css_selector, link_to_map) {
|
31
|
+
_map = link_to_map;
|
32
|
+
_this.el = $(button_css_selector);
|
33
|
+
|
34
|
+
if (_this.el.length > 0) {
|
35
|
+
//mark_button_present = true;
|
36
|
+
_this.el.on('click', this.onClick);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
}
|
@@ -53,7 +53,7 @@ var InitMap = function (params) {
|
|
53
53
|
mapfill: true,
|
54
54
|
zoom: true,
|
55
55
|
zoombuttons: true,
|
56
|
-
maxscale:
|
56
|
+
maxscale: 3,
|
57
57
|
fitscale: 0.51,
|
58
58
|
skin: '', // css class name
|
59
59
|
scale: 1,
|
@@ -237,6 +237,9 @@ var InitMap = function (params) {
|
|
237
237
|
}).done(function () {
|
238
238
|
console.log('<ajax.done>');
|
239
239
|
|
240
|
+
self.edit_button_klass = new UpdateJsonButton();
|
241
|
+
self.edit_button_klass.init('.mapplic-update-json', self);
|
242
|
+
|
240
243
|
self.edit_button_klass = new EditButton();
|
241
244
|
self.edit_button_klass.init('.mapplic-edit-button', self);
|
242
245
|
|
@@ -300,7 +300,7 @@ function Tabs(options) {
|
|
300
300
|
}
|
301
301
|
|
302
302
|
if (mark_error_occurs) {
|
303
|
-
alert('data error, refer log for details.');
|
303
|
+
//alert('data error, refer log for details.');
|
304
304
|
console.log('<_displayContent> [ERROR] Что-то не то с данными.');
|
305
305
|
}
|
306
306
|
|
@@ -324,4 +324,4 @@ function Tabs(options) {
|
|
324
324
|
|
325
325
|
this._fInit(options);
|
326
326
|
|
327
|
-
}
|
327
|
+
}
|
@@ -447,6 +447,20 @@
|
|
447
447
|
}
|
448
448
|
}
|
449
449
|
|
450
|
+
&.mapplic-update-json {
|
451
|
+
border-radius: 0 0 1px 1px;
|
452
|
+
border-top: none;
|
453
|
+
|
454
|
+
&:after {
|
455
|
+
content: 'json';
|
456
|
+
font-size: 14px;
|
457
|
+
}
|
458
|
+
|
459
|
+
&.editing, &.edit_area, &.edit_floor {
|
460
|
+
background-color: #006ca1;
|
461
|
+
}
|
462
|
+
}
|
463
|
+
|
450
464
|
&.mapplic-new-button {
|
451
465
|
border-radius: 0 0 1px 1px;
|
452
466
|
border-top: none;
|
@@ -3,7 +3,12 @@
|
|
3
3
|
//console.log("<js.erb>");
|
4
4
|
|
5
5
|
var $btn_layer = $("<%= params[:div_css_selector] %>");
|
6
|
-
var $html
|
6
|
+
var $html;
|
7
|
+
|
8
|
+
$html = $('<a href="#" class="mapplic-update-json" title="Перегенировать locations.json"></a>');
|
9
|
+
$btn_layer.append($html);
|
10
|
+
|
11
|
+
$html = $('<a href="#" class="mapplic-edit-button"></a>');
|
7
12
|
$btn_layer.append($html);
|
8
13
|
|
9
14
|
$html = $('<a href="#" class="mapplic-remove-button mapplic-disabled" data-placement="right" data-toggle="tooltip" title="Удалить полигон"></a>');
|
data/config/routes.rb
CHANGED
@@ -11,5 +11,6 @@ C80MapFloors::Engine.routes.draw do
|
|
11
11
|
match '/ajax/fetch_unlinked_floors', to: 'ajax#fetch_unlinked_floors', via: :post
|
12
12
|
match '/ajax/fetch_unlinked_areas', to: 'ajax#fetch_unlinked_areas', via: :post
|
13
13
|
match '/ajax/find_shops', to: 'ajax#find_shops', via: :post
|
14
|
+
match '/ajax/update_map_json', to: 'ajax#update_map_json', via: :post
|
14
15
|
|
15
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_map_floors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- app/assets/javascripts/buttons/admin_buttons/button_new.js
|
122
122
|
- app/assets/javascripts/buttons/admin_buttons/button_remove.js
|
123
123
|
- app/assets/javascripts/buttons/admin_buttons/button_save.js
|
124
|
+
- app/assets/javascripts/buttons/admin_buttons/button_update_json.js
|
124
125
|
- app/assets/javascripts/buttons/button_back_to_map.js
|
125
126
|
- app/assets/javascripts/buttons/zoom_buttons.js
|
126
127
|
- app/assets/javascripts/c80_map_floors.js.coffee
|
@@ -191,6 +192,7 @@ files:
|
|
191
192
|
- app/views/c80_map_floors/ajax/shared/_select_list_unlinked_areas.html.erb
|
192
193
|
- app/views/c80_map_floors/ajax/shared/_select_list_unlinked_buildings.html.erb
|
193
194
|
- app/views/c80_map_floors/ajax/shared/_select_list_unlinked_floors.html.erb
|
195
|
+
- app/views/c80_map_floors/ajax/update_map_json.js.erb
|
194
196
|
- app/views/c80_map_floors/shared/_modal_window.html.erb
|
195
197
|
- app/views/c80_map_floors/shared/_save_preloader.html.erb
|
196
198
|
- app/views/c80_map_floors/shared/map_row/_area_order_button.html.erb
|