sproutcore 0.9.13 → 0.9.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/History.txt +19 -0
  2. data/Manifest.txt +103 -26
  3. data/app_generators/sproutcore/templates/README +1 -1
  4. data/bin/sc-build +1 -1
  5. data/bin/sc-gen +0 -0
  6. data/bin/sc-ide +278 -0
  7. data/bin/sc-init +38 -0
  8. data/bin/sc-install +96 -0
  9. data/bin/sc-remove +94 -0
  10. data/bin/sc-server +4 -0
  11. data/bin/sc-update +94 -0
  12. data/bin/sproutcore +3 -14
  13. data/clients/sc_docs/controllers/docs.js +1 -1
  14. data/clients/sc_docs/models/doc.js +6 -0
  15. data/clients/sc_docs/views/doc_frame.js +1 -1
  16. data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
  17. data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
  18. data/frameworks/sproutcore/HISTORY +34 -2
  19. data/frameworks/sproutcore/controllers/array.js +1 -1
  20. data/frameworks/sproutcore/controllers/controller.js +1 -1
  21. data/frameworks/sproutcore/controllers/object.js +9 -6
  22. data/frameworks/sproutcore/core.js +19 -4
  23. data/frameworks/sproutcore/english.lproj/blank.gif +0 -0
  24. data/frameworks/sproutcore/english.lproj/core.css +1 -0
  25. data/frameworks/sproutcore/english.lproj/menu.css +1 -0
  26. data/frameworks/sproutcore/foundation/application.js +3 -3
  27. data/frameworks/sproutcore/foundation/benchmark.js +1 -1
  28. data/frameworks/sproutcore/foundation/node_descriptor.js +13 -1
  29. data/frameworks/sproutcore/foundation/page.js +3 -2
  30. data/frameworks/sproutcore/foundation/path_module.js +33 -16
  31. data/frameworks/sproutcore/foundation/run_loop.js +1 -1
  32. data/frameworks/sproutcore/foundation/server.js +68 -18
  33. data/frameworks/sproutcore/foundation/string.js +1 -1
  34. data/frameworks/sproutcore/globals/window.js +62 -15
  35. data/frameworks/sproutcore/lib/core_views.rb +1 -0
  36. data/frameworks/sproutcore/lib/index.rhtml +4 -3
  37. data/frameworks/sproutcore/lib/menu_views.rb +2 -2
  38. data/frameworks/sproutcore/models/collection.js +122 -107
  39. data/frameworks/sproutcore/models/record.js +2 -2
  40. data/frameworks/sproutcore/panes/manager.js +1 -1
  41. data/frameworks/sproutcore/panes/overlay.js +3 -3
  42. data/frameworks/sproutcore/tests/controllers/object.rhtml +26 -0
  43. data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +2 -2
  44. data/frameworks/sproutcore/views/button/disclosure.js +1 -1
  45. data/frameworks/sproutcore/views/collection/collection.js +19 -15
  46. data/frameworks/sproutcore/views/collection/source_list.js +1 -1
  47. data/frameworks/sproutcore/views/collection/table.js +2 -2
  48. data/frameworks/sproutcore/views/error_explanation.js +1 -1
  49. data/frameworks/sproutcore/views/field/checkbox_field.js +1 -1
  50. data/frameworks/sproutcore/views/field/field.js +1 -1
  51. data/frameworks/sproutcore/views/field/radio_field.js +1 -1
  52. data/frameworks/sproutcore/views/field/select_field.js +1 -1
  53. data/frameworks/sproutcore/views/form.js +1 -1
  54. data/frameworks/sproutcore/views/image.js +1 -1
  55. data/frameworks/sproutcore/views/menu_item.js +1 -1
  56. data/frameworks/sproutcore/views/popup_button.js +1 -1
  57. data/frameworks/sproutcore/views/popup_menu.js +1 -1
  58. data/frameworks/sproutcore/views/progress.js +4 -2
  59. data/frameworks/sproutcore/views/radio_group.js +1 -1
  60. data/frameworks/sproutcore/views/scroll.js +1 -1
  61. data/frameworks/sproutcore/views/source_list_group.js +1 -1
  62. data/frameworks/sproutcore/views/split.js +1 -1
  63. data/frameworks/sproutcore/views/tab.js +3 -1
  64. data/frameworks/sproutcore/views/view.js +19 -3
  65. data/jsdoc/README.txt +89 -57
  66. data/jsdoc/app/frame/Chain.js +102 -0
  67. data/jsdoc/app/frame/Dumper.js +144 -0
  68. data/jsdoc/app/frame/Hash.js +47 -0
  69. data/jsdoc/app/frame/Link.js +142 -0
  70. data/jsdoc/app/frame/Namespace.js +10 -0
  71. data/jsdoc/app/frame/Opt.js +134 -0
  72. data/jsdoc/app/frame/Reflection.js +26 -0
  73. data/jsdoc/app/frame/String.js +93 -0
  74. data/jsdoc/app/frame/Testrun.js +129 -0
  75. data/jsdoc/app/frame.js +33 -0
  76. data/jsdoc/app/handlers/FOODOC.js +26 -0
  77. data/jsdoc/app/handlers/XMLDOC/DomReader.js +159 -0
  78. data/jsdoc/app/handlers/XMLDOC/XMLDoc.js +16 -0
  79. data/jsdoc/app/handlers/XMLDOC/XMLParse.js +292 -0
  80. data/jsdoc/app/handlers/XMLDOC.js +26 -0
  81. data/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
  82. data/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
  83. data/jsdoc/app/lib/JSDOC/JsDoc.js +180 -0
  84. data/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
  85. data/jsdoc/app/lib/JSDOC/Lang.js +144 -0
  86. data/jsdoc/app/lib/JSDOC/Parser.js +109 -0
  87. data/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
  88. data/jsdoc/app/lib/JSDOC/Symbol.js +600 -0
  89. data/jsdoc/app/lib/JSDOC/SymbolSet.js +220 -0
  90. data/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
  91. data/jsdoc/app/lib/JSDOC/Token.js +18 -0
  92. data/jsdoc/app/lib/JSDOC/TokenReader.js +323 -0
  93. data/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
  94. data/jsdoc/app/lib/JSDOC/Util.js +32 -0
  95. data/jsdoc/app/lib/JSDOC/Walker.js +416 -0
  96. data/jsdoc/app/lib/JSDOC.js +97 -0
  97. data/jsdoc/app/main.js +74 -0
  98. data/jsdoc/app/plugins/commentSrcJson.js +19 -0
  99. data/jsdoc/app/plugins/frameworkPrototype.js +16 -0
  100. data/jsdoc/app/plugins/functionCall.js +10 -0
  101. data/jsdoc/app/plugins/publishSrcHilite.js +62 -0
  102. data/jsdoc/app/plugins/sproutcoreTags.js +26 -0
  103. data/jsdoc/app/plugins/symbolLink.js +9 -0
  104. data/jsdoc/app/plugins/tagParamConfig.js +31 -0
  105. data/jsdoc/app/plugins/tagSynonyms.js +43 -0
  106. data/jsdoc/app/run.js +339 -137
  107. data/jsdoc/changes.txt +47 -0
  108. data/jsdoc/conf/sample.conf +31 -0
  109. data/jsdoc/java/build.xml +36 -0
  110. data/jsdoc/java/build_1.4.xml +36 -0
  111. data/jsdoc/java/classes/js.jar +0 -0
  112. data/jsdoc/java/src/JsDebugRun.java +21 -0
  113. data/jsdoc/java/src/JsRun.java +21 -0
  114. data/jsdoc/jsdebug.jar +0 -0
  115. data/jsdoc/jsrun.jar +0 -0
  116. data/jsdoc/t/TestDoc.js +144 -0
  117. data/jsdoc/t/runner.js +13 -0
  118. data/jsdoc/templates/sproutcore/allclasses.tmpl +17 -0
  119. data/jsdoc/templates/sproutcore/allfiles.tmpl +56 -0
  120. data/jsdoc/templates/sproutcore/class.tmpl +408 -326
  121. data/jsdoc/templates/sproutcore/index.tmpl +30 -31
  122. data/jsdoc/templates/sproutcore/publish.js +173 -81
  123. data/jsdoc/templates/sproutcore/static/default.css +191 -0
  124. data/jsdoc/templates/sproutcore/static/header.html +2 -0
  125. data/jsdoc/templates/sproutcore/static/index.html +19 -0
  126. data/jsdoc/templates/sproutcore/symbol.tmpl +35 -0
  127. data/jsdoc/test/addon.js +24 -0
  128. data/jsdoc/test/anon_inner.js +14 -0
  129. data/jsdoc/test/augments.js +31 -0
  130. data/jsdoc/test/augments2.js +26 -0
  131. data/jsdoc/test/borrows.js +41 -0
  132. data/jsdoc/test/borrows2.js +23 -0
  133. data/jsdoc/test/config.js +22 -0
  134. data/jsdoc/test/constructs.js +18 -0
  135. data/jsdoc/test/encoding.js +10 -0
  136. data/jsdoc/test/encoding_other.js +12 -0
  137. data/jsdoc/test/functions_anon.js +39 -0
  138. data/jsdoc/test/functions_nested.js +33 -0
  139. data/jsdoc/test/global.js +13 -0
  140. data/jsdoc/test/globals.js +25 -0
  141. data/jsdoc/test/ignore.js +10 -0
  142. data/jsdoc/test/inner.js +16 -0
  143. data/jsdoc/test/jsdoc_test.js +477 -0
  144. data/jsdoc/test/lend.js +33 -0
  145. data/jsdoc/test/memberof.js +20 -0
  146. data/jsdoc/test/memberof_constructor.js +15 -0
  147. data/jsdoc/test/name.js +19 -0
  148. data/jsdoc/test/namespace_nested.js +23 -0
  149. data/jsdoc/test/nocode.js +13 -0
  150. data/jsdoc/test/oblit_anon.js +20 -0
  151. data/jsdoc/test/overview.js +20 -0
  152. data/jsdoc/test/param_inline.js +37 -0
  153. data/jsdoc/test/params_optional.js +8 -0
  154. data/jsdoc/test/prototype.js +17 -0
  155. data/jsdoc/test/prototype_nested.js +9 -0
  156. data/jsdoc/test/prototype_oblit.js +13 -0
  157. data/jsdoc/test/prototype_oblit_constructor.js +24 -0
  158. data/jsdoc/test/public.js +10 -0
  159. data/jsdoc/test/shared.js +42 -0
  160. data/jsdoc/test/shared2.js +2 -0
  161. data/jsdoc/test/shortcuts.js +22 -0
  162. data/jsdoc/test/static_this.js +13 -0
  163. data/jsdoc/test/synonyms.js +23 -0
  164. data/jsdoc/test/tosource.js +23 -0
  165. data/jsdoc/test/variable_redefine.js +14 -0
  166. data/jsdoc/test.js +304 -0
  167. data/lib/sproutcore/build_tools/resource_builder.rb +6 -1
  168. data/lib/sproutcore/bundle_installer.rb +268 -0
  169. data/lib/sproutcore/jsdoc.rb +7 -6
  170. data/lib/sproutcore/library.rb +38 -0
  171. data/lib/sproutcore/merb/bundle_controller.rb +8 -4
  172. data/lib/sproutcore/version.rb +1 -1
  173. data/lib/sproutcore.rb +1 -1
  174. data/script/destroy +0 -0
  175. data/script/generate +0 -0
  176. data/script/txt2html +0 -0
  177. metadata +117 -29
  178. data/clients/view_builder/core.js +0 -19
  179. data/clients/view_builder/english.lproj/body.css +0 -149
  180. data/clients/view_builder/english.lproj/body.rhtml +0 -18
  181. data/clients/view_builder/english.lproj/strings.js +0 -14
  182. data/clients/view_builder/main.js +0 -37
  183. data/jsdoc/app/DocFile.js +0 -137
  184. data/jsdoc/app/DocTag.js +0 -110
  185. data/jsdoc/app/Doclet.js +0 -63
  186. data/jsdoc/app/Dumper.js +0 -143
  187. data/jsdoc/app/JsDoc.js +0 -103
  188. data/jsdoc/app/JsHilite.js +0 -45
  189. data/jsdoc/app/JsIO.js +0 -163
  190. data/jsdoc/app/JsParse.js +0 -385
  191. data/jsdoc/app/JsPlate.js +0 -130
  192. data/jsdoc/app/JsTestrun.js +0 -129
  193. data/jsdoc/app/JsToke.js +0 -564
  194. data/jsdoc/app/Symbol.js +0 -298
  195. data/jsdoc/app/Transformer.js +0 -14
  196. data/jsdoc/app/Util.js +0 -97
  197. data/jsdoc/app/js.jar +0 -0
  198. data/jsdoc/plugins/min.js +0 -316
  199. data/jsdoc/plugins/strip.js +0 -20
  200. data/jsdoc/templates/sproutcore/default.css +0 -191
  201. data/jsdoc/templates/sproutcore/index.html +0 -13
  202. data/jsdoc/templates/sproutcore/prototype.js +0 -4186
  203. data/jsdoc/templates/sproutcore/splash.html +0 -7
