- Timestamp:
- Mar 26, 2015 2:52:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js
r830 r831 9 9 if (p_period == -1 && is_overdate == 1) 10 10 { 11 12 13 14 15 $('#update_user_info').modal({backdrop: 'static',keyboard: false,});16 17 }); 11 $('#alert-trial-services').modal('show'); 12 $('#alert-trial-services').on('hidden.bs.modal', function () { 13 if (update_user_info == "1") 14 { 15 $('#update_user_info').modal({backdrop: 'static', keyboard: false, }); 16 } 17 }); 18 18 } 19 19 else 20 20 { 21 22 23 24 21 if (update_user_info == "1") 22 { 23 $('#update_user_info').modal({backdrop: 'static'}); 24 } 25 25 } 26 26 … … 54 54 console.log('Show modal!'); 55 55 $('#alert-services-package').modal('show'); 56 56 //$('#alert-services-package-bk').modal('show'); 57 57 } 58 58 … … 124 124 } 125 125 126 function DoCloseLecture 127 g_Flash.SetVariable("command", "Quit App"); 128 } 129 130 function getLectureState 131 132 return state == 'true' ? true: (state == 'false' ? false:false);126 function DoCloseLecture() { 127 g_Flash.SetVariable("command", "Quit App"); 128 } 129 130 function getLectureState() { 131 var state = g_Flash.GetVariable("dataChanged"); 132 return state == 'true' ? true : (state == 'false' ? false : false); 133 133 } 134 134 … … 174 174 175 175 $(document).ready(function () { 176 InitViolet(); 177 if(fileid!="") 178 { 179 console.log('http://sbgapi.violet.vn/space/file/id/'+fileid); 180 DoOpenLecture('http://sbgapi.violet.vn/space/file/id/'+fileid); 181 } 182 var inFormOrLink = false; 183 184 $(window).on('beforeunload', function() { 185 var e = $.Event('webapp:page:closing'); 186 $(window).trigger(e); // let other modules determine whether to prevent closing 187 if(e.isDefaultPrevented()) { 188 return e.message; 189 } 190 }); 191 192 $(window).on('webapp:page:closing', function(e) { 193 if(getLectureState()) { 194 e.preventDefault(); 195 e.message = 'Bạn Äang soạn bà i giảng và chưa lưu dữ liá»u. Bạn có muá»n chuyá»n khá»i ứng dụng khÃŽng?'; 196 } 197 }); 198 176 InitViolet(); 177 var inFormOrLink = false; 178 179 $(window).on('beforeunload', function () { 180 var e = $.Event('webapp:page:closing'); 181 $(window).trigger(e); // let other modules determine whether to prevent closing 182 if (e.isDefaultPrevented()) { 183 return e.message; 184 } 185 }); 186 187 $(window).on('webapp:page:closing', function (e) { 188 if (getLectureState()) { 189 e.preventDefault(); 190 e.message = 'Bạn Äang soạn bà i giảng và chưa lưu dữ liá»u. Bạn có muá»n chuyá»n khá»i ứng dụng khÃŽng?'; 191 } 192 }); 193 setTimeout(function () { 194 if (fileid != "") 195 { 196 DoOpenLecture(api_url+'space/file/id/' + fileid); 197 } 198 199 }, 1000); 199 200 }) 200 201
Note: See TracChangeset
for help on using the changeset viewer.