test/model/test.html
branchnew-model
changeset 860 7fd843e0dc4e
parent 858 ad1ffe0c0955
child 864 5e76a06b961c
equal deleted inserted replaced
858:ad1ffe0c0955 860:7fd843e0dc4e
    13         <script type="text/javascript" src="../../src/js/serializers/PlatformSerializer.js"></script>
    13         <script type="text/javascript" src="../../src/js/serializers/PlatformSerializer.js"></script>
    14         <script type="text/javascript">
    14         <script type="text/javascript">
    15             IriSP.jQuery = jQuery;
    15             IriSP.jQuery = jQuery;
    16             IriSP._ = _;
    16             IriSP._ = _;
    17             var _directory = new IriSP.Model.Directory();
    17             var _directory = new IriSP.Model.Directory();
    18             var _source = _directory.source("../integration/polemic_fr.json", "ns", "ns", IriSP.serializers.platform);
    18             var _source = _directory.remoteSource({
       
    19                 url: "../integration/polemic_fr.json",
       
    20                 namespace: "metadataplayer",
       
    21                 serializer: IriSP.serializers.platform
       
    22             });
       
    23             function showExport() {
       
    24                 console.log(_source.serialize());
       
    25                 $("body").html(JSON.stringify(_source.serialize()).replace(/(\[|\{)/g,'$1<ul><li>').replace(/(\]|\})/g,'</li></ul>$1').replace(/,/g,',</li><li>'))
       
    26             }
    19         </script>
    27         </script>
       
    28         <style type="text/css">
       
    29             ul, li {
       
    30                 list-style: none;
       
    31                 margin: 0;
       
    32             }
       
    33         </style>
    20     </head>
    34     </head>
    21     <body>
    35     <body>
    22         <h1></h1>
    36         <a href="#" onclick="showExport(); return false;">Export Json</a>
    23     </body>
    37     </body>
    24 </html>
    38 </html>