Skip to content

Commit

Permalink
Add configuration to enable or disable the inclusion of website name …
Browse files Browse the repository at this point in the history
…of twitter
  • Loading branch information
ddasutein committed Dec 27, 2021
1 parent 1a74d1c commit 401097b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions js/Configuration/OptionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ let loadHTMLSettings = () => {
case "twitter_random_string_length":
document.getElementById("twitter_settings_string_length").value = x.value;
break;
case "twitter_include_website_title":
document.getElementById("twitter_settings_site_title").checked = x.value;
break;
}
});
break;
Expand Down Expand Up @@ -153,6 +156,7 @@ let loadHTMLSettings = () => {

function SaveOptions() {


switch (htmlPageMeta) {

case "general":
Expand All @@ -162,11 +166,16 @@ function SaveOptions() {
break;

case "twitter":
console.log("TEST")

SaveSettings("twitter_include_mention_symbol", document.getElementById("twitter_settings_include_mention_symbol").checked);
SaveSettings("twitter_include_tweet_id", document.getElementById("twitter_settings_include_tweet_id").checked);
SaveSettings("twitter_include_date", document.getElementById("twitter_settings_include_date_checkbox").checked);
SaveSettings("twitter_date_format", document.getElementById("twitter_settings_select_date_format").value);
SaveSettings("twitter_random_string_length", document.getElementById("twitter_settings_string_length").value);
console.log(document.getElementById("twitter_settings_site_title").checked)
SaveSettings("twitter_include_website_title", document.getElementById("twitter_settings_site_title").checked);

break;

case "lineblog":
Expand Down
5 changes: 3 additions & 2 deletions js/Configuration/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ chrome.storage.local.get({
twitter_include_date: false,
twitter_date_format: "0",
twitter_random_string_length: "4",
twitter_include_website_title: false,
//#endregion

//#region LINE BLOG Settings
Expand Down Expand Up @@ -120,8 +121,8 @@ chrome.storage.local.get({

{
category: CategoryEnum.Twitter,
name: chrome.i18n.getMessage("twitter_settings_include_website_name"),
value: items.twitter_include_date,
name: chrome.i18n.getMessage("twitter_settings_site_title"),
value: items.twitter_include_website_title,
key: "twitter_include_website_title"
},

Expand Down
10 changes: 10 additions & 0 deletions js/Event/Twitter/TwitterContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ function SaveTwitterMedia(tabUrl, url, linkUrl){
temp[temp.indexOf("{date}")] = GetDateFormat(key.value);
}
break;

case 5:
if (!key.value){
idx = temp.indexOf("Twitter");
if (idx > -1){
temp.splice(idx, 1)
}
}

break;
}
}));
console.log(temp)
Expand Down

0 comments on commit 401097b

Please sign in to comment.