diff --git a/README.md b/README.md index ca3662da8..15992edd3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,25 @@ This repository contains a static directory structure used in [Bebras tasks](htt This would be usually considered bad (or outdated) practice, but it addresses a requirement: allow people who are not experts in JavaScript tools (who cannot install `npm`, `bower`, etc.) to have a development environment for Bebras tasks. +## Bundles + +To optimise loading of files, this directory also contains bundles, which can be used in place of importing the corresponding JS files. + +To define a bundle, you must, in `importModules*.js` : + +* add how to import the bundle to `importableModules` +* add the list of modules this bundle includes in `bundledModules` + +and then, include, in `gulpfile.js`, the list of files to include in this bundle. + +The command +``` +gulp bundles +``` +will then generate all bundles into the subfolder `bundles/`. + +While testing this feature, bundles are loaded by `importModules*.js` only if `window.useBundles` is `true`. + ### TODO - find a better solution? diff --git a/bundles/bebras-base.js b/bundles/bebras-base.js new file mode 100644 index 000000000..c0dec2a33 --- /dev/null +++ b/bundles/bebras-base.js @@ -0,0 +1,1610 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+"
"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;gt |