Is there a way to load Google Fonts into Devtools - google-chrome-devtools

I know I can import the font I would like to use into the CSS file with the Devtools open. It just seems like a no-brainer for Google to have their massive Fonts library linked to Devtools. Is there a way to do this?

The answer is too old, but this might help others. Type in console following code, then you can use it in Element>styles
var link = document.createElement('link');
link.href = "https://fonts.googleapis.com/css?family=Roboto";
link.rel = "stylesheet";
document.body.prepend(link);

Select an element in Elements panel > DOM Tree and press F2 to edit the <head> tag of your HTML. From there, just add the <link> tag to your HTML. Press Command+Enter (Mac) or Control+Enter to save your changes.
In the Network panel you'll see a request for the font file.

Related

How to stop tinymce convert an image url into img?

The queston is in the tittle. When I paste an image url into the textarea tinymce converts it into the image, How to force it leave only link?
Testing this on TinyMCE 4, on the full featured example given in the TinyMCE documentation, this does not seem to happen... When I paste an image URL there, the URL keeps there, no image replaces it.
What version of TinyMCE do you have? Do you have any custom plugin? Maybe this is being triggered by custom code?
You have to delete the plugin "paste"

How to have image target new window or _blank using FPDF?

In my app the PDF gets opened in the web page and in the below example, when the users clicks on Logo.png it's getting redirected to FPDF site in the same page, but i want to open the link in the new window, instead of opening in the same window, so the users has the PDF opened.
$pdf->Image('logo.png',10,10,30,0,'','http://www.fpdf.org');
Yes I have tried some workarounds for this but its seem to not possible currently. But I have achieved this using ViewerJS.
Just display pdf using viewerjs(pdf js). Just put this line $('a').attr('target', '_blank'); after div.setAttribute('data-loaded', true); inside viewer.js file.
And you will find target blank. Hope this helps!
Sorry, I am pretty sure that this is not possible currently.

Embed vimeo video into tinyMCE editor

I know nothing about programming so apologies if I get terminologies wrong.
I need to embed a video from vimeo into tinyMCE editor. This is the embed code that Vimeo provides for its videos:
<iframe src="http://player.vimeo.com/video/24676022" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
When I paste that into the editor and click update, nothing happens. Does it just hate it and won't let me do it or is there a simple workaround?
Are you pasting that HTML code into the HTML version of your tinyMCE editor?
You cannot simply copy and paste HTML into the editor's WYSIWYG editor.
Unless you are doing any post-processing of the HTML you are trying to save, the iframe should be saved (and shown in the final version) as well.
The solution is simply to configure TinyMCE to accept the iframe tag as a valid element.
You can learn more here: http://www.frederikvig.com/2010/10/how-to-add-support-for-iframes-and-other-elements-to-tinymce-in-episerver-cms/
you can use htmlspecialchars_decode($data_from_mysql)
it will display the video in your web browser....
well this works perfect for me..
You can use the following jquery code to embedd iframes into your tinymce created pages:
$(document).ready(function() {
var $obj = $('.mce-object-iframe');
var video_url = $obj.attr('data-mce-p-src');
var width = $obj.attr('width');
var height = $obj.attr('height');
$obj.replaceWith('<iframe width="'+width+'" height="'+height+'" src="'+video_url+'" style="border:0px;"></iframe>');
});

iphone webview show html with images and css file

I found some interesting URL http://cubiq.org/rotating-wheel-for-your-iphone-webapps which has rotational menu. Its good. It has html file along with images, css files etc.
In iPhone app, I copied (to root folder) all the files and imported to project. I'm using UIWebView's load request to load the html. But I'm not getting the rotatable menu.
Can some one post me the code (or tutorial or prototype or example) on how to use it?
Also let me know how to catch the even on click on "OK" button at the middle of the html.
Thanks in advance.
checkout IUI : http://code.google.com/p/iui/

Tinymce - Convert image url to html image url

This is question about tinymce... Current image editor is slow for because it demands opening popup for every new picture I want to add. I have my own external image gallery where each image contains it's url so copy-paste of url's is very easy and fast...
I would like to have button similar to Bold that does following:
To editor I paste url of image (for example: www.site.com/image.jpg) and when i select this url and click on my new button it converts image url to <img src='www.site.com/image.jpg'> and shows image in editor.
I searched plugins and found nothing similar to this.
Any ideas?
Thanks in advance!
Ilija
solved!
In documentation there is example how to manipulate text in editor from external commands... end even set them as button