2020-02-27 08:44:03 +01:00
//META{"name":"PersonalPins","authorId":"278543574059057154","invite":"Jx3TjNS","donate":"https://www.paypal.me/MircoWittrien","patreon":"https://www.patreon.com/MircoWittrien","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/PersonalPins","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/PersonalPins/PersonalPins.plugin.js"}*//
2018-12-28 14:28:50 +01:00
2020-09-19 20:49:33 +02:00
module . exports = ( _ => {
const config = {
"info" : {
"name" : "PersonalPins" ,
"author" : "DevilBro" ,
"version" : "1.9.7" ,
"description" : "Similar to normal pins. Lets you save messages as notes for yourself."
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
} ;
return ! window . BDFDB _Global || ( ! window . BDFDB _Global . loaded && ! window . BDFDB _Global . started ) ? class {
getName ( ) { return config . info . name ; }
getAuthor ( ) { return config . info . author ; }
getVersion ( ) { return config . info . version ; }
getDescription ( ) { return config . info . description ; }
2020-07-11 23:28:30 +02:00
2020-09-19 20:49:33 +02:00
load ( ) {
if ( ! window . BDFDB _Global || ! Array . isArray ( window . BDFDB _Global . pluginQueue ) ) window . BDFDB _Global = Object . assign ( { } , window . BDFDB _Global , { pluginQueue : [ ] } ) ;
if ( ! window . BDFDB _Global . downloadModal ) {
window . BDFDB _Global . downloadModal = true ;
BdApi . showConfirmationModal ( "Library Missing" , ` The library plugin needed for ${ config . info . name } is missing. Please click "Download Now" to install it. ` , {
confirmText : "Download Now" ,
cancelText : "Cancel" ,
onCancel : _ => { delete window . BDFDB _Global . downloadModal ; } ,
2020-09-20 08:15:13 +02:00
onConfirm : _ => {
delete window . BDFDB _Global . downloadModal ;
require ( "request" ) . get ( "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js" , ( e , r , b ) => {
if ( ! e && b && b . indexOf ( ` //META{"name":" ` ) > - 1 ) require ( "fs" ) . writeFile ( require ( "path" ) . join ( BdApi . Plugins . folder , "0BDFDB.plugin.js" ) , b , _ => { } ) ;
else BdApi . alert ( "Error" , "Could not download BDFDB library plugin, try again some time later." ) ;
} ) ;
}
2020-09-19 20:49:33 +02:00
} ) ;
}
if ( ! window . BDFDB _Global . pluginQueue . includes ( config . info . name ) ) window . BDFDB _Global . pluginQueue . push ( config . info . name ) ;
}
start ( ) { }
stop ( ) { }
} : ( ( [ Plugin , BDFDB ] ) => {
const pinIconGeneral = ` <svg name="Note" width="24" height="24" viewBox="-1 -1.5 23 23"><mask/><g mask="url(#pinIconMask)"><path fill="currentColor" d="M 4.618, 0 c -0.316, 0 -0.573, 0.256 -0.573, 0.573 v 1.145 c 0, 0.316, 0.256, 0.573, 0.573, 0.573 s 0.573 -0.256, 0.573 -0.573 V 0.573 C 5.191, 0.256, 4.935, 0, 4.618, 0 z"/><path fill="currentColor" d="M 8.053, 0 c -0.316, 0 -0.573, 0.256 -0.573, 0.573 v 1.145 c 0, 0.316, 0.256, 0.573, 0.573, 0.573 s 0.573 -0.256, 0.573 -0.573 V 0.573 C 8.626, 0.256, 8.37, 0, 8.053, 0 z"/><path fill="currentColor" d="M 11.489, 0 c -0.316, 0 -0.573, 0.256 -0.573, 0.573 v 1.145 c 0, 0.316, 0.256, 0.573, 0.573, 0.573 c 0.316, 0, 0.573 -0.256, 0.573 -0.573 V 0.573 C 12.061, 0.256, 11.805, 0, 11.489, 0 z "/><path fill="currentColor" d="M 14.924, 0 c -0.316, 0 -0.573, 0.256 -0.573, 0.573 v 1.145 c 0, 0.316, 0.256, 0.573, 0.573, 0.573 c 0.316, 0, 0.573 -0.256, 0.573 -0.573 V 0.573 C 15.496, 0.256, 15.24, 0, 14.924, 0 z"/><path fill="currentColor" d="M 16.641, 1.25 V 1.718 c 0, 0.947 -0.77, 1.718 -1.718, 1.718 c -0.947, 0 -1.718 -0.77 -1.718 -1.718 c 0, 0.947 -0.77, 1.718 -1.718, 1.718 c -0.947, 0 -1.718 -0.77 -1.718 -1.718 c 0, 0.947 -0.77, 1.718 -1.718, 1.718 c -0.947, 0 -1.718 -0.77 -1.718 -1.718 c 0, 0.947 -0.77, 1.718 -1.718, 1.718 c -0.947, 0 -1.718 -0.77 -1.718 -1.718 V 1.25 C 2.236, 1.488, 1.756, 2.117, 1.756, 2.863 v 14.962 c 0, 0.947, 0.77, 1.718, 1.718, 1.718 h 12.595 c 0.947, 0, 1.718 -0.77, 1.718 -1.718 V 2.863 C 17.786, 2.117, 17.306, 1.488, 16.641, 1.25 z M 14.924, 16.679 H 4.618 c -0.316, 0 -0.573 -0.256 -0.573 -0.573 c 0 -0.316, 0.256 -0.573, 0.573 -0.573 h 10.305 c 0.316, 0, 0.573, 0.256, 0.573, 0.573 C 15.496, 16.423, 15.24, 16.679, 14.924, 16.679 z M 14.924, 13.244 H 4.618 c -0.316, 0 -0.573 -0.256 -0.573 -0.573 c 0 -0.316, 0.256 -0.573, 0.573 -0.573 h 10.305 c 0.316, 0, 0.573, 0.256, 0.573, 0.573 C 15.496, 12.988, 15.24, 13.244, 14.924, 13.244 z M 14.924, 9.733 H 4.618 c -0.316, 0 -0.573 -0.256 -0.573 -0.573 s 0.256 -0.573, 0.573 -0.573 h 10.305 c 0.316, 0, 0.573, 0.256, 0.573, 0.573 S 15.24, 9.733, 14.924, 9.733 z M 14.924, 6.298 H 4.618 c -0.316, 0 -0.573 -0.256 -0.573 -0.573 s 0.256 -0.573, 0.573 -0.573 h 10.305 c 0.316, 0, 0.573, 0.256, 0.573, 0.573 S 15.24, 6.298, 14.924, 6.298 z"/></g><extra/></svg> ` ;
const pinIconMask = ` <mask id="pinIconMask" fill="black"><path d="M 0 0 H 24 V 24 H 0 Z" fill="white"></path><path d="M24 12 H 12 V 24 H 24 Z" fill="black"></path></mask> ` ;
const pinIcon = pinIconGeneral . replace ( ` <extra/> ` , ` ` ) . replace ( ` <mask/> ` , ` ` ) . replace ( ` mask="url(#pinIconMask)" ` , ` ` ) ;
const pinIconDelete = pinIconGeneral . replace ( ` <extra/> ` , ` <path transform="translate(8, 8)" stroke="#f04747" stroke-width="2" fill="none" d="M 4 4 l 8.666 8.666 m 0 -8.667 l -8.667 8.666 Z"/> ` ) . replace ( ` <mask/> ` , pinIconMask ) ;
const pinIconUpdate = pinIconGeneral . replace ( ` <extra/> ` , ` <path transform="translate(10, 10)" fill="#43b581" d="M 11.374, 4.978 V 0 l -1.672, 1.671 C 8.675, 0.64, 7.256, 0, 5.685, 0 C 2.542, 0, 0.003, 2.546, 0.003, 5.688 s 2.538, 5.688, 5.681, 5.688 c 2.648, 0, 4.867 -1.814, 5.496 -4.267 h -1.48 c -0.587, 1.656 -2.158, 2.844 -4.018, 2.844 c -2.358, 0 -4.267 -1.91 -4.267 -4.267 s 1.909 -4.267, 4.266 -4.267 c 1.176, 0, 2.232, 0.49, 3.004, 1.262 l -2.294, 2.293 H 11.374 z"/> ` ) . replace ( ` <mask/> ` , pinIconMask ) ;
const filterKeys = [ "channel" , "server" , "all" ] ;
const sortKeys = [ "notetime" , "messagetime" ] ;
const orderKeys = [ "ascending" , "descending" ] ;
var choices = { } ;
return class PersonalPins extends Plugin {
onLoad ( ) {
this . defaults = {
choices : {
defaultFilter : { value : filterKeys [ 0 ] , options : filterKeys , type : "filter" , description : "Default choice tab" } ,
defaultSort : { value : sortKeys [ 0 ] , options : sortKeys , type : "sort" , description : "Default sort choice" } ,
defaultOrder : { value : orderKeys [ 0 ] , options : orderKeys , type : "order" , description : "Default order choice" } ,
}
} ;
2020-07-11 23:28:30 +02:00
2020-09-19 20:49:33 +02:00
this . patchedModules = {
after : {
HeaderBarContainer : "render"
}
} ;
}
2020-02-04 08:20:40 +01:00
2020-09-19 20:49:33 +02:00
onStart ( ) {
this . forceUpdateAll ( ) ;
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
onStop ( ) {
2020-07-11 23:28:30 +02:00
this . forceUpdateAll ( ) ;
2020-02-04 08:20:40 +01:00
}
2019-10-22 11:37:23 +02:00
2020-09-19 20:49:33 +02:00
getSettingsPanel ( collapseStates = { } ) {
let settingsPanel , settingsItems = [ ] ;
for ( let key in choices ) settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsSaveItem , {
className : BDFDB . disCN . marginbottom8 ,
type : "Select" ,
plugin : this ,
keys : [ "choices" , key ] ,
label : this . defaults . choices [ key ] . description ,
basis : "50%" ,
value : choices [ key ] ,
options : ( this . defaults . choices [ key ] . options || [ ] ) . map ( option => this . getValue ( option , this . defaults . choices [ key ] . type ) ) ,
searchable : true
} ) ) ;
2020-02-04 08:20:40 +01:00
2020-09-19 20:49:33 +02:00
settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Button" ,
className : BDFDB . disCN . marginbottom8 ,
color : BDFDB . LibraryComponents . Button . Colors . RED ,
label : "Delete all notes" ,
onClick : _ => {
BDFDB . ModalUtils . confirm ( this , "Are you sure you want to delete all pinned notes?" , _ => {
BDFDB . DataUtils . remove ( this , "notes" ) ;
} ) ;
} ,
children : BDFDB . LanguageUtils . LanguageStrings . DELETE
} ) ) ;
return settingsPanel = BDFDB . PluginUtils . createSettingsPanel ( this , settingsItems ) ;
2020-02-04 08:20:40 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
onSettingsClosed ( ) {
if ( this . SettingsUpdated ) {
delete this . SettingsUpdated ;
this . forceUpdateAll ( ) ;
}
}
forceUpdateAll ( ) {
choices = BDFDB . DataUtils . get ( this , "choices" ) ;
BDFDB . PatchUtils . forceAllUpdates ( this ) ;
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
onMessageContextMenu ( e ) {
if ( e . instance . props . message && e . instance . props . channel ) {
let note = this . getNoteData ( e . instance . props . message , e . instance . props . channel ) ;
let hint = BDFDB . BDUtils . isPluginEnabled ( "MessageUtilities" ) ? BDFDB . BDUtils . getPlugin ( "MessageUtilities" ) . getActiveShortcutString ( "__Note_Message" ) : null ;
let [ children , index ] = BDFDB . ContextMenuUtils . findItem ( e . returnvalue , { id : [ "pin" , "unpin" ] } ) ;
if ( index == - 1 ) [ children , index ] = BDFDB . ContextMenuUtils . findItem ( e . returnvalue , { id : [ "edit" , "add-reaction" , "quote" ] } ) ;
children . splice ( index > - 1 ? index + 1 : 0 , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
label : note ? this . labels . context _unpinoption _text : this . labels . context _pinoption _text ,
id : BDFDB . ContextMenuUtils . createItemId ( this . name , note ? "unpin-note" : "pin-note" ) ,
hint : hint && ( _ => {
return BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . MenuItems . MenuHint , {
hint : hint
} ) ;
} ) ,
action : _ => {
this . addMessageToNotes ( e . instance . props . message , e . instance . props . channel ) ;
}
} ) ) ;
if ( this . isNoteOutdated ( note , e . instance . props . message ) ) children . splice ( index > - 1 ? index + 1 : 0 , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
label : this . labels . context _updateoption _text ,
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "update-note" ) ,
action : _ => {
this . updateNoteData ( note , e . instance . props . message ) ;
}
} ) ) ;
}
}
onMessageOptionContextMenu ( e ) {
if ( e . instance . props . message && e . instance . props . channel ) {
let note = this . getNoteData ( e . instance . props . message , e . instance . props . channel ) ;
let [ children , index ] = BDFDB . ContextMenuUtils . findItem ( e . returnvalue , { id : [ "pin" , "unpin" ] } ) ;
children . splice ( index + 1 , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
label : note ? this . labels . context _unpinoption _text : this . labels . context _pinoption _text ,
id : BDFDB . ContextMenuUtils . createItemId ( this . name , note ? "unpin-note" : "pin-note" ) ,
icon : _ => {
return BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . MenuItems . MenuIcon , {
icon : note ? pinIconDelete : pinIcon
} ) ;
} ,
action : _ => {
this . addMessageToNotes ( e . instance . props . message , e . instance . props . channel ) ;
}
} ) ) ;
if ( this . isNoteOutdated ( note , e . instance . props . message ) ) children . splice ( index + 1 , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
label : this . labels . context _updateoption _text ,
id : "update-note" ,
icon : _ => {
return BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . MenuItems . MenuIcon , {
icon : pinIconUpdate
} ) ;
} ,
action : _ => {
this . updateNoteData ( note , e . instance . props . message ) ;
}
} ) ) ;
}
2020-07-11 23:28:30 +02:00
}
2020-09-19 20:49:33 +02:00
processHeaderBarContainer ( e ) {
let [ children , index ] = BDFDB . ReactUtils . findParent ( BDFDB . ObjectUtils . get ( e . returnvalue , "props.toolbar" ) , { name : "FluxContainer(Search)" } ) ;
if ( index > - 1 ) children . splice ( index , 0 , BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . PopoutContainer , {
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TooltipContainer , {
text : this . labels . popout _note _text ,
tooltipConfig : { type : "bottom" } ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Clickable , {
className : BDFDB . disCNS . channelheadericonwrapper + BDFDB . disCN . channelheadericonclickable ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SvgIcon , {
className : BDFDB . disCNS . channelheadericon ,
iconSVG : pinIcon
} )
} )
2020-05-19 16:39:28 +02:00
} ) ,
2020-09-19 20:49:33 +02:00
popoutClassName : BDFDB . disCN . messagespopoutwrap ,
animation : BDFDB . LibraryComponents . PopoutContainer . Animation . SCALE ,
position : BDFDB . LibraryComponents . PopoutContainer . Positions . BOTTOM ,
align : BDFDB . LibraryComponents . PopoutContainer . Align . RIGHT ,
width : 650 ,
maxHeight : "calc(100vh - 100px)" ,
onClose : instance => {
BDFDB . DOMUtils . removeClass ( instance . domElementRef . current , BDFDB . disCN . channelheadericonselected ) ;
2020-05-14 17:33:14 +02:00
} ,
2020-09-19 20:49:33 +02:00
renderPopout : instance => {
BDFDB . DOMUtils . addClass ( instance . domElementRef . current , BDFDB . disCN . channelheadericonselected ) ;
return this . openNotesPopout ( instance ) ;
2020-02-04 08:20:40 +01:00
}
} ) ) ;
2018-12-28 14:28:50 +01:00
}
2020-09-19 20:49:33 +02:00
openNotesPopout ( buttonInstance ) {
buttonInstance . props . selectedFilter = buttonInstance . props . selectedFilter || this . getValue ( choices . defaultFilter || filterKeys [ 0 ] , "filter" ) ;
buttonInstance . props . selectedSort = buttonInstance . props . selectedSort || this . getValue ( choices . defaultSort || sortKeys [ 0 ] , "sort" ) ;
buttonInstance . props . selectedOrder = buttonInstance . props . selectedOrder || this . getValue ( choices . defaultOrder || orderKeys [ 0 ] , "order" ) ;
buttonInstance . props . searchKey = buttonInstance . props . searchKey || "" ;
let searchTimeout ;
return [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . messagespopouttabbarheader + BDFDB . disCN . messagespopoutheader ,
style : {
paddingBottom : 4
} ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
direction : BDFDB . LibraryComponents . Flex . Direction . VERTICAL ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
className : BDFDB . disCN . marginbottom4 ,
align : BDFDB . LibraryComponents . Flex . Align . CENTER ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex . Child , {
className : BDFDB . disCN . messagespopouttitle ,
children : this . labels . popout _note _text
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SearchBar , {
query : buttonInstance . props . searchKey ,
onChange : value => {
BDFDB . TimeUtils . clear ( searchTimeout ) ;
searchTimeout = BDFDB . TimeUtils . timeout ( _ => {
buttonInstance . props . searchKey = value ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
} , 1000 ) ;
} ,
onClear : _ => {
buttonInstance . props . searchKey = "" ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
}
} )
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
align : BDFDB . LibraryComponents . Flex . Align . CENTER ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TabBar , {
className : BDFDB . disCN . messagespopouttabbar ,
itemClassName : BDFDB . disCN . messagespopouttabbartab ,
itemSelectedClassName : BDFDB . disCN . messagespopouttabbartabactive ,
type : BDFDB . LibraryComponents . TabBar . Types . TOP _PILL ,
selectedItem : buttonInstance . props . selectedFilter . value ,
items : filterKeys . map ( option => this . getValue ( option , "filter" ) ) ,
onItemSelect : option => {
buttonInstance . props . selectedFilter = this . getValue ( option , "filter" ) ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
}
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . QuickSelect , {
label : BDFDB . LanguageUtils . LibraryStrings . sort _by + ":" ,
value : buttonInstance . props . selectedSort ,
options : sortKeys . map ( option => this . getValue ( option , "sort" ) ) ,
onChange : option => {
buttonInstance . props . selectedSort = this . getValue ( option , "sort" ) ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
}
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . QuickSelect , {
label : BDFDB . LanguageUtils . LibraryStrings . order + ":" ,
value : buttonInstance . props . selectedOrder ,
options : orderKeys . map ( option => this . getValue ( option , "order" ) ) ,
onChange : option => {
buttonInstance . props . selectedOrder = this . getValue ( option , "order" ) ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
}
} )
]
} )
]
2020-02-04 08:20:40 +01:00
} )
2020-09-19 20:49:33 +02:00
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ScrollerThin , {
className : BDFDB . disCN . messagespopout ,
children : this . filterMessages ( buttonInstance , buttonInstance . props . selectedFilter . value , buttonInstance . props . selectedSort . value , buttonInstance . props . selectedOrder . value == "descending" , buttonInstance . props . searchKey . toUpperCase ( ) )
2020-02-04 08:20:40 +01:00
} )
2020-09-19 20:49:33 +02:00
] ;
}
getValue ( key , type ) {
return {
label : type == "order" ? BDFDB . LanguageUtils . LibraryStrings [ key ] : this . labels [ ` popout_ ${ type } _ ${ key } _text ` ] ,
value : key
} ;
}
filterMessages ( buttonInstance , filter , sort , reverse , searchkey ) {
let lightTheme = BDFDB . DiscordUtils . getTheme ( ) == BDFDB . disCN . themelight ;
let messages = [ ] , notes = BDFDB . DataUtils . load ( this , "notes" ) , updateData = false ;
for ( let guild _id in notes ) for ( let channel _id in notes [ guild _id ] ) for ( let message _idPOS in notes [ guild _id ] [ channel _id ] ) {
let message = JSON . parse ( notes [ guild _id ] [ channel _id ] [ message _idPOS ] . message ) ;
message . author = new BDFDB . DiscordObjects . User ( message . author ) ;
message . timestamp = new BDFDB . DiscordObjects . Timestamp ( message . timestamp ) ;
message . editedTimestamp = message . editedTimestamp && new BDFDB . DiscordObjects . Timestamp ( message . editedTimestamp ) ;
if ( message . customRenderedContent && message . customRenderedContent . content . length ) message . customRenderedContent . content = BDFDB . ReactUtils . objectToReact ( message . customRenderedContent . content ) ;
for ( let embed of message . embeds ) {
embed . color = typeof embed . color != "string" ? null : embed . color ;
embed . timestamp = embed . timestamp && new BDFDB . DiscordObjects . Timestamp ( embed . timestamp ) ;
}
message . embeds = message . embeds . filter ( n => ! ( n && n . type == "gifv" ) ) ;
message . reactions = [ ] ;
message = new BDFDB . DiscordObjects . Message ( message ) ;
let channel = notes [ guild _id ] [ channel _id ] [ message _idPOS ] . channel && new BDFDB . DiscordObjects . Channel ( JSON . parse ( notes [ guild _id ] [ channel _id ] [ message _idPOS ] . channel ) ) ;
if ( ! channel ) {
channel = BDFDB . LibraryModules . ChannelStore . getChannel ( message . channel _id ) ;
if ( channel ) {
updateData = true ;
notes [ guild _id ] [ channel _id ] [ message _idPOS ] . channel = JSON . stringify ( channel ) ;
}
}
messages . push ( {
note : notes [ guild _id ] [ channel _id ] [ message _idPOS ] ,
channel _id ,
guild _id ,
message ,
channel ,
messagetime : notes [ guild _id ] [ channel _id ] [ message _idPOS ] . timestamp ,
notetime : notes [ guild _id ] [ channel _id ] [ message _idPOS ] . addedat
} ) ;
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
if ( updateData ) BDFDB . DataUtils . save ( notes , this , "notes" ) ;
let currentChannel = BDFDB . LibraryModules . ChannelStore . getChannel ( BDFDB . LibraryModules . LastChannelStore . getChannelId ( ) ) || { } ;
switch ( filter ) {
case "channel" :
messages = messages . filter ( messageData => messageData . channel _id == currentChannel . id ) ;
break ;
case "server" :
messages = messages . filter ( messageData => messageData . guild _id == ( currentChannel . guild _id || BDFDB . DiscordConstants . ME ) ) ;
break ;
case "allservers" :
messages = messages ;
break ;
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
if ( searchkey ) {
let searchValues = [ "content" , "author.username" , "rawDescription" , "author.name" ] ;
messages = messages . filter ( messageData => searchValues . some ( key => this . containsSearchkey ( messageData . message , key , searchkey ) || messageData . message . embeds . some ( embed => this . containsSearchkey ( embed , key , searchkey ) ) ) ) ;
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
BDFDB . ArrayUtils . keySort ( messages , sort ) ;
if ( ! reverse ) messages . reverse ( ) ;
return Object . keys ( messages ) . length ?
messages . map ( messageData => this . renderMessage ( buttonInstance , messageData . note , messageData . message , messageData . channel , filter ) ) . flat ( 10 ) . filter ( n => n ) :
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . MessagesPopoutComponents . EmptyStateCenter , {
msg : BDFDB . LanguageUtils . LanguageStrings . AUTOCOMPLETE _NO _RESULTS _HEADER ,
image : lightTheme ? "/assets/03c7541028afafafd1a9f6a81cb7f149.svg" : "/assets/6793e022dc1b065b21f12d6df02f91bd.svg"
} ) ;
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
containsSearchkey ( data , key , searchkey ) {
let value = BDFDB . ObjectUtils . get ( data , key ) ;
return value && value . toUpperCase ( ) . indexOf ( searchkey ) > - 1
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
renderMessage ( buttonInstance , note , message , channel , filter ) {
if ( ! message || ! channel ) return null ;
let channelname = channel . name ;
let guild = channel . guild _id && BDFDB . LibraryModules . GuildStore . getGuild ( channel . guild _id ) ;
let role = guild && BDFDB . LibraryModules . PermissionRoleUtils . getHighestRole ( guild , message . author . id ) ;
if ( role ) message . colorString = role . colorString ;
if ( filter != "channel" && ! channelname && channel . recipients . length > 0 ) {
for ( let dmuser _id of channel . recipients ) {
channelname = channelname ? channelname + ", @" : channelname ;
channelname = channelname + ( ( BDFDB . LibraryModules . UserStore . getUser ( dmuser _id ) || { } ) . username || BDFDB . LanguageUtils . LanguageStrings . UNKNOWN _USER ) ;
}
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
return [ filter == "channel" ? null : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . messagespopoutchannelseparator ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Clickable , {
tag : "span" ,
className : BDFDB . disCN . messagespopoutchannelname ,
onClick : _ => {
BDFDB . LibraryModules . SelectChannelUtils . selectChannel ( channel . guild _id , channel . id ) ;
} ,
children : channelname ? ( ( channel . guild _id ? "#" : "@" ) + channelname ) : "???"
} ) ,
filter == "all" ? BDFDB . ReactUtils . createElement ( "span" , {
className : BDFDB . disCN . messagespopoutguildname ,
children : channel . guild _id ? ( BDFDB . LibraryModules . GuildStore . getGuild ( channel . guild _id ) || { } ) . name || BDFDB . LanguageUtils . LanguageStrings . GUILD _UNAVAILABLE _HEADER : BDFDB . LanguageUtils . LanguageStrings . DIRECT _MESSAGES
} ) : null
]
} ) , BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . messagespopoutgroupwrapper ,
key : message . id ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . MessageGroup , {
className : BDFDB . disCN . messagespopoutgroupcozy ,
message : message ,
channel : channel
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . messagespopoutactionbuttons ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Clickable , {
className : BDFDB . disCN . messagespopoutjumpbutton ,
onClick : _ => {
BDFDB . LibraryModules . SelectChannelUtils . selectChannel ( channel . guild _id , channel . id , message . id ) ;
} ,
children : BDFDB . ReactUtils . createElement ( "div" , {
children : BDFDB . LanguageUtils . LanguageStrings . JUMP
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Clickable , {
className : BDFDB . disCN . messagespopoutjumpbutton ,
onClick : _ => {
if ( message . content || message . attachments . length > 1 ) {
let text = message . content || "" ;
for ( let attachment of message . attachments ) if ( attachment . url ) text += ( ( text ? "\n" : "" ) + attachment . url ) ;
BDFDB . LibraryRequires . electron . clipboard . write ( { text } ) ;
}
else if ( message . attachments . length == 1 && message . attachments [ 0 ] . url ) {
BDFDB . LibraryRequires . request ( { url : message . attachments [ 0 ] . url , encoding : null } , ( error , response , buffer ) => {
if ( buffer ) {
if ( BDFDB . LibraryRequires . process . platform === "win32" || BDFDB . LibraryRequires . process . platform === "darwin" ) {
BDFDB . LibraryRequires . electron . clipboard . write ( { image : BDFDB . LibraryRequires . electron . nativeImage . createFromBuffer ( buffer ) } ) ;
}
else {
let file = BDFDB . LibraryRequires . path . join ( BDFDB . LibraryRequires . process . env [ "HOME" ] , "personalpinstemp.png" ) ;
BDFDB . LibraryRequires . fs . writeFileSync ( file , buffer , { encoding : null } ) ;
BDFDB . LibraryRequires . electron . clipboard . write ( { image : file } ) ;
BDFDB . LibraryRequires . fs . unlinkSync ( file ) ;
}
2020-02-04 09:26:05 +01:00
}
2020-09-19 20:49:33 +02:00
} ) ;
}
} ,
children : BDFDB . ReactUtils . createElement ( "div" , {
children : BDFDB . LanguageUtils . LanguageStrings . COPY
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Button , {
look : BDFDB . LibraryComponents . Button . Looks . BLANK ,
size : BDFDB . LibraryComponents . Button . Sizes . NONE ,
onClick : ( e , instance ) => {
this . removeNoteData ( note ) ;
BDFDB . ReactUtils . forceUpdate ( buttonInstance . context . popout . _owner . stateNode ) ;
} ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SvgIcon , {
className : BDFDB . disCN . messagespopoutclosebutton ,
name : BDFDB . LibraryComponents . SvgIcon . Names . CLOSE
} )
2020-02-04 09:26:05 +01:00
} )
2020-09-19 20:49:33 +02:00
]
} )
]
} ) ] ;
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
addMessageToNotes ( message , channel ) {
if ( ! message ) return ;
let notes = BDFDB . DataUtils . load ( this , "notes" ) ;
channel = channel || BDFDB . LibraryModules . ChannelStore . getChannel ( message . channel _id ) ;
let guild _id = channel . guild _id || BDFDB . DiscordConstants . ME ;
notes [ guild _id ] = notes [ guild _id ] || { } ;
notes [ guild _id ] [ channel . id ] = notes [ guild _id ] [ channel . id ] || { }
if ( ! notes [ guild _id ] [ channel . id ] [ message . id ] ) {
notes [ guild _id ] [ channel . id ] [ message . id ] = {
addedat : new Date ( ) . getTime ( ) ,
channel : JSON . stringify ( channel ) ,
id : message . id ,
message : JSON . stringify ( message ) ,
timestamp : message . timestamp . _i . getTime ( )
} ;
BDFDB . DataUtils . save ( notes , this , "notes" ) ;
BDFDB . NotificationUtils . toast ( this . labels . toast _noteadd _text , { type : "success" } ) ;
}
else this . removeNoteData ( notes [ guild _id ] [ channel . id ] [ message . id ] ) ;
}
isNoteOutdated ( note , message ) {
let notemessage = note && JSON . parse ( note . message ) , keys = [ "content" , "embeds" , "attachment" ] ;
return notemessage && ! BDFDB . equals ( BDFDB . ObjectUtils . extract ( notemessage , keys ) , BDFDB . ObjectUtils . extract ( message , keys ) ) ;
2020-02-04 08:20:40 +01:00
}
2019-11-09 12:53:04 +01:00
2020-09-19 20:49:33 +02:00
getNoteData ( message , channel ) {
if ( ! message ) return ;
channel = channel || BDFDB . LibraryModules . ChannelStore . getChannel ( message . channel _id ) ;
let guild _id = channel . guild _id || BDFDB . DiscordConstants . ME ;
let notes = BDFDB . DataUtils . load ( this , "notes" ) ;
return notes [ guild _id ] && notes [ guild _id ] [ channel . id ] && notes [ guild _id ] [ channel . id ] [ message . id ] ;
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
updateNoteData ( note , newmessage ) {
let message = JSON . parse ( note . message ) ;
let channel = JSON . parse ( note . channel ) ;
if ( ! message || ! channel ) return ;
let guild _id = channel . guild _id || BDFDB . DiscordConstants . ME ;
let notes = BDFDB . DataUtils . load ( this , "notes" ) ;
notes [ guild _id ] [ channel . id ] [ note . id ] . message = JSON . stringify ( newmessage ) ;
BDFDB . DataUtils . save ( notes , this , "notes" ) ;
BDFDB . NotificationUtils . toast ( this . labels . toast _noteupdate _text , { type : "info" } ) ;
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
removeNoteData ( note ) {
let message = JSON . parse ( note . message ) ;
let channel = JSON . parse ( note . channel ) ;
if ( ! message || ! channel ) return ;
let guild _id = channel . guild _id || BDFDB . DiscordConstants . ME ;
let notes = BDFDB . DataUtils . load ( this , "notes" ) ;
delete notes [ guild _id ] [ channel . id ] [ note . id ] ;
if ( BDFDB . ObjectUtils . isEmpty ( notes [ guild _id ] [ channel . id ] ) ) {
delete notes [ guild _id ] [ channel . id ] ;
if ( BDFDB . ObjectUtils . isEmpty ( notes [ guild _id ] ) ) delete notes [ guild _id ] ;
}
BDFDB . DataUtils . save ( notes , this , "notes" ) ;
BDFDB . NotificationUtils . toast ( this . labels . toast _noteremove _text , { type : "danger" } ) ;
2020-02-04 08:20:40 +01:00
}
2020-07-11 23:28:30 +02:00
2020-02-04 08:20:40 +01:00
2020-09-19 20:49:33 +02:00
setLabelsByLanguage ( ) {
switch ( BDFDB . LanguageUtils . getLanguage ( ) . id ) {
case "hr" : //croatian
return {
popout _note _text : "Bilješke" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Poslužavnik" ,
popout _filter _all _text : "Svi poslužitelji" ,
popout _sort _messagetime _text : "Vijesti-Datum" ,
popout _sort _notetime _text : "Bilješka-Datum" ,
context _pinoption _text : "Napominjemo poruku" ,
context _updateoption _text : "Ažuriraj bilješku" ,
context _unpinoption _text : "Uklonite bilješku" ,
popout _pinoption _text : "Bilješka" ,
toast _noteadd _text : "Poruka dodana u bilježnicu." ,
toast _noteupdate _text : "Poruka je ažurirana u bilježnici." ,
toast _noteremove _text : "Poruka uklonjena iz bilježnice."
} ;
case "da" : //danish
return {
popout _note _text : "Noter" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Alle servere" ,
popout _sort _messagetime _text : "Meddelelse-Dato" ,
popout _sort _notetime _text : "Note-Dato" ,
context _pinoption _text : "Noter besked" ,
context _updateoption _text : "Opdater note" ,
context _unpinoption _text : "Fjern note" ,
popout _pinoption _text : "Noter" ,
toast _noteadd _text : "Meddelelse tilføjet til notesbog." ,
toast _noteupdate _text : "Meddelelse opdateret i den notesbog." ,
toast _noteremove _text : "Meddelelse fjernet fra notesbog."
} ;
case "de" : //german
return {
popout _note _text : "Notizen" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Alle Server" ,
popout _sort _messagetime _text : "Nachrichten-Datum" ,
popout _sort _notetime _text : "Notiz-Datum" ,
context _pinoption _text : "Nachricht notieren" ,
context _updateoption _text : "Notiz aktualisieren" ,
context _unpinoption _text : "Notiz entfernen" ,
popout _pinoption _text : "Notieren" ,
toast _noteadd _text : "Nachricht zum Notizbuch hinzugefügt." ,
toast _noteupdate _text : "Nachricht im Notizbuch aktualisiert." ,
toast _noteremove _text : "Nachricht aus dem Notizbuch entfernt."
} ;
case "es" : //spanish
return {
popout _note _text : "Notas" ,
popout _filter _channel _text : "Canal" ,
popout _filter _server _text : "Servidor" ,
popout _filter _all _text : "Todos los servidores" ,
popout _sort _messagetime _text : "Mensaje-Fecha" ,
popout _sort _notetime _text : "Nota-Fecha" ,
context _pinoption _text : "Anotar mensaje" ,
context _updateoption _text : "Actualiza la nota" ,
context _unpinoption _text : "Eliminar la nota" ,
popout _pinoption _text : "Anotar" ,
toast _noteadd _text : "Mensaje agregado al cuaderno." ,
toast _noteupdate _text : "Mensaje actualizado en el cuaderno." ,
toast _noteremove _text : "Mensaje eliminado del cuaderno."
} ;
case "fr" : //french
return {
popout _note _text : "Notes" ,
popout _filter _channel _text : "Canal" ,
popout _filter _server _text : "Serveur" ,
popout _filter _all _text : "Tous les serveurs" ,
popout _sort _messagetime _text : "Message-Date" ,
popout _sort _notetime _text : "Note-Date" ,
context _pinoption _text : "Noter le message" ,
context _updateoption _text : "Mettre à jour la note" ,
context _unpinoption _text : "Enlevez la note" ,
popout _pinoption _text : "Noter" ,
toast _noteadd _text : "Message ajouté au cahier." ,
toast _noteupdate _text : "Message mis à jour dans le cahier." ,
toast _noteremove _text : "Message supprimé du cahier."
} ;
case "it" : //italian
return {
popout _note _text : "Note" ,
popout _filter _channel _text : "Canale" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Tutti i server" ,
popout _sort _messagetime _text : "Messaggio-Data" ,
popout _sort _notetime _text : "Nota-Data" ,
context _pinoption _text : "Annotare il messaggio" ,
context _updateoption _text : "Aggiorna la nota" ,
context _unpinoption _text : "Rimuovi la nota" ,
popout _pinoption _text : "Annotare" ,
toast _noteadd _text : "Messaggio aggiunto al blocco note." ,
toast _noteupdate _text : "Messaggio aggiornato nel blocco note." ,
toast _noteremove _text : "Messaggio rimosso dal blocco note."
} ;
case "nl" : //dutch
return {
popout _note _text : "Notities" ,
popout _filter _channel _text : "Kanaal" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Alle servers" ,
popout _sort _messagetime _text : "Bericht-Datum" ,
popout _sort _notetime _text : "Notitie-Datum" ,
context _pinoption _text : "Noteer bericht" ,
context _updateoption _text : "Update de notitie" ,
context _unpinoption _text : "Verwijder de notitie" ,
popout _pinoption _text : "Noteer" ,
toast _noteadd _text : "Bericht toegevoegd aan notitieblok." ,
toast _noteupdate _text : "Bericht bijgewerkt in het notitieblok." ,
toast _noteremove _text : "Bericht verwijderd van notitieblok."
} ;
case "no" : //norwegian
return {
popout _note _text : "Notatene" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Alle servere" ,
popout _sort _messagetime _text : "Melding-Dato" ,
popout _sort _notetime _text : "Merknad-Dato" ,
context _pinoption _text : "Notat ned meldingen" ,
context _updateoption _text : "Oppdater notatet" ,
context _unpinoption _text : "Fjern notatet" ,
popout _pinoption _text : "Notere" ,
toast _noteadd _text : "Melding lagt til i notisboken." ,
toast _noteupdate _text : "Melding oppdatert i notisbok." ,
toast _noteremove _text : "Melding fjernet fra notatboken."
} ;
case "pl" : //polish
return {
popout _note _text : "Notatki" ,
popout _filter _channel _text : "Kanał" ,
popout _filter _server _text : "Serwer" ,
popout _filter _all _text : "Wszystkie serwery" ,
popout _sort _messagetime _text : "Wiadomość-Data" ,
popout _sort _notetime _text : "Notatka-Data" ,
context _pinoption _text : "Notuj wiadomość" ,
context _updateoption _text : "Zaktualizuj notatkę" ,
context _unpinoption _text : "Usuń notatkę" ,
popout _pinoption _text : "Notuj" ,
toast _noteadd _text : "Wiadomość została dodana do notatnika." ,
toast _noteupdate _text : "Wiadomość zaktualizowana w notatniku." ,
toast _noteremove _text : "Wiadomość została usunięta z notatnika."
} ;
case "pt-BR" : //portuguese (brazil)
return {
popout _note _text : "Notas" ,
popout _filter _channel _text : "Canal" ,
popout _filter _server _text : "Servidor" ,
popout _filter _all _text : "Todos os servidores" ,
popout _sort _messagetime _text : "Mensagem-Data" ,
popout _sort _notetime _text : "Nota-Data" ,
context _pinoption _text : "Anote a mensagem" ,
context _updateoption _text : "Atualize a nota" ,
context _unpinoption _text : "Remova a nota" ,
popout _pinoption _text : "Anotar" ,
toast _noteadd _text : "Mensagem adicionada ao caderno." ,
toast _noteupdate _text : "Mensagem atualizada no caderno." ,
toast _noteremove _text : "Mensagem removida do caderno."
} ;
case "fi" : //finnish
return {
popout _note _text : "Muistiinpanot" ,
popout _filter _channel _text : "Kanava" ,
popout _filter _server _text : "Palvelin" ,
popout _filter _all _text : "Kaikki palvelimet" ,
popout _sort _messagetime _text : "Viesti-Päivämäärä" ,
popout _sort _notetime _text : "Huomaa-Päivämäärä" ,
context _pinoption _text : "Huomaa viesti" ,
context _updateoption _text : "Päivitä muistiinpano" ,
context _unpinoption _text : "Poista muistiinpano" ,
popout _pinoption _text : "Huomaa" ,
toast _noteadd _text : "Viesti lisätty muistikirjaan." ,
toast _noteupdate _text : "Viesti päivitetty muistikirjaan." ,
toast _noteremove _text : "Viesti poistettiin muistikirjaan."
} ;
case "sv" : //swedish
return {
popout _note _text : "Anteckningarna" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Alla servrar" ,
popout _sort _messagetime _text : "Meddelande-Datum" ,
popout _sort _notetime _text : "Anteckningen-Datum" ,
context _pinoption _text : "Anteckna meddelande" ,
context _updateoption _text : "Uppdatera noten" ,
context _unpinoption _text : "Ta bort noten" ,
popout _pinoption _text : "Anteckna" ,
toast _noteadd _text : "Meddelandet läggs till i anteckningsboken." ,
toast _noteupdate _text : "Meddelandet uppdateras i anteckningsboken." ,
toast _noteremove _text : "Meddelande borttaget från anteckningsboken."
} ;
case "tr" : //turkish
return {
popout _note _text : "Notlar" ,
popout _filter _channel _text : "Kanal" ,
popout _filter _server _text : "Sunucu" ,
popout _filter _all _text : "Tüm Sunucular" ,
popout _sort _messagetime _text : "Mesaj-Tarih" ,
popout _sort _notetime _text : "Not-Tarih" ,
context _pinoption _text : "Mesajı not alı n" ,
context _updateoption _text : "Notu güncelle" ,
context _unpinoption _text : "Notu kaldı rmak" ,
popout _pinoption _text : "Not almak" ,
toast _noteadd _text : "Mesaj not defteri'ya eklendi." ,
toast _noteupdate _text : "Mesaj defterde güncellendi." ,
toast _noteremove _text : "Mesaj not defteri'dan kaldı rı ldı ."
} ;
case "cs" : //czech
return {
popout _note _text : "Poznámky" ,
popout _filter _channel _text : "Kanál" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "Všechny servery" ,
popout _sort _messagetime _text : "Zpráva-datum" ,
popout _sort _notetime _text : "Poznámka-datum" ,
context _pinoption _text : "Poznámka dolů zprávu" ,
context _updateoption _text : "Aktualizujte poznámku" ,
context _unpinoption _text : "Odstraňte poznámku" ,
popout _pinoption _text : "Poznámka dolů" ,
toast _noteadd _text : "Zpráva byla přidána do notebooku." ,
toast _noteupdate _text : "Zpráva byla v notebooku aktualizována." ,
toast _noteremove _text : "Zpráva byla odebrána z notebooku."
} ;
case "bg" : //bulgarian
return {
popout _note _text : "бележките" ,
popout _filter _channel _text : "Канал" ,
popout _filter _server _text : "Сървър" ,
popout _filter _all _text : "Всички сървъри" ,
popout _sort _messagetime _text : "Съобщение-Дата" ,
popout _sort _notetime _text : "Забележка-Дата" ,
context _pinoption _text : "Oтб е ле же те съобщението" ,
context _updateoption _text : "Актуализирайте бележката" ,
context _unpinoption _text : "Премахнете бележката" ,
popout _pinoption _text : "Oтб е ле же те " ,
toast _noteadd _text : "Съобщението б е добавено към бележника." ,
toast _noteupdate _text : "Съобщението е актуализирано в бележника." ,
toast _noteremove _text : "Съобщението е премахнато от преносимия бележника."
} ;
case "ru" : //russian
return {
popout _note _text : "Заметки" ,
popout _filter _channel _text : "Канал" ,
popout _filter _server _text : "Cе р ве р " ,
popout _filter _all _text : "В с е серверы" ,
popout _sort _messagetime _text : "Сообщение-дата" ,
popout _sort _notetime _text : "Заметки-Дата" ,
context _pinoption _text : "Записывать вниз" ,
context _updateoption _text : "Обновить заметку" ,
context _unpinoption _text : "Удалить заметку" ,
popout _pinoption _text : "Записывать" ,
toast _noteadd _text : "Сообщение добавлено в блокнот." ,
toast _noteupdate _text : "Сообщение обновлено в записной блокнот." ,
toast _noteremove _text : "Сообщение удалено из записной блокнот."
} ;
case "uk" : //ukrainian
return {
popout _note _text : "Замітки" ,
popout _filter _channel _text : "Канал" ,
popout _filter _server _text : "Сервер" ,
popout _filter _all _text : "В с і сервери" ,
popout _sort _messagetime _text : "Повідомлення-дата" ,
popout _sort _notetime _text : "Примітка-дата" ,
context _pinoption _text : "Зверніть увагу на повідомлення" ,
context _updateoption _text : "Оновіть нотатку" ,
context _unpinoption _text : "Видаліть нотатку" ,
popout _pinoption _text : "Занотуйте" ,
toast _noteadd _text : "Повідомлення додається до ноутбука." ,
toast _noteupdate _text : "Повідомлення оновлено в ноутбука." ,
toast _noteremove _text : "Повідомлення видалено з ноутбука."
} ;
case "ja" : //japanese
return {
popout _note _text : "ノート" ,
popout _filter _channel _text : "チャネル" ,
popout _filter _server _text : "サーバ" ,
popout _filter _all _text : "すべてのサーバー" ,
popout _sort _messagetime _text : "メッセージ-日付" ,
popout _sort _notetime _text : "注-日付" ,
context _pinoption _text : "ノートダウンメッセージ" ,
context _updateoption _text : "メモを更新する" ,
context _unpinoption _text : "メモを削除" ,
popout _pinoption _text : "書き留める" ,
toast _noteadd _text : "ノートブックにメッセージが追加されました." ,
toast _noteupdate _text : "ノートブックで更新されたメッセージ." ,
toast _noteremove _text : "ノートブックからメッセージが削除されました."
} ;
case "zh-TW" : //chinese (traditional)
return {
popout _note _text : "筆記" ,
popout _filter _channel _text : "渠道" ,
popout _filter _server _text : "服務器" ,
popout _filter _all _text : "所有服務器" ,
popout _sort _messagetime _text : "消息-日期" ,
popout _sort _notetime _text : "注-日期" ,
context _pinoption _text : "記下下來的消息" ,
context _updateoption _text : "更新說明" ,
context _unpinoption _text : "刪除備註" ,
popout _pinoption _text : "記下" ,
toast _noteadd _text : "消息添加到筆記本." ,
toast _noteupdate _text : "消息在筆記本中更新." ,
toast _noteremove _text : "消息從筆記本中刪除."
} ;
case "ko" : //korean
return {
popout _note _text : "노트" ,
popout _filter _channel _text : "채널" ,
popout _filter _server _text : "섬기는 사람" ,
popout _filter _all _text : "모든 서버" ,
popout _sort _messagetime _text : "메시지-날짜" ,
popout _sort _notetime _text : "주-날짜" ,
context _pinoption _text : "메모 다운 메시지" ,
context _updateoption _text : "메모 업데이트" ,
context _unpinoption _text : "메모 삭제" ,
popout _pinoption _text : "메모하다" ,
toast _noteadd _text : "노트북에 메시지 추가됨." ,
toast _noteupdate _text : "노트북에서 메시지가 업데이트되었습니다." ,
toast _noteremove _text : "노트에서 메시지 삭제됨."
} ;
default : //default: english
return {
popout _note _text : "Notes" ,
popout _filter _channel _text : "Channel" ,
popout _filter _server _text : "Server" ,
popout _filter _all _text : "All Servers" ,
popout _sort _messagetime _text : "Message-Date" ,
popout _sort _notetime _text : "Note-Date" ,
context _pinoption _text : "Note Message" ,
context _updateoption _text : "Update Note" ,
context _unpinoption _text : "Remove Note" ,
popout _pinoption _text : "Note" ,
toast _noteadd _text : "Message added to notebook." ,
toast _noteupdate _text : "Message updated in the notebook." ,
toast _noteremove _text : "Message removed from notebook."
} ;
}
2020-02-04 08:20:40 +01:00
}
2020-09-19 20:49:33 +02:00
} ;
} ) ( window . BDFDB _Global . PluginUtils . buildPlugin ( config ) ) ;
} ) ( ) ;