Skip to content

Commit

Permalink
Merge 762d6dc into f9a387c
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Jul 11, 2018
2 parents f9a387c + 762d6dc commit c3dccb8
Show file tree
Hide file tree
Showing 60 changed files with 241 additions and 90 deletions.
3 changes: 1 addition & 2 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MaterialDesignLite',
#directory : 'src',
#platforms : [ #pharo ]
#directory : 'src'
}
],
#testing : {
Expand Down
38 changes: 22 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
language: smalltalk
sudo: false

os:
- linux
- osx

smalltalk:
- Pharo-7.0
- Pharo-6.1
- Pharo-5.0

matrix:
fast_finish: true
allow_failures:
- smalltalk: Pharo-7.0
language: smalltalk
sudo: false

os:
- linux
- osx

smalltalk:
- Pharo-7.0
- Pharo-6.1
- Pharo-5.0
- GemStone-3.4.1

matrix:
fast_finish: true
allow_failures:
- smalltalk: Pharo-7.0

# This make Gemstone builds 3x faster
cache:
directories:
- $SMALLTALK_CI_CACHE
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,14 @@ ZnWorkspace openUrl: 'http://ws.stfx.eu/1JIZRQS7OI00'

## Smalltalk versions compatibility

| MDL version | Compatible Pharo versions |
|------------- |--------------------------- |
| 1.x.x | Pharo 50, 60, 61 |
| MDL version | Compatible Pharo versions | Compatible Gemstone versions |
|------------- |--------------------------- |--------------------------- |
| 1.1.x | Pharo 50, 60, 61 | None |
| 1.2.x | Pharo 50, 60, 61 | None |
| Dev | Pharo 50, 60, 61 | Gemstone 3.4.1 (*) (**) |

(*) *This version of Gemstone is tested. Older versions might work but we did not tested it.*
(**) *The compatibility is not total. MaterialDesignLite uses Pharo's Traits to provide the users composables components. Thus, if the Gemstone users wants to use those components they will have to flatten themself the Traits in their Seaside application*

## Under the hood

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hexColor: aString
style:
(String
streamContents: [ :s |
s << 'background-color: '.
(aString first = $#)
ifFalse: [ s << $# ].
s << aString ])
s nextPutAll: 'background-color: '.
aString first = $#
ifFalse: [ s nextPut: $# ].
s nextPutAll: aString ])
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ getJsShowingSnackbar
^ String
streamContents: [ :s |
s
<< 'var snackbarContainer=document.querySelector("#';
<< self id;
<< '");var data={};data.message="';
<< (self message ifNil: [ '' ]);
<< '";data.timeout=';
<< self timeout asString;
<< $;.
nextPutAll: 'var snackbarContainer=document.querySelector("#';
nextPutAll: self id;
nextPutAll: '");var data={};data.message="';
nextPutAll: (self message ifNil: [ '' ]);
nextPutAll: '";data.timeout=';
nextPutAll: self timeout asString;
nextPut: $;.
action
ifNotNil: [ s
<< 'data.actionText="';
<< (self actionText ifNil: [ 'Action' ]);
<< '";var handler=function(event){';
<< self action;
<< '};data.actionHandler=handler;' ].
s << 'snackbarContainer.MaterialSnackbar.showSnackbar(data);' ]
nextPutAll: 'data.actionText="';
nextPutAll: (self actionText ifNil: [ 'Action' ]);
nextPutAll: '";var handler=function(event){';
nextPutAll: self action;
nextPutAll: '};data.actionHandler=handler;' ].
s nextPutAll: 'snackbarContainer.MaterialSnackbar.showSnackbar(data);' ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*Material-Design-Lite-Components
mdlMultilineTextField: text
SystemVersion current major > 5
ifTrue: [ self deprecated: 'Uses #mdlTextArea:' transformWith: '`@receiver mdlMultilineTextField: `@statements1' -> '`@receiver mdlTextArea: `@statements1' ]
ifFalse: [ self deprecated: 'Uses #mdlTextArea:' ].
(self isOnGemstone or: [ SystemVersion current major < 6 ])
ifTrue: [ self deprecated: 'Uses #mdlTextArea:' ]
ifFalse: [ self deprecated: 'Uses #mdlTextArea:' transformWith: '`@receiver mdlMultilineTextField: `@statements1' -> '`@receiver mdlTextArea: `@statements1' ].
^ self mdlTextArea: text
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*Material-Design-Lite-Components
mdlMultilineTextField
SystemVersion current major > 5
ifTrue: [ self deprecated: 'Uses #mdlTextArea' transformWith: '`@receiver mdlMultilineTextField' -> '`@receiver mdlTextArea' ]
ifFalse: [ self deprecated: 'Uses #mdlTextArea' ].
(self isOnGemstone or: [ SystemVersion current major < 6 ])
ifTrue: [ self deprecated: 'Uses #mdlTextArea' ]
ifFalse: [ self deprecated: 'Uses #mdlTextArea' transformWith: '`@receiver mdlMultilineTextField' -> '`@receiver mdlTextArea' ].
^ self mdlTextArea
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
helpers
mockMethod
"I am a Mock method for tests"

