c80_map_floors 0.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.travis.yml +3 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +67 -0
  8. data/Rakefile +1 -0
  9. data/app/admin/c80_map_floors/floors.rb +57 -0
  10. data/app/admin/c80_map_floors/map_buildings.rb +49 -0
  11. data/app/admin/c80_map_floors/settings.rb +32 -0
  12. data/app/assets/javascripts/buttons/admin_buttons/button_area_link.js +91 -0
  13. data/app/assets/javascripts/buttons/admin_buttons/button_building_link.js +91 -0
  14. data/app/assets/javascripts/buttons/admin_buttons/button_cancel_create.js +21 -0
  15. data/app/assets/javascripts/buttons/admin_buttons/button_cancel_remove.js +23 -0
  16. data/app/assets/javascripts/buttons/admin_buttons/button_complete_create.js +22 -0
  17. data/app/assets/javascripts/buttons/admin_buttons/button_edit.js +96 -0
  18. data/app/assets/javascripts/buttons/admin_buttons/button_new.js +46 -0
  19. data/app/assets/javascripts/buttons/admin_buttons/button_remove.js +23 -0
  20. data/app/assets/javascripts/buttons/admin_buttons/button_save.js +111 -0
  21. data/app/assets/javascripts/buttons/button_back_to_map.js +84 -0
  22. data/app/assets/javascripts/buttons/zoom_buttons.js +78 -0
  23. data/app/assets/javascripts/c80_map_floors.js.coffee +23 -0
  24. data/app/assets/javascripts/events/app_event.js +15 -0
  25. data/app/assets/javascripts/map_objects/area.js +251 -0
  26. data/app/assets/javascripts/map_objects/building.js +294 -0
  27. data/app/assets/javascripts/map_objects/dot.js +14 -0
  28. data/app/assets/javascripts/map_objects/floor.js +10 -0
  29. data/app/assets/javascripts/src/main.js +1421 -0
  30. data/app/assets/javascripts/src/state_controller.js +322 -0
  31. data/app/assets/javascripts/src/utils/map_utils.js +23 -0
  32. data/app/assets/javascripts/src/utils/opacity_buttons_utils.js +15 -0
  33. data/app/assets/javascripts/src/utils/utils.js +140 -0
  34. data/app/assets/javascripts/svg_elements/area_label.js +25 -0
  35. data/app/assets/javascripts/svg_elements/building_label.js +65 -0
  36. data/app/assets/javascripts/svg_elements/helper.js +36 -0
  37. data/app/assets/javascripts/svg_elements/polygon.js +194 -0
  38. data/app/assets/javascripts/view/save_preloader.js +30 -0
  39. data/app/assets/stylesheets/c80_map_floors.scss +4 -0
  40. data/app/assets/stylesheets/map.scss +1464 -0
  41. data/app/assets/stylesheets/view/buttons/area_order_button.scss +16 -0
  42. data/app/assets/stylesheets/view/buttons/back_to_map_button.scss +28 -0
  43. data/app/assets/stylesheets/view/elems/building_info.scss +54 -0
  44. data/app/assets/stylesheets/view/elems/free_areas_label.scss +116 -0
  45. data/app/assets/stylesheets/view/elems/map_objects/map_object_image_bg.scss +10 -0
  46. data/app/assets/stylesheets/view/modal_window.scss +13 -0
  47. data/app/assets/stylesheets/view/save_preloader.scss +206 -0
  48. data/app/controllers/c80_map_floors/ajax_controller.rb +65 -0
  49. data/app/controllers/c80_map_floors/application_controller.rb +6 -0
  50. data/app/controllers/c80_map_floors/map_ajax_controller.rb +70 -0
  51. data/app/helpers/c80_map_floors/application_helper.rb +28 -0
  52. data/app/models/c80_map_floors/area.rb +20 -0
  53. data/app/models/c80_map_floors/area_representator.rb +75 -0
  54. data/app/models/c80_map_floors/base_map_object.rb +41 -0
  55. data/app/models/c80_map_floors/building_representator.rb +72 -0
  56. data/app/models/c80_map_floors/floor.rb +37 -0
  57. data/app/models/c80_map_floors/map_building.rb +45 -0
  58. data/app/models/c80_map_floors/map_json.rb +35 -0
  59. data/app/models/c80_map_floors/setting.rb +32 -0
  60. data/app/uploaders/c80_map_floors/building_image_uploader.rb +31 -0
  61. data/app/uploaders/c80_map_floors/floor_image_uploader.rb +33 -0
  62. data/app/uploaders/c80_map_floors/map_image_uploader.rb +31 -0
  63. data/app/views/c80_map_floors/_map_row_index.html.erb +40 -0
  64. data/app/views/c80_map_floors/ajax/fetch_unlinked_areas.js.erb +7 -0
  65. data/app/views/c80_map_floors/ajax/fetch_unlinked_buildings.js.erb +7 -0
  66. data/app/views/c80_map_floors/ajax/map_edit_buttons.js.erb +36 -0
  67. data/app/views/c80_map_floors/ajax/shared/_map_creating.html.erb +6 -0
  68. data/app/views/c80_map_floors/ajax/shared/_map_editing.html.erb +4 -0
  69. data/app/views/c80_map_floors/ajax/shared/_map_removing.html.erb +5 -0
  70. data/app/views/c80_map_floors/ajax/shared/_select_list_unlinked_areas.html.erb +6 -0
  71. data/app/views/c80_map_floors/ajax/shared/_select_list_unlinked_buildings.html.erb +10 -0
  72. data/app/views/c80_map_floors/shared/_modal_window.html.erb +28 -0
  73. data/app/views/c80_map_floors/shared/_save_preloader.html.erb +3 -0
  74. data/app/views/c80_map_floors/shared/map_row/_area_order_button.html.erb +7 -0
  75. data/app/views/c80_map_floors/shared/map_row/_building_info.html.erb +17 -0
  76. data/bin/console +14 -0
  77. data/bin/setup +7 -0
  78. data/c80_map_floors.gemspec +28 -0
  79. data/config/routes.rb +4 -0
  80. data/db/migrate/20161015190000_create_c80_map_floors_settings.rb +8 -0
  81. data/db/migrate/20161015190001_create_c80_map_floors_map_buildings.rb +10 -0
  82. data/db/migrate/20161015190002_create_c80_map_floors_areas.rb +12 -0
  83. data/db/migrate/20161015190003_add_building_representator_to_c80_map_floors_buildings.rb +6 -0
  84. data/db/migrate/20161015190004_create_c80_map_floors_floors.rb +16 -0
  85. data/db/migrate/20161019111010_add_title_to_c80_map_floors_buildings.rb +5 -0
  86. data/db/migrate/20161020184040_add_coords_img_to_c80_map_floors_buildings.rb +5 -0
  87. data/db/seeds/c80_map_floors_01_fill_map_settings.rb +6 -0
  88. data/db/seeds/c80_map_floors_02_create_test_area.rb +7 -0
  89. data/lib/c80_map_floors.rb +8 -0
  90. data/lib/c80_map_floors/engine.rb +23 -0
  91. data/lib/c80_map_floors/version.rb +3 -0
  92. metadata +218 -0
