Team:NTU Taiwan/javascript/index.js

From 2013.igem.org

(Difference between revisions)
 
(11 intermediate revisions not shown)
Line 1: Line 1:
-
$(document).ready(function(){
+
var changeContent = function(html, loadcall, callback){
-
    console.log("init index.js");
+
    $(".content").hide("slide", { direction: "left", easing: "easeOutExpo"}, 300).queue(function(){
-
     $("#calendar_content").dp_calendar({  
+
        $(this).html(html);
-
         date_selected: Date.now(),  
+
        if(loadcall) {
-
         show_datepicker: false,  
+
            loadcall();
-
         order_by: 3,  
+
        }
-
         format_ampm: true,  
+
        $(this).show("slide", { direction: "right", easing: "easeInOutQuart"}, 500).dequeue();
 +
        if(callback) {
 +
            callback();
 +
        }
 +
    });
 +
};
 +
 
 +
var calendar_create = function(target){
 +
     $(target).dp_calendar({
 +
         date_selected: new Date(2013, 7, 09, 12, 0),
 +
         show_datepicker: false,
 +
         order_by: 3,
 +
         format_ampm: true,
         events_array: [{
         events_array: [{
-
                 startDate: new Date(2013, 1, 16, 12, 00),
+
                 startDate: new Date(2013, 1, 16, 12, 0),
-
                 title: 'Weekly Meeting',
+
                 title: "Weekly Meeting",
-
                 priority: 3,
+
                 priority: 3
             },{
             },{
                 startDate: new Date(2013, 1, 16, 14, 30),
                 startDate: new Date(2013, 1, 16, 14, 30),
-
                 title: 'Report Review by 李易遠',
+
                 title: "Report Review by 李易遠",
-
                 description: '李易遠:review0217 - Synthetic Biological Technology',
+
                 description: "李易遠:review0217 - Synthetic Biological Technology",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 1, 16, 14, 30),
                 startDate: new Date(2013, 1, 16, 14, 30),
-
                 title: 'Report Review by 張宏宇',
+
                 title: "Report Review by 張宏宇",
-
                 description: '張宏宇:review0217 - Synthetic biology new engineering rules for an emerging discipline',
+
                 description: "張宏宇:review0217 - Synthetic biology new engineering rules for an emerging discipline",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 1, 16, 14, 30),
                 startDate: new Date(2013, 1, 16, 14, 30),
-
                 title: 'Report Review by 呂宗諭',
+
                 title: "Report Review by 呂宗諭",
-
                 description: '呂宗諭:review0217 - DNA assembly',
+
                 description: "呂宗諭:review0217 - DNA assembly",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 1, 16, 14, 30),
                 startDate: new Date(2013, 1, 16, 14, 30),
-
                 title: '介紹2012 iGEM各隊伍主題',
+
                 title: "介紹2012 iGEM各隊伍主題",
-
                 description: '介紹2012 iGEM各隊伍主題',
+
                 description: "介紹2012 iGEM各隊伍主題",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 1, 16, 14, 30),
                 startDate: new Date(2013, 1, 16, 14, 30),
-
                 title: '討論題目',
+
                 title: "討論題目",
-
                 description: '1.  題名:染料、水果熟成控制、糞便尿液唾液、營養熱量測量、水族箱、養殖漁業、免疫檢測、沙漠化、珊瑚、芳香劑、避孕<br/>2.查詢相關資料',
+
                 description: "1.  題名:染料、水果熟成控制、糞便尿液唾液、營養熱量測量、水族箱、養殖漁業、免疫檢測、沙漠化、珊瑚、芳香劑、避孕<br/>2.查詢相關資料",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 12, 00),
+
                 startDate: new Date(2013, 1, 23, 12, 0),
-
                 title: 'Weekly Meeting',
+
                 title: "Weekly Meeting",
-
                 priority: 3,
+
                 priority: 3
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: '報告醫學院的三個題目 by 李易遠',
+
                 title: "報告醫學院的三個題目 by 李易遠",
-
                 description: '1.  偵測土味<br/>2.  HIV 的receptor給細菌,利用細菌抓HIV病毒。類似抗體的技巧<br/>3.  水耕植物:用細菌偵測鈉、鉀、磷的變換',
+
                 description: "1.  偵測土味<br/>2.  HIV 的receptor給細菌,利用細菌抓HIV病毒。類似抗體的技巧<br/>3.  水耕植物:用細菌偵測鈉、鉀、磷的變換",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 水果 by 吳泰億 ',
+
                 title: "Project資料與提案 - 水果 by 吳泰億 ",
-
                 description: '1.  乙烯、乙炔在催熟中扮演的角色<br/>2.  面臨問題 - 過量有害<br/>3.  可嘗試方向 - 水果成熟度的分級、利用乙烯、偵測乙烯的儀器',
+
                 description: "1.  乙烯、乙炔在催熟中扮演的角色<br/>2.  面臨問題 - 過量有害<br/>3.  可嘗試方向 - 水果成熟度的分級、利用乙烯、偵測乙烯的儀器",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 水果 by Po-Hsien ',
+
                 title: "Project資料與提案 - 水果 by Po-Hsien ",
-
                 description: '1. 水果非破壞性檢測技術',
+
                 description: "1. 水果非破壞性檢測技術",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 養殖漁業 by 吳泰億 ',
+
                 title: "Project資料與提案 - 養殖漁業 by 吳泰億 ",
-
                 description: 'A.  面臨的問題 寒冬、硝化細菌<br/>B.  改善設施、飼料配方、抗寒基因的研究<br/>C.  可嘗試方向 魚類的生態球',
+
                 description: "A.  面臨的問題 寒冬、硝化細菌<br/>B.  改善設施、飼料配方、抗寒基因的研究<br/>C.  可嘗試方向 魚類的生態球",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 養殖漁業 by 王德緯 ',
+
                 title: "Project資料與提案 - 養殖漁業 by 王德緯 ",
-
                 description: 'A.  Uncoupling protein 讓proton 通過 不會產生ATP但產生熱<br/>B.  用合成生物學的方法好處:不需要燃油、電力<br/>C.  評估需要消耗提供多少熱量、養分來餵我們的biological device',
+
                 description: "A.  Uncoupling protein 讓proton 通過 不會產生ATP但產生熱<br/>B.  用合成生物學的方法好處:不需要燃油、電力<br/>C.  評估需要消耗提供多少熱量、養分來餵我們的biological device",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 養殖漁業 by 呂宗諭 ',
+
                 title: "Project資料與提案 - 養殖漁業 by 呂宗諭 ",
-
                 description: 'A.  寒冷造成傷害的原因:太冷產生結晶、細胞膜會被破壞、免疫能力下降<br/>B.  AFP, AFGP、基改魚類、飼料',
+
                 description: "A.  寒冷造成傷害的原因:太冷產生結晶、細胞膜會被破壞、免疫能力下降<br/>B.  AFP, AFGP、基改魚類、飼料",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: 'Project資料與提案 - 芳香劑 by 呂宗諭 ',
+
                 title: "Project資料與提案 - 芳香劑 by 呂宗諭 ",
-
                 description: '偵測臭味的receptor、濕度溫度、代謝臭味的分子、直接放出芳香物',
+
                 description: "偵測臭味的receptor、濕度溫度、代謝臭味的分子、直接放出芳香物",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 1, 23, 14, 00),
+
                 startDate: new Date(2013, 1, 23, 14, 0),
-
                 title: '隊名 NTU BEST',
+
                 title: "隊名 NTU BEST",
-
                 description: 'NTU BEST :Biochemistry Engineering Synbio Team',
+
                 description: "NTU BEST :Biochemistry Engineering Synbio Team",
                 priority: 2
                 priority: 2
             },{
             },{
-
                 startDate: new Date(2013, 2, 9, 12, 00),
+
                 startDate: new Date(2013, 2, 9, 12, 0),
-
                 title: 'Weekly Meeting',
+
                 title: "Weekly Meeting",
-
                 priority: 3,
+
                 priority: 3
             },{
             },{
-
                 startDate: new Date(2013, 2, 9, 14, 00),
+
                 startDate: new Date(2013, 2, 9, 14, 0),
-
                 title: '主題評估 - 合成胞器',
+
                 title: "主題評估 - 合成胞器",
-
                 description: '需要克服:創新不足、困難度高',
+
                 description: "需要克服:創新不足、困難度高",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 9, 14, 00),
+
                 startDate: new Date(2013, 2, 9, 14, 0),
-
                 title: '主題評估 - 發熱菌株(採用)',
+
                 title: "主題評估 - 發熱菌株(採用)",
-
                 description: 'i.先前研究<br/>ii.產熱效率:不足的話目標改為提升效率',
+
                 description: "i.先前研究<br/>ii.產熱效率:不足的話目標改為提升效率",
                 priority: 2
                 priority: 2
             },{
             },{
-
                 startDate: new Date(2013, 2, 9, 14, 00),
+
                 startDate: new Date(2013, 2, 9, 14, 0),
-
                 title: '主題評估 - 高分子',
+
                 title: "主題評估 - 高分子",
-
                 description: 'i.  很多人做過<br/>ii.  需要議題',
+
                 description: "i.  很多人做過<br/>ii.  需要議題",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 9, 14, 00),
+
                 startDate: new Date(2013, 2, 9, 14, 0),
-
                 title: '主題評估 - 合成生物學玩具',
+
                 title: "主題評估 - 合成生物學玩具",
-
                 description: '杜鵑花節做出prototype',
+
                 description: "杜鵑花節做出prototype",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 2, 16),
                 startDate: new Date(2013, 2, 16),
                 endDate: new Date(2013, 2, 17),
                 endDate: new Date(2013, 2, 17),
-
                 title: '台大杜鵑花節 - 合成生物學玩具',
+
                 title: "台大杜鵑花節 - 合成生物學玩具",
-
                 description: 'WEBSITE COMMING SOON<img src=images/NTU_ALALEA_FESTIVAL.jpg>',
+
                 description: "WEBSITE COMMING SOON<img src=images/NTU_ALALEA_FESTIVAL.jpg>",
                 priority: 3,
                 priority: 3,
                 frecuency: 1
                 frecuency: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 23, 12, 00),
+
                 startDate: new Date(2013, 2, 23, 12, 0),
-
                 title: 'Weekly Meeting',
+
                 title: "Weekly Meeting",
-
                 priority: 3,
+
                 priority: 3
             },{
             },{
-
                 startDate: new Date(2013, 2, 23, 14, 00),
+
                 startDate: new Date(2013, 2, 23, 14, 0),
-
                 title: 'WET LAB老師接洽,實驗方法&應用層面',
+
                 title: "WET LAB老師接洽,實驗方法&應用層面",
-
                 description: 'a: 呂宗諭:漁科所<br/>b: 張宏宇:梁國淦-發酵槽、熱卡計之儀器組裝與採買<br/>c: 李易遠:陳彥榮-隊務',
+
                 description: "a: 呂宗諭:漁科所<br/>b: 張宏宇:梁國淦-發酵槽、熱卡計之儀器組裝與採買<br/>c: 李易遠:陳彥榮-隊務",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 23, 14, 00),
