ramaze 0.3.0 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/Rakefile +3 -2
  2. data/bin/ramaze +9 -3
  3. data/doc/AUTHORS +6 -2
  4. data/doc/CHANGELOG +272 -66
  5. data/doc/GPL +12 -13
  6. data/doc/README.html +729 -0
  7. data/doc/changes.txt +5757 -0
  8. data/doc/changes.xml +5759 -0
  9. data/doc/meta/announcement.txt +48 -39
  10. data/doc/tutorial/todolist.mkd +10 -12
  11. data/examples/blog/start.rb +1 -0
  12. data/examples/caching.rb +1 -0
  13. data/examples/element.rb +3 -0
  14. data/examples/hello.rb +1 -3
  15. data/examples/identity.rb +5 -8
  16. data/examples/layout.rb +1 -0
  17. data/examples/linking.rb +1 -0
  18. data/examples/memleak_detector.rb +1 -0
  19. data/examples/nitro_form.rb +1 -0
  20. data/examples/rammit/start.rb +1 -0
  21. data/examples/rapaste/Rakefile +7 -0
  22. data/examples/rapaste/{src/controller.rb → controller/paste.rb} +28 -3
  23. data/examples/rapaste/{src/model.rb → model/paste.rb} +0 -4
  24. data/examples/rapaste/public/css/display.css +17 -0
  25. data/examples/rapaste/spec/rapaste.rb +2 -2
  26. data/examples/rapaste/start.rb +9 -4
  27. data/examples/rapaste/{template → view}/copy.xhtml +0 -0
  28. data/examples/rapaste/{template → view}/index.xhtml +0 -0
  29. data/examples/rapaste/{template → view}/layout.xhtml +3 -0
  30. data/examples/rapaste/{template → view}/list.xhtml +4 -3
  31. data/examples/rapaste/view/search.xhtml +41 -0
  32. data/examples/rapaste/{template → view}/view.xhtml +0 -0
  33. data/examples/simple.rb +3 -3
  34. data/examples/templates/template/external.amrita +9 -9
  35. data/examples/templates/template/external.redcloth +19 -0
  36. data/examples/templates/template_amrita2.rb +40 -7
  37. data/examples/templates/template_erubis.rb +3 -3
  38. data/examples/templates/template_ezamar.rb +1 -3
  39. data/examples/templates/template_haml.rb +1 -3
  40. data/examples/templates/template_liquid.rb +3 -3
  41. data/examples/templates/template_markaby.rb +1 -3
  42. data/examples/templates/template_nagoro.rb +1 -3
  43. data/examples/templates/template_redcloth.rb +59 -0
  44. data/examples/templates/template_remarkably.rb +1 -3
  45. data/examples/templates/template_xslt.rb +1 -4
  46. data/examples/todolist/src/controller/main.rb +1 -1
  47. data/examples/todolist/start.rb +1 -2
  48. data/examples/upload/start.rb +19 -0
  49. data/examples/upload/view/index.xhtml +25 -0
  50. data/examples/whywiki/start.rb +1 -3
  51. data/examples/wikore/start.rb +3 -0
  52. data/examples/wiktacular/mkd/newpagename/current.mkd +1 -0
  53. data/examples/wiktacular/mkd/newpagename/current.mkd.bak +1 -0
  54. data/examples/wiktacular/start.rb +1 -0
  55. data/lib/proto/controller/main.rb +0 -3
  56. data/lib/proto/public/js/jquery.js +106 -93
  57. data/lib/proto/spec/main.rb +2 -5
  58. data/lib/proto/start.rb +0 -3
  59. data/lib/ramaze.rb +3 -2
  60. data/lib/ramaze/action.rb +6 -10
  61. data/lib/ramaze/adapter/lsws.rb +19 -0
  62. data/lib/ramaze/contrib/email.rb +84 -0
  63. data/lib/ramaze/contrib/email.rb-darcs-backup0 +81 -0
  64. data/lib/ramaze/contrib/gettext.rb +1 -0
  65. data/lib/ramaze/contrib/gettext/parser.rb +46 -0
  66. data/lib/ramaze/contrib/route.rb +3 -36
  67. data/lib/ramaze/controller.rb +4 -6
  68. data/lib/ramaze/controller/resolve.rb +28 -1
  69. data/lib/ramaze/dispatcher.rb +1 -1
  70. data/lib/ramaze/dispatcher/file.rb +17 -0
  71. data/lib/ramaze/global/globalstruct.rb +7 -4
  72. data/lib/ramaze/helper/auth.rb +1 -1
  73. data/lib/ramaze/helper/identity.rb +25 -15
  74. data/lib/ramaze/helper/link.rb +29 -8
  75. data/lib/ramaze/helper/maruku.rb +7 -0
  76. data/lib/ramaze/helper/partial.rb +25 -10
  77. data/lib/ramaze/route.rb +56 -0
  78. data/lib/ramaze/snippets/metaid.rb +17 -0
  79. data/lib/ramaze/spec/helper.rb +0 -2
  80. data/lib/ramaze/spec/helper/mock_http.rb +6 -0
  81. data/lib/ramaze/spec/helper/pretty_output.rb +5 -1
  82. data/lib/ramaze/store/default.rb +3 -1
  83. data/lib/ramaze/template.rb +1 -1
  84. data/lib/ramaze/template/amrita2.rb +21 -15
  85. data/lib/ramaze/template/bijou.rb +39 -0
  86. data/lib/ramaze/template/builder.rb +28 -0
  87. data/lib/ramaze/template/redcloth.rb +24 -0
  88. data/lib/ramaze/template/sass.rb +3 -1
  89. data/lib/ramaze/tool/create.rb +2 -1
  90. data/lib/ramaze/tool/localize.rb +6 -1
  91. data/lib/ramaze/trinity/request.rb +8 -0
  92. data/lib/ramaze/trinity/session.rb +8 -5
  93. data/lib/ramaze/version.rb +1 -1
  94. data/rake_tasks/gem.rake +0 -1
  95. data/rake_tasks/maintenance.rake +4 -1
  96. data/spec/contrib/route.rb +14 -63
  97. data/spec/examples/linking.rb +2 -2
  98. data/spec/examples/templates/template_redcloth.rb +28 -0
  99. data/spec/ramaze/controller/subclass.rb +21 -0
  100. data/spec/ramaze/dispatcher/file.rb +31 -0
  101. data/spec/ramaze/helper/link.rb +46 -0
  102. data/spec/ramaze/helper/partial.rb +22 -1
  103. data/spec/ramaze/helper/template/locals.xhtml +1 -0
  104. data/spec/ramaze/helper/template/recursive_locals.xhtml +7 -0
  105. data/spec/ramaze/params.rb +8 -0
  106. data/spec/ramaze/request.rb +14 -0
  107. data/spec/ramaze/route.rb +107 -0
  108. data/spec/ramaze/session.rb +4 -2
  109. data/spec/ramaze/template/amrita2.rb +21 -7
  110. data/spec/ramaze/template/amrita2/external.amrita +6 -0
  111. data/spec/ramaze/template/amrita2/sum.amrita +1 -1
  112. data/spec/ramaze/template/bijou.rb +25 -0
  113. data/spec/ramaze/template/builder.rb +55 -0
  114. data/spec/ramaze/template/builder/external.rxml +3 -0
  115. data/spec/ramaze/template/haml.rb +15 -0
  116. data/spec/ramaze/template/haml/locals.haml +1 -0
  117. data/spec/ramaze/template/redcloth.rb +38 -0
  118. data/spec/ramaze/template/redcloth/external.redcloth +1 -0
  119. metadata +472 -442
  120. data/examples/rapaste/rapaste.sqlite +0 -0
  121. data/spec/ramaze/template/amrita2/data.amrita +0 -6
  122. data/spec/ramaze/template/amrita2/index.amrita +0 -1
