summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/js/mm.js84
-rw-r--r--custom/views/archive/index.tpl.php2
-rw-r--r--custom/views/default/index.tpl.php2
3 files changed, 0 insertions, 88 deletions
diff --git a/app/js/mm.js b/app/js/mm.js
deleted file mode 100644
index 0e39ff7..0000000
--- a/app/js/mm.js
+++ /dev/null
@@ -1,84 +0,0 @@
-function getElementsByClassName(className, tag, elm){
- var testClass = new RegExp("(^|\\\\s)" + className + "(\\\\s|$)");
- var tag = tag || "*";
- var elm = elm || document;
- var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
- var returnElements = [];
- var current;
- var length = elements.length;
- for(var i=0; i<length; i++){
- current = elements[i];
- if(testClass.test(current.className)){
- returnElements.push(current);
- }
- }
- return returnElements;
-}
-
-// Takes an ISO time and returns a string representing how
-// long ago the date represents.
-// http://ejohn.org/blog/javascript-pretty-date/
-function prettyDate(time){
- var date = new Date();
- date.setTime(time*1000); // milliseconds
- var diff = (((new Date()).getTime() - date.getTime()) / 1000);
- var day_diff = Math.floor(diff / 86400);
-
- if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
- return;
-
- return day_diff == 0 && (
- diff < 60 && "just now" ||
- diff < 120 && "1 minute ago" ||
- diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
- diff < 7200 && "1 hour ago" ||
- diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
- day_diff == 1 && "Yesterday" ||
- day_diff < 7 && day_diff + " days ago" ||
- day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
-}
-
-function showHideContent() {
- var sibling = this.nextSibling;
-
- if (-1 == sibling.className.indexOf('collapsed')) {
- this.className = 'expand';
- sibling.className += ' collapsed';
- } else {
- this.className = 'collapse';
- sibling.className = sibling.className.replace('collapsed','');
- }
-}
-
-window.onload = function() {
- //Dates to age
- var dates = getElementsByClassName('date');
- for (var i=0; i< dates.length; i++) {
- dates[i].title = dates[i].innerHTML;
- dates[i].innerHTML = prettyDate(dates[i].id.replace('post',''));
-
- if (dates[i].title && dates[i].title != '') {
- dates[i].style.cursor = "pointer";
- dates[i].onclick = function() {
- var tmp = this.innerHTML;
- this.innerHTML = this.title;
- this.title = tmp;
- }
- }
- }
-
- //Show/hide posts
- /*
- var postcontent = getElementsByClassName('post-content');
- for (var i=0; i<postcontent.length; i++){
- var p = postcontent[i].parentNode;
-
- var a = document.createElement('A');
- a.className = 'collapse';
- a.innerHTML = 'show/hide';
- a.onclick = showHideContent;
-
- p.insertBefore(a, postcontent[i]);
- }
- */
-} \ No newline at end of file
diff --git a/custom/views/archive/index.tpl.php b/custom/views/archive/index.tpl.php
index 9a02c2f..8f45fa0 100644
--- a/custom/views/archive/index.tpl.php
+++ b/custom/views/archive/index.tpl.php
@@ -110,7 +110,5 @@ header('Content-type: text/html; charset=UTF-8');
<?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
</div>
-
- <script src="app/js/mm.js" type="text/javascript"></script>
</body>
</html>
diff --git a/custom/views/default/index.tpl.php b/custom/views/default/index.tpl.php
index 70e23c4..4f82e46 100644
--- a/custom/views/default/index.tpl.php
+++ b/custom/views/default/index.tpl.php
@@ -69,7 +69,5 @@ header('Content-type: text/html; charset=UTF-8');
<?php include(dirname(__FILE__).'/footer.tpl.php'); ?>
</div>
-
- <script src="app/js/mm.js" type="text/javascript"></script>
</body>
</html>