Skip to content

Commit

Permalink
Update some text.
Browse files Browse the repository at this point in the history
  • Loading branch information
poshboytl committed Jul 23, 2012
1 parent b50f0b0 commit 06fc4c0
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions index.html
Expand Up @@ -18,7 +18,7 @@

<header>
<h1>Smart Time Ago</h1>
<p>Smart Time Ago is a little jQuery library to update the relative timestamps in your document. </p>
<p>Smart Time Ago is a little jQuery library to update the relative timestamps in your document intelligently.</p>
</header>

<div id="banner" >
Expand All @@ -39,26 +39,33 @@ <h1>Smart Time Ago</h1>

<div class="panel">
<h1>What</h1>
<p>Smart Time Ago is a little jQuery library to update the relative timestamps in your document. (e.g "3 hours ago").</p>
<p>Smart Time Ago is a little jQuery library to update the relative
timestamps in your document intelligently. (e.g "3 hours ago").</p>
<p>It's originally built for <a href="https://pragmatic.ly/">https://pragmatic.ly/.</a></p>
<p>It's inspired by another jQuery plugin <a href="http://timeago.yarp.com/">http://timeago.yarp.com/</a> but give more flexibility and more features.</p>
<p>It's inspired by another jQuery plugin <a href="http://timeago.yarp.com/">http://timeago.yarp.com/</a> but give more flexibility and more intelligently.</p>
</div> <!-- Intro STA End -->

<div class="panel">
<h1>Why</h1>
<p>Smart Time Ago will check and update the relative time every 30000 millisecond (30 seconds) in the scope you specify. Latter it will check the newest time in your scope then change the interval to a proper value.</p>
<p>For example, If the newest time in the scope you specify is '2 hours ago'. The smart-time-ago won't check and update the relative time every 30 seconds, because it's unneccessary. It will automaticly make the interval longer to 15 minutes.</p>
<h1>Why Smart?</h1>
<p>Smart Time Ago will check and update the relative time every
60000 millisecond (60 seconds) in the scope you specify at the
beginning. Latter it will check the newest time in your scope then
tune the checking time interval to a proper value.</p>
<p>For example, if the newest time in the scope you specify is '2
hours ago'. There is no need to check and update the relative time
every 60 seconds. Instead, Smart Time Ago will automaticly make the checking time interval longer to 30 minutes.</p>
<p>Rules:</p>
<ul>
<li>The newest time less than 44.5 minutes, the interval will set to 0.5 minutes.</li>
<li>The newest time between 44.5, 89.5 minutes, the interval will set to 15 minutes.</li>
<li>The newest time more than 1 hour and a half, the interval will set to 30 minutes.</li>
<li>The newest time less than 44 minutes, the checking time interval will set to 1 minute.</li>
<li>The newest time between 44 and 89 minutes, the checking time interval will set to 22 minutes.</li>
<li>The newest time more between 90 minutes and 42 hours, the checking time interval will set to 30 minutes.</li>
<li>The newest time more than 42 hours, the checking time interval will set to half day.</li>
</ul>
</div> <!-- Explain Why End -->

<div class="panel">
<h1>Installation</h1>
<p>You can just use it as a jQuery plugin. If so, you just need copy the lib/timeago.js or src/timeago.coffee to your javascripts lib then load it after jQuery loaded.</p>
<p>You can just use it as a jQuery plugin. If so, you just need copy the lib/timeago.js or src/timeago.coffee to your project folder then load it after jQuery.</p>
<p>Or if you use node, you can install it from npm.</p>
<pre>
<code>
Expand All @@ -68,7 +75,7 @@ <h1>Installation</h1>

<div class="panel">
<h1>Usage</h1>
<p>By default smart-time-ago will keep watch on the time elements with a class of timeago and a ISO8601 timestamp in datatime attribute:</p>
<p>By default Smart Time Ago will keep watching on the time elements with a class of timeago and a ISO8601 timestamp in datatime attribute:</p>
<pre>
<code>
&lt;time class="timeago" datetime="2012-07-18T07:51:50Z"&gt;about 8 hours ago&lt;/time&gt;</code>
Expand Down Expand Up @@ -114,10 +121,10 @@ <h1>Configuration</h1>
suffix: 'ago'
};</code>
</pre>
<p>The 'time.timeago' is the default selector for smart-time-ago to watch and update.</p>
<p>The 'datetime' is the default attribute to put the ISO8601 absolute time for smart-time-ago to parse.</p>
<p>The 'up' in dir means the elements in your scope is display by time desc. which means if the dir sets to 'up'. smart-time-ago will treat the first element's time as the newest time to adjust the time interval. Oppositely if it set to 'down', smart-time-ago will treat the last element's time as the newewst time.</p>
<p>The 'ago' in 'suffix' means the relative generated by smart-time-ago will look like '3 hours ago'. If you want the text looks like '3 hours from now', you might need change the 'suffix' to 'from now'.
<p>The 'time.timeago' is the default selector to watch and update.</p>
<p>The 'datetime' is the default attribute to put the ISO8601 absolute time to parse.</p>
<p>The 'up' in dir means the elements in your scope is display by time desc. which means if the dir sets to 'up'. Smart Time Ago will treat the first element's time as the newest time to adjust the time interval. Oppositely if it set to 'down', Smart Time Ago will treat the last element's time as the newewst time.</p>
<p>The 'ago' in 'suffix' means the relative generated by Smart Time Ago will look like '3 hours ago'. If you want the text looks like '3 hours from now', you might need change the 'suffix' to 'from now'.
</p>
<p>You can change the default configurations by passing the options to timeago function when initialize timeago like:</p>
<pre>
Expand All @@ -144,4 +151,4 @@ <h1>Configuration</h1>
<!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->

</body>
</html>
</html>

0 comments on commit 06fc4c0

Please sign in to comment.