Sha256: bd2888bbbb09389aa79579288681abfc267cdf8337651b1d9a167b2d9b872209

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

<script>
    (function() {
        if (window.tml_already_initialized) return;
        window.tml_already_initialized = true;

        var script = window.document.createElement('script');
        script.setAttribute('id', 'tml-tools');
        script.setAttribute('type', 'application/javascript');
        script.setAttribute('src', '<%= tml_application.tools['javascript'] %>');
        script.setAttribute('charset', 'UTF-8');
        script.onload = function() {
            Tml.Utils.insertCSS(window.document, "<%= tml_application.tools['stylesheet'] %>", false);
            Tml.app_key = '<%= tml_application.key %>';
            Tml.host = '<%= tml_application.tools['host'] %>';
            Tml.locale = '<%= tml_current_language.locale %>';
            Tml.current_source = '<%= tml_current_source %>';
            <%
              if tml_application.feature_enabled?(:shortcuts)
                 tml_application.shortcuts.each do |key, script|
            %>
            shortcut.add('<%=key.html_safe%>', function() {<%= script.html_safe %>});
            <%
                 end
              end
            %>
            if (typeof(tml_on_ready) === 'function') {
                tml_on_ready();
            }
        };
        window.document.getElementsByTagName('head')[0].appendChild(script);
    })();
</script>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tml-rails-5.2.7 app/views/tml_rails/tags/_scripts_tools.html.erb
tml-rails-5.2.5 app/views/tml_rails/tags/_scripts_tools.html.erb
tml-rails-5.2.2 app/views/tml_rails/tags/_scripts_tools.html.erb
tml-rails-5.2.1 app/views/tml_rails/tags/_scripts_tools.html.erb
tml-rails-5.1.2 app/views/tml_rails/tags/_scripts_tools.html.erb
tml-rails-5.1.1 app/views/tml_rails/tags/_scripts_tools.html.erb