<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to load resource files with require.js in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821468#M2751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14170110396102412 jive_macro_code" jivemacro_uid="_14170110396102412"&gt;
&lt;P&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;faUrl = &lt;SPAN style="color: #6a8759;"&gt;'/extensions/extensionName/lib/external/fontawesome/css/font-awesome.min.css'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;wiUtils.&lt;SPAN style="color: #ffc66d;"&gt;addStyleLinkToHeader&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'wiFonts-fa'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;faUrl)&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14170110395935584 jive_text_macro jive_macro_code" jivemacro_uid="_14170110395935584"&gt;
&lt;P&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;/**&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * Adds a style to the link header with the given id.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * If the style with the given key is already part of the header, nothing&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * will happen. &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #526d4a; font-weight: bold; font-style: italic;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;key of the &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #526d4a; font-weight: bold; font-style: italic;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;link to the style sheet.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; */&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;addStyleLinkToHeader&lt;/SPAN&gt;: &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;function &lt;/SPAN&gt;(key&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;link) {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $(document).&lt;SPAN style="color: #9876aa;"&gt;ready&lt;/SPAN&gt;(&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;function &lt;/SPAN&gt;() {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;idPattern = &lt;SPAN style="color: #6a8759;"&gt;'wiStyleLinked_' &lt;/SPAN&gt;+ key&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;($(&lt;SPAN style="color: #6a8759;"&gt;'#' &lt;/SPAN&gt;+ idPattern).&lt;SPAN style="color: #9876aa;"&gt;length &lt;/SPAN&gt;=== &lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;$lnk = $(document.&lt;SPAN style="color: #ffc66d;"&gt;createElement&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'link'&lt;/SPAN&gt;))&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'rel'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'stylesheet'&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'href'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;link)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'id'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;idPattern)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$(&lt;SPAN style="color: #6a8759;"&gt;"head"&lt;/SPAN&gt;).&lt;SPAN style="color: #ffc66d;"&gt;append&lt;/SPAN&gt;($lnk)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;And in the css file change the path relative to your css to point correctly to the font files:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14170110669884478" jivemacro_uid="_14170110669884478"&gt;
&lt;P&gt;&lt;SPAN style="color: #ffc66d;"&gt;url&lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;'../fonts/fontawesome-webfont.eot?v=4.0.3'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2014 14:09:44 GMT</pubDate>
    <dc:creator>Stefan_Walther</dc:creator>
    <dc:date>2014-11-26T14:09:44Z</dc:date>
    <item>
      <title>How to load resource files with require.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821467#M2750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to adopt a solution into an extension which uses font-awesome.css which loads font files from a sub-folder. Now I'm getting this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Failed to load resource: the server responded with a status of 404 (Not Found) &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:4848/"&gt;http://localhost:4848/&lt;/A&gt;&lt;STRONG&gt;fonts/fontawesome-webfont.woff&lt;/STRONG&gt;?v=4.2.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to place the resource files somewhere else or is there a way to load them or point the path to with require.js?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 08:28:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821467#M2750</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-11-26T08:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to load resource files with require.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821468#M2751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14170110396102412 jive_macro_code" jivemacro_uid="_14170110396102412"&gt;
&lt;P&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;faUrl = &lt;SPAN style="color: #6a8759;"&gt;'/extensions/extensionName/lib/external/fontawesome/css/font-awesome.min.css'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;wiUtils.&lt;SPAN style="color: #ffc66d;"&gt;addStyleLinkToHeader&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'wiFonts-fa'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;faUrl)&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14170110395935584 jive_text_macro jive_macro_code" jivemacro_uid="_14170110395935584"&gt;
&lt;P&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;/**&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * Adds a style to the link header with the given id.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * If the style with the given key is already part of the header, nothing&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * will happen. &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #526d4a; font-weight: bold; font-style: italic;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;key of the &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #526d4a; font-weight: bold; font-style: italic;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt;link to the style sheet.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #629755; font-style: italic;"&gt; */&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;addStyleLinkToHeader&lt;/SPAN&gt;: &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;function &lt;/SPAN&gt;(key&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;link) {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $(document).&lt;SPAN style="color: #9876aa;"&gt;ready&lt;/SPAN&gt;(&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;function &lt;/SPAN&gt;() {&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;idPattern = &lt;SPAN style="color: #6a8759;"&gt;'wiStyleLinked_' &lt;/SPAN&gt;+ key&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;($(&lt;SPAN style="color: #6a8759;"&gt;'#' &lt;/SPAN&gt;+ idPattern).&lt;SPAN style="color: #9876aa;"&gt;length &lt;/SPAN&gt;=== &lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;$lnk = $(document.&lt;SPAN style="color: #ffc66d;"&gt;createElement&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'link'&lt;/SPAN&gt;))&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'rel'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'stylesheet'&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'href'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;link)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$lnk.attr(&lt;SPAN style="color: #6a8759;"&gt;'id'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;idPattern)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;$(&lt;SPAN style="color: #6a8759;"&gt;"head"&lt;/SPAN&gt;).&lt;SPAN style="color: #ffc66d;"&gt;append&lt;/SPAN&gt;($lnk)&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; })&lt;SPAN style="color: #cc7832;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;And in the css file change the path relative to your css to point correctly to the font files:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #cc7832;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14170110669884478" jivemacro_uid="_14170110669884478"&gt;
&lt;P&gt;&lt;SPAN style="color: #ffc66d;"&gt;url&lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;'../fonts/fontawesome-webfont.eot?v=4.0.3'&lt;/SPAN&gt;)&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 14:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821468#M2751</guid>
      <dc:creator>Stefan_Walther</dc:creator>
      <dc:date>2014-11-26T14:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to load resource files with require.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821469#M2752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can certainly also use require.js but since the requirejs css plugin is not included it's a bit harder and you have to load the css with text! first then add it again to the header (as demonstrated in all the other examples where css is injected into the header).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 14:13:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821469#M2752</guid>
      <dc:creator>Stefan_Walther</dc:creator>
      <dc:date>2014-11-26T14:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to load resource files with require.js</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821470#M2753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;thanks this works good. I would prefer this method over require.js text! loading for all css files..&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 20:36:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-load-resource-files-with-require-js/m-p/821470#M2753</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-11-26T20:36:16Z</dc:date>
    </item>
  </channel>
</rss>

