I'm gonna visualize on a WebView an external HTML page.. that I cannot modify.
Is there the possibility to insert in the HTML code "viewport" metadata before loading the request on the web view? I'd like to scale the page correctly in the UiWebview.
Thank you all.
I did not quite clearly understood your question..but guess you are trying to append meta viewport tag without modifying the actual html...if yes, you can do it using external Javascript...
document.getElementsByTagName('head')[0].appendChild( ... );
Make DOM element like so:
MetaVa=document.createElement('meta');
Metava.name='viewport';
MetaVa.content='......';
document.getElementsByTagName('head')[0].appendChild(MetaVa);
Related
I need to create a page division in Alloys XML, like a <div> tag in HTML
Basically it needs to be able to be variable size, have attributes like font, colour, border ETC and most importantly it needs to have sub tags such as label and button inside
I've tried using sperate views from this and requiring them into the current window. I've also tried using modules, but I'm not sure if I did it correctly.
My question is, what would be the best way to go around this?
You can create a Widget for this: https://wiki.appcelerator.org/display/guides2/Alloy+Widgets
It is basically a reusable component which you can pass parameters into and it has a own controller, style and view file.
In your XML file you can use it like this:
<Widget src="foo" name="button"/>
(More specific Giorgio Bozio)
I have been using Rotativa for the last year to print simple html to pdf and its been working fantastic. Very happy with product, but now recently i have been trying to do something a little more advance and i keep having the same issue.
Normally i would send Rotativa a simple invoice view (Predefined HTML) with model data populated via Razor and this worked well, but now i am trying to implement template's for my invoices. Customers can create their own template layouts with a custom 3rd party form designer and then upload its template file into my site. I take this file and parse it and generate the elements of the invoice with stringbuilder and div tags. I then send the generated HTML to the view that uses a #HTML.Raw() to populate the invoice html. Rotativa then takes this View and generates a pdf, but when it generates the pdf its quality of the text is horrible and blurry. Thus it generates the template correctly, but does some sort of shrinking or something to make the text not look crisp.
I have tried everything, from playing with custom switches to playing with the dimensions of the html.
When i copy the generated html to a view and just generate the pdf plainly then it prints fine, but as soon as i push the html to the view with HTML.Raw i seem to land up with fussy text.
Giorgio Bozio, does Rotativa have a issue with Html.Raw? or can you perhaps open a dialog with me to try and resolve this issue? Really hope you can help me...or someone can help me. Desperate and dont really want to change Rotativa for something else.
Please help.
Resolved Text printing issue by removing background-color definitions on Div containers.
Resolved extra blank page printing issue by reducing PageHeight on Rotativa Customswitches
:-)
Masters,
I have a scenario where i have a list of Items and on clicking single item it gets details along with image src url using ajax call.
I want to display(render) image right on page.
Now Image source URL is a FileActionResult returning Base64 string.
The problem is the page does not render image although it is having correct Src URL.
And I don't want any additional Ajax call.
Please Help.
Thanks in advance.
How are you forcing the image to be updated?
The DOM is going to keep the image the same until you tell it to refresh the image -- I would suggest using something like
document.getElementById('theImg').src="/newImg.gif?unique=someuniquestring";
where someuniquestring is a new random datetime or something (to make sure browsers like IE don't cache the GET request).
Is there a way I can load a script at the end of the body tag instead of loading in the header? I want to load Facebox and load the jscipt calls to it after the body has loaded.
Despite what jdog wrote, there are a number of ways to take content just before Joomla echoes it to the browser and edit it. This article gives a good overview: http://www.howtojoomla.net/how-tos/development/how-to-fix-joomla-content-plugins
The specific example turns strings into links, but you can modify that to insert your markup right before the </body> tag.
no.
I assume you want to do this for website load speed reasons, what you could do is look at CSS/JS compression components, such as JFinalizer and see which of those support deferred loading of Javascript.
In a view (master view) another view is called with $this->load->view(‘sub_view’);
In the sub_view i have a textarea to use with tinymce.
If I combine the views in one single view and call it from my controller my js works fine and the textarea converts to tinymce editor.
If i use the master - sub scenario and my js targets elements in the sub_view although the same html is returned to the browser js doesn’t fire up correctly and instead of my textarea the whole div that is contained in the sub_view is converted to tinymce. It's like if the contents are loaded afterwards or something.
By the way if i setup just an onclick=alert"()" in the subview it fires up.
Edit: You can grab an example from codeigniter.com/forums/viewthread/179792
Figured it all out.
It had nothing to do with either codeigniter or tinymce
It was markup error
in the main view there was a and the textarea id was also content.
I don't know why it worked correct in full_view
In the init it was 'textarea.tinymce' and textarea had class='tinymce' while the div had the same id too but was not a textarea.
but in the sub_view the wrong markup caused errors.
Changing ids fixed it
Thanks anyone for taking time to review the problem.