@ -20,15 +20,15 @@ var TwisterOptions = function()
}
}
this . soundNotifOptions = function ( ) {
this . soundNotifOptions = function ( ) {
$ ( '#notifyForm select' ) . each ( function ( ) {
$ ( '#notifyForm select' ) . each ( function ( ) {
this . value = $ . Options . getOption ( this . id , "false" ) ;
this . value = $ . Options . getOption ( this . id , 'false' ) ;
} ) ;
} ) ;
var player = $ ( '#player' ) ;
var player = $ ( '#player' ) ;
player [ 0 ] . pause ( ) ;
player [ 0 ] . pause ( ) ;
$ ( '#player' ) . empty ( ) ;
$ ( '#player' ) . empty ( ) ;
$ ( 'form#notifyForm' ) . on ( 'change' , 'select' , function ( ) {
$ ( 'form#notifyForm' ) . on ( 'change' , 'select' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
if ( this . value == false ) { player [ 0 ] . pause ( ) ; return ; }
if ( this . value == false ) { player [ 0 ] . pause ( ) ; return ; }
@ -46,10 +46,10 @@ var TwisterOptions = function()
this . volumeControl = function ( ) {
this . volumeControl = function ( ) {
var playerVol = $ ( '#playerVol' ) ;
var playerVol = $ ( '#playerVol' ) ;
playerVol [ 0 ] . value = $ . Option s. getOption ( playerVol [ 0 ] . id , 1 ) ;
playerVol [ 0 ] . value = thi s. getOption ( playerVol [ 0 ] . id , 1 ) ;
$ ( '.volValue' ) . text ( ( playerVol [ 0 ] . value * 100 ) . toFixed ( ) ) ;
$ ( '.volValue' ) . text ( ( playerVol [ 0 ] . value * 100 ) . toFixed ( ) ) ;
playerVol . on ( 'change' , function ( ) {
playerVol . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
$ ( '#player' ) [ 0 ] . volume = ( this . value ) ;
$ ( '#player' ) [ 0 ] . volume = ( this . value ) ;
$ ( '.volValue' ) . text ( ( this . value * 100 ) . toFixed ( ) ) ;
$ ( '.volValue' ) . text ( ( this . value * 100 ) . toFixed ( ) ) ;
@ -57,8 +57,8 @@ var TwisterOptions = function()
}
}
this . DMsNotif = function ( ) {
this . DMsNotif = function ( ) {
var sndDM = $ . Option s. getOption ( 'sndDM' , "false" ) ;
var sndDM = thi s. getOption ( 'sndDM' , 'false' ) ;
if ( sndDM == "false" ) return ;
if ( sndDM === 'false' ) return ;
var player = $ ( '#player' ) ;
var player = $ ( '#player' ) ;
$ ( '#player' ) . empty ( ) ;
$ ( '#player' ) . empty ( ) ;
@ -69,13 +69,13 @@ var TwisterOptions = function()
player . attr ( 'type' , 'audio/ogg' ) ;
player . attr ( 'type' , 'audio/ogg' ) ;
player . attr ( 'src' , 'sound/' + sndDM + '.ogg' ) ;
player . attr ( 'src' , 'sound/' + sndDM + '.ogg' ) ;
}
}
player [ 0 ] . volume = $ . Option s. getOption ( 'playerVol' , 1 ) ;
player [ 0 ] . volume = thi s. getOption ( 'playerVol' , 1 ) ;
player [ 0 ] . play ( ) ;
player [ 0 ] . play ( ) ;
}
}
this . mensNotif = function ( ) {
this . mensNotif = function ( ) {
var sndMention = $ . Option s. getOption ( 'sndMention' , "false" ) ;
var sndMention = thi s. getOption ( 'sndMention' , 'false' ) ;
if ( sndMention == "false" ) return ;
if ( sndMention === 'false' ) return ;
var player = $ ( '#playerSec' ) ;
var player = $ ( '#playerSec' ) ;
$ ( '#playerSec' ) . empty ( ) ;
$ ( '#playerSec' ) . empty ( ) ;
@ -86,23 +86,22 @@ var TwisterOptions = function()
player . attr ( 'type' , 'audio/ogg' ) ;
player . attr ( 'type' , 'audio/ogg' ) ;
player . attr ( 'src' , 'sound/' + sndMention + '.ogg' ) ;
player . attr ( 'src' , 'sound/' + sndMention + '.ogg' ) ;
}
}
player [ 0 ] . volume = $ . Option s. getOption ( 'playerVol' , 1 ) ;
player [ 0 ] . volume = thi s. getOption ( 'playerVol' , 1 ) ;
player [ 0 ] . play ( ) ;
player [ 0 ] . play ( ) ;
}
}
this . getShowDesktopNotifPostsOpt = function ( ) {
this . getShowDesktopNotifPostsOpt = function ( ) {
return $ . Option s. getOption ( 'showDesktopNotifPosts' , 'enable' ) ;
return thi s. getOption ( 'showDesktopNotifPosts' , 'enable' ) ;
}
}
this . setShowDesktopNotifPostsOpt = function ( ) {
this . setShowDesktopNotifPostsOpt = function ( ) {
function showDesktopNotifPostsDesc ( ) {
function showDesktopNotifPostsDesc ( ) {
if ( $ . Options . getShowDesktopNotifPostsOpt ( ) === 'enable' ) {
if ( $ . Options . getShowDesktopNotifPostsOpt ( ) === 'enable' )
$ ( '#showDesktopNotifPostsDesc' ) [ 0 ] . style . display = 'inline' ;
$ ( '#showDesktopNotifPostsDesc' ) . css ( 'display' , 'inline' ) ;
} else {
else
$ ( '#showDesktopNotifPostsDesc' ) [ 0 ] . style . display = 'none' ;
$ ( '#showDesktopNotifPostsDesc' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#showDesktopNotifPosts' ) . val ( this . getShowDesktopNotifPostsOpt ( ) ) ;
$ ( '#showDesktopNotifPosts' ) . val ( this . getShowDesktopNotifPostsOpt ( ) ) ;
showDesktopNotifPostsDesc ( ) ;
showDesktopNotifPostsDesc ( ) ;
$ ( '#showDesktopNotifPosts' ) . on ( 'change' , function ( ) {
$ ( '#showDesktopNotifPosts' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -111,28 +110,26 @@ var TwisterOptions = function()
}
}
this . getShowDesktopNotifPostsTimerOpt = function ( ) {
this . getShowDesktopNotifPostsTimerOpt = function ( ) {
return parseInt ( $ . Option s. getOption ( 'showDesktopNotifPostsTimer' , '6' ) ) ;
return parseInt ( thi s. getOption ( 'showDesktopNotifPostsTimer' , '6' ) ) ;
}
}
this . setShowDesktopNotifPostsTimerOpt = function ( ) {
this . setShowDesktopNotifPostsTimerOpt = function ( ) {
$ ( '#showDesktopNotifPostsTimer' ) [ 0 ] . value = this . getShowDesktopNotifPostsTimerOpt ( ) . toString ( ) ;
$ ( '#showDesktopNotifPostsTimer' ) . val ( this . getShowDesktopNotifPostsTimerOpt ( ) . toString ( ) ) ;
$ ( '#showDesktopNotifPostsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
$ ( '#showDesktopNotifPostsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
}
}
this . getShowDesktopNotifPostsModalOpt = function ( ) {
this . getShowDesktopNotifPostsModalOpt = function ( ) {
return $ . Option s. getOption ( 'showDesktopNotifPostsModal' , 'enable' ) ;
return thi s. getOption ( 'showDesktopNotifPostsModal' , 'enable' ) ;
}
}
this . setShowDesktopNotifPostsModalOpt = function ( ) {
this . setShowDesktopNotifPostsModalOpt = function ( ) {
function showDesktopNotifPostsModalDesc ( ) {
function showDesktopNotifPostsModalDesc ( ) {
if ( $ . Options . getShowDesktopNotifPostsModalOpt ( ) === 'enable' ) {
if ( $ . Options . getShowDesktopNotifPostsModalOpt ( ) === 'enable' )
$ ( '#showDesktopNotifPostsModalDesc' ) [ 0 ] . style . display = 'inline' ;
$ ( '#showDesktopNotifPostsModalDesc' ) . css ( 'display' , 'inline' ) ;
} else {
else
$ ( '#showDesktopNotifPostsModalDesc' ) [ 0 ] . style . display = 'none' ;
$ ( '#showDesktopNotifPostsModalDesc' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#showDesktopNotifPostsModal' ) . val ( this . getShowDesktopNotifPostsModalOpt ( ) ) ;
$ ( '#showDesktopNotifPostsModal' ) . val ( this . getShowDesktopNotifPostsModalOpt ( ) ) ;
showDesktopNotifPostsModalDesc ( ) ;
showDesktopNotifPostsModalDesc ( ) ;
$ ( '#showDesktopNotifPostsModal' ) . on ( 'change' , function ( ) {
$ ( '#showDesktopNotifPostsModal' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -141,28 +138,26 @@ var TwisterOptions = function()
}
}
this . getShowDesktopNotifPostsModalTimerOpt = function ( ) {
this . getShowDesktopNotifPostsModalTimerOpt = function ( ) {
return parseInt ( $ . Option s. getOption ( 'showDesktopNotifPostsModalTimer' , '6' ) ) ;
return parseInt ( thi s. getOption ( 'showDesktopNotifPostsModalTimer' , '6' ) ) ;
}
}
this . setShowDesktopNotifPostsModalTimerOpt = function ( ) {
this . setShowDesktopNotifPostsModalTimerOpt = function ( ) {
$ ( '#showDesktopNotifPostsModalTimer' ) [ 0 ] . value = this . getShowDesktopNotifPostsModalTimerOpt ( ) . toString ( ) ;
$ ( '#showDesktopNotifPostsModalTimer' ) . val ( this . getShowDesktopNotifPostsModalTimerOpt ( ) . toString ( ) ) ;
$ ( '#showDesktopNotifPostsModalTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
$ ( '#showDesktopNotifPostsModalTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
}
}
this . getShowDesktopNotifMentionsOpt = function ( ) {
this . getShowDesktopNotifMentionsOpt = function ( ) {
return $ . Option s. getOption ( 'showDesktopNotifMentions' , 'enable' ) ;
return thi s. getOption ( 'showDesktopNotifMentions' , 'enable' ) ;
}
}
this . setShowDesktopNotifMentionsOpt = function ( ) {
this . setShowDesktopNotifMentionsOpt = function ( ) {
function showDesktopNotifMentionsDesc ( ) {
function showDesktopNotifMentionsDesc ( ) {
if ( $ . Options . getShowDesktopNotifMentionsOpt ( ) === 'enable' ) {
if ( $ . Options . getShowDesktopNotifMentionsOpt ( ) === 'enable' )
$ ( '#showDesktopNotifMentionsDesc' ) [ 0 ] . style . display = 'inline' ;
$ ( '#showDesktopNotifMentionsDesc' ) . css ( 'display' , 'inline' ) ;
} else {
else
$ ( '#showDesktopNotifMentionsDesc' ) [ 0 ] . style . display = 'none' ;
$ ( '#showDesktopNotifMentionsDesc' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#showDesktopNotifMentions' ) . val ( this . getShowDesktopNotifMentionsOpt ( ) ) ;
$ ( '#showDesktopNotifMentions' ) . val ( this . getShowDesktopNotifMentionsOpt ( ) ) ;
showDesktopNotifMentionsDesc ( ) ;
showDesktopNotifMentionsDesc ( ) ;
$ ( '#showDesktopNotifMentions' ) . on ( 'change' , function ( ) {
$ ( '#showDesktopNotifMentions' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -171,28 +166,26 @@ var TwisterOptions = function()
}
}
this . getShowDesktopNotifMentionsTimerOpt = function ( ) {
this . getShowDesktopNotifMentionsTimerOpt = function ( ) {
return parseInt ( $ . Option s. getOption ( 'showDesktopNotifMentionsTimer' , '60' ) ) ;
return parseInt ( thi s. getOption ( 'showDesktopNotifMentionsTimer' , '60' ) ) ;
}
}
this . setShowDesktopNotifMentionsTimerOpt = function ( ) {
this . setShowDesktopNotifMentionsTimerOpt = function ( ) {
$ ( '#showDesktopNotifMentionsTimer' ) [ 0 ] . value = this . getShowDesktopNotifMentionsTimerOpt ( ) . toString ( ) ;
$ ( '#showDesktopNotifMentionsTimer' ) . val ( this . getShowDesktopNotifMentionsTimerOpt ( ) . toString ( ) ) ;
$ ( '#showDesktopNotifMentionsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
$ ( '#showDesktopNotifMentionsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
}
}
this . getShowDesktopNotifDMsOpt = function ( ) {
this . getShowDesktopNotifDMsOpt = function ( ) {
return $ . Option s. getOption ( 'showDesktopNotifDMs' , 'enable' ) ;
return thi s. getOption ( 'showDesktopNotifDMs' , 'enable' ) ;
}
}
this . setShowDesktopNotifDMsOpt = function ( ) {
this . setShowDesktopNotifDMsOpt = function ( ) {
function showDesktopNotifDMsDesc ( ) {
function showDesktopNotifDMsDesc ( ) {
if ( $ . Options . getShowDesktopNotifDMsOpt ( ) === 'enable' ) {
if ( $ . Options . getShowDesktopNotifDMsOpt ( ) === 'enable' )
$ ( '#showDesktopNotifDMsDesc' ) [ 0 ] . style . display = 'inline' ;
$ ( '#showDesktopNotifDMsDesc' ) . css ( 'display' , 'inline' ) ;
} else {
else
$ ( '#showDesktopNotifDMsDesc' ) [ 0 ] . style . display = 'none' ;
$ ( '#showDesktopNotifDMsDesc' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#showDesktopNotifDMs' ) . val ( this . getShowDesktopNotifDMsOpt ( ) ) ;
$ ( '#showDesktopNotifDMs' ) . val ( this . getShowDesktopNotifDMsOpt ( ) ) ;
showDesktopNotifDMsDesc ( ) ;
showDesktopNotifDMsDesc ( ) ;
$ ( '#showDesktopNotifDMs' ) . on ( 'change' , function ( ) {
$ ( '#showDesktopNotifDMs' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -201,13 +194,12 @@ var TwisterOptions = function()
}
}
this . getShowDesktopNotifDMsTimerOpt = function ( ) {
this . getShowDesktopNotifDMsTimerOpt = function ( ) {
return parseInt ( $ . Option s. getOption ( 'showDesktopNotifDMsTimer' , '60' ) ) ;
return parseInt ( thi s. getOption ( 'showDesktopNotifDMsTimer' , '60' ) ) ;
}
}
this . setShowDesktopNotifDMsTimerOpt = function ( ) {
this . setShowDesktopNotifDMsTimerOpt = function ( ) {
$ ( '#showDesktopNotifDMsTimer' ) [ 0 ] . value = this . getShowDesktopNotifDMsTimerOpt ( ) . toString ( ) ;
$ ( '#showDesktopNotifDMsTimer' ) . val ( this . getShowDesktopNotifDMsTimerOpt ( ) . toString ( ) ) ;
$ ( '#showDesktopNotifDMsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
$ ( '#showDesktopNotifDMsTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
}
}
this . setTestDesktopNotif = function ( ) {
this . setTestDesktopNotif = function ( ) {
@ -216,159 +208,156 @@ var TwisterOptions = function()
} )
} )
}
}
this . keysSendDefault = "ctrlenter" ;
this . keysSendDefault = 'ctrlenter' ;
this . keysSend = function ( ) {
this . keysSend = function ( ) {
$ ( '#keysOpt select' ) [ 0 ] . value = $ . Options . getOption ( 'keysSend' , this . keysSendDefault ) ;
$ ( '#keysOpt select' ) . val ( this . getOption ( 'keysSend' , this . keysSendDefault ) ) ;
$ ( '#keysOpt select' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#keysOpt select' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
} )
}
}
this . keyEnterToSend = function ( ) {
this . keyEnterToSend = function ( ) {
return $ . Option s. getOption ( 'keysSend' , this . keysSendDefault ) == "enter" ;
return thi s. getOption ( 'keysSend' , this . keysSendDefault ) === 'enter' ;
}
}
this . setLang = function ( ) {
this . setLang = function ( ) {
$ ( '#language' ) . val ( $ . Option s. getOption ( 'locLang' , 'auto' ) )
$ ( '#language' ) . val ( thi s . getOption ( 'locLang' , 'auto' ) ) ;
$ ( '#language' ) . on ( 'change' , function ( ) {
$ ( '#language' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( 'locLang' , $ ( this ) . val ( ) ) ;
$ . Options . setOption ( 'locLang' , $ ( this ) . val ( ) ) ;
if ( $ ( this ) . val ( ) != 'auto' ) {
twisterRpc ( "setpreferredspamlang" , [ $ ( this ) . val ( ) ] ) ;
}
location . reload ( ) ;
location . reload ( ) ;
} )
} )
}
}
this . getTheme = function ( ) {
this . getTheme = function ( ) {
return $ . Option s. getOption ( 'theme' , 'original' ) ;
return thi s. getOption ( 'theme' , 'original' ) ;
}
}
this . setTheme = function ( ) {
this . setTheme = function ( ) {
$ ( '#theme' ) . val ( this . getTheme ( ) )
$ ( '#theme' ) . val ( this . getTheme ( ) )
$ ( '#theme' ) . on ( 'change' , function ( ) {
$ ( '#theme' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( 'theme' , $ ( this ) . val ( ) ) ;
$ . Options . setOption ( 'theme' , $ ( this ) . val ( ) ) ;
location . reload ( ) ;
location . reload ( ) ;
} ) ;
} ) ;
}
}
this . getLineFeedsOpt = function ( ) {
this . getLineFeedsOpt = function ( ) {
return $ . Option s. getOption ( 'displayLineFeeds' , "disable" ) ;
return thi s. getOption ( 'displayLineFeeds' , 'disable' ) ;
}
}
this . setLineFeedsOpt = function ( ) {
this . setLineFeedsOpt = function ( ) {
$ ( '#lineFeedsOpt select' ) [ 0 ] . value = this . getLineFeedsOpt ( ) ;
$ ( '#lineFeedsOpt select' ) . val ( this . getLineFeedsOpt ( ) ) ;
$ ( '#lineFeedsOpt select' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#lineFeedsOpt select' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
} )
}
}
this . getShowPreviewOpt = function ( ) {
this . getShowPreviewOpt = function ( ) {
return $ . Option s. getOption ( 'displayPreview' , "disable" ) ;
return thi s. getOption ( 'displayPreview' , 'disable' ) ;
}
}
this . setShowPreviewOpt = function ( ) {
this . setShowPreviewOpt = function ( ) {
$ ( '#showPreviewOpt select' ) [ 0 ] . value = this . getShowPreviewOpt ( ) ;
$ ( '#showPreviewOpt select' ) . val ( this . getShowPreviewOpt ( ) ) ;
$ ( '#showPreviewOpt select' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#showPreviewOpt select' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
} ) ;
}
}
this . getUnicodeConversionOpt = function ( ) {
this . getUnicodeConversionOpt = function ( ) {
return $ . Option s. getOption ( 'unicodeConversion' , "disable" ) ;
return thi s. getOption ( 'unicodeConversion' , 'disable' ) ;
}
}
this . setUnicodeConversionOpt = function ( ) {
this . setUnicodeConversionOpt = function ( ) {
$ ( "#unicodeConversion" ) [ 0 ] . value = this . getUnicodeConversionOpt ( ) ;
$ ( '#unicodeConversion' ) . val ( this . getUnicodeConversionOpt ( ) ) ;
if ( this . getUnicodeConversionOpt ( ) === "custom" )
if ( this . getUnicodeConversionOpt ( ) === 'custom' )
$ ( "#unicodeConversionOpt .suboptions" ) [ 0 ] . style . height = "230px" ;
$ ( '#unicodeConversionOpt .suboptions' ) . css ( 'height' , 'auto' ) ;
$ ( "#unicodeConversion" ) . on ( 'change' , function ( ) {
$ ( '#unicodeConversion' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
if ( this . value === "custom" )
if ( this . value === 'custom' )
$ ( "#unicodeConversionOpt .suboptions" ) [ 0 ] . style . height = "230px" ;
$ ( '#unicodeConversionOpt .suboptions' ) . css ( 'height' , 'auto' ) ;
else
else
$ ( "#unicodeConversionOpt .suboptions" ) [ 0 ] . style . height = "0px" ;
$ ( '#unicodeConversionOpt .suboptions' ) . css ( 'height' , '0px' ) ;
} ) ;
} ) ;
}
}
this . getConvertPunctuationsOpt = function ( ) {
this . getConvertPunctuationsOpt = function ( ) {
return $ . Option s. getOption ( 'convertPunctuationsOpt' , false ) ;
return thi s. getOption ( 'convertPunctuationsOpt' , false ) ;
}
}
this . setConvertPunctuationsOpt = function ( ) {
this . setConvertPunctuationsOpt = function ( ) {
$ ( '#convertPunctuationsOpt' ) [ 0 ] . checked = this . getConvertPunctuationsOpt ( ) ;
$ ( '#convertPunctuationsOpt' ) . prop ( 'checked' , this . getConvertPunctuationsOpt ( ) ) ;
$ ( '#convertPunctuationsOpt' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#convertPunctuationsOpt' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . checked ) ;
} ) ;
}
}
this . getConvertEmotionsOpt = function ( ) {
this . getConvertEmotionsOpt = function ( ) {
return $ . Option s. getOption ( 'convertEmotionsOpt' , false ) ;
return thi s. getOption ( 'convertEmotionsOpt' , false ) ;
}
}
this . setConvertEmotionsOpt = function ( ) {
this . setConvertEmotionsOpt = function ( ) {
$ ( '#convertEmotionsOpt' ) [ 0 ] . checked = this . getConvertEmotionsOpt ( ) ;
$ ( '#convertEmotionsOpt' ) . prop ( 'checked' , this . getConvertEmotionsOpt ( ) ) ;
$ ( '#convertEmotionsOpt' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#convertEmotionsOpt' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . checked ) ;
} ) ;
}
}
this . getConvertSignsOpt = function ( ) {
this . getConvertSignsOpt = function ( ) {
return $ . Option s. getOption ( 'convertSignsOpt' , false ) ;
return thi s. getOption ( 'convertSignsOpt' , false ) ;
}
}
this . setConvertSignsOpt = function ( ) {
this . setConvertSignsOpt = function ( ) {
$ ( '#convertSignsOpt' ) [ 0 ] . checked = this . getConvertSignsOpt ( ) ;
$ ( '#convertSignsOpt' ) . prop ( 'checked' , this . getConvertSignsOpt ( ) ) ;
$ ( '#convertSignsOpt' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#convertSignsOpt' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . checked ) ;
} ) ;
}
}
this . getConvertFractionsOpt = function ( ) {
this . getConvertFractionsOpt = function ( ) {
return $ . Option s. getOption ( 'convertFractionsOpt' , false ) ;
return thi s. getOption ( 'convertFractionsOpt' , false ) ;
}
}
this . setConvertFractionsOpt = function ( ) {
this . setConvertFractionsOpt = function ( ) {
$ ( '#convertFractionsOpt' ) [ 0 ] . checked = this . getConvertFractionsOpt ( ) ;
$ ( '#convertFractionsOpt' ) . prop ( 'checked' , this . getConvertFractionsOpt ( ) ) ;
$ ( '#convertFractionsOpt' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#convertFractionsOpt' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . checked ) ;
} ) ;
}
}
this . getUseProxyOpt = function ( ) {
this . getUseProxyOpt = function ( ) {
return $ . Option s. getOption ( 'useProxy' , 'disable' ) ;
return thi s. getOption ( 'useProxy' , 'disable' ) ;
}
}
this . setUseProxyOpt = function ( ) {
this . setUseProxyOpt = function ( ) {
$ ( '#useProxy' ) [ 0 ] . value = this . getUseProxyOpt ( ) ;
$ ( '#useProxy' ) . val ( this . getUseProxyOpt ( ) ) ;
if ( this . getUseProxyOpt ( ) === 'disable' )
if ( this . getUseProxyOpt ( ) === 'disable' )
$ ( '#useProxyForImgOnly' ) . attr ( 'disabled' , 'disabled' ) ;
$ ( '#useProxyForImgOnly' ) . attr ( 'disabled' , 'disabled' ) ;
$ ( '#useProxy' ) . on ( 'change' , function ( ) {
$ ( '#useProxy' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
if ( this . value === 'disable' )
if ( this . value === 'disable' )
$ ( '#useProxyForImgOnly' ) . attr ( 'disabled' , 'disabled' ) ;
$ ( '#useProxyForImgOnly' ) . attr ( 'disabled' , 'disabled' ) ;
else
else
$ ( '#useProxyForImgOnly' ) . removeAttr ( 'disabled' ) ;
$ ( '#useProxyForImgOnly' ) . removeAttr ( 'disabled' ) ;
} ) ;
} ) ;
}
}
this . getUseProxyForImgOnlyOpt = function ( ) {
this . getUseProxyForImgOnlyOpt = function ( ) {
return $ . Option s. getOption ( 'useProxyForImgOnly' , false ) ;
return thi s. getOption ( 'useProxyForImgOnly' , false ) ;
}
}
this . setUseProxyForImgOnlyOpt = function ( ) {
this . setUseProxyForImgOnlyOpt = function ( ) {
$ ( '#useProxyForImgOnly' ) [ 0 ] . checked = this . getUseProxyForImgOnlyOpt ( ) ;
$ ( '#useProxyForImgOnly' ) . prop ( 'checked' , this . getUseProxyForImgOnlyOpt ( ) ) ;
$ ( '#useProxyForImgOnly' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
}
this . getTopTrendsOpt = function ( ) {
return this . getOption ( 'TopTrends' , 'enable' ) ;
}
$ ( '#useProxyForImgOnly' ) . on ( 'change' , function ( ) {
this . setTopTrendsOpt = function ( ) {
$ . Options . setOption ( this . id , this . checked ) ;
function TopTrendsCfg ( ) {
if ( $ . Options . getTopTrendsOpt ( ) === 'enable' )
$ ( '#TopTrendsCont' ) . show ( ) ;
else
$ ( '#TopTrendsCont' ) . hide ( ) ;
}
$ ( '#TopTrends' ) . val ( this . getTopTrendsOpt ( ) ) ;
TopTrendsCfg ( ) ;
$ ( '#TopTrends' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
TopTrendsCfg ( ) ;
} ) ;
} ) ;
}
}
@ -378,13 +367,12 @@ var TwisterOptions = function()
this . setTopTrendsAutoUpdateOpt = function ( ) {
this . setTopTrendsAutoUpdateOpt = function ( ) {
function TopTrendsAutoUpdateCfg ( ) {
function TopTrendsAutoUpdateCfg ( ) {
if ( $ . Options . getTopTrendsAutoUpdateOpt ( ) === 'enable' ) {
if ( $ . Options . getTopTrendsAutoUpdateOpt ( ) === 'enable' )
$ ( '#TopTrendsAutoUpdateOpt' ) [ 0 ] . style . display = 'inline' ;
$ ( '#TopTrendsAutoUpdateOpt' ) . css ( 'display' , 'inline' ) ;
} else {
else
$ ( '#TopTrendsAutoUpdateOpt' ) [ 0 ] . style . display = 'none' ;
$ ( '#TopTrendsAutoUpdateOpt' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#TopTrendsAutoUpdate' ) . val ( this . getTopTrendsAutoUpdateOpt ( ) ) ;
$ ( '#TopTrendsAutoUpdate' ) . val ( this . getTopTrendsAutoUpdateOpt ( ) ) ;
TopTrendsAutoUpdateCfg ( ) ;
TopTrendsAutoUpdateCfg ( ) ;
$ ( '#TopTrendsAutoUpdate' ) . on ( 'change' , function ( ) {
$ ( '#TopTrendsAutoUpdate' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -397,86 +385,77 @@ var TwisterOptions = function()
}
}
this . setTopTrendsAutoUpdateTimerOpt = function ( ) {
this . setTopTrendsAutoUpdateTimerOpt = function ( ) {
$ ( '#TopTrendsAutoUpdateTimer' ) [ 0 ] . value = this . getTopTrendsAutoUpdateTimerOpt ( ) . toString ( ) ;
$ ( '#TopTrendsAutoUpdateTimer' ) . val ( this . getTopTrendsAutoUpdateTimerOpt ( ) . toString ( ) ) ;
$ ( '#TopTrendsAutoUpdateTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
}
$ ( '#TopTrendsAutoUpdateTimer' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'second(s)' ) ) ; } ) ;
this . getWhoToFollowOpt = function ( ) {
return this . getOption ( 'WhoToFollow' , 'enable' ) ;
}
}
this . getSplitPostsOpt = function ( ) {
this . setWhoToFollowOpt = function ( ) {
return $ . Options . getOption ( 'splitPosts' , 'disable' ) ;
$ ( '#WhoToFollow' ) . val ( this . getWhoToFollowOpt ( ) ) ;
$ ( '#WhoToFollow' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
}
}
this . setSplitPostsOpt = function ( ) {
this . getSplitPostsOpt = function ( ) {
$ ( '#splitPosts' ) [ 0 ] . value = this . getSplitPostsOpt ( ) ;
return this . getOption ( 'splitPosts' , 'disable' ) ;
}
$ ( '#splitPosts' ) . on ( 'change' , function ( ) {
this . setSplitPostsOpt = function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ ( '#splitPosts' ) . val ( this . getSplitPostsOpt ( ) ) ;
} ) ;
$ ( '#splitPosts' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
}
}
this . getHideRepliesOpt = function ( ) {
this . getHideRepliesOpt = function ( ) {
return $ . Option s. getOption ( 'hideReplies' , 'following' ) ;
return thi s. getOption ( 'hideReplies' , 'following' ) ;
}
}
this . setHideRepliesOpt = function ( ) {
this . setHideRepliesOpt = function ( ) {
$ ( '#hideReplies' ) [ 0 ] . value = this . getHideRepliesOpt ( ) ;
$ ( '#hideReplies' ) . val ( this . getHideRepliesOpt ( ) ) ;
$ ( '#hideReplies' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#hideReplies' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
} ) ;
}
}
this . getHideCloseRTsOpt = function ( ) {
this . getHideCloseRTsOpt = function ( ) {
return $ . Option s. getOption ( 'hideCloseRTs' , 'disable' ) ;
return thi s. getOption ( 'hideCloseRTs' , 'disable' ) ;
} ;
} ;
this . setHideCloseRTsOpt = function ( ) {
this . setHideCloseRTsOpt = function ( ) {
$ ( '#hideCloseRTs' ) [ 0 ] . value = this . getHideCloseRTsOpt ( ) ;
function hideCloseRTsCfg ( ) {
if ( $ . Options . getHideCloseRTsOpt ( ) === 'disable' )
if ( this . getHideCloseRTsOpt ( ) === 'disable' ) {
$ ( '#hideCloseRTsDesc' ) . css ( 'display' , 'none' ) ;
$ ( '#hideCloseRTsDesc' ) [ 0 ] . style . display = 'none' ;
else
} else {
$ ( '#hideCloseRTsDesc' ) . css ( 'display' , 'inline' ) ;
$ ( '#hideCloseRTsDesc' ) [ 0 ] . style . display = 'inline' ;
}
}
$ ( '#hideCloseRTs' ) . val ( this . getHideCloseRTsOpt ( ) ) ;
hideCloseRTsCfg ( ) ;
$ ( '#hideCloseRTs' ) . on ( 'change' , function ( ) {
$ ( '#hideCloseRTs' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
hideCloseRTsCfg ( ) ;
if ( this . value === 'disable' ) {
$ ( '#hideCloseRTsDesc' ) [ 0 ] . style . display = 'none' ;
} else {
$ ( '#hideCloseRTsDesc' ) [ 0 ] . style . display = 'inline' ;
}
} ) ;
} ) ;
} ;
} ;
this . getHideCloseRTsHourOpt = function ( ) {
this . getHideCloseRTsHourOpt = function ( ) {
return parseInt ( $ . Option s. getOption ( 'hideCloseRtsHour' , '1' ) ) ;
return parseInt ( this . getOption ( 'hideCloseRtsHour' , '1' ) ) ;
} ;
} ;
this . setHideCloseRTsHourOpt = function ( ) {
this . setHideCloseRTsHourOpt = function ( ) {
$ ( '#hideCloseRtsHour' ) [ 0 ] . value = this . getHideCloseRTsHourOpt ( ) . toString ( ) ;
$ ( '#hideCloseRtsHour' ) . val ( this . getHideCloseRTsHourOpt ( ) . toString ( ) ) ;
$ ( '#hideCloseRtsHour' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'hour(s)' ) ) ; } ) ;
$ ( '#hideCloseRtsHour' ) . on ( 'keyup' , function ( ) { setElemValNumeric ( this , polyglot . t ( 'hour(s)' ) ) ; } ) ;
} ;
this . getIsFollowingMeOpt = function ( ) {
return $ . Options . getOption ( 'isFollowingMe' ) ;
} ;
} ;
this . getFilterLangOpt = function ( ) {
this . getFilterLangOpt = function ( ) {
return this . getOption ( 'filterLang' , 'disable' ) ;
return this . getOption ( 'filterLang' , 'disable' ) ;
}
}
this . setFilterLangOpt = function ( ) {
this . setFilterLangOpt = function ( ) {
function filterLangListCont ( ) {
function filterLangListCont ( ) {
if ( $ . Options . getFilterLangOpt ( ) !== 'disable' ) {
if ( $ . Options . getFilterLangOpt ( ) !== 'disable' )
$ ( '#filterLangListCont' ) [ 0 ] . style . display = 'block' ;
$ ( '#filterLangListCont' ) . css ( 'display' , 'block' ) ;
} else {
else
$ ( '#filterLangListCont' ) [ 0 ] . style . display = 'none' ;
$ ( '#filterLangListCont' ) . css ( 'display' , 'none' ) ;
}
}
}
$ ( '#filterLang' ) . val ( this . getFilterLangOpt ( ) ) ;
$ ( '#filterLang' ) . val ( this . getFilterLangOpt ( ) ) ;
filterLangListCont ( ) ;
filterLangListCont ( ) ;
$ ( '#filterLang' ) . on ( 'change' , function ( ) {
$ ( '#filterLang' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
@ -489,9 +468,9 @@ var TwisterOptions = function()
}
}
this . setFilterLangListOpt = function ( ) {
this . setFilterLangListOpt = function ( ) {
$ ( '#filterLangList' ) . val ( this . getFilterLangListOpt ( ) ) ;
$ ( '#filterLangList' ) . val ( this . getFilterLangListOpt ( ) ) ;
$ ( '#filterLangList' ) . on ( 'keyup' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#filterLangList' ) . on ( 'keyup' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
}
}
this . getFilterLangAccuracyOpt = function ( ) {
this . getFilterLangAccuracyOpt = function ( ) {
@ -499,8 +478,8 @@ var TwisterOptions = function()
}
}
this . setFilterLangAccuracyOpt = function ( ) {
this . setFilterLangAccuracyOpt = function ( ) {
$ ( '#filterLangAccuracy' ) . val ( this . getFilterLangAccuracyOpt ( ) ) ;
$ ( '#filterLangAccuracy' ) . val ( this . getFilterLangAccuracyOpt ( ) ) ;
$ ( '#filterLangAccuracyVal' ) . text ( this . getFilterLangAccuracyOpt ( ) ) ;
$ ( '#filterLangAccuracyVal' ) . text ( this . getFilterLangAccuracyOpt ( ) ) ;
$ ( '#filterLangAccuracy' ) . on ( 'change' , function ( ) {
$ ( '#filterLangAccuracy' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ . Options . setOption ( this . id , this . value ) ;
$ ( '#filterLangAccuracyVal' ) . text ( this . value ) ;
$ ( '#filterLangAccuracyVal' ) . text ( this . value ) ;
@ -513,8 +492,7 @@ var TwisterOptions = function()
this . setFilterLangForPostboardOpt = function ( ) {
this . setFilterLangForPostboardOpt = function ( ) {
$ ( '#filterLangForPostboard' ) . prop ( 'checked' , this . getFilterLangForPostboardOpt ( ) ) ;
$ ( '#filterLangForPostboard' ) . prop ( 'checked' , this . getFilterLangForPostboardOpt ( ) ) ;
$ ( '#filterLangForPostboard' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#filterLangForPostboard' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
}
}
this . getFilterLangForSearchingOpt = function ( ) {
this . getFilterLangForSearchingOpt = function ( ) {
@ -523,8 +501,7 @@ var TwisterOptions = function()
this . setFilterLangForSearchingOpt = function ( ) {
this . setFilterLangForSearchingOpt = function ( ) {
$ ( '#filterLangForSearching' ) . prop ( 'checked' , this . getFilterLangForSearchingOpt ( ) ) ;
$ ( '#filterLangForSearching' ) . prop ( 'checked' , this . getFilterLangForSearchingOpt ( ) ) ;
$ ( '#filterLangForSearching' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#filterLangForSearching' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
}
}
this . getFilterLangForTopTrendsOpt = function ( ) {
this . getFilterLangForTopTrendsOpt = function ( ) {
@ -533,8 +510,7 @@ var TwisterOptions = function()
this . setFilterLangForTopTrendsOpt = function ( ) {
this . setFilterLangForTopTrendsOpt = function ( ) {
$ ( '#filterLangForTopTrends' ) . prop ( 'checked' , this . getFilterLangForTopTrendsOpt ( ) ) ;
$ ( '#filterLangForTopTrends' ) . prop ( 'checked' , this . getFilterLangForTopTrendsOpt ( ) ) ;
$ ( '#filterLangForTopTrends' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#filterLangForTopTrends' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
}
}
this . getFilterLangSimulateOpt = function ( ) {
this . getFilterLangSimulateOpt = function ( ) {
@ -543,28 +519,25 @@ var TwisterOptions = function()
this . setFilterLangSimulateOpt = function ( ) {
this . setFilterLangSimulateOpt = function ( ) {
$ ( '#filterLangSimulate' ) . prop ( 'checked' , this . getFilterLangSimulateOpt ( ) ) ;
$ ( '#filterLangSimulate' ) . prop ( 'checked' , this . getFilterLangSimulateOpt ( ) ) ;
$ ( '#filterLangSimulate' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
$ ( '#filterLangSimulate' ) . on ( 'click' , function ( ) { $ . Options . setOption ( this . id , this . checked ) ; } ) ;
}
}
this . setIsFollowingMeOpt = function ( ) {
this . getIsFollowingMeOpt = function ( ) {
$ ( '#isFollowingMe' ) [ 0 ] . value = this . getIsFollowingMeOpt ( ) ;
return this . getOption ( 'isFollowingMe' , 'in-profile' ) ;
} ;
$ ( '#isFollowingMe' ) . on ( 'change' , function ( ) {
this . setIsFollowingMeOpt = function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
$ ( '#isFollowingMe' ) . val ( this . getIsFollowingMeOpt ( ) ) ;
} ) ;
$ ( '#isFollowingMe' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
} ;
} ;
this . getDMCopySelfOpt = function ( ) {
this . getDMCopySelfOpt = function ( ) {
return $ . Option s. getOption ( 'dmCopySelf' , "enable" ) ;
return thi s. getOption ( 'dmCopySelf' , 'enable' ) ;
}
}
this . setDMCopySelfOpt = function ( ) {
this . setDMCopySelfOpt = function ( ) {
$ ( '#dmCopySelfOpt select' ) [ 0 ] . value = this . getDMCopySelfOpt ( ) ;
$ ( '#dmCopySelfOpt select' ) . val ( this . getDMCopySelfOpt ( ) ) ;
$ ( '#dmCopySelfOpt select' ) . on ( 'change' , function ( ) { $ . Options . setOption ( this . id , this . value ) ; } ) ;
$ ( '#dmCopySelfOpt select' ) . on ( 'change' , function ( ) {
$ . Options . setOption ( this . id , this . value ) ;
} ) ;
}
}
this . InitOptions = function ( ) {
this . InitOptions = function ( ) {
@ -592,7 +565,9 @@ var TwisterOptions = function()
this . setUseProxyOpt ( ) ;
this . setUseProxyOpt ( ) ;
this . setUseProxyForImgOnlyOpt ( ) ;
this . setUseProxyForImgOnlyOpt ( ) ;
this . setTopTrendsAutoUpdateOpt ( ) ;
this . setTopTrendsAutoUpdateOpt ( ) ;
this . setTopTrendsOpt ( ) ;
this . setTopTrendsAutoUpdateTimerOpt ( ) ;
this . setTopTrendsAutoUpdateTimerOpt ( ) ;
this . setWhoToFollowOpt ( ) ;
this . setSplitPostsOpt ( ) ;
this . setSplitPostsOpt ( ) ;
this . setHideRepliesOpt ( ) ;
this . setHideRepliesOpt ( ) ;
this . setHideCloseRTsHourOpt ( ) ;
this . setHideCloseRTsHourOpt ( ) ;