I downloaded a custom build for CKEditor open source from the website and followed the documentation to set it up. I put the following in my header.html file which is included in EVERY file:
<script src="./includes/ckeditor/ckeditor.js"></script>
<script>
window.onload = function() {
CKEDITOR.replaceAll();
};
</script>
I was under the impression that this would load the script and then replace all <textarea> fields in forms with the editor but i'm just getting basic editors as default with textarea's. Any idea? All files were uploaded to the root/includes/ckeditor directory when unzipped.
Turns out it was an apache permissions issue. Problem solved.
Related
The problem is that I'm not being able to do this:
<script src="./app/node_modules/tone/build/Tone.js"></script>
<script>
var synth = new Tone.Synth();
</script>
I get this in the console output:
chromium: [INFO:CONSOLE(50)] "Uncaught ReferenceError: Tone is not defined"
Any help will be greatly appreciated.
What could be wrong here:
WebView would not understand that path at all.
node_modules folder won't be available after compilation.
So what you could do
Place your JS file within the same folder where you have your HTML, so you can use relative path.
If you use Webpack make sure the configuration is updated to include those HTML and JS files during build.
Is there a simple way to initialize ckeditor in source mode so it won't format the content?
When I am saving certain code I save it in source mode and that works great, but to keep it from editing my code I need to track if it was saved in source mode and also load it in source mode to make it easier to edit information.
I found the answer. It is really simple thankfully.
<script type="text/javascript">
CKEDITOR.replace( 'editor1' ).config.startupMode = 'source';
</script>
I am using Typescript SDK 0.9.1.1 and WebStorm 7. I have a .ts file with a file watcher transpiling its .js and sourcemap files. I also have an HTML file that looks like this...
<!DOCTYPE html>
<html>
<head></head>
<body>
<p id="output">5</p>
<script src="HelloWorld.js"></script>
<script>
var u = new Utils();
document.getElementById('output').innerHTML = u.plusOne(5);
</script>
</body>
</html>
The plusOne function simply takes the number (in this case, 5) and returns that number plus one. My page, javascript and Typescript work fine, because the page says "6" when loaded.
I can set breakpoints in the .js file and they are hit (showing me the Typescript file's equivalent line) but if I set breakpoints in the original .ts file they are not. I've searched for this issue but my problem seems different from others' - I am running locally (not remotely) and I am setting the breakpoints in WebStorm, not Chrome's debug view.
In WebStorm, the Scripts tab shows only the .js and .html files. Should I be seeing more here? If that's the problem, how do I fix it? I've opened the debug configuration but I don't see a way to add the .ts file there.
To those of you that got here via Google:
All I had to do was make sure that sourceMap was set to true in my tsConfig.json like so:
{
...
"compilerOptions": {
...
"sourceMap": true,
...
},
...
}
Turns out this is due to an open bug in WebStorm. In practical terms, the workaround is to reload the HTML page from the browser (which is NOT the same as rerunning the HTML page in debug mode from WebStorm). If you do that then the breakpoints in the .ts file will be hit.
I am trying to create a Hello World JS Metro app on Visual Studio 2011, using YUI3.
I´ve grabbed a local copy of YUI, added to a subfolder in the solution, and added a reference to yui-min.js on my default.html page:
<!-- TodoJS references -->
<link href="/css/default.css" rel="stylesheet">
<script src="/js/default.js"></script>
<script src="js/yui/build/yui/yui.js"></script>
and then at the bottom of the page I´ve added the following code:
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
YUI().use("event", function () {
//some code will go here..
});
}, false);
</script>
When I run the code, I get a null ref error on YUI(). I do get intelissense working in Visual Studio (e.g YUI().add), so the reference seems to be OK, but YUI is not found on run time. Any tips?
I would try the steps outlined in How To: Create a Windows 8 Metro App with JS and YUI 3
I take it that you've got the issue fixed. However if you'd like to use the YUI components such as "calendar", "tabview" etc, you'll have to modify a few files that include innerHTML calls and wrap the added html content with toStaticHTML.
There were only a couple of files(dom-base.js, yui.js) that needed to be modified and most of the components worked fine(including the "datatable" and "charts" widgets), with the exception of the rich text editor. The nice thing about YUI is that it supports touch gestures for a majority of the components, for example panning "datatable" works correctly.
I'm having trouble figuring out why when I create a new MVC 3 application the jQuery intellisence is not working until I alter the script tag in my _Layout page. According to a tutorial I watched, as long as I placed the vsdoc file in my scripts folder, I should have jQuery intellisense but that is not the case, at least thats not happening for me. After creating a new project, here is what the script tag looks like in my _Layout.cshtml page:
<script src="#Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
I have included the vsdoc file in my Scripts folder but I do not have jQuery intellisense. If I do a view sorce on the page here is what I see:
<script src="/Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
It doesn't look as if the path is correctly resolved.
So I then delete this tag and replace it by dragging and dropping the file to the page and end up with this:
<script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
Now I get jQuery intellisense. So why do I have to make these changes befeore I get intellisense? Is this something that others have experienced or am I possibly doing something wrong? It seems like the #Url.Content functionality is broke and leads me to wonder if maybe I will have problems with it for other uses like placing images on a form.
As far as I am aware, your vsdoc.js script cannot just exist in the scripts folder. It has to be referenced in every view that will use it.
You should reference it like this:
#if (false) {
<script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
}
Note: Check the version of the file that you reference is correct.
The if statement will prevent the browser from actually downloading the file.