test/model/test.html
changeset 944 8a6c9e3d0158
parent 872 d777d05a16e4
child 1076 510fd2a482f4
equal deleted inserted replaced
907:27b248a13355 944:8a6c9e3d0158
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       
     2 "http://www.w3.org/TR/html4/loose.dtd">
       
     3 <html xmlns="http://www.w3.org/1999/xhtml">
       
     4     <head>
       
     5         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
     6         <title>Test Modèle de Données</title>
       
     7         <script type="text/javascript" src="../../src/js/libs/jquery.min.js"></script>
       
     8         <script type="text/javascript" src="../../src/js/libs/underscore.js"></script>
       
     9         <script type="text/javascript">
       
    10             IriSP = {}
       
    11         </script>
       
    12         <script type="text/javascript" src="../../src/js/model.js"></script>
       
    13         <script type="text/javascript" src="../../src/js/serializers/PlatformSerializer.js"></script>
       
    14         <script type="text/javascript" src="../../src/js/serializers/CinecastSerializer.js"></script>
       
    15         <script type="text/javascript">
       
    16             IriSP.jQuery = jQuery;
       
    17             IriSP._ = _;
       
    18             var _directory = new IriSP.Model.Directory();
       
    19             var _source = _directory.remoteSource({
       
    20                 //url: "../integration/polemic_fr.json",
       
    21                 url : '../integration/allocine_dossier_independant/json_examples/movie32.json',
       
    22                 namespace: "cinecast",
       
    23                 serializer: IriSP.serializers.cinecast
       
    24             });
       
    25             function showExport() {
       
    26                 console.log(_source.serialize());
       
    27                 $("body").html(JSON.stringify(_source.serialize()).replace(/(\[|\{)/g,'$1<ul><li>').replace(/(\]|\})/g,'</li></ul>$1').replace(/,/g,',</li><li>'))
       
    28             }
       
    29             function benchmark(name, callback) {
       
    30                 document.write('<p>Running benchmark ' + name + '</p>');
       
    31                 var b = new Date();
       
    32                 for (var i = 0; i < 100000; i++) {
       
    33                     callback(i);
       
    34                 }
       
    35                 document.write('<p>Took ' + (new Date() - b) + 'ms</p>');
       
    36             }
       
    37         </script>
       
    38         <style type="text/css">
       
    39             ul, li {
       
    40                 list-style: none;
       
    41                 margin: 0;
       
    42             }
       
    43         </style>
       
    44     </head>
       
    45     <body>
       
    46         <a href="#" onclick="showExport(); return false;">Export Json</a>
       
    47     </body>
       
    48 </html>