@@ -0,0 +1,16 @@
1
+ #area_order_button {
2
+ width: auto;
3
+ padding: 0 15px;
4
+ position: absolute;
5
+ bottom: 15px;
6
+ right: 15px;
7
+ font-weight: normal;
8
+ border-radius: 2px;
9
+ }
10
+
11
+ // когда входим в здание - кнопка не видна
12
+ div.view_building {
13
+ #area_order_button {
14
+ display: none;
15
+ }
16
+ }
@@ -0,0 +1,28 @@
1
+ #BackToMapButton {
2
+ background-color: #3377A8;
3
+ color: #fff !important;
4
+ display: block;
5
+ font-size: 17px;
6
+ cursor: pointer;
7
+ text-align: center;
8
+ line-height: 50px;
9
+ width: 417px;
10
+ height: 50px;
11
+ z-index: 5;
12
+ transition: opacity 0.6s ease-out;
13
+ -webkit-transition: all 0.6s ease-out;
14
+ -moz-transition: all 0.6s ease-out;
15
+ -ms-transition: all 0.6s ease-out;
16
+ -o-transition: all 0.6s ease-out;
17
+ position: absolute;
18
+ padding: 0 15px;
19
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
20
+ text-transform: uppercase;
21
+ /*font-family: FrankRegular, sans-serif;*/
22
+ font-weight: normal;
23
+
24
+ &:hover {
25
+ background-color: #5FCE4B;
26
+ }
27
+
28
+ }
@@ -0,0 +1,54 @@
1
+
2
+ .building_info {
3
+ position: absolute;
4
+ z-index: 5;
5
+ top: 10px;
6
+ padding: 20px;
7
+ background-color: #ededed;
8
+ display: none;
9
+ font-size: 14px;
10
+ min-width: 417px;
11
+
12
+ -webkit-transition: all 0.8s cubic-bezier(.25, .8, .25, 1);
13
+ -moz-transition: all 0.8s cubic-bezier(.25, .8, .25, 1);
14
+ transition: all 0.8s cubic-bezier(.25, .8, .25, 1);
15
+
16
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
17
+
18
+ h2 {
19
+ /*@include frankRegular(21px);*/
20
+ margin: -20px -20px 10px -20px;
21
+ padding: 20px;
22
+ text-transform: uppercase;
23
+ color: #ffffff;
24
+ background-color: #54658E;
25
+ }
26
+
27
+ ul {
28
+ list-style: none;
29
+ margin-left: 0;
30
+ padding-left: 0;
31
+ /*@include frankRegular(15px);*/
32
+
33
+ li {
34
+ overflow: hidden;
35
+
36
+ -webkit-transition: all 0.3s;
37
+ -moz-transition: all 0.3s;
38
+ transition: all 0.3s;
39
+
40
+ span {
41
+ color: #6f6f6f;
42
+ }
43
+ }
44
+ }
45
+
46
+ h5 {
47
+ border-top: 1px solid #14233C;
48
+ color: #1f283e;
49
+ margin-top: 18px;
50
+ padding-top: 18px;
51
+ /*@include frankRegular(21px);*/
52
+ }
53
+
54
+ }
@@ -0,0 +1,116 @@
1
+
2
+ g.free_areas_label {
3
+
4
+ > * {
5
+ transform-origin: 50% 50%;
6
+ transform: matrix(1, 0, 0, 1, 0, 0);
7
+ display: block;
8
+
9
+ &.text {
10
+ font-size: 40px;
11
+ font-weight: bold;
12
+ fill: #ffffff;
13
+ transform: translateY(12px) translateX(-12px);
14
+ text-shadow: 0 0 1px rgba(0, 0, 0, 0.58);
15
+ }
16
+
17
+ &.pulse {
18
+
19
+ animation: pulseAnimation 3s infinite;
20
+ transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
21
+ -webkit-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
22
+ -moz-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
23
+
24
+ fill: rgba(57, 189, 95, 0.39);
25
+ -webkit-animation-duration: 3s;
26
+ -moz-animation-duration: 3s;
27
+ animation-duration: 3s;
28
+
29
+ }
30
+
31
+ &.pulse2 {
32
+
33
+ animation: pulseAnimation 3s 0.75s infinite;
34
+ transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
35
+ -webkit-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
36
+ -moz-transition: all 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
37
+
38
+ fill: rgba(57, 189, 95, 0.69);
39
+
40
+ -webkit-animation-duration: 2s;
41
+ -moz-animation-duration: 2s;
42
+ animation-duration: 2s;
43
+
44
+ }
45
+
46
+ &.circle {
47
+ fill: rgba(57, 189, 95, 0.53);
48
+ }
49
+
50
+ &.line {
51
+ stroke: rgba(57, 189, 95, 0.99);
52
+ stroke-width: 1px;
53
+ }
54
+
55
+ }
56
+
57
+ }
58
+
59
+ @-webkit-keyframes pulseAnimation {
60
+ 0% {
61
+ -webkit-transform: scale(1);
62
+ opacity: 0
63
+ }
64
+ 20% {
65
+ opacity: 1
66
+ }
67
+ 75% {
68
+ -webkit-transform: scale(1.5);
69
+ opacity: 0
70
+ }
71
+ 100% {
72
+ opacity: 0
73
+ }
74
+ }
75
+
76
+ @-moz-keyframes pulseAnimation {
77
+ 0% {
78
+ -moz-transform: scale(1);
79
+ opacity: 0
80
+ }
81
+ 20% {
82
+ opacity: 1
83
+ }
84
+ 75% {
85
+ -moz-transform: scale(1.5);
86
+ opacity: 0
87
+ }
88
+ 100% {
89
+ opacity: 0
90
+ }
91
+ }
92
+
93
+ @keyframes pulseAnimation {
94
+ 0% {
95
+ -webkit-transform: scale(1);
96
+ -moz-transform: scale(1);
97
+ -ms-transform: scale(1);
98
+ -o-transform: scale(1);
99
+ transform: scale(1);
100
+ opacity: 0
101
+ }
102
+ 20% {
103
+ opacity: 1
104
+ }
105
+ 75% {
106
+ -webkit-transform: scale(1.5);
107
+ -moz-transform: scale(1.5);
108
+ -ms-transform: scale(1.5);
109
+ -o-transform: scale(1.5);
110
+ transform: scale(1.5);
111
+ opacity: 0
112
+ }
113
+ 100% {
114
+ opacity: 0
115
+ }
116
+ }
@@ -0,0 +1,10 @@
1
+ img.map_object_image_bg {
2
+ position: absolute;
3
+ -webkit-touch-callout: none;
4
+ -webkit-user-select: none;
5
+ -khtml-user-select: none;
6
+ -moz-user-select: none;
7
+ -ms-user-select: none;
8
+ user-select: none;
9
+ width: auto;
10
+ }
@@ -0,0 +1,13 @@
1
+ div#modal_window {
2
+
3
+ .modal-body {
4
+ font-size: 12px;
5
+ }
6
+
7
+ div.dropdown-menu.open {
8
+ border: none;
9
+ shadow:none;
10
+ background-color: transparent;
11
+ }
12
+
13
+ }
@@ -0,0 +1,206 @@
1
+ div#savePreloader {
2
+ position: absolute;
3
+ z-index: 100000;
4
+ top: 0;
5
+ left: 0;
6
+ bottom: 0;
7
+ right: 0;
8
+ background-color: rgba(0, 0, 0, .01);
9
+ display: none;
10
+ opacity: 0;
11
+ text-align: center; /*!*/
12
+ white-space: nowrap; /*!*/
13
+
14
+ transition: all 0.4s ease-in-out;
15
+ -webkit-transition: all 0.4s ease-in-out;
16
+ -moz-transition: all 0.4s ease-in-out;
17
+ -ms-transition: all 0.4s ease-in-out;
18
+ -o-transition: all 0.4s ease-in-out;
19
+
20
+ &.shown {
21
+ background-color: rgba(0, 0, 0, .4);
22
+ opacity: 1;
23
+ }
24
+
25
+ span.helper {
26
+ display: inline-block; /*!*/
27
+ vertical-align: middle; /*!*/
28
+ height: 100%; /*!*/
29
+ }
30
+
31
+ .uil-ring-css {
32
+ background: none;
33
+ position: relative;
34
+ width: 200px;
35
+ height: 200px;
36
+ vertical-align: middle; /*!*/
37
+ display: inline-block;
38
+ transform:scale(0.5);
39
+
40
+ > div {
41
+ position: absolute;
42
+ display: block;
43
+ width: 160px;
44
+ height: 160px;
45
+ top: 20px;
46
+ left: 20px;
47
+ border-radius: 80px;
48
+ box-shadow: 0 6px 0 0 #59ebff;
49
+ -ms-animation: uil-ring-anim 1s linear infinite;
50
+ -moz-animation: uil-ring-anim 1s linear infinite;
51
+ -webkit-animation: uil-ring-anim 1s linear infinite;
52
+ -o-animation: uil-ring-anim 1s linear infinite;
53
+ animation: uil-ring-anim 1s linear infinite;
54
+ }
55
+
56
+ &:before {
57
+ display:block;
58
+ position: absolute;
59
+ top:0;
60
+ left:0;
61
+ bottom:0;
62
+ right:0;
63
+ content: 'wait';
64
+ font-size:26px;
65
+ color: white;
66
+ margin-top: 80px;
67
+ }
68
+ }
69
+
70
+ }
71
+
72
+ @-webkit-keyframes uil-ring-anim {
73
+ 0% {
74
+ -ms-transform: rotate(0deg);
75
+ -moz-transform: rotate(0deg);
76
+ -webkit-transform: rotate(0deg);
77
+ -o-transform: rotate(0deg);
78
+ transform: rotate(0deg);
79
+ }
80
+ 100% {
81
+ -ms-transform: rotate(360deg);
82
+ -moz-transform: rotate(360deg);
83
+ -webkit-transform: rotate(360deg);
84
+ -o-transform: rotate(360deg);
85
+ transform: rotate(360deg);
86
+ }
87
+ }
88
+
89
+ @-webkit-keyframes uil-ring-anim {
90
+ 0% {
91
+ -ms-transform: rotate(0deg);
92
+ -moz-transform: rotate(0deg);
93
+ -webkit-transform: rotate(0deg);
94
+ -o-transform: rotate(0deg);
95
+ transform: rotate(0deg);
96
+ }
97
+ 100% {
98
+ -ms-transform: rotate(360deg);
99
+ -moz-transform: rotate(360deg);
100
+ -webkit-transform: rotate(360deg);
101
+ -o-transform: rotate(360deg);
102
+ transform: rotate(360deg);
103
+ }
104
+ }
105
+
106
+ @-moz-keyframes uil-ring-anim {
107
+ 0% {
108
+ -ms-transform: rotate(0deg);
109
+ -moz-transform: rotate(0deg);
110
+ -webkit-transform: rotate(0deg);
111
+ -o-transform: rotate(0deg);
112
+ transform: rotate(0deg);
113
+ }
114
+ 100% {
115
+ -ms-transform: rotate(360deg);
116
+ -moz-transform: rotate(360deg);
117
+ -webkit-transform: rotate(360deg);
118
+ -o-transform: rotate(360deg);
119
+ transform: rotate(360deg);
120
+ }
121
+ }
122
+
123
+ @-ms-keyframes uil-ring-anim {
124
+ 0% {
125
+ -ms-transform: rotate(0deg);
126
+ -moz-transform: rotate(0deg);
127
+ -webkit-transform: rotate(0deg);
128
+ -o-transform: rotate(0deg);
129
+ transform: rotate(0deg);
130
+ }
131
+ 100% {
132
+ -ms-transform: rotate(360deg);
133
+ -moz-transform: rotate(360deg);
134
+ -webkit-transform: rotate(360deg);
135
+ -o-transform: rotate(360deg);
136
+ transform: rotate(360deg);
137
+ }
138
+ }
139
+
140
+ @-moz-keyframes uil-ring-anim {
141
+ 0% {
142
+ -ms-transform: rotate(0deg);
143
+ -moz-transform: rotate(0deg);
144
+ -webkit-transform: rotate(0deg);
145
+ -o-transform: rotate(0deg);
146
+ transform: rotate(0deg);
147
+ }
148
+ 100% {
149
+ -ms-transform: rotate(360deg);
150
+ -moz-transform: rotate(360deg);
151
+ -webkit-transform: rotate(360deg);
152
+ -o-transform: rotate(360deg);
153
+ transform: rotate(360deg);
154
+ }
155
+ }
156
+
157
+ @-webkit-keyframes uil-ring-anim {
158
+ 0% {
159
+ -ms-transform: rotate(0deg);
160
+ -moz-transform: rotate(0deg);
161
+ -webkit-transform: rotate(0deg);
162
+ -o-transform: rotate(0deg);
163
+ transform: rotate(0deg);
164
+ }
165
+ 100% {
166
+ -ms-transform: rotate(360deg);
167
+ -moz-transform: rotate(360deg);
168
+ -webkit-transform: rotate(360deg);
169
+ -o-transform: rotate(360deg);
170
+ transform: rotate(360deg);
171
+ }
172
+ }
173
+
174
+ @-o-keyframes uil-ring-anim {
175
+ 0% {
176
+ -ms-transform: rotate(0deg);
177
+ -moz-transform: rotate(0deg);
178
+ -webkit-transform: rotate(0deg);
179
+ -o-transform: rotate(0deg);
180
+ transform: rotate(0deg);
181
+ }
182
+ 100% {
183
+ -ms-transform: rotate(360deg);
184
+ -moz-transform: rotate(360deg);
185
+ -webkit-transform: rotate(360deg);
186
+ -o-transform: rotate(360deg);
187
+ transform: rotate(360deg);
188
+ }
189
+ }
190
+
191
+ @keyframes uil-ring-anim {
192
+ 0% {
193
+ -ms-transform: rotate(0deg);
194
+ -moz-transform: rotate(0deg);
195
+ -webkit-transform: rotate(0deg);
196
+ -o-transform: rotate(0deg);
197
+ transform: rotate(0deg);
198
+ }
199
+ 100% {
200
+ -ms-transform: rotate(360deg);
201
+ -moz-transform: rotate(360deg);
202
+ -webkit-transform: rotate(360deg);
203
+ -o-transform: rotate(360deg);
204
+ transform: rotate(360deg);
205
+ }
206
+ }