Skip to content

Instantly share code, notes, and snippets.

@giisyu
Last active November 15, 2016 02:37
Show Gist options
  • Save giisyu/8800f79e075995600df73c2619bcd924 to your computer and use it in GitHub Desktop.
Save giisyu/8800f79e075995600df73c2619bcd924 to your computer and use it in GitHub Desktop.
Elm内にtwitterボタン等scriptタグがあるものを貼る ref: http://qiita.com/jooex/items/6757a1cf9a57fddb3829
import Html exposing (..)
import Html.Attributes exposing (..)
script_ : List (Attribute msg) -> List (Html msg) -> Html msg
script_ =
Html.node "script"
socialTwitterButton =
div []
[ a
[ class "twitter-follow-button"
, attribute "data-show-count" "false"
, href "https://twitter.com/joo_ex"
]
[ text "Follow @joo_ex" ]
, script_ []
[ text "!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';\n if(!d.getElementById(id)){js=d.createElement(s);\n js.id=id;\n js.src=p+'://platform.twitter.com/widgets.js';\n fjs.parentNode.insertBefore(js,fjs);\n }}(document, 'script', 'twitter-wjs');"
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment