From f296495a912ce759df11c43e78b4552788bdbff2 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Thu, 25 Jul 2019 14:30:04 +0200 Subject: Merge the v3 branch into separate namespace + fix Docker stuff (again) I was getting tired of having to keep two branches up-to-date with the latest developments, so decided to throw v3 into the same branch - just different files (...which will get mostly rewritten again soon). The two versions aren't very different in terms of dependencies, build system and support code, so they can now properly share files. Added a section to the README to avoid confusion. This merge also makes it easier to quickly switch between the different versions, which is handy for development. It's even possible to run both at the same time, but my scripts use the same port so that needs a workaround. And it's amazing how often I break the Docker scripts. --- elm3/Lib/Ffi.elm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 elm3/Lib/Ffi.elm (limited to 'elm3/Lib/Ffi.elm') diff --git a/elm3/Lib/Ffi.elm b/elm3/Lib/Ffi.elm new file mode 100644 index 00000000..6c3cbf46 --- /dev/null +++ b/elm3/Lib/Ffi.elm @@ -0,0 +1,29 @@ +-- Elm 0.19: "We've removed all Native modules and plugged all XSS vectors, +-- it's now impossible to talk with Javascript other than with ports!" +-- Me: "Oh yeah? I'll just run sed over the generated Javascript!" + +-- This module is a hack to work around the lack of an FFI (Foreign Function +-- Interface) in Elm. The functions in this module are stubs, their +-- implementations are replaced by the Makefile with calls to +-- window.elmFfi_ and the actual implementations are in static/v3/vndb.js. +-- +-- Use sparingly, all of this will likely break in future Elm versions. +module Lib.Ffi exposing (..) + +import Html exposing (Attribute) +import Html.Attributes exposing (title) + + +-- This is an "onclick = openLightbox(this)" attribute +openLightbox : Attribute msg +openLightbox = title "" + + +-- Set the innerHTML attribute of a node +innerHtml : String -> Attribute msg +innerHtml = always (title "") + + +-- The current year +curYear : Int +curYear = 2018 -- cgit v1.2.3