lsd_rails 0.1 → 0.1.1
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/lib/lsd/widget_generator.rb +1 -1
- data/lib/templates/Application.js +59 -19
- data/lib/templates/Widget.js +1 -4
- data/lib/templates/app_name.js +1 -4
- data/lib/templates/new_widget.js +1 -4
- metadata +1 -1
data/lib/lsd/widget_generator.rb
CHANGED
@@ -8,7 +8,7 @@ class WidgetGenerator < Rails::Generators::Base
|
|
8
8
|
|
9
9
|
def create_widget_file
|
10
10
|
widgets_path = "public/javascripts/Source/Widget"
|
11
|
-
@widget_name = @widget_name.
|
11
|
+
@widget_name = @widget_name.classify
|
12
12
|
@app_name = LSD.detect_project_name
|
13
13
|
|
14
14
|
empty_directory(widgets_path)
|
@@ -1,30 +1,70 @@
|
|
1
1
|
/*
|
2
2
|
---
|
3
|
-
|
4
|
-
script: Application.js
|
5
|
-
|
6
|
-
description: Main script of application
|
7
|
-
|
8
|
-
license: Public domain (http://unlicense.org).
|
3
|
+
description: The file the requires dependencies. To be required, of course.
|
9
4
|
|
10
|
-
|
5
|
+
license: MIT-style
|
6
|
+
|
7
|
+
authors:
|
11
8
|
|
12
9
|
requires:
|
13
|
-
-
|
14
|
-
-
|
15
|
-
|
10
|
+
- LSD/LSD.Widget
|
11
|
+
- LSD/LSD.Document
|
12
|
+
- Native/LSD.Native.*
|
13
|
+
- Widgets/LSD.Widget.Body
|
14
|
+
- Widgets/LSD.Widget.Anchor
|
16
15
|
- Widgets/LSD.Widget.Form
|
17
16
|
- Widgets/LSD.Widget.Label
|
18
|
-
-
|
19
|
-
- LSD/LSD.
|
20
|
-
- LSD/LSD.
|
21
|
-
- LSD/LSD.Action
|
22
|
-
- LSD/LSD.
|
23
|
-
|
17
|
+
- LSD/LSD.Action.Append
|
18
|
+
- LSD/LSD.Action.Update
|
19
|
+
- LSD/LSD.Action.Check
|
20
|
+
- LSD/LSD.Action.Clone
|
21
|
+
- LSD/LSD.Action.Delete
|
22
|
+
- LSD/LSD.Action.Display
|
23
|
+
- LSD/LSD.Action.Focus
|
24
|
+
- LSD/LSD.Action.Replace
|
25
|
+
- LSD/LSD.Action.Set
|
26
|
+
- LSD/LSD.Action.State
|
27
|
+
- LSD/LSD.Action.Submit
|
28
|
+
|
29
|
+
provides: [Application]
|
30
|
+
|
31
|
+
What is that above?
|
32
|
+
It's a list of Application dependencies. It loads:
|
33
|
+
* LSD.Widget - The smallest entity of a framework, DOM Element's
|
34
|
+
younger (and prettier) brother. A boy that will do
|
35
|
+
things for you.
|
36
|
+
|
37
|
+
* LSD.Document - A thing that wraps the whole document, makes
|
38
|
+
<body> a widget and traverses layout to convert
|
39
|
+
elements into widgets.
|
40
|
+
|
41
|
+
* LSD.Native.* - Includes a HTML4 set of widgets that handle form
|
42
|
+
fields. It's a wise thing to be closer to DOM and use
|
43
|
+
plain input elements.
|
44
|
+
|
45
|
+
* LSD.Widget...- A basic set of essensial widgets, that augment their
|
46
|
+
elements to do something functional and beautiful.
|
47
|
+
|
48
|
+
* LSD.Action...- A set of actions that widget can execute on self,
|
49
|
+
other widgets, or plain DOM elements. There're a little
|
50
|
+
more of them (e.g. Edit), but you may not need them now.
|
51
|
+
|
52
|
+
A prefix before slash in expression means (like Native in Native/LSD.Widget.Input)
|
53
|
+
is a package name (set in package.yml as "name"). So to require a file
|
54
|
+
from a specific package, you have to specify package name as well.
|
55
|
+
|
56
|
+
Some useful things to require:
|
57
|
+
|
58
|
+
Mobile/*
|
59
|
+
Includes all mobile widgets and mobile adjustements if a browser
|
60
|
+
is detected as mobile.
|
24
61
|
|
25
|
-
|
26
|
-
|
27
|
-
|
62
|
+
LSD/LSD.Mixin.Validity
|
63
|
+
Enable HTML5 form validation on all fields.
|
64
|
+
|
65
|
+
LSD/LSD.Action.Edit
|
66
|
+
Adds edit action that turns a microdata-formatted element into an
|
67
|
+
edit in-place form with submit and cancel buttons.
|
28
68
|
...
|
29
69
|
*/
|
30
70
|
|
data/lib/templates/Widget.js
CHANGED
data/lib/templates/app_name.js
CHANGED
data/lib/templates/new_widget.js
CHANGED