+
                 startDate: new Date(2013, 2, 23, 14, 0),
-
                 title: 'DRY LAB模擬',
+
                 title: "DRY LAB模擬",
-
                 description: 'a: 模擬 UCP/ATP synthase 比例,找出產熱最大值<br/>b: 模擬實際寒流來襲時,魚塭中的菌需發熱功率多少才能維持溫暖',
+
                 description: "a: 模擬 UCP/ATP synthase 比例,找出產熱最大值<br/>b: 模擬實際寒流來襲時,魚塭中的菌需發熱功率多少才能維持溫暖",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 30, 12, 00),
+
                 startDate: new Date(2013, 2, 30, 12, 0),
-
                 title: 'Weekly Meeting',
+
                 title: "Weekly Meeting",
-
                 priority: 3,
+
                 priority: 3
             },{
             },{
-
                 startDate: new Date(2013, 2, 30, 14, 00),
+
                 startDate: new Date(2013, 2, 30, 14, 0),
-
                 title: '報進度 - 呂宗諭',
+
                 title: "報進度 - 呂宗諭",
-
                 description: ' 1:UCP1人體活化路徑<br/>2:突變株: G176, G76, G269L<br/>3:Gene ontology<br/>4:找Mutation protocol、HR protocol<br/>5:溫度promoter: 增加敏感度',
+
                 description: " 1:UCP1人體活化路徑<br/>2:突變株: G176, G76, G269L<br/>3:Gene ontology<br/>4:找Mutation protocol、HR protocol<br/>5:溫度promoter: 增加敏感度",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 30, 14, 00),
