履歴: プログラミング/Riot.js/riot_js-railsの手直し
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 18 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2017/1/27 17:22:19 | プログラミング/Riot.js/riot_js-railsの手直し 最新版 | 25,291 | +1 | -1 | 表示 | 差分 | — |
| 2017/1/27 17:22:19 | プログラミング/Riot.js/riot_js-railsの手直し | 25,297 | +2 | -1 | 表示 | 表示中 | 選択 |
| 2016/10/20 14:32:50 | プログラミング/Riot.js/riot_js-railsの手直し | 25,270 | +2 | -0 | 表示 | 差分 | 選択 |
| 2016/10/20 3:05:00 | プログラミング/Riot.js/riot_js-railsの手直し | 25,217 | +114 | -0 | 表示 | 差分 | 選択 |
| 2016/10/19 7:15:34 | プログラミング/Riot.js/riot_js-railsの手直し | 21,920 | +89 | -14 | 表示 | 差分 | 基準 |
| 2016/10/13 7:49:10 | プログラミング/Riot.js/riot_js-railsの手直し | 19,598 | +47 | -0 | 表示 | 差分 | 選択 |
| 2016/10/13 7:49:10 | プログラミング/Riot.js/riot_js-railsの手直し | 18,578 | +41 | -248 | 表示 | 差分 | 選択 |
| 2016/10/12 14:57:28 | プログラミング/Riot.js/riot_js-railsの手直し | 23,370 | +6 | -0 | 表示 | 差分 | 選択 |
| 2016/10/12 9:36:40 | プログラミング/Riot.js/riot_js-railsの手直し | 23,261 | +299 | -136 | 表示 | 差分 | 選択 |
| 2016/10/11 23:52:46 | プログラミング/Riot.js/riot_js-railsの手直し | 18,982 | +85 | -11 | 表示 | 差分 | 選択 |
| 2016/10/11 15:58:58 | プログラミング/Riot.js/riot_js-railsの手直し | 17,450 | +83 | -19 | 表示 | 差分 | 選択 |
| 2016/10/11 13:50:49 | プログラミング/Riot.js/riot_js-railsの手直し | 15,197 | +193 | -2 | 表示 | 差分 | 選択 |
| 2016/10/4 4:45:38 | プログラミング/Riot.js/riot_js-railsの手直し | 11,053 | +5 | -5 | 表示 | 差分 | 選択 |
| 2016/10/4 4:45:38 | プログラミング/Riot.js/riot_js-railsの手直し | 11,053 | +13 | -2 | 表示 | 差分 | 選択 |
| 2016/10/4 0:29:17 | プログラミング/Riot.js/riot_js-railsの手直し | 10,750 | +66 | -0 | 表示 | 差分 | 選択 |
| 2016/7/4 14:28:19 | プログラミング/Riot.js/riot_js-railsの手直し | 8,851 | +4 | -1 | 表示 | 差分 | 選択 |
| 2016/7/4 14:28:19 | プログラミング/Riot.js/riot_js-railsの手直し | 8,794 | +189 | -2 | 表示 | 差分 | 選択 |
| 2016/7/4 10:47:00 | プログラミング/Riot.js/riot_js-railsの手直し | 3,926 | — | — | 表示 | — | 選択 |
基準: プログラミング/Riot.js/riot_js-railsの手直し (2016/10/19 7:15:34) → 比較: プログラミング/Riot.js/riot_js-railsの手直し (2017/1/27 17:22:19)
@@ -663,6 +663,8 @@
とすれば上記コードを使えます。
+→ 本家に取り込まれました (2017/01/27)
+
* さらに手直し [#afdb6fc3]
** テストを phantomjs で書いてみる [#g282f17e]
@@ -783,8 +785,123 @@
rails 4 では(?) slim-rails を導入していれば何もしなくても slim がつかえるようだったが、
上記コードにより slim-rails を Gemfile に含める必要はなく、slim のみでよくなる。
+* slim + coffeescript + sass + riot の使い勝手 [#yfd84c69]
+** 属性の引用符 [#v88d605f]
+riot で属性を javascript で与える場合、引用符を省略して次のように書けますが、
+
+ LANG: html
+ <li each={ item, i in items }>{ item }</li>
+
+slim で
+
+ LANG: slim
+ li each={ item, i in items }
+ | { item }
+
+と書くと属性値の { } の中を ruby で解釈しようとしてエラーになってしまいます。
+
+属性値は必ず引用符で囲まなければなりません。
+
+ LANG: slim
+ li each="{ item, i in items }"
+ | { item }
+
+** style scoped [#ee4334fe]
+
+もしかして、、、これ実現不可能???
+
+** sass 中で改行のエスケープ [#z39e690a]
+
+https://github.com/sass/sass/commit/3d27be5d0c9cff02e48398d29997f0a99d558ef1
+
+これで良さそうなんだけれど、
+
+ gem 'sass', :git => 'git://github.com/sass/sass.git', :ref => '3d27be5d0c9cff02e48398d29997f0a99d558ef1'
+
+とすると、
+
+ Fetching git://github.com/sass/sass.git
+ fatal: Could not parse object '3d27be5d0c9cff02e48398d29997f0a99d558ef1'.
+ Git error: command `git reset --hard 3d27be5d0c9cff02e48398d29997f0a99d558ef1` in directory
+ /home/osamu/.rvm/gems/ruby-2.3.1@album/bundler/gems/sass-3d27be5d0c9c has failed.
+ If this error persists you could try removing the cache directory
+ '/home/osamu/.rvm/gems/ruby-2.3.1@album/cache/bundler/git/sass-d1bc97264a602a16cbc8b7962b139cf458860561'
+
+といって怒られてしまいます???
+
+** 試してみる [#m3274067]
+
+ bootstrap-carousel
+
+ div[ id="carousel-example-generic" class="carousel slide" data-ride="carousel"
+ data-interval="{ this.interval }" data-pause="{ this.pause }"
+ data-wrap="{ this.wrap }" data-keyboard="{ this.keyboard }" ]
+
+ / Indicators
+ ol class="carousel-indicators"
+ li[ each="{ this.items }" data-target="#carousel-example-generic"
+ data-slide-to="{ index }" class="{ active: index==0 }" ]
+
+ / Wrapper for slides
+ div class="carousel-inner"
+ div each="{ this.items }" class="{ item: true, active: index==0 }"
+ img src="{ src }" alt="{ caption }"
+ div class="carousel-caption"
+ h2
+ | { caption }
+
+ / Controls
+ a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"
+ span class="fa fa-angle-left"
+ a class="right carousel-control" href="#carousel-example-generic" data-slide="next"
+ span class="fa fa-angle-right"
+
+ sass:
+ .carousel-inner > .item
+ text-align: center
+
+ .carousel-inner > .item > img
+ display: inline
+
+ .carousel-inner .carousel-caption h2
+ color: rgba(0,0,0,0.6)
+ font-size: 40px
+ text-shadow: 0px 0px 5px rgba(255, 255, 255, 0.6), 0px 0px 10px rgba(255, 255, 255, 0.6)
+
+ .carousel-indicators li
+ background-color: rgba(0,0,0,0.4)
+ box-shadow: 0 0 5px rgba(0,0,0,0.6)
+ border-color: rgba(255,255,255,0.8)
+ margin-left: 6px
+ margin-right: 6px
+
+ .carousel-indicators li.active
+ border-color: rgba(255,255,255,0.8)
+ background-color: rgba(255,255,255,0.8)
+ margin-left: 6px
+ margin-right: 6px
+
+ img
+ opacity: 0.8
+
+ coffee:
+ @on 'update', ->
+ @interval = opts.interval ? 5000
+ @pause = opts.pause ? "hover"
+ @wrap = opts.wrap ? true
+ @keyboard = opts.keyboard ? true
+
+ @items = for img, i in $(@root._innerHTML) when img.tagName == 'IMG'
+ caption: img.alt
+ src: img.src
+ index: i
+
+こんな感じで、かなり良いのだけれど・・・style タグに scoped を付けられないのが痛すぎる???
+
+そうでもないか。sass の先頭に tag 名を書いて、他を全て & から始めれば同じことになりそう。
+
* 質問・コメント [#x0da6bd0]
#article_kcaptcha