Skip to content

Commit

Permalink
Add modal support.
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Apr 7, 2017
1 parent 206fa7a commit 0b49dc5
Show file tree
Hide file tree
Showing 85 changed files with 438 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commentStamp" : "<historical>",
"super" : "WillowTestCase",
"category" : "Willow-Bootstrap-Tests-Plugin",
"category" : "Willow-Bootstrap-Tests-Plugins",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ testRoles
self
assert: BootstrapConstants alert equals: 'alert';
assert: BootstrapConstants button equals: 'button';
assert: BootstrapConstants dialog equals: 'dialog';
assert: BootstrapConstants document equals: 'document';
assert: BootstrapConstants group equals: 'group';
assert: BootstrapConstants navigation equals: 'navigation';
assert: BootstrapConstants presentation equals: 'presentation';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"instance" : {
"testDataAPI" : "GabrielOmarCotelli 4/6/2017 17:19",
"testRoles" : "GabrielOmarCotelli 4/4/2017 11:35"
"testRoles" : "GabrielOmarCotelli 4/7/2017 17:11"
},
"class" : { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
tests
testModal

self
assert: BootstrapCssStyles modal equals: 'modal';
assert: BootstrapCssStyles modalBackdrop equals: 'modal-backdrop';
assert: BootstrapCssStyles modalBody equals: 'modal-body';
assert: BootstrapCssStyles modalContent equals: 'modal-content';
assert: BootstrapCssStyles modalDialog equals: 'modal-dialog';
assert: BootstrapCssStyles modalFooter equals: 'modal-footer';
assert: BootstrapCssStyles modalHeader equals: 'modal-header';
assert: BootstrapCssStyles modalLarge equals: 'modal-lg';
assert: BootstrapCssStyles modalOpen equals: 'modal-open';
assert: BootstrapCssStyles modalSmall equals: 'modal-sm';
assert: BootstrapCssStyles modalTitle equals: 'modal-title'
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"testWells" : "GabrielOmarCotelli 4/4/2017 11:32",
"testPanels" : "GabrielOmarCotelli 4/4/2017 11:17",
"testCode" : "GabrielOmarCotelli 4/4/2017 10:26",
"testForms" : "GabrielOmarCotelli 4/4/2017 10:34",
"testModal" : "GabrielOmarCotelli 4/7/2017 17:13",
"testGridSystem" : "GabrielOmarCotelli 4/4/2017 10:37",
"testLabels" : "GabrielOmarCotelli 4/4/2017 10:53",
"testMediaObjects" : "GabrielOmarCotelli 4/4/2017 11:05",
"testAlerts" : "GabrielOmarCotelli 4/4/2017 10:19",
"testResponsiveUtilities" : "GabrielOmarCotelli 4/4/2017 11:23",
"testContainers" : "GabrielOmarCotelli 4/4/2017 10:27",
"testTables" : "GabrielOmarCotelli 4/5/2017 16:42",
"testForms" : "GabrielOmarCotelli 4/4/2017 10:34",
"testResponsiveUtilities" : "GabrielOmarCotelli 4/4/2017 11:23",
"testDropdowns" : "GabrielOmarCotelli 4/4/2017 10:29",
"testTables" : "GabrielOmarCotelli 4/5/2017 16:42",
"testProgressBars" : "GabrielOmarCotelli 4/4/2017 11:18",
"testNavigation" : "GabrielOmarCotelli 4/6/2017 17:50"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A BootstrapModalTest is a test class for testing the behavior of BootstrapModal
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
private
renderModalContentApplying: aBlock

^ self
renderUsing: [ :canvas |
| div modal |

div := canvas div class: BootstrapCssStyles modal.
modal := canvas jQuery new bootstrapModal.
aBlock value: modal.
div script: modal ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tests-Options
testBackdrop

| html |

html := self renderModalContentApplying: [ :modal | modal backdrop: BootstrapConstants static ].

self
assert: html
equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal({"backdrop":"static"});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tests-Options
testBackdropBoolean

| html |

html := self renderModalContentApplying: [ :modal | modal backdrop: true ].

self
assert: html
equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal({"backdrop":true});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testHide

| html |

html := self renderModalContentApplying: [ :modal | modal hide ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal("hide");</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testOnHidden

| html |

html := self renderModalContentApplying: [ :modal | modal onHidden: JSFunction new ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal().on("hidden.bs.modal",function(){});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testOnHide

| html |

html := self renderModalContentApplying: [ :modal | modal onHide: JSFunction new ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal().on("hide.bs.modal",function(){});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testOnShow

| html |

html := self renderModalContentApplying: [ :modal | modal onShow: JSFunction new ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal().on("show.bs.modal",function(){});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testOnShown

| html |

html := self renderModalContentApplying: [ :modal | modal onShown: JSFunction new ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal().on("shown.bs.modal",function(){});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
tests-Options
testOptions

| html |

html := self
renderModalContentApplying: [ :modal |
modal
backdrop: false;
keyboard: false;
show: true ].

self
assert: html
equals:
'<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal({"backdrop":false,"keyboard":false,"show":true});</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testShow

| html |

html := self renderModalContentApplying: [ :modal | modal show ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal("show");</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests-Methods
testToggle

| html |

html := self renderModalContentApplying: [ :modal | modal toggle ].

self assert: html equals: '<div class="modal" id="id1"></div><script type="text/javascript">$("#id1").modal("toggle");</script>'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"instance" : {
"testOnShown" : "GabrielOmarCotelli 4/7/2017 17:04",
"testHide" : "GabrielOmarCotelli 4/7/2017 16:57",
"renderModalContentApplying:" : "GabrielOmarCotelli 4/7/2017 16:56",
"testToggle" : "GabrielOmarCotelli 4/7/2017 16:58",
"testOnHidden" : "GabrielOmarCotelli 4/7/2017 17:03",
"testBackdrop" : "GabrielOmarCotelli 4/7/2017 16:59",
"testBackdropBoolean" : "GabrielOmarCotelli 4/7/2017 17:00",
"testShow" : "GabrielOmarCotelli 4/7/2017 16:58",
"testOnShow" : "GabrielOmarCotelli 4/7/2017 17:03",
"testOnHide" : "GabrielOmarCotelli 4/7/2017 17:03",
"testOptions" : "GabrielOmarCotelli 4/7/2017 17:00"
},
"class" : { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "<historical>",
"super" : "WillowTestCase",
"category" : "Willow-Bootstrap-Tests-Plugins",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BootstrapModalTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SystemOrganization addCategory: #'Willow-Bootstrap-Tests'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Frontend'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Libraries'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Plugin'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Plugins'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-Select'!
SystemOrganization addCategory: 'Willow-Bootstrap-Tests-WebViews'!
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.16' message 'Add test cases' id 'ac9b9f2a-fa08-0d00-9f64-276c051ce4ae' date '7 April 2017' time '4:14:07.188075 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.15' message 'Add Collapse plugin support' id '814bc73c-f608-0d00-b4d7-2112039fb704' date '7 April 2017' time '11:32:51.909823 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.14' message 'Add Bootstrap Navigation Bar support' id '70332d67-e808-0d00-af59-926405851807' date '6 April 2017' time '7:02:33.689635 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.13' message 'Fixed notification section rendering.' id 'bd31953c-e008-0d00-ac33-2ec00cf493dd' date '6 April 2017' time '9:17:59.346597 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.12' message 'Fixed notification section rendering.' id 'd69eb12d-e008-0d00-9830-fa1006c06800' date '6 April 2017' time '9:13:49.550294 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.11' message 'Fixed notification section rendering.' id '5f01dee1-df08-0d00-9aa7-98460d42ab5d' date '6 April 2017' time '8:52:37.390687 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.10' message 'Updated test case.' id '48124f58-d208-0d00-8951-61d70577508c' date '5 April 2017' time '4:43:34.970116 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.9' message 'Rename utility method ' id '0be12911-ce08-0d00-993b-9d360ef8e485' date '5 April 2017' time '11:37:21.481165 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.8' message 'Add WillowApplication support.' id 'f839e32c-c008-0d00-8497-8f49002954dd' date '4 April 2017' time '7:02:57.070801 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.7' message 'Add test cases' id '15e9533c-ba08-0d00-8ee5-5b5d0356d0e3' date '4 April 2017' time '11:57:46.310111 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.6' message 'Add meta and doctype tests' id '7267da57-aa08-0d00-a579-6951059f230d' date '3 April 2017' time '5:00:08.632371 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.5' message 'Add test cases' id 'e835709f-a708-0d00-86c4-b79e00e2ec5f' date '3 April 2017' time '1:45:24.730536 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.4' message 'Add Bootstrap Libraries' id '31d0f4f1-a508-0d00-be3a-bfa10315a44d' date '3 April 2017' time '11:45:19.217911 am' author 'GabrielOmarCotelli' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.17' message 'Add modal support.' id '95553d6c-fc08-0d00-8233-34be0f9a6dbd' date '7 April 2017' time '6:55:37.978453 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.16' message 'Add test cases' id 'ac9b9f2a-fa08-0d00-9f64-276c051ce4ae' date '7 April 2017' time '4:14:07.188075 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.15' message 'Add Collapse plugin support' id '814bc73c-f608-0d00-b4d7-2112039fb704' date '7 April 2017' time '11:32:51.909823 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.14' message 'Add Bootstrap Navigation Bar support' id '70332d67-e808-0d00-af59-926405851807' date '6 April 2017' time '7:02:33.689635 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.13' message 'Fixed notification section rendering.' id 'bd31953c-e008-0d00-ac33-2ec00cf493dd' date '6 April 2017' time '9:17:59.346597 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.12' message 'Fixed notification section rendering.' id 'd69eb12d-e008-0d00-9830-fa1006c06800' date '6 April 2017' time '9:13:49.550294 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-MaximilianoTabacman.11' message 'Fixed notification section rendering.' id '5f01dee1-df08-0d00-9aa7-98460d42ab5d' date '6 April 2017' time '8:52:37.390687 am' author 'MaximilianoTabacman' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.10' message 'Updated test case.' id '48124f58-d208-0d00-8951-61d70577508c' date '5 April 2017' time '4:43:34.970116 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.9' message 'Rename utility method ' id '0be12911-ce08-0d00-993b-9d360ef8e485' date '5 April 2017' time '11:37:21.481165 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.8' message 'Add WillowApplication support.' id 'f839e32c-c008-0d00-8497-8f49002954dd' date '4 April 2017' time '7:02:57.070801 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.7' message 'Add test cases' id '15e9533c-ba08-0d00-8ee5-5b5d0356d0e3' date '4 April 2017' time '11:57:46.310111 am' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.6' message 'Add meta and doctype tests' id '7267da57-aa08-0d00-a579-6951059f230d' date '3 April 2017' time '5:00:08.632371 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.5' message 'Add test cases' id 'e835709f-a708-0d00-86c4-b79e00e2ec5f' date '3 April 2017' time '1:45:24.730536 pm' author 'GabrielOmarCotelli' ancestors ((name 'Willow-Bootstrap-Tests-GabrielOmarCotelli.4' message 'Add Bootstrap Libraries' id '31d0f4f1-a508-0d00-be3a-bfa10315a44d' date '3 April 2017' time '11:45:19.217911 am' author 'GabrielOmarCotelli' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Methods
hide

functionAsArgument := 'hide'
functionName := 'hide'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Methods
show

functionAsArgument := 'show'
functionName := 'show'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Methods
toggle

functionAsArgument := BootstrapConstants toggle
functionName := BootstrapConstants toggle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"instance" : {
"parent:" : "GabrielOmarCotelli 4/7/2017 10:49",
"toggle:" : "GabrielOmarCotelli 4/7/2017 10:49",
"method" : "GabrielOmarCotelli 4/7/2017 10:47",
"hide" : "GabrielOmarCotelli 4/7/2017 10:50",
"arguments" : "GabrielOmarCotelli 4/7/2017 10:45",
"toggle" : "GabrielOmarCotelli 4/7/2017 10:50",
"show" : "GabrielOmarCotelli 4/7/2017 10:50"
"method" : "GabrielOmarCotelli 4/7/2017 16:46",
"hide" : "GabrielOmarCotelli 4/7/2017 16:45",
"toggle" : "GabrielOmarCotelli 4/7/2017 16:45",
"show" : "GabrielOmarCotelli 4/7/2017 16:45"
},
"class" : { }
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"commentStamp" : "GabrielOmarCotelli 4/7/2017 10:45",
"super" : "JQPlugin",
"super" : "BootstrapPlugin",
"category" : "Willow-Bootstrap-Plugins",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"functionAsArgument"
],
"instvars" : [ ],
"name" : "BootstrapCollapse",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data-API
backdrop

^ 'backdrop'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Roles
dialog

^ 'dialog'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Roles
document

^ 'document'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Events
hiddenModal

^ 'hidden.bs.modal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Events
hideModal

^ 'hide.bs.modal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data-API
keyboard

^ 'keyboard'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data-API
modal

^ 'modal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data-API
show

^ 'show'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Events
showModal

^ 'show.bs.modal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Events
shownModal

^ 'shown.bs.modal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data-API
static

^ 'static'

0 comments on commit 0b49dc5

Please sign in to comment.