Team:NTU Taiwan/javascript/index.js

From 2013.igem.org

(Difference between revisions)
Line 201: Line 201:
                 title: 'Conference',
                 title: 'Conference',
                 description: 'conference with UT-Tokyo iGEM',
                 description: 'conference with UT-Tokyo iGEM',
 +
                priority: 1
 +
            },{
 +
                startDate: new Date(2013, 7, 5),
 +
                endDate: new Date(2013, 7, 9),
 +
                frecuency: 1,
 +
                title: 'Conference with Asia Teams',
 +
                description: 'conference in Chao-Tung University',
                 priority: 1
                 priority: 1
             }
             }
Line 207: Line 214:
      
      
     $("#ui-datepicker-div").hide();
     $("#ui-datepicker-div").hide();
 +
 +
    var Mediahostname = "http://ntu-best.herokuapp.com/";
 +
    if(document.location.protocol === "file:" || document.location.hostname === "localhost")
 +
        Mediahostname = "./";
      
      
     var LightBoxAdd = function(id, src){
     var LightBoxAdd = function(id, src){
Line 212: Line 223:
             "<div id='%s' class='lightbox hide fade' tabindex='-1' role='dialog' aria-hidden='true'>" +  
             "<div id='%s' class='lightbox hide fade' tabindex='-1' role='dialog' aria-hidden='true'>" +  
                 "<div class='lightbox-content'>" +  
                 "<div class='lightbox-content'>" +  
-
                     "<img src='http://ntu-best.herokuapp.com/%s' alt=''>" +  
+
                     "<img src='%s' alt=''>" +  
                 "</div>" +
                 "</div>" +
-
             "</div>", id, src, src));
+
             "</div>", id, src));
     }
     }
     var parseFileName = function(path){
     var parseFileName = function(path){
Line 238: Line 249:
                     "<div class='thumbnail' data-thumb='tooltip' data-placement='top' data-original-title='Click me'>" +
                     "<div class='thumbnail' data-thumb='tooltip' data-placement='top' data-original-title='Click me'>" +
                         "<a href='#%s_%d' data-toggle='lightbox'>" +
                         "<a href='#%s_%d' data-toggle='lightbox'>" +
-
                             "<img src='http://ntu-best.herokuapp.com/img/%s/(%d).jpg' alt=''>" +  
+
                             "<img src='%simg/%s/(%d).jpg' alt=''>" +  
                         "</a>" +  
                         "</a>" +  
                     "</div>" +  
                     "</div>" +  
-
                 "</li>", folder, j, folder, j);
+
                 "</li>", folder, j, Mediahostname, folder, j);
             if(j%4 == 0 || j == number){
             if(j%4 == 0 || j == number){
Line 248: Line 259:
             }
             }
-
             LightBoxAdd(sprintf("%s_%d", folder, j), sprintf("./img/%s/(%d).jpg", folder, j));
+
             LightBoxAdd(sprintf("%s_%d", folder, j), sprintf("%simg/%s/(%d).jpg", Mediahostname, folder, j));
         }
         }
Line 255: Line 266:
     $.each($(".lightboxImg"), function(index, value){
     $.each($(".lightboxImg"), function(index, value){
         var img = $(value).attr("img");
         var img = $(value).attr("img");
-
         var innerValue = sprintf("<a href='#%s' data-toggle='lightbox'> <img src='http://ntu-best.herokuapp.com/%s' alt='' style='%s'> </a>", Path2ID(img), img, $(value).attr('img-style'));
+
         var innerValue = sprintf("<a href='#%s' data-toggle='lightbox'> <img src='%s%s' alt='' style='%s'> </a>", Path2ID(img), Mediahostname, img, $(value).attr('img-style'));
         $(value).append(innerValue);
         $(value).append(innerValue);
-
         LightBoxAdd(Path2ID(img), img);
+
         LightBoxAdd(Path2ID(img), sprintf("%s%s", Mediahostname, img));
     })
     })
      
      
     $("#intro-background").videoBG({
     $("#intro-background").videoBG({
-
         mp4:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.mp4',
+
         mp4: Mediahostname + 'video/Digital DNA Dreamscene.mp4',
-
         ogv:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.ogv',
+
         ogv: Mediahostname + 'video/Digital DNA Dreamscene.ogv',
-
         webm:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.webm',
+
         webm: Mediahostname + 'video/Digital DNA Dreamscene.webm',
-
         poster:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.jpg',
+
         poster: Mediahostname + 'video/Digital DNA Dreamscene.jpg',
         fullscreen:true
         fullscreen:true
     });
     });