data/bin/sc-remove ADDED
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # REMOVES A SPROUTCORE BUNDLE
4
+ # This script will attempt to update installed framework and application
5
+ # bundles from github. If the framework or application is not already
6
+ # installed, it will attempt to install it.
7
+ #
8
+ # Usage:
9
+ # sc-remove owner-projectname
10
+
11
+
12
+ APP_ROOT = File.expand_path(Dir.pwd)
13
+ SC_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
14
+ $:.unshift File.join(SC_ROOT,'lib') ;
15
+
16
+ # Set String encoding to Unicode
17
+ $KCODE = 'u'
18
+
19
+ # Require SproutCore
20
+ require 'rubygems'
21
+ require 'rubigen'
22
+ require 'sproutcore'
23
+ require 'optparse'
24
+
25
+ ############################################################
26
+ ## Define Helper Methods
27
+ ##
28
+
29
+
30
+ ############################################################
31
+ ## Process Options
32
+ ##
33
+
34
+ # Process options
35
+ bundle_name = ARGV.shift if (ARGV.size > 0 && ARGV[0][0..0] != '-')
36
+ options = {
37
+ :verbose => false,
38
+ :library_root => APP_ROOT,
39
+ :can_install => false # Ignore install-related options.
40
+ }
41
+
42
+ opts = OptionParser.new do |opts|
43
+ opts.version = SproutCore::VERSION::STRING
44
+
45
+ opts.banner = "Usage: sc-update {bundle-name} {options}"
46
+ opts.define_head "Remotely update JavaScript bundles from Github and other sources"
47
+ opts.separator ''
48
+ opts.separator '*'*80
49
+ opts.separator 'If no flags are given, sc-update will attempt to update the named bundle from'
50
+ opts.separator 'github into the local project.'
51
+ opts.separator '*'*80
52
+
53
+ SC::BundleInstaller.configure_tool_options(opts, options)
54
+ end
55
+
56
+ begin
57
+ opts.parse!
58
+ rescue Exception => e
59
+ puts opts
60
+ puts e
61
+ exit(1)
62
+ end
63
+
64
+ ############################################################
65
+ ## SETUP ENVIRONMENT
66
+ ##
67
+
68
+ # Configure logger
69
+ SC.logger.level = (options[:verbose]) ? Logger::DEBUG : Logger::INFO
70
+ SC.logger.progname = $0
71
+ SC.logger.info("sc-remove v#{SproutCore::VERSION::STRING}")
72
+
73
+ # Confirm various safety settings
74
+ SC.logger.info(" ~ Verbose logging enabled") if options[:verbose]
75
+ SC.logger.info(" ~ Dry run mode - no change will be made") if options[:dry_run]
76
+
77
+ # Load Library
78
+ library = SC.library_for(options[:library_root])
79
+
80
+ ############################################################
81
+ ## PERFORM THE INSTALL
82
+ ##
83
+
84
+ if bundle_name.nil?
85
+ puts opts
86
+ SC.logger.fatal("A bundle name is required.")
87
+ exit(1)
88
+ end
89
+
90
+ library.remove_bundle(bundle_name, options)
91
+ SC.logger.debug("")
92
+
93
+
94
+
data/bin/sc-server CHANGED
@@ -36,6 +36,10 @@ unless ARGV.index('-p')
36
36
  ARGV.push *%w[-p 4020]
