123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
-
-
-
-
-
-
-
-
-
- function get_cui_html(file) {
- clog("get_cui_html",this,arguments)
- // console.trace("~IX~ ixr")
- clog("~IX~ ixr")
- // for (var file of this.arr){
- var aii
- aii= $.ajax({
- // url: "ign/cui.html",
- url: file.url,
- // data: file.qs,
- cache:false,
- // complete:complete_html,
- success: file.success || proc_cui_html,
- // error: err_html,
- // dataType: "text"
- dataType: "html"
- })
- aii.file = file
- // aii.rldh=file
- // }
- }
-
-
-
- function cui_respH(){
- clog("cui_respH")
- }
-
- function cui_diffH(file){
- clog("cui_diffH",this,arguments)
- // get_cui_html(file)
- }
-
-
-
-
-
-
- function proc_cui_html(rsp,status,xhr){
- clog("proc_cui_html",this,arguments)
- /*
- gxh.success = {
- that:this,
- rsp,status,xhr,
- args:arguments,
- }
- */
- // insert_cui_html(rsp)
- // rsp
- }
- function insert_cui_html(innerHTML){
- window.cui_html = innerHTML
- t5i2.crnr_init()
- // t5i2.crnr_refresh()
-
- // var n
- // n = document.createElement("div")
- // n = document.querySelector("#xh_root")
- // n ? n.innerHTML = innerHTML : 0
- // event_html(n)
- }
-
-
- function dflt_api_handler(){
- clog("dflt_api_handler NOT IMPLIMENTED")
- }
-
- function add_rld_html(){
- // js files
- // html
- // css
-
-
-
-
- rldi.files["ign/m/timer/rhtml.html"]= {url: "ign/m/timer/rhtml.html",
- qs: {v:1}, respH: cui_respH, diffH: cui_diffH,
- cached:"z z",
- success:proc_cui_html,
- }
-
-
-
- }
-
-
-
-
-
-
- // jsrh
- // cssrh
- api_dflts = {
- dflt:reqt,
- js:{
- diffH:jsrh,
- // diffH:jsrh,
- qs:{v:1},
- },
- css:{
- diffH:cssrh,
- qs:{v:1},
-
- },
- html:{
-
- diffH:html_rld_cb,
- qs:{v:1},
- },
- }
-
-
- api_test = {}
-
- // <script class="rld" src="ign/m/m_api.js?c=023"></script>
- function insert_js(file){
- var n = document.createElement("SCRIPT")
- n.classList.add("rld")
- n.src=file.url + "?_="+new Date().getTime()
- // n.rel="stylesheet"
- $(`script.rld[src^="`+file.url+`"]`).remove()
- $(".m0.module").after(n)
- }
- function insert_css(file){
- var url = file.url
- var n = document.createElement("LINK")
- n.classList.add("rld")
- n.href=file.url + "?_="+new Date().getTime()
- n.rel="stylesheet"
- $(`link.rld[href^="`+file.url+`"]`).remove()
- $(".m0.module").after(n)
- }
- function html_rld_cb(){
- clog("html_rld_cb!")
-
- }
-
-
- function html_rld_cb2(){
- clog("html_rld_cb2!",this,[...arguments])
-
- }
- function html_rld_cb3(){
- clog("html_rld_cb3!",this,[...arguments])
- }
- function html_rld_cb4(rsp,status,xhr){
- clog("html_rld_cb4!",this,[...arguments])
- // window[this.success_js](rsp,status,xhr)
- window[xhr.file.success_js](rsp,status,xhr)
- }
-
-
- function register_rld(file){
- clog("RR",file)
- file.cached = rls[file.url]
- rldi.files[file.url] = file
-
- }
-
-
- window.qto_stop = 0
- window.qto_cnt = 0
- function qto_init(){
- window.qto_stop = 0
- window.qto_cnt = 0
- // setTimeout(qto_stop_fn,1000)
- setTimeout(qto_stop_fn,100)
- qto()
-
- }
- function qto_stop_fn(){
- clog("qto_stop_fn")
- window.qto_stop =1
- }
- function qto(){
- clog("QTO",window.qto_cnt)
- // clog("QTO",window.qto_cnt,$(`script.rld[src^="ign/m/timer/m.js"]`))
- window.qto_cnt += 1
- if (!window.qto_stop){
- setTimeout(qto,1)
- }
-
- }
-
-
-
- // $(`script.rld[src^="ign/m/timer/m.js"]`).remove()
- // ign/m/timer/m.js
-
-
-
-
- // mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:["ign/m/timer/m.html"]}
- // mtx ={js:["ign/m/timer/m.js"],css:["ign/m/timer/m.css"],html:[{url:"ign/m/timer/m.html",diffH:html_rld_cb2,success:html_rld_cb4,}]}
- mtx ={
- // js:["ign/m/timer/m.js","ign/m/timer/m0.js"],
- js:["ign/m/timer/m0.js","ign/m/timer/m.js",],
- css:["ign/m/timer/m.css"],
- html:[{url:"ign/m/timer/m.html",diffH:get_cui_html,success:html_rld_cb4,success_js:"html_js_handler"}]
- }
-
- function add_module(o){
- var k,v
- let file
- // qto_init()
- // file = jclone(api_dflts.css)
- for (k of o.css || []){
- if (typeof(k) == "string"){
- file = $.extend(true,{},api_dflts.css, {url:k})
- } else {
- file = $.extend(true,{},api_dflts.css, k)
- }
- // file = jclone(api_dflts.css)
- // file.url = k
-
- register_rld(file)
- insert_css(file)
-
- api_test[file.url]=file
- clog("~",k)
- }
- for (k of o.js || []){
- if (typeof(k) == "string"){
- file = $.extend(true,{},api_dflts.js, {url:k})
- } else {
- file = $.extend(true,{},api_dflts.js, k)
- }
- // file = jclone(api_dflts.js)
- // file.url = k
-
- register_rld(file)
- insert_js(file)
-
- api_test[file.url]=file
- clog("~",k)
- }
- for (k of o.html || []){
- if (typeof(k) == "string"){
- file = $.extend(true,{},api_dflts.html, {url:k})
- } else {
- file = $.extend(true,{},api_dflts.html, k)
- }
- // file = jclone(api_dflts.html)
- // file.url = k
- register_rld(file)
- api_test[file.url]=file
- clog("~",k)
- rfile = file
- get_cui_html(file)
- }
- /*
- // clog()
- var css_url = "ign/m/timer/m.css"
- var css_file = {
- url:css_url,
- diffH:cssrh,
- qs:{v:1},
- }
- rldi.files[css_file.url] = css_file
- // var n = document.createElement("LINK")
- // n.classList.add("rld")
- // n.href=css_url + "?_="+new Date().getTime()
- // n.rel="stylesheet"
- // $(".m0.module").after(n)
-
- // n.class="rld"
-
- // return n
-
- */
- // <link class="rld" rel="stylesheet" href="ign/r0.css?c=023">
- // rldi.files[css_file.url] = css_file
- // insert_css()
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- // get_cui_html(rfile)
-
-
-
-
-
-
-
- setTimeout(add_module,300,mtx)
-
-
- // add_module(mtx )
|