Ace Code Editor theme 403 - javascript

I have installed the code editor Ace onto my site (not locally). Now I am trying to load the theme 'ambiance' as shown in the available themes here.
editor.setTheme("ace/theme/ambiance");
However its failing to load returning a 403 response. I can see it being used with no issue on the ace kitchen sink page here.
The other themes I have tried have loaded with no problem, so why am I getting 403 forbidden for ambiance since its clearly listed in the themes repo?

Which installation instructions did you follow (link please)?
I did
git clone https://github.com/ajaxorg/ace-builds.git
and the contents of ace-builds/src show no obvious problem with theme-ambiance.js.
All I can suggest is to debug the problem in a browser with great devtools, like Google Chrome.

Related

Why is a cloudflare script being inserted into source for Drupal domain?

Code for a CloudFlare script is being inserted into the source for one of my sites (Drupal) and I do not know where it is coming from. Someone suggested that it may be related to a Superfish module but I have searched and can't find it. It appears to be the cause of some problems because it links to an old version of d3.js.
It's probably because you have Rocket Loader enabled in your CloudFlare settings. Check that and report back. There might be other settings causing it as well. Can you post the website so I can check further?
At some time a Drupal module or theme must have installed the link to cloudflare in the the variable table in the Drupal mysql database (sometimes when a module is uninstalled it does not clean up 100%) I deleted the entry and the script isn't being inserted anymore.

Prestashop Bitnami link css and js files only with the default theme, why?

Good morning dears,
I had installed the Prestashop Bitnami on localhost (with XAMPP) and all works good.
BUT!
I have a theme (elena, Velathemes) have good feedbacks, and it work very well on my live store (prestashop 1.6.1.4) and when i try to install the same one on the localhost prestashop (1.6.1.5 !!!) don't find any CSS or Js (Firebug error log show nothing strange, i attached a screenshot however).
I tried to update Prestashop, and it improved a little bit.. some CSS appear but the most ones no..
The back office works good, the deafult theme too.
I had install it with the .zip file on the BO
Someone have any idea where i mistake?
Thank you so much
You need to go on the BO and:
Disable caching (when designing is better)
Regenerate Thumbnails
Force the HTML compilation
You may have configured shop wrongly. In back office go to Preferences -> SEO& URLs and do the following changes and save the changes.
Shop Domain: localhost:8080
SSL Domain: localhost:8080
Base URI: /preshtashop/
Then clear your cache and look again.
You have cached all.css file on your screenshot. Please refresh the cache by "Advanced parameters->Performance->Clear cache"
Then please check paths of your js scripts, css files in modules, theme files. If no links in result html please check paths and real css and js locations.

ThreeCSG.js minimal example

