JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus helper for ckeditor sizing
[wfpl-cms.git] / template.html
index ff775b0..89c3cb6 100644 (file)
@@ -2,13 +2,13 @@
 <html lang="en">
 <head>
        <title>~$title html~~$cms_title html~</title>
-       <!--~$meta_description nonempty {~--><meta name="description" content="~$meta_description attr~" /><!--~}~-->
-       <!--~$meta_keywords nonempty {~--><meta name="keywords" content="~$meta_keywords attr~" /><!--~}~-->
        <!--[if lt IE 9]>
                ~$running_locally {~<script src="/javascript/html5.js"></script>~}~
                ~$running_locally unset {~<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>~}~
        <![endif]-->
-       <link rel="stylesheet~$running_locally {~/less~}~" href="style.~$running_locally {~less?m=~style.less mtime~~}~~$running_locally unset {~css?m=~style.css mtime~~}~" /><!--~$running_locally {~--><script>less = {env:'development'};</script><script src="/javascript/less/less.min.js"></script><!--~}~-->
+       <link rel="stylesheet" href="style.css?m=~style.css mtime~" />
+       <!--~$meta_description nonempty {~--><meta name="description" content="~$meta_description attr~" /><!--~}~-->
+       <!--~$meta_keywords nonempty {~--><meta name="keywords" content="~$meta_keywords attr~" /><!--~}~-->
        <!--~$head~-->
 </head>
 
                        footer text here
                </footer>
        </div>
+       <!--~$render_timestamps {~-->
+               <script>
+                       (function() {
+                               var i02 = function (i) { return i > 9 ? i : '0' + i; };
+                               var date_to_html = function (d, include_time) {
+                                       var hours = d.getHours()
+                                       var ret = '<span class="date_time">' +
+                                               i02(d.getMonth() + 1) + '/' +
+                                               i02(d.getDate()) + '/' +
+                                               d.getFullYear();
+                                       if (include_time) {
+                                               ret += ' ' + ((hours + 11) % 12 + 1) + ':' +
+                                                       i02(d.getMinutes()) +
+                                                       (hours < 12 ? 'am' : 'pm')
+                                       }
+                                       ret += '</span>';
+                                       return ret;
+                               }
+                               window.render_timestamps = function() {
+                                       var els = document.getElementsByClassName('unix_time');
+                                       var i, d, hours;
+                                       for (i in els) {
+                                               d = new Date(1000 * parseInt(els[i].innerHTML));
+                                               els[i].innerHTML = date_to_html(d, true);
+                                       }
+                                       els = document.getElementsByClassName('unix_date');
+                                       for (i in els) {
+                                               d = new Date(1000 * parseInt(els[i].innerHTML));
+                                               els[i].innerHTML = date_to_html(d, false);
+                                       }
+                               }
+                       }).call();
+                       render_timestamps();
+               </script>
+       <!--~}~-->
 </body>
 </html>