From 6b8956d20a03c1af8413740d48cd5f65ad15a776 Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Fri, 15 May 2026 13:26:52 +0530 Subject: [PATCH 1/6] feat: add shareText --- package-lock.json | 11 +++++++ package.json | 1 + src/cm/commandRegistry.js | 31 +++++++++++++++++++ src/lib/selectionMenu.js | 1 + .../android/com/foxdebug/system/System.java | 21 +++++++++++++ src/plugins/system/www/plugin.js | 3 ++ 6 files changed, 68 insertions(+) diff --git a/package-lock.json b/package-lock.json index b73017cc4..1aee51a4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,6 +100,7 @@ "babel-loader": "^10.1.1", "com.foxdebug.acode.rk.auth": "file:src/plugins/auth", "com.foxdebug.acode.rk.customtabs": "file:src/plugins/custom-tabs", + "com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot", "com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal", "com.foxdebug.acode.rk.plugin.plugincontext": "file:src/plugins/pluginContext", "cordova-android": "^15.0.0", @@ -5264,6 +5265,10 @@ "resolved": "src/plugins/custom-tabs", "link": true }, + "node_modules/com.foxdebug.acode.rk.exec.proot": { + "resolved": "src/plugins/proot", + "link": true + }, "node_modules/com.foxdebug.acode.rk.exec.terminal": { "resolved": "src/plugins/terminal", "link": true @@ -10605,6 +10610,12 @@ "dev": true, "license": "MIT" }, + "src/plugins/proot": { + "name": "com.foxdebug.acode.rk.exec.proot", + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, "src/plugins/sdcard": { "name": "cordova-plugin-sdcard", "version": "1.1.0", diff --git a/package.json b/package.json index 561d84d7f..f32af4910 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "babel-loader": "^10.1.1", "com.foxdebug.acode.rk.auth": "file:src/plugins/auth", "com.foxdebug.acode.rk.customtabs": "file:src/plugins/custom-tabs", + "com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot", "com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal", "com.foxdebug.acode.rk.plugin.plugincontext": "file:src/plugins/pluginContext", "cordova-android": "^15.0.0", diff --git a/src/cm/commandRegistry.js b/src/cm/commandRegistry.js index 498d09d26..d76e50827 100644 --- a/src/cm/commandRegistry.js +++ b/src/cm/commandRegistry.js @@ -436,6 +436,14 @@ function registerCoreCommands() { requiresView: true, run: pasteCommand, }); + + addCommand({ + name: "share", + description: "Share", + readOnly: false, + requiresView: true, + run: shareCommand, + }); addCommand({ name: "problems", description: "Show errors and warnings", @@ -1293,6 +1301,29 @@ function pasteCommand(view) { return true; } +function shareCommand(view) { + const resolvedView = resolveView(view); + if (!resolvedView) return false; + const { state } = resolvedView; + const ranges = state.selection.ranges; + const segments = []; + let changes = []; + ranges.forEach((range) => { + if (range.empty) { + const line = state.doc.lineAt(range.head); + segments.push(state.doc.sliceString(line.from, line.to)); + changes.push({ from: line.from, to: line.to, insert: "" }); + return; + } + segments.push(state.doc.sliceString(range.from, range.to)); + changes.push({ from: range.from, to: range.to, insert: "" }); + }); + const textToShare = segments.join("\n"); + system.shareText(textToShare,console.log,console.error); + console.log("Sharing text:", textToShare); + return true; +} + function selectWordCommand(view) { const resolvedView = resolveView(view); if (!resolvedView) return false; diff --git a/src/lib/selectionMenu.js b/src/lib/selectionMenu.js index 53b8a966e..1559f6b93 100644 --- a/src/lib/selectionMenu.js +++ b/src/lib/selectionMenu.js @@ -42,6 +42,7 @@ export default function selectionMenu() { "all", true, ), + item(() => exec("share"), , "selected"), item( (color) => acode.exec("insert-color", color), , diff --git a/src/plugins/system/android/com/foxdebug/system/System.java b/src/plugins/system/android/com/foxdebug/system/System.java index f9852bbd1..dc1e9b581 100644 --- a/src/plugins/system/android/com/foxdebug/system/System.java +++ b/src/plugins/system/android/com/foxdebug/system/System.java @@ -114,6 +114,13 @@ import android.content.pm.PackageManager; import android.os.Build; +import android.content.Intent; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaPlugin; + +import org.json.JSONArray; +import org.json.JSONException; public class System extends CordovaPlugin { @@ -234,6 +241,20 @@ public void run() { case "set-intent-handler": setIntentHandler(callbackContext); return true; + + case "shareText": + String text = args.getString(0); + + Intent shareIntent = new Intent(Intent.ACTION_SEND); + shareIntent.setType("text/plain"); + shareIntent.putExtra(Intent.EXTRA_TEXT, text); + + cordova.getActivity().startActivity( + Intent.createChooser(shareIntent, "Share") + ); + + callbackContext.success(); + return true; case "set-ui-theme": this.cordova.getActivity() .runOnUiThread( diff --git a/src/plugins/system/www/plugin.js b/src/plugins/system/www/plugin.js index 7ff70f551..519b4f988 100644 --- a/src/plugins/system/www/plugin.js +++ b/src/plugins/system/www/plugin.js @@ -30,6 +30,9 @@ module.exports = { getInstaller: function (success, error) { cordova.exec(success, error, 'System', 'getInstaller', []); }, + shareText: function (text, success, error) { + cordova.exec(success, error, 'System', 'shareText', [text]); + }, getNativeLibraryPath: function (success, error) { From 46c51fe74798c80b0552a7e207de989404caf51d Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Fri, 15 May 2026 13:35:49 +0530 Subject: [PATCH 2/6] fix --- src/cm/commandRegistry.js | 18 ++++++++++------ src/lib/selectionMenu.js | 2 +- .../android/com/foxdebug/system/System.java | 21 ++++++++++++------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/cm/commandRegistry.js b/src/cm/commandRegistry.js index d76e50827..6a1c1e139 100644 --- a/src/cm/commandRegistry.js +++ b/src/cm/commandRegistry.js @@ -440,7 +440,7 @@ function registerCoreCommands() { addCommand({ name: "share", description: "Share", - readOnly: false, + readOnly: true, requiresView: true, run: shareCommand, }); @@ -1304,23 +1304,29 @@ function pasteCommand(view) { function shareCommand(view) { const resolvedView = resolveView(view); if (!resolvedView) return false; + const { state } = resolvedView; const ranges = state.selection.ranges; const segments = []; - let changes = []; + ranges.forEach((range) => { if (range.empty) { const line = state.doc.lineAt(range.head); segments.push(state.doc.sliceString(line.from, line.to)); - changes.push({ from: line.from, to: line.to, insert: "" }); return; } + segments.push(state.doc.sliceString(range.from, range.to)); - changes.push({ from: range.from, to: range.to, insert: "" }); }); + const textToShare = segments.join("\n"); - system.shareText(textToShare,console.log,console.error); - console.log("Sharing text:", textToShare); + + system.shareText( + textToShare, + console.log, + console.error + ); + return true; } diff --git a/src/lib/selectionMenu.js b/src/lib/selectionMenu.js index 1559f6b93..14930e715 100644 --- a/src/lib/selectionMenu.js +++ b/src/lib/selectionMenu.js @@ -42,7 +42,7 @@ export default function selectionMenu() { "all", true, ), - item(() => exec("share"), , "selected"), + item(() => exec("share"), , "selected",true), item( (color) => acode.exec("insert-color", color), , diff --git a/src/plugins/system/android/com/foxdebug/system/System.java b/src/plugins/system/android/com/foxdebug/system/System.java index dc1e9b581..8f2946ca9 100644 --- a/src/plugins/system/android/com/foxdebug/system/System.java +++ b/src/plugins/system/android/com/foxdebug/system/System.java @@ -245,15 +245,22 @@ public void run() { case "shareText": String text = args.getString(0); - Intent shareIntent = new Intent(Intent.ACTION_SEND); - shareIntent.setType("text/plain"); - shareIntent.putExtra(Intent.EXTRA_TEXT, text); + cordova.getActivity().runOnUiThread(() -> { + try { + Intent shareIntent = new Intent(Intent.ACTION_SEND); + shareIntent.setType("text/plain"); + shareIntent.putExtra(Intent.EXTRA_TEXT, text); - cordova.getActivity().startActivity( - Intent.createChooser(shareIntent, "Share") - ); + cordova.getActivity().startActivity( + Intent.createChooser(shareIntent, "Share") + ); - callbackContext.success(); + callbackContext.success(); + + } catch (Exception e) { + callbackContext.error(e.getMessage()); + } + }); return true; case "set-ui-theme": this.cordova.getActivity() From 9aaedfcd80f442fe725935d6881f0c45c7f8eeb3 Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Sat, 16 May 2026 08:38:14 +0530 Subject: [PATCH 3/6] format --- src/cm/commandRegistry.js | 6 +----- src/lib/selectionMenu.js | 7 ++++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cm/commandRegistry.js b/src/cm/commandRegistry.js index 6a1c1e139..4b4302711 100644 --- a/src/cm/commandRegistry.js +++ b/src/cm/commandRegistry.js @@ -1321,11 +1321,7 @@ function shareCommand(view) { const textToShare = segments.join("\n"); - system.shareText( - textToShare, - console.log, - console.error - ); + system.shareText(textToShare, console.log, console.error); return true; } diff --git a/src/lib/selectionMenu.js b/src/lib/selectionMenu.js index 14930e715..1afee3160 100644 --- a/src/lib/selectionMenu.js +++ b/src/lib/selectionMenu.js @@ -42,7 +42,12 @@ export default function selectionMenu() { "all", true, ), - item(() => exec("share"), , "selected",true), + item( + () => exec("share"), + , + "selected", + true, + ), item( (color) => acode.exec("insert-color", color), , From 04bdf5284bfed09e8de23bab3e2c27a57b2efc11 Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Sun, 17 May 2026 11:56:06 +0530 Subject: [PATCH 4/6] feat: added toggle --- src/lang/ar-ye.json | 6 ++++-- src/lang/be-by.json | 6 ++++-- src/lang/bn-bd.json | 6 ++++-- src/lang/cs-cz.json | 6 ++++-- src/lang/de-de.json | 6 ++++-- src/lang/en-us.json | 2 ++ src/lang/es-sv.json | 6 ++++-- src/lang/fr-fr.json | 6 ++++-- src/lang/he-il.json | 6 ++++-- src/lang/hi-in.json | 6 ++++-- src/lang/hu-hu.json | 6 ++++-- src/lang/id-id.json | 6 ++++-- src/lang/ir-fa.json | 6 ++++-- src/lang/it-it.json | 6 ++++-- src/lang/ja-jp.json | 6 ++++-- src/lang/ko-kr.json | 6 ++++-- src/lang/ml-in.json | 6 ++++-- src/lang/mm-unicode.json | 6 ++++-- src/lang/mm-zawgyi.json | 6 ++++-- src/lang/pl-pl.json | 6 ++++-- src/lang/pt-br.json | 6 ++++-- src/lang/pu-in.json | 6 ++++-- src/lang/ru-ru.json | 6 ++++-- src/lang/tl-ph.json | 6 ++++-- src/lang/tr-tr.json | 6 ++++-- src/lang/uk-ua.json | 6 ++++-- src/lang/uz-uz.json | 6 ++++-- src/lang/vi-vn.json | 6 ++++-- src/lang/zh-cn.json | 6 ++++-- src/lang/zh-hant.json | 6 ++++-- src/lang/zh-tw.json | 6 ++++-- src/lib/selectionMenu.js | 17 ++++++++++------- src/lib/settings.js | 1 + src/settings/editorSettings.js | 7 +++++++ 34 files changed, 140 insertions(+), 67 deletions(-) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index 7c453bf15..ad46c44b2 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 1d32cd69e..7d46eca26 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index 01bf8d581..fdedc0fbc 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index 7a51a366f..b3b94f05f 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/de-de.json b/src/lang/de-de.json index 40cc4fbca..1cb62af6c 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 51f53f3ad..87dfe408c 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -81,6 +81,7 @@ "settings saved": "Settings saved", "show line numbers": "Show line numbers", "show hidden files": "Show hidden files", + "show share button": "Show share button", "show spaces": "Show spaces", "soft tab": "Soft tab", "sort by name": "Sort by name", @@ -672,6 +673,7 @@ "settings-info-editor-rtl-text": "Switch right-to-left behavior per line.", "settings-info-editor-scroll-settings": "Adjust scrollbar size, speed, and gesture behavior.", "settings-info-editor-shift-click-selection": "Extend selection with Shift + tap or click.", + "settings-info-editor-show-share-button": "Show share button in selection menu.", "settings-info-editor-show-spaces": "Display visible whitespace markers.", "settings-info-editor-soft-tab": "Insert spaces instead of tab characters.", "settings-info-editor-tab-size": "Set how many spaces each tab step uses.", diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index adae05ea4..43b1e44ba 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index e00bebc64..2ea5369cc 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/he-il.json b/src/lang/he-il.json index 68bed40df..00316e411 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 70e7dac59..e6c3d8ae3 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 87db04b35..9ef1e1e21 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Szövegek méretezése az Acode teljes felületén.", "plugin-not-supported": "A bővítmény nem támogatott", "plugin-not-supported-info": "A bővítmény az Acode egy régebbi verziójához készült.", - "login-to-view": "Jelentkezzen be a megtekintéséhez…" -} + "login-to-view": "Jelentkezzen be a megtekintéséhez…", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 48b7253f0..2d57df7c0 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Skalakan teks di seluruh antarmuka Acode.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index 01bdb45bb..add7c6ce9 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/it-it.json b/src/lang/it-it.json index c69296a47..922895a6d 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index e6ae384ca..9a14919b1 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index ec3422a53..b9f16053d 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index 860e876ba..b601fdab6 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index a9d447263..9f3c2b1a6 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 37c48ebb4..153de5ad4 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index e83e693af..6ee2aef7f 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index f3859a002..be6e641fb 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index c15b011cb..0e611927d 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index 214c42f42..02aa524b4 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index eff0fc0f1..cbc401e83 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 5de5fbfad..1e182c520 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index f79045a3b..55817cce8 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -730,5 +730,7 @@ "settings-info-editor-auto-close-tags": "Автоматично вставляти закриваючі теги у файли шаблонів HTML, XML, Vue, Angular та PHP.", "ui zoom": "Масштабування інтерфейсу користувача", "settings-info-app-ui-zoom": "Масштабування тексту в інтерфейсі Acode.", - "login-to-view": "Будь ласка, увійдіть для перегляду цього..." -} + "login-to-view": "Будь ласка, увійдіть для перегляду цього...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index b632aa13f..5bbf1282e 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 9aca036f5..29731b153 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 3885a02f7..3447d1810 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "缩放所有 Acode 界面文字。", "plugin-not-supported": "不支持该插件", "plugin-not-supported-info": "该插件仅适用于旧版本的 Acode。", - "login-to-view": "请先登录以查看此内容……" -} + "login-to-view": "请先登录以查看此内容……", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 20c6257b6..dd9662776 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "縮放所有 Acode 介面文字。", "plugin-not-supported": "不支持該插件", "plugin-not-supported-info": "該插件僅適用於舊版本的 Acode。", - "login-to-view": "請先登錄以查看此內容……" -} + "login-to-view": "請先登錄以查看此內容……", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index e21883d13..a9bdf3563 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -730,5 +730,7 @@ "settings-info-app-ui-zoom": "Scale text across the Acode interface.", "plugin-not-supported": "Plugin not supported", "plugin-not-supported-info": "The plugin was created for older version of Acode.", - "login-to-view": "Please login to view this..." -} + "login-to-view": "Please login to view this...", + "show share button": "Show share button", + "settings-info-editor-show-share-button": "Show share button in selection menu." +} \ No newline at end of file diff --git a/src/lib/selectionMenu.js b/src/lib/selectionMenu.js index 1afee3160..b54dc193d 100644 --- a/src/lib/selectionMenu.js +++ b/src/lib/selectionMenu.js @@ -1,3 +1,5 @@ +import appSettings from "lib/settings"; + const exec = (command) => { const { editor } = editorManager; editor.execCommand(command); @@ -42,12 +44,13 @@ export default function selectionMenu() { "all", true, ), - item( - () => exec("share"), - , - "selected", - true, - ), + appSettings.get("showShareButton") && + item( + () => exec("share"), + , + "selected", + true, + ), item( (color) => acode.exec("insert-color", color), , @@ -60,7 +63,7 @@ export default function selectionMenu() { true, ), ...items, - ]; + ].filter(Boolean); } /** diff --git a/src/lib/settings.js b/src/lib/settings.js index b092daf40..e14f8886d 100644 --- a/src/lib/settings.js +++ b/src/lib/settings.js @@ -192,6 +192,7 @@ class Settings { }, developerMode: false, shiftClickSelection: false, + showShareButton: true, }; this.value = structuredClone(this.#defaultSettings); } diff --git a/src/settings/editorSettings.js b/src/settings/editorSettings.js index cf31d2bb7..48697205a 100644 --- a/src/settings/editorSettings.js +++ b/src/settings/editorSettings.js @@ -196,6 +196,13 @@ export default function editorSettings() { info: strings["settings-info-editor-shift-click-selection"], category: categories.cursorSelection, }, + { + key: "showShareButton", + text: strings["show share button"], + checkbox: values.showShareButton ?? true, + info: strings["settings-info-editor-show-share-button"], + category: categories.cursorSelection, + }, { key: "rtlText", text: strings["line based rtl switching"], From 1ba8b5951f5cf567e51f93002685f291c90e2cad Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Sun, 17 May 2026 11:57:07 +0530 Subject: [PATCH 5/6] format --- src/lang/ar-ye.json | 2 +- src/lang/be-by.json | 2 +- src/lang/bn-bd.json | 2 +- src/lang/cs-cz.json | 2 +- src/lang/de-de.json | 2 +- src/lang/es-sv.json | 2 +- src/lang/fr-fr.json | 2 +- src/lang/he-il.json | 2 +- src/lang/hi-in.json | 2 +- src/lang/hu-hu.json | 2 +- src/lang/id-id.json | 2 +- src/lang/ir-fa.json | 2 +- src/lang/it-it.json | 2 +- src/lang/ja-jp.json | 2 +- src/lang/ko-kr.json | 2 +- src/lang/ml-in.json | 2 +- src/lang/mm-unicode.json | 2 +- src/lang/mm-zawgyi.json | 2 +- src/lang/pl-pl.json | 2 +- src/lang/pt-br.json | 2 +- src/lang/pu-in.json | 2 +- src/lang/ru-ru.json | 2 +- src/lang/tl-ph.json | 2 +- src/lang/tr-tr.json | 2 +- src/lang/uk-ua.json | 2 +- src/lang/uz-uz.json | 2 +- src/lang/vi-vn.json | 2 +- src/lang/zh-cn.json | 2 +- src/lang/zh-hant.json | 2 +- src/lang/zh-tw.json | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index ad46c44b2..d13c8135e 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 7d46eca26..9082d61eb 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index fdedc0fbc..508bdbe54 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index b3b94f05f..e238f4403 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/de-de.json b/src/lang/de-de.json index 1cb62af6c..1101e810a 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index 43b1e44ba..ea9f3c1d1 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index 2ea5369cc..b726ae610 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/he-il.json b/src/lang/he-il.json index 00316e411..0dd6fc2b5 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index e6c3d8ae3..ff4262922 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 9ef1e1e21..b8b0a23c3 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -733,4 +733,4 @@ "login-to-view": "Jelentkezzen be a megtekintéséhez…", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 2d57df7c0..b1cb192b2 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index add7c6ce9..ecb619b3a 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/it-it.json b/src/lang/it-it.json index 922895a6d..f5e5db536 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index 9a14919b1..6918b5890 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index b9f16053d..1d14d9031 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index b601fdab6..297e6b842 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index 9f3c2b1a6..772818505 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 153de5ad4..771cc3aeb 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index 6ee2aef7f..a5a41db56 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index be6e641fb..68e29b4c5 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index 0e611927d..958b1e7b1 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index 02aa524b4..1fb32621e 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index cbc401e83..48036a8ac 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 1e182c520..d467fc891 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index 55817cce8..110d7c690 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -733,4 +733,4 @@ "login-to-view": "Будь ласка, увійдіть для перегляду цього...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 5bbf1282e..9a240b511 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 29731b153..5b41e76a5 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 3447d1810..1720b8f4e 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -733,4 +733,4 @@ "login-to-view": "请先登录以查看此内容……", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index dd9662776..3d723e577 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -733,4 +733,4 @@ "login-to-view": "請先登錄以查看此內容……", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index a9bdf3563..5acbc3390 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -733,4 +733,4 @@ "login-to-view": "Please login to view this...", "show share button": "Show share button", "settings-info-editor-show-share-button": "Show share button in selection menu." -} \ No newline at end of file +} From 753f03e1b21f045416053192077acd5037655e31 Mon Sep 17 00:00:00 2001 From: Rohit Kushwaha Date: Mon, 18 May 2026 14:29:38 +0530 Subject: [PATCH 6/6] fix: conflict --- src/lang/id-id.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 9e9815175..7e133d51c 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -729,7 +729,7 @@ "ui zoom": "Pembesaran UI", "settings-info-app-ui-zoom": "Skalakan teks di seluruh antarmuka Acode.", "show share button": "Show share button", - "settings-info-editor-show-share-button": "Show share button in selection menu." + "settings-info-editor-show-share-button": "Show share button in selection menu.", "plugin-not-supported": "Plugin tidak didukung", "plugin-not-supported-info": "Plugin dibuat untuk versi lama dari Acode.", "login-to-view": "Mohon login untuk melihat ini..."