Editing all files & folders inside Wordpress Dashboard - javascript

I know it is possible to edit php and css file in the editor in dashboard [Appearance -> Editor].. But i was wondering why it is not possible to edit all the folders [including js files] in the editor..
I searched for this and found a plugin to make all files editable inside wordpress dashboard.. https://wordpress.org/plugins/solid-code-theme-editor/
But still is there anyway to do it by adding any javascript or shortcode or whatever??

Unfortunately there isn't a way to extend the types of files that Appearance -> Editor lets you edit (for example, adding files in subfolders, or JS files). I've tried to find a way to do this before, but - despite almost everything else being hook'able in WordPress - there is no way to hook into the file editor to change the way it works.
This could be for security reasons (having the ability to edit files like this can be a problem in the first place anyway), but in the end, the only way to add the ability to edit every file is to use an outside-of-WordPress editor, which is what the plugin you referred to does.
I usually disable the Editor entirely (by adding define('DISALLOW_FILE_EDIT',true); to wp-config.php), and use another method of editing the theme instead (usually FTP, or occasionally the file manager accessible through the web host's control panel). This way you'll have access to everything you need.

Related

How to disable backups for custom widgets in Vaadin 7

In my Vaadin application a custom widget which extends AbstractJavaScriptComponent has several files as follows. These files are available in browser:
Comp1Html.js.exe
Comp1Html_bak.js
Comp1Htmlold
Are these bak and old files required? Also, how to remove these unwanted files?
You need to preserve all files that are directly referenced through e.g. a #JavaScript annotation or indirectly referenced by e.g. being included from another script file. The exact details on that is highly depending on the specifics of this particular component.
The easiest way to find out which files are actually needed might be to temporary put a copy of all the files somewhere else and then try removing each file and checking if everything still seems to work.

How to implement plugins into Electron app?

I'm looking for a way to implement "Plugins" for my Electron tool.
Below is a pseudo example of how I'm thinking it would work
Supply .js/.zip/plugin file
File would contain name of plugin, and it's category (Global, Team centric, Misc)
File would contain HTML for the GUI, which get's placed in a div designated for tool space. This name would be added as an option to the necessary Select, as well as logic added to pull in the HTML to the same div
In the tool, select the plugin file:
page will load the JavaScript script, and add option to select along with logic to switch to the plugin
The hope is to automate my current process.
Currently I'm manually updating the index page to reference the new JavaScript script, and to add the option on the select
The JavaScript Script has logic in it looking at the Select, and looking to see if the option was selected
which then pulls in it's own HTML via a function within
Is there anything I can reference/utilize to make this work?
After 4+ months of working on this, I've managed to get this to work. I will try to outline my approach.
Each "plugin" or "tool" will need it's own .js file
the js file should contain an exports.html function that will return the html for the tool
the js file should contain an exports.Events function that adds all relevant event listeners
create a json file cataloging each tool, along with information needed i.e. a description, image path, .js file path, etc.
require the .js file when selected, load the html and the events
parse the json to figure out which tool to load along with needed info
all i need to do is update the json file and upload the .js file to add a new plugin.
I developed an electron app using vue as the front-end.
My idea was to develop plugins as vue plugins and publish via npm.
I used live-plugin-manager to install and uninstall plugins.
The dependencies were automatically removed by making use of a counter
The only problem I faced was how to load these installed plugins into my main app.
The workaround I found was posted as answer to my own question at How to use electron to load the vue plugins installed dynamically into a plugins folder
Hope it helps
I know I'm a little late to the party but I encountered the same problem. To solve it I have built a plugin framework for Electron called Pluggable Electron and it is available on npm.
The framework handles the lifecycle of plugins, provides as npm packages, like installation, activation, removal, etc. The plugins can then be called on at any time to exend the core app functionality.
The framework is still under development but you can find a 1st version here: pluggable-electron.
I expect it is too late for Marker but still answering here for anyone else that might have this question.

.Net Core and Typescript: how to instruct TFS to ignore generated js and js.map files

I have a .NET Core project and I want to use TypeScript. I would like to exclude the generated .js and .js.map files from my check-ins.
I have tried the tfignore approach described here, but this does not seem to work.
Any suggestion?
If it does not work then you likely already have the file under source control. You will need to remove the existing fine from source before the .ignore file will work.
If you delete the files from source control, check in, and get latest then you should not see them re-added to source control.
First, please make sure your .tfignore file created without any problem. This file does not have any suffix. One way to create it suggest you to rename a new.txt file with "tfignore." It will auto change to right .tfignore file.
You can also use the auto automatically generated .tfignore file, follow below steps:
In the Pending Changes page, in the Excluded Changes section, choose
the Detected changes link.
The Promote Candidate Changes dialog box appears.
Select a file, open its context menu, and choose Ignore this local
item, Ignore by extension, Ignore by file name, or Ignore by folder.
Choose OK or Cancel to close the Promote Candidate Changes dialog
box.
A .tfignore file appears in the Included Changes section of the
Pending Changes page. You can open this file and modify it to meet
your needs.
More info please check the Customize which files are ignored by version control from MSDN Link:Add files to the server
Second, just as MrHinsh said, it does not work when you already have the file under source control. You could try to create or generate some new js and js.map files for test. If the files already in source control you need to unbind/bind those files.
Another way to solve the issue is updating your VS to VS2015Update 3. The .tfignore should be indeed working correctly. More detail ways you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes

How to add a file library and be able to edit it

I want to use a specific file in Webstorm IDE for help with the autocomplete on other files, Im using the module pattern so one file has the main methods used for the others modules. So in Webstorm I added this file as a library as is explained here http://www.jetbrains.com/webstorm/webhelp/configuring-javascript-libraries.html .
The problem is that now that is a library I CANT edit it any more or add new code to this file. So I have to remove it from the Webstorm scope to be able to edit it. And then add it again in the scope(library) when Im working in the other files and has the ability to use the autocomplete.
So how can I add this file as a library AND tell webstorm that he should let me add and edit current content for this file?
Library files write protection was implemented by design to prevent users from making accidental modifications to them. Recommended workflow is to open library files as separate project for editing, or include them not as "library" but as a separate content root. http://youtrack.jetbrains.com/issue/WEB-1065 requires making the current behavior optional. You are welcome to vote for it

What components are absolute requirements for TinyMCE?

I am working within ExactTarget which is a SalesForce subsidiary application and using their language AMPscript to create web forms which will update a Database table for use on publicly visible web pages. I want to use a wysiwyg Text Editor to allow non-coders to have more flexibility in editing these form "textarea" components. It was suggested I use TinyMCE. The challenge is that for this project I do not have an FTP accessible area to store the full set of application folders. In other instances I've been able to include only the required components of a .js and get the required functionality.
I uploaded tinymce.min.js and placed the selector on the page. Without other components I don't see any text editing tools or a toolbar (nothing changed) on the still plain as day textarea.
Am wondering if anyone knows the core and minimal set of files from within the plugins, themes, skins and langs directory that would be required. If it's only a few components I can rebuild it and probably edit the code to locate the files within ExactTarget. Otherwise it may simply be too complex an undertaking for this project.
Any other suggestions on resolving this are welcome.
Assuming that you are building this tool in an ExactTarget microsite/landing page, is there any reason why you can't just use the CDN for TinyMCE? From TinyMCE's documentation, you would only have to include the following lines to get an editor working in a textarea:
<script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea"
});
</script>
If for some reason this is not an option, and you have to upload TinyMCE files to ExactTarget, it actually is possible to upload files to a hierarchy by selectively uploading files to the Portfolio and/or uploading files to a microsite using personalized URLs.

Categories

Resources