37
37
  end
38
38
 
39
+ unless ARGV.index('--merb-root')
40
+ ARGV.push "--merb-root=#{SC.library.root_path}"
41
+ end
42
+
39
43
  ############################################################
40
44
  ## Configure Merb
41
45
  ##
data/bin/sc-update ADDED
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # UPDATES A SPROUTCORE BUNDLE
4
+ # This script will attempt to update installed framework and application
5
+ # bundles from github. If the framework or application is not already
6
+ # installed, it will attempt to install it.
7
+ #
8
+ # Usage:
9
+ # sc-update owner-projectname
10
+ #
11
+ # You can also pass the standard install options for sc-install:
12
+ # sc-update owner-projectname --source=sproutit/sproutcore-samples
13
+ # sc-update owner-projectname --method=zip
14
+
15
+
16
+ APP_ROOT = File.expand_path(Dir.pwd)
17
+ SC_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
18
+ $:.unshift File.join(SC_ROOT,'lib') ;
19
+
20
+ # Set String encoding to Unicode
21
+ $KCODE = 'u'
22
+
23
+ # Require SproutCore
24
+ require 'rubygems'
25
+ require 'rubigen'
26
+ require 'sproutcore'
27
+ require 'optparse'
28
+
29
+ ############################################################
30
+ ## Define Helper Methods
31
+ ##
32
+
33
+
34
+ ############################################################
35
+ ## Process Options
36
+ ##
37
+
38
+ # Process options
39
+ bundle_name = ARGV.shift if (ARGV.size > 0 && ARGV[0][0..0] != '-')
40
+ options = { :verbose => false, :library_root => APP_ROOT }
41
+
42
+ opts = OptionParser.new do |opts|
43
+ opts.version = SproutCore::VERSION::STRING
44
+
45
+ opts.banner = "Usage: sc-update {bundle-name} {options}"
46
+ opts.define_head "Remotely update JavaScript bundles from Github and other sources"
47
+ opts.separator ''
48
+ opts.separator '*'*80
49
+ opts.separator 'If no flags are given, sc-update will attempt to update the named bundle from'
50
+ opts.separator 'github into the local project.'
51
+ opts.separator '*'*80
52
+
53
+ SC::BundleInstaller.configure_tool_options(opts, options)
54
+ end
55
+
56
+ begin
57
+ opts.parse!
58
+ rescue Exception => e
59
+ puts opts
60
+ puts e
61
+ exit(1)
62
+ end
63
+
64
+ ############################################################
65
+ ## SETUP ENVIRONMENT
66
+ ##
67
+
68
+ # Configure logger
69
+ SC.logger.level = (options[:verbose]) ? Logger::DEBUG : Logger::INFO
70
+ SC.logger.progname = $0
71
+ SC.logger.info("sc-update v#{SproutCore::VERSION::STRING}")
72
+
73
+ # Confirm various safety settings
74
+ SC.logger.info(" ~ Verbose logging enabled") if options[:verbose]
75
+ SC.logger.info(" ~ Dry run mode - no change will be made") if options[:dry_run]
76
+
77
+ # Load Library
78
+ library = SC.library_for(options[:library_root])
79
+
80
+ ############################################################
81
+ ## PERFORM THE INSTALL
82
+ ##
83
+
84
+ if bundle_name.nil?
85
+ puts opts
86
+ SC.logger.fatal("A bundle name is required.")
87
+ exit(1)
88
+ end
89
+
90
+ library.update_bundle(bundle_name, options)
91
+ SC.logger.debug("")
92
+
93
+
94
+
data/bin/sproutcore CHANGED
@@ -16,20 +16,6 @@ if %w(-v --version).include? ARGV.first
16
16
  exit(0)
