PageSourceSearch

https://onefunc.com/app/plan/jslib/OF_STATUS_SHARE.js

js onefunc.com collected 2026-10-02 16:05:23 UTC 11,354 bytes, 1 lines download raw bytes

1OF_STATUS_SHARE={contentData:{comfortStatus:0,creativityIndex:0,eventArray:0},saveLatestShareProperty:function(t){OF.setLocalStorage("status_share_settings",t)},getLatestShareProperty:function(){var t=OF.getLocalStorage("status_share_settings");return null==t&&(t={comfort_status:!0,creativity_index:!1},OF.setLocalStorage("status_share_settings",t)),t},setup:function(r,_,o,d){OFML.analysis.getNewtonObjByDate(r,_,o,function(t){var s=t.dataObj.resultArray;OF_STATUS.DIALOG.CONTENT._createDetailData(r,_,function(t,e,a,n){try{var c=OF_STATUS.CALC.get7DayAverage(r,_,o,t,e,a)}catch(t){c={total_today:0,total1:0,total2:0,total3:0,total4:0,total5:0,total7:0,total14:0,total30:0,creativity_today:0,creativity1:0,creativity2:0,creativity3:0,creativity4:0,creativity5:0,creativity7:0,creativity14:0,creativity30:0}}var i=0,i=(s.forEach(function(t,e,a){isFinite(Number(t.force))&&(i+=Number(t.force))}),OF.roundDown(i,3)),t=0;e.YEAR==C.main.selectedDate.year&&e.MON==C.main.selectedDate.mon&&(t=e.detailObj[C.main.selectedDate.day]?.VALUE||0),d(t,c,s)})})},show:function(n,c,i,t){var e=OFML_UTIL.getMeasurementStyle();OF_STATUS_SHARE.currentMeasurementStyle=e,OF_DIALOG.show({hashName:"staus_share",startCallbackFunc:function(){OF_STATUS_SHARE.setup(n,c,i,function(t,e,a){OF_STATUS_SHARE.contentData.year=n,OF_STATUS_SHARE.contentData.mon=c,OF_STATUS_SHARE.contentData.day=i,OF_STATUS_SHARE.contentData.comfortStatus=t,OF_STATUS_SHARE.contentData.creativityIndex=e.creativity_today,OF_STATUS_SHARE.contentData.avg7Obj=e,OF_STATUS_SHARE.contentData.eventArray=a;t=OF_STATUS_SHARE.createBaseContent();OF.id(OF_DIALOG.contentID).appendChild(t),OF.DOM.ARIA.updatePanelVisibility(OF.id(OF_DIALOG.baseID),OF.id(OF_DIALOG.contentID)),OF_STATUS_SHARE.setTextFieldValue()})},endCallbackFunc:function(){},closeCallbackFunc:function(){t()}})},setTextFieldValue:function(){var t=document.getElementById("OF_STATUS_SHARE_TEXT"),e=(OF.isTextareaFocused(t)&&t.blur(),document.getElementById("OF_STATUS_SHARE_LIST_ITEM_comfortstatus").checked),a=document.getElementById("OF_STATUS_SHARE_LIST_ITEM_creativity").checked,n=document.getElementsByName("OF_STATUS_SHARE_LIST_ITEM_CHECK_EVENT"),c="";if(e){switch(Number(OF_STATUS_SHARE.contentData.comfortStatus)){case 0:var i="⚪️";break;case 1:i="🔵";break;case 2:i="🟢";break;case 3:i="🟡";break;case 4:i="🔴"}c=c+(TL.status_activity_share_dialog_data_comfortstatus_title+" : "+i+" "+TL["ofml_condition_evaluation_"+OF_STATUS_SHARE.contentData.comfortStatus])+"\n"}a&&(c=c+(TL.status_activity_share_dialog_data_creativity_title+" : "+OF_STATUS_SHARE.contentData.creativityIndex)+"\n");var s="";for(eventCheckNode of n)if(eventCheckNode.checked){var r=eventCheckNode.eventObj;switch(Number(r.status)){case 0:i="⚪️";break;case 1:i="🔵";break;case 2:i="🟢";break;case 3:i="🟡";break;case 4:i="🔴"}s=s+(i+" "+r.eventName)+"\n"}""!=s&&(c=(c+=TL.status_activity_share_dialog_data_eventlist_title+":")+"\n"+s);n=document.getElementById("OF_STATUS_SHARE_SHARE_BUTTON");if(""==c)n.disabled=!0,n.style.opacity=.3;else if(n.disabled=!1,n.style.opacity=1,""!=c){switch(OFML_UTIL.getMeasurementStyle()){case"standard":c+="\n"+TL.status_activity_share_dialog_data_measurement+" : "+TL.ofml_measurement_method_style_standard;break;case"strict":c+="\n"+TL.status_activity_share_dialog_data_measurement+" : "+TL.ofml_measurement_method_style_strict;break;case"theoretical":c+="\n"+TL.status_activity_share_dialog_data_measurement+" : "+TL.ofml_measurement_method_style_theoretical}c+=" "+TL.status_activity_share_dialog_data_measurement_onefunc}c="["+(OF_STATUS_SHARE.contentData.year+"/"+timeFunc.digit2(OF_STATUS_SHARE.contentData.mon)+"/"+OF_STATUS_SHARE.contentData.day)+"]\n"+c;t.value=c,OF_STATUS_SHARE.saveLatestShareProperty({comfort_status:e,creativity_index:a})},createBaseContent:function(){var t=document.createDocumentFragment(),e=(t.addEventListener("scroll",function(t){clearTimeout(OF_STATUS_SHARE.scrollTimeout),OF_STATUS_SHARE.scrollTimeout=setTimeout(function(){var t=document.getElementById("OF_STATUS_SHARE_TEXT");OF.isTextareaFocused(t)&&t.blur()},300)}
1,!1),OF_STATUS_SHARE.createHeadContent()),e=(t.appendChild(e),OF_STATUS_SHARE.createContent());return t.appendChild(e),t},createHeadContent:function(){var t=document.createElement("div"),e=(t.setAttribute("class","HEAD"),document.createElement("button")),e=(e.setAttribute("class","CLOSE_BUTTON"),e.textContent=TL.close,t.appendChild(e),e.onclick=function(t){OF_DIALOG.close(function(){})},document.createElement("button"));return e.setAttribute("id","OF_STATUS_SHARE_SHARE_BUTTON"),e.setAttribute("class","RIGHT_BUTTON"),t.appendChild(e),OF.UA.isElectron?e.textContent=TL.copy:e.textContent=TL.share,e.onclick=function(t){var e,a,n=document.getElementById("OF_STATUS_SHARE_TEXT").value.trim();""!=n&&(OF.UA.isElectron?(navigator.clipboard.writeText(n),OFM.TOP.createMessage({message:TL.top_message_done_copy,colorNumber:1,donotClear:!1,forceDisplay:!0,forceClear:!0,timeout:void 0}),OF_DIALOG.close(function(){})):(e=t.target,OF.buttonStyle.wait(e),a={text:n},async function(){try{await navigator.share(a)}catch(t){"AbortError: Share canceled"!=t&&OF_DIALOG.close(function(){})}OF.buttonStyle.default(e)}()))},t},createContent:function(){{var t=OF_STATUS_SHARE.getLatestShareProperty(),e=document.createElement("div"),a=(e.setAttribute("class","MAIN_CONTENT OF_STATUS_SHARE"),document.createElement("h3")),n=(a.setAttribute("class","about"),a.textContent=TL.status_activity_share_dialog_textarea_title,e.appendChild(a),document.createElement("textarea"));n.setAttribute("id","OF_STATUS_SHARE_TEXT"),n.setAttribute("class","share_text_area"),n.onfocus=function(t){},e.appendChild(n);var n,c=((n=document.createElement("hr")).setAttribute("class","line"),e.appendChild(n),document.createElement("div"));c.setAttribute("class","space"),e.appendChild(c);var a,i=((a=document.createElement("h3")).setAttribute("class","about"),a.textContent=TL.status_activity_share_dialog_title,e.appendChild(a),document.createElement("div")),s=(i.setAttribute("id","OF_STATUS_SHARE_LIST"),i.setAttribute("class","list"),document.createElement("div")),r=(s.setAttribute("class","stylebox"),document.createElement("div")),_=(r.setAttribute("tabindex","0"),r.setAttribute("class","detail"),s.appendChild(r),document.createElement("div")),o=(_.setAttribute("class","share_name"),r.appendChild(_),document.createElement("label")),d=(o.setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_comfortstatus"),o.textContent=TL.status_activity_share_dialog_data_comfortstatus_title,_.appendChild(o),document.createElement("div")),l=(d.setAttribute("class","share_privacy"),r.appendChild(d),document.createElement("label")),u=(l.setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_comfortstatus"),l.innerHTML=TL.status_activity_share_dialog_data_comfortstatus_privicy,d.appendChild(l),document.createElement("div"));u.setAttribute("class","share_about"),r.appendChild(u);var d,T=((d=document.createElement("label")).setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_comfortstatus"),u.appendChild(d),document.createElement("input")),c,s;T.setAttribute("name","OF_STATUS_SHARE_LIST_ITEM_CHECK"),T.setAttribute("id","OF_STATUS_SHARE_LIST_ITEM_comfortstatus"),T.setAttribute("type","checkbox"),T.setAttribute("class","style_input"),s.appendChild(T),t.comfort_status&&(T.checked=!0),T.onchange=function(t){t.target.checked?t.target.checked=!0:t.target.checked=!1,OF_STATUS_SHARE.setTextFieldValue()},(c=document.createElement("div")).setAttribute("class","space"),s.appendChild(c),i.appendChild(s),(s=document.createElement("div")).setAttribute("class","stylebox")}(r=document.createElement("div")).setAttribute("tabindex","0"),r.setAttribute("class","detail"),s.appendChild(r),(_=document.createElement("div")).setAttribute("class","share_name"),r.appendChild(_),(o=document.createElement("label")).setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_creativity"),o.textContent=TL.status_activity_share_dialog_data_creativity_title,_.appendChild(o),(u=document.createElement("div")).setAttribute("class","share_about"),r.appendChild(u),(d=document.createElement("label")).setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_creativity"),d.innerHTML=TL.status_activity_share_dialog_data_creativity_privicy,u.appendChild(d),(u=document.createElement("div")).setAttribute("class","share_about"),r.appendChild(u),(d=document.createElement("label")).setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_creativity"),u.appendChild(d),(T=document.createElement("input")).setAttribute("name","OF_STATUS_SHARE_LIST_ITEM_CHECK"),T.setAttribute("id","OF_STATUS_SHARE_LIST_ITEM_creativity"),T.setAttribute("type","checkbox"),T.setAttribute("class","style_input"),s.appendChild(T),t.creativity_index&&(T.checked=!0),T.onchange=function(t){t.target.checked?t.target.checked=!0:t.target.checked=!1,OF_STATUS_SHARE.setTextFieldValue()},(c=document.createElement("div")).setAttribute("class","space"),s.appendChild(c),i.appendChild(s),(c=document.createElement("div")).setAttribute("class","space"),i.appendChild(c);(a=document.createElement("h3")).setAttribute("class","about"),a.textContent=TL.status_activity_share_dialog_data_event_title,i.appendChild(a);l=document.createElement("div");if(l.setAttribute("class","text"),l.innerHTML=TL.status_activity_share_dialog_data_event_privicy,i.appendChild(l),0==OF_STATUS_SHARE.contentData.eventArray.length){(n=document.createElement("hr")).setAttribute("class","line"),i.appendChild(n);d=document.createElement("div");d.setAttribute("class","none_event"),d.innerHTML=TL.no_plan,i.appendChild(d)}else{2<=OF_STATUS_SHARE.contentData.eventArray.length&&((t=document.createElement("div")).setAttribute("class","event_all_select"),t.innerHTML="すべての予定を選択",i.appendChild(t),t.onclick=function(){for(eventCheckNode of document.getElementsByName("OF_STATUS_SHARE_LIST_ITEM_CHECK_EVENT"))eventCheckNode.checked=!0;OF_STATUS_SHARE.setTextFieldValue()});(n=document.createElement("hr")).setAttribute("class","line"),i.appendChild(n);var S=0;for(eventObj of OF_STATUS_SHARE.contentData.eventArray){switch(Number(eventObj.status)){case 0:var A="⚪️";break;case 1:A="🔵";break;case 2:A="🟢";break;case 3:A="🟡";break;case 4:A="🔴"}(s=document.createElement("div")).setAttribute("class","stylebox"),(r=document.createElement("div")).setAttribute("class","detail"),s.appendChild(r),(_=document.createElement("h4")).setAttribute("tabindex","0"),_.setAttribute("class","event_name"),r.appendChild(_),(o=document.createElement("label")).setAttribute("for","OF_STATUS_SHARE_LIST_ITEM_event_"+S),o.setAttribute("aria-label",eventObj.eventName+" Wit Meter: "+eventObj.status+" "+TL["ofml_condition_evaluation_"+eventObj.status]),o.textContent=A+" "+eventObj.eventName,_.appendChild(o),(u=document.createElement("div")).setAttribute("class","share_about"),r.appendChild(u),(T=document.createElement("input")).setAttribute("name","OF_STATUS_SHARE_LIST_ITEM_CHECK_EVENT"),T.setAttribute("id","OF_STATUS_SHARE_LIST_ITEM_event_"+S),T.setAttribute("type","checkbox"),T.setAttribute("class","style_input"),T.eventObj=eventObj,s.appendChild(T),T.onchange=function(t){t.target.checked?t.target.checked=!0:t.target.checked=!1,OF_STATUS_SHARE.setTextFieldValue()},i.appendChild(s),S+=1}}return e.appendChild(i),(c=document.createElement("div")).setAttribute("class","DUMMY"),e.appendChild(c),e}};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.