Revision as of 14:27, 13 August 2013

$(document).ready(function(){

   console.log("init index.js");
   $("#calendar_content").dp_calendar({ 
       date_selected: Date.now(), 
       show_datepicker: false, 
       order_by: 3, 
       format_ampm: true, 
       events_array: [{
               startDate: new Date(2013, 1, 16, 12, 00),
               title: 'Weekly Meeting',
               priority: 3,
           },{
               startDate: new Date(2013, 1, 16, 14, 30),
               title: 'Report Review by 李易遠',
               description: '李易遠:review0217 - Synthetic Biological Technology',
               priority: 1
           },{
               startDate: new Date(2013, 1, 16, 14, 30),
               title: 'Report Review by 張宏宇',
               description: '張宏宇:review0217 - Synthetic biology new engineering rules for an emerging discipline',
               priority: 1
           },{
               startDate: new Date(2013, 1, 16, 14, 30),
               title: 'Report Review by 呂宗諭',
               description: '呂宗諭:review0217 - DNA assembly',
               priority: 1
           },{
               startDate: new Date(2013, 1, 16, 14, 30),
               title: '介紹2012 iGEM各隊伍主題',
               description: '介紹2012 iGEM各隊伍主題',
               priority: 1
           },{
               startDate: new Date(2013, 1, 16, 14, 30),
               title: '討論題目',
               description: '1.  題名:染料、水果熟成控制、糞便尿液唾液、營養熱量測量、水族箱、養殖漁業、免疫檢測、沙漠化、珊瑚、芳香劑、避孕
2.查詢相關資料', priority: 1 },{ startDate: new Date(2013, 1, 23, 12, 00), title: 'Weekly Meeting', priority: 3, },{ startDate: new Date(2013, 1, 23, 14, 00), title: '報告醫學院的三個題目 by 李易遠', description: '1. 偵測土味
2. HIV 的receptor給細菌,利用細菌抓HIV病毒。類似抗體的技巧
3. 水耕植物:用細菌偵測鈉、鉀、磷的變換', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 水果 by 吳泰億 ', description: '1. 乙烯、乙炔在催熟中扮演的角色
2. 面臨問題 - 過量有害
3. 可嘗試方向 - 水果成熟度的分級、利用乙烯、偵測乙烯的儀器', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 水果 by Po-Hsien ', description: '1. 水果非破壞性檢測技術', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 養殖漁業 by 吳泰億 ', description: 'A. 面臨的問題 寒冬、硝化細菌
B. 改善設施、飼料配方、抗寒基因的研究
C. 可嘗試方向 魚類的生態球', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 養殖漁業 by 王德緯 ', description: 'A. Uncoupling protein 讓proton 通過 不會產生ATP但產生熱
B. 用合成生物學的方法好處:不需要燃油、電力
C. 評估需要消耗提供多少熱量、養分來餵我們的biological device', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 養殖漁業 by 呂宗諭 ', description: 'A. 寒冷造成傷害的原因:太冷產生結晶、細胞膜會被破壞、免疫能力下降
B. AFP, AFGP、基改魚類、飼料', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: 'Project資料與提案 - 芳香劑 by 呂宗諭 ', description: '偵測臭味的receptor、濕度溫度、代謝臭味的分子、直接放出芳香物', priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 00), title: '隊名 NTU BEST', description: 'NTU BEST :Biochemistry Engineering Synbio Team', priority: 2 },{ startDate: new Date(2013, 2, 9, 12, 00), title: 'Weekly Meeting', priority: 3, },{ startDate: new Date(2013, 2, 9, 14, 00), title: '主題評估 - 合成胞器', description: '需要克服:創新不足、困難度高', priority: 1 },{ startDate: new Date(2013, 2, 9, 14, 00), title: '主題評估 - 發熱菌株(採用)', description: 'i.先前研究
ii.產熱效率:不足的話目標改為提升效率', priority: 2 },{ startDate: new Date(2013, 2, 9, 14, 00), title: '主題評估 - 高分子', description: 'i. 很多人做過
ii. 需要議題', priority: 1 },{ startDate: new Date(2013, 2, 9, 14, 00), title: '主題評估 - 合成生物學玩具', description: '杜鵑花節做出prototype', priority: 1 },{ startDate: new Date(2013, 2, 16), endDate: new Date(2013, 2, 17), title: '台大杜鵑花節 - 合成生物學玩具', description: 'WEBSITE COMMING SOON<img src=images/NTU_ALALEA_FESTIVAL.jpg>', priority: 3, frecuency: 1 },{ startDate: new Date(2013, 2, 23, 12, 00), title: 'Weekly Meeting', priority: 3, },{ startDate: new Date(2013, 2, 23, 14, 00), title: 'WET LAB老師接洽,實驗方法&應用層面', description: 'a: 呂宗諭:漁科所
b: 張宏宇:梁國淦-發酵槽、熱卡計之儀器組裝與採買
c: 李易遠:陳彥榮-隊務', priority: 1 },{ startDate: new Date(2013, 2, 23, 14, 00), title: 'DRY LAB模擬', description: 'a: 模擬 UCP/ATP synthase 比例,找出產熱最大值
b: 模擬實際寒流來襲時,魚塭中的菌需發熱功率多少才能維持溫暖', priority: 1 },{ startDate: new Date(2013, 2, 30, 12, 00), title: 'Weekly Meeting', priority: 3, },{ startDate: new Date(2013, 2, 30, 14, 00), title: '報進度 - 呂宗諭', description: ' 1:UCP1人體活化路徑
2:突變株: G176, G76, G269L
3:Gene ontology
4:找Mutation protocol、HR protocol
5:溫度promoter: 增加敏感度', priority: 1 },{ startDate: new Date(2013, 2, 30, 14, 00), title: '報進度 - 張宏宇', description: ' 1: 結合發酵槽與卡計', priority: 1 },{ startDate: new Date(2013, 2, 30, 14, 00), title: '報進度 - 王德緯', description: ' 1: UCP 分解
2: Transcription factor', priority: 1 },{ startDate: new Date(2013, 3, 6, 14, 00), title: '確認目標', description: ' 1: 低溫下加熱儀器的成本
2: 大尺寸加熱難度', priority: 1 },{ startDate: new Date(2013, 3, 6, 14, 00), title: '研究2008年成果', description: 'Experiment 2008是用Homologous 還是 plasmid?', priority: 1 },{ startDate: new Date(2013, 3, 11), title: '與麗冠教授討論實驗細節', description: '1. UV突變方法
2. 低溫培養箱使用
3. 酵母菌HR方法
4. 大腸桿菌的優勢
5. 回收死菌的系統', priority: 1 },{ startDate: new Date(2013, 3, 20, 14, 00), title: 'UT-Tokyo discussion next week', description: '題目報告', priority: 1 },{ startDate: new Date(2013, 4, 4, 14, 00), title: 'Conference with UT-Tokyo', description: 'Conference with UT-Tokyo by Skype
link: http://goo.gl/X6u5Z ', priority: 1 },{ startDate: new Date(2013, 5, 12), endDate: new Date(2013, 5, 0), title: '討論', description: 'Normal Meeting', priority: 1, frecuency: 2, },{ startDate: new Date(2013, 5, 1), endDate: new Date(2013, 5, 30), title: 'NTU 期末考', description: '期末考試ING', priority: 3, frecuency: 1 },{ startDate: new Date(2013, 6, 5, 10, 30), title: '配培養液、培養基、菌體活化、繼代', description: '討論人力分配及生長曲線測定', priority: 1 },{ startDate: new Date(2013, 6, 8, 10, 30), title: 'Conference', description: 'Conference with Purdue iGEM team', priority: 1 },{ startDate: new Date(2013, 6, 10, 10, 30), title: 'Conference', description: 'Conference with Berkeley iGEM', priority: 1 },{ startDate: new Date(2013, 6, 14, 10, 30), title: 'Conference', description: 'conference with UT-Tokyo iGEM', priority: 1 },{ startDate: new Date(2013, 7, 5), endDate: new Date(2013, 7, 9), frecuency: 1, title: 'Conference with Asia Teams', description: 'conference in Chao-Tung University', priority: 1 } ] }); $("#ui-datepicker-div").hide();
   var Mediahostname = "http://ntu-best.herokuapp.com/";
   if(document.location.protocol === "file:" || document.location.hostname === "localhost")
       Mediahostname = "./";
   
   var LightBoxAdd = function(id, src){
       $("#lightbox").append(sprintf(
"", id, src));
   }
   var parseFileName = function(path){
       return path.replace(/^.*[\\\/]/, );
   }
   var Path2ID = function(path){
       path = path.replace(/^\.[\\\/]img[\\\/]/, );
       path = path.replace(/\.[^/.]+$/, "");
       return path.replace(/[\\\/]/g, '_');
   }
   var gallery = $("#gallery .container .divide")
   $.each($("#gallery .container .divide"), function(index, value){
       var number = parseInt($(value).attr("number"));
       var folder = $(value).attr("folder");   
$(value).append("
    ");
           var data = "", lightBox = "";
           for(var j=1; j<=number; j++){
    
    if(j%4 == 1) data += "
    ";
               data += sprintf("" + 
    
    "
  • " + "
    " +
                           "<a href='#%s_%d' data-toggle='lightbox'>" +
                               "<img src='%simg/%s/(%d).jpg' alt=>" + 
                           "</a>" + 
    
    "
    " +
                   "</li>", folder, j, Mediahostname, folder, j);
    
               if(j%4 == 0 || j == number){
                   $(value).find(".thumbnails").append(data)
                   data = "";
               }
    
               LightBoxAdd(sprintf("%s_%d", folder, j), sprintf("%simg/%s/(%d).jpg", Mediahostname, folder, j));
           }
    
       })
    
       $.each($(".lightboxImg"), function(index, value){
           var img = $(value).attr("img");
           var innerValue = sprintf("<a href='#%s' data-toggle='lightbox'> <img src='%s%s' alt= style='%s'> </a>", Path2ID(img), Mediahostname, img, $(value).attr('img-style'));
           $(value).append(innerValue);
           LightBoxAdd(Path2ID(img), sprintf("%s%s", Mediahostname, img));
       })
       
    
       $("#intro-background").videoBG({
           mp4: Mediahostname + 'video/Digital DNA Dreamscene.mp4',
           ogv: Mediahostname + 'video/Digital DNA Dreamscene.ogv',
           webm: Mediahostname + 'video/Digital DNA Dreamscene.webm',
           poster: Mediahostname + 'video/Digital DNA Dreamscene.jpg',
           fullscreen:true
       });
    
       $("#contactForm input[type='submit']").click(function(){
           var message = "";
           if($("#contactForm #name").val() == "") message += "Name Field can't be empty
    "; if($("#contactForm #message").val() == "") message += "Please Type what you want to inform us
    "; if(message == "") { message = sprintf("%s?subject=[IGEM WIKI CONTACT]%s&body=%s", $("#contactForm").attr("action"), $("#contactForm #name").val(), $("#contactForm #message").val()); window.open(message); } else{ $(".alert").html(message); $(".message").show("slow"); } })
    })