|
@@ -28,7 +28,7 @@
|
|
|
|
|
|
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;"></div>
|
|
|
<!-- demo feature, non-production use -->
|
|
|
- <script src="./demoData/demoFeature.js"></script>
|
|
|
+ <!-- <script src="./demoData/demoFeature.js"></script> -->
|
|
|
<script src="./demoData/sheetFormula.js"></script>
|
|
|
<script src="./demoData/sheetCell.js"></script>
|
|
|
<script src="./demoData/sheetConditionFormat.js"></script>
|
|
@@ -57,31 +57,31 @@
|
|
|
$(function () {
|
|
|
|
|
|
// According to the browser language
|
|
|
- var lang = luckysheetDemoUtil.language() === 'zh' ? 'zh' : 'en';
|
|
|
- var isShare = luckysheetDemoUtil.getRequest().share; // '?share=1' opens the collaborative editing mode
|
|
|
- var gridKey = luckysheetDemoUtil.getRequest().gridKey; // workbook id for collaborative editing, or directly define here
|
|
|
+ // var lang = luckysheetDemoUtil.language() === 'zh' ? 'zh' : 'en';
|
|
|
+ // var isShare = luckysheetDemoUtil.getRequest().share; // '?share=1' opens the collaborative editing mode
|
|
|
+ // var gridKey = luckysheetDemoUtil.getRequest().gridKey; // workbook id for collaborative editing, or directly define here
|
|
|
var options = null;
|
|
|
|
|
|
- if(isShare || gridKey){
|
|
|
- // http://localhost:3000/?gridKey=12eyy789-kk45ofid-23737245
|
|
|
- if(!gridKey){
|
|
|
- alert('If gridKey is not provided in the address bar, please add it in the source code')
|
|
|
- }
|
|
|
- options = {
|
|
|
- container: "luckysheet",
|
|
|
- lang: lang,
|
|
|
- allowUpdate:true,
|
|
|
- updateImageUrl: location.origin + "/luckysheet/api/updateImg",
|
|
|
- updateUrl: "ws://"+ location.host +"/luckysheet/websocket/luckysheet",
|
|
|
- gridKey: gridKey,
|
|
|
- loadUrl: location.origin + "/luckysheet/api/load",
|
|
|
- loadSheetUrl: location.origin + "/luckysheet/api/loadsheet"
|
|
|
- }
|
|
|
- }else{
|
|
|
+ // if(isShare || gridKey){
|
|
|
+ // // http://localhost:3000/?gridKey=12eyy789-kk45ofid-23737245
|
|
|
+ // if(!gridKey){
|
|
|
+ // alert('If gridKey is not provided in the address bar, please add it in the source code')
|
|
|
+ // }
|
|
|
+ // options = {
|
|
|
+ // container: "luckysheet",
|
|
|
+ // lang: lang,
|
|
|
+ // allowUpdate:true,
|
|
|
+ // updateImageUrl: location.origin + "/luckysheet/api/updateImg",
|
|
|
+ // updateUrl: "ws://"+ location.host +"/luckysheet/websocket/luckysheet",
|
|
|
+ // gridKey: gridKey,
|
|
|
+ // loadUrl: location.origin + "/luckysheet/api/load",
|
|
|
+ // loadSheetUrl: location.origin + "/luckysheet/api/loadsheet"
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
// http://localhost:3000/
|
|
|
options = {
|
|
|
container: 'luckysheet',
|
|
|
- lang: lang,
|
|
|
+ lang: (document.documentElement.lang||document.head.lang||window.navigator.language||window.navigator.userLanguage||"zh").substr(0,2),
|
|
|
// pager: {
|
|
|
// pageIndex: 1,
|
|
|
// pageSize: 10,
|
|
@@ -142,7 +142,7 @@
|
|
|
// console.info(data,sheetFile,ctx)
|
|
|
},
|
|
|
updated:function(operate){
|
|
|
- // console.info(operate)
|
|
|
+ // console.info('updated',operate)
|
|
|
},
|
|
|
cellUpdateBefore:function(r,c,value,isRefresh){
|
|
|
// console.info('cellUpdateBefore',r,c,value,isRefresh)
|
|
@@ -181,7 +181,7 @@
|
|
|
// console.info(json)
|
|
|
},
|
|
|
rangePasteBefore:function(range,data){
|
|
|
- // console.info('rangePasteBefore',range,data)
|
|
|
+ console.info('rangePasteBefore',range,data)
|
|
|
// return false; //Can intercept paste
|
|
|
},
|
|
|
|
|
@@ -1875,7 +1875,7 @@
|
|
|
"scrollTop": 0
|
|
|
}]*/
|
|
|
}
|
|
|
- }
|
|
|
+ // }
|
|
|
options.loading={
|
|
|
image:()=>{
|
|
|
return `<svg viewBox="25 25 50 50" class="circular">
|