CKEDITOR browse and insert image issue - javascript

How to browse/insert image in Ckeditor by using opencart's filemanager(image manager) ?
I hope can get to know how to insert an image in ckeditor by using the opencart image manager and code sample

1)Open CKEditor's config.js file. You can usually find it in the "ckeditor" folder of your OpenCart installation.
2)Find the line where the "filebrowserBrowseUrl" configuration is defined and change its value to the URL of your OpenCart's file manager. For example:
config.filebrowserBrowseUrl = '/admin/index.php?route=common/filemanager';
3)Save the config.js file and close it.
4)In your OpenCart backend, go to the page where you have CKEditor integrated. You should now see a "Browse Server" button in the Image Properties dialog box.
5)When you click the "Browse Server" button, a new window should open displaying your OpenCart's file manager. You can now browse your image folders and select the image you want to insert.
6)Once you've selected an image, click the "Insert" button and the image should be inserted into the CKEditor instance.
--Note: The above steps assume that you have the OpenCart's file manager enabled in your backend. If not, you may need to install and enable it first.

Related

How to print PDF file from link opening modal box using javascript?

I'm using VueJS and I trying to print a PDF document file that I generated by a link, example: localhost:3000/file12.pdf
I was reading about window.print, but I did get open the file in other _blank page, instead of modal box that I would like.
I looking for some lib, find this PrintJS but I didnt find param to open a link. Anyone can suggest me how to do it?

All downloads from iframe go to folder in server

My website contains a iframe which allows the user to navigate the web. If the user clicks a download button on any website I would like it to download in a folder located on the servers itself. So if the user presses download on a image, the image is downloaded onto a folder on the server instead of the computer. Is this possible? I have no idea on how to go about doing this.
You seem to need to display a download button on any website...
You cannot modify all internet websites with your code.
The only way to go this is :
to create a browser extension, like this one : https://chrome.google.com/webstore/detail/image-downloader/cnpniohnfphhjihaiiggeabnkjhpaldj
This extension will be able to interact with any website and do what you want.
or (more simple to code) execute a Javascript of your own that will make floating a download button on any image of any website.
You can do this with this Chrome extension for example : https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
You can also use a "download" button over the iframe that launch a curl Linux command that will download the iframe page and all the images, files etc...

How to set up the Brackets editor?

I want to use Brackets to view my HTML, JS, and CSS files I've written. However whenever I open a file from my folder "Code", Google Chrome Opens up an index of my desktop folders, then I have to click the folder "code" and go in the folder to click on it. How can I make it to where when I click on "live preview" Chrome loads the actual HTML file instead of traveling the world first?
Here is a picture of what's going on:
http://imgur.com/a/zLTo5
Referencing your image, Julie/Desktop is your root.
So, here is what I would do.
Lets say Code2 is the folder that contains all your code for the site you are building. In this case, you would open Brackets and select file > open folder and then navigate to the Code2 folder and open it. This sets Code2 as the root directory for Brackets. Now, in that folder, make sure that you have an index.html file - preferrably the one that you are working on. Now clicking the view button should open the actual page in your browser.
If you dont have an index file, and want to load a different file then just toss a blank index file in the root, click the view button and a blank page should open in the browser. Now just change the path to include the proper name of your file and it should load the page you wish to edit. Saving should reload it in browser.
Example. If your index path is http://127.0.0.1:52497/index.html but you want to view a page with the filename of page2.html, then you would change the path to: http://127.0.0.1:52497/page2.html
Whatever directory you have imported into Brackets needs to have an index.html file. You dont have an index file in that root from what I can tell - so it has no idea what you want to load when you click the open in browser button.

Programatically set destination as "Print as pdf" and save to a designated path on windows file system

Our Application opens up the print dialog box using JavaScript. Can we programmatically skip the dialog box and set the destination printer as "Save as PDF" and dynamically save the file to a designated folder on windows file system.
We will be OK if this is supported in at least one browser. This is needed so that we can automate printing of multiple documents from the system. Any help with this matter is appreciated.

iFrame file upload with IE produces download dialogue

I'm developing a custom module for Drupal dealing with Document Management. At this point, the module loads, you can upload files (via a hidden iframe and some ajax requests), browse directories and set various levels of permissions. And everything works perfectly in Firefox.
Issue:
In IE however, I run into an issue. For some reason when I upload a file the save file dialogue pops up and asks me to download the file I just uploaded. It looks like it's asking me to download it from the web-servers tmp location however, as that seems to be the file-name and such. However, if I hit cancel and refresh the page I can see that the file I uploaded did actually get uploaded to the server.
Here is how the upload process works. Click the upload button. The upload button is the standard file input form element hidden and placed over a styled version of the button. Clicking on this causes the "Choose a file" dialogue to open.
Select a file and click "Open". A modal dialogue pops up asking you for some further information about the file. The modal is part of the same form element but remains invisible until you click Upload button
Clicking save in the modal causes the file to be uploaded. The "action" attribute on the form is pointed to a page and the target is the iframe.
The iFrame is polled a few times every second to see if it's contents have changed. When the file is uploaded a "success" message appears in the iframe. Since it belongs to the same domain, I scrape the content within the iframe.
Once the iFrame says that the file has been uploaded, I use some JS to update the application with the name of the file
Since I can't use Firebug in IE, I have to stick to utilizing Microsofts Web Developer Toolbar, which makes it very hard to figure out if the bolded step is actually occuring. It seems like it should, since the file IS being uploaded. It is just getting interrupted by that file download dialogue.
Since no one seems to have an answer, I'll post the fix I found. I doubt it's perfect, but it's the best solution I could come up with.
It turned out to be an issue with the polling as suspected. The fix ended up being instead of outputting json to the iFrame, just output some JavaScript that calls a function that updates the main window. That simple.

Categories

Resources