Description:
jquery, bootstrap ok
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r865:8fe37a31b728 - - The requested commit is too big and content was truncated. 139 files changed. Show full diff
@@ -0,0 +1,9 | |||
|
1 | + import { Application } from "@hotwired/stimulus" | |
|
2 | + | |
|
3 | + const application = Application.start() | |
|
4 | + | |
|
5 | + // Configure Stimulus development experience | |
|
6 | + application.debug = false | |
|
7 | + window.Stimulus = application | |
|
8 | + | |
|
9 | + export { application } |
@@ -0,0 +1,7 | |||
|
1 | + import { Controller } from "@hotwired/stimulus" | |
|
2 | + | |
|
3 | + export default class extends Controller { | |
|
4 | + connect() { | |
|
5 | + this.element.textContent = "Hello World!" | |
|
6 | + } | |
|
7 | + } |
@@ -0,0 +1,11 | |||
|
1 | + // Import and register all your controllers from the importmap under controllers/* | |
|
2 | + | |
|
3 | + import { application } from "controllers/application" | |
|
4 | + | |
|
5 | + // Eager load all controllers defined in the import map under controllers/**/*_controller | |
|
6 | + import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" | |
|
7 | + eagerLoadControllersFrom("controllers", application) | |
|
8 | + | |
|
9 | + // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) | |
|
10 | + // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" | |
|
11 | + // lazyLoadControllersFrom("controllers", application) |
@@ -0,0 +1,11 | |||
|
1 | + //we need jquery to load first, this is enforced by | |
|
2 | + // doing | |
|
3 | + // <%= javascript_import_module_tag('prepen_jquery') %> | |
|
4 | + // before | |
|
5 | + // <%= javascript_importmap_tags %> | |
|
6 | + // (which loads application.js | |
|
7 | + | |
|
8 | + import jQuery from "jquery" | |
|
9 | + window.$ = window.jQuery = jQuery; | |
|
10 | + | |
|
11 | + console.log('i am prepend_jquery'); |
new file 100644 |
@@ -54,24 +54,25 | |||
|
54 | 54 | gem 'best_in_place', git: "https://github.com/mmotherwell/best_in_place" |
|
55 | 55 | |
|
56 | 56 | # jquery addition |
|
57 | - gem 'jquery-rails' | |
|
58 | - gem 'jquery-ui-rails' | |
|
57 | + #gem 'jquery-rails' | |
|
58 | + #gem 'jquery-ui-rails' | |
|
59 | 59 | #gem 'jquery-timepicker-addon-rails' |
|
60 | - gem 'jquery-tablesorter' | |
|
61 | - gem 'jquery-countdown-rails' | |
|
60 | + #gem 'jquery-tablesorter' | |
|
61 | + #gem 'jquery-countdown-rails' | |
|
62 | 62 | |
|
63 | 63 | #syntax highlighter |
|
64 | 64 | gem 'rouge' |
|
65 | 65 | |
|
66 | 66 | #bootstrap add-ons |
|
67 | - gem 'bootstrap-sass', '~> 3.4.1' | |
|
68 | - gem 'bootstrap-switch-rails' | |
|
69 |
- gem 'bootstrap- |
|
|
70 |
- |
|
|
71 | - gem 'momentjs-rails', '>= 2.9.0' | |
|
72 | - gem 'rails_bootstrap_sortable' | |
|
67 | + #gem 'bootstrap-sass', '~> 3.4.1' | |
|
68 | + gem 'bootstrap', '~> 5.2' | |
|
69 | + #gem 'bootstrap-switch-rails' | |
|
70 | + #gem 'bootstrap-toggle-rails' | |
|
71 | + #gem 'autoprefixer-rails' | |
|
72 | + #gem 'momentjs-rails', '>= 2.9.0' | |
|
73 | + #gem 'rails_bootstrap_sortable' | |
|
73 | 74 | #gem 'bootstrap-datepicker-rails' |
|
74 | - gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' | |
|
75 | + #gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' | |
|
75 | 76 | #gem 'jquery-datatables-rails' |
|
76 | 77 | |
|
77 | 78 | #----------- user interface ----------------- |
@@ -92,13 +92,10 | |||
|
92 | 92 | bindex (0.8.1) |
|
93 | 93 | bootsnap (1.13.0) |
|
94 | 94 | msgpack (~> 1.2) |
|
95 |
- bootstrap |
|
|
96 |
- autoprefixer-rails (>= |
|
|
97 | - sassc (>= 2.0.0) | |
|
98 |
- |
|
|
99 | - bootstrap-toggle-rails (2.2.1.0) | |
|
100 | - bootstrap3-datetimepicker-rails (4.17.47) | |
|
101 | - momentjs-rails (>= 2.8.1) | |
|
95 | + bootstrap (5.2.0) | |
|
96 | + autoprefixer-rails (>= 9.1.0) | |
|
97 | + popper_js (>= 2.11.5, < 3) | |
|
98 | + sassc-rails (>= 2.0.0) | |
|
102 | 99 | builder (3.2.4) |
|
103 | 100 | capybara (3.37.1) |
|
104 | 101 | addressable |
@@ -158,15 +155,6 | |||
|
158 | 155 | jbuilder (2.11.5) |
|
159 | 156 | actionview (>= 5.0.0) |
|
160 | 157 | activesupport (>= 5.0.0) |
|
161 | - jquery-countdown-rails (2.0.2) | |
|
162 | - jquery-rails (4.5.0) | |
|
163 | - rails-dom-testing (>= 1, < 3) | |
|
164 | - railties (>= 4.2.0) | |
|
165 | - thor (>= 0.14, < 2.0) | |
|
166 | - jquery-tablesorter (1.27.2) | |
|
167 | - railties (>= 3.2) | |
|
168 | - jquery-ui-rails (6.0.1) | |
|
169 | - railties (>= 3.2.16) | |
|
170 | 158 | listen (3.0.8) |
|
171 | 159 | rb-fsevent (~> 0.9, >= 0.9.4) |
|
172 | 160 | rb-inotify (~> 0.9, >= 0.9.7) |
@@ -185,8 +173,6 | |||
|
185 | 173 | builder |
|
186 | 174 | minitest (>= 5.0) |
|
187 | 175 | ruby-progressbar |
|
188 | - momentjs-rails (2.29.4.1) | |
|
189 | - railties (>= 3.1) | |
|
190 | 176 | msgpack (1.5.6) |
|
191 | 177 | multi_json (1.15.0) |
|
192 | 178 | mysql2 (0.5.4) |
@@ -207,6 +193,7 | |||
|
207 | 193 | nio4r (2.5.8) |
|
208 | 194 | nokogiri (1.13.8-x86_64-linux) |
|
209 | 195 | racc (~> 1.4) |
|
196 | + popper_js (2.11.5) | |
|
210 | 197 | public_suffix (5.0.0) |
|
211 | 198 | puma (5.6.5) |
|
212 | 199 | nio4r (~> 2.0) |
@@ -237,8 +224,6 | |||
|
237 | 224 | nokogiri (>= 1.6) |
|
238 | 225 | rails-html-sanitizer (1.4.3) |
|
239 | 226 | loofah (~> 2.3) |
|
240 | - rails_bootstrap_sortable (2.0.7) | |
|
241 | - momentjs-rails (>= 2.8.3) | |
|
242 | 227 | railties (7.0.4) |
|
243 | 228 | actionpack (= 7.0.4) |
|
244 | 229 | activesupport (= 7.0.4) |
@@ -325,13 +310,9 | |||
|
325 | 310 | DEPENDENCIES |
|
326 | 311 | ace-rails-ap |
|
327 | 312 | activerecord-session_store |
|
328 | - autoprefixer-rails | |
|
329 | 313 | best_in_place! |
|
330 | 314 | bootsnap |
|
331 |
- bootstrap |
|
|
332 | - bootstrap-switch-rails | |
|
333 | - bootstrap-toggle-rails | |
|
334 | - bootstrap3-datetimepicker-rails (~> 4.17.47) | |
|
315 | + bootstrap (~> 5.2) | |
|
335 | 316 | capybara |
|
336 | 317 | coffee-rails |
|
337 | 318 | debug |
@@ -342,19 +323,13 | |||
|
342 | 323 | importmap-rails (~> 1.1) |
|
343 | 324 | in_place_editing |
|
344 | 325 | jbuilder |
|
345 | - jquery-countdown-rails | |
|
346 | - jquery-rails | |
|
347 | - jquery-tablesorter | |
|
348 | - jquery-ui-rails | |
|
349 | 326 | listen (>= 3.0.5, < 3.2) |
|
350 | 327 | |
|
351 | 328 | minitest-reporters |
|
352 | - momentjs-rails (>= 2.9.0) | |
|
353 | 329 | mysql2 |
|
354 | 330 | puma |
|
355 | 331 | rails (~> 7.0) |
|
356 | 332 | rails-controller-testing |
|
357 | - rails_bootstrap_sortable | |
|
358 | 333 | rdiscount |
|
359 | 334 | rouge |
|
360 | 335 | sassc-rails |
@@ -1,5 +1,4 | |||
|
1 | 1 | //= link_tree ../images |
|
2 | - // x= link_directory ../javascripts .js | |
|
3 | 2 | //= link_directory ../stylesheets .css |
|
4 | 3 | //= link_tree ../../javascript .js |
|
5 | 4 | //= link_tree ../../../vendor/javascript .js |
@@ -14,27 +14,27 | |||
|
14 | 14 | * # *= require_self |
|
15 | 15 | */ |
|
16 | 16 | |
|
17 | - @import "jquery-ui"; | |
|
17 | + //@import "jquery-ui"; | |
|
18 | 18 | //@import "jquery.ui.core"; |
|
19 | 19 | //@import "jquery.ui.theme"; |
|
20 | 20 | //@import "jquery.ui.datepicker"; |
|
21 | 21 | //@import "jquery.ui.slider"; |
|
22 | 22 | //@import "jquery-ui-timepicker-addon"; |
|
23 | 23 | //@import "jquery-tablesorter/theme.metro-dark"; |
|
24 | - @import "jquery.countdown"; | |
|
25 | - @import "tablesorter-theme.cafe"; | |
|
24 | + //@import "jquery.countdown"; | |
|
25 | + //@import "tablesorter-theme.cafe"; | |
|
26 | 26 | |
|
27 | 27 | //bootstrap |
|
28 | - @import "bootstrap-sprockets"; | |
|
28 | + //@import "bootstrap-sprockets"; | |
|
29 | 29 | @import "bootstrap"; |
|
30 | 30 | @import "select2"; |
|
31 | 31 | @import "select2-bootstrap"; |
|
32 | 32 | |
|
33 | 33 | //@import bootstrap3-switch |
|
34 | - @import "bootstrap-toggle"; | |
|
35 | - @import "bootstrap-sortable"; | |
|
34 | + //@import "bootstrap-toggle"; | |
|
35 | + //@import "bootstrap-sortable"; | |
|
36 | 36 | //@import "bootstrap-datepicker3"; |
|
37 | - @import "bootstrap-datetimepicker"; | |
|
37 | + //@import "bootstrap-datetimepicker"; | |
|
38 | 38 | @import "datatables.net-bs/css/dataTables.bootstrap.min"; |
|
39 | 39 | @import "datatables.net-buttons-bs/css/buttons.bootstrap.min"; |
|
40 | 40 |
@@ -2,16 +2,19 | |||
|
2 | 2 | //import "@hotwired/turbo-rails" |
|
3 | 3 | //import "controllers" |
|
4 | 4 | // |
|
5 | - console.log('xxxxx') | |
|
6 |
- import |
|
|
7 | - //import pdfmake from "pdfmake" | |
|
5 | + | |
|
6 | + import pdfmake from "pdfmake" | |
|
8 | 7 | //import jszip from "jszip" |
|
9 | 8 | //import DataTable from "datatables.net-bs5" |
|
10 | - // | |
|
11 | - window.$ = window.jQuery = jQuery; | |
|
12 | 9 | //window.DataTable = DataTable(); |
|
13 | - // | |
|
10 | + | |
|
11 | + //bootstrap | |
|
12 | + //import * as bootstrap from "bootstrap" | |
|
13 | + import "bootstrap" | |
|
14 | + window.bootstrap = bootstrap | |
|
14 | 15 | console.log($); // ok |
|
15 |
- |
|
|
16 | + console.log(bootstrap) | |
|
17 | + console.log(jszip); | |
|
18 | + | |
|
16 | 19 | console.log('application.js ready') |
|
17 | 20 |
@@ -5,9 +5,15 | |||
|
5 | 5 | = stylesheet_link_tag "application", params[:controller], :media => "all" |
|
6 | 6 | = csrf_meta_tags |
|
7 | 7 | = csp_meta_tag |
|
8 | + = javascript_import_module_tag('prepend_jquery') | |
|
8 | 9 | = javascript_importmap_tags |
|
9 | 10 | = content_for :header |
|
10 | 11 | = yield :head |
|
12 | + -# %link{href:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css",rel:"stylesheet",integrity:"sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT",crossorigin:"anonymous"} | |
|
13 | + -# %script{src:"https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js",integrity:"sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3",crossorigin:"anonymous"} | |
|
14 | + -# %script{src:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js",integrity:"sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz",crossorigin:"anonymous"} | |
|
15 | + | |
|
16 | + | |
|
11 | 17 | |
|
12 | 18 | %body |
|
13 | 19 | - unless local_assigns[:skip_header] |
@@ -1,8 +1,12 | |||
|
1 | 1 | # Pin npm packages by running ./bin/importmap |
|
2 | 2 | |
|
3 | + #entry point | |
|
3 | 4 | pin "application", preload: true |
|
4 | - #pin_all_from "app/javascript/controllers", under: "controllers" | |
|
5 | + pin "prepend_jquery", preload: true | |
|
6 | + pin_all_from "app/javascript/controllers", under: "controllers" | |
|
5 | 7 | |
|
6 | - #pin "jquery" # @3.6.1 | |
|
7 | - #pin "pdfmake", to: "https://ga.jspm.io/npm:pdfmake@0.2.5/build/pdfmake.js" | |
|
8 | - pin "jquery", to: 'jquery-local.js' | |
|
8 | + pin "pdfmake", to: "https://ga.jspm.io/npm:pdfmake@0.2.5/build/pdfmake.js" | |
|
9 | + pin "jquery", to: 'jquery.js' | |
|
10 | + pin "bootstrap", to: "bootstrap.bundle.min.js" | |
|
11 | + #no need popper, because bundled already in bootstrap | |
|
12 | + #pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js" |
@@ -12,6 +12,8 | |||
|
12 | 12 | # application.js, application.css, and all non-JS/CSS in the app/assets |
|
13 | 13 | # folder are already added. |
|
14 | 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) |
|
15 | + Rails.application.config.assets.precompile += %w(bootstrap.min.js popper.js) | |
|
16 | + | |
|
15 | 17 | Rails.application.config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js'] |
|
16 | 18 | Rails.application.config.assets.precompile += ['local_jquery.js','tablesorter-theme.cafe.css'] |
|
17 | 19 | %w( announcements submissions configurations contests contest_management graders heartbeat |
file renamed from vendor/javascript/jquery-local.js to vendor/javascript/jquery.js |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
deleted file |
You need to be logged in to leave comments.
Login now