diff --git a/course/index.html b/course/index.html index 7e22440..2663bd0 100644 --- a/course/index.html +++ b/course/index.html @@ -313,7 +313,7 @@ detail = ''; detail += '\ - \ + \ \
開課序號'+id+'
開課序號'+id+'
開課單位/班級'+res[3]['dept']+res[3]['year']+res[3]['class']+'
上課時間'; $.each( res[3]['time'], function( k2, t ) { @@ -396,7 +396,7 @@ detail = ''; if(!id.includes('ALT_')) detail += '\ - \ + \ \ \ \ diff --git a/course/rule.html b/course/rule.html index 07972a3..09fa5f4 100644 --- a/course/rule.html +++ b/course/rule.html @@ -358,7 +358,7 @@ detail = ''; detail += '
開課序號'+id+'
開課序號'+id+'
開課單位/班級'+basic_data[0].innerHTML+'
上課時間'+basic_data[2].innerHTML+'
修別/學分'+basic_data[3].innerHTML+' 學分
\ - \ + \ \
開課序號'+courseData[id].id+'
開課序號'+courseData[id].id+'
開課單位/班級'+courseData[id].dept+courseData[id].year+courseData[id].class+'
上課時間'; $.each( courseData[id].time, function( k2, t ) { diff --git a/course/saved.html b/course/saved.html index 2f288fa..b7545a1 100644 --- a/course/saved.html +++ b/course/saved.html @@ -239,6 +239,24 @@ const params = new Proxy(new URLSearchParams(window.location.search), { get: (searchParams, prop) => searchParams.get(prop), }); + + if(params.ids) { + Swal.fire({ + title: '確定要匯入 ' +params.ids.split(',').length+ ' 門課程?', + text: '先前收藏的課程將會清空!', + confirmButtonText: '匯入', + showCancelButton: true, + cancelButtonText: '取消', + confirmButtonColor: 'var(--ts-primary-600)' + }).then((result) => { + if (result.isConfirmed) { + localStorage.setItem('savedCourse', JSON.stringify(params.ids.split(','))); + localStorage.setItem('term', params.ids.substr(0,4)); + location.href = './saved'; + } + }) + } + if(window.location.hash) { _import = atob(window.location.hash.replace('#','')).split(','); if(_import.length > 0) { @@ -326,7 +344,7 @@ detail = ''; if(!id.includes('ALT_')) detail += '\ - \ + \ \ \ \ @@ -453,6 +471,34 @@ }); }); + $('body').on('click','#share',function(){ + Swal.fire({ + title: '匯出 ' +savedCourse.length+ ' 門收藏的課程', + text: '請複製以下網址後到其他裝置貼上!', + input: 'text', + inputValue: 'https://mcut.henrywu.tw/course/saved?ids='+savedCourse.join(','), + inputAttributes: { + autocapitalize: 'off' + }, + confirmButtonText: '複製', + showCancelButton: true, + cancelButtonText: '關閉', + confirmButtonColor: 'var(--ts-primary-600)' + }).then((result) => { + if (result.isConfirmed) { + var ip = document.getElementById('swal2-input'); + ip.select(); + document.execCommand('copy'); + Swal.fire({ + title: '已複製網址,請貼上到其他裝置!', icon: 'success', toast: true, + timer: 3000, timerProgressBar: true, + position: 'bottom-start', showConfirmButton: false, + }) + } + }); + document.getElementById('swal2-input').setSelectionRange(0,0); + }); + $('[data-show]').on('click',function(){ $('[data-content]').hide(); $('[data-content="'+$(this).attr('data-show')+'"]').show(); @@ -498,7 +544,8 @@

收藏的課程

- +   +
開課序號'+id+'
開課序號'+id+'
開課單位/班級'+basic_data[0].innerHTML+'
上課時間'+basic_data[2].innerHTML+'
修別/學分'+basic_data[3].innerHTML+' 學分