<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sentido Web &#187; Javascript</title>
	<atom:link href="http://sentidoweb.com/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://sentidoweb.com</link>
	<description>Desarrollo web, HTML, CSS, Javascript, PHP, MySQL</description>
	<lastBuildDate>Mon, 16 Jan 2012 10:16:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Progreso de subida de ficheros únicamente con HTML5</title>
		<link>http://sentidoweb.com/2011/11/19/progreso-de-subida-de-ficheros-unicamente-con-html5.php</link>
		<comments>http://sentidoweb.com/2011/11/19/progreso-de-subida-de-ficheros-unicamente-con-html5.php#comments</comments>
		<pubDate>Sat, 19 Nov 2011 21:03:58 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[progress]]></category>
		<category><![CDATA[subir ficheros]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2757</guid>
		<description><![CDATA[Uno de los mayores problemas con los que nos hemos encontrado a la hora de hacer aplicaciones que suben ficheros, es mostrar al usuario cuánto se ha subido y así poder saber cuánto queda. Ahora con HTML5 y XMLHttpRequest Level 2 podemos mostrarlo sin necesidad de parte del servidor. El script hace uso de Evento [...]]]></description>
			<content:encoded><![CDATA[<p>Uno de los mayores problemas con los que nos hemos encontrado a la hora de hacer aplicaciones que suben ficheros, es mostrar al usuario cuánto se ha subido y así poder saber cuánto queda. Ahora con HTML5 y XMLHttpRequest Level 2 podemos mostrarlo sin necesidad de parte del servidor.</p>
<p>El script hace uso de <a href="http://www.w3.org/TR/progress-events/">Evento de Progreso</a> de HTML5 para poder mostrar:</p>
<ul><li><strong>total</strong>: total de bytes</li>
<li><strong>loaded</strong>: bytes subidos</li>
<li><strong>lengthComputable</strong>: indica si el tamaño del fichero es conocido</li>
<li><strong>transferSpeed</strong>: velocidad de transferencia</li>
<li><strong>timeRemaining</strong>: tiempo que falta (en formato Date)</li>
</ul>
<p>Por ahora solo es compatible con Firefox, Chrome y Safari.</p>
<p>En el post lo explican con gran detalle.</p>
<p><a href="http://www.matlus.com/html5-file-upload-with-progress/">Html5 File Upload with Progress</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/11/19/progreso-de-subida-de-ficheros-unicamente-con-html5.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JSZip: crear ficheros ZIP mediante Javascript</title>
		<link>http://sentidoweb.com/2011/10/06/jszip-crear-ficheros-zip-mediante-javascript.php</link>
		<comments>http://sentidoweb.com/2011/10/06/jszip-crear-ficheros-zip-mediante-javascript.php#comments</comments>
		<pubDate>Thu, 06 Oct 2011 08:26:58 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jszip]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2750</guid>
		<description><![CDATA[Interesante librería que nos permite crear ficheros ZIP desde Javascript, con unas simples líneas de código podemos crear zips con ficheros de texto, imágenes, crear directorios&#8230; var zip = new JSZip&#40;&#41;; zip.add&#40;"Hello.txt", "Hello World\n"&#41;; img = zip.folder&#40;"images"&#41;; img.add&#40;"smile.gif", imgData, &#123;base64: true&#125;&#41;; content = zip.generate&#40;&#41;; location.href="data:application/zip;base64,"+content; El único problema que hay es a la hora de [...]]]></description>
			<content:encoded><![CDATA[<p>Interesante librería que nos permite crear ficheros ZIP desde Javascript, con unas simples líneas de código podemos crear zips con ficheros de texto, imágenes, crear directorios&#8230;</p>
<pre><code><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> zip = <span style="color: #003366; font-weight: bold;">new</span> JSZip<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
zip.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Hello.txt"</span>, <span style="color: #3366CC;">"Hello World<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #66cc66;">&#41;</span>;
img = zip.<span style="color: #006600;">folder</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"images"</span><span style="color: #66cc66;">&#41;</span>;
img.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"smile.gif"</span>, imgData, <span style="color: #66cc66;">&#123;</span>base64: <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
content = zip.<span style="color: #006600;">generate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
location.<span style="color: #006600;">href</span>=<span style="color: #3366CC;">"data:application/zip;base64,"</span>+content;</pre></code></pre>
<p>El único problema que hay es a la hora de generar el nombre del fichero: Firefox crea un fichero con un nombre extraño y acabado en .part, Safari lo nombra &#8220;Unknown&#8221; sin extensión, Chrome &#8220;download.zip&#8221; e IE directamente ni funciona la librería.</p>
<p><a href="http://jszip.stuartk.co.uk/">JSZip</a></p>
<p>Vía / <a href="https://twitter.com/#!/devongovett/status/121656042483499008">@devongovett</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/10/06/jszip-crear-ficheros-zip-mediante-javascript.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF.js librería Javascript para leer PDF en Canvas</title>
		<link>http://sentidoweb.com/2011/06/15/pdf-js-libreria-javascript-para-leer-pdf-en-canvas.php</link>
		<comments>http://sentidoweb.com/2011/06/15/pdf-js-libreria-javascript-para-leer-pdf-en-canvas.php#comments</comments>
		<pubDate>Wed, 15 Jun 2011 16:48:49 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2737</guid>
		<description><![CDATA[Interesante librería Javascript que nos permite mostrar en Canvas (HTML5) el contenido de un PDF. Puede venir muy bien para aplicaciones móviles, ya que en navegación en escritorio normalmente la gente tiene instalado un visor de PDFs. &#60;html&#62; &#60;head&#62; &#60;title&#62;Simple pdf.js page viewer&#60;/title&#62; &#60;script type="text/javascript" src="pdf.js"&#62;&#60;/script&#62; &#60;style type"text/css"&#62; body { margin: 6px; padding: 0px; background-color: [...]]]></description>
			<content:encoded><![CDATA[<p>Interesante librería Javascript que nos permite mostrar en Canvas (HTML5) el contenido de un PDF. Puede venir muy bien para aplicaciones móviles, ya que en navegación en escritorio normalmente la gente tiene instalado un visor de PDFs.</p>
<pre><code><pre class="html"><span style="color: #009900;"><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">&lt;html&gt;</span></a></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">&lt;head&gt;</span></a></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></a></span>Simple pdf.js page viewer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title&gt;</span></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span>
          <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"pdf.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/style.html"><span style="color: #000000; font-weight: bold;">&lt;style</span></a> <span style="color: #000066;">type</span><span style="color: #ff0000;">"text/css"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
body {
  margin: 6px;
  padding: 0px;
  background-color: #c0bdb7;
}
#controls {
  border-bottom: 1px solid black;
  position:fixed;
  left: 0px; top: 0px;
  width: 100%;
  padding: 7px;
  background-color: rgb(242, 240, 238);
}
span#info {
  float: right;
  font: 14px sans-serif;
  margin-right: 10px;
}
#viewer {
  margin: auto;
  border: 1px solid black;
  width: 8.5in;
  height: 11in;
}
#pageNumber {
  text-align: right;
}
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style&gt;</span></span>
&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
function queryParams() {
    var qs = window.location.search.substring(1);
    var kvs = qs.split(&quot;<span style="color: #ddbb00;">&amp;&quot;);</span>
    var params = { };
    for (var i = 0; i <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a> kvs.length; ++i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        var kv = kvs<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.split<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"="</span><span style="color: #66cc66;">&#41;</span>;
        params<span style="color: #66cc66;">&#91;</span>unescape<span style="color: #66cc66;">&#40;</span>kv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span> = unescape<span style="color: #66cc66;">&#40;</span>kv<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
    return params;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
var canvas, numPages, pageDisplay, pageNum;
function load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    canvas = document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"canvas"</span><span style="color: #66cc66;">&#41;</span>;
    canvas.mozOpaque = true;
    pageDisplay = document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"pageNumber"</span><span style="color: #66cc66;">&#41;</span>;
    infoDisplay = document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"info"</span><span style="color: #66cc66;">&#41;</span>;
    pageNum = parseInt<span style="color: #66cc66;">&#40;</span>queryParams<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.page<span style="color: #66cc66;">&#41;</span> || <span style="color: #cc66cc;">1</span>;
    fileName = queryParams<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.file || <span style="color: #ff0000;">"compressed.tracemonkey-pldi-09.pdf"</span>;
    open<span style="color: #66cc66;">&#40;</span>fileName<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
function open<span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    document.title = url;
    req = new XMLHttpRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    req.open<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"GET"</span>, url<span style="color: #66cc66;">&#41;</span>;
    req.mozResponseType = req.responseType = <span style="color: #ff0000;">"arraybuffer"</span>;
    req.expected = <span style="color: #66cc66;">&#40;</span>document.URL.indexOf<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"file:"</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #cc66cc;">0</span> : <span style="color: #cc66cc;">200</span>;
    req.onreadystatechange = xhrstate;
    req.send<span style="color: #66cc66;">&#40;</span>null<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
function xhrstate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    if <span style="color: #66cc66;">&#40;</span>req.readyState == <span style="color: #cc66cc;">4</span> &amp;&amp; req.status == req.expected<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        var <span style="color: #000066;">data</span> = req.mozResponseArrayBuffer ||
                   req.mozResponse ||
                   req.responseArrayBuffer ||
                   req.response;
        pdf = new PDFDoc<span style="color: #66cc66;">&#40;</span>new Stream<span style="color: #66cc66;">&#40;</span><span style="color: #000066;">data</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        numPages = pdf.numPages;
        document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"numPages"</span><span style="color: #66cc66;">&#41;</span>.innerHTML = numPages.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        gotoPage<span style="color: #66cc66;">&#40;</span>pageNum<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
function displayPage<span style="color: #66cc66;">&#40;</span>num<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    pageDisplay.value = num;
&nbsp;
    var t0 = Date.now<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var page = pdf.getPage<span style="color: #66cc66;">&#40;</span>pageNum = num<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var t1 = Date.now<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var ctx = canvas.getContext<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"2d"</span><span style="color: #66cc66;">&#41;</span>;
    ctx.save<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    ctx.fillStyle = <span style="color: #ff0000;">"rgb(255, 255, 255)"</span>;
    ctx.fillRect<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, canvas.width, canvas.height<span style="color: #66cc66;">&#41;</span>;
    ctx.restore<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var gfx = new CanvasGraphics<span style="color: #66cc66;">&#40;</span>ctx<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    // page.compile will collect all fonts <span style="color: #000066;">for</span> us, once we have loaded them
    // we can trigger the actual page rendering with page.display
    var fonts = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
    page.compile<span style="color: #66cc66;">&#40;</span>gfx, fonts<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var t2 = Date.now<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    // This should be called when font loading is complete
    page.display<span style="color: #66cc66;">&#40;</span>gfx<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    var t3 = Date.now<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    infoDisplay.innerHTML = <span style="color: #ff0000;">"Time to load/compile/render: "</span>+ <span style="color: #66cc66;">&#40;</span>t1 - t0<span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">"/"</span> + <span style="color: #66cc66;">&#40;</span>t2 - t1<span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">"/"</span> + <span style="color: #66cc66;">&#40;</span>t3 - t2<span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">" ms"</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
function nextPage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    if <span style="color: #66cc66;">&#40;</span>pageNum <span style="color: #000000; font-weight: bold;">&lt;</span></a> numPages<span style="color: #66cc66;">&#41;</span>
        ++pageNum;
    displayPage<span style="color: #66cc66;">&#40;</span>pageNum<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
function prevPage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    if <span style="color: #66cc66;">&#40;</span>pageNum <span style="color: #000000; font-weight: bold;">&gt;</span></a></span> 1)
        --pageNum;
    displayPage(pageNum);
}
function gotoPage(num) {
    if (0 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>= num &amp;&amp; num <span style="color: #000000; font-weight: bold;">&lt;</span></a>= numPages<span style="color: #66cc66;">&#41;</span>
        pageNum = num;
    displayPage<span style="color: #66cc66;">&#40;</span>pageNum<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head&gt;</span></span>
&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body</span></a> <span style="color: #000066;">onload</span>=<span style="color: #ff0000;">"load();"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"controls"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;"><a href="http://december.com/html/4/element/button.html"><span style="color: #000000; font-weight: bold;">&lt;button</span></a> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">"prevPage();"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Previous<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button&gt;</span></span>
    <span style="color: #009900;"><a href="http://december.com/html/4/element/button.html"><span style="color: #000000; font-weight: bold;">&lt;button</span></a> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">"nextPage();"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Next<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button&gt;</span></span>
    <span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"pageNumber"</span> <span style="color: #000066;">onchange</span>=<span style="color: #ff0000;">"gotoPage(this.value);"</span>
           <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"1"</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">"4"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/input&gt;</span></span>
    / <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"numPages"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>--<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
    <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"info"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"viewer"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Canvas dimensions must be specified in CSS pixels.  CSS pixels
      -- are always 96 dpi.  These dimensions are 8.5x11in at 96dpi. --&gt;</span></span>
    <span style="color: #009900;">&lt;canvas <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"canvas"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"816"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"1056"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/canvas&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html&gt;</span></span></pre></code></pre>
<p><a href="https://github.com/andreasgal/pdf.js">PDF.js</a></p>
<p>Vía / <a href="http://twitter.com/#!/badass_js/status/81002447287484416">@badass_js</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/06/15/pdf-js-libreria-javascript-para-leer-pdf-en-canvas.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Popcorn.js librería Javascript que permite sincronizar vídeo y contenido en HTML5</title>
		<link>http://sentidoweb.com/2011/06/08/popcorn-js-libreria-javascript-que-permite-sincronizar-video-y-contenido-en-html5.php</link>
		<comments>http://sentidoweb.com/2011/06/08/popcorn-js-libreria-javascript-que-permite-sincronizar-video-y-contenido-en-html5.php#comments</comments>
		<pubDate>Wed, 08 Jun 2011 16:25:54 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2733</guid>
		<description><![CDATA[Popcorn.js es una librería que permite sincronizar la etiqueta &#60;video&#62; de HTML5 con contenido que deseemos mostrar. Para ello utiliza las propiedades, métodos y eventos nativos de HTMLMediaElement. Además ofrece un sistema de plugins desarrollados por la comunidad: document.addEventListener&#40;"DOMContentLoaded", function &#40;&#41; &#123; // Create a popcporn instance by calling Popcorn(&#34;#id-of-my-video&#34;) var pop = Popcorn&#40;"#video"&#41;; // [...]]]></description>
			<content:encoded><![CDATA[<p>Popcorn.js es una librería que permite sincronizar la etiqueta &lt;video&gt; de HTML5 con contenido que deseemos mostrar. Para ello utiliza las propiedades, métodos y eventos nativos de HTMLMediaElement. Además ofrece un sistema de plugins desarrollados por la comunidad:</p>
<pre><code><pre class="javascript">document.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"DOMContentLoaded"</span>, <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #009900; font-style: italic;">// Create a popcporn instance by calling Popcorn(&quot;#id-of-my-video&quot;)</span>
      <span style="color: #003366; font-weight: bold;">var</span> pop = Popcorn<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#video"</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #009900; font-style: italic;">// play the video right away</span>
      pop.<span style="color: #006600;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #009900; font-style: italic;">// add a footnote at 2 seconds</span>
        .<span style="color: #006600;">footnote</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>
          start: <span style="color: #CC0000;">2</span>,
          end: <span style="color: #CC0000;">6</span>,
          text: <span style="color: #3366CC;">"This footnote is the stepping stone of progress!"</span>,
          target: <span style="color: #3366CC;">"footnotediv"</span>
        <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</pre></code></pre>
<p>Podéis ver algunos <a href="http://popcornjs.org/demos">ejemplos</a> bastante interesantes. Una librería muy útil para presentaciones y vídeos corporativos.</p>
<p><a href="http://popcornjs.org/">Popcorn.js</a></p> ]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/06/08/popcorn-js-libreria-javascript-que-permite-sincronizar-video-y-contenido-en-html5.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MathJax: librería javascript para mostrar fórmulas matemáticas</title>
		<link>http://sentidoweb.com/2011/04/22/mathjax-libreria-javascript-para-mostrar-formulas-matematicas.php</link>
		<comments>http://sentidoweb.com/2011/04/22/mathjax-libreria-javascript-para-mostrar-formulas-matematicas.php#comments</comments>
		<pubDate>Fri, 22 Apr 2011 17:59:26 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[mathjax]]></category>
		<category><![CDATA[mathml]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2718</guid>
		<description><![CDATA[MathJax es una librería javascript que permite mostrar fórmulas LaTeX y MathML en nuestras páginas. Es compatible con casi todos los navegadores (menos IE5.5 lógicamente), permite copiar el código TeX y MathML de la página, utiliza fuentes CSS y no imágenes o Flash y muchas cosas más. &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;title&#62;MathJax TeX Test Page&#60;/title&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>MathJax</strong> es una librería javascript que permite mostrar fórmulas LaTeX y MathML en nuestras páginas. Es compatible con casi todos los navegadores (menos IE5.5 lógicamente), permite copiar el código TeX y MathML de la página, utiliza fuentes CSS y no imágenes o Flash y muchas cosas más.</p>
<pre><code><pre class="html"><span style="color: #00bbdd;">&lt;!DOCTYPE html&gt;</span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">&lt;html&gt;</span></a></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">&lt;head&gt;</span></a></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></a></span>MathJax TeX Test Page<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/x-mathjax-config"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
  MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\(','\)']]}});
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span>
  <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body&gt;</span></a></span>
When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html&gt;</span></span></pre></code></pre>
<p><a href="http://www.mathjax.org">MathJax</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/04/22/mathjax-libreria-javascript-para-mostrar-formulas-matematicas.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Graceful Websocket: plugin jQuery para websockets</title>
		<link>http://sentidoweb.com/2011/04/18/jquery-graceful-websocket-plugin-jquery-para-websockets.php</link>
		<comments>http://sentidoweb.com/2011/04/18/jquery-graceful-websocket-plugin-jquery-para-websockets.php#comments</comments>
		<pubDate>Mon, 18 Apr 2011 07:58:46 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2716</guid>
		<description><![CDATA[jQuery Graceful Websocket es un plugin jQuery que nos permite comunicarnos con el servidor usando websockets de HTML5. El problema es que tan solo Chrome permite los websokets (creo que Firefox los tiene desactivados por defecto por temas de seguridad), además se necesita que el servidor los pueda tratar, por lo que este plugin permite [...]]]></description>
			<content:encoded><![CDATA[<p><strong>jQuery Graceful Websocket</strong> es un plugin jQuery que nos permite comunicarnos con el servidor usando websockets de HTML5. El problema es que tan solo Chrome permite los websokets (creo que Firefox los tiene desactivados por defecto por temas de seguridad), además se necesita que el servidor los pueda tratar, por lo que este plugin permite una alternativa mediante Ajax transparente al desarrollador.</p>
<pre><code><pre class="php"><span style="color: #808080; font-style: italic;">// Si el servidor no admite websockets sustituye el ws:// por http://</span>
<span style="color: #000000; font-weight: bold;">var</span> ws = $.gracefulWebSocket<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"ws://127.0.0.1:8080/"</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// Env&Atilde;&shy;a datos al servidor. </span>
<span style="color: #808080; font-style: italic;">// Si el servidor no admite websockets lo env&Atilde;&shy;a mediante POST</span>
ws.send<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"message to server"</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// Recibe datos del servidor</span>
<span style="color: #808080; font-style: italic;">// Si el servidor no admite websockets hace un polling mediante GET</span>
ws.onmessage = <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">var</span> messageFromServer = event.data;   
<span style="color: #66cc66;">&#125;</span>;</pre></code></pre>
<p><a href="http://code.google.com/p/jquery-graceful-websocket/">WebSocket plugin for jQuery with graceful degradation</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/04/18/jquery-graceful-websocket-plugin-jquery-para-websockets.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clipping de vídeo usando HTML5 y SVG en Firefox4</title>
		<link>http://sentidoweb.com/2011/03/23/clipping-de-video-usando-html5-y-svg-en-firefox4.php</link>
		<comments>http://sentidoweb.com/2011/03/23/clipping-de-video-usando-html5-y-svg-en-firefox4.php#comments</comments>
		<pubDate>Wed, 23 Mar 2011 18:10:27 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[clipping]]></category>
		<category><![CDATA[firefox4]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2696</guid>
		<description><![CDATA[La verdad es que Firefox4 está de lujo, y las demos que ofrece Mozilla son increíbles. De una de ellas he sacado cómo hacer clipping en vídeos usando HTML5 y la posibilidad de incrustar SVG (sólo funciona en Firefox4). El método es sencillo, tengo un SVG que muestra el contorno y los botones de play [...]]]></description>
			<content:encoded><![CDATA[<p>La verdad es que Firefox4 está de lujo, y las <a href="https://developer.mozilla.org/es/demos/">demos que ofrece Mozilla</a> son increíbles. De una de ellas he sacado cómo hacer clipping en vídeos usando HTML5 y la posibilidad de incrustar SVG (sólo funciona en Firefox4).</p>
<p><img src="http://sentidoweb.com/wp-content/uploads/2011/03/clipping-video.png" alt="" title="clipping-video" width="311" height="248" class="alignnone size-full wp-image-2697 center" /></p>
<p>El método es sencillo, tengo un SVG que muestra el contorno y los botones de play y pausa, además tiene un <em>clipPath</em> que se usará para el estilo <em>clip-path</em> del vídeo:</p>
<p><strong>SVG</strong></p>
<pre><code><pre class="html"><span style="color: #009900;">&lt;svg <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"300"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"250"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"svg2"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
  <span style="color: #009900;">&lt;clipPath <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"clip"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;">&lt;use xlink:<span style="color: #000066;">href</span>=<span style="color: #ff0000;">"#borde"</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/clipPath&gt;</span>
  <span style="color: #009900;">&lt;g <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"player"</span> <span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;">&lt;path
       <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"fill:none;stroke:#014700;stroke-width:10;stroke-opacity:0.7;"</span>
       d=<span style="color: #ff0000;">"m 40,20 S 20,20,20,40 C 20,50,30,220,60,230 C 90,250,270,190,280,180 C 310,160,260,70,250,60 C 200,0,40,20,40,20 z"</span>
       <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"borde"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;">&lt;g <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"pause"</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"fill:#000000;fill-opacity:0.3;display: none"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
      <span style="color: #009900;">&lt;rect y=<span style="color: #ff0000;">"100"</span> x=<span style="color: #ff0000;">"125"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"50"</span>
         <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"20"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"rect3590"</span>
         <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"color:#000000;fill:#000000;fill-opacity:0.3"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
      <span style="color: #009900;">&lt;rect y=<span style="color: #ff0000;">"100"</span> x=<span style="color: #ff0000;">"150"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"50"</span>
         <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"20"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"rect3590"</span>
         <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"color:#000000;fill:#000000;fill-opacity:0.5"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/g&gt;</span>
    <span style="color: #009900;">&lt;path
       <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"color:#000000;fill:#000000;fill-opacity:0.5"</span>
       <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"play"</span> d=<span style="color: #ff0000;">"m 125,100 L 125,150 L 175,125 z"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/g&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/svg&gt;</span></pre></code></pre>
<p><strong>Vídeo</strong></p>
<pre><code><pre class="html"><span style="color: #009900;">&lt;video <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"clip-path: url(#clip);"</span> preload=<span style="color: #ff0000;">"auto"</span> autobuffer=<span style="color: #ff0000;">""</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://videos.mozilla.org/serv/mozhacks/demos/resources/londonproject/fight.ogv"</span> <span style="color: #000066;">tabindex</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"video"</span> <span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/video&gt;</span></pre></code></pre>
<p><strong>Javascript</strong></p>
<pre><code><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> play = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'play'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> pause = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'pause'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> video = document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'video'</span><span style="color: #66cc66;">&#41;</span>;
play.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'click'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    play.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'none'</span>;
    pause.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'block'</span>;
    video.<span style="color: #006600;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;  
pause.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'click'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    play.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'block'</span>;
    pause.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'none'</span>;
    video.<span style="color: #006600;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;  
video.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"ended"</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    play.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'block'</span>;
    pause.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">'none'</span>;
    video.<span style="color: #006600;">pause</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</pre></code></pre>
<p>El vídeo es el mismo que el de la demo de Mozilla, he puesto el borde semi-transparente para que se vea el clipping como va.</p>
<p><a href='http://sentidoweb.com/wp-content/uploads/2011/03/video_clipping.html'>Demo</a></p>
<p>Vía / <a href="https://developer.mozilla.org/es/demos/detail/project-london-trailer">Project London Trailer</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2011/03/23/clipping-de-video-usando-html5-y-svg-en-firefox4.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://videos.mozilla.org/serv/mozhacks/demos/resources/londonproject/fight.ogv" length="889765" type="video/ogg" />
		</item>
		<item>
		<title>El rendimiento de Google Instant Previews</title>
		<link>http://sentidoweb.com/2010/11/16/el-rendimiento-de-google-instant-previews.php</link>
		<comments>http://sentidoweb.com/2010/11/16/el-rendimiento-de-google-instant-previews.php#comments</comments>
		<pubDate>Tue, 16 Nov 2010 10:00:51 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Desarrollo web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[instant previews]]></category>
		<category><![CDATA[jsonp]]></category>
		<category><![CDATA[rendimiento]]></category>

		<guid isPermaLink="false">http://sentidoweb.com/?p=2649</guid>
		<description><![CDATA[Algunas veces no nos paramos a pensar en los cambios que añade una web, en este caso Google, los problemas que pueden aparecer en tema de rendimiento. Y estos problemas suelen ser fundamentales a la hora de la impresión que se lleva un usuario de la web, claro, que Google no se caracteriza por problemas [...]]]></description>
			<content:encoded><![CDATA[<p>Algunas veces no nos paramos a pensar en los cambios que añade una web, en este caso Google, los problemas que pueden aparecer en tema de rendimiento. Y estos problemas suelen ser fundamentales a la hora de la impresión que se lleva un usuario de la web, claro, que Google no se caracteriza por problemas de rendimiento y los expertos que están trabajando allá deben ser de lo mejorcito que existe.</p>
<p>Después de este rollo introductorio, me gustaría apuntar los 3 aspectos que utiliza Google para mejorar el rendimiento que se centran sobre todo en la <strong>reducción del número de peticiones HTTP</strong>: </p>
<ul>
<li><strong>Compilación de Javascript</strong>: mediante <a href="http://code.google.com/intl/es-ES/closure/compiler/">Closure Compiler</a>, consigue reducir el tamaño de los ficheros js, reutilizar variables, &#8230;</li>
<li><strong>JSONP bajo demando</strong>: <a href="http://en.wikipedia.org/wiki/JSON#JSONP">JSONP</a> permite envolver la respuesta JSON con una llamada Javascript. Se realizan llamadas directas al script en vez de usar Ajax, lo cual permite hacer llamadas crossdomain y que el navegador lo cachee perfectamente. El problema es que si se añade la llamada con un createElement, el navegador se queda cargando, por lo que es mejor meterlo entre un setTimeout.</li>
<li><strong>DATA URIs</strong>: es un método de añadir contenido en URLs usando base64, el problema es que IE8 sólo admite DATA URIs de 32k, por lo que dividen las imagenes en trozos y los &#8220;empalman&#8221; con etiquetas IMG. También han comprobado que aunque base64 añade hasta un 33% del tamaño, como lo devuelven en gzip, el tamaño final es más o menos el mismo.</li>
</ul>
<p>Está claro que hay que aprender de los que saben.</p>
<p><a href="http://googlecode.blogspot.com/2010/11/instant-previews-under-hood.html#">Instant Previews: Under the hood</a></p>
<p>Vía / <a href="http://highscalability.com/blog/2010/11/15/how-googles-instant-previews-reduces-http-requests.html">High Scalability</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2010/11/16/el-rendimiento-de-google-instant-previews.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heatmap en tiempo real con Javascript y Canvas</title>
		<link>http://sentidoweb.com/2010/11/09/heatmap-en-tiempo-real-con-javascript-y-canvas.php</link>
		<comments>http://sentidoweb.com/2010/11/09/heatmap-en-tiempo-real-con-javascript-y-canvas.php#comments</comments>
		<pubDate>Tue, 09 Nov 2010 19:52:01 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Quicklinks]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[heatmap]]></category>

		<guid isPermaLink="false">http://www.webappers.com/2010/11/02/real-time-heatmap-with-javascript-html-canvas-element/</guid>
		<description><![CDATA[Los heatmaps son muy útiles para ver qué zonas de nuestras webs atraen la atención de los usuarios. Esta función de Javascript permite mostrar en tiempo real el heatmap que se va produciendo gracias a Javascript y el elemento HTML de Canvas. Real-time heatmap example with Javascript and HTMLCanvas Post originalVía / WebAppers]]></description>
			<content:encoded><![CDATA[<p>Los heatmaps son muy útiles para ver qué zonas de nuestras webs atraen la atención de los usuarios. Esta función de Javascript permite mostrar en tiempo real el heatmap que se va produciendo gracias a Javascript y el elemento HTML de Canvas.</p>
<p><img src="http://sentidoweb.com/wp-content/uploads/2010/11/heatmap.png" alt="" title="heatmap" width="299" height="294" class="center" /></p>
<p><a href="http://www.patrick-wied.at/static/heatmap/">Real-time heatmap example with Javascript and HTMLCanvas</a></p>
<p><a href="http://www.webappers.com/2010/11/02/real-time-heatmap-with-javascript-html-canvas-element/" title="Real-time Heatmap with Javascript &amp; HTML Canvas Element">Post originalVía / WebAppers</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2010/11/09/heatmap-en-tiempo-real-con-javascript-y-canvas.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Close Pixelate: pixela imágenes con HTML5</title>
		<link>http://sentidoweb.com/2010/10/20/close-pixelate-pixela-imagenes-con-html5.php</link>
		<comments>http://sentidoweb.com/2010/10/20/close-pixelate-pixela-imagenes-con-html5.php#comments</comments>
		<pubDate>Wed, 20 Oct 2010 17:25:18 +0000</pubDate>
		<dc:creator>displaynone</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Quicklinks]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[imagen]]></category>
		<category><![CDATA[pixelate]]></category>

		<guid isPermaLink="false">http://www.webappers.com/2010/10/19/convert-images-into-a-pixelated-version-with-close-pixelate/</guid>
		<description><![CDATA[Close Pixelate es un script que convierte una imagen en su correspondiente pixelada haciendo uso de HTML5 y canvas. Se le pueden indicar las siguientes opciones: resolución, forma del pixelado, tamaño, desplazamiento y canal alpha Su uso es tan sencillo como ejecutar lo siguiente: var docReady = function&#40;&#41; &#123; document.getElementById&#40;'portrait-image'&#41;.closePixelate&#40;&#91; &#123; resolution : 24 &#125;, [...]]]></description>
			<content:encoded><![CDATA[<p>Close Pixelate es un script que convierte una imagen en su correspondiente pixelada haciendo uso de HTML5 y canvas. Se le pueden indicar las siguientes opciones: resolución, forma del pixelado, tamaño, desplazamiento y canal alpha</p>
<p><img src="http://sentidoweb.com/wp-content/uploads/2010/10/canvas.png" alt="" title="canvas" width="500" height="313" class="center" /></p>
<p>Su uso es tan sencillo como ejecutar lo siguiente:</p>
<pre><code><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> docReady = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'portrait-image'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">closePixelate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>
    <span style="color: #66cc66;">&#123;</span> resolution : <span style="color: #CC0000;">24</span> <span style="color: #66cc66;">&#125;</span>,
    <span style="color: #66cc66;">&#123;</span> shape : <span style="color: #3366CC;">'circle'</span>, resolution : <span style="color: #CC0000;">24</span>, size: <span style="color: #CC0000;">16</span>, offset: <span style="color: #CC0000;">12</span>, alpha: <span style="color: #CC0000;">0</span>.<span style="color: #CC0000;">5</span> <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;
window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'DOMContentLoaded'</span>, docReady, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</pre></code></pre>
<p><a href="http://desandro.com/resources/close-pixelate/">Close Pixelate</a></p>
<p>Vía / <a href="http://www.webappers.com/2010/10/19/convert-images-into-a-pixelated-version-with-close-pixelate/" title="Convert Images into a Pixelated Version with Close Pixelate">WebAppers</a></p>]]></content:encoded>
			<wfw:commentRss>http://sentidoweb.com/2010/10/20/close-pixelate-pixela-imagenes-con-html5.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

