CLodopfuncs.js 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  1. (function (win) {
  2. var CLODOP = {
  3. strWebPageID:"7BCAAAE",strTaskID:"",strHostURI:"http://localhost:18000",
  4. VERSION:"6.5.6.9",IVERSION:"6569",CVERSION:"6.5.6.9",HTTPS_STATUS:0,VERSION_EXT:true,
  5. iBaseTask:0,timeThreshold:5,Priority:1,blIslocal:true,
  6. Iframes:[],ItemDatas:{},PageData:{},defStyleJson:{},PageDataEx:{},ItemCNameStyles:{},
  7. blWorking:false,blNormalItemAdded:false,blTmpSelectedIndex:null,Caption:null,Color:null,CompanyName:null,strBroadcastMS:null,
  8. Border:null,Inbrowse:null,webskt:null,SocketEnable:false,SocketOpened:false,NoClearAfterPrint:false,On_Return_Remain:false,On_Broadcast_Remain:false,
  9. On_Return:null,Result:null,OBO_Mode:1,blOneByone:false,DelimChar:"\f\f",Printers:{"default":"3","list":[{"name":"导出为WPS PDF","DriverName":"Kingsoft Virtual Printer Driver","PortName":"Kingsoft Virtual Printer Port","Orientation":"1","PaperSize":"9","PaperLength":"2970","PaperWidth":"2100","Copies":"1","DefaultSource":"1","PrintQuality":"600","Color":"2","Duplex":"1","FormName":"A4","Comment":"","DriverVersion":"20481","DCOrientation":"90","MaxExtentWidth":"65535","MaxExtentLength":"65535","MinExtentWidth":"10","MinExtentlength":"10","pagelist":[{"name":"信纸"},{"name":"小号信纸"},{"name":"Tabloid"},{"name":"Ledger"},{"name":"法律专用纸"},{"name":"Statement"},{"name":"Executive"},{"name":"A3"},{"name":"A4"},{"name":"A4 小号"},{"name":"A5"},{"name":"B4 (JIS)"},{"name":"B5 (JIS)"},{"name":"Folio"},{"name":"Quarto"},{"name":"10x14"},{"name":"11x17"},{"name":"便笺"},{"name":"信封 #9"},{"name":"信封 #10"},{"name":"信封 #11"},{"name":"信封 #12"},{"name":"信封 #14"},{"name":"C size sheet"},{"name":"D size sheet"},{"name":"E size sheet"},{"name":"信封 DL"},{"name":"信封 C5"},{"name":"信封 C3"},{"name":"信封 C4"},{"name":"信封 C6"},{"name":"信封 C65"},{"name":"信封 B4"},{"name":"信封 B5"},{"name":"信封 B6"},{"name":"信封"},{"name":"信封 Monarch"},{"name":"6 3/4 信封"},{"name":"美国标准 Fanfold"},{"name":"德国标准 Fanfold"},{"name":"德国法律专用纸 Fanfold"},{"name":"B4 (ISO)"},{"name":"日式明信片"},{"name":"9x11"},{"name":"10x11"},{"name":"15x11"},{"name":"信封邀请函"},{"name":"特大信纸"},{"name":"特大法律专用纸"},{"name":"Tabloid 特大"},{"name":"A4 特大"},{"name":"信纸横向"},{"name":"A4 横向"},{"name":"特大信纸横向"},{"name":"Super A"},{"name":"Super B"},{"name":"信纸加大"},{"name":"A4 加大"},{"name":"A5 横向"},{"name":"B5 (JIS) 横向"},{"name":"A3 特大"},{"name":"A5 特大"},{"name":"B5 (ISO) 特大"},{"name":"A2"},{"name":"A3 横向"},{"name":"A3 特大横向"},{"name":"日式往返明信片"},{"name":"A6"},{"name":"日式信封 Kaku #2"},{"name":"日式信封 Kaku #3"},{"name":"日式信封 Chou #3"},{"name":"日式信封 Chou #4"},{"name":"信纸旋转"},{"name":"A3 旋转"},{"name":"A4 旋转"},{"name":"A5 旋转"},{"name":"B4 (JIS) 旋转"},{"name":"B5 (JIS) 旋转"},{"name":"日式明信片旋转"},{"name":"双层日式明信片旋转"},{"name":"A6 旋转"},{"name":"日式信封 Kaku #2 旋转"},{"name":"日式信封 Kaku #3 旋转"},{"name":"日式信封 Chou #3 旋转"},{"name":"日式信封 Chou #4 旋转"},{"name":"B6 (JIS)"},{"name":"B6 (JIS) 旋转"},{"name":"12x11"},{"name":"日式信封 You #4"},{"name":"日式信封 You #4 旋转"},{"name":"PRC 16K"},{"name":"PRC 32K"},{"name":"PRC 32K(Big)"},{"name":"PRC 信封 #1"},{"name":"PRC 信封 #2"},{"name":"PRC 信封 #3"},{"name":"PRC 信封 #4"},{"name":"PRC 信封 #5"},{"name":"PRC 信封 #6"},{"name":"PRC 信封 #7"},{"name":"PRC 信封 #8"},{"name":"PRC 信封 #9"},{"name":"PRC 信封 #10"},{"name":"PRC 16K 旋转"},{"name":"PRC 32K 旋转"},{"name":"PRC 32K(大)旋转"},{"name":"PRC 信封 #1 旋转"},{"name":"PRC 信封 #2 旋转"},{"name":"PRC 信封 #3 旋转"},{"name":"PRC 信封 #4 旋转"},{"name":"PRC 信封 #5 旋转"},{"name":"PRC 信封 #6 旋转"},{"name":"PRC 信封 #7 旋转"},{"name":"PRC 信封 #8 旋转"},{"name":"PRC 信封 #9 旋转"},{"name":"PRC 信封 #10 旋转"}],"subdevlist":[]},{"name":"Microsoft XPS Document Writer","DriverName":"Microsoft XPS Document Writer v4","PortName":"PORTPROMPT:","Orientation":"1","PaperSize":"9","PaperLength":"2970","PaperWidth":"2100","Copies":"1","DefaultSource":"15","PrintQuality":"600","Color":"2","Duplex":"1","FormName":"A4","Comment":"","DriverVersion":"1539","DCOrientation":"270","MaxExtentWidth":"8636","MaxExtentLength":"11176","MinExtentWidth":"900","MinExtentlength":"900","pagelist":[{"name":"信纸"},{"name":"小号信纸"},{"name":"Tabloid"},{"name":"Ledger"},{"name":"法律专用纸"},{"name":"Statement"},{"name":"Executive"},{"name":"A3"},{"name":"A4"},{"name":"A4 小号"},{"name":"A5"},{"name":"B4 (JIS)"},{"name":"B5 (JIS)"},{"name":"Folio"},{"name":"Quarto"},{"name":"10x14"},{"name":"11x17"},{"name":"便笺"},{"name":"信封 #9"},{"name":"信封 #10"},{"name":"信封 #11"},{"name":"信封 #12"},{"name":"信封 #14"},{"name":"C size sheet"},{"name":"D size sheet"},{"name":"E size sheet"},{"name":"信封 DL"},{"name":"信封 C5"},{"name":"信封 C3"},{"name":"信封 C4"},{"name":"信封 C6"},{"name":"信封 C65"},{"name":"信封 B4"},{"name":"信封 B5"},{"name":"信封 B6"},{"name":"信封"},{"name":"信封 Monarch"},{"name":"6 3/4 信封"},{"name":"美国标准 Fanfold"},{"name":"德国标准 Fanfold"},{"name":"德国法律专用纸 Fanfold"},{"name":"B4 (ISO)"},{"name":"日式明信片"},{"name":"9x11"},{"name":"10x11"},{"name":"15x11"},{"name":"信封邀请函"},{"name":"特大信纸"},{"name":"特大法律专用纸"},{"name":"A4 特大"},{"name":"信纸横向"},{"name":"A4 横向"},{"name":"特大信纸横向"},{"name":"Super A"},{"name":"Super B"},{"name":"信纸加大"},{"name":"A4 加大"},{"name":"A5 横向"},{"name":"B5 (JIS) 横向"},{"name":"A3 特大"},{"name":"A5 特大"},{"name":"B5 (ISO) 特大"},{"name":"A2"},{"name":"A3 横向"},{"name":"A3 特大横向"},{"name":"日式往返明信片"},{"name":"A6"},{"name":"日式信封 Kaku #2"},{"name":"日式信封 Kaku #3"},{"name":"日式信封 Chou #3"},{"name":"日式信封 Chou #4"},{"name":"信纸旋转"},{"name":"A3 旋转"},{"name":"A4 旋转"},{"name":"A5 旋转"},{"name":"B4 (JIS) 旋转"},{"name":"B5 (JIS) 旋转"},{"name":"日式明信片旋转"},{"name":"双层日式明信片旋转"},{"name":"A6 旋转"},{"name":"日式信封 Kaku #2 旋转"},{"name":"日式信封 Kaku #3 旋转"},{"name":"日式信封 Chou #3 旋转"},{"name":"日式信封 Chou #4 旋转"},{"name":"B6 (JIS)"},{"name":"B6 (JIS) 旋转"},{"name":"12x11"},{"name":"日式信封 You #4"},{"name":"日式信封 You #4 旋转"},{"name":"PRC 信封 #1"},{"name":"PRC 信封 #3"},{"name":"PRC 信封 #4"},{"name":"PRC 信封 #5"},{"name":"PRC 信封 #6"},{"name":"PRC 信封 #7"},{"name":"PRC 信封 #8"},{"name":"PRC 信封 #9"},{"name":"PRC 信封 #10"},{"name":"PRC 信封 #1 旋转"},{"name":"PRC 信封 #3 旋转"},{"name":"PRC 信封 #4 旋转"},{"name":"PRC 信封 #5 旋转"},{"name":"PRC 信封 #6 旋转"},{"name":"PRC 信封 #7 旋转"},{"name":"PRC 信封 #8 旋转"},{"name":"PRC 信封 #9 旋转"},{"name":"用户定义大小"}],"subdevlist":[]},{"name":"Microsoft Print to PDF","DriverName":"Microsoft Print To PDF","PortName":"PORTPROMPT:","Orientation":"1","PaperSize":"9","PaperLength":"2970","PaperWidth":"2100","Copies":"1","DefaultSource":"15","PrintQuality":"600","Color":"2","Duplex":"1","FormName":"A4","Comment":"","DriverVersion":"1539","DCOrientation":"90","MaxExtentWidth":"2970","MaxExtentLength":"4318","MinExtentWidth":"1397","MinExtentlength":"2100","pagelist":[{"name":"信纸"},{"name":"Tabloid"},{"name":"法律专用纸"},{"name":"Statement"},{"name":"Executive"},{"name":"A3"},{"name":"A4"},{"name":"A5"},{"name":"B4 (JIS)"},{"name":"B5 (JIS)"}],"subdevlist":[]},{"name":"HP LaserJet Pro MFP M126nw[E25CAD]","DriverName":"HP LaserJet Pro MFP M125-M126 PCLmS","PortName":"WSD-47f0526c-952d-43e8-9083-696d52ea6a78","Orientation":"1","PaperSize":"9","PaperLength":"2970","PaperWidth":"2100","Copies":"1","DefaultSource":"15","PrintQuality":"600","Color":"1","Duplex":"1","FormName":"A4","Comment":"","DriverVersion":"1539","DCOrientation":"270","MaxExtentWidth":"2159","MaxExtentLength":"3556","MinExtentWidth":"984","MinExtentlength":"1480","pagelist":[{"name":"信纸"},{"name":"法律专用纸"},{"name":"Executive"},{"name":"A4"},{"name":"A5"},{"name":"B5 (JIS)"},{"name":"信封 #10"},{"name":"信封 DL"},{"name":"信封 C5"},{"name":"信封 B5"},{"name":"信封 Monarch"},{"name":"日式明信片"},{"name":"A6"},{"name":"双层日式明信片旋转"},{"name":"Oficio 8.5x13"},{"name":"16K 184x260 毫米"},{"name":"16K 195x270 毫米"},{"name":"16K 197x273 毫米"},{"name":"Oficio 216x340 毫米"}],"subdevlist":[]},{"name":"Fax","DriverName":"Microsoft Shared Fax Driver","PortName":"SHRFAX:","Orientation":"1","PaperSize":"9","PaperLength":"0","PaperWidth":"0","Copies":"1","DefaultSource":"1","PrintQuality":"200","Color":"1","Duplex":"1","FormName":"A4","Comment":"","DriverVersion":"1024","DCOrientation":"90","MaxExtentWidth":"2160","MaxExtentLength":"3556","MinExtentWidth":"0","MinExtentlength":"0","pagelist":[{"name":"信纸"},{"name":"小号信纸"},{"name":"法律专用纸"},{"name":"Statement"},{"name":"Executive"},{"name":"A4"},{"name":"A4 小号"},{"name":"A5"},{"name":"B5 (JIS)"},{"name":"Folio"},{"name":"Quarto"},{"name":"便笺"},{"name":"信封 #9"},{"name":"信封 #10"},{"name":"信封 #11"},{"name":"信封 #12"},{"name":"信封 #14"},{"name":"信封 DL"},{"name":"信封 C5"},{"name":"信封 C6"},{"name":"信封 C65"},{"name":"信封 B5"},{"name":"信封 B6"},{"name":"信封"},{"name":"信封 Monarch"},{"name":"6 3/4 信封"},{"name":"德国标准 Fanfold"},{"name":"德国法律专用纸 Fanfold"},{"name":"日式明信片"},{"name":"Reserved48"},{"name":"Reserved49"},{"name":"信纸横向"},{"name":"A4 横向"},{"name":"信纸加大"},{"name":"A4 加大"},{"name":"A5 横向"},{"name":"B5 (JIS) 横向"},{"name":"A5 特大"},{"name":"B5 (ISO) 特大"},{"name":"日式往返明信片"},{"name":"A6"},{"name":"日式信封 Kaku #3"},{"name":"日式信封 Chou #3"},{"name":"日式信封 Chou #4"},{"name":"A5 旋转"},{"name":"日式明信片旋转"},{"name":"双层日式明信片旋转"},{"name":"A6 旋转"},{"name":"日式信封 Chou #4 旋转"},{"name":"B6 (JIS)"},{"name":"B6 (JIS) 旋转"},{"name":"日式信封 You #4"},{"name":"PRC 16K"},{"name":"PRC 32K"},{"name":"PRC 32K(Big)"},{"name":"PRC 信封 #1"},{"name":"PRC 信封 #2"},{"name":"PRC 信封 #3"},{"name":"PRC 信封 #4"},{"name":"PRC 信封 #5"},{"name":"PRC 信封 #6"},{"name":"PRC 信封 #7"},{"name":"PRC 信封 #8"},{"name":"PRC 32K 旋转"},{"name":"PRC 32K(大)旋转"},{"name":"PRC 信封 #1 旋转"},{"name":"PRC 信封 #2 旋转"},{"name":"PRC 信封 #3 旋转"},{"name":"PRC 信封 #4 旋转"},{"name":"Oficio 8.5x13"},{"name":"16K 184x260 毫米"},{"name":"16K 195x270 毫米"},{"name":"16K 197x273 毫米"},{"name":"Oficio 216x340 毫米"}],"subdevlist":[]}]},
  10. altMessageWebSocketInvalid:"WebSocket没准备好,请稍后重试!",
  11. altMessageNoReadWriteFile:"不能远程读写文件!",
  12. altMessageNoReadFile:"不能远程读文件!",
  13. altMessageNoWriteFile:"不能远程写文件!",
  14. altMessageNoPrintDesign:"不能远程打印设计!",
  15. altMessageNoPrintSetup:"不能远程打印维护!",
  16. altMessageSomeWindowExist:"有窗口已打开,先关闭它(持续如此时请刷新页面)!",
  17. altMessageBusy:"上一个请求正忙,请稍后再试!",
  18. Browser: (function(){
  19. var ua = navigator.userAgent;
  20. var isOpera = Object.prototype.toString.call(window.opera) == "[object Opera]";
  21. return {
  22. IE: !!window.attachEvent && !isOpera,
  23. Opera: isOpera,
  24. WebKit: ua.indexOf("AppleWebKit/") > -1,
  25. Gecko: ua.indexOf("Gecko") > -1 && ua.indexOf("KHTML") === -1,
  26. MobileSafari: /Apple.*Mobile/.test(ua)
  27. }
  28. })(),
  29. GetTaskID:function(){
  30. if (!this.strTaskID || this.strTaskID==""){
  31. var dt=new Date();
  32. this.iBaseTask++;
  33. this.strTaskID=""+dt.getHours()+dt.getMinutes()+dt.getSeconds()+"_"+this.iBaseTask;
  34. }
  35. return this.strWebPageID+this.strTaskID;
  36. },
  37. DoInit:
  38. function() {
  39. this.strTaskID="";
  40. if (this.NoClearAfterPrint) return;
  41. this.ItemDatas={"count":0};
  42. this.PageData={};
  43. this.ItemCNameStyles={};
  44. this.defStyleJson={"beginpage":0,"beginpagea":0};
  45. this.blNormalItemAdded=false;
  46. },
  47. OpenWebSocket:
  48. function() {
  49. if (!window.WebSocket && !window.MozWebSocket){
  50. if (window.On_CLodop_Opened){
  51. if (CLODOP.Priority==window.CLODOP_OK_Priority) setTimeout("window.On_CLodop_Opened(CLODOP)",1);
  52. }
  53. return;
  54. }
  55. this.SocketEnable=true;
  56. try {
  57. if (!this.webskt || this.webskt.readyState==3) {
  58. if (!window.WebSocket && window.MozWebSocket) window.WebSocket=window.MozWebSocket;
  59. this.webskt=new WebSocket('ws://127.0.0.1:18000/c_webskt/');
  60. this.webskt.onopen = function(e) {
  61. CLODOP.SocketOpened=true;
  62. if (window.On_CLodop_Opened){
  63. if (CLODOP.Priority==window.CLODOP_OK_Priority) setTimeout("window.On_CLodop_Opened(CLODOP)",1);
  64. }
  65. };
  66. this.webskt.onmessage = function(e) {
  67. CLODOP.blOneByone=false;
  68. var strResult=e.data;
  69. CLODOP.Result=strResult;
  70. try {
  71. var strFTaskID=null;
  72. var iPos=strResult.indexOf("=");
  73. if (iPos>=0 && iPos<30){
  74. strFTaskID=strResult.slice(0,iPos);
  75. strResult=strResult.slice(iPos+1);
  76. }
  77. if (strFTaskID.indexOf("ErrorMS")>-1){
  78. alert(strResult);
  79. return;
  80. }
  81. if (strFTaskID.indexOf("BroadcastMS")>-1){
  82. CLODOP.strBroadcastMS=strResult;
  83. if (CLODOP.On_Broadcast){
  84. var selfFunc=CLODOP.On_Broadcast;
  85. CLODOP.On_Broadcast(strResult);
  86. if (!CLODOP.On_Broadcast_Remain && selfFunc === CLODOP.On_Broadcast)
  87. CLODOP.On_Broadcast=null;
  88. }
  89. return;
  90. }
  91. if (CLODOP.On_Return) {
  92. var selfFunc=CLODOP.On_Return;
  93. if ((strResult.toLowerCase()=="true") || (strResult.toLowerCase()=="false"))
  94. CLODOP.On_Return(strFTaskID,strResult.toLowerCase()=="true"); else
  95. CLODOP.On_Return(strFTaskID,strResult);
  96. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  97. }
  98. }catch(err){};
  99. };
  100. this.webskt.onclose = function(e) {
  101. if (!CLODOP.SocketOpened) {CLODOP.SocketEnable=false;return;}
  102. setTimeout("CLODOP.OpenWebSocket()",2000);
  103. };
  104. this.webskt.onerror = function(e){};
  105. }
  106. }catch(err){
  107. this.webskt=null;
  108. if (err.message.indexOf("SecurityError")>-1)
  109. this.SocketEnable=false; else
  110. setTimeout("CLODOP.OpenWebSocket()",2000);
  111. }
  112. },
  113. wsSend:
  114. function(strData,blReTry) {
  115. if (!this.SocketEnable) return;
  116. if (this.webskt && this.webskt.readyState==1){
  117. this.Result=null;
  118. this.webskt.send(strData);
  119. return true;
  120. } else {
  121. if (!blReTry)
  122. setTimeout(function(){CLODOP.wsSend(strData,true);},600);
  123. else {
  124. alert(this.altMessageWebSocketInvalid);
  125. this.OpenWebSocket();
  126. }
  127. }
  128. },
  129. FORMAT:
  130. function(oType, oValue) {
  131. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  132. var tResult=null;
  133. if (oType!==undefined && oValue!==undefined) {
  134. if (oType.replace(/^\s+|\s+$/g,"").toLowerCase().indexOf("time:")==0) {
  135. oType=oType.replace(/^\s+|\s+$/g,"").slice(5);
  136. if (oValue.toLowerCase().indexOf("now")>-1) oValue=(new Date()).toString();
  137. if (oValue.toLowerCase().indexOf("date")>-1) oValue=(new Date()).toString();
  138. if (oValue.toLowerCase().indexOf("time")>-1) oValue=(new Date()).toString();
  139. var TypeYMD="ymd";
  140. if (oValue.toLowerCase().indexOf("ymd")>-1) {TypeYMD="ymd";oValue=oValue.slice(3);}
  141. if (oValue.toLowerCase().indexOf("dmy")>-1) {TypeYMD="dmy";oValue=oValue.slice(3);}
  142. if (oValue.toLowerCase().indexOf("mdy")>-1) {TypeYMD="mdy";oValue=oValue.slice(3);}
  143. oValue=oValue.replace(/ [^ ]*\+[^ ]* /g," ");
  144. oValue=oValue.replace(/\(.*\)/g," ");
  145. oValue=oValue.replace(/星期日|星期一|星期二|星期三|星期四|星期五|星期六/g," ");
  146. oValue=oValue.replace(/[A-Za-z]+day|Mon|Tue|Wed|Thu|Fri|Sat|Sun/g," ");
  147. var aMonth=0;
  148. var exp=new RegExp("Oct[A-Za-z]*|十月|10月","i"); if (oValue.match(exp)!==null) {aMonth=10;oValue=oValue.replace(exp,"");}
  149. exp=new RegExp("Nov[A-Za-z]*|十一月|11月","i"); if (oValue.match(exp)!==null) {aMonth=11;oValue=oValue.replace(exp,"");}
  150. exp=new RegExp("Dec[A-Za-z]*|十二月|12月","i"); if (oValue.match(exp)!==null) {aMonth=12;oValue=oValue.replace(exp,"");}
  151. exp=new RegExp("Jan[A-Za-z]*|一月|01月|1月","i"); if (oValue.match(exp)!==null) {aMonth=1;oValue=oValue.replace(exp,"");}
  152. exp=new RegExp("Feb[A-Za-z]*|二月|02月|2月","i"); if (oValue.match(exp)!==null) {aMonth=2;oValue=oValue.replace(exp,"");}
  153. exp=new RegExp("Mar[A-Za-z]*|三月|03月|3月","i"); if (oValue.match(exp)!==null) {aMonth=3;oValue=oValue.replace(exp,"");}
  154. exp=new RegExp("Apr[A-Za-z]*|四月|04月|4月","i"); if (oValue.match(exp)!==null) {aMonth=4;oValue=oValue.replace(exp,"");}
  155. exp=new RegExp("May[A-Za-z]*|五月|05月|5月","i"); if (oValue.match(exp)!==null) {aMonth=5;oValue=oValue.replace(exp,"");}
  156. exp=new RegExp("Jun[A-Za-z]*|六月|06月|6月","i"); if (oValue.match(exp)!==null) {aMonth=6;oValue=oValue.replace(exp,"");}
  157. exp=new RegExp("Jul[A-Za-z]*|七月|07月|7月","i"); if (oValue.match(exp)!==null) {aMonth=7;oValue=oValue.replace(exp,"");}
  158. exp=new RegExp("Aug[A-Za-z]*|八月|08月|8月","i"); if (oValue.match(exp)!==null) {aMonth=8;oValue=oValue.replace(exp,"");}
  159. exp=new RegExp("Sep[A-Za-z]*|九月|09月|9月","i"); if (oValue.match(exp)!==null) {aMonth=9;oValue=oValue.replace(exp,"");}
  160. oValue=oValue.replace(/日|秒/g," ");
  161. oValue=oValue.replace(/时|分/g,":");
  162. var subTime=oValue.match(/ \d+:\d+:\d+/);
  163. if (subTime==null) subTime="";
  164. oValue=oValue.replace(/ \d+:\d+:\d+/,"")+subTime;
  165. var dValue=new Date();
  166. var iYear=0;var iMonth=0;var iDate=0;var iHour=0;var iMinutes=0;var iSecond=0;
  167. var tmpValue=oValue; var sValue="";
  168. var MC1=0;MC2=0;MC3=0;
  169. sValue=tmpValue.match(/\d+/); if (sValue!==null) {MC1=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}
  170. sValue=tmpValue.match(/\d+/); if (sValue!==null) {MC2=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}
  171. if (aMonth<=0){sValue=tmpValue.match(/\d+/); if (sValue!==null) {MC3=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}}
  172. if (aMonth>0){iMonth=aMonth; if (MC2<=31){iYear=MC1;iDate=MC2;} else {iYear=MC2;iDate=MC1;}} else
  173. if (TypeYMD=="dmy"){iDate=MC1;iMonth=MC2;iYear=MC3;} else
  174. if (TypeYMD=="mdy"){iMonth=MC1;iDate=MC2;iYear=MC3;} else {
  175. iYear=MC1;iMonth=MC2;iDate=MC3;
  176. if(MC3>31){ iYear=MC3;iMonth=MC1;iDate=MC2;if(MC1>12){iDate=MC1;iMonth=MC2};} else
  177. {if(MC2>12){iYear=MC2;iMonth=MC1;}}
  178. }
  179. var sValue=tmpValue.match(/\d+/); if (sValue!==null) {iHour=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}
  180. var sValue=tmpValue.match(/\d+/); if (sValue!==null) {iMinutes=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}
  181. var sValue=tmpValue.match(/\d+/); if (sValue!==null) {iSecond=parseInt(sValue[0]);tmpValue=tmpValue.replace(/\d+/,"");}
  182. if (oType.toLowerCase()=="isvalidformat")
  183. oValue=(iYear>0 && iMonth>0 && iMonth<=12 && iDate>0 && iDate<=31); else {
  184. if ((""+iYear).length<4) iYear=iYear+2000;
  185. dValue.setFullYear(iYear,iMonth-1,iDate);
  186. dValue.setHours(iHour); dValue.setMinutes(iMinutes); dValue.setSeconds(iSecond);
  187. var iDay=dValue.getDay();
  188. if (oType.toLowerCase()=="weekindex")
  189. oValue=iDay; else
  190. if (oType.toLowerCase()=="floatvalue")
  191. oValue=dValue.getTime(); else {
  192. var sWeek="";
  193. switch(iDay){case 0:sWeek="日";break;case 1:sWeek="一";break;case 2:sWeek="二";break;case 3:sWeek="三";break;case 4:sWeek="四";break;case 5:sWeek="五";break;case 6:sWeek="六";break;}
  194. oValue=oType.replace(/dddd/ig,"星期"+sWeek);
  195. if(/(y+)/i.test(oValue)) oValue=oValue.replace(RegExp.$1,(iYear+"").substr(4-RegExp.$1.length));
  196. if(/(m+:)/i.test(oValue)) oValue=oValue.replace(RegExp.$1,("00"+iMinutes+":").substr(("00"+iMinutes+":").length-RegExp.$1.length));
  197. if(/(M+)/i.test(oValue)) {
  198. var dsWidth=(""+iMonth).length>RegExp.$1.length?(""+iMonth).length:RegExp.$1.length;
  199. oValue=oValue.replace(RegExp.$1,("00"+iMonth).substr(("00"+iMonth).length-dsWidth));
  200. }
  201. if(/(d+)/i.test(oValue)) {
  202. var dsWidth=(""+iDate).length>RegExp.$1.length?(""+iDate).length:RegExp.$1.length;
  203. oValue=oValue.replace(RegExp.$1,("00"+iDate).substr(("00"+iDate).length-dsWidth));
  204. }
  205. if(/(H+)/i.test(oValue)) oValue=oValue.replace(RegExp.$1,("00"+iHour).substr(("00"+iHour).length-RegExp.$1.length));
  206. if(/(n+)/i.test(oValue)) oValue=oValue.replace(RegExp.$1,("00"+iMinutes).substr(("00"+iMinutes).length-RegExp.$1.length));
  207. if(/(s+)/i.test(oValue)) oValue=oValue.replace(RegExp.$1,("00"+iSecond).substr(("00"+iSecond).length-RegExp.$1.length));
  208. }
  209. }
  210. if (CLODOP.On_Return){
  211. var selfFunc=CLODOP.On_Return;
  212. CLODOP.On_Return(0,oValue);
  213. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  214. }
  215. return oValue;
  216. } else
  217. if (this.blIslocal || oType.indexOf("FILE:")<0) {
  218. this.PageData["format_type"]=oType;
  219. this.PageData["format_value"]=oValue;
  220. if (this.DoPostDatas("format")==true) {
  221. this.GetLastResult(false);
  222. tResult=this.GetTaskID();
  223. }
  224. } else alert(this.altMessageNoReadWriteFile)
  225. }
  226. this.DoInit();
  227. this.blWorking=false;
  228. return tResult;
  229. },
  230. SET_PRINT_PAPER:
  231. function(Top,Left,Width,Height,strPrintTask) {
  232. return this.PRINT_INITA(Top,Left,Width,Height,strPrintTask);
  233. },
  234. PRINT_INIT:
  235. function(strPrintTask) {
  236. return this.PRINT_INITA(null,null,null,null,strPrintTask);
  237. },
  238. PRINT_INITA:
  239. function(Top,Left,Width,Height,strPrintTask) {
  240. if (Top===undefined || Top===null) Top="";
  241. if (Left===undefined || Left===null) Left="";
  242. if (Width===undefined || Width===null) Width="";
  243. if (Height===undefined || Height===null) Height="";
  244. if (strPrintTask===undefined || strPrintTask===null) strPrintTask="";
  245. this.NoClearAfterPrint=false;
  246. this.DoInit();
  247. this.PageData["top"]=Top;
  248. this.PageData["left"]=Left;
  249. this.PageData["width"]=Width;
  250. this.PageData["height"]=Height;
  251. this.PageData["printtask"]=strPrintTask;
  252. return true;
  253. },
  254. SET_PRINT_MODE:
  255. function(strModeType,ModeValue) {
  256. if (strModeType===undefined || strModeType===null) strModeType="";
  257. if (ModeValue===undefined || ModeValue===null) ModeValue="";
  258. if (strModeType==="") return false;
  259. strModeType=strModeType.toLowerCase();
  260. this.PageData[strModeType]=ModeValue;
  261. if (strModeType=="noclear_after_print") this.NoClearAfterPrint=ModeValue;
  262. if (strModeType.indexOf("window_def")>-1 || strModeType.indexOf("control_printer")>-1) {
  263. var tResult=null;
  264. if (this.DoPostDatas("onlysetprint")==true) {
  265. this.GetLastResult(false);
  266. tResult=this.GetTaskID();
  267. }
  268. this.DoInit();
  269. this.blWorking=false;
  270. return tResult;
  271. }
  272. },
  273. ADD_PRINT_TEXT:
  274. function(top,left,width,height,strText) {
  275. return this.AddItemArray(2,top,left,width,height,strText);
  276. },
  277. ADD_PRINT_TEXTA:
  278. function(itemName,top,left,width,height,strText) {
  279. return this.AddItemArray(2,top,left,width,height,strText,itemName);
  280. },
  281. ADD_PRINT_HTM:
  282. function(top,left,width,height,strHTML) {
  283. return this.AddItemArray(4,top,left,width,height,strHTML);
  284. },
  285. ADD_PRINT_HTML:
  286. function(top,left,width,height,strHTML) {
  287. return this.AddItemArray(1,top,left,width,height,strHTML);
  288. },
  289. ADD_PRINT_HTMLA:
  290. function(itemName,top,left,width,height,strHTML) {
  291. return this.AddItemArray(1,top,left,width,height,strHTML,itemName);
  292. },
  293. ADD_PRINT_BARCODE:
  294. function(top,left,width,height,BarType,BarValue) {
  295. return this.AddItemArray(9,top,left,width,height,BarValue,null,null,null,null,null,null,BarType);
  296. },
  297. ADD_PRINT_BARCODEA:
  298. function(ItemName,top,left,width,height,BarType,BarValue) {
  299. return this.AddItemArray(9,top,left,width,height,BarValue,ItemName,null,null,null,null,null,BarType);
  300. },
  301. ADD_PRINT_RECTA:
  302. function(top,left,width,height,intPenStyle,intPenWidth,intColor) {
  303. return this.AddItemArray(3,top,left,width,height,null,null,2,intPenStyle,intPenWidth,intColor,null);
  304. },
  305. ADD_PRINT_RECT:
  306. function(top,left,width,height,intPenStyle,intPenWidth) {
  307. return this.AddItemArray(3,top,left,width,height,null,null,2,intPenStyle,intPenWidth,null,null);
  308. },
  309. ADD_PRINT_ELLIPSEA:
  310. function(top,left,width,height,intPenStyle,intPenWidth,intColor) {
  311. return this.AddItemArray(3,top,left,width,height,null,null,3,intPenStyle,intPenWidth,intColor,null);
  312. },
  313. ADD_PRINT_ELLIPSE:
  314. function(top,left,width,height,intPenStyle,intPenWidth) {
  315. return this.AddItemArray(3,top,left,width,height,null,null,3,intPenStyle,intPenWidth,null,null);
  316. },
  317. ADD_PRINT_SHAPE:
  318. function(ShapeType,top,left,width,height,intPenStyle,intPenWidth,intColor) {
  319. return this.AddItemArray(3,top,left,width,height,null,null,ShapeType,intPenStyle,intPenWidth,intColor,null);
  320. },
  321. ADD_PRINT_LINE:
  322. function(top1,left1,top2,left2,intPenStyle,intPenWidth) {
  323. return this.AddItemArray(3,top1,left1,top2,left2,null,null,0,intPenStyle,intPenWidth,null,"1");
  324. },
  325. ADD_PRINT_DNLINE:
  326. function(Top,Left,Width,Height,intPenStyle,intPenWidth) {
  327. return this.AddItemArray(3,Top,Left,Width,Height,null,null,1,intPenStyle,intPenWidth,null,null);
  328. },
  329. ADD_PRINT_DNLINEA:
  330. function(Top,Left,Width,Height,intPenStyle,intPenWidth,intColor) {
  331. return this.AddItemArray(3,Top,Left,Width,Height,null,null,1,intPenStyle,intPenWidth,intColor,null);
  332. },
  333. ADD_PRINT_UPLINE:
  334. function(Top,Left,Width,Height,intPenStyle,intPenWidth) {
  335. return this.AddItemArray(3,Top,Left,Width,Height,null,null,0,intPenStyle,intPenWidth,null,null);
  336. },
  337. ADD_PRINT_UPLINEA:
  338. function(Top,Left,Width,Height,intPenStyle,intPenWidth,intColor) {
  339. return this.AddItemArray(3,Top,Left,Width,Height,null,null,0,intPenStyle,intPenWidth,intColor,null);
  340. },
  341. ADD_PRINT_TABLE:
  342. function(top,left,width,height,strHTML) {
  343. return this.AddItemArray(6,top,left,width,height,strHTML);
  344. },
  345. ADD_PRINT_TBURL:
  346. function(top,left,width,height,strURL) {
  347. return this.AddItemArray(7,top,left,width,height,strURL);
  348. },
  349. ADD_PRINT_URL:
  350. function(top,left,width,height,strURL) {
  351. return this.AddItemArray(5,top,left,width,height,strURL);
  352. },
  353. ADD_PRINT_IMAGE:
  354. function(top,left,width,height,strHTML) {
  355. return this.AddItemArray(8,top,left,width,height,strHTML);
  356. },
  357. ADD_PRINT_CHART:
  358. function(top,left,width,height,strChartTypess,strHTML) {
  359. return this.AddItemArray(10,top,left,width,height,strHTML,null,null,null,null,null,null,null,strChartTypess);
  360. },
  361. ADD_PRINT_PDF:
  362. function(top,left,width,height,strContent) {
  363. if (!this.blIslocal && strContent[1]==":")
  364. alert("Unable to print or view remote service files"); else
  365. return this.AddItemArray(11,top,left,width,height,strContent);
  366. },
  367. SET_PRINT_PROPERTY:
  368. function(ItemNO, intPageType, intHorzOrient, intVertOrient) {
  369. this.SET_PRINT_STYLEA(ItemNO,"ItemType",intPageType);
  370. this.SET_PRINT_STYLEA(ItemNO,"HOrient",intHorzOrient);
  371. this.SET_PRINT_STYLEA(ItemNO,"VOrient",intVertOrient);
  372. },
  373. SET_PRINT_PROPERTYA:
  374. function(ItemName, intPageType, intHorzOrient, intVertOrient) {
  375. this.SET_PRINT_PROPERTY(ItemName,intPageType,intHorzOrient,intVertOrient);
  376. },
  377. SET_PRINT_STYLE:
  378. function(strStyleName,StyleValue) {
  379. if (strStyleName===undefined || strStyleName===null) strStyleName="";
  380. if (StyleValue===undefined || StyleValue===null) StyleValue="";
  381. if (strStyleName==="") return false;
  382. strStyleName=strStyleName.toLowerCase();
  383. this.defStyleJson[strStyleName]=StyleValue;
  384. },
  385. SET_PRINT_STYLEA:
  386. function(ItemNo,strKey,Value) {
  387. if (ItemNo===undefined || ItemNo===null) ItemNo="";
  388. if (strKey===undefined || strKey===null) strKey="";
  389. if (Value===undefined || Value===null) Value="";
  390. if (ItemNo==="" || strKey==="") return false;
  391. if (this.ItemDatas["count"]<=0) {
  392. if (this.PageData["add_print_program_data"]!==undefined) {
  393. this.ItemCNameStyles[strKey.toLowerCase()+"-"+ItemNo]=Value;
  394. return true;
  395. } else {
  396. return false;
  397. }
  398. }
  399. strKey=strKey.toLowerCase();
  400. if (strKey=="type") return false;
  401. var blResult=false;
  402. if (ItemNo==0) {ItemNo=this.ItemDatas["count"];}
  403. for(var vItemNO in this.ItemDatas){
  404. var ItemName=this.ItemDatas[vItemNO]["itemname"];
  405. if ((ItemNo==vItemNO)||(ItemNo==ItemName)||((typeof ItemNo === "string")&&(typeof ItemName === "string")&&(ItemNo.toUpperCase()==ItemName.toUpperCase()))){
  406. this.ItemDatas[vItemNO][strKey]=Value;
  407. blResult=true;
  408. }
  409. }
  410. if (blResult) return true;
  411. return false;
  412. },
  413. SET_PRINT_TEXT_STYLE:
  414. function(ItemNO,strFontName,intSize,intBold,intItalic,intUnderline,intAlignment) {
  415. this.SET_PRINT_STYLEA(ItemNO,"fontname",strFontName);
  416. this.SET_PRINT_STYLEA(ItemNO,"fontsize",intSize);
  417. this.SET_PRINT_STYLEA(ItemNO,"bold",intBold);
  418. this.SET_PRINT_STYLEA(ItemNO,"italic",intItalic);
  419. this.SET_PRINT_STYLEA(ItemNO,"underline",intUnderline);
  420. this.SET_PRINT_STYLEA(ItemNO,"alignment",intAlignment);
  421. },
  422. SET_PRINT_TEXT_STYLEA:
  423. function(ItemNO,strFontName,intSize,intBold,intItalic,intUnderline,intAlignment,Color) {
  424. this.SET_PRINT_TEXT_STYLE(ItemNO,strFontName,intSize,intBold,intItalic,intUnderline,intAlignment);
  425. this.SET_PRINT_STYLEA(ItemNO,"fontcolor",Color);
  426. },
  427. SET_PRINT_TEXT_STYLEB:
  428. function(ItemNO,strFontName,intSize,intBold,intItalic,intUnderline,intAlignment,Color) {
  429. this.SET_PRINT_TEXT_STYLEA(ItemNO,strFontName,intSize,intBold,intItalic,intUnderline,intAlignment,Color);
  430. },
  431. NEWPAGE:
  432. function() {
  433. this.NewPage();
  434. },
  435. NewPage:
  436. function() {
  437. var blSomeNormal=false;
  438. var noItemType;
  439. for(var vItemNO in this.ItemDatas){
  440. if (vItemNO=="count") noItemType=false; else noItemType=true;
  441. for(var vItemxx in this.ItemDatas[vItemNO]){
  442. if (vItemxx=="itemtype") {
  443. noItemType=false;
  444. if ((this.ItemDatas[vItemNO][vItemxx]==0)||(this.ItemDatas[vItemNO][vItemxx]==4)){
  445. blSomeNormal=true;
  446. break;
  447. }
  448. }
  449. }
  450. if (noItemType) blSomeNormal=true;
  451. if (blSomeNormal) break;
  452. }
  453. if (blSomeNormal) this.defStyleJson["beginpage"]=this.defStyleJson["beginpage"]+1;
  454. },
  455. NEWPAGEA:
  456. function() {
  457. this.NewPageA();
  458. },
  459. NewPageA:
  460. function() {
  461. var blSomeNormal=false;
  462. var noItemType;
  463. for(var vItemNO in this.ItemDatas){
  464. if (vItemNO=="count") noItemType=false; else noItemType=true;
  465. for(var vItemxx in this.ItemDatas[vItemNO]){
  466. if (vItemxx=="itemtype") {
  467. noItemType=false;
  468. if ((this.ItemDatas[vItemNO][vItemxx]==0)||(this.ItemDatas[vItemNO][vItemxx]==4)){
  469. blSomeNormal=true;
  470. break;
  471. }
  472. }
  473. }
  474. if (noItemType) blSomeNormal=true;
  475. if (blSomeNormal) break;
  476. }
  477. if (blSomeNormal) this.defStyleJson["beginpagea"]=this.defStyleJson["beginpagea"]+1;
  478. },
  479. PREVIEW:
  480. function(destView,iWidth,iHigh,iOption) {
  481. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  482. var tResult=null;
  483. if ((!destView)&&(this.blIslocal)&&(!this.PageData["printersubid"])) {
  484. if (this.DoPostDatas("preview")==true) {
  485. this.Result=null;
  486. this.GetLastResult(true);
  487. tResult=this.GetTaskID();
  488. }
  489. } else {
  490. if (this.DoPostDatas("cpreview")==true) {
  491. this.DoCPreview(destView,iWidth,iHigh,iOption);
  492. tResult=this.GetTaskID();
  493. }
  494. }
  495. this.DoInit();
  496. this.blWorking=false;
  497. return tResult;
  498. },
  499. PRINT:
  500. function() {
  501. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  502. var tResult=null;
  503. if (this.DoPostDatas("print")==true)
  504. tResult=this.GetTaskID();
  505. this.DoInit();
  506. this.blWorking=false;
  507. return tResult;
  508. },
  509. GET_PRINTER_COUNT:
  510. function() {
  511. if (this.Printers===undefined) return 0; else {
  512. return this.Printers["list"].length;
  513. }
  514. },
  515. GET_PRINTER_NAME:
  516. function(intNO) {
  517. if (this.Printers===undefined) return ""; else {
  518. if (typeof intNO == "string" && intNO.indexOf(":")>-1){
  519. var strPPname=intNO.slice(intNO.indexOf(":")+1);
  520. intNO=intNO.slice(0,intNO.indexOf(":"));
  521. if (intNO==-1)
  522. return this.Printers["list"][this.Printers["default"]][strPPname]; else
  523. return this.Printers["list"][intNO][strPPname];
  524. } else {
  525. if (intNO==-1)
  526. return this.Printers["list"][this.Printers["default"]].name; else
  527. if (intNO>=0 && intNO<this.Printers["list"].length)
  528. return this.Printers["list"][intNO].name; else return "Printer NO. overflow";
  529. }
  530. }
  531. },
  532. GET_PAGESIZES_LIST:
  533. function(PNameIndx,Split,ListName,NameOrID) {
  534. if (!ListName) ListName="pagelist";
  535. if (!NameOrID) NameOrID="name";
  536. if (this.Printers===undefined) return ""; else {
  537. if (PNameIndx==-1) PNameIndx=this.Printers["list"][this.Printers["default"]].name;
  538. for (var intNO in this.Printers["list"]){
  539. if (PNameIndx==intNO||PNameIndx==this.Printers["list"][intNO].name) {
  540. var strList="";
  541. for (var iPNO in this.Printers["list"][intNO][ListName]){
  542. if ((NameOrID=="id") && this.Printers["list"][intNO][ListName][iPNO].id) {
  543. if (strList==="") strList=this.Printers["list"][intNO][ListName][iPNO].id; else
  544. strList=strList+Split+this.Printers["list"][intNO][ListName][iPNO].id;
  545. } else {
  546. if (strList==="") strList=this.Printers["list"][intNO][ListName][iPNO].name; else
  547. strList=strList+Split+this.Printers["list"][intNO][ListName][iPNO].name;
  548. }
  549. }
  550. return strList;
  551. }
  552. }
  553. return "";
  554. }
  555. },
  556. SET_PRINTER_INDEX:
  557. function(strName,strKeyModeName) {
  558. if (this.Printers===undefined) return false; else {
  559. if (!strKeyModeName) strKeyModeName="printerindex";
  560. strName=strName+"";
  561. strName=strName.replace(/^\s+|\s+$/g,"");
  562. var iPos=strName.indexOf(",");
  563. var strNameOrNO=strName;
  564. if (iPos>-1) strNameOrNO=strName.slice(0,iPos);
  565. if (strNameOrNO=="-1") {
  566. this.PageData[strKeyModeName]=this.Printers["default"];
  567. if (iPos>-1) this.PageData["printersubid"]=strName.slice(iPos+1);
  568. return true;
  569. } else {
  570. for(var vNO in this.Printers["list"]){
  571. var strPrinterName=this.Printers["list"][vNO].name;
  572. if (!strPrinterName) continue;
  573. if ((strPrinterName.replace(/\\/g,"")==strNameOrNO.replace(/\\/g,""))||(vNO==strNameOrNO)) {
  574. this.PageData[strKeyModeName]=strPrinterName;
  575. if (iPos>-1) this.PageData["printersubid"]=strName.slice(iPos+1);
  576. return true;
  577. }
  578. }
  579. return false;
  580. }
  581. }
  582. },
  583. SET_PRINTER_INDEXA:
  584. function(strName) {
  585. return this.SET_PRINTER_INDEX(strName,"printerindexa");
  586. },
  587. PRINT_DESIGN:
  588. function() {
  589. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  590. var tResult=null;
  591. if (this.blIslocal) {
  592. if (this.DoPostDatas("print_design")==true) {
  593. this.Result=null;
  594. this.GetLastResult(true);
  595. tResult=this.GetTaskID();
  596. }
  597. } else alert(this.altMessageNoPrintDesign);
  598. this.DoInit();
  599. this.blWorking=false;
  600. return tResult;
  601. },
  602. PRINT_SETUP:
  603. function() {
  604. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  605. var tResult=null;
  606. if (this.blIslocal) {
  607. if (this.DoPostDatas("print_setup")==true) {
  608. this.Result=null;
  609. this.GetLastResult(true);
  610. tResult=this.GetTaskID();
  611. }
  612. } else alert(this.altMessageNoPrintSetup);
  613. this.DoInit();
  614. this.blWorking=false;
  615. return tResult;
  616. },
  617. SET_PRINT_PAGESIZE:
  618. function(intOrient,PageWidth,PageHeight,strPageName) {
  619. if (intOrient !==undefined && intOrient!==null) this.PageData["orient"]=intOrient;
  620. if (PageWidth !==undefined && PageWidth!==null) this.PageData["pagewidth"]=PageWidth;
  621. if (PageHeight !==undefined && PageHeight!==null) this.PageData["pageheight"]=PageHeight;
  622. if (strPageName !==undefined && strPageName!==null) this.PageData["pagename"]=strPageName;
  623. },
  624. SET_PRINT_COPIES:
  625. function(intCopies) {
  626. if (intCopies !==undefined && intCopies!==null){
  627. this.PageData["printcopies"]=intCopies;
  628. return true;
  629. }
  630. },
  631. SELECT_PRINTER:
  632. function(blPrint) {
  633. this.SelectBox.create(388,240,!blPrint);
  634. return true;
  635. },
  636. PRINTA:
  637. function(blPrintB,sView) {
  638. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  639. var tResult=null;
  640. if (!sView && this.blIslocal) {
  641. this.Result=null;
  642. if (blPrintB) {
  643. if (this.DoPostDatas("printb")==true) {
  644. this.GetLastResult(false);
  645. tResult=this.GetTaskID();
  646. }
  647. } else {
  648. if (this.DoPostDatas("printa")==true) {
  649. this.GetLastResult(true);
  650. tResult=this.GetTaskID();
  651. }
  652. }
  653. this.DoInit();
  654. this.blWorking=false;
  655. } else {
  656. this.SELECT_PRINTER(true);
  657. }
  658. return tResult;
  659. },
  660. PRINTAOK:
  661. function(iPrintIndex,iPrintCopies,iStartNO,iEndNO,onlySelect) {
  662. this.SET_PRINTER_INDEX(iPrintIndex);
  663. this.SET_PRINT_COPIES(iPrintCopies);
  664. if (iStartNO !==undefined && iStartNO !==0) this.SET_PRINT_MODE("PRINT_START_PAGE",iStartNO);
  665. if (iEndNO !==undefined && iEndNO !==0) this.SET_PRINT_MODE("PRINT_END_PAGE",iEndNO);
  666. if (!onlySelect) this.PRINT(); else {
  667. this.blTmpSelectedIndex=iPrintIndex;
  668. if (CLODOP.On_Return) {
  669. var selfFunc=CLODOP.On_Return;
  670. CLODOP.On_Return(0,iPrintIndex);
  671. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  672. }
  673. }
  674. },
  675. SET_LICENSES:
  676. function(strCompanyName, strLicense, strLicenseA, strLicenseB) {
  677. if ((strCompanyName=='THIRD LICENSE') && (strLicense=="")) {
  678. if (strLicenseA && strLicenseA!=="") this.PageDataEx["licensec"]=strLicenseA;
  679. if (strLicenseB && strLicenseB!=="") this.PageDataEx["licensed"]=strLicenseB;
  680. } else if ((strCompanyName=='LICENSE TETCODE') && (strLicense=="") && (strLicenseB=="")) {
  681. if (strLicenseA && strLicenseA!=="") this.PageDataEx["Licensetetcode"]=strLicenseA;
  682. } else {
  683. if (strCompanyName && strCompanyName!=="") this.PageDataEx["companyname"]=strCompanyName;
  684. if (strLicense && strLicense!=="") this.PageDataEx["license"]=strLicense;
  685. if (strLicenseA && strLicenseA!=="") this.PageDataEx["licensea"]=strLicenseA;
  686. if (strLicenseB && strLicenseB!=="") this.PageDataEx["licenseb"]=strLicenseB;
  687. }
  688. },
  689. PRINTB:
  690. function() {
  691. return this.PRINTA(true);
  692. },
  693. PREVIEWA:
  694. function() {
  695. return this.PREVIEW();
  696. },
  697. PREVIEWB:
  698. function() {
  699. return this.PREVIEW();
  700. },
  701. ADD_PRINT_SETUP_BKIMG:
  702. function(strContent) {
  703. if (strContent !==undefined && strContent!==null){
  704. this.PageData["setup_bkimg"]=strContent;
  705. return true;
  706. }
  707. },
  708. SET_PREVIEW_WINDOW:
  709. function(intDispMode,intToolMode,blDirectPrint,oWidth,oHeight,strPButtonCaptoin) {
  710. if (intDispMode!==undefined && intDispMode!==null) this.PageData["pvw_dispmode"]=intDispMode;
  711. if (intToolMode!==undefined && intToolMode!==null) this.PageData["pvw_toolmode"]=intToolMode;
  712. if (blDirectPrint!==undefined && blDirectPrint!==null) this.PageData["pvw_directprint"]=blDirectPrint;
  713. if (oWidth!==undefined && oWidth!==null) this.PageData["pvw_width"]=oWidth;
  714. if (oHeight!==undefined && oHeight!==null) this.PageData["pvw_height"]=oHeight;
  715. if (strPButtonCaptoin!==undefined && strPButtonCaptoin!==null) this.PageData["pvw_puttoncaptoin"]=strPButtonCaptoin;
  716. },
  717. SET_PREVIEW_MODE:
  718. function(ModeValue) {
  719. if (ModeValue!==undefined) this.PageData["pvw_preview_mode"]=ModeValue;
  720. },
  721. SET_SHOW_MODE:
  722. function(strModeType,ModeValue) {
  723. if (strModeType===undefined || strModeType===null) strModeType="";
  724. if (ModeValue===undefined || ModeValue===null) ModeValue="";
  725. if (strModeType==="") return false;
  726. strModeType=strModeType.toLowerCase();
  727. this.PageData['shwmod_'+strModeType]=ModeValue;
  728. },
  729. SAVE_TO_FILE:
  730. function(strFileName) {
  731. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  732. var tResult=null;
  733. if (this.blIslocal) {
  734. if (strFileName) {
  735. this.PageData["stf_file_name"]=strFileName;
  736. if (this.DoPostDatas("savetofile")==true) {
  737. this.GetLastResult(false);
  738. tResult=this.GetTaskID();
  739. }
  740. }
  741. } else alert(this.altMessageNoWriteFile);
  742. this.DoInit();
  743. this.blWorking=false;
  744. return tResult;
  745. },
  746. SET_SAVE_MODE:
  747. function(strModeType,ModeValue) {
  748. if (strModeType===undefined || strModeType===null) strModeType="";
  749. if (ModeValue===undefined || ModeValue===null) ModeValue="";
  750. if (strModeType==="") return false;
  751. strModeType=strModeType.toLowerCase();
  752. this.PageData['stfmod_'+strModeType]=ModeValue;
  753. },
  754. SEND_PRINT_RAWDATA:
  755. function(strRawData) {
  756. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  757. var tResult=null;
  758. if (strRawData!==undefined) {
  759. this.PageData["raw_print_data"]=strRawData;
  760. if (this.DoPostDatas("sendrawdata")==true) {
  761. this.GetLastResult(false);
  762. tResult=this.GetTaskID();
  763. }
  764. }
  765. this.DoInit();
  766. this.blWorking=false;
  767. return tResult;
  768. },
  769. WRITE_FILE_TEXT:
  770. function(WriteMode,strFileName,strText) {
  771. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  772. var tResult=null;
  773. if (this.blIslocal) {
  774. if (strFileName!==undefined && strText!==undefined) {
  775. this.PageData["write_file_mode"]=WriteMode;
  776. this.PageData["write_file_name"]=strFileName;
  777. this.PageData["write_file_text"]=strText;
  778. if (this.DoPostDatas("writefiletext")==true) {
  779. this.GetLastResult(false);
  780. tResult=this.GetTaskID();
  781. }
  782. }
  783. } else alert(this.altMessageNoWriteFile);
  784. this.DoInit();
  785. this.blWorking=false;
  786. return tResult;
  787. },
  788. GET_DIALOG_VALUE:
  789. function(oType, oPreValue) {
  790. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  791. var tResult=null;
  792. if (oType!==undefined && oPreValue!==undefined) {
  793. if (this.blIslocal) {
  794. this.PageData["dialog_type"]=oType;
  795. this.PageData["dialog_value"]=oPreValue;
  796. if (this.DoPostDatas("dialog")==true) {
  797. this.GetLastResult(true);
  798. tResult=this.GetTaskID();
  799. }
  800. } else alert(this.altMessageNoReadWriteFile);
  801. }
  802. this.DoInit();
  803. this.blWorking=false;
  804. return tResult;
  805. },
  806. WRITE_PORT_DATA:
  807. function(strPortName,strData) {
  808. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  809. var tResult=null;
  810. if (strPortName!==undefined && strData!==undefined) {
  811. this.PageData["write_port_name"]=strPortName;
  812. this.PageData["write_port_data"]=strData;
  813. if (this.DoPostDatas("writeportdata")==true) {
  814. this.GetLastResult(false);
  815. tResult=this.GetTaskID();
  816. }
  817. }
  818. this.DoInit();
  819. this.blWorking=false;
  820. return tResult;
  821. },
  822. READ_PORT_DATA:
  823. function(strPortName) {
  824. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  825. var tResult=null;
  826. if (strPortName!==undefined) {
  827. this.PageData["read_port_name"]=strPortName;
  828. if (this.DoPostDatas("readportdata")==true) {
  829. this.GetLastResult(false);
  830. tResult=this.GetTaskID();
  831. }
  832. }
  833. this.DoInit();
  834. this.blWorking=false;
  835. return tResult;
  836. },
  837. GET_SYSTEM_INFO:
  838. function(InfoType) {
  839. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  840. var tResult=null;
  841. if (InfoType!==undefined) {
  842. this.PageData["system_info_type"]=InfoType;
  843. if (this.DoPostDatas("getsysteminfo")==true) {
  844. this.GetLastResult(false);
  845. tResult=this.GetTaskID();
  846. }
  847. }
  848. this.DoInit();
  849. this.blWorking=false;
  850. return tResult;
  851. },
  852. GET_FILE_TEXT:
  853. function(strFileName) {
  854. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  855. var tResult=null;
  856. if (this.blIslocal) {
  857. if (strFileName!==undefined) {
  858. this.PageData["get_file_name"]=strFileName;
  859. if (this.DoPostDatas("getfiletext")==true) {
  860. this.GetLastResult(false);
  861. tResult=this.GetTaskID();
  862. }
  863. }
  864. } else alert(this.altMessageNoReadFile);
  865. this.DoInit();
  866. this.blWorking=false;
  867. return tResult;
  868. },
  869. IS_FILE_EXIST:
  870. function(strFileName) {
  871. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  872. var tResult=null;
  873. if (this.blIslocal) {
  874. if (strFileName!==undefined) {
  875. this.PageData["file_exist_name"]=strFileName;
  876. if (this.DoPostDatas("isfileexist")==true) {
  877. this.GetLastResult(false);
  878. tResult=this.GetTaskID();
  879. }
  880. }
  881. } else alert(this.altMessageNoReadFile);
  882. this.DoInit();
  883. this.blWorking=false;
  884. return tResult;
  885. },
  886. GET_FILE_TIME:
  887. function(strFileName) {
  888. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  889. var tResult=null;
  890. if (this.blIslocal) {
  891. if (strFileName!==undefined) {
  892. this.PageData["file_time_name"]=strFileName;
  893. if (this.DoPostDatas("getfiletime")==true) {
  894. this.GetLastResult(false);
  895. tResult=this.GetTaskID();
  896. }
  897. }
  898. } else alert(this.altMessageNoReadFile);
  899. this.DoInit();
  900. this.blWorking=false;
  901. return tResult;
  902. },
  903. GET_PRINT_INIFFNAME:
  904. function(strPrintTaskName) {
  905. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  906. var tResult=null;
  907. if (this.blIslocal) {
  908. if (strPrintTaskName!==undefined) {
  909. this.PageData["iniff_task_name"]=strPrintTaskName;
  910. if (this.DoPostDatas("getiniffname")==true) {
  911. this.GetLastResult(false);
  912. tResult=this.GetTaskID();
  913. }
  914. }
  915. } else alert(this.altMessageNoReadFile);
  916. this.DoInit();
  917. this.blWorking=false;
  918. return tResult;
  919. },
  920. GET_VALUE:
  921. function(ValueType, ValueIndex) {
  922. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  923. var tResult=null;
  924. if (ValueType!==undefined && ValueIndex !==undefined) {
  925. this.PageData["get_value_type"]=ValueType;
  926. this.PageData["get_value_index"]=ValueIndex;
  927. if (this.DoPostDatas("dogetvalue")==true) {
  928. this.GetLastResult(false);
  929. tResult=this.GetTaskID();
  930. }
  931. }
  932. this.DoInit();
  933. this.blWorking=false;
  934. return tResult;
  935. },
  936. ADD_PRINT_DATA:
  937. function(DataType,oValue) {
  938. if (DataType !==undefined && oValue!==null){
  939. if (DataType.toLowerCase().indexOf("programdata")>-1) {
  940. this.PageData["add_print_program_data"]=oValue;
  941. return true;
  942. }
  943. }
  944. },
  945. SHOW_CHART:
  946. function() {
  947. },
  948. DO_ACTION:
  949. function(strActName,strActValue) {
  950. if (this.blWorking) {alert(this.altMessageBusy);return null;}
  951. var tResult=null;
  952. if (strActName!==undefined && strActValue!==undefined) {
  953. this.PageData["do_action_name"]=strActName;
  954. this.PageData["do_action_value"]=strActValue;
  955. if (this.DoPostDatas("doaction")==true) {
  956. this.GetLastResult(false);
  957. tResult=this.GetTaskID();
  958. }
  959. }
  960. this.DoInit();
  961. this.blWorking=false;
  962. return tResult;
  963. },
  964. Create_Printer_List:
  965. function(oElement,blNoDetailForAO){
  966. while(oElement.childNodes.length>0){
  967. var children = oElement.childNodes;
  968. for(var i=0;i<children.length;i++)
  969. oElement.removeChild(children[i]);
  970. };
  971. var iCount=this.GET_PRINTER_COUNT();
  972. var iIndex=0;
  973. for(var i=0;i<iCount;i++){
  974. var option=document.createElement('option');
  975. option.innerHTML=this.GET_PRINTER_NAME(i);
  976. option.value=iIndex;
  977. oElement.appendChild(option); iIndex++;
  978. if (this.VERSION_EXT){
  979. if (this.Printers["list"][i]["subdevlist"].length>0){
  980. if (blNoDetailForAO) option.innerHTML=option.innerHTML+',..'; else {
  981. var strDrivename=option.innerHTML;
  982. for(var j=0;j<this.Printers["list"][i]["subdevlist"].length;j++){
  983. var strDevID=this.Printers["list"][i]["subdevlist"][j].id;
  984. var strDevName=this.Printers["list"][i]["subdevlist"][j].name;
  985. if (j==0) {
  986. option.innerHTML=strDrivename+','+strDevName;
  987. option.value=strDrivename+','+strDevID+';'+strDevName;
  988. } else {
  989. option=document.createElement('option');
  990. option.innerHTML=strDrivename+','+strDevName;
  991. option.value=strDrivename+','+strDevID+';'+strDevName;
  992. oElement.appendChild(option);iIndex++;
  993. if (iIndex>=100) return;
  994. }
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. },
  1001. Create_PageSize_List:
  1002. function (oElement,printIndex){
  1003. while(oElement.childNodes.length>0){
  1004. var children = oElement.childNodes;
  1005. for(var i=0;i<children.length;i++)
  1006. oElement.removeChild(children[i]);
  1007. };
  1008. var strPageSizeList=CLODOP.GET_PAGESIZES_LIST(printIndex,"\n");
  1009. var Options=new Array();
  1010. Options=strPageSizeList.split("\n");
  1011. for (var i in Options){
  1012. var option=document.createElement('option');
  1013. option.innerHTML=Options[i];
  1014. option.value=Options[i];
  1015. oElement.appendChild(option);
  1016. }
  1017. },
  1018. SET_BRIDGE_INDEX:
  1019. function(strValue) {
  1020. if (this.Printers===undefined) return false; else {
  1021. strValue=(strValue+"").replace(/^\s+|\s+$/g,"");
  1022. for(var vNO in this.Printers["list"]){
  1023. var strDriverOrName=this.Printers["list"][vNO].name;
  1024. if (strDriverOrName=="(AO)Client-Bridge Driver") {
  1025. this.PageData["printerindex"]=vNO;
  1026. this.PageData["printersubid"]=strValue;
  1027. return true;
  1028. }
  1029. }
  1030. return false;
  1031. }
  1032. },
  1033. Get_AOPrinters_List:
  1034. function (DriverNameOrIndex,strListName,strSplit){
  1035. if (!strSplit) strSplit="\n";
  1036. if (!strListName) strListName="name";
  1037. return CLODOP.GET_PAGESIZES_LIST(DriverNameOrIndex,strSplit,"subdevlist",strListName);
  1038. },
  1039. Get_AOBridges_List:
  1040. function (DriverNameOrIndex,strListName,strSplit){
  1041. return CLODOP.Get_AOPrinters_List(DriverNameOrIndex,strListName,strSplit);
  1042. },
  1043. Get_AOBridge_List:
  1044. function (strListName,strSplit){
  1045. return CLODOP.Get_AOPrinters_List("(AO)Client-Bridge Driver",strListName,strSplit);
  1046. },
  1047. Get_AOBridge_SubPrinters_List:
  1048. function (BridgeNameOrIndex,strListName,strSplit,DriverNameOrIndex){
  1049. if (!DriverNameOrIndex) DriverNameOrIndex="(AO)Client-Bridge Driver";
  1050. if (!strSplit) strSplit="\n";
  1051. if (!strListName) strListName="name";
  1052. for (var iDrvNO in this.Printers["list"]){
  1053. if (DriverNameOrIndex==iDrvNO||DriverNameOrIndex==this.Printers["list"][iDrvNO].name) {
  1054. for (var iBdgNO in this.Printers["list"][iDrvNO]["subdevlist"]){
  1055. var BridgeID=this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].id;
  1056. var BridgeName=this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].name;
  1057. if (BridgeNameOrIndex==iBdgNO||BridgeNameOrIndex==BridgeID+";"+BridgeName) {
  1058. var strList="";
  1059. for (var iSsbPNO in this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"]){
  1060. if (iSsbPNO!="0") strList=strList+strSplit;
  1061. if (strListName.toLowerCase()=="id") strList=strList+iSsbPNO; else
  1062. strList=strList+this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"][iSsbPNO].name;
  1063. }
  1064. return strList;
  1065. }
  1066. }
  1067. }
  1068. }
  1069. return "";
  1070. },
  1071. Get_AOBridge_SubPrinters_PageSize_List:
  1072. function (BridgeNameOrIndex,SubPrinterNameOrIndex,strSplit,DriverNameOrIndex){
  1073. if (!DriverNameOrIndex) DriverNameOrIndex="(AO)Client-Bridge Driver";
  1074. if (!strSplit) strSplit="\n";
  1075. for (var iDrvNO in this.Printers["list"]){
  1076. if (DriverNameOrIndex==iDrvNO||DriverNameOrIndex==this.Printers["list"][iDrvNO].name) {
  1077. for (var iBdgNO in this.Printers["list"][iDrvNO]["subdevlist"]){
  1078. var BridgeID=this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].id;
  1079. var BridgeName=this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].name;
  1080. if (BridgeNameOrIndex==iBdgNO||BridgeNameOrIndex==BridgeID+";"+BridgeName) {
  1081. for (var iSsbPNO in this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"]){
  1082. if (SubPrinterNameOrIndex==iSsbPNO||SubPrinterNameOrIndex==this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"][iSsbPNO].name) {
  1083. var strList="";
  1084. for (var iPageSizeNO in this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"][iSsbPNO]["pagelist"]){
  1085. if (iPageSizeNO!="0") strList=strList+strSplit;
  1086. strList=strList+this.Printers["list"][iDrvNO]["subdevlist"][iBdgNO].ssbprinter["list"][iSsbPNO]["pagelist"][iPageSizeNO].name;
  1087. }
  1088. return strList;
  1089. };
  1090. }
  1091. }
  1092. }
  1093. }
  1094. }
  1095. return "";
  1096. },
  1097. AddItemArray:
  1098. function(type,top,left,width,height,strContent,itemname,ShapeType,intPenStyle,intPenWidth,intColor,isLinePosition,BarType,strChartTypess) {
  1099. if (top===undefined||left===undefined||width===undefined||height===undefined||strContent===undefined){
  1100. return false;
  1101. }
  1102. var sCount=this.ItemDatas["count"];
  1103. sCount++;
  1104. var oneItem={};
  1105. for(var vstyle in this.defStyleJson){
  1106. oneItem[vstyle]=this.defStyleJson[vstyle];
  1107. }
  1108. oneItem["type"]=type;
  1109. oneItem["top"]=top;
  1110. oneItem["left"]=left;
  1111. oneItem["width"]=width;
  1112. oneItem["height"]=height;
  1113. if (strContent!=null) {
  1114. if (typeof strContent === "string" && strContent.indexOf(this.DelimChar)>-1)
  1115. oneItem["content"]=strContent.replace(new RegExp(this.DelimChar,'g'),''); else
  1116. oneItem["content"]=strContent;
  1117. }
  1118. if ((itemname!==undefined)&&(itemname!=null)) oneItem["itemname"]=itemname+"";
  1119. if ((ShapeType!==undefined)&&(ShapeType!=null)) oneItem["shapetype"]=ShapeType;
  1120. if ((intPenStyle!==undefined)&&(intPenStyle!=null)) oneItem["penstyle"]=intPenStyle;
  1121. if ((intPenWidth!==undefined)&&(intPenWidth!=null)) oneItem["penwidth"]=intPenWidth;
  1122. if ((intColor!==undefined)&&(intColor!=null)) oneItem["fontcolor"]=intColor;
  1123. if ((isLinePosition!==undefined)&&(isLinePosition!=null)) oneItem["lineposition"]="1";
  1124. if ((BarType!==undefined)&&(BarType!=null)) oneItem["fontname"]=BarType;
  1125. if ((strChartTypess!==undefined)&&(strChartTypess!=null)) oneItem["charttypess"]=strChartTypess;
  1126. oneItem["beginpage"]=this.defStyleJson["beginpage"];
  1127. oneItem["beginpagea"]=this.defStyleJson["beginpagea"];
  1128. this.ItemDatas["count"]=sCount;
  1129. this.ItemDatas[sCount]=oneItem;
  1130. this.blNormalItemAdded=true;
  1131. return true;
  1132. },
  1133. RemoveIframes:
  1134. function() {
  1135. var obody=document.body || document.getElementsByTagName("body")[0] || document.documentElement;
  1136. try{
  1137. for (var i=0;i<this.Iframes.length;i++) {
  1138. var now=(new Date()).getTime();
  1139. if ((now-this.Iframes[i]["time"])>this.timeThreshold*60000) {
  1140. obody.removeChild(this.Iframes[i]["iframe"]);
  1141. this.Iframes.splice(i,1);
  1142. }
  1143. }
  1144. }catch(err){};
  1145. },
  1146. AddInputElement:
  1147. function(odocument,oform,name,value) {
  1148. if (value!==undefined){
  1149. var oinput= odocument.createElement("input");
  1150. oinput.name=name;oinput.type="hidden";oinput.value=value;
  1151. oform.appendChild(oinput);
  1152. }
  1153. },
  1154. createPostDataString:
  1155. function(afterPostAction) {
  1156. var strData="act="+afterPostAction+this.DelimChar;
  1157. strData=strData+"browseurl="+window.location.href+this.DelimChar;
  1158. for(var vMode in this.PageDataEx){
  1159. strData=strData+vMode+"="+this.PageDataEx[vMode]+this.DelimChar;
  1160. }
  1161. var PrintModeNamess="";
  1162. for(var vMode in this.PageData){
  1163. strData=strData+vMode+"="+this.PageData[vMode]+this.DelimChar;
  1164. if (vMode!="top" && vMode!="left" && vMode!="width" && vMode!="height" && vMode!="printtask" && vMode!="printerindex" && vMode!="printerindexa" && vMode!="printersubid" && vMode!="orient" && vMode!="pagewidth" && vMode!="pageheight" && vMode!="pagename" && vMode!="printcopies" && vMode!="setup_bkimg")
  1165. PrintModeNamess=PrintModeNamess+";"+vMode;
  1166. }
  1167. if (PrintModeNamess !=="")
  1168. strData=strData+"printmodenames="+PrintModeNamess+this.DelimChar;
  1169. var StyleClassNamess="";
  1170. for(var vClassStyle in this.ItemCNameStyles){
  1171. strData=strData+vClassStyle+"="+this.ItemCNameStyles[vClassStyle]+this.DelimChar;
  1172. StyleClassNamess=StyleClassNamess+";"+vClassStyle;
  1173. }
  1174. if (StyleClassNamess !=="")
  1175. strData=strData+"printstyleclassnames="+StyleClassNamess+this.DelimChar;
  1176. strData=strData+"itemcount="+this.ItemDatas["count"]+this.DelimChar;
  1177. for(var vItemNO in this.ItemDatas){
  1178. var ItemStyless="";
  1179. for(var vItemxx in this.ItemDatas[vItemNO]){
  1180. if (vItemxx!="beginpage" && vItemxx!="beginpagea" && vItemxx!="type" && vItemxx!="top" && vItemxx!="left" && vItemxx!="width" && vItemxx!="height")
  1181. ItemStyless=ItemStyless+";"+vItemxx;
  1182. }
  1183. strData=strData+vItemNO+"_itemstylenames"+"="+ItemStyless+this.DelimChar;
  1184. for(var vItemxx in this.ItemDatas[vItemNO]){
  1185. strData=strData+vItemNO+"_"+vItemxx+"="+this.ItemDatas[vItemNO][vItemxx]+this.DelimChar;
  1186. }
  1187. }
  1188. return strData;
  1189. },
  1190. wsDoPostDatas:
  1191. function(afterPostAction) {
  1192. var strData="charset=丂"+this.DelimChar;
  1193. strData=strData+"tid="+this.GetTaskID()+this.DelimChar;
  1194. strData=strData+this.createPostDataString(afterPostAction);
  1195. return this.wsSend("post:"+strData);
  1196. },
  1197. DoPostDatas:
  1198. function(afterPostAction) {
  1199. if (this.OBO_Mode && this.blOneByone){
  1200. alert(this.altMessageSomeWindowExist);
  1201. return false;
  1202. }
  1203. this.blWorking=true;
  1204. if (this.blTmpSelectedIndex !== null)
  1205. this.SET_PRINTER_INDEX(this.blTmpSelectedIndex);
  1206. if (this.SocketEnable){
  1207. return this.wsDoPostDatas(afterPostAction);
  1208. }
  1209. this.RemoveIframes();
  1210. var obody=document.body || document.getElementsByTagName("body")[0] || document.documentElement;
  1211. var oiframe=document.createElement("iframe");
  1212. oiframe.setAttribute("src","about:blank");
  1213. oiframe.setAttribute("style","display:none");
  1214. oiframe.height=0;
  1215. obody.appendChild(oiframe);
  1216. var contentdocument=oiframe.contentWindow.document;
  1217. contentdocument.write("<form action='"+this.strHostURI+"/c_dopostdatas' method='post' enctype='application/x-www-form-urlencoded'></form>");
  1218. var oform=contentdocument.getElementsByTagName("form")[0];
  1219. this.AddInputElement(contentdocument,oform,"charset","丂");
  1220. this.AddInputElement(contentdocument,oform,"tid",this.GetTaskID());
  1221. this.AddInputElement(contentdocument,oform,"post",this.createPostDataString(afterPostAction));
  1222. oform.submit();
  1223. var IframeMS={};
  1224. IframeMS["time"]=(new Date()).getTime();
  1225. IframeMS["iframe"]=oiframe;
  1226. this.Iframes.push(IframeMS);
  1227. return true;
  1228. },
  1229. GetLastResult:
  1230. function(blFOneByone){
  1231. if (blFOneByone) this.blOneByone=true;
  1232. if (this.SocketEnable){
  1233. return true;
  1234. }
  1235. var url = this.strHostURI+"/c_lastresult.js";
  1236. url = url + "?times=" + (new Date().getTime());
  1237. url = url + "&tid=" + this.GetTaskID();
  1238. url = encodeURI(url).replace("%20","+");
  1239. var oscript = document.createElement("script");
  1240. oscript.src = url;
  1241. oscript.async = false;
  1242. oscript.type = "text/javascript";
  1243. oscript.charset="utf-8";
  1244. var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
  1245. head.insertBefore(oscript,head.firstChild );
  1246. oscript.onload =oscript.onreadystatechange= function() {
  1247. if (!oscript.readyState|| /loaded|complete/.test(oscript.readyState)){
  1248. CLODOP.blOneByone=false;
  1249. if (CLodop_ACTLastResult)
  1250. var strResult=decodeURIComponent(CLodop_ACTLastResult);
  1251. var strResultTaskID=CLodop_ACTTaskID;
  1252. CLODOP.Result=strResult;
  1253. if (CLodop_ACTAlert) CLodop_ACTAlert();
  1254. if (CLODOP.On_Return)
  1255. try {
  1256. var selfFunc=CLODOP.On_Return;
  1257. if (strResult =="true" || strResult =="false")
  1258. CLODOP.On_Return(strResultTaskID,strResult=="true"); else
  1259. CLODOP.On_Return(strResultTaskID,strResult);
  1260. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  1261. }catch(err){};
  1262. oscript.onload = oscript.onreadystatechange = null;
  1263. if ( oscript.parentNode ) {
  1264. oscript.parentNode.removeChild( oscript );
  1265. }
  1266. }
  1267. };
  1268. return true;
  1269. },
  1270. DoCPreview:
  1271. function(destView,iWidth,iHigh,iOption) {
  1272. var obody=document.body || document.getElementsByTagName("body")[0] || document.documentElement;
  1273. if (typeof iWidth !== "number" || !iWidth) iWidth=Math.round(obody.offsetWidth*2/3); else
  1274. if (obody.offsetWidth<iWidth) iWidth=obody.offsetWidth;
  1275. if (typeof iHigh !== "number" || !iHigh) iHigh=Math.round(window.screen.height-200); else
  1276. if (window.screen.height<iHigh) iHigh=window.screen.height;
  1277. var url = this.strHostURI+"/c_dopreview";
  1278. url = url + "?times=" + (new Date().getTime());
  1279. url = url + "&tid=" + this.GetTaskID();
  1280. url = url + "&iw=" + iWidth;
  1281. url = url + "&ih=" + iHigh;
  1282. if (iOption) url = url + "&opid=" + iOption;
  1283. url = encodeURI(url).replace("%20","+");
  1284. this.PopView(destView,url,iWidth,iHigh);
  1285. },
  1286. PopView:
  1287. function(destView,strPURL,iWidth,iHigh) {
  1288. try{
  1289. if (destView && typeof destView === "string" && destView.length>0){
  1290. if (destView === "_dialog" ) {
  1291. if (window.showModalDialog)
  1292. {window.showModalDialog(strPURL,'dialog','center:yes');}else
  1293. {window.open(strPURL,"", "scrollbars=yes,toolbar=no,left=150,top=100,resizable=yes");}
  1294. } else
  1295. if (destView === "_self" || destView === "_top" || destView === "_parent") {
  1296. window.location.href=strPURL;
  1297. } else
  1298. if (destView === "_blank" ) {
  1299. this.PreviewBox.create(strPURL,iWidth,iHigh);
  1300. } else
  1301. if (destView.indexOf("_winopen:")>-1) {
  1302. var strFeatures=destView.slice(destView.indexOf("_winopen:")+9);
  1303. if (strFeatures.indexOf("_blank")>-1)
  1304. window.open(strPURL,"_blank",strFeatures.slice(strFeatures.indexOf("_blank")+6)); else
  1305. window.open(strPURL,"",strFeatures);
  1306. } else
  1307. if (document.getElementById(destView)) {
  1308. document.getElementById(destView).src=strPURL;
  1309. } else
  1310. alert("iframe '"+destView+"' not exist!");
  1311. } else this.PreviewBox.create(strPURL,iWidth,iHigh);
  1312. }catch(err){ alert("CLODOP PopView "+err); };
  1313. },
  1314. creatMyButtonElement:
  1315. function(strType,strValue) {
  1316. try {
  1317. var oElement=document.createElement("<input type='"+strType+"' value='"+strValue+"'></input>");
  1318. } catch(e){};
  1319. if (!oElement){
  1320. oElement=document.createElement("input");
  1321. oElement.type=strType;
  1322. oElement.value=strValue;
  1323. }
  1324. return oElement;
  1325. },
  1326. creatLabelElement:
  1327. function(Type,Value,Width,Left,Top) {
  1328. var TxtLabel=document.createElement(Type);
  1329. TxtLabel.innerHTML=Value;
  1330. TxtLabel.style.cssText="position:absolute;width:"+Width+"px;left:"+Left+"px;top:"+Top+"px;";
  1331. return TxtLabel;
  1332. },
  1333. SelectBox:{
  1334. dragapproved:false,
  1335. offsetx:0,offsety:0,tempx:0,tempy:0,FrantDiv:undefined,PopDiv:undefined,selPrinter:undefined,selCopies:undefined,
  1336. closeit:function(){
  1337. if (CLODOP.SelectBox.PopDiv && CLODOP.SelectBox.PopDiv.parentNode)
  1338. CLODOP.SelectBox.PopDiv.parentNode.removeChild(CLODOP.SelectBox.PopDiv);
  1339. if (this.FrantDiv&&this.FrantDiv.parentNode)
  1340. this.FrantDiv.parentNode.removeChild(this.FrantDiv);
  1341. this.PopDiv=undefined;
  1342. },
  1343. initializedrag:function(e){
  1344. var we=window.event || e;
  1345. this.offsetx=we.clientX;
  1346. this.offsety=we.clientY;
  1347. this.tempx=parseInt(this.PopDiv.style.left);
  1348. this.tempy=parseInt(this.PopDiv.style.top);
  1349. this.dragapproved=true;
  1350. },
  1351. drag_drop:function(e){
  1352. if (!this.dragapproved) return;
  1353. var we=window.event || e;
  1354. this.PopDiv.style.left=we.clientX-this.offsetx+this.tempx+"px";
  1355. this.PopDiv.style.top=we.clientY-this.offsety+this.tempy+"px";
  1356. },
  1357. stopdrag:function(){
  1358. this.dragapproved=false;
  1359. },
  1360. clickOK:function(onlySelect){
  1361. CLODOP.PRINTAOK(CLODOP.SelectBox.selPrinter.value,CLODOP.SelectBox.selCopies.value,0,0,onlySelect);
  1362. this.closeit();
  1363. },
  1364. create:function(iW,iH,onlySelect){
  1365. if (CLODOP.SelectBox.PopDiv) this.closeit();
  1366. var obody=document.body || document.getElementsByTagName("body")[0] || document.documentElement;
  1367. var Boxdiv=document.createElement("div");
  1368. obody.appendChild(Boxdiv);
  1369. Boxdiv.style.cssText="position:absolute;z-index:91100;display:block;top:2px;border:1px solid #6B97C1;background:#F5F5F5;color:#000;font-size:13px;";
  1370. Boxdiv.style.width=iW+"px";
  1371. Boxdiv.style.left=Math.max((obody.offsetWidth-iW)/2,0)+"px";
  1372. Boxdiv.style.top=Math.max((obody.offsetHeight-iH)/2,0)+"px";
  1373. Boxdiv.style.height=iH+"px";
  1374. this.PopDiv=Boxdiv;
  1375. var titleDiv=document.createElement("div");
  1376. Boxdiv.appendChild(titleDiv);
  1377. titleDiv.style.cssText="font: bold 13px Arial;line-height:25px;height:27px;text-indent:5px;color: white;background:#8BACCF";
  1378. titleDiv.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;打印";
  1379. titleDiv.onmousedown=function(event){CLODOP.SelectBox.initializedrag(event);};
  1380. titleDiv.onmousemove=function(event){CLODOP.SelectBox.drag_drop(event);};
  1381. titleDiv.onmouseup=function(){CLODOP.SelectBox.stopdrag();};
  1382. var icoButton=document.createElement("button");
  1383. titleDiv.appendChild(icoButton);
  1384. icoButton.style.cssText="background:transparent url("+CLODOP.strHostURI+"/c_favicon.ico) no-repeat scroll 0 0px;margin-left:5px;position:absolute;height:20px;line-height:100px;width:34px;left:3px;border:0;top:5px";
  1385. var CloseButton=document.createElement("button");
  1386. titleDiv.appendChild(CloseButton);
  1387. CloseButton.style.cssText="background:transparent url("+CLODOP.strHostURI+"/images/c_winclose.png) no-repeat scroll 0 0px;margin-right:5px;position:absolute;height:20px;line-height:100px;width:34px;right:3px;border:0;top:4px";
  1388. CloseButton.onclick=function(){
  1389. CLODOP.SelectBox.closeit();
  1390. if (onlySelect && CLODOP.On_Return){
  1391. var selfFunc=CLODOP.On_Return;
  1392. CLODOP.On_Return(0,-1);
  1393. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  1394. }
  1395. };
  1396. var areaDiv=document.createElement("div");
  1397. Boxdiv.appendChild(areaDiv);
  1398. areaDiv.style.cssText="background:#F5F5F5;color:#000;border:0px;left:0px;top:0px;";
  1399. areaDiv.style.width=iW-2+"px";
  1400. areaDiv.style.height=(iH-27)+"px";
  1401. var OKButton=CLODOP.creatMyButtonElement("button","确定");
  1402. Boxdiv.appendChild(OKButton);
  1403. OKButton.style.cssText="position:absolute;width:80px;height:23px;";
  1404. OKButton.style.left="110px"; OKButton.style.top=(iH-64)+"px";
  1405. OKButton.onclick=function(){CLODOP.SelectBox.clickOK(onlySelect);};
  1406. var CancelButton=CLODOP.creatMyButtonElement("button","取消");
  1407. Boxdiv.appendChild(CancelButton);
  1408. CancelButton.style.cssText="position:absolute;width:80px;;height:23px;";
  1409. CancelButton.style.left="240px"; CancelButton.style.top=(iH-64)+"px";
  1410. CancelButton.onclick=function(){
  1411. CLODOP.SelectBox.closeit();
  1412. if (onlySelect && CLODOP.On_Return){
  1413. var selfFunc=CLODOP.On_Return;
  1414. CLODOP.On_Return(0,-1);
  1415. if (!CLODOP.On_Return_Remain && selfFunc === CLODOP.On_Return) CLODOP.On_Return=null;
  1416. }
  1417. };
  1418. areaDiv.appendChild(CLODOP.creatLabelElement("span","选打印机:",200,46,67));
  1419. var oSelect=document.createElement("select");
  1420. Boxdiv.appendChild(oSelect);
  1421. this.selPrinter=oSelect;
  1422. oSelect.style.cssText="position:absolute;size:1;width:212px;left:110px;top:62px;";
  1423. CLODOP.Create_Printer_List(oSelect);
  1424. areaDiv.appendChild(CLODOP.creatLabelElement("span","打印份数:",200,46,121));
  1425. var oCopies=CLODOP.creatMyButtonElement("text","1");
  1426. Boxdiv.appendChild(oCopies);
  1427. this.selCopies=oCopies;
  1428. oCopies.style.cssText="position:absolute;size:1;width:30px;left:110px;top:117px;";
  1429. this.FrantDiv=document.createElement("div");
  1430. obody.appendChild(this.FrantDiv);
  1431. this.FrantDiv.style.cssText="border:0px;left:0px;top:0px;filter: alpha(opacity=20); position: fixed; opacity: 0.2;-moz-opacity: 0.2; _position: absolute;z-index:91009; over-flow: hidden;";
  1432. if (CLODOP.Browser.IE && (document.compatMode == "BackCompat" || navigator.userAgent.indexOf("MSIE 6.0")>0)){
  1433. this.FrantDiv.style.width=obody.scrollWidth+"px";
  1434. this.FrantDiv.style.height=obody.scrollHeight+"px";
  1435. }else{
  1436. this.FrantDiv.style.width="100%";
  1437. this.FrantDiv.style.height="100%";
  1438. }
  1439. }
  1440. },
  1441. PreviewBox: {
  1442. dragapproved:false,
  1443. offsetx:0,offsety:0,tempx:0,tempy:0,FrantDiv:undefined,PopDiv:undefined,ContentFrame:undefined,
  1444. closeit:function(oSelf){
  1445. if (CLODOP.PreviewBox.PopDiv && CLODOP.PreviewBox.PopDiv.parentNode)
  1446. CLODOP.PreviewBox.PopDiv.parentNode.removeChild(CLODOP.PreviewBox.PopDiv);
  1447. if (this.FrantDiv&&this.FrantDiv.parentNode)
  1448. this.FrantDiv.parentNode.removeChild(this.FrantDiv);
  1449. this.PopDiv=undefined;
  1450. },
  1451. initializedrag:function(e,oSelf){
  1452. var we=window.event || e;
  1453. this.offsetx=we.clientX;
  1454. this.offsety=we.clientY;
  1455. this.tempx=parseInt(oSelf.style.left);
  1456. this.tempy=parseInt(oSelf.style.top);
  1457. this.dragapproved=true;
  1458. },
  1459. drag_drop:function(e,oSelf){
  1460. if (!this.dragapproved) return;
  1461. var we=window.event || e;
  1462. oSelf.style.left=we.clientX-this.offsetx+this.tempx+"px";
  1463. oSelf.style.top=we.clientY-this.offsety+this.tempy+"px";
  1464. },
  1465. stopdrag:function(){
  1466. this.dragapproved=false;
  1467. if (this.ContentFrame) this.ContentFrame.style.display="block";
  1468. },
  1469. create:function(strURL,iW,iH){
  1470. if (CLODOP.PreviewBox.PopDiv) this.closeit();
  1471. var obody=document.body || document.getElementsByTagName("body")[0] || document.documentElement;
  1472. var vBoxDiv=document.createElement("div");
  1473. obody.appendChild(vBoxDiv);
  1474. vBoxDiv.style.cssText="position:absolute;z-index:91100;display:block;top:2px;border:1px solid #6B97C1;font-size:13px;";
  1475. vBoxDiv.style.width=iW+"px";
  1476. var iLeft=(obody.offsetWidth-iW)/2;
  1477. if (window.screen.width<obody.offsetWidth) iLeft=(window.screen.width-iW)/2;
  1478. if (iLeft<0) iLeft=0;
  1479. vBoxDiv.style.left=iLeft+"px";
  1480. vBoxDiv.style.height=iH+"px";
  1481. vBoxDiv.onmousedown=function(event){CLODOP.PreviewBox.initializedrag(event,this);};
  1482. vBoxDiv.onmouseup=function(){CLODOP.PreviewBox.stopdrag();};
  1483. vBoxDiv.onmousemove=function(event){CLODOP.PreviewBox.drag_drop(event,this);};
  1484. this.PopDiv=vBoxDiv;
  1485. var titleDiv=document.createElement("div");
  1486. vBoxDiv.appendChild(titleDiv);
  1487. titleDiv.style.cssText="position:absolute;left:0px;width:100%;font: bold 14px Arial;line-height:27px;height:27px;text-indent:26px;color: white;background:#8BACCF";
  1488. titleDiv.innerHTML="打印预览";
  1489. var icoButton=document.createElement("button");
  1490. titleDiv.appendChild(icoButton);
  1491. icoButton.style.cssText="background:transparent url("+CLODOP.strHostURI+"/c_favicon.ico) no-repeat scroll 0 0px;margin-left:5px;position:absolute;height:20px;line-height:100px;width:34px;left:3px;border:0;top:5px";
  1492. var CloseButton=document.createElement("button");
  1493. titleDiv.appendChild(CloseButton);
  1494. CloseButton.style.cssText="background:transparent url("+CLODOP.strHostURI+"/images/c_winclose.png) no-repeat scroll 0 0px;margin-right:5px;position:absolute;height:20px;line-height:100px;width:34px;right:3px;border:0;top:4px";
  1495. CloseButton.onclick=function(){CLODOP.PreviewBox.closeit(this);};
  1496. var areaDiv=document.createElement("div");
  1497. vBoxDiv.appendChild(areaDiv);
  1498. areaDiv.style.cssText="background:#F5F5F5;color:#000;border:0px;left:0px;top:0px;";
  1499. areaDiv.style.width=iW+"px";
  1500. areaDiv.style.height=(iH-0)+"px";
  1501. this.ContentFrame=document.createElement("iframe");
  1502. areaDiv.appendChild(this.ContentFrame);
  1503. this.ContentFrame.style.cssText="width:100%;height:100%;";
  1504. this.ContentFrame.src=strURL;
  1505. this.ContentFrame.frameBorder="no";
  1506. this.FrantDiv=document.createElement("div");
  1507. obody.appendChild(this.FrantDiv);
  1508. this.FrantDiv.style.cssText="border:0px;left:0px;top:0px;filter: alpha(opacity=20); position: fixed; opacity: 0.2; -moz-opacity: 0.2; _position: absolute;z-index:91009; over-flow: hidden;";
  1509. if (CLODOP.Browser.IE && (document.compatMode == "BackCompat" || navigator.userAgent.indexOf("MSIE 6.0")>0)){
  1510. this.FrantDiv.style.width=obody.scrollWidth+"px";
  1511. this.FrantDiv.style.height=obody.scrollHeight+"px";
  1512. }else{
  1513. this.FrantDiv.style.width="100%";
  1514. this.FrantDiv.style.height="100%";
  1515. }
  1516. }
  1517. }
  1518. };
  1519. if (win.CLODOP2015_7028 && win.CLODOP2015_7028.Priority && win.CLODOP2015_7028.Priority>CLODOP.Priority) {
  1520. CLODOP=win.CLODOP2015_7028;
  1521. win.CLODOP_OK_Priority=win.CLODOP2015_7028.Priority;
  1522. return;
  1523. }
  1524. win.LODOP=CLODOP;
  1525. win.CLODOP=CLODOP;
  1526. win.CLODOP2015_7028=CLODOP;
  1527. win.CLODOP_OK_Priority=CLODOP.Priority;
  1528. win.CLODOP.DoInit();
  1529. if (navigator.userAgent.indexOf("Lodop")<0) win.CLODOP.OpenWebSocket();
  1530. win.getCLodop=function(){return window.CLODOP2015_7028;};
  1531. })(window);
  1532. function getCLodop(){
  1533. return window.CLODOP2015_7028;
  1534. }