elm

How do I get the current time in Elm?

依然范特西╮ 提交于 2019-11-27 12:48:43
I'm running elm-repl to play around with the language. I'd like to see what the current time is. How would I do that? It doesn't appear to be possible with the current library. Why is that? EDIT: I made a package to help with this. http://package.elm-lang.org/packages/z5h/time-app This was asked around elm 0.15 - things are different in elm 0.17 & 0.18 : see How do I get the current time in Elm 0.17/0.18? Update for 0.19 It is not possible to get the current time using the standard library.. You need to use elm/time . As with 0.18, all you need is a command and Msg to handle the result type

File Upload in Elm

久未见 提交于 2019-11-27 03:10:33
问题 How does one upload a file (image or excel) in Elm? Can't seem to find any examples. The answer is fine even if the native code is used. Have seen Data in Elm-Html but it appears files and blobs are not supported. What is the way around this? 回答1: I am the author of the library MisterMetaphor refers to. It's easier to use than he explains though. Take a look at how I set up elm-package.json in the example: https://github.com/simonh1000/file-reader/blob/master/example/elm-package.json - just

How do I get the current time in Elm?

丶灬走出姿态 提交于 2019-11-26 16:10:20
问题 I'm running elm-repl to play around with the language. I'd like to see what the current time is. How would I do that? It doesn't appear to be possible with the current library. Why is that? EDIT: I made a package to help with this. http://package.elm-lang.org/packages/z5h/time-app This was asked around elm 0.15 - things are different in elm 0.17 & 0.18 : see How do I get the current time in Elm 0.17/0.18? 回答1: Update for 0.19 It is not possible to get the current time using the standard

修复png bug的脚本

依然范特西╮ 提交于 2019-11-26 11:51:01
代码 // IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support // (c) 2008 Angus Turnbull http://www.twinhelix.com // This is licensed under the GNU LGPL, version 2.1 or later. // For details, see: http://creativecommons.org/licenses/LGPL/2.1/ var IEPNGFix = window.IEPNGFix || {}; IEPNGFix.tileBG = function (elm, pngSrc, ready) { // Params: A reference to a DOM element, the PNG src file pathname, and a // hidden "ready-to-run" passed when called back after image preloading. var data = this .data[elm.uniqueID], elmW = Math.max(elm.clientWidth, elm.scrollWidth), elmH = Math.max(elm