diff options
-rw-r--r-- | nbproject/project.properties | 3 | ||||
-rw-r--r-- | src/java/com/juick/http/www/UserThread.java | 4 | ||||
-rw-r--r-- | web/favicon.png | bin | 0 -> 244 bytes | |||
-rw-r--r-- | web/js/jquery.autoresize.js | 230 | ||||
-rw-r--r-- | web/logo3.png | bin | 0 -> 1722 bytes | |||
-rw-r--r-- | web/map.js | 182 | ||||
-rw-r--r-- | web/maps.js | 228 | ||||
-rw-r--r-- | web/mc.js | 1 | ||||
-rw-r--r-- | web/message-menu-icon.png | bin | 0 -> 479 bytes | |||
-rw-r--r-- | web/post3.js | 55 | ||||
-rw-r--r-- | web/scripts3.js | 48 | ||||
-rw-r--r-- | web/style3.css | 112 |
12 files changed, 859 insertions, 4 deletions
diff --git a/nbproject/project.properties b/nbproject/project.properties index 873bcd4c..1ae4ca76 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,10 +1,9 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=true -annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.web.dir}/WEB-INF/classes -build.classes.excludes=**/*.java,**/*.form +build.classes.excludes=**/*.java,**/*.form,**/*.js,**/*.css,**/*.png build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 4643da42..7248697b 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -268,7 +268,7 @@ public class UserThread { out.println(" </ul></div></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>"); out.println(" <div class=\"msg-txt\">" + msg.Text + "</div>"); - out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentFormComment(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>"); + out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentForm(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>"); out.println(" <div class=\"msg-comment\" style=\"display: none\"></div>"); if (ReplyTo == 0) { int childs = msg.getChildsCount() - 1; @@ -306,7 +306,7 @@ public class UserThread { out.println(" </ul></div></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:</div>"); out.println(" <div class=\"msg-txt\">" + msg.Text + "</div>"); - out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentFormComment(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>"); + out.println(" <div class=\"msg-links\"><a href=\"#\" onclick=\"return showCommentForm(" + msg.MID + "," + msg.RID + ")\">" + rb.getString("Comment") + "</a></div>"); out.println(" <div class=\"msg-comment\" style=\"display: none\"></div>"); out.println(" </li>"); } diff --git a/web/favicon.png b/web/favicon.png Binary files differnew file mode 100644 index 00000000..bc7161e2 --- /dev/null +++ b/web/favicon.png diff --git a/web/js/jquery.autoresize.js b/web/js/jquery.autoresize.js new file mode 100644 index 00000000..a54ec545 --- /dev/null +++ b/web/js/jquery.autoresize.js @@ -0,0 +1,230 @@ +/* + * jQuery.fn.autoResize 1.1 + * -- + * https://github.com/jamespadolsey/jQuery.fn.autoResize + * -- + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://sam.zoy.org/wtfpl/COPYING for more details. */ + +(function($){ + + var defaults = autoResize.defaults = { + onResize: function(){}, + animate: { + duration: 200, + complete: function(){} + }, + extraSpace: 0, + minHeight: 1, + maxHeight: 500, + minWidth: 'original', + maxWidth: 500 + }; + + autoResize.cloneCSSProperties = [ + 'lineHeight', 'textDecoration', 'letterSpacing', + 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', + 'textTransform', 'textAlign', 'direction', 'wordSpacing', 'fontSizeAdjust', + 'padding' + ]; + + autoResize.cloneCSSValues = { + position: 'absolute', + top: -9999, + left: -9999, + opacity: 0, + overflow: 'hidden' + }; + + autoResize.resizableFilterSelector = 'textarea,input:not(input[type]),input[type=text],input[type=password]'; + + autoResize.AutoResizer = AutoResizer; + + $.fn.autoResize = autoResize; + + function autoResize(config) { + this.filter(autoResize.resizableFilterSelector).each(function(){ + new AutoResizer( $(this), config ); + }); + return this; + } + + function AutoResizer(el, config) { + + config = this.config = $.extend(autoResize.defaults, config); + this.el = el; + + this.nodeName = el[0].nodeName.toLowerCase(); + + this.originalHeight = el.height(); + this.previousScrollTop = null; + + this.value = el.val(); + + if (config.maxWidth === 'original') config.maxWidth = el.width(); + if (config.minWidth === 'original') config.minWidth = el.width(); + if (config.maxHeight === 'original') config.maxHeight = el.height(); + if (config.minHeight === 'original') config.minHeight = el.height(); + + if (this.nodeName === 'textarea') { + el.css({ + resize: 'none', + overflowY: 'hidden' + }); + } + + el.data('AutoResizer', this); + + this.createClone(); + this.injectClone(); + this.bind(); + + } + + AutoResizer.prototype = { + + bind: function() { + + var check = $.proxy(function(){ + this.check(); + return true; + }, this); + + this.unbind(); + + this.el + .bind('keyup.autoResize', check) + //.bind('keydown.autoResize', check) + .bind('change.autoResize', check); + + this.check(null, true); + + }, + + unbind: function() { + this.el.unbind('.autoResize'); + }, + + createClone: function() { + + var el = this.el, + clone; + + if (this.nodeName === 'textarea') { + clone = el.clone().height('auto'); + } else { + clone = $('<span/>').width('auto').css({ + whiteSpace: 'nowrap' + }); + } + + this.clone = clone; + + $.each(autoResize.cloneCSSProperties, function(i, p){ + clone[0].style[p] = el.css(p); + }); + + clone + .removeAttr('name') + .removeAttr('id') + .attr('tabIndex', -1) + .css(autoResize.cloneCSSValues); + + }, + + check: function(e, immediate) { + + var config = this.config, + clone = this.clone, + el = this.el, + value = el.val(); + + if (this.nodeName === 'input') { + + clone.text(value); + + // Calculate new width + whether to change + var cloneWidth = clone.width(), + newWidth = (cloneWidth + config.extraSpace) >= config.minWidth ? + cloneWidth + config.extraSpace : config.minWidth, + currentWidth = el.width(); + + newWidth = Math.min(newWidth, config.maxWidth); + + if ( + (newWidth < currentWidth && newWidth >= config.minWidth) || + (newWidth >= config.minWidth && newWidth <= config.maxWidth) + ) { + + config.onResize.call(el); + + el.scrollLeft(0); + + config.animate && !immediate ? + el.stop(1,1).animate({ + width: newWidth + }, config.animate) + : el.width(newWidth); + + } + + return; + + } + + // TEXTAREA + + clone.height(0).val(value).scrollTop(10000); + + var scrollTop = clone[0].scrollTop + config.extraSpace; + + // Don't do anything if scrollTop hasen't changed: + if (this.previousScrollTop === scrollTop) { + return; + } + + this.previousScrollTop = scrollTop; + + if (scrollTop >= config.maxHeight) { + el.css('overflowY', ''); + return; + } + + el.css('overflowY', 'hidden'); + + if (scrollTop < config.minHeight) { + scrollTop = config.minHeight; + } + + config.onResize.call(el); + + // Either animate or directly apply height: + config.animate && !immediate ? + el.stop(1,1).animate({ + height: scrollTop + }, config.animate) + : el.height(scrollTop); + + }, + + destroy: function() { + this.unbind(); + this.el.removeData('AutoResizer'); + this.clone.remove(); + delete this.el; + delete this.clone; + }, + + injectClone: function() { + ( + autoResize.cloneContainer || + (autoResize.cloneContainer = $('<arclones/>').appendTo('body')) + ).append(this.clone); + } + + }; + +})(jQuery);
\ No newline at end of file diff --git a/web/logo3.png b/web/logo3.png Binary files differnew file mode 100644 index 00000000..df656d3f --- /dev/null +++ b/web/logo3.png diff --git a/web/map.js b/web/map.js new file mode 100644 index 00000000..4359727f --- /dev/null +++ b/web/map.js @@ -0,0 +1,182 @@ +var map; +var mc; +var icon=new GIcon(G_DEFAULT_ICON,"http://maps.google.com/mapfiles/marker_orange.png"); + +function mapInit() { + var lat=getHashVar("lat"); + var lon=getHashVar("lon"); + var zoom=getHashVar("zoom"); + if(!lat || !lon || !zoom) { + lat=readCookie("lat"); + lon=readCookie("lon"); + zoom=readCookie("zoom"); + if(!lat || !lon || !zoom) { + lat=30; + lon=0; + zoom=2; + } + else { + lat=parseFloat(lat); + lon=parseFloat(lon); + zoom=parseInt(zoom); + } + } else { + lat=parseFloat(lat); + lon=parseFloat(lon); + zoom=parseInt(zoom); + } + + map=new GMap2(document.getElementById("geomap")); + map.setCenter(new GLatLng(lat,lon),zoom,G_HYBRID_MAP); + map.addControl(new GMapTypeControl()); + map.enableScrollWheelZoom(); + map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(-10,-60))); + + mc=new MarkerClusterer(map,null,{ + gridSize:40, + maxZoom:15 + }); + + GEvent.addListener(map,"moveend",mapLoadMarkers); + GEvent.addListener(map,"zoomend",mapLoadMarkers); + + mapLoadMarkers(); +} + +function mapLoadMarkers() { + var mapcenter=map.getCenter(); + var lat=Math.round(mapcenter.lat()*100000)/100000; + var lon=Math.round(mapcenter.lng()*100000)/100000; + window.location.hash.replace("#lat="+lat+"&lon="+lon+"&zoom="+map.getZoom()); + writeCookie("lat",lat,365,"/map"); + writeCookie("lon",lon,365,"/map"); + writeCookie("zoom",map.getZoom(),365,"/map"); + + var bounds=map.getBounds(); + var swlat=bounds.getSouthWest().lat(); + if(swlat<-90) swlat=-90; + var swlng=bounds.getSouthWest().lng(); + if(swlng<-180) swlng=-180; + + var nelat=bounds.getNorthEast().lat(); + if(nelat>90) nelat=90; + var nelng=bounds.getNorthEast().lng(); + if(nelng>180) nelng=180; + + if(nelng<swlng) { + var tmp=nelng; + nelng=swlng; + swlng=tmp; + } + + var nodes=document.getElementsByClassName("loadScript"); + for(var i=0; i<nodes.length; i++) + nodes[i].parentNode.removeChild(nodes[i]); + loadScript("http://api.juick.com/places?south="+swlat+"&west="+swlng+"&north="+nelat+"&east="+nelng+"&count=75&callback=mapParsePlaces"); + loadScript("http://api.juick.com/messages?south="+swlat+"&west="+swlng+"&north="+nelat+"&east="+nelng+"&callback=mapParseMessages"); +} + +function loadScript(src) { + var scripttag=document.createElement("script"); + scripttag.setAttribute("type","text/javascript"); + scripttag.setAttribute("src",src); + scripttag.setAttribute("class","loadScript"); + document.getElementsByTagName("head")[0].appendChild(scripttag); +} + +function mapParsePlaces(json) { + var places=document.getElementById("places"); + while(places.hasChildNodes()) places.removeChild(places.lastChild); + var markers=[]; + for(var i=0; i<json.length; i++) { + markers.push( + createMarker( + json[i].pid, + new GLatLng(parseFloat(json[i].lat),parseFloat(json[i].lon)), + json[i].name, + "http://juick.com/places/"+json[i].pid, + icon + ) + ); + if(i<10) { + var li=document.createElement("li"); + li.innerHTML='<li><a href="/places/'+json[i].pid+'">'+json[i].name+'</a></li>'; + places.appendChild(li); + } + } + mc.clearMarkers(); + mc.addMarkers(markers); +} + +function mapParseMessages(json) { + var msgs=document.getElementById("messages"); + while(msgs.hasChildNodes()) msgs.removeChild(msgs.lastChild); + for(var i=0; i<json.length; i++) { + var replies=json[i].replies; + if(!replies) replies=0; + var ihtml='<div class="msg"><big><a href="/'+json[i].user.uname+'/">@'+json[i].user.uname+'</a>:'; + if(json[i].tags) + for(var n=0; n<json[i].tags.length; n++) + ihtml+=' <a href="/'+json[i].user.uname+'/?tag='+json[i].tags[n]+'">*'+json[i].tags[n]+'</a>'; + ihtml+='</big><div class="msgtxt">'; + if(json[i].location) + ihtml+='<b>Location:</b> <a href="/places/'+json[i].location.place_id+'">'+json[i].location.name+'</a><br/>'; + if(json[i].photo) + ihtml+='<b>Attachment:</b> <a href="'+json[i].photo.medium+'">Photo</a><br/>'; + if(json[i].video) + ihtml+='<b>Attachment:</b> <a href="'+json[i].video.mp4+'">Video</a><br/>'; + ihtml+=json[i].body+'</div><div class="msgbottom"><div class="msgnum"><a href="/'+json[i].user.uname+'/'+json[i].mid+'">#'+json[i].mid+'</a></div><div class="msginfo"><a href="/'+json[i].user.uname+'/'+json[i].mid+'">replies: '+replies+'</a></div></div></div>'; + + var li=document.createElement("li"); + li.className='liav'; + li.style.backgroundImage='url(http://i.juick.com/as/'+json[i].user.uid+'.png)'; + li.innerHTML=ihtml; + msgs.appendChild(li); + } +} + +function createMarker(id,latlng,title,href,icon) { + var marker=new GMarker(latlng,{ + 'icon':icon, + 'title':title + }); + marker.param=id; + if(href && href!="") + GEvent.addListener(marker,"click",function(ll) { + var txt='<a href="'+href+'">'+title+'</a>'; + map.openInfoWindowHtml(ll,txt); + }); + return marker; +} + +function getHashVar(variable) { + var query=window.location.hash.substring(1); + var vars=query.split("&"); + for(var i=0; i<vars.length; i++) { + var pair=vars[i].split("="); + if(pair[0]==variable) return pair[1]; + } + return null; +} + +function writeCookie(name,value,days,path) { + var expires; + if(days) { + var date=new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + expires="; expires="+date.toGMTString(); + } else expires=""; + if(!path) path="/"; + document.cookie=name+"="+value+expires+"; path="+path; +} + +function readCookie(name) { + var nameEQ=name+"="; + var ca=document.cookie.split(';'); + for(var i=0; i<ca.length; i++) { + var c=ca[i]; + while(c.charAt(0)==' ') c=c.substring(1,c.length); + if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length); + } + return null; +} diff --git a/web/maps.js b/web/maps.js new file mode 100644 index 00000000..39ac3d6f --- /dev/null +++ b/web/maps.js @@ -0,0 +1,228 @@ +var map; +var mc; +var mapParams; +var mapBounds=null; +var cross=null; +var jcontrol=null; +var crossOnMap=false; + +function mapInitAny() { + map=new GMap2(document.getElementById("geomap")); + map.setMapType(G_HYBRID_MAP); + map.addControl(new GMapTypeControl()); + map.enableScrollWheelZoom(); +} + +function mapInitSimple(lat,lng,iconcolor) { + mapInitAny(); + map.addControl(new GSmallZoomControl()); + map.setCenter(new GLatLng(lat,lng),15); + + var icon=new GIcon(G_DEFAULT_ICON); + if(iconcolor && iconcolor!='red') icon.image="http://maps.google.com/mapfiles/marker_"+iconcolor+".png"; + + map.addOverlay(new GMarker(new GLatLng(lat,lng),{ + 'icon':icon, + 'clickable':false + })); +} + +function mapInit(params,autozoom,place) { + mapParams=params; + + mapInitAny(); + map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(-10,-60))); + if(place) { + jcontrol=new JuickControl(); + cross=new GScreenOverlay('http://static.juick.com/cross.png', + new GScreenPoint(0.5, .5, 'fraction', 'fraction'), + new GScreenPoint(9, 9), + new GScreenSize(19, 19) + ); + } + map.setCenter(new GLatLng(30,0),2); + + mc=new MarkerClusterer(map,null,{ + gridSize:40, + maxZoom:15 + }); + + GEvent.addListener(map,"moveend",mapLoadMarkers); + GEvent.addListener(map,"zoomend",mapLoadMarkers); + + if(autozoom==1 && navigator.geolocation) navigator.geolocation.getCurrentPosition(mapSetCenter,null,{ + timeout:5 + }); + else mapLoadMarkers(autozoom); +} + +// call loadMarkers even if getCurrentPosition failed + +function mapSetCenter(pos) { + map.setCenter(new GLatLng(pos.coords.latitude,pos.coords.longitude),11); + mapLoadMarkers(); +} + +function mapLoadMarkers(zoomOld) { + var zoom=map.getZoom(); + if(zoom>14 && cross!=null && !crossOnMap) { + map.addControl(jcontrol); + map.addOverlay(cross); + crossOnMap=true; + } + if(zoom<=14 && cross!=null && crossOnMap) { + map.removeControl(jcontrol); + map.removeOverlay(cross); + crossOnMap=false; + } + + var bounds=map.getBounds(); + if(mapBounds==null || !mapBounds.containsBounds(bounds) || zoomOld>0) { + var span=bounds.toSpan(); + + var swlat=bounds.getSouthWest().lat()-span.lat()/3; + if(swlat<-90) swlat=-90; + var swlng=bounds.getSouthWest().lng()-span.lng()/3; + if(swlng<-180) swlng=-180; + + var nelat=bounds.getNorthEast().lat()+span.lat()/3; + if(nelat>90) nelat=90; + var nelng=bounds.getNorthEast().lng()+span.lng()/3; + if(nelng>180) nelng=180; + + mapBounds=new GLatLngBounds(new GLatLng(swlat,swlng),new GLatLng(nelat,nelng)); + + var q="/_mapxml?"+mapParams+"&south="+swlat+"&west="+swlng+"&north="+nelat+"&east="+nelng; + GDownloadUrl(q,function(data) { + var xmlmarkers=GXml.parse(data).documentElement.getElementsByTagName("marker"); + var markers=[]; + var mbounds=new GLatLngBounds(); + var icon; + var iconcolor="null"; + for(var i=0; i<xmlmarkers.length; i++) { + var latlng=new GLatLng(parseFloat(xmlmarkers[i].getAttribute("lat")),parseFloat(xmlmarkers[i].getAttribute("lon"))); + var iconcolornew=xmlmarkers[i].getAttribute("color"); + if(iconcolor!=iconcolornew) { + iconcolor=iconcolornew; + icon=new GIcon(G_DEFAULT_ICON); + if(iconcolor!="" && iconcolor!='red') icon.image="http://maps.google.com/mapfiles/marker_"+iconcolor+".png"; + } + markers.push( + createMarker( + xmlmarkers[i].getAttribute("param"), + latlng, + xmlmarkers[i].getAttribute("title"), + xmlmarkers[i].getAttribute("href"), + icon + ) + ); + if(zoomOld==-1) mbounds.extend(latlng); + } + mc.clearMarkers(); + mc.addMarkers(markers); + if(zoomOld==-1) { + var zoom=map.getBoundsZoomLevel(mbounds)-1; + if(zoom>14) zoom=14; + else if(zoom<1) zoom=1; + map.setCenter(mbounds.getCenter(),zoom); + } + }); + } +} + +function createMarker(id,latlng,title,href,icon) { + var marker=new GMarker(latlng,{ + 'icon':icon, + 'title':title + }); + marker.param=id; + if(href && href!="") + GEvent.addListener(marker,"click",function(ll) { + var txt='<a href="'+href+'">'+title+'</a>'; + map.openInfoWindowHtml(ll,txt); + }); + return marker; +} + +// + +function JuickControl() {} +JuickControl.prototype = new GControl(); +JuickControl.prototype.initialize = function(map) { + var container = document.createElement("div"); + + var bAddPlace = document.createElement("div"); + this.setButtonStyle_(bAddPlace); + container.appendChild(bAddPlace); + bAddPlace.appendChild(document.createTextNode("Add place")); + GEvent.addDomListener(bAddPlace, "click", this.onAddPlaceClick); + map.getContainer().appendChild(container); + return container; +} + +JuickControl.prototype.getDefaultPosition = function() { + return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 35)); +} + +JuickControl.prototype.setButtonStyle_ = function(button) { + button.style.color = "#000000"; + button.style.backgroundColor = "white"; + button.style.font = "small Arial"; + button.style.border = "1px solid black"; + button.style.padding = "2px"; + button.style.marginBottom = "5px"; + button.style.textAlign = "center"; + button.style.width = "6em"; + button.style.cursor = "pointer"; +} + +var htmlAddPlace='<form><p style="width: 440px"><b>Name:</b><br/>\ +<input type="text" name="description" maxlength="64" style="width: 400px"/><br/>\ +Impersonal description (max 255 symbols):<br/>\ +<textarea name="text" rows="5" style="width: 400px"></textarea><br/>\ +URL:<br/>\ +<input type="text" name="url" maxlength="128" style="width: 400px"/><br/>\ +Tags (separated by space, 10 max):\ +<input type="text" name="tags" maxlength="255" style="width: 400px"/></p>\ +<p style="width: 400px; text-align: right; margin-bottom: 0"><input type="button" value=" Add " onclick="addPlace(this.form)"/></p>\ +</form>'; + +var placeLatLng; + +JuickControl.prototype.onAddPlaceClick = function() { + placeLatLng=map.getCenter(); + map.removeOverlay(cross); + map.openInfoWindowHtml(placeLatLng,htmlAddPlace,{ + onCloseFn:function() { + map.panTo(placeLatLng); + map.addOverlay(cross); + } + }); +} + +function addPlace(form) { + var description=form.description.value; + if(description=='') { + alert('Enter place name.'); + return; + } + var text=form.text.value; + var url=form.url.value; + var tags=form.tags.value; + map.closeInfoWindow(); + GDownloadUrl("/_mapxml",function(data) { + var xmlmarkers=GXml.parse(data).documentElement.getElementsByTagName("marker"); + + var icon=new GIcon(G_DEFAULT_ICON); + icon.image="http://maps.google.com/mapfiles/marker_orange.png"; + var markers=[]; + markers.push(createMarker( + xmlmarkers[0].getAttribute("param"), + placeLatLng, + description, + xmlmarkers[0].getAttribute("href"), + icon + )); + mc.addMarkers(markers); + },'lat='+placeLatLng.lat()+'&lon='+placeLatLng.lng()+'&description='+escape(description)+'&text='+escape(text)+'&url='+escape(url)+'&tags='+escape(tags)); +} diff --git a/web/mc.js b/web/mc.js new file mode 100644 index 00000000..986d19ac --- /dev/null +++ b/web/mc.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 37(n,v,w){4 o=[];4 m=n;4 t=z;4 q=3;4 r=20;4 x=[36,30,2R,2E,2z];4 s=[];4 u=[];4 p=z;4 i=0;A(i=1;i<=5;++i){s.O({\'18\':"1V://35-31-2Z.2W.2Q/2K/2C/2B/2y/m"+i+".2u",\'S\':x[i-1],\'Z\':x[i-1]})}6(F w==="X"&&w!==z){6(F w.1f==="13"&&w.1f>0){r=w.1f}6(F w.1y==="13"){t=w.1y}6(F w.14==="X"&&w.14!==z&&w.14.9!==0){s=w.14}}7 1t(){6(u.9===0){8}4 a=[];A(i=0;i<u.9;++i){q.Q(u[i],G,z,z,G)}u=a}3.1s=7(){8 s};3.12=7(){A(4 i=0;i<o.9;++i){6(F o[i]!=="1Y"&&o[i]!==z){o[i].12()}}o=[];u=[];17.1W(p)};7 1p(a){8 m.1b().34(a.1o())}7 1S(a){4 c=a.9;4 b=[];A(4 i=c-1;i>=0;--i){q.Q(a[i].C,G,a[i].I,b,G)}1t()}3.Q=7(g,j,b,h,a){6(a!==G){6(!1p(g)){u.O(g);8}}4 f=b;4 d=h;4 e=m.M(g.1o());6(F f!=="2A"){f=T}6(F d!=="X"||d===z){d=o}4 k=d.9;4 c=z;A(4 i=k-1;i>=0;i--){c=d[i];4 l=c.1L();6(l===z){1I}l=m.M(l);6(e.x>=l.x-r&&e.x<=l.x+r&&e.y>=l.y-r&&e.y<=l.y+r){c.Q({\'I\':f,\'C\':g});6(!j){c.L()}8}}c=R 1J(3,n);c.Q({\'I\':f,\'C\':g});6(!j){c.L()}d.O(c);6(d!==o){o.O(c)}};3.1C=7(a){A(4 i=0;i<o.9;++i){6(o[i].1K(a)){o[i].L();8}}};3.L=7(){4 a=3.1j();A(4 i=0;i<a.9;++i){a[i].L(G)}};3.1j=7(){4 b=[];4 a=m.1b();A(4 i=0;i<o.9;i++){6(o[i].1n(a)){b.O(o[i])}}8 b};3.1N=7(){8 t};3.1M=7(){8 m};3.1e=7(){8 r};3.Y=7(){4 a=0;A(4 i=0;i<o.9;++i){a+=o[i].Y()}8 a};3.29=7(){8 o.9};3.1A=7(){4 d=3.1j();4 e=[];4 f=0;A(4 i=0;i<d.9;++i){4 c=d[i];4 b=c.1x();6(b===z){1I}4 a=m.W();6(a!==b){4 h=c.1w();A(4 j=0;j<h.9;++j){4 g={\'I\':T,\'C\':h[j].C};e.O(g)}c.12();f++;A(j=0;j<o.9;++j){6(c===o[j]){o.1v(j,1)}}}}1S(e);3.L()};3.1u=7(a){A(4 i=0;i<a.9;++i){3.Q(a[i],G)}3.L()};6(F v==="X"&&v!==z){3.1u(v)}p=17.27(m,"26",7(){q.1A()})}7 1J(h){4 o=z;4 n=[];4 m=h;4 j=h.1M();4 l=z;4 k=j.W();3.1w=7(){8 n};3.1n=7(c){6(o===z){8 T}6(!c){c=j.1b()}4 g=j.M(c.25());4 a=j.M(c.24());4 b=j.M(o);4 e=G;4 f=h.1e();6(k!==j.W()){4 d=j.W()-k;f=23.22(2,d)*f}6(a.x!==g.x&&(b.x+f<g.x||b.x-f>a.x)){e=T}6(e&&(b.y+f<a.y||b.y-f>g.y)){e=T}8 e};3.1L=7(){8 o};3.Q=7(a){6(o===z){o=a.C.1o()}n.O(a)};3.1C=7(a){A(4 i=0;i<n.9;++i){6(a===n[i].C){6(n[i].I){j.1c(n[i].C)}n.1v(i,1);8 G}}8 T};3.1x=7(){8 k};3.L=7(b){6(!b&&!3.1n()){8}k=j.W();4 i=0;4 a=h.1N();6(a===z){a=j.21().1Z()}6(k>=a||3.Y()===1){A(i=0;i<n.9;++i){6(n[i].I){6(n[i].C.11()){n[i].C.1a()}}N{j.1r(n[i].C);n[i].I=G}}6(l!==z){l.1k()}}N{A(i=0;i<n.9;++i){6(n[i].I&&(!n[i].C.11())){n[i].C.1k()}}6(l===z){l=R E(o,3.Y(),m.1s(),m.1e());j.1r(l)}N{6(l.11()){l.1a()}l.1q(G)}}};3.12=7(){6(l!==z){j.1c(l)}A(4 i=0;i<n.9;++i){6(n[i].I){j.1c(n[i].C)}}n=[]};3.Y=7(){8 n.9}}7 E(a,c,d,b){4 f=0;4 e=c;1X(e!==0){e=V(e/10,10);f++}6(d.9<f){f=d.9}3.16=d[f-1].18;3.H=d[f-1].S;3.P=d[f-1].Z;3.19=d[f-1].1U;3.D=d[f-1].32;3.15=a;3.1T=f;3.1R=d;3.1m=c;3.1l=b}E.J=R 2Y();E.J.2X=7(i){3.1P=i;4 j=1O.2V("2U");4 h=3.15;4 f=i.M(h);f.x-=V(3.P/2,10);f.y-=V(3.H/2,10);4 g="";6(1O.2T){g=\'2S:2P:2O.2M.2L(2J=2I,2H="\'+3.16+\'");\'}N{g="2G:18("+3.16+");"}6(F 3.D==="X"){6(F 3.D[0]==="13"&&3.D[0]>0&&3.D[0]<3.H){g+=\'S:\'+(3.H-3.D[0])+\'B;1H-1g:\'+3.D[0]+\'B;\'}N{g+=\'S:\'+3.H+\'B;1G-S:\'+3.H+\'B;\'}6(F 3.D[1]==="13"&&3.D[1]>0&&3.D[1]<3.P){g+=\'Z:\'+(3.P-3.D[1])+\'B;1H-1i:\'+3.D[1]+\'B;\'}N{g+=\'Z:\'+3.P+\'B;1F-1E:1D;\'}}N{g+=\'S:\'+3.H+\'B;1G-S:\'+3.H+\'B;\';g+=\'Z:\'+3.P+\'B;1F-1E:1D;\'}4 k=3.19?3.19:\'2x\';j.U.2w=g+\'2v:2t;1g:\'+f.y+"B;1i:"+f.x+"B;2D:"+k+";2s:2F;1h-2r:2q;"+\'1h-2p:2o,2n-2m;1h-2N:2l\';j.2k=3.1m;i.2j(2i).2h(j);4 e=3.1l;17.2g(j,"2f",7(){4 a=i.M(h);4 d=R 1Q(a.x-e,a.y+e);d=i.1B(d);4 b=R 1Q(a.x+e,a.y-e);b=i.1B(b);4 c=i.2e(R 2d(d,b),i.2c());i.2b(h,c)});3.K=j};E.J.1K=7(){3.K.2a.33(3.K)};E.J.28=7(){8 R E(3.15,3.1T,3.1m,3.1R,3.1l)};E.J.1q=7(a){6(!a){8}4 b=3.1P.M(3.15);b.x-=V(3.P/2,10);b.y-=V(3.H/2,10);3.K.U.1g=b.y+"B";3.K.U.1i=b.x+"B"};E.J.1k=7(){3.K.U.1d="1z"};E.J.1a=7(){3.K.U.1d=""};E.J.11=7(){8 3.K.U.1d==="1z"};',62,194,'|||this|var||if|function|return|length||||||||||||||||||||||||||null|for|px|marker|anchor_|ClusterMarker_|typeof|true|height_|isAdded|prototype|div_|redraw_|fromLatLngToDivPixel|else|push|width_|addMarker|new|height|false|style|parseInt|getZoom|object|getTotalMarkers|width||isHidden|clearMarkers|number|styles|latlng_|url_|GEvent|url|textColor_|show|getBounds|removeOverlay|display|getGridSize_|gridSize|top|font|left|getClustersInViewport_|hide|padding_|text_|isInBounds|getLatLng|isMarkerInViewport_|redraw|addOverlay|getStyles_|addLeftMarkers_|addMarkers|splice|getMarkers|getCurrentZoom|maxZoom|none|resetViewport|fromDivPixelToLatLng|removeMarker|center|align|text|line|padding|continue|Cluster|remove|getCenter|getMap_|getMaxZoom_|document|map_|GPoint|styles_|reAddMarkers_|index_|opt_textColor|http|removeListener|while|undefined|getMaximumResolution|60|getCurrentMapType|pow|Math|getNorthEast|getSouthWest|moveend|addListener|copy|getTotalClusters|parentNode|setCenter|getSize|GLatLngBounds|getBoundsZoomLevel|click|addDomListener|appendChild|G_MAP_MAP_PANE|getPane|innerHTML|bold|serif|sans|Arial|family|11px|size|position|pointer|png|cursor|cssText|black|images|90|boolean|markerclusterer|trunk|color|78|absolute|background|src|scale|sizingMethod|svn|AlphaImageLoader|Microsoft|weight|DXImageTransform|progid|com|66|filter|all|div|createElement|googlecode|initialize|GOverlay|library|56|utility|opt_anchor|removeChild|containsLatLng|gmaps|53|MarkerClusterer'.split('|'),0,{}))
\ No newline at end of file diff --git a/web/message-menu-icon.png b/web/message-menu-icon.png Binary files differnew file mode 100644 index 00000000..4cac2563 --- /dev/null +++ b/web/message-menu-icon.png diff --git a/web/post3.js b/web/post3.js new file mode 100644 index 00000000..31b3f8f2 --- /dev/null +++ b/web/post3.js @@ -0,0 +1,55 @@ +if(window!=window.top) { + window.top.location.href='http://juick.com/post'; +} + +function clearLocation() { + document.getElementById("location").innerHTML='<a href="#" onclick="addLocation()">Choose</a>'; + document.getElementById("locationclear").style.display="none"; + document.getElementById("geomap").style.display="none"; + document.forms["postmsg"].place_id.value=0; +} + +function addLocation() { + document.getElementById("location").innerHTML="?"; + document.getElementById("locationclear").style.display="inline"; + document.getElementById("geomap").style.display="block"; + if(!map) { + mapInit('show=places',1,1); + GEvent.addListener(map,"click", function(overlay) { + if(overlay instanceof GMarker) { + document.getElementById("location").innerHTML='<a href="/places/'+overlay.param+'">'+overlay.getTitle()+'</a>'; + document.forms["postmsg"].place_id.value=overlay.param; + } + }); + } +} + +function addTag(tag) { + document.forms["postmsg"].body.value='*'+tag+' '+document.forms["postmsg"].body.value; + return false; +} + +function webcamShow() { + swfobject.embedSWF('http://juick.com/_webcam.swf','webcam','320','280','9.0.115','false',null,null,null); +} + +function webcamImage(hash) { + document.getElementById("webcamwrap").innerHTML='<div id="webcam"></div>'; + document.getElementById("attachmentfile").style.display="none"; + document.getElementById("attachmentwebcam").style.display="inline"; + document.forms["postmsg"].webcam.value=hash; +} + +function clearAttachment() { + document.getElementById("attachmentfile").style.display="inline"; + document.getElementById("attachmentwebcam").style.display="none"; + document.forms["postmsg"].webcam.value=""; +} + +$(document).ready(function() { + clearLocation(); + clearAttachment(); + $("textarea")[0].focus(); +}); + +$(window).unload(GUnload); diff --git a/web/scripts3.js b/web/scripts3.js new file mode 100644 index 00000000..ec86d39e --- /dev/null +++ b/web/scripts3.js @@ -0,0 +1,48 @@ +function inlinevideo(mid) { + var flashvars={ + file:'http://i.juick.com/video/'+mid+'.mp4', + image:'http://i.juick.com/thumbs/'+mid+'.jpg', + skin:'http://static.juick.com/glow.zip' + }; + var params={ + allowfullscreen:'true' + }; + swfobject.embedSWF('http://static.juick.com/player.swf','video-'+mid,'640','390','9.0.115','false',flashvars,params,null); +} + +function postformListener(formEl,ev) { + if(ev.ctrlKey && (ev.keyCode==10 || ev.keyCode==13)) formEl.submit(); +} + +function showMoreReplies(id) { + $('#'+id+' .msg-comments').hide(); + + var replies=$('#replies>li'); + var flagshow=0; + for(var i=0; i<replies.length; i++) { + if(flagshow==1) { + if(replies[i].style.display=="none") { + replies[i].style.display="block"; + } else { + break; + } + } + if(replies[i].id==id) { + flagshow=1; + } + } + return false; +} + +function showCommentForm(mid,rid) { + if($('#replies #'+rid+' textarea').length==0) { + var c=$('#replies #'+rid+' .msg-comment'); + c.wrap('<form action="/post" method="POST" enctype="multipart/form-data"/>'); + c.before('<input type="hidden" name="mid" value="'+mid+'"/><input type="hidden" name="rid" value="'+rid+'"/>'); + c.append('<textarea name="body" rows="1" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea>'); + } + $('#replies #'+rid+' .msg-links').hide(); + $('#replies #'+rid+' .msg-comment').show(); + $('#replies #'+rid+' textarea')[0].focus(); + return false; +} diff --git a/web/style3.css b/web/style3.css new file mode 100644 index 00000000..49add6f2 --- /dev/null +++ b/web/style3.css @@ -0,0 +1,112 @@ +html { margin: 0; padding: 0; font-family: sans-serif; font-size: 16px; } +body { margin: 0; padding: 0; } +h1,h2 { font-weight: normal; } +ul { list-style-type: none; } +a { text-decoration: none; } +hr { display: none; } +img { border: none; } + +/********/ + +#header { width: 900px; margin: 0 auto; } +#logo { float: left; margin: 8px 16px 0 0; } +#header ul { margin: 0; padding: 0; } +#header a { text-decoration: none; font-size: 18px; } + +#nav li { float: left; } +#nav-right { float: right; } +#nav-right li { float: left; } + +#header ul a { display: block; line-height: 56px; padding: 0 20px; } +#nav-right img { vertical-align: middle; margin: 0 4px 0 0; } +#nav-menu { display: none; position: absolute; z-index: 1; } +#nav-menu li { float: none; } + +/********/ + +#title { clear: both; width: 100%; border-top: 1px solid; border-bottom: 1px solid; background: #F0F0F0; } +#title>h1 { width: 900px; margin: 20px auto; font-size: 28px; } + +#title-container { width: 900px; margin: 20px auto; min-height: 100px; } +#title-av { width: 100px; height: 100px; margin-left: 20px; float: left; } +#title-av img { vertical-align: top; padding: 2px; } +#title-stats { width: 200px; float: right; border-left: 1px solid; } +#title-stats ul { margin: 10px 0 10px 20px; padding: 0; } +#title-stats li { margin: 0; padding: 0; } +#title-username { margin: 0 220px 0 140px; } + +/********/ + +#wrapper { width: 900px; margin: 0 auto; } +#content { width: 640px; margin-left: 260px; float: left; } +#content ul { list-style-type: none; margin: 0; padding: 0; } +#content li { background-repeat: no-repeat; } + +/********/ + +#geomap { margin-top: 1em; width: 640px; height: 360px; overflow: hidden; } + +#content .msg { padding: 16px 0 0 0; margin: 0 0 16px 0; border-top: 1px solid; width: 640px; } +#content .msg-media { text-align: center; margin-bottom: 10px; } +#content .msg-avatar { float: left; } +#content .msg-avatar img { width: 48px; height: 48px; vertical-align: top; } +#content .msg-ts { float: right; } +#content .msg-ts a { font-size: small; } +#content .msg-menu { margin: 0 8px; display: inline; position: relative; } +#content .msg-menu img { vertical-align: top; } +#content .msg-menu ul { display: none; position: absolute; top: 20px; right: 0; width: 200px; margin: 0; padding: 5px; } +#content .msg-menu li { margin: 0; padding: 0; } +#content .msg-header { margin-left: 58px; } +#content .msg-txt { margin-left: 58px; padding: 6px 0 0 0; } +#content .msg-links { font-size: small; margin: 10px 0 0 68px; } +#content .msg-comments { margin: 10px 0 0 58px; padding: 5px 20px; overflow: hidden; font-size: small; } +#content .msg-comment { margin: 10px 0 0 58px; padding: 0px 0 0 20px; } +#content textarea { border: 1px solid; width: 556px; padding: 2px; resize: vertical; } + +#chats li { margin: 16px; } + +.title2 { padding: 10px 20px; margin: 20px 0 10px 0; } +.title2-right { float: right; line-height: 24px; } +.title2 h2 { margin: 0; font-size: 24px; } + +#gallery { margin: 20px auto; padding: 0; } +.galleryitem { float: left; margin: 0; padding: 0; line-height: 0; } +.galleryitem img { margin: 0 5px 5px 0; } + +.page { text-align: center; padding: 5px; } + +/********/ + +#column { float: left; width: 210px; margin-left: -900px; } +#column ul { margin: 8px 0 0 0; padding: 0; } +#column li { margin: 0; padding: 2px 0 2px 10px; } +#column p { font-size: 14px; margin: 0 0 0 10px; } +#column .inp { width: 195px; } +#column h2 { border-bottom: 1px solid; font-size: 18px; margin: 24px 0 8px 0; padding: 0 0 2px 2px; } + +/********/ + +#footer { clear: both; width: 900px; margin: 0 auto; font-size: small; padding: 25px 0 10px; } +#footer-right { float: right; } + +/******************************************************************************/ + +html { background: #FFF; color: #000; } +a { color: #069; } +#header li a:hover { background: #E0F0FF; } +#title { border-color: #CCC; } +#nav-menu { background: #DDD; } +#title-stats { border-color: #CCC; } + +#content .msg { border-color: #DDD; } +#content .msg-comments { background: #F5F5F5; color: #999; } +#content .msg-ts a { color: #999; } +#content textarea { border-color: #DDD; } +#content .msg-menu ul { background: #DDD; } +.title2 { background: #F0F0F0; } +.page { background: #F0F0F0; } + +#column li:hover { background: #E0F0FF; } +#column h2 { border-color: #CCC; } + +#footer { color: #999; } |