CKEditor ignoring BASEPATH in Laravel - javascript

Installed CKEditor and CKFinder in a Laravel project, both in the Public/js folder
In my main page, I load a site specific .js file which contains
var CKEDITOR_BASEPATH = '/js/ckeditor/';
Also tried:
var CKEDITOR_BASEPATH = 'http://localhost:8888/js/ckeditor/';
Then I load my ckeditor.js file
From my /Resources/Views/admin/newpage.blade.php view, I load up a text box and call CKEditor.replace(). Does it perfectly. I can add a new page, even edit them.
Problem occurs when I try to use the Browse server buttons, it tries to load the plugin from /admin/ckeditor/plugins/... instead of /js/ckeditor/plugins/...
I have a feeling its something simple I am missing, but just not sure what. Any thoughts?

you have to write full address to file file this
<script>
window.CKEDITOR_BASEPATH = 'http://example.com/path/to/libs/ckeditor/';
</script>

use Symfony-2
laravel5 composer

I had a similar issue with laravel and CKEditior.
The difference is I was facing this in plugin folder to give the icon of my custom button
icon: this.path + 'mypath'
solved my issue.
So you may also have to append your path after this.path
Hope it will sove yours too.

Related

Loading external JS / JQuery script via MeteorJS

I'm trying to load an external script while using Meteor.
Currently using this code in my layout.js to some success.
Meteor.startup( function() {
$.getScript('js/scripts.js');
});
However, if I go to another url and come back to it, the script no longer works. (I see it not working because my background cover image disappears.)
Any external scripts should be placed in client/compatibility, and Meteor will load it for you; no need for $.getScript('js/scripts.js');
You can then instantiate that script on the template like:
Template.game.onRendered(function(){
$('.grid').isotope({});
});
For anyone needing help with this, replace Meteor.startup with Template.name.onRendered. This helped solve my issue.
Cheers!

Javascript images error in wordpress

After moving to Wordpress the images of weather cannot be retrieved even though the JavaScript code runs fine. Here is the code that I am using to retrieve images in custom.js. The code:
$('#weather').openWeather({
city: 'New York, US',
placeTarget: '.weather-place',
iconTarget: '.weather-icon',
customIcons: 'files/img/icons/weather/'
});
There is something wrong with
'files/img/icons/weather/'
Well firstly when using html the javascript was in files/js/custom.js and the images were in files/img/weather/ it worked but now with wordpress it does'nt work
Your help would be appreciated.
The files folder is in the root directory.
If your files directory branches off the root, then try adding a slash before the word "files", like so: customIcons: '/files/img/icons/weather/'
Else, you may need to provide the entire path http://www.mydomain.com/files/...
ALSO, you're not providing a file name /files/img/icons/weather/icon.jpg
If you moved to wordpress, the paths might have changed. Where do you keep your javscript library?
I would use the debug console from your browser to see what happens and which icons your script is trying to get and then modify the path. (press F12 and click on the "network" tab, reload the page and check for 404 errors)

slide show not works in downloaded site

I've built a site http://ucemeche.weebly.com , Now I want to transfer it on other server. http://Weebly.com provides a function to download whole site in zip format that I've done.
But problem is when I am browsing that downloaded site the slide shows, photo gallery etc are not working in as working in live site. Perhaps it is related to java script.
Why is it happening ? What is the solution ?
Check the paths of the javascripts. You might be missing some scripts or you do not include them properly.
Check the error console in your browser. Most likely it will show you what's wrong.
You simply have to change the paths to the images in the html file
the paths will be something like:
"2\/1\/2\/5\/56254238\/3375189.png"
change them to:
"..\/folder name where your files are\/uploads\/2\/1\/2\/5\/56254238\/3375189.png"
This was three years ago, so perhaps this is a late answer. There is a hosted file slideshow-jq.js. In it, there is a function largeURL(photo).
Copy that slideshow-jq.js into the root of your zip, and edit the file:
url = '/uploads/' + url.replace(/^\/uploads\//, '');
Remove the leading / in front of uploads.
Now, update your page and look for this line:
<script src="http://cdn2.editmysite.com/js/site/main.js?buildTime=1234"></script><script type='text/javascript' src='http://cdn1.editmysite.com/editor/libraries/slideshow-jq.js?buildTime=1234'></script>
Or something like that. Change the src to the local file, "./slideshow-jq.js"
That corrects the issue.

Zend Framework - tinyMCE - plugin folders are mistaken to be controllers? Help

Hi guys I'm trying to integrate the tinymce plugin however I'm running into problems such that almost every feature which requires a plugin to be rendered i.e the add url popup or add image pop up - it opens an empty pop up window. Even if I try to open it inline I get the same blank popup window.. I noticed that whenever I click on lets say url button in tinymCE it opens with reference to my localhost and because of that I'm assuming my application is mistaking the containing javascript folder to be some controller or action.
How can I fix this please - I've set up mod rewrite to allow clean urls as well as ignore the javascript folder but this is a different issue altogether :(
what should I be looking at here.. I can't notice any error sin firebug..
Try putting .htaccess with following contents into your MCE directory:
RewriteEngine Off
OUCH sorry - I figured it out ... apparently I had set up my htaccess file to ignore file extensions of images but the templates loaded had a file extension of .htm... just added the new extensions to the htaccess and got it fixed.. sorry for panicking thanks anyway!

Having trouble with Lightbox

OK i downloaded all the files and put them into a directory on m server call "lightbox" when I try to use it on a page, the image pops up on the bottom of the page, not overlapping modal like. I changed the images sources in the lightbox.js file to include the lightbox/ directory. The images in the css file are still relative to the css document . So I am not sure why it is not working correctly. Here is a link to the page Clicky
Does anyone have a clue what I am doing wrong?
Thanks!!
UPDATE the text page located here:clicky which is inside the lightbox directory works fine. So I am pretty sure this is happening because I put the files into a folder on my server instead of just on my server, but I would like to keep my files organized so if anyone knows how to make it work from inside a directory?
There is some image paths in the js file. You can modify them there... or better yet add this before the lightbox.js script
<script type="text/javascript">
LightboxOptions = {
fileLoadingImage: '/lightbox/images/loading.gif',
fileBottomNavCloseImage: '/lightbox/images/closelabel.gif'
};
</script>
<script src="js/lightbox.js" type="text/javascript"></script>
This is pretty silly but I put in the correct address for the javascript files but I had put in an incorrect address for the CSS file, after correcting that it worked.

Categories

Resources