Permalink
Browse files

Removed old javascripts

  • Loading branch information...
1 parent 9197b03 commit 27c7b863a2a9bd26b059effbdeb1c176f418ab4f @mcfiredrill committed Dec 7, 2011
@@ -1,128 +0,0 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
-
-function insert_emoticon(text) {
- var my_text = $('leaf_content').value;
- var caret_pos = $('leaf_content').selectionEnd;
-
- $(leaf_content).value = my_text.substring(0, caret_pos)
- + text
- + my_text.substring(caret_pos);
-}
-
-document.observe("dom:loaded", function() {
- // the element in which we will observe all clicks and capture
- // ones originating from pagination links
- var container = $(document.body);
-
- if (container) {
- var img = new Image;
- img.src = '/images/spinner.gif';
-
- function createSpinner() {
- return new Element('img', { src: img.src, 'class': 'spinner' });
- }
-
- container.observe('click', function(e) {
- var el = e.element();
- if (el.match('.pagination a')) {
- window.scrollTo(0,0);
- el.up('.pagination').insert(createSpinner());
- target = $('branches');
- new Ajax.Request(el.href,
- {
- method: 'get'
- })
- e.stop();
- }
- });
- }
-});
-
-/* yoinked from wakaba */
-function get_cookie(name)
-{
- with(document.cookie)
- {
- var regexp=new RegExp("(^|;\\s+)"+name+"=(.*?)(;|$)");
- var hit=regexp.exec(document.cookie);
- if(hit&&hit.length>2) return unescape(hit[2]);
- else return '';
- }
-}
-
-function set_cookie(name,value,days)
-{
- if(days)
- {
- var date=new Date();
- date.setTime(date.getTime()+(days*24*60*60*1000));
- var expires="; expires="+date.toGMTString();
- }
- else expires="";
- document.cookie=name+"="+value+expires+"; path=/";
-}
-
-function set_stylesheet(styletitle)
-{
- var links=document.getElementsByTagName("link");
- var found=false;
- for(var i=0;i<links.length;i++)
- {
- var rel=links[i].getAttribute("rel");
- var title=links[i].getAttribute("title");
- if(rel.indexOf("style")!=-1&&title)
- {
- links[i].disabled=true; // IE needs this to work. IE needs to die.
- if(styletitle==title) { links[i].disabled=false; found=true; }
- }
- }
- if(!found) set_preferred_stylesheet();
-}
-
-function set_preferred_stylesheet()
-{
- var links=document.getElementsByTagName("link");
- for(var i=0;i<links.length;i++)
- {
- var rel=links[i].getAttribute("rel");
- var title=links[i].getAttribute("title");
- if(rel.indexOf("style")!=-1&&title) links[i].disabled=(rel.indexOf("alt")!=-1);
- }
-}
-
-function get_preferred_stylesheet()
-{
- var links=document.getElementsByTagName("link");
- for(var i=0;i<links.length;i++)
- {
- var rel=links[i].getAttribute("rel");
- var title=links[i].getAttribute("title");
- if(rel.indexOf("style")!=-1&&rel.indexOf("alt")==-1&&title) return title;
- }
- return null;
-}
-
-function get_active_stylesheet()
-{
- var links=document.getElementsByTagName("link");
- for(var i=0;i<links.length;i++)
- {
- var rel=links[i].getAttribute("rel");
- var title=links[i].getAttribute("title");
- if(rel.indexOf("style")!=-1&&title&&!links[i].disabled) return title;
- }
-}
-
-window.onunload=function(e)
-{
- var title=get_active_stylesheet();
- set_cookie('style_cookie',title,365);
-}
-
-window.onload=function(e)
-{
- var cookie=get_cookie('style_cookie');
- var title=cookie?cookie:get_preferred_stylesheet();
- set_stylesheet(title);
-}
Oops, something went wrong. Retry.

0 comments on commit 27c7b86

Please sign in to comment.