Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xmlns:frog="http://fdp.frogtrade.com/ns/">
- <head>
- <meta name="frogLib" content="1.1" />
- <title>My Widget</title>
- <style type="text/css">
- body
- { min-height: 1250px; }
- p, div, ul, li, h1, h2, h3, h4, span
- { margin: 0; padding: 0; line-height:15px; }
- p
- { margin: 6px 0; }
- ul
- { padding: 5px; }
- li
- { padding: 1px 10px; }
- h2
- { margin: 10px 1px 5px 1px; padding: 5px 0 5px 8px; border-top: 3px solid #ccc; border-bottom: 1px dotted #ccc; }
- h3
- { margin: 6px 0 2px 0; font-size: 125%; }
- </style>
- <frog:roles>
- <role name="api.users.getinfo" />
- <role name="group.view.self" />
- <role name="group.view.all" />
- <role name="group.view.self.members" />
- <role name="api.users.search" />
- <role name="user.view.skeleton" />
- <role name="group.view.all.members" />
- <role name="api.timetable.getclasses" />
- <role name="timetable.view.any" />
- <role name="api.groups.getall" />
- <role name="user.image.view" />
- </frog:roles>
- <script src="/js/jquery.min.js"></script>
- <script src="/user/74/169314.js"></script> // jqimpromptu
- <script type="text/javascript">
- //<![CDATA[
- var TutorGroupPoints = {
- URL: 'http://staff.curriculum.local/frog/rewards.php',
- CurrentUser: UWA.Environment.user.id,
- Groups: { },
- Sorted: [ ],
- init: function() {
- var that = this; // <-- caching outer this
- /* retrieve all of the groups from Frog and store them in a variable */
- Frog.API.get('groups.getAll',
- {
- 'onSuccess': function (data) { that.Groups = data; },
- 'onError': function(err) { alert(err); }
- });
- },
- yearClick: function(year) {
- for (var i = 0; i < this.Groups.length; i++) {
- if (this.Groups[i].name.indexOf(year) == 0 && this.Groups[i].name.indexOf('/Tp') != -1) {
- var arrayToPush = { 'id': this.Groups[i].id, 'name': this.Groups[i].name };
- this.Sorted.push(arrayToPush);
- }
- }
- console.log( this.Sorted );
- $('#nav').empty();
- for (var i = 0; i < this.Sorted.length; i++) {
- $('#nav ul').append('<li id="' + this.Sorted[i].id + '">' + this.Sorted[i].name + '</li>');
- console.log('<li id="' + this.Sorted[i].id + '">' + this.Sorted[i].name + '</li>');
- }
- }
- };
- widget.onLoad = function(){
- TutorGroupPoints.init();
- $('#nav li a').click(function() {
- TutorGroupPoints.yearClick($(this).attr("id"));
- });
- }
- //]]>
- </script>
- <style>
- </style>
- </head>
- <body>
- <div id="wrapper">
- <div id="nav">
- <h2>Tutor Groups</h2>
- <ul>
- <li><a class="year" href="javascript:void(0);" title="Year 9" id="9">Year 9</a></li>
- <li><a class="year" href="javascript:void(0);" title="Year 10" id="10">Year 10</a></li>
- <li><a class="year" href="javascript:void(0);" title="Year 11" id="11">Year 11</a></li>
- <li><a class="year" href="javascript:void(0);" title="Year 12" id="12">Year 12</a></li>
- <li><a class="year" href="javascript:void(0);" title="Year 13" id="13">Year 13</a></li>
- </ul>
- </div>
- <div id="content">
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment