https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-02-07T10:38:41ZRedmineRedmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=453952013-02-07T10:38:41ZDaniel Felix
<ul><li><strong>Category</strong> set to <i>Administration</i></li><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul><p>1. and 4. could be integrated with something like this (from HTML5 Boilerplate)<br /><code><script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script><br /><script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script></code></p>
<p>2. The first line of the above mentioned code could be dynamic, which is generated depending on the settings in the administration.<br />There could be something like a pulldown (just local, jquery, microsoft, google, etc.)</p>
<p>3. Hm, well an automatic detection could be tricky. Example: jQuery updates to jQuery 2.x which possibly remove some function or change some function definition. This could break some features. I would prefer, that the developers choose which version should be used or not.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=453962013-02-07T10:50:48ZEtienne Massip
<ul></ul><p>Don't forget that Redmine can be deployed on a LAN not connected to the Internet.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=454232013-02-07T20:24:29ZJan Niggemann (redmine.org team member)jan.niggemann@redmine.org
<ul></ul><p>Etienne Massip wrote:</p>
<blockquote>
<p>Don't forget that Redmine can be deployed on a LAN not connected to the Internet.</p>
</blockquote>
<p>Wouldn't that match case no 4?</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=454312013-02-08T06:22:13ZBill Wang
<ul></ul><blockquote>
<p>3. Hm, well an automatic detection could be tricky. Example: jQuery updates to jQuery 2.x which possibly remove some function or change some function definition. This could break some features. I would prefer, that the developers choose which version should be used or not.</p>
</blockquote>
<p>I mean what versioin of lib we get from CDN should be same as the version from local bundled.<br />so it is same API whatever from CDN or local.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=454342013-02-08T08:15:14ZDaniel Felix
<ul></ul><p>Etienne Massip wrote:</p>
<blockquote>
<p>Don't forget that Redmine can be deployed on a LAN not connected to the Internet.</p>
</blockquote>
<p>Well this would be handled by my mentioned code above. If the extern server isn't available, the local code would be handled. <br />OR:<br />See my point two. If the user selects "none", just the local source would be used.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=454452013-02-08T11:27:37ZEtienne Massip
<ul></ul><p>I'm not sure Redmine should handle CDN configuration; administrators who want to have assets delivered by CDN should already be able to do such with some config:</p>
<pre><code class="ruby syntaxhl"> <span class="no">ActionController</span><span class="o">::</span><span class="no">Base</span><span class="p">.</span><span class="nf">asset_host</span> <span class="o">=</span> <span class="no">Proc</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="o">|</span><span class="n">source</span><span class="o">|</span>
<span class="k">if</span> <span class="n">source</span> <span class="o">~=</span> <span class="sr">/.*jquery.*/</span>
<span class="s2">"//ajax.googleapis.com/ajax/libs/jquery"</span>
<span class="k">end</span>
<span class="p">}</span>
</code></pre>
<p>(this is a hand-written untested probably nonfunctional example)</p>
<p>You can add fallback mechanism, etc.</p>
<p>See <a class="external" href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html">http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html</a>.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=458032013-02-17T10:26:30ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>JQuery and JQuery-UI are merged in Redmine assets so it wouldn't work. It's hacky anyway and would make the upgrade process painfull. That's the purpose of this request to make using a CDN straightforward.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=458162013-02-17T18:47:25ZEtienne Massip
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>JQuery and JQuery-UI are merged in Redmine assets so it wouldn't work.</p>
</blockquote>
<p>That was a non-functionnal example for demonstration purpose.</p>
<blockquote>
<p>It's hacky anyway</p>
</blockquote>
<p>It's Rails configuration?</p>
<blockquote>
<p>and would make the upgrade process painfull.</p>
</blockquote>
<p>Why would it be? Could be in <code>config/additional_environment.rb</code>, couldn't it?</p>
<blockquote>
<p>That's the purpose of this request to make using a CDN straightforward.</p>
</blockquote>
<p>IMHO this should be handled by the Rails stack since it can be, rather than Redmine.</p> Redmine - Feature #13088: CDN support to jquery/ui libhttps://www.redmine.org/issues/13088?journal_id=458182013-02-17T21:50:29ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Sure, you can do pretty much everything in <code>additional_environment.rb</code> if you know about Rails configuration (which changes quite often BTW), Ruby, regexp and all but that's not what we can call "configuration". What I see here is a way to enable a CDN by simply uncommenting something like <code>jquery_cdn: google</code> in <code>configuration.yml</code>.</p>