<?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>DocuView - document management system &#187; javascript</title>
	<atom:link href="http://docuview.co.uk/index.php/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://docuview.co.uk</link>
	<description>revolutionary web 2.0 document management system</description>
	<lastBuildDate>Fri, 25 Jun 2010 00:50:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>styling forms &#8211; the 21st century way</title>
		<link>http://docuview.co.uk/index.php/2009/08/styling-forms-the-21st-century-way/</link>
		<comments>http://docuview.co.uk/index.php/2009/08/styling-forms-the-21st-century-way/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 18:09:18 +0000</pubDate>
		<dc:creator>Martin Korych</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[alternative]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[docuview]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[line-height]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[working]]></category>

		<guid isPermaLink="false">http://docuview.co.uk/?p=354</guid>
		<description><![CDATA[Even better usage of labels in beautiful semantically enhanced forms combined with jQuery (as seen at ZURB).]]></description>
			<content:encoded><![CDATA[<p>Based on an<a title="styling forms as used in DocuView" href="http://www.zurb.com/article/271/making-forms-convert-through-awesome-inli"> amazing article from ZURB</a> I recommend you have a look at I have revisited their technique to:</p>
<ul>
<li>deliver the same solution in jQuery</li>
<li>use a bit more flexible CSS (at least in my view)</li>
<li>redesign our search box</li>
</ul>
<p><span id="more-354"></span></p>
<p>Up until now we have been using a simple JavaScript solution:</p>
<pre class="brush: xml;">&lt;form id=&quot;search&quot; action=&quot;/index.php&quot; method=&quot;get&quot;&gt;
&lt;div&gt;
&lt;input class=&quot;search_string&quot; type=&quot;text&quot; name=&quot;search_string&quot; id=&quot;search_string&quot; onfocus=&quot;if (this.value == this.defaultValue) this.value = '';&quot; onblur=&quot;if (trim(this.value) == '') this.value = this.defaultValue;&quot; onmouseover=&quot;this.focus();&quot; value=&quot;search DocuView&quot; /&gt;
&lt;input class=&quot;search_submit&quot; type=&quot;submit&quot; name=&quot;search_submit&quot; id=&quot;search_submit&quot; value=&quot;&quot; /&gt;
&lt;input class=&quot;hidden&quot; type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;search&quot; /&gt;
&lt;/div&gt;
&lt;/form&gt;</pre>
<p>It worked just fine. Displayed the desired value in the input field and on focus it&#8217;d replace it with cursor&#8230; We use that in combination with:</p>
<pre class="brush: xml;">&lt;body class=&quot;documents&quot; onload=&quot;document.forms[0].elements[0].focus();&quot;&gt;</pre>
<p>which would automatically focus on the form&#8217;s search field upon loading the document AND:</p>
<pre class="brush: jscript;">
function trim(string)
{
return string.replace(/^\s+|\s+$/g, '')
}
</pre>
<p>The sought after not built-in JavaScript trim function (there is a jQuery alternative, see below).</p>
<p>Since then I have also read this <a title="text-indent workaround in IE6/IE7" href="http://www.productivedreams.com/ie-not-intepreting-text-indent-on-submit-buttons/">article on optimising and styling the submit/search button in IE6/IE7</a> or generally any browser not supporting text-indent on button elements.</p>
<h3>Now for the NEW code</h3>
<p>I have used more or less the same code as seen at ZURB.</p>
<pre class="brush: xml;">
&lt;form id=&quot;search&quot; action=&quot;/testing/label.php&quot; method=&quot;get&quot;&gt;
&lt;div&gt;
&lt;label for=&quot;search-string&quot; class=&quot;overlay&quot;&gt;&lt;span&gt;search Docu&lt;strong&gt;View&lt;/strong&gt;&lt;/span&gt;&lt;/label&gt;
&lt;input class=&quot;search-string&quot; type=&quot;text&quot; name=&quot;search-string&quot; id=&quot;search-string&quot; value=&quot;search]&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;search-submit&quot; id=&quot;search-submit&quot; value=&quot;search DocuView&quot; /&gt;
&lt;/div&gt;
&lt;/form&gt;
</pre>
<p>I have used an id for the form to make the CSS specific, easier to insert and start using immediately. I have to admit I have tried to omit the extra class on the label but the jQuery code stopped working (and frankly I do not know why yet &#8211; I&#8217;m hoping some of you will help me shed some light on it/I&#8217;ll figure out why soon). Anywho&#8230;</p>
<h3>Coding the form behaviour</h3>
<p>I have used relative units (em) to ensure the form scales with the size of the font. Also our tweaked version of <a title="CSS Reset stylesheet" href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s Reset CSS</a> is used. The result is acceptably similar in all major browsers (IE7/8, Firefox 3.5, Opera 9, Safari 4, Chrome 2, IE6 is having a problem displaying the submit button as defined &#8211; maybe some of you will know how to solve that). In Opera the input field is *slightly* lower than I&#8217;d like it to be. I have tried cheating it: converted all the values from relative to fixed (em -&gt; px), using 16px font (.75em = 12px, .5em = 8px, .25em = 4px) + I had to add &#8220;invisible&#8221; (white) borders to both the <strong>search-string</strong> input field and <strong>the span contained in the label</strong> but to no avail. At this point there does not seem to be a way to achieve pixel perfect overlay between the input field and the span (in XHTML Strict). Yet!</p>
<p>Apart from converting the JavaScript from the Prototype to jQuery I have also added validating and styling the label when user deletes the contents of the input field OR loads the page with AutoFill/submitted form values in it. Also instead of using the not-yet-100%-supported opacity/transition all I&#8217;m changing is the color of the font in the span.</p>
<pre class="brush: jscript;">
$(document).ready(function()
{
// Select all textboxes and assign them to an array
var input	=	$('#search-string');
var label	=	$('label.overlay');

if (!$.trim(input.val())	==	'')
{
label.addClass('focus').addClass('hastext');
}
else
{
label.removeClass('focus').removeClass('hastext');
}

// Fade the label back when a field gains focus
input.focus(function()
{
if ($.trim($(this).val())	==	'')
{
label.addClass('focus');
}
else
{
label.addClass('hastext');
}
});

// Fade the label back when the user starts to type
input.keyup(function(e)
{
//	empty? label-&gt;focused
if ($.trim($(this).val())	==	'')
{
label.removeClass('hastext').removeClass('focus').addClass('focus');
}
else
{
label.addClass('hastext');
}
});

// Check if a field is empty when the user switches out
input.blur(function()
{
if ($.trim($(this).val())	==	'')
{
label.removeClass('focus').removeClass('hastext');
}
});
});
</pre>
<p>Don&#8217;t forget to include the jQuery library! <a title="styling forms as used in DocuView" href="http://demo.docuview.co.uk/testing/label.php">I have devised a demo</a> and have started implementing this throughout our software. As ZURB warned: do not overuse it. I was happy to find semantically friendlier and in a way much better solution than we have used so far.</p>
<h3>Finally: the CSS</h3>
<pre class="brush: css;">
body { font-size: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 1.5; }
strong { font-weight: bold; }
#search { width: 20em; color: white; background-color: black; margin: 2em; }
#search div { position: relative; height: 3em; }
#search input { border: 0 none; font-family: Helvetica, Arial, sans-serif; font-size: 100%; }
#search label { position: absolute; left: .5em; top: .5em; width: 19em; height: 2em; background: white; z-index: 1; font-size: 100%; }
#search span { color: black; display: block; padding: .25em 0 0 .25em; border: 0 none; /*border-left: 1px solid white;*/ /*border-top: 2px solid white;*/ }
#search .focus span { color: #ccc; }
#search .hastext span { color: white; }
#search #search-string { position: absolute; z-index: 10; top: .5em; left: .5em; width: 87%; height: 2em; background: none; padding: .25em 0 0 .25em; /*border-top: 2px solid white;*/ }
#search #search-submit { background: transparent url(http://img.docuview.co.uk/sprite/search.png) no-repeat center center; height: 100%; width: 13%; font-size: 0; text-indent: -9999px; line-height: 0; display: block; position: absolute; top: 0; right: 0; z-index: 10; overflow: hidden; }
</pre>
<p>Thank you, ZURB guys, for the inspiration, I absolutely love the idea! I hope you find the implementation as useful as I have.</p>
]]></content:encoded>
			<wfw:commentRss>http://docuview.co.uk/index.php/2009/08/styling-forms-the-21st-century-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>display PDF in Thickbox v3 (+jquery) &#8211; finally working!</title>
		<link>http://docuview.co.uk/index.php/2008/07/display-pdf-in-thickbox-v3-jquery-finally-working/</link>
		<comments>http://docuview.co.uk/index.php/2008/07/display-pdf-in-thickbox-v3-jquery-finally-working/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 14:26:49 +0000</pubDate>
		<dc:creator>Martin Korych</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[docuview]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[modal window]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[solved]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[v3]]></category>
		<category><![CDATA[working]]></category>

		<guid isPermaLink="false">http://docuview.co.uk/blog/?p=55</guid>
		<description><![CDATA[Hi all! I&#8217;m super excited and would like to let you all know &#8211; especially the ones that have been stuck with a similar issue for some time: we have ThickBox working and running with DocuView and&#8230; DISPLAYING AUTOMATICALLY GENERATED PDFs (AS WELL AS NORMAL PDFs) IN MODAL WINDOW (and it works in FireFox 2+, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!</p>
<p>I&#8217;m super excited and would like to let you all know &#8211; especially the ones that have been stuck with a similar issue for some time: we have ThickBox working and running with Docu<strong>View</strong> and&#8230; DISPLAYING AUTOMATICALLY GENERATED PDFs (AS WELL AS NORMAL PDFs) IN MODAL WINDOW (and it works in FireFox 2+, IE6+, IE7, Opera 9.51, Safari Win&#8230; Mac testing <span style="text-decoration: line-through;">follows</span> successfully completed).<span id="more-55"></span></p>
<p>The link that helped me: <a title="thickbox forum" href="http://codylindley.com/thickboxforum/comments.php?DiscussionID=303&amp;page=1" target="_blank">http://codylindley.com/thickboxforum/comments.php?DiscussionID=303&amp;page=1</a></p>
<p>I am still trying to get my head around the fact that the solution is as easy as adding all seven (7) characters: .show(). The forum member was solving displaying Flash, but it applies to PDF too.</p>
<p><strong><span style="color: #99cc00;">*NEW UPDATE!</span></strong> I&#8217;m really really chuffed, pleased and ecstatic, hope it helps, by all means check the <a title="edited Thickbox javascript file as used and demonstrated in DocuView - displaying PDF" href="http://docuview.co.uk/wp-content/themes/docuview/lib/thickbox.js">edited thickbox javascript file</a>. The changes occur on lines #196 and #199, one is meant to append the aforementioned &#8220;.show()&#8221; at the end of each occurrence of &#8220;&lt;/iframe&gt;&#8221; in the code.</p>
<p>Drop me a line should you struggle, drop me a line if it worked for you! Now we&#8217;re down to cracking generating PDF through COM (OpenOffice) via PHP.</p>
<p>Till then <img src='http://docuview.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://docuview.co.uk/index.php/2008/07/display-pdf-in-thickbox-v3-jquery-finally-working/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Surely I am not&#8230;</title>
		<link>http://docuview.co.uk/index.php/2008/03/surely-i-am-not/</link>
		<comments>http://docuview.co.uk/index.php/2008/03/surely-i-am-not/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 22:46:59 +0000</pubDate>
		<dc:creator>Martin Korych</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[docuview]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lightwindow]]></category>
		<category><![CDATA[modal window]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[working]]></category>

		<guid isPermaLink="false">http://docuview.co.uk/blog/?p=3</guid>
		<description><![CDATA[Surely I am not the first one who&#8217;s ever required such functionality, but if there&#8217;s anyone out there who knows how to do it please do get in touch. I have decided to update DocuView bigtime and introduce modal windows/dialogs by implementing what seemed to me as the most suitable solution: Kevin Miller&#8217;s Lightwindow (http://www.stickmanlabs.com/lightwindow/). [...]]]></description>
			<content:encoded><![CDATA[<p>Surely I am not the first one who&#8217;s ever required such functionality, but if there&#8217;s anyone out there who knows how to do it please do get in touch. I have decided to update DocuView bigtime and introduce modal windows/dialogs by implementing what seemed to me as the most suitable solution: Kevin Miller&#8217;s Lightwindow (<a title="Lighwindow 2.0" href="http://www.stickmanlabs.com/lightwindow/">http://www.stickmanlabs.com/lightwindow/</a>). The difficulty (or should I say obstacle) we have with his system is the lack of support for local forms. To be more precise working with forms in Lightwindow without breaking any semantics and amending (drastically) the code.</p>
<p>Kevin, I&#8217;ve heard rumours that you&#8217;re working on version three. Can I ask you to look into this, please? (BTW &#8211; I have donated towards your MacBook Pro as I believe everyone should have one). Please get in touch, I&#8217;d love to help you/participate on making it happen. We could start with the CSS <img src='http://docuview.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I am intending to keep you updated and as soon as we solve it (as Google shows no sign of anyone doing so) I&#8217;ll let you know. So you can amend your site. So we can have nicer apps. So we can have nicer internet. Wouldn&#8217;t it be nice&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://docuview.co.uk/index.php/2008/03/surely-i-am-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
