mp_objInp.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  6. <title>录入</title>
  7. <script src="/js/mp_base/base.js"></script>
  8. <style>
  9. body {
  10. margin: 0;
  11. background: #f5f5f5;
  12. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  13. }
  14. #app {
  15. min-height: 100vh;
  16. background: #f5f5f5;
  17. overflow: hidden;
  18. }
  19. .content {
  20. width: 100%;
  21. height: 100vh;
  22. min-height: 0;
  23. }
  24. .form-frame {
  25. width: 100%;
  26. height: 100%;
  27. border: 0;
  28. display: block;
  29. background: #fff;
  30. }
  31. .placeholder {
  32. padding: 28px 16px;
  33. color: #666;
  34. font-size: 14px;
  35. text-align: center;
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <div id="app">
  41. <div class="content" id="contentWrap">
  42. <iframe
  43. v-if="iframeSrc"
  44. id="objInpFrame"
  45. class="form-frame"
  46. :src="iframeSrc"
  47. @load="handleFrameLoad"
  48. ></iframe>
  49. <div v-else class="placeholder" id="placeholder">{{ placeholderText }}</div>
  50. </div>
  51. <ss-bottom
  52. v-if="showBottom"
  53. :buttons="bottomButtons"
  54. @button-click="handleBottomAction"
  55. >
  56. </ss-bottom>
  57. <!-- 功能说明:inp 保存并提交后使用统一样式二次确认弹窗,不再使用浏览器原生 confirm by xu 2026-03-01 -->
  58. <ss-confirm
  59. v-model="showSubmitConfirm"
  60. title="提示"
  61. @confirm="handleConfirmSubmit"
  62. >
  63. <div style="text-align:center;padding:16px 0;font-size: 16px;">是否提交?</div>
  64. </ss-confirm>
  65. </div>
  66. <script>
  67. // 功能说明:公共录入壳页(先调业务接口+dataTag,再按 include_input 装载 mp_ 表单页) by xu 2026-02-28
  68. (function () {
  69. const boot = function () {
  70. const setStatus = (text) => {
  71. if (state.vm) {
  72. state.vm.placeholderText = text;
  73. return;
  74. }
  75. const placeholder = document.getElementById('placeholder');
  76. if (placeholder) placeholder.textContent = text;
  77. };
  78. const state = {
  79. pageParams: {},
  80. service: '',
  81. initPayload: {},
  82. dataTagPayload: {},
  83. ssObjName: '',
  84. ssObjId: '',
  85. iframe: null,
  86. submitEnabled: false,
  87. vm: null,
  88. pendingFinalSubmit: null,
  89. finalSubmitting: false,
  90. };
  91. // 功能说明:执行 inp 二次确认后的最终提交(${ssObjName}_lr_tj_qr) by xu 2026-03-01
  92. const submitFinalConfirm = async () => {
  93. if (state.finalSubmitting) return;
  94. const pending = state.pendingFinalSubmit;
  95. if (!pending || typeof pending !== 'object') {
  96. if (typeof showToastEffect === 'function') showToastEffect('提交参数缺失', 1800, 'error');
  97. return;
  98. }
  99. const req = ensureRequest();
  100. state.finalSubmitting = true;
  101. try {
  102. const response = await req.post(
  103. `/service?ssServ=${encodeURIComponent(pending.serviceName)}`,
  104. pending.payload,
  105. { loading: true, formData: true }
  106. );
  107. assertServiceSuccess(response && response.data !== undefined
  108. ? response.data
  109. : response);
  110. state.pendingFinalSubmit = null;
  111. if (typeof showToastEffect === 'function') showToastEffect('提交成功', 1400, 'success');
  112. setTimeout(() => goBack(true), 600);
  113. } catch (error) {
  114. console.error('[mp_objInp] 二次确认提交失败', error);
  115. if (typeof showToastEffect === 'function') showToastEffect(
  116. error && error.message
  117. ? error.message
  118. : '提交失败,请稍后重试',
  119. 2200,
  120. 'error'
  121. );
  122. } finally {
  123. state.finalSubmitting = false;
  124. }
  125. };
  126. const getUrlParams = () => {
  127. const params = {};
  128. const search = new URLSearchParams(window.location.search || '');
  129. for (const [key, value] of search.entries()) {
  130. params[key] = decodeURIComponent(value || '');
  131. }
  132. return params;
  133. };
  134. const unwrapData = (data) => {
  135. if (!data || typeof data !== 'object') return {};
  136. if (data.ssData && typeof data.ssData === 'object') return data.ssData;
  137. return data;
  138. };
  139. const assertServiceSuccess = (data) => {
  140. const payload = data && typeof data === 'object' ? data : {};
  141. if (payload.ssCode !== undefined && Number(payload.ssCode) !== 0) {
  142. throw new Error(payload.ssMsg || payload.msg || '提交失败');
  143. }
  144. return payload;
  145. };
  146. const parseJsonString = (text) => {
  147. if (!text || typeof text !== 'string') return {};
  148. try {
  149. const obj = JSON.parse(text);
  150. return obj && typeof obj === 'object' ? obj : {};
  151. } catch (_) {
  152. return {};
  153. }
  154. };
  155. const pruneParams = (obj) => {
  156. const out = {};
  157. Object.entries(obj || {}).forEach(([key, value]) => {
  158. if (value === undefined || value === null || value === '') return;
  159. out[key] = value;
  160. });
  161. return out;
  162. };
  163. // 功能说明:新增场景 id=0 统一按空处理,和你要求保持一致 by xu 2026-02-28
  164. const resolveObjIdFromInit = (payload, ssObjName, urlParams) => {
  165. const fromUrl = String(urlParams.ssObjId || '').trim();
  166. if (fromUrl) return fromUrl;
  167. if (!payload || typeof payload !== 'object') return '';
  168. const objName = String(ssObjName || '').trim();
  169. if (!objName) return '';
  170. const objData = payload[objName];
  171. if (!objData || typeof objData !== 'object') return '';
  172. const idField = String(payload.ssObjIdName || objData.idName || '').trim();
  173. if (!idField) return '';
  174. const rawId = objData[idField];
  175. if (rawId === undefined || rawId === null || rawId === '' || Number(rawId) === 0) return '';
  176. return String(rawId);
  177. };
  178. // 功能说明:/page/xyqj_inp.jsp -> /page/mp_xyqj_inp.html by xu 2026-02-28
  179. const includeToMpFormPath = (includeInput) => {
  180. const raw = String(includeInput || '').trim();
  181. if (!raw) return '';
  182. const noPrefix = raw.replace(/^\/page\//i, '');
  183. const base = noPrefix.replace(/\.ss\.jsp$/i, '').replace(/\.jsp$/i, '');
  184. if (!base) return '';
  185. return `/page/mp_${base}.html`;
  186. };
  187. // 功能说明:变动页签里的 objInp 可能拿不到 include_input,此时按对象名兜底到 mp_xxx_inp.html by xu 2026-03-06
  188. const resolveFallbackFormPath = () => {
  189. const objName = String(state.ssObjName || state.pageParams.ssObjName || '').trim();
  190. if (objName) {
  191. return `/page/mp_${objName}_inp.html`;
  192. }
  193. const serviceName = String(state.service || state.pageParams.service || state.pageParams.ssServ || '').trim();
  194. const match = serviceName.match(/^([a-zA-Z0-9_]+?)_/);
  195. if (match && match[1]) {
  196. return `/page/mp_${match[1]}_inp.html`;
  197. }
  198. return '';
  199. };
  200. const goBack = (refreshParent) => {
  201. if (window.NavigationManager && typeof window.NavigationManager.goBack === 'function') {
  202. window.NavigationManager.goBack({ refreshParent: !!refreshParent });
  203. } else {
  204. window.history.back();
  205. }
  206. };
  207. const ensureRequest = () => {
  208. if (!window.request || typeof window.request.post !== 'function') {
  209. throw new Error('request 未就绪');
  210. }
  211. return window.request;
  212. };
  213. // 功能说明:内容区高度按 100vh 减去 ss-bottom 实际高度计算 by xu 2026-02-28
  214. const updateContentHeight = () => {
  215. const contentWrap = document.getElementById('contentWrap');
  216. if (!contentWrap) return;
  217. const bottom = document.querySelector('#app .ss-bottom');
  218. const bottomHeight = bottom ? bottom.offsetHeight : 0;
  219. contentWrap.style.height = `calc(100vh - ${bottomHeight}px)`;
  220. };
  221. // 功能说明:学校违纪录入使用其他移动端入口一致的默认底部按钮和文案
  222. const isSchoolViolationEntry = (serviceName = '', objName = '') => {
  223. const service = String(serviceName || state.service || getUrlParams().service || '').trim();
  224. const objectName = String(objName || state.ssObjName || '').trim();
  225. return objectName === 'xxwjjl' || service.startsWith('xxwjjl_');
  226. };
  227. const makeCloseBottomButton = (serviceName = '', objName = '') => ({
  228. text: isSchoolViolationEntry(serviceName, objName) ? '取消' : '关闭',
  229. action: 'close'
  230. });
  231. const makeSubmitBottomButton = (text, serviceName = '', objName = '') => {
  232. const button = {
  233. text: text || '保存并提交',
  234. action: 'saveSubmit'
  235. };
  236. if (!isSchoolViolationEntry(serviceName, objName)) {
  237. button.backgroundColor = '#575d6d';
  238. button.color = '#fff';
  239. }
  240. return button;
  241. };
  242. const updateBottomButtons = (submitTitle) => {
  243. if (!state.vm) return;
  244. state.vm.bottomButtons = [
  245. makeCloseBottomButton(state.service, state.ssObjName),
  246. makeSubmitBottomButton(submitTitle, state.service, state.ssObjName)
  247. ];
  248. setTimeout(updateContentHeight, 0);
  249. };
  250. // 功能说明:供 iframe 子页调用,控制父页底部按钮显隐(解决日期弹层被底部按钮遮挡) by xu 2026-02-28
  251. const setBottomVisible = (visible) => {
  252. if (!state.vm) return;
  253. state.vm.showBottom = visible !== false;
  254. setTimeout(updateContentHeight, 0);
  255. };
  256. const getFrameFormData = async () => {
  257. const frame = document.getElementById('objInpFrame');
  258. const frameWindow = frame ? frame.contentWindow : null;
  259. if (!frameWindow) return { valid: false, message: '表单页面未加载完成', data: {} };
  260. // 功能说明:优先走子页面暴露方法,尽量减少表单页工作量 by xu 2026-02-28
  261. if (typeof frameWindow.__mpObjInpGetFormData === 'function') {
  262. // 功能说明:支持子页异步取值(如提交前补查关联字段),确保提交参数完整 by xu 2026-03-01
  263. const result = await Promise.resolve(frameWindow.__mpObjInpGetFormData());
  264. if (result && typeof result === 'object') {
  265. return {
  266. valid: result.valid !== false,
  267. message: result.message || '',
  268. data: result.data && typeof result.data === 'object' ? result.data : {},
  269. };
  270. }
  271. }
  272. const doc = frameWindow.document;
  273. const data = {};
  274. const nodes = doc.querySelectorAll('input[name],select[name],textarea[name]');
  275. nodes.forEach((node) => {
  276. const name = node.getAttribute('name');
  277. if (!name || node.disabled) return;
  278. const type = (node.getAttribute('type') || '').toLowerCase();
  279. if ((type === 'checkbox' || type === 'radio') && !node.checked) return;
  280. data[name] = node.value;
  281. });
  282. return { valid: true, message: '', data };
  283. };
  284. const getSubmitConfig = () => {
  285. const p = state.initPayload || {};
  286. const saveServiceName = String(p.saveAndCommit || '').trim();
  287. const saveDest = String(p.saveAndCommitDest || '').trim();
  288. const routeServiceName = String(state.service || state.pageParams.service || state.pageParams.ssServ || '').trim();
  289. const routeDest = String(state.pageParams.dest || state.pageParams.ssDest || '').trim();
  290. const routeParamObj = parseJsonString(state.pageParams.param);
  291. const routeDataType = String(state.pageParams.dataType || routeParamObj.dataType || '').trim().toLowerCase();
  292. // 功能说明:变动页签若第一接口没回 saveAndCommitDest,则回退用当前 service+objInp+param 提交 by xu 2026-03-06
  293. const canUseRouteSubmit = routeDataType === 'change' && routeDest.toLowerCase() === 'objinp' && !!routeServiceName;
  294. const serviceName = saveServiceName || (canUseRouteSubmit ? routeServiceName : '');
  295. const dest = saveDest || (canUseRouteSubmit ? routeDest : '');
  296. const enabled = !!(serviceName && dest);
  297. return {
  298. enabled,
  299. serviceName,
  300. dest,
  301. title: String(p.saveAndCommitButtonValue || '保存并提交'),
  302. paramObj: pruneParams({
  303. ...(canUseRouteSubmit ? {
  304. ...routeParamObj,
  305. sqid: state.pageParams.sqid,
  306. shid: state.pageParams.shid,
  307. shyjm: state.pageParams.shyjm,
  308. bdlbm: state.pageParams.bdlbm,
  309. dataType: state.pageParams.dataType,
  310. } : {}),
  311. ...parseJsonString(p.saveAndCommitParam),
  312. }),
  313. };
  314. };
  315. const renderFormFrame = () => {
  316. const includeInput = (state.dataTagPayload && state.dataTagPayload.include_input) || '';
  317. const fallbackFormPath = resolveFallbackFormPath();
  318. const formPath = includeToMpFormPath(includeInput) || fallbackFormPath;
  319. console.log('[mp_objInp][renderFormFrame] include_input =', includeInput);
  320. console.log('[mp_objInp][renderFormFrame] fallbackFormPath =', fallbackFormPath);
  321. console.log('[mp_objInp][renderFormFrame] formPath =', formPath);
  322. if (!formPath) {
  323. if (state.vm) {
  324. state.vm.iframeSrc = '';
  325. state.vm.placeholderText = '未获取到 include_input,且未命中对象表单页';
  326. }
  327. state.submitEnabled = false;
  328. console.warn('[mp_objInp][renderFormFrame] formPath为空,终止渲染iframe');
  329. return;
  330. }
  331. const childParams = new URLSearchParams();
  332. Object.entries(state.pageParams || {}).forEach(([key, value]) => {
  333. if (value === undefined || value === null || value === '') return;
  334. childParams.set(key, value);
  335. });
  336. childParams.set('embed', '1');
  337. childParams.set('ssObjName', state.ssObjName || '');
  338. childParams.set('ssObjId', state.ssObjId || '');
  339. const iframeSrc = `${formPath}?${childParams.toString()}`;
  340. console.log('[mp_objInp][renderFormFrame] iframe src =', iframeSrc);
  341. if (state.vm) {
  342. state.vm.iframeSrc = iframeSrc;
  343. }
  344. const submitCfg = getSubmitConfig();
  345. state.submitEnabled = !!submitCfg.enabled;
  346. updateBottomButtons(submitCfg.title);
  347. setTimeout(updateContentHeight, 0);
  348. };
  349. const loadInitPayload = async () => {
  350. const req = ensureRequest();
  351. const postData = {
  352. ...state.pageParams,
  353. management: state.pageParams.management || '1',
  354. isReady: '1',
  355. };
  356. const res = await req.post(
  357. `/service?ssServ=${state.service}&management=1&isReady=1`,
  358. postData,
  359. { loading: false, formData: true }
  360. );
  361. state.initPayload = unwrapData(res ? res.data : null);
  362. state.ssObjName = String(state.initPayload.ssObjName || state.pageParams.ssObjName || '').trim();
  363. state.ssObjId = resolveObjIdFromInit(state.initPayload, state.ssObjName, state.pageParams);
  364. console.log('[mp_objInp] init响应', state.initPayload);
  365. };
  366. const loadDataTagPayload = async () => {
  367. const req = ensureRequest();
  368. const dataTagParams = {
  369. ...state.pageParams,
  370. ssObjName: state.ssObjName,
  371. ssObjId: state.ssObjId,
  372. };
  373. const res = await req.post(
  374. `/service?ssServ=dataTag&ssDest=data&name=inp&ssObjName=${encodeURIComponent(state.ssObjName)}&ssObjId=${encodeURIComponent(state.ssObjId)}`,
  375. dataTagParams,
  376. { loading: false, formData: true }
  377. );
  378. state.dataTagPayload = unwrapData(res ? res.data : null);
  379. console.log('[mp_objInp] dataTag响应', state.dataTagPayload);
  380. console.log('[mp_objInp] dataTag include_input =', (state.dataTagPayload && state.dataTagPayload.include_input) || '');
  381. };
  382. const submitSaveAndCommit = async () => {
  383. try {
  384. const cfg = getSubmitConfig();
  385. if (!state.submitEnabled || !cfg.enabled) {
  386. if (typeof showToastEffect === 'function') showToastEffect('当前页面不支持保存并提交', 1800, 'warning');
  387. return;
  388. }
  389. if (!cfg.serviceName || !cfg.dest) {
  390. if (typeof showToastEffect === 'function') showToastEffect('提交配置缺失', 1800, 'error');
  391. return;
  392. }
  393. const formResult = await getFrameFormData();
  394. if (!formResult.valid) {
  395. if (typeof showToastEffect === 'function') showToastEffect(formResult.message || '表单校验未通过', 2000, 'warning');
  396. return;
  397. }
  398. const req = ensureRequest();
  399. const payload = pruneParams({
  400. ...(cfg.paramObj || {}),
  401. ...(formResult.data || {}),
  402. ssObjName: state.ssObjName || undefined,
  403. ssObjId: state.ssObjId || undefined,
  404. [((state.initPayload && state.initPayload.ssObjIdName) || 'ssObjId')]: state.ssObjId || undefined,
  405. });
  406. const res = await req.post(
  407. `/service?ssServ=${cfg.serviceName}&ssDest=${encodeURIComponent(cfg.dest)}`,
  408. payload,
  409. { loading: true, formData: true }
  410. );
  411. console.log('[mp_objInp] saveAndCommit响应', res);
  412. assertServiceSuccess(res && res.data !== undefined
  413. ? res.data
  414. : res);
  415. const submitResp = unwrapData(res ? res.data : null);
  416. // 功能说明:保存并提交后若目标为 addSure,则在 inp 页二次确认并直接调最终提交接口 by xu 2026-03-01
  417. if (String(cfg.dest || '').trim().toLowerCase() === 'addsure') {
  418. const finalObjName = String((submitResp && submitResp.ssObjName) || state.ssObjName || '').trim();
  419. const finalObjIdName = String((submitResp && submitResp.ssObjIdName) || (state.initPayload && state.initPayload.ssObjIdName) || 'ssObjId').trim();
  420. const finalObjId = String((submitResp && submitResp.ssObjId) || state.ssObjId || '').trim();
  421. if (!finalObjName || !finalObjId) {
  422. if (typeof showToastEffect === 'function') showToastEffect('缺少提交参数,无法确认提交', 2200, 'error');
  423. return;
  424. }
  425. const finalServ = `${finalObjName}_lr_tj_qr`;
  426. const finalPayload = pruneParams({
  427. ssObjName: finalObjName,
  428. [finalObjIdName]: finalObjId,
  429. });
  430. // 功能说明:先缓存最终提交参数,再弹 ss-confirm 确认 by xu 2026-03-01
  431. state.pendingFinalSubmit = {
  432. serviceName: finalServ,
  433. payload: finalPayload,
  434. };
  435. if (state.vm) {
  436. state.vm.showSubmitConfirm = true;
  437. }
  438. return;
  439. }
  440. if (typeof showToastEffect === 'function') showToastEffect('提交成功', 1400, 'success');
  441. setTimeout(() => goBack(true), 600);
  442. } catch (err) {
  443. console.error('[mp_objInp] 提交失败', err);
  444. if (typeof showToastEffect === 'function') showToastEffect(
  445. err && err.message ? err.message : '提交失败,请稍后重试',
  446. 2200,
  447. 'error'
  448. );
  449. }
  450. };
  451. const init = async () => {
  452. try {
  453. setStatus('正在初始化录入页...');
  454. state.pageParams = getUrlParams();
  455. state.service = String(state.pageParams.service || '').trim();
  456. if (!state.service) throw new Error('缺少 service 参数');
  457. setStatus('正在加载业务配置...');
  458. await loadInitPayload();
  459. if (!state.ssObjName) throw new Error('第一接口未返回 ssObjName');
  460. setStatus('正在加载 dataTag...');
  461. await loadDataTagPayload();
  462. setStatus('正在加载表单页面...');
  463. renderFormFrame();
  464. setTimeout(updateContentHeight, 0);
  465. } catch (err) {
  466. console.error('[mp_objInp] 初始化失败', err);
  467. setStatus(`初始化失败:${err && err.message ? err.message : err}`);
  468. state.submitEnabled = false;
  469. }
  470. };
  471. window.addEventListener('resize', updateContentHeight);
  472. // 功能说明:使用 ss-bottom 统一底部样式与交互 by xu 2026-02-28
  473. window.SS.dom.initializeFormApp({
  474. el: '#app',
  475. data() {
  476. return {
  477. iframeSrc: '',
  478. placeholderText: '正在加载录入页面...',
  479. showBottom: true,
  480. showSubmitConfirm: false,
  481. bottomButtons: [
  482. makeCloseBottomButton(getUrlParams().service),
  483. makeSubmitBottomButton('保存并提交', getUrlParams().service)
  484. ]
  485. }
  486. },
  487. methods: {
  488. handleFrameLoad() {
  489. console.log('[mp_objInp][renderFormFrame] iframe onload');
  490. setTimeout(updateContentHeight, 0);
  491. },
  492. handleBottomAction(payload) {
  493. if (payload && payload.action === 'close') {
  494. goBack(false);
  495. return;
  496. }
  497. if (payload && payload.action === 'saveSubmit') {
  498. submitSaveAndCommit();
  499. }
  500. },
  501. // 功能说明:二次确认弹窗点击“确认”后执行最终提交 by xu 2026-03-01
  502. handleConfirmSubmit() {
  503. submitFinalConfirm();
  504. }
  505. },
  506. mounted() {
  507. state.vm = this;
  508. window.__mpObjInpSetBottomVisible = setBottomVisible;
  509. init();
  510. },
  511. beforeUnmount() {
  512. window.removeEventListener('resize', updateContentHeight);
  513. try {
  514. if (window.__mpObjInpSetBottomVisible === setBottomVisible) {
  515. delete window.__mpObjInpSetBottomVisible;
  516. }
  517. } catch (_) {}
  518. }
  519. });
  520. };
  521. // 功能说明:SS.ready 某些场景可能不触发,增加超时兜底启动 by xu 2026-02-28
  522. let booted = false;
  523. let tries = 0;
  524. const maxTries = 20;
  525. const safeBoot = function () {
  526. if (booted) return;
  527. const ready = !!(window.SS && window.SS.dom && typeof window.SS.dom.initializeFormApp === 'function');
  528. if (!ready) {
  529. tries += 1;
  530. if (tries >= maxTries) {
  531. const ph = document.getElementById('placeholder');
  532. if (ph) ph.textContent = '初始化失败:ss 组件未就绪';
  533. return;
  534. }
  535. setTimeout(safeBoot, 200);
  536. return;
  537. }
  538. booted = true;
  539. boot();
  540. };
  541. if (window.SS && typeof window.SS.ready === 'function') {
  542. window.SS.ready(safeBoot);
  543. setTimeout(safeBoot, 1600);
  544. } else {
  545. setTimeout(safeBoot, 0);
  546. }
  547. })();
  548. </script>
  549. </body>
  550. </html>