erp_app 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/erp_app/shared/configuration_controller.rb +3 -2
- data/app/views/erp_app/mobile/base/index.erb +1 -1
- data/lib/erp_app/extensions/railties/action_view/helpers/include_helper.rb +1 -1
- data/lib/erp_app/version.rb +1 -1
- data/lib/erp_app/widgets/railties/action_view/helpers/widget_helper.rb +7 -7
- data/public/javascripts/erp_app/jquery_support.js +32 -19
- data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +16 -12
- data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +4 -6
- data/public/javascripts/erp_app/utility.js +11 -7
- data/public/javascripts/erp_app/widgets.js +38 -2
- data/public/javascripts/jquery_plugins/jquery.address.min.js +32 -0
- data/public/javascripts/jquery_plugins/jquery.loadmask.min.js +10 -0
- data/public/stylesheets/jquery_plugins/jquery.loadmask.css +40 -0
- metadata +13 -10
@@ -9,14 +9,15 @@ module ErpApp
|
|
9
9
|
array << category.to_tree_hash(:only => [], :methods => [{:id => :categoryId}], :icon_cls => 'icon-index')
|
10
10
|
end
|
11
11
|
end
|
12
|
+
tree_array.sort_by!{|hash| [hash[:text]]}
|
12
13
|
render :json => tree_array
|
13
14
|
end
|
14
15
|
|
15
16
|
def setup
|
16
17
|
category_id = params[:category_id]
|
17
18
|
configuration = ::Configuration.find(params[:id])
|
18
|
-
|
19
|
-
render :json => {:success => true, :configurationItemTypes => configuration.item_types.by_category(Category.find(category_id)).collect(&:to_js_hash)}
|
19
|
+
|
20
|
+
render :json => {:success => true, :configurationItemTypes => configuration.item_types.by_category(Category.find(category_id)).collect(&:to_js_hash).sort_by{|hash| [hash[:internalIdentifier]]}}
|
20
21
|
end
|
21
22
|
|
22
23
|
def load
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
3
|
<head>
|
4
4
|
<title>CompassAE Mobile</title>
|
5
|
-
<%=include_sencha_touch :debug =>
|
5
|
+
<%=include_sencha_touch :debug => (Rails.env != 'production')%>
|
6
6
|
<%=static_javascript_include_tag('erp_app/utility.js')%>
|
7
7
|
<%=static_javascript_include_tag('erp_app/mobile/mobile_base.js')%>
|
8
8
|
<%#=setup_js_authentication(@user, @desktop)%>
|
@@ -20,7 +20,7 @@ module ErpApp
|
|
20
20
|
def include_extjs(opt={})
|
21
21
|
resources = ''
|
22
22
|
|
23
|
-
if opt[:debug]
|
23
|
+
if opt[:debug]
|
24
24
|
resources << static_javascript_include_tag("extjs/ext-all-debug.js")
|
25
25
|
else
|
26
26
|
resources << static_javascript_include_tag("extjs/ext-all.js")
|
data/lib/erp_app/version.rb
CHANGED
@@ -11,7 +11,7 @@ module ErpApp
|
|
11
11
|
|
12
12
|
uuid = Digest::SHA1.hexdigest(Time.now.to_s + rand(10000).to_s)
|
13
13
|
|
14
|
-
raw "<div id=\"#{uuid}\">Loading ...<script type=\"text/javascript\">Compass.ErpApp.Widgets.setup('#{uuid}', '#{name}', '#{action}', #{params}, true);</script></div>"
|
14
|
+
raw "<div id=\"#{uuid}\" class='compass_ae-widget'>Loading ...<script type=\"text/javascript\">Compass.ErpApp.Widgets.setup('#{uuid}', '#{name}', '#{action}', #{params}, true);</script></div>"
|
15
15
|
end
|
16
16
|
|
17
17
|
def build_widget_url(action,id=nil,params={})
|
@@ -49,9 +49,9 @@ module ErpApp
|
|
49
49
|
widget_params
|
50
50
|
end
|
51
51
|
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
52
|
+
end #WidgetHelper
|
53
|
+
end #Helpers
|
54
|
+
end #ActionView
|
55
|
+
end #Railties
|
56
|
+
end #Widgets
|
57
|
+
end #ErpApp
|
@@ -1,24 +1,37 @@
|
|
1
|
-
if($){
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
if ($) {
|
2
|
+
$(document).ready(function () {
|
3
|
+
Compass.ErpApp.JQuerySupport.setupHtmlReplace();
|
4
|
+
});
|
5
5
|
|
6
|
-
|
6
|
+
Ext.ns("Compass.ErpApp.JQuerySupport");
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
Compass.ErpApp.JQuerySupport.setupHtmlReplace = function () {
|
9
|
+
jQuery('body').unbind('ajaxSuccess').bind('ajaxSuccess', Compass.ErpApp.JQuerySupport.handleHtmlUpdateResponse);
|
10
|
+
};
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
Compass.ErpApp.JQuerySupport.handleHtmlUpdateResponse = function (e, xhr, settings) {
|
13
|
+
if(Compass.ErpApp.JQuerySupport.IsJsonString(xhr.responseText)){
|
14
|
+
var responseData = jQuery.parseJSON(xhr.responseText);
|
15
|
+
if (!Ext.isEmpty(responseData) && !Ext.isEmpty(responseData.htmlId)) {
|
16
|
+
var updateDiv = $('#' + responseData.htmlId);
|
17
|
+
try {
|
18
|
+
updateDiv.closest('div.compass_ae-widget').unmask();
|
19
|
+
}
|
20
|
+
catch (ex) {
|
21
|
+
//messy catch for no update div
|
22
|
+
}
|
23
|
+
updateDiv.get(0).innerHTML = responseData.html;
|
24
|
+
Compass.ErpApp.Utility.evaluateScriptTags(updateDiv.get(0));
|
25
|
+
}
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
Compass.ErpApp.JQuerySupport.IsJsonString = function (str) {
|
30
|
+
try {
|
31
|
+
JSON.parse(str);
|
32
|
+
} catch (e) {
|
33
|
+
return false;
|
34
|
+
}
|
35
|
+
return true;
|
21
36
|
}
|
22
|
-
|
23
|
-
};
|
24
37
|
}
|
@@ -36,12 +36,12 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGrid",{
|
|
36
36
|
var store = Ext.create('Ext.data.Store', {
|
37
37
|
model: ((config.editable) ? config.model : undefined),
|
38
38
|
fields:config['fields'],
|
39
|
-
|
39
|
+
remoteSort:config['remoteSort'],
|
40
40
|
autoSync: true,
|
41
41
|
pageSize: config['pageSize'],
|
42
42
|
proxy: config.proxy,
|
43
43
|
storeId: config['storeId'],
|
44
|
-
autoLoad:
|
44
|
+
autoLoad: false
|
45
45
|
});
|
46
46
|
|
47
47
|
this.store = store;
|
@@ -54,18 +54,18 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGrid",{
|
|
54
54
|
emptyMsg: config['emptyMsg']
|
55
55
|
});
|
56
56
|
}
|
57
|
-
|
57
|
+
|
58
58
|
this.callParent(arguments);
|
59
59
|
},
|
60
60
|
|
61
61
|
constructor : function(config) {
|
62
|
-
this.editing = Ext.create('Ext.grid.plugin.RowEditing', {
|
63
|
-
clicksToMoveEditor: 1
|
64
|
-
});
|
65
|
-
|
66
|
-
var plugins = [];
|
67
|
-
var tbar = {};
|
68
62
|
if(config['editable']){
|
63
|
+
var tbar = {};
|
64
|
+
var plugins = [];
|
65
|
+
this.editing = Ext.create('Ext.grid.plugin.RowEditing', {
|
66
|
+
clicksToMoveEditor: 1
|
67
|
+
});
|
68
|
+
|
69
69
|
var Model = Ext.define(config.model,{
|
70
70
|
extend:'Ext.data.Model',
|
71
71
|
fields:config.fields,
|
@@ -97,16 +97,20 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGrid",{
|
|
97
97
|
}
|
98
98
|
}]
|
99
99
|
};
|
100
|
+
|
101
|
+
config = Ext.apply({
|
102
|
+
plugins:plugins,
|
103
|
+
tbar:tbar
|
104
|
+
}, config);
|
100
105
|
}
|
101
106
|
|
102
107
|
config = Ext.apply({
|
103
108
|
layout:'fit',
|
104
109
|
frame: false,
|
105
110
|
autoScroll:true,
|
106
|
-
loadMask:true
|
107
|
-
plugins:plugins,
|
108
|
-
tbar:tbar
|
111
|
+
loadMask:true
|
109
112
|
}, config);
|
113
|
+
|
110
114
|
this.callParent([config]);
|
111
115
|
}
|
112
116
|
});
|
@@ -15,6 +15,7 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGridLoaderPanel",{
|
|
15
15
|
editable:config['editable'],
|
16
16
|
url:config['dataUrl'],
|
17
17
|
page:config['page'],
|
18
|
+
remoteSort:config['remoteSort'],
|
18
19
|
pageSize:config['pageSize'],
|
19
20
|
displayMsg:config['displayMsg'],
|
20
21
|
emptyMsg:config['emptyMsg'],
|
@@ -28,8 +29,7 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGridLoaderPanel",{
|
|
28
29
|
listeners: config.grid_listeners,
|
29
30
|
storeId: config['storeId']
|
30
31
|
});
|
31
|
-
self.
|
32
|
-
|
32
|
+
self.down('shared_dynamiceditablegrid').getStore().load();
|
33
33
|
}
|
34
34
|
else{
|
35
35
|
var message = response.message;
|
@@ -46,14 +46,12 @@ Ext.define("Compass.ErpApp.Shared.DynamicEditableGridLoaderPanel",{
|
|
46
46
|
},
|
47
47
|
|
48
48
|
onRender: function() {
|
49
|
-
|
49
|
+
this.callParent(arguments);
|
50
50
|
this.setupGrid();
|
51
51
|
},
|
52
52
|
|
53
53
|
constructor : function(config) {
|
54
|
-
config = Ext.apply({
|
55
|
-
layout:'card'
|
56
|
-
}, config);
|
54
|
+
config = Ext.apply({layout:'card'}, config);
|
57
55
|
this.callParent([config]);
|
58
56
|
}
|
59
57
|
});
|
@@ -46,6 +46,16 @@ Compass.ErpApp.Utility.handleFormFailure = function(action){
|
|
46
46
|
}
|
47
47
|
};
|
48
48
|
|
49
|
+
Compass.ErpApp.Utility.randomString = function(length) {
|
50
|
+
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
|
51
|
+
var randomString = '';
|
52
|
+
for (var i=0; i<length; i++) {
|
53
|
+
var randomNumber = Math.floor(Math.random() * chars.length);
|
54
|
+
randomString += chars.substring(randomNumber,randomNumber+1);
|
55
|
+
}
|
56
|
+
return randomString
|
57
|
+
};
|
58
|
+
|
49
59
|
Compass.ErpApp.Utility.roundNumber = function(num) {
|
50
60
|
var twoDPString = "0.00";
|
51
61
|
if(!Compass.ErpApp.Utility.isBlank(num) && !isNaN(num)){
|
@@ -128,13 +138,7 @@ Compass.ErpApp.Utility.addCommas = function(nStr)
|
|
128
138
|
};
|
129
139
|
|
130
140
|
Compass.ErpApp.Utility.isBlank = function(value) {
|
131
|
-
|
132
|
-
|
133
|
-
if(value === 'undefined' || value === undefined || value === null || value === '' || value === ' '){
|
134
|
-
result = true;
|
135
|
-
}
|
136
|
-
|
137
|
-
return result;
|
141
|
+
return Ext.isEmpty(value);
|
138
142
|
};
|
139
143
|
|
140
144
|
Compass.ErpApp.Utility.removeDublicates = function(arrayName) {
|
@@ -10,7 +10,7 @@ Compass.ErpApp.Widgets = {
|
|
10
10
|
method: 'POST',
|
11
11
|
params:widgetParams,
|
12
12
|
success: function(response) {
|
13
|
-
|
13
|
+
Ext.get(uuid).dom.innerHTML = response.responseText;
|
14
14
|
Compass.ErpApp.Utility.evaluateScriptTags(Ext.get(uuid).dom);
|
15
15
|
Compass.ErpApp.JQuerySupport.setupHtmlReplace();
|
16
16
|
if(addToLoaded)
|
@@ -22,7 +22,7 @@ Compass.ErpApp.Widgets = {
|
|
22
22
|
});
|
23
23
|
},
|
24
24
|
failure: function(response) {
|
25
|
-
|
25
|
+
jQuery('#'+uuid).unmask();
|
26
26
|
}
|
27
27
|
});
|
28
28
|
},
|
@@ -41,6 +41,42 @@ Compass.ErpApp.Widgets = {
|
|
41
41
|
});
|
42
42
|
},
|
43
43
|
|
44
|
+
setupAjaxNavigation : function(css_class, home_url){
|
45
|
+
$.address.value('nav?url=' + home_url);
|
46
|
+
|
47
|
+
var bindCss = 'a.'+css_class;
|
48
|
+
var anchor = null;
|
49
|
+
jQuery(bindCss).bind('click', function(){
|
50
|
+
anchor = $(this);
|
51
|
+
var href = anchor.attr('href');
|
52
|
+
$.address.value('nav?url=' + href + '&key='+Compass.ErpApp.Utility.randomString(10));
|
53
|
+
anchor.closest('div.compass_ae-widget').mask("Loading....");
|
54
|
+
|
55
|
+
$.ajax({
|
56
|
+
url: href,
|
57
|
+
success: Compass.ErpApp.JQuerySupport.handleHtmlUpdateResponse
|
58
|
+
});
|
59
|
+
|
60
|
+
return false;
|
61
|
+
});
|
62
|
+
|
63
|
+
$.address.change(function(event) {
|
64
|
+
try{
|
65
|
+
if(!Ext.isEmpty(event.parameters.url)){
|
66
|
+
$.ajax({
|
67
|
+
url: event.parameters.url,
|
68
|
+
success: Compass.ErpApp.JQuerySupport.handleHtmlUpdateResponse
|
69
|
+
});
|
70
|
+
}
|
71
|
+
}
|
72
|
+
catch(exception){
|
73
|
+
if(console){
|
74
|
+
console.log(exception);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
});
|
78
|
+
},
|
79
|
+
|
44
80
|
LoadedWidgets : [],
|
45
81
|
|
46
82
|
AvailableWidgets : []
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Address Plugin v1.3.2
|
3
|
+
* http://www.asual.com/jquery/address/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009-2010 Rostislav Hristov
|
6
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7
|
+
* http://jquery.org/license
|
8
|
+
*
|
9
|
+
* Date: 2010-12-29 14:59:02 +0200 (Wed, 29 Dec 2010)
|
10
|
+
*/
|
11
|
+
(function(c){c.address=function(){var z=function(a){c(c.address).trigger(c.extend(c.Event(a),function(){for(var b={},e=c.address.parameterNames(),h=0,q=e.length;h<q;h++)b[e[h]]=c.address.parameter(e[h]);return{value:c.address.value(),path:c.address.path(),pathNames:c.address.pathNames(),parameterNames:e,parameters:b,queryString:c.address.queryString()}}.call(c.address)))},A=function(a,b,e){c(c.address).bind(a,b,e);return c.address},C=function(){return B.pushState&&d.state!==i},u=function(){return("/"+
|
12
|
+
g.pathname.replace(new RegExp(d.state),"")+g.search+(K()?"#"+K():"")).replace(ba,"/")},K=function(){var a=g.href.indexOf("#");return a!=-1?D(g.href.substr(a+1),l):""},w=function(){return C()?u():K()},va=function(){return"javascript"},s=function(a){a=a.toString();return(d.strict&&a.substr(0,1)!="/"?"/":"")+a},D=function(a,b){if(d.crawlable&&b)return(a!=""?"!":"")+a;return a.replace(/^\!/,"")},E=function(a,b){return parseInt(a.css(b),10)},ca=function(a){for(var b,e,h=0,q=a.childNodes.length;h<q;h++){if(a.childNodes[h].src)b=
|
13
|
+
String(a.childNodes[h].src);if(e=ca(a.childNodes[h]))b=e}return b},O=function(){if(!T){var a=w(),b=f!=a;if(F&&p<523){if(L!=B.length){L=B.length;if(J[L-1]!==i)f=J[L-1];M(l)}}else if(b)if(G&&p<7)g.reload();else{G&&p<8&&d.history&&x(W,50);f=a;M(l)}}},M=function(a){z(da);z(a?ea:fa);x(ga,10)},ga=function(){if(d.tracker!=="null"&&d.tracker!==null){var a=c.isFunction(d.tracker)?d.tracker:k[d.tracker],b=(g.pathname+g.search+(c.address&&!C()?c.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,"");if(c.isFunction(a))a(b);
|
14
|
+
else if(c.isFunction(k.urchinTracker))k.urchinTracker(b);else if(k.pageTracker!==i&&c.isFunction(k.pageTracker._trackPageview))k.pageTracker._trackPageview(b);else k._gaq!==i&&c.isFunction(k._gaq.push)&&k._gaq.push(["_trackPageview",b])}},W=function(){var a=va()+":"+l+";document.open();document.writeln('<html><head><title>"+n.title.replace("'","\\'")+"</title><script>var "+r+' = "'+encodeURIComponent(w())+(n.domain!=g.host?'";document.domain="'+n.domain:"")+"\";<\/script></head></html>');document.close();";
|
15
|
+
if(p<7)o.src=a;else o.contentWindow.location.replace(a)},ia=function(){if(P&&ha!=-1){var a,b=P.substr(ha+1).split("&");for(v=0;v<b.length;v++){a=b[v].split("=");if(/^(autoUpdate|crawlable|history|strict|wrap)$/.test(a[0]))d[a[0]]=isNaN(a[1])?/^(true|yes)$/i.test(a[1]):parseInt(a[1],10)!==0;if(/^(state|tracker)$/.test(a[0]))d[a[0]]=a[1]}P=null}f=w()},ka=function(){if(!ja){ja=m;ia();var a=function(){wa.call(this);xa.call(this)},b=c("body").ajaxComplete(a);a();if(d.wrap){c("body > *").wrapAll('<div style="padding:'+
|
16
|
+
(E(b,"marginTop")+E(b,"paddingTop"))+"px "+(E(b,"marginRight")+E(b,"paddingRight"))+"px "+(E(b,"marginBottom")+E(b,"paddingBottom"))+"px "+(E(b,"marginLeft")+E(b,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+r+'" style="height:100%;overflow:auto;position:relative;'+(F?window.statusbar.visible&&!/chrome/i.test(X)?"":"resize:both;":"")+'" />');c("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});F&&c('<style type="text/css" />').appendTo("head").text("#"+r+"::-webkit-resizer { background-color: #fff; }")}if(G&&
|
17
|
+
p<8){a=n.getElementsByTagName("frameset")[0];o=n.createElement((a?"":"i")+"frame");if(a){a.insertAdjacentElement("beforeEnd",o);a[a.cols?"cols":"rows"]+=",0";o.noResize=m;o.frameBorder=o.frameSpacing=0}else{o.style.display="none";o.style.width=o.style.height=0;o.tabIndex=-1;n.body.insertAdjacentElement("afterBegin",o)}x(function(){c(o).bind("load",function(){var e=o.contentWindow;f=e[r]!==i?e[r]:"";if(f!=w()){M(l);g.hash=D(f,m)}});o.contentWindow[r]===i&&W()},50)}else if(F){if(p<418){c(n.body).append('<form id="'+
|
18
|
+
r+'" style="position:absolute;top:-9999px;" method="get"></form>');Y=n.getElementById(r)}if(g[r]===i)g[r]={};if(g[r][g.pathname]!==i)J=g[r][g.pathname].split(",")}x(function(){z("init");M(l)},1);if(!C())if(G&&p>7||!G&&"on"+Q in k)if(k.addEventListener)k.addEventListener(Q,O,l);else k.attachEvent&&k.attachEvent("on"+Q,O);else ya(O,50)}},wa=function(){var a,b=c("a"),e=b.size(),h=-1;x(function(){if(++h!=e){a=c(b.get(h));a.is("[rel*=address:]")&&a.address();x(arguments.callee,1)}},1)},za=function(){if(f!=
|
19
|
+
w()){f=w();M(l)}},Aa=function(){if(k.removeEventListener)k.removeEventListener(Q,O,l);else k.detachEvent&&k.detachEvent("on"+Q,O)},xa=function(){if(d.crawlable){var a=g.pathname.replace(/\/$/,"");c("body").html().indexOf("_escaped_fragment_")!=-1&&c("a[href]:not([href^=http]), , a[href*="+document.domain+"]").each(function(){var b=c(this).attr("href").replace(/^http:/,"").replace(new RegExp(a+"/?$"),"");if(b==""||b.indexOf("_escaped_fragment_")!=-1)c(this).attr("href","#"+c.address.decode(b.replace(/\/(.*)\?_escaped_fragment_=(.*)$/,
|
20
|
+
"!$2")))})}},la=function(a){return a.replace(/\+/g," ")},H=function(a){return ma(na(a)).replace(/%20/g,"+")},oa=function(a){return a.split("#")[0].split("?")[0]},pa=function(a){a=oa(a);var b=a.replace(ba,"/").split("/");if(a.substr(0,1)=="/"||a.length===0)b.splice(0,1);a.substr(a.length-1,1)=="/"&&b.splice(b.length-1,1);return b},R=function(a){a=a.split("?");return a.slice(1,a.length).join("?").split("#")[0]},qa=function(a,b){if(b=R(b)){params=b.split("&");b=[];for(v=0;v<params.length;v++){var e=
|
21
|
+
params[v].split("=");if(e[0]==a||c.address.decode(e[0])==a)b.push(e.slice(1).join("="))}if(b.length!==0)return b.length!=1?b:b[0]}},ra=function(a){var b=R(a);a=[];if(b&&b.indexOf("=")!=-1){b=b.split("&");for(var e=0;e<b.length;e++){var h=b[e].split("=")[0];c.inArray(h,a)==-1&&a.push(h)}}return a},U=function(a){a=a.split("#");return a.slice(1,a.length).join("#")},i,r="jQueryAddress",Q="hashchange",da="change",ea="internalChange",fa="externalChange",m=true,l=false,d={autoUpdate:m,crawlable:l,history:m,
|
22
|
+
strict:m,wrap:l},t=c.browser,p=parseFloat(c.browser.version),sa=t.mozilla,G=t.msie,ta=t.opera,F=t.webkit||t.safari,Z=l,k=function(){try{return top.document!==i?top:window}catch(a){return window}}(),n=k.document,B=k.history,g=k.location,ya=setInterval,x=setTimeout,ma=encodeURIComponent,na=decodeURIComponent,ba=/\/{2,9}/g,X=navigator.userAgent,o,Y,P=ca(document),ha=P?P.indexOf("?"):-1,$=n.title,L=B.length,T=l,ja=l,aa=m,ua=m,V=l,J=[],f=w();if(G){p=parseFloat(X.substr(X.indexOf("MSIE")+4));if(n.documentMode&&
|
23
|
+
n.documentMode!=p)p=n.documentMode!=8?7:8;c(document).bind("propertychange",function(){if(n.title!=$&&n.title.indexOf("#"+w())!=-1)n.title=$})}if(Z=sa&&p>=1||G&&p>=6||ta&&p>=9.5||F&&p>=312){for(var v=1;v<L;v++)J.push("");J.push(f);if(ta)history.navigationMode="compatible";if(document.readyState=="complete")var Ba=setInterval(function(){if(c.address){ka();clearInterval(Ba)}},50);else{ia();c(ka)}t=u();if(d.state!==i)if(B.pushState)t.substr(0,3)=="/#/"&&g.replace(d.state.replace(/^\/$/,"")+t.substr(2));
|
24
|
+
else t!="/"&&t.replace(/^\/#/,"")!=K()&&g.replace(d.state.replace(/^\/$/,"")+"/#"+t);c(window).bind("popstate",za).bind("unload",Aa)}else!Z&&K()!=""||F&&p<418&&K()!=""&&g.search!=""?g.replace(g.href.substr(0,g.href.indexOf("#"))):ga();return{bind:function(a,b,e){return A(a,b,e)},init:function(a){return A("init",a)},change:function(a){return A(da,a)},internalChange:function(a){return A(ea,a)},externalChange:function(a){return A(fa,a)},baseURL:function(){var a=g.href;if(a.indexOf("#")!=-1)a=a.substr(0,
|
25
|
+
a.indexOf("#"));if(/\/$/.test(a))a=a.substr(0,a.length-1);return a},autoUpdate:function(a){if(a!==i){d.autoUpdate=a;return this}return d.autoUpdate},crawlable:function(a){if(a!==i){d.crawlable=a;return this}return d.crawlable},history:function(a){if(a!==i){d.history=a;return this}return d.history},state:function(a){if(a!==i){d.state=a;return this}return d.state},strict:function(a){if(a!==i){d.strict=a;return this}return d.strict},tracker:function(a){if(a!==i){d.tracker=a;return this}return d.tracker},
|
26
|
+
wrap:function(a){if(a!==i){d.wrap=a;return this}return d.wrap},update:function(){V=m;this.value(f);V=l;return this},encode:function(a){var b=pa(a),e=ra(a),h=R(a),q=U(a),I=a.substr(0,1),N=a.substr(a.length-1),j="";c.each(b,function(y,S){j+="/"+H(S)});if(h!==""){j+="?";if(e.length===0)j+=h;else{c.each(e,function(y,S){y=qa(S,a);if(typeof y!=="string")c.each(y,function(Da,Ca){j+=H(S)+"="+H(Ca)+"&"});else j+=H(S)+"="+H(y)+"&"});j=j.substr(0,j.length-1)}}if(q!=="")j+="#"+H(q);if(I!="/"&&j.substr(0,1)==
|
27
|
+
"/")j=j.substr(1);if(I=="/"&&j.substr(0,1)!="/")j="/"+j;if(/#|&|\?/.test(N))j+=N;return j},decode:function(a){if(a!==i){var b=[],e=function(I){return na(I.toString().replace(/\+/g,"%20"))};if(typeof a=="object"&&a.length!==i){for(var h=0,q=a.length;h<q;h++)b[h]=e(a[h]);return b}else return e(a)}},title:function(a){if(a!==i){x(function(){$=n.title=a;if(ua&&o&&o.contentWindow&&o.contentWindow.document){o.contentWindow.document.title=a;ua=l}if(!aa&&sa)g.replace(g.href.indexOf("#")!=-1?g.href:g.href+
|
28
|
+
"#");aa=l},50);return this}return n.title},value:function(a){if(a!==i){a=s(a);if(d.autoUpdate)a=this.encode(a);if(a=="/")a="";if(f==a&&!V)return;aa=m;f=a;if(d.autoUpdate||V){M(m);if(C())B[d.history?"pushState":"replaceState"]({},"",d.state.replace(/\/$/,"")+(f==""?"/":f));else{T=m;J[B.length]=f;if(F)if(d.history){g[r][g.pathname]=J.toString();L=B.length+1;if(p<418){if(g.search==""){Y.action="#"+D(f,m);Y.submit()}}else if(p<523||f==""){a=n.createEvent("MouseEvents");a.initEvent("click",m,m);var b=
|
29
|
+
n.createElement("a");b.href="#"+D(f,m);b.dispatchEvent(a)}else g.hash="#"+D(f,m)}else g.replace("#"+D(f,m));else if(f!=w())if(d.history)g.hash="#"+D(f,m);else g.replace("#"+D(f,m));G&&p<8&&d.history&&x(W,50);if(F)x(function(){T=l},1);else T=l}}return this}if(!Z)return null;return this.decode(s(f))},path:function(a){if(a!==i){var b=R(s(f)),e=U(s(f));this.value(a+(b?"?"+b:"")+(e?"#"+e:""));return this}return this.decode(oa(s(f)))},pathNames:function(){return this.decode(pa(s(f)))},queryString:function(a){if(a!==
|
30
|
+
i){var b=U(s(f));this.value(this.path()+(a?"?"+a:"")+(b?"#"+b:""));return this}return this.decode(R(s(f)))},parameter:function(a,b,e){var h,q;if(b!==i){var I=this.parameterNames();q=[];b=b?ma(b):"";for(h=0;h<I.length;h++){var N=I[h],j=this.parameter(N);if(typeof j=="string")j=[j];if(N==a)j=b===null||b===""?[]:e?j.concat([b]):[b];for(var y=0;y<j.length;y++)q.push(N+"="+la(H(j[y])))}c.inArray(a,I)==-1&&b!==null&&b!==""&&q.push(a+"="+la(H(b)));this.queryString(q.join("&"));return this}return this.decode(qa(a,
|
31
|
+
s(f)))},parameterNames:function(){return this.decode(ra(s(f)))},hash:function(a){if(a!==i){this.value(s(f).split("#")[0]+(a?"#"+a:""));return this}return this.decode(U(s(f)))}}}();c.fn.address=function(z){if(!c(this).attr("address")){var A=function(C){if(c(this).is("a")){var u=z?z.call(this):/address:/.test(c(this).attr("rel"))?c(this).attr("rel").split("address:")[1].split(" ")[0]:c.address.state()!==undefined&&c.address.state()!="/"?c(this).attr("href").replace(new RegExp("^(.*"+c.address.state()+
|
32
|
+
"|\\.)"),""):c(this).attr("href").replace(/^(#\!?|\.)/,"");c.address.value(u);C.preventDefault()}};c(this).click(A).live("click",A).live("submit",function(C){if(c(this).is("form")){var u=c(this).attr("action");u=z?z.call(this):(u.indexOf("?")!=-1?u.replace(/&$/,""):u+"?")+c.address.decode(c(this).serialize());c.address.value(u);C.preventDefault()}}).attr("address",true)}return this}})(jQuery);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2009 Sergiy Kovalchuk (serg472@gmail.com)
|
3
|
+
*
|
4
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
6
|
+
*
|
7
|
+
* Following code is based on Element.mask() implementation from ExtJS framework (http://extjs.com/)
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
(function(a){a.fn.mask=function(c,b){a(this).each(function(){if(b!==undefined&&b>0){var d=a(this);d.data("_mask_timeout",setTimeout(function(){a.maskElement(d,c)},b))}else{a.maskElement(a(this),c)}})};a.fn.unmask=function(){a(this).each(function(){a.unmaskElement(a(this))})};a.fn.isMasked=function(){return this.hasClass("masked")};a.maskElement=function(d,c){if(d.data("_mask_timeout")!==undefined){clearTimeout(d.data("_mask_timeout"));d.removeData("_mask_timeout")}if(d.isMasked()){a.unmaskElement(d)}if(d.css("position")=="static"){d.addClass("masked-relative")}d.addClass("masked");var e=a('<div class="loadmask"></div>');if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){e.height(d.height()+parseInt(d.css("padding-top"))+parseInt(d.css("padding-bottom")));e.width(d.width()+parseInt(d.css("padding-left"))+parseInt(d.css("padding-right")))}if(navigator.userAgent.toLowerCase().indexOf("msie 6")>-1){d.find("select").addClass("masked-hidden")}d.append(e);if(c!==undefined){var b=a('<div class="loadmask-msg" style="display:none;"></div>');b.append("<div>"+c+"</div>");d.append(b);b.css("top",Math.round(d.height()/2-(b.height()-parseInt(b.css("padding-top"))-parseInt(b.css("padding-bottom")))/2)+"px");b.css("left",Math.round(d.width()/2-(b.width()-parseInt(b.css("padding-left"))-parseInt(b.css("padding-right")))/2)+"px");b.show()}};a.unmaskElement=function(b){if(b.data("_mask_timeout")!==undefined){clearTimeout(b.data("_mask_timeout"));b.removeData("_mask_timeout")}b.find(".loadmask-msg,.loadmask").remove();b.removeClass("masked");b.removeClass("masked-relative");b.find("select").removeClass("masked-hidden")}})(jQuery);
|
@@ -0,0 +1,40 @@
|
|
1
|
+
.loadmask {
|
2
|
+
z-index: 100;
|
3
|
+
position: absolute;
|
4
|
+
top:0;
|
5
|
+
left:0;
|
6
|
+
-moz-opacity: 0.5;
|
7
|
+
opacity: .50;
|
8
|
+
filter: alpha(opacity=50);
|
9
|
+
background-color: #CCC;
|
10
|
+
width: 100%;
|
11
|
+
height: 100%;
|
12
|
+
zoom: 1;
|
13
|
+
}
|
14
|
+
.loadmask-msg {
|
15
|
+
z-index: 20001;
|
16
|
+
position: absolute;
|
17
|
+
top: 0;
|
18
|
+
left: 0;
|
19
|
+
border:1px solid #6593cf;
|
20
|
+
background: #c3daf9;
|
21
|
+
padding:2px;
|
22
|
+
}
|
23
|
+
.loadmask-msg div {
|
24
|
+
padding:5px 10px 5px 25px;
|
25
|
+
background: #fbfbfb url('/images/loading_icon.gif') no-repeat 5px 5px;
|
26
|
+
line-height: 16px;
|
27
|
+
border:1px solid #a3bad9;
|
28
|
+
color:#222;
|
29
|
+
font:normal 11px tahoma, arial, helvetica, sans-serif;
|
30
|
+
cursor:wait;
|
31
|
+
}
|
32
|
+
.masked {
|
33
|
+
overflow: hidden !important;
|
34
|
+
}
|
35
|
+
.masked-relative {
|
36
|
+
position: relative !important;
|
37
|
+
}
|
38
|
+
.masked-hidden {
|
39
|
+
visibility: hidden !important;
|
40
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: will_paginate
|
16
|
-
requirement: &
|
16
|
+
requirement: &70129997617900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70129997617900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: uglifier
|
27
|
-
requirement: &
|
27
|
+
requirement: &70129997620420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70129997620420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: erp_tech_svcs
|
38
|
-
requirement: &
|
38
|
+
requirement: &70129997463880 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70129997463880
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: erp_dev_svcs
|
49
|
-
requirement: &
|
49
|
+
requirement: &70129997408200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70129997408200
|
58
58
|
description: Provides an application infrastructure based on the Sencha/extjs UI framework,
|
59
59
|
as well as several utilities and example applications. It houses the core application
|
60
60
|
container framework and component model infrastructure that play a key role in the
|
@@ -1568,6 +1568,8 @@ files:
|
|
1568
1568
|
- public/javascripts/extjs/Ext.ux.form.MultiSelect.js
|
1569
1569
|
- public/javascripts/extjs/ext_ux_tab_close_menu.js
|
1570
1570
|
- public/javascripts/extjs/overrides.js
|
1571
|
+
- public/javascripts/jquery_plugins/jquery.address.min.js
|
1572
|
+
- public/javascripts/jquery_plugins/jquery.loadmask.min.js
|
1571
1573
|
- public/javascripts/sencha_touch/sencha-touch-all-debug.js
|
1572
1574
|
- public/javascripts/sencha_touch/sencha-touch-all.js
|
1573
1575
|
- public/stylesheets/erp_app/desktop/base.css
|
@@ -2845,6 +2847,7 @@ files:
|
|
2845
2847
|
- public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_triggerfield.scss
|
2846
2848
|
- public/stylesheets/extjs/resources/themes/templates/resources/sass/config.rb
|
2847
2849
|
- public/stylesheets/extjs/resources/themes/templates/resources/sass/my-ext-theme.scss
|
2850
|
+
- public/stylesheets/jquery_plugins/jquery.loadmask.css
|
2848
2851
|
- public/stylesheets/sencha_touch/resources/css/android.css
|
2849
2852
|
- public/stylesheets/sencha_touch/resources/css/apple.css
|
2850
2853
|
- public/stylesheets/sencha_touch/resources/css/bb6.css
|