<?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>hubionmac.com &#187; javascript</title> <atom:link href="http://hubionmac.com/wordpress/tag/javascript/feed/" rel="self" type="application/rss+xml" /><link>http://hubionmac.com/wordpress</link> <description>script the unscriptable</description> <lastBuildDate>Fri, 03 Feb 2012 22:41:10 +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>JavaScript: PrettyPhoto Video für iOS anpassen</title><link>http://hubionmac.com/wordpress/2011/03/javascript-prettyphoto-video-fur-ios-anpassen/</link> <comments>http://hubionmac.com/wordpress/2011/03/javascript-prettyphoto-video-fur-ios-anpassen/#comments</comments> <pubDate>Thu, 31 Mar 2011 05:32:55 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[ipad]]></category> <category><![CDATA[iphone]]></category> <category><![CDATA[ipod]]></category> <category><![CDATA[php]]></category> <category><![CDATA[prettyphoto]]></category> <category><![CDATA[webdev]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2788</guid> <description><![CDATA[Ich habe für einige Seiten PrettyPhoto in Verbindung mit dem Flowplayer genutzt, um Videos einzubinden. Da die Filme als mp4 vorliegen und die Seiten auch für das iPad&#038;Co nutzbar sein sollen, waren hier einige Anpassungen an PrettyPhoto selbst notwendig. Zunächst sollten die Videos auch ohne aktiviertes JavaScript abspielbar sein, hierzu wurde ein PHP-Seite erstellt, die [...]]]></description> <content:encoded><![CDATA[<div class="2columns"><p>Ich habe für einige Seiten <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/" target="_blank">PrettyPhoto</a> in Verbindung mit dem <a href="http://flowplayer.org/" target="_blank">Flowplayer</a> genutzt, um Videos einzubinden. Da die Filme als mp4 vorliegen und die Seiten auch für das iPad&#038;Co nutzbar sein sollen, waren hier einige Anpassungen an PrettyPhoto selbst notwendig.<br /> Zunächst sollten die Videos auch ohne aktiviertes JavaScript abspielbar sein, hierzu wurde ein <a href="http://hubionmac.com/wordpress/wp-content/uploads/2011/03/player.php_.zip">PHP-Seite</a> erstellt, die zwischen iOS und anderen Geräten unterscheiden kann und die mp4 Dateien entsprechen einbindet (FlashObject oder HTML5-Video-Tag für iOS). Die Links zu die dieser Seite (player.php?url=/media/meinfilm.mp4) wurde entsprechend eingefügt.</p><p>Ist nun JavaScript aktiv werden diese Links (rel=&#8221;prettyphoto&#8221;) entsprechend <a href="http://hubionmac.com/wordpress/wp-content/uploads/2011/03/initPrettyPhoto.js" target="_blank">umgebaut</a>. Alle nicht-iOS Geräte zeigen in einer PrettyPhoto-Box den Inhalt der Player.php (in einem iFrame) an, hierzu wird zumindest <em>iframe=true</em> an den Link angehängt. iOS Geräte gehen etwas weiter und ersetzen zunächst den Link zur Player.php gegen den direkten Link zur mp4-Datei.<br /> Nun kommt eine kleine eigene Anpassung in der PrettyPhoto.js zum Tragen, nämlich<br /> <code>else if (itemSrc.match(/\b.mov\b/i)|| ((navigator.userAgent.indexOf(&#x27;iPad&#x27;)&gt;-1 || navigator.userAgent.indexOf(&#x27;iPhone&#x27;)&gt;-1 || navigator.userAgent.indexOf(&#x27;iPod&#x27;)&gt;-1) &amp;&amp; (itemSrc.indexOf(&#x27;.mp4&#x27;) != -1))) {<br /> return &#x27;quicktime&#x27;;</code><br /> Auf diesem Weg wird unter iOS das Video direkt in ein Overlay eingebunden (als Quicktime Object).</p><p>Diese Anpassung war notwendig, da das Video in dem sonst genutztem iFrame nicht 100%ig zentriert wurde&#8230;</p></div><p><strong>Fazit:</strong><br /> Es scheint eine recht solide Weise zu sein, Videos einzubinden. Vielleicht sollte man eine zentrale Stelle definieren, auf die JavaScript und PHP zugreifen, die die Bedingungen für iOS definiert. Am schönsten wäre es, wenn die PHP, sowie JavaScript-Lösung das Video über einen HTML-5-Video-Tag einbinden würden, neben iOS gibt es schließlich ja auch noch Android und WebOS&#8230; to be continued</p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/03/javascript-prettyphoto-video-fur-ios-anpassen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Protected: Mactechnews Gallerie Downloader</title><link>http://hubionmac.com/wordpress/2011/01/mactechnews-gallerie-downloader/</link> <comments>http://hubionmac.com/wordpress/2011/01/mactechnews-gallerie-downloader/#comments</comments> <pubDate>Fri, 14 Jan 2011 11:36:43 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[Safari]]></category> <category><![CDATA[AppleScript]]></category> <category><![CDATA[curl]]></category> <category><![CDATA[download]]></category> <category><![CDATA[images]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[mactechnews]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2520</guid> <description><![CDATA[There is no excerpt because this is a protected post.]]></description> <content:encoded><![CDATA[<form action="http://hubionmac.com/wordpress/wp-pass.php" method="post"><p>This post is password protected. To view it please enter your password below:</p><p><label for="pwbox-2520">Password:<br /> <input name="post_password" id="pwbox-2520" type="password" size="20" /></label><br /> <input type="submit" name="Submit" value="Submit" /></p></form> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/01/mactechnews-gallerie-downloader/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>FireFox 4 ist schnell…</title><link>http://hubionmac.com/wordpress/2011/01/firefox-4-ist-schnell/</link> <comments>http://hubionmac.com/wordpress/2011/01/firefox-4-ist-schnell/#comments</comments> <pubDate>Mon, 03 Jan 2011 21:59:56 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[Software I Use]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[webkit]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2426</guid> <description><![CDATA[Ich bin vor einiger Zeit von FireFox auf Safari gewechselt. Wenn ich mir aber nun die JavaScript-Performance der 4er Beta ansehe werde ich doch langsam wieder etwas schwach. Das ganze Ding macht wirklich den Eindruck einer schnellen Mac-Anwendung. Jetzt müssen Sie nur noch die AppleScript-Unterstützung etwas voran bringen und ich habe meinen neuen Standard-Browser =) [...]]]></description> <content:encoded><![CDATA[<p>Ich bin vor einiger Zeit von FireFox auf Safari gewechselt. Wenn ich mir aber nun die JavaScript-Performance der 4er Beta <a href="http://hubionmac.com/wordpress/2009/06/so-schon-firefox-3-5-auch-sein-mag/" target="_blank">ansehe</a> werde ich doch langsam wieder etwas schwach. Das ganze Ding macht wirklich den Eindruck einer schnellen Mac-Anwendung.<br /> Jetzt müssen Sie nur noch die AppleScript-Unterstützung etwas voran bringen und ich habe meinen neuen Standard-Browser =)<br /> Ok, die Webkit-Animationen dürften mir etwas fehlen, aber da wir sich bestimmt etwas finden, was mich darüber hinweg tröstet.</p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2011/01/firefox-4-ist-schnell/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>AppleScript in Google Chrome</title><link>http://hubionmac.com/wordpress/2010/11/applescript-in-google-chrome/</link> <comments>http://hubionmac.com/wordpress/2010/11/applescript-in-google-chrome/#comments</comments> <pubDate>Sat, 06 Nov 2010 21:15:50 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[Google Chrome]]></category> <category><![CDATA[Safari]]></category> <category><![CDATA[AppleScript]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[safari]]></category> <category><![CDATA[support]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2364</guid> <description><![CDATA[Bei meiner Arbeit nutze ich oft AppleScript in Verbindung mit JavaScript. Viele meiner täglichen Aufgaben müssen über Webseiten abgewickelt werden und wenn es z.B. darum geht ein Web-Formular mit Daten aus Excel oder einem anderen Programm zu füttern oder Daten aus Webseiten zu extrahieren, dann kann so eine AppleScript-JavaScript-Lösung einem schon wirklich einiges an Zeit [...]]]></description> <content:encoded><![CDATA[<p>Bei meiner Arbeit nutze ich oft AppleScript in Verbindung mit JavaScript. Viele meiner täglichen Aufgaben müssen über Webseiten abgewickelt werden und wenn es z.B. darum geht ein Web-Formular mit Daten aus Excel oder einem anderen Programm zu füttern oder Daten aus Webseiten zu extrahieren, dann kann so eine AppleScript-JavaScript-Lösung einem schon wirklich einiges an Zeit ersparen.<br /> Bisher war hierfür eigentlich nur Safari geeignet, da nur Safari das Ausführen längere JavaScripts via AppleScript unterstützte.</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Safari&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>document</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #2832f9"><b>do JavaScript</b></span> &#8220;document.links.length&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div></div><p>Aber jetzt hat auch Google Chrome eine Schnittstelle für AppleScript erhalten und kann (wenn auch noch etwas rudimentär) JavaScript-Befehle über AppleScript ausführen.</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Google Chrome&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>window</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>tab</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #2832f9"><b>execute</b></span> <span style="color: #2832f9">javascript</span> &#8220;document.links.length&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 117.8px; text-indent: -117.8px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div></div><p>Das Problem was dabei aber noch besteht: Der Aufruf führt das angegeben JavaScript zwar aus, gibt aber an AppleScript nichts aus. Stattdessen erscheint nach dem Ausführen des obigen Codes nur <span style="background:#aaa;padding:0 5px 0 5px;font: 12.0px Verdana; color: #2832f9"><i>missing value</i></span> in der Ausgabe. Zur Zeit behelfe ich mir noch damit den Rückgabewert in den Titel des Dokuments zu schreiben und diesen dann via AppleScript auszulesen:</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Google Chrome&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>window</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>tab</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #2832f9"><b>execute</b></span> <span style="color: #2832f9">javascript</span> &#8220;document.title = document.links.length + 1&#8243;</p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #172fb9"><b>delay</b></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>get</b> <span style="color: #8c27d6">title</span></p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div></div><p>Etwas unschön zumal ein delay mit rein muss, da der Titel sich nicht unmittelbar aktualisiert, aber zumindest schon mal ein Anfang, wenn Chrome der auserwählte Web-Browser sein sollte.</p><p><strong>Kleiner Nachtrag&#8230; statt <span style="color: #2832f9"><i>tab</i></span> 1 kann man auch <span style="font: 12.0px Verdana; color: #9200de">active tab</span> nutzen</strong></p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/11/applescript-in-google-chrome/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Webdev: Webkit Transition Beispiel</title><link>http://hubionmac.com/wordpress/2010/05/webdev-webkit-transition-beispiel/</link> <comments>http://hubionmac.com/wordpress/2010/05/webdev-webkit-transition-beispiel/#comments</comments> <pubDate>Mon, 31 May 2010 02:52:21 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[webdev]]></category> <category><![CDATA[beispiel]]></category> <category><![CDATA[css]]></category> <category><![CDATA[html]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[webkit]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2234</guid> <description><![CDATA[Ich wollte für eine kleine Web-Anwendung die ich gerade schreibe einen Effekt nutzen, den ich auf der Seite von The Wonderfactory gesehen habe. Dort kann man auf der Seite die Schlagzeilen durchblättern, was vermutlich mit der selben Technik umgesetzt wurde, die die auch für die HTML-5 Ausgabe der Sports-Illustrated genutzt haben. Ich bin nicht so [...]]]></description> <content:encoded><![CDATA[<p>Ich wollte für eine kleine Web-Anwendung die ich gerade schreibe einen Effekt nutzen, den ich auf der Seite von <a href="http://www.thewonderfactory.com/" target="_blank">The Wonderfactory</a> gesehen habe. Dort kann man auf der Seite die Schlagzeilen durchblättern, was vermutlich mit der selben Technik umgesetzt wurde, die die auch für die HTML-5 Ausgabe der Sports-Illustrated genutzt haben.<br /> Ich bin nicht so ein Freund von aufgeblähten JavaScript-Bibliotheken (zu aufgebläht für meine Seite) und diesen setTimeout-Pfusch den man nutzt, um etwas Bewegung in eine Seite zu bringen. Deshalb und weil die Seite die ich gerade schreibe wohl hauptsächlich von Webkit-Browsern angesteuert werden dürfte, habe ich mir so eine Wisch-Effekt-Box mit dem ein bissle JavaScript und etwas mehr CSS zusammengebaut. Unterm Strich können diese <a href="http://webkit.org/blog/324/css-animation-2/" target="_blank">Webkit-Transition-Effekte</a> einiges an JavaScript-Code überflüssig machen und die Seite läuft damit auch problemlos auf dem iPhone =)<br /> Und die Animation soll angeblich auch von der Hardware beschleunigt werden.<br /> <a href="http://hubionmac.com/downloads/softwarschmiede/skimbox.html" target="_blank">Link zur Demo Seite</a></p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/05/webdev-webkit-transition-beispiel/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Safari: Öffne alle JavaScript Links</title><link>http://hubionmac.com/wordpress/2010/05/safari-offne-alle-javascript-links/</link> <comments>http://hubionmac.com/wordpress/2010/05/safari-offne-alle-javascript-links/#comments</comments> <pubDate>Wed, 05 May 2010 20:16:46 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[Safari]]></category> <category><![CDATA[Useful Snippets]]></category> <category><![CDATA[AppleScript]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[safari]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2203</guid> <description><![CDATA[Kann recht praktisch sein, wenn man sich mal alle JavaScript-Dateien zu einer Website anzeigen lassen möchte&#8230; Code zum markieren einmal anklicken Code im Skript-Editor öffnen tell application &#8220;Safari&#8221; tell document 1 &#8211;set mybaseURL to do JavaScript &#8220;document.URL.slice(0, document.URL.lastIndexOf(&#8216;/&#8217;)+1)&#8221; set jslinks to do JavaScript &#8220;var jssrcarray = new Array() for (var i=0;i&#60;document.getElementsByTagName(&#8216;script&#8217;).length;i++) { jssrcarray.push(document.getElementsByTagName(&#8216;script&#8217;)[i].src) } jssrcarray [...]]]></description> <content:encoded><![CDATA[<p>Kann recht praktisch sein, wenn man sich mal alle JavaScript-Dateien zu einer Website anzeigen lassen möchte&#8230;</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Safari&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>document</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana; color: #5e6161"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></span>&#8211;set mybaseURL to do JavaScript &#8220;document.URL.slice(0, document.URL.lastIndexOf(&#8216;/&#8217;)+1)&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>set</b> <span style="color: #3b9120">jslinks</span> <b>to</b> <span style="color: #2832f9"><b>do JavaScript</b></span> &#8220;var jssrcarray = new Array()</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>for (var i=0;i&lt;document.getElementsByTagName(&#8216;script&#8217;).length;i++)</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>{</p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>jssrcarray.push(document.getElementsByTagName(&#8216;script&#8217;)[i].src)</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>}</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>jssrcarray</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>&#8220;</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>repeat</b> <b>with</b> <span style="color: #3b9120">jslink</span> <b>in</b> <span style="color: #3b9120">jslinks</span></p><p style="margin: 0.0px 0.0px 0.0px 166.5px; text-indent: -166.5px; font: 12.0px Verdana; color: #172fb9"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></span><b>open location</b><span style="color: #000000"> </span><span style="color: #3b9120">jslink</span></p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>repeat</b></p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/05/safari-offne-alle-javascript-links/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nervige Overlays auf Website entfernen</title><link>http://hubionmac.com/wordpress/2010/05/nervige-overlays-auf-website-entfernen/</link> <comments>http://hubionmac.com/wordpress/2010/05/nervige-overlays-auf-website-entfernen/#comments</comments> <pubDate>Tue, 04 May 2010 07:41:37 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[NERV!]]></category> <category><![CDATA[ausblenden]]></category> <category><![CDATA[overlay]]></category> <category><![CDATA[pop-up]]></category> <category><![CDATA[werbung]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2200</guid> <description><![CDATA[Früher waren es die Pop-Up-Fenster heute sind es nervig Overlays, die die Sicht auf eine Website versperren. Entweder schaltet man stumpf JavaScript aus oder klickt die Overlays weg, was dann den Aufruf von anderen Overlays oder Popups zur Folge hat. Ein kleine Hilf stellt diese JavaScipt-Code dar, den der alle diese Overlay-Dinger schlichtweg ausblendet. (Quick&#038;Dirty). [...]]]></description> <content:encoded><![CDATA[<p>Früher waren es die Pop-Up-Fenster heute sind es nervig Overlays, die die Sicht auf eine Website versperren. Entweder schaltet man stumpf JavaScript aus oder klickt die Overlays weg, was dann den Aufruf von anderen Overlays oder Popups zur Folge hat. Ein kleine Hilf stellt diese JavaScipt-Code dar, den der alle diese Overlay-Dinger schlichtweg ausblendet. (Quick&#038;Dirty).</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Safari&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>document</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #2832f9"><b>do JavaScript</b></span> &#8220;for (var i=0;i&lt;document.getElementsByTagName(&#8216;*&#8217;).length;i++)</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">{</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">if ((document.getElementsByTagName(&#8216;*&#8217;)[i].style.position == &#8216;absolute&#8217;)||(document.getElementsByTagName(&#8216;*&#8217;)[i].style.position == &#8216;fixed&#8217;))</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">document.getElementsByTagName(&#8216;*&#8217;)[i].style.display = &#8216;none&#8217;</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">}&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p></div></div><p>Macnews hat da eine etwas abgeänderte Form, das Overlay wird dort über eine Stylesheet definiert, deshalb nun computed style und schon funktioniert es wieder =)</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>tell</b> <span style="color: #2832f9"><i>application</i></span> &#8220;Safari&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>tell</b> <span style="color: #2832f9"><i>document</i></span> 1</p><p style="margin: 0.0px 0.0px 0.0px 124.8px; text-indent: -124.9px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span style="color: #2832f9"><b>do JavaScript</b></span> &#8220;for (var i=0;i&lt;document.getElementsByTagName(&#8216;*&#8217;).length;i++)</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">{</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">if ((document.defaultView.getComputedStyle(document.getElementsByTagName(&#8216;*&#8217;)[i],null).position == &#8216;absolute&#8217;)||(document.defaultView.getComputedStyle(document.getElementsByTagName(&#8216;*&#8217;)[i],null).position == &#8216;fixed&#8217;))</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">document.getElementsByTagName(&#8216;*&#8217;)[i].style.display = &#8216;none&#8217;</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">}&#8221;</p><p style="margin: 0.0px 0.0px 0.0px 83.2px; text-indent: -83.2px; font: 12.0px Verdana"><span class="Apple-tab-span" style="white-space:pre"> </span><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><b>end</b> <b>tell</b></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana; min-height: 15.0px"></p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana; min-height: 15.0px"></p></div></div> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/05/nervige-overlays-auf-website-entfernen/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Youtube Downloadlink für Videos</title><link>http://hubionmac.com/wordpress/2010/04/youtube-downloadlink-fur-videos/</link> <comments>http://hubionmac.com/wordpress/2010/04/youtube-downloadlink-fur-videos/#comments</comments> <pubDate>Mon, 12 Apr 2010 23:32:50 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[youtube]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2110</guid> <description><![CDATA[Ich hatte da mal ein sehr schönes JavaScript als Bookmark, welches mit einen Download-Link der mp4 in die Seite einbaute, nur leider funktionierte das nicht mehr. Ein ungleich kürzes Skript habe ich hier gefunden und mit daraus dann das hier gebaut: Code zum markieren einmal anklicken javascript:swfHTM%20=%20document.getElementById(&#8216;movie_player&#8217;).getAttribute(&#8216;flashvars&#8217;);%20w%20=%20swfHTM.split(&#8216;&#38;&#8217;);%20for%20(i%20=%200;%20i%20&#60;=%20w.length%20-%201;%20i++)%20{%20if%20(w[i].split(&#8216;=&#8217;)[0]%20==%20&#8242;t&#8217;)%20{%20t%20=%20w[i].split(&#8216;=&#8217;)[1];%20}%20if%20(w[i].split(&#8216;=&#8217;)[0]%20==%20&#8242;video_id&#8217;)%20{%20videoid%20=%20w[i].split(&#8216;=&#8217;)[1];%20}%20}%20bla%20=%20document.createElement(&#8216;a&#8217;);%20bla.setAttribute(&#8216;href&#8217;,'http://youtube.com/get_video?video_id=&#8217;%20+%20videoid%20+%20&#8242;&#38;t=&#8217;%20+%20t%20+%20&#8242;=&#8217;%20+%20&#8242;&#38;fmt=18&#8242;);%20bla.innerHTML%20=%20&#8242;DOWNLOAD&#8217;;%20document.getElementById(&#8216;masthead-nav&#8217;).appendChild(bla); Einfach kopieren, als Bookmark abspeichern und schon hat [...]]]></description> <content:encoded><![CDATA[<p>Ich hatte da mal ein sehr schönes JavaScript als Bookmark, welches mit einen Download-Link der mp4 in die Seite einbaute, nur leider funktionierte das nicht mehr. Ein ungleich kürzes Skript habe ich <a target="_blank" href="http://unlockforus.blogspot.com/2008/09/directly-download-youtube-videos-in.html">hier</a> gefunden und mit daraus dann das hier gebaut:</p><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken</em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">javascript:swfHTM%20=%20document.getElementById(&#8216;movie_player&#8217;).getAttribute(&#8216;flashvars&#8217;);%20w%20=%20swfHTM.split(&#8216;&amp;&#8217;);%20for%20(i%20=%200;%20i%20&lt;=%20w.length%20-%201;%20i++)%20{%20if%20(w[i].split(&#8216;=&#8217;)[0]%20==%20&#8242;t&#8217;)%20{%20t%20=%20w[i].split(&#8216;=&#8217;)[1];%20}%20if%20(w[i].split(&#8216;=&#8217;)[0]%20==%20&#8242;video_id&#8217;)%20{%20videoid%20=%20w[i].split(&#8216;=&#8217;)[1];%20}%20}%20bla%20=%20document.createElement(&#8216;a&#8217;);%20bla.setAttribute(&#8216;href&#8217;,'http://youtube.com/get_video?video_id=&#8217;%20+%20videoid%20+%20&#8242;&amp;t=&#8217;%20+%20t%20+%20&#8242;=&#8217;%20+%20&#8242;&amp;fmt=18&#8242;);%20bla.innerHTML%20=%20&#8242;DOWNLOAD&#8217;;%20document.getElementById(&#8216;masthead-nav&#8217;).appendChild(bla);</p></div></div><p>Einfach kopieren, als Bookmark abspeichern und schon hat man einen DownloadButton für You-Tube-Videos =)</p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/04/youtube-downloadlink-fur-videos/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>JavaScript:AppleScript Link bauen mit Text aus div-Element</title><link>http://hubionmac.com/wordpress/2010/03/javascriptapplescript-link-bauen-mit-text-aus-div-element/</link> <comments>http://hubionmac.com/wordpress/2010/03/javascriptapplescript-link-bauen-mit-text-aus-div-element/#comments</comments> <pubDate>Sat, 13 Mar 2010 00:13:34 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[hubionmac.com]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[AppleScript]]></category> <category><![CDATA[link]]></category> <category><![CDATA[utf-8]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=2009</guid> <description><![CDATA[Ich poste ja den AppleScript-Quellcode hier immer in so einem Div-Elementen, das ab einer gewissen Größe einen Scroll-Balken bekommen. Zudem wählt ein Klick auf den besagten Container den kompletten Inhalt aus und weil ich copy&#038;paste eh schon so oft mache, gibt es dazu noch einen Link &#8220;Code im Script-Editor öffnen&#8221;. Code zum markieren einmal anklicken [...]]]></description> <content:encoded><![CDATA[<div class="hubionmac_spalte_first">Ich poste ja den AppleScript-Quellcode hier immer in so einem Div-Elementen, das ab einer gewissen Größe einen Scroll-Balken bekommen.</div><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">Zudem wählt ein Klick auf den besagten Container den kompletten Inhalt aus und weil ich copy&#038;paste eh schon so oft mache, gibt es dazu noch einen Link &#8220;Code im Script-Editor öffnen&#8221;.</div><div style="clear: both;"></div><hr /><div><div style="clear: left; font-size: 0.8em;"><em>Code zum markieren einmal anklicken <a href="#" onclick="selectThis(this.parentNode.parentNode.parentNode.getElementsByTagName('div')[1]);buildAppleScriptLink();">Code im Skript-Editor öffnen</a></em></div><div class="hubionmac_codebox" onclick="selectThis(this);"><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana"><span style="color: #2000c0"><b>display dialog</b></span> &#8220;Hallo, ich bin ein Dialog voller Sonderzeichen!\&#8221;§$%&amp;/()=?</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">und Umlaute: ÖÄÜöää</p><p style="margin: 0.0px 0.0px 0.0px 41.6px; text-indent: -41.6px; font: 12.0px Verdana">Hm, fällt mir sonst noch etwas ein&#8230; ∂†ΩƒΩ©¨ªºø{|Ω®[€¢€‚∂®çƒ©√∫ª~º∆øπ@•∞œ@&#8221;</p></div></div><hr /> Um diesen Link geht es nun, den baue ich mir nämlich via JavaScript und da die Routine, die ich dazu geschrieben hatte, etwas buggy war, jetzt aber nach einer kleinen Anpassung anscheinend endlich auch mit allen Sonderzeichen und Umlauten zu funktionieren scheint, hier der Code dazu:<br /> <code>function buildAppleScriptLink() {<br /> var txt = '';<br /> if (window.getSelection)<br /> {<br /> txt = window.getSelection();<br /> }<br /> else if (document.getSelection)<br /> {<br /> txt = document.getSelection();<br /> }<br /> else if (document.selection)<br /> {<br /> txt = document.selection.createRange().text;<br /> }<br /> else return;<br /> window.open(("applescript://com.apple.scripteditor?action=new&#038;script=" + (new String(txt)).replace(/\"/g,'%22').replace(/\n/g,'%0D'))).close();<br /> window.getSelection().removeAllRanges();<br /> }</code></p><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">Das Ding wird nach eine anderen Routine aufgerufen (<a href="http://hubionmac.com/downloads/javascripts/hubionmacs/hubionmacs.js" target="_blank">selectThis(this)</a>), die den Inhalt des &#8220;Code-Divs&#8221; auswählt. Der Text, also nicht der HTML-Quellcode (innerHTML) wird dann zu einem AppleScript-Link umformatiert (Anführungszeichen und Zeilenumbrüche werden ersetzt gegen URL-Konforme Escape-Sequenzen) und dieser Link wird via JavaScript dann auch gleich in einem</div><div style="width: 45%; float: left; padding-right: 10pt; display: inline; text-align: justify;">neuen Fenster aufgerufen, was dann zumindest auf einem Mac, den AppleScript-Editor öffnet. Meine Tests unter 10.6.2 und Safari (4.0.5) waren bisher allesamt erfolgreich. Sollte jemand noch eine Idee zu einer Verbesserung des Codes haben, bitte in die Comments. Ich denke das sollte aber alles Funktionieren, sofern die Seite vom Encoding auf UTF-8 steht.</div><div style="clear: both;"></div><p><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;</code></p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/03/javascriptapplescript-link-bauen-mit-text-aus-div-element/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Paint mit HTML</title><link>http://hubionmac.com/wordpress/2010/02/paint-mit-html/</link> <comments>http://hubionmac.com/wordpress/2010/02/paint-mit-html/#comments</comments> <pubDate>Sun, 21 Feb 2010 22:12:59 +0000</pubDate> <dc:creator>hubi</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[html]]></category> <category><![CDATA[paint]]></category><guid isPermaLink="false">http://hubionmac.com/wordpress/?p=1918</guid> <description><![CDATA[Mal sehen, was sich sonst noch dazu finden wird =) html_paint1]]></description> <content:encoded><![CDATA[<p>Mal sehen, was sich sonst noch dazu finden wird =)<br /> <a href='http://hubionmac.com/wordpress/wp-content/uploads/2010/02/html_paint1.html'>html_paint1</a></p> ]]></content:encoded> <wfw:commentRss>http://hubionmac.com/wordpress/2010/02/paint-mit-html/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 7/51 queries in 0.305 seconds using disk: basic
Object Caching 325/677 objects using disk: basic

Served from: hubionmac.com @ 2012-02-11 09:31:41 -->
