magic_grid 0.9.3 → 0.9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +2 -1
- data/README.md +42 -0
- data/Rakefile +2 -15
- data/lib/magic_grid/version.rb +1 -1
- data/spec/definition_spec.rb +47 -0
- data/spec/helpers_spec.rb +75 -0
- data/spec/spec_helper.rb +46 -0
- metadata +43 -714
- data/README.rdoc +0 -19
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -50071
- data/test/dummy/log/passenger.3000.log +0 -362
- data/test/dummy/log/test.log +0 -77
- data/test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212 +0 -0
- data/test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6 +0 -0
- data/test/dummy/tmp/cache/assets/CC7/220/sprockets%2Fd066c004d1fd26ae76a61303a7a18145 +0 -0
- data/test/dummy/tmp/cache/assets/CC9/CD0/sprockets%2Fd14b4504301b7b44b32bbb81929e419a +0 -0
- data/test/dummy/tmp/cache/assets/CD5/B70/sprockets%2F416150dc3ac35079c94273cc46e90aa6 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea +0 -0
- data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/test/dummy/tmp/cache/assets/D1A/310/sprockets%2F5384ad85f52d3272dbc64d46ef3876a4 +0 -0
- data/test/dummy/tmp/cache/assets/D30/820/sprockets%2Ffbb017837adf4b4486b10683c4c1af30 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D59/BC0/sprockets%2Fb3a75b50e55b5cc61ca234ea3e684a30 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D5F/9C0/sprockets%2Fa3922762ba5091b4a27f1c09f2fbb4fb +0 -0
- data/test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
- data/test/dummy/tmp/cache/assets/D71/EE0/sprockets%2Fca1606e8fd72d043cc6746bad760b9f7 +0 -0
- data/test/dummy/tmp/cache/assets/D8E/B70/sprockets%2F5175c0aae5001ef8abf8671aa2456cdd +0 -0
- data/test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/test/dummy/tmp/cache/assets/DA1/E20/sprockets%2F84c2bd8ba93beb86bb554f84b37bf710 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/tarantula/images/header_bg.jpg +0 -0
- data/test/dummy/tmp/tarantula/images/logo.png +0 -0
- data/test/dummy/tmp/tarantula/images/tagline.png +0 -0
- data/test/dummy/tmp/tarantula/index.html +0 -7834
- data/test/dummy/tmp/tarantula/javascripts/jquery-1.2.3.js +0 -3408
- data/test/dummy/tmp/tarantula/javascripts/jquery-ui-tabs.js +0 -890
- data/test/dummy/tmp/tarantula/javascripts/jquery.tablesorter.js +0 -861
- data/test/dummy/tmp/tarantula/javascripts/tarantula.js +0 -10
- data/test/dummy/tmp/tarantula/stylesheets/tarantula.css +0 -346
- data/test/dummy/tmp/tarantula/test_posts/1.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/10.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/11.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/12.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/13.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/14.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/15.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/16.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/17.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/18.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/19.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/2.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/20.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/21.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/22.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/23.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/24.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/25.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/26.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/27.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/28.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/29.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/3.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/30.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/31.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/32.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/4.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/5.html +0 -69
- data/test/dummy/tmp/tarantula/test_posts/6.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/7.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/8.html +0 -71
- data/test/dummy/tmp/tarantula/test_posts/9.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/100.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/101.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/102.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/103.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/104.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/105.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/106.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/107.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/108.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/109.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/110.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/111.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/112.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/113.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/114.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/115.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/116.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/117.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/118.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/119.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/120.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/121.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/122.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/123.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/124.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/125.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/126.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/127.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/128.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/129.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/130.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/131.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/132.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/133.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/134.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/135.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/136.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/137.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/138.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/139.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/140.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/141.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/142.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/143.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/144.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/145.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/146.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/147.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/148.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/149.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/150.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/151.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/152.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/153.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/154.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/155.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/156.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/157.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/158.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/159.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/160.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/161.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/162.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/163.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/164.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/165.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/166.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/167.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/168.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/169.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/170.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/171.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/172.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/173.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/174.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/175.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/176.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/177.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/178.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/179.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/180.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/181.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/182.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/183.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/184.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/185.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/186.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/187.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/188.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/189.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/190.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/191.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/192.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/193.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/194.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/195.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/196.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/197.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/198.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/199.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/200.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/201.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/202.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/203.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/204.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/205.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/206.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/207.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/208.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/209.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/210.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/211.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/212.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/213.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/214.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/215.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/216.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/217.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/218.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/219.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/220.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/221.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/222.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/223.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/224.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/225.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/226.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/227.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/228.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/229.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/230.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/231.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/232.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/233.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/234.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/235.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/236.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/237.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/238.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/239.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/240.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/241.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/242.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/243.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/244.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/245.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/246.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/247.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/248.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/249.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/250.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/251.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/252.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/253.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/254.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/255.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/256.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/257.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/258.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/259.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/260.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/261.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/262.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/263.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/264.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/265.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/266.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/267.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/268.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/269.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/270.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/271.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/272.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/273.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/274.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/275.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/276.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/277.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/278.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/279.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/280.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/281.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/282.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/283.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/284.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/285.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/286.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/287.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/288.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/289.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/290.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/291.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/292.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/293.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/294.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/295.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/296.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/297.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/298.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/299.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/300.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/301.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/302.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/303.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/304.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/305.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/306.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/307.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/308.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/309.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/31.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/310.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/311.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/312.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/313.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/314.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/315.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/316.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/32.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/33.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/34.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/35.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/36.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/37.html +0 -69
- data/test/dummy/tmp/tarantula/test_users/38.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/39.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/40.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/41.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/42.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/43.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/44.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/45.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/46.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/47.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/48.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/49.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/50.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/51.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/52.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/53.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/54.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/55.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/56.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/57.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/58.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/59.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/60.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/61.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/62.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/63.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/64.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/65.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/66.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/67.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/68.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/69.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/70.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/71.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/72.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/73.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/74.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/75.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/76.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/77.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/78.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/79.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/80.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/81.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/82.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/83.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/84.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/85.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/86.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/87.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/88.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/89.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/90.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/91.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/92.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/93.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/94.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/95.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/96.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/97.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/98.html +0 -71
- data/test/dummy/tmp/tarantula/test_users/99.html +0 -71
@@ -1,861 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* TableSorter 2.0 - Client-side table sorting with ease!
|
4
|
-
* Version 2.0.1
|
5
|
-
* @requires jQuery v1.2.1
|
6
|
-
*
|
7
|
-
* Copyright (c) 2007 Christian Bach
|
8
|
-
* Examples and docs at: http://tablesorter.com
|
9
|
-
* Dual licensed under the MIT and GPL licenses:
|
10
|
-
* http://www.opensource.org/licenses/mit-license.php
|
11
|
-
* http://www.gnu.org/licenses/gpl.html
|
12
|
-
*
|
13
|
-
*/
|
14
|
-
/**
|
15
|
-
*
|
16
|
-
* @description Create a sortable table with multi-column sorting capabilitys
|
17
|
-
*
|
18
|
-
* @example $('table').tablesorter();
|
19
|
-
* @desc Create a simple tablesorter interface.
|
20
|
-
*
|
21
|
-
* @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
|
22
|
-
* @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
|
23
|
-
*
|
24
|
-
* @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
25
|
-
* @desc Create a tablesorter interface and disableing the first and secound column headers.
|
26
|
-
*
|
27
|
-
* @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
|
28
|
-
* @desc Create a tablesorter interface and set a column parser for the first and secound column.
|
29
|
-
*
|
30
|
-
*
|
31
|
-
* @param Object settings An object literal containing key/value pairs to provide optional settings.
|
32
|
-
*
|
33
|
-
* @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
|
34
|
-
* Default value: "header"
|
35
|
-
*
|
36
|
-
* @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
|
37
|
-
* Default value: "headerSortUp"
|
38
|
-
*
|
39
|
-
* @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
|
40
|
-
* Default value: "headerSortDown"
|
41
|
-
*
|
42
|
-
* @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
|
43
|
-
* Default value: "asc"
|
44
|
-
*
|
45
|
-
* @option String sortMultisortKey (optional) A string of the multi-column sort key.
|
46
|
-
* Default value: "shiftKey"
|
47
|
-
*
|
48
|
-
* @option String textExtraction (optional) A string of the text-extraction method to use.
|
49
|
-
* For complex html structures inside td cell set this option to "complex",
|
50
|
-
* on large tables the complex option can be slow.
|
51
|
-
* Default value: "simple"
|
52
|
-
*
|
53
|
-
* @option Object headers (optional) An array containing the forces sorting rules.
|
54
|
-
* This option let's you specify a default sorting rule.
|
55
|
-
* Default value: null
|
56
|
-
*
|
57
|
-
* @option Array sortList (optional) An array containing the forces sorting rules.
|
58
|
-
* This option let's you specify a default sorting rule.
|
59
|
-
* Default value: null
|
60
|
-
*
|
61
|
-
* @option Array sortForce (optional) An array containing the forces sorting rules.
|
62
|
-
* This option let's you specify a default sorting rule.
|
63
|
-
* Default value: null
|
64
|
-
*
|
65
|
-
*
|
66
|
-
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
|
67
|
-
* This is usefull when using the pager companion plugin.
|
68
|
-
* This options requires the dimension jquery plugin.
|
69
|
-
* Default value: false
|
70
|
-
*
|
71
|
-
* @option Boolean cancelSelection (optional) Boolean flag indicating if tablesorter should cancel selection of the table headers text.
|
72
|
-
* Default value: true
|
73
|
-
*
|
74
|
-
* @option Boolean debug (optional) Boolean flag indicating if tablesorter should display debuging information usefull for development.
|
75
|
-
*
|
76
|
-
* @type jQuery
|
77
|
-
*
|
78
|
-
* @name tablesorter
|
79
|
-
*
|
80
|
-
* @cat Plugins/Tablesorter
|
81
|
-
*
|
82
|
-
* @author Christian Bach/christian.bach@polyester.se
|
83
|
-
*/
|
84
|
-
|
85
|
-
(function($) {
|
86
|
-
$.extend({
|
87
|
-
tablesorter: new function() {
|
88
|
-
|
89
|
-
var parsers = [], widgets = [];
|
90
|
-
|
91
|
-
this.defaults = {
|
92
|
-
cssHeader: "header",
|
93
|
-
cssAsc: "headerSortUp",
|
94
|
-
cssDesc: "headerSortDown",
|
95
|
-
sortInitialOrder: "asc",
|
96
|
-
sortMultiSortKey: "shiftKey",
|
97
|
-
sortForce: null,
|
98
|
-
textExtraction: "simple",
|
99
|
-
parsers: {},
|
100
|
-
widgets: [],
|
101
|
-
widgetZebra: {css: ["even","odd"]},
|
102
|
-
headers: {},
|
103
|
-
widthFixed: false,
|
104
|
-
cancelSelection: true,
|
105
|
-
sortList: [],
|
106
|
-
headerList: [],
|
107
|
-
dateFormat: "us",
|
108
|
-
debug: false
|
109
|
-
};
|
110
|
-
|
111
|
-
/* debuging utils */
|
112
|
-
function benchmark(s,d) {
|
113
|
-
log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
|
114
|
-
}
|
115
|
-
|
116
|
-
this.benchmark = benchmark;
|
117
|
-
|
118
|
-
function log(s) {
|
119
|
-
if (typeof console != "undefined" && typeof console.debug != "undefined") {
|
120
|
-
console.log(s);
|
121
|
-
} else {
|
122
|
-
alert(s);
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
|
-
/* parsers utils */
|
127
|
-
function buildParserCache(table,$headers) {
|
128
|
-
|
129
|
-
if(table.config.debug) { var parsersDebug = ""; }
|
130
|
-
|
131
|
-
var rows = table.tBodies[0].rows;
|
132
|
-
|
133
|
-
if(table.tBodies[0].rows[0]) {
|
134
|
-
|
135
|
-
var list = [], cells = rows[0].cells, l = cells.length;
|
136
|
-
|
137
|
-
for (var i=0;i < l; i++) {
|
138
|
-
var p = false;
|
139
|
-
|
140
|
-
if($.meta && ($($headers[i]).data() && $($headers[i]).data().sorter) ) {
|
141
|
-
|
142
|
-
p = getParserById($($headers[i]).data().sorter);
|
143
|
-
|
144
|
-
} else if((table.config.headers[i] && table.config.headers[i].sorter)) {
|
145
|
-
|
146
|
-
p = getParserById(table.config.headers[i].sorter);
|
147
|
-
}
|
148
|
-
if(!p) {
|
149
|
-
p = detectParserForColumn(table.config,cells[i]);
|
150
|
-
}
|
151
|
-
|
152
|
-
if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
|
153
|
-
|
154
|
-
list.push(p);
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
if(table.config.debug) { log(parsersDebug); }
|
159
|
-
|
160
|
-
return list;
|
161
|
-
};
|
162
|
-
|
163
|
-
function detectParserForColumn(config,node) {
|
164
|
-
var l = parsers.length;
|
165
|
-
for(var i=1; i < l; i++) {
|
166
|
-
if(parsers[i].is($.trim(getElementText(config,node)))) {
|
167
|
-
return parsers[i];
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
// 0 is always the generic parser (text)
|
172
|
-
return parsers[0];
|
173
|
-
}
|
174
|
-
|
175
|
-
function getParserById(name) {
|
176
|
-
var l = parsers.length;
|
177
|
-
for(var i=0; i < l; i++) {
|
178
|
-
if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
|
179
|
-
return parsers[i];
|
180
|
-
}
|
181
|
-
}
|
182
|
-
return false;
|
183
|
-
}
|
184
|
-
|
185
|
-
/* utils */
|
186
|
-
function buildCache(table) {
|
187
|
-
|
188
|
-
if(table.config.debug) { var cacheTime = new Date(); }
|
189
|
-
|
190
|
-
|
191
|
-
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
|
192
|
-
totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
|
193
|
-
parsers = table.config.parsers,
|
194
|
-
cache = {row: [], normalized: []};
|
195
|
-
|
196
|
-
for (var i=0;i < totalRows; ++i) {
|
197
|
-
|
198
|
-
/** Add the table data to main data array */
|
199
|
-
var c = table.tBodies[0].rows[i], cols = [];
|
200
|
-
|
201
|
-
cache.row.push($(c));
|
202
|
-
|
203
|
-
for(var j=0; j < totalCells; ++j) {
|
204
|
-
cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));
|
205
|
-
}
|
206
|
-
|
207
|
-
cols.push(i); // add position for rowCache
|
208
|
-
cache.normalized.push(cols);
|
209
|
-
cols = null;
|
210
|
-
};
|
211
|
-
|
212
|
-
if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
|
213
|
-
|
214
|
-
return cache;
|
215
|
-
};
|
216
|
-
|
217
|
-
function getElementText(config,node) {
|
218
|
-
|
219
|
-
if(!node) return "";
|
220
|
-
|
221
|
-
var t = "";
|
222
|
-
|
223
|
-
if(config.textExtraction == "simple") {
|
224
|
-
if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
|
225
|
-
t = node.childNodes[0].innerHTML;
|
226
|
-
} else {
|
227
|
-
t = node.innerHTML;
|
228
|
-
}
|
229
|
-
} else {
|
230
|
-
if(typeof(config.textExtraction) == "function") {
|
231
|
-
t = config.textExtraction(node);
|
232
|
-
} else {
|
233
|
-
t = $(node).text();
|
234
|
-
}
|
235
|
-
}
|
236
|
-
return t;
|
237
|
-
}
|
238
|
-
|
239
|
-
function appendToTable(table,cache) {
|
240
|
-
|
241
|
-
if(table.config.debug) {var appendTime = new Date()}
|
242
|
-
|
243
|
-
var c = cache,
|
244
|
-
r = c.row,
|
245
|
-
n= c.normalized,
|
246
|
-
totalRows = n.length,
|
247
|
-
checkCell = (n[0].length-1),
|
248
|
-
tableBody = $(table.tBodies[0]),
|
249
|
-
rows = [];
|
250
|
-
|
251
|
-
// clear the table body
|
252
|
-
//$.tablesorter.clearTableBody(table);
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
for (var i=0;i < totalRows; i++) {
|
258
|
-
rows.push(r[n[i][checkCell]]);
|
259
|
-
if(!table.config.appender) {
|
260
|
-
|
261
|
-
var o = r[n[i][checkCell]];
|
262
|
-
var l = o.length;
|
263
|
-
for(var j=0; j < l; j++) {
|
264
|
-
|
265
|
-
tableBody[0].appendChild(o[j]);
|
266
|
-
|
267
|
-
}
|
268
|
-
|
269
|
-
//tableBody.append(r[n[i][checkCell]]);
|
270
|
-
}
|
271
|
-
}
|
272
|
-
|
273
|
-
if(table.config.appender) {
|
274
|
-
|
275
|
-
table.config.appender(table,rows);
|
276
|
-
}
|
277
|
-
|
278
|
-
rows = null;
|
279
|
-
|
280
|
-
if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
|
281
|
-
|
282
|
-
//apply table widgets
|
283
|
-
applyWidget(table);
|
284
|
-
};
|
285
|
-
|
286
|
-
function buildHeaders(table) {
|
287
|
-
|
288
|
-
if(table.config.debug) { var time = new Date(); }
|
289
|
-
|
290
|
-
var meta = ($.meta) ? true : false, tableHeadersRows = [];
|
291
|
-
|
292
|
-
for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
|
293
|
-
|
294
|
-
$tableHeaders = $("thead th",table);
|
295
|
-
|
296
|
-
$tableHeaders.each(function(index) {
|
297
|
-
|
298
|
-
this.count = 0;
|
299
|
-
this.column = index;
|
300
|
-
this.order = formatSortingOrder(table.config.sortInitialOrder);
|
301
|
-
|
302
|
-
if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
|
303
|
-
|
304
|
-
if(!this.sortDisabled) {
|
305
|
-
$(this).addClass(table.config.cssHeader);
|
306
|
-
}
|
307
|
-
|
308
|
-
// add cell to headerList
|
309
|
-
table.config.headerList[index]= this;
|
310
|
-
});
|
311
|
-
|
312
|
-
if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
|
313
|
-
|
314
|
-
return $tableHeaders;
|
315
|
-
|
316
|
-
};
|
317
|
-
|
318
|
-
function checkCellColSpan(table, rows, row) {
|
319
|
-
var arr = [], r = table.tHead.rows, c = r[row].cells;
|
320
|
-
|
321
|
-
for(var i=0; i < c.length; i++) {
|
322
|
-
var cell = c[i];
|
323
|
-
|
324
|
-
if ( cell.colSpan > 1) {
|
325
|
-
arr = arr.concat(checkCellColSpan(table, headerArr,row++));
|
326
|
-
} else {
|
327
|
-
if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
|
328
|
-
arr.push(cell);
|
329
|
-
}
|
330
|
-
//headerArr[row] = (i+row);
|
331
|
-
}
|
332
|
-
}
|
333
|
-
return arr;
|
334
|
-
};
|
335
|
-
|
336
|
-
function checkHeaderMetadata(cell) {
|
337
|
-
if(($.meta) && ($(cell).data().sorter === false)) { return true; };
|
338
|
-
return false;
|
339
|
-
}
|
340
|
-
|
341
|
-
function checkHeaderOptions(table,i) {
|
342
|
-
if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
|
343
|
-
return false;
|
344
|
-
}
|
345
|
-
|
346
|
-
function applyWidget(table) {
|
347
|
-
var c = table.config.widgets;
|
348
|
-
var l = c.length;
|
349
|
-
for(var i=0; i < l; i++) {
|
350
|
-
|
351
|
-
getWidgetById(c[i]).format(table);
|
352
|
-
}
|
353
|
-
|
354
|
-
}
|
355
|
-
|
356
|
-
function getWidgetById(name) {
|
357
|
-
var l = widgets.length;
|
358
|
-
for(var i=0; i < l; i++) {
|
359
|
-
if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
|
360
|
-
return widgets[i];
|
361
|
-
}
|
362
|
-
}
|
363
|
-
};
|
364
|
-
|
365
|
-
function formatSortingOrder(v) {
|
366
|
-
|
367
|
-
if(typeof(v) != "Number") {
|
368
|
-
i = (v.toLowerCase() == "desc") ? 1 : 0;
|
369
|
-
} else {
|
370
|
-
i = (v == (0 || 1)) ? v : 0;
|
371
|
-
}
|
372
|
-
return i;
|
373
|
-
}
|
374
|
-
|
375
|
-
function isValueInArray(v, a) {
|
376
|
-
var l = a.length;
|
377
|
-
for(var i=0; i < l; i++) {
|
378
|
-
if(a[i][0] == v) {
|
379
|
-
return true;
|
380
|
-
}
|
381
|
-
}
|
382
|
-
return false;
|
383
|
-
}
|
384
|
-
|
385
|
-
function setHeadersCss(table,$headers, list, css) {
|
386
|
-
// remove all header information
|
387
|
-
$headers.removeClass(css[0]).removeClass(css[1]);
|
388
|
-
|
389
|
-
var h = [];
|
390
|
-
$headers.each(function(offset) {
|
391
|
-
if(!this.sortDisabled) {
|
392
|
-
h[this.column] = $(this);
|
393
|
-
}
|
394
|
-
});
|
395
|
-
|
396
|
-
var l = list.length;
|
397
|
-
for(var i=0; i < l; i++) {
|
398
|
-
h[list[i][0]].addClass(css[list[i][1]]);
|
399
|
-
}
|
400
|
-
}
|
401
|
-
|
402
|
-
function fixColumnWidth(table,$headers) {
|
403
|
-
var c = table.config;
|
404
|
-
if(c.widthFixed) {
|
405
|
-
var colgroup = $('<colgroup>');
|
406
|
-
$("tr:first td",table.tBodies[0]).each(function() {
|
407
|
-
colgroup.append($('<col>').css('width',$(this).width()));
|
408
|
-
});
|
409
|
-
$(table).prepend(colgroup);
|
410
|
-
};
|
411
|
-
}
|
412
|
-
|
413
|
-
function updateHeaderSortCount(table,sortList) {
|
414
|
-
var c = table.config, l = sortList.length;
|
415
|
-
for(var i=0; i < l; i++) {
|
416
|
-
var s = sortList[i], o = c.headerList[s[0]];
|
417
|
-
o.count = s[1];
|
418
|
-
o.count++;
|
419
|
-
}
|
420
|
-
}
|
421
|
-
|
422
|
-
/* sorting methods */
|
423
|
-
function multisort(table,sortList,cache) {
|
424
|
-
|
425
|
-
|
426
|
-
if(table.config.debug) { var sortTime = new Date(); }
|
427
|
-
|
428
|
-
var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
|
429
|
-
|
430
|
-
for(var i=0; i < l; i++) {
|
431
|
-
|
432
|
-
var c = sortList[i][0];
|
433
|
-
var order = sortList[i][1];
|
434
|
-
var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
|
435
|
-
|
436
|
-
var e = "e" + i;
|
437
|
-
|
438
|
-
dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
|
439
|
-
dynamicExp += "if(" + e + ") { return " + e + "; } ";
|
440
|
-
dynamicExp += "else { ";
|
441
|
-
}
|
442
|
-
|
443
|
-
// if value is the same keep orignal order
|
444
|
-
var orgOrderCol = cache.normalized[0].length - 1;
|
445
|
-
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
|
446
|
-
|
447
|
-
for(var i=0; i < l; i++) {
|
448
|
-
dynamicExp += "}; ";
|
449
|
-
}
|
450
|
-
|
451
|
-
dynamicExp += "return 0; ";
|
452
|
-
dynamicExp += "}; ";
|
453
|
-
|
454
|
-
eval(dynamicExp);
|
455
|
-
|
456
|
-
cache.normalized.sort(sortWrapper);
|
457
|
-
|
458
|
-
if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
|
459
|
-
|
460
|
-
return cache;
|
461
|
-
};
|
462
|
-
|
463
|
-
function sortText(a,b) {
|
464
|
-
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
465
|
-
};
|
466
|
-
|
467
|
-
function sortTextDesc(a,b) {
|
468
|
-
return ((b < a) ? -1 : ((b > a) ? 1 : 0));
|
469
|
-
};
|
470
|
-
|
471
|
-
function sortNumeric(a,b) {
|
472
|
-
return a-b;
|
473
|
-
};
|
474
|
-
|
475
|
-
function sortNumericDesc(a,b) {
|
476
|
-
return b-a;
|
477
|
-
};
|
478
|
-
|
479
|
-
function getCachedSortType(parsers,i) {
|
480
|
-
return parsers[i].type;
|
481
|
-
};
|
482
|
-
|
483
|
-
/* public methods */
|
484
|
-
this.construct = function(settings) {
|
485
|
-
|
486
|
-
return this.each(function() {
|
487
|
-
|
488
|
-
if(!this.tHead || !this.tBodies) return;
|
489
|
-
|
490
|
-
var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
|
491
|
-
|
492
|
-
this.config = {};
|
493
|
-
|
494
|
-
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
495
|
-
|
496
|
-
// store common expression for speed
|
497
|
-
$this = $(this);
|
498
|
-
|
499
|
-
// build headers
|
500
|
-
$headers = buildHeaders(this);
|
501
|
-
|
502
|
-
// try to auto detect column type, and store in tables config
|
503
|
-
this.config.parsers = buildParserCache(this,$headers);
|
504
|
-
|
505
|
-
|
506
|
-
// build the cache for the tbody cells
|
507
|
-
cache = buildCache(this);
|
508
|
-
|
509
|
-
// get the css class names, could be done else where.
|
510
|
-
var sortCSS = [config.cssDesc,config.cssAsc];
|
511
|
-
|
512
|
-
// fixate columns if the users supplies the fixedWidth option
|
513
|
-
fixColumnWidth(this);
|
514
|
-
|
515
|
-
// apply event handling to headers
|
516
|
-
// this is to big, perhaps break it out?
|
517
|
-
$headers.click(function(e) {
|
518
|
-
|
519
|
-
var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
|
520
|
-
|
521
|
-
if(!this.sortDisabled && totalRows > 0) {
|
522
|
-
// store exp, for speed
|
523
|
-
var $cell = $(this);
|
524
|
-
|
525
|
-
// get current column index
|
526
|
-
var i = this.column;
|
527
|
-
|
528
|
-
// get current column sort order
|
529
|
-
this.order = this.count++ % 2;
|
530
|
-
|
531
|
-
// user only whants to sort on one column
|
532
|
-
if(!e[config.sortMultiSortKey]) {
|
533
|
-
|
534
|
-
// flush the sort list
|
535
|
-
config.sortList = [];
|
536
|
-
|
537
|
-
if(config.sortForce != null) {
|
538
|
-
var a = config.sortForce;
|
539
|
-
for(var j=0; j < a.length; j++) {
|
540
|
-
config.sortList.push(a[j]);
|
541
|
-
}
|
542
|
-
}
|
543
|
-
|
544
|
-
// add column to sort list
|
545
|
-
config.sortList.push([i,this.order]);
|
546
|
-
|
547
|
-
// multi column sorting
|
548
|
-
} else {
|
549
|
-
// the user has clicked on an all ready sortet column.
|
550
|
-
if(isValueInArray(i,config.sortList)) {
|
551
|
-
|
552
|
-
// revers the sorting direction for all tables.
|
553
|
-
for(var j=0; j < config.sortList.length; j++) {
|
554
|
-
var s = config.sortList[j], o = config.headerList[s[0]];
|
555
|
-
if(s[0] == i) {
|
556
|
-
o.count = s[1];
|
557
|
-
o.count++;
|
558
|
-
s[1] = o.count % 2;
|
559
|
-
}
|
560
|
-
}
|
561
|
-
} else {
|
562
|
-
// add column to sort list array
|
563
|
-
config.sortList.push([i,this.order]);
|
564
|
-
}
|
565
|
-
};
|
566
|
-
|
567
|
-
// trigger sortstart
|
568
|
-
$this.trigger("sortStart");
|
569
|
-
|
570
|
-
//set css for headers
|
571
|
-
setHeadersCss($this[0],$headers,config.sortList,sortCSS);
|
572
|
-
|
573
|
-
// javascript threading..
|
574
|
-
setTimeout(function() {
|
575
|
-
// sort the table and append it to the dom
|
576
|
-
appendToTable($this[0],multisort($this[0],config.sortList,cache));
|
577
|
-
// trigger sortstart
|
578
|
-
$this.trigger("sortEnd");
|
579
|
-
}, 0);
|
580
|
-
// stop normal event by returning false
|
581
|
-
return false;
|
582
|
-
}
|
583
|
-
// cancel selection
|
584
|
-
}).mousedown(function() {
|
585
|
-
if(config.cancelSelection) {
|
586
|
-
this.onselectstart = function() {return false};
|
587
|
-
return false;
|
588
|
-
}
|
589
|
-
});
|
590
|
-
|
591
|
-
// apply easy methods that trigger binded events
|
592
|
-
$this.bind("update",function() {
|
593
|
-
|
594
|
-
// rebuild parsers.
|
595
|
-
this.config.parsers = buildParserCache(this,$headers);
|
596
|
-
|
597
|
-
// rebuild the cache map
|
598
|
-
cache = buildCache(this);
|
599
|
-
|
600
|
-
}).bind("sorton",function(e,list) {
|
601
|
-
|
602
|
-
config.sortList = list;
|
603
|
-
|
604
|
-
// update and store the sortlist
|
605
|
-
var sortList = config.sortList;
|
606
|
-
|
607
|
-
// update header count index
|
608
|
-
updateHeaderSortCount(this,sortList);
|
609
|
-
|
610
|
-
//set css for headers
|
611
|
-
setHeadersCss(this,$headers,sortList,sortCSS);
|
612
|
-
|
613
|
-
// sort the table and append it to the dom
|
614
|
-
appendToTable(this,multisort(this,sortList,cache));
|
615
|
-
|
616
|
-
}).bind("appendCache",function() {
|
617
|
-
|
618
|
-
appendToTable(this,cache);
|
619
|
-
|
620
|
-
}).bind("applyWidgetId",function(e,id) {
|
621
|
-
|
622
|
-
getWidgetById(id).format(this);
|
623
|
-
|
624
|
-
}).bind("applyWidgets",function() {
|
625
|
-
// apply widgets
|
626
|
-
applyWidget(this);
|
627
|
-
});
|
628
|
-
|
629
|
-
if($.meta && ($(this).data() && $(this).data().sortlist)) {
|
630
|
-
config.sortList = $(this).data().sortlist;
|
631
|
-
}
|
632
|
-
// if user has supplied a sort list to constructor.
|
633
|
-
if(config.sortList.length > 0) {
|
634
|
-
$this.trigger("sorton",[config.sortList]);
|
635
|
-
}
|
636
|
-
|
637
|
-
// apply widgets
|
638
|
-
applyWidget(this);
|
639
|
-
});
|
640
|
-
};
|
641
|
-
|
642
|
-
this.addParser = function(parser) {
|
643
|
-
var l = parsers.length, a = true;
|
644
|
-
for(var i=0; i < l; i++) {
|
645
|
-
if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
|
646
|
-
a = false;
|
647
|
-
}
|
648
|
-
}
|
649
|
-
if(a) { parsers.push(parser); };
|
650
|
-
};
|
651
|
-
|
652
|
-
this.addWidget = function(widget) {
|
653
|
-
widgets.push(widget);
|
654
|
-
};
|
655
|
-
|
656
|
-
this.formatFloat = function(s) {
|
657
|
-
|
658
|
-
var i = parseFloat(s);
|
659
|
-
return (isNaN(i)) ? 0 : i;
|
660
|
-
};
|
661
|
-
this.formatInt = function(s) {
|
662
|
-
var i = parseInt(s);
|
663
|
-
return (isNaN(i)) ? 0 : i;
|
664
|
-
};
|
665
|
-
|
666
|
-
this.clearTableBody = function(table) {
|
667
|
-
|
668
|
-
if($.browser.msie) {
|
669
|
-
|
670
|
-
function empty() {
|
671
|
-
|
672
|
-
while ( this.firstChild ) this.removeChild( this.firstChild );
|
673
|
-
|
674
|
-
}
|
675
|
-
|
676
|
-
empty.apply(table.tBodies[0]);
|
677
|
-
|
678
|
-
} else {
|
679
|
-
table.tBodies[0].innerHTML = "";
|
680
|
-
}
|
681
|
-
};
|
682
|
-
}
|
683
|
-
});
|
684
|
-
|
685
|
-
// extend plugin scope
|
686
|
-
$.fn.extend({
|
687
|
-
tablesorter: $.tablesorter.construct
|
688
|
-
});
|
689
|
-
|
690
|
-
var ts = $.tablesorter;
|
691
|
-
|
692
|
-
// add default parsers
|
693
|
-
ts.addParser({
|
694
|
-
id: "text",
|
695
|
-
is: function(s) {
|
696
|
-
return true;
|
697
|
-
},
|
698
|
-
format: function(s) {
|
699
|
-
return $.trim(s.toLowerCase());
|
700
|
-
},
|
701
|
-
type: "text"
|
702
|
-
});
|
703
|
-
|
704
|
-
ts.addParser({
|
705
|
-
id: "integer",
|
706
|
-
is: function(s) {
|
707
|
-
return /^\d+$/.test(s);
|
708
|
-
},
|
709
|
-
format: function(s) {
|
710
|
-
return $.tablesorter.formatFloat(s);
|
711
|
-
},
|
712
|
-
type: "numeric"
|
713
|
-
});
|
714
|
-
|
715
|
-
ts.addParser({
|
716
|
-
id: "currency",
|
717
|
-
is: function(s) {
|
718
|
-
return /^[£$€?.]/.test(s);
|
719
|
-
},
|
720
|
-
format: function(s) {
|
721
|
-
return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
|
722
|
-
},
|
723
|
-
type: "numeric"
|
724
|
-
});
|
725
|
-
|
726
|
-
ts.addParser({
|
727
|
-
id: "floating",
|
728
|
-
is: function(s) {
|
729
|
-
return s.match(new RegExp(/^(\+|-)?[0-9]+\.[0-9]+((E|e)(\+|-)?[0-9]+)?$/));
|
730
|
-
},
|
731
|
-
format: function(s) {
|
732
|
-
return $.tablesorter.formatFloat(s.replace(new RegExp(/,/),""));
|
733
|
-
},
|
734
|
-
type: "numeric"
|
735
|
-
});
|
736
|
-
|
737
|
-
ts.addParser({
|
738
|
-
id: "ipAddress",
|
739
|
-
is: function(s) {
|
740
|
-
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
|
741
|
-
},
|
742
|
-
format: function(s) {
|
743
|
-
var a = s.split("."), r = "", l = a.length;
|
744
|
-
for(var i = 0; i < l; i++) {
|
745
|
-
var item = a[i];
|
746
|
-
if(item.length == 2) {
|
747
|
-
r += "0" + item;
|
748
|
-
} else {
|
749
|
-
r += item;
|
750
|
-
}
|
751
|
-
}
|
752
|
-
return $.tablesorter.formatFloat(r);
|
753
|
-
},
|
754
|
-
type: "numeric"
|
755
|
-
});
|
756
|
-
|
757
|
-
ts.addParser({
|
758
|
-
id: "url",
|
759
|
-
is: function(s) {
|
760
|
-
return /^(https?|ftp|file):\/\/$/.test(s);
|
761
|
-
},
|
762
|
-
format: function(s) {
|
763
|
-
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));
|
764
|
-
},
|
765
|
-
type: "text"
|
766
|
-
});
|
767
|
-
|
768
|
-
ts.addParser({
|
769
|
-
id: "isoDate",
|
770
|
-
is: function(s) {
|
771
|
-
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
|
772
|
-
},
|
773
|
-
format: function(s) {
|
774
|
-
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0");
|
775
|
-
},
|
776
|
-
type: "numeric"
|
777
|
-
});
|
778
|
-
|
779
|
-
ts.addParser({
|
780
|
-
id: "percent",
|
781
|
-
is: function(s) {
|
782
|
-
return /^\d{1,3}%$/.test(s);
|
783
|
-
},
|
784
|
-
format: function(s) {
|
785
|
-
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));
|
786
|
-
},
|
787
|
-
type: "numeric"
|
788
|
-
});
|
789
|
-
|
790
|
-
ts.addParser({
|
791
|
-
id: "usLongDate",
|
792
|
-
is: function(s) {
|
793
|
-
return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
|
794
|
-
},
|
795
|
-
format: function(s) {
|
796
|
-
return $.tablesorter.formatFloat(new Date(s).getTime());
|
797
|
-
},
|
798
|
-
type: "numeric"
|
799
|
-
});
|
800
|
-
|
801
|
-
ts.addParser({
|
802
|
-
id: "shortDate",
|
803
|
-
is: function(s) {
|
804
|
-
return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
|
805
|
-
},
|
806
|
-
format: function(s,table) {
|
807
|
-
var c = table.config;
|
808
|
-
s = s.replace(/\-/g,"/");
|
809
|
-
if(c.dateFormat == "us") {
|
810
|
-
// reformat the string in ISO format
|
811
|
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
|
812
|
-
} else if(c.dateFormat == "uk") {
|
813
|
-
//reformat the string in ISO format
|
814
|
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
|
815
|
-
} else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
|
816
|
-
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
|
817
|
-
}
|
818
|
-
return $.tablesorter.formatFloat(new Date(s).getTime());
|
819
|
-
},
|
820
|
-
type: "numeric"
|
821
|
-
});
|
822
|
-
|
823
|
-
ts.addParser({
|
824
|
-
id: "time",
|
825
|
-
is: function(s) {
|
826
|
-
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
|
827
|
-
},
|
828
|
-
format: function(s) {
|
829
|
-
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
|
830
|
-
},
|
831
|
-
type: "numeric"
|
832
|
-
});
|
833
|
-
|
834
|
-
|
835
|
-
ts.addParser({
|
836
|
-
id: "metadata",
|
837
|
-
is: function(s) {
|
838
|
-
return false;
|
839
|
-
},
|
840
|
-
format: function(s,table,cell) {
|
841
|
-
var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
|
842
|
-
return $(cell).data()[p];
|
843
|
-
},
|
844
|
-
type: "numeric"
|
845
|
-
});
|
846
|
-
|
847
|
-
// add default widgets
|
848
|
-
ts.addWidget({
|
849
|
-
id: "zebra",
|
850
|
-
format: function(table) {
|
851
|
-
if(table.config.debug) { var time = new Date(); }
|
852
|
-
$("tr:visible",table.tBodies[0])
|
853
|
-
.filter(':even')
|
854
|
-
.removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0])
|
855
|
-
.end().filter(':odd')
|
856
|
-
.removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
|
857
|
-
if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
|
858
|
-
}
|
859
|
-
});
|
860
|
-
|
861
|
-
})(jQuery);
|