+
                 startDate: new Date(2013, 2, 30, 14, 0),
-
                 title: '報進度 - 張宏宇',
+
                 title: "報進度 - 張宏宇",
-
                 description: ' 1: 結合發酵槽與卡計',
+
                 description: " 1: 結合發酵槽與卡計",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 2, 30, 14, 00),
+
                 startDate: new Date(2013, 2, 30, 14, 0),
-
                 title: '報進度 - 王德緯',
+
                 title: "報進度 - 王德緯",
-
                 description: ' 1: UCP 分解<br/>2: Transcription factor',
+
                 description: " 1: UCP 分解<br/>2: Transcription factor",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 3, 6, 14, 00),
+
                 startDate: new Date(2013, 3, 6, 14, 0),
-
                 title: '確認目標',
+
                 title: "確認目標",
-
                 description: ' 1: 低溫下加熱儀器的成本<br/>2: 大尺寸加熱難度',
+
                 description: " 1: 低溫下加熱儀器的成本<br/>2: 大尺寸加熱難度",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 3, 6, 14, 00),
+
                 startDate: new Date(2013, 3, 6, 14, 0),
-
                 title: '研究2008年成果',
+
                 title: "研究2008年成果",
-
                 description: 'Experiment 2008是用Homologous 還是 plasmid?',