^ 2 + 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
helpers
testCodeOf
self
assert: (self codeOf: #mockMethod)
equals:
' "I am a Mock method for tests"
^ 2 + 3'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "TestCase",
"category" : "Material-Design-Lite-Core-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "MDLCoreTests",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Material-Design-Lite-Core
codeOf: aSymbol
"I take a method selector I contains and return his source code without the declaration."

^ String streamContents: [ :stream | (self class sourceCodeAt: aSymbol) lines allButFirst do: [ :ea | stream nextPutAll: ea ] separatedBy: [ stream nextPutAll: GRPlatform current newline ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Material-Design-Lite-Core
isOnGemstone
"In Gemstone we load the package Matrial-Design-Lite-Gemstone which includes a MDLGemstone class. We can use this to know if we are on Gemstone."

^ Smalltalk hasClassNamed: #MDLGemstone
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "Object"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ mdlDemoCss
,
''') no-repeat top left/contain;
}
.mdl-demo-warning{
color: rgba(255,152,0 ,1);
}
.mdl-doc{
width: 100%;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ renderContentOn: html
with: [ html heading
level3;
with: self title.
html paragraph: self description ].
html paragraph: self description.
self renderWarningMessageOn: html ].
self renderScreenContentOn: html ]
size: 12 ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rendering
renderWarningMessageOn: html
self warningMessage ifNil: [ ^ self ].

html div
class: 'mdl-demo-warning';
mdlTypographyBody2;
with: 'Warning: ', self warningMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
warningMessage
"Potential warning message to display"

^ nil
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
rendering
renderScreenContentOn: html
html div
style: 'color: #' , MDLColor red asHexString , '; margin: 32px; font-size: smaller;';
with: 'Warning: This widget will be deleted in the next major release of MDL. You can replace it by the MDLSortableTableWidget.'.
self render: self pagination on: html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
warningMessage
^ 'This widget will be deleted in the next major release of MDL. You can replace it by the MDLSortableTableWidget.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
warningMessage
^ 'This extension is not available in the Gemstone version of this project. This is due to the lack of Traits on Gemstone. You can reproduce it by flattening the Traits of the project in your project.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
warningMessage
^ 'This extension is not available in the Gemstone version of this project. This is due to the lack of Traits on Gemstone. You can reproduce it by flattening the Traits of the project in your project.'
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ renderSelectOn: html
ifFalse: [ (number - 1) greaseString ] ]
callback: [ :input |
Transcript
<< input;
show: input;
cr ]
selectedObject: 3
tooltip: 'description'
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "MDLRightanelResizerTest",
"name" : "MDLRightPanelResizerTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
tests
testRenderEmptyGenericDialogOn
"This component is not available on Gemstone"
self isOnGemstone ifTrue: [ ^ self ].

self
assert: [ :html | MDLMockRootDialogRenderer new renderEmptyGenericDialogOn: html ]
generatedIncludesAll: #('mdl-dialog' 'data-openbtnid="root-dialog__open"' 'data-closebtnid="root-dialog__close"')
5 changes: 3 additions & 2 deletions src/Material-Design-Lite-GemStone.package/.filetree
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "CharacterCollection" }
"name" : "CharacterCollection"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*Material-Design-Lite-GemStone
detect: aBlock ifFound: foundBlock ifNone: exceptionBlock
"Evaluate aBlock with each of the receiver's elements as the argument.
If some element evaluates aBlock to true, then cull this element into
foundBlock and answer the result of this evaluation.
If none evaluate to true, then evaluate exceptionBlock."

self
do: [ :each |
(aBlock value: each)
ifTrue: [ ^ foundBlock cull: each ] ].
^ exceptionBlock value
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Material-Design-Lite-GemStone
isNotEmpty
"Answer whether the receiver contains any elements."

^ self isEmpty not
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "Collection"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Material-Design-Lite-GemStone
firstWeekdayOfMonth: month year: year
"Answer the weekday index of the first day in <month> in the <year>."

^ (self year: year month: month day: 1) weekdayIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*Material-Design-Lite-GemStone
monthNames
"Return a collection of month names"

^ MonthNames copy value
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*Material-Design-Lite-GemStone
monthAbbreviation
^ self monthName copyFrom: 1 to: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "Date"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "MDLAnchorButton" }
"name" : "MDLAnchorButton"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "MDLButton" }
"name" : "MDLButton"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "MDLExampleRootDialogRoot" }
"name" : "MDLExampleRootDialogRoot"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Description
--------------------

I am a class just used to know if the Gemstone support is in the image.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "CyrilFerlicot 7/9/2018 15:18",
"super" : "Object",
"category" : "Material-Design-Lite-GemStone",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "MDLGemstone",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "MDLMockRootDialogRenderer" }
"name" : "MDLMockRootDialogRenderer"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "Object" }
"name" : "Object"
}
Loading

0 comments on commit c3dccb8

Please sign in to comment.