Permalink
Browse files

feature: All samples are live

  • Loading branch information...
MikeMitterer committed Oct 23, 2018
1 parent f9a3d4c commit 6fdfbae28d779efec5990fe65dd58f06dedd4d7f
Showing with 330 additions and 185 deletions.
  1. +30 −7 README.md
  2. +24 −0 REMINDER.md
  3. +11 −5 deploy-samples.sh
  4. +3 −54 pubspec.yaml
  5. +14 −0 samples/_scripts/.prep.default.kts
  6. +95 −0 samples/_templates/default.app.scss
  7. +1 −1 samples/m4d_accordion/.prep.config.properties
  8. +1 −1 samples/m4d_accordion/.rsync
  9. +1 −7 samples/m4d_accordion/pubspec.yaml
  10. +1 −0 samples/m4d_accordion/web/_app.scss
  11. +4 −2 samples/m4d_accordion/web/index.html
  12. +2 −0 samples/m4d_animation/.prep.config.properties
  13. +1 −1 samples/m4d_animation/.rsync
  14. +1 −7 samples/m4d_animation/pubspec.yaml
  15. +1 −0 samples/m4d_animation/web/_app.scss
  16. +4 −2 samples/m4d_animation/web/index.html
  17. +1 −0 samples/m4d_badge/.prep.config.properties
  18. +1 −1 samples/m4d_badge/.rsync
  19. +1 −7 samples/m4d_badge/pubspec.yaml
  20. +1 −0 samples/m4d_badge/web/_app.scss
  21. +4 −2 samples/m4d_badge/web/index.html
  22. +2 −0 samples/m4d_button/.prep.config.properties
  23. +1 −1 samples/m4d_button/.rsync
  24. +1 −7 samples/m4d_button/pubspec.yaml
  25. +1 −0 samples/m4d_button/web/_app.scss
  26. +4 −2 samples/m4d_button/web/index.html
  27. +1 −1 samples/m4d_checkbox/.prep.config.properties
  28. +1 −1 samples/m4d_checkbox/.rsync
  29. +1 −7 samples/m4d_checkbox/pubspec.yaml
  30. +1 −0 samples/m4d_checkbox/web/_app.scss
  31. +4 −2 samples/m4d_checkbox/web/index.html
  32. +1 −0 samples/m4d_datatable/.prep.config.properties
  33. +1 −1 samples/m4d_datatable/.rsync
  34. +1 −7 samples/m4d_datatable/pubspec.yaml
  35. +1 −0 samples/m4d_datatable/web/_app.scss
  36. +4 −2 samples/m4d_datatable/web/index.html
  37. +2 −0 samples/m4d_datatable2/.prep.config.properties
  38. +1 −1 samples/m4d_datatable2/.rsync
  39. +0 −3 samples/m4d_datatable2/lib/devicestatus.dart
  40. +1 −7 samples/m4d_datatable2/pubspec.yaml
  41. +1 −0 samples/m4d_datatable2/web/_app.scss
  42. +4 −2 samples/m4d_datatable2/web/index.html
  43. +1 −0 samples/m4d_footer/.prep.config.properties
  44. +1 −1 samples/m4d_footer/.rsync
  45. +1 −0 samples/m4d_footer/web/_app.scss
  46. +4 −2 samples/m4d_footer/web/index.html
  47. +1 −0 samples/m4d_grid/.prep.config.properties
  48. +1 −1 samples/m4d_grid/.rsync
  49. +1 −0 samples/m4d_grid/web/_app.scss
  50. +4 −2 samples/m4d_grid/web/index.html
  51. +1 −0 samples/m4d_icontoggle/.prep.config.properties
  52. +1 −1 samples/m4d_icontoggle/.rsync
  53. +1 −0 samples/m4d_icontoggle/web/_app.scss
  54. +4 −2 samples/m4d_icontoggle/web/index.html
  55. +1 −0 samples/m4d_lablefield/.prep.config.properties
  56. +1 −1 samples/m4d_lablefield/.rsync
  57. +1 −0 samples/m4d_lablefield/web/_app.scss
  58. +1 −1 samples/m4d_lablefield/web/index.html
  59. +1 −0 samples/m4d_layout/.prep.config.properties
  60. +1 −1 samples/m4d_layout/.rsync
  61. +1 −0 samples/m4d_layout/web/_app.scss
  62. +4 −2 samples/m4d_layout/web/index.html
  63. +1 −0 samples/m4d_list/.prep.config.properties
  64. +1 −1 samples/m4d_list/.rsync
  65. +1 −0 samples/m4d_list/web/_app.scss
  66. +4 −2 samples/m4d_list/web/index.html
  67. +1 −0 samples/m4d_menu/.prep.config.properties
  68. +1 −1 samples/m4d_menu/.rsync
  69. +1 −0 samples/m4d_menu/web/_app.scss
  70. +4 −2 samples/m4d_menu/web/index.html
  71. +1 −0 samples/m4d_navpills/.prep.config.properties
  72. +1 −1 samples/m4d_navpills/.rsync
  73. +1 −0 samples/m4d_navpills/web/_app.scss
  74. +1 −1 samples/m4d_navpills/web/index.html
  75. +1 −0 samples/m4d_palette/.prep.config.properties
  76. +1 −1 samples/m4d_palette/.rsync
  77. +1 −0 samples/m4d_palette/web/_app.scss
  78. +1 −1 samples/m4d_palette/web/index.html
  79. +1 −0 samples/m4d_progress/.prep.config.properties
  80. +1 −1 samples/m4d_progress/.rsync
  81. +1 −0 samples/m4d_progress/web/_app.scss
  82. +1 −1 samples/m4d_progress/web/index.html
  83. +1 −0 samples/m4d_radio/.prep.config.properties
  84. +1 −1 samples/m4d_radio/.rsync
  85. +1 −0 samples/m4d_radio/web/_app.scss
  86. +1 −1 samples/m4d_radio/web/index.html
  87. +1 −0 samples/m4d_shadow/.prep.config.properties
  88. +1 −1 samples/m4d_shadow/.rsync
  89. +1 −0 samples/m4d_shadow/web/_app.scss
  90. +1 −1 samples/m4d_shadow/web/index.html
  91. +1 −0 samples/m4d_slider/.prep.config.properties
  92. +1 −1 samples/m4d_slider/.rsync
  93. +1 −0 samples/m4d_slider/web/_app.scss
  94. +1 −1 samples/m4d_slider/web/index.html
  95. +1 −0 samples/m4d_spinner/.prep.config.properties
  96. +1 −1 samples/m4d_spinner/.rsync
  97. +1 −0 samples/m4d_spinner/web/_app.scss
  98. +1 −1 samples/m4d_spinner/web/index.html
  99. +1 −0 samples/m4d_switch/.prep.config.properties
  100. +1 −1 samples/m4d_switch/.rsync
  101. +1 −0 samples/m4d_switch/web/_app.scss
  102. +1 −1 samples/m4d_switch/web/index.html
  103. +1 −0 samples/m4d_tabs/.prep.config.properties
  104. +1 −1 samples/m4d_tabs/.rsync
  105. +1 −0 samples/m4d_tabs/web/_app.scss
  106. +1 −1 samples/m4d_tabs/web/index.html
  107. +1 −0 samples/m4d_textfield/.prep.config.properties
  108. +1 −1 samples/m4d_textfield/.rsync
  109. +1 −0 samples/m4d_textfield/web/_app.scss
  110. +1 −1 samples/m4d_textfield/web/index.html
  111. +1 −0 samples/m4d_tooltip/.prep.config.properties
  112. +1 −1 samples/m4d_tooltip/.rsync
  113. +1 −0 samples/m4d_tooltip/web/_app.scss
  114. +1 −1 samples/m4d_tooltip/web/index.html
  115. +1 −0 samples/m4d_typography/.prep.config.properties
  116. +1 −1 samples/m4d_typography/.rsync
  117. +1 −0 samples/m4d_typography/web/_app.scss
  118. +1 −1 samples/m4d_typography/web/index.html
