PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/1.4/docs/html/tutorials/kissy/loader/timestamp.html

https://github.com/kissyteam/kissyteam.github.com
HTML | 294 lines | 250 code | 26 blank | 18 comment | 0 complexity | b671f9767ed99dd9c8dd70680cd2bbb3 MD5 | raw file
Possible License(s): Apache-2.0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta name="viewport"
  6. content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  7. <meta name="data-spm" content="1" data-spm-protocol="i" />
  8. <title>使用 KISSY Loader 管理时间戳 &mdash; KISSY v1.4 Documentation</title>
  9. <link rel="stylesheet" href="//g.alicdn.com/kissy/k/1.4.7/css/dpl/base-min.css"/>
  10. <link rel="stylesheet" href="http://a.tbcdn.cn/s/kissy/gallery/sphinx/1.1.3/pygments.css" type="text/css" />
  11. <link rel="shortcut icon" href="http://a.tbcdn.cn/s/kissy/favicon.ico" type="image/x-icon" />
  12. <script>
  13. var DOCUMENTATION_OPTIONS = {
  14. URL_ROOT: '../../../',
  15. VERSION: '',
  16. COLLAPSE_INDEX: false,
  17. FILE_SUFFIX: '.html',
  18. HAS_SOURCE: true
  19. };
  20. </script>
  21. <script type="text/javascript" src="http://a.tbcdn.cn/s/kissy/gallery/sphinx/1.1.3/??jquery.js,underscore.js,doctools.js,searchtools.js"></script>
  22. <script>
  23. var _gaq = _gaq || [];
  24. _gaq.push(['_setAccount', 'UA-31470541-1']);
  25. _gaq.push(['_trackPageview']);
  26. (function() {
  27. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  28. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  29. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  30. })();
  31. </script>
  32. <link rel="stylesheet" href="../../../_static/kissy.css"/>
  33. <link rel="stylesheet" href="../../../_static/prettify.css"/>
  34. <link rel="stylesheet" href="../../../_static/forkit.css"/>
  35. <link rel="stylesheet" href="../../../_static/bootstrap.css"/>
  36. <script src="//g.alicdn.com/kissy/k/1.4.7/seed.js"></script>
  37. </head>
  38. <body data-spy="scroll" data-target=".bs-docs-sidebar">
  39. <nav id="sidebar">
  40. <header>
  41. <a href="/" >
  42. <img src="http://gtms01.alicdn.com/tps/i1/T1MVbxFoRcXXchhRni-175-68.png" alt="" />
  43. </a>
  44. </header>
  45. <div class="col-sub">
  46. <div class="s-box">
  47. <div class="s-box-bd">
  48. <ul class="current">
  49. <li class="toctree-l1"><a class="reference internal" href="../../../api/index.html">API Documentation</a></li>
  50. <li class="toctree-l1"><a class="reference internal" href="../../../demo/index.html">Demos</a></li>
  51. <li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Tutorials</a><ul class="current">
  52. <li class="toctree-l2 current"><a class="reference internal" href="../index.html">KISSY Modules</a><ul class="current">
  53. <li class="toctree-l3 current"><a class="reference internal" href="index.html">Loader</a></li>
  54. <li class="toctree-l3"><a class="reference internal" href="../ua/index.html">UA</a></li>
  55. <li class="toctree-l3"><a class="reference internal" href="../base/index.html">base</a></li>
  56. <li class="toctree-l3"><a class="reference internal" href="../selector/impl.html">css3 selectors</a></li>
  57. <li class="toctree-l3"><a class="reference internal" href="../swf/index.html">swf</a></li>
  58. <li class="toctree-l3"><a class="reference internal" href="../xtemplate/index.html">xtemplate</a></li>
  59. </ul>
  60. </li>
  61. <li class="toctree-l2"><a class="reference internal" href="../../style-guide/index.html">最佳编码实践</a></li>
  62. <li class="toctree-l2"><a class="reference internal" href="../../workflow/index.html">组件开发指南</a></li>
  63. <li class="toctree-l2"><a class="reference internal" href="../../tools/index.html">前端常用工具</a></li>
  64. </ul>
  65. </li>
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-extra">
  71. <div class="s-box">
  72. <div class="s-box-hd">
  73. <h3>本节提纲</h3>
  74. </div>
  75. <div class="s-box-bd">
  76. <ul>
  77. <li><a class="reference internal" href="#">使用 KISSY Loader 管理时间戳</a><ul>
  78. <li><a class="reference internal" href="#refer">Refer</a></li>
  79. <li><a class="reference internal" href="#id2">概述</a></li>
  80. <li><a class="reference internal" href="#id3">设置内置模块时间戳</a></li>
  81. <li><a class="reference internal" href="#id4">设置特定包时间戳</a></li>
  82. <li><a class="reference internal" href="#id5">设置特定模块时间戳</a></li>
  83. <li><a class="reference internal" href="#id6">总示例</a></li>
  84. </ul>
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. <div id="searchbox" class="searchbox">
  91. <form class="search" action="../../../search.html" method="get">
  92. <input type="text" name="q" size="28" class="ipt"/>
  93. <input type="submit" value="Go" class="btn"/>
  94. <input type="hidden" name="check_keywords" value="yes"/>
  95. <input type="hidden" name="area" value="default"/>
  96. </form>
  97. </div>
  98. </nav>
  99. <div id="content" class="body">
  100. <article>
  101. <ul class="api-header clearfix">
  102. <li class="first">
  103. <a href="/" >
  104. 首页
  105. </a>
  106. </li>
  107. <li><a href="../../../../../docs/html/api/index.html">API</a></li>
  108. <li><a href="../../../../../docs/html/demo/index.html">Demo</a></li>
  109. <li>
  110. <a href="../../../../../docs/html/guideline/get-started.html" >Guideline</a>
  111. </li>
  112. <li>
  113. <a href="../../../../../docs/html/coms.html" >组件列表</a>
  114. </li>
  115. <li><a href="../../../../../docs/html/tutorials/index.html">Tutorials</a></li>
  116. <li style="float:right"><a href="https://github.com/kissyteam/kissy">Source Code</a></li>
  117. <li style="float:right"><a href="/1.4/api/">English API Docs</a></li>
  118. </ul>
  119. <div class='related'>
  120. <h3>Navigation</h3>
  121. <ul>
  122. <li class="right" style="margin-right: 10px">
  123. <a href="../../../genindex.html" title="General Index"
  124. accesskey="I">index</a></li>
  125. <li class="right" >
  126. <a href="../../../py-modindex.html" title="Python Module Index"
  127. >modules</a> | </li>
  128. <li class="right" >
  129. <a href="common-lib.html" title="使用 KISSY Loader 组织公用的模块库"
  130. accesskey="N">next</a> | </li>
  131. <li class="right" >
  132. <a href="simple.html" title="简单使用 KISSY Loader"
  133. accesskey="P">previous</a> | </li>
  134. <li><a href="../../../index.html">KISSY v1.4 Documentation</a> &#187; </li>
  135. <li><a href="../../index.html" >Tutorials</a> &#187; </li>
  136. <li><a href="../index.html" >KISSY Modules</a> &#187; </li>
  137. <li><a href="index.html" accesskey="U">Loader</a> &#187; </li>
  138. </ul>
  139. </div>
  140. <div class="section" id="kissy-loader">
  141. <h1>使用 KISSY Loader 管理时间戳<a class="headerlink" href="#kissy-loader" title="Permalink to this headline"></a></h1>
  142. <p>author: <a class="reference external" href="mailto:yiminghe&#37;&#52;&#48;gmail&#46;com">承玉</a></p>
  143. <div class="section" id="refer">
  144. <h2>Refer<a class="headerlink" href="#refer" title="Permalink to this headline"></a></h2>
  145. <div class="line-block">
  146. <div class="line"><a class="reference internal" href="../../../api/loader/index.html#loader"><em>api</em></a></div>
  147. </div>
  148. <div class="line-block">
  149. <div class="line"><a class="reference internal" href="../../../demo/loader/index.html#loader-demo"><em>demo</em></a></div>
  150. </div>
  151. </div>
  152. <div class="section" id="id2">
  153. <h2>概述<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
  154. <p>通过 kissy loader 可以对 kissy 内置模块特定包以及特定模块设置不同的时间戳其中优先级关系为</p>
  155. <p>特定模块时间戳 &gt; 特定包时间戳 &gt; 内置模块时间戳</p>
  156. <p>当某个模块优先级高的时间戳找不到时会取值优先级低的时间戳</p>
  157. </div>
  158. <div class="section" id="id3">
  159. <h2>设置内置模块时间戳<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h2>
  160. <p>通过 KISSY.config(&#8220;tag&#8221;,..); 设置 kissy 内置模块的时间戳</p>
  161. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">config</span><span class="p">(</span><span class="s2">&quot;tag&quot;</span><span class="p">,</span><span class="s2">&quot;1234&quot;</span><span class="p">);</span>
  162. </pre></div>
  163. </div>
  164. </div>
  165. <div class="section" id="id4">
  166. <h2>设置特定包时间戳<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h2>
  167. <p>通过 KISSY.config(&#8220;packages&#8221;,...); 设置特定包的时间戳</p>
  168. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">config</span><span class="p">(</span><span class="s2">&quot;packages&quot;</span><span class="p">,{</span>
  169. <span class="nx">crm</span><span class="o">:</span><span class="p">{</span>
  170. <span class="nx">tag</span><span class="o">:</span><span class="s2">&quot;xzxc&quot;</span>
  171. <span class="p">}</span>
  172. <span class="p">});</span>
  173. </pre></div>
  174. </div>
  175. </div>
  176. <div class="section" id="id5">
  177. <h2>设置特定模块时间戳<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h2>
  178. <p>通过 KISSY.config(&#8220;modules&#8221;,...); 设置特定模块的时间戳</p>
  179. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">config</span><span class="p">(</span><span class="s2">&quot;modules&quot;</span><span class="p">,{</span>
  180. <span class="s2">&quot;crm/x&quot;</span><span class="o">:</span><span class="p">{</span>
  181. <span class="nx">tag</span><span class="o">:</span><span class="s2">&quot;xzxc&quot;</span>
  182. <span class="p">}</span>
  183. <span class="p">});</span>
  184. </pre></div>
  185. </div>
  186. </div>
  187. <div class="section" id="id6">
  188. <h2>总示例<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2>
  189. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">config</span><span class="p">({</span>
  190. <span class="c1">// 默认为 kissy build 时间,例如 20120531</span>
  191. <span class="c1">// base:&#39;&#39;</span>
  192. <span class="nx">packages</span><span class="o">:</span><span class="p">{</span>
  193. <span class="s2">&quot;crm&quot;</span><span class="o">:</span><span class="p">{</span>
  194. <span class="nx">base</span><span class="o">:</span><span class="s1">&#39;xx/&#39;</span><span class="p">,</span>
  195. <span class="nx">tag</span><span class="o">:</span><span class="s1">&#39;a&#39;</span>
  196. <span class="p">},</span>
  197. <span class="s2">&quot;tc&quot;</span><span class="o">:</span><span class="p">{</span>
  198. <span class="nx">base</span><span class="o">:</span><span class="s1">&#39;y/&#39;</span>
  199. <span class="p">}</span>
  200. <span class="p">},</span>
  201. <span class="nx">modules</span><span class="o">:</span><span class="p">{</span>
  202. <span class="s2">&quot;crm/x&quot;</span><span class="o">:</span><span class="p">{</span>
  203. <span class="nx">tag</span><span class="o">:</span><span class="s1">&#39;c&#39;</span>
  204. <span class="p">}</span>
  205. <span class="p">}</span>
  206. <span class="p">});</span>
  207. </pre></div>
  208. </div>
  209. <p>那么载入 seed 后的实际加载为</p>
  210. <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">use</span><span class="p">(</span><span class="s2">&quot;dom&quot;</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="nx">dom</span><span class="p">.</span><span class="nx">js</span><span class="o">?</span><span class="nx">t</span><span class="o">=</span><span class="mi">20120531</span>
  211. <span class="nx">use</span><span class="p">(</span><span class="s2">&quot;crm/x2&quot;</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="nx">crm</span><span class="o">/</span><span class="nx">x2</span><span class="p">.</span><span class="nx">js</span><span class="o">?</span><span class="nx">t</span><span class="o">=</span><span class="nx">a</span>
  212. <span class="nx">use</span><span class="p">(</span><span class="s2">&quot;crm/x&quot;</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="nx">crm</span><span class="o">/</span><span class="nx">x</span><span class="p">.</span><span class="nx">js</span><span class="o">?</span><span class="nx">t</span><span class="o">=</span><span class="nx">c</span>
  213. <span class="nx">use</span><span class="p">(</span><span class="s2">&quot;tc/r&quot;</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="nx">tc</span><span class="o">/</span><span class="nx">r</span><span class="p">.</span><span class="nx">js</span><span class="o">?</span><span class="nx">t</span><span class="o">=</span><span class="mi">20120531</span>
  214. </pre></div>
  215. </div>
  216. </div>
  217. </div>
  218. <div id="disqus_thread"></div>
  219. <script>
  220. if((window.location.hostname.indexOf("kissyui.com")!=-1 )&& window.localStorage.getItem("kissy-commment")!="0"){
  221. /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
  222. var disqus_shortname = 'kissy-docs'; // required: replace example with your forum shortname
  223. // The following are highly recommended additional parameters. Remove the slashes in front to use.
  224. //var disqus_identifier = '/anim';
  225. //var disqus_url = window.location;
  226. /* * * DON'T EDIT BELOW THIS LINE * * */
  227. (function() {
  228. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  229. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  230. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  231. })();
  232. }
  233. </script>
  234. <!--<div id="google-search-box">
  235. <div id="cse" style="width: 100%;">Loading</div>
  236. <script>
  237. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  238. document.write('<script src="http://www.google.com/jsapi" type="text/javascript"><'+'/script>');
  239. }
  240. </script>
  241. <script>
  242. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  243. google.load('search', '1', {language : 'zh-CN', style : google.loader.themes.MINIMALIST});
  244. google.setOnLoadCallback(function() {
  245. var customSearchControl = new google.search.CustomSearchControl('012347804910294994683:n4uzb24gqdm');
  246. customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
  247. customSearchControl.draw('cse');
  248. }, true);
  249. }
  250. </script>
  251. </div>-->
  252. </article>
  253. </div>
  254. <footer class="footer">
  255. <p>&copy; Copyright 2010~2014, KISSY Team. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a></p>
  256. </footer></body>
  257. <script>
  258. // added by jayli
  259. (function(){
  260. $('table.docutils').addClass('table table-bordered');
  261. $('.admonition.note').addClass('alert alert-info');
  262. $('.admonition.hint').addClass('alert alert-success');
  263. $('.admonition.warning').addClass('alert alert-warning');
  264. $('.admonition.attention').addClass('alert alert-danger');
  265. })();
  266. </script>
  267. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=39100375" charset="UTF-8"></script>
  268. </html>