Loading an image before pdf appears on target="_blank" new tab - image

I am creating and displaying a PDF file which happens after I click a certain button. This all happens in a new tab (target="_blank"), and is all coded server-side.
How can I put a "loading image" when the new tab opens to show that yes a PDF file is being created, please wait.
Thank you and all suggestions are welcomed.

Rather then link directly to the PDF, create an HTML "wrapper" in which you put an object tag whose style allows it to cover the entire window. You can then put a standard loading gif (or whatever) on top. Using the object onload event, hide the loading image when the PDF is loaded. Then use JavaScript to set the data property of the object tag to the PDF.

Related

AngularJS ng-repeat don't see scope variable - in WYSIWYG editor loaded with AJAX?

I'm modifying a website, built with AngularJS, and in one page I have a WYSIWYG editor.
The whole widget that includes the editor, is a div that has 'ng-controller="TextsController"'.
In this div I have a button, clicking on it displays the editor. And the initializing of the editor happens in a directive - "richTextEditor".
So - I'm making a popup in this editor, that has to show some images from the server. I put the code for pulling the images in the controller ... and there I set
$http.get('/url/to/files').success(function(data) {
$scope.imagesFromServer = data;
});
and in the view I have
'ng-repeat="image in imagesFromServer"'
And the problem is that the ngRepeat doesn't see any items.
I have two ideas:
The view, containing the ngRepeat (the HTML for the editor, and the popup with the images as well) loads with AJAX, and at that very moment the scope variable is not set.
I'm initializing the scope variable in the wrong place. (Eventually has to be in the directive instead of the controller? ... but all examples I've seen and done so far - pull every data in the controller, and the view sees it directly.)
Hope I've described the situation clearly.
Thanks in advance.

image display in drupal

i would like to create an image gallery on my homepage in drupal. Each image will have been uploaded by the user, and, as i understand it, will be saved in some image directory folder in drupal. My question concerns a recent tip i picked up in response to the general debate whether or not it is good to store images as blob in mysql. The tip was to store the filenames of the images in mysql so you can essentially still sort the files. I was wondering whether this would be possible even if the files url is in drupal so to speak. It should be possible shouldn't it? I new to programming you see and want to the images on my homepage to be periodically refreshed according to a define sorting function. I would greatly appreciate any response to this question. Cheers.
You can using content types and views module for create gallery in Drupal 7.
First create new content type with gallery name(admin/structure/types/add).
Then add a image field to gallery content type and save it.
If you want have thumbnail of image you should create a image style. for example create a image style with thumbnail_custom name and add suitable effect(admin/config/media/image-styles/add). You will use of this image style in views in the next step.
Then create a new view with gallery-view name. uncheck create a page, check create a block, enter block title and item per page you want(admin/structure/views/add).
In Filter criteria from block details add content type gallery.
In Fields add Content image that appears in node:gallery and select and select thumbnail_custom for image style option.
Save view.
This view block appears in Blocks section and you select region for it.
If you want this block appears only in the front page, in configuration of this block in the section pages of visibility settings check "Only the listed pages" option and then enter "<front>" phrase in textarea.

tinyMCE callback handler on image drag&drop

tinyMCE supports dragging images from a website (not local file browser) to the rich text editor field. They get converted to and <img src=''>...</img> tag and are immediately displayed as images.
I would like to change the src url of the image tag when it is inserted that way. I tried using the urlconverter_callback handler and the paste_preprocess handler from the paste plugin but neither of them get triggered when I drop the image to the editor field.
Which callback can I use to react on an image drag&drop to the editor? Or is there another way to change the image src when it's dropped?
(urlconverter_callback works when I add the image with the 'Insert Image' button but that's not what I'm looking for.)
The key relies on what's already told: Drag-n-Drop events belong to the browser domain, so TinyMCE knows nothing about them unless we bind them, which in this case it's not necessary.
It's also important to have in mind the way Drag-n-Drop interactions share information between the different events: reading and writting the dataTransfer property via getData and setData functions.
That said, this is my aproach (note I'm using jquery for selection and event binding):
Bind the dragstart event to the image, so it fires when we start the interaction. Make the string replacement and store the result on dataTransfer.
https://gist.github.com/3040473
Useful links:
http://www.useragentman.com/blog/2010/01/10/cross-browser-html5-drag-and-drop/
https://developer.mozilla.org/En/DragDrop/Drag_and_Drop

Joomla/Seblod Display Image Thumbnail Only, Link to Lightbox

I am using Joomla and Seblod. I would like to create a gallery of thumbnails only, tiled next to one another and when clicked it will open each image into a lightbox (fancybox) and display larger image and description.
Problem I'm having is that when I try to display only the image thumbnails, I get the label "Image" or whatever I enter into Seblod. I just want plain image thumbnails, no text or any description but when clicked it opens them in the lightbox. I'm sure this is child's play, but confusing for a a beginning Joomla user like myself.
Any help would be appreciated, thanks.
There is built-in Lightbox functionality in Seblod, but it takes a few steps to make it work. It is even better if you use a custom template, because then you can add regular PHP functions to process your photos.
In any case, to get started, look at the tutorial I wrote on this subject: http://www.seblod.com/support/documentation/seblod-2x/fields/typo/1710-create-a-simple-gallery-with-fieldx-field.html

Insert an image with a link in a PDF using PDFBox

I have multiple PDFs and I want to insert a logo on every page which links to http://xyz.com (that is, clicking on the logo opens up xyz.com in the browser).
Also, I want to insert some text 'Click Here to view this page at xyz.com' next to the logo where 'Click Here' is a link (different link on every page, like http://xyz.com/show.php?id=76&page=3)
I have been able to add the logo and the text but could not figure out how to make the text a link.
I had posted this on pdfbox-users mailing list also and a pointer to the solution was posted there by Hesham G. Link

Resources