+
                 description: "Experiment 2008是用Homologous 還是 plasmid?",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 3, 11),
                 startDate: new Date(2013, 3, 11),
-
                 title: '與麗冠教授討論實驗細節',
+
                 title: "與麗冠教授討論實驗細節",
-
                 description: '1. UV突變方法<br/>2. 低溫培養箱使用<br/>3. 酵母菌HR方法<br/>4. 大腸桿菌的優勢<br/>5. 回收死菌的系統',
+
                 description: "1. UV突變方法<br/>2. 低溫培養箱使用<br/>3. 酵母菌HR方法<br/>4. 大腸桿菌的優勢<br/>5. 回收死菌的系統",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 3, 20, 14, 00),
+
                 startDate: new Date(2013, 3, 20, 14, 0),
-
                 title: 'UT-Tokyo discussion next week',
+
                 title: "UT-Tokyo discussion next week",
-
                 description: '題目報告',
+
                 description: "題目報告",
                 priority: 1
                 priority: 1
             },{
             },{
-
                 startDate: new Date(2013, 4, 4, 14, 00),
+
                 startDate: new Date(2013, 4, 4, 14, 0),
-
                 title: 'Conference with UT-Tokyo',
+
                 title: "Conference with UT-Tokyo",
-
                 description: 'Conference with UT-Tokyo by Skype<br/> link: http://goo.gl/X6u5Z ',
+
                 description: "Conference with UT-Tokyo by Skype<br/> link: http://goo.gl/X6u5Z ",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 5, 12),
                 startDate: new Date(2013, 5, 12),
                 endDate: new Date(2013, 5, 0),
                 endDate: new Date(2013, 5, 0),
-
                 title: '討論',
+
                 title: "討論",
-
                 description: 'Normal Meeting',
+
                 description: "Normal Meeting",
                 priority: 1,
                 priority: 1,
-
                 frecuency: 2,
