[Seaside Commits] Seaside 3.0: JQuery-UI-lr.41.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Thu Nov 12 08:22:37 CET 2009


Lukas Renggli uploaded a new version of JQuery-UI to project Seaside 3.0:
http://www.squeaksource.com/Seaside30/JQuery-UI-lr.41.mcz

==================== Summary ====================

Name: JQuery-UI-lr.41
Author: lr
Time: 12 November 2009, 8:22:28 am
UUID: 1032be5a-27c1-4b95-8de7-657944f82a54
Ancestors: JQuery-UI-lr.40

- fixed the #generate method to work with latest code (not yet moved somewhere else, as we don't have a good package for that)
- updated documentation to latest status

=============== Diff against JQuery-UI-lr.40 ===============

Item was changed:
  ----- Method: JQSlider>>animate: (in category 'options-generated') -----
+ animate: aBooleanOrStringOrNumber
+ 	"Whether to slide handle smoothly when user click outside handle on the bar. Will also accept a string representing one of the three predefined speeds ('slow', 'normal', or 'fast') or the number of milliseconds to run the animation (e.g. 1000)."
- animate: aBoolean
- 	"Whether to slide handle smoothly when user click outside handle on the bar."
  
+ 	self optionAt: 'animate' put: aBooleanOrStringOrNumber!
- 	self optionAt: 'animate' put: aBoolean!

Item was added:
+ ----- Method: JQDialog>>closeText: (in category 'options-generated') -----
+ closeText: aString
+ 	"Specifies the text for the close button."
+ 
+ 	self optionAt: 'closeText' put: aString!

Item was changed:
  ----- Method: JQSortable>>revert: (in category 'options-generated') -----
+ revert: aBooleanInteger
+ 	"If set to true, the item will be reverted to its new DOM position with a smooth animation. Optionally, it can also be set to a number that controls the duration of the animation in ms."
- revert: aBoolean
- 	"If set to true, the item will be reverted to its new DOM position with a smooth animation."
  
+ 	self optionAt: 'revert' put: aBooleanInteger!
- 	self optionAt: 'revert' put: aBoolean!

Item was changed:
  ----- Method: JQDialog>>height: (in category 'options-generated') -----
  height: aNumber
+ 	"The height of the dialog, in pixels. Specifying <nowiki>'auto'</nowiki> is also supported to make the dialog adjust based on its content."
- 	"The height of the dialog, in pixels."
  
  	self optionAt: 'height' put: aNumber!

Item was changed:
  ----- Method: JQSlider>>orientation: (in category 'options-generated') -----
  orientation: aString
+ 	"This option determines whether the slider has the min at the left, the max at the right or the min at the bottom, the max at the top. Possible values: 'horizontal', 'vertical'."
- 	"Normally you don't need to set this option because the plugin detects the slider orientation automatically. If the orientation is not correctly detected you can set this option to 'horizontal' or 'vertical'."
  
  	self optionAt: 'orientation' put: aString!

