index.html 2.44 KB
Newer Older
Kjetil Thuen's avatar
Kjetil Thuen committed
1 2
<!DOCTYPE html>
<html lang="en">
Kjetil Thuen's avatar
Kjetil Thuen committed
3 4 5
   <head>
       <meta charset="utf-8">
       <title>ScrollMagnifyer</title>
6
       <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
Kjetil Thuen's avatar
Kjetil Thuen committed
7
       <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js"></script>
8 9 10 11 12
       <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
       <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
       <script src="utils.js"></script>
       <script src="studylist.js"></script>
       <script src="listPeek.js"></script>
Kjetil Thuen's avatar
Kjetil Thuen committed
13 14
       <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
       <link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css" rel="stylesheet">
15
       <link href="listPeek.css" rel="stylesheet">
Kjetil Thuen's avatar
Kjetil Thuen committed
16
       <script>
17 18 19 20
         var jsondata = {};
         var build_list = function() {
             //TODO: Remember selected element, and scroll there (default to first element).
             var template = Handlebars.templates['studylist'];
Kjetil Thuen's avatar
Kjetil Thuen committed
21 22 23
             var listhtml = template(jsondata);
             $('#content').html(listhtml);
             register_event_handlers();
24 25
             initialize_list_peek();
         };
Kjetil Thuen's avatar
Kjetil Thuen committed
26

27
         var load_data = function() {
Kjetil Thuen's avatar
Kjetil Thuen committed
28
             $.ajax({
29 30 31 32
                 url: "https://nesstar-dev.nsd.uib.no/nesstardrop/study/list",
                 datatype: "json",
                 async: true,
                 context: document.body
Kjetil Thuen's avatar
Kjetil Thuen committed
33
             }).done(function(data) {
34 35
                 jsondata = data;
                 build_list();
Kjetil Thuen's avatar
Kjetil Thuen committed
36
             });
37
         };
Kjetil Thuen's avatar
Kjetil Thuen committed
38 39 40 41 42 43 44
       </script>
   </head>
   <body>
      <div class="hero-unit">
         <h1>Data fra Skolenesstar</h1>
         Finn interresante studier i listen under.
      </div>
45
      <div id="content"></div>
Kjetil Thuen's avatar
Kjetil Thuen committed
46
      <h2 id="target"></h2>
47
      <div id="expander">
Kjetil Thuen's avatar
Kjetil Thuen committed
48 49 50
         <div class="metadata">
            <div class="abstract lead"></div>
            <div class="buttons">
51 52
               <button class="btn btn-info"><i class="icon-info-sign"> </i> Mer metadata</button>
               <button class="btn btn-success"><i class="icon-ok-sign"> </i> Velg studie</button>
Kjetil Thuen's avatar
Kjetil Thuen committed
53 54 55 56 57 58 59 60 61 62
            </div>
         </div>
      </div>
      <script>
         load_data();
         $(window).resize(function() {
            build_list();
         });
      </script>
   </body>
Kjetil Thuen's avatar
Kjetil Thuen committed
63
</html>