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

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!

Related

atom.io : Open Files via Clickable Links within Javascript Comments

Is there way, in Atom, to open files that are mentioned in comments?
When I edit a code file, there are often other code files of interest that I may want to also open while working on that file. Sometimes these reference files are miles away and require numerous steps of navigation to open them via the left-pane tree structure.
I was thinking, it would be nice if I could put relative file paths into javascript comments in a manner that atom would understand that if I click that path it should open that file in a new tab.
I suspect this isn't an original idea, so I'm hoping someone can direct me to a solution that enables this type of functionality or make me aware of how it is already enabled but I must use some syntax I'm not currently using.
I found open-project-file and it seems like a nice fit.
Update: I tested it and it works great! You just click on the relative path (whether it is located in code or comment) and by hitting ctrl-shift-o it immediately opens the file in a new tab within the atom editor.

djangobyexample book - jquery bookmarklet not working at all

I'm working through Django By Example and in one chapter a jQuery bookmarklet is built within a Django app so that a user can easily save jpg images from a website into their user profile area within the Django app.
The tutorial does give exact instructions on what to do which I have followed and although I have managed to get the bookmarklet button to appear in my bookmarks bar in Chrome, nothing happens when I click it when browsing a webpage with jpg images.
This is my local Django dashboard where the bookmarklet button is added to the bookmarks bar and this part works fine
and this is how it must look like when clicked on the bookmarklet, this is the part where nothing happens for me when I clicked on bookmarklet.
(how to solve this?)
These are the relevant js files
https://github.com/davejonesbkk/bookmarks/blob/master/images/templates/bookmarklet_launcher.js
https://github.com/davejonesbkk/bookmarks/blob/master/images/static/js/bookmarklet.js
I believe the JavaScript launcher is unable to load the JavaScript files or the JS launcher itself is not getting loaded.
The JavaScript launcher is getting called through a Django template tag "include" inside the anchor tag.
this is the link:
https://github.com/davejonesbkk/bookmarks/blob/master/account/templates/account/dashboard.html
I tried debugging it through CTRL+SHIFT+I console where trouble showed that "include" tag not working properly.
Your include tag is split over two lines:
images from other websites → <a href="javascript:{% include
"bookmarklet_launcher.js" %}" class="button">Bookmark it</a><p>
Django does not support multiple line tags. Change it to:
images from other websites → Bookmark it<p>
I have faced the similar error while going through the book.
The bookmark button is not functioning,when i debugged it through chrome debugger,i could able to see errors at js level.I have made two changes to resolve these errors.
1.Error message: net::ERR_ABORTED
Action step:
In the book its mentioned that to place bookmarklet.js in images application directory,but in bookmarklet_launcher.js the source is refered to below path
http://127.0.0.1:8000/static/js/bookmarklet.js?r=
So place bookmarklet.js in /static/js/ directory inside images application(if folder structure not available create it).
2.Error message: net::ERR_ABORTED
There is one more file that should be placed which is bookmarklet.css which is being refereed at below line in bookmarklet.js.
href: static_url + 'css/bookmarklet.css?r=' + Math.floor(Math.random()*99999999999999999999)
Action step:
create a file bookmarklet.css inside /static/css/ directory and place the css code.Refer below link for css code:
Git Hub link for css code reference
1.After the above steps,restart the development server.
2.Drag the bookmark it button to create a bookmark in browser.
3.Open any website that is HTTP(not https) and click on bookmark it(The one which is bookmarked in browser not bookmark it button).
4.The below pop up appears
the problem is that template doesn't exist so try t do the following
**
1. make sure your include code in same line
2. make sure same name of the template exist on your project director /images/templates/file_name.js.
3. or go to setting and add your templates directory to templates.
4. if it load but no images views don't forget that you only accept jpeg and jpg images only
** so you can try another sites like wikipedia **
I was able to solve this by making sure that the url from ngrok tunnel in the bookmarklet.js and bookmarklet_luncher.js starts with https not http
Instead of this http://127.0.0.1:8000/static/js/bookmarklet.js?r= it should rather be
https://127.0.0.1:8000/static/js/bookmarklet.js?r=
After 4 hours of doing everything... googling, deleting code, and rewriting code...
Only had to hit Ctrl+C to stop server and re-run server .
Just take a break and come back to fix it :)
Mine works same as instructed in the book – no changes, no nothing.
Only restarted the server.

CKEditor ignoring BASEPATH in Laravel

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.

How to look at the Javascript that a page is using?

Are you able to see the coding of a Javascript function on a webpage your viewing? Is there a way using Google Chrome DevTools for example?
Specifically, I want to figure out how to code something like this
!Example 1
from this page
http://www.indeed.com/cmp/Bruce-Productions/jobs/Graphic-Designer-0a8d9cff06bf2790
Thanks in advance for any help!
Yes there is a way to look at all of a webpages html, Javascript files, and CSS using Chrome.
Open up the page in chrome, right click on the page and select inspect element (or press ctrl+shift+I).
From there you can navigate the different elements on the the page and the structure of the HTML file.
To get at the Javascript and CSS files switch over to the sources tab and look through the folders on the left to find the file you are looking for.
A word of warning, depending on the site the code that they are using may be minified (most all of the white space removed, and lots of variable names and other things shortened) or otherwise very difficult to read. If you are looking to do something more specific then I would recommend searching for that, or posting a question regarding that problem.
If you want to view the Javascript code, you can right-click the page, then select Inspect, then navigate to the javascript line by highlighting or selecting that line with .js extension and then position your pointer in the .js file, right-click & select Reveal in Sources panel.
In the browser you do right click to open a menu and select "View Source Code". Then you can read or save that page to analyze the content for any image or script.
But your question is so generic maybe you should try something basic and try to builds thing from there. Otherwise make a more specific question of what you want to do.
You can check it by opening the inspector in your browser and selecting the "coverage" menu. Then click on the "type" column until you find the .js files.
It is pretty much it, but you can read more details here: https://developer.chrome.com/docs/devtools/coverage/

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.

Categories

Resources