diff options
| -rwxr-xr-x | src/site.clj | 10 | ||||
| -rw-r--r-- | static/form_login/front.css | 296 | ||||
| -rwxr-xr-x | static/search/all.js | 2 | ||||
| -rwxr-xr-x | template/banner.st | 39 | ||||
| -rwxr-xr-x | template/profile.st | 98 |
5 files changed, 231 insertions, 214 deletions
diff --git a/src/site.clj b/src/site.clj index 65890ef..972da44 100755 --- a/src/site.clj +++ b/src/site.clj @@ -74,6 +74,9 @@ (defn resp-success [message] {:status 200 :headers {} :body (json-str message)}) +(defn non-empty-string? [s] + (and s (> (count s) 0))) + ;; Database (defn do-select [query] @@ -132,7 +135,7 @@ @(room :messages))))) (defn process-user [u] - (if (u :avatar) + (if (non-empty-string? (u :avatar)) {"nick" (u :nick) "avatar" (encode-html-entities (u :avatar))} {"nick" (u :nick)})) @@ -217,7 +220,7 @@ (defn login [session params] (let [nick (params :nick) hash (params :hash) - db-user (authorize-nick-hash nick hash)] + db-user (authorize-nick-hash nick hash)] (if db-user [(populate-session-from-db db-user) (resp-success "OK")] @@ -246,9 +249,6 @@ ;; Profile -(defn non-empty-string? [s] - (and s (> (count s) 0))) - (defn profile [session profile-nick offset] (let [user-info (fetch-nick profile-nick)] (if user-info diff --git a/static/form_login/front.css b/static/form_login/front.css index e329647..0f72f59 100644 --- a/static/form_login/front.css +++ b/static/form_login/front.css @@ -1,149 +1,149 @@ -#login-container {
- float: right;
- /*width:780px;
- margin:0 auto;*/
-right:2;
-color:#fff;
- position: relative;
-top:-6;
-filter:alpha(opacity=90);
- -moz-opacity:0.9;
- -khtml-opacity: 0.9;
- opacity: 0.9;
-
-}
-
-#login-container a:link, a:visited {
- color:#f0e;
- text-decoration:none;
-}
-#login-container .topnav {
- padding:10px 0px 12px;
- font-size:11px;
- line-height:23px;
- text-align:right;
-
-}
-#login-container .topnav a.signin {
-
- padding:4px 3 3px 6px;
- text-decoration:none;
-border:1px solid #000;
-background-color:#f0e;
- font-weight:;
- color:#fff;
- -webkit-border-radius:4px;
- -moz-border-radius:4px;
- border-radius:4px;
- *background:transparent url("images/signin-nav-bg-ie.png") no-repeat 0 0;
- *padding:4px 12px 6px; filter:alpha(opacity=80);
-
-
-}
-#login-container .topnav a.signin:hover {
- background:#59B;
- *background:transparent url("images/signin-nav-bg-hover-ie.png") no-repeat 0 0;
- *padding:4px 12px 6px;
-}
-#login-container .topnav a.signin, #login-container .topnav a.signin:hover {
- *background-position:0 3px!important;
-}
-
-a.signin {
- position:relative;
- margin-left:3px;
-}
-a.signin span {
- background-image:url("images/toggle_down_light.png");
- background-repeat:no-repeat;
- background-position:100% 50%;
- padding:4px 16px 6px 0;
-}
-#login-container .topnav a.menu-open {
- background:#ddeef6!important;
- color:#666!important;
- outline:none;box-shadow: 3px 2px 2px #ccc;
--webkit-box-shadow: 3px 2px 2px #ccc;
--moz-box-shadow: 3px 2px 2px #ccc;
-filter: progid:DXImageTransform.Microsoft.dropShadow(color=#ccc, offX=3, offY=4, positive=true);
-
-}
-
-a.signin.menu-open span {
- background-image:url("images/toggle_up_dark.png");
- color:#789;
-}
-
-#signin_menu {
- -moz-border-radius-topleft:5px;
- -moz-border-radius-bottomleft:5px;
- -moz-border-radius-bottomright:5px;
- -webkit-border-top-left-radius:5px;
- -webkit-border-bottom-left-radius:5px;
- -webkit-border-bottom-right-radius:5px;
- display:none;
- background-color:#ddeef6;
- position:absolute;
- width:210px;
- z-index:100;
- border:1px transparent;
- text-align:left;
- padding:12px;
- top: 24.5px;
- right: 0px;
- margin-top:5px;
- margin-right: 0px;
- *margin-right: -1px;
- color:#789;
- font-size:11px; box-shadow: 3px 2px 2px #ccc;
--webkit-box-shadow: 3px 2px 2px #ccc;
--moz-box-shadow: 3px 2px 2px #ccc;
-filter: progid:DXImageTransform.Microsoft.dropShadow(color=#ccc, offX=3, offY=4, positive=true);
-}
-
-#signin_menu input[type=text], #signin_menu input[type=password] {
- display:block;
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- border:1px solid #ACE;
- font-size:13px;
- margin:0 0 5px;
- padding:5px;
- width:203px;
-}
-#signin_menu p {
- margin:0;
-}
-#signin_menu a {
- color:#6AC;
-}
-#signin_menu label {
- font-weight:normal;
-}
-
-#signin_menu p a {
- color:#27B!important;
-}
-#loginSubmit {
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- background:#39d url('images/bg-btn-blue.png') repeat-x scroll 0 0;
- border:1px solid #39D;
- color:#fff;
- text-shadow:0 -1px 0 #39d;
- padding:4px 10px 5px;
- font-size:11px;
- margin:0 5px 0 0;
- font-weight:bold;
-}
-#loginSubmit::-moz-focus-inner {
-padding:0;
-border:0;
-}
-#loginSubmit:hover, #loginSubmit:focus {
- background-position:0 -5px;
- cursor:pointer;
-}
-.no-cursor { cursor: none; }
-.invisible { display: none !important; }
+#login-container { + float: right; + /*width:780px; + margin:0 auto;*/ +right:2; +color:#fff; + position: relative; +top:-6; +filter:alpha(opacity=90); + -moz-opacity:0.9; + -khtml-opacity: 0.9; + opacity: 0.9; + +} + +#login-container a:link, a:visited { + color:#f0e; + text-decoration:none; +} +#login-container .topnav { + padding:10px 0px 12px; + font-size:11px; + line-height:23px; + text-align:right; + +} +#login-container .topnav a.signin { + + padding:4px 3 3px 6px; + text-decoration:none; +border:1px solid #000; +background-color:#f0e; + font-weight:; + color:#fff; + -webkit-border-radius:4px; + -moz-border-radius:4px; + border-radius:4px; + *background:transparent url("images/signin-nav-bg-ie.png") no-repeat 0 0; + *padding:4px 12px 6px; filter:alpha(opacity=80); + + +} +#login-container .topnav a.signin:hover { + background:#59B; + *background:transparent url("images/signin-nav-bg-hover-ie.png") no-repeat 0 0; + *padding:4px 12px 6px; +} +#login-container .topnav a.signin, #login-container .topnav a.signin:hover { + *background-position:0 3px!important; +} + +a.signin { + position:relative; + margin-left:3px; +} +a.signin span { + background-image:url("images/toggle_down_light.png"); + background-repeat:no-repeat; + background-position:100% 50%; + padding:4px 16px 6px 0; +} +#login-container .topnav a.menu-open { + background:#ddeef6!important; + color:#666!important; + outline:none;box-shadow: 3px 2px 2px #ccc; +-webkit-box-shadow: 3px 2px 2px #ccc; +-moz-box-shadow: 3px 2px 2px #ccc; +filter: progid:DXImageTransform.Microsoft.dropShadow(color=#ccc, offX=3, offY=4, positive=true); + +} + +a.signin.menu-open span { + background-image:url("images/toggle_up_dark.png"); + color:#789; +} + +#signin_menu { + -moz-border-radius-topleft:5px; + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -webkit-border-top-left-radius:5px; + -webkit-border-bottom-left-radius:5px; + -webkit-border-bottom-right-radius:5px; + display:none; + background-color:#ddeef6; + position:absolute; + width:210px; + z-index:100; + border:1px transparent; + text-align:left; + padding:12px; + top: 24.5px; + right: 0px; + margin-top:5px; + margin-right: 0px; + *margin-right: -1px; + color:#789; + font-size:11px; box-shadow: 3px 2px 2px #ccc; +-webkit-box-shadow: 3px 2px 2px #ccc; +-moz-box-shadow: 3px 2px 2px #ccc; +filter: progid:DXImageTransform.Microsoft.dropShadow(color=#ccc, offX=3, offY=4, positive=true); +} + +#signin_menu input[type=text], #signin_menu input[type=password] { + display:block; + -moz-border-radius:4px; + -webkit-border-radius:4px; + border:1px solid #ACE; + font-size:13px; + margin:0 0 5px; + padding:5px; + width:203px; +} +#signin_menu p { + margin:0; +} +#signin_menu a { + color:#6AC; +} +#signin_menu label { + font-weight:normal; +} + +#signin_menu p a { + color:#27B!important; +} +#loginSubmit { + -moz-border-radius:4px; + -webkit-border-radius:4px; + background:#39d url('images/bg-btn-blue.png') repeat-x scroll 0 0; + border:1px solid #39D; + color:#fff; + text-shadow:0 -1px 0 #39d; + padding:4px 10px 5px; + font-size:11px; + margin:0 5px 0 0; + font-weight:bold; +} +#loginSubmit::-moz-focus-inner { +padding:0; +border:0; +} +#loginSubmit:hover, #loginSubmit:focus { + background-position:0 -5px; + cursor:pointer; +} +.no-cursor { cursor: none; } +.invisible { display: none !important; } #cursor-big { position: absolute; z-index: 1000; }
\ No newline at end of file diff --git a/static/search/all.js b/static/search/all.js index 233a5a9..fc5aa14 100755 --- a/static/search/all.js +++ b/static/search/all.js @@ -1 +1 @@ -$(document).ready(function(){var $desc=$('#description');var dheight=$desc.height();$desc.css('height','0').hide();var about=$('a#about').text();$('a#about').bind('click',function(){if($desc.is(':visible')){closeDesc()}else{$desc.show().animate({height:dheight},{duration:500});$('a#about').text("close")};return false});function closeDesc(){$desc.animate({height:0},{duration:500,complete:function(){$desc.fadeOut(function(){$(this).css('display','none');$('a#about').text(about)})}})};$('a.closeinfo').bind('click',function(){closeDesc()});$('a#notecount').bind('click',function(){$('.notes').toggle()});var $searchBox=$('#search input[type="text"]');var searchDefault='Search';$searchBox.val(searchDefault);$searchBox.focus(function(){if($(this).attr("value")==searchDefault)$(this).attr("value","");$(this).addClass("focus")});$searchBox.blur(function(){if($(this).attr("value")=="")$(this).attr("value",searchDefault);$(this).removeClass("focus")});$('#wrapper a:not(.popupwindow)').filter(function(){var theHref=this;if(theHref.hostname&&theHref.hostname!==location.hostname){$(theHref).not(".noAutoIcon").addClass("offSite");$(theHref).not(".noAutoLink").attr('target','_blank').bind('click keypress',function(event){var code=event.charCode||event.keyCode;if(!code||(code&&code==13)){if(pageTracker){var fixedLink=this.href;fixedLink=fixedLink.replace(/https?:\/\/(.*)/,"$1");fixedLink='/outgoing/'+fixedLink;pageTracker._trackPageview(fixedLink)}}})}})});
+$(document).ready(function(){var $desc=$('#description');var dheight=$desc.height();$desc.css('height','0').hide();var about=$('a#about').text();$('a#about').bind('click',function(){if($desc.is(':visible')){closeDesc()}else{$desc.show().animate({height:dheight},{duration:500});$('a#about').text("close")};return false});function closeDesc(){$desc.animate({height:0},{duration:500,complete:function(){$desc.fadeOut(function(){$(this).css('display','none');$('a#about').text(about)})}})};$('a.closeinfo').bind('click',function(){closeDesc()});$('a#notecount').bind('click',function(){$('.notes').toggle()});var $searchBox=$('#search input[type="text"]');var searchDefault='Search';$searchBox.val(searchDefault);$searchBox.focus(function(){if($(this).attr("value")==searchDefault)$(this).attr("value","");$(this).addClass("focus")});$searchBox.blur(function(){if($(this).attr("value")=="")$(this).attr("value",searchDefault);$(this).removeClass("focus")});$('#wrapper a:not(.popupwindow)').filter(function(){var theHref=this;if(theHref.hostname&&theHref.hostname!==location.hostname){$(theHref).not(".noAutoIcon").addClass("offSite");$(theHref).not(".noAutoLink").attr('target','_blank').bind('click keypress',function(event){var code=event.charCode||event.keyCode;if(!code||(code&&code==13)){if(pageTracker){var fixedLink=this.href;fixedLink=fixedLink.replace(/https?:\/\/(.*)/,"$1");fixedLink='/outgoing/'+fixedLink;pageTracker._trackPageview(fixedLink)}}})}})}); diff --git a/template/banner.st b/template/banner.st index b182bfa..80d3865 100755 --- a/template/banner.st +++ b/template/banner.st @@ -2,33 +2,46 @@ <div id="header7"> <div id="logoicons"> <div id="logo7"> - <div align="center"><a href="/chat"><i>dump.fm</i></a></div> - + <div align="center"><a href="/chat"><i>dump.fm</i></a></div> <div id="strapline"><img src="/static/talkwith.png" width="179" height="53" /></div> </div> <div class="white"> <div id="bar7"> <div style="float: left;"> - <div align="center">$if(user_nick)$ - <a href="/log"><img src="/static/text.gif" > Log</a> - <a href="/u/$user_nick$"> <img src="/static/home4.gif"/> Profile</a> <a href="/browser"> <img src="/static/image_draw.gif" /> Browser Tool</a> - $else$ <a href="/register"><img src="/static/answer_good.gif" />Register</a> - <div id="landscape"> <img src="/static/const_landscape.gif" /> </div> <div id="welcomeinternet"> <img src="/static/welcome.gif" /> </div> - $endif$ - -</div> - + <div align="center"> + $if(user_nick)$ + <a href="/log"><img src="/static/text.gif" > Log</a> + <a href="/u/$user_nick$"> + <img src="/static/home4.gif"/>Profile + </a> + <a href="/browser"> + <img src="/static/image_draw.gif" /> + Browser Tool</a> + $else$ + <a href="/register"><img src="/static/answer_good.gif" />Register</a> + <div id="landscape"> <img src="/static/const_landscape.gif" /> </div> + <div id="welcomeinternet"> <img src="/static/welcome.gif" /> </div> + $endif$ + </div> </div> </div> </div> </div> <div id="logout7" class="white"> + $if(isadmin)$ + <div id="vip"> + <a href="/VIP/chat"> ★ VIP ★ </a> + </div> + $endif$ + <div align="center">$if(user_nick)$ <a href="/logout"><img src="/static/door2.gif" width="16" height="16" /> Logout</a> $else$ $form_login()$ $endif$ </div> + </div> - <div align="center"><br /> - </div> + <div align="center"><br /></div> </div> </div> + + diff --git a/template/profile.st b/template/profile.st index 9c60ac1..2390acc 100755 --- a/template/profile.st +++ b/template/profile.st @@ -2,42 +2,43 @@ <head> <title>$nick$'s dump.fm</title> $head()$ + <link rel="stylesheet" type="text/css" media="screen" + href="/static/profile.css"> + <script src="/static/jquery.editinplace.1.0.1.packed.js" + type="text/javascript" > + </script> <link rel="stylesheet" type="text/css" media="screen" href="/static/profile.css"> <script type="text/javascript" src="/static/jquery.editinplace.1.0.1.packed.js"></script> - <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" /> - <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script> - <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.datepicker.js"></script> - + <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script> + <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.datepicker.js"></script> <script> - jQuery(document).ready(initProfile); - </script> - <script> - jQuery(document).ready(function(){ - jQuery("#datepicker").datepicker(); - }); - - </script> + jQuery(document).ready(function(){ + initProfile(); + jQuery("#datepicker").datepicker(); + jQuery(".linkify").each(function() { + var text = jQuery(this).text(); + jQuery(this).html(linkify(text)); + }); + }); + </script> - </head> <body> $banner()$ <div id="chatrap"> - <div id="log"> - <div id="loghead"> - - </div> + <div id="loghead"> + </div> <br> + <div id="posts"> - - <div id="posts"> - - $if(dumps)$ + $if(dumps)$ $dumps:{ d | $logged_dump(dump=d)$ }$ + $else$ <h3> </h3> <h3> </h3> @@ -48,56 +49,59 @@ To get started <a href="/chat">join in</a> and post a few pictures.</h3> <h3> </h3></div> <h3> </h3> - <h3> </h3> <h3> </h3> + <h3> </h3> + <h3> </h3> <h3> </h3> <h3> </h3> $endif$ + <p> </p> - <div id="pnav"> + <div id="pnav"> $if(next)$ <div id="pnavo"> <a href="/u/$nick$/$next$">☜ OLD</a> </div> $endif$ - $if(prev)$ <div id="pnavn"><a href="/u/$nick$/$prev$">NEW ☞</a></div> $endif$ - <br><br> -</div> + <br><br> </div> - - <div id="profile"> - - <h2>$nick$</h2> - $if(avatar)$ - <img id="avatarPic" src="$avatar$" width="150px"/> - $else$ - <b id="avatarPic">No avatar</b> - $endif$ + <div id="profile"> + <h2>$nick$</h2> - $if(is_home)$ - <div id="avatar" class="editable">$avatar$</div> - $endif$ + $if(avatar)$ + <img id="avatarPic" src="$avatar$" width="150px"/> + $else$ + <b id="avatarPic">No avatar</b> + $endif$ - <h3>contact info</h3> - <div id="contact" $if(is_home)$class="editable"$endif$>$contact$</div> - <br> + $if(is_home)$ + <div id="avatar" class="editable">$avatar$</div> + $endif$ + + <h3>contact info</h3> + <div id="contact" class="$if(is_home)$editable$else$linkify$endif$"> + $contact$ + </div> + <br> <h3>personal info</h3> - <div id="bio" $if(is_home)$class="editable"$endif$>$bio$</div> -<br> - <div id="date"> -<div type="text" id="datepicker"></div></div> + <div id="bio" class="$if(is_home)$editable$else$linkify$endif$"> + $bio$ + </div> + <br> + <div id="date"> + <div type="text" id="datepicker"></div></div> </div> <div id="footer"> - $footer()$ - </div> + $footer()$ + </div> </div> </div> </body> |