+
                 frecuency: 2
             },{
             },{
                 startDate: new Date(2013, 5, 1),
                 startDate: new Date(2013, 5, 1),
                 endDate: new Date(2013, 5, 30),
                 endDate: new Date(2013, 5, 30),
-
                 title: 'NTU 期末考',
+
                 title: "NTU 期末考",
-
                 description: '期末考試ING',
+
                 description: "期末考試ING",
                 priority: 3,
                 priority: 3,
                 frecuency: 1
                 frecuency: 1
             },{
             },{
                 startDate: new Date(2013, 6, 5, 10, 30),
                 startDate: new Date(2013, 6, 5, 10, 30),
-
                 title: '配培養液、培養基、菌體活化、繼代',
+
                 title: "配培養液、培養基、菌體活化、繼代",
-
                 description: '討論人力分配及生長曲線測定',
+
                 description: "討論人力分配及生長曲線測定",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 6, 8, 10, 30),
                 startDate: new Date(2013, 6, 8, 10, 30),
-
                 title: 'Conference',
+
                 title: "Conference",
-
                 description: 'Conference with Purdue iGEM team',
+
                 description: "Conference with Purdue iGEM team",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 6, 10, 10, 30),
                 startDate: new Date(2013, 6, 10, 10, 30),
-
                 title: 'Conference',
+
                 title: "Conference",
-
                 description: 'Conference with Berkeley iGEM',
+
                 description: "Conference with Berkeley iGEM",
                 priority: 1
                 priority: 1
             },{
             },{
                 startDate: new Date(2013, 6, 14, 10, 30),
                 startDate: new Date(2013, 6, 14, 10, 30),
-
                 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
             }
             }
         ]
         ]
-
     });  
+
     });
-
   
+
};
-
    $("#ui-datepicker-div").hide();
+
 
-
   
