<?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>Archetyped</title>
	<atom:link href="http://archetyped.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://archetyped.com</link>
	<description>Explore, Experiment, Inspire</description>
	<lastBuildDate>Thu, 10 May 2012 19:19:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Lab &#8250; Simple Lightbox &#8211; The Road to 2.0: Modularity</title>
		<link>http://archetyped.com/lab/simple-lightbox-2-0-modularity/</link>
		<comments>http://archetyped.com/lab/simple-lightbox-2-0-modularity/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 21:23:50 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Feature]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Module]]></category>
		<category><![CDATA[Overview]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/auto-draft/</guid>
		<description><![CDATA[Simple Lightbox 2.0 has been rewritten from the ground up to be fully modular.  Read on to learn more about the different modules and how they work together for ultimate flexibility in displaying content.]]></description>
			<content:encoded><![CDATA[<h2>Why Modular?</h2>
<p>In the <a href="http://archetyped.com/lab/simple-lightbox-road-to-2-overview/" title="Simple Lightbox - The Road to 2.0: Overview">overview of the changes coming to Simple Lightbox 2.0</a>, I mentioned that the lightbox code had been entirely rewritten to be modular in nature.  This was not a trivial task, but there are a few reasons that make a modular approach an ideal option:</p>
<ul>
<li><strong>Organized</strong> &#8211; Code is grouped by purpose/use which makes it easier to find the necessary code when adding new features and maintaining current code</li>
<li><strong>Flexible</strong> &#8211; Multiple <strong>instances</strong> of modules can be created, allowing multiple lightbox viewers with different configurations (options, themes, etc.) to be added to a page.</li>
<li><strong>Extensible</strong> &#8211; New modules can be easily added to provide new features and functionality (even by 3rd-party plugins)</li>
<li><strong>Consistent</strong> &#8211; All modules have a consistent API to safely access a component&#8217;s properties and functionality.  This means less issues due to small changes like internal name changes, etc.</li>
<li><strong>Sane</strong> &#8211; I got tired of prefixing all methods with a namespace denoting their purpose (e.g. <code>viewerResize()</code>, <code>itemShow()</code>, etc.). Now methods can have simple names and can be easily called (e.g. <code>viewer.resize()</code>, <code>item.show()</code>, etc.)</li>
</ul>
<p>Let&#8217;s have a look at the various modules</p>
<h2>Controller</h2>
<p>Everything starts at the <strong>Controller</strong>.  This is the command center that coordinates all of the other modules.  That being said, the Controller mostly initializes the other modules and gets out of the way for them to do their thing.</p>
<p>Modules that are managed by the Controller are called <strong>Components</strong>, and are actually what do most of the work in SLB 2.0.  All components share the same base and are then further customized to handle their specific functions.</p>
<p>The components are:</p>
<ul>
<li><code>Viewer</code></li>
<li><code>Content_Item</code></li>
<li><code>Content_Type</code></li>
<li><code>Group</code></li>
<li><code>Theme</code></li>
<li><code>Template</code></li>
<li><code>Template_Tag</code></li>
<li><code>Template_Tag_Handler</code></li>
</ul>
<h2>Viewer</h2>
<p>A <code>Viewer</code> handles all display-oriented functionality for a lightbox, from navigation to animations to user-customizable options like UI text and overlay opacity.</p>
<p>Multiple <code>Viewers</code> can be added to the page, each with a different configuration, allowing different links (and groups of links) to be displayed differently from each other.</p>
<p><code>Viewers</code> reference other components for its functionality:</p>
<ul>
<li>The current <code>Content_Item</code> being displayed in the viewer can be accessed to determine the next or previous item to display (e.g. if it is part of a <code>Group</code>)</li>
<li>The viewer&#8217;s <code>Theme</code> controls what the lightbox looks like</li>
</ul>
<h2>Content_Item</h2>
<p>A <code>Content_Item</code> represents an item to be displayed in a <code>Viewer</code>.  A <code>Content_Item</code> instance will be created for any link that is activated for SLB, and is used to access the item&#8217;s various properties that will be displayed in the <code>Viewer</code> (e.g. image, title/caption, description, etc.).</p>
<p>Items may be part of a <code>Group</code> that can be navigated through by the item&#8217;s <code>Viewer</code>, or isolated from all other items.</p>
<p>All items also have a <code>Content_Type</code> that defines properties and functionality for various types of content (image, video, etc.)</p>
<h2>Content_Type</h2>
<p>A <code>Content_Type</code> defines how properties are retrieved for a <code>Content_Item</code> as different approaches are required for different types of content (e.g. displaying an image compared to displaying a video).</p>
<p>Any number of <code>Content_Types</code> can be defined, allowing any type of content to be displayed by SLB.  Using a priority-based structure, custom <code>Content_Types</code> can even override default <code>Content_Types</code> to add new features for a specific type of content.</p>
<h2>Group</h2>
<p>A <code>Group</code> is primarily a collection of <code>Content_Items</code>, allowing a <code>Viewer</code> to navigate through multiple items (e.g. a slideshow of related images).</p>
<p>There can be multiple <code>Groups</code> of items on the page.</p>
<p>A <code>Content_Item</code> can belong to a single <code>Group</code> (or none at all).</p>
<h2>Theme</h2>
<p>Plain and simple, a <code>Theme</code> controls how a <code>Viewer</code> looks when it is displayed.  Different <code>Viewers</code> can have different <code>Themes</code> to allow a different UI for each <code>Viewer</code>.</p>
<p>All <code>Themes</code> have a <code>Template</code> that defines the layout of the content to be displayed in the <code>Viewer</code>.</p>
<h2>Template</h2>
<p>At its core, a <code>Template</code> is a bit of HTML with <code>Template_Tags</code> sprinkled to define how a <code>Content_Item</code> is displayed in the lightbox.  When requested, a <code>Template</code> will generate the final output using the properties of the <code>Content_Item</code> being displayed.</p>
<p>A basic template may look like:</p>
<pre class="brush:html;gutter:false">&lt;div class="container"&gt;
	{item.content}
	&lt;div class="details"&gt;
		&lt;strong&gt;{item.caption}&lt;/strong&gt;
		&lt;p&gt;{item.description}&lt;/p&gt;
		&lt;div class="nav"&gt;
			{ui.nav_prev}
			{ui.nav_next}
			{ui.nav_slide_control}
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class="close"&gt;
		{ui.close}
	&lt;/div&gt;
&lt;/div&gt;</pre>
<h2>Template_Tag</h2>
<p>A <code>Template_Tag</code> is a placeholder used in <code>Templates</code> that will be replaced with dynamic content for each item.  This allows full customization of what properties will be displayed for an item and how the properties will be displayed in the lightbox.</p>
<p>There are 2 default template tags (though custom tags can also be added):</p>
<ul>
<li><code>item</code> &#8211; Access the current <code>Content_Item's</code> properties</li>
<ul>
<li>Examples</li>
<ul>
<li><code>item.content</code>: Item&#8217;s content (image, video, etc.)</li>
<li><code>item.caption</code>: Item&#8217;s caption/title</li>
<li><code>item.group</code>: The name of the group the item is in</li>
</ul>
</ul>
<li><code>ui</code> &#8211; Insert UI elements into the template</li>
<ul>
<li>Examples</li>
<ul>
<li><code>ui.nav_prev</code>: Button to navigate to the previous <code>Content_Item</code></li>
<li><code>ui.close</code>: Button to close the lightbox</li>
</ul>
</ul>
</ul>
<h2>Template_Tag_Handler</h2>
<p>A <code>Template_Tag_Handler</code> do the heavy lifting to control how <code>Template_Tag</code> in a <code>Template</code> is processed.  This allows any type of tag to be created for ultimate customizability.</p>
<p>There is one <code>Template_Tag_Handler</code> for each type of <code>Template_Tag</code>.</p>
<h2>Simple, Right?</h2>
<p>As you can see, breaking up the lightbox&#8217;s functionality into modules greatly simplifies working with the various components as the structure and relationships are quite clear.  The improved consistency and extensibility make the work well worth it.</p>
<p><a href="http://archetyped.com/lab/simple-lightbox-2-0-modularity/"> Simple Lightbox &#8211; The Road to 2.0: Modularity</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on April 26, 2012 11:23am</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/simple-lightbox-2-0-modularity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; Simple Lightbox &#8211; The Road to 2.0: Overview</title>
		<link>http://archetyped.com/lab/simple-lightbox-road-to-2-overview/</link>
		<comments>http://archetyped.com/lab/simple-lightbox-road-to-2-overview/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 03:00:23 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Feature]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Overview]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Roadmap]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/auto-draft/</guid>
		<description><![CDATA[If you've been paying attention to the recent development notes, you may have noticed the uptick in notes relating to Simple Lightbox (SLB), my highly customizable lightbox plugin for the venerable WordPress platform.  Now it's official: Simple Lightbox 2.0 is coming.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been paying attention to the recent <a href="http://archetyped.com/tag/notes+simple-lightbox/">development log</a>, you may have noticed the uptick in notes relating to <a href="http://archetyped.com/tools/simple-lightbox/" title="Simple Lightbox">Simple Lightbox</a> (SLB), my highly customizable lightbox plugin for the venerable <a href="http://wordpress.org/">WordPress</a> platform.  Now it&#8217;s official: <strong>Simple Lightbox 2.0 is coming</strong>.</p>
<p>I <a href="http://archetyped.com/lab/slb-1-5-themes-and-speed/" title="SLB: 1.5 - Themes and Speed">previously wrote</a> that Simple Lightbox is meant to be <strong>purpose-built for WordPress</strong>, and that&#8217;s what the next version is all about.</p>
<p>Many improvements are on the way in the next version, especially in terms of customization, performance, and usability.  Future posts will provide a more in-depth look at the various features, but here is a brief overview of the changes we&#8217;ll see in Simple Lightbox 2.0:</p>
<h2>Customization</h2>
<p>The current version of SLB already has a wealth of options (activation by post-type, slideshow controls, UI customization, etc.), and even allows third-party additions to a limited degree.  However, the next version of SLB will take this to the next level.  Advanced third-party support will allow custom features to be added to SLB just like a WordPress plugin.  The administration interface has been overhauled to provide site owners with a simple way to control both built-in and third-party features.</p>
<p>Simply put, there are going to be some very interesting features that will let you display media in new ways in the next version.</p>
<h2>Flexibility</h2>
<p>The lightbox code has been rewritten from the ground up to be completely modular and extremely extensible.  This results in smoother operation of the default lightbox components, but also allows others to add additional features to make the humble lightbox an even more powerful tool for displaying media.</p>
<h2>Robust Theme Support</h2>
<p>Love it or hate it, most lightboxes (SLB included) generally have a very similar look, but the next version of SLB will make it simple for the lightbox to fit the look of the rest of your site perfectly.  This will also allow theme developers add support for SLB to their themes.  Imagine downloading a theme with a lightbox that matches the rest of the theme perfectly.</p>
<p>Adding additional features to a lightbox theme will also be possible.  Social/sharing buttons, download links, and more will be simple to add.</p>
<h2>Display Everything</h2>
<p>Thanks to the modular nature of SLB 2.0, the lightbox will be capable of displaying <em>any</em> type of content.  SLB 2.0 will ship with some default content types built-in (images, WordPress attachments, etc.), and additional content types will also be available (either directly or via third-parties).</p>
<p>The best part is that <strong>anyone</strong> will be able to simply add the ability to display new content types in SLB.</p>
<h2>Auto-resize? Yes</h2>
<p>I&#8217;ve heard the cries for automatic resizing of content that is too large for the browser window.  I&#8217;d love this feature too, but it needs to be done right, as standard implementations leave a lot to be desired in terms of image quality.  I&#8217;m happy to report that some interesting solutions are currently in development to allow Simple Lightbox to resize content to fit the browser window while maintaining as much image quality as possible.</p>
<h2>Advanced, but still Simple</h2>
<p>You may have noticed the word &#8220;<em>simple</em>&#8221; sprinkled generously throughout this overview, but this is no trivial matter.  Simple Lightbox was made to be a simple and automatic way to display images in a lightbox with as little fuss as possible.  SLB 2.0 will have more features, but it will still remain as simple as ever to customize to your heart&#8217;s content.  Not to worry, SLB&#8217;s zero-click functionality will still be there&#8211; just activate and it works.</p>
<h2>As always, the suggestion box is open</h2>
<p>Rapid progress is being made on Simple Lightbox 2.0, but your requests and suggestions are as welcome as always.  Leave a comment below for what you want to see in the next version of SLB (but don&#8217;t bother asking for free slurpies&#8211; that&#8217;s already planned as a premium option).</p>
<h2>Be Prepared</h2>
<p>As I mentioned, future posts will cover various aspects of SLB 2.0 in greater detail, so keep your eyes peeled or <a href="http://twitter.com/archetyped">follow me</a> to find out about them the <strong>instant</strong> they&#8217;re published.</p>
<div class="highlight">
<h3>In-Depth Coverage</h3>
<ul>
<li><a href="http://archetyped.com/lab/simple-lightbox-2-0-modularity/" title="Simple Lightbox - The Road to 2.0: Modularity">Modularity in Simple Lightbox 2.0</a></li>
</ul>
</div>
<h2>Get a Sneak Peek</h2>
<p>Private beta testing will begin soon.  If you&#8217;d like to join the ranks of our brave beta testers and get an early peek at Simple Lightbox 2.0, keep an eye out for the signup for the private beta phase.  Yes, I&#8217;ll be sure to <a href="http://twitter.com/archetyped">tweet about it</a>.</p>
<p><a href="http://archetyped.com/lab/simple-lightbox-road-to-2-overview/"> Simple Lightbox &#8211; The Road to 2.0: Overview</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on April 5, 2012 05:00pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/simple-lightbox-road-to-2-overview/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Blog &#8250; Schedule Changes</title>
		<link>http://archetyped.com/blog/schedule-changes/</link>
		<comments>http://archetyped.com/blog/schedule-changes/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 00:26:31 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Feature]]></category>
		<category><![CDATA[30 Days]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Results]]></category>
		<category><![CDATA[Schedule]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://archetyped.com/auto-draft/</guid>
		<description><![CDATA[During my previous , one of the questions that arose was how larger projects would fit into a workflow that allowed only one day per week to work on any given project.  Despite the many benefits of such a constant variation of work (increased motivation to make progress, a fresh start every day, etc.), the ...]]></description>
			<content:encoded><![CDATA[<p>During my previous <a href="http://archetyped.com/blog/30-days-of-schedules-in-review/" title="30 Days of Schedules: In Review">experiment with schedules</a>, one of the questions that arose was how larger projects would fit into a workflow that allowed only one day per week to work on any given project.  Despite the many benefits of such a constant variation of work (increased motivation to make progress, a fresh start every day, etc.), the reality is that a project that would take 2 weeks of work would end up taking <strong>2.5 months</strong> to complete, which is obviously not ideal.</p>
<h2>A new experiment: 2 for 1</h2>
<p>This week, I have begun experimenting with a schedule that allots <em>two</em> days per week to a project instead of just one.</p>
<p>I will still be grouping multiple projects together on the same days as I have found that it helps to keep my eyes from glazing over as can happen when working on one thing for too long.  The projects are grouped together strategically (related workflows, thought processes, etc.) to maintain as much momentum as possible throughout the day.  I have also injected a day (Wednesday) where I do something <strong>completely different</strong> to optimize the transition between the first half of the week and the second half.</p>
<h3>The Schedule</h3>
<ul>
<li><strong>Monday-Tuesday</strong></li>
<ul>
<li><a href="http://archetyped.com/tools/simple-lightbox/" title="Simple Lightbox">Simple Lightbox</a></li>
<li><a href="http://archetyped.com/tools/cornerstone/" title="Cornerstone">Cornerstone</a></li>
</ul>
<li><strong>Wednesday</strong></li>
<ul>
<li>Photography</li>
<li>Video</li>
</ul>
<li><strong>Thursday-Friday</strong></li>
<ul>
<li><em>Top-Secret Project</em></li>
<li>Site Maintenance</li>
</ul>
</ul>
<h2>Benefits</h2>
<p>Some of the main benefits one may expect from such a schedule are:</p>
<ul>
<li><strong>Better use of momentum</strong> &#8212; Momentum is a powerful tool, and by allocating two consecutive days per week to a project, I will be able to harness the momentum from the first day to make even more progress the next day.<br />
<strong></strong></li>
<li><strong>Increased focus</strong> &#8212; With fewer projects to juggle, I can focus more attention on specific projects.<br />
<strong></strong></li>
<li><strong>Faster project completion</strong> &#8212; With more time to work on a given project, I will be able to complete the projects faster</li>
<li><strong>Increased availability for new projects</strong> &#8212; There are <em>always</em> projects on the backburner.  By completing current projects faster, I will be able to start working on the awaiting projects sooner.</li>
</ul>
<h2>Pitfalls</h2>
<p>Though one additional day may seem trivial, such a change to the schedule is not without its pitfalls:</p>
<ul>
<li><strong>Less variation</strong> &#8212; Variation was one of the best things about working on a different project every day.  The daily change was refreshing and kept boredom at bay.  By focusing on fewer projects during the week, I may become bored with the repetition.</li>
<li><strong>No progress on other projects</strong>  &#8212; In order to spend more time on certain projects, work will need to be stopped on other projects.  It pains me to put a halt on some projects, even though it provides more time to another project.</li>
<li><strong>Less pressure</strong> &#8212; This is a big one.  By allocating more time to a project during the week, I am essentially <strong>extending the deadline</strong> for the tasks I have scheduled.  I will need to remain vigilant to avoid the <a href="http://en.wikipedia.org/wiki/J._Wellington_Wimpy">Wimpy-esque</a> thought that I can &#8220;take care of it tomorrow.&#8221;</li>
</ul>
<h2>The middle road</h2>
<p>I admit that one of the primary motivations for changing my weekly schedule is a <strong>lack of patience</strong>&#8211; I want to finish certain projects, and I don&#8217;t want to wait.  However, by taking the middle road and allocating only one additional day to each project, I&#8217;m hoping that I will benefit both from the <strong>variation</strong> of a daily schedule and the <strong>increased time</strong> of a more selective schedule.</p>
<p><a href="http://archetyped.com/blog/schedule-changes/"> Schedule Changes</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on April 5, 2012 02:26pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/blog/schedule-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; EDU: Notes &#8211; Core: User: History</title>
		<link>http://archetyped.com/lab/edu-notes-core-user-history/</link>
		<comments>http://archetyped.com/lab/edu-notes-core-user-history/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 04:09:54 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Organization]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[User]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=1033</guid>
		<description><![CDATA[Requirements Create &#8220;paper trail&#8221; of changes made to user Role, grade, position, etc. Date-based Track any type of change for any type of user Students, teachers, administration, etc. Allow retrieval of full user history Allow retrieval of history of based on relationships/connections between content types Example: Retrieve history of a class by finding all teachers ...]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>Create &#8220;paper trail&#8221; of changes made to user</li>
<ul>
<li>Role, grade, position, etc.</li>
<li>Date-based</li>
</ul>
<li>Track any type of change for any type of user</li>
<ul>
<li>Students, teachers, administration, etc.</li>
</ul>
<li>Allow retrieval of full user history</li>
<li>Allow retrieval of history of based on relationships/connections between content types</li>
<ul>
<li>Example: Retrieve history of a <strong>class</strong> by finding all <strong>teachers</strong> associated with class in <strong>their</strong> histories</li>
</ul>
<li>Allow queries for users based on properties in history</li>
<ul>
<li>Example: Find all <strong>students</strong> who have had a class with a specific <strong>teacher</strong></li>
</ul>
</ul>
<h2>Data Storage (Options)</h2>
<ol>
<li>User metadata (separate records)</li>
<ul>
<li>Store history in built-in <code>wp_usermeta</code> database table</li>
<li>Methodology: Changing a property for a user</li>
<ol>
<li>Save old property value in special meta key: <code>hist_{property-name}</code></li>
<ul>
<li><code>{property-name}</code> is property being changed</li>
</ul>
<li>Set new property value in default meta key: <code>{property-name}</code></li>
</ol>
<li><code>-</code> Changes not dated</li>
<ul>
<li>Option: Could store date with old value as serialized data</li>
<ul>
<li><code>-</code> Would need to parse/sort full query before results based on specific properties/values could be returned</li>
</ul>
</ul>
<li><code>+</code> Simple to query based on meta key</li>
<ul>
<li>Find all users with specified property/value combination</li>
</ul>
<li><code>?</code> Can user metadata store multiple items with same key for user? (ala post meta)</li>
<ul>
<li><code>A</code>: Yes</li>
</ul>
</ul>
<li>User metadata (serialized data)</li>
<ul>
<li>Entire user history stored in single row for user in built-in <code>wp_usermeta</code> database table</li>
<li>Data stored as serialized array</li>
<ul>
<li>Key: Timestamp of user property change</li>
<li>Value: Object/array of properties/values</li>
</ul>
<li><code>-</code> Must query <strong>all</strong> users&#8217; histories before <strong>any</strong> connections can be made</li>
<li><code>+</code> Keeps <code>wp_usermeta</code> table cleaner</li>
</ul>
<li><strong>Separate database table</strong></li>
<ul>
<li>User history stored in bespoke database table(s): <code>user_history</code></li>
<li>Structure (schema)</li>
<ul>
<li><code>id</code>: Unique row ID</li>
<li><code>user_id</code>: User ID</li>
<li><code>date</code>: Timestamp of property/value change</li>
<li><code>property</code>: Property being set/changed</li>
<li><code>value</code>: New value of property</li>
</ul>
<li>Example: Student grade-level change</li>
<ul>
<li><code>id</code>: Automatically set</li>
<li><code>user_id</code>: <code>{user-id}</code> (ID from <code>wp_users</code> table)</li>
<li><code>date</code>: Current date time</li>
<li><code>property</code>: &#8220;grade-level&#8221;</li>
<li><code>value</code>: 2</li>
</ul>
<li><code>?</code> Current user properties: How to manage/query? (Options)</li>
<ol>
<li><strong>Mirror current properties/values in user metadata</strong></li>
<ul>
<li>History table used primarily for <strong>past</strong> history</li>
<li>All <strong>current</strong> user data should be accessed from user metadata</li>
<li>History updated when property changed/set</li>
<li><code>+</code> Can perform queries for current data using metadata (all students in class &#8220;x&#8221;, etc.)</li>
<li><code>-</code> Duplication of data: <code>wp_usermeta</code>/<code>user_history</code></li>
<ul>
<li>Not too much of an issue because history only used for archival purposes (e.g. not validating current user properties)</li>
</ul>
</ul>
<li>Add <code>current</code> column to user history table</li>
<ul>
<li>Flag indicates row contains latest data for user property</li>
<li><code>-</code> Must unset previous row flagged as current when setting new data</li>
<li><code>+</code>Simple to query current data using where clause
<pre class="brush:sql;gutter:false">...WHERE current = true</pre>
</li>
</ul>
<li>Use <code>date</code> column</li>
<ul>
<li>Query only latest matching rows</li>
<li>Unique rows sorted by <code>date</code> column</li>
<ul>
<li>Will return most recent row of each property for user</li>
</ul>
<li><code>?</code> How to retrieve multiple properties with same key for user?</li>
<ul>
<li>Example: <strong>Student</strong> may currently be in multiple <strong>classes</strong> (and assigned to each class at <strong>different times</strong>)</li>
<li><code>-</code> Only most recently-set class would be returned for student</li>
</ul>
</ul>
</ol>
</ul>
</ol>
<h2>Properties with multiple values (Options)</h2>
<h3>Examples</h3>
<ul>
<li><strong>Student</strong> in multiple <strong>classes</strong> in current semester</li>
<li><strong>Teacher</strong> teaching multiple <strong>classes</strong> in current semester</li>
</ul>
<ol>
<li>Serialized property value</li>
<ul>
<li>Store data as array</li>
<li><code>-</code> Does not track granular changes</li>
<ul>
<li>Example: Single class changed while others remain</li>
</ul>
</ul>
<li><strong>Multiple rows with same property</strong></li>
<ul>
<li>Example: Separate row for each <strong>class</strong> that <strong>student</strong> is enrolled in</li>
<li><code>+</code> Current classes managed as user metadata</li>
<ul>
<li>History just for chronological record</li>
<ul>
<li>Dates of property changes &#8220;tells the story&#8221; of user&#8217;s changes</li>
</ul>
</ul>
</ul>
</ol>
<p><a href="http://archetyped.com/lab/edu-notes-core-user-history/"> EDU: Notes &#8211; Core: User: History</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on March 21, 2012 06:09pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/edu-notes-core-user-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB 1.6.2 Beta</title>
		<link>http://archetyped.com/lab/slb-1-6-2-beta/</link>
		<comments>http://archetyped.com/lab/slb-1-6-2-beta/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 23:08:32 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Beta]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=1027</guid>
		<description><![CDATA[It's been awhile, but a new beta version of Simple Lightbox is ready to be unleashed upon our awesome group of brave testers.]]></description>
			<content:encoded><![CDATA[<div class="notice"><strong>Update:</strong> Thank you to all of the brave beta testers for helping making this beta phase incredibly successful! SLB 1.6.2 (Final) has been released! <a href="http://archetyped.com/tools/simple-lightbox/" title="Simple Lightbox">Go get it now</a>!</div>
<p>It&#8217;s been awhile, but a new beta version of <a href="http://archetyped.com/tools/simple-lightbox/" title="Simple Lightbox">Simple Lightbox</a> is ready to be unleashed upon our awesome group of brave testers. Your testing helps to make SLB better with each update.</p>
<p>The beta is quite stable, but one person (me) can only do so much testing. Now it&#8217;s time to let it loose for all of you to install and test.</p>
<div class="highlight">As always, since there are so many different possible WordPress configurations (themes, plugins, etc.), it is highly recommended that you test any beta version on a test site <strong>before</strong> updating a production site.</div>
<p>Version 1.6.2 is primarily a maintenance release.  Not a lot has changed (except for a 95% rebuild of the JS code), so with your help it hopefully it won&#8217;t be long before 1.6.2 is ready for an official release.</p>
<h3>What you get</h3>
<p>For being a brave lad and installing the beta version on your site, you get the latest version with all the new features before anyone else. You also get a chance to provide feedback before the final version is released. Awesome, I know.</p>
<p>Oh yeah, and if you find a bug, <strong>the fix is named after you</strong>. Fame and fortune will surely soon follow.</p>
<div class="notice">
<h3>How to report an issue</h3>
<p>Every release is tested on a fresh installation of WordPress (current version) using the default themes. If you are experiencing a problem, it&#8217;s likely due to a conflict with a specific theme or plugin and I would love to hear about it. Just provide the information below and I will take a look your issue.<strong>If you have an bug/issue to report, please provide the following:</strong></p>
<ul>
<li><strong>URL of page exhibiting bug</strong> (I can&#8217;t do much if I can&#8217;t test it myself)</li>
<li>WordPress version (3.3.1 etc.) &#8212; Note: SLB only supports the latest version of WordPress</li>
<li>Other plugins installed</li>
<li>Browser(s) with issue (Firefox, Chrome, etc.)</li>
</ul>
</div>
<p><strong>Note: </strong>As always, all previous stable versions of Simple Lightbox are available via <a href="http://wordpress.org/extend/plugins/simple-lightbox/download/">WordPress&#8217; official plugin page</a> if you need to downgrade to a previous version for any reason.</p>
<h3>Release Notes:</h3>
<h4>Beta 2</h4>
<ul>
<li>Optimize: Improved PHP 5 compatibility</li>
</ul>
<h4>Beta 1</h4>
<ul>
<li>Update: Rebuild JS code</li>
<li>Fix: Some elements can overlap lightbox</li>
<li>Optimize: Improved utility code</li>
</ul>
<p><a href="http://archetyped.com/lab/slb-1-6-2-beta/"> SLB 1.6.2 Beta</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on March 16, 2012 01:08pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-1-6-2-beta/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB: Notes &#8211; JS: Component References</title>
		<link>http://archetyped.com/lab/slb-notes-js-component-references/</link>
		<comments>http://archetyped.com/lab/slb-notes-js-component-references/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 09:37:50 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=1021</guid>
		<description><![CDATA[Requirements Unified way to get/set component references from within other components Used as base of other get/set methods (get_viewer(), etc.) Smart &#8211; not too dependent on configuration Safe &#8211; manages component data without risk of corruption Get component reference (Process) Arguments Property name (string): Name of property to retrieve (group, viewer, etc.) Data type (Component ...]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>Unified way to get/set component references from within other components</li>
<ul>
<li>Used as base of other get/set methods (<code>get_viewer()</code>, etc.)</li>
</ul>
<li>Smart &#8211; not too dependent on configuration</li>
<li>Safe &#8211; manages component data without risk of corruption</li>
</ul>
<h2>Get component reference (Process)</h2>
<h3>Arguments</h3>
<ul>
<li>Property name (<code>string</code>): Name of property to retrieve (<code>group</code>, <code>viewer</code>, etc.)</li>
<li>Data type <code></code>(<code>Component Class [function]</code>): Component type (<code>View.Viewer</code>, <code>View.Group</code>, etc.)</li>
<ul>
<li>Validates data type before returning data</li>
<li>Enables creation of new component instance if necessary</li>
</ul>
<li>Get default (optional) (<code>boolean</code>): Whether to get default component reference from controller</li>
<ul>
<li>Default: Yes</li>
<li>Useful when searching through container components for reference (as returning default reference will stop iteration through containers)</li>
</ul>
</ul>
<h3>Prioritized search for component</h3>
<ol>
<li>Check if instance <strong>property</strong> already set</li>
<ul>
<li>Can be set by various operations</li>
<ul>
<li>Previous property retrieval (caches property for future access)</li>
<li>Direct property setting (e.g. <code>set_viewer()</code>, etc.)</li>
</ul>
<li>Return value immediately if property is set</li>
</ul>
<li>Check instance <strong>attributes</strong> for component</li>
<ul>
<li>Instance attributes stored as<code></code>: <code>instance.attributes</code> (<code>object</code>)</li>
<li>Attribute key matches property name: <code>instance.attributes.viewer</code> will contain <code>viewer</code> reference</li>
<li>Possible return values &#8211; Dependent on how attribute was set</li>
<ul>
<li>String: ID of component reference</li>
<ul>
<li>Components stored by ID in controller (<code>View</code>)</li>
</ul>
<li>Object reference: Direct reference to another component</li>
</ul>
<li>Set attribute value to main instance property if found (for faster future retrievals)</li>
<ul>
<li><code>set_component(property_name, value)</code></li>
<ul>
<li>Sanitizes value</li>
<li>Retrieves actual component reference from controller based on ID (<code>string</code>) and component type</li>
</ul>
</ul>
</ul>
<li>Check <strong>containers</strong></li>
<ul>
<li>Containers: Component instances that current component instance can inherit/access properties from</li>
<ul>
<li>Such components <em>contain</em> current component (e.g. <code>Group</code> contains <code>Item</code>, etc.)</li>
</ul>
<li>Containers defined in component class definitions (<code>object</code>)</li>
<ul>
<li>Key: property name (<code>group</code>, <code>viewer</code>, etc.)</li>
<li>Value: Component data type (<code>View.Group</code>, <code>View.Viewer</code>, etc.)</li>
</ul>
<li>Iterate through containers</li>
<ul>
<li>Retrieve container component reference
<pre class="brush:javascript;gutter:false">//Example (Group)
var container = get_component('group', View.Group);</pre>
</li>
<ul>
<li><code>-</code> Recursion issue in <code>get_component()</code> if using <code>get_component()</code>to retrieve containers
<ul>
<li>Example: Property being searched for = Container being searched</li>
<ul>
<li>Property: group</li>
<li>Current container: group</li>
</ul>
<li><code>A</code>: Skip containers that match current property being searched for</li>
<ul>
<li>e.g. Don&#8217;t look in &#8216;group&#8217; container if attempting to retrieve &#8216;group&#8217; reference</li>
</ul>
</ul>
</li>
</ul>
<li>Look for component reference in valid containers
<pre class="brush:javascript;gutter:false">var component = container.get_component(property_name, data_type);</pre>
</li>
</ul>
<ul>
<li>Containers will generally access controller object (<code>View</code>) if reference not set on container itself (next step)</li>
<ul>
<li><code>?</code> What if subsequent containers have component reference directly?</li>
<ul>
<li>Example: <code>group</code> container does not have reference, but <code>view</code> container does</li>
<li>Options</li>
<ol>
<li>Retrieve reference from container&#8217;s controller as fallback (current)</li>
<ul>
<li>Only single container will be evaluated (since a valid reference will be returned from controller as fallback)</li>
<li><code>-</code> Subsequent containers will not have a chance to retrieve reference</li>
<li><code>-</code> Pointless to have multiple containers</li>
</ul>
<li><strong>Do not use controller as fallback</strong></li>
<ul>
<li>Add additional parameter to <code>get_component()</code>to skip fallback
<pre class="brush:javascript;gutter:false">var container = get_component('group', View.Group, false);</pre>
</li>
<li>Return empty value if reference not found on component itself</li>
<li><code>+</code> All containers will be evaluated</li>
</ul>
</ol>
</ul>
</ul>
</ul>
</ul>
<li>Get reference to default component from <strong>controller</strong></li>
<ul>
<li>Controller (<code>View</code>) is set as parent of all components</li>
<li>Default component created if not previously created</li>
<li>Uses initialization options to build component instance with default properties</li>
<li><code>?</code> Do all components have a default?</li>
<ul>
<li>Viewer: Yes</li>
<li>Theme: Yes</li>
<li>Group: No<code></code></li>
<ul>
<li><code>?</code> Handling items without groups</li>
<ol>
<li><strong>Ungrouped items are displayed singly (current)</strong></li>
<ul>
<li>No slideshow support for ungrouped items</li>
<li><code>+</code> Clear/straightforward operation</li>
<li><code>+</code> Server-side can add ungrouped items to group based on options (group by post, etc.)</li>
</ul>
<li>Display ungrouped items as group</li>
<ul>
<li>Use a default group to group all items not explicitly placed in a group</li>
<li>Ungrouped items will be displayed as a slideshow</li>
<li><code>+</code> Possible to easily cycle through ungrouped items</li>
<li><code>-</code> Overrides admin options</li>
<li><code>-</code> Items do not need to be grouped if they were not purposefully grouped</li>
<li><code>-</code> Items that you want to display in isolation will need to have to be explicitly placed in their own group</li>
</ul>
</ol>
</ul>
<li>Content Item: No</li>
<ul>
<li>All content items are unique and should point to valid content</li>
</ul>
<li>Content Type: No</li>
<ul>
<li>All content types registered manually</li>
</ul>
</ul>
</ul>
</ol>
<h3>Return value</h3>
<ul>
<li>Valid component type or <code>NULL</code> (e.g. if component reference not found)</li>
<li>Wrapper methods (<code>get_group()</code>, <code>get_viewer()</code>, etc.) can use return value to validate data and return appropriate value</li>
</ul>
<h2>Set component reference (process)</h2>
<h3>Arguments</h3>
<ul>
<li>Property name (<code>string</code>): Name of property to set (<code>group</code>, <code>viewer</code>, etc.)</li>
<li>Value (<code>object|string</code>): Component reference</li>
<ul>
<li><code>string</code>: ID of reference &#8211; stored in controller (<code>View</code>)</li>
<li><code>object</code>: Component instance reference</li>
</ul>
<li>Data type <code></code>(<code>Component Class [function]</code>): Component type (<code>View.Viewer</code>, <code>View.Group</code>, etc.)</li>
<ul>
<li>Required data type for component</li>
</ul>
</ul>
<h3>Methodology</h3>
<ol>
<li>Retrieve component instance from controller if ID supplied
<pre class="brush:javascript;gutter:false">var component = this.get_parent().get_component(id, data_type);</pre>
</li>
<ul>
<li><code>?</code> What to do if component with matching ID does not exist in controller?</li>
<ul>
<li><code>A</code>: Options</li>
<ol>
<li>Return empty value (<code>null</code>)</li>
<ul>
<li>Component reference not set on current object</li>
<li>Continue to next step (container iteration) if attempting to set invalid value in <code>get_component()</code> to find valid component reference</li>
</ul>
<li><strong>Create new component</strong></li>
<ul>
<li>Use supplied ID to initialize new component instance</li>
<li>Use controller defaults/options to set new component&#8217;s properties</li>
<ul>
<li>Controller options are parsed (if not already parsed) to provide access to component-specific options/properties</li>
<li><code>?</code> Use single method to initialize new components or use component-specific methods?</li>
<ul>
<li><code>A</code>: Options</li>
<ol>
<li>Single universal method</li>
<ul>
<li>Controller properties will need to parsed into groups so that new component will be passed appropriate values</li>
<li><code>+</code> Only one method to maintain when API changes, etc.</li>
<li><code>+</code> Components share same base definition (methods, properties, etc.)</li>
<li><code>-</code> Single method may become convoluted when components diverge a lot</li>
</ul>
<li>Component-specific methods</li>
<ul>
<li>Create specific method for initializing each component (<code>View.add_group()</code>, etc.)</li>
<li><code>+</code> These methods should exist anyway for adding components directly</li>
<li><code>?</code> How to add components if component-specific method does not exist</li>
</ul>
<li><strong>Component-specific + Universal method</strong></li>
<ul>
<li>Use universal method (less specialized) if component-specific (more specialized) initialization method for component does not exist</li>
<li><code>+</code> Simple components may not need specialized methods</li>
<li><code>+</code> Allows more specialized creation of components as needed</li>
</ul>
</ol>
</ul>
</ul>
<li><code>+</code> Object&#8217;s attributes say that component should exist</li>
<li><code>+</code> Not overwriting anything &#8211; only creates new instance if ID does not exist</li>
<ul>
<li>Can customize component instance properties later if necessary</li>
</ul>
<li>New component instance saved to appropriate controller collection (Based on data type: <code>View.groups</code>, <code>View.viewers</code>, etc.)</li>
</ul>
</ol>
</ul>
</ul>
<li>Save component reference to specified property type
<pre class="brush:javascript;gutter:false">this.property = component;</pre>
</li>
</ol>
<p><a href="http://archetyped.com/lab/slb-notes-js-component-references/"> SLB: Notes &#8211; JS: Component References</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on March 8, 2012 11:37pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-notes-js-component-references/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB: Notes &#8211; JS: Processes</title>
		<link>http://archetyped.com/lab/slb-notes-js-processes/</link>
		<comments>http://archetyped.com/lab/slb-notes-js-processes/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 20:55:19 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=1019</guid>
		<description><![CDATA[Requirements Do as little as possible at any given time (only what is necessary) e.g. Parse theme tags only when displaying theme, not during initialization, etc. Safe data access &#8211; Component instance data always accessible Cache component instance data/properties If something is parsed or processed, the result should be cached for future access Displaying Content ...]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>Do as little as possible at any given time (only what is necessary)</li>
<ul>
<li>e.g. Parse theme tags only when displaying theme, not during initialization, etc.</li>
</ul>
<li>Safe data access &#8211; Component instance data always accessible</li>
<li>Cache component instance data/properties</li>
<ul>
<li>If something is parsed or processed, the result should be cached for future access</li>
</ul>
</ul>
<h2>Displaying Content Item</h2>
<ol>
<li>Link clicked</li>
<ul>
<li>Click handler set on initialization</li>
</ul>
<li>Determine Viewer</li>
<ul>
<li>Iterate through component hierarchy until a Viewer is found</li>
<li>Priority</li>
<ol>
<li>Content Item &#8211; set specifically for current item</li>
<li>Group &#8211; set for group that item is in</li>
<li>Default &#8211; set on View Controller as fallback Viewer</li>
</ol>
</ul>
<li>Set &#8220;Loading&#8221; flag (Viewer)</li>
<li>Load Viewer Theme</li>
<ul>
<li>Insert Theme layout into DOM (if not previously done)</li>
<li>Parse Theme layout</li>
<ul>
<li>Static tags &#8211; UI, labels, etc.</li>
<li>Dynamic tags: Item data, etc.</li>
</ul>
</ul>
<li>Load item content</li>
<ul>
<li>Determine Content Type</li>
<li>Load Content Type</li>
<li>Run renderer for displaying Content Type</li>
</ul>
<li>Display Viewer</li>
<ul>
<li>Viewer event handlers (e.g. navigation, etc.) set as &#8220;live&#8221; events during initialization</li>
</ul>
<li>Content loaded</li>
<li>Turn off &#8220;Loading&#8221; flag</li>
<li>Start timers, etc. (for slideshow)</li>
</ol>
<p><a href="http://archetyped.com/lab/slb-notes-js-processes/"> SLB: Notes &#8211; JS: Processes</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on March 7, 2012 10:55am</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-notes-js-processes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB: Notes &#8211; JS: Components: Themes: Layout Tags</title>
		<link>http://archetyped.com/lab/slb-notes-js-components-themes-layout-tags/</link>
		<comments>http://archetyped.com/lab/slb-notes-js-components-themes-layout-tags/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 21:53:03 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[Tags]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=1015</guid>
		<description><![CDATA[Requirements Insert predefined HTML Core and theme-specific Support dynamic content Changes on per-item basis Necessary to support multiple content types (e.g. images in &#60;img&#62; element, HTML in &#60;div&#62;, etc.) Support attributes/options Customize how tag is processed/output Support user-customizable options (UI labels, formatting, etc.) Elements (Core) Content: Primary content (image, video, etc.) displayed in lightbox Dynamic: ...]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>Insert predefined HTML</li>
<ul>
<li>Core and theme-specific</li>
</ul>
<li>Support dynamic content</li>
<ul>
<li>Changes on per-item basis</li>
<li>Necessary to support multiple content types (e.g. images in <code>&lt;img&gt;</code> element, HTML in <code>&lt;div&gt;</code>, etc.)</li>
</ul>
<li>Support attributes/options</li>
<ul>
<li>Customize how tag is processed/output</li>
</ul>
<li>Support user-customizable options (UI labels, formatting, etc.)</li>
</ul>
<h2>Elements (Core)</h2>
<ul>
<li>Content: Primary content (image, video, etc.) displayed in lightbox</li>
<ul>
<li>Dynamic: HTML changes based on content type</li>
</ul>
<li>Item Data: Data/attributes of current item</li>
<ul>
<li>Examples: Permalink, source URI, image dimensions, title, caption, description, etc.</li>
<li>Available attributes based on item&#8217;s content type</li>
<li>Common attributes</li>
<ul>
<li>Source URI (<code>string</code>): Direct URI to content (for display in lightbox)</li>
<ul>
<li>Image source, video file, etc.</li>
</ul>
<li>Permalink (<code>string</code>): Canonical URI for content (e.g. when viewed on its own page)</li>
<ul>
<li>Video page, attachment page, image URI, Website address, etc.</li>
</ul>
<li>Title (<code>string</code>): Item caption</li>
<ul>
<li>Derived from link if not otherwise available</li>
</ul>
<li>Group (<code>obj</code>): Group item belongs to</li>
<li>Internal (<code>bool</code>): Whether item is internal media or not</li>
</ul>
</ul>
<li>UI elements</li>
<ul>
<li>Static: Does not change per-item</li>
<li>Labels: User-customizable UI content</li>
<ul>
<li>Navigation text: previous/next item, start/stop slideshow, close, etc.</li>
</ul>
<li>Predefined elements: HTML for building UI (close button, prev/next button, loading indicator, etc.)</li>
</ul>
</ul>
<h2>Implementation</h2>
<ol style="list-style-type: upper-alpha;">
<li>Dynamic Data (options)</li>
<ol>
<li><strong>Wrap tag output with DOM element</strong></li>
<ul>
<li>Example:
<pre class="brush:html;gutter:false">&lt;span id="slb_tag-id" class="slb_dynamic_wrap"&gt;[tag output]&lt;/span&gt;</pre>
</li>
<li>Wrapper indicates dynamic data using DOM attributes</li>
<ul>
<li><code>class</code>: <code>slb_dynamic_wrap</code></li>
<li><code>id</code>: <code>slb_tag[id]</code> (Points to object with tag options)</li>
<li>Alternative: Set reference to raw tag as data on wrapper element itself
<pre class="brush:javascript;gutter:false">$(el).data('slb_tag', tag);</pre>
</li>
</ul>
<li><code>+</code> Allows dynamic replacement of content in viewer</li>
<li>Similar to current method of loading new content in lightbox (replace HTML inside of a wrapper DOM element)</li>
<li><code>+</code> Allows any tag to be dynamic</li>
<li><code>?</code> Should all tags be dynamic?</li>
<ul>
<li><code>A</code>: No, only those accessing data (item, environment, date/time, etc.)</li>
</ul>
<li><code>-</code> Cannot use data within HTML tags (since tag output is wrapped in a DOM element itself)</li>
<ul>
<li>Example<br />
<strong>Original</strong></p>
<pre class="brush:html;gutter:false">&lt;a href="domain.com/file.html?id={tag}"&gt;Link text&lt;/a&gt;</pre>
<p><strong>Rendered</strong></p>
<pre class="brush:html;gutter:false">&lt;a href="domain.com/file.html?id=&lt;span id="slb_tag-id"&gt;[tag output]&lt;/span&gt;"&gt;Link text&lt;/a&gt;</pre>
</li>
<li>Solution (options)</li>
<ol>
<li>Build HTML tag using options in theme tag</li>
<ul>
<li>Example</li>
<ul>
<li>Link
<pre class="brush:html;gutter:false">&lt;a href="domain.com/file.html?id=[tag data]"&gt;Link text&lt;/a&gt;</pre>
</li>
<li>Tag
<pre class="brush:html;gutter:false">{tag pre='&lt;a href="domain.com/file.html?id=' post='"&gt;Link text&lt;/a&gt;'}</pre>
</li>
<li>Alt
<pre class="brush:html;gutter:false">{tag format='&lt;a href="domain.com/file.html?id=%s"&gt;Link text&lt;/a&gt;'}</pre>
</li>
<ul>
<li>Uses string formatting to replace <code>%s</code> with tag output</li>
</ul>
</ul>
<li>Entire output wrapped in wrapper</li>
<li>Original string format saved</li>
<li>Formatted value inserted as HTML into DOM (wrapped)</li>
<li><code>+</code> Allows complex output using item data</li>
<li><code>+</code> Does not impede HTML output</li>
<li><code>-</code> Convoluted way to build HTML output using tag output</li>
<li><code>-</code> Limited: How to use other data within link? (link text, <code>title</code> attribute, etc.)</li>
</ul>
<li><strong>Register handlers for different tags</strong></li>
<ul>
<li>Similar to <a href="http://archetyped.com/tools/cornerstone/" title="Cornerstone">CNR</a> content type field templates</li>
<li>Example: Link
<pre class="brush:html;gutter:false">{link href="domain.com/file.html?id=%s" data="item.permalink"}Link text{/link}</pre>
</li>
<ul>
<li>Attributes</li>
<ul>
<li><code>href</code>: URI format</li>
<li><code>data</code>: Data to use in URI format</li>
<li><code>title</code>: Link title (can be string format)</li>
<li><code>title_data</code>: Data to use for Link title</li>
<li>Link text: Wrapped in tag</li>
</ul>
</ul>
<li><code>+</code> More specific handling of output</li>
<ul>
<li>Attribute data will be properly formatted (escaped for URLs, etc.)</li>
</ul>
<li><code>+</code> Simple: Don&#8217;t need to mess with HTML in tag attributes</li>
<li><code>-</code> More complex to implement</li>
<li><code>+</code> Highly flexible: any kind of output can be accomplished by tag handlers</li>
</ul>
</ol>
</ul>
</ul>
<li>Rebuild <strong>entire</strong> layout for each item</li>
<ul>
<li>Start with raw layout (with tags, etc.) every time an item is displayed</li>
<li><code>-</code> Inefficient: must parse entire layout for each item (even if few dynamic tags are present)</li>
<ul>
<li>Performance may suffer</li>
</ul>
<li><code>+</code> Will always be a certain amount of dynamic data in layout (content, etc.)</li>
<ul>
<li>Parts of layout must always be rebuilt per-item anyway</li>
</ul>
<li><code>?</code> Visual smoothness? Rebuilding full layout affect transition between items?</li>
<ul>
<li>Likely</li>
</ul>
<li><code>+</code> Simple: Don&#8217;t need to wrap tags since raw layout will be used every time</li>
</ul>
</ol>
<li>Tags (Default)</li>
<ul>
<li><code>item</code>: Access item data/properties</li>
<ul>
<li>Example:<code>{item.title}</code> &#8211; Item title</li>
<li>Dynamic: Yes</li>
<li>Format modifiers: Yes</li>
<ul>
<li><code>{item.title|lower|escape}</code> (makes item title lowercase and escapes it)</li>
</ul>
</ul>
<li><code>ui</code>: User interface output</li>
<ul>
<li>Example: <code>{ui.nav_next}</code> &#8211; Next item navigation link</li>
<li>Dynamic: No</li>
<li>Format modifiers: No</li>
</ul>
<li>Common attributes: Can be set on all default tags</li>
<ul>
<li>May be implemented differently by different tags</li>
<li><code>class</code>: CSS class</li>
<li><code>id</code>: Unique ID</li>
</ul>
</ul>
<li>Tag format (Options)</li>
<ol>
<li>Curly braces + XML-style attributes</li>
<ul>
<li>Tags denoted by curly braces (<code>{</code>, <code>}</code>)</li>
<li>Options/attributes set XML-style: <code>attribute="value"</code></li>
<li><code>+</code> Simple: Familiar to any using HTML</li>
<li><code>+</code> Fairly unique: Curly braces not common in normal content</li>
<li><code>?</code> How do format modifiers fit in?</li>
<ul>
<li>Simple: <code>{tag.prop|modifier}</code></li>
<li>With Options</li>
<ol>
<li>XML-style attributes followed by delimited modifiers: <code>{tag.prop attribute="value"|modifier}</code></li>
<ul>
<li>Attributes processed first, then passed to modifiers<br />
<code></code></li>
<li><code>+</code> Clear separate between modifiers and attributes</li>
<li><code>+</code> Still pretty simple to write</li>
<li><code>-</code> Convoluted: 2 different modes for similar information (options that modify output)</li>
</ul>
<li><strong>Format modifier style: <code>{tag.prop|attribute:value|modifier}</code></strong></li>
<ul>
<li><code>-</code> Attributes not clearly separated from modifiers (hard to tell when option is an attribute or a modifier)</li>
<li><code>+</code> Simple: Singular way to add options that modify output</li>
<li><code>+</code> Tag handler can use supported options and pass output to global modifiers after (with processed options removed)</li>
<ul>
<li><code>supports_modifiers</code> flag in tag definition can determine whether output is processed by global modifiers or not</li>
</ul>
</ul>
<li>One or the other (attributes <strong>or</strong> modifiers): <code>{tag.prop attribute="value"}</code> or <code>{tag.prop|modifier}</code></li>
<ul>
<li><code>-</code> Limiting: May be useful to have access to properties <strong>and</strong> modifiers in tag</li>
<ul>
<li><code>?</code> When? (Use cases)</li>
<ul>
<li>Item: No &#8211; Modifiers only (<code>{item.title|lower}</code>)</li>
<li>UI: No &#8211; Attributes only (<code>{ui.nav_next class="test"}</code>)</li>
<ul>
<li>Outputs DOM element, so should not be modified by standard modifiers (<code>lower</code>, etc.)</li>
<ul>
<li>Formatting of values (e.g. labels) should be handled via CSS</li>
</ul>
</ul>
<li>Custom Tags: Possibly (<code>{tag attr="value"|modifier}</code>)</li>
<ul>
<li><code>+</code> Allows theme designer to further customize output from custom tags</li>
</ul>
</ul>
</ul>
</ul>
</ol>
</ul>
</ul>
<li>Double braces (curly/square) + XML-style attributes</li>
<ul>
<li>Attributes same as <strong>1</strong></li>
<li>Tags denoted by double braces (<code>{{</code>/<code>}}</code> or <code>[[</code>/<code>]]</code>)</li>
<li><code>+</code> More unique: double braces even less common than single braces in content</li>
<li><code>-</code> More characters to type for every tag</li>
<li><code>-</code> Increases visual &#8220;noise&#8221; in layout</li>
</ul>
<li>Other established format</li>
<ul>
<li>Liquid, Smarty, etc.</li>
<li>Need to look into options</li>
</ul>
</ol>
<li>Registering External Tag Handlers (options)</li>
<ol>
<li>Client file registration (via other plugins)</li>
<ul>
<li>Allow additional files to be registered with internal client files</li>
<li>Use same structure: <code>[handle, file, etc.]</code></li>
<li><code>-</code> Will need to expand file parser to handle external files</li>
<ul>
<li><code>+</code> Not too difficult since external files should have full path rather than relative path (just look for presence of path constants)</li>
</ul>
<li><code>+</code> Allows simple inclusion of JS files <strong>after</strong> internal files loaded</li>
<ul>
<li>JS file can register tags, etc.</li>
</ul>
<li>Use dependencies to determine order of loading external files</li>
<ul>
<li><code>+</code> Also controls whether external file is loaded (if dependent on internal file that is not loaded, external file with not be loaded, etc.)</li>
</ul>
</ul>
<li>WP Hooks</li>
<ul>
<li>Fire hooks before/after various operations</li>
<li>Events</li>
<ul>
<li><code>slb_head</code>/<code>slb_admin_head</code>: Header files loaded</li>
<li><code>slb_footer</code>/<code>slb_admin_footer</code>: Footer files loaded</li>
<li><code>slb_client_init</code>: Client JS initialized</li>
</ul>
<li><code>+</code> Allows external code to add files/code in proper location</li>
<ul>
<li>Ensures SLB&#8217;s files are loaded before external code is executed</li>
</ul>
<li><code>?</code> How to confirm necessary files have been loaded?</li>
<ul>
<li>Hooks will always fire, but different files are loaded based on various conditions (context, callbacks, etc.)</li>
<li><code>A</code> Use SLB functions in external code to determine if external file should be loaded</li>
<ul>
<li>PHP
<pre class="brush:php">/* External Plugin */
add_action('slb_head', 'ext_load_head_files');

function ext_load_head_files() {
	if ( slb_is_enabled() &amp;&amp; slb_is_context('public') ) {
		//Load files...
	}
}</pre>
</li>
<li>JS (object detection)
<pre class="brush:js">/* Confirm SLB loaded */
if ( !SLB || !SLB.View )
	return false;

/* Run code */
SLB.View.add_tag(...);</pre>
</li>
</ul>
</ul>
<li><code>?</code> How to fire hook after files loaded?</li>
<ul>
<li>File loading is handled by WP enqueue/registration API (No direct loading)</li>
<li><code>A</code>Add hook to trigger SLB hook
<pre class="brush:php">//Low priority hook
add_action('wp_head', 'call_slb_head', 99);

function call_slb_head() {
	//Fire internal hook
	do_action('slb_head');
}</pre>
</li>
</ul>
</ul>
</ol>
<li>Tag Handlers</li>
<ul>
<li>Properties</li>
<ul>
<li><code>id</code> (<code>string</code>): Tag ID</li>
<li><code>build</code> (<code>function</code>): Function to build tag output</li>
<li><code>attrs</code> (<code>object</code>): Default attributes/values</li>
<li><code>dynamic</code> (<code>bool</code>): Tag rebuilt for each item or not</li>
<li><code>supports_modifiers</code> (<code>bool</code>): Determines if modifiers can be used on tag output</li>
</ul>
</ul>
</ol>
<p><a href="http://archetyped.com/lab/slb-notes-js-components-themes-layout-tags/"> SLB: Notes &#8211; JS: Components: Themes: Layout Tags</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on March 6, 2012 11:53am</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-notes-js-components-themes-layout-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB: Notes &#8211; JS: Classes</title>
		<link>http://archetyped.com/lab/slb-notes-js-classes/</link>
		<comments>http://archetyped.com/lab/slb-notes-js-classes/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 20:21:19 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=999</guid>
		<description><![CDATA[Requirements Consistent access to base object (SLB global variable) Support for methods/properties Consistent access to utility/helper methods/properties (prefix, context, etc.) Organized structure Extendible &#8211; Attach members/data to objects e.g. SLB (base object), SLB.util (utility object), SLB.View (view controller), etc. Implementation (Options) Current: Object literals with extend method Define methods in object declaration - Object properties ...]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<ul>
<li>Consistent access to base object (<code>SLB</code> global variable)</li>
<li>Support for methods/properties</li>
<li>Consistent access to utility/helper methods/properties (prefix, context, etc.)</li>
<li>Organized structure</li>
<li>Extendible &#8211; Attach members/data to objects</li>
<ul>
<li>e.g. <code>SLB</code> (base object), <code>SLB.util</code> (utility object), <code>SLB.View</code> (view controller), etc.</li>
</ul>
</ul>
<h2>Implementation (Options)</h2>
<ol>
<li>Current: Object literals with <code>extend</code> method</li>
<ul>
<li>Define methods in object declaration</li>
<li><code>-</code> Object properties cannot reference self via this (references <code>window</code> object)</li>
<ul>
<li>Less modular code</li>
</ul>
<li><code>+</code> Simple declarations</li>
</ul>
<li><strong>Constructor function</strong></li>
<ul>
<li>Objects are instances of base class definition</li>
<li>Base constructor defines standard properties/methods (utilities, etc.)
<pre class="brush:js;gutter:false">SLB = new Base();</pre>
</li>
<ul>
<li>All objects have direct access to standard methods/properties (<code>SLB.View.util.get_prefix();</code>)</li>
<li><code>?</code> Better than single base object with properties/methods (<code>SLB.View.base.util references SLB.util</code>)</li>
<ul>
<li><code>A:</code> Yes</li>
</ul>
</ul>
<li>Will need to wrap initialization and attachment of new members into single method</li>
<ul>
<li>e.g. <code>SLB.attach('View', {data});</code></li>
<li><code>?</code> Method name? &#8211; currently <code>extend</code>, but may conflict with <code>Class.extend()</code> (Inheritance)</li>
<ol>
<li>Single method &#8211; 2 modes (based on parameters)</li>
<ul>
<li><code>SLB.extend('View', data)</code> (2 parameters)</li>
<ul>
<li>Add <code>View</code> member to <code>SLB</code> object</li>
<li>Create new instance of base class inherited by <code>View</code> object</li>
<li><code>data (object)</code> &#8211; Properties/methods for new member</li>
</ul>
<li><code>SLB.extend(obj)</code> (1 parameter)</li>
<ul>
<li>Extends <code>SLB</code> object and returns new instance</li>
</ul>
<li><code>+</code> Simple</li>
<li><code>+</code> Single method for both <strong>related</strong> functionalities</li>
<ul>
<li>One version simply adds it to global object</li>
</ul>
<li><code>-</code> Confusion: Better to have separate methods for sake of clarity?</li>
<ul>
<li><code>extend</code>: Create new class inheriting base class</li>
<li><code>attach</code>: Add member to object (creating new class that inherits base class)</li>
</ul>
</ul>
</ol>
</ul>
<li>Structure</li>
<ul>
<li>Class Definitions</li>
<ul>
<li>Base</li>
<ul>
<li>Utility/Helper methods</li>
<ul>
<li>References base object for instance properties (<code>prefix</code>, etc.)</li>
</ul>
<li>Member attachment functionality</li>
<li>Standard properties/methods</li>
</ul>
</ul>
<ul>
<li>Core<code></code></li>
<ul>
<li>Extends Base class</li>
<li>Functionality specific to core object</li>
</ul>
</ul>
<li>Instance Objects</li>
<ul>
<li>Core (<code>SLB</code>)</li>
<ul>
<li>Base instance for all other members to be attached to</li>
<li>Members</li>
</ul>
<ul>
<li>View Controller (<code>SLB.View</code>)</li>
<ul>
<li>Lightbox functionality controller</li>
</ul>
<ul>
<li><code>SLB.attach('View', obj class_definition)</code></li>
<ul>
<li>New <code>View</code> class created (extends Base class)</li>
</ul>
<li><code>+</code> Access to standard properties/methods without having to &#8220;travel&#8221; to Core (<code>SLB</code>) object</li>
<li>Components (viewers, groups, etc.)</li>
<ul>
<li>Attached via
<pre class="brush:js;gutter:false">SLB.View.Viewer = SLB.View.extend(obj class_definition)</pre>
</li>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ol>
<p><a href="http://archetyped.com/lab/slb-notes-js-classes/"> SLB: Notes &#8211; JS: Classes</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on February 28, 2012 10:21am</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-notes-js-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab &#8250; SLB: Notes &#8211; Client Files: Context Callbacks</title>
		<link>http://archetyped.com/lab/slb-notes-client-files-context-callbacks/</link>
		<comments>http://archetyped.com/lab/slb-notes-client-files-context-callbacks/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 01:26:44 +0000</pubDate>
		<dc:creator>Sol</dc:creator>
				<category><![CDATA[Context]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Files]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Planning]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Simple Lightbox]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://archetyped.com/?post_type=devlog&#038;p=998</guid>
		<description><![CDATA[Invalid Callbacks How to handle invalid callbacks? Options Current: Remove context completely Other valid contexts will still be evaluated - If no other contexts exist, file will always be loaded Not ideal behavior Pass all callbacks to register method (whether valid or not Allow register method to determine how to handle invalid callbacks - Extra ...]]></description>
			<content:encoded><![CDATA[<h2>Invalid Callbacks</h2>
<h3>How to handle invalid callbacks?</h3>
<h4>Options</h4>
<ol>
<li>Current: Remove context completely</li>
<ul>
<li>Other valid contexts will still be evaluated</li>
<li><code>-</code> If no other contexts exist, file will <strong>always</strong> be loaded</li>
<ul>
<li>Not ideal behavior</li>
</ul>
</ul>
<li>Pass all callbacks to <code>register</code> method (whether valid or not</li>
<ul>
<li>Allow <code>register</code> method to determine how to handle invalid callbacks</li>
<li><code>-</code> Extra processing for file that should not be loaded</li>
</ul>
<li>Remove callback and evaluate just context (string)</li>
<ul>
<li><code>-</code> Callback is meant to be a condition of loading file</li>
<ul>
<li>Removal of callback will cause undesired loading of files</li>
</ul>
</ul>
<li><strong>Track if no valid context exist for file (after parsing)</strong></li>
<ul>
<li>Remove files with no valid contexts</li>
<li>Files defined with empty contexts are allowed to pass</li>
<ul>
<li>Should always be loaded</li>
</ul>
<li>Use flag to track during parsing</li>
<ul>
<li>Example: <code>$valid_context = false</code> until valid context encountered</li>
<li>If flag is <code>false</code> after all contexts evaluated, remove file</li>
</ul>
<li><code>?</code> Are there other conditions that should still allow file to load?</li>
<ul>
<li>e.g. <code>callback</code> property</li>
<li><code>A</code>: If contexts are set but all are invalid, global callback doesn&#8217;t matter</li>
<ul>
<li>Contexts &amp; global callback are both evaluated when loading file</li>
</ul>
</ul>
</ul>
</ol>
<p><a href="http://archetyped.com/lab/slb-notes-client-files-context-callbacks/"> SLB: Notes &#8211; Client Files: Context Callbacks</a> was originally published on <a href="http://archetyped.com">Archetyped</a> on February 27, 2012 03:26pm</p>]]></content:encoded>
			<wfw:commentRss>http://archetyped.com/lab/slb-notes-client-files-context-callbacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

