Add: lang

This commit is contained in:
cutls 2020-02-08 23:48:31 +09:00
parent 72daf55e4e
commit 5d9327d3d3
8 changed files with 34 additions and 1 deletions

View File

@ -317,6 +317,7 @@ function srcBox(mode) {
} else if (mode == 'close') { } else if (mode == 'close') {
if(!selectedText) { if(!selectedText) {
$('#pageSrc').addClass('hide') $('#pageSrc').addClass('hide')
$('#pageSrc').removeClass('keep')
} }
} else { } else {
$('#pageSrc').toggleClass('hide') $('#pageSrc').toggleClass('hide')
@ -340,9 +341,16 @@ document.addEventListener('selectionchange', function() {
} }
}) })
function doSrc(type) { function doSrc(type) {
$('#pageSrc').addClass('hide')
$('#pageSrc').removeClass('keep')
var q = $('#pageSrcInput').val() var q = $('#pageSrcInput').val()
if(type == 'web') { if(type == 'web') {
postMessage(["openUrl", 'https://google.com/search?q=' + q], "*") var start = localStorage.getItem('srcUrl')
if(!start) {
start = 'https://google.com/search?q={q}'
}
start = start.replace(/{q}/, q)
postMessage(["openUrl", start], "*")
} else if(type == 'ts') { } else if(type == 'ts') {
tsAdd(q) tsAdd(q)
} }

View File

@ -1,6 +1,8 @@
{ {
"draghere":"Drag here to upload", "draghere":"Drag here to upload",
"close":"Close", "close":"Close",
"webSrc": "Search on Web",
"tsSrc": "Search on tootsearch",
"showSelectProf":"Show profile of the selecting account", "showSelectProf":"Show profile of the selecting account",
"closethisbox":"Close this box", "closethisbox":"Close this box",
"toot":"Toot", "toot":"Toot",

View File

@ -35,6 +35,8 @@
"useragent":"User agent", "useragent":"User agent",
"useragentWarn":"Restart when changed", "useragentWarn":"Restart when changed",
"absolute": "absolute value", "absolute": "absolute value",
"srcUrl": "Search engine",
"srcUrlWarn": "{q} will be replaced to query.",
"themeSel": "Select theme", "themeSel": "Select theme",
"customtheme": "Edit and add custom themes", "customtheme": "Edit and add custom themes",
"customthemeDirection": "Color scheme", "customthemeDirection": "Color scheme",

View File

@ -1,6 +1,8 @@
{ {
"draghere":"ドラッグしてみ?(ドラッグしたらすぐアップロードされるで)", "draghere":"ドラッグしてみ?(ドラッグしたらすぐアップロードされるで)",
"close":"Close", "close":"Close",
"webSrc": "Webでさがす",
"tsSrc": "tootsearchでさがす",
"showSelectProf":"このアカウントのプロフィール出す", "showSelectProf":"このアカウントのプロフィール出す",
"closethisbox":"このボックスなおす", "closethisbox":"このボックスなおす",
"post-new":"投稿", "post-new":"投稿",

View File

@ -34,6 +34,8 @@
"useragent":"ユーザーエージェント", "useragent":"ユーザーエージェント",
"useragentWarn":"再起動すんで。", "useragentWarn":"再起動すんで。",
"absolute": "絶対指定", "absolute": "絶対指定",
"srcUrl": "検索エンジン",
"srcUrlWarn": "{q}が検索文字列になるで。",
"themeSel": "テーマの選択", "themeSel": "テーマの選択",
"customtheme": "カスタムテーマの作成・編集", "customtheme": "カスタムテーマの作成・編集",
"customthemeDirection": "色の系統", "customthemeDirection": "色の系統",

View File

@ -1,5 +1,7 @@
{ {
"draghere":"ここにドラッグして添付(ドラッグと同時にアップロードされます)", "draghere":"ここにドラッグして添付(ドラッグと同時にアップロードされます)",
"webSrc": "Webで検索",
"tsSrc": "tootsearchで検索",
"close":"Close", "close":"Close",
"showSelectProf":"選択したアカウントのプロフィールを表示", "showSelectProf":"選択したアカウントのプロフィールを表示",
"closethisbox":"このボックスを閉じる", "closethisbox":"このボックスを閉じる",

View File

@ -35,6 +35,8 @@
"useragent":"ユーザーエージェント", "useragent":"ユーザーエージェント",
"useragentWarn":"再起動します。", "useragentWarn":"再起動します。",
"absolute": "絶対指定", "absolute": "絶対指定",
"srcUrl": "検索エンジン",
"srcUrlWarn": "{q}が検索文字列に置換されます。",
"themeSel": "テーマの選択", "themeSel": "テーマの選択",
"customtheme": "カスタムテーマの作成・編集", "customtheme": "カスタムテーマの作成・編集",
"customthemeDirection": "色の系統", "customthemeDirection": "色の系統",

View File

@ -129,6 +129,19 @@ var envConstruction = [
head: '@@useragent@@', head: '@@useragent@@',
desc: '@@useragentWarn@@' desc: '@@useragentWarn@@'
} }
},
{
id: 'srcUrl',
storage: 'srcUrl',
checkbox: false,
doubleText: false,
width: 200,
setValue: 'https://google.com/search?q={q}',
text: {
head: '@@srcUrl@@',
desc: '@@srcUrlWarn@@',
after: ''
}
} }
] ]
var tlConstruction = [ var tlConstruction = [