rhodes 3.3.2 → 3.3.3.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Manifest.txt +4 -0
- data/Rakefile +2 -2
- data/doc/device-caps.txt +2 -2
- data/doc/rhodes-api.txt +0 -3
- data/installer/rhostudio-moto.nsi +14 -48
- data/installer/rhostudio.nsi +12 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +167 -46
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +15 -15
- data/platform/android/build/android.rake +36 -24
- data/platform/iphone/Classes/MapView/GoogleGeocoder.h +2 -1
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +44 -6
- data/platform/iphone/Classes/MapView/MapViewController.m +10 -1
- data/platform/shared/common/ExtManager.cpp +103 -0
- data/platform/shared/common/ExtManager.h +101 -0
- data/platform/shared/common/RhodesApp.cpp +3 -2
- data/platform/shared/common/RhodesApp.h +3 -0
- data/platform/shared/common/map/GeocodingMapEngine.cpp +24 -1
- data/platform/shared/common/map/GeocodingMapEngine.h +3 -0
- data/platform/shared/logging/RhoLogConf.cpp +2 -1
- data/platform/shared/net/HttpServer.cpp +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +6 -0
- data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
- data/platform/wm/rhodes/DateTimePicker.cpp +38 -8
- data/platform/wm/rhodes/DateTimePicker.h +4 -0
- data/platform/wm/rhodes/LogOptionsDlg.cpp +16 -0
- data/platform/wm/rhodes/LogOptionsDlg.h +3 -2
- data/platform/wm/rhodes/LogView.cpp +21 -1
- data/platform/wm/rhodes/LogView.h +3 -1
- data/platform/wm/rhodes/MainWindow.cpp +1 -2
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +16 -2
- data/platform/wm/rhodes/MapView/MapViewManager.h +2 -0
- data/platform/wm/rhodes/Rhodes.cpp +2 -1
- data/platform/wm/rhodes/Rhodes.rc +7 -6
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +303 -147
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +22 -16
- data/platform/wm/rhoelements.sln +3 -3
- data/platform/wp7/RhoRubyLib/common/RhoFile.cs +16 -0
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +5 -5
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml +1 -1
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +36 -3
- data/rakefile.rb +2 -2
- data/res/generators/rhogen.rb +5 -0
- data/res/generators/templates/application/app/layout.erb +6 -2
- data/res/generators/templates/application/public/js/jquery-wp7-patch.js +149 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/Montana.sln +29 -7
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/Montana.vcproj +316 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/montana.vsprops +15 -0
- data/version +1 -1
- metadata +11 -5
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
#include "ext/rho/rhoruby.h"
|
4
4
|
#include "resource.h"
|
5
|
+
#include "common/ExtManager.h"
|
5
6
|
|
6
7
|
namespace rho {
|
7
8
|
|
8
9
|
class CRhoSignatureWindow;
|
9
|
-
class CRhoSignature
|
10
|
+
class CRhoSignature : public common::IRhoExtension
|
10
11
|
{
|
11
12
|
static CRhoSignatureWindow* m_pSigWindow;
|
12
13
|
public:
|
@@ -14,28 +15,30 @@ public:
|
|
14
15
|
|
15
16
|
class CParams
|
16
17
|
{
|
18
|
+
void readParams(rho_param* params);
|
17
19
|
public:
|
18
20
|
CParams(ESignature eType, rho_param* params)
|
19
21
|
{
|
20
|
-
|
22
|
+
readParams(params);
|
23
|
+
|
21
24
|
m_eType = eType;
|
22
25
|
}
|
23
|
-
|
24
|
-
{
|
25
|
-
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
int getPenColor();
|
31
|
-
int getBgColor();
|
32
|
-
int getPenWidth();
|
33
|
-
boolean hasBorder();
|
26
|
+
|
27
|
+
const String& getFilePath(){ return m_strFilePath; }
|
28
|
+
const String& getFileFormat(){ return m_strFileFormat; }
|
29
|
+
int getPenColor(){ return m_nPenColor; }
|
30
|
+
int getBgColor(){ return m_nBgColor; }
|
31
|
+
int getPenWidth(){ return m_nPenWidth; }
|
32
|
+
boolean hasBorder(){ return m_nBorder > 0; }
|
34
33
|
CRect getWndRect();
|
35
34
|
|
36
35
|
ESignature m_eType;
|
37
|
-
rho_param* m_params;
|
38
36
|
String m_strFilePath, m_strFileFormat;
|
37
|
+
int m_nPenColor, m_nBgColor, m_nBorder;
|
38
|
+
long m_nLeft, m_nTop, m_nWidth, m_nHeight, m_nPenWidth;
|
39
|
+
|
40
|
+
String m_strSendVectorJS;
|
41
|
+
boolean m_bSendVectors;
|
39
42
|
};
|
40
43
|
|
41
44
|
class CModalParams: public CParams
|
@@ -70,6 +73,10 @@ public:
|
|
70
73
|
static const char* getCaptureFile();
|
71
74
|
static void clearSignature(int );
|
72
75
|
static void hideSignature();
|
76
|
+
|
77
|
+
//IRhoExtension
|
78
|
+
virtual void onSetProperty(const wchar_t* pName, const wchar_t* pValue, const common::CRhoExtData& oExtData);
|
79
|
+
virtual void onBeforeNavigate(const common::CRhoExtData& oExtData);
|
73
80
|
};
|
74
81
|
|
75
82
|
class CRhoSignatureWindow : public CDialogImpl <CRhoSignatureWindow>
|
@@ -89,7 +96,6 @@ class CRhoSignatureWindow : public CDialogImpl <CRhoSignatureWindow>
|
|
89
96
|
CPoint m_ptLast;
|
90
97
|
bool m_bOutOfSignature, m_bCapture;
|
91
98
|
Vector<CSigPoint> m_vecPoints;
|
92
|
-
bool m_bDoVectors;
|
93
99
|
|
94
100
|
void addNewPoint(int x, int y, bool bNewLine);
|
95
101
|
void sendVectors();
|
@@ -102,7 +108,7 @@ class CRhoSignatureWindow : public CDialogImpl <CRhoSignatureWindow>
|
|
102
108
|
HRESULT saveBitmapToFileByImageFactory( HBITMAP hBitmap, LPCTSTR filename, LPCTSTR format);
|
103
109
|
void drawSignature( CDC& oDC, CRect& rcDraw );
|
104
110
|
public:
|
105
|
-
CRhoSignatureWindow(CRhoSignature::CParams* pParams) : m_pParams(pParams), m_hWndCommandBar(0),
|
111
|
+
CRhoSignatureWindow(CRhoSignature::CParams* pParams) : m_pParams(pParams), m_hWndCommandBar(0), m_bOutOfSignature(false), m_bCapture(false){}
|
106
112
|
~CRhoSignatureWindow(){ delete m_pParams; }
|
107
113
|
|
108
114
|
enum { IDD = IDD_TAKE_SIGNATURE };
|
data/platform/wm/rhoelements.sln
CHANGED
@@ -6,11 +6,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rhodes", "Rhodes\Rhodes.vcp
|
|
6
6
|
Release.AspNetCompiler.Debug = "False"
|
7
7
|
EndProjectSection
|
8
8
|
ProjectSection(ProjectDependencies) = postProject
|
9
|
+
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5} = {F196A418-11F1-4067-9F4F-BCC7D70E6EC5}
|
10
|
+
{B381B601-04B1-475B-B635-003F8E7DA3A9} = {B381B601-04B1-475B-B635-003F8E7DA3A9}
|
11
|
+
{6F57C60E-C083-4D46-A3B9-E17948A33518} = {6F57C60E-C083-4D46-A3B9-E17948A33518}
|
9
12
|
{AA77BEC0-2A60-4589-A784-7D78F60B35B6} = {AA77BEC0-2A60-4589-A784-7D78F60B35B6}
|
10
13
|
{D81234E0-D8D4-49C7-BDE5-4720C3898AE8} = {D81234E0-D8D4-49C7-BDE5-4720C3898AE8}
|
11
|
-
{6F57C60E-C083-4D46-A3B9-E17948A33518} = {6F57C60E-C083-4D46-A3B9-E17948A33518}
|
12
|
-
{B381B601-04B1-475B-B635-003F8E7DA3A9} = {B381B601-04B1-475B-B635-003F8E7DA3A9}
|
13
|
-
{F196A418-11F1-4067-9F4F-BCC7D70E6EC5} = {F196A418-11F1-4067-9F4F-BCC7D70E6EC5}
|
14
14
|
EndProjectSection
|
15
15
|
EndProject
|
16
16
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rubylib", "rubylib\rubylib.vcproj", "{AA77BEC0-2A60-4589-A784-7D78F60B35B6}"
|
@@ -298,6 +298,22 @@ namespace rho.common
|
|
298
298
|
return content;
|
299
299
|
}
|
300
300
|
|
301
|
+
public static String readFileToString(String path)
|
302
|
+
{
|
303
|
+
string content = "";
|
304
|
+
path = CFilePath.removeFirstSlash(path);
|
305
|
+
|
306
|
+
if (!isFileExist(path)) return content;
|
307
|
+
|
308
|
+
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
|
309
|
+
using (Stream st = isoStore.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.None))
|
310
|
+
using (System.IO.BinaryReader br = new BinaryReader(st))
|
311
|
+
{
|
312
|
+
content = new String(br.ReadChars((int)st.Length));
|
313
|
+
}
|
314
|
+
return content;
|
315
|
+
}
|
316
|
+
|
301
317
|
public static String readStringFromResourceFile(String path)
|
302
318
|
{
|
303
319
|
string content = "";
|
@@ -98,15 +98,15 @@ namespace rho.net
|
|
98
98
|
}
|
99
99
|
else
|
100
100
|
{
|
101
|
-
String res = CRhoFile.isResourceFileExist(strUrl) ? CRhoFile.readStringFromResourceFile(strUrl) : CRhoFile.
|
102
|
-
|
101
|
+
String res = CRhoFile.isResourceFileExist(strUrl) ? CRhoFile.readStringFromResourceFile(strUrl) : CRhoFile.readFileToString(strUrl);
|
102
|
+
|
103
103
|
String[] args = new String[4];
|
104
104
|
args[0] = m_strAjaxContext;
|
105
105
|
args[1] = res;
|
106
106
|
args[2] = "ok";
|
107
107
|
args[3] = "200";
|
108
108
|
|
109
|
-
RHODESAPP().processInvokeScriptArgs("
|
109
|
+
RHODESAPP().processInvokeScriptArgs("_rho_ajaxProxyCallback", args, RHODESAPP().getCurrentTab());
|
110
110
|
}
|
111
111
|
}
|
112
112
|
|
@@ -168,7 +168,7 @@ namespace rho.net
|
|
168
168
|
CRoute route = new CRoute();
|
169
169
|
if (dispatch(url, route))
|
170
170
|
{
|
171
|
-
addQueueCommand(new CServerCommand(this, route, bAjaxCall ? "
|
171
|
+
addQueueCommand(new CServerCommand(this, route, bAjaxCall ? "GET" : "GET", url, query, "", CServerCommand.scDispatch, strAjaxContext));
|
172
172
|
|
173
173
|
return true;
|
174
174
|
}
|
@@ -178,7 +178,7 @@ namespace rho.net
|
|
178
178
|
String strIndexFile = getIndex(fullPath);
|
179
179
|
if (strIndexFile.Length > 0)
|
180
180
|
{
|
181
|
-
addQueueCommand(new CServerCommand(this, route, bAjaxCall ? "
|
181
|
+
addQueueCommand(new CServerCommand(this, route, bAjaxCall ? "GET" : "GET", url, query, "", CServerCommand.scIndex, strAjaxContext));
|
182
182
|
|
183
183
|
return true;
|
184
184
|
}
|
@@ -11,6 +11,6 @@
|
|
11
11
|
d:DesignHeight="607" d:DesignWidth="480">
|
12
12
|
|
13
13
|
<Grid x:Name="LayoutRoot">
|
14
|
-
<phone:WebBrowser Grid.Row="1" HorizontalAlignment="Left" Name="webBrowser1" VerticalAlignment="Top" Height="607" Width="480" />
|
14
|
+
<phone:WebBrowser Grid.Row="1" HorizontalAlignment="Left" Name="webBrowser1" VerticalAlignment="Top" Height="607" Width="480" IsScriptEnabled="True" />
|
15
15
|
</Grid>
|
16
16
|
</UserControl>
|
@@ -48,6 +48,9 @@ namespace rho.views
|
|
48
48
|
private static RhoLogger LOG = RhoLogger.RHO_STRIP_LOG ? new RhoEmptyLogger() :
|
49
49
|
new RhoLogger("RhoView");
|
50
50
|
|
51
|
+
private static RhoLogger JSLOG = RhoLogger.RHO_STRIP_LOG ? new RhoEmptyLogger() :
|
52
|
+
new RhoLogger("JavaScript");
|
53
|
+
|
51
54
|
private Stack<Uri> m_backHistory = new Stack<Uri>();
|
52
55
|
private Stack<Uri> m_forwardHistory = new Stack<Uri>();
|
53
56
|
/// <summary>
|
@@ -63,7 +66,15 @@ namespace rho.views
|
|
63
66
|
private bool m_reload = false;
|
64
67
|
private bool m_loadFirstTime = true;
|
65
68
|
private bool m_masterView = false;
|
69
|
+
|
66
70
|
private const string AJAX_CONTEXT_PARAM = "_rho_callbackId";
|
71
|
+
private const string JS_NOTIFY_CONSOLE_LOG = "console.log:";
|
72
|
+
private const string JS_NOTIFY_CONSOLE_INFO = "console.info:";
|
73
|
+
private const string JS_NOTIFY_CONSOLE_WARNING = "console.warn:";
|
74
|
+
private const string JS_NOTIFY_CONSOLE_ERROR = "console.error:";
|
75
|
+
private const string JS_NOTIFY_REQUEST = "request:";
|
76
|
+
private const string REQUEST_URL_SCHEME = "x-wmapp1:";
|
77
|
+
|
67
78
|
//TO DO history. each time we have to save our current state of rhodesapp in rhoview entity
|
68
79
|
public Stack<Uri> BackHistory { set { m_backHistory = value; } }
|
69
80
|
public Stack<Uri> ForwardHistory { set { m_forwardHistory = value; } }
|
@@ -168,12 +179,34 @@ namespace rho.views
|
|
168
179
|
|
169
180
|
private void WebBrowser_OnScriptNotify(object sender, NotifyEventArgs e)
|
170
181
|
{
|
171
|
-
string
|
172
|
-
|
182
|
+
string request = e.Value;
|
183
|
+
|
184
|
+
if (request.startsWith(JS_NOTIFY_CONSOLE_LOG))
|
185
|
+
{
|
186
|
+
JSLOG.INFO(request.substring(JS_NOTIFY_CONSOLE_LOG.length()).trim());
|
187
|
+
}
|
188
|
+
else if (request.startsWith(JS_NOTIFY_CONSOLE_INFO))
|
189
|
+
{
|
190
|
+
JSLOG.INFO(request.substring(JS_NOTIFY_CONSOLE_INFO.length()).trim());
|
191
|
+
}
|
192
|
+
else if (request.startsWith(JS_NOTIFY_CONSOLE_WARNING))
|
193
|
+
{
|
194
|
+
JSLOG.WARNING(request.substring(JS_NOTIFY_CONSOLE_WARNING.length()).trim());
|
195
|
+
}
|
196
|
+
else if (request.startsWith(JS_NOTIFY_CONSOLE_ERROR))
|
173
197
|
{
|
174
|
-
|
198
|
+
JSLOG.ERROR(request.substring(JS_NOTIFY_CONSOLE_ERROR.length()).trim());
|
175
199
|
}
|
200
|
+
else if (request.startsWith(JS_NOTIFY_REQUEST))
|
201
|
+
{
|
202
|
+
string req = request.substring(JS_NOTIFY_REQUEST.length()).trim();
|
176
203
|
|
204
|
+
string ajaxContext = extractAjaxContext(req);
|
205
|
+
if (!RHODESAPP().HttpServer.processBrowserRequest(new Uri(req.substring(REQUEST_URL_SCHEME.length()), UriKind.Relative), ajaxContext))
|
206
|
+
{
|
207
|
+
LOG.ERROR("External requests should be filtered in javascript");
|
208
|
+
}
|
209
|
+
}
|
177
210
|
}
|
178
211
|
|
179
212
|
public void refresh()
|
data/rakefile.rb
CHANGED
@@ -274,8 +274,8 @@ namespace "config" do
|
|
274
274
|
$app_config["capabilities"] += ["barcode"] if $app_config["extensions"].index("barcode-moto")
|
275
275
|
end
|
276
276
|
|
277
|
-
puts "$app_config['extensions'] : #{$app_config['extensions']}"
|
278
|
-
puts "$app_config['capabilities'] : #{$app_config['capabilities']}"
|
277
|
+
puts "$app_config['extensions'] : #{$app_config['extensions'].inspect}"
|
278
|
+
puts "$app_config['capabilities'] : #{$app_config['capabilities'].inspect}"
|
279
279
|
|
280
280
|
$hidden_app = $app_config["hidden_app"].nil?() ? "0" : $app_config["hidden_app"]
|
281
281
|
|
data/res/generators/rhogen.rb
CHANGED
@@ -398,6 +398,11 @@ module Rhogen
|
|
398
398
|
template.destination = "extensions/#{name.downcase}/ext/#{name.downcase}/platform/wm/#{name.camel_case}.vcproj"
|
399
399
|
end
|
400
400
|
|
401
|
+
template :extension_wm_vcproject do |template|
|
402
|
+
template.source = 'extensions/montana/ext/montana/platform/wm/Montana.vsprops'
|
403
|
+
template.destination = "extensions/#{name.downcase}/ext/#{name.downcase}/platform/wm/#{name.camel_case}.vsprops"
|
404
|
+
end
|
405
|
+
|
401
406
|
template :extension_wm_h do |template|
|
402
407
|
template.source = 'extensions/montana/ext/montana/platform/wm/src/montana_wm.h'
|
403
408
|
template.destination = "extensions/#{name.downcase}/ext/#{name.downcase}/platform/wm/src/#{name.downcase}_wm.h"
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
19
19
|
<%% end %>
|
20
20
|
|
21
|
-
<%% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' || is_bb6 || System::get_property('webview_framework') =~ /^WEBKIT/ %>
|
21
|
+
<%% if System::get_property('platform') == 'APPLE' || System::get_property('platform') == 'ANDROID' || System::get_property('platform') == 'WP7' || is_bb6 || System::get_property('webview_framework') =~ /^WEBKIT/ %>
|
22
22
|
<script src="/public/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
|
23
23
|
|
24
24
|
<link rel="stylesheet" href="/public/jqmobile/jquery.mobile-1.0.min.css">
|
@@ -48,6 +48,9 @@
|
|
48
48
|
$.mobile.loadingMessageDelay = 300; // in ms
|
49
49
|
});
|
50
50
|
</script>
|
51
|
+
<%% if System::get_property('platform') == 'WP7'%>
|
52
|
+
<script type="text/javascript" charset="utf-8" src="/public/js/jquery-wp7-patch.js"></script>
|
53
|
+
<%% end %>
|
51
54
|
<script type="text/javascript" charset="utf-8" src="/public/jqmobile/jquery.mobile-1.0.min.js"></script>
|
52
55
|
<script type="text/javascript" charset="utf-8" src="/public/js/jqmobile-patch.js"></script>
|
53
56
|
|
@@ -62,7 +65,7 @@
|
|
62
65
|
<%% elsif System::get_property('platform') == 'Blackberry' %>
|
63
66
|
<link href="/public/css/blackberry.css" type="text/css" rel="stylesheet"/>
|
64
67
|
<%% elsif System::get_property('platform') == 'WP7' %>
|
65
|
-
<link href="/public/css/
|
68
|
+
<link href="/public/css/iphone.css" type="text/css" rel="stylesheet"/>
|
66
69
|
<script src="/public/js/wp7.js" type="text/javascript"></script>
|
67
70
|
<%% elsif System::get_property('webview_framework') =~ /^WEBKIT/ %>
|
68
71
|
<link href="/public/css/android.css" type="text/css" rel="stylesheet"/>
|
@@ -77,6 +80,7 @@
|
|
77
80
|
<%% elsif System::get_property('platform') == 'WP7' %>
|
78
81
|
onload="wp7_change_forms_action_to_get()"
|
79
82
|
<%% end %>
|
83
|
+
data-platform="<%%= System::get_property('platform') %>"
|
80
84
|
>
|
81
85
|
<%%= @content %>
|
82
86
|
</body>
|
@@ -0,0 +1,149 @@
|
|
1
|
+
(function($){
|
2
|
+
|
3
|
+
var _rho_deferred_paramName = "_rho_deferred";
|
4
|
+
var _rho_callbackId_paramName = "_rho_callbackId";
|
5
|
+
var _rho_callbackId_valuePrefix = "_rhoId#";
|
6
|
+
|
7
|
+
// console function proxies ============================================
|
8
|
+
if ("object" != typeof console) console = {};
|
9
|
+
|
10
|
+
if ("function" != typeof console.log) console.log = function(msg) {
|
11
|
+
window.external.notify('console.log: ' +msg);
|
12
|
+
};
|
13
|
+
|
14
|
+
if ("function" != typeof console.info) console.info = console.log;
|
15
|
+
|
16
|
+
if ("function" != typeof console.warn) console.warn = function(msg) {
|
17
|
+
window.external.notify('console.warn: ' +msg);
|
18
|
+
};
|
19
|
+
|
20
|
+
if ("function" != typeof console.error) console.error = function(msg) {
|
21
|
+
window.external.notify('console.error: ' +msg);
|
22
|
+
};
|
23
|
+
|
24
|
+
if ("function" != typeof window.alert && "object" != typeof window.alert) window.alert = function(msg) {
|
25
|
+
window.external.notify('alert: ' +msg);
|
26
|
+
};
|
27
|
+
// =====================================================================
|
28
|
+
|
29
|
+
// do nothing if jQuery is undefined
|
30
|
+
if (!$) {
|
31
|
+
console.error('jQuery is undefined');
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
|
35
|
+
var callbackCount = 0;
|
36
|
+
var pendingCallbacks = {};
|
37
|
+
|
38
|
+
function normalizeAjaxOptions(urlOrOptions, options) {
|
39
|
+
if ('string' == typeof urlOrOptions && 'object' == typeof options) {
|
40
|
+
return $.extend({}, {url: urlOrOptions}, options);
|
41
|
+
} else if ('object' == typeof urlOrOptions) {
|
42
|
+
return urlOrOptions;
|
43
|
+
}
|
44
|
+
return {};
|
45
|
+
}
|
46
|
+
|
47
|
+
var _ajax = $.ajax;
|
48
|
+
|
49
|
+
function wp7ajax() {
|
50
|
+
//console.log('in wp7ajax');
|
51
|
+
//console.log('window.location: ' +window.location);
|
52
|
+
// there may be ajax(options) or ajax(url, options) form of call
|
53
|
+
var options = normalizeAjaxOptions.apply(this, arguments);
|
54
|
+
//console.log('options has been normalized, options.url == "' +options.url +'"');
|
55
|
+
|
56
|
+
// if we have URL in request options and it is a local URL
|
57
|
+
if (options.url.match(/^https?:\/\/(127\.0\.0\.1|localhost)/) ||
|
58
|
+
options.url.match(/^x-wmapp1:/)) {
|
59
|
+
//console.log('it is a local app URL');
|
60
|
+
// then call proxy
|
61
|
+
return wp7notifyProxy.apply(this, [options]);
|
62
|
+
}
|
63
|
+
// else, let default AJAX function to handle it
|
64
|
+
return _ajax.apply(this, arguments);
|
65
|
+
}
|
66
|
+
|
67
|
+
$.ajax = wp7ajax;
|
68
|
+
|
69
|
+
function wp7notifyProxy(options) {
|
70
|
+
//console.log('in wp7notifyProxy');
|
71
|
+
/*
|
72
|
+
* IMPORTANT NOTE! ===========================================
|
73
|
+
* At the moment this implementation doesn't support anything
|
74
|
+
* besides GET request. No headers, cookies, response status
|
75
|
+
* codes, etc. Just request parameters and response content.
|
76
|
+
* ===========================================================
|
77
|
+
*/
|
78
|
+
|
79
|
+
//console.log('options.url: ' + options.url);
|
80
|
+
//console.log('typeof options.data: ' + typeof options.data);
|
81
|
+
//if ("string" == typeof options.data) console.log('options.data: ' + options.data);
|
82
|
+
|
83
|
+
var urlQueryParams = "";
|
84
|
+
// set next call id value
|
85
|
+
var cbIdValue = encodeURIComponent(_rho_callbackId_valuePrefix + callbackCount++);
|
86
|
+
|
87
|
+
if ("string" == typeof options.data) {
|
88
|
+
urlQueryParams = options.data;
|
89
|
+
}
|
90
|
+
if ("object" != typeof options.data) {
|
91
|
+
options.data = {};
|
92
|
+
}
|
93
|
+
|
94
|
+
// set callback id param value
|
95
|
+
options.data[_rho_callbackId_paramName] = cbIdValue;
|
96
|
+
// set deferred object to resolve/reject late
|
97
|
+
options[_rho_deferred_paramName] = $.Deferred();
|
98
|
+
// store options for pending callback
|
99
|
+
pendingCallbacks[options.data[_rho_callbackId_paramName]] = options;
|
100
|
+
|
101
|
+
// compose GET request formatted URI
|
102
|
+
$.each(options.data, function(name, value){
|
103
|
+
urlQueryParams += ((0 < urlQueryParams.length ? "&" : "")
|
104
|
+
+encodeURIComponent(name) +'=' +encodeURIComponent(value));
|
105
|
+
});
|
106
|
+
|
107
|
+
//console.log('wp7notifyProxy: urlQueryParams: ' +urlQueryParams);
|
108
|
+
window.external.notify('request:' +options.url +"?" +urlQueryParams);
|
109
|
+
return options[_rho_deferred_paramName];
|
110
|
+
}
|
111
|
+
|
112
|
+
function fireHandlers(options, result, status, errCode) {
|
113
|
+
// TODO: fake jqXHR needs to be provided
|
114
|
+
var jqXHR = null;
|
115
|
+
|
116
|
+
if ("error" == status) {
|
117
|
+
if ('function' == typeof options.error) {
|
118
|
+
// start handler asynchronously
|
119
|
+
setTimeout(function(){
|
120
|
+
options.error.apply(this, [jqXHR, status, result]);
|
121
|
+
}, 1);
|
122
|
+
}
|
123
|
+
if ('object' == typeof options[_rho_deferred_paramName]) {
|
124
|
+
options[_rho_deferred_paramName].resolve([jqXHR, status, result]);
|
125
|
+
}
|
126
|
+
} else {
|
127
|
+
if ('function' == typeof options.success) {
|
128
|
+
// start handler asynchronously
|
129
|
+
setTimeout(function(){
|
130
|
+
options.success.apply(this, [result, status, jqXHR]);
|
131
|
+
}, 1);
|
132
|
+
}
|
133
|
+
if ('object' == typeof options[_rho_deferred_paramName]) {
|
134
|
+
options[_rho_deferred_paramName].resolve([result, status, jqXHR]);
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
window._rho_ajaxProxyCallback = function(callbackId, result, status, errCode) {
|
140
|
+
var cbId = decodeURIComponent(callbackId);
|
141
|
+
//console.log('_rho_ajaxProxyCallback: callback for: ' +cbId);
|
142
|
+
if (pendingCallbacks[cbId]) {
|
143
|
+
fireHandlers(pendingCallbacks[cbId], result, status, errCode);
|
144
|
+
delete pendingCallbacks[cbId];
|
145
|
+
}
|
146
|
+
};
|
147
|
+
|
148
|
+
|
149
|
+
})(jQuery);
|
data/res/generators/templates/extension/extensions/montana/ext/montana/platform/wm/Montana.sln
CHANGED
@@ -1,20 +1,42 @@
|
|
1
1
|
|
2
2
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
3
3
|
# Visual Studio 2005
|
4
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "<%= name.camel_case() %>", "<%= name.camel_case() + ".vcproj" %>", "{
|
4
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "<%= name.camel_case() %>", "<%= name.camel_case() + ".vcproj" %>", "{93453E28-E84A-40C4-BD6A-51A8373D7044}"
|
5
5
|
EndProject
|
6
6
|
Global
|
7
7
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8
|
+
Debug|MC3000c50b (ARMV4I) = Debug|MC3000c50b (ARMV4I)
|
8
9
|
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
|
10
|
+
Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I) = Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
11
|
+
Debug|Win32 = Debug|Win32
|
12
|
+
Release|MC3000c50b (ARMV4I) = Release|MC3000c50b (ARMV4I)
|
9
13
|
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
|
14
|
+
Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I) = Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
15
|
+
Release|Win32 = Release|Win32
|
10
16
|
EndGlobalSection
|
11
17
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
12
|
-
{
|
13
|
-
{
|
14
|
-
{
|
15
|
-
{
|
16
|
-
{
|
17
|
-
{
|
18
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|MC3000c50b (ARMV4I).ActiveCfg = Debug|MC3000c50b (ARMV4I)
|
19
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|MC3000c50b (ARMV4I).Build.0 = Debug|MC3000c50b (ARMV4I)
|
20
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|MC3000c50b (ARMV4I).Deploy.0 = Debug|MC3000c50b (ARMV4I)
|
21
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
|
22
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
|
23
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
|
24
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
25
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I).Build.0 = Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
26
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
27
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Win32.ActiveCfg = Debug|Win32
|
28
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Debug|Win32.Build.0 = Debug|Win32
|
29
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|MC3000c50b (ARMV4I).ActiveCfg = Release|MC3000c50b (ARMV4I)
|
30
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|MC3000c50b (ARMV4I).Build.0 = Release|MC3000c50b (ARMV4I)
|
31
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|MC3000c50b (ARMV4I).Deploy.0 = Release|MC3000c50b (ARMV4I)
|
32
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
|
33
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
|
34
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
|
35
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I).ActiveCfg = Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
36
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I).Build.0 = Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
37
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I).Deploy.0 = Release|Windows Mobile 6.5.3 Professional DTK (ARMV4I)
|
38
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Win32.ActiveCfg = Release|Win32
|
39
|
+
{93453E28-E84A-40C4-BD6A-51A8373D7044}.Release|Win32.Build.0 = Release|Win32
|
18
40
|
EndGlobalSection
|
19
41
|
GlobalSection(SolutionProperties) = preSolution
|
20
42
|
HideSolutionNode = FALSE
|