@@ -1,11 +1,34 @@
# Material4Dart - Basic Components
> Basic components like MaterialButton, MaterialCheckbox and so on
## Examples
> [GitHub](https://github.com/MikeMitterer/m4d_components)
## Reminder
[m4d_accordion.example.mikemitterer.at](http://m4d_accordion.example.mikemitterer.at)
[m4d_animation.example.mikemitterer.at](http://m4d_animation.example.mikemitterer.at)
[m4d_badge.example.mikemitterer.at](http://m4d_badge.example.mikemitterer.at)
[m4d_button.example.mikemitterer.at](http://m4d_button.example.mikemitterer.at)
[m4d_checkbox.example.mikemitterer.at](http://m4d_checkbox.example.mikemitterer.at)
[m4d_datatable.example.mikemitterer.at](http://m4d_datatable.example.mikemitterer.at)
[m4d_footer.example.mikemitterer.at](http://m4d_footer.example.mikemitterer.at)
[m4d_grid.example.mikemitterer.at](http://m4d_grid.example.mikemitterer.at)
[m4d_icontoggle.example.mikemitterer.at](http://m4d_icontoggle.example.mikemitterer.at)
[m4d_lablefield.example.mikemitterer.at](http://m4d_lablefield.example.mikemitterer.at)
[m4d_layout.example.mikemitterer.at](http://m4d_layout.example.mikemitterer.at)
[m4d_list.example.mikemitterer.at](http://m4d_list.example.mikemitterer.at)
[m4d_menu.example.mikemitterer.at](http://m4d_menu.example.mikemitterer.at)
[m4d_navpills.example.mikemitterer.at](http://m4d_navpills.example.mikemitterer.at)
[m4d_palette.example.mikemitterer.at](http://m4d_palette.example.mikemitterer.at)
[m4d_progress.example.mikemitterer.at](http://m4d_progress.example.mikemitterer.at)
[m4d_radio.example.mikemitterer.at](http://m4d_radio.example.mikemitterer.at)
[m4d_shadow.example.mikemitterer.at](http://m4d_shadow.example.mikemitterer.at)
[m4d_slider.example.mikemitterer.at](http://m4d_slider.example.mikemitterer.at)
[m4d_spinner.example.mikemitterer.at](http://m4d_spinner.example.mikemitterer.at)
[m4d_switch.example.mikemitterer.at](http://m4d_switch.example.mikemitterer.at)
[m4d_tabs.example.mikemitterer.at](http://m4d_tabs.example.mikemitterer.at)
[m4d_textfield.example.mikemitterer.at](http://m4d_textfield.example.mikemitterer.at)
[m4d_tooltip.example.mikemitterer.at](http://m4d_tooltip.example.mikemitterer.at)
[m4d_typography.example.mikemitterer.at](http://m4d_typography.example.mikemitterer.at)

# 1 - Erstellen der index.html und von pubspec.yaml
/deploy-samples.sh -x m4d_navpills --force && ./deploy-samples.sh -g m4d_navpills --force

# 2 - In demo.scss _app.scss einfügen
# 3 - main.dart updaten

git s
@@ -0,0 +1,24 @@
## Reminder for scripts used for this package

# 1 - Erstellen der index.html und von pubspec.yaml
/deploy-samples.sh -x m4d_navpills --force && ./deploy-samples.sh -g m4d_navpills --force

# 2 - In demo.scss _app.scss einfügen
# 3 - main.dart updaten
### Batch-processing .rsync
# Holt die jeweilige Zeile aus dem .rsync für das Sample
find samples/ -name ".rsync" | xargs awk 'FNR==4' | cut -d ' ' -f 5-
find samples/ -name ".rsync" | xargs awk 'FNR==5' | cut -d ' ' -f 5-
find samples/ -name ".rsync" | xargs awk 'FNR==9' | cut -d ' ' -f 5-
...
### Show all URL for all the .rsyncs
# List URLs
find samples/ -name ".rsync" | xargs awk 'FNR==14' | cut -d ' ' -f 5- | sed -e "s/.*http:\/\/\([^/]*\)\/.*/http:\/\/\1/"
# Gen Links for README
find samples/ -name ".rsync" | xargs awk 'FNR==14' | cut -d ' ' -f 5- | sed -e "s/.*http:\/\/\([^/]*\)\/.*/\[\1\]\(http:\/\/\1\)/"
@@ -65,13 +65,19 @@ fi
usage() {
echo
echo "Usage: ${APPNAME} [ options ]"
echo
echo -e "\t-l | --list [example_name] Lists all examples from '${YELLOW}${EXAMPLE_FOLDER}'${NC}-folder"
echo -e "\t-x | --prepare [example_name] Prepare sample"
echo
echo -e "\t- Init ------------------------------------------------------------------------------"
echo -e "\t-x | --prepare [example_name] Prepare sample (calls 'prep-script')"
echo -e "\t-g | --generate [example_name] [--force] Generates rsync-Config"
echo
echo -e "\t- Day2Day ---------------------------------------------------------------------------"
echo -e "\t-u | --update [example_name] Updates the sample"
echo -e "\t-d | --deploy [example_name] [--release] Creates 'deploy'-dir for Dart"
echo -e "\t-p | --publish [example_name] [--force] Publish samples to AWS/S3 (only on day ${PUBLISH_ONLY_ON_DAY})"
echo -e "\t use --force to ignore Monday as publishing day"
echo -e "\t-g | --generate [example_name] [--force] Generates rsync-Config"
echo -e "\t use --force to ignore"
echo -e "\t Monday as publishing day"
}

CMDLINE=${1:-}
@@ -88,7 +94,7 @@ case "${CMDLINE}" in
;;

-x|prepare|-prepare|--prepare)
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "--force" ]; then
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "" ]; then
prepareSamples "${EXAMPLE_FOLDER}/${OPTION1}"
else
prepareSamples "${EXAMPLES[@]}"
@@ -104,7 +110,7 @@ case "${CMDLINE}" in
;;

-d|deploy|-deploy|--deploy)
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "" ]; then
if [ -n "${OPTION1+set}" -a "${OPTION1}" != "--release" ]; then
deploySamples "${EXAMPLE_FOLDER}/${OPTION1}"
else
deploySamples "${EXAMPLES[@]}"
@@ -1,5 +1,5 @@
name: m4d_components
description: Material Design Lite for Dart
description: Material Design 4 Dart - Basic components
version: 2.2.2
author: Mike Mitterer <office@mikemitterer.at>
homepage: http://www.material-design-lite.pub
@@ -8,71 +8,20 @@ environment:
sdk: ">=2.0.0 <3.0.0"

dependencies:
#intl: ^0.15.0
validate: ^1.0.0

#platform_detect: "^1.3.0"
#browser_detect: ^1.0.0

logging: '>=0.11.3 <1.0.0'
console_log_handler: ^1.0.0

# route_hierarchical: ^0.7.0
# angel_route: ^2.0.0

#m4d_router: ^0.2.0
# path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_router

#reflected_mustache: ^1.0.0
# path: /Volumes/Daten/DevLocal/DevDart/reflected_mustache

#mustache: # ^0.2.0
# path: /Volumes/Daten/DevLocal/DevDart/mustache
# git: git://github.com/xxgreg/mustache

#dnd: ^1.0.0
# path: /Volumes/Daten/DevLocal/DevDart/dart-dnd

#dryice: ^2.0.0
# path: /Volumes/Daten/DevLocal/DevDart/dryice


path: ^1.4.0

#l10n: ^2.0.0
# path: /Volumes/Daten/DevLocal/DevDart/L10N4Dart

m4d_core:
path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_core
m4d_core: '>=0.1.0 <1.0.0'
# path: /Volumes/Daten/DevLocal/DevDart/m4d/m4d_core

#dependency_overrides:
# build_runner: ^0.9.1
# build_config: ^0.3.0
# front_end: ^0.1.2

dev_dependencies:
test: any

build_runner: any
build_test: any
build_web_compilers: any

args: any
# material_icons: any
grinder: any
mdl_grinder:
# git: https://github.com/MikeMitterer/dart-mdl-grinder
path: /Volumes/Daten/DevLocal/DevDart/MaterialGrinder

#transformers:
## - di
# - mdl
#
# - $dart2js:
# commandLineOptions: [--enable-experimental-mirrors]

#web:
# compiler:
# debug: dartdevc


@@ -71,3 +71,17 @@ properties["sample.html.template"]?.apply {
} ?: run {
logger.debug("$SAMPLE_NAME has no default.index.html! ")
}

properties["sample.appstyle"]?.apply {

// default.app.scss
val filename = this.toString()

cpyFile(File(filename),
File(File(SCRIPTPATH,"web"), "_app.scss"), emptyMap<String,String>())

logger.info("_app.scss updated for $SAMPLE_NAME! ")

} ?: run {
logger.debug("$SAMPLE_NAME has it's own _app.scss! ")
}
@@ -0,0 +1,95 @@
html, body {
margin: 0;
padding: 0;
}

h1, h2 {
font-family: 'Roboto','Helvetica','Arial',sans-serif;
font-weight: 400;
}

h2 {
font-size: 24px;
line-height: 1.35;

margin-top: 0.66em;
margin-bottom: 0.66em;
}


.ribbon {
width: 100%;
height: 30vh;
}

.demo-page > .mdl-layout__container > .mdl-layout > * {
flex-shrink: 0;
}

.demo-page > .mdl-layout__container > .mdl-layout > main.mdl-layout__content.mdl-layout__content {
margin-top: -25vh;
}

/*header.mdl-layout__header {*/
/*display: flex !important;*/
/*}*/

.container {
max-width: 1600px;
width: 100%;
margin: 0 auto;
}

.content {
border-radius: 2px;
padding: 24px;
}

.mdl-layout__content .demo-section { min-height: 500px; }

.mdl-mini-footer {
padding-top: 12px;
padding-bottom: 12px;
font-size: 12px;
}

#view-source {
position: fixed;
display: block;
right: 0;
bottom: 37px;
margin-right: 40px;
z-index: 900;
}

.sitegen-link, .mm-link { margin-bottom: 0; }
.is-small-screen .sitegen-link .additional-info { display: none; }
.mm-link { font-size: 12px; }

/*
Solves bug in grid...
*/

@media (max-width: 479px) {
.mdl-grid {
padding: 0;
}
}

@media (max-width: 640px) {
.mm-link {
display: none;
}
}

@media (max-width: 839px) and (min-width: 480px) {
.mdl-grid {
padding: 0;
}
}

@media (max-width: 850px) {
#view-source {
bottom: 29px;
}
}
@@ -5,4 +5,4 @@ pubspec.template=../_templates/pubspec.tmpl.yaml
sample.html.template=../_templates/default.index.html
sample.content=.sitegen/html/_content/index.html


sample.appstyle=../_templates/default.app.scss
@@ -6,7 +6,7 @@
# - sudo mkdir -p ~/website/data/example/m4d_accordion
# - sudo chown ubuntu:ubuntu ~/website/data/example/m4d_accordion
# - sudo chmod 775 ~/website/data/example/m4d_accordion
# - echo 'm4d_accordion' > ~/website/data/example/raspi4_cam/index.html
# - echo 'm4d_accordion' > ~/website/data/example/m4d_accordion/index.html
# - ls -lad ~/website/data/example/m4d_accordion
# - cd ~/website && docker-compose restart
#
@@ -8,15 +8,12 @@ environment:
sdk: ">=2.0.0 <3.0.0"

dependencies:
#intl: ^0.15.0
#args: any
validate: ^1.0.0
#browser_detect: ^1.0.0

logging: '>=0.11.3 <1.0.0'
console_log_handler: ^1.0.0
# git: git@github.com:MikeMitterer/dart-console_log_handler.git
# path: /Volumes/Daten/DevLocal/DevDart/ConsoleLogHandler
# path: /Volumes/Daten/DevLocal/DevDart/ConsoleLogHandler

m4d_components:
# '>=2.1.0 <3.0.0'
@@ -25,9 +22,6 @@ dependencies:
# ref: v2.2
path: ../..

#reflected_mustache:
# path: /Volumes/Daten/DevLocal/DevDart/reflected_mustache

dev_dependencies:
build_runner: any
build_web_compilers: any
@@ -50,6 +50,7 @@ h2 {
.mdl-mini-footer {
padding-top: 12px;
padding-bottom: 12px;
font-size: 12px;
}

#view-source {
@@ -205,8 +205,10 @@ <h5 class="mdl-accordion--header">Header</h5>
</main>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer--left-section">
<p class="sitegen-link">Page was generated with <a href="https://pub.dartlang.org/packages/sitegen" target="_blank">SiteGen.</a>
<span class="additional-info">The static site generator for Dart.</span></p>
<div>Sample for pub-package:
<a href="https://pub.dartlang.org/packages/m4d_components" target="_blank">m4d_components</a>
<span class="published">/ published: <span class="pubdate">2018-10-23 / 18:25:04</span></span>
</div>
</div>
<div class="mdl-mini-footer--right-section">
<p class="mm-link">Brought to you by:
@@ -5,3 +5,5 @@ pubspec.template=../_templates/pubspec.tmpl.yaml
sample.html.template=../_templates/default.index.html
sample.content=.sitegen/html/_content/index.html

sample.appstyle=../_templates/default.app.scss

@@ -6,7 +6,7 @@
# - sudo mkdir -p ~/website/data/example/m4d_animation
# - sudo chown ubuntu:ubuntu ~/website/data/example/m4d_animation
# - sudo chmod 775 ~/website/data/example/m4d_animation
# - echo 'm4d_animation' > ~/website/data/example/raspi4_cam/index.html
# - echo 'm4d_animation' > ~/website/data/example/m4d_animation/index.html
# - ls -lad ~/website/data/example/m4d_animation
# - cd ~/website && docker-compose restart
#
Oops, something went wrong.

0 comments on commit 6fdfbae

Please sign in to comment.