You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Fabian Christ <ch...@googlemail.com> on 2011/10/18 16:03:12 UTC

Mixed static resources through WebFragments

Hi,

I had a look at the HTML source of the FactStore documentation page and was
surprised what bunch of JavaScript is included. The reason is that each
WebFragment can add static script resources and all these resources together
are included in every page. This is bad as you can see:

    <script type="text/javascript"
src="/stanbol/static/home/scripts/jquery-1.4.2.js
<view-source:http://localhost:8080/stanbol/static/home/scripts/jquery-1.4.2.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/contenthub/scripts/prettify/prettify.js
<view-source:http://localhost:8080/stanbol/static/contenthub/scripts/prettify/prettify.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/contenthub/scripts/jit.js
<view-source:http://localhost:8080/stanbol/static/contenthub/scripts/jit.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/contenthub/scripts/jquery-1.5.1.min.js
<view-source:http://localhost:8080/stanbol/static/contenthub/scripts/jquery-1.5.1.min.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/contenthub/scripts/jquery-ui-1.8.11.custom.min.js
<view-source:http://localhost:8080/stanbol/static/contenthub/scripts/jquery-ui-1.8.11.custom.min.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/factstore/scripts/json2.js
<view-source:http://localhost:8080/stanbol/static/factstore/scripts/json2.js>"></script>

    <script type="text/javascript"
src="/stanbol/static/enhancer/openlayers-2.9/OpenLayers.js
<view-source:http://localhost:8080/stanbol/static/enhancer/openlayers-2.9/OpenLayers.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/ontonet/actions/actions.js
<view-source:http://localhost:8080/stanbol/static/ontonet/actions/actions.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/rules/actions/actions.js
<view-source:http://localhost:8080/stanbol/static/rules/actions/actions.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/rules/actions/tutorial.js
<view-source:http://localhost:8080/stanbol/static/rules/actions/tutorial.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/jquery-1.5.1.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/jquery-1.5.1.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/jquery-ui.1.9m5.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/jquery-ui.1.9m5.js>"></script>

    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/underscore-min.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/underscore-min.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/backbone.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/backbone.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/jquery.rdfquery.debug.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/jquery.rdfquery.debug.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/vie/vie-latest.debug.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/vie/vie-latest.debug.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/hallo/hallo.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/hallo/hallo.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/hallo/format.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/hallo/format.js>"></script>

    <script type="text/javascript"
src="/stanbol/static/enhancervie/lib/annotate.js
<view-source:http://localhost:8080/stanbol/static/enhancervie/lib/annotate.js>"></script>
    <script type="text/javascript"
src="/stanbol/static/enhancer/scripts/prettify/prettify.js
<view-source:http://localhost:8080/stanbol/static/enhancer/scripts/prettify/prettify.js>"></script>

How should we handle this correctly? Should each fragment be more
carefully to add such resources or should each fragment include
whatever it needs but the different resources are not mixed for
different fragments?

Best,
- Fabian



-- 
Fabian
http://twitter.com/fctwitt