-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"separateMethodMetaAndSource" : false, | ||
"noMethodMetaData" : true, | ||
"useCypressPropertiesFile" : true | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
repository/JQuery-Examples.package/WATodoWithJQuery.class/class/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
initialization | ||
initialize | ||
(WAAdmin register: self asApplicationAt: '/examples/todo-jquery') | ||
exceptionHandler: WADebugErrorHandler; | ||
addLibrary: WAExamplesLibrary |
6 changes: 6 additions & 0 deletions
6
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/addTodo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
actions | ||
addTodo: aString | ||
| newTodo | | ||
newTodo := WATodoWithJQueryItem newWithDescription: aString in: todos. | ||
todos add: newTodo. | ||
^ newTodo |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/children.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
children | ||
^ self todos |
6 changes: 6 additions & 0 deletions
6
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialization | ||
initialize | ||
super initialize. | ||
todos := OrderedCollection new. | ||
1 to: 5000 do: [ :index | | ||
self addTodo: 'Task ', index greaseString ] |
19 changes: 19 additions & 0 deletions
19
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/renderAddNewTodoOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
rendering | ||
renderAddNewTodoOn: html | ||
| newTodo | | ||
html header | ||
id: #header; | ||
with: [ | ||
html heading | ||
level: 1; | ||
with: 'todos'. | ||
html textInput | ||
id: #'new-todo'; | ||
autofocus; | ||
attributeAt: 'autocomplete' put: 'off'; | ||
callback: [ :value | newTodo := self addTodo: value ]; | ||
onChange: (html jQuery ajax | ||
serializeThis; | ||
script: [ :s | s << ((s jQuery id: 'todo-list') append: newTodo) ]; | ||
onComplete: ((html jQuery id: #'new-todo') value: '')); | ||
placeholder: 'What needs to be done?' ] |
7 changes: 7 additions & 0 deletions
7
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/renderContentOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rendering | ||
renderContentOn: html | ||
html section | ||
id: #todoapp; | ||
with: [ | ||
self renderAddNewTodoOn: html. | ||
self renderTodosOn: html ] |
19 changes: 19 additions & 0 deletions
19
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/renderTodosOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
rendering | ||
renderTodosOn: html | ||
|
||
html section | ||
id: 'main'; | ||
with: [ | ||
html checkbox | ||
id: 'toggle-all'. | ||
html label | ||
for: 'toggle-all'; | ||
with: 'Mark all as complete'. | ||
html unorderedList | ||
id: 'todo-list'; | ||
script: (self scriptToTriggerCheckboxToggleOn: html); | ||
script: (self scriptToTriggerRenameOn: html); | ||
script: (self scriptToTriggerEditOn: html); | ||
script: (self scriptToSerializeEditOn: html); | ||
with: [ | ||
self todos do: [ :todoItem | todoItem renderOn: html ] ] ] |
17 changes: 17 additions & 0 deletions
17
...itory/JQuery-Examples.package/WATodoWithJQuery.class/instance/scriptToSerializeEditOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
rendering | ||
scriptToSerializeEditOn: html | ||
|
||
| currentItem itemId | | ||
^ html jQuery this | ||
on: 'change' | ||
selector:'.edit' | ||
do: (( | ||
html jQuery ajax | ||
serialize: (html jQuery expression: (JSStream on:'event.target')); | ||
callback: [ :passengers | currentItem := passengers first ] | ||
passengers: ((html jQuery expression: (JSStream on:'event.target')) closest:'li'); | ||
callback: [ :id | itemId := id ] | ||
value: (JSStream on:'$(event.target).closest("li").get(0).id'); | ||
script: [ :s | s << (((s jQuery id: itemId) find: 'label') html: currentItem description) ]; | ||
onComplete: ((((html jQuery expression: (JSStream on: 'event.target')) closest:'li') find: '.edit') hide, (((html jQuery expression: (JSStream on: 'event.target')) closest:'li') find: 'label') show)) | ||
asFunction: #(event)) |
7 changes: 7 additions & 0 deletions
7
...uery-Examples.package/WATodoWithJQuery.class/instance/scriptToTriggerCheckboxToggleOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rendering | ||
scriptToTriggerCheckboxToggleOn: html | ||
|
||
^ html jQuery this | ||
on: 'click' | ||
selector: '.toggle' | ||
do: ((html jQuery ajax serializeWithHidden: (html jQuery expression: (JSStream on: 'event.target'))) asFunction: #(event)) |
7 changes: 7 additions & 0 deletions
7
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/scriptToTriggerEditOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rendering | ||
scriptToTriggerEditOn: html | ||
|
||
^ html jQuery this | ||
on: 'click' | ||
selector: '.view>label' | ||
do: (((((html jQuery expression: (JSStream on: 'event.target')) hide closest:'li') find: '.edit') show) asFunction:#(event)) |
10 changes: 10 additions & 0 deletions
10
...itory/JQuery-Examples.package/WATodoWithJQuery.class/instance/scriptToTriggerRenameOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rendering | ||
scriptToTriggerRenameOn: html | ||
|
||
^ html jQuery this | ||
on: 'click' | ||
selector: '.destroy' | ||
do: ((html jQuery ajax | ||
callback: [ :passengers | passengers first remove ] | ||
passengers: (((html jQuery expression: (JSStream on:'event.target')) closest: 'li')); | ||
onComplete: (((html jQuery expression: (JSStream on:'event.target')) closest: 'li') remove)) asFunction: #(event)) |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/todos.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
todos | ||
^ todos |
6 changes: 6 additions & 0 deletions
6
repository/JQuery-Examples.package/WATodoWithJQuery.class/instance/updateRoot..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
rendering | ||
updateRoot: aRoot | ||
|
||
super updateRoot: aRoot. | ||
aRoot stylesheet url: WAExamplesLibrary / #todoCss. | ||
aRoot javascript url: JQDeploymentLibrary / #jQueryJs |
13 changes: 13 additions & 0 deletions
13
repository/JQuery-Examples.package/WATodoWithJQuery.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "WAExampleComponent", | ||
"category" : "JQuery-Examples", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"todos" | ||
], | ||
"name" : "WATodoWithJQuery", | ||
"type" : "normal" | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
...sitory/JQuery-Examples.package/WATodoWithJQueryItem.class/class/newWithDescription.in..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
instance creation | ||
newWithDescription: aString in: aCollection | ||
^ self new initializeWithDescription: aString in: aCollection |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/description..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
description: anObject | ||
description := anObject |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/description.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
description | ||
^ description |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/done..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
done: anObject | ||
done := anObject |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/done.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
done | ||
^ done |
6 changes: 6 additions & 0 deletions
6
...ery-Examples.package/WATodoWithJQueryItem.class/instance/initializeWithDescription.in..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
initialization | ||
initializeWithDescription: aString in: aCollection | ||
self initialize. | ||
self done: false. | ||
self description: aString. | ||
todos := aCollection |
3 changes: 3 additions & 0 deletions
3
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/remove.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
private | ||
remove | ||
todos remove: self |
20 changes: 20 additions & 0 deletions
20
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/instance/renderContentOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
rendering | ||
renderContentOn: html | ||
html listItem | ||
passenger: self; | ||
with: [ | ||
html div | ||
class: 'view'; | ||
with:[ | ||
html checkbox | ||
class: 'toggle'; | ||
callback: [ :value | self done: value ]; | ||
value: done. | ||
html label: description. | ||
html button | ||
class: 'destroy' ]. | ||
html textInput | ||
class: 'edit'; | ||
style: 'display:none'; | ||
callback: [ :value | self description: value ]; | ||
value: description ] |
15 changes: 15 additions & 0 deletions
15
repository/JQuery-Examples.package/WATodoWithJQueryItem.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "WAComponent", | ||
"category" : "JQuery-Examples", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"todos", | ||
"description", | ||
"done" | ||
], | ||
"name" : "WATodoWithJQueryItem", | ||
"type" : "normal" | ||
} |
1 change: 1 addition & 0 deletions
1
repository/JQuery-Examples.package/monticello.meta/categories.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SystemOrganization addCategory: #'JQuery-Examples'! |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(name 'JQuery-Examples') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ } |