If look the example of tinyMCE on official website with Firefox you can see the blinking of editor. Only in firefox.
I think it is bacause css files of editor are external and I want to put all css rules in the html file of iframe.
Please help me to find place where I can add inline styles!
I think you need to set the content css, see here for details:
http://www.tinymce.com/wiki.php/Configuration:content_css
eg:
content_css : "css/custom_content.css"
Related
I am using a python library to convert HTML page into PDF.
It does it correctly, except it only handles inline styling. It does not reflect the styling applied to DOM elements using external style sheets.
So, as a solution I am thinking of adding those CSS styling from all the external CSS stylesheets into the head tag of the html file and then send it to get converted into pdf.
But, I am not sure how? Can anyone give me any ideas or atleast suggestion on how to go around fixing that? Or, if they know a better solution.
Much appreciate
Is the python running outside or client-side? You can examine the solution here # http://www.xportability.com/XEPOnline/FOTestSuite.html. While this does a lot more, you can reach through that page to the included Javascript. Look for flattenstyle.js for inspiration.
Because our handling is different, we actually copy a selected div element to another hidden div and "flatten" the style by extracting styles we want. What you could do is run such a javascript on page load and save out the div and not destroy it, then you have most all the print styling in the HTML.
I'm implementing tinymce editor, it creates an iframe with head and body. To insert my site's css I just use the content_css : "path/to/css/mysite.css" in the init() for the tinymce, but that for some reason isn't working, it's not being reflected on the iframe, is there any possibility to make it work?
The editor is working but without my site's css styles.
Btw I'm using the latest TinyMCE version (4.0.12)
Thanks in advance.
The following code pulls HTML from a table and injects the contents into HTML email.
var content = $j('#product_comparison').html();
The problem with this approach is that the HTML email loses its styling because the original table references an external stylesheet and my understanding of HTML email is that all styles should be inline and not referenced externally or within a <style> tag.
Are there any Javascript / jQuery methods that can create the HTML with inline styles included so the result would appear correctly in a HTML email message?
Well, if you want a crude but quick way of achieving this, you can do as follows to set the style attribute of one specific element to all its computed style:
$('#my-div').css(window.getComputedStyle(document.getElementById('my-div')));
Although this will give you all style properties for that item.
Of course, you cannot simply use the .html() method for this, you'll need to clone each element individually.
http://jsfiddle.net/QfN6N/1/
Once you've got the HTML out, paste into the tool linked to below, preceded by a <link> to the CSS file and it will inline all the relevant CSS automatically.
MailChimp CSS Inliner
Hope this helps.
I'm writing an extension for chrome as "Content script". My extension should change the background color of google home page (https://www.google.com)
I wrote this code (including jquery):
$(".gsib_a").style="background:#FF0000";
But not worked. I'm sure I added jQuery to content script, and the manifest.json file is set. I am sure because this code works:
$(".gsib_a").hide();
And I am sure changing style of the element with class of gsib_a is exactly what I need and affects. Because I've tested it by Chrome Developer Tools.
Okay, who knows the problem?
if you want to change an attribute, use the attr method:
$('.gsib_a').attr('style','background-color:#FF0000');
but you can change the css directly with the css method:
$('.gsib_a').css('background-color','#FF0000');
I wrote a plugin for FCKeditor that inserts <div> tags into HTML for later replacement with dynamic data.
I use the fake image approach to insert an image placeholder into the visual part of the FCKeditor window. That image is connected to the <div> as it appears in the source. This approach is also used by the native page break functionality native to FCKeditor.
I want to apply some styles to that image. Specifically, I want to add a icon image to the background. I have been adding the CSS to my custom editorarea CSS file that I specified in my config file. But I'd like to move that code into the plugin directory somehow.
Is there a way to add custom CSS to the editoarea using Javascript in a plugin?
I have written exactly this kind of plug-in myself in the past. Looking at my code, it seems I concluded that it wasn't possible (or at least straightforward) to add custom CSS to the edit document, so I specify everything on the style object of the image placeholder in the plugin script, including a background image that lives in the plugin directory.