Skip to content

Commit

Permalink
Add description how to activate native rich text copy
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 8, 2020
1 parent 0078622 commit 33323fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"config_copyToClipboardFormats_placeholders": { "message": "Available place holders for formats:\n%URL%=Page URL,\n%TITLE%=Page Title,\n%URL_HTMLIFIED%=URL escaped for HTML,\n%TITLE_HTMLIFIED%=Title escaped for HTML,\n%TST_INDENT(indenter)%, %TST_INDENT(indenter1)(indenter2)...(indenterN)%=Indent (powered by Tree Style Tab)\n%TAB%=Tab,\n%EOL%=Line Feed" },
"config_copyToClipboardFormats_placeholders_special": { "message": "Place holders based on page contents (you need to grant required permission):\n%AUTHOR%=Author name (specified by META),\n%DESCRIPTION%=Description (specified by META),\n%KEYWORDS%=Search keywords (specified by META),\n%AUTHOR_HTMLIFIED%=Author name escaped for HTML,\n%DESCRIPTION_HTMLIFIED%=Description escaped for HTML,\n%KEYWORDS_HTMLIFIED%=Search keywords escaped for HTML,\n%RT%=Copy as a rich text (Note: this placeholder itself is cleared from the copied text)" },
"config_copyToClipboardFormats_placeholders_replace": { "message": "There is one more epecial placeholder function: %REPLACE(\"base text\", \"match pattern regular expression 1\", \"replaced text 1\", \"match pattern regular expression 2\", \"replaced text 2\", ...)% It will useful for post-edit of placeholder values. \nFor example: \n%REPLACE(\"%URL%\", \"\\?.*$\", \"\")% \n => URL with stripped query parameters \n%REPLACE(\"%URL%\", \"^((?!\\w+://([^/]*\\.)?(google\\.com|duckduckgo\\.com)/.*).*)\\?.*$\", \"$$1\")% \n => URL with stripped query parameters, except Google and DuckDuckGo" },
"config_howToActivateNativeRichTextCopy_description": { "message": "If you hope to use any rich text format with less troubles, you should go to \"about:config\" and set \"dom.events.asyncClipboard.dataTransfer\" to \"true\"." },

"config_allUrlsPermissionGranted_label": { "message": "Allow to collect data from page contents / Allow to copy data as rich text format" },

Expand Down
1 change: 1 addition & 0 deletions _locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"config_copyToClipboardFormats_placeholders": { "message": "書式には以下のプレースホルダを使えます:\n%URL%=ページのURL,\n%TITLE%=ページのタイトル,\n%URL_HTMLIFIED%=HTML用にエスケープされたURL,\n%TITLE_HTMLIFIED%=HTML用にエスケープされたタイトル,\n%TST_INDENT(indenter)%, %TST_INDENT(indenter1)(indenter2)...(indenterN)%=インデント(Tree Style Tabを使用)\n%TAB%=タブ文字,\n%EOL%=改行" },
"config_copyToClipboardFormats_placeholders_special": { "message": "ページの内容に基づくプレースホルダー(権限の許可が必要です):\n%AUTHOR%=metaタグで指定された作者名,\n%DESCRIPTION%=metaタグで指定された説明文,\n%KEYWORDS%=metaタグで指定された検索用キーワード,\n%AUTHOR_HTMLIFIED%=HTML用にエスケープされた作者名,\n%DESCRIPTION_HTMLIFIED%=HTML用にエスケープされた説明文,\n%KEYWORDS_HTMLIFIED%=HTML用にエスケープされた検索用キーワード,\n%RT%=リッチテキストとしてコピーする(このプレースホルダ自体は空文字に変換されます)" },
"config_copyToClipboardFormats_placeholders_replace": { "message": "%REPLACE(\"置換対象の文字列\", \"置換箇所の正規表現1\", \"置換後の文字列1\", \"置換箇所の正規表現2\", \"置換後の文字列2\", ...)% という書式で高度な置換も行えます。これを使うとプレースホルダーの値を加工できます。\n例: \n%REPLACE(\"%URL%\", \"\\?.*$\", \"\")% \n →常にURL末尾のクエリ文字列を除去\n%REPLACE(\"%URL%\", \"^((?!\\w+://([^/]*\\.)?(google\\.com|duckduckgo\\.com)/.*).*)\\?.*$\", \"$$1\")% \n → GoogleとDuckDuckGo以外でURL末尾のクエリ文字列を除去" },
"config_howToActivateNativeRichTextCopy_description": { "message": "リッチテキスト形式でのコピー機能をより安定して動作するようにするためには、 about:config で dom.events.asyncClipboard.dataTransfer を true に設定してくだい。" },

"config_allUrlsPermissionGranted_label": { "message": "ページの内容からデータを取得することを許可する / データをリッチテキスト形式でコピーすることを許可する" },

Expand Down
9 changes: 8 additions & 1 deletion options/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ ul p.sub {
}

p.syntax-description {
white-space: pre-wrap;
}

.copyable {
-moz-user-select: text;
cursor: text;
white-space: pre-wrap;
}

#howToActivateNativeRichTextCopy {
font-weight: bold;
}
9 changes: 5 additions & 4 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
<p><button id="copyToClipboardFormatsAddNewRow"
title="__MSG_config_copyToClipboardFormats_add__">+</button></p>
<p><button id="copyToClipboardFormatsRestoreDefaults">__MSG_config_copyToClipboardFormats_restoreDefaults__</button></p>
<p class="syntax-description">__MSG_config_copyToClipboardFormats_accesskey__</p>
<p class="syntax-description">__MSG_config_copyToClipboardFormats_placeholders__</p>
<p class="syntax-description">__MSG_config_copyToClipboardFormats_placeholders_special__</p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_accesskey__</p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_placeholders__</p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_placeholders_special__</p>
<p class="sub"
><label id="allUrlsPermissionCheck"><input id="allUrlsPermissionGranted"
type="checkbox">
__MSG_config_allUrlsPermissionGranted_label__</label></p>
<p class="syntax-description">__MSG_config_copyToClipboardFormats_placeholders_replace__</p>
<p class="sub copyable" id="howToActivateNativeRichTextCopy">__MSG_config_howToActivateNativeRichTextCopy_description__</p>
<p class="syntax-description copyable">__MSG_config_copyToClipboardFormats_placeholders_replace__</p>

<hr>

Expand Down

0 comments on commit 33323fe

Please sign in to comment.