Item was changed:
  ----- Method: JQWidget class>>generate (in category 'private') -----
  generate
  	"This code is used to generate the widget classes from the JQuery documentation. It is not necessary to port this code to other platforms. The code is already run from within Pharo and normally does not need to be called by you."
  
  	| model url |
  	model := (Smalltalk at: #RBNamespace) new.
  	url := 'http://docs.jquery.com/action/raw/UI/API/1.7.2/'.
  	#('Draggable' 'Droppable' 'Resizable' 'Selectable' 'Sortable' 'Accordion' 'Datepicker' 'Dialog' 'Progressbar' 'Slider' 'Tabs' ) do: [ :id |
  		| stream string class matcher tokens argument dictionary removals selector source |
  
  		" fetch documentation "
  		stream := (Smalltalk at: #HTTPSocket) httpGet: url , id.
  		stream isString ifTrue: [ self error: stream ].
  		string := (stream contents
  			replaceAll: Character cr with: Character space)
  			replaceAll: Character lf with: Character space.
  
  		" prepare class "
  		removals := Set new.
  		class := model classNamed: ('JQ' , id) asSymbol.
  		class isNil ifTrue: [ self error: 'Class not found JQ' , id ].
  		class selectors do: [ :rselector |
  			((class protocolsFor: rselector)
  				anySatisfy: [ :each | each endsWith: '-generated' ])
  					ifTrue: [ removals add: rselector ] ].
  
  		" generate options "
  		matcher := '\{\{UIAPIPluginOption\|' asRegex.
  		matcher matchesIn: string do: [ :match |
+ 			tokens := string copyFrom: (matcher subEnd: 1) first to: string size.
- 			tokens := string copyFrom: (matcher subEnd: 1) to: string size.
  			tokens := ((tokens readStream upToAll: '}}') findTokens: $|)
  				collect: [ :each | each withBlanksCondensed ].
  			argument := ((tokens at: 3)
  				copyReplaceAll: ',' with: 'Or')
  				select: [ :each | each isAlphaNumeric ].
  			argument := (argument first isVowel
  				ifTrue: [ 'an' ] ifFalse: [ 'a' ]) , argument.
  			selector := ((tokens at: 2) , ':') asSymbol.
  			source := selector , ' ' , argument , '
  	"' , (((tokens at: 5) copyReplaceAll: '"' with: '''') copyReplaceAll: '''''' with: '''') , '"
  
  	self optionAt: ' , (tokens at: 2) printString , ' put: ' , argument.
  			removals remove: selector ifAbsent: [ ].
  			(class sourceCodeFor: selector) = source
  				ifFalse: [ class compile: source classified: #'options-generated' ] ].
  
  		" generate events "
  		matcher := '\{\{(UIAPIPluginEvent|UIAPIPluginDatepickerEvent)\|' asRegex.
  		matcher matchesIn: string do: [ :match |
+ 			tokens := string copyFrom: (matcher subEnd: 1) first to: string size.
- 			tokens := string copyFrom: (matcher subEnd: 1) to: string size.
  			dictionary := Dictionary new.
  			((tokens readStream upToAll: '}}') findTokens: $|) do: [ :each |
  				dictionary
  					at: (each copyUpTo: $=) withBlanksCondensed asLowercase
  					put: (each copyAfter: $=) withBlanksCondensed ].
  			((dictionary includesKey: 'event') and: [ dictionary includesKey: 'description' ]) ifTrue: [
  				selector := ((((dictionary at: 'event') beginsWith: 'on')
  					ifTrue: [ dictionary at: 'event' ]
  					ifFalse: [ 'on' , (dictionary at: 'event') capitalized ]) , ':') asSymbol.
  				source := selector , ' anObject
  	"' , (((dictionary at: 'description') copyReplaceAll: '"' with: '''') copyReplaceAll: '''''' with: '''') , '"
  
  	self optionAt: ' , (dictionary at: 'event') printString , ' put: anObject asFunction'.
  				removals remove: selector ifAbsent: [ ].
  				(class sourceCodeFor: selector) = source
  					ifFalse: [ class compile: source classified: #'events-generated' ] ] ].
  			
  		" generate methods "
  		matcher := '\{\{UIAPIPluginMethod\|' asRegex.
  		matcher matchesIn: string do: [ :match |
+ 			tokens := string copyFrom: (matcher subEnd: 1) first to: string size.
- 			tokens := string copyFrom: (matcher subEnd: 1) to: string size.
  			Transcript show: class name; show: (tokens readStream upToAll: '}}'); cr; cr ].
  
  		" remove methods not present anymore "
  		removals do: [ :rselector | class removeMethod: rselector ] ].
  
  	" open changes "
  	model changes open!

Item was changed:
  ----- Method: JQDialog>>position: (in category 'options-generated') -----
  position: aStringOrArray
+ 	"Specifies where the dialog should be displayed. Possible values: <br>1) a single string representing position within viewport: 'center', 'left', 'right', 'top', 'bottom'. <br>2) an array containing an <em>x,y</em> coordinate pair in pixel offset from left, top corner of viewport (e.g. [350,100]) <br>3) an array containing <em>x,y</em> position string values (e.g. ['right','top'] for top right corner)."
- 	"Specifies where the dialog should be displayed. Possible values: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport) or the possible string values (e.g. ['right','top'] for top right corner)."
  
  	self optionAt: 'position' put: aStringOrArray!




More information about the commits mailing list