spiderfw 0.5.7 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +17 -6
- data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +18 -5
- data/apps/cas_server/lib/cas.rb +1 -1
- data/apps/cms/models/content.rb +16 -0
- data/apps/cms/models/news_item.rb +7 -0
- data/apps/cms/models/translation.rb +14 -0
- data/apps/cms/views/admin/admin.shtml +16 -0
- data/apps/cms/views/admin/content.shtml +4 -0
- data/apps/core/acl/_init.rb +10 -0
- data/apps/core/acl/controllers/acl_controller.rb +14 -0
- data/apps/core/acl/models/permission.rb +11 -0
- data/apps/core/acl/views/acl.layout.shtml +8 -0
- data/apps/core/acl/views/index.shtml +3 -0
- data/apps/core/auth/controllers/mixins/auth_helper.rb +3 -3
- data/apps/core/auth/lib/authenticable.rb +4 -0
- data/apps/core/auth/models/super_user.rb +1 -0
- data/apps/core/auth/po/it/spider_auth.po +18 -10
- data/apps/core/auth/po/spider_auth.pot +13 -1
- data/apps/core/components/_init.rb +2 -1
- data/apps/core/components/po/it/spider_components.po +3 -3
- data/apps/core/components/po/spider_components.pot +3 -3
- data/apps/core/components/public/css/month_calendar.css +24 -0
- data/apps/core/components/public/js/jquery/jquery-1.4.2-min.js +154 -0
- data/apps/core/components/public/js/jquery/jquery-1.4.2.js +6240 -0
- data/apps/core/components/public/js/jquery/plugins/jquery.form.js +1 -1
- data/apps/core/components/public/js/spider.js +26 -20
- data/apps/core/components/widgets/admin/admin.rb +1 -1
- data/apps/core/components/widgets/crud/crud.rb +1 -1
- data/apps/core/components/widgets/list/list.rb +2 -2
- data/apps/core/components/widgets/month_calendar/month_calendar.rb +67 -0
- data/apps/core/components/widgets/month_calendar/month_calendar.shtml +21 -0
- data/apps/core/components/widgets/table/table.rb +4 -2
- data/apps/core/components/widgets/table/table.shtml +37 -31
- data/apps/core/forms/_init.rb +2 -1
- data/apps/core/forms/po/it/spider_forms.po +14 -2
- data/apps/core/forms/po/spider_forms.pot +13 -1
- data/apps/core/forms/public/css/file_input.css +15 -0
- data/apps/core/forms/public/{form.css → css/form.css} +8 -0
- data/apps/core/forms/public/file_input.js +37 -0
- data/apps/core/forms/tags/element_label.erb +4 -1
- data/apps/core/forms/tags/element_row.erb +7 -2
- data/apps/core/forms/tags/row.erb +10 -1
- data/apps/core/forms/widgets/form/form.rb +43 -10
- data/apps/core/forms/widgets/form/form.shtml +12 -5
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -0
- data/apps/core/forms/widgets/inputs/file_input/file_input.rb +43 -0
- data/apps/core/forms/widgets/inputs/file_input/file_input.shtml +12 -0
- data/apps/core/forms/widgets/inputs/input/input.rb +23 -1
- data/apps/core/forms/widgets/inputs/password/password.rb +1 -0
- data/apps/core/forms/widgets/inputs/text/text.shtml +1 -1
- data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +2 -2
- data/apps/git_model_versioning/models/mixins/git_versioned.rb +91 -0
- data/apps/hippo/models/mixins/hippo_struct.rb +42 -26
- data/apps/master/controllers/git.rb +32 -0
- data/apps/messenger/_init.rb +1 -1
- data/apps/messenger/config/options.rb +2 -0
- data/apps/messenger/config/worker/queue.rb +3 -0
- data/apps/messenger/controllers/mixins/{messenger_controller_mixin.rb → messenger_helper.rb} +8 -6
- data/apps/messenger/messenger.rb +10 -3
- data/apps/messenger/models/message.rb +2 -2
- data/apps/messenger/po/it/spider_messenger.po +1 -1
- data/apps/messenger/po/spider_messenger.pot +1 -1
- data/apps/saml/_init.rb +13 -0
- data/apps/saml/controllers/saml2idp.rb +18 -0
- data/apps/saml/lib/bindings/http_redirect_binding.rb +14 -0
- data/apps/saml/lib/messages/authn_request.rb +52 -0
- data/apps/saml/lib/saml.rb +10 -0
- data/apps/soap/controllers/soap_controller.rb +12 -2
- data/apps/soap/lib/soap.rb +16 -1
- data/apps/soap/soap.gemspec +10 -0
- data/apps/webdav/lib/locking.rb +2 -2
- data/apps/worker/_init.rb +2 -0
- data/apps/worker/config/options.rb +1 -0
- data/apps/worker/worker.rb +17 -4
- data/blueprints/app/__APP__.appspec +4 -0
- data/blueprints/app/_init.rb +5 -8
- data/blueprints/app/controllers/__APP___controller.rb +2 -1
- data/blueprints/app/views/__APP__.layout.shtml +4 -1
- data/blueprints/install/config/config.yml +2 -4
- data/blueprints/model.rb +15 -0
- data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
- data/data/locale/it/LC_MESSAGES/spider_messenger.mo +0 -0
- data/lib/spiderfw/app.rb +93 -31
- data/lib/spiderfw/autoload.rb +1 -0
- data/lib/spiderfw/cmd/cmd.rb +8 -1
- data/lib/spiderfw/cmd/commands/config.rb +54 -0
- data/lib/spiderfw/config/configuration.rb +30 -0
- data/lib/spiderfw/config/options/spider.rb +18 -6
- data/lib/spiderfw/controller/controller.rb +12 -11
- data/lib/spiderfw/controller/dispatcher.rb +5 -4
- data/lib/spiderfw/controller/http_controller.rb +16 -2
- data/lib/spiderfw/controller/mixins/http_mixin.rb +3 -2
- data/lib/spiderfw/controller/mixins/static_content.rb +8 -2
- data/lib/spiderfw/controller/mixins/visual.rb +72 -52
- data/lib/spiderfw/controller/request.rb +7 -3
- data/lib/spiderfw/controller/scene.rb +6 -0
- data/lib/spiderfw/controller/session.rb +12 -8
- data/lib/spiderfw/env.rb +1 -1
- data/lib/spiderfw/http/adapters/mongrel.rb +1 -1
- data/lib/spiderfw/http/http.rb +48 -19
- data/lib/spiderfw/i18n/cldr.rb +53 -3
- data/lib/spiderfw/i18n/i18n.rb +52 -2
- data/lib/spiderfw/i18n/provider.rb +24 -0
- data/lib/spiderfw/i18n/rails.rb +24 -0
- data/lib/spiderfw/model/active_record.rb +3 -3
- data/lib/spiderfw/model/base_model.rb +45 -14
- data/lib/spiderfw/model/condition.rb +11 -2
- data/lib/spiderfw/model/data_type.rb +15 -7
- data/lib/spiderfw/model/datatypes/decimal.rb +15 -3
- data/lib/spiderfw/model/datatypes/file_path.rb +50 -0
- data/lib/spiderfw/model/datatypes/serialized_object.rb +0 -4
- data/lib/spiderfw/model/datatypes/uuid.rb +3 -3
- data/lib/spiderfw/model/datatypes.rb +1 -0
- data/lib/spiderfw/model/extended_models/managed.rb +11 -2
- data/lib/spiderfw/model/mappers/db_mapper.rb +116 -52
- data/lib/spiderfw/model/mappers/mapper.rb +36 -14
- data/lib/spiderfw/model/mixins/state_machine.rb +45 -9
- data/lib/spiderfw/model/mixins/versioned.rb +1 -1
- data/lib/spiderfw/model/model.rb +2 -1
- data/lib/spiderfw/model/query_set.rb +21 -3
- data/lib/spiderfw/model/request.rb +7 -0
- data/lib/spiderfw/model/storage/db/adapters/mssql.rb +2 -1
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +4 -1
- data/lib/spiderfw/model/storage/db/adapters/oci8.rb +35 -18
- data/lib/spiderfw/model/storage/db/adapters/sqlite.rb +68 -34
- data/lib/spiderfw/model/storage/db/connectors/odbc.rb +1 -1
- data/lib/spiderfw/model/storage/db/db_schema.rb +33 -4
- data/lib/spiderfw/model/storage/db/db_storage.rb +27 -8
- data/lib/spiderfw/requires.rb +2 -0
- data/lib/spiderfw/tag/tag.rb +1 -1
- data/lib/spiderfw/templates/blocks/attr_if.rb +7 -1
- data/lib/spiderfw/templates/blocks/each.rb +8 -3
- data/lib/spiderfw/templates/blocks/html.rb +12 -22
- data/lib/spiderfw/templates/blocks/render.rb +3 -3
- data/lib/spiderfw/templates/blocks/run.rb +47 -11
- data/lib/spiderfw/templates/blocks/tag_if.rb +2 -2
- data/lib/spiderfw/templates/blocks/text.rb +2 -1
- data/lib/spiderfw/templates/blocks/widget.rb +5 -3
- data/lib/spiderfw/templates/blocks/yield.rb +1 -1
- data/lib/spiderfw/templates/template.rb +27 -24
- data/lib/spiderfw/templates/template_blocks.rb +37 -14
- data/lib/spiderfw/utils/monkey/exception.rb +1 -1
- data/lib/spiderfw/utils/monkey/nil_class.rb +7 -0
- data/lib/spiderfw/utils/monkey/numeric.rb +15 -0
- data/lib/spiderfw/version.rb +1 -1
- data/lib/spiderfw/widget/widget.rb +36 -33
- data/lib/spiderfw/widget/widget_attributes.rb +1 -1
- data/lib/spiderfw.rb +18 -5
- data/spider.gemspec +5 -5
- metadata +44 -18
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +0 -187
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +0 -1
- data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +0 -193
- data/apps/core/forms/widgets/inputs/subform/subform.rb +0 -10
- data/apps/core/forms/widgets/inputs/subform/subform.shtml +0 -5
- data/apps/messenger/config/worker.rb +0 -3
- data/lib/spiderfw/controller/app_controller.rb +0 -14
- data/lib/spiderfw/utils/test_case.rb +0 -24
@@ -1,187 +0,0 @@
|
|
1
|
-
// JavaScript Document
|
2
|
-
(function($) {
|
3
|
-
|
4
|
-
$.fn.jTree = function(options) {
|
5
|
-
var opts = $.extend({}, $.fn.jTree.defaults, options);
|
6
|
-
var cur = 0, curOff = 0, off =0, h =0, w=0, hover = 0;
|
7
|
-
var str='<li class="jTreePlacement" style="background:'+opts.pBg+';border:'+opts.pBorder+';color:'+opts.pColor+';height:'+opts.pHeight+'"></li>';
|
8
|
-
var container = this;
|
9
|
-
//events are written here
|
10
|
-
$(this).find("li").mousedown(function(e){
|
11
|
-
if ($("#jTreeHelper").is(":not(:animated)") && e.button !=2) {
|
12
|
-
// append jTreePlacement to body and hides
|
13
|
-
$("body").append(str);
|
14
|
-
$(".jTreePlacement").hide();
|
15
|
-
//get the current li and append to helper
|
16
|
-
$(this).clone().appendTo("#jTreeHelper");
|
17
|
-
|
18
|
-
// get initial state, cur and offset
|
19
|
-
cur = this;
|
20
|
-
curOff = $(cur).offset();
|
21
|
-
$(cur).hide();
|
22
|
-
// show initial helper
|
23
|
-
$("#jTreeHelper").css ({
|
24
|
-
position: "absolute",
|
25
|
-
top: e.pageY + 5,
|
26
|
-
left: e.pageX + 5,
|
27
|
-
background: opts.hBg,
|
28
|
-
opacity: opts.hOpacity
|
29
|
-
}).show();
|
30
|
-
$("#jTreeHelper *").css ({
|
31
|
-
color: opts.hColor,
|
32
|
-
background: opts.hBg,
|
33
|
-
});
|
34
|
-
// start binding events to use
|
35
|
-
// prevent text selection
|
36
|
-
$(document).bind("selectstart", doNothing);
|
37
|
-
|
38
|
-
// doubleclick is destructive, better disable
|
39
|
-
$(container).find("li").bind("dblclick", doNothing);
|
40
|
-
|
41
|
-
// in single li calculate the offset, width height of hovered block
|
42
|
-
$(container).find("li").bind("mouseover", getInitial);
|
43
|
-
|
44
|
-
// in single li put placement in correct places, also move the helper around
|
45
|
-
$(container).find("li").bind("mousemove", putPlacement);
|
46
|
-
|
47
|
-
// handle mouse movement outside our container
|
48
|
-
$(document).bind("mousemove", helperPosition);
|
49
|
-
}
|
50
|
-
//prevent bubbling of mousedown
|
51
|
-
return false;
|
52
|
-
});
|
53
|
-
|
54
|
-
// in single li or in container, snap into placement if present then destroy placement
|
55
|
-
// and helper then show snapped in object/li
|
56
|
-
// also destroys events
|
57
|
-
$(this).find("li").andSelf().mouseup(function(e){
|
58
|
-
// if placementBox is detected
|
59
|
-
if ($(".jTreePlacement").is(":visible")) {
|
60
|
-
$(cur).insertBefore(".jTreePlacement").show();
|
61
|
-
}
|
62
|
-
$(cur).show();
|
63
|
-
// remove helper and placement box
|
64
|
-
$(container).find("ul:empty").remove();
|
65
|
-
$("#jTreeHelper").empty().hide();
|
66
|
-
$(".jTreePlacement").remove();
|
67
|
-
|
68
|
-
// remove bindings
|
69
|
-
destroyBindings();
|
70
|
-
|
71
|
-
return false;
|
72
|
-
});
|
73
|
-
|
74
|
-
$(document).mouseup(function(e){
|
75
|
-
if (cur!=0) {
|
76
|
-
$("#jTreeHelper").animate({
|
77
|
-
top: curOff.top,
|
78
|
-
left: curOff.left
|
79
|
-
}, opts.snapBack, function(){
|
80
|
-
$("#jTreeHelper").empty().hide();
|
81
|
-
$(".jTreePlacement").remove();
|
82
|
-
$(cur).show();
|
83
|
-
}
|
84
|
-
);
|
85
|
-
destroyBindings();
|
86
|
-
}
|
87
|
-
cur = 0;
|
88
|
-
return false;
|
89
|
-
});
|
90
|
-
//functions are written here
|
91
|
-
var doNothing = function(){
|
92
|
-
return false;
|
93
|
-
};
|
94
|
-
|
95
|
-
var destroyBindings = function(){
|
96
|
-
$(document).unbind("selectstart", doNothing);
|
97
|
-
$(container).find("li").unbind("dblclick", doNothing);
|
98
|
-
$(container).find("li").unbind("mouseover", getInitial);
|
99
|
-
$(container).find("li").unbind("mousemove", putPlacement);
|
100
|
-
$(document).unbind("mousemove", helperPosition);
|
101
|
-
};
|
102
|
-
|
103
|
-
var helperPosition = function(e) {
|
104
|
-
$("#jTreeHelper").css ({
|
105
|
-
top: e.pageY + 5,
|
106
|
-
left: e.pageX + 5
|
107
|
-
});
|
108
|
-
|
109
|
-
$(".jTreePlacement").remove();
|
110
|
-
};
|
111
|
-
|
112
|
-
var getInitial = function(e){
|
113
|
-
off = $(this).offset();
|
114
|
-
h = $(this).height();
|
115
|
-
w = $(this).width();
|
116
|
-
hover = this;
|
117
|
-
return false;
|
118
|
-
};
|
119
|
-
|
120
|
-
var putPlacement = function(e){
|
121
|
-
$(cur).hide();
|
122
|
-
$("#jTreeHelper").css ({
|
123
|
-
top: e.pageY + 5,
|
124
|
-
left: e.pageX + 5
|
125
|
-
});
|
126
|
-
|
127
|
-
//inserting before
|
128
|
-
if ( e.pageY >= off.top && e.pageY < (off.top + h/2 - 1) ) {
|
129
|
-
if (!$(this).prev().hasClass("jTreePlacement")) {
|
130
|
-
$(".jTreePlacement").remove();
|
131
|
-
$(this).before(str);
|
132
|
-
}
|
133
|
-
}
|
134
|
-
//inserting after
|
135
|
-
else if (e.pageY >(off.top + h/2) && e.pageY <= (off.top + h) ) {
|
136
|
-
// as a sibling
|
137
|
-
if (e.pageY > off.left && e.pageX < off.left + opts.childOff) {
|
138
|
-
if (!$(this).next().hasClass("jTreePlacement")) {
|
139
|
-
$(".jTreePlacement").remove();
|
140
|
-
$(this).after(str);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
// as a child
|
144
|
-
else if (e.pageX > off.left + opts.childOff) {
|
145
|
-
|
146
|
-
$(".jTreePlacement").remove();
|
147
|
-
if ($(this).find("ul").length == 0)
|
148
|
-
$(this).append('<ul>'+str+'</ul>');
|
149
|
-
else
|
150
|
-
$(this).find("ul").prepend(str);
|
151
|
-
}
|
152
|
-
}
|
153
|
-
return false;
|
154
|
-
}
|
155
|
-
|
156
|
-
var lockIn = function(e) {
|
157
|
-
// if placement box is present, insert before placement box
|
158
|
-
if ($(".jTreePlacement").length==1) {
|
159
|
-
$(cur).insertBefore(".jTreePlacement");
|
160
|
-
}
|
161
|
-
$(cur).show();
|
162
|
-
|
163
|
-
// remove helper and placement box
|
164
|
-
$("#jTreeHelper").empty().hide();
|
165
|
-
|
166
|
-
$(".jTreePlacement").remove();;
|
167
|
-
}
|
168
|
-
|
169
|
-
}; // end jTree
|
170
|
-
|
171
|
-
|
172
|
-
$.fn.jTree.defaults = {
|
173
|
-
showHelper: false,
|
174
|
-
hOpacity: 0.5,
|
175
|
-
hBg: "#FCC",
|
176
|
-
hColor: "#222",
|
177
|
-
pBorder: "1px dashed #CCC",
|
178
|
-
pBg: "#EEE",
|
179
|
-
pColor: "#222",
|
180
|
-
pHeight: "20px",
|
181
|
-
childOff: 20,
|
182
|
-
snapBack: 1000
|
183
|
-
};
|
184
|
-
|
185
|
-
})(jQuery);
|
186
|
-
|
187
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(A){A.fn.jTree=function(Q){var C=A.extend({},A.fn.jTree.defaults,Q);var O=0,M=0,E=0,F=0,N=0,I=0;var K='<li class="jTreePlacement" style="background:'+C.pBg+";border:"+C.pBorder+";color:"+C.pColor+";height:"+C.pHeight+'"></li>';var D=this;A(this).find("li").mousedown(function(R){if(A("#jTreeHelper").is(":not(:animated)")&&R.button!=2){A("body").append(K);A(".jTreePlacement").hide();A(this).clone().appendTo("#jTreeHelper");O=this;M=A(O).offset();A(O).hide();A("#jTreeHelper").css({position:"absolute",top:R.pageY+5,left:R.pageX+5,background:C.hBg,opacity:C.hOpacity}).show();A("#jTreeHelper *").css({color:C.hColor,background:C.hBg,});A(document).bind("selectstart",G);A(D).find("li").bind("dblclick",G);A(D).find("li").bind("mouseover",H);A(D).find("li").bind("mousemove",J);A(document).bind("mousemove",P)}return false});A(this).find("li").andSelf().mouseup(function(R){if(A(".jTreePlacement").is(":visible")){A(O).insertBefore(".jTreePlacement").show()}A(O).show();A(D).find("ul:empty").remove();A("#jTreeHelper").empty().hide();A(".jTreePlacement").remove();B();return false});A(document).mouseup(function(R){if(O!=0){A("#jTreeHelper").animate({top:M.top,left:M.left},C.snapBack,function(){A("#jTreeHelper").empty().hide();A(".jTreePlacement").remove();A(O).show()});B()}O=0;return false});var G=function(){return false};var B=function(){A(document).unbind("selectstart",G);A(D).find("li").unbind("dblclick",G);A(D).find("li").unbind("mouseover",H);A(D).find("li").unbind("mousemove",J);A(document).unbind("mousemove",P)};var P=function(R){A("#jTreeHelper").css({top:R.pageY+5,left:R.pageX+5});A(".jTreePlacement").remove()};var H=function(R){E=A(this).offset();F=A(this).height();N=A(this).width();I=this;return false};var J=function(R){A(O).hide();A("#jTreeHelper").css({top:R.pageY+5,left:R.pageX+5});if(R.pageY>=E.top&&R.pageY<(E.top+F/2-1)){if(!A(this).prev().hasClass("jTreePlacement")){A(".jTreePlacement").remove();A(this).before(K)}}else{if(R.pageY>(E.top+F/2)&&R.pageY<=(E.top+F)){if(R.pageY>E.left&&R.pageX<E.left+C.childOff){if(!A(this).next().hasClass("jTreePlacement")){A(".jTreePlacement").remove();A(this).after(K)}}else{if(R.pageX>E.left+C.childOff){A(".jTreePlacement").remove();if(A(this).find("ul").length==0){A(this).append("<ul>"+K+"</ul>")}else{A(this).find("ul").prepend(K)}}}}}return false};var L=function(R){if(A(".jTreePlacement").length==1){A(O).insertBefore(".jTreePlacement")}A(O).show();A("#jTreeHelper").empty().hide();A(".jTreePlacement").remove()}};A.fn.jTree.defaults={showHelper:false,hOpacity:0.5,hBg:"#FCC",hColor:"#222",pBorder:"1px dashed #CCC",pBg:"#EEE",pColor:"#222",pHeight:"20px",childOff:20,snapBack:1000}})(jQuery);
|
@@ -1,193 +0,0 @@
|
|
1
|
-
// JavaScript Document
|
2
|
-
(function($) {
|
3
|
-
|
4
|
-
$.fn.jTree = function(options) {
|
5
|
-
var opts = $.extend({}, $.fn.jTree.defaults, options);
|
6
|
-
var cur = 0, curOff = 0, off =0, h =0, w=0, hover = 0;
|
7
|
-
var str='<li class="jTreePlacement" style="background:'+opts.pBg+';border:'+opts.pBorder+';color:'+opts.pColor+';height:'+opts.pHeight+'"></li>';
|
8
|
-
var container = this;
|
9
|
-
$("body").append(str);
|
10
|
-
$(".jTreePlacement").hide();
|
11
|
-
//events are written here
|
12
|
-
$(this).find("li").draggable({
|
13
|
-
start: function(){
|
14
|
-
|
15
|
-
}
|
16
|
-
})
|
17
|
-
$(this).find("li").mousedown(function(e){
|
18
|
-
if ($("#jTreeHelper").is(":not(:animated)") && e.button !=2) {
|
19
|
-
// append jTreePlacement to body and hides
|
20
|
-
|
21
|
-
//get the current li and append to helper
|
22
|
-
$(this).clone().appendTo("#jTreeHelper");
|
23
|
-
|
24
|
-
// get initial state, cur and offset
|
25
|
-
cur = this;
|
26
|
-
curOff = $(cur).offset();
|
27
|
-
$(cur).hide();
|
28
|
-
// show initial helper
|
29
|
-
$("#jTreeHelper").css ({
|
30
|
-
position: "absolute",
|
31
|
-
top: e.pageY + 5,
|
32
|
-
left: e.pageX + 5,
|
33
|
-
background: opts.hBg,
|
34
|
-
opacity: opts.hOpacity
|
35
|
-
}).show();
|
36
|
-
$("#jTreeHelper *").css ({
|
37
|
-
color: opts.hColor,
|
38
|
-
background: opts.hBg
|
39
|
-
});
|
40
|
-
// start binding events to use
|
41
|
-
// prevent text selection
|
42
|
-
$(document).bind("selectstart", doNothing);
|
43
|
-
|
44
|
-
// doubleclick is destructive, better disable
|
45
|
-
$(container).find("li").bind("dblclick", doNothing);
|
46
|
-
|
47
|
-
// in single li calculate the offset, width height of hovered block
|
48
|
-
$(container).find("li").bind("mouseover", getInitial);
|
49
|
-
|
50
|
-
// in single li put placement in correct places, also move the helper around
|
51
|
-
$(container).find("li").bind("mousemove", putPlacement);
|
52
|
-
|
53
|
-
// handle mouse movement outside our container
|
54
|
-
$(document).bind("mousemove", helperPosition);
|
55
|
-
}
|
56
|
-
//prevent bubbling of mousedown
|
57
|
-
return false;
|
58
|
-
});
|
59
|
-
|
60
|
-
// in single li or in container, snap into placement if present then destroy placement
|
61
|
-
// and helper then show snapped in object/li
|
62
|
-
// also destroys events
|
63
|
-
$(this).find("li").andSelf().mouseup(function(e){
|
64
|
-
// if placementBox is detected
|
65
|
-
if ($(".jTreePlacement").is(":visible")) {
|
66
|
-
$(cur).insertBefore(".jTreePlacement").show();
|
67
|
-
}
|
68
|
-
$(cur).show();
|
69
|
-
// remove helper and placement box
|
70
|
-
$(container).find("ul:empty").remove();
|
71
|
-
$("#jTreeHelper").empty().hide();
|
72
|
-
$(".jTreePlacement").remove();
|
73
|
-
|
74
|
-
// remove bindings
|
75
|
-
destroyBindings();
|
76
|
-
|
77
|
-
return false;
|
78
|
-
});
|
79
|
-
|
80
|
-
$(document).mouseup(function(e){
|
81
|
-
if (cur!=0) {
|
82
|
-
$("#jTreeHelper").animate({
|
83
|
-
top: curOff.top,
|
84
|
-
left: curOff.left
|
85
|
-
}, opts.snapBack, function(){
|
86
|
-
$("#jTreeHelper").empty().hide();
|
87
|
-
$(".jTreePlacement").remove();
|
88
|
-
$(cur).show();
|
89
|
-
}
|
90
|
-
);
|
91
|
-
destroyBindings();
|
92
|
-
}
|
93
|
-
cur = 0;
|
94
|
-
return false;
|
95
|
-
});
|
96
|
-
//functions are written here
|
97
|
-
var doNothing = function(){
|
98
|
-
return false;
|
99
|
-
};
|
100
|
-
|
101
|
-
var destroyBindings = function(){
|
102
|
-
$(document).unbind("selectstart", doNothing);
|
103
|
-
$(container).find("li").unbind("dblclick", doNothing);
|
104
|
-
$(container).find("li").unbind("mouseover", getInitial);
|
105
|
-
$(container).find("li").unbind("mousemove", putPlacement);
|
106
|
-
$(document).unbind("mousemove", helperPosition);
|
107
|
-
};
|
108
|
-
|
109
|
-
var helperPosition = function(e) {
|
110
|
-
$("#jTreeHelper").css ({
|
111
|
-
top: e.pageY + 5,
|
112
|
-
left: e.pageX + 5
|
113
|
-
});
|
114
|
-
|
115
|
-
$(".jTreePlacement").remove();
|
116
|
-
};
|
117
|
-
|
118
|
-
var getInitial = function(e){
|
119
|
-
off = $(this).offset();
|
120
|
-
h = $(this).height();
|
121
|
-
w = $(this).width();
|
122
|
-
hover = this;
|
123
|
-
return false;
|
124
|
-
};
|
125
|
-
|
126
|
-
var putPlacement = function(e){
|
127
|
-
$(cur).hide();
|
128
|
-
$("#jTreeHelper").css ({
|
129
|
-
top: e.pageY + 5,
|
130
|
-
left: e.pageX + 5
|
131
|
-
});
|
132
|
-
|
133
|
-
//inserting before
|
134
|
-
if ( e.pageY >= off.top && e.pageY < (off.top + h/2 - 1) ) {
|
135
|
-
if (!$(this).prev().hasClass("jTreePlacement")) {
|
136
|
-
$(".jTreePlacement").remove();
|
137
|
-
$(this).before(str);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
//inserting after
|
141
|
-
else if (e.pageY >(off.top + h/2) && e.pageY <= (off.top + h) ) {
|
142
|
-
// as a sibling
|
143
|
-
if (e.pageY > off.left && e.pageX < off.left + opts.childOff) {
|
144
|
-
if (!$(this).next().hasClass("jTreePlacement")) {
|
145
|
-
$(".jTreePlacement").remove();
|
146
|
-
$(this).after(str);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
// as a child
|
150
|
-
else if (e.pageX > off.left + opts.childOff) {
|
151
|
-
|
152
|
-
$(".jTreePlacement").remove();
|
153
|
-
if ($(this).find("ul").length == 0)
|
154
|
-
$(this).append('<ul>'+str+'</ul>');
|
155
|
-
else
|
156
|
-
$(this).find("ul").prepend(str);
|
157
|
-
}
|
158
|
-
}
|
159
|
-
return false;
|
160
|
-
};
|
161
|
-
|
162
|
-
var lockIn = function(e) {
|
163
|
-
// if placement box is present, insert before placement box
|
164
|
-
if ($(".jTreePlacement").length==1) {
|
165
|
-
$(cur).insertBefore(".jTreePlacement");
|
166
|
-
}
|
167
|
-
$(cur).show();
|
168
|
-
|
169
|
-
// remove helper and placement box
|
170
|
-
$("#jTreeHelper").empty().hide();
|
171
|
-
|
172
|
-
$(".jTreePlacement").remove();;
|
173
|
-
};
|
174
|
-
|
175
|
-
}; // end jTree
|
176
|
-
|
177
|
-
|
178
|
-
$.fn.jTree.defaults = {
|
179
|
-
showHelper: false,
|
180
|
-
hOpacity: 0.5,
|
181
|
-
hBg: "#FCC",
|
182
|
-
hColor: "#222",
|
183
|
-
pBorder: "1px dashed #CCC",
|
184
|
-
pBg: "#EEE",
|
185
|
-
pColor: "#222",
|
186
|
-
pHeight: "20px",
|
187
|
-
childOff: 20,
|
188
|
-
snapBack: 1000
|
189
|
-
};
|
190
|
-
|
191
|
-
})(jQuery);
|
192
|
-
|
193
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'spiderfw/controller/mixins/static_content'
|
2
|
-
|
3
|
-
module Spider
|
4
|
-
|
5
|
-
class AppController < Controller
|
6
|
-
# FIXME: should extend PageController, but there are some circular dependencies to sort out.
|
7
|
-
include Visual
|
8
|
-
include StaticContent
|
9
|
-
include WidgetHelper
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
module Spider
|
4
|
-
|
5
|
-
class TestCase < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def self.standalone
|
8
|
-
@standalone
|
9
|
-
end
|
10
|
-
|
11
|
-
def setup
|
12
|
-
Spider._test_setup if self.class.standalone
|
13
|
-
end
|
14
|
-
|
15
|
-
def teardown
|
16
|
-
Spider._test_teardown if self.class.standalone
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_dummy
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|