index.html 2.35 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>
Kjetil Thuen's avatar
Kjetil Thuen committed
8
       <!--
9 10
       <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>
Kjetil Thuen's avatar
Kjetil Thuen committed
11
       -->
12 13 14
       <script src="utils.js"></script>
       <script src="studylist.js"></script>
       <script src="listPeek.js"></script>
Kjetil Thuen's avatar
Kjetil Thuen committed
15 16
       <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">
17
       <link href="listPeek.css" rel="stylesheet">
Kjetil Thuen's avatar
Kjetil Thuen committed
18
       <script>
19 20 21 22
         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
23 24 25
             var listhtml = template(jsondata);
             $('#content').html(listhtml);
             register_event_handlers();
26 27
             initialize_list_peek();
         };
Kjetil Thuen's avatar
Kjetil Thuen committed
28

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