<?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>:: TechBlog :: &#187; javascript</title>
	<atom:link href="http://techblog.touchbasic.com/html/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.touchbasic.com/html</link>
	<description>Techblog is collection of articles covering a wide variety of tech related topics including: Linux, Microsoft, Google, web development, web design, open source, wordpress, security, and more.</description>
	<lastBuildDate>Fri, 06 May 2011 00:58:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WP 2.3 Plugin &#8211; Per Post Creative Commons License</title>
		<link>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/</link>
		<comments>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 22:33:31 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Copyright]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cc]]></category>
		<category><![CDATA[creative commons]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/</guid>
		<description><![CDATA[This plugin will add the ability to choose different Creative Commons licensing structures for different posts that you publish to your WordPress blog. As far as i could tell, there are currently 2 other CC plugins for WordPress &#8211; wpLicense and cc-configurator &#8211; however both of them only let you set your license on a [...]]]></description>
			<content:encoded><![CDATA[<p>This plugin will add the ability to choose different Creative Commons licensing structures for different posts that you publish to your WordPress blog.</p>
<p>As far as i could tell, there are currently 2 other CC plugins for WordPress &#8211; <a href="http://wiki.creativecommons.org/WpLicense">wpLicense</a> and <a href="http://www.g-loaded.eu/2006/01/14/creative-commons-configurator-wordpress-plugin/">cc-configurator</a> &#8211; however both of them only let you set your license on a global level. That is, they let you pick one license for all your posts and pages throughout your entire site. I thought it might be useful if each WP user/author could choose between different CC licenses and be able to set them on a post-by-post basis. So, i modified the wpLicense plugin to do just that. </p>
<blockquote><p><strong>&#8220;The main purpose of this plugin is to give WP admins who run sites with multiple users/authors the option let these users/authors set specific CC licensing terms on a post by post basis.&#8221;</strong></p></blockquote>
<p><strong>How it works:</strong><br />
It uses the <a href="http://api.creativecommons.org/docs/readme_15.html#details-license-uri-uri">CC api</a> and the <a href="http://wiki.creativecommons.org/JsWidget">JsWidget</a> to add a new section to the write/edit post page and then displays a small CC graphic/button and text on your published posts for all to see. The widget lets you choose the appropriate licensing structure and then your choice is automatically saved to a custom field the next time you click &#8220;Save and Continue Editing&#8221;, &#8220;Save&#8221;, or &#8220;Publish&#8221;. Then, it uses the CC api (details-license-uri-uri) to call some javascript that displays a small graphic/button and some text linking back to the definitions for the license you have chosen. Jquery was used to insert the new CC license section to the write/edit post pages as well as to open/close the new section. I also had to use Jquery to fix the tooltips for the JsWidget. Lastly, this plugin is optimized so that it will add only 1 DB query (the cc_js_result_uri) to each post that has set a CC license and stores it to a custom field for that given post &#8211; whereas the wpLicense plugin seemed to use 3 seperate db queries to set the global licencing for the site.</p>
<p><strong>Screenshots:</strong><br />
Check out the plugin in action.<br />
<a href='http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/cc-edit-post-view/' rel='attachment wp-att-202' title='cc edit post view'><img style="float:left;margin:15px;padding:2px;border:1px solid #bbb;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/02/cc-edit-post.thumbnail.jpg' alt='cc edit post view' /></a><a href='http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/cc-view-post-license/' rel='attachment wp-att-203' title='cc view post license'><img style="float:left;margin:15px;padding:2px;border:1px solid #bbb;" src='http://techblog.touchbasic.com/html/wp-content/uploads/2008/02/cc-view-post.thumbnail.jpg' alt='cc view post license' /></a></p>
<div style="clear:both;"></div>
<p><span id="more-201"></span></p>
<p><strong>Download:</strong><br />
Click on the following link to download the plugin: <a href="http://touchbasic.googlepages.com/per-post-license_v0.2.zip">per-post-license_v.02.zip</a></p>
<p><strong>Requirements:</strong><br />
1. This plugin has been testing and works on WP 2.3.x using the default theme (but it is still a work in progess / comments and suggestions are welcome).<br />
2. Your web server needs either curl (most have it installed and it&#8217;s the default setting used in this plugin) or URL file-access enabled (to be able to run file_get_contents() instead of curl).</p>
<p><strong>Install:</strong><br />
1. Unzip and Copy the per-post-license folder to your plugins directiory and activate it.<br />
2. Add the template function (see next paragraph) to where you&#8217;d like the CC image/button and text to appear on your post (this might be the single.php or footer.php template file).<br />
3. Go to the Write post page or Edit an existing post.<br />
4. Look for the new section marked &#8220;CC License&#8221; and click the small &#8220;plus&#8221; sign to open the section.<br />
5. Select &#8220;A Creative Commons license&#8221; and choose the appropriate licensing structure.<br />
6. Save the post and You&#8217;re Done!</p>
<p><strong>WP Template Function:</strong><br />
Add the following function to the WP template file (like single.php, or footer.php) to get the CC license to appear on your post.<br />
<code lang="php">
<div id="cc_code">< ?php if(function_exists('cc_insert_html')) { cc_insert_html($display=true); } /* get cc code */ ?></div>
<p></code></p>
<p><strong>Template Options:</strong><br />
Right now, there are only 2 options that you can use with the cc_insert_html() template function.<br />
1. The first is the $display variable. [$display=true ---> will show the CC license , $display=false will not]<br />
2. The second is the $use_curl variable [default is set to --> $use_curl=true , if you explicitly set $use_curl=false the plugin will revert to the php function file_get_contents() which is not always enabled on all web servers]</p>
<p><strong>CSS styles:</strong><br />
Here is a sample style you can use to center, add padding and margins, as well as a horizontal dashed separator (you can ofcourse use any style you like). You would add this code to your style.css file in your template directory.<br />
<code lang="css">#cc_code { text-align:center; font-size:11px; width:450px; margin-top:25px; padding-top:25px; border-top:1px dashed #ccc; }</code><br />
You could also just use inline css and replace the < div id="cc_code" > and add these styles directly &#8211; something like < div style="text-align:center; font-size:11px;" >.</p>
<p><strong>To Do:</strong><br />
- get rss/atom feeds showing CC license<br />
- possibly add CC to header (if appropriate)<br />
- option to set per author licensing (for all an author&#8217;s posts)<br />
- option to set global default license for entire site<br />
- option to turn off graphic/button and just show text<br />
- option to choose/add an existing licensing structure (other than CC) by providing a URL<br />
- create another template function to gather and list all posts with CC licensing (by title)</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/wp-23-plugin-per-post-creative-commons-license/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to get the WPG2 plugin to work with Thickbox</title>
		<link>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</link>
		<comments>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 21:12:07 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[g2image]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[WPG2]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/</guid>
		<description><![CDATA[If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image. Well, i needed a choice/option that worked in a similar way but [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a Gallery2 installation intergrated with WordPress 2.3 &#8211; using the WPG2 plugin &#8211; then you are probably aware that the G2Image chooser includes a choice for inserting images into posts using the LightBox effect and pointing to a full-sized image.</p>
<p>Well, i needed a choice/option that worked in a similar way but for Thickbox. Since both Lightbox and Thickbox are triggered by including special attributes on each anchor (a link) and pointing to a full-sized image &#8211; i figured it could not be that hard to find and edit the code that inserts the LightBox bit and swap it out for some Thickbox code.</p>
<blockquote><p>LightBox format is: < a href="fullsized.jpg" rel="lightbox" >< img src="thumb.jpg" />< /a ><br />
ThickBox format is: < a href="fullsized.jpg" class="thickbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>All i ended up doing was adding the thickbox class=&#8221;thickbox&#8221; in addition to the lightbox rel=&#8221;lightbox&#8221;.</p>
<p>So the final result inserts the combined code into your WordPress posts:</p>
<blockquote><p>< a href="fullsized.jpg" class="thickbox" rel="lightbox" >< img src="thumb.jpg" />< /a ></p></blockquote>
<p>Now it works with either Lightbox or Thickbox scripts (i wouldn&#8217;t use both at the same time).<br />
Note: you still need to provide the appropriate javascript (Thickbox or Lightbox) and link to it in your header file for this to work.</p>
<blockquote><p>Tested with:<br />
WordPress v2.3.1<br />
Gallery2 v2.2.3 core 1.2.0.5<br />
WPG2 v3.0.2</p></blockquote>
<p>Anyway, here are the 3 WPG2 plugin files i edited to get this going:</p>
<blockquote><p>
<strong>wp-content/plugins/wpg2/g2image/g2image.php</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/g2image.php">here</a>]<br />
<strong>wp-content/plugins/wpg2/g2image/jscripts/functions.js</strong> &#8211; [download the changed file <a id="p187" href="http://techblog.touchbasic.com/html/wp-content/uploads/2007/11/functions.js">here</a>]<br />
<strong>wp-content/plugins/wpg2/wpg2embed.inc</strong> &#8211; [download the changed file <a href="http://touchbasic.googlepages.com/wpg2embed.inc">here</a>]
</p></blockquote>
<p>These are the exact edits i made (but watch out! because copy/pasting seems to change the single quote marks):</p>
<p>g2image.php &#8211; modify option to give choice (in dropdown menu of W2Image chooser) for specifically inserting Thickbox<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with LightBox link to Fullsized Image'); [/code]<br />
	[code lang="php"] $message['thumbnail_lightbox'] = T_('Thumbnail with ThickBox link to Fullsized Image'); [/code]</p>
<p>functions.js &#8211; modify javascript to do the actual inserting of code with Thickbox<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" rel="lightbox'; [/code]<br />
	[code lang="php"] htmlCode += '<a href="' + fullsize_img[i] + '" class="thickbox" rel="lightbox'; [/code]</p>
<p>wpg2embed.inc - modify wpg2tag so option (in dropdown menu of W2Image chooser) will work with Thickbox [optional]<br />
Note: for this to work you also need to have "Should WPG2 Tags have Lightbox Support?" set to "Yes" in your backend: WPG2 > Lightbox Options.<br />
	[code lang="php"] $img = str_replace('><img ', ' rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]<br />
	[code lang="php"] $img = str_replace('/><img ', ' class="thickbox" rel="lightbox['.$post-/>ID.']"><img ', $img); [/code]</a/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/how-to-get-the-wpg2-plugin-to-work-with-thickbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web 2.0 &#8211; Where are you?</title>
		<link>http://techblog.touchbasic.com/html/web-20-where-are-you/</link>
		<comments>http://techblog.touchbasic.com/html/web-20-where-are-you/#comments</comments>
		<pubDate>Fri, 08 Jul 2005 17:36:26 +0000</pubDate>
		<dc:creator>elran</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://techblog.touchbasic.com/html/?p=94</guid>
		<description><![CDATA[As a follow up to the earlier post entitled <a href="http://techblog.touchbasic.com/html/?p=91">AJAX: A Closer Look</a>, i decided to dig deeper into this new technique and the trends in web design / programming that appear to be emerging. The term Web 2.0 is commonly used to refer to a new generation of web applications and systems.]]></description>
			<content:encoded><![CDATA[<p><span style="color:#bbb;margin-bottom:15px;">[ page last updated: Aug. 04, 2005. ]</span></p>
<p>As a follow up to the earlier post entitled <a href="http://techblog.touchbasic.com/html/?p=91">AJAX: A Closer Look</a>, i decided to dig deeper into this new technique and the trends in web design / programming that appear to be emerging. The term Web 2.0 is commonly used to refer to a new generation of web applications and systems.</p>
<p>From <a href="http://www.whatsweb20.com/about">www.whatsweb20.com</a>, &#8220;it&#8217;s going to enable a whole bunch of cool new things that we can&#8217;t even imagine yet&#8221;.</p>
<p><span id="more-94"></span></p>
<p>According to the <a href="http://en.wikipedia.org/wiki/Web_2.0">Wikipedia</a>:</p>
<blockquote><p>
A website could be said to be built using Web 2.0 technologies if it featured a number of the following techniques:</p>
<p><span class="under">Technical</span>:</p>
<ul>
<li>CSS and semantically valid XHTML markup</li>
<li>Unobtrusive AJAX Techniques</li>
<li>Syndication of data in RSS/ATOM</li>
<li>Aggregation of RSS/ATOM data</li>
<li>Clean and meaningful URLs</li>
<li>Support posting to a weblog</li>
<li>RESTian (preferred) or XML Webservice APIs</li>
<li>Some social networking aspects (share your data with friends, etc)</li>
</ul>
<p><span class="under">General</span>:</p>
<ul>
<li>The site should not act as a &#8220;walled garden&#8221; &#8211; it should be easy to get data in and out of the system.</li>
<li>Users should own their own data on the site</li>
<li>Purely web based &#8211; most successful web 2.0 sites can be used almost entirely through the browser</li>
</ul>
</blockquote>
<p>Other related technologies include:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/SOAP">SOAP</a> &#8211; Simple Object Access Protocol</li>
<li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li>
</ul>
<p>Here a some sites with excellent resources:</p>
<ul>
<li><a href="http://script.aculo.us/">script.aculo.us</a> provides you with easy-to-use, compatible and, ultimately, totally cool JavaScript libraries to make your web sites and web applications fly, Web 2.0 style.</li>
<li><a href="http://ripcord.co.nz/behaviour/">Behaviour</a> is the missing link for your ajax apps.</li>
<li><a href="http://prototype.conio.net/">Prototype</a> is an object-oriented Javascript library that aims to ease development of dynamic web applications.</li>
<li><a href="http://mir.aculo.us/">mir.aculo.us</a> is a site with a collection of thoughts, links and other stuff related to web application development, RoR, AJAX, Web 2.0, and more.</li>
<li><a href="http://openrico.org/">Rico</a> provides a very simple interface for registering Ajax request handlers as well as HTML elements or JavaScript objects as Ajax response objects.</li>
<li><a href="http://www.techcrunch.com/">Techcrunch</a> is a weblog dedicated to obsessively profiling and reviewing every newly launched web 2.0 business, product and service.</li>
<li><a href="http://tool-man.org/examples/sorting.html">Tool-man.org</a> has some good resources, including some examples such as: Drag &#038; Drop Sortable Lists with JavaScript and CSS</li>
<li><a href="http://jpspan.sourceforge.net/wiki/doku.php">JPSpan</a> provides tools to â€œhook upâ€ PHP and Javascript, for the purpose of fetching data from PHP into a web page which has already loaded, without reloading the entire page.</li>
<li><a href="http://www.modernmethod.com/sajax/">SAJAX</a> &#8211; Simple Ajax Toolkit by ModernMethod &#8211; XMLHTTPRequest Toolkit for PHP.</li>
<li><a href="http://cpaint.sourceforge.net/">CPAINT</a> &#8211; Cross-Platform Asynchronous INterface Toolkit. It provides the code required to implement AJAX and JSRS on the back-end, while using JavaScript on the front-end.</li>
</ul>
<p>Even more resources:<br />
1. <a href="http://www.ruby-lang.org/en/">Ruby</a> is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, portable, open, and free.<br />
2. <a href="http://www.bigbold.com/snippets/">Snippets</a> is a public code repository. You can easily add code to your personal collection of code snippets, categorize your code snippets with keywords (known as &#8216;tags&#8217;), and share your snippets via this site.<br />
3. <a href="http://rubyforge.org/">RubyForge</a> is a home for open source Ruby projects.<br />
4. <a href="http://www.rubycentral.com/book/index.html">Programming Ruby</a> is a book complete with tutorials and reference for the Ruby programming language.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.touchbasic.com/html/web-20-where-are-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