+
var windowResize = function(){
-
    var LightBoxAdd = function(id, src){
+
    $("iframe").css("width", "75%").css("height", $("iframe").width()*6/8);
-
        $("#lightbox").append(sprintf(
+
     if($(".rainbow-text").length !== 0){
-
            "<div id='%s' class='lightbox hide fade' tabindex='-1' role='dialog' aria-hidden='true'>" +
+
         $("#particleSystem").css("top", $(".rainbow-text").offset().top+50 + "px");
-
                "<div class='lightbox-content'>" +
+
-
                    "<img src='%s' alt='' onerror='this.src=http://ntu-best.herokuapp.com/%s>" +
+
-
                "</div>" +
+
-
            "</div>", id, src, 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("<div class=\"span12\"><ul class=\"thumbnails\"></ul></div>");
 
-
        var data = "", lightBox = "";
+
var spinner = new Spinner({
-
        for(var j=1; j<=number; j++){
+
    lines: 11,
-
            if(j%4 == 1) data += "<div class=\"row divide\">";
+
    length: 34,
-
            data += sprintf("" +
+
    width: 15,
-
                "<li class='span3'>" +
+
    radius: 45,
-
                    "<div class='thumbnail' data-thumb='tooltip' data-placement='top' data-original-title='Click me'>" +
+
    corners: 1.0,
-
                        "<a href='#%s_%d' data-toggle='lightbox'>" +
+
    rotate: 50,
-
                            "<img src='./img/%s/%%20(%d).jpg' onerror='this.src=http://ntu-best.herokuapp.com/img/%s/%%20(%d).jpg alt=''>" +
+
    trail: 86,
-
                        "</a>" +
+
    speed: 1.5,
-
                    "</div>" +
+
    direction: 1,
-
                "</li>", folder, j, folder, j, folder, j);
+
    shadow: "on",
 +
    className: "container"
 +
}).spin();
-
            if(j%4 == 0 || j == number){
+
if($("#preloader").length > 0){
-
                 $(value).find(".thumbnails").append(data)
+
    $("#preloader").append(spinner.el);
-
                 data = "";
+
}
 +
 
 +
$(document).ready(function(){
 +
    $(window).on("resize", windowResize);
 +
 
 +
    $("#navbar .dropdown>a").hover(function(){
 +
        $(this).parent().addClass("open");
 +
    });
 +
 
 +
 
 +
    var myRouter = Backbone.Router.extend({
 +
        initialize: function(){
 +
            this.database = {};
 +
            var data = $("script[type='text/template']");
 +
            for(var i=0; i<data.length; i++){
 +
                 this.database[$(data[i]).attr("id")] = $(data[i]).html();
 +
            }
 +
        },
 +
        routes:{
 +
            "*action": "mainContent"
 +
        },
 +
        mainContent: function(p1){
 +
            if(!p1) {
 +
                 p1 = "";
             }
             }
-
             LightBoxAdd(sprintf("%s_%d", folder, j), sprintf("./img/%s/%%20(%d).jpg", folder, j));
+
             $("#navbar a").parent().removeClass("active");
-
        }
+
            if($("#navbar a[href='#" + p1 + "']").closest("li").parents("li").length !== 0){
 +
                $("#navbar a[href='#" + p1 + "']").parents("li").addClass("active");
 +
            }
 +
            else{
 +
                $("#navbar a[href='#" + p1 + "']").parent().addClass("active");
 +
            }
-
    })
+
            if(!p1) {
 +
                p1 = "index";
 +
            }
 +
            if($("#" + p1).length === 0) {
 +
                p1 = "undefined";
 +
            }
-
    $.each($(".lightboxImg"), function(index, value){
+
            changeContent(this.database[p1], function(){
-
        var img = $(value).attr("img");
+
                $("[lightbox-id]").children().each(function(){
-
        var innerValue = sprintf("<a href='#%s' data-toggle='lightbox'> <img src='%s' alt='' onerror='this.src=http://ntu-best.herokuapp.com/%s' style='%s'> </a>", Path2ID(img), img, img, $(value).attr('img-style'));
+
                    var src = $(this).children("img").attr("src");
-
        $(value).append(innerValue);
+
                    var group = $(this).parent().attr("lightbox-id");
-
        LightBoxAdd(Path2ID(img), img);
+
                    $(this).wrapInner("<a href="+src+" data-lightbox="+group+"></a>");
-
    })
+
                });
-
   
+
                $(".tilt-gallery li").addClass("photo-item").wrapInner("<div></div>");
-
    $("#intro-background").videoBG({
+
                $("img").error(function(){
-
        mp4:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.mp4',
+
                    if($(this).attr("alt-src")){
-
        ogv:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.ogv',
+
                        $(this).attr("src", $(this).attr("alt-src"));
-
        webm:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.webm',
+
                    }
-
        poster:'http://ntu-best.herokuapp.com/video/Digital DNA Dreamscene.jpg',
+
                });
-
        fullscreen:true
+
 
 +
                calendar_create($("#calendar_content"));
 +
 
 +
                $(".index-item a, .photo-item a").click(function(){
 +
                    $("body").animate({
 +
                        scrollTop: $("#" + $(this).attr("scroll-to")).offset().top
 +
                    }, 1000, "easeInOutBack");
 +
                });
 +
 
 +
            }, function(){
 +
                $(window).resize();
 +
               
 +
                $(".content section h1.header").fitText(1, {minFontSize: "20px", maxFontSize: "90px"});
 +
 
 +
                $(".teamMember .img-gallery li").click(function(){
 +
                    $(this).addClass("active");
 +
                    $(this).siblings().removeClass("active");
 +
                }).click(function(){
 +
                    var html = $("#" + $(this).children().attr("toggle")).html();
 +
                    var color = $("#" + $(this).children().attr("toggle")).attr("color");
 +
                    if(color){
 +
                        var ori_color = $("#teamContainer").attr("cur-color");
 +
                        $("#teamContainer").removeClass(ori_color).addClass(color).attr("cur-color", color);
 +
                    }
 +
                   
 +
                    $("#teamContainer>div").hide("slide", {direction: "left", easing: "easeOutExpo"}, 500).queue(function(){
 +
                        $(this).html(html).show("slide", {direction: "right", easing: "easeInOutCubic"}, 300).dequeue();
 +
                    });
 +
                });
 +
 
 +
                $("[data-toggle='tooltip']").tooltip({
 +
                    placement: "auto",
 +
                    container: "body"
 +
                });
 +
 
 +
               
 +
            });
 +
        }
     });
     });
-
})
+
 
 +
    new myRouter();
 +
    Backbone.history.start();
 +
});

Latest revision as of 03:06, 28 September 2013

var changeContent = function(html, loadcall, callback){

   $(".content").hide("slide", { direction: "left", easing: "easeOutExpo"}, 300).queue(function(){
       $(this).html(html);
       if(loadcall) {
           loadcall();
       }
       $(this).show("slide", { direction: "right", easing: "easeInOutQuart"}, 500).dequeue();
       if(callback) {
           callback();
       }
   });

};

var calendar_create = function(target){

   $(target).dp_calendar({
       date_selected: new Date(2013, 7, 09, 12, 0),
       show_datepicker: false,
       order_by: 3,
       format_ampm: true,
       events_array: [{
               startDate: new Date(2013, 1, 16, 12, 0),
               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, 0), title: "Weekly Meeting", priority: 3 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "報告醫學院的三個題目 by 李易遠", description: "1. 偵測土味
2. HIV 的receptor給細菌,利用細菌抓HIV病毒。類似抗體的技巧
3. 水耕植物:用細菌偵測鈉、鉀、磷的變換", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 水果 by 吳泰億 ", description: "1. 乙烯、乙炔在催熟中扮演的角色
2. 面臨問題 - 過量有害
3. 可嘗試方向 - 水果成熟度的分級、利用乙烯、偵測乙烯的儀器", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 水果 by Po-Hsien ", description: "1. 水果非破壞性檢測技術", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 養殖漁業 by 吳泰億 ", description: "A. 面臨的問題 寒冬、硝化細菌
B. 改善設施、飼料配方、抗寒基因的研究
C. 可嘗試方向 魚類的生態球", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 養殖漁業 by 王德緯 ", description: "A. Uncoupling protein 讓proton 通過 不會產生ATP但產生熱
B. 用合成生物學的方法好處:不需要燃油、電力
C. 評估需要消耗提供多少熱量、養分來餵我們的biological device", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 養殖漁業 by 呂宗諭 ", description: "A. 寒冷造成傷害的原因:太冷產生結晶、細胞膜會被破壞、免疫能力下降
B. AFP, AFGP、基改魚類、飼料", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "Project資料與提案 - 芳香劑 by 呂宗諭 ", description: "偵測臭味的receptor、濕度溫度、代謝臭味的分子、直接放出芳香物", priority: 1 },{ startDate: new Date(2013, 1, 23, 14, 0), title: "隊名 NTU BEST", description: "NTU BEST :Biochemistry Engineering Synbio Team", priority: 2 },{ startDate: new Date(2013, 2, 9, 12, 0), title: "Weekly Meeting", priority: 3 },{ startDate: new Date(2013, 2, 9, 14, 0), title: "主題評估 - 合成胞器", description: "需要克服:創新不足、困難度高", priority: 1 },{ startDate: new Date(2013, 2, 9, 14, 0), title: "主題評估 - 發熱菌株(採用)", description: "i.先前研究
ii.產熱效率:不足的話目標改為提升效率", priority: 2 },{ startDate: new Date(2013, 2, 9, 14, 0), title: "主題評估 - 高分子", description: "i. 很多人做過
ii. 需要議題", priority: 1 },{ startDate: new Date(2013, 2, 9, 14, 0), 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, 0), title: "Weekly Meeting", priority: 3 },{ startDate: new Date(2013, 2, 23, 14, 0), title: "WET LAB老師接洽,實驗方法&應用層面", description: "a: 呂宗諭:漁科所
b: 張宏宇:梁國淦-發酵槽、熱卡計之儀器組裝與採買
c: 李易遠:陳彥榮-隊務", priority: 1 },{ startDate: new Date(2013, 2, 23, 14, 0), title: "DRY LAB模擬", description: "a: 模擬 UCP/ATP synthase 比例,找出產熱最大值
b: 模擬實際寒流來襲時,魚塭中的菌需發熱功率多少才能維持溫暖", priority: 1 },{ startDate: new Date(2013, 2, 30, 12, 0), title: "Weekly Meeting", priority: 3 },{ startDate: new Date(2013, 2, 30, 14, 0), 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, 0), title: "報進度 - 張宏宇", description: " 1: 結合發酵槽與卡計", priority: 1 },{ startDate: new Date(2013, 2, 30, 14, 0), title: "報進度 - 王德緯", description: " 1: UCP 分解
2: Transcription factor", priority: 1 },{ startDate: new Date(2013, 3, 6, 14, 0), title: "確認目標", description: " 1: 低溫下加熱儀器的成本
2: 大尺寸加熱難度", priority: 1 },{ startDate: new Date(2013, 3, 6, 14, 0), 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, 0), title: "UT-Tokyo discussion next week", description: "題目報告", priority: 1 },{ startDate: new Date(2013, 4, 4, 14, 0), 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 } ] });

};

var windowResize = function(){

   $("iframe").css("width", "75%").css("height", $("iframe").width()*6/8);
   if($(".rainbow-text").length !== 0){
       $("#particleSystem").css("top", $(".rainbow-text").offset().top+50 + "px");
   }

};


var spinner = new Spinner({

   lines: 11,
   length: 34,
   width: 15,
   radius: 45,
   corners: 1.0,
   rotate: 50,
   trail: 86,
   speed: 1.5,
   direction: 1,
   shadow: "on",
   className: "container"

}).spin();

if($("#preloader").length > 0){

   $("#preloader").append(spinner.el);

}

$(document).ready(function(){

   $(window).on("resize", windowResize);
   $("#navbar .dropdown>a").hover(function(){
       $(this).parent().addClass("open");
   });


   var myRouter = Backbone.Router.extend({
       initialize: function(){
           this.database = {};
           var data = $("script[type='text/template']");
           for(var i=0; i<data.length; i++){
               this.database[$(data[i]).attr("id")] = $(data[i]).html();
           }
       },
       routes:{
           "*action": "mainContent"
       },
       mainContent: function(p1){
           if(!p1) {
               p1 = "";
           }
           $("#navbar a").parent().removeClass("active");
           if($("#navbar a[href='#" + p1 + "']").closest("li").parents("li").length !== 0){
               $("#navbar a[href='#" + p1 + "']").parents("li").addClass("active");
           }
           else{
               $("#navbar a[href='#" + p1 + "']").parent().addClass("active");
           }
           if(!p1) {
               p1 = "index";
           }
           if($("#" + p1).length === 0) {
               p1 = "undefined";
           }
           changeContent(this.database[p1], function(){
               $("[lightbox-id]").children().each(function(){
                   var src = $(this).children("img").attr("src");
                   var group = $(this).parent().attr("lightbox-id");
                   $(this).wrapInner("<a href="+src+" data-lightbox="+group+"></a>");
               });
$(".tilt-gallery li").addClass("photo-item").wrapInner("
");
               $("img").error(function(){
                   if($(this).attr("alt-src")){
                       $(this).attr("src", $(this).attr("alt-src"));
                   }
               });
               calendar_create($("#calendar_content"));
               $(".index-item a, .photo-item a").click(function(){
                   $("body").animate({
                       scrollTop: $("#" + $(this).attr("scroll-to")).offset().top
                   }, 1000, "easeInOutBack");
               });
           }, function(){
               $(window).resize();
               
               $(".content section h1.header").fitText(1, {minFontSize: "20px", maxFontSize: "90px"});
               $(".teamMember .img-gallery li").click(function(){
                   $(this).addClass("active");
                   $(this).siblings().removeClass("active");
               }).click(function(){
                   var html = $("#" + $(this).children().attr("toggle")).html();
                   var color = $("#" + $(this).children().attr("toggle")).attr("color");
                   if(color){
                       var ori_color = $("#teamContainer").attr("cur-color");
                       $("#teamContainer").removeClass(ori_color).addClass(color).attr("cur-color", color);
                   }
                   
                   $("#teamContainer>div").hide("slide", {direction: "left", easing: "easeOutExpo"}, 500).queue(function(){
                       $(this).html(html).show("slide", {direction: "right", easing: "easeInOutCubic"}, 300).dequeue();
                   });
               });
               $("[data-toggle='tooltip']").tooltip({
                   placement: "auto",
                   container: "body"
               });


           });
       }
   });
   new myRouter();
   Backbone.history.start();

});