I am trying to learn ThreeCSG.js, the javascript Constructive Solid Geometry front-end to Three.js. I thought I would start by copying a minimal example from the web. I tried to save a local copy of Chandler Prall's amazing little javascript Constructive Solid Geometry example using ThreeCSG.js from the site
https://stemkoski.github.io/Three.js/CSG.html
When I made a local copy of the page (using Chrome's Save as webpage, complete command), I found that the checkerboard texture file was missing. I got the following javascript console error:
Failed to load resource: net::ERR_FILE_NOT_FOUND
with the full path name of the (missing) jpg file. When I manually downloaded the jpg file and put it where Chrome was looking for the jpg file, I got a different error:
The cross-origin image at file:///C:/tmp/images/checkerboard.jpg may not be loaded.
My browser is Chrome 43.0.2357.134, Windows 7 64. I ran into similar problems with IE. Thinking it might be a bug/feature of three.js, I tried the most recent version of three.min.js, but got syntax errors. (The example uses an older version of threecsg.js, and the API has changed.)
What am I doing wrong?
It does not download the image directory so notable to load that and throws the error here in code
var floorTexture = new THREE.ImageUtils.loadTexture( 'images/checkerboard.jpg' );
you need to download that image and use any webserver to render the html page as it is making ajax request to render that image
The Problem you are facing is called CORS.
You need to configure your browser according to this github wiki article:
How to run things locally
Pasting links without further information is bad practise, but the settings depend on what browser you are using.
Another solution is to run it on a local server, how to do so is also explained in the second link.
If you are using Chrome and it's just for testing, there is a Chrome extension that will Allow-Control-Allow-Origin
The main problem is you are fetching the file locally. The file need to be fetched from the server. So the best choice is use some IDE like net beans and execute it as a Web Application

What does "Failed to get composer template data" mean in Facebook lint?

I've created a trivial prototype app on Facebook. When my test script (JavaScript on Ubuntu command line, powered by Node.js) tries to access the app, it produces this error message:
{ error:
{ message: 'Invalid OAuth access token.',
type: 'OAuthException',
code: 190
}
}
So I'm trying to debug using Facebook's lint debugger. However when I paste the app's access token into lint, it responds with:
Failed to get composer template data.
I have no idea what this means, and a lengthy stumble through Google reveals page after page of people who are similarly clueless.
Has anyone seen this error, and fixed it?
Details about the app:
It's configured to ask for read_insights and manage_pages alongside standard permissions. No other permissions are requested.
Settings, Basic: I've had to put a nonexistent URL in the secure canvas URL, since I don't have any SSL hosting anywhere. The non-SSL canvas URL is complete and points to an existing page.
"App Info" is all filled in (apart from Tagline which is optional).
I haven't submitted the app for approval for public use, and there are no "items for approval". I'm going to be the only person who ever uses it, this isn't necessary for this app.
Switching from "live" to "sandbox" and back again doesn't make any difference.
There are no warnings anywhere on the app developer page.
A client I worked for was experiencing a similar issue - when sharing certain URLs on Facebook, the Facebook Sharer wasn't picking up any of the thumbnails. Frustrated with that, the client was trying to clear the Sharer's cache using the debugger at https://developers.facebook.com/tools/debug/, hoping that this way Facebook will re-cache the page and display the corresponding images.
However, in doing so, the client was seeing the ambiguous "Failed to get composer template data." error, and resorted to me for a solution.
I did my research, and it turned out that Facebook had decided to block the domain of the CDN that my client was using to serve images from. Since the pages were loading all images from that CDN, none of the images were getting picked up and the debugger was returning that "Failed to get composer template data." error.
The moment we started serving the images from a new CDN, Facebook started picking them up correctly, and the error disappeared.
Hope that helps you!
P.S. Please note however, this is not a permanent solution if you are violating Facebook's terms in some way. Yes - Facebook's spam prevention algorithms do return false positives sometimes, but most of the time they have a pretty good reason to block your content.
P.P.S. Worth noting, in the case I'm describing, when we passed the CDN URL to the debugger, it returned "This link is blocked, or you have triggered an excessive amount of scrapes. If you think you're seeing this by mistake, please let us know."
I had same error, "Failed to get composer template data.".
I believe my path to Images was blacklisted by Facebook. Workaround was to create virtual path that points to Images folder. Then I could reference /Images with /OGImages virtual directory. Then I no longer received the error.
Had kind of the same problem, I figured out I needed to use HTTPS instead of HTTP for the image link, and everything went fine then.
Hope it may help !
I had just the same problem and it appeared suddenly after several months without any site changes except content. First I thought the Facebook spam filter had blocked our site, as suggested by a Ycombinator comment thread but then I found the real problem.
In fact it was the official Facebook Wordpress plugin that was acting up. Disabling it meant that the Facebook debugger could once again fetch our data and sharing started to work immediately.
In my case is was a "Facebook Share Buttons" plugin for Wordpress. I've deactivated the plugin and resolved the issue.

Wordpress not loading javascript file

I have just uploaded a wordpress site from previously developing it on my localhost. On my localhost there are several plugin javascript files that are picked up and used to display a tooltip on the google map plugin for the markers.
On my localhost this all works fine but when i uploaded this through FTP, some of the javascript files appear to longer be loaded. Is there any way to check which files are being uploaded when the page is loading the javascript?
Whenever i try to check or edit the file from Filezilla, it gives a Microsoft JScript runtime error, Code: 800A1391, Error: 'document' is undefined, so i can't check that what the host uses is the exact same code as my localhost.
Many thanks,
Dan
Most browser developer toolkits (Dragonfly, Chrome Developer Tools, Firebug, etc) include a Net tab which will tell you which files have been requested and the status of them.
Try using either firebug http://getfirebug.com/ with Firefox or the Chrome web inspector and look at the (Net/Network) panel while you reload the page to see if the js files are trying to load. This should give you some insight.

Categories