Skip to content

Commit 7cbb0ea

Browse files
authored
Merge pull request #37 from smellman/feature/dev-webpack
use webpack and integrate with typescript
2 parents f01e226 + 5a2e024 commit 7cbb0ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5394
-114105
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
.DS_Store
2+
node_modules
3+
# webpack generate files
4+
assets/javascripts/main.js
5+
assets/javascripts/main.js.*
6+
assets/javascripts/*.png
7+
assets/javascripts/*.svg
8+
assets/javascripts/*.ttf
9+
assets/javascripts/*.eot
10+
assets/javascripts/*.woff2
11+
assets/javascripts/*.woff
12+
13+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Redmine GTT plugins **require PostgreSQL/PostGIS** and will not work with SQLite
1919
- Redmine >= 4.0.0
2020
- PostgreSQL >= 9.6
2121
- PostGIS >= 2.4
22+
- NodeJS v14
23+
- yarn
2224

2325
## Installation
2426

@@ -34,11 +36,15 @@ To install Redmine GTT plugin, download or clone this repository in your Redmine
3436
```
3537
cd path/to/plugin/directory
3638
git clone https://github.com/gtt-project/redmine_gtt.git
39+
cd redmine_gtt
40+
yarn
41+
npx webpack
3742
```
3843

3944
Then run
4045

4146
```
47+
export GEM_PG_VERSION=your-pg-version # skip this line if redmine use pg 1.1.4.
4248
bundle install
4349
bundle exec rake redmine:plugins:migrate
4450
```

app/helpers/gtt_map_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ def map_tag(map: nil, layers: map&.layers,
3434
content_tag(:div, "", data: data, id: uid, class: 'ol-map'),
3535
javascript_tag("
3636
$(document).ready(function(){
37+
/*
3738
App.init({
3839
target: $('##{uid}')[0]
3940
});
41+
*/
42+
var target = document.getElementById('#{uid}');
43+
window.createGttClient(target);
4044
});
4145
")
4246
]

app/views/settings/gtt/_settings.html.erb

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<% Tracker.all.each do |t| %>
44
<p>
55
<%= content_tag :label, t.name %>
6-
<%= select_tag "settings[tracker_#{t.id}]", "<option>#{@settings["tracker_#{t.id}"]}</option>".html_safe %>
6+
<%= select_tag "settings[tracker_#{t.id}]", "<option>#{@settings["tracker_#{t.id}"]}</option>".html_safe %>
77
<i id="icon_settings_tracker_<%= t.id %>"></i>
88
</p>
99
<% end %>
@@ -72,16 +72,5 @@
7272
</div>
7373

7474
<%= javascript_tag do %>
75-
var glyph = ol.style.FontSymbol.prototype.defs.glyphs;
76-
for (var font in ol.style.FontSymbol.prototype.defs.fonts){
77-
for (var i in glyph){
78-
if (glyph[i].font == font){
79-
$("[id^='settings_tracker_']").append(new Option(glyph[i].name, i))
80-
}
81-
}
82-
}
83-
$("[id^='settings_tracker_']").change(function(){
84-
var trackerId = $(this).attr("id")
85-
$("#icon_" + trackerId).attr("class", $(this).val())
86-
})
75+
window.gtt_setting()
8776
<% end %>

assets/javascripts/fontmaki-def.js

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)