Browse Source

add option to enable/disable encryption of DMs's data cache, separate section for DMs in options

readme-update
Simon Grim 7 years ago
parent
commit
9a97fd0328
  1. 39
      js/interface_localization.js
  2. 4
      js/options.js
  3. 6
      js/twister_newmsgs.js
  4. 35
      options.html
  5. 2
      theme_nin/css/style.css
  6. 12
      theme_nin/js/theme_option.js
  7. 5
      theme_nin/sass/_tabs.sass

39
js/interface_localization.js

@ -367,7 +367,8 @@ if(preferredLanguage == "en"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Terminate Daemon": "Terminate Daemon", "Terminate Daemon": "Terminate Daemon",
"New post": "New post", "New post": "New post",
"Search": "Search", "Search": "Search",
@ -736,7 +737,8 @@ if(preferredLanguage == "es"){
"Language": "Idioma", "Language": "Idioma",
"Sound": "Sonido", "Sound": "Sonido",
"Users": "Usuarios", "Users": "Usuarios",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -1099,7 +1101,8 @@ if(preferredLanguage == "uk"){
"Language": "Мова", "Language": "Мова",
"Sound": "Звук", "Sound": "Звук",
"Users": "Користувачі", "Users": "Користувачі",
"Direct Message's copy to self": "Повідомлення скопійовано самому собі", 'dm_copy_outgoing_to_self': 'Повідомлення скопійовано самому собі',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Статистика трафіку", "Traffic information": "Статистика трафіку",
"Direct messages with": "Співбесіда з", "Direct messages with": "Співбесіда з",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
@ -1465,7 +1468,8 @@ if(preferredLanguage == "zh-CN"){
"Language": "语言", "Language": "语言",
"Sound": "声音", "Sound": "声音",
"Users": "用户", "Users": "用户",
"Direct Message's copy to self": "将私信发一份副本给我", 'dm_copy_outgoing_to_self': '将私信发一份副本给我',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Terminate Daemon": "终止后台进程", "Terminate Daemon": "终止后台进程",
"New post": "新推文", "New post": "新推文",
"Search": "搜索", "Search": "搜索",
@ -1835,7 +1839,8 @@ if(preferredLanguage == "nl"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -2199,7 +2204,8 @@ if(preferredLanguage == "it"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -2565,7 +2571,8 @@ if(preferredLanguage == "fr"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -2932,7 +2939,8 @@ if(preferredLanguage == "ru"){
"Language": "Язык", "Language": "Язык",
"Sound": "Звук", "Sound": "Звук",
"Users": "Пользователи", "Users": "Пользователи",
"Direct Message's copy to self": "Синхронизировать отправленные личные сообщения", 'dm_copy_outgoing_to_self': 'Синхронизировать отправленные личные сообщения',
'dm_encrypt_local_cache': 'Шифровать локальный кэш данных',
"Terminate Daemon": "Выключить twister демон", "Terminate Daemon": "Выключить twister демон",
"New post": "Новый пост", "New post": "Новый пост",
"Search": "Поиск", "Search": "Поиск",
@ -3304,7 +3312,8 @@ if(preferredLanguage == "de"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Kopie der Direktnachricht an mich selbst", 'dm_copy_outgoing_to_self': 'Kopie der Direktnachricht an mich selbst',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -3667,7 +3676,8 @@ if(preferredLanguage == "ja"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -4035,7 +4045,8 @@ if(preferredLanguage == "pt-BR"){
"Language": "Language", "Language": "Language",
"Sound": "Sound", "Sound": "Sound",
"Users": "Users", "Users": "Users",
"Direct Message's copy to self": "Direct Message's copy to self", 'dm_copy_outgoing_to_self': 'Copy outgoing messages to self',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Traffic information", "Traffic information": "Traffic information",
"DHT Torrents:": "DHT Torrents:", "DHT Torrents:": "DHT Torrents:",
"Peers:": "Peers:", "Peers:": "Peers:",
@ -4400,7 +4411,8 @@ if(preferredLanguage == "tr"){
"Language": "Dil", "Language": "Dil",
"Sound": "Ses", "Sound": "Ses",
"Users": "Kullanıcılar", "Users": "Kullanıcılar",
"Direct Message's copy to self": "Özel iletinin kopyasını sakla", 'dm_copy_outgoing_to_self': 'Özel iletinin kopyasını sakla',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"Traffic information": "Trafik bilgileri", "Traffic information": "Trafik bilgileri",
"DHT Torrents:": "DHT Torrentleri:", "DHT Torrents:": "DHT Torrentleri:",
"Peers:": "Eşler:", "Peers:": "Eşler:",
@ -4765,7 +4777,8 @@ if(preferredLanguage == "cs"){
"Language": "Jazyk", "Language": "Jazyk",
"Sound": "Zvuky", "Sound": "Zvuky",
"Users": "Uživatelé", "Users": "Uživatelé",
"Direct Message's copy to self": "Posílat kopie přímých zpráv sám sobě", 'dm_copy_outgoing_to_self': 'Posílat kopie přímých zpráv sám sobě',
'dm_encrypt_local_cache': 'Encrypt local data cache',
"New post": "Nový příspěvek", "New post": "Nový příspěvek",
"Search": "Hledat", "Search": "Hledat",
"Direct Msg": "Přímá zpráva", "Direct Msg": "Přímá zpráva",

4
js/options.js

@ -227,6 +227,10 @@ function twisterOptions() {
name: 'dmCopySelf', name: 'dmCopySelf',
valDefault: 'enable' valDefault: 'enable'
}); });
this.add({
name: 'dmEncryptCache',
valDefault: 'enable'
});
this.add({ this.add({
name: 'hideReplies', name: 'hideReplies',
valDefault: 'following' valDefault: 'following'

6
js/twister_newmsgs.js

@ -200,8 +200,10 @@ function saveDMsToStorage() {
}; };
} }
pool = twister.var.key.pub.encrypt(JSON.stringify(pool)); if ($.Options.get('dmEncryptCache') === 'enable') {
delete pool.orig; // WORKAROUND the decrypt function does .slice(0, orig) but something goes wrong in process of buffer decoding (if original string contains non-ASCII characters) and orig may be smaller than the actual size, if it is undefined .slice gets it whole pool = twister.var.key.pub.encrypt(JSON.stringify(pool));
delete pool.orig; // WORKAROUND the decrypt function does .slice(0, orig) but something goes wrong in process of buffer decoding (if original string contains non-ASCII characters) and orig may be smaller than the actual size, if it is undefined .slice gets it whole
}
$.initNamespaceStorage(defaultScreenName).localStorage.set('DMs', pool); $.initNamespaceStorage(defaultScreenName).localStorage.set('DMs', pool);
} }

35
options.html

@ -52,6 +52,8 @@
<label for="t-2" class="tabs selectable_theme theme_nin">Theme</label> <label for="t-2" class="tabs selectable_theme theme_nin">Theme</label>
<input id="t-3" name="option_tab" type="radio" class="selectable_theme theme_nin"/> <input id="t-3" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
<label for="t-3" class="tabs selectable_theme theme_nin">Notifications</label> <label for="t-3" class="tabs selectable_theme theme_nin">Notifications</label>
<input id="t-8" name="option_tab" type="radio" class="selectable_theme theme_nin" />
<label for="t-8" class="tabs selectable_theme theme_nin">Direct Messages</label>
<input id="t-4" name="option_tab" type="radio" class="selectable_theme theme_nin"/> <input id="t-4" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
<label for="t-4" class="tabs selectable_theme theme_nin">Keys</label> <label for="t-4" class="tabs selectable_theme theme_nin">Keys</label>
<input id="t-5" name="option_tab" type="radio" class="selectable_theme theme_nin"/> <input id="t-5" name="option_tab" type="radio" class="selectable_theme theme_nin"/>
@ -194,6 +196,30 @@
</div> </div>
</div> </div>
<div class="DMs">
<div class="module">
<p class="label label-h">Direct Messages</p>
<div class="container">
<form action="" id="dmCopySelfOpt">
<p class="label">dm_copy_outgoing_to_self</p>
<select name="" id="dmCopySelf" class="container">
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
</form>
</div>
<div class="container">
<form action="" id="dmEncryptCacheOpt">
<p class="label">dm_encrypt_local_cache</p>
<select name="" id="dmEncryptCache" class="container">
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
</form>
</div>
</div>
</div>
<div class="keys"> <div class="keys">
<div class="module"> <div class="module">
<p class="label label-h"> Keys </p> <p class="label label-h"> Keys </p>
@ -457,15 +483,6 @@
</select> </select>
</form> </form>
</div> </div>
<div class="container">
<form action="" id="dmCopySelfOpt">
<p class="label">Direct Message's copy to self</p>
<select name="" id="dmCopySelf" class="container">
<option value="disable">Disable</option>
<option value="enable">Enable</option>
</select>
</form>
</div>
</div> </div>
</div> </div>
</div> </div>

2
theme_nin/css/style.css

@ -1415,7 +1415,7 @@ button:disabled:hover, button.disabled:hover, .mini-profile-actions span.disable
visibility: hidden; visibility: hidden;
} }
/* line 42, ../sass/_tabs.sass */ /* line 42, ../sass/_tabs.sass */
.options input#tab_language:checked ~ .tab-content .language, .options input#t-2:checked ~ .tab-content .theme, .options input#t-3:checked ~ .tab-content .notifications, .options input#t-4:checked ~ .tab-content .keys, .options input#t-5:checked ~ .tab-content .appearance, .options input#t-6:checked ~ .tab-content .users, .options input#t-7:checked ~ .tab-content .webtorrent { .options input#tab_language:checked ~ .tab-content .language, .options input#t-2:checked ~ .tab-content .theme, .options input#t-3:checked ~ .tab-content .notifications, .options input#t-4:checked ~ .tab-content .keys, .options input#t-5:checked ~ .tab-content .appearance, .options input#t-6:checked ~ .tab-content .users, .options input#t-7:checked ~ .tab-content .webtorrent, .options input#t-8:checked ~ .tab-content .DMs {
position: relative; position: relative;
z-index: 10; z-index: 10;
opacity: 1; opacity: 1;

12
theme_nin/js/theme_option.js

@ -53,12 +53,8 @@ $(function(){
}); });
function localizeLabels() { function localizeLabels() {
$("label[for=tab_language]").text(polyglot.t("Language")); $('label.tabs').each(function (i, elem) {
$("label[for=t-2]").text(polyglot.t("Theme")); var elem = $(elem);
$("label[for=t-3]").text(polyglot.t("Notifications")); elem.text(polyglot.t(elem.text()));
$("label[for=t-4]").text(polyglot.t("Keys")); });
$("label[for=t-5]").text(polyglot.t("Appearance"));
$("label[for=t-6]").text(polyglot.t("Users"));
$("label[for=t-7]").text(polyglot.t("WebTorrent"));
} }

5
theme_nin/sass/_tabs.sass

@ -48,6 +48,7 @@
&#t-5:checked ~ .tab-content .appearance, &#t-5:checked ~ .tab-content .appearance,
&#t-6:checked ~ .tab-content .users &#t-6:checked ~ .tab-content .users
&#t-7:checked ~ .tab-content .webtorrent &#t-7:checked ~ .tab-content .webtorrent
&#t-8:checked ~ .tab-content .DMs
position: relative position: relative
z-index: 10 z-index: 10
opacity: 1 opacity: 1
@ -59,7 +60,7 @@
text-align: center text-align: center
width: auto width: auto
display: inline-block!important display: inline-block!important
margin: 0 5px 0 0 margin: 0 5px 0 0
padding: 5px 15px padding: 5px 15px
color: $main-color-light color: $main-color-light
background: $background-light background: $background-light
@ -67,5 +68,3 @@
input:checked + label.tabs input:checked + label.tabs
background: $bloc-background-color background: $bloc-background-color
color: $main-color-dark color: $main-color-dark

Loading…
Cancel
Save