${extensions}`,
18 | };
19 | });
20 | }
21 |
22 | function onselect(mode) {
23 | const activeFile = editorManager.activeFile;
24 |
25 | let modeAssociated;
26 | try {
27 | modeAssociated = JSON.parse(localStorage.modeassoc || "{}");
28 | } catch (error) {
29 | modeAssociated = {};
30 | }
31 |
32 | modeAssociated[Path.extname(activeFile.filename)] = mode;
33 | localStorage.modeassoc = JSON.stringify(modeAssociated);
34 |
35 | activeFile.setMode(mode);
36 | }
37 |
--------------------------------------------------------------------------------
/src/palettes/changeTheme/style.scss:
--------------------------------------------------------------------------------
1 | .theme-item {
2 | display: flex;
3 | align-items: center;
4 | justify-content: space-between;
5 | padding: 4px;
6 | width: 100%;
7 |
8 | span {
9 | font-size: 1rem;
10 | }
11 |
12 | .current {
13 | color: var(--error-text-color);
14 | background-color: var(--primary-color);
15 | border-radius: 5px;
16 | padding: 2px 6px;
17 | font-size: 0.8rem;
18 | margin-left: 8px;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/palettes/commandPalette/index.js:
--------------------------------------------------------------------------------
1 | import palette from "components/palette";
2 | import helpers from "utils/helpers";
3 |
4 | export default async function commandPalette() {
5 | const recentCommands = RecentlyUsedCommands();
6 | const { editor } = editorManager;
7 | const commands = Object.values(editor.commands.commands);
8 |
9 | const isEditorFocused = editor.isFocused();
10 |
11 | palette(generateHints, onselect, strings["type command"], () => {
12 | if (isEditorFocused) editor.focus();
13 | });
14 |
15 | function generateHints() {
16 | const hints = [];
17 |
18 | commands.forEach(({ name, description, bindKey }) => {
19 | /**
20 | * @param {boolean} recentlyUsed Is the command recently used
21 | * @returns {{value: string, text: string}}
22 | */
23 | const item = (recentlyUsed) => ({
24 | value: name,
25 | text: `
${description ?? name}${bindKey?.win ?? ""}`,
26 | });
27 | if (recentCommands.commands.includes(name)) {
28 | hints.unshift(item(true));
29 | return;
30 | }
31 | hints.push(item());
32 | });
33 |
34 | return hints;
35 | }
36 |
37 | function onselect(value) {
38 | const command = commands.find(({ name }) => name === value);
39 | if (!command) return;
40 | recentCommands.push(value);
41 | command.exec(editorManager.editor);
42 | }
43 | }
44 |
45 | function RecentlyUsedCommands() {
46 | return {
47 | /**
48 | * @returns {string[]}
49 | */
50 | get commands() {
51 | return (
52 | helpers.parseJSON(localStorage.getItem("recentlyUsedCommands")) || []
53 | );
54 | },
55 | /**
56 | * Saves command to recently used commands
57 | * @param {string} command Command name
58 | * @returns {void}
59 | */
60 | push(command) {
61 | const { commands } = this;
62 | if (commands.length > 10) {
63 | commands.pop();
64 | }
65 | if (commands.includes(command)) {
66 | commands.splice(commands.indexOf(command), 1);
67 | }
68 | commands.unshift(command);
69 | localStorage.setItem("recentlyUsedCommands", JSON.stringify(commands));
70 | },
71 | };
72 | }
73 |
--------------------------------------------------------------------------------
/src/plugins/Executor/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.foxdebug.acode.exec",
3 | "version": "1.0.0",
4 | "description": "Execute linux commands",
5 | "cordova": {
6 | "id": "com.foxdebug.acode.exec",
7 | "platforms": [
8 | "android"
9 | ]
10 | },
11 | "keywords": [
12 | "ecosystem:cordova",
13 | "cordova-android"
14 | ],
15 | "author": "",
16 | "license": "ISC"
17 | }
18 |
--------------------------------------------------------------------------------
/src/plugins/Executor/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
Executor
3 |
--------------------------------------------------------------------------------
/src/plugins/Executor/www/Executor.js:
--------------------------------------------------------------------------------
1 | var exec = require('cordova/exec');
2 |
3 | module.exports.execute = function (cmd,success,failure) {
4 | exec(success, failure, 'Executor', 'exec', [cmd]);
5 | }
--------------------------------------------------------------------------------
/src/plugins/browser/android/com/foxdebug/browser/Plugin.java:
--------------------------------------------------------------------------------
1 | package com.foxdebug.browser;
2 |
3 | import android.content.Intent;
4 | import com.foxdebug.browser.BrowserActivity;
5 | import org.apache.cordova.CallbackContext;
6 | import org.apache.cordova.CordovaPlugin;
7 | import org.json.JSONArray;
8 | import org.json.JSONException;
9 | import org.json.JSONObject;
10 |
11 | public class Plugin extends CordovaPlugin {
12 |
13 | @Override
14 | public boolean execute(
15 | String action,
16 | JSONArray args,
17 | CallbackContext callbackContext
18 | ) throws JSONException {
19 | if (action.equals("open")) {
20 | String url = args.getString(0);
21 | JSONObject theme = args.getJSONObject(1);
22 | boolean onlyConsole = args.optBoolean(2, false);
23 | String themeString = theme.toString();
24 | Intent intent = new Intent(cordova.getActivity(), BrowserActivity.class);
25 |
26 | intent.putExtra("url", url);
27 | intent.putExtra("theme", themeString);
28 | intent.putExtra("onlyConsole", onlyConsole);
29 | cordova.getActivity().startActivity(intent);
30 | callbackContext.success("Opened browser");
31 | return true;
32 | }
33 | return false;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/plugins/browser/index.js:
--------------------------------------------------------------------------------
1 | import settings from 'lib/settings';
2 | import themes from 'theme/list';
3 |
4 | const SERVICE = 'Browser';
5 |
6 | function open(url, isConsole = false) {
7 | const ACTION = 'open';
8 | const success = () => { };
9 | const error = () => { };
10 | const theme = themes.get(settings.value.appTheme).toJSON('hex');
11 | cordova.exec(success, error, SERVICE, ACTION, [url, theme, isConsole]);
12 | }
13 |
14 | export default {
15 | open,
16 | };
--------------------------------------------------------------------------------
/src/plugins/browser/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cordova-plugin-browser",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC"
11 | }
--------------------------------------------------------------------------------
/src/plugins/browser/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | cordova-plugin-browser
5 | In app browser
6 | Apache 2.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/plugins/browser/res/android/menu_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/plugins/browser/res/android/menu_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/plugins/browser/res/android/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/src/plugins/browser/utils/updatePackage.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 |
4 | const configXML = path.resolve(__dirname, "../../../config.xml");
5 | const menuJava = path.resolve(__dirname, "../../../platforms/android/app/src/main/java/com/foxdebug/browser/Menu.java");
6 | const repeatChar = (char, times) => {
7 | let res = "";
8 | while (--times >= 0) res += char;
9 | return res;
10 | };
11 |
12 | try {
13 | const config = fs.readFileSync(configXML, "utf8");
14 | const fileData = fs.readFileSync(menuJava, "utf8");
15 | const appName = /widget id="([0-9a-zA-Z\.\-_]*)"/.exec(config)[1].split(".").pop();
16 | const newFileData = fileData.replace(/(import com\.foxdebug\.)(acode|acodefree)(.R;)/, `$1${appName}$3`);
17 | fs.writeFileSync(menuJava, newFileData);
18 |
19 | const msg = `==== Changed package to com.foxdebug.${appName} ====`;
20 |
21 | console.log("");
22 | console.log(repeatChar("=", msg.length));
23 | console.log(msg);
24 | console.log(repeatChar("=", msg.length));
25 | console.log("");
26 |
27 | } catch (error) {
28 | console.error(error);
29 | process.exit(1);
30 | }
--------------------------------------------------------------------------------
/src/plugins/ftp/LICENSE.md:
--------------------------------------------------------------------------------
1 | - GoldRaccoon is under [original author's license](https://github.com/albertodebortoli/GoldRaccoon/blob/master/LICENSE.markdown)
2 | - ftp4j is under [LGPL](http://opensource.org/licenses/LGPL-2.1)
3 | - All other codes (writen by me) are under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
4 |
--------------------------------------------------------------------------------
/src/plugins/ftp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cordova-plugin-ftp",
3 | "version": "1.1.1",
4 | "description": "This cordova plugin is created to use ftp (client) in web/js.",
5 | "cordova": {
6 | "id": "cordova-plugin-ftp",
7 | "platforms": [
8 | "android",
9 | "ios"
10 | ]
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/xfally/cordova-plugin-ftp"
15 | },
16 | "keywords": [
17 | "cordova",
18 | "ftp",
19 | "cordova-android",
20 | "cordova-ios"
21 | ],
22 | "author": "pax",
23 | "license": "Apache-2.0",
24 | "bugs": {
25 | "url": "https://github.com/xfally/cordova-plugin-ftp/issues"
26 | },
27 | "homepage": "https://github.com/xfally/cordova-plugin-ftp",
28 | "scripts": {
29 | "test": "echo \"Error: no test specified\" && exit 1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/plugins/ftp/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | Ftp
5 | Cordova Ftp Plugin
6 | MIT
7 | cordova,ftp
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/plugins/iap/index.d.ts:
--------------------------------------------------------------------------------
1 | interface Iap {
2 | getProducts(
3 | skuList: Array
,
4 | onSuccess: (skuList: Array