haml_coffee_assets 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +13 -5
- data/lib/haml_coffee_assets/version.rb +1 -1
- data/lib/js/hamlcoffee.js +2 -2
- metadata +3 -3
data/README.md
CHANGED
|
@@ -150,7 +150,7 @@ If you prefer another HTML format than HTML5, you can set it in your `config/app
|
|
|
150
150
|
config.hamlcoffee.format = 'xhtml'
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
### Template
|
|
153
|
+
### Template placement
|
|
154
154
|
|
|
155
155
|
By default all Haml Coffee templates are placed under the configured template namespace. You can choose between the
|
|
156
156
|
following placements:
|
|
@@ -161,6 +161,14 @@ following placements:
|
|
|
161
161
|
By setting the placement option to `amd`, each template will be wrapped within a `define` function, enabling the usage
|
|
162
162
|
of a module loader.
|
|
163
163
|
|
|
164
|
+
```ruby
|
|
165
|
+
config.hamlcoffee.placement = 'amd'
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Please note, the `placement` option is only applicable if you use the `.hamlc` extension and let Haml Coffee Assets
|
|
169
|
+
handle the JST generation. The global `hamlcoffee` helpers must be loaded normally before making use of any
|
|
170
|
+
templates due to the current template design.
|
|
171
|
+
|
|
164
172
|
### Template namespace
|
|
165
173
|
|
|
166
174
|
By default all Haml Coffee templates are registered under the `JST` namespace. A template
|
|
@@ -302,11 +310,11 @@ Now you can use the properties from the global context in every template:
|
|
|
302
310
|
|
|
303
311
|
```haml
|
|
304
312
|
.not-found-error
|
|
305
|
-
%h1
|
|
313
|
+
%h1 Page not found
|
|
306
314
|
- if @isAuthenticated
|
|
307
|
-
%p
|
|
315
|
+
%p Please visit the home page.
|
|
308
316
|
- else
|
|
309
|
-
%p
|
|
317
|
+
%p Please log into your account.
|
|
310
318
|
```
|
|
311
319
|
|
|
312
320
|
If you like to use your own implementation, simply configure your context function in your `config/application.rb`:
|
|
@@ -396,7 +404,7 @@ to, you can set custom functions for:
|
|
|
396
404
|
* config.hamlcoffee.customPrecede
|
|
397
405
|
|
|
398
406
|
You can see the [default implementation](https://github.com/netzpirat/haml_coffee_assets/blob/master/vendor/assets/javascripts/hamlcoffee.js.coffee.erb)
|
|
399
|
-
and the [Haml Coffee documentation](https://github.com/netzpirat/haml-coffee#custom-helper-function-
|
|
407
|
+
and the [Haml Coffee documentation](https://github.com/netzpirat/haml-coffee#custom-helper-function-options)
|
|
400
408
|
for more information about each helper function.
|
|
401
409
|
|
|
402
410
|
## Author
|
data/lib/js/hamlcoffee.js
CHANGED
|
@@ -363,7 +363,7 @@ require.define("/haml-coffee.coffee", function (require, module, exports, __dirn
|
|
|
363
363
|
|
|
364
364
|
module.exports = HamlCoffee = (function() {
|
|
365
365
|
|
|
366
|
-
HamlCoffee.VERSION = '1.6.
|
|
366
|
+
HamlCoffee.VERSION = '1.6.2';
|
|
367
367
|
|
|
368
368
|
function HamlCoffee(options) {
|
|
369
369
|
var _base, _base10, _base2, _base3, _base4, _base5, _base6, _base7, _base8, _base9, _ref, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
|
|
@@ -1278,7 +1278,7 @@ require.define("/nodes/haml.coffee", function (require, module, exports, __dirna
|
|
|
1278
1278
|
key = (_ref2 = keyValue[0]) != null ? _ref2.replace(/^\s+|\s+$/g, '').replace(/^:/, '') : void 0;
|
|
1279
1279
|
if (quoted = key.match(/^("|')(.*)\1$/)) key = quoted[2];
|
|
1280
1280
|
value = (_ref3 = keyValue[1]) != null ? _ref3.replace(/^\s+|[\s,]+$/g, '').replace(/\u0090/g, '') : void 0;
|
|
1281
|
-
if (key === 'data') {
|
|
1281
|
+
if (key === 'data' && !value) {
|
|
1282
1282
|
inDataAttribute = true;
|
|
1283
1283
|
hasDataAttribute = true;
|
|
1284
1284
|
} else if (key && value) {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: haml_coffee_assets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-10-
|
|
12
|
+
date: 2012-10-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: coffee-script
|
|
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
108
108
|
version: '0'
|
|
109
109
|
segments:
|
|
110
110
|
- 0
|
|
111
|
-
hash:
|
|
111
|
+
hash: -2825006732775094402
|
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
none: false
|
|
114
114
|
requirements:
|