From ebf6365b06fe97bdd0d6cdb338e35f95527fe58d Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Mon, 22 Sep 2008 19:31:52 +0200
Subject: [PATCH 01/94] fixed the order of javascripts - hotkeys now work
---
git-wiki.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index a6126bb7..cc6d963c 100755
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -165,7 +165,7 @@ def list_item(page)
%head
%title= title
%link{:rel => 'stylesheet', :href => '/_stylesheet.css', :type => 'text/css'}
- - Dir[Sinatra.application.options.public + '/*.js'].reverse.each do |lib|
+ - Dir[Sinatra.application.options.public + '/*.js'].sort.each do |lib|
%script{:src => "/#{File.basename(lib)}", :type => 'text/javascript'}
:javascript
$(document).ready(function() {
From 87f60efe27b3746f76f715623f3409f179ef06b7 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 09:00:31 +0100
Subject: [PATCH 02/94] Better hotkeys
---
git-wiki.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index a6126bb7..dcf2339d 100755
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -169,8 +169,8 @@ def list_item(page)
%script{:src => "/#{File.basename(lib)}", :type => 'text/javascript'}
:javascript
$(document).ready(function() {
- $.hotkeys.add('Ctrl+h', function() { document.location = '/#{Homepage}' })
- $.hotkeys.add('Ctrl+l', function() { document.location = '/_list' })
+ $.hotkeys.add('Ctrl+1', function() { document.location = '/#{Homepage}' })
+ $.hotkeys.add('Ctrl+2', function() { document.location = '/_list' })
/* title-case-ification */
document.title = document.title.toTitleCase();
From ba9893ce1ffdf58ceb63eb7cc0154219a9daa0f9 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 15:15:51 +0100
Subject: [PATCH 03/94] Support for images
---
git-wiki.rb | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index 9a036dca..77591bcf 100644
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -148,6 +148,16 @@ class App < Sinatra::Base
haml :list
end
+ get "/img/*" do
+ git_obj = GitWiki.repository.tree/'img'
+ params[:splat].each do |part|
+ git_obj = git_obj/part
+ not_found if git_obj.nil?
+ end
+ content_type File.extname(params[:splat].last)
+ body git_obj.data
+ end
+
get "/:page/edit" do
@page = Page.find_or_create(params[:page])
haml :edit
@@ -182,8 +192,6 @@ def list_item(page)
%html
%head
%title= title
- $.hotkeys.add('Ctrl+1', function() { document.location = '/#{Homepage}' })
- $.hotkeys.add('Ctrl+2', function() { document.location = '/_list' })
%body
%ul
%li
From 6e576388e8fd7c7b6904a5e74b4b22a4ba0a497b Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 17:35:15 +0100
Subject: [PATCH 04/94] Make custom h1 possible
---
git-wiki.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index 77591bcf..61310595 100644
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -75,7 +75,9 @@ def initialize(blob)
end
def to_html
- RDiscount.new(wiki_link(content)).to_html
+ html = RDiscount.new(wiki_link(content)).to_html
+ html = "
#{name}
" + html unless html =~ /
/
+ html
end
def to_s
@@ -204,7 +206,6 @@ def list_item(page)
- title @page.name
#edit
%a{:href => "/#{@page}/edit"} Edit this page
-%h1= title
#content
~"#{@page.to_html}"
From cea0bb52ba69dd045b22b8b83b20c77395893fc4 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 17:53:39 +0100
Subject: [PATCH 05/94] Update fork's README
---
README.markdown | 44 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 39 insertions(+), 5 deletions(-)
diff --git a/README.markdown b/README.markdown
index aadc5555..7a45c352 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1,9 +1,44 @@
-git-wiki: because who needs cool names when you use git?
-========================================================
+git-wiki
+========
git-wiki is a wiki that relies on git to keep pages' history
and [Sinatra][] to serve them.
+Features of this fork
+---------------------
+
+## Support for images
+
+You can add images to /img folder of your git repository. Subfolders are
+also supported. At least gif, png and jpg supported - content type is
+set automatically by Sinatra. You can reference the images then from
+your wiki pages like ``
+
+No web interface at this time - use `git commit`.
+
+
+## Custom h1 header
+
+If your wiki page contains a markdown h1 header, then
+this one is used on the page.
+
+If not, then h1 is created out of the file name (as in original git-wiki).
+
+
+Plans
+-----
+
+* support for attachments
+* nicer CSS
+* support for deeper Wiki page folder structure
+* do not rely on wiki words
+* support for special programmed pages - via haml or liquid template
+ engine
+
+
+Original README by Simon Rozet
+------------------------------
+
I wrote git-wiki as a quick and dirty hack, mostly to play with Sinatra.
It turned out that Sinatra is an awesome little web framework and that this
hack isn't as useless as I first though since I now use it daily.
@@ -11,13 +46,12 @@ hack isn't as useless as I first though since I now use it daily.
However, it is definitely not feature rich and will probably never be because
I mostly use it as a web frontend for `git`, `ls` and `vim`.
-If you want history, search, etc. you should look at other people's [forks][],
-especially [al3x][]'s one.
+If you want history, search, etc. you should look at other people's [forks][].
Install
-------
-The fellowing [gems][] are required to run git-wiki:
+The following [gems][] are required to run git-wiki:
- [Sinatra][]
- [mojombo-grit][]
From 1ed9de0aa9cde7677bbfbdc016661bb7ab15f2c0 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 17:57:10 +0100
Subject: [PATCH 06/94] More polite license
---
README.markdown | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/README.markdown b/README.markdown
index 7a45c352..14a3101e 100644
--- a/README.markdown
+++ b/README.markdown
@@ -7,7 +7,7 @@ and [Sinatra][] to serve them.
Features of this fork
---------------------
-## Support for images
+### Support for images
You can add images to /img folder of your git repository. Subfolders are
also supported. At least gif, png and jpg supported - content type is
@@ -17,7 +17,7 @@ your wiki pages like ``
No web interface at this time - use `git commit`.
-## Custom h1 header
+### Custom h1 header
If your wiki page contains a markdown h1 header, then
this one is used on the page.
@@ -118,17 +118,20 @@ then sync your changes back when you're done.
Git is the next Unix
-Licence
--------
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- Version 2, December 2004
-
- Copyright (C) 2008 Simon Rozet
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. You just DO WHAT THE FUCK YOU WANT TO.
+MIT license
+-----------
+Copyright (c) 2009 Vladimir Dobriakov, vladimir.dobriakov@innoq.com
+Copyright (c) Simon Rozet
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
From 93d2a97c95271ca20119d9af6f2bd43345279fef Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 17:59:20 +0100
Subject: [PATCH 07/94] Format README
---
README.markdown | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.markdown b/README.markdown
index 14a3101e..db1ac64e 100644
--- a/README.markdown
+++ b/README.markdown
@@ -4,12 +4,12 @@ git-wiki
git-wiki is a wiki that relies on git to keep pages' history
and [Sinatra][] to serve them.
-Features of this fork
+Features of this fork (by geekQ)
---------------------
### Support for images
-You can add images to /img folder of your git repository. Subfolders are
+You can add images to `/img` folder of your git repository. Subfolders are
also supported. At least gif, png and jpg supported - content type is
set automatically by Sinatra. You can reference the images then from
your wiki pages like ``
@@ -122,6 +122,7 @@ Git is the next Unix
MIT license
-----------
Copyright (c) 2009 Vladimir Dobriakov, vladimir.dobriakov@innoq.com
+
Copyright (c) Simon Rozet
Permission is hereby granted, free of charge, to any person obtaining
From 6ade2b4420c0398f963d90747f331b83b4db9018 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Sun, 25 Oct 2009 19:08:36 +0100
Subject: [PATCH 08/94] CSS for navigation
---
git-wiki.rb | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index 61310595..73997a63 100644
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -194,20 +194,40 @@ def list_item(page)
%html
%head
%title= title
+ %style
+ :sass
+ body
+ margin-left: 2em
+ ul#navigation
+ list-style-type: none
+ display: inline
+ margin: 0
+ padding: 0
+ li
+ display: inline
+ margin: 0
+ padding: 0
+ padding-right: 1em
+ a.service
+ color: #4377EF
+ text-decoration: none
+ font-weight: bold
+ a.service:hover
+ border-bottom: 2px dotted #4377EF
%body
- %ul
+ %ul#navigation
%li
- %a{ :href => "/#{GitWiki.homepage}" } Home
+ %a.service{ :href => "/#{GitWiki.homepage}" } Home
%li
- %a{ :href => "/pages" } All pages
+ %a.service{ :href => "/pages" } All pages
#content= yield
@@ show
- title @page.name
-#edit
- %a{:href => "/#{@page}/edit"} Edit this page
#content
~"#{@page.to_html}"
+#edit
+ %a.service{:href => "/#{@page}/edit"} Edit this page
@@ edit
- title "Editing #{@page.name}"
From 2ce8a597567fd1e6aa559f33c5e8d9d67bc7feb1 Mon Sep 17 00:00:00 2001
From: Vladimir Dobriakov
Date: Thu, 29 Oct 2009 07:51:05 +0100
Subject: [PATCH 09/94] CSS for print
---
git-wiki.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/git-wiki.rb b/git-wiki.rb
index 73997a63..2b38e050 100644
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -214,6 +214,9 @@ def list_item(page)
font-weight: bold
a.service:hover
border-bottom: 2px dotted #4377EF
+ @media print
+ .service
+ display: none
%body
%ul#navigation
%li
From 39cd5c5abb99ee8b59bd73af3ac059f329d2914c Mon Sep 17 00:00:00 2001
From: docunext
Date: Mon, 7 Dec 2009 10:29:07 -0500
Subject: [PATCH 10/94] Changed path to rackup and syntax for page names and
link text
---
git-wiki.rb | 8 +++++---
run.ru | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index aad7d1cc..e99393e3 100755
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -117,9 +117,11 @@ def commit_message
end
def wiki_link(str)
- str.gsub(/([A-Z][a-z]+[A-Z][A-Za-z0-9]+)/) { |page|
- %Q{#{page}}
+ str.gsub(/\[\[([^\]]+\]\])/) { |page|
+ file = page.downcase.gsub('[','').gsub(']','').gsub(/[^a-z0-9]/,'_');
+ linktext = page.gsub('[','').gsub(']','');
+ %Q{#{linktext}}
}
end
end
diff --git a/run.ru b/run.ru
index 664eb858..0d72c2fc 100755
--- a/run.ru
+++ b/run.ru
@@ -1,5 +1,5 @@
-#!/usr/bin/env rackup
+#!/usr/bin/rackup1.8
require File.dirname(__FILE__) + "/git-wiki"
run GitWiki.new(File.expand_path(ARGV[1] || "~/wiki"),
- ARGV[2] || ".markdown", ARGV[3] || "Home")
+ ARGV[2] || ".mdwn", ARGV[3] || "Home")
From 750bf01f89d7949d8d08fd405b631dce8bdd373f Mon Sep 17 00:00:00 2001
From: docunext
Date: Mon, 14 Dec 2009 19:33:31 -0500
Subject: [PATCH 11/94] more work on the names
---
git-wiki.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/git-wiki.rb b/git-wiki.rb
index e99393e3..63b4670b 100755
--- a/git-wiki.rb
+++ b/git-wiki.rb
@@ -120,7 +120,7 @@ def wiki_link(str)
str.gsub(/\[\[([^\]]+\]\])/) { |page|
file = page.downcase.gsub('[','').gsub(']','').gsub(/[^a-z0-9]/,'_');
linktext = page.gsub('[','').gsub(']','');
- %Q{#{linktext}}
}
end
@@ -168,12 +168,13 @@ class App < Sinatra::Base
private
def title(title=nil)
- @title = title.to_s unless title.nil?
+ @title = title.to_s.gsub('_',' ').gsub(/\b\w+/){$&.capitalize} unless title.nil?
@title
end
def list_item(page)
- %Q{#{page.name}}
+ title = page.name.gsub('_',' ').gsub(/\b\w+/){$&.capitalize}
+ %Q{#{title}}
end
end
end
@@ -184,6 +185,7 @@ def list_item(page)
%html
%head
%title= title
+ %style{ :type=> "text/css" } .unknown { color:red; }
%body
%ul
%li
From 5ed311c1e0ce49c537efbf0a0b7252e994b2b4b9 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:31:36 -0500
Subject: [PATCH 12/94] new TODO
---
TODO | 1 +
1 file changed, 1 insertion(+)
create mode 100644 TODO
diff --git a/TODO b/TODO
new file mode 100644
index 00000000..a658ff75
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Use XSLT instead of Haml.
From 5317c2b0ae61ee5d6e075fa15cd3b69461d2582f Mon Sep 17 00:00:00 2001
From: Docunext
Date: Thu, 17 Dec 2009 00:33:37 -0500
Subject: [PATCH 13/94] hu
---
TODO | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 TODO
diff --git a/TODO b/TODO
deleted file mode 100644
index a658ff75..00000000
--- a/TODO
+++ /dev/null
@@ -1 +0,0 @@
-Use XSLT instead of Haml.
From 0fa681bdd51024d4b6b0905c2b7cff4a3cd43c04 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:34:42 -0500
Subject: [PATCH 14/94] new TODO
---
TODO | 1 +
1 file changed, 1 insertion(+)
create mode 100644 TODO
diff --git a/TODO b/TODO
new file mode 100644
index 00000000..3eacbba3
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Use XSL instead of Haml.
From c9036d9c3668c4873ed5e15ae3ddc3a928b886e7 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:39:26 -0500
Subject: [PATCH 15/94] mini
---
TODO | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 3eacbba3..efbcc54d 100644
--- a/TODO
+++ b/TODO
@@ -1 +1,2 @@
-Use XSL instead of Haml.
+Use Rack XSL instead of Haml.
+
From 1b1f4e79037a846ad53a5eedab7d8842fc8269ce Mon Sep 17 00:00:00 2001
From: Docunext
Date: Thu, 17 Dec 2009 00:40:18 -0500
Subject: [PATCH 16/94] huh
---
TODO | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/TODO b/TODO
index efbcc54d..3eacbba3 100644
--- a/TODO
+++ b/TODO
@@ -1,2 +1 @@
-Use Rack XSL instead of Haml.
-
+Use XSL instead of Haml.
From 6d81fa5d1b3702e3844b2a9d7dce7ce21ab17d05 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:43:56 -0500
Subject: [PATCH 17/94] rack
---
TODO | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 3eacbba3..5855e86f 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-Use XSL instead of Haml.
+Use Rack XSL instead of Haml.
From 9aae89ddd0316cba8c29f60b0295b05221c6bf3a Mon Sep 17 00:00:00 2001
From: Docunext
Date: Thu, 17 Dec 2009 00:47:08 -0500
Subject: [PATCH 18/94] huh
---
TODO | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 5855e86f..3eacbba3 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-Use Rack XSL instead of Haml.
+Use XSL instead of Haml.
From 31464dcd6ec9b815e88691f039a460d883eda197 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:49:36 -0500
Subject: [PATCH 19/94] rack
---
TODO | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 3eacbba3..5855e86f 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-Use XSL instead of Haml.
+Use Rack XSL instead of Haml.
From e6f8879fa752223fee5a51dd4e520cd9f2f793e6 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:50:34 -0500
Subject: [PATCH 20/94] rack
---
TODO | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 3eacbba3..5855e86f 100644
--- a/TODO
+++ b/TODO
@@ -1 +1 @@
-Use XSL instead of Haml.
+Use Rack XSL instead of Haml.
From 8f06488f5391bba8eee1bff12a209ab762b82910 Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:55:05 -0500
Subject: [PATCH 21/94] mini
---
TODO | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/TODO b/TODO
index 5855e86f..a8f429cd 100644
--- a/TODO
+++ b/TODO
@@ -1 +1,2 @@
-Use Rack XSL instead of Haml.
+* Use Rack XSL instead of Haml.
+* Ruby GD?
From 2bf4051e5c35ddc9c9100ae3e013e0c53d9b9c3e Mon Sep 17 00:00:00 2001
From: docunext
Date: Thu, 17 Dec 2009 00:57:32 -0500
Subject: [PATCH 22/94] null
---
minitest | 1 +
1 file changed, 1 insertion(+)
create mode 100644 minitest
diff --git a/minitest b/minitest
new file mode 100644
index 00000000..e0fadc27
--- /dev/null
+++ b/minitest
@@ -0,0 +1 @@
+deleteme
From 5730d2129801600463506488e4dafdbd7c396e48 Mon Sep 17 00:00:00 2001
From: docunext
Date: Sun, 20 Dec 2009 01:44:57 -0500
Subject: [PATCH 23/94] setting up static files
---
public/s/js/docu-not-git-wiki.js | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 public/s/js/docu-not-git-wiki.js
diff --git a/public/s/js/docu-not-git-wiki.js b/public/s/js/docu-not-git-wiki.js
new file mode 100644
index 00000000..e69de29b
From 9ffb8214b215b1f3739ca1223de80d4c08fc0c27 Mon Sep 17 00:00:00 2001
From: docunext
Date: Sun, 20 Dec 2009 01:58:03 -0500
Subject: [PATCH 24/94] jquery
---
public/s/js/jquery/jquery-1.3.2.min.js | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 public/s/js/jquery/jquery-1.3.2.min.js
diff --git a/public/s/js/jquery/jquery-1.3.2.min.js b/public/s/js/jquery/jquery-1.3.2.min.js
new file mode 100644
index 00000000..b1ae21d8
--- /dev/null
+++ b/public/s/js/jquery/jquery-1.3.2.min.js
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"