2018-10-11 10:21:26 +02:00
module . exports = ( Plugin , Api , Vendor ) => {
if ( typeof BDFDB !== "object" ) global . BDFDB = { $ : Vendor . $ , BDv2Api : Api } ;
const { $ } = Vendor ;
return class extends Plugin {
initConstructor ( ) {
this . labels = { } ;
this . messageContextEntryMarkup =
` <div class=" ${ BDFDB . disCN . contextmenuitemgroup } ">
< div class = "${BDFDB.disCN.contextmenuitem} personalpin-item" >
2019-01-02 22:08:55 +01:00
< span class = "DevilBro-textscrollwrapper" speed = 3 > < div class = "DevilBro-textscroll" > REPLACE _context _noteoption _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< / d i v > ` ;
this . notesButton =
` <svg class=" ${ BDFDB . disCNS . channelheadericoninactive + BDFDB . disCNS . channelheadericon + BDFDB . disCN . channelheadericonmargin } notesButton" name="Note" width="16" height="16" viewBox="0 0 26 26">
< g fill = "none" fill - rule = "evenodd" transform = "translate(3,2)" >
< path class = "${BDFDB.disCN.channelheadericonforeground}" 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 class = "${BDFDB.disCN.channelheadericonforeground}" 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 class = "${BDFDB.disCN.channelheadericonforeground}" 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 class = "${BDFDB.disCN.channelheadericonforeground}" 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 class = "${BDFDB.disCN.channelheadericonforeground}" 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 >
< / s v g > ` ;
this . notesPopoutMarkup =
` <div class=" ${ BDFDB . disCNS . popout + BDFDB . disCNS . popoutbottomright + BDFDB . disCNS . popoutnoarrow + BDFDB . disCN . popoutnoshadow } popout-personalpins-notes DevilBro-modal" style="z-index: 1000; visibility: visible; left: 544.844px; top: 35.9896px; transform: translateX(-100%) translateY(0%) translateZ(0px);">
< div class = "${BDFDB.disCNS.messagespopoutwrap + BDFDB.disCNS.recentmentionspopout + BDFDB.disCN.popoutthemedpopout}" style = "max-height: 740px; width: 500px;" >
< div class = "${BDFDB.disCNS.recentmentionsheader + BDFDB.disCNS.recentmentionsheader2 + BDFDB.disCN.messagespopoutheader}" style = "padding-bottom: 0;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.margintop8}" style = "flex: 0 0 auto;" >
< div class = "${BDFDB.disCNS.recentmentionstitle + BDFDB.disCN.messagespopouttitle}" > REPLACE _popout _note _text < / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCNS.searchbar + BDFDB.disCN.size14}" style = "flex: 1 1 auto;" >
< input class = "${BDFDB.disCNS.searchbarinput + BDFDB.disCN.flexchild}" value = "" placeholder = "Search for ..." style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.searchbariconwrap + BDFDB.disCN.flexchild}" >
< i class = "${BDFDB.disCNS.searchbaricon + BDFDB.disCNS.searchbareyeglass + BDFDB.disCN.searchbarvisible}" / >
< i class = "${BDFDB.disCNS.searchbaricon + BDFDB.disCN.searchbarclear}" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.margintop8}" style = "flex: 0 0 auto;" >
< div tab = "channel" class = "tab" > REPLACE _popout _channel _text < / d i v >
< div tab = "server" class = "tab" > REPLACE _popout _server _text < / d i v >
< div tab = "allservers" class = "tab" > REPLACE _popout _allservers _text < / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.quickselect}" style = "padding-bottom: 15px; float:right;" >
< div class = "${BDFDB.disCN.quickselectlabel}" > REPLACE _popout _sort _text : < / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.quickselectclick}" style = "flex: 0 0 auto;" >
< div option = "timestamp" class = "${BDFDB.disCN.quickselectvalue}" > REPLACE _popout _messagesort _text < / d i v >
< div class = "${BDFDB.disCN.quickselectarrow}" > < / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCN.scrollerwrap}" >
< div class = "${BDFDB.disCNS.messagespopout + BDFDB.disCN.scroller}" >
< div class = "${BDFDB.disCN.messagespopoutemptyplaceholder}" >
< div class = "${BDFDB.disCN.messagespopoutimage}" style = "background-image: url(/assets/6793e022dc1b065b21f12d6df02f91bd.svg);" > < / d i v >
< div class = "${BDFDB.disCN.messagespopoutbody}" > < / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v > ` ;
this . sortPopoutMarkup =
` <div class=" ${ BDFDB . disCNS . popout + BDFDB . disCNS . popoutbottomright + BDFDB . disCN . popoutnoshadow } personalpins-sort-popout" style="z-index: 1100; visibility: visible; transform: translateX(-100%) translateY(0%) translateZ(0px);">
< div >
< div class = "${BDFDB.disCN.contextmenu} quickSelectPopout" >
< div class = "${BDFDB.disCN.contextmenuitemgroup}" >
< div option = "timestamp" class = "${BDFDB.disCN.contextmenuitem}" > REPLACE _popout _messagesort _text < / d i v >
< div option = "addedat" class = "${BDFDB.disCN.contextmenuitem}" > REPLACE _popout _datesort _text < / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v > ` ;
this . optionButtonMarkup =
` <div class=" ${ BDFDB . disCN . optionpopoutbutton } btn-personalpins"></div> ` ;
this . optionsPopoutMarkup =
` <div class=" ${ BDFDB . disCNS . popout + BDFDB . disCNS . popoutbottom + BDFDB . disCN . popoutnoarrow } popout-personalpins-options" style="z-index: 1000; visibility: visible;">
< div class = "${BDFDB.disCN.optionpopout}" > < / d i v
< / d i v > ` ;
this . popoutEntryMarkup =
` <div class=" ${ BDFDB . disCNS . optionpopoutitem + BDFDB . disCN . weightmedium } btn-item-personalpins">REPLACE_popout_noteoption_text</div> ` ;
this . messageMarkup =
` <div class=" ${ BDFDB . disCNS . messagegroup + BDFDB . disCN . messagehideoverflow } ">
< div class = "${BDFDB.disCN.avatarlargeold}" > < / d i v >
< div class = "${BDFDB.disCN.messagecomment}" >
< div class = "${BDFDB.disCNS.message + BDFDB.disCN.messagefirst}" >
< div class = "${BDFDB.disCN.messagebody}" >
< h2 class = "${BDFDB.disCN.h2old}" >
< span class = "${BDFDB.disCN.messageusernamewrapper}" > < strong class = "${BDFDB.disCN.messageusername}" > < / s t r o n g > < / s p a n >
< span class = "${BDFDB.disCN.messagehighlightseparator}" > - < / s p a n >
< span class = "${BDFDB.disCN.messagetimestamp}" > < / s p a n >
< / h 2 >
< div class = "${BDFDB.disCN.messagetext}" >
< div class = "${BDFDB.disCN.messagemarkup}" style = "width: 380px;" > < / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCN.messageaccessory}" > < / d i v >
< div class = "${BDFDB.disCNS.description + BDFDB.disCNS.formtext + BDFDB.disCNS.note + BDFDB.disCNS.margintop4 + BDFDB.disCNS.modedefault + BDFDB.disCN.primary} server-channel" > < / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.sinkinteractions + BDFDB.disCN.clickable}" > < / d i v >
< div class = "${BDFDB.disCN.messagespopoutactionbuttons}" >
< div class = "${BDFDB.disCN.messagespopoutjumpbutton} jump" > < div class = "${BDFDB.disCN.messagespopouttext}" > REPLACE _popout _jump _text < / d i v > < / d i v >
< div class = "${BDFDB.disCN.messagespopoutjumpbutton} copy" > < div class = "${BDFDB.disCN.messagespopouttext}" > REPLACE _popout _copy _text < / d i v > < / d i v >
< div class = "${BDFDB.disCN.messagespopoutclosebutton}" > < / d i v >
< / d i v >
< / d i v > ` ;
}
onStart ( ) {
var libraryScript = null ;
if ( typeof BDFDB !== "object" || typeof BDFDB . isLibraryOutdated !== "function" || BDFDB . isLibraryOutdated ( ) ) {
libraryScript = document . querySelector ( 'head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]' ) ;
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js" ) ;
document . head . appendChild ( libraryScript ) ;
}
this . startTimeout = setTimeout ( ( ) => { this . initialize ( ) ; } , 30000 ) ;
if ( typeof BDFDB === "object" && typeof BDFDB . isLibraryOutdated === "function" ) this . initialize ( ) ;
else libraryScript . addEventListener ( "load" , ( ) => { this . initialize ( ) ; } ) ;
return true ;
}
initialize ( ) {
if ( typeof BDFDB === "object" ) {
BDFDB . loadMessage ( this ) ;
2018-12-20 22:54:42 +01:00
this . GuildStore = BDFDB . WebModules . findByProperties ( "getGuild" ) ;
this . ChannelStore = BDFDB . WebModules . findByProperties ( "getChannel" ) ;
this . UserStore = BDFDB . WebModules . findByProperties ( "getUser" ) ;
this . MemberStore = BDFDB . WebModules . findByProperties ( "getMember" ) ;
this . IconUtils = BDFDB . WebModules . findByProperties ( "getUserAvatarURL" ) ;
this . HistoryUtils = BDFDB . WebModules . findByProperties ( "transitionTo" , "replaceWith" , "getHistory" ) ;
this . MainDiscord = BDFDB . WebModules . findByProperties ( "ActionTypes" ) ;
2018-10-11 10:21:26 +02:00
var observer = null ;
observer = new MutationObserver ( ( changes , _ ) => {
changes . forEach (
( change , i ) => {
if ( change . addedNodes ) {
change . addedNodes . forEach ( ( node ) => {
if ( node . nodeType == 1 && node . className . includes ( BDFDB . disCN . contextmenu ) ) {
this . onContextMenu ( node ) ;
}
} ) ;
}
}
) ;
} ) ;
BDFDB . addObserver ( this , BDFDB . dotCN . appmount , { name : "messageContextObserver" , instance : observer } , { childList : true } ) ;
observer = new MutationObserver ( ( changes , _ ) => {
changes . forEach (
( change , i ) => {
if ( change . addedNodes ) {
change . addedNodes . forEach ( ( node ) => {
if ( node && node . tagName && node . classList && node . classList . contains ( BDFDB . disCN . messagegroup ) ) {
node . querySelectorAll ( BDFDB . dotCN . message ) . forEach ( message => { this . addOptionButton ( message ) ; } ) ;
}
else if ( node && node . tagName && node . classList && node . classList . contains ( BDFDB . disCN . message ) ) {
this . addOptionButton ( node ) ;
}
} ) ;
}
}
) ;
} ) ;
BDFDB . addObserver ( this , BDFDB . dotCN . messages , { name : "chatWindowObserver" , instance : observer } , { childList : true , subtree : true } ) ;
observer = new MutationObserver ( ( changes , _ ) => {
changes . forEach (
( change , i ) => {
if ( change . addedNodes ) {
change . addedNodes . forEach ( ( node ) => {
if ( node && node . tagName && node . querySelector ( BDFDB . dotCN . optionpopout ) && ! node . querySelector ( ".btn-item-personalpins" ) ) {
$ ( node ) . find ( BDFDB . dotCN . optionpopout ) . append ( this . popoutEntryMarkup ) ;
this . addClickListener ( node ) ;
}
} ) ;
}
}
) ;
} ) ;
BDFDB . addObserver ( this , BDFDB . dotCN . popouts , { name : "optionPopoutObserver" , instance : observer } , { childList : true } ) ;
$ ( document ) . off ( "click." + this . name , BDFDB . dotCN . optionpopoutbutton ) . off ( "contextmenu." + this . name , BDFDB . dotCN . message )
. on ( "click." + this . name , BDFDB . dotCN . optionpopoutbutton , ( e ) => {
this . getMessageData ( $ ( BDFDB . dotCN . message ) . has ( e . currentTarget ) [ 0 ] ) ;
} )
. on ( "contextmenu." + this . name , BDFDB . dotCN . message , ( e ) => {
this . getMessageData ( e . currentTarget ) ;
} ) ;
document . querySelectorAll ( BDFDB . dotCNS . messagegroup + BDFDB . dotCN . message ) . forEach ( message => { this . addOptionButton ( message ) ; } ) ;
this . addNotesButton ( ) ;
return true ;
}
else {
console . error ( this . name + ": Fatal Error: Could not load BD functions!" ) ;
return false ;
}
}
onStop ( ) {
if ( typeof BDFDB === "object" ) {
$ ( document ) . off ( "click." + this . name , BDFDB . dotCN . optionpopoutbutton ) . off ( "contextmenu." + this . name , BDFDB . dotCN . message ) ;
$ ( ".btn-personalpins, .notesButton" ) . remove ( ) ;
BDFDB . unloadMessage ( this ) ;
return true ;
}
else {
return false ;
}
}
onSwitch ( ) {
if ( typeof BDFDB === "object" ) {
BDFDB . addObserver ( this , BDFDB . dotCN . messages , { name : "chatWindowObserver" } , { childList : true , subtree : true } ) ;
document . querySelectorAll ( BDFDB . dotCNS . messages + BDFDB . dotCN . message ) . forEach ( message => { this . addOptionButton ( message ) ; } ) ;
setTimeout ( ( ) => {
this . addNotesButton ( ) ;
} , 1 ) ;
}
}
// begin of own functions
resetAll ( ) {
if ( confirm ( "Are you sure you want to delete all pinned notes?" ) ) {
BDFDB . removeAllData ( this , "pins" ) ;
}
}
changeLanguageStrings ( ) {
this . messageContextEntryMarkup = this . messageContextEntryMarkup . replace ( "REPLACE_context_noteoption_text" , this . labels . context _noteoption _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_note_text" , this . labels . popout _note _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_channel_text" , this . labels . popout _channel _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_server_text" , this . labels . popout _server _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_allservers_text" , this . labels . popout _allservers _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_sort_text" , this . labels . popout _sort _text ) ;
this . notesPopoutMarkup = this . notesPopoutMarkup . replace ( "REPLACE_popout_messagesort_text" , this . labels . popout _messagesort _text ) ;
this . messageMarkup = this . messageMarkup . replace ( "REPLACE_popout_jump_text" , this . labels . popout _jump _text ) ;
this . messageMarkup = this . messageMarkup . replace ( "REPLACE_popout_copy_text" , this . labels . popout _copy _text ) ;
this . sortPopoutMarkup = this . sortPopoutMarkup . replace ( "REPLACE_popout_messagesort_text" , this . labels . popout _messagesort _text ) ;
this . sortPopoutMarkup = this . sortPopoutMarkup . replace ( "REPLACE_popout_datesort_text" , this . labels . popout _datesort _text ) ;
this . popoutEntryMarkup = this . popoutEntryMarkup . replace ( "REPLACE_popout_noteoption_text" , this . labels . popout _noteoption _text ) ;
}
onContextMenu ( context ) {
if ( ! context || ! context . tagName || ! context . parentElement || context . querySelector ( ".personalpin-item" ) ) return ;
for ( let group of context . querySelectorAll ( BDFDB . dotCN . contextmenuitemgroup ) ) {
if ( BDFDB . getKeyInformation ( { "node" : group , "key" : "displayName" , "value" : "MessagePinItem" } ) ) {
$ ( this . messageContextEntryMarkup ) . insertAfter ( group )
. on ( "click" , ".personalpin-item" , ( ) => {
$ ( context ) . hide ( ) ;
this . addMessageToNotes ( ) ;
} ) ;
BDFDB . updateContextPosition ( context ) ;
break ;
}
}
}
getMessageData ( div ) {
if ( div && ! div . querySelector ( BDFDB . dotCN . messagesystem ) ) {
var messagegroup = $ ( BDFDB . dotCN . messagegroup ) . has ( div ) ;
var pos = messagegroup . find ( BDFDB . dotCN . message ) . index ( div ) ;
if ( messagegroup [ 0 ] && pos > - 1 ) {
var info = BDFDB . getKeyInformation ( { "node" : div , "key" : "messages" , "up" : true , "time" : 1000 } ) ;
if ( info ) this . message = Object . assign ( { } , info [ pos ] , { "div" : div , "group" : messagegroup [ 0 ] , "pos" : pos } ) ;
}
}
else {
this . message = null ;
}
}
addNotesButton ( ) {
$ ( ".notesButton" ) . remove ( ) ;
$ ( this . notesButton )
. insertBefore ( $ ( BDFDB . dotCN . channelheadericoninactive ) . parent ( ) . find ( BDFDB . dotCN . channelheadersearch ) )
. on ( "click." + this . name , ( e ) => {
this . openNotesPopout ( e ) ;
} )
. on ( "mouseenter." + this . name , ( e ) => {
BDFDB . createTooltip ( this . labels . popout _note _text , e . currentTarget , { type : "bottom" , selector : "note-button-tooltip" } ) ;
} ) ;
}
addOptionButton ( message ) {
if ( ! message . querySelector ( BDFDB . dotCN . optionpopoutbutton ) && ! message . querySelector ( BDFDB . dotCN . messagesystem ) && ! message . querySelector ( BDFDB . dotCN . messageuploadcancel ) ) {
$ ( this . optionButtonMarkup ) . insertBefore ( message . querySelector ( BDFDB . dotCN . messagetext ) . firstChild ) ;
$ ( message ) . off ( "click." + this . name ) . on ( "click." + this . name , ".btn-personalpins" , ( e ) => {
this . openOptionPopout ( e ) ;
} ) ;
}
}
openNotesPopout ( e ) {
var wrapper = e . currentTarget ;
if ( wrapper . classList . contains ( "popout-open" ) ) return ;
wrapper . classList . add ( "popout-open" ) ;
var popout = $ ( this . notesPopoutMarkup ) ;
BDFDB . initElements ( popout ) ;
var wrappersize = wrapper . getBoundingClientRect ( ) ;
popout
. appendTo ( BDFDB . dotCN . popouts )
. css ( "left" , wrappersize . width / 2 + wrappersize . left + "px" )
. css ( "top" , wrappersize . height + wrappersize . top + "px" )
. on ( "click" , ".tab" , ( ) => {
this . addNotes ( popout [ 0 ] ) ;
} )
. on ( "keyup." + this . name , BDFDB . dotCN . searchbarinput , ( ) => {
clearTimeout ( popout . searchTimeout ) ;
popout . searchTimeout = setTimeout ( ( ) => { this . addNotes ( popout [ 0 ] ) ; } , 1000 ) ;
} )
. on ( "click." + this . name , BDFDB . dotCN . searchbarclear + BDFDB . dotCN . searchbarvisible , ( ) => {
clearTimeout ( popout . searchTimeout ) ;
popout . searchTimeout = setTimeout ( ( ) => { this . addNotes ( popout [ 0 ] ) ; } , 1000 ) ;
} )
. on ( "click" , BDFDB . dotCN . quickselectclick , ( e2 ) => {
this . openSortPopout ( e2 , popout [ 0 ] ) ;
} ) ;
$ ( document ) . on ( "mousedown.notepopout" + this . name , ( e2 ) => {
if ( popout . has ( e2 . target ) . length == 0 && $ ( ".personalpins-sort-popout" ) . has ( e2 . target ) . length == 0 ) {
$ ( document ) . off ( "mousedown.notepopout" + this . name ) ;
popout . remove ( ) ;
setTimeout ( ( ) => { wrapper . classList . remove ( "popout-open" ) ; } , 300 ) ;
}
} ) ;
this . addNotes ( popout [ 0 ] ) ;
}
openSortPopout ( e , notespopout ) {
var wrapper = e . currentTarget ;
if ( wrapper . classList . contains ( "popout-open" ) ) return ;
wrapper . classList . add ( "popout-open" ) ;
var value = $ ( wrapper ) . find ( BDFDB . dotCN . quickselectvalue ) ;
var popout = $ ( this . sortPopoutMarkup ) ;
$ ( BDFDB . dotCN . popouts ) . append ( popout )
. off ( "click" , BDFDB . dotCN . contextmenuitem )
. on ( "click" , BDFDB . dotCN . contextmenuitem , ( e2 ) => {
value . text ( $ ( e2 . currentTarget ) . text ( ) ) ;
value . attr ( "option" , $ ( e2 . currentTarget ) . attr ( "option" ) ) ;
$ ( document ) . off ( "mousedown.sortpopout" + this . name ) ;
popout . remove ( ) ;
setTimeout ( ( ) => { wrapper . classList . remove ( "popout-open" ) ; } , 300 ) ;
this . addNotes ( notespopout ) ;
} ) ;
popout
. css ( "left" , $ ( e . currentTarget ) . offset ( ) . left + $ ( e . currentTarget ) . outerWidth ( ) + "px" )
. css ( "top" , $ ( e . currentTarget ) . offset ( ) . top + value . outerHeight ( ) + "px" )
. find ( BDFDB . dotCN . contextmenu ) . addClass ( BDFDB . getDiscordTheme ( ) ) ;
$ ( document ) . on ( "mousedown.sortpopout" + this . name , ( e2 ) => {
if ( popout . has ( e2 . target ) . length == 0 ) {
$ ( document ) . off ( "mousedown.sortpopout" + this . name ) ;
popout . remove ( ) ;
setTimeout ( ( ) => { wrapper . classList . remove ( "popout-open" ) ; } , 300 ) ;
}
} ) ;
}
openOptionPopout ( e ) {
var wrapper = e . currentTarget ;
if ( wrapper . classList . contains ( BDFDB . disCN . optionpopoutopen ) ) return ;
wrapper . classList . add ( BDFDB . disCN . optionpopoutopen ) ;
var popout = $ ( this . optionsPopoutMarkup ) ;
$ ( BDFDB . dotCN . popouts ) . append ( popout ) ;
$ ( popout ) . find ( BDFDB . dotCN . optionpopout ) . append ( this . popoutEntryMarkup ) ;
this . addClickListener ( popout ) ;
popout
. css ( "left" , e . pageX - ( $ ( popout ) . outerWidth ( ) / 2 ) + "px" )
. css ( "top" , e . pageY + "px" ) ;
$ ( document ) . on ( "mousedown.optionpopout" + this . name , ( e2 ) => {
if ( popout . has ( e2 . target ) . length == 0 ) {
$ ( document ) . off ( "mousedown.optionpopout" + this . name ) ;
popout . remove ( ) ;
setTimeout ( ( ) => { wrapper . classList . remove ( BDFDB . disCN . optionpopoutopen ) ; } , 300 ) ;
}
} ) ;
}
addClickListener ( popout ) {
$ ( popout )
. off ( "click." + this . name , ".btn-item-personalpins" )
. on ( "click." + this . name , ".btn-item-personalpins" , ( e ) => {
$ ( BDFDB . dotCN . popout ) . has ( BDFDB . dotCN . optionpopout ) . hide ( ) ;
this . addMessageToNotes ( ) ;
var popoutbutton = document . querySelector ( BDFDB . dotCN . optionpopoutbutton + BDFDB . dotCN . optionpopoutopen ) ;
if ( popoutbutton ) popoutbutton . classList . remove ( BDFDB . disCN . optionpopoutopen ) ;
} ) ;
}
addMessageToNotes ( ) {
if ( ! this . message ) return ;
var channelObj = BDFDB . getSelectedChannel ( ) ;
var serverObj = BDFDB . getSelectedServer ( ) || { } ;
if ( this . message && channelObj ) {
var author = this . message . author ;
var channelID = channelObj . id ;
var serverID = serverObj . id ? serverObj . id : "@me" ;
var pins = BDFDB . loadAllData ( this , "pins" ) ;
pins [ serverID ] = pins [ serverID ] ? pins [ serverID ] : { }
pins [ serverID ] [ channelID ] = pins [ serverID ] [ channelID ] ? pins [ serverID ] [ channelID ] : { }
var messageID = this . message . id ;
var position = this . message . pos ;
var channelname = channelObj . name ;
if ( ! channelname && channelObj . recipients . length > 0 ) {
for ( let dmmemberID of channelObj . recipients ) {
channelname = channelname ? channelname + ", @" : channelname ;
channelname = channelname + this . UserStore . getUser ( dmmemberID ) . username ;
}
}
var markup = this . message . div . querySelector ( BDFDB . dotCN . messagecontent ) || this . message . div . querySelector ( BDFDB . dotCN . messagemarkup ) ;
var message = {
"serverID" : serverID ,
"serverName" : serverObj . name ? serverObj . name : "Direct Messages" ,
"channelID" : channelID ,
"channelName" : channelname ,
"id" : messageID ,
"pos" : position ,
"timestamp" : this . message . timestamp . _i . getTime ( ) ,
"addedat" : new Date ( ) . getTime ( ) ,
"color" : this . message . colorString ,
"authorID" : author . id ,
"authorName" : author . username ,
"avatar" : this . IconUtils . getUserAvatarURL ( author ) ,
"content" : this . message . content ,
"markup" : markup . innerHTML ,
"accessory" : this . message . div . querySelector ( BDFDB . dotCN . messageaccessory ) . innerHTML
} ;
pins [ serverID ] [ channelID ] [ messageID + "_" + position ] = message ;
BDFDB . saveAllData ( pins , this , "pins" ) ;
BDFDB . showToast ( this . labels . toast _noteadd _text , { type : "success" } ) ;
}
this . message = null ;
}
addNotes ( notespopout ) {
notespopout . querySelectorAll ( BDFDB . dotCN . messagegroup ) . forEach ( message => { message . remove ( ) ; } ) ;
var channelObj = BDFDB . getSelectedChannel ( ) ;
if ( channelObj ) {
var serverID = channelObj . guild _id ? channelObj . guild _id : "@me" ;
var channelID = channelObj . id ;
var pins = BDFDB . loadAllData ( this , "pins" ) ;
if ( ! BDFDB . isObjectEmpty ( pins ) ) {
var language = BDFDB . getDiscordLanguage ( ) . id ;
var container = notespopout . querySelector ( BDFDB . dotCN . messagespopout ) ;
var placeholder = notespopout . querySelector ( BDFDB . dotCN . messagespopoutemptyplaceholder ) ;
var messages = { } ;
switch ( notespopout . querySelector ( ".tab.selected" ) . getAttribute ( "tab" ) ) {
case "channel" :
messages = pins [ serverID ] && pins [ serverID ] [ channelID ] ? pins [ serverID ] [ channelID ] : { } ;
break ;
case "server" :
if ( pins [ serverID ] ) for ( let channel in pins [ serverID ] ) messages = Object . assign ( messages , pins [ serverID ] [ channel ] ) ;
break ;
case "allservers" :
for ( let server in pins ) if ( pins [ server ] ) for ( let channel in pins [ server ] ) messages = Object . assign ( messages , pins [ server ] [ channel ] ) ;
break ;
}
var messageArray = [ ] ;
for ( var id in messages ) {
messageArray . push ( messages [ id ] ) ;
}
BDFDB . sortArrayByKey ( messageArray , notespopout . querySelector ( BDFDB . dotCN . quickselectvalue ) . getAttribute ( "option" ) ) ;
for ( let messageData of messageArray ) {
let message = $ ( this . messageMarkup ) [ 0 ] ;
let server = this . GuildStore . getGuild ( messageData . serverID ) ;
let channel = this . ChannelStore . getChannel ( messageData . channelID ) ;
let user = this . UserStore . getUser ( messageData . authorID ) ;
let member = this . MemberStore . getMember ( messageData . serverID , messageData . authorID ) ;
let date = new Date ( messageData . timestamp ) ;
container . insertBefore ( message , container . firstChild ) ;
message . querySelector ( BDFDB . dotCN . avatarlargeold ) . style . backgroundImage =
user ? "url(" + this . IconUtils . getUserAvatarURL ( user ) + ")" : "url(" + messageData . avatar + ")" ;
message . querySelector ( BDFDB . dotCN . messageusername ) . innerText = user ? user . username : messageData . authorName ;
message . querySelector ( BDFDB . dotCN . messageusername ) . style . color = member ? member . colorString : messageData . color ;
message . querySelector ( BDFDB . dotCN . messagetimestamp ) . innerText = date . toLocaleString ( language ) ;
message . querySelector ( ".server-channel" ) . innerText =
( server && server . name ? server . name : messageData . serverName ) +
( messageData . serverID == "@me" ? " @" : " #" ) +
( channel && channel . name ? channel . name : messageData . channelName ) ;
message . querySelector ( BDFDB . dotCN . messagemarkup ) . innerHTML = messageData . markup ;
message . querySelector ( BDFDB . dotCN . messageaccessory ) . innerHTML = messageData . accessory ;
$ ( message ) . on ( "click." + this . name , BDFDB . dotCN . messagespopoutclosebutton , ( e ) => {
message . remove ( ) ;
delete pins [ messageData . serverID ] [ messageData . channelID ] [ messageData . id + "_" + messageData . pos ] ;
BDFDB . saveAllData ( pins , this , "pins" ) ;
if ( ! container . querySelector ( BDFDB . dotCN . messagegroup ) ) $ ( placeholder ) . show ( ) ;
BDFDB . showToast ( this . labels . toast _noteremove _text , { type : "danger" } ) ;
} )
. on ( "click." + this . name , BDFDB . dotCN . messagespopoutjumpbutton + ".jump" , ( e ) => {
this . HistoryUtils . transitionTo ( this . MainDiscord . Routes . MESSAGE ( messageData . serverID , messageData . channelID , messageData . id ) ) ;
} )
. on ( "click." + this . name , BDFDB . dotCN . messagespopoutjumpbutton + ".copy" , ( e ) => {
let clipboard = require ( "electron" ) . clipboard ;
if ( messageData . content ) clipboard . write ( { text : messageData . content } ) ;
else {
var image = message . querySelector ( BDFDB . dotCNS . imagewrapper + "img" ) ;
if ( image ) {
// stolen from Image2Clipboard
require ( "request" ) ( { url : image . src , encoding : null } , ( error , response , buffer ) => {
if ( buffer ) {
var platform = require ( "process" ) . platform ;
if ( platform === "win32" || platform === "darwin" ) {
clipboard . write ( { image : require ( "electron" ) . nativeImage . createFromBuffer ( buffer ) } ) ;
}
else {
var file = require ( "path" ) . join ( require ( "process" ) . env [ "HOME" ] , "personalpinstemp.png" ) ;
require ( "fs" ) . writeFileSync ( file , buffer , { encoding : null } ) ;
clipboard . write ( { image : file } ) ;
require ( "fs" ) . unlinkSync ( file ) ;
}
}
} ) ;
}
}
} ) ;
}
var searchstring = notespopout . querySelector ( BDFDB . dotCN . searchbarinput ) . value . replace ( /[<|>]/g , "" ) ;
if ( searchstring ) for ( let note of notespopout . querySelectorAll ( BDFDB . dotCN . messagegroup ) ) {
note . innerHTML = BDFDB . highlightText ( note . innerHTML , searchstring ) ;
if ( ! note . querySelector ( BDFDB . dotCN . highlight ) ) note . remove ( ) ;
}
$ ( placeholder ) . toggle ( notespopout . querySelectorAll ( BDFDB . dotCN . messagegroup ) . length == 0 ) ;
}
}
}
getSettingsPanel ( ) {
var settingshtml = ` <div class="DevilBro-settings ${ this . name } -settings"> ` ;
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 0 0 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;">Delete all Notes.</h3><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorred + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } reset-button" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } ">Reset</div></button></div> ` ;
settingshtml += ` </div> ` ;
var settingspanel = $ ( settingshtml ) [ 0 ] ;
$ ( settingspanel )
. on ( "click" , ".reset-button" , ( ) => { this . resetAll ( ) ; } ) ;
return settingspanel ;
}
setLabelsByLanguage ( ) {
switch ( BDFDB . getDiscordLanguage ( ) . id ) {
case "hr" : //croatian
return {
popout _note _text : "Bilješke" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Poslužavnik" ,
popout _allservers _text : "Svi poslužitelji" ,
popout _sort _text : "Poredaj po" ,
popout _messagesort _text : "Vijesti-Datum" ,
popout _datesort _text : "Bilješka-Datum" ,
popout _jump _text : "Skok" ,
popout _copy _text : "Kopija" ,
context _noteoption _text : "Napominjemo poruku" ,
popout _noteoption _text : "Bilješka" ,
toast _noteadd _text : "Poruka dodana u bilježnicu." ,
toast _noteremove _text : "Poruka uklonjena iz bilježnice."
} ;
case "da" : //danish
return {
popout _note _text : "Noter" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Server" ,
popout _allservers _text : "Alle servere" ,
popout _sort _text : "Sorter efter" ,
popout _messagesort _text : "Meddelelse-Dato" ,
popout _datesort _text : "Note-Dato" ,
popout _jump _text : "Hop" ,
popout _copy _text : "Kopi" ,
context _noteoption _text : "Noter Meddelelse" ,
popout _noteoption _text : "Noter" ,
toast _noteadd _text : "Meddelelse tilføjet til notesbog." ,
toast _noteremove _text : "Meddelelse fjernet fra notesbog."
} ;
case "de" : //german
return {
popout _note _text : "Notizen" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Server" ,
popout _allservers _text : "Alle Server" ,
popout _sort _text : "Sortieren nach" ,
popout _messagesort _text : "Nachrichten-Datum" ,
popout _datesort _text : "Notiz-Datum" ,
popout _jump _text : "Springen" ,
popout _copy _text : "Kopieren" ,
context _noteoption _text : "Nachricht notieren" ,
popout _noteoption _text : "Notieren" ,
toast _noteadd _text : "Nachricht zum Notizbuch hinzugefügt." ,
toast _noteremove _text : "Nachricht aus dem Notizbuch entfernt."
} ;
case "es" : //spanish
return {
popout _note _text : "Notas" ,
popout _channel _text : "Canal" ,
popout _server _text : "Servidor" ,
popout _allservers _text : "Todos los servidores" ,
popout _sort _text : "Ordenar por" ,
popout _messagesort _text : "Mensaje-Fecha" ,
popout _datesort _text : "Nota-Fecha" ,
popout _jump _text : "Ir a" ,
popout _copy _text : "Copiar" ,
context _noteoption _text : "Anotar mensaje" ,
popout _noteoption _text : "Anotar" ,
toast _noteadd _text : "Mensaje agregado al cuaderno." ,
toast _noteremove _text : "Mensaje eliminado del cuaderno."
} ;
case "fr" : //french
return {
popout _note _text : "Notes" ,
popout _channel _text : "Canal" ,
popout _server _text : "Serveur" ,
popout _allservers _text : "Tous les serveurs" ,
popout _sort _text : "Trier par" ,
popout _messagesort _text : "Message-Date" ,
popout _datesort _text : "Note-Date" ,
popout _jump _text : "Accéder" ,
popout _copy _text : "Copier" ,
context _noteoption _text : "Noter le message" ,
popout _noteoption _text : "Noter" ,
toast _noteadd _text : "Message ajouté au bloc-notes." ,
toast _noteremove _text : "Message supprimé du bloc-notes."
} ;
case "it" : //italian
return {
popout _note _text : "Note" ,
popout _channel _text : "Canale" ,
popout _server _text : "Server" ,
popout _allservers _text : "Tutti i server" ,
popout _sort _text : "Ordina per" ,
popout _messagesort _text : "Messaggio-Data" ,
popout _datesort _text : "Nota-Data" ,
popout _jump _text : "Vai" ,
popout _copy _text : "Copiare" ,
context _noteoption _text : "Annotare il messaggio" ,
popout _noteoption _text : "Annotare" ,
toast _noteadd _text : "Messaggio aggiunto al blocco note." ,
toast _noteremove _text : "Messaggio rimosso dal blocco note."
} ;
case "nl" : //dutch
return {
popout _note _text : "Notities" ,
popout _channel _text : "Kanaal" ,
popout _server _text : "Server" ,
popout _allservers _text : "Alle servers" ,
popout _sort _text : "Sorteer op" ,
popout _messagesort _text : "Bericht-Datum" ,
popout _datesort _text : "Notitie-Datum" ,
popout _jump _text : "Openen" ,
popout _copy _text : "Kopiëren" ,
context _noteoption _text : "Noteer bericht" ,
popout _noteoption _text : "Noteer" ,
toast _noteadd _text : "Bericht toegevoegd aan notitieblok." ,
toast _noteremove _text : "Bericht verwijderd van notitieblok."
} ;
case "no" : //norwegian
return {
popout _note _text : "Notatene" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Server" ,
popout _allservers _text : "Alle servere" ,
popout _sort _text : "Sorter etter" ,
popout _messagesort _text : "Melding-Dato" ,
popout _datesort _text : "Merknad-Dato" ,
popout _jump _text : "Hoppe" ,
popout _copy _text : "Kopiere" ,
context _noteoption _text : "Notat ned meldingen" ,
popout _noteoption _text : "Notere" ,
toast _noteadd _text : "Melding lagt til i notisboken." ,
toast _noteremove _text : "Melding fjernet fra notatboken."
} ;
case "pl" : //polish
return {
popout _note _text : "Notatki" ,
popout _channel _text : "Kanał" ,
popout _server _text : "Serwer" ,
popout _allservers _text : "Wszystkie serwery" ,
popout _sort _text : "Sortuj według" ,
popout _messagesort _text : "Wiadomość-Data" ,
popout _datesort _text : "Notatka-Data" ,
popout _jump _text : "Skocz" ,
popout _copy _text : "Kopiować" ,
context _noteoption _text : "Notuj wiadomość" ,
popout _noteoption _text : "Notuj" ,
toast _noteadd _text : "Wiadomość została dodana do notatnika." ,
toast _noteremove _text : "Wiadomość została usunięta z notatnika."
} ;
case "pt-BR" : //portuguese (brazil)
return {
popout _note _text : "Notas" ,
popout _channel _text : "Canal" ,
popout _server _text : "Servidor" ,
popout _allservers _text : "Todos os servidores" ,
popout _sort _text : "Ordenar por" ,
popout _messagesort _text : "Mensagem-Data" ,
popout _datesort _text : "Nota-Data" ,
popout _jump _text : "Pular" ,
popout _copy _text : "Copiar" ,
context _noteoption _text : "Anote a mensagem" ,
popout _noteoption _text : "Anotar" ,
toast _noteadd _text : "Mensagem adicionada ao caderno." ,
toast _noteremove _text : "Mensagem removida do caderno."
} ;
case "fi" : //finnish
return {
popout _note _text : "Muistiinpanot" ,
popout _channel _text : "Kanava" ,
popout _server _text : "Palvelin" ,
popout _allservers _text : "Kaikki palvelimet" ,
popout _sort _text : "Järjestä" ,
popout _messagesort _text : "Viesti-Päivämäärä" ,
popout _datesort _text : "Huomaa-Päivämäärä" ,
popout _jump _text : "Siirry" ,
popout _copy _text : "Kopioida" ,
context _noteoption _text : "Huomaa viesti" ,
popout _noteoption _text : "Huomaa" ,
toast _noteadd _text : "Viesti lisätty muistikirjaan." ,
toast _noteremove _text : "Viesti poistettiin muistikirjaan."
} ;
case "sv" : //swedish
return {
popout _note _text : "Anteckningarna" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Server" ,
popout _allservers _text : "Alla servrar" ,
popout _sort _text : "Sortera efter" ,
popout _messagesort _text : "Meddelande-Datum" ,
popout _datesort _text : "Anteckningen-Datum" ,
popout _jump _text : "Hoppa" ,
popout _copy _text : "Kopiera" ,
context _noteoption _text : "Anteckna meddelande" ,
popout _noteoption _text : "Anteckna" ,
toast _noteadd _text : "Meddelandet läggs till i anteckningsboken." ,
toast _noteremove _text : "Meddelande borttaget från anteckningsboken."
} ;
case "tr" : //turkish
return {
popout _note _text : "Notlar" ,
popout _channel _text : "Kanal" ,
popout _server _text : "Sunucu" ,
popout _allservers _text : "Tüm Sunucular" ,
popout _sort _text : "Göre sı rala" ,
popout _messagesort _text : "Mesaj-Tarih" ,
popout _datesort _text : "Not-Tarih" ,
popout _jump _text : "Git" ,
popout _copy _text : "Kopyalamak" ,
context _noteoption _text : "Mesajı not alı n" ,
popout _noteoption _text : "Not almak" ,
toast _noteadd _text : "Mesaj not defteri'ya eklendi." ,
toast _noteremove _text : "Mesaj not defteri'dan kaldı rı ldı ."
} ;
case "cs" : //czech
return {
popout _note _text : "Poznámky" ,
popout _channel _text : "Kanál" ,
popout _server _text : "Server" ,
popout _allservers _text : "Všechny servery" ,
popout _sort _text : "Seřazeno podle" ,
popout _messagesort _text : "Zpráva-datum" ,
popout _datesort _text : "Poznámka-datum" ,
popout _jump _text : "Skok" ,
popout _copy _text : "Kopírovat" ,
context _noteoption _text : "Poznámka dolů zprávu" ,
popout _noteoption _text : "Poznámka dolů" ,
toast _noteadd _text : "Zpráva byla přidána do notebooku." ,
toast _noteremove _text : "Zpráva byla odebrána z notebooku."
} ;
case "bg" : //bulgarian
return {
popout _note _text : "бележките" ,
popout _channel _text : "Канал" ,
popout _server _text : "Сървър" ,
popout _allservers _text : "Всички сървъри" ,
popout _sort _text : "Сортиране по" ,
popout _messagesort _text : "Съобщение-Дата" ,
popout _datesort _text : "Забележка-Дата" ,
popout _jump _text : "Направо" ,
popout _copy _text : "Копирам" ,
context _noteoption _text : "Oтб е ле же те съобщението" ,
popout _noteoption _text : "Oтб е ле же те " ,
toast _noteadd _text : "Съобщението б е добавено към бележника." ,
toast _noteremove _text : "Съобщението е премахнато от преносимия компютър."
} ;
case "ru" : //russian
return {
popout _note _text : "Заметки" ,
popout _channel _text : "Канал" ,
popout _server _text : "Cе р ве р " ,
popout _allservers _text : "В с е серверы" ,
popout _sort _text : "Сортировать по" ,
popout _messagesort _text : "Сообщение-дата" ,
popout _datesort _text : "Заметки-Дата" ,
popout _jump _text : "Перейти" ,
popout _copy _text : "Копировать" ,
context _noteoption _text : "Записывать вниз" ,
popout _noteoption _text : "Записывать" ,
toast _noteadd _text : "Сообщение добавлено в блокнот." ,
toast _noteremove _text : "Сообщение удалено из записной книжки."
} ;
case "uk" : //ukrainian
return {
popout _note _text : "Замітки" ,
popout _channel _text : "Канал" ,
popout _server _text : "Сервер" ,
popout _allservers _text : "В с і сервери" ,
popout _sort _text : "Сортувати за" ,
popout _messagesort _text : "Повідомлення-дата" ,
popout _datesort _text : "Примітка-дата" ,
popout _jump _text : "Плиг" ,
popout _copy _text : "Копіювати" ,
context _noteoption _text : "Зверніть увагу на повідомлення" ,
popout _noteoption _text : "Занотуйте" ,
toast _noteadd _text : "Повідомлення додається до ноутбука." ,
toast _noteremove _text : "Повідомлення видалено з ноутбука."
} ;
case "ja" : //japanese
return {
popout _note _text : "ノート" ,
popout _channel _text : "チャネル" ,
popout _server _text : "サーバ" ,
popout _allservers _text : "すべてのサーバー" ,
popout _sort _text : "並び替え" ,
popout _messagesort _text : "メッセージ-日付" ,
popout _datesort _text : "注-日付" ,
popout _jump _text : "ジャンプ" ,
popout _copy _text : "写す" ,
context _noteoption _text : "ノートダウンメッセージ" ,
popout _noteoption _text : "書き留める" ,
toast _noteadd _text : "ノートブックにメッセージが追加されました." ,
toast _noteremove _text : "ノートブックからメッセージが削除されました."
} ;
case "zh-TW" : //chinese (traditional)
return {
popout _note _text : "筆記" ,
popout _channel _text : "渠道" ,
popout _server _text : "服務器" ,
popout _allservers _text : "所有服務器" ,
popout _sort _text : "排序方式" ,
popout _messagesort _text : "消息-日期" ,
popout _datesort _text : "注-日期" ,
popout _jump _text : "跳到" ,
popout _copy _text : "複製" ,
context _noteoption _text : "記下下來的消息" ,
popout _noteoption _text : "記下" ,
toast _noteadd _text : "消息添加到筆記本." ,
toast _noteremove _text : "消息從筆記本中刪除."
} ;
case "ko" : //korean
return {
popout _note _text : "노트" ,
popout _channel _text : "채널" ,
popout _server _text : "섬기는 사람" ,
popout _allservers _text : "모든 서버" ,
popout _sort _text : "정렬 기준" ,
popout _messagesort _text : "메시지-날짜" ,
popout _datesort _text : "주-날짜" ,
popout _jump _text : "이동" ,
popout _copy _text : "베끼다" ,
context _noteoption _text : "메모 다운 메시지" ,
popout _noteoption _text : "메모하다" ,
toast _noteadd _text : "노트북에 메시지 추가됨." ,
toast _noteremove _text : "노트에서 메시지 삭제됨."
} ;
default : //default: english
return {
popout _note _text : "Notes" ,
popout _channel _text : "Channel" ,
popout _server _text : "Server" ,
popout _allservers _text : "All Servers" ,
popout _sort _text : "Sort by" ,
popout _messagesort _text : "Message-Date" ,
popout _datesort _text : "Note-Date" ,
popout _jump _text : "Jump" ,
popout _copy _text : "Copy" ,
context _noteoption _text : "Note Message" ,
popout _noteoption _text : "Note" ,
toast _noteadd _text : "Message added to notebook." ,
toast _noteremove _text : "Message removed from notebook."
} ;
}
}
}
} ;