From: Dylan Lloyd Date: Thu, 17 Feb 2011 04:38:42 +0000 (-0500) Subject: Merged branch 'no-javascript' with notes X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=0d5b65dd317eda7cd09d208c634067c4a9acb6fd;p=dylansserver.git Merged branch 'no-javascript' with notes Now gracefully falls back to friendly URL's when javascript is disabled. Links are adjusted to anchors with javascript on page load. notes/ are paginated with index.php and rewritten to from /notes/page/# and notes are permalinked at /notes/note_title. index.php loads exhibits from MySQL to allow for this. notes/ are published via publish.py, and exhibits are published via publish_projects.py. THESE SCRIPTS ARE NOT SAFE - they trust user input implicitly and are chmodded 700. mysql> show tables; +----------------------------+ | Tables_in_dylanstestserver | +----------------------------+ | notes | | projects | +----------------------------+ 2 rows in set (0.00 sec) mysql> desc notes; +-------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | date_posted | date | NO | | NULL | | | title | varchar(255) | NO | | NULL | | | text | longblob | NO | | NULL | | | url | varchar(255) | NO | | NULL | | +-------------+--------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec) mysql> desc projects; +-------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO | | NULL | | | text | longblob | NO | | NULL | | +-------+--------------+------+-----+---------+----------------+ 3 rows in set (0.00 sec) --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0c3fa09..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -notes/* -!notes/index.php -!notes/notes.php diff --git a/.htaccess b/.htaccess index f58eeb4..b11bc6a 100644 --- a/.htaccess +++ b/.htaccess @@ -1,6 +1,6 @@ ErrorDocument 404 /404.php RewriteEngine on RewriteRule ^notes/page/([1-9]+)/?$ notes/index.php?page=$1 [L] -RewriteRule ^note/([^/\.]+)/?$ notes/index.php?note=$1 [L] -php_flag display_errors on -php_value error_reporting 7 +RewriteRule ^notes/([^/\.]+)/?$ notes/index.php?note=$1 [L] +RewriteRule ^notes/?$ notes/ [L] +RewriteRule ^([^/\.]+)/?$ index.php?project=$1 [L] diff --git a/includes/all.js b/includes/all.js index a910e5c..f29299e 100644 --- a/includes/all.js +++ b/includes/all.js @@ -248,11 +248,16 @@ b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); (function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","left"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);var i={};i[g]=(f== "show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;$(document).ready(function() { - $(".exhibit").hide(); - var divs = document.getElementsByTagName('div'); if(document.location.hash){ $(document.location.hash + '_').show(); } + $("ul#portfolio li a.tab").each(function(){ + if (document.location.href.indexOf($(this).attr("href")) == 0) { + $("#" + this.attr("href")).show("slide", 600); + } + $(this).attr("href", "#" + $(this).attr("href")); + }); + var divs = document.getElementsByTagName('div'); var i = 0; $("ul#portfolio li a.tab").click(function() { i++; @@ -269,5 +274,4 @@ b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); divs[i].className += (" shownDiv"); } }); - }); diff --git a/includes/style.css b/includes/style.css index 265fcca..102c82c 100644 --- a/includes/style.css +++ b/includes/style.css @@ -61,6 +61,7 @@ li { min-height:600px; border:1px solid black; padding:10px; + display:none; } .shownDiv { @@ -69,7 +70,10 @@ li { #contact_me { margin-top:100px; +<<<<<<< HEAD font-family:sans-serif; +======= +>>>>>>> no-javascript } /* reprap */ @@ -90,12 +94,21 @@ li { #peephow_title_2 { font-size:3em; +<<<<<<< HEAD } #peepshow_entry { font:1.4em "lucida console"; } +======= +} + +#peepshow_entry { + font:1.4em "lucida console"; +} + +>>>>>>> no-javascript /* readoo */ #readoo_title { font:1.6em arial; @@ -130,6 +143,7 @@ li { #i_like_pandora_entry { font:1.4em "lucida console"; +<<<<<<< HEAD } /* notes */ @@ -154,4 +168,6 @@ li { pre { margin-top:10px; +======= +>>>>>>> no-javascript } diff --git a/includes/tabs.js b/includes/tabs.js index 79d76bb..346b76b 100644 --- a/includes/tabs.js +++ b/includes/tabs.js @@ -1,9 +1,14 @@ $(document).ready(function() { - $(".exhibit").hide(); - var divs = document.getElementsByTagName('div'); if(document.location.hash){ $(document.location.hash + '_').show(); } + $("ul#portfolio li a.tab").each(function(){ + if (document.location.href.indexOf($(this).attr("href")) == 0) { + $("#" + this.attr("href")).show("slide", 600); + } + $(this).attr("href", "#" + $(this).attr("href")); + }); + var divs = document.getElementsByTagName('div'); var i = 0; $("ul#portfolio li a.tab").click(function() { i++; @@ -20,5 +25,4 @@ $(document).ready(function() { divs[i].className += (" shownDiv"); } }); - }); diff --git a/index.php b/index.php index c0971b1..dbff9a5 100644 --- a/index.php +++ b/index.php @@ -25,119 +25,47 @@
-
- 3D printing is a form of additive - manufacturing technology where a three dimensional object - is created by successive layers of material. [1]:http://en.wikipedia.org/wiki/3D_printing
- -
- reprap is a free - desktop 3D printer capable of printing plastic - objects.
-
- repthis.info is the - account of a friend and I learning to build our own.
-
-
- -
-

youtube_backup

backs - up all the youtube - videos in a users favorites list.
-
- this is my fork of the original - youtube_backup which adds asynchronous alerts after - successful downloads.
-
- it's written in python.
-
- -
-

i_like_pandora

searches - youtube for what you - like on pandora.
-
- then it downloads the first video.
-
- it's working, but i'm still making it better.
-
-
- the code is free (as in freedom), here.
-
-
- -
-

foxy-addons/

- -

peepshow

a - firefox - addon, to load linked images inline (like on reddit).
-
- here's the repo - for the source code.
-
- -
-

drawcss

writing markup for website wireframes - always seemed silly.
-
- this is a tool to draw them (it's not done).
-
- check - out the invisible divs this page is built on.
-
- then get the - code.
-
- -
-

readoo

helps - you find search keywords to target.
-
- it reads your IIS logs, and finds successful keywords - worth focusing on.
-
- it's not done yet! here's the source - code.
-
-
+ +