17
17
  end
18
18
 
19
- if ARGV.first == 'freeze:edge'
20
- puts "Freezing SproutCore edge..."
21
- FileUtils.mkdir_p('frameworks')
22
- ['sproutcore'].each do |framework|
23
- if File.exists?(File.join('frameworks', framework, '.svn'))
24
- puts `svn up #{File.join('frameworks',framework)}`
25
- else
26
- puts `svn co http://sproutcore.googlecode.com/svn/trunk/frameworks/#{framework} #{File.join('frameworks', framework)}`
27
- end
28
- end
29
-
30
- exit(0)
31
- end
32
-
33
19
  require 'rubigen/scripts/generate'
34
20
  source = RubiGen::PathSource.new(:application,
35
21
  File.join(File.dirname(__FILE__), "../app_generators"))
@@ -37,3 +23,6 @@ RubiGen::Base.reset_sources
37
23
  RubiGen::Base.append_sources source
38
24
  RubiGen::Base.use_component_sources! [:sc, :app]
39
25
  RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'sproutcore')
26
+
27
+ puts "\n\nWARNING: This command will change in the near future.\nPlease use 'sc-init' instead of 'sproutcore' to create new project libraries.\n\n"
28
+
@@ -51,7 +51,7 @@ Docs.docsController = SC.Object.create({
51
51
  var clientRoot = this.get('clientRoot') ;
52
52
  clientRoot = clientRoot.replace(new RegExp("^%@/?".fmt(window.indexPrefix)), window.urlPrefix + '/');
53
53
  console.log('clientName: '+ clientRoot) ;
54
- Docs.server.request(clientRoot, ['data','classes.js'].join('/'), null, {
54
+ Docs.server.request(clientRoot, ['data',('classes.js?'+ Math.random())].join('/'), null, {
55
55
  onSuccess: this._reloadSuccess.bind(this),
56
56
  onFailure: this._reloadFailure.bind(this)
57
57
  }) ;
@@ -4,6 +4,12 @@
4
4
 
5
5
  require('core');
6
6
 
7
+ /**
8
+ @class
9
+
10
+ @extends SC.Record
11
+ @since SproutCore 1.0
12
+ */
7
13
  Docs.Doc = SC.Record.extend({
8
14
  icon: 'sc-icon-document-16'
9
15
  }) ;
@@ -13,7 +13,7 @@ Docs.DocFrameView = SC.View.extend({
13
13
  var doc = this.get('doc') ;
14
14
  var url = (doc) ? doc.get('url') : '' ;
15
15
  if (url.length > 0) {
16
- url = "/%@/%@/-docs/data/%@".fmt(window.urlPrefix,Docs.docsController.get('clientName'), url) ;
16
+ url = "/%@/%@/-docs/data/symbols/%@".fmt(window.urlPrefix,Docs.docsController.get('clientName'), url) ;
17
17
  }
18
18
 
19
19
  // make sure we clear out the old document settings if needed.
@@ -1,3 +1,37 @@
1
+ == sproutcore 0.9.14
2
+
3
+ - Fixed bug in SC.SourceListView that could incorrectly hide groups. Closes #57. (Thanks mguymon)
4
+
5
+ - Fixed bug in SC.ObjectController that would sometimes not commit all pending
6
+ changes because the model object would clear the changes hash. Also a test
7
+ for this was added. Closes #66. (Thanks YoNoSoyTu!)
8
+
9
+ - default index.html now has text/javascript added to script tags. Closes #71
10
+ - server.js now handles namespaced prefixes. Closes #74
11
+
12
+ - label_view now defaults to the span tag. Closes #75. (Thanks Erich!)
13
+
14
+ - Added support for posting data in both URL-encoded and JSON formats via
15
+ SC.server. This makes for a much cleaner round-trip. To use this, set the
16
+ postFormat: property to SC.JSON_FORMAT in SC.server. Closes #49.
17
+ (Thanks Mauris Lamers!)
18
+
19
+ - The newRecord property is now set to false once a record has been
20
+ successfully sent back to the server. A new internal property tracks when
21
+ you are waiting on a record to be created on the server and refuses to
22
+ submit it a second time. Closes #81 (Thanks Gareth!)
23
+
24
+ - All internal calls for arguments.callee.base.apply() have now been switched
25
+ to sc_super(). This means you MUST use version 0.9.13 or later of the build
26
+ tools to work with the javascript.
27
+
28
+ - Fixed a memory leak in IE that was caused by a self-reference to document.
29
+ (Thanks Juan)
30
+
31
+ - Improved documentation for a variety of classes. (Thanks gskluzacek)
32
+
33
+ - SC.Server can now handled nested Server prefixes in case you have
34
+ multi-level namespaces.
1
35
 
2
36
  == sproutcore 0.9.12
3
37
 
@@ -91,7 +125,6 @@ value. This makes it possible to do method chaining.
91
125
 
92
126
  - Properly order drop targets so that nested targets appear first.
93
127
 
94
-
95
128
  == 0.9.8
96
129
 
97
130
  * [FIX] collection views now update group views appropriately.
@@ -437,5 +470,4 @@ and table_view. Also refactored collection view helpers into their own file.
437
470
  * [FIX] SC.ObjectController: Avoid unwanted commit when oldValue == null && newValue == ''.
438
471
 
439
472
 
440
- == 0.9.0 2008-03-08
441
473
 
@@ -291,7 +291,7 @@ SC.ArrayController = SC.Controller.extend(SC.Array, SC.SelectionSupport,
291
291
  },
292
292
 
293
293
  init: function() {
294
- arguments.callee.base.apply(this, arguments) ;
294
+ sc_super() ;
295
295
  if (this.get('content')) this._contentObserver() ;
296
296
  }
297
297
 
@@ -67,7 +67,7 @@ SC.Controller = SC.Object.extend(
67
67
  */
68
68
  init: function()
69
69
  {
70
- arguments.callee.base.apply(this,arguments);
70
+ sc_super();
71
71
  this._contextObserver();
72
72
  },
73
73
 
@@ -147,16 +147,19 @@ SC.ObjectController = SC.Controller.extend(
147
147
  } else {
148
148
 
149
149
  if (content.beginPropertyChanges) content.beginPropertyChanges() ;
150
- for(var key in this._changes) {
151
- if (!this._changes.hasOwnProperty(key)) continue;
150
+
151
+ // save the set of changes to apply them. Nothing should clear it but
152
+ // just in case.
153
+ var changes = this._changes ;
154
+ for(var key in changes) {
155
+ if (!changes.hasOwnProperty(key)) continue;
152
156
 
153
157
  var oldValue = content.get ? content.get(key) : content[key];
154
- var newValue = this._changes[key];
158
+ var newValue = changes[key];
155
159
 
156
160
  if (oldValue == null && newValue == '') newValue = null;
157
- if (newValue != oldValue)
158
- {
159
- (content.set) ? content.set('isDirty', true) : (content['isDirty'] = true);
161
+ if (newValue != oldValue) {
162
+ (content.set) ? content.set('isDirty', YES) : (content.isDirty=YES);
160
163
  }
161
164
 
162
165
  if (content.set) {
@@ -39,9 +39,16 @@
39
39
  //
40
40
  // ==========================================================================
41
41
 
42
- // All objects live in the SproutCore namespace, which is also availabe in the
43
- // abreviation SC.
44
- if (!window.SC) SC = {}; SproutCore = SC ;
42
+ if (!window.SC) {
43
+ /**
44
+ @namespace
45
+
46
+ All objects live in the SproutCore namespace, which is also availabe in the
47
+ abbreviation SC.
48
+ */
49
+ SC = {};
50
+ SproutCore = SC ;
51
+ }
45
52
 
46
53
  // this makes for some nicer to read code
47
54
  var YES = true ; var NO = false ;
@@ -90,7 +97,7 @@ Object.extend(SC,{
90
97
  tempDLIFrame.style.left='-10000px';
91
98
  // Don't set the iFrame content yet if this is Safari
92
99
  if (!(SC.isSafari())) {
93
- tempDLIFrame.setAttribute('src',path);
100
+ tempDLIFrame.setAttribute('src',path);
94
101
  }
95
102
  document.getElementsByTagName('body')[0].appendChild(tempDLIFrame);
96
103
  if (SC.isSafari()) {
@@ -100,9 +107,12 @@ Object.extend(SC,{
100
107
  if (!(SC.isSafari())) {
101
108
  var r = function() {
102
109
  document.body.removeChild(document.getElementById(frameId));
110
+ frameId = null;
103
111
  } ;
104
112
  var t = r.invokeLater(null, 2000);
105
113
  }
114
+ //remove possible IE7 leak
115
+ tempDLIFrame = null;
106
116
  },
107
117
 
108
118
  // Call this method during setup of your app to queue up methods to be
@@ -113,6 +123,7 @@ Object.extend(SC,{
113
123
  if (SC._onloadQueueFlushed) func.call(document);
114
124
  var queue = SC._onloadQueue || [] ;
115
125
  queue.push(func) ; SC._onloadQueue = queue ;
126
+ queue = null;
116
127
  },
117
128
 
118
129
  // To flush the callOnLoad queue, you need to set window.onload=SC.didLoad
@@ -150,6 +161,10 @@ Object.extend(SC,{
150
161
  }
151
162
 
152
163
  SC.runLoop.endRunLoop();
164
+ //remove possible IE7 leak
165
+ b = null;
166
+ queue = null;
167
+ func = null;
153
168
  },
154
169
 
155
170
  // this will take a URL of any type and convert it to a fully qualified URL.
File without changes
@@ -23,6 +23,7 @@
23
23
  user-select: none;
24
24
  opacity: 0.45;
25
25
  -moz-opacity: .45 ;
26
+ filter: alpha(opacity=45);
26
27
  z-index: 1000000;
27
28
  cursor: default ;
28
29
  }
@@ -83,6 +83,7 @@
83
83
  .menu-pane li.menu-item.disabled a img {
84
84
  opacity: .50;
85
85
  -moz-opacity: .50 ;
86
+ filter: alpha(opacity=50);
86
87
  }
87
88
 
88
89
  .menu-pane li.menu-item .shortcut {
@@ -87,7 +87,7 @@ SC.Application = SC.Responder.extend(
87
87
 
88
88
  /**
89
89
  * Route an action message to the appropriate responder
90
- * @param {String} action The action to perform
90
+ * @param {String} action The action to perform - this is a method name.
91
91
  * @param {SC.Responder} target The object to perform the action upon. Set to null to search the Responder chain for a receiver.
92
92
  * @param {Object} sender The sender of the action
93
93
  * @returns return value info
@@ -104,8 +104,8 @@ SC.Application = SC.Responder.extend(
104
104
  // no action, no target...
105
105
  if (!action || ($type(action) != T_STRING)) return null;
106
106
 
107
- // an explicit target was passed... but make sure that it does indeed respond to the action...
108
- if (target) return target.respondsTo(action) ? target : null;
107
+ // an explicit target was passed...
108
+ if (target) return target.respondsTo(action) ? target : null ;
109
109
 
110
110
  // ok, no target was passed... try to find one in the responder chain
111
111
  var keyPane = this.get('keyPane');
@@ -86,7 +86,7 @@ SC.Benchmark = {
86
86
  var stat = this._statFor(key) ;
87
87
  var start = stat._starts.pop() ;
88
88
  if (!start) {
89
- console.log('WARNING: SC.Benchmark "%@" ended without a matching start. No information was saved.'.fmt(key));
89
+ console.log('SC.Benchmark "%@" ended without a matching start. No information was saved.'.fmt(key));
90
90
  return ;
91
91
  }
92
92
 
@@ -49,9 +49,21 @@ SC.NodeDescriptor = {
49
49
  childNodes.each(function(desc) {
50
50
  ret.appendChild(that.create(desc)) ;
51
51
  }) ;
52
+ that=null;
53
+ childNodes=null;
52
54
  }
53
55
 
54
- return ret ;
56
+ try{
57
+ return ret ;
58
+ }finally{
59
+ //ie7 memory leaks
60
+ tag=null;
61
+ className=null;
62
+ elementId=null;
63
+ style=null;
64
+ innerHTML=null;
65
+ ret=null;
66
+ }
55
67
  },
56
68
 
57
69
  ignoredProperties: ['tag','cssClass','id','style','childNodes','innerHTML']
@@ -28,7 +28,7 @@ SC.Page = SC.Object.extend(
28
28
  }
29
29
  ret.awake() ;
30
30
  return ret ;
31
- } else return arguments.callee.base.apply(this,arguments) ;
31
+ } else return sc_super() ;
32
32
  },
33
33
 
34
34
  // in addition to activating bindings, calling awake on the page object
@@ -43,10 +43,11 @@ SC.Page = SC.Object.extend(
43
43
  },
44
44
 
45
45
  init: function() {
46
- arguments.callee.base.apply(this,arguments) ;
46
+ sc_super() ;
47
47
  var el = this.rootElement = $('resources') ;
48
48
  SC.callOnLoad(function() {
49
49
  if (el && el.parentNode) el.parentNode.removeChild(el) ;
50
+ el = null;
50
51
  }) ;
51
52
  },
52
53
 
@@ -32,61 +32,76 @@ NO_LIMIT = 10000 ;
32
32
  */
33
33
  SC.PathModule = {
34
34
 
35
+ // NOTE: The code below simulates having document.rootElement = document.
36
+ // we can't actually do this assignment because it will leak memory in IE.
37
+
35
38
  $$func: function(func, levels, max, nest) {
36
- return SC._PathModule.$$func(this.rootElement,func,levels,max,nest);
39
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
40
+ return SC._PathModule.$$func(el,func,levels,max,nest);
37
41
  },
38
42
 
39
43
  $$C: function(className, levels, max, nest) {
40
- return SC._PathModule.$$C(this.rootElement,className,levels,max,nest);
44
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
45
+ return SC._PathModule.$$C(el,className,levels,max,nest);
41
46
  },
42
47
 
43
48
  $$T: function(tagName, levels, max, nest) {
44
- return SC._PathModule.$$T(this.rootElement,tagName,levels,max,nest);
49
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
50
+ return SC._PathModule.$$T(el,tagName,levels,max,nest);
45
51
  },
46
52
 
47
53
  $$P: function(property, value, levels, max, nest) {
48
- return SC._PathModule.$$P(this.rootElement, property, value, levels, max, nest);
54
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
55
+ return SC._PathModule.$$P(el, property, value, levels, max, nest);
49
56
  },
50
57
 
51
58
  $$S: function(selector, levels, max, nest) {
52
- return SC._PathModule.$$S(this.rootElement, selector, levels, max, nest);
59
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
60
+ return SC._PathModule.$$S(el, selector, levels, max, nest);
53
61
  },
54
62
 
55
63
  // finds the first node for which func returns true.
56
64
  $func: function(func, levels) {
57
- return SC._PathModule.$func(this.rootElement, func, levels);
65
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
66
+ return SC._PathModule.$func(el, func, levels);
58
67
  },
59
68
 
60
69
  // finds the first node with class name. returns element, not array.
61
70
  $C: function(className, levels) {
62
- return SC._PathModule.$C(this.rootElement, className, levels);
71
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
72
+ return SC._PathModule.$C(el, className, levels);
63
73
  },
64
74
 
65
75
  // finds the first node with tag name. returns element, not array.
66
76
  $T: function(tagName, levels) {
67
- return SC._PathModule.$T(this.rootElement, tagName, levels);
77
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
78
+ return SC._PathModule.$T(el, tagName, levels);
68
79
  },
69
80
 
70
81
  // find first node with an attribute matching then named value.
71
82
  $P: function(attr, value, levels) {
72
- return SC._PathModule.$P(this.rootElement, attr, value, levels);
83
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
84
+ return SC._PathModule.$P(el, attr, value, levels);
73
85
  },
74
86
 
75
87
  // find first node matching the specified class selector.
76
88
  $S: function(selector, levels) {
77
- return SC._PathModule.$S(this.rootElement, selector, levels);
89
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
90
+ return SC._PathModule.$S(el, selector, levels);
78
91
  },
79
92
 
80
93
  // find an element and configure it as the named view if it is not already
81
94
  // configured.
82
95
  $$view: function(selector, viewClass, levels, max, nest) {
83
- return SC._PathModule.$$view(this.rootElement, selector, viewClass, levels, max, nest) ;
96
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
97
+ return SC._PathModule.$$view(el, selector, viewClass, levels, max, nest) ;
84
98
  },
85
99
 
86
100
  // find the first element matching the selector and create a view if it is
87
101
  // not already configured.
88
102
  $view: function(selector, viewClass, levels) {
89
- return SC._PathModule.$view(this.rootElement, selector, viewClass, levels) ;
103
+ var el = (this.rootElement) ? this.rootElement : (this === document) ? document : null ;
104
+ return SC._PathModule.$view(el, selector, viewClass, levels) ;
90
105
  }
91
106
 
92
107
  };
@@ -219,7 +234,7 @@ SC._PathModule = {
219
234
 
220
235
  // convert star to NO_LIMIT
221
236
  if (blevels == '*') blevels = NO_LIMIT ;
222
- if (bmax == '*') bmac = NO_LIMIT ;
237
+ if (bmax == '*') bmax = NO_LIMIT ;
223
238
 
224
239
  // prepare the selector info.
225
240
  // q tells us how to process the first part.
@@ -247,6 +262,7 @@ SC._PathModule = {
247
262
  if (fret == null) {
248
263
  fret = [] ;
249
264
  for(var i=0;i<ret.length;i++) {
265
+
250
266
  var found = SC._PathModule.$$func(ret[i],function(node) {
251
267
  var match ;
252
268
  switch(q) {
@@ -269,7 +285,8 @@ SC._PathModule = {
269
285
  }
270
286
 
271
287
  // if the first item matched, verify that the others match as well.
272
- for(var i=0; match && i < bits.length; i++) {
288
+ var ilen = bits.length ;
289
+ for(var i=0; match && i < ilen; i++) {
273
290
  if (!Element.hasClassName(node,bits[i])) match = false ;
274
291
  }
275
292
  return match ;
@@ -283,7 +300,8 @@ SC._PathModule = {
283
300
  // now follow indicies, if there are any
284
301
  if (indicies && indicies.length > 0 && ret) {
285
302
  ret = ret.map(function(el){
286
- for(var iloc=0; el && (iloc < indicies.length); iloc++) {
303
+ var iloclen = indicies.length ;
304
+ for(var iloc=0; el && (iloc < iloclen); iloc++) {
287
305
  el = el.childNodes[indicies[iloc]] ;
288
306
  }
289
307
  return el;
@@ -393,7 +411,6 @@ if (typeof HTMLElement != 'undefined') {
393
411
 
394
412
  // applies to document
395
413
  Object.extend(document,SC.PathModule) ;
396
- document.rootElement = document ;
397
414
 
398
415
  // applies to window.
399
416
  Object.extend(Object.extend(window,SC.PathModule), {
@@ -246,7 +246,7 @@ SC.runLoop = SC.Object.create({
246
246
 
247
247
  // find next timer to trigger. If the first unpaused timer.
248
248
  var rec = this._next ;
249
- while(rec && rec.timer.get('isPaused')) rec = rec.next ;
249
+ while(rec && (!rec.timer || rec.timer.get('isPaused')) ) rec = rec.next ;
250
250
 
251
251
  // if no next timer was found, then cancel any timer.
252
252
  if (!rec) {