From c6caf09953b59e0ea4c02a1f916b45eed69916e9 Mon Sep 17 00:00:00 2001 From: FieryFlames Date: Wed, 19 Jul 2023 01:52:41 +0000 Subject: [PATCH] deploy: 88ed971f8705c730ebcbe5b254adaca0f8617d68 --- index.js | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1dd6a3b..112a7ee 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(function(o,l,u,t,i,c,f){"use strict";function s(e,a){switch(a){case"calendar":return e.calendar();case"relative":return e.fromNow();case"custom":return e.format(t.storage.customFormat)}}const{ScrollView:b}=c.General,{FormSection:g,FormRow:y,FormDivider:h}=c.Forms,v=l.findByName("RowCheckmark"),{ClearButtonVisibility:R,default:C}=l.findByProps("ClearButtonVisibility");function E(e){let{label:a,subLabel:n,selected:r,onPress:Y}=e;return React.createElement(y,{label:a,subLabel:n,trailing:React.createElement(v,{selected:r}),onPress:Y})}function w(e){let{value:a,onChangeText:n,placeholder:r}=e;return React.createElement(C,{value:a,onChangeText:n,placeholder:r,clearButtonVisibility:R.WITH_CONTENT,showBorder:!1,showTopContainer:!1,style:{paddingHorizontal:15,paddingVertical:13}})}let d=[{label:"Calendar",key:"calendar"},{label:"Relative",key:"relative"},{label:"Custom",key:"custom"}];function M(){return i.useProxy(t.storage),React.createElement(b,null,React.createElement(g,null,d.map(function(e,a){let{label:n,key:r}=e;return React.createElement(React.Fragment,null,React.createElement(E,{label:n,subLabel:s(u.moment(),r),selected:t.storage.selected===r,onPress:function(){return t.storage.selected=r}}),a!==d.length-1&&React.createElement(h,null))}),t.storage.selected==="custom"&&React.createElement(w,{value:t.storage.customFormat,onChangeText:function(e){return t.storage.customFormat=e},placeholder:"dddd, MMMM Do YYYY, h:mm:ss a"})))}const F=l.findByName("RowManager");let m;var T={onLoad:function(){t.storage.selected??="calendar",t.storage.customFormat??="dddd, MMMM Do YYYY, h:mm:ss a",m=f.after("generate",F.prototype,function(e,a){let[n]=e,{message:r}=a;n.rowType===1&&(r.timestamp=s(n.message.timestamp,t.storage.selected))})},onUnload:function(){m()},settings:M};return o.default=T,Object.defineProperty(o,"__esModule",{value:!0}),o})({},vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui.components,vendetta.patcher); +(function(n,s,g,t,b,c,m){"use strict";function u(e,a){switch(a){case"calendar":return e.calendar();case"relative":return e.fromNow();case"custom":return e.format(t.storage.customFormat)}}const{ScrollView:h}=c.General,{FormSection:d,FormRow:y,FormDivider:R,FormSwitchRow:v}=c.Forms,w=s.findByName("RowCheckmark"),{ClearButtonVisibility:E,default:M}=s.findByProps("ClearButtonVisibility");function p(e){let{label:a,subLabel:o,selected:r,onPress:Y}=e;return React.createElement(y,{label:a,subLabel:o,trailing:React.createElement(w,{selected:r}),onPress:Y})}function C(e){let{value:a,onChangeText:o,placeholder:r}=e;return React.createElement(M,{value:a,onChangeText:o,placeholder:r,clearButtonVisibility:E.WITH_CONTENT,showBorder:!1,showTopContainer:!1,style:{paddingHorizontal:15,paddingVertical:13}})}let i=[{label:"Calendar",key:"calendar"},{label:"Relative",key:"relative"},{label:"Custom",key:"custom"}];function F(){return b.useProxy(t.storage),React.createElement(h,null,React.createElement(d,null,i.map(function(e,a){let{label:o,key:r}=e;return React.createElement(React.Fragment,null,React.createElement(p,{label:o,subLabel:u(g.moment(),r),selected:t.storage.selected===r,onPress:function(){return t.storage.selected=r}}),a!==i.length-1&&React.createElement(R,null))}),t.storage.selected==="custom"&&React.createElement(C,{value:t.storage.customFormat,onChangeText:function(e){return t.storage.customFormat=e},placeholder:"dddd, MMMM Do YYYY, h:mm:ss a"})),React.createElement(d,null,React.createElement(v,{label:"Separate messages",subLabel:"Always shows username, avatar and timestamp for each message",value:t.storage.separateMessages,onValueChange:function(e){t.storage.separateMessages=e}})))}const f=s.findByName("RowManager");let l=[];var T={onLoad:function(){t.storage.selected??="calendar",t.storage.customFormat??="dddd, MMMM Do YYYY, h:mm:ss a",l.push(m.before("generate",f.prototype,function(e){let[a]=e;a.rowType===1&&t.storage.separateMessages&&(a.isFirst=!0)})),l.push(m.after("generate",f.prototype,function(e,a){let[o]=e,{message:r}=a;o.rowType===1&&r.timestamp&&(r.timestamp=u(o.message.timestamp,t.storage.selected))}))},onUnload:function(){l.forEach(function(e){return e()})},settings:F};return n.default=T,Object.defineProperty(n,"__esModule",{value:!0}),n})({},vendetta.metro,vendetta.metro.common,vendetta.plugin,vendetta.storage,vendetta.ui.components,vendetta.patcher); diff --git a/manifest.json b/manifest.json index 69d2ba8..6790db9 100644 --- a/manifest.json +++ b/manifest.json @@ -1 +1 @@ -{"name":"Custom Timestamps","description":"Customize the format of timestamps in chat.","authors":[{"name":"Fiery","id":"890228870559698955"}],"main":"index.js","vendetta":{"icon":"clock"},"hash":"2c06f8587b8d1c1b580942a0efe0f08cd2ec42ab41963aa7e71c7bd1b4070a98"} \ No newline at end of file +{"name":"Custom Timestamps","description":"Customize the format of timestamps in chat.","authors":[{"name":"Fiery","id":"890228870559698955"}],"main":"index.js","vendetta":{"icon":"clock"},"hash":"d6de80586e59eb8c058e24ae2fcd10da0bb355c5655db4b9793e28d490b33850"} \ No newline at end of file