File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,3 +301,12 @@ table.nav{
301301 opacity : 0 ;
302302 z-index : 9999 ;
303303}
304+
305+ /* 處理按鈕列的提示字串位置 */
306+ .toolMenu div {
307+ display : flex !important ;
308+ justify-content : center;
309+ text-align : center;
310+ left : 0px ;
311+ right : 0px ;
312+ }
Original file line number Diff line number Diff line change 11+ ( function ( ) {
22
3+ var FILMS = {
4+ 'stages/01' : 'https://youtu.be/o9NPI3BtNoA' ,
5+ 'stages/02' : 'https://youtu.be/VN4sKngbiGI' ,
6+ 'stages/03' : 'https://youtu.be/mXCnzUzcNSk' ,
7+ 'stages/05' : 'https://youtu.be/UmMJG2zInWU' ,
8+ 'stages/10' : 'https://youtu.be/NA2kjjwoWNA'
9+ } ;
10+
311 window . addEventListener ( 'load' , function ( ) {
412
513 // 當點選關卡而非解答時,清空內容
816 // 當點選關卡而非解答時,清空內容
917 restoreSimulator ( ) ;
1018
19+ // 決定影片按鈕的行為
20+ watchFilm ( ) ;
21+
1122 // 計算闖關時間
1223 window . stage = {
1324 startTime : Date . now ( ) ,
7889 return frame . contentWindow . blockly . getConfig ( ) ;
7990 }
8091
92+ function watchFilm ( ) {
93+ var stageName = Code . getStringParamFromUrl ( 'page' ) ;
94+ var url = FILMS [ stageName ] ;
95+ var watchFilm = document . getElementById ( 'watchFilm' ) ;
96+
97+ if ( ! url ) {
98+ watchFilm . style . display = "none" ;
99+ return ;
100+ }
101+
102+ Code . bindClick ( watchFilm ,
103+ function ( ) {
104+ window . open ( url ) ;
105+ } ) ;
106+ }
107+
81108} ) ( ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var MSG = {
2121 timeout : "Maximum execution iterations exceeded." ,
2222 trashTooltip : "Discard All Blocks" ,
2323 sampleTooltip : "Load Sample Blocks" ,
24+ film : "Film" ,
2425 helpTooltip : "Help" ,
2526 simulatorTooltip : "Simulator Area" ,
2627 demoTooltip : "Web Demo Area" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var MSG = {
2121 timeout : "超过最大执行数" ,
2222 trashTooltip : "删除所有积木" ,
2323 sampleTooltip : "载入范例积木" ,
24+ film : "影片" ,
2425 helpTooltip : "提示" ,
2526 simulatorTooltip : "模拟器区域" ,
2627 demoTooltip : "网页互动区域" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var MSG = {
2121 timeout : "超過最大執行數" ,
2222 trashTooltip : "刪除所有積木" ,
2323 sampleTooltip : "載入範例積木" ,
24+ film : "影片" ,
2425 helpTooltip : "提示" ,
2526 simulatorTooltip : "模擬器區域" ,
2627 demoTooltip : "網頁互動區域" ,
Original file line number Diff line number Diff line change 5757 <td class =" tabmin" > </td >
5858 <td id =" tab_xml" class =" taboff" style =" display:none;" >XML</td >
5959 <td class =" tabmax" >
60+ <button id =" watchFilm" class =" notext toolMenu" >
61+ <i class =" icon-film" ></i > <div >{{ film }} </div >
62+ </button >
6063 <button id =" helpButton" class =" notext toolMenu" >
6164 <i class =" icon-info" ></i > <div >{{ helpTooltip }} </div >
6265 </button >
You can’t perform that action at this time.
0 commit comments