window.addEvent('domready', function() { //var vsLogRegBox = new Fx.Slide('logRegBox').hide(); if($('pollForm') != null) $('pollForm').slide('hide'); if($('demo-status') != null) $('demo-status').setStyle('display', 'none'); }); var mySlide; var friendsPage = 0; var dontDestroyEditBarOnBlur = false; var uploadCategory = ''; /* if($('buddyList') != null) setInterval("GetNewFriendsPage(friendsPage)", 30000); */ var DashRandomInterval; var tn = null; window.addEvent('domready', function() { if($('dashRandom') != null){ DashRandomInterval = setInterval('GetNewDashboardRandom()', 20000); } //if($('searchStuff') != null) // $('searchStuff').setStyle('display', 'none'); //var vsLogRegBox = new Fx.Slide('logRegBox').hide(); //$('logRegBox').hide(); //vsLogRegBox.slideIn(); $$('.logRegOpen').each(function(el) { el.addEvents({ 'click': function(e) { e.stop(); $('logRegLogin').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegRegister').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegLogin').set('dissolve', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegRegister').set('dissolve', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegLogin').reveal(); $('logRegRegister').dissolve(); ToggleLogRegBox(); //$('logRegBox').show(); //vsLogRegBox.toggle(); } }); }); $$('.logRegClose').each(function(el) { el.addEvents({ 'click': function(e) { e.stop(); $('logRegBox').set('dissolve', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegBox').dissolve(); //vsLogRegBox.toggle(); } }); }); $$('.dashRandom').each(function(el) { el.addEvents({ 'click': function() { if(tooltipDiv != null) $(tooltipDiv).dispose(); } }); }); $$('.button').each(function(el) { el.addEvents({ 'click': function() { if($('editBar') != null) KillEditBar(); } }); }); $$('.ytoverlay').each(function(el) { el.addEvents({ 'mouseenter': function() { if(tn != null) tn.dispose(); tn = $(el.childNodes[1]).clone(); var preg_tag =$(el).href.match( /\bv=\b([A-Za-z0-9\_\-]*)/); var tag = preg_tag[1]; var url = "/action/getYTJSON"; var req = new Request({ method: 'post', url: url, data: {'tag' : tag }, onFailure: function(r) { //alert("Unknown Error. Please try again. " + r); }, onRequest: function() { }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); var json_data = new Hash(json.get('data')); var json_tns = new Hash(json_data.get('thumbnail')); var duration = json_data.get('duration'); var mins = Math.round(duration / 60); var secs = duration % 60; DisplayTooltip(el, "" + "

" + json_data.get('description') + "

" + "

(" + mins + ":" + secs + ")

"); } }).send(); /* var url = "/action/1200&page="+escape($(el).href); //tooltipDiv = LoadTooltip(el, url); var req = new Request({ method: 'get', url: url, data: { 'page' : escape($(el).href) }, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { }, onSuccess: function(response) { //var stripped = response.replace(/(<([^>]+)>)/ig,""); //el.setAttribute('title', stripped); //tooltipDiv = DisplayTooltip(el, response); DisplayTooltip(el, "

" + response + "

"); } }).send(); //DisplayTooltip(el, "

Youtube Video

"); */ /* var top = el.getCoordinates().top.toInt(); var left = el.getCoordinates().left.toInt(); $(tn).setStyle('position', 'absolute'); $(tn).setStyle('left', left); $(tn).setStyle('top',top + 13); $(tn).inject(document.body); $(tn).addEvents({ 'mouseleave': function() { if($(tn) != null) $(tn).dissolve(); } }); $(tn).reveal(); */ }, 'mouseleave': function() { //$(el.childNodes[1]).dissolve(); $('tooltip').nix(true); } }); }); $$('.ytimg').each(function(el) { el.setStyle('display', 'none'); el.addEvents({ 'mouseleave': function() { $(el).dissolve(); } }); }); /* * I am pretty sure this is causing a memory leak in firefox. * $$('div.post').each(function(el) { el.fade('hide'); el.fade('in'); }); */ $$('input.persistent', 'textarea.persistent').each(function(el) { $(el).value = GetCookie($(el).get('id')); $(el).innerHTML = GetCookie($(el).get('id')); el.addEvents({ 'blur': function() { SetCookie($(el).get('id'), $(el).value, 3); } }); }); $$('textarea.blurbCount').each(function(el) { DisplayNeededChars(el); el.addEvents({ 'keyup': function() { DisplayNeededChars(el); } }); }); $$('.confirm').each(function(el) { el.setStyle('display', 'none'); }); $$('.soc_container li').each(function(el) { el.addEvents({ 'mouseenter': function() { el.set('tween', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); //el.tween('background-color', '#5E7A9F'); //el.tween('color', '#c0c0c0'); }, 'mouseleave': function() { //el.tween('background-color', '#40536C'); //el.tween('color', '#f0f0f0'); } }); }); $$('body').each(function(el) { var fx = new Fx.Morph(el,{ duration:100, link:'cancel' }); el.addEvents({ 'click': function() { if(tooltipDiv != null) $(tooltipDiv).dispose(); } }); }); $$('span.userMenu img').each(function(el) { var fx = new Fx.Morph(el,{ duration:100, link:'cancel' }); el.addEvents({ 'mouseenter': function() { //ShowMessage(el.getAttribute('alt')); DisplayTooltip(el, el.getAttribute('alt')); //DisplayTooltip(el, el.getAttribute('alt')); }, 'mouseleave' : function() { //HideStatusBar(); $('tooltip').dispose(); } }); }); $$('form.ajax').each(function(el) { el.addEvents({ 'submit': function(e) { new Event(e).stop(); SubmitForm(el); } }); }); $$('.autoClear').each(function(el) { var fx = new Fx.Morph(el,{ duration:100, link:'cancel' }); el.addEvents({ 'focus': function() { if(el.getAttribute('changed') != 'true') { el.rel = el.value; el.value = ''; el.setAttribute("oldColor", el.getStyle('color')); el.setStyle("color", $('body').getStyle('color')); } }, 'blur': function() { if(el.value == '') { el.value = el.rel; el.setStyle('color', el.getAttribute('oldColor')); el.setAttribute("changed", ''); } }, 'change': function(){ el.setAttribute("changed", 'true'); } }); }); $$('td.attachment a').each(function(el) { el.addEvents({ 'mouseenter': function() { //DisplayTooltip(el, el.getAttribute('alt') + "test"); }, 'mouseleave' : function() { //HideStatusBar(); } }); }); $$('.hidden').each(function(el) { var p = new Fx.Slide(el, { duration:400, transition: Fx.Transitions.Quart.easeIn}).hide(); }); var tbOrigColor = ''; $$('a').each(function(el) { var fx = new Fx.Tween(el,{ duration:100, link:'cancel', transition: Fx.Transitions.Sine.easeOut}); el.addEvents({ 'mouseenter': function() { //if(tbOrigColor == '') //tbOrigColor = el.getStyle('color'); //el.tween('color', '#793B36'); }, 'mouseleave': function() { //el.tween('color', tbOrigColor); } }); }); //var postOrigColor = ''; $$('div.post').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { clearInterval( DashRandomInterval); //ShowMessage("STOP RANDOM SCROLL"); }, 'mouseleave': function() { if($('dashRandom') != null){ DashRandomInterval = setInterval('GetNewDashboardRandom()', 10000); //ShowMessage("DO RANDOM NOW"); } } }); }); /* $$('div.attachments').each(function(el) { el.slide('hide'); }); */ /* $$('div.comment').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { fx.start({ 'background-color': '#eef5ee' }); }, 'mouseleave': function() { fx.start({ 'background-color': $(document.body).getStyle('background-color') }); } }); }); */ $$('.titleTooltip').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.setAttribute('alt', el.getAttribute('title')); el.setAttribute('title', null); el.addEvents({ 'mouseenter': function() { //ShowMessage(el.getAttribute('alt')); DisplayTooltip(el, el.getAttribute('alt')); //DisplayTooltip(el, el.getAttribute('alt')); }, 'mouseleave' : function() { //HideStatusBar(); if($('tooltip') != null) $('tooltip').dispose(); } }); }); var inboxEvenOColor; $$('td.inboxItemEven').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { inboxEvenOColor = el.getStyle("background-color"); fx.start({ 'background-color': '#e9e9e9' }); }, 'mouseleave': function() { fx.start({ 'background-color': inboxEvenOColor }); } }); }); var inboxEvenOColor; $$('span.upvote').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { //DisplayTooltip(el, 'Vote that this is good.'); }, 'mouseleave': function() { //DestroyTooltip(); } }); }); $$('.attachments img').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { var open = el.getAttribute('open'); if($('mediaOpen') != null) $('mediaOpen').nix(true); if(open != '' && $('mediaOpen') == null) { var top = el.getCoordinates().top.toInt(); var left = el.getCoordinates().left.toInt(); var link = new Element("a"); link.href = open; /* link.set('html', 'more'); link.setStyle('position', 'absolute'); link.href ='/media/' + el.getAttribute('hash'); link.setStyle('top', top); link.setStyle('left', left); link.setStyle('display', 'none'); link.setStyle('width', el.getStyle('width')); link.addClass('attachmentOverlay'); link.setAttribute('id', 'mediaOpen'); link.injectInside(document.body); link.addEvent('mouseleave', function() {link.nix(true);}); link.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); link.reveal(); */ } }, 'mouseleave': function() { } }); }); var inboxOddOColor; $$('td.inboxItemOdd').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { inboxOddOColor = el.getStyle('background-color'); fx.start({ 'background-color': '#e9e9e9' }); }, 'mouseleave': function() { fx.start({ 'background-color': inboxOddOColor }); } }); }); $$('div.head ul li, .soc_container li, .subdrop, .button, .goarrow').each(function(el) { var fx = new Fx.Morph(el,{ duration:300, link:'cancel' }); el.addEvents({ 'mouseenter': function() { el.tween( 'color', '#4579AB' ); }, 'mouseleave': function() { el.tween( 'color', '#0f0f0f' ); } }); }); $$('a.InboxMassTool').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'click': function(e) { new Event(e).stop(); //touchURL(el.href); var req = new Request({ method: 'get', url: el.href, data: { 'do' : '1' }, onFailure: function() { ShowMessage("There was a problem, sorry buddy.", "error"); $('inbox').fade('in'); }, onRequest: function() { $('inbox').fade('out'); }, onSuccess: function(response) { $('inbox').innerHTML = response; $('inbox').fade('in'); } }).send(); } }); }); var unreadOColor; $$('td.inboxItemUnread').each(function(el) { var fx = new Fx.Morph(el,{ duration:200, link:'cancel' }); el.addEvents({ 'mouseenter': function() { unreadOColor = el.getStyle('background-color'); fx.start({ 'background-color': '#e9e9e9' }); }, 'mouseleave': function() { fx.start({ 'background-color': unreadOColor }); } }); }); var tooltipDiv = null; $$('span.enableHoverTitle a').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'mouseenter': function() { //if(tooltipDiv != null) $(tooltipDiv).dispose(); var url = "/action/1200&page="+escape($(el).href); //tooltipDiv = LoadTooltip(el, url); var req = new Request({ method: 'get', url: url, data: { 'page' : escape($(el).href) }, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { }, onSuccess: function(response) { //var stripped = response.replace(/(<([^>]+)>)/ig,""); //el.setAttribute('title', stripped); tooltipDiv = DisplayTooltip(el, response); } }).send(); }, 'mouseleave': function() { /* $(tooltipDiv).chain( function(){$(tooltipDiv).fade('out');} ).chain( function(){$(tooltipDIv).dispose();} ) */ //$(tooltipDiv).dispose(); $(tooltipDiv).nix(true); //prettyDestroy(tooltipDiv, true); } }); }); $$('span.popupclose').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { HideStatusBar(); } }); }); $$('a.peoplePopup').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { time = 1337523209;var url = '?'; if($('containerAge') != null) $('containerAge').nix(true); //var url = window.location + ""; //var lastURL = url.substr(url.length - 1, url.length); //url = url.replace("#", ""); //if(lastURL != '&' || lastURL == '') // url += "?"; var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; var div = new Element('div'); //var div = $('agePopup'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('soc_container'); div.setAttribute('id','containerAge'); div.injectInside(document.body); $(div).addEvent('mouseleave',function(){ div.nix(true); }) var left = new Element('div'); left.addClass('soc_left'); left.injectInside(div); var a = new Element('a'); a.href = '/people/all/'; a.setStyle('display', 'block'); a.innerHTML = 'everyone'; a.injectInside(div); var a = new Element('a'); a.href = '/friends/'; a.setStyle('display', 'block'); a.innerHTML = 'friends'; a.injectInside(div); var a = new Element('a'); a.href = '/people/imfollowing/'; a.setStyle('display', 'block'); a.innerHTML = 'followed by you'; a.injectInside(div); var a = new Element('a'); a.href = '/people/followingme/'; a.setStyle('display', 'block'); a.innerHTML = 'following you'; a.injectInside(div); var a = new Element('a'); a.href = '/people/blocked/'; a.setStyle('display', 'block'); a.innerHTML = 'blocked'; a.injectInside(div); div.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); div.reveal(); } }); }); $$('li.subdrop').each(function(pop) { $(pop).setStyle('display', 'none'); }); $$('a.subUserMenu').each(function(el) { el.addEvents({ 'click' : function() { if($('subUserDrop') == null) { var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; var div = new Element('div'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('soc_container'); div.setAttribute('id','subUserDrop'); $$('li.subdrop').each(function(pop) { $(pop).setStyle('display', 'block'); $(pop).injectInside(div); }); div.injectInside(document.body); $(div).addEvent('mouseleave',function(){ //div.nix(false); div.dissolve(); }); div.reveal(); }else{ $('subUserDrop').reveal(); } } }); }); $$('li.headdrop').each(function(pop) { $(pop).setStyle('display', 'none'); }); $$('a.headUserMenu').each(function(el) { el.addEvents({ 'click' : function() { if($('userDrop') == null) { var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; var div = new Element('div'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('soc_container'); div.setAttribute('id','userDrop'); $$('li.headdrop').each(function(pop) { $(pop).setStyle('display', 'block'); $(pop).injectInside(div); }); div.injectInside(document.body); $(div).addEvent('mouseleave',function(){ //div.nix(false); div.dissolve(); }); div.reveal(); }else{ $('userDrop').reveal(); } } }); }); $$('a.agePopup').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { time = 1337523209;var url = '?'; if($('containerAge') != null) $('containerAge').dispose(); //var url = window.location + ""; //var lastURL = url.substr(url.length - 1, url.length); //url = url.replace("#", ""); //if(lastURL != '&' || lastURL == '') // url += "?"; var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; var div = new Element('div'); //var div = $('agePopup'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('soc_container'); div.setAttribute('id','containerAge'); div.injectInside(document.body); $(div).addEvent('mouseleave',function(){ div.nix(true); }) var left = new Element('div'); //left.addClass('soc_left'); left.injectInside(div); var a = new Element('a'); a.href = url+'cutoff='+(time - 3600); a.setStyle('display', 'block'); a.innerHTML = 'the last hour'; a.injectInside(div); var a = new Element('a'); a.href = url+'cutoff='+(time - 86400); a.setStyle('display', 'block'); a.innerHTML = 'the last day'; a.injectInside(div); var a = new Element('a'); a.href = url+'cutoff='+(time - 604800); a.setStyle('display', 'block'); a.innerHTML = 'the last week'; a.injectInside(div); var a = new Element('a'); a.href = url+'cutoff='+(time - 2592000); a.setStyle('display', 'block'); a.innerHTML = 'the last month'; a.injectInside(div); var a = new Element('a'); a.href = url+'cutoff='+(time - 31104000); a.setStyle('display', 'block'); a.innerHTML = 'the last year'; a.injectInside(div); var a = new Element('a'); a.href = url; a.setStyle('display', 'block'); a.innerHTML = 'the beginning of time'; a.injectInside(div); div.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); div.reveal(); } }); }); $$('textarea').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'keyup': function(e) { //AutoResizeObject(el); }, 'focus' : function() { AutoResizeObject(el); //var mtop = el.getStyle('margin-top').toInt(); //el.setStyle('margin-top', mtop + 30); InjectEditbar(el); //DestroyEditbar(); }, 'click' : function() { //AutoResizeObject(el); }, 'blur' : function() { //if($('editBar') != null){ //KillEditBar(); //} } }); }); $$('textarea.blurb').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'focus': function() { if($('postCategoryPopup') != null){ if($('postCategoryPopup').getStyle('visibility') == 'visible') prettyDestroy('postCategoryPopup', 'kindof'); } } }); }); $$('a.blGetMoreFriends').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { GetNewFriendsPage(10); } }); }); $$('.spamCheck').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'blur': function() { var url = "/action/7000"; var req = new Request({ method: 'post', url: url, data: { 'text' : el.value }, onFailure: function() { }, onRequest: function() { }, onSuccess: function(response) { if(parseFloat(response) >= 10) { $('captcha').setStyle('display', 'block'); }else if(GetCookie('captcha') == 'false'){ if($('captchaALL') != null){ $('captchaALL').setStyle('display', 'none'); ShowMessage("You don't have to enter a captcha if your post doesn't look like spam and you have good Points.", "info"); } } } }).send(); } }); }); $$('a.blGetPreviousFriends').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { GetNewFriendsPage(-10); } }); }); $$('a.blRefreshFriends').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'click': function() { GetNewFriendsPage(0); } }); }); var originalSpoilerColor; $$('span.spoiler').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.setAttribute('rel', el.getAttribute('title')); el.setAttribute('title', null); el.addEvents({ 'mouseenter': function() { //originalSpoilerColor = el.getStyle('color'); //el.tween('color', '#111'); var t; t = el.getAttribute('rel'); //el.setAttribute('title', el.innerHTML); //el.set('html', t); DisplayTooltip(el, t); }, 'mouseleave': function() { //t = el.getAttribute('title'); //el.setAttribute('title', el.innerHTML); //el.set('html', t); $('tooltip').dispose(); } }); }); //$$('uploadpropic').each(function(el) { //var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); /* $('uploadpropic').addEvents({ 'click': function() { alert("ha"); var form = $('uploadpropic').form; $(form).set('send', { onRequest: function() { alert("request"); }, onSuccess: function() { ShowMessage("Profile Picture Uploaded!", "success"); }, onFailure: function () { ShowMessage("Sorry, your profile picture wasn't saved.", "error"); } }); $(form).send(); } }); //}); */ /* $('sendMessageSubmit').addEvent( 'click', function(evt){ // Stops the submission of the form. new Event(evt).stop(); // Sends the form to the action path, // which is 'script.php' $('sendMessageForm').send(); } ); */ /* mySlide = new Slider($('area'), $('knob'), { steps: 480, onChange: function(step){ document.getElementById("demModValue").value = step; document.getElementById("pointsForModD").innerHTML = step; } }).set(10); */ }); function ChangeKarmaSlider(val) { mySlide.set(val); } function DisplayLinkHoverInfo(link) { /* *First mission is to get the title of the remote page. */ var url = "/action/1200"; var retdiv; //var url = 'todo.txt'; //alert("requesting title for: "+url); var req = new Request({ method: 'get', url: url, data: { 'page' : escape($(link).href), 'title' : true }, onFailure: function() { ShowMessage("Failed to get page title, the link may be broken.", "error"); }, onRequest: function() { //ShowMessage("Requesting..."); }, onComplete: function(response) { //var Tips1 = new Tips($$(link)); //ShowMessage(response+"
("+$(link).href+")"); DisplayTooltip(link, response); } }).send(); } function GetNewFriendsPage(step) { friendsPage+=step; if(friendsPage < 0) friendsPage = 0; var req = new Request({ method: 'get', url: '/action/2000', data: { 's' : friendsPage }, onRequest: function() { $('buddyList').fade('out'); }, onFailure: function() { }, onSuccess: function(response) { $('buddyList').fade('hide'); document.getElementById('buddyList').innerHTML = response; $('buddyList').fade('in'); } }).send(); } function AutoResizeObject(el) { var theSize = el.getSize(); var theScrollSize = el.getScrollSize(); var theParentSize = el.parentNode.getSize(); //if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { var checksize = (theScrollSize.y); } //else var checksize = (theScrollSize.y+this.vertPadding); if(theScrollSize.y > theSize.y) { //we are scrolling, so grow: el.set('tween', {duration: '100'}); el.tween('height', theScrollSize.y + 10); } if(theScrollSize.x > theSize.x) { //we are scrolling, so grow: el.set('tween', {duration: '100'}); if(theScrollSize.x > theParentSize.x){ el.tween('width', theParentSize.x); }else el.tween('width', theScrollSize.x + 10); } } var oldEditBarBox; var EditBoxTextbox; function InjectEditbar(textarea) { var parent = textarea; AutoResizeObject(textarea); EditBoxTextbox = textarea; //if($(oldEditBarBox) != null && ($('atlinkPopup') != null || $('emotePopup') != null) || $('postlinkPopup') != null){ if($('editBar') != null){ //alert(textarea); while($('editBar') != null) $('editBar').dispose(); } oldEditBarBox = textarea; KillSlideEditPops(); var parentSize = textarea.getSize(); var bar; if($('editBar') == null){ //$('editBar').dispose(); bar = new Element('div'); bar.setStyle('width', parentSize.x+"px"); bar.setStyle('top', '0px'); bar.setStyle('position', 'inline'); bar.addClass('toolbar'); bar.setAttribute('id', 'editBar'); //create bold text var boldButton = new Element('span'); boldButton.innerHTML = "B"; boldButton.inject(bar); $(boldButton).addEvent('click',function(e){ e = new Event(e).stop(); AddBBCodeToTextarea(textarea, '[b]', '[/b]'); }); //create italic text var italicButton = new Element('span'); italicButton.innerHTML = "I"; italicButton.inject(bar); $(italicButton).addEvent('click',function(e){ e = new Event(e).stop(); AddBBCodeToTextarea(textarea, '[i]', '[/i]'); }); //create underline text var underlineButton = new Element('span'); underlineButton.innerHTML = "U"; underlineButton.inject(bar); $(underlineButton).addEvent('click',function(e){ e = new Event(e).stop(); AddBBCodeToTextarea(textarea, '[u]', '[/u]'); }); //create underline text var underlineButton = new Element('span'); underlineButton.innerHTML = "link"; underlineButton.setStyle('margin-left', '10px'); underlineButton.inject(bar); $(underlineButton).addEvent('click',function(e){ e = new Event(e).stop(); var url = prompt("Enter the URL of the website you wish to link to."); if(url == '') return; if(url.substring(0, 7) != "http://" && url.substring(0, 6) != "ftp://") url = "http://"+url; var text = prompt("Enter the text for the link"); if(text == '' || text == null) text = url.substring(7, url.length); AddBBCodeToTextarea(textarea, '[url='+url+"]", text+'[/url]'); }); //create underline text var underlineButton = new Element('span'); underlineButton.innerHTML = "spoiler"; underlineButton.inject(bar); $(underlineButton).addEvent('click',function(e){ e = new Event(e).stop(); AddBBCodeToTextarea(textarea, '[spoiler]', '[/spoiler]'); }); /* //create emoticon text var emoteButton = new Element('span'); emoteButton.innerHTML = "emote"; emoteButton.inject(bar); $(emoteButton).addEvent('click',function(e){ e = new Event(e).stop(); KillSlideEditPops(); if($('emotePopup') != null){ return; } var emoteP = new Element('div'); var top = textarea.getCoordinates().top.toInt(); var height = textarea.getCoordinates().height.toInt(); var left = textarea.getCoordinates().left.toInt(); var pos = top+height emoteP.setStyle('top', top); emoteP.setStyle('margin-top',10); emoteP.setStyle('width', textarea.getSize().x+'px'); emoteP.addClass('editDropdown'); emoteP.setAttribute('id', 'emotePopup'); var emoticonRel; var img = new Element('img'); img.src = '/img/emoticon/wtf.gif'; emoticonRel = 'wtf.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/cool.gif'; emoticonRel = 'cool.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/icon_question.gif'; emoticonRel = 'icon_question.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wall_bash-anim.gif'; emoticonRel = 'wall_bash-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/yes_anim.gif'; emoticonRel = 'yes_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/pissed-off2.gif'; emoticonRel = 'pissed-off2.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/icon_arrow.gif'; emoticonRel = 'icon_arrow.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/sad_anim.gif'; emoticonRel = 'sad_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/music.gif'; emoticonRel = 'music.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/tongue_anim.gif'; emoticonRel = 'tongue_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/puppy-eyes_anim.gif'; emoticonRel = 'puppy-eyes_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/dance-anim.gif'; emoticonRel = 'dance-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wtf_anim.gif'; emoticonRel = 'wtf_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/cry_anim.gif'; emoticonRel = 'cry_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wow_anim.gif'; emoticonRel = 'wow_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wow.gif'; emoticonRel = 'wow.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/ehh.gif'; emoticonRel = 'ehh.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/confused_anim.gif'; emoticonRel = 'confused_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wink_anim.gif'; emoticonRel = 'wink_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wht.gif'; emoticonRel = 'wht.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/ban.gif'; emoticonRel = 'ban.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/camouflage-anim.gif'; emoticonRel = 'camouflage-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/holy.gif'; emoticonRel = 'holy.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/muted.gif'; emoticonRel = 'muted.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/middlef2.gif'; emoticonRel = 'middlef2.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/thumb-down_anim.gif'; emoticonRel = 'thumb-down_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/..'; emoticonRel = '..'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/crazy-anim.gif'; emoticonRel = 'crazy-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/whistle-anim.gif'; emoticonRel = 'whistle-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/fackoff.gif'; emoticonRel = 'fackoff.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/middlef-anim.gif'; emoticonRel = 'middlef-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/fake-santa.gif'; emoticonRel = 'fake-santa.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/devil_anim.gif'; emoticonRel = 'devil_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/flower.gif'; emoticonRel = 'flower.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/shy.gif'; emoticonRel = 'shy.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/sugoi_anim.gif'; emoticonRel = 'sugoi_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/tongue2.gif'; emoticonRel = 'tongue2.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/madman-anim.gif'; emoticonRel = 'madman-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/happy2.gif'; emoticonRel = 'happy2.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/shocked-anim.gif'; emoticonRel = 'shocked-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/bored_anim.gif'; emoticonRel = 'bored_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/wink.gif'; emoticonRel = 'wink.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/hihi_anim.gif'; emoticonRel = 'hihi_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/smile_anim.gif'; emoticonRel = 'smile_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/pissed-off3.gif'; emoticonRel = 'pissed-off3.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/santa.gif'; emoticonRel = 'santa.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/lego_anim.gif'; emoticonRel = 'lego_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/heart-anim.gif'; emoticonRel = 'heart-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/happy.gif'; emoticonRel = 'happy.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/rotfl_anim.gif'; emoticonRel = 'rotfl_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/thinking_anim.gif'; emoticonRel = 'thinking_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/eek.gif'; emoticonRel = 'eek.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/thumb-up_anim.gif'; emoticonRel = 'thumb-up_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/little_lol-anim.gif'; emoticonRel = 'little_lol-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/falled_in_love-anim.gif'; emoticonRel = 'falled_in_love-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/happy-sweat.gif'; emoticonRel = 'happy-sweat.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/big-grin-sweat.gif'; emoticonRel = 'big-grin-sweat.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/ermm.gif'; emoticonRel = 'ermm.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/new_toy-anim.gif'; emoticonRel = 'new_toy-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/big-grin.gif'; emoticonRel = 'big-grin.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/sweatdrop-anim.gif'; emoticonRel = 'sweatdrop-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/coolio_anim.gif'; emoticonRel = 'coolio_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/tongue4.gif'; emoticonRel = 'tongue4.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/pissed-off.gif'; emoticonRel = 'pissed-off.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/.'; emoticonRel = '.'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/fake-smile.gif'; emoticonRel = 'fake-smile.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/clap-anim.gif'; emoticonRel = 'clap-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/big_wink.gif'; emoticonRel = 'big_wink.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/tongue3.gif'; emoticonRel = 'tongue3.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/hypno-anim.gif'; emoticonRel = 'hypno-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/lol-above-anim.gif'; emoticonRel = 'lol-above-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/shifty-anim.gif'; emoticonRel = 'shifty-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/lets_sin-anim.gif'; emoticonRel = 'lets_sin-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/hump.gif'; emoticonRel = 'hump.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/no_anim.gif'; emoticonRel = 'no_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/cookie.gif'; emoticonRel = 'cookie.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/icon_exclaim.gif'; emoticonRel = 'icon_exclaim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/hahaha.gif'; emoticonRel = 'hahaha.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/bright_moon-anim.gif'; emoticonRel = 'bright_moon-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/annoying-nerd.gif'; emoticonRel = 'annoying-nerd.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/kiss_anim.gif'; emoticonRel = 'kiss_anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/very-happy.gif'; emoticonRel = 'very-happy.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); var img = new Element('img'); img.src = '/img/emoticon/music-anim.gif'; emoticonRel = 'music-anim.gif'; emoticonRel = emoticonRel.substring(0, emoticonRel.length - 4); img.setAttribute('rel', emoticonRel); img.addClass('emoticonSel'); img.injectInside(emoteP); emoteP.injectInside(bar); var emotePSlider = new Fx.Slide('emotePopup', {}).hide(); emotePSlider.slideIn(); $$('img.emoticonSel').each(function(el2) { var fx = new Fx.Morph(el2,{ duration:400, link:'cancel' }); el2.addEvents({ 'click': function() { var emoticon = el2.get('rel'); AddBBCodeToTextarea(textarea, '**'+emoticon+'**', ''); var killSlide = new Fx.Slide('emotePopup', { duration:400, transition: Fx.Transitions.Quart.easeOut}).chain( function(){ $('emotePopup').dispose();}); killSlide.slideOut(); } }); }); }); //create list of friends for @links var atLinkButton = new Element('span'); atLinkButton.innerHTML = "@user"; atLinkButton.setStyle('margin-left', '10px'); atLinkButton.inject(bar); $(atLinkButton).addEvent('click',function(e){ e = new Event(e).stop(); KillSlideEditPops(); if($('atlinkPopup') != null){ return; } var atlinkP = new Element('div'); var top = textarea.getCoordinates().top.toInt(); var height = textarea.getCoordinates().height.toInt(); var left = textarea.getCoordinates().left.toInt(); var pos = top+height atlinkP.setStyle('width', textarea.getSize().x+'px'); atlinkP.setStyle('margin-top',10); atlinkP.addClass('editDropdown'); atlinkP.setAttribute('id', 'atlinkPopup'); atlinkP.injectInside(bar); var atlinkPSlider = new Fx.Slide('atlinkPopup', {}).hide(); //loadURL('/action/2006', atlinkPopup); var url = '/action/2006'; var req = new Request({ method: 'get', url: '/action/2006', data: { 'do' : '1' }, onFailure: function() { alert("Unknown Error. Please try again."); $('atlinkPopup').dispose(); }, onRequest: function() { //atlinkPopup.fade('out'); //$('atlinkPopup').fade('hide'); }, onSuccess: function(response) { //$('atlinkPopup').fade('in'); $('atlinkPopup').set('html', response); atlinkPSlider.slideIn(); } }).send(); }); //create #link text var linkButton = new Element('span'); linkButton.innerHTML = "#post"; linkButton.inject(bar); $(linkButton).addEvent('click',function(e){ e = new Event(e).stop(); KillSlideEditPops(); if($('postlinkPopup') != null){ return; } var atlinkP = new Element('div'); var top = textarea.getCoordinates().top.toInt(); var height = textarea.getCoordinates().height.toInt(); var left = textarea.getCoordinates().left.toInt(); var pos = top+height atlinkP.setStyle('width', textarea.getSize().x+'px'); atlinkP.addClass('editDropdown'); atlinkP.setAttribute('id', 'postlinkPopup'); atlinkP.injectInside(bar); var postlinkPSlider = new Fx.Slide('postlinkPopup', {}).hide(); var atlinkMenu = new Element('div'); atlinkMenu.injectInside(atlinkP); var atlinkAjax = new Element('div'); atlinkAjax.injectInside(atlinkP); var atlinkFriends = new Element('span'); atlinkFriends.set('html', 'Friends'); atlinkFriends.addClass('editBarSubmenu'); atlinkFriends.injectInside(atlinkMenu); atlinkFriends.addEvent('click',function(e){ var req = new Request({ method: 'get', url: '/action/5002&friends', data: { 'friends' : true }, onFailure: function() { alert("Unknown Error. Please try again."); $('postlinkPopup').dispose(); }, onRequest: function() { //atlinkPopup.fade('out'); }, onSuccess: function(response) { //$('postlinkPopup').set('html', response); atlinkAjax.set('html', response); postlinkPSlider.slideIn(); } }).send(); }); var atlinkAjax = new Element('div'); atlinkAjax.injectInside(atlinkP); var atlinkFriends = new Element('span'); atlinkFriends.set('html', 'Followed'); atlinkFriends.addClass('editBarSubmenu'); atlinkFriends.setStyle('margin-top',10); atlinkFriends.injectInside(atlinkMenu); atlinkFriends.addEvent('click',function(e){ var req = new Request({ method: 'get', url: '/action/5002&followed', data: { 'followed' : true }, onFailure: function() { alert("Unknown Error. Please try again."); $('postlinkPopup').dispose(); }, onRequest: function() { //atlinkPopup.fade('out'); }, onSuccess: function(response) { //$('postlinkPopup').set('html', response); atlinkAjax.set('html', response); postlinkPSlider.slideIn(); } }).send(); }); var atlinkFriends = new Element('span'); atlinkFriends.set('html', 'Voted On'); atlinkFriends.addClass('editBarSubmenu'); atlinkFriends.injectInside(atlinkMenu); atlinkFriends.addEvent('click',function(e){ var req = new Request({ method: 'get', url: '/action/5002', data: { 'do' : '1' }, onFailure: function() { alert("Unknown Error. Please try again."); $('postlinkPopup').dispose(); }, onRequest: function() { //atlinkPopup.fade('out'); }, onSuccess: function(response) { //$('postlinkPopup').set('html', response); atlinkAjax.set('html', response); postlinkPSlider.slideIn(); } }).send(); }); var req = new Request({ method: 'get', url: '/action/5002', data: { 'friends' : true}, onFailure: function() { alert("Unknown Error. Please try again."); $('postlinkPopup').dispose(); }, onRequest: function() { //atlinkPopup.fade('out'); }, onSuccess: function(response) { //$('postlinkPopup').set('html', response); atlinkAjax.set('html', response); postlinkPSlider.slideIn(); } }).send(); }); */ //create underline text var helpButton = new Element('span'); helpButton.innerHTML = "help"; helpButton.setStyle('margin-left', '15px'); helpButton.inject(bar); $(helpButton).addEvent('click',function(e){ e = new Event(e).stop(); new MooDialog.Request('/posthelp.htm', {}, {size: {width: 500, height: 400}}); }); var closeButton = new Element('span'); closeButton.innerHTML = "close"; closeButton.setStyle('margin-left', '15px'); closeButton.inject(bar); $(closeButton).addEvent('click',function(e){ e = new Event(e).stop(); KillEditBar(); }); //create underline text /* var quoteButton = new Element('span'); quoteButton.innerHTML = "quote"; quoteButton.inject(bar); $(quoteButton).addEvent('click',function(e){ e = new Event(e).stop(); if($('quotePopup') != null){ DoKillSlide('quotePopup'); return; } var qContainer = new Element('div'); qContainer.setStyle('width', textarea.getSize().x+'px'); qContainer.addClass('editDropdown'); qContainer.setAttribute('id', 'quotePopup'); qContainer.set('html', 'some quote shit goes here, wee
'); qContainer.inject(bar, 'after'); var quotePSlider = new Fx.Slide('quotePopup', {}).hide(); var qBox = new Element('textarea'); qBox.inject(qContainer, 'after'); quotePSlider.slideIn(); //if(name != null && name != '') // AddBBCodeToTextarea(textarea, '[quote='+name+']', '[/quote]'); }); */ //inject the tool bar //bar.fade('hide'); bar.setStyle('position', 'absolute'); bar.setStyle('display', 'inline'); var top = textarea.getCoordinates().top.toInt(); var left = textarea.getCoordinates().left.toInt(); bar.setStyle('top', top - 30); bar.setStyle('left', left); bar.setStyle('width', textarea.getSize().x); bar.setStyle('visibility', 'visible'); bar.setStyle('display', 'none'); bar.inject(document.body, 'after'); bar.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); bar.reveal(); //bar.fade('in'); }else{ //bar = $('editBar'); } } function DestroyEditbar(el) { if($('editBar') != null) $('editBar').dispose(); if($('atlinkPopup') != null) $('atlinkPopup').dispose(); } function AddBBCodeToTextarea(textarea, startTag, endTag) { var len = textarea.value.length; var start = textarea.selectionStart; var end = textarea.selectionEnd; var sel = textarea.value.substring(start, end); var replace = startTag + sel + endTag; textarea.value = textarea.value.substring(0,start) + replace + textarea.value.substring(end,len); textarea.focus(); } function ToggleLogRegBox() { var scrollScreen = new Fx.Scroll(window).toTop(); var p = new Fx.Reveal($('logRegBox'), {duration: 300, mode: 'vertical', transition: Fx.Transitions.Sine.easeOut}); p.reveal(); } function KillSlideEditPops() { if($('atlinkPopup') != null) DoKillSlide('atlinkPopup'); if($('postlinkPopup') != null) DoKillSlide('postlinkPopup'); if($('emotePopup') != null) DoKillSlide('emotePopup'); } function SetCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } function GetCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } var neededForBlurbSubmit; function DisplayNeededChars(el) { neededForBlurbSubmit = 15 - el.value.length; if(neededForBlurbSubmit <= 0){ $$('span.BlurbSizeCount').set('html','Your post is long enough.'); } else{ $$('span.BlurbSizeCount').set('html', neededForBlurbSubmit + " characters needed."); } } function ReportPost(id) { if(GetCookie('logPass') == '') DoLoginPrompt('report offensive posts'); else{ if(confirm("Are you sure you want to report this post? If you do report it, a moderator will be notified.")) loadStatusBar("/action/5003&id="+id); } } function RefreshPost(id) { var url = "/action/5004&id="+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to get page title, the link may be broken.", "error"); }, onRequest: function() { $('postContainer_'+id).fade('out'); }, onComplete: function(response) { $('postContainer_'+id).set('html', response); $('postContainer_'+id).fade('in'); } }).send(); } function ValidateAndContribute(form) { if($('blurb') != null) { if($('blurb').value.length < 15) { ShowMessage("You need to type " + (15 + $('blurb').value.length ) + " more characters to contribute to this huddle.", "info"); return false; } } if($('postTitle').value.length < 10) { ShowMessage("Posts require a title that is longer than 10 characters.", "info"); return false; } var scrollFX = new Fx.Scroll(document.body); $(form).set('send', { onRequest: function() { //$('submitForm').dissolve(); $('submitButton').disabled = 1; if($('editBar') != null) KillEditBar(); //$('demo-actions').dissolve(); $('submitButton').value = 'uploading...'; $$('.file-remove').each(function(el) { el.dissolve(); }); if($('attachLink') != null) $('attachLink').dissolve(); $('searchStuff').dissolve(); //$('attachHeader').set('html', 'Posting in progress...'); //$('attachSubtext').set('html', 'Your post is being put into the huddle.'); scrollFX.toTop(); uploadCategory = $('postCategory').value; }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); if($('pollForm').getAttribute('action') == 'doit') { var req = new Request({ method: 'post', url: "/action/addpoll", data: { 'postID' : json.get('id'), 'question' : $('pollQuestion').value, 'pollAns1' : $('pollAns1').value, 'pollAns2' : $('pollAns2').value, 'pollAns3' : $('pollAns3').value, 'pollAns4' : $('pollAns4').value, 'pollAns5' : $('pollAns5').value }, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { }, onSuccess: function(response) { } }).send(); } if($('demo-list').innerHTML != '') { $('demo-status').reveal(); var text; if($('blurb') == null) text = ''; else text = $('blurb').value; up.setOptions({data: { 'category': $('postCategory').value, 'blurb': text, 'username': '', 'password': '', 'id': json.get('id'), 'poster': json.get('poster') } }); up.upload(); }else{ /*Owner is not returned as the actual owner to save */ if(json.get('owner') == '') { $('contributeForm').nix(false); $('submitForm').nix(false); $('submitButton').dispose(); $('demo-list').nix(false); $('attachmentTable').nix(false); $('contributeStatus').set('html', 'Post Successful! No one leads this huddle.
You can lead it'); $('contributeStatus').load('/js/ajax_data/post_succesful_no_leader.php?huddle=' + urlencode($('postCategory').value)); }else{ window.location = '/comments/' + json.get('id'); //$('contributeStatus').set('html', 'Post successful! Check it out in the huddle.
'); //$('contributeStatus').load('/js/ajax_data/post_successful_no_attach.php?huddle=' + urlencode($('postCategory').value)); } /* $('contributeForm').nix(false); $('submitForm').nix(false); $('submitButton').dispose(); $('demo-list').nix(false); $('attachmentTable').nix(false); */ //$('contributeStatus').set('html', 'Your post has been made! Check it out in the huddle.'); //$('contributeStatus').load('/js/ajax_data/post_successful_no_attach.php'); } }, onError: function() { ShowMessage("An unknown error happend while trying to make your post, please try again.", "error"); $('submitButton').disabled = 0; $('submitButton').value = "post"; }, onFailure: function () { ShowMessage("Sorry, there was an error. Please try again.", "error"); $('submitButton').disabled = 0; $('submitButton').value = "post"; /* $('submitForm').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('submitForm').reveal(); $('submitButton').disabled = true; //$('demo-actions').reveal(); //$('demo-actions').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('submitButton').value = 'retry'; $('attachLink').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('attachLink').reveal(); */ } }); $(form).send(); //up.setOptions({data: $('contributeForm').toQueryString()}); //$('contributeForm').nix(false); //$('contributeStatus').set('html', "Making Post, please wait."); return true; } function ForgetPostReports(id) { loadStatusBar("/action/1005&id="+id); prettyDestroy("postContainer_"+id, true); } function SlideShow(el) { var p = new Fx.Slide(el, { duration:400, transition: Fx.Transitions.Quart.easeIn}); p.toggle(); } /* function AddAttachment(el) { if(totalAttachments >= 20) ShowMessage("You have reached the limit for file uploads.", "info"); else{ totalAttachments++; var s = new Element('span'); var inp = new Element('input'); s.setStyle("display", "block"); var originalINPProps = $('attachment').getProperties('title', 'type', 'name', 'class'); inp.setProperties(originalINPProps); s.set('html', totalAttachments + '. '); inp.injectInside(s, 'after'); s.injectInside(el, 'after'); } } */ function SubmitForm(f) { $(f).set('send', { onRequest: function() { }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); if(json.get('status') == '1') { if(json.get('message')) ShowMessage(json.get('message'), "success"); if(json.get('redirect')) { ShowMessage("REDIRECTING: " + json.get('redirect'), "success"); window.location=json.get('redirect'); } }else if(json.get('status') == '0'){ ShowMessage(json.get('message'), "error"); }else{ ShowMessage(response, "success"); } }, onFailure: function () { ShowMessage("Sorry, there was an error. Please try again.", "error"); } }); $(f).send(); } function SetCookieTime(id, type, time) { SetCookie("lastlook_"+type+"_"+id, time, 365); } function MooRequest(url, w, h) { var x = new MooDialog.Request(url,{}, { size: {width: w, height: h}, id: 'mooReq'}) } function DoLoginPrompt(todo) { if(todo == undefined) todo = "do that"; new MooDialog.Confirm3("You need an account to " + todo + ".", function() { ToggleLogRegBox(); $('logRegLogin').dissolve(); $('logRegRegister').reveal(); }, ToggleLogRegBox, function() {}, { title : 'Sorry, you need to be logged in!', closeButton : false, size: {width: 360, height: 340}, okText: 'create account', cancelText2: 'i like lurking', cancelText: 'login'} ) /* new MooDialog.Confirm("You need to be logged in to " + todo + ". \n\nDo you want to login or register now?", ToggleLogRegBox, function() {}, { size: {width: 380, height: 140}, okText: 'login or register', cancelText: 'maybe later pal'}); */ /* var vsLogRegBoxV = new Fx.Slide('logRegBox'); var scrollFX = new Fx.Scroll(window).toTop(); $('logRegBox').show(); vsLogRegBoxV.toggle(); */ } function RemoveHTMLTags(el) { var strInputCode = el.innerHTML; var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, ""); return strTagStrippedText; } function DoKillSlide(element){ var killSlide = new Fx.Slide(element, { duration:400, transition: Fx.Transitions.Quart.easeOut}).chain( function(){ $(element).dispose();}); killSlide.slideOut(); } /** * FancyUpload Showcase * * @license MIT License * @author Harald Kirschner * @copyright Authors */ var up; var totalAttachments = 0; var totalAttachmentSize = 0; var totalAttachmentsUploaded = 0; function InitUploader() { if($('contributeForm') == null) return; up = new FancyUpload2($('demo-status'), $('demo-list'), { id: 'swiffer', url: $('contributeForm').action, params: { wmode: 'transparent', bgcolor: '#ff3300' }, fieldName: 'Filedata', path: '/js/fure/Swiff.Uploader.swf', limitSize: 10240000, // 2Mb onLoad: function() { $('demo-status').removeClass('hide'); $('demo-fallback').destroy(); }, typeFilter: { 'All Supported (Images, Flash, Documents, Audio, Videos, Torrents)': '*.dae; *.avi; *.swf; *.flv; *.fla; *.doc; *.docx; *.docm; *.dotx; *.dotm; *.pptx; *.ptt; *.doc; *.torrent; *.txt; *.c; *.cpp; *.asm; *.text; *.pdf; *.jpg; *.jpeg; *.gif; *.png; *.mp3; *.mid' }, selectSuccess: function(files) { files.each(function(file) { if(totalAttachments > 20) //if(totalAttachments >= 2) { ShowMessage("You can not attach any more files to this post.", "info"); file.remove(); return; } if(file.size > 10240000) { ShowMessage("That file is too big! Just like a certain someone who runs Facebook's ego is.", "info"); file.remove(); return; } if(totalAttachmentSize > 16777216) { ShowMessage("All of your attachments are too big for this post. Remove some attachments or try and not upload such a large attachment.", "info"); file.remove(); return; } totalAttachments++; totalAttachmentSize += file.size; }, this); }, /** * Is called when files were not added, "files" is an array of invalid File classes. * * This example creates a list of error elements directly in the file list, which * hide on click. */ fileInvalid: function(files) { alert('bad file ' + files); $('submitForm').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('submitForm').reveal(); ShowMessage("There was an error adding attachments to your post.", "error"); files.each(function(file) { new Element('li', { 'class': 'validation-error', html: file.validationErrorMessage || file.validationError, title: MooTools.lang.get('FancyUpload', 'removeTitle'), events: { click: function() { this.destroy(); } } }).inject(this.list, 'top'); }, this); }, /** * This one was directly in FancyUpload2 before, the event makes it * easier for you, to add your own response handling (you probably want * to send something else than JSON or different items). */ fileComplete: function(file, response) { var json = new Hash(JSON.decode(response, true) || {}); if (json.get('status') == '1') { file.element.addClass('file-success'); file.info.set('html', 'File was attached!'); //$('submitButton').dispose(); //$('demo-list').nix(false); totalAttachmentsUploaded++; //alert("HI BABY " + totalAttachmentsUploaded + " OF " + up.fileCount); if(up.fileCount == totalAttachmentsUploaded) { $('demo-status').nix(true); if(json.get('owner') == '') $('contributeStatus').set('html', 'No one leads this Huddle. You can lead it'); else window.location = "/comments/" + json.get('id'); //$('contributeStatus').set('html', 'Your post has been made and your files were attached! Check it out in the Huddle.
'); }else{ $('submitForm').nix(false); } } else { file.element.addClass('file-failed'); file.info.set('html', 'An error occured: ' + (json.get('error') ? (json.get('error') + ' #' + json.get('code')) : response)); $('submitButton').disabled = false; $('submitButton').value = 'retry'; } }, /** * onFail is called when the Flash movie got bashed by some browser plugin * like Adblock or Flashblock. */ onFail: function(error) { switch (error) { case 'hidden': // works after enabling the movie and clicking refresh alert('To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).'); break; case 'blocked': // This no *full* fail, it works after the user clicks the button alert('To enable the embedded uploader, enable the blocked Flash movie (see Flashblock).'); break; case 'empty': // Oh oh, wrong path alert('A required file was not found, please be patient as we fix this.'); break; case 'flash': // no flash 9+ :( alert('To enable the embedded uploader, install the latest Adobe Flash plugin.') break; default: ShowMessage('There was an unknown error.', "error"); } }, // The changed parts! debug: false, // enable logs, uses console.log target: 'mnuAttach' // the element for the overlay (Flash 10 only) }); } window.addEvent('load', function() { if($('contributeForm') == null) return; // For testing, showing the user the current Flash version. //document.getElement('h3 + p').appendText(' Detected Flash ' + Browser.Plugins.Flash.version + '!'); InitUploader(); /** * Various interactions */ $('mnuAttach').addEvent('click', function() { /** * Doesn't work anymore with Flash 10: swiffy.browse(); * FancyUpload moves the Flash movie as overlay over the link. * (see opeion "target" above) */ up.browse(); //$('demo-status').reveal(); return false; }); /** * The *NEW* way to set the typeFilter, since Flash 10 does not call * swiffy.browse(), we need to change the type manually before the browse-click. */ /* $('demo-select-images').addEvent('change', function() { var filter = null; if (this.checked) { filter = {'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png'}; } up.options.typeFilter = filter; }); */ $('demo-clear').addEvent('click', function() { totalAttachments = 0; totalAttachmentSize = 0; up.removeFile(); return false; }); /* $('demo-upload').addEvent('click', function() { up.upload(); return false; }); */ }); /* mooSocialize - bookmark tool �2008 artViper designstudio - all rights reserved */ /* information about this tool and other widgets: info@artviper.net */ /* the header 'artViper's social bookmark widget has not to be disposed */ /* same goes for the link to this tool */ var overlay; var LoggingMeInAlready = false; function LogMeIn(form) { if(LoggingMeInAlready) ShowMessage("You are currently being logged in, please wait for the process to finish.", "busy"); else { LoggingMeInAlready = true; var req = new Request({ method: 'post', url: '/redir.php?action=2', data: { 'password' : $('logPass').value, 'username' : $('logUsername').value, 'rememberME' : $('rememberME').checked }, onFailure: function() { //$(form).setAttribute('disabled', 'false'); ShowMessage("There was a problem logging into your account.", "error"); LoggingMeInAlready = false; }, onRequest: function() { $(form).setAttribute('disabled', 'true'); ShowMessage("Logging in...", "busy"); }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); if(json.get('status')){ var setup = false; var url = ''; if(json.get('userTitle') == '') url += '&userTitle'; if(json.get('userBlurb') == '') url += '&userBlurb'; if(json.get('joinedHuddles') == 0) url += '&joinedHuddles'; if(json.get('postCount') == 0) url += '&postCount'; if(json.get('commentCount') == 0) url += '&commentCount'; if(json.get('data') == false) url += '&data'; if(url == '') location.reload(true); else{ window.location = '/'; } }else{ HideStatusBar(); LoggingMeInAlready = false; new MooDialog.Alert(json.get('message')); } } }).send(); } } window.addEvent('domready',function(){ $$('.socializer').addEvent('click',function(e){ DisplaySocializer(this); }); }) function DisplaySocializer(host) { if(document.getElementById('containerx') == null){ // define container pos var top = host.getCoordinates().top.toInt(); var height = host.getCoordinates().height.toInt(); var left = host.getCoordinates().left.toInt(); var pos = top+height; var div = new Element('div'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('soc_container'); div.setAttribute('id','containerx'); div.injectInside(document.body); $(div).addEvent('blur',function(){ host.dispose(); }) // close button var closeme = new Element('img'); closeme.src="/js/moodialog/css/dialog-close.png"; closeme.setAttribute('id','close'); closeme.injectInside(div); closeme.addEvent('click',function(){ div.nix(true); }) var title= escape(host.title); //var url = escape(document.location.href); var url = urlencode(host.href); var name = new Element('h5'); name.innerHTML = 'Pass this along to your friends.'; name.injectInside(div); var left = new Element('div'); left.addClass('soc_left'); left.injectInside(div); var fb = new Element('iframe'); //fb.setAttribute('src', 'http://www.facebook.com/plugins/like.php?href='+url+'&layout=button_count&show_faces=false&width=60&action=like&font&colorscheme=dark&height=21'); fb.setAttribute('src', 'http://www.facebook.com/plugins/like.php?href='+url+'&layout=button_count&show_faces=false&width=60&action=like&font&colorscheme=dark&height=21'); fb.setAttribute('scrolling', 'no'); fb.setAttribute('frameborder', '0'); fb.setAttribute('allowTransparency', 'true'); fb.setStyle('border', 'none'); fb.setStyle('overflow', 'hidden'); fb.setStyle('width', '60px'); fb.setStyle('height', '21px'); fb.setStyle('display', 'block'); fb.injectInside(left); // del.icio.us var img = new Element('img'); img.alt = 'send to del.icio.us'; img.src = '/images/delicious.png'; img.injectInside(left); var myLink = new Element('a'); myLink.href = 'http://del.icio.us/post?url='+url+'&title='+title; myLink.title = 'send to del.icio.us'; myLink.innerHTML = 'del.icio.us'; myLink.injectInside(left); // digg.com var img = new Element('img'); img.alt = 'send to digg'; img.src = '/images/digg.png'; img.injectInside(left); var myLink = new Element('a'); myLink.href = 'http://digg.com/submit?phase=2&url='+url+'&title='+title; myLink.title = 'send to del.icio.us'; myLink.innerHTML = 'digg'; myLink.injectInside(left); // reddit.com var img = new Element('img'); img.alt = 'send to reddit.com'; img.src = '/images/reddit.png'; img.injectInside(left); var myLink = new Element('a'); myLink.href = 'http://reddit.com/submit?url='+url+'&title='+title; myLink.title = 'send to reddit'; myLink.innerHTML = 'reddit'; myLink.injectInside(left); // put in right side container var right = new Element('div'); right.addClass('soc_left'); right.injectInside(div); // stumpleupon.com var img = new Element('img'); img.alt = 'send to stumbleupon'; img.src = '/images/stumbleupon.png'; img.injectInside(right); var myLink = new Element('a'); myLink.href = 'http://www.stumbleupon.com/refer.php?url='+url+'&title='+title; myLink.title = 'send to stumbleupon'; myLink.innerHTML = 'stumbleupon'; myLink.injectInside(right); // google.com var img = new Element('img'); img.alt = 'send to google'; img.src = '/images/google.png'; img.injectInside(right); var myLink = new Element('a'); myLink.href = 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+url+'&title='+title; myLink.title = 'send to google'; myLink.innerHTML = 'google'; myLink.injectInside(right); // squidoo.com var img = new Element('img'); img.alt = 'send to squidoo.com'; img.src = '/images/squidoo.png'; img.injectInside(right); var myLink = new Element('a'); myLink.href = 'http://www.squidoo.com/lensmaster/bookmark?'+url myLink.title = 'send to squidoo'; myLink.innerHTML = 'squidoo'; myLink.injectInside(right); // ask.com var img = new Element('img'); img.alt = 'send to ask.com'; img.src = '/images/ask.png'; img.injectInside(right); var myLink = new Element('a'); myLink.href = 'http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&t=webpages&title='+title+'&url='+url; myLink.title = 'send to ask'; myLink.innerHTML = 'ask'; myLink.injectInside(right); // ask.com var img = new Element('img'); img.alt = 'send to slashdot.org'; img.src = '/images/slashdot.png'; img.injectInside(right); var myLink = new Element('a'); myLink.href = 'http://slashdot.org/bookmark.pl?title='+title+'&url='+url; myLink.title = 'send to slashdot'; myLink.innerHTML = 'slashdot'; myLink.injectInside(right); // add send to friend var con = new Element('div'); con.addClass('soc_send_friend'); con.injectInside(div); var name = new Element('small'); name.innerHTML = 'When you share a link from this popup and you\'re logged in,
anyone who signs up within a week after visiting your
link will count as a referral for you.'; name.injectInside(div); // /* var ptag = new Element('p'); ptag.innerHTML = 'Send this article to a friend'; ptag.injectInside(con); ptag.setStyle('color','#000'); var form = new Element('form'); form.setAttribute('name','friendform'); form.setAttribute('id','friendform'); var inp = new Element('input'); inp.setAttribute('type','text'); inp.setAttribute('id','email_friend'); var sendme = new Element('input'); sendme.setAttribute('type','submit'); sendme.setAttribute('class', 'button'); sendme.setAttribute('value',"send"); form.injectInside(con); inp.injectInside(form); sendme.injectAfter(inp); $('friendform').addEvent('submit',function(el){ el = new Event(el).stop(); $(con).addClass('wait'); var input = inp.value; new Ajax('send_to_friend.php?email='+input+'&title='+title+'&url='+url, { method:'get', update:$(con), onComplete:function(){ $(con).disposeClass('wait'); }}).request(); return false; }) */ // fade in div.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); div.reveal(); // div.effect('opacity',{duration:500, wait:true, transition:Fx.Transitions.linear }).chain(function(){ // }).start(0,1); var originalColor; $$('.soc_left a').each(function(el) { var fx = new Fx.Morph(el,{ duration:400, link:'cancel' }); el.addEvents({ 'mouseenter': function() { originalColor = el.getStyle('color'); el.tween('color', '#fff'); }, 'mouseleave': function() { el.tween('color', originalColor); } }); }); // open new window via ajax $$('.soc_left a').addEvent('click',function(e){ e = new Event(e).stop(); var address = this.href; var scTop = window.getScrollTop().toInt(); // is it a crap IE ? nav = navigator.appName; if(nav.indexOf('Microsoft') != -1){ if(navigator.appVersion.indexOf('MSIE 6') != -1 || navigator.appVersion.indexOf('MSIE 7') != -1){ var width = document.body.clientWidth; } }else{ var width = window.innerWidth.toInt(); } var left = (width - 780) /2; var wind = new Element('div', { styles: { 'top':scTop+20, 'opacity':'1.0', 'width':'780px', 'left':left + 'px', 'position':'absolute' } }) wind.addClass('open_window'); var closeX = new Element('img'); closeX.src = "/js/moodialog/css/dialog-close.png"; //closeX.addClass('close'); closeX.addEvent('click',function(){ wind.dispose(); }) closeX.injectInside(wind); var c = new Element('iframe'); c.src = address; c.setStyle('width','780px'); c.setStyle('height','500px'); c.setStyle('border','none'); c.setStyle('margin','0 auto'); c.injectInside(wind); wind.injectInside(document.body); }) }else{ var eff = new Fx.Morph('containerx', { duration: 500, wait:true, transition:Fx.Transitions.linear }).chain(function(){ $('containerx').dispose(); }); eff.start({ 'opacity':[0,1] }); } } var reqT; var reqT2; var height=-40; var HideTime; function ShowMessages() { var message = gup('msg'); if(message.length > 5) { $("popupmsg").innerHTML=urldecode(message); showStatusBar(height); HideTime += 4500; setTimeout("autoHideStatusBar()", 5000); } } var popup; function ShowMessage(message, type) { if(message.length > 5) { //new MooDialog.Alert(urldecode(message), {size: {width: 566, height: 350}}); if($('popup') == null) { popup = new Element('div'); popup.addClass('popup'); popup.addClass('MooDialog'); popup.set('id', 'popup'); var container = new Element('div'); container.addClass('MooContentPane'); var icon = new Element('span'); icon.set('id', 'popupIcon'); if(type == "error") { icon.set('class', 'error'); }else if(type == "info"){ icon.set('class', 'info'); }else if(type == "busy"){ icon.set('class', 'busy'); }else if(type == "success"){ icon.set('class', 'success'); } icon.injectInside(container); var m = new Element('span'); m.set('id', 'popupmsg'); m.set('html', urldecode(message)); m.injectInside(container); var c = new Element('span'); c.addClass('popupclose'); c.addEvent('click',function(e){ popup.fade('out'); $(popup).set('morph', {duration: 250, transition: Fx.Transitions.Expo.easeIn}); $(popup).morph({ bottom: -150}); }); c.injectInside(container); container.injectInside(popup); popup.injectInside(document.body); } $(popup).fade('in'); $(popup).set('morph', {duration: 250, transition: Fx.Transitions.Expo.easeOut}); $(popup).morph({ bottom: -20}); } } function showStatusBar() { if(height >= -1) return; height+=3; document.getElementById("popup").style.bottom=height+"px"; setTimeout("showStatusBar(" + height + ")", 1); } function HideStatusBar() { $('popup').fade('out'); //document.getElementById("popupmsg").innerHTML=urldecode(message); var height = $('popup').getStyle("height").toInt() + $('popup').getStyle("padding-top").toInt() + $('popup').getStyle("padding-bottom").toInt(); height = height * -1; $('popup').set('morph', {duration: 400, transition: Fx.Transitions.Expo.easeIn}); $('popup').morph({ bottom: height}); } function autoHideStatusBar() { HideTime -= 5000; if(HideTime <=0) hideStatusBar(); } /* *Loads files into the statusbar and shows it. */ function loadStatusBar(url) { var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onRequest: function() { }, onComplete: function(response) { ShowMessage(response); } }).send(); } function loadStatusBarDone(url) { if(reqT.status == 200) { ShowMessage(reqT.responseText); }else{ ShowMessage("Ajax Error 2!"); } } //thank you lobo //http://www.netlobo.com/url_query_string_javascript.html function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } function urldecode( str ) { // http://kevin.vanzonneveld.net // + original by: Philip Peterson // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: AJ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Brett Zamir (http://brett-zamir.me) // + input by: travc // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Lars Fischer // + input by: Ratheous // % note 1: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/ // * example 1: urldecode('Kevin+van+Zonneveld%21'); // * returns 1: 'Kevin van Zonneveld!' // * example 2: urldecode('http%3A%2F%2Fkevin.vanzonneveld.net%2F'); // * returns 2: 'http://kevin.vanzonneveld.net/' // * example 3: urldecode('http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'); // * returns 3: 'http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a' var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr=''; var replacer = function(search, replace, str) { var tmp_arr = []; tmp_arr = str.split(search); return tmp_arr.join(replace); }; // The hash_map is identical to the one in urlencode. hash_map["'"] = '%27'; hash_map['('] = '%28'; hash_map[')'] = '%29'; hash_map['*'] = '%2A'; hash_map['~'] = '%7E'; hash_map['!'] = '%21'; hash_map['%20'] = '+'; hash_map['\u00DC'] = '%DC'; hash_map['\u00FC'] = '%FC'; hash_map['\u00C4'] = '%D4'; hash_map['\u00E4'] = '%E4'; hash_map['\u00D6'] = '%D6'; hash_map['\u00F6'] = '%F6'; hash_map['\u00DF'] = '%DF'; hash_map['\u20AC'] = '%80'; hash_map['\u0081'] = '%81'; hash_map['\u201A'] = '%82'; hash_map['\u0192'] = '%83'; hash_map['\u201E'] = '%84'; hash_map['\u2026'] = '%85'; hash_map['\u2020'] = '%86'; hash_map['\u2021'] = '%87'; hash_map['\u02C6'] = '%88'; hash_map['\u2030'] = '%89'; hash_map['\u0160'] = '%8A'; hash_map['\u2039'] = '%8B'; hash_map['\u0152'] = '%8C'; hash_map['\u008D'] = '%8D'; hash_map['\u017D'] = '%8E'; hash_map['\u008F'] = '%8F'; hash_map['\u0090'] = '%90'; hash_map['\u2018'] = '%91'; hash_map['\u2019'] = '%92'; hash_map['\u201C'] = '%93'; hash_map['\u201D'] = '%94'; hash_map['\u2022'] = '%95'; hash_map['\u2013'] = '%96'; hash_map['\u2014'] = '%97'; hash_map['\u02DC'] = '%98'; hash_map['\u2122'] = '%99'; hash_map['\u0161'] = '%9A'; hash_map['\u203A'] = '%9B'; hash_map['\u0153'] = '%9C'; hash_map['\u009D'] = '%9D'; hash_map['\u017E'] = '%9E'; hash_map['\u0178'] = '%9F'; for (unicodeStr in hash_map) { hexEscStr = hash_map[unicodeStr]; // Switch order when decoding ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing } // End with decodeURIComponent, which most resembles PHP's encoding functions ret = decodeURIComponent(ret); return ret; } function urlencode(str) { str = escape(str); str = str.replace('+', '%2B'); str = str.replace('%20', '+'); str = str.replace('*', '%2A'); str = str.replace('/', '%2F'); str = str.replace('@', '%40'); return str; } window.addEvent('domready',function(){ $$('.userPopup').each(function(el) { el.addEvents({ 'click': function(e) { e.stop; DisplayUserPopupMenu(el, document.body); } }); }); $$('.userPopup').each(function(el) { el.addEvents({ 'dblclick': function() { window.location = el.href; } }); }); }) function LaunchPostingHelp() { var x = new MooDialog.Request('/posthelp.htm',{}, { size: {width: 600, height: 480}}); } function KillAll(name) { $$(name).each(function(el) { $(el).nix(true); }); } var userPopupElem; var UserPopupContainer; function DisplayUserPopupMenu(el, targetInject) { var user = el.innerHTML.trim(); var url = '/action/1101&poster='+user; var req = new Request({ method: 'get', url: url, data: '', onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { KillAll('.soc_container'); var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; UserPopupContainer = new Element('div'); UserPopupContainer.setStyle('top',pos); UserPopupContainer.setStyle('left',left); UserPopupContainer.addClass('soc_container'); UserPopupContainer.set('html', 'Loading user profile.'); UserPopupContainer.setAttribute('id', 'popup'); UserPopupContainer.injectInside(targetInject); UserPopupContainer.reveal();}, onSuccess: function(response) { UserPopupContainer.set('html', response); } }).send(); /* var user = myElem.innerHTML.trim(); userPopupElem = new MooDialog.Request('/action/1101&poster='+user,{}, { size: { width: 400, height: 380 } } ); */ } function LoadUserMenu(myElem, user) { var target = 'userPopupItems'; if(user == undefined) user = myElem.innerHTML.trim(); //var userPopSlide = new Fx.Slide('containerx', { //duration:400, transition: Fx.Transitions.Quart.easeIn}).hide(); var req = new Request({ method: 'get', url: '/action/1101&poster='+user, data: { 'poster' : user }, onRequest: function() { $('userPopupItems').set('html', 'loading...'); }, onFailure: function(){ ShowMessage("There was a problem loading a user's menu, pal.", "error"); }, onComplete: function(response) { $('userPopupItems').set('html', response); new Fx.Reveal($('containerx')).reveal(); //userPopSlide.slideIn(); //$(target).fade('in'); //$(target).set('morph', {duration: 1000, transition: Fx.Transitions.Elastic.easeIn}); //$(target).morph({height: auto, width: auto}); } }).send(); } function LaunchInviter(name, element) { if(element == null) element = $('containerx'); var req = new Request({ method: 'get', url: '/action/400&i='+name, data: { 'i' : name }, onRequest: function() { $(element).set('html', 'loading...'); }, onSuccess: function(response) { //$(element).fade('hide'); $(element).set('html', response); $(element).set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $(element).reveal(); //inviterPopSlide.slideIn(); //$(element).fade('in'); } }).send(); } function SendInvite(category, invite) { //action/401&category=$category&i=$invite var req = new Request({ method: 'get', url: '/redir.php?action=401&category='+category+"&i"+invite, data: { 'category' : category, 'i' : invite }, onRequest: function() { ShowMessage("Sending invitation...", "busy"); }, onFailure: function(){ ShowMessage("Your invitation got lost somewhere.", "error"); }, onSuccess: function(response) { ShowMessage(response, "success"); //$(target).set('morph', {duration: 1000, transition: Fx.Transitions.Elastic.easeIn}); //$(target).morph({height: auto, width: auto}); } }).send(); } function LaunchModder(name, element) { if(element == null) element = $('containerx'); var req = new Request({ method: 'get', url: '/action/420&i='+name, data: { 'do' : '1' }, onRequest: function() { $(element).set('html', 'loading...'); }, onSuccess: function(response) { $(element).set('html', response); $(element).set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $(element).reveal(); } }).send(); } function MakeMod(category, name, element) { if(element == null) element = $('containerx'); var req = new Request({ method: 'get', url: '/action/421&i='+name+"&category="+category, data: { 'do' : '1' }, onRequest: function() { $(element).set('html', 'loading...'); }, onComplete: function(response) { $(element).set('html', response); $(element).set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $(element).reveal(); } }).send(); } function LaunchBanTool(name, category, element) { if(element == null) element = $('containerx'); name = escape(name); category = escape(category); var req = new Request({ method: 'get', url: '/action/1003&i='+name+"&category="+category, data: { 'do' : '1' }, onRequest: function() { $(element).set('html', 'loading...'); }, onComplete: function(response) { $(element).set('html', response); $(element).set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $(element).reveal; } }).send(); } window.addEvent('domready',function(){ $$('.categoryPopup').each(function(el) { el.addEvents({ 'dblclick': function() { window.location = el.href; } }); }); $$('.categoryPopup').each(function(el) { el.addEvents({ 'click': function(e) { e.stop(); var poster = $(el).getAttribute('poster'); var pid = $(el).getAttribute('pid'); DisplayCategoryPopupMenu(el, el.innerHTML, poster, pid); } }); }); if($('postCategoryPopup') != null) { $('postCategoryPopup').addEvent('keyup', function(k){ if(k.key == 'esc') $('postCategoryPopup').fade('out'); }); } }); window.addEvent('keyup',function(keycode){ if(keycode.key == 'esc') { //kill whatever the fuck is on our screen if it exists. if($('tooltip') != null) $('tooltip').nix(true); if($('containerx') != null) $('containerx').nix(true); if($('postCategoryPopup') != null) prettyDestroy($('postCategoryPopup'), 'kindof'); if($('editBar') != null) KillEditBar(); KillSlideEditPops(); } }); var CategoryPopupContainer; function DisplayCategoryPopupMenu(el, text, poster, pid) { var url = '/action/1150&category='+text.trim()+'&poster='+poster+'&id='+pid; var req = new Request({ method: 'get', url: url, data: '', onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { KillAll('.soc_container'); var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; CategoryPopupContainer = new Element('div'); CategoryPopupContainer.setStyle('top',pos); CategoryPopupContainer.setStyle('left',left); CategoryPopupContainer.addClass('soc_container'); CategoryPopupContainer.set('html', 'Grabbing Huddle information.'); CategoryPopupContainer.setAttribute('id', 'popup'); CategoryPopupContainer.injectInside(document.body); CategoryPopupContainer.reveal(); }, onSuccess: function(response) { CategoryPopupContainer.set('html', response); } }).send(); /* new MooDialog.Request('/action/1150&category='+text.trim()+'&poster='+poster+'&id='+pid, {}, { size: {width: 520, height: 220} } ); */ } var req; var req2; function loadURL(url, target, opacity, leaveOld, data) { //$(target).set('morph', {duration: 10000, transition: Fx.Transitions.Elastic.easeIn}); //$(target).set('fade', {duration: 10000, transition: Fx.Transitions.Elastic.easeIn}); if($('editBar') != null) $('editBar').dispose(); if(data == null) data = {do : '1'}; var req = new Request({ method: 'get', url: url, data: data, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { if(opacity == undefined) $(target).fade('out'); else $(target).fade(opacity); }, onSuccess: function(response) { if(opacity == undefined) $(target).fade('hide'); if(leaveOld == undefined) $(target).set('html',response); else if(leaveOld == true) document.getElementById(target).innerHTML += response; else $(target).set('html',response); //$(target).set('html', response); if(opacity == undefined) $(target).fade('in'); else $(target).fade(opacity); /* var div = new Element('div'); div.setAttribute('id','dicks'); div.set('html', response); div.injectInside(target); */ //$(target).fade('in'); //$(target).set('morph', {duration: 1000, transition: Fx.Transitions.Elastic.easeIn}); //$(target).morph({height: auto, width: auto}); } }).send(); /* document.getElementById(target).innerHTML = "Loading..."; if(window.XMLHttpRequest) { req = new XMLHttpRequest(); }else if(window.ActiveXObject){ req = new ActiveXObject("Microsoft.XMLHTTP");; }else{ alert('Sorry, your browser does not support AJAX.\nPlease upgrade to Firefox.'); } if(req != undefined) { if(target != null) req.onreadystatechange = function() {loadURLDone(url, target);}; req.open("GET", url, true); req.send(""); } return false; */ } function loadURLDone(url, target) { if(req.status == 200) { document.getElementById(target).innerHTML = req.responseText; }else{ document.getElementById(target).innerHTML = "Ajax Error 2!"; } } function prettyDestroy(target, destroy) { if($(target) != null) { $(target).fade('out'); if(destroy == true) { setTimeout("prettyObliterate('"+target+"')", 500); }else if(destroy == "kindof"){ }else setTimeout("document.getElementById('"+target+"').innerHTML=''", 500); } } function prettyObliterate(target) { //var height = $(target).getStyle('height'); //var width = $(target).getStyle('width'); //$(target).set('morph', {duration: 1000, transition: Fx.Transitions.Elastic.easeOut}); //$(target).morph({height: 0, width: 0}); //$(target).set('tween', {duration: 'long'}); //$(target).tween('border', '6px solid #36f'); if($(target) != null) $(target).dispose(); //document.getElementById(target).innerHTML = ''; } function touchURL(url) { if(window.XMLHttpRequest) { req = new XMLHttpRequest(); }else if(window.ActiveXObject){ req = new ActiveXObject("Microsoft.XMLHTTP");; }else{ alert('Sorry, your browser does not support AJAX.\nPlease upgrade to Firefox.'); } if(req != undefined) { req.open("GET", url, true); req.send(""); } return false; } function DeletePost(id) { var reallyDelete = confirm("Are you sure you want to delete this post?"); if(reallyDelete) { var url = '/action/1002&id='+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to delete post. Please try again.", "error"); }, onRequest: function() { }, onSuccess: function(response) { ShowMessage(response, "success"); RefreshPost(id); } }).send(); } } function UndeletePost(id) { var reallyDelete = confirm("Are you sure you want to undelete this post?"); if(reallyDelete) { var url = '/action/1004&id='+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to undelete post. Please try again.", "error"); }, onRequest: function() { }, onComplete: function(response) { ShowMessage(response, "success"); RefreshPost(id); } }).send(); } } function ElementDispose(id) { $(id).dispose() } function BanUser(user, category) { loadStatusBar('/action/1001&user='+user+'&category='+category); } function DisplayTooltip(elem, data) { var pos = $(elem).getCoordinates().top.toInt(); var left = $(elem).getCoordinates().left.toInt(); var height = $(elem).getCoordinates().height.toInt(); pos += height + 10; while($('tooltip') != null) { $('tooltip').dispose(); } var div = new Element('div'); div.setStyle('top',pos); div.setStyle('left',left); div.addClass('tooltip'); div.addClass('soc_container'); div.setAttribute('id','tooltip'); //div.fade('hide'); div.injectInside(document.body); /* var img = new Element('img'); img.alt = ''; img.src = '/skin/easy/tooltipArrow.png'; img.setStyle('position', 'absolute'); img.setStyle('top', '-20px'); img.injectInside(div); */ div.addEvents({ 'click': function() { div.nix(true); }, 'mouseleave': function() { div.nix(true); } }); $("tooltip").set('html', $('tooltip').get('html')+data); $('tooltip').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $("tooltip").reveal(); //loadURL(url, "tooltip", .9, true); return div; } function LoadTooltip(elem, url) { var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { }, onRequest: function() { }, onComplete: function(response) { DisplayTooltip(elem, response); } }).send(); } function DestroyTooltip() { //$('tooltip').fade('out'); //PrettyDestory($('tooltip'), true); $('tooltip').nix(true); } var shownMessages = new Array(); var msgFormShown = false; window.addEvent('domready', function() { $$('span.messageBody').each(function(el) { var vsLogRegBox = new Fx.Slide(el).hide(); }); }); function GetMessage(id) { var index = ExistsInArray(shownMessages, id); if(index == -1) { //loadURL("/action/25&id="+id, "inboxViewMessage_"+id); var url = "/action/25&id="+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to get message. Please try again.", "error"); }, onRequest: function() { $("inboxViewMessage_"+id).set('html', 'loading...'); }, onComplete: function(response) { $("inboxViewMessage_"+id).set('html', response); var vsLogRegBox = new Fx.Slide($('inboxViewMessage_'+id)).toggle(); $('inboxPreview_'+id).fade('out'); } }).send(); shownMessages.push(id); }else{ var vsLogRegBox = new Fx.Slide($('inboxViewMessage_'+id)).toggle(); shownMessages.splice(index, 1); $('inboxPreview_'+id).fade('in'); } } function ShowDeleteMessageForm(id) { //loadURL("/action/26&id="+id, "inboxViewMessage_"+id); var url = "/action/26&id="+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to get message. Please try again.", "error"); }, onRequest: function() { $("inboxViewMessage_"+id).set('html', 'loading...'); }, onComplete: function(response) { $("inboxViewMessage_"+id).set('html', response); var vsLogRegBox = new Fx.Slide($('inboxViewMessage_'+id)).toggle(); } }).send(); } function ShowReplyForm(id) { //loadURL("/action/28&id="+id, "inboxViewMessage_"+id); var url = "/action/28&id="+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to get message. Please try again.", "error"); }, onRequest: function() { $("inboxReplyBox_"+id).set('html', 'loading...'); }, onComplete: function(response) { $("inboxReplyBox_"+id).set('html', response); var vsLogRegBox = new Fx.Slide($('inboxReplyBox_'+id)).toggle(); $("inboxReplyBox_"+id).setStyle('overflow', 'normal'); } }).send(); } function ShowNewMessageForm(recipient) { if(msgFormShown) { msgFormShown = false; prettyDestroy("AddRemoveStatus", false); }else{ loadURL("/action/30&recipient="+recipient, "AddRemoveStatus"); msgFormShown = true; $('subjectField').focus(); } } function SendMessage(myElem) { var form = myElem.form; $(form).set('send', { onRequest: function() { ShowMessage("Sending Message...", "busy"); DisableEnableForm(form, true); }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); var message = json.get('message'); var status = json.get('status'); if(status) { window.location = '/inbox/sendsuccessful'; }else{ ShowMessage(message, "error"); } //add a delay to slow people down from spamming. Anyone who isn't //a complete idiot can bypass this, but it'll keep 95% of users //from spamming. I just called 95% of people idiots, awesome! //setTimeout("DisableEnableForm(form, false)", 1500); //prettyDestroy(myElem.parentNode.parentNode, false); DisableEnableForm(form, false); }, onFailure: function () { ShowMessage("There was a problem sending your message.", "error"); DisableEnableForm(form, false); } }); $(form).send(); } function ReplyMessage(myElem, id) { var form = myElem.form; $(form).set('send', { onRequest: function() { ShowMessage("Sending...", "busy"); $(myElem.parentNode.parentNode).fade("out"); }, onSuccess: function() { if($('editBar') != null) KillEditBar(); ShowMessage("Reply was sent!", "success"); $(myElem.parentNode.parentNode).dissolve(); //GetMessage(id); }, onFailure: function () { ShowMessage("There was a problem replying to this message.", "error"); $(myElem.parentNode.parentNode).fade("in"); } }); $(form).send(); } function DisableEnableForm(xForm,xHow){ objElems = xForm.elements; for(i=0;i'); //ShowMessage("GOOD " + json.get('status') + ' ' + response); HideStatusBar(); return; } //}else{ //ClearRegArea(); ShowMessage(message, "info"); UsernameOK = false; $('regUNameStatus').set('html', ''); //} } }).send(); } function ShowPasswordHintMessage(el) { if(el.value == '') ShowMessage("Your password must be at least 5 characters long and only consist of letters, numbers, or underscores", "error"); } function ShowCreateUsernameHintMessage(el) { if(el.value == '') ShowMessage("Your username must consist of letters, numbers, or underscores, be between 3 and 24 characters, and must be unique. Please make sure your username does not contain any offensive language, or it may be banned.", "error"); } function ValidatePasswords() { if($('registerPassword').value == $('passwordv').value) { $('passStatus').set('html', ''); if(UsernameOK) { //ShowMessage("Your passwords match. You did it! You can register now!"); HideStatusBar(); BothOK = true; return true; } }else{ BothOK = false; ClearRegArea(); $('passStatus').set('html', ''); //ShowMessage("It looks like your passwords don't match.", "error"); } return false; } function ClearRegArea() { //$('registerDo').set('html', ''); } function InjectSubmitButton() { return; if(UsernameOK == true && PassOK == true && BothOK == true) { $('registerDo').set('html', ''); var submit = new Element('input'); submit.setAttribute('type', 'button'); submit.setAttribute('value', 'register'); submit.addClass('button'); submit.setAttribute('onclick', 'SubmitRegisterForm();'); var tos = new Element('span'); tos.addClass('copyright'); tos.setStyle('display', 'block'); tos.set('html', 'By registering your account, you agree to the tos.'); submit.inject($('registerDo')); tos.inject($('registerDo')); /* if(confirm("You are about to register the account: " + $('registerUsername').value + ".\n\nPress OK if you're sure you want this to be your username.")) { var form = $('registerForm'); $(form).setAttribute('action', '/action/1'); $(form).set('send', { onRequest: function() { $(form).setAttribute('disabled', 'true'); ShowMessage("Registering Account...", "busy"); }, onSuccess: function(responseText) { ShowMessage("Account created, you can now log in!", "success"); $(form.parentNode).fade('out'); $('logUsername').value = $('registerUsername').value; $('logPass').value = $('registerPassword').value; }, onFailure: function() { $(form).setAttribute('disabled', 'false'); ShowMessage("There was a problem registering your account.", "error"); } }); $(form).send(); } */ } } var emailStatusOK = false; function ValidateEmail(email) { if(email.test(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/)) { $('emailStatus').set('html', ''); emailStatus = true; }else{ $('emailStatus').set('html', ''); } } function SubmitRegisterForm() { if($('tos').checked == false) { ShowMessage("You must agree to the Terms of Service before registering for myHuddler.", "error"); return; } if(emailStatusOK == false && 1 == 34) { new MooDialog.Alert("Please enter a valid email address.", {size: {width: 320, height: 150}}); return; } var url = "/action/1103&u="+document.getElementById("registerUsername").value; var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { ShowMessage("There was a problem verifying what you typed in. Please try again later.", "error"); }, onRequest: function() { }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); if(json.get('status')) { var form = $('registerForm'); $(form).setAttribute('action', '/action/1'); $(form).set('send', { onRequest: function() { $(form).setAttribute('disabled', 'true'); ShowMessage("Registering Account...", "busy"); }, onSuccess: function(responseText) { ShowMessage("Account created, you can now log in! RESPONDED: " + responseText, "success"); $(form.parentNode).fade('out'); $('logUsername').value = $('registerUsername').value; $('logPass').value = $('registerPassword').value; $('logRegRegister').nix(false); $('logRegLogin').set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); $('logRegLogin').reveal('in'); }, onFailure: function() { $(form).setAttribute('disabled', 'false'); ShowMessage("There was a problem registering your account.", "error"); } }); $(form).send(); }else new MooDialog.Alert(json.get('message')); } }).send(); } var heightDD = -400; function showDropdown() { if(heightDD >= 3000) return; heightDD+=3; document.getElementById("dropdown").style.bottom=heightDD+"px"; setTimeout("showDropdown(" + heightDD + ")", 1); } function hideDropdown() { if(heightDD < 0) return; heightDD-=3; document.getElementById("dropdown").style.bottom=heightDD+"px"; setTimeout("hideDropdown(" + heightDD + ")", 1); } function ShowPartialAutoComplete() { document.getElementById("postCategoryPopup").style.visibility="visible"; document.getElementById("postCategoryPopup").style.top=document.getElementById("postCategory").top+"px"; document.getElementById("postCategoryPopup").style.left=document.getElementById("postCategory").left+"px"; $("postCategoryPopup").fade("in"); } /* * Loads Partial matches into the drop down box */ var lastPTime = 0; var mode = 'search'; function DisplayCategoryChooser(keypress) { GetPopupData(mode); } var originalSwifferLocation; function GetPopupData(type) { $('searchStuff').reveal(); if($('tooltip') != null) $('tooltip').dispose(); mode = type; var s = 400; /* if($('popyours').getStyle('font-size').toInt() < s) s = $('popyours').getStyle('font-size').toInt(); if($('popsearch').getStyle('font-size').toInt() < s) s = $('popsearch').getStyle('font-size').toInt(); if($('popjoined').getStyle('font-size').toInt() < s) s = $('popjoined').getStyle('font-size').toInt(); $('popjoined').setStyle('font-size', s); $('popsearch').setStyle('font-size', s); $('popyours').setStyle('font-size', s); $('pop'+mode).setStyle('font-size', $('pop'+mode).getStyle('font-size').toInt() + 10); */ if($('category') != null && $('categorysearch').value != null) { var req = new Request({ method: 'post', url: '/action/postPopup', data: { 'type' : type, 'search' : $('categorysearch').value }, onFailure: function() { alert('failed to search!'); }, onRequest: function() { }, onSuccess: function(response) { $('postCategoryPopup').set('html', 'Search Results (click on a huddle name to post to it.):
' + response); $("postCategoryPopup").setStyle('top', $("postCategory").top+"px"); $("postCategoryPopup").setStyle('left', $("postCategory").left+"px"); var width = $("postCategoryPopup").getStyle('width').toInt() + $("postCategoryPopup").getStyle('padding-left').toInt() + $("postCategoryPopup").getStyle('padding-right').toInt(); } }).send(); } //lastPTime = new Date().getTime() + 1000; } function SeeIfCategoryAllowsAnons(el) { var url = '/action/5005&category='+escape(el); var req = new Request({ method: 'get', url: url, data: { 'id' : 0 }, onFailure: function() { ShowMessage("Failed to delete post. Please try again.", "error"); }, onRequest: function() { }, onComplete: function(response) { ShowMessage(response, "success"); if(response == 'false'){ $('goanon').disabled = true; $('goanon').checked = false; $('goanonPostPassword').fade('out'); $('goanonMsg').set('html', 'The leader of this huddle does not allow users to post anonymously.') } else { $('goanon').disabled = false; $('goanonMsg').set('html', '') } } }).send(); } function UpVote(id, logged) { //touchURL('/action/8&id='+id); //loadURL('/action/8&id='+id, 'voteCount_'+id); if(GetCookie('logPass') == ''){ DoLoginPrompt('upvote posts'); }else{ var oldValue; var url = '/action/8&id='+id; var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { }, onRequest: function() { oldValue = $('voteCount_'+id).innerHTML; }, onComplete: function(response) { if(oldValue != response) { //$("upvoteButton_"+id).set('class', 'upvoted'); //$("downvoteButton_"+id).set('class', 'downvote'); ShowMessage("You've already approved of this post."); } $('voteCount_'+id).set('html', response); } }).send(); } } function DownVote(id, logged) { //touchURL('/action/9&id='+id); if(GetCookie('logPass') == ''){ DoLoginPrompt('down posts'); }else{ var oldValue; var url = '/action/9&id='+id; var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { }, onRequest: function() { oldValue = $('voteCount_'+id).innerHTML; }, onComplete: function(response) { if(oldValue != response) { //$("upvoteButton_"+id).set('class', 'upvote'); //$("downvoteButton_"+id).set('class', 'downvoted'); } $('voteCount_'+id).set('html', response); } }).send(); } } function UpVoteComment(el, id) { //loadURL('/action/17&id='+id, 'voteCCount_'+id); if(GetCookie('logPass') == '') DoLoginPrompt('like replies'); else{ var oldValue; var url = '/action/17&id='+id; var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { }, onRequest: function() { oldValue = $('voteCCount_'+id).innerHTML; }, onComplete: function(response) { if(oldValue != response && response != '') { //$("upvoteButton_"+id).set('class', 'upvote'); //$("downvoteButton_"+id).set('class', 'downvoted'); $('voteCCount_'+id).set('html', response); } } }).send(); } } function DownVoteComment(el, id) { //loadURL('/action/18&id='+id, 'voteCCount_'+id); if(GetCookie('logPass') == '') DoLoginPrompt('dislike replies'); else{ var oldValue; var url = '/action/18&id='+id; var req = new Request({ method: 'get', url: url, data: { 'do' : '1' }, onFailure: function() { }, onRequest: function() { oldValue = $('voteCCount_'+id).innerHTML; }, onComplete: function(response) { if(oldValue != response && response != '') { //$("upvoteButton_"+id).set('class', 'upvote'); //$("downvoteButton_"+id).set('class', 'downvoted'); $('voteCCount_'+id).set('html', response); } } }).send(); } } function AddFavorite(category) { //document.getElementById("addBrowserFav_"+category).innerHTML = ""; //document.getElementById("addBrowserDet_"+category).innerHTML = ""; if(GetCookie('logPass') == '') DoLoginPrompt('join Huddles'); else{ touchURL('/action/11&category='+category); $('addbutton_'+category).dissolve(); $('removebutton_'+category).reveal(); //prettyDestroy("addBrowserFav_"+category); //prettyDestroy("addBrowserDet_"+category); } } function RemoveFavorite(category) { //document.getElementById("remBrowserFav_"+category).innerHTML = ""; //document.getElementById("remBrowserDet_"+category).innerHTML = ""; if(GetCookie('logPass') == '') DoLoginPrompt('leave Huddles'); else{ touchURL('/action/12&category='+category); $('addbutton_'+category).reveal(); $('removebutton_'+category).dissolve(); //prettyDestroy("remBrowserFav_"+category); //prettyDestroy("remBrowserDet_"+category); } } function AddFollow(follow) { if(GetCookie('logPass') == '') DoLoginPrompt('follow people'); else loadStatusBar('/action/13&poster='+follow); } function RemoveFollow(follow) { if(GetCookie('logPass') == '') DoLoginPrompt('stop following people'); else loadStatusBar('/action/14&poster='+follow); } function SaveCategory(id) { if(GetCookie('logPass') == '') DoLoginPrompt('save Huddles'); else{ var url = '/action/1500&id='+id; var req = new Request({ method: 'get', url: url, data: { 'id' : id }, onFailure: function() { ShowMessage("Failed to save category. Please try again.", "error"); }, onRequest: function() { }, onComplete: function(response) { ShowMessage(response, "success"); RefreshPost(id); } }).send(); } } function UnsaveCategory(id) { SaveCategory(id); } function ToggleBlock(follow) { if(GetCookie('logPass') == '') DoLoginPrompt('unsave Huddles'); else loadStatusBar('/action/1100&poster='+follow); } function RemoveFollower(follow) { if(GetCookie('logPass') == '') DoLoginPrompt('remove followers'); else loadStatusBar('/action/80&poster='+follow); } function KickFollower(follower) { if(GetCookie('logPass') == '') DoLoginPrompt(); else loadStatusBar('/action/81&follower='+follower); } var shownComments = new Array(); window.addEvent('domready', function() { $$('span.commentReply').each(function(el) { //el.fade('hide'); el.setStyle('display', 'none'); }); }); function ShowCommentReply(id, thread) { if(GetCookie('logPass') == ''){ DoLoginPrompt('reply in huddle posts'); }else{ var index = ExistsInArray(shownComments, id); if (index == -1) { shownComments.push(id); ShowCommentReplyForm(id, thread); } else { shownComments.splice(index, 1); HideCommentReplyForm(id); } } } function HideCommentReplyForm(id) { //PrettyDestroy('commentReply_'+id, false); //$('commentReply_'+id).set('html', ''); $('commentReply_'+id).setStyle('display', 'none'); // $('commentReply_'+id).set('html', ''); } function ShowCommentReplyForm(id, thread) { //loadURL('/action/15&id=' + id + '&thread=' + thread, 'commentReply_' + id); $('commentReply_'+id).setStyle('display', 'inherit'); /* var req = new Request({ method: 'get', url: '/action/15&id=' + id + '&thread=' + thread, data: { 'do' : '1' }, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { }, onSuccess: function(response) { $('commentReply_'+id).setStyle('overflow', 'inherit'); $('commentReply_'+id).set('html', response); } }).send(); */ } function ToggleComments(el, id) { var parent = $('commentContainer_'+id); var commentSlide = new Fx.Slide(parent, { duration:400, transition: Fx.Transitions.Quart.easeIn}); if($(parent).getStyle('display') == 'none') { //commentSlide.slideOut(); //$(parent).fade('hide'); //$(parent).setStyle('display', 'inherit'); //$(parent).fade('in'); $(parent).reveal(); el.innerHTML = '[-]'; }else{ //$(parent).setStyle('display', 'none'); //commentSlide.slideIn(); $(parent).dissolve(); el.innerHTML = '[+]'; } } function SubmitComment(myElem) { var form = myElem.form; $(form).set('send', { onRequest: function() { //$(myElem.parentNode.parentNode).fade("out"); $(form).fade("out"); }, onSuccess: function(responseText) { ShowMessage("Reply was posted! ", "success"); var div = new Element('div'); //div.setStyle('top',); //div.setStyle('left',left); div.setStyle('class', 'comment'); div.setAttribute('id', 'heynewcomment'); div.set('html', responseText); div.injectInside(myElem.parentNode.parentNode, 'before'); //loadURL("todo.txt", "heynewcomment"); //$(form).dispose(); //$(myElem.parentNode.parentNode).fade("in"); }, onFailure: function() { ShowMessage("There was a problem submitting this message.", "error"); $(myElem.parentNode.parentNode).fade("in"); } }); $(form).send(); } function EditCommentP(id) { loadURL("/action/19&id=" + id, "commentText_" + id); } function SaveCommentEdit(myElem, id) { var form = myElem.form; var node = form.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; $(form).set('send', { onRequest: function() { $(node).fade("out"); }, onSuccess: function(responseH) { //alert('yay it worked'); //loadURL('/action/5001&id='+id, 'postData_'+id); //loadURL('/action/10&id='+id, 'voteCount_'+id); $(node).set('html', responseH); $(node).fade("in"); }, onFailure: function() { ShowMessage("Failed to commit edit.", "error"); $(node).fade("in"); } }); $(form).send(); } function CancelCommentEdit(el, id) { if($('editBar') != null) KillEditBar(); var form = el.form; var node = form.parentNode.parentNode.parentNode; //node.innerHTML = 'fuck you!'; //loadURL('/action/23&id='+id, node); //loadURL('todo.txt', node); var req = new Request({ method: 'get', url: '/action/23&id='+id, data: { 'do' : '1' }, onFailure: function() { alert("Unknown Error. Please try again."); }, onRequest: function() { node.fade('out'); }, onSuccess: function(response) { node.fade('hide'); node.innerHTML = response; //$(target).set('html', response); node.fade('in'); /* var div = new Element('div'); div.setAttribute('id','dicks'); div.set('html', response); div.injectInside(target); */ //$(target).fade('in'); //$(target).set('morph', {duration: 1000, transition: Fx.Transitions.Elastic.easeIn}); //$(target).morph({height: auto, width: auto}); } }).send(); } function DeleteCommentP(id) { loadURL("/action/21&id=" + id, "commentText_" + id); } function DeleteComment(myElem) { var form = myElem.form; var node = form.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; $(form).set('send', { onRequest: function() { $(node).fade("out"); }, onSuccess: function(responseH) { //alert('yay it worked'); //loadURL('/action/5001&id='+id, 'postData_'+id); //loadURL('/action/10&id='+id, 'voteCount_'+id); //$(node).set('html', responseH); //$(node).fade("in"); $(node).dispose(); //prettyDestroy(node, f); }, onFailure: function() { ShowMessage("Failed to delete comment. Boy, I sure hope it's not a stupid comment.", "error"); $(node).fade("in"); } }); $(form).send(); } function ChangeFollowed() { var value = document.getElementById("followAccess").value; touchURL("/action/60&access="+value); } function ChangeNSFW() { var url = '/action/61'; var req = new Request({ method: 'get', url: url, data: { 'id' : 0}, onFailure: function() { ShowMessage("Failed to update your settings.", "error"); }, onRequest: function() { }, onComplete: function(response) { ShowMessage(response, "success"); //location.reload(true); } }).send(); } function ChangeAllowInvites(v) { touchURL("/action/62&v="+v); } function AbandonHuddle(huddle) { if(confirm("Do you really want to abandon this huddle?\n\nYou will no longer be the leader and you will no longer be a moderator.\nThis will allow for someone else to become the leader?")) { loadStatusBar("/action/1006&category="+huddle); } } var shown = 'top'; function ToggleFavoriteHeader() { if(shown == 'top') { shown = 'favs'; document.getElementById('topBarChooser').innerHTML = 'Joined Huddles:'; loadURL('/action/1400', 'topBarData'); }else{ shown = 'top'; document.getElementById('topBarChooser').innerHTML = 'Top Huddles:'; loadURL('/action/1401', 'topBarData'); } } function AddSelectedFriends() { var CSVUsers = SelectedToCSV(); var req = new Request({ method: 'post', url: '/action/2001', data: {'req' : CSVUsers}, onRequest: function() { ShowMessage("Sending Friend Requests...", "busy"); }, onFailure: function() { ShowMessage("There was a problem sending friend requests.", "error"); }, onSuccess: function(response) { ShowMessage(response, "success"); } }).send(); } function RemoveSelectedFriends() { var CSVUsers = SelectedToCSV(); if(confirm("Are you sure you want to remove these friends?\n\nYou'll have to send friend requests if you want to be friends again later.")) { var req = new Request({ method: 'get', url: '/action/2003', data: {'remove' : CSVUsers}, onRequest: function() { ShowMessage("Removing friends...", "busy"); }, onFailure: function() { ShowMessage("There was a problem removing your friend(s).", "error"); }, onSuccess: function(response) { ShowMessage(response, "success"); } }).send(); } } function SendInviteToSelected(el) { var CSVUsers = SelectedToCSV(); LaunchInviter(CSVUsers, el); } function BlockSelected() { var CSVUsers = SelectedToCSV(); if(confirm("Do you really want to block all of these people?")) { var req = new Request({ method: 'post', url: '/action/1107', data: {'block' : CSVUsers}, onRequest: function() { ShowMessage("Blocking annoying people...", "busy"); }, onFailure: function() { ShowMessage("There was a problem blocking!", "error"); }, onSuccess: function(response) { ShowMessage(response, "success"); } }).send(); } } function UnblockSelected() { var CSVUsers = SelectedToCSV(); if(confirm("Do you really want to block all of these people?")) { var req = new Request({ method: 'post', url: '/action/1108', data: {'block' : CSVUsers}, onRequest: function() { ShowMessage("Blocking annoying people...", "busy"); }, onFailure: function() { ShowMessage("There was a problem blocking!", "error"); }, onSuccess: function(response) { ShowMessage(response, "success"); } }).send(); } } function SendMessageToSelected() { var CSVUsers = SelectedToCSV(); window.location = "/inbox/compose/"+escape(CSVUsers); } function FollowSelected() { var CSVUsers = SelectedToCSV(); } function SelectedToCSV() { var users = new Array(); $$('.userSelect').each(function(el) { if(el.checked) users.push(el.getAttribute('userid')); //users += el.getAttribute('userid') + ","; }); return users.join(","); } function ChangeSkin(el) { var req = new Request({ method: 'post', url: '/action/changeSkin', data: { 'skin' : el.value }, onFailure: function() { ShowMessage("There was an error changing your skin.", "error"); }, onRequest: function() { }, onSuccess: function(response) { SetCookie("skin", el.value, 666); window.location.reload() } }).send(); } function ValidateCreate(el) { if(el.value.length < 3){ ShowMessage("Your huddle name must be over 3 characters long.", "info"); $('createStatus').set('src', '/img/icons/nogood_sm.png'); return; } if(el.value.length > 24){ ShowMessage("Your huddle name must be less than 24 characters. " + el.value, "info"); $('createStatus').set('src', '/img/icons/nogood_sm.png'); return; } if(!el.value.match(/^[a-zA-Z\ ]+$/)) { ShowMessage('You are only allowed to use letters, numbers, and spaces in your huddle names.', "info"); $('createStatus').set('src', '/img/icons/nogood_sm.png'); return; } HideStatusBar(); var req = new Request({ method: 'post', url: '/action/checkCreateHuddle', data: { 'category' : el.value }, onFailure: function() { ShowMessage("There was an error seeing if this huddle was already created.", "error"); }, onRequest: function() { }, onSuccess: function(response) { var json = new Hash(JSON.decode(response, true) || {}); if(json.get('status')) { $('createStatus').set('src', '/img/icons/accept_sm.png'); }else{ $('createStatus').set('src', '/img/icons/nogood_sm.png'); ShowMessage(json.get('message'), "success"); } } }).send(); } function DashStopScrolling() { clearInterval(DashRandomInterval); } function DashStartScrolling() { DashRandomInterval = setInterval('GetNewDashboardRandom()', 20000); } var node = 0; function GetNewDashboardRandom() { if($('dashRandom') == null) return; var o = document.getElementById('dashRandom').childNodes[node]; var browserName=navigator.appName; if (browserName=="Microsoft Internet Explorer") { node = 0; } else { if(node < 5) node++; } //--> if($(o) == null) {ShowMessage("ALL DONE! " + node); return;} var req = new Request({ method: 'get', url: "/action/randomPost", data: { 'do' : '1' }, onFailure: function() { //alert("Unknown Error. Please try again."); }, onRequest: function() { }, onSuccess: function(response) { $(o).nix(true); var div = new Element('div'); div.setStyle('display', 'none'); div.set('html', response); div.injectInside($('dashRandom'), 'after'); div.set('reveal', {duration: 200, transition: Fx.Transitions.Sine.easeOut}); div.reveal(); } }).send(); } function KillEditBar() { //var mtop = $(EditBoxTextbox).getStyle('margin-top').toInt(); //$(EditBoxTextbox).setStyle('margin-top', mtop - 30); $('editBar').nix(true); } function ListPopup(el) { if($('containerx') != null) $('containerx').dispose(); var m = new Element('div'); m.addClass('soc_container'); // define container pos var top = el.getCoordinates().top.toInt(); var height = el.getCoordinates().height.toInt(); var left = el.getCoordinates().left.toInt(); var pos = top+height; m.setStyle('top',pos); m.setStyle('left',left); m.addClass('soc_container'); m.setAttribute('id','containerx'); m.injectInside(document.body); m.setStyle('position', 'absolute'); var x = 0; var l = new Element('ul'); ShowMessage(el); var item = new Element('span'); item.set('html', el.innerHTML); ShowMessage(item.innerHTML + " hi there it worked?"); item.injectInside(m, 'after'); m.innerHTML = el.innerHTML; m.injectInside(document.body); m.reveal(); } /* IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards http://code.google.com/p/ie7-js/ http://www.opensource.org/licenses/mit-license.php */ //;(function(N,p){var h=N.IE7={version:"2.1(beta4)",toString:bT("[IE7]")};h.compat=9;var t=h.appVersion=navigator.appVersion.match(/MSIE (\d\.\d)/)[1]-0;if(/ie7_off/.test(top.location.search)||t<5.5||t>=h.compat)return;var E=t<6,bj=bT(),bx=p.documentElement,B,x,cy="!",U=":link{ie7-link:link}:visited{ie7-link:visited}",cz=/^[\w\.]+[^:]*$/;function bk(c,a){if(cz.test(c))c=(a||"")+c;return c};function by(c,a){c=bk(c,a);return c.slice(0,c.lastIndexOf("/")+1)};var bU=p.scripts[p.scripts.length-1],cA=by(bU.src);try{var V=new ActiveXObject("Microsoft.XMLHTTP")}catch(ex){}var bl={};function cB(c,a){try{c=bk(c,a);if(!bl[c]){V.open("GET",c,false);V.send();if(V.status==0||V.status==200){bl[c]=V.responseText}}}catch(ex){}return bl[c]||""};var dA=Array.prototype.slice,dB=/%([1-9])/g,cC=/^\s\s*/,cD=/\s\s*$/,cE=/([\/()[\]{}|*+-.,^$?\\])/g,bV=/\bbase\b/,bW=["constructor","toString"],bm;function F(){};F.extend=function(g,f){bm=true;var d=new this;O(d,g);bm=false;var c=d.constructor;function a(){if(!bm)c.apply(this,arguments)};d.constructor=a;a.extend=arguments.callee;O(a,f);a.prototype=d;return a};F.prototype.extend=function(a){return O(this,a)};var P="#",Q="#",bc=".",bn="/",dC=/\\(\d+)/g,cF=/\[(\\.|[^\]\\])+\]|\\.|\(\?/g,cG=/\(/g,cH=/\$(\d+)/,cI=/^\$\d+$/,cJ=/(\[(\\.|[^\]\\])+\]|\\.|\(\?)|\(/g,cK=/^<#\w+>$/,cL=/<#(\w+)>/g,G=F.extend({constructor:function(a){this[bc]=[];this[Q]={};this.merge(a)},add:function(c,a){delete this[bn];if(c instanceof RegExp){c=c.source}if(!this[P+c])this[bc].push(String(c));return this[Q][P+c]=new G.Item(c,a,this)},compile:function(a){if(a||!this[bn]){this[bn]=new RegExp(this,this.ignoreCase?"gi":"g")}return this[bn]},merge:function(c){for(var a in c)this.add(a,c[a])},exec:function(o){var k=this,l=k[bc],m=k[Q],j,i=this.compile(true).exec(o);if(i){var g=0,f=1;while((j=m[P+l[g++]])){var d=f+j.length+1;if(i[f]){if(j.replacement===0){return k.exec(o)}else{var c=i.slice(f,d),a=c.length;while(--a)c[a]=c[a]||"";c[0]={match:c[0],item:j};return c}}f=d}}return null},parse:function(o){o+="";var k=this,l=k[bc],m=k[Q];return o.replace(this.compile(),function(j){var i=[],g,f=1,d=arguments.length;while(--d)i[d]=arguments[d]||"";while((g=m[P+l[d++]])){var c=f+g.length+1;if(i[f]){var a=g.replacement;switch(typeof a){case"function":return a.apply(k,i.slice(f,c));case"number":return i[f+a];default:return a}}f=c}return j})},toString:function(){var g=[],f=this[bc],d=this[Q],c;for(var a=0;c=d[P+f[a]];a++){g[a]=c.source}return"("+g.join(")|(")+")"}},{IGNORE:null,Item:F.extend({constructor:function(k,l,m){var j=k.indexOf("(")===-1?0:G.count(k),i=m.dictionary;if(i&&k.indexOf("<#")!==-1){if(cK.test(k)){var g=i[Q][P+k.slice(2,-1)];k=g.replacement;j=g._5}else{k=i.parse(k)}}if(typeof l=="number")l=String(l);else if(l==null)l=0;if(typeof l=="string"&&cH.test(l)){if(cI.test(l)){var f=l.slice(1)-0;if(f&&f<=j)l=f}else{var d=l,c;l=function(a){if(!c){c=new RegExp(k,"g"+(this.ignoreCase?"i":""))}return a.replace(c,d)}}}this.length=j;this.source=String(k);this.replacement=l}}),count:function(a){return(String(a).replace(cF,"").match(cG)||"").length}}),cM=G.extend({parse:function(f){var d=this[Q];return f.replace(cL,function(c,a){a=d[P+a];return a?a._6:c})},add:function(g,f){if(f instanceof RegExp){f=f.source}var d=f.replace(cJ,cN);if(f.indexOf("(")!==-1){var c=G.count(f)}if(f.indexOf("<#")!==-1){f=this.parse(f);d=this.parse(d)}var a=this.base(g,f);a._6=d;a._5=c||a.length;return a},toString:function(){return"(<#"+this[PATTERNS].join(">)|(<#")+">)"}});function cN(c,a){return a||"(?:"};function O(i,g){if(i&&g){var f=(typeof g=="function"?Function:Object).prototype;var d=bW.length,c;if(bm)while(c=bW[--d]){var a=g[c];if(a!=f[c]){if(bV.test(a)){bX(i,c,a)}else{i[c]=a}}}for(c in g)if(typeof f[c]=="undefined"){var a=g[c];if(i[c]&&typeof a=="function"&&bV.test(a)){bX(i,c,a)}else{i[c]=a}}}return i};function bX(i,g,f){var d=i[g];i[g]=function(){var c=this.base;this.base=d;var a=f.apply(this,arguments);this.base=c;return a}};function cO(f,d){if(!d)d=f;var c={};for(var a in f)c[a]=d[a];return c};function H(g){var f=arguments,d=new RegExp("%([1-"+arguments.length+"])","g");return String(g).replace(d,function(c,a){return a":"","\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/":"","@(namespace|import)[^;\\n]+[;\\n]":"","'(\\\\.|[^'\\\\])*'":cd,'"(\\\\.|[^"\\\\])*"':cd,"\\s+":" "});function cQ(a){return cc.parse(a).replace(bz,"$1")};function bd(a){return a.replace(cb,cR)};function cd(c){var a=W.length;W[a]=c.slice(1,-1).replace(bz,"$1").replace(cP,"\\'");return"'"+a+"'"};function cR(d,c){var a=W[c];if(a==null)return d;return"'"+W[c]+"'"};function bp(a){return a.indexOf("'")===0?W[a.slice(1,-1)]:a};var cS=new G({Width:"Height",width:"height",Left:"Top",left:"top",Right:"Bottom",right:"bottom",onX:"onY"});function ce(a){return cS.parse(a)};var cf=[];function bA(a){cT(a);y(N,"onresize",a)};function y(d,c,a){d.attachEvent(c,a);cf.push(arguments)};function cU(d,c,a){try{d.detachEvent(c,a)}catch(ex){}};y(N,"onunload",function(){var a;while(a=cf.pop()){cU(a[0],a[1],a[2])}});function be(d,c,a){if(!d.elements)d.elements={};if(a)d.elements[c.uniqueID]=c;else delete d.elements[c.uniqueID];return a};y(N,"onbeforeprint",function(){if(!h.CSS.print)new cg("print");h.CSS.print.recalc()});var ch=/^\d+(px)?$/i,X=/^\d+%$/,C=function(f,d){if(ch.test(d))return parseInt(d);var c=f.style.left,a=f.runtimeStyle.left;f.runtimeStyle.left=f.currentStyle.left;f.style.left=d||0;d=f.style.pixelLeft;f.style.left=c;f.runtimeStyle.left=a;return d},bB="ie7-",ci=F.extend({constructor:function(){this.fixes=[];this.recalcs=[]},init:bj}),bC=[];function cT(a){bC.push(a)};h.recalc=function(){h.HTML.recalc();h.CSS.recalc();for(var a=0;a'@'",cm="if("+cl+"){",cn="(e.nodeName==='FORM'?IE7._0(e,'id'):e.id)",cV=/a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i,cW=/(.*)(:first-(line|letter))/,cX=/\s/,cY=/((?:\\.|[^{\\])+)\{((?:\\.|[^}\\])+)\}/g,cZ=/(?:\\.|[^,\\])+/g,I=p.styleSheets,bF=[];h.CSS=new(ci.extend({parser:new ca,screen:"",print:"",styles:[],rules:[],pseudoClasses:t<7?"first\\-child":"",dynamicPseudoClasses:{toString:function(){var c=[];for(var a in this)c.push(a);return c.join("|")}},init:function(){var j="^\x01$",i="\\[class=?[^\\]]*\\]",g=[];if(this.pseudoClasses)g.push(this.pseudoClasses);var f=this.dynamicPseudoClasses.toString();if(f)g.push(f);g=g.join("|");var d=t<7?["[>+~\\[(]|([:.])[\\w-]+\\1"]:[i];if(g)d.push(":("+g+")");this.UNKNOWN=new RegExp(d.join("|")||j,"i");var c=t<7?["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"]:[i],a=c.concat();if(g)a.push(":("+g+")");u.COMPLEX=new RegExp(a.join("|")||j,"ig");if(this.pseudoClasses)c.push(":("+this.pseudoClasses+")");bf.COMPLEX=new RegExp(c.join("|")||j,"i");f="not\\(:"+f.split("|").join("\\)|not\\(:")+"\\)|"+f;bf.MATCH=new RegExp(f?"(.*?):("+f+")(.*)":j,"i");this.createStyleSheet();this.refresh()},addEventHandler:function(){y.apply(null,arguments)},addFix:function(c,a){this.parser.add(c,a)},addRecalc:function(i,g,f,d){i=i.source||i;g=new RegExp("([{;\\s])"+i+"\\s*:\\s*"+g+"[^;}]*");var c=this.recalcs.length;if(typeof d=="string")d=i+":"+d;this.addFix(g,function(a){if(typeof d=="function")d=d(a);return(d?d:a)+";ie7-"+a.slice(1)+";ie7_recalc"+c+":1"});this.recalcs.push(arguments);return c},apply:function(){this.getInlineCSS();new cg("screen");this.trash()},createStyleSheet:function(){p.getElementsByTagName("head")[0].appendChild(p.createElement("style"));this.styleSheet=I[I.length-1];this.styleSheet.ie7=true;this.styleSheet.owningElement.ie7=true;this.styleSheet.cssText=U},getInlineCSS:function(){var d=p.getElementsByTagName("style"),c;for(var a=d.length-1;c=d[a];a--){if(!c.disabled&&!c.ie7){c._7=c.innerHTML}}},getText:function(d,c){try{var a=d.cssText}catch(e){a=""}if(V)a=cB(d.href,c)||a;return a},recalc:function(){this.screen.recalc();var q=/ie7_recalc\d+/g,n=U.match(/[{,]/g).length,o=this.styleSheet.rules,k,l,m,j,i,g,f,d,c;for(g=n;k=o[g];g++){var a=k.style.cssText;if(l=a.match(q)){j=J(k.selectorText);if(j.length)for(f=0;f*","position:relative")}l.push(g.join("\n"))}}this.cssText=l.join("\n");this.rules=h.CSS.rules.slice(k)},recalc:function(){var c,a;for(a=0;(c=this.rules[a]);a++)c.recalc()},toString:function(){return this.declarations+"@media "+this.media+"{"+this.cssText+"}"}}),R,u=h.Rule=F.extend({constructor:function(d,c){this.id=h.CSS.rules.length;this.className=u.PREFIX+this.id;var a=d.match(cW);this.selector=(a?a[1]:d)||"*";this.selectorText=this.parse(this.selector)+(a?a[2]:"");this.cssText=c;this.MATCH=new RegExp("\\s"+this.className+"(\\s|$)","g");h.CSS.rules.push(this);this.init()},init:bj,add:function(a){a.className+=" "+this.className},recalc:function(){var c=J(this.selector);for(var a=0;a0&&u.CLASS.test(f)){f=f.replace(u.CLASS,"");c--}while(d>0&&u.TAG.test(f)){f=f.replace(u.TAG,"$1*");d--}f+="."+this.className;c=Math.min(c,2);d=Math.min(d,2);var a=-10*c-d;if(a>0){f=f+","+u.MAP[a]+" "+f}return f},remove:function(a){a.className=a.className.replace(this.MATCH,"$1")},toString:function(){return H("%1 {%2}",this.selectorText,this.cssText)}},{CHILD:/>/g,CLASS:/\.[\w-]+/,CLASSES:/[.:\[]/g,MULTI:/(\.[\w-]+)+/g,PREFIX:"ie7_class",TAG:/^\w+|([\s>+~])\w+/,TAGS:/^\w|[\s>+~]\w/g,MAP:{"1":"html","2":"html body","10":".ie7_html","11":"html.ie7_html","12":"html.ie7_html body","20":".ie7_html .ie7_body","21":"html.ie7_html .ie7_body","22":"html.ie7_html body.ie7_body"}}),bf=u.extend({constructor:function(g,f,d,c,a){this.negated=d.indexOf("not")===0;if(this.negated)d=d.slice(5,-1);this.attach=f||"*";this.dynamicPseudoClass=h.CSS.dynamicPseudoClasses[d];this.target=c;this.base(g,a)},recalc:function(){var f=J(this.attach),d;for(var c=0;d=f[c];c++){var a=this.target?J(this.target,d):[d];if(a.length)this.dynamicPseudoClass.apply(d,a,this)}}}),M=F.extend({constructor:function(c,a){this.name=c;this.apply=a;this.instances={};h.CSS.dynamicPseudoClasses[c]=this},register:function(g,f){var d=g[2];if(!f&&d.negated){this.unregister(g,true)}else{g.id=d.id+g[0].uniqueID;if(!this.instances[g.id]){var c=g[1],a;for(a=0;a":function(g,f,d,c){var a="IE7._0(e,'"+f+"')";c=bp(c);if(d.length>1){if(!c||d==="~="&&cX.test(c)){return"false&&"}a="("+a+"||'')"}return"("+H(co[d],a,c)+")&&"},"<#id>":cn+"==='$1'&&","<#class>":"e.className&&(' '+e.className+' ').indexOf(' $1 ')!==-1&&",":first-child":"!"+ck+"&&",":link":"e.currentStyle['ie7-link']=='link'&&",":visited":"e.currentStyle['ie7-link']=='visited'&&"};h.HTML=new(ci.extend({fixed:{},init:bj,addFix:function(){this.fixes.push(arguments)},apply:function(){for(var f=0;f=n(d,d.currentStyle.maxWidth)){d.runtimeStyle.width=d.currentStyle.maxWidth}else{d.runtimeStyle.width=d.runtimeStyle.fixedWidth}};function m(a){if(be(m,a,/^(fixed|absolute)$/.test(a.currentStyle.position)&&bD(a,"left")!=="auto"&&bD(a,"right")!=="auto"&&L.test(bD(a,"width")))){j(a);v.boxSizing(a)}};v.fixRight=m;function j(d){var c=q(d,d.runtimeStyle._3||d.currentStyle.left),a=s(d)-q(d,d.currentStyle.right)-c-k(d,"margin");if(parseInt(d.runtimeStyle.width)===a)return;d.runtimeStyle.width="";if(bq(d)||r||d.offsetWidth=7)return;h.CSS.addRecalc("position","fixed",o,"absolute");h.CSS.addRecalc("background(-attachment)?","[^};]*fixed",q);var z=E?"body":"documentElement";function w(){if(B.currentStyle.backgroundAttachment!=="fixed"){if(B.currentStyle.backgroundImage==="none"){B.runtimeStyle.backgroundRepeat="no-repeat";B.runtimeStyle.backgroundImage="url("+bG+")"}B.runtimeStyle.backgroundAttachment="fixed"}w=bj};var r=cj("img");function A(a){return a?bq(a)||A(a.parentElement):false};function s(d,c,a){setTimeout("document.all."+d.uniqueID+".runtimeStyle.setExpression('"+c+"','"+a+"')",0)};function q(a){if(be(q,a,a.currentStyle.backgroundAttachment==="fixed"&&!a.contains(B))){w();j.bgLeft(a);j.bgTop(a);n(a)}};function n(c){r.src=c.currentStyle.backgroundImage.slice(5,-2);var a=c.canHaveChildren?c:c.parentElement;a.appendChild(r);j.setOffsetLeft(c);j.setOffsetTop(c);a.removeChild(r)};function o(a){if(be(o,a,bq(a))){Y(a,"position","absolute");Y(a,"left",a.currentStyle.left);Y(a,"top",a.currentStyle.top);w();h.Layout.fixRight(a);k(a)}};function k(d,c){p.body.getBoundingClientRect();j.positionTop(d,c);j.positionLeft(d,c,true);if(!d.runtimeStyle.autoLeft&&d.currentStyle.marginLeft==="auto"&&d.currentStyle.right!=="auto"){var a=x.clientWidth-j.getPixelWidth(d,d.currentStyle.right)-j.getPixelWidth(d,d.runtimeStyle._3)-d.clientWidth;if(d.currentStyle.marginRight==="auto")a=parseInt(a/2);if(A(d.offsetParent))d.runtimeStyle.pixelLeft+=a;else d.runtimeStyle.shiftLeft=a}if(!d.runtimeStyle.fixedWidth)j.clipWidth(d);if(!d.runtimeStyle.fixedHeight)j.clipHeight(d)};function l(){var c=q.elements;for(var a in c)n(c[a]);c=o.elements;for(a in c){k(c[a],true);k(c[a],true)}m=0};var m;bA(function(){if(!m)m=setTimeout(l,100)});var j={},i=function(g){g.bgLeft=function(a){a.style.backgroundPositionX=a.currentStyle.backgroundPositionX;if(!A(a)){s(a,"backgroundPositionX","(parseInt(runtimeStyle.offsetLeft)+document."+z+".scrollLeft)||0")}};g.setOffsetLeft=function(c){var a=A(c)?"backgroundPositionX":"offsetLeft";c.runtimeStyle[a]=g.getOffsetLeft(c,c.style.backgroundPositionX)-c.getBoundingClientRect().left-c.clientLeft+2};g.getOffsetLeft=function(c,a){switch(a){case"left":case"top":return 0;case"right":case"bottom":return x.clientWidth-r.offsetWidth;case"center":return(x.clientWidth-r.offsetWidth)/2;default:if(X.test(a)){return parseInt((x.clientWidth-r.offsetWidth)*parseFloat(a)/100)}r.style.left=a;return r.offsetLeft}};g.clipWidth=function(f){var d=f.runtimeStyle.fixWidth;f.runtimeStyle.borderRightWidth="";f.runtimeStyle.width=d?g.getPixelWidth(f,d)+"px":"";if(f.currentStyle.width!=="auto"){var c=f.getBoundingClientRect();var a=f.offsetWidth-x.clientWidth+c.left-2;if(a>=0){f.runtimeStyle.borderRightWidth="0px";a=Math.max(C(f,f.currentStyle.width)-a,0);Y(f,"width",a);return a}}};g.positionLeft=function(c,a){if(!a&&X.test(c.currentStyle.width)){c.runtimeStyle.fixWidth=c.currentStyle.width}if(c.runtimeStyle.fixWidth){c.runtimeStyle.width=g.getPixelWidth(c,c.runtimeStyle.fixWidth)}c.runtimeStyle.shiftLeft=0;c.runtimeStyle._3=c.currentStyle.left;c.runtimeStyle.autoLeft=c.currentStyle.right!=="auto"&&c.currentStyle.left==="auto";c.runtimeStyle.left="";c.runtimeStyle.screenLeft=g.getScreenLeft(c);c.runtimeStyle.pixelLeft=c.runtimeStyle.screenLeft;if(!a&&!A(c.offsetParent)){s(c,"pixelLeft","runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document."+z+".scrollLeft")}};g.getScreenLeft=function(d){var c=d.offsetLeft,a=1;if(d.runtimeStyle.autoLeft){c=x.clientWidth-d.offsetWidth-g.getPixelWidth(d,d.currentStyle.right)}if(d.currentStyle.marginLeft!=="auto"){c-=g.getPixelWidth(d,d.currentStyle.marginLeft)}while(d=d.offsetParent){if(d.currentStyle.position!=="static")a=-1;c+=d.offsetLeft*a}return c};g.getPixelWidth=function(c,a){return X.test(a)?parseInt(parseFloat(a)/100*x.clientWidth):C(c,a)}};eval("var _9="+ce(i));i(j);_9(j)})();if(t<7){var bJ={backgroundColor:"transparent",backgroundImage:"none",backgroundPositionX:null,backgroundPositionY:null,backgroundRepeat:null,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none",borderLeftWidth:0,borderLeftColor:"#000",borderTopColor:"#000",borderRightColor:"#000",borderBottomColor:"#000",height:null,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,width:"100%"};h.CSS.addRecalc("overflow","visible",function(d){if(d.currentStyle.position==="absolute")return;if(d.parentNode.ie7_wrapped)return;if(h.Layout&&d.currentStyle["max-height"]!=="auto"){h.Layout.maxHeight(d)}if(d.currentStyle.marginLeft==="auto")d.style.marginLeft=0;if(d.currentStyle.marginRight==="auto")d.style.marginRight=0;var c=p.createElement(cy);c.ie7_wrapped=d;for(var a in bJ){c.style[a]=d.currentStyle[a];if(bJ[a]!=null){d.runtimeStyle[a]=bJ[a]}}c.style.display="block";c.style.position="relative";d.runtimeStyle.position="absolute";d.parentNode.insertBefore(c,d);c.appendChild(d)})}function dc(){var s="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");for(var q=0;q%4",MATCH:/(.*):(before|after).*/,count:0});h._getLang=function(c){var a="";while(c&&c.nodeType===1){a=c.lang||c.getAttribute("lang")||"";if(a)break;c=c.parentNode}return a};T=O(T,{":lang\\(([^)]+)\\)":"((ii=IE7._getLang(e))==='$1'||ii.indexOf('$1-')===0)&&"})}var dj=/^(submit|reset|button)$/;h.HTML.addRecalc("button,input",function(c){if(c.nodeName==="BUTTON"){var a=c.outerHTML.match(/ value="([^"]*)"/i);c.runtimeStyle.value=a?a[1]:""}if(c.type==="submit"){y(c,"onclick",function(){c.runtimeStyle.clicked=true;setTimeout("document.all."+c.uniqueID+".runtimeStyle.clicked=false",1)})}});h.HTML.addRecalc("form",function(d){y(d,"onsubmit",function(){for(var c,a=0;c=d[a];a++){if(dj.test(c.type)&&!c.disabled&&!c.runtimeStyle.clicked){c.disabled=true;setTimeout("document.all."+c.uniqueID+".disabled=false",1)}else if(c.nodeName==="BUTTON"&&c.type==="submit"){setTimeout("document.all."+c.uniqueID+".value='"+c.value+"'",1);c.value=c.runtimeStyle.value}}})});h.HTML.addRecalc("img",function(a){if(a.alt&&!a.title)a.title=""});if(t<8){h.CSS.addRecalc("border-spacing",bg,function(a){if(a.currentStyle.borderCollapse!=="collapse"){a.cellSpacing=C(a,a.currentStyle["ie7-border-spacing"].split(" ")[0])}});h.CSS.addRecalc("box-sizing","content-box",h.Layout.boxSizing);h.CSS.addRecalc("box-sizing","border-box",h.Layout.borderBox)}if(t<8){var dk=/^image/i;h.HTML.addRecalc("object",function(a){if(dk.test(a.type)){a.body.style.cssText="margin:0;padding:0;border:none;overflow:hidden";return a}})}var bM="!IE7._a(e,'next')&&",cs=bM.replace("next","previous");if(h.CSS.pseudoClasses)h.CSS.pseudoClasses+="|";h.CSS.pseudoClasses+="(?:first|last|only)\\-(?:child|of\\-type)|empty|root|target|"+("not|nth\\-child|nth\\-last\\-child|nth\\-of\\-type|nth\\-last\\-of\\-type".split("|").join(bK+"|")+bK);var bN=new M("checked",function(c){if(typeof c.checked!=="boolean")return;var a=arguments;h.CSS.addEventHandler(c,"onpropertychange",function(){if(event.propertyName==="checked"){if(c.checked===true)bN.register(a);else bN.unregister(a)}});if(c.checked===true)bN.register(a)}),bO=new M("enabled",function(c){if(typeof c.disabled!=="boolean")return;var a=arguments;h.CSS.addEventHandler(c,"onpropertychange",function(){if(event.propertyName==="disabled"){if(c.disabled===false)bO.register(a);else bO.unregister(a)}});if(c.disabled===false)bO.register(a)}),bP=new M("disabled",function(c){if(typeof c.disabled!=="boolean")return;var a=arguments;h.CSS.addEventHandler(c,"onpropertychange",function(){if(event.propertyName==="disabled"){if(c.disabled===true)bP.register(a);else bP.unregister(a)}});if(c.disabled===true)bP.register(a)}),bQ=new M("indeterminate",function(c){if(typeof c.indeterminate!=="boolean")return;var a=arguments;h.CSS.addEventHandler(c,"onpropertychange",function(){if(event.propertyName==="indeterminate"){if(c.indeterminate===true)bQ.register(a);else bQ.unregister(a)}});h.CSS.addEventHandler(c,"onclick",function(){bQ.unregister(a)})}),bR=new M("target",function(c){var a=arguments;if(!c.tabIndex)c.tabIndex=0;h.CSS.addEventHandler(p,"onpropertychange",function(){if(event.propertyName==="activeElement"){if(c.id&&c.id===location.hash.slice(1))bR.register(a);else bR.unregister(a)}});if(c.id&&c.id===location.hash.slice(1))bR.register(a)}),ct=1,bu={_4:1};h._b=function(l,m,j){var i=l.parentNode;if(!i||i.nodeType!==1)return NaN;var g=j?l.nodeName:"";if(g==="TR"&&l.sectionRowIndex>=0){var c=l.sectionRowIndex;return m?l.parentNode.rows.length-c+1:c}if((g==="TD"||g==="TH")&&l.cellIndex>=0){c=l.cellIndex;return m?l.parentNode.cells.length-c+1:c}if(bu._4!==ct){bu={_4:ct}}var f=(i.uniqueID)+"-"+g,d=bu[f];if(!d){d={};var c=0,a=i.firstChild;while(a){if(j?a.nodeName===g:a.nodeName>"@"){d[a.uniqueID]=++c}a=a.nextSibling}d.length=c;bu[f]=d}c=d[l.uniqueID];return m?d.length-c+1:c};h._c=function(a){a=a.firstChild;while(a){if(a.nodeType===3||a.nodeName>"@")return false;a=a.nextSibling}return true};h._a=function(d,c){var a=d.nodeName;c+="Sibling";do{d=d[c];if(d&&d.nodeName===a)break}while(d);return d};var dl={"+":1,"-":-1},dm=/ /g;T=O(O({":nth(-last)?-(?:child|(of-type))\\((<#nth_arg>)\\)(<#filter>)?":function(m,j,i,g,f){g=g.replace(dm,"");var d="IE7._b(e,"+!!j+","+!!i+")";if(g==="even")g="2n";else if(g==="odd")g="2n+1";else if(!isNaN(g))g="0n"+~~g;g=g.split("n");var c=~~(dl[g[0]]||g[0]||1),b=~~g[1];if(c===0){var a=d+"==="+b}else{a="((ii="+d+")-("+b+"))%"+c+"===0&&ii"+(c<0?"<":">")+"="+b}return this.parse(f)+a+"&&"},"<#negation>":function(c,a){if(/:not/i.test(a))bv();if(/^[#.:\[]/.test(a)){a="*"+a}return"!("+D.parse(a).slice(3,-2)+")&&"}},T),{":checked":"e.checked===true&&",":disabled":"e.disabled===true&&",":enabled":"e.disabled===false&&",":last-child":"!"+bE+"&&",":only-child":"!"+ck+"&&!"+bE+"&&",":first-of-type":cs,":last-of-type":bM,":only-of-type":cs+bM,":empty":"IE7._c(e)&&",":root":"e==R&&",":target":"H&&"+cn+"===H&&"});var dn="article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");for(var cu=0,cv;cv=dn[cu];cu++)p.createElement(cv);U+="datalist{display:none}details{padding-left:40px;display:block;margin:1em 0}meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}progress{width:10em;}article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}figure{margin:1em 40px;display:block}mark{background:yellow}";h.CSS.addFix(/\bopacity\s*:\s*([\d.]+)/,function(c,a){return"zoom:1;filter:Alpha(opacity="+((a*100)||1)+")"});var D,J=(function(){var o0=/^[>+~]/,bw=false;function dp(f,d,c){f=bZ(f);if(!d)d=p;var a=d;bw=o0.test(f);if(bw){d=d.parentNode;f="*"+f}try{return n.create(f,bw)(d,c?null:[],a)}catch(ex){return c?null:[]}};var dq=/^(\\.|[' >+~#.\[\]:*(),\w-\^|$=]|[^\x00-\xa0])+$/,dE=/^(href|src)$/,cw={"class":"className","for":"htmlFor"},dF=/\sie7_\w+/g,dr=/^(action|cite|codebase|data|dynsrc|href|longdesc|lowsrc|src|usemap|url)$/i;h._0=function(f,d){if(f.getAttributeNode){var c=f.getAttributeNode(d)}d=cw[d.toLowerCase()]||d;if(!c)c=f.attributes[d];var a=c&&c.specified;if(f[d]&&typeof f[d]=="boolean")return d.toLowerCase();if((a&&dr.test(d))||(!c&&E)||d==="value"||d==="type"){return f.getAttribute(d,2)}if(d==="style")return f.style.cssText.toLowerCase()||null;return a?String(c.nodeValue):null};var cx="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";O(cw,cO(cx.toLowerCase().split(","),cx.split(",")));h._1=function(c,a){a+="Sibling";do{c=c[a];if(c&&c.nodeName>"@")break}while(c);return c};var ds=/(^|[, >+~])([#.:\[])/g,dG=/\)\{/g,dt=/,/,dH=/^['"]/,du=/\\([\da-f]{2,2})/gi,dI=/last/i;h._d=function(f,d){var c=f.all[d]||null;if(!c||(c.nodeType&&h._0(c,"id")===d))return c;for(var a=0;a+~]/,operator:/[\^~|$*]?=/,nth_arg:/[+-]?\d+|[+-]?\d*n(?:\s*[+-]\s*\d+)?|even|odd/,tag:/\*|<#ident>/,id:/#(<#ident>)/,'class':/\.(<#ident>)/,pseudo:/\:([\w-]+)(?:\(([^)]+)\))?/,attr:/\[(<#ident>)(?:(<#operator>)((?:\\.|[^\[\]#.:])+))?\]/,negation:/:not\((<#tag>|<#id>|<#class>|<#attr>|<#pseudo>)\)/,sequence:/(\\.|[~*]=|\+\d|\+?\d*n\s*\+\s*\d|[^\s>+~,\*])+/,filter:/[#.:\[]<#sequence>/,selector:/[^>+~](\\.|[^,])*?/,grammar:/^(<#selector>)((,<#selector>)*)$/}),ignoreCase:true}),dv=new bb({"\\\\.|[~*]\\s+=|\\+\\s+\\d":G.IGNORE,"\\[\\s+":"[","\\(\\s+":"(","\\s+\\)":")","\\s+\\]":"]","\\s*([,>+~]|<#operator>)\\s*":"$1","\\s+$":"","\\s+":" "});function dw(a){a=dv.parse(a.replace(du,"\\x$1")).replace(bz,"$1").replace(ds,"$1*$2");if(!dq.test(a))bv();return a};function dJ(a){return a.replace(cb,dx)};function dx(c,a){return W[a]};var dy=/\{/g,dz=/\\{/g;function bS(a){return Array((a.replace(dz,"").match(dy)||"").length+1).join("}")};T=new bb(T);var v=/:target/i,Z=/:root/i;function S(c){var a="";if(Z.test(c))a+=",R=d.documentElement";if(v.test(c))a+=",H=d.location;H=H&&H.hash.replace('#','')";if(a||c.indexOf("#")!==-1){a=",t=c.nodeType,d=t===9?c:c.ownerDocument||(c.document||c).parentWindow.document"+a}return"var ii"+a+";"};var ba={" ":";while(e!=s&&(e=e.parentNode)&&e.nodeType===1){",">":".parentElement;if(e){","+":";while((e=e.previousSibling)&&!("+cl+"))continue;if(e){","~":";while((e=e.previousSibling)){"+cm},K=/\be\b/g;D=new bb({"(?:(<#selector>)(<#combinator>))?(<#tag>)(<#filter>)?$":function(j,i,g,f,d){var c="";if(f!=="*"){var a=f.toUpperCase();c+="if(e.nodeName==='"+a+(a===f?"":"'||e.nodeName==='"+f)+"'){"}if(d){c+="if("+T.parse(d).slice(0,-2)+"){"}c=c.replace(K,"e"+this.index);if(g){c+="var e=e"+(this.index++)+ba[g];c=c.replace(K,"e"+this.index)}if(i){c+=this.parse(i)}return c}});var L="e0=IE7._d(d,'%1');if(e0){",z="var n=c.getElementsByTagName('%1');",w="if(r==null)return e0;r[k++]=e0;",r=1,A=new bb({"^((?:<#selector>)?(?:<#combinator>))(<#tag>)(<#filter>)?$":true}),s={},q=new bb({"^(<#tag>)#(<#ident>)(<#filter>)?( [^,]*)?$":function(j,i,g,f,d){var c=H(L,g),a="}";if(f){c+=D.parse(i+f);a=bS(c)}if(d){c+="s=c=e0;"+n.parse("*"+d)}else{c+=w}return c+a},"^([^#,]+)#(<#ident>)(<#filter>)?$":function(g,f,d,c){var a=H(L,d);if(f==="*"){a+=w}else{a+=D.parse(f+c)+w+"break"}return a+bS(a)},"^.*$":""}),n=new bb({"<#grammar>":function(k,l,m){if(!this.groups)this.groups=[];var j=A.exec(" "+l);if(!j)bv();this.groups.push(j.slice(1));if(m){return this.parse(m.replace(dt,""))}var i=this.groups,g=i[0][r];for(var c=1;j=i[c];c++){if(g!==j[r]){g="*";break}}var f="",d=w+"continue filtering;";for(var c=0;j=i[c];c++){D.index=0;if(g!=="*")j[r]="*";j=j.join("");if(j===" *"){f=d;break}else{j=D.parse(j);if(bw)j+="if(e"+D.index+"==s){";f+=j+d+bS(j)}}var a=g==="*";return(a?"var n=c.all;":H(z,g))+"filtering:while((e0=n[i++]))"+(a?cm.replace(K,"e0"):"{")+f+"}"},"^.*$":bv}),o=/\&\&(e\d+)\.nodeType===1(\)\{\s*if\(\1\.nodeName=)/g;n.create=function(d){if(!s[d]){d=dw(d);this.groups=null;D.index=0;var c=this.parse(d);this.groups=null;D.index=0;if(d.indexOf("#")!==-1){var a=q.parse(d);if(a){c="if(t===1||t===11|!c.getElementById){"+c+"}else{"+a+"}"}}c=c.replace(o,"$2");c=S(d)+bd(c);s[d]=new Function("return function(c,r,s){var i=0,k=0,e0;"+c+"return r}")()}return s[d]};return dp})();function bv(){throw new SyntaxError("Invalid selector.");};h.loaded=true;(function(){try{if(!p.body)throw"continue";bx.doScroll("left")}catch(ex){setTimeout(arguments.callee,1);return}try{eval(bU.innerHTML)}catch(ex){}if(typeof IE7_PNG_SUFFIX=="object"){bh=IE7_PNG_SUFFIX}else{bh=new RegExp(bY(N.IE7_PNG_SUFFIX||"-trans.png")+"(\\?.*)?$","i")}B=p.body;x=E?B:bx;B.className+=" ie7_body";bx.className+=" ie7_html";if(E)dc();h.CSS.init();h.HTML.init();h.HTML.apply();h.CSS.apply();h.recalc()})()})(this,document);