@@ -1,6 +1,3 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
1
  # Default url mappings are:
5
2
  # a controller called Main is mapped on the root of the site: /
6
3
  # a controller called Something is mapped on: /something
@@ -1,13 +1,13 @@
1
1
  (function(){
2
2
  /*
3
- * jQuery 1.2.2b2 - New Wave Javascript
3
+ * jQuery 1.2.3b - New Wave Javascript
4
4
  *
5
5
  * Copyright (c) 2007 John Resig (jquery.com)
6
6
  * Dual licensed under the MIT (MIT-LICENSE.txt)
7
7
  * and GPL (GPL-LICENSE.txt) licenses.
8
8
  *
9
- * $Date: 2007-12-20 10:14:13 -0500 (Thu, 20 Dec 2007) $
10
- * $Rev: 4269 $
9
+ * $Date: 2008-01-25 19:26:28 -0500 (Fri, 25 Jan 2008) $
10
+ * $Rev: 4537 $
11
11
  */
12
12
 
13
13
  // Map over jQuery in case of overwrite
@@ -101,7 +101,7 @@ jQuery.fn = jQuery.prototype = {
101
101
  },
102
102
 
103
103
  // The current version of jQuery being used
104
- jquery: "1.2.2b2",
104
+ jquery: "1.2.3b",
105
105
 
106
106
  // The number of elements contained in the matched element set
107
107
  size: function() {
@@ -304,11 +304,9 @@ jQuery.fn = jQuery.prototype = {
304
304
  // as properties will not be copied (such as the
305
305
  // the name attribute on an input).
306
306
  var clone = this.cloneNode(true),
307
- container = document.createElement("div"),
308
- container2 = document.createElement("div");
307
+ container = document.createElement("div");
309
308
  container.appendChild(clone);
310
- container2.innerHTML = container.innerHTML;
311
- return container2.firstChild;
309
+ return jQuery.clean([container.innerHTML])[0];
312
310
  } else
313
311
  return this.cloneNode(true);
314
312
  });
@@ -324,6 +322,8 @@ jQuery.fn = jQuery.prototype = {
324
322
  // Copy the events from the original to the clone
325
323
  if ( events === true )
326
324
  this.find("*").andSelf().each(function(i){
325
+ if (this.nodeType == 3)
326
+ return;
327
327
  var events = jQuery.data( this, "events" );
328
328
 
329
329
  for ( var type in events )
@@ -598,8 +598,7 @@ jQuery.extend({
598
598
  return jQuery;
599
599
  },
600
600
 
601
- // This may seem like some crazy code, but trust me when I say that this
602
- // is the only cross-browser way to do this. --John
601
+ // See test/unit/core.js for details concerning this function.
603
602
  isFunction: function( fn ) {
604
603
  return !!fn && typeof fn != "string" && !fn.nodeName &&
605
604
  fn.constructor != Array && /function/i.test( fn + "" );
@@ -707,20 +706,22 @@ jQuery.extend({
707
706
  // args is for internal usage only
708
707
  each: function( object, callback, args ) {
709
708
  if ( args ) {
710
- if ( object.length == undefined )
709
+ if ( object.length == undefined ) {
711
710
  for ( var name in object )
712
- callback.apply( object[ name ], args );
713
- else
711
+ if ( callback.apply( object[ name ], args ) === false )
712
+ break;
713
+ } else
714
714
  for ( var i = 0, length = object.length; i < length; i++ )
715
715
  if ( callback.apply( object[ i ], args ) === false )
716
716
  break;
717
717
 
718
718
  // A special, fast, case for the most common use of each
719
719
  } else {
720
- if ( object.length == undefined )
720
+ if ( object.length == undefined ) {
721
721
  for ( var name in object )
722
- callback.call( object[ name ], name, object[ name ] );
723
- else
722
+ if ( callback.call( object[ name ], name, object[ name ] ) === false )
723
+ break;
724
+ } else
724
725
  for ( var i = 0, length = object.length, value = object[0];
725
726
  i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
726
727
  }
@@ -836,7 +837,7 @@ jQuery.extend({
836
837
  if ( name.match( /float/i ) )
837
838
  name = styleFloat;
838
839
 
839
- if ( !force && elem.style[ name ] )
840
+ if ( !force && elem.style && elem.style[ name ] )
840
841
  ret = elem.style[ name ];
841
842
 
842
843
  else if ( document.defaultView && document.defaultView.getComputedStyle ) {
@@ -933,7 +934,7 @@ jQuery.extend({
933
934
  if ( typeof elem == "string" ) {
934
935
  // Fix "XHTML"-style tags in all browsers
935
936
  elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
936
- return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ?
937
+ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
937
938
  all :
938
939
  front + "></" + tag + ">";
939
940
  });
@@ -1153,11 +1154,6 @@ jQuery.extend({
1153
1154
  },
1154
1155
 
1155
1156
  grep: function( elems, callback, inv ) {
1156
- // If a string is passed in for the function, make a function
1157
- // for it (a handy shortcut)
1158
- if ( typeof callback == "string" )
1159
- callback = eval("false||function(a,i){return " + callback + "}");
1160
-
1161
1157
  var ret = [];
1162
1158
 
1163
1159
  // Go through the array, only saving the items
@@ -1230,18 +1226,16 @@ jQuery.extend({
1230
1226
  });
1231
1227
 
1232
1228
  jQuery.each({
1233
- parent: "elem.parentNode",
1234
- parents: "jQuery.dir(elem,'parentNode')",
1235
- next: "jQuery.nth(elem,2,'nextSibling')",
1236
- prev: "jQuery.nth(elem,2,'previousSibling')",
1237
- nextAll: "jQuery.dir(elem,'nextSibling')",
1238
- prevAll: "jQuery.dir(elem,'previousSibling')",
1239
- siblings: "jQuery.sibling(elem.parentNode.firstChild,elem)",
1240
- children: "jQuery.sibling(elem.firstChild)",
1241
- contents: "jQuery.nodeName(elem,'iframe')?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)"
1229
+ parent: function(elem){return elem.parentNode;},
1230
+ parents: function(elem){return jQuery.dir(elem,"parentNode");},
1231
+ next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
1232
+ prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
1233
+ nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
1234
+ prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
1235
+ siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
1236
+ children: function(elem){return jQuery.sibling(elem.firstChild);},
1237
+ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
1242
1238
  }, function(name, fn){
1243
- fn = eval("false||function(elem){return " + fn + "}");
1244
-
1245
1239
  jQuery.fn[ name ] = function( selector ) {
1246
1240
  var ret = jQuery.map( this, fn );
1247
1241
 
@@ -1356,61 +1350,61 @@ var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
1356
1350
 
1357
1351
  jQuery.extend({
1358
1352
  expr: {
1359
- "": "m[2]=='*'||jQuery.nodeName(a,m[2])",
1360
- "#": "a.getAttribute('id')==m[2]",
1353
+ "": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
1354
+ "#": function(a,i,m){return a.getAttribute("id")==m[2];},
1361
1355
  ":": {
1362
1356
  // Position Checks
1363
- lt: "i<m[3]-0",
1364
- gt: "i>m[3]-0",
1365
- nth: "m[3]-0==i",
1366
- eq: "m[3]-0==i",
1367
- first: "i==0",
1368
- last: "i==r.length-1",
1369
- even: "i%2==0",
1370
- odd: "i%2",
1357
+ lt: function(a,i,m){return i<m[3]-0;},
1358
+ gt: function(a,i,m){return i>m[3]-0;},
1359
+ nth: function(a,i,m){return m[3]-0==i;},
1360
+ eq: function(a,i,m){return m[3]-0==i;},
1361
+ first: function(a,i){return i==0;},
1362
+ last: function(a,i,m,r){return i==r.length-1;},
1363
+ even: function(a,i){return i%2==0;},
1364
+ odd: function(a,i){return i%2;},
1371
1365
 
1372
1366
  // Child Checks
1373
- "first-child": "a.parentNode.getElementsByTagName('*')[0]==a",
1374
- "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
1375
- "only-child": "!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",
1367
+ "first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
1368
+ "last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
1369
+ "only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
1376
1370
 
1377
1371
  // Parent Checks
1378
- parent: "a.firstChild",
1379
- empty: "!a.firstChild",
1372
+ parent: function(a){return a.firstChild;},
1373
+ empty: function(a){return !a.firstChild;},
1380
1374
 
1381
1375
  // Text Check
1382
- contains: "(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",
1376
+ contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},
1383
1377
 
1384
1378
  // Visibility
1385
- visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
1386
- hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
1379
+ visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
1380
+ hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
1387
1381
 
1388
1382
  // Form attributes
1389
- enabled: "!a.disabled",
1390
- disabled: "a.disabled",
1391
- checked: "a.checked",
1392
- selected: "a.selected||jQuery.attr(a,'selected')",
1383
+ enabled: function(a){return !a.disabled;},
1384
+ disabled: function(a){return a.disabled;},
1385
+ checked: function(a){return a.checked;},
1386
+ selected: function(a){return a.selected||jQuery.attr(a,"selected");},
1393
1387
 
1394
1388
  // Form elements
1395
- text: "'text'==a.type",
1396
- radio: "'radio'==a.type",
1397
- checkbox: "'checkbox'==a.type",
1398
- file: "'file'==a.type",
1399
- password: "'password'==a.type",
1400
- submit: "'submit'==a.type",
1401
- image: "'image'==a.type",
1402
- reset: "'reset'==a.type",
1403
- button: '"button"==a.type||jQuery.nodeName(a,"button")',
1404
- input: "/input|select|textarea|button/i.test(a.nodeName)",
1389
+ text: function(a){return "text"==a.type;},
1390
+ radio: function(a){return "radio"==a.type;},
1391
+ checkbox: function(a){return "checkbox"==a.type;},
1392
+ file: function(a){return "file"==a.type;},
1393
+ password: function(a){return "password"==a.type;},
1394
+ submit: function(a){return "submit"==a.type;},
1395
+ image: function(a){return "image"==a.type;},
1396
+ reset: function(a){return "reset"==a.type;},
1397
+ button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
1398
+ input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
1405
1399
 
1406
1400
  // :has()
1407
- has: "jQuery.find(m[3],a).length",
1401
+ has: function(a,i,m){return jQuery.find(m[3],a).length;},
1408
1402
 
1409
1403
  // :header
1410
- header: "/h\\d/i.test(a.nodeName)",
1404
+ header: function(a){return /h\d/i.test(a.nodeName);},
1411
1405
 
1412
1406
  // :animated
1413
- animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
1407
+ animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
1414
1408
  }
1415
1409
  },
1416
1410
 
@@ -1738,15 +1732,17 @@ jQuery.extend({
1738
1732
 
1739
1733
  // Otherwise, find the expression to execute
1740
1734
  } else {
1741
- var f = jQuery.expr[m[1]];
1742
- if ( typeof f != "string" )
1743
- f = jQuery.expr[m[1]][m[2]];
1735
+ var fn = jQuery.expr[ m[1] ];
1736
+ if ( typeof fn == "object" )
1737
+ fn = fn[ m[2] ];
1744
1738
 
1745
- // Build a custom macro to enclose it
1746
- f = eval("false||function(a,i){return " + f + "}");
1739
+ if ( typeof fn == "string" )
1740
+ fn = eval("false||function(a,i){return " + fn + ";}");
1747
1741
 
1748
1742
  // Execute it against the current filter
1749
- r = jQuery.grep( r, f, not );
1743
+ r = jQuery.grep( r, function(elem, i){
1744
+ return fn(elem, i, m, r);
1745
+ }, not );
1750
1746
  }
1751
1747
  }
1752
1748
 
@@ -1840,10 +1836,14 @@ jQuery.event = {
1840
1836
  if ( typeof jQuery == "undefined" || jQuery.event.triggered )
1841
1837
  return val;
1842
1838
 
1843
- val = jQuery.event.handle.apply(elem, arguments);
1839
+ val = jQuery.event.handle.apply(arguments.callee.elem, arguments);
1844
1840
 
1845
1841
  return val;
1846
1842
  });
1843
+ // Add elem as a property of the handle function
1844
+ // This is to prevent a memory leak with non-native
1845
+ // event in IE.
1846
+ handle.elem = elem;
1847
1847
 
1848
1848
  // Handle multiple events seperated by a space
1849
1849
  // jQuery(...).bind("mouseover mouseout", fn);
@@ -1878,6 +1878,9 @@ jQuery.event = {
1878
1878
  // Keep track of which events have been used, for global triggering
1879
1879
  jQuery.event.global[type] = true;
1880
1880
  });
1881
+
1882
+ // Nullify elem to prevent memory leaks in IE
1883
+ elem = null;
1881
1884
  },
1882
1885
 
1883
1886
  guid: 1,
@@ -1941,6 +1944,8 @@ jQuery.event = {
1941
1944
  // Remove the expando if it's no longer used
1942
1945
  for ( ret in events ) break;
1943
1946
  if ( !ret ) {
1947
+ var handle = jQuery.data( elem, "handle" );
1948
+ if ( handle ) handle.elem = null;
1944
1949
  jQuery.removeData( elem, "events" );
1945
1950
  jQuery.removeData( elem, "handle" );
1946
1951
  }
@@ -1989,7 +1994,7 @@ jQuery.event = {
1989
1994
  // Handle triggering of extra function
1990
1995
  if ( extra && jQuery.isFunction( extra ) ) {
1991
1996
  // call the extra function and tack the current return value on the end for possible inspection
1992
- var ret = extra.apply( elem, data.concat( val ) );
1997
+ ret = extra.apply( elem, val == null ? data : data.concat( val ) );
1993
1998
  // if anything is returned, give it precedence and have it overwrite the previous value
1994
1999
  if (ret !== undefined)
1995
2000
  val = ret;
@@ -2054,18 +2059,11 @@ jQuery.event = {
2054
2059
  },
2055
2060
 
2056
2061
  fix: function(event) {
2057
- // Short-circuit if the event has already been fixed by jQuery.event.fix
2058
- if ( event[ expando ] )
2059
- return event;
2060
-
2061
2062
  // store a copy of the original event object
2062
2063
  // and clone to set read-only properties
2063
2064
  var originalEvent = event;
2064
2065
  event = jQuery.extend({}, originalEvent);
2065
2066
 
2066
- // Mark the event as fixed by jQuery.event.fix
2067
- event[ expando ] = true;
2068
-
2069
2067
  // add preventDefault and stopPropagation since
2070
2068
  // they will not work on the clone
2071
2069
  event.preventDefault = function() {
@@ -2103,7 +2101,7 @@ jQuery.event = {
2103
2101
  }
2104
2102
 
2105
2103
  // Add which for key events
2106
- if ( !event.which && (event.charCode || event.keyCode) )
2104
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
2107
2105
  event.which = event.charCode || event.keyCode;
2108
2106
 
2109
2107
  // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
@@ -2269,7 +2267,7 @@ jQuery.extend({
2269
2267
  }
2270
2268
 
2271
2269
  // Trigger any bound ready events
2272
- $(document).triggerHandler("ready");
2270
+ jQuery(document).triggerHandler("ready");
2273
2271
  }
2274
2272
  }
2275
2273
  });
@@ -2352,7 +2350,7 @@ var withinElement = function(event, elem) {
2352
2350
  // Check if mouse(over|out) are still within the same parent element
2353
2351
  var parent = event.relatedTarget;
2354
2352
  // Traverse up the tree
2355
- while ( parent && parent != elem ) try { parent = parent.parentNode } catch(error) { parent = elem; };
2353
+ while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
2356
2354
  // Return true if we actually just moused on to a sub-element
2357
2355
  return parent == elem;
2358
2356
  };
@@ -2509,7 +2507,17 @@ jQuery.extend({
2509
2507
  contentType: "application/x-www-form-urlencoded",
2510
2508
  processData: true,
2511
2509
  async: true,
2512
- data: null
2510
+ data: null,
2511
+ username: null,
2512
+ password: null,
2513
+ accepts: {
2514
+ xml: "application/xml, text/xml",
2515
+ html: "text/html",
2516
+ script: "text/javascript, application/javascript",
2517
+ json: "application/json, text/javascript",
2518
+ text: "text/plain",
2519
+ _default: "*/*"
2520
+ }
2513
2521
  },
2514
2522
 
2515
2523
  // Last-Modified header cache for next request
@@ -2587,7 +2595,7 @@ jQuery.extend({
2587
2595
 
2588
2596
  // If we're requesting a remote document
2589
2597
  // and trying to load JSON or Script with a GET
2590
- if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && ( s.dataType == "script" || s.dataType =="json" ) && s.type.toLowerCase() == "get" ) {
2598
+ if ( (!s.url.indexOf("http") || !s.url.indexOf("//")) && s.dataType == "script" && s.type.toLowerCase() == "get" ) {
2591
2599
  var head = document.getElementsByTagName("head")[0];
2592
2600
  var script = document.createElement("script");
2593
2601
  script.src = s.url;
@@ -2623,7 +2631,7 @@ jQuery.extend({
2623
2631
  var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
2624
2632
 
2625
2633
  // Open the socket
2626
- xml.open(s.type, s.url, s.async);
2634
+ xml.open(s.type, s.url, s.async, s.username, s.password);
2627
2635
 
2628
2636
  // Need an extra try/catch for cross domain requests in Firefox 3
2629
2637
  try {
@@ -2638,6 +2646,11 @@ jQuery.extend({
2638
2646
 
2639
2647
  // Set header so the called script knows that it's an XMLHttpRequest
2640
2648
  xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
2649
+
2650
+ // Set the Accepts header for the server, depending on the dataType
2651
+ xml.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
2652
+ s.accepts[ s.dataType ] + ", */*" :
2653
+ s.accepts._default );
2641
2654
  } catch(e){}
2642
2655
 
2643
2656
  // Allow custom headers/mimetypes
@@ -2853,6 +2866,9 @@ jQuery.fn.extend({
2853
2866
  if ( jQuery.css(this,"display") == "none" ) {
2854
2867
  var elem = jQuery("<" + this.tagName + " />").appendTo("body");
2855
2868
  this.style.display = elem.css("display");
2869
+ // handle an edge condition where css is - div { display:none; } or similar
2870
+ if (this.style.display == "none")
2871
+ this.style.display = "block";
2856
2872
  elem.remove();
2857
2873
  }
2858
2874
  }).end();
@@ -2982,9 +2998,6 @@ jQuery.fn.extend({
2982
2998
  return queue( this[0], type );
2983
2999
 
2984
3000
  return this.each(function(){
2985
- if ( this.nodeType != 1)
2986
- return;
2987
-
2988
3001
  if ( fn.constructor == Array )
2989
3002
  queue(this, type, fn);
2990
3003
  else {
@@ -1,6 +1,3 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
1
  require 'ramaze'
5
2
  require 'ramaze/spec/helper'
6
3
 
@@ -14,14 +11,14 @@ describe MainController do
14
11
  it 'should show start page' do
15
12
  got = get('/')
16
13
  got.status.should == 200
17
- got.at_xpath('//title').text.strip.should ==
14
+ got.at('//title').text.strip.should ==
18
15
  MainController.new.index
19
16
  end
20
17
 
21
18
  it 'should show /notemplate' do
22
19
  got = get('/notemplate')
23
20
  got.status.should == 200
24
- got.at_xpath('//body').text.strip.should ==
21
+ got.at('//body').text.strip.should ==
25
22
  MainController.new.notemplate
26
23
  end
27
24
  end
data/lib/proto/start.rb CHANGED
@@ -1,6 +1,3 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
1
  require 'rubygems'
5
2
  require 'ramaze'
6
3