diff --git a/Gemfile.lock b/Gemfile.lock index 414d685f..ea119284 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,19 +3,17 @@ GEM specs: addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - adsf (1.5.0) + adsf (1.5.2) rack (>= 1.0.0, < 4.0.0) rackup (~> 2.1) - adsf-live (1.5.0) + adsf-live (1.5.2) adsf (~> 1.3) em-websocket (~> 0.5) eventmachine (~> 1.2) listen (~> 3.0) - rack-livereload (~> 0.3) autoprefixer-rails (10.4.19.0) execjs (~> 2) base64 (0.2.0) - bigdecimal (3.1.8) builder (3.3.0) coderay (1.1.3) colored (1.2) @@ -31,9 +29,7 @@ GEM execjs (2.9.1) ffi (1.17.0) formatador (1.1.0) - google-protobuf (4.28.2) - bigdecimal - rake (>= 13) + google-protobuf (3.25.5) guard (2.18.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -77,16 +73,17 @@ GEM lumberjack (1.2.10) memo_wise (1.10.0) method_source (1.1.0) - mime-types (3.5.2) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0903) + mime-types-data (3.2024.1001) mini_portile2 (2.8.7) - nanoc (4.13.0) + nanoc (4.12.21) addressable (~> 2.5) colored (~> 1.2) nanoc-checking (~> 1.0, >= 1.0.2) - nanoc-cli (= 4.13.0) - nanoc-core (= 4.13.0) + nanoc-cli (= 4.12.21) + nanoc-core (= 4.12.21) nanoc-deploying (~> 1.0) parallel (~> 1.12) tty-command (~> 0.8) @@ -94,13 +91,13 @@ GEM nanoc-checking (1.0.5) nanoc-cli (~> 4.12, >= 4.12.5) nanoc-core (~> 4.12, >= 4.12.5) - nanoc-cli (4.13.0) + nanoc-cli (4.12.21) cri (~> 2.15) diff-lcs (~> 1.3) - nanoc-core (= 4.13.0) + nanoc-core (= 4.12.21) pry zeitwerk (~> 2.1) - nanoc-core (4.13.0) + nanoc-core (4.12.21) base64 (~> 0.2) concurrent-ruby (~> 1.1) ddmetrics (~> 1.0) @@ -116,7 +113,7 @@ GEM nanoc-checking (~> 1.0) nanoc-cli (~> 4.11, >= 4.11.15) nanoc-core (~> 4.11, >= 4.11.15) - nanoc-live (1.1.0) + nanoc-live (1.0.0) adsf-live (~> 1.4) listen (~> 3.0) nanoc-cli (~> 4.11, >= 4.11.14) @@ -148,9 +145,7 @@ GEM mime-types (>= 3.0) websocket-driver (>= 0.6.0) racc (1.8.1) - rack (3.1.7) - rack-livereload (0.5.1) - rack + rack (3.1.8) rackup (2.1.0) rack (>= 3) webrick (~> 1.8) @@ -162,11 +157,11 @@ GEM rbtree (0.4.6) reline (0.5.10) io-console (~> 0.5) - rexml (3.3.7) + rexml (3.3.8) rubypants (0.7.1) - sass-embedded (1.79.3) - google-protobuf (~> 4.27) - rake (>= 13) + sass-embedded (1.69.5) + google-protobuf (~> 3.23) + rake (>= 13.0.0) sassc (2.4.0) ffi (~> 1.9) set (1.1.0) @@ -178,7 +173,7 @@ GEM stringio (3.1.1) terminal-notifier (2.0.0) terminal-notifier-guard (1.7.0) - terser (1.2.3) + terser (1.2.4) execjs (>= 0.3.0, < 3) thor (1.3.2) tty-color (0.6.0) diff --git a/content/assets/scripts/message.js b/content/assets/scripts/message.js index 280bc25d..8fc2d506 100644 --- a/content/assets/scripts/message.js +++ b/content/assets/scripts/message.js @@ -1,13 +1,22 @@ const form = $("#cammieForm"); -const formName = form.find('input[name="name"]'); -const formMessage = form.find('input[name="message"]'); +const formName = $('#cammieFormName'); +const formMessage = $('#cammieFormMessage'); const formButton = form.find('button[type="submit"]'); const responseError = $("#cammieFormResponseError"); const responseSuccess = $("#cammieFormResponseSuccess"); +const modal = $("#cammieFormModal"); +const modalName = $("#cammieModalName"); +const modalCancel = $("#cammieModalCancel"); $("#cammieForm").submit((e) => { e.preventDefault(); formButton.addClass("is-loading"); + + if (!formName.val() || formName.val() === "") { + modal.addClass("is-active"); + return + } + return $.ajax({ url: "https://kelder.zeus.ugent.be/messages/", contentType: "text/plain", @@ -30,3 +39,14 @@ $("#cammieForm").submit((e) => { }, }); }); + +$("#cammieModalSend").on("click", e => { + modal.removeClass("is-active"); + formName.val(modalName.val() || "-"); + modal.removeClass("is-active"); + form.submit(); +}); + +$("#cammieModalCancel").on("click", e => { + modal.removeClass("is-active"); +}); diff --git a/content/cammie.erb b/content/cammie.erb index 20ce22f1..359367d0 100644 --- a/content/cammie.erb +++ b/content/cammie.erb @@ -104,12 +104,35 @@ socket.on('replymessage', function(obj) { + + +