rad_common_interface 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/app/static/demo/images/img1.jpg +0 -0
- data/app/static/demo/images/img1_200.jpg +0 -0
- data/app/static/demo/images/img1_icon.jpg +0 -0
- data/app/static/demo/images/img1_thumb.jpg +0 -0
- data/app/static/demo/images/img2.jpg +0 -0
- data/app/static/demo/images/img2_200.jpg +0 -0
- data/app/static/demo/images/img2_icon.jpg +0 -0
- data/app/static/demo/images/img2_thumb.jpg +0 -0
- data/app/static/demo/images/img3.jpg +0 -0
- data/app/static/demo/images/img3_200.jpg +0 -0
- data/app/static/demo/images/img3_icon.jpg +0 -0
- data/app/static/demo/images/img3_thumb.jpg +0 -0
- data/app/static/demo/images/img_big.jpg +0 -0
- data/app/static/demo/images/img_big_icon.jpg +0 -0
- data/app/static/demo/images/img_big_thum.jpg +0 -0
- data/app/static/demo/images/video_icon.png +0 -0
- data/app/static/face/attachments.js +85 -0
- data/app/static/face/dialogs.js +189 -0
- data/app/static/face/discussion.js +47 -0
- data/app/static/face/markup.js +53 -0
- data/app/static/face/more.js +33 -0
- data/app/static/face/table.js +24 -0
- data/app/static/face/tabs.js +26 -0
- data/app/static/face.css +8 -0
- data/app/static/face.js +109 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.ContextMenu.js +36 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Image.js +121 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Mask.js +76 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.Static.js +0 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.css +12 -0
- data/app/static/lib/SimpleDialog/SimpleDialog.js +158 -0
- data/app/static/lib/ajax_file_uploading.js +33 -0
- data/app/static/themes/default/reset.css +127 -0
- data/app/static/themes/default/style/application.less +51 -0
- data/app/static/themes/default/style/aspects.less +15 -0
- data/app/static/themes/default/style/basic.less +49 -0
- data/app/static/themes/default/style/forms.less +34 -0
- data/app/static/themes/default/style/items.less +43 -0
- data/app/static/themes/default/style/markup.less +16 -0
- data/app/static/themes/default/style/micelaneous.less +10 -0
- data/app/static/themes/default/style/mixins.less +72 -0
- data/app/static/themes/default/style/styles.less +57 -0
- data/app/static/themes/default/style/tools.less +15 -0
- data/app/static/themes/default/style/variables.less +38 -0
- data/app/static/themes/default/style.css +944 -0
- data/app/static/themes/default/style.js +127 -0
- data/app/static/themes/default/style.less +22 -0
- data/app/static/vendor/flext.js +254 -0
- data/app/static/vendor/formalize/formalize.css +311 -0
- data/app/static/vendor/formalize/mootools.formalize.js +163 -0
- data/app/static/vendor/formalize/reset.css +171 -0
- data/app/static/vendor/iFrameFormRequest.js +95 -0
- data/app/static/vendor/mootools-more.js +4185 -0
- data/app/static/vendor/purr/purr.css +43 -0
- data/app/static/vendor/purr/purr.js +308 -0
- data/app/views/face/_attachments_tag.html.haml +17 -0
- data/app/views/rad/face/demo/commons/aspects.html.haml +32 -0
- data/app/views/rad/face/demo/commons/basic.html.haml +86 -0
- data/app/views/rad/face/demo/commons/forms.html.haml +57 -0
- data/app/views/rad/face/demo/commons/items.html.haml +32 -0
- data/app/views/rad/face/demo/commons/style.html.erb +111 -0
- data/app/views/rad/face/demo/dialogs/dialog.js.haml +1 -0
- data/app/views/rad/face/demo/dialogs/dialog_form.html.haml +7 -0
- data/app/views/rad/face/demo/dialogs/dialog_form.js.erb +1 -0
- data/app/views/rad/face/demo/dialogs/inplace/_element.html.haml +3 -0
- data/app/views/rad/face/demo/dialogs/inplace/_form.html.haml +3 -0
- data/app/views/rad/face/demo/dialogs/inplace.js.haml +1 -0
- data/app/views/rad/face/demo/dialogs/inplace_form.js.haml +2 -0
- data/app/views/rad/face/demo/dialogs/show.html.haml +27 -0
- data/app/views/rad/face/demo/helps/help.html.haml +1 -0
- data/app/views/rad/face/demo/helps/index.html.haml +25 -0
- data/app/views/rad/face/demo/layout.html.haml +3 -0
- data/app/views/rad/face/demo/layout.js.haml +11 -0
- data/app/views/rad/face/demo/shared/_comments.html.haml +11 -0
- data/app/views/rad/face/demo/shared/_core_tools.html.haml +6 -0
- data/app/views/rad/face/demo/shared/_line_previews.html.haml +40 -0
- data/app/views/rad/face/demo/shared/_paginator.html.haml +7 -0
- data/app/views/rad/face/demo/shared/_tools.html.haml +25 -0
- data/app/views/rad/face/demo/shared/_top_navigation_bottom.html.haml +34 -0
- data/app/views/rad/face/demo/sites/blog.html.haml +12 -0
- data/app/views/rad/face/demo/sites/home.html.haml +8 -0
- data/app/views/rad/face/demo/sites/post.html.haml +10 -0
- data/app/views/rad/face/demo/sites/style.html.haml +8 -0
- data/app/views/themes/default/application.html.haml +25 -0
- data/app/views/themes/default/basic_list.html.haml +2 -0
- data/app/views/themes/default/basic_list_item.html.haml +5 -0
- data/app/views/themes/default/bottom_panel.html.haml +16 -0
- data/app/views/themes/default/comment.html.haml +20 -0
- data/app/views/themes/default/controls.html.haml +3 -0
- data/app/views/themes/default/demo_metadata.rb +118 -0
- data/app/views/themes/default/details.html.haml +6 -0
- data/app/views/themes/default/discussion.html.haml +7 -0
- data/app/views/themes/default/divider.html.haml +2 -0
- data/app/views/themes/default/forms/errors.html.haml +4 -0
- data/app/views/themes/default/forms/field.html.haml +18 -0
- data/app/views/themes/default/forms/form.html.haml +4 -0
- data/app/views/themes/default/forms/line.html.haml +8 -0
- data/app/views/themes/default/help.html.haml +3 -0
- data/app/views/themes/default/html.html.haml +1 -0
- data/app/views/themes/default/index.html.haml +6 -0
- data/app/views/themes/default/item.html.haml +12 -0
- data/app/views/themes/default/layout_templates/dashboard.html.haml +1 -0
- data/app/views/themes/default/layout_templates/default.html.haml +22 -0
- data/app/views/themes/default/line.html.haml +21 -0
- data/app/views/themes/default/message.html.haml +2 -0
- data/app/views/themes/default/more.html.haml +8 -0
- data/app/views/themes/default/narrow.html.haml +2 -0
- data/app/views/themes/default/navigation.html.haml +16 -0
- data/app/views/themes/default/paginator.html.haml +8 -0
- data/app/views/themes/default/shared/details.html.haml +17 -0
- data/app/views/themes/default/table.html.haml +9 -0
- data/app/views/themes/default/table_row.html.haml +4 -0
- data/app/views/themes/default/tabs.html.haml +27 -0
- data/app/views/themes/default/tag_selector.html.haml +10 -0
- data/app/views/themes/default/text.html.haml +4 -0
- data/app/views/themes/default/thumb.html.haml +10 -0
- data/app/views/themes/default/title.html.haml +3 -0
- data/app/views/themes/default/tool.html.haml +5 -0
- data/app/views/themes/default/toolbar.html.haml +16 -0
- data/app/views/themes/default/top_panel.html.haml +18 -0
- metadata +153 -25
@@ -0,0 +1,163 @@
|
|
1
|
+
//
|
2
|
+
// Note: This file depends on the MooTools library.
|
3
|
+
//
|
4
|
+
|
5
|
+
// Module pattern:
|
6
|
+
// http://yuiblog.com/blog/2007/06/12/module-pattern/
|
7
|
+
var FORMALIZE = (function(window, document, undefined) {
|
8
|
+
// Private constants.
|
9
|
+
var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
|
10
|
+
var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
|
11
|
+
var WEBKIT = 'webkitAppearance' in document.createElement('select').style;
|
12
|
+
var IE6 = Browser.ie6;
|
13
|
+
var IE7 = Browser.ie7;
|
14
|
+
|
15
|
+
// Expose innards of FORMALIZE.
|
16
|
+
return {
|
17
|
+
// FORMALIZE.go
|
18
|
+
go: function() {
|
19
|
+
for (var i in FORMALIZE.init) {
|
20
|
+
FORMALIZE.init[i]();
|
21
|
+
}
|
22
|
+
},
|
23
|
+
// FORMALIZE.init
|
24
|
+
init: {
|
25
|
+
// FORMALIZE.init.detect_webkit
|
26
|
+
detect_webkit: function() {
|
27
|
+
if (!WEBKIT) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
|
31
|
+
// Tweaks for Safari + Chrome.
|
32
|
+
$$('html')[0].addClass('is_webkit');
|
33
|
+
},
|
34
|
+
// FORMALIZE.init.full_input_size
|
35
|
+
full_input_size: function() {
|
36
|
+
if (!IE7 || !$$('textarea, input.input_full').length) {
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
|
40
|
+
// This fixes width: 100% on <textarea> and class="input_full".
|
41
|
+
// It ensures that form elements don't go wider than container.
|
42
|
+
$$('textarea, input.input_full').each(function(el) {
|
43
|
+
new Element('span.input_full_wrap').wraps(el);
|
44
|
+
});
|
45
|
+
|
46
|
+
},
|
47
|
+
// FORMALIZE.init.ie6_skin_inputs
|
48
|
+
ie6_skin_inputs: function() {
|
49
|
+
// Test for Internet Explorer 6.
|
50
|
+
if (!IE6 || !$$('input, select, textarea').length) {
|
51
|
+
// Exit if the browser is not IE6,
|
52
|
+
// or if no form elements exist.
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
|
56
|
+
// For <input type="submit" />, etc.
|
57
|
+
var button_regex = /button|submit|reset/;
|
58
|
+
|
59
|
+
// For <input type="text" />, etc.
|
60
|
+
var type_regex = /date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;
|
61
|
+
|
62
|
+
$$('input').each(function(el) {
|
63
|
+
// Is it a button?
|
64
|
+
if (el.getAttribute('type').match(button_regex)) {
|
65
|
+
el.addClass('ie6_button');
|
66
|
+
|
67
|
+
/* Is it disabled? */
|
68
|
+
if (el.disabled) {
|
69
|
+
el.addClass('ie6_button_disabled');
|
70
|
+
}
|
71
|
+
}
|
72
|
+
// Or is it a textual input?
|
73
|
+
else if (el.getAttribute('type').match(type_regex)) {
|
74
|
+
el.addClass('ie6_input');
|
75
|
+
|
76
|
+
/* Is it disabled? */
|
77
|
+
if (el.disabled) {
|
78
|
+
el.addClass('ie6_input_disabled');
|
79
|
+
}
|
80
|
+
}
|
81
|
+
});
|
82
|
+
|
83
|
+
$$('textarea, select').each(function(el) {
|
84
|
+
/* Is it disabled? */
|
85
|
+
if (el.disabled) {
|
86
|
+
el.addClass('ie6_input_disabled');
|
87
|
+
}
|
88
|
+
});
|
89
|
+
},
|
90
|
+
// FORMALIZE.init.autofocus
|
91
|
+
autofocus: function() {
|
92
|
+
if (AUTOFOCUS_SUPPORTED || !$$('[autofocus]').length) {
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
|
96
|
+
$$('[autofocus]')[0].focus();
|
97
|
+
},
|
98
|
+
// FORMALIZE.init.placeholder
|
99
|
+
placeholder: function() {
|
100
|
+
if (PLACEHOLDER_SUPPORTED || !$$('[placeholder]').length) {
|
101
|
+
// Exit if placeholder is supported natively,
|
102
|
+
// or if page does not have any placeholder.
|
103
|
+
return;
|
104
|
+
}
|
105
|
+
|
106
|
+
FORMALIZE.misc.add_placeholder();
|
107
|
+
|
108
|
+
$$('[placeholder]').each(function(el) {
|
109
|
+
var text = el.get('placeholder');
|
110
|
+
|
111
|
+
el.addEvents({
|
112
|
+
focus: function() {
|
113
|
+
if (el.value === text) {
|
114
|
+
el.set('value', '').removeClass('placeholder_text');
|
115
|
+
}
|
116
|
+
},
|
117
|
+
blur: function() {
|
118
|
+
FORMALIZE.misc.add_placeholder();
|
119
|
+
}
|
120
|
+
});
|
121
|
+
|
122
|
+
// Prevent <form> from accidentally
|
123
|
+
// submitting the placeholder text.
|
124
|
+
el.getParent('form').addEvents({
|
125
|
+
'submit': function() {
|
126
|
+
if (el.value === text) {
|
127
|
+
el.set('value', '').removeClass('placeholder_text');
|
128
|
+
}
|
129
|
+
},
|
130
|
+
'reset': function() {
|
131
|
+
setTimeout(FORMALIZE.misc.add_placeholder, 50);
|
132
|
+
}
|
133
|
+
});
|
134
|
+
});
|
135
|
+
}
|
136
|
+
},
|
137
|
+
// FORMALIZE.misc
|
138
|
+
misc: {
|
139
|
+
// FORMALIZE.misc.add_placeholder
|
140
|
+
add_placeholder: function() {
|
141
|
+
if (PLACEHOLDER_SUPPORTED || !$$('[placeholder]').length) {
|
142
|
+
// Exit if placeholder is supported natively,
|
143
|
+
// or if page does not have any placeholder.
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
|
147
|
+
$$('[placeholder]').each(function(el) {
|
148
|
+
var text = el.get('placeholder');
|
149
|
+
|
150
|
+
if (!el.value || el.value === text) {
|
151
|
+
el.set('value', text).addClass('placeholder_text');
|
152
|
+
}
|
153
|
+
});
|
154
|
+
}
|
155
|
+
}
|
156
|
+
};
|
157
|
+
// Alias window, document.
|
158
|
+
})(this, this.document);
|
159
|
+
|
160
|
+
// Automatically calls all functions in FORMALIZE.init
|
161
|
+
$(document).addEvent('domready', function() {
|
162
|
+
FORMALIZE.go();
|
163
|
+
});
|
@@ -0,0 +1,171 @@
|
|
1
|
+
/* `XHTML, HTML4, HTML5 Reset
|
2
|
+
----------------------------------------------------------------------------------------------------*/
|
3
|
+
|
4
|
+
a,
|
5
|
+
abbr,
|
6
|
+
acronym,
|
7
|
+
address,
|
8
|
+
applet,
|
9
|
+
article,
|
10
|
+
aside,
|
11
|
+
audio,
|
12
|
+
b,
|
13
|
+
big,
|
14
|
+
blockquote,
|
15
|
+
body,
|
16
|
+
canvas,
|
17
|
+
caption,
|
18
|
+
center,
|
19
|
+
cite,
|
20
|
+
code,
|
21
|
+
dd,
|
22
|
+
del,
|
23
|
+
details,
|
24
|
+
dfn,
|
25
|
+
dialog,
|
26
|
+
div,
|
27
|
+
dl,
|
28
|
+
dt,
|
29
|
+
em,
|
30
|
+
embed,
|
31
|
+
fieldset,
|
32
|
+
figcaption,
|
33
|
+
figure,
|
34
|
+
font,
|
35
|
+
footer,
|
36
|
+
form,
|
37
|
+
h1,
|
38
|
+
h2,
|
39
|
+
h3,
|
40
|
+
h4,
|
41
|
+
h5,
|
42
|
+
h6,
|
43
|
+
header,
|
44
|
+
hgroup,
|
45
|
+
hr,
|
46
|
+
html,
|
47
|
+
i,
|
48
|
+
iframe,
|
49
|
+
img,
|
50
|
+
ins,
|
51
|
+
kbd,
|
52
|
+
label,
|
53
|
+
legend,
|
54
|
+
li,
|
55
|
+
mark,
|
56
|
+
menu,
|
57
|
+
meter,
|
58
|
+
nav,
|
59
|
+
object,
|
60
|
+
ol,
|
61
|
+
output,
|
62
|
+
p,
|
63
|
+
pre,
|
64
|
+
progress,
|
65
|
+
q,
|
66
|
+
rp,
|
67
|
+
rt,
|
68
|
+
ruby,
|
69
|
+
s,
|
70
|
+
samp,
|
71
|
+
section,
|
72
|
+
small,
|
73
|
+
span,
|
74
|
+
strike,
|
75
|
+
strong,
|
76
|
+
sub,
|
77
|
+
summary,
|
78
|
+
sup,
|
79
|
+
table,
|
80
|
+
tbody,
|
81
|
+
td,
|
82
|
+
tfoot,
|
83
|
+
th,
|
84
|
+
thead,
|
85
|
+
time,
|
86
|
+
tr,
|
87
|
+
tt,
|
88
|
+
u,
|
89
|
+
ul,
|
90
|
+
var,
|
91
|
+
video,
|
92
|
+
xmp {
|
93
|
+
border: 0;
|
94
|
+
margin: 0;
|
95
|
+
padding: 0;
|
96
|
+
font-size: 100%;
|
97
|
+
}
|
98
|
+
|
99
|
+
html,
|
100
|
+
body {
|
101
|
+
height: 100%;
|
102
|
+
}
|
103
|
+
|
104
|
+
article,
|
105
|
+
aside,
|
106
|
+
details,
|
107
|
+
figcaption,
|
108
|
+
figure,
|
109
|
+
footer,
|
110
|
+
header,
|
111
|
+
hgroup,
|
112
|
+
menu,
|
113
|
+
nav,
|
114
|
+
section {
|
115
|
+
/*
|
116
|
+
Override the default (display: inline) for
|
117
|
+
browsers that do not recognize HTML5 tags.
|
118
|
+
|
119
|
+
IE8 (and lower) requires a shiv:
|
120
|
+
http://ejohn.org/blog/html5-shiv
|
121
|
+
*/
|
122
|
+
display: block;
|
123
|
+
}
|
124
|
+
|
125
|
+
b,
|
126
|
+
strong {
|
127
|
+
/*
|
128
|
+
Makes browsers agree.
|
129
|
+
IE + Opera = font-weight: bold.
|
130
|
+
Gecko + WebKit = font-weight: bolder.
|
131
|
+
*/
|
132
|
+
font-weight: bold;
|
133
|
+
}
|
134
|
+
|
135
|
+
img {
|
136
|
+
color: transparent;
|
137
|
+
font-size: 0;
|
138
|
+
vertical-align: middle;
|
139
|
+
/*
|
140
|
+
For IE.
|
141
|
+
http://css-tricks.com/ie-fix-bicubic-scaling-for-images
|
142
|
+
*/
|
143
|
+
-ms-interpolation-mode: bicubic;
|
144
|
+
}
|
145
|
+
|
146
|
+
li {
|
147
|
+
/*
|
148
|
+
For IE6 + IE7.
|
149
|
+
*/
|
150
|
+
display: list-item;
|
151
|
+
}
|
152
|
+
|
153
|
+
table {
|
154
|
+
border-collapse: collapse;
|
155
|
+
border-spacing: 0;
|
156
|
+
}
|
157
|
+
|
158
|
+
th,
|
159
|
+
td,
|
160
|
+
caption {
|
161
|
+
font-weight: normal;
|
162
|
+
vertical-align: top;
|
163
|
+
text-align: left;
|
164
|
+
}
|
165
|
+
|
166
|
+
svg {
|
167
|
+
/*
|
168
|
+
For IE9.
|
169
|
+
*/
|
170
|
+
overflow: hidden;
|
171
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
/*
|
2
|
+
---
|
3
|
+
description: This class gives you a method to upload files 'the ajax way'
|
4
|
+
|
5
|
+
license: MIT-style
|
6
|
+
|
7
|
+
authors:
|
8
|
+
- Arian Stolwijk
|
9
|
+
|
10
|
+
requires: [Class, Options, Events, Element, Element.Event, Element.Style]
|
11
|
+
|
12
|
+
provides: [Element.iFrameFormRequest, iFrameFormRequest]
|
13
|
+
|
14
|
+
...
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @author Arian Stolwijk
|
19
|
+
* Idea taken from http://www.webtoolkit.info/ajax-file-upload.html
|
20
|
+
*/
|
21
|
+
|
22
|
+
var iFrameFormRequest = new Class({
|
23
|
+
|
24
|
+
Implements: [Options, Events],
|
25
|
+
|
26
|
+
options: { /*
|
27
|
+
onRequest: function(){},
|
28
|
+
onComplete: function(data){},
|
29
|
+
onFailure: function(){}, */
|
30
|
+
eventName: 'submit'
|
31
|
+
},
|
32
|
+
|
33
|
+
initialize: function(form, options){
|
34
|
+
this.setOptions(options);
|
35
|
+
var frameId = this.frameId = String.uniqueID();
|
36
|
+
var loading = false;
|
37
|
+
|
38
|
+
this.form = document.id(form);
|
39
|
+
|
40
|
+
this.formEvent = function(){
|
41
|
+
loading = true;
|
42
|
+
this.fireEvent('request');
|
43
|
+
}.bind(this);
|
44
|
+
|
45
|
+
this.iframe = new IFrame({
|
46
|
+
name: frameId,
|
47
|
+
styles: {
|
48
|
+
display: 'none'
|
49
|
+
},
|
50
|
+
src: 'about:blank',
|
51
|
+
events: {
|
52
|
+
load: function(contentWindow){
|
53
|
+
// if (loading){
|
54
|
+
var doc = this.iframe.contentWindow.document;
|
55
|
+
if (doc && doc.location.href != 'about:blank'){
|
56
|
+
// this.fireEvent('complete', doc.body.innerHTML);
|
57
|
+
var response = doc.body.getElementsByTagName('textarea')[0].value;
|
58
|
+
this.fireEvent('complete', response);
|
59
|
+
} else {
|
60
|
+
this.fireEvent('failure');
|
61
|
+
}
|
62
|
+
// loading = false;
|
63
|
+
// }
|
64
|
+
}.bind(this)
|
65
|
+
}
|
66
|
+
}).inject(document.body);
|
67
|
+
|
68
|
+
this.attach();
|
69
|
+
},
|
70
|
+
|
71
|
+
send: function(){
|
72
|
+
this.form.submit();
|
73
|
+
},
|
74
|
+
|
75
|
+
attach: function(){
|
76
|
+
this.target = this.form.get('target');
|
77
|
+
this.form.set('target', this.frameId)
|
78
|
+
.addEvent(this.options.eventName, this.formEvent);
|
79
|
+
},
|
80
|
+
|
81
|
+
detach: function(){
|
82
|
+
this.form.set('target', this.target)
|
83
|
+
.removeEvent(this.options.eventName, this.formEvent);
|
84
|
+
},
|
85
|
+
|
86
|
+
toElement: function(){
|
87
|
+
return this.iframe;
|
88
|
+
}
|
89
|
+
|
90
|
+
});
|
91
|
+
|
92
|
+
Element.implement('iFrameFormRequest', function(options){
|
93
|
+
this.store('iFrameFormRequest', new iFrameFormRequest(this, options));
|
94
|
+
return this;
|
95
|
+
});
|