Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/karma/js/course.js
diff options
context:
space:
mode:
Diffstat (limited to 'karma/js/course.js')
-rwxr-xr-xkarma/js/course.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/karma/js/course.js b/karma/js/course.js
new file mode 100755
index 0000000..cc7ef0b
--- /dev/null
+++ b/karma/js/course.js
@@ -0,0 +1,67 @@
+$(function(){
+ /* set title in head */
+ $('head title')
+ .empty()
+ .text(subject);
+ /* set navbar: linkHome, title, linkQuit */
+ $('<div>',{
+ class:'linkHome topbtn_left',
+ id:'linkHome',
+ title:'Home',
+ click:function(){
+ window.location = 'http://localhost:8008/content/index.html';
+ }
+ })
+ .appendTo('#header');
+ $('<div>',{
+ id:'lesson_title'
+ })
+ .text(subject)
+ .appendTo('#header');
+ $('<img>',{
+ src:'../karma/image/title_block_lt.png',
+ class:'title_img'
+ })
+ .prependTo('#lesson_title');
+ $('<img>',{
+ src:'../karma/image/title_block_rt.png',
+ class:'title_img'
+ })
+ .appendTo('#lesson_title');
+ $('<div>',{
+ class:'linkQuit topbtn_right',
+ id:'linkQuit',
+ title:'Quit',
+ click:function(){
+ window.close();
+ }
+ })
+ .appendTo('#header');
+
+ /* for each course, create div */
+ var classes = ['c11','c21','c31','c41','c12','c22','c32','c42','c13','c23','c33','c43'];
+ for(i=0;i<courses.length;i++){
+ cl = classes[i];
+ clid = '#'+cl;
+ a = 'a'+cl;
+ aid = '#a'+cl;
+ $('<div>',{
+ class: cl,
+ id:cl,
+ })
+ .appendTo('#content');
+ $('<a>',{
+ id:a,
+ href:'course_'+courses[i][0]+'.html',
+ width:175,
+ height:175
+ })
+ .appendTo(clid);
+ $('<img>',{
+ src:courses[i][2],
+ alt:courses[i][1]
+ })
+ .appendTo(aid);
+ }
+
+})