mirror of https://github.com/VueTubeApp/VueTube
feat: ✨ stage 1 | plugins
This commit is contained in:
parent
cd7e78feee
commit
a3eca42539
|
@ -1,5 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
<center v-if="plugins.length == 0">
|
||||||
|
<v-icon size="50px">mdi-connection</v-icon>
|
||||||
|
<h2>No plugins installed</h2>
|
||||||
|
</center>
|
||||||
|
|
||||||
<!-- sorry for the mess, I will make a dumb (styles only) standardized card component later - Nik -->
|
<!-- sorry for the mess, I will make a dumb (styles only) standardized card component later - Nik -->
|
||||||
<div
|
<div
|
||||||
v-for="(plugin, index) in plugins"
|
v-for="(plugin, index) in plugins"
|
||||||
|
@ -47,7 +53,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
plugins: new Array(),
|
plugins: [],
|
||||||
installedVersion: process.env.appVersion,
|
installedVersion: process.env.appVersion,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -105,9 +105,7 @@ export default {
|
||||||
{
|
{
|
||||||
name: "Plugins",
|
name: "Plugins",
|
||||||
icon: "mdi-puzzle",
|
icon: "mdi-puzzle",
|
||||||
to: "",
|
to: "/mods/plugins"
|
||||||
to: "/mods/plugins",
|
|
||||||
disabled: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Updates",
|
name: "Updates",
|
||||||
|
|
|
@ -20,6 +20,7 @@ const ytApiVal = {
|
||||||
const filesystem = {
|
const filesystem = {
|
||||||
plugins: "vuetube/plugins",
|
plugins: "vuetube/plugins",
|
||||||
temp: "vuetube/temp",
|
temp: "vuetube/temp",
|
||||||
|
downloads: "vuetube/downloads",
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = {
|
||||||
* Execute code on ALL VueTube pages
|
* Execute code on ALL VueTube pages
|
||||||
************************/
|
************************/
|
||||||
global: function() {
|
global: function() {
|
||||||
|
console.log("This code is now executed when ALL vuetube pages (including settings) are loaded.")
|
||||||
},
|
},
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
|
|
|
@ -38,35 +38,18 @@ const ensureStructure = new Promise(async (resolve, reject) => {
|
||||||
const module = {
|
const module = {
|
||||||
|
|
||||||
|
|
||||||
//--- Get Plugins ---//
|
//--- List Plugins ---//
|
||||||
list: new Promise(async (resolve, reject) => {
|
list: new Promise(async (resolve, reject) => {
|
||||||
let plugins = new Array();
|
|
||||||
|
|
||||||
if (await !ensureStructure) reject("Invalid Structure");
|
if (await !ensureStructure) reject("Invalid Structure");
|
||||||
|
|
||||||
// Temp Plugin List
|
const plugins = await Filesystem.readdir({
|
||||||
plugins = Filesystem.readdir({
|
path: "vuetube/plugins/",
|
||||||
directory: APP_DIRECTORY,
|
directory: APP_DIRECTORY
|
||||||
path: fs.plugins
|
|
||||||
})
|
|
||||||
// End Temp Plugin List
|
|
||||||
resolve(plugins);
|
|
||||||
}),
|
|
||||||
//--- End Get Plugins ---//
|
|
||||||
|
|
||||||
//--- Delete Plugin ---//
|
|
||||||
list: async (pluginName) => {
|
|
||||||
|
|
||||||
console.log(fs.plugins);
|
|
||||||
/*
|
|
||||||
const contents = await Filesystem.readFile({
|
|
||||||
path: 'secrets/text.txt',
|
|
||||||
directory: Directory.Documents,
|
|
||||||
encoding: Encoding.UTF8,
|
|
||||||
});
|
});
|
||||||
*/
|
resolve(plugins);
|
||||||
|
|
||||||
}
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,5 @@
|
||||||
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<access origin="*" />
|
<access origin="*" />
|
||||||
|
|
||||||
<feature name="CDVOrientation">
|
|
||||||
<param name="android-package" value="cordova.plugins.screenorientation.CDVOrientation"/>
|
|
||||||
</feature>
|
|
||||||
|
|
||||||
|
|
||||||
</widget>
|
</widget>
|
|
@ -1,98 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package cordova.plugins.screenorientation;
|
|
||||||
|
|
||||||
import org.apache.cordova.CallbackContext;
|
|
||||||
import org.apache.cordova.CordovaPlugin;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
public class CDVOrientation extends CordovaPlugin {
|
|
||||||
|
|
||||||
private static final String TAG = "YoikScreenOrientation";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Screen Orientation Constants
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final String ANY = "any";
|
|
||||||
private static final String PORTRAIT_PRIMARY = "portrait-primary";
|
|
||||||
private static final String PORTRAIT_SECONDARY = "portrait-secondary";
|
|
||||||
private static final String LANDSCAPE_PRIMARY = "landscape-primary";
|
|
||||||
private static final String LANDSCAPE_SECONDARY = "landscape-secondary";
|
|
||||||
private static final String PORTRAIT = "portrait";
|
|
||||||
private static final String LANDSCAPE = "landscape";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
|
|
||||||
|
|
||||||
Log.d(TAG, "execute action: " + action);
|
|
||||||
|
|
||||||
// Route the Action
|
|
||||||
if (action.equals("screenOrientation")) {
|
|
||||||
return routeScreenOrientation(args, callbackContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action not found
|
|
||||||
callbackContext.error("action not recognised");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean routeScreenOrientation(JSONArray args, CallbackContext callbackContext) {
|
|
||||||
|
|
||||||
String action = args.optString(0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String orientation = args.optString(1);
|
|
||||||
|
|
||||||
Log.d(TAG, "Requested ScreenOrientation: " + orientation);
|
|
||||||
|
|
||||||
Activity activity = cordova.getActivity();
|
|
||||||
|
|
||||||
if (orientation.equals(ANY)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
|
||||||
} else if (orientation.equals(LANDSCAPE_PRIMARY)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
|
||||||
} else if (orientation.equals(PORTRAIT_PRIMARY)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
||||||
} else if (orientation.equals(LANDSCAPE)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
|
||||||
} else if (orientation.equals(PORTRAIT)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
|
||||||
} else if (orientation.equals(LANDSCAPE_SECONDARY)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
|
|
||||||
} else if (orientation.equals(PORTRAIT_SECONDARY)) {
|
|
||||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
callbackContext.success();
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,9 +2,5 @@
|
||||||
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<access origin="*" />
|
<access origin="*" />
|
||||||
|
|
||||||
<feature name="CDVOrientation">
|
|
||||||
<param name="ios-package" value="CDVOrientation"/>
|
|
||||||
</feature>
|
|
||||||
|
|
||||||
|
|
||||||
</widget>
|
</widget>
|
|
@ -9,18 +9,17 @@ install! 'cocoapods', :disable_input_output_paths => true
|
||||||
def capacitor_pods
|
def capacitor_pods
|
||||||
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCommunityHttp', :path => '../../node_modules/@capacitor-community/http'
|
pod 'CapacitorCommunityHttp', :path => '..\..\node_modules\@capacitor-community\http'
|
||||||
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
|
pod 'CapacitorApp', :path => '..\..\node_modules\@capacitor\app'
|
||||||
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
|
pod 'CapacitorBrowser', :path => '..\..\node_modules\@capacitor\browser'
|
||||||
pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device'
|
pod 'CapacitorDevice', :path => '..\..\node_modules\@capacitor\device'
|
||||||
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
pod 'CapacitorFilesystem', :path => '..\..\node_modules\@capacitor\filesystem'
|
||||||
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
pod 'CapacitorHaptics', :path => '..\..\node_modules\@capacitor\haptics'
|
||||||
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
|
pod 'CapacitorShare', :path => '..\..\node_modules\@capacitor\share'
|
||||||
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
|
pod 'CapacitorSplashScreen', :path => '..\..\node_modules\@capacitor\splash-screen'
|
||||||
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
pod 'CapacitorStatusBar', :path => '..\..\node_modules\@capacitor\status-bar'
|
||||||
pod 'CapacitorToast', :path => '../../node_modules/@capacitor/toast'
|
pod 'CapacitorToast', :path => '..\..\node_modules\@capacitor\toast'
|
||||||
pod 'HugotomaziCapacitorNavigationBar', :path => '../../node_modules/@hugotomazi/capacitor-navigation-bar'
|
pod 'HugotomaziCapacitorNavigationBar', :path => '..\..\node_modules\@hugotomazi\capacitor-navigation-bar'
|
||||||
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'App' do
|
target 'App' do
|
||||||
|
|
Loading…
Reference in New Issue