rhodes 3.3.3.beta.3 → 3.3.3.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Manifest.txt +16 -1
  2. data/Rakefile +77 -28
  3. data/doc/build.txt +5 -3
  4. data/doc/configuration.txt +13 -0
  5. data/doc/device-caps.txt +46 -27
  6. data/doc/rhom.txt +2 -2
  7. data/doc/test-log-debug.txt +6 -0
  8. data/doc/ui.txt +13 -0
  9. data/lib/build/jake.rb +11 -11
  10. data/lib/extensions/crypt/crypt/cbc.rb +5 -2
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
  12. data/lib/framework/rho/render.rb +17 -4
  13. data/lib/framework/rho/rho.rb +1 -1
  14. data/lib/framework/rho/rhocontroller.rb +11 -1
  15. data/lib/framework/rhomotoapi.rb +110 -0
  16. data/platform/android/Rhodes/jni/Android.mk +2 -5
  17. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  18. data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
  19. data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
  23. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
  24. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
  25. data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
  26. data/platform/android/Rhodes/rhobundle.xml +1 -1
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
  44. data/platform/android/build/RhodesSRC_build.files +2 -1
  45. data/platform/android/build/android.rake +48 -17
  46. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
  47. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
  48. data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
  49. data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
  50. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  51. data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
  52. data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
  53. data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
  54. data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
  55. data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
  56. data/platform/iphone/Classes/RhoMainView.h +2 -0
  57. data/platform/iphone/Classes/Rhodes.m +11 -5
  58. data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
  59. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
  60. data/platform/iphone/Classes/SimpleMainView.m +3 -0
  61. data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
  62. data/platform/iphone/Classes/TabbedMainView.m +30 -11
  63. data/platform/iphone/rbuild/iphone.rake +7 -1
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
  65. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  66. data/platform/shared/common/BundleManager.cpp +42 -2
  67. data/platform/shared/common/ExtManager.h +7 -0
  68. data/platform/shared/common/RhoFile.cpp +170 -2
  69. data/platform/shared/common/RhoFile.h +4 -0
  70. data/platform/shared/common/RhodesApp.cpp +30 -0
  71. data/platform/shared/common/RhodesApp.h +1 -0
  72. data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
  73. data/platform/shared/common/map/OSMMapEngine.h +3 -0
  74. data/platform/shared/logging/RhoLogConf.cpp +8 -9
  75. data/platform/shared/logging/RhoLogConf.h +5 -7
  76. data/platform/shared/logging/RhoLogSink.cpp +3 -3
  77. data/platform/shared/logging/RhoLogSink.h +1 -1
  78. data/platform/shared/net/HttpServer.cpp +17 -9
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  81. data/platform/shared/ruby/ext/webview/webview.i +9 -4
  82. data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
  83. data/platform/shared/test/Tests.cpp +2 -2
  84. data/platform/wm/build/build_inf.js +75 -47
  85. data/platform/wm/build/wm.rake +50 -53
  86. data/platform/wm/rhodes/Rhodes.cpp +40 -97
  87. data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
  88. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
  89. data/platform/wm/tools/detool/detool.cpp +103 -52
  90. data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
  91. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  92. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
  93. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
  94. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
  95. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
  96. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
  97. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
  98. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
  99. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
  100. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
  101. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
  102. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
  103. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
  106. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
  107. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
  108. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -0
  110. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
  111. data/platform/wp7/rhodes/Rhodes.csproj +5 -1
  112. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
  113. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
  114. data/rakefile.rb +77 -28
  115. data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
  116. data/res/build-tools/YUICompressorLicense.txt +54 -0
  117. data/res/build-tools/detool.exe +0 -0
  118. data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
  119. data/res/generators/templates/application/app/layout.erb +1 -0
  120. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
  121. data/res/generators/templates/application/public/js/syncengine.js +147 -0
  122. data/spec/phone_spec/app/Data/septest.json +1 -1
  123. data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
  124. data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
  125. data/spec/phone_spec/app/spec/date_spec.rb +6 -6
  126. data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
  127. data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
  128. data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
  129. data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
  130. data/spec/phone_spec/app/spec_runner.rb +9 -10
  131. data/version +1 -1
  132. metadata +20 -5
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -151,6 +151,7 @@ namespace Rhodes
151
151
  // Create the frame but don't set it as RootVisual yet; this allows the splash
152
152
  // screen to remain active until the application is ready to render.
153
153
  RootFrame = new PhoneApplicationFrame();
154
+ //RootFrame = new TransitionFrame();
154
155
  RootFrame.Navigated += CompleteInitializePhoneApplication;
155
156
 
156
157
  // Handle navigation failures
@@ -1,27 +1,27 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.0">
3
- <App xmlns="" ProductID="{1aa73f88-4d47-4f94-acdd-ab9301d45a2a}" Title="Rhodes" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="Rhodes author" Description="Sample description" Publisher="Rhodes">
4
- <IconPath IsRelative="true" IsResource="false">icon.png</IconPath>
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <Deployment AppPlatformVersion='7.1' xmlns='http://schemas.microsoft.com/windowsphone/2009/deployment'>
3
+ <App Author='Rhodes author' Description='Sample description' Genre='apps.normal' ProductID='{1aa73f88-4d47-4f94-acdd-ab9301d45a2a}' Publisher='Rhodes' RuntimeType='Silverlight' Title='InSite Mobile' Version='1.0.0.0' xmlns=''>
4
+ <IconPath IsRelative='true' IsResource='false'>icon.png</IconPath>
5
5
  <Capabilities>
6
- <Capability Name="ID_CAP_GAMERSERVICES" />
7
- <Capability Name="ID_CAP_IDENTITY_DEVICE" />
8
- <Capability Name="ID_CAP_IDENTITY_USER" />
9
- <Capability Name="ID_CAP_LOCATION" />
10
- <Capability Name="ID_CAP_MEDIALIB" />
11
- <Capability Name="ID_CAP_MICROPHONE" />
12
- <Capability Name="ID_CAP_NETWORKING" />
13
- <Capability Name="ID_CAP_PHONEDIALER" />
14
- <Capability Name="ID_CAP_PUSH_NOTIFICATION" />
15
- <Capability Name="ID_CAP_SENSORS" />
16
- <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
6
+ <Capability Name='ID_CAP_GAMERSERVICES'/>
7
+ <Capability Name='ID_CAP_IDENTITY_DEVICE'/>
8
+ <Capability Name='ID_CAP_IDENTITY_USER'/>
9
+ <Capability Name='ID_CAP_LOCATION'/>
10
+ <Capability Name='ID_CAP_MEDIALIB'/>
11
+ <Capability Name='ID_CAP_MICROPHONE'/>
12
+ <Capability Name='ID_CAP_NETWORKING'/>
13
+ <Capability Name='ID_CAP_PHONEDIALER'/>
14
+ <Capability Name='ID_CAP_PUSH_NOTIFICATION'/>
15
+ <Capability Name='ID_CAP_SENSORS'/>
16
+ <Capability Name='ID_CAP_WEBBROWSERCOMPONENT'/>
17
17
  </Capabilities>
18
18
  <Tasks>
19
- <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
19
+ <DefaultTask Name='_default' NavigationPage='MainPage.xaml'/>
20
20
  </Tasks>
21
21
  <Tokens>
22
- <PrimaryToken TokenID="RhodesToken" TaskName="_default">
22
+ <PrimaryToken TaskName='_default' TokenID='RhodesToken'>
23
23
  <TemplateType5>
24
- <BackgroundImageURI IsRelative="true" IsResource="false">Background.png</BackgroundImageURI>
24
+ <BackgroundImageURI IsRelative='true' IsResource='false'>Background.png</BackgroundImageURI>
25
25
  <Count>0</Count>
26
26
  <Title>Rhodes</Title>
27
27
  </TemplateType5>
@@ -13,7 +13,7 @@
13
13
  <AssemblyName>Rhodes</AssemblyName>
14
14
  <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
15
15
  <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
16
- <TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile>
16
+ <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
17
17
  <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
18
18
  <SilverlightApplication>true</SilverlightApplication>
19
19
  <SupportedCultures>
@@ -59,6 +59,7 @@
59
59
  <HintPath>..\ironruby\bin\Silverlight3$(Configuration)\IronRuby.Libraries.dll</HintPath>
60
60
  </Reference>
61
61
  <Reference Include="Microsoft.Phone" />
62
+ <Reference Include="Microsoft.Phone.Controls.Toolkit, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b772ad94eb9ca604, processorArchitecture=MSIL" />
62
63
  <Reference Include="Microsoft.Phone.Interop" />
63
64
  <Reference Include="System.Core" />
64
65
  <Reference Include="System.Windows" />
@@ -102,6 +103,8 @@
102
103
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
103
104
  </Content>
104
105
  <Content Include="SplashScreenImage.jpg" />
106
+ <Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
107
+ <Content Include="Toolkit.Content\ApplicationBar.Check.png" />
105
108
  </ItemGroup>
106
109
  <ItemGroup>
107
110
  <ProjectReference Include="..\RhoRubyLib\RhoRubyLib.csproj">
@@ -109,6 +112,7 @@
109
112
  <Name>RhoRubyLib</Name>
110
113
  </ProjectReference>
111
114
  </ItemGroup>
115
+ <ItemGroup />
112
116
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
113
117
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
114
118
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
data/rakefile.rb CHANGED
@@ -150,8 +150,6 @@ def make_application_build_capabilities_header_file
150
150
  Jake.modify_file_if_content_changed(File.join($startdir, "platform", "shared", "common", "app_build_capabilities.h"), f)
151
151
  end
152
152
 
153
-
154
-
155
153
  def make_application_build_config_java_file
156
154
 
157
155
  f = StringIO.new("", "w+")
@@ -265,15 +263,12 @@ namespace "config" do
265
263
 
266
264
  application_build_configs = {}
267
265
 
268
- #Process motorola extensions
269
- if capabilities.index("motorola")
270
- $app_config["capabilities"] += ["webkit_browser"] if $app_config["extensions"].index("webkit-browser")
271
- $app_config["extensions"] += ["rhoelements"]
272
-
273
- idx_barcode = $app_config["extensions"].index("barcode")
274
- $app_config["extensions"][idx_barcode] = "barcode-moto" if idx_barcode
275
-
276
- $app_config["capabilities"] += ["barcode"] if $app_config["extensions"].index("barcode-moto")
266
+ #Process rhoelements settings
267
+ if $app_config["app_type"] == 'rhoelements'
268
+ $app_config["capabilities"] += ["motorola"] unless $app_config["capabilities"].index("motorola")
269
+ $app_config["extensions"] += ["rhoelementsext"] if $current_platform == 'wm'
270
+ $app_config["extensions"] += ["motoapi"] #extension with plug-ins
271
+ $app_config["extensions"] += ['webkit-browser'] unless $app_config["extensions"].index("webkit-browser")
277
272
 
278
273
  #check for RE2 plugins
279
274
  plugins = ""
@@ -284,7 +279,20 @@ namespace "config" do
284
279
  end
285
280
  end
286
281
 
282
+ if plugins.length() == 0
283
+ plugins = "ALL"
284
+ end
285
+
287
286
  application_build_configs['moto-plugins'] = plugins if plugins.length() > 0
287
+
288
+ end
289
+
290
+ if $app_config["capabilities"].index("motorola")
291
+ if $app_config["extensions"].index("webkit-browser")
292
+ $app_config["capabilities"] += ["webkit_browser"]
293
+ $app_config["extensions"].delete("webkit-browser")
294
+ end
295
+ $app_config["extensions"] += ["rhoelements"]
288
296
  end
289
297
 
290
298
  puts "$app_config['extensions'] : #{$app_config['extensions'].inspect}"
@@ -318,6 +326,10 @@ namespace "config" do
318
326
  $rhologhostport = 52363 unless $rhologhostport
319
327
  $rhologhostaddr = Jake.localip()
320
328
 
329
+ $obfuscate_js = (($app_config["obfuscate"].nil? || $app_config["obfuscate"]["js"].nil?) ? nil : 1 )
330
+ $obfuscate_css = (($app_config["obfuscate"].nil? || $app_config["obfuscate"]["css"].nil?) ? nil : 1 )
331
+ $obfuscate_exclude = ($app_config["obfuscate"].nil? ? nil : $app_config["obfuscate"]["exclude_dirs"] )
332
+ $obfuscator = 'res/build-tools/yuicompressor-2.4.7.jar'
321
333
  end
322
334
 
323
335
  task :qt do
@@ -401,6 +413,8 @@ def set_linker_flags
401
413
  end
402
414
 
403
415
  def add_extension(path,dest)
416
+ puts 'add_extension - ' + path.to_s + " - " + dest.to_s
417
+
404
418
  start = pwd
405
419
  chdir path if File.directory?(path)
406
420
 
@@ -417,6 +431,8 @@ def init_extensions(startdir, dest)
417
431
 
418
432
  puts 'init extensions'
419
433
  $app_config["extensions"].each do |extname|
434
+ puts 'ext - ' + extname
435
+
420
436
  extpath = nil
421
437
  extpaths.each do |p|
422
438
  ep = File.join(p, extname)
@@ -425,19 +441,24 @@ def init_extensions(startdir, dest)
425
441
  break
426
442
  end
427
443
  end
444
+
445
+ puts '1'
428
446
 
429
447
  if extpath.nil?
430
448
  begin
431
449
  $rhodes_extensions = nil
432
450
  require extname
433
- extpath = $rhodes_extensions[0] unless $rhodes_extensions.nil?
434
- $app_config["extpaths"] << extpath
451
+ puts '1-2'
452
+ if $rhodes_extensions
453
+ extpath = $rhodes_extensions[0]
454
+ $app_config["extpaths"] << extpath
455
+ end
435
456
  rescue Exception => e
436
457
  puts "exception"
437
458
  end
438
459
  end
439
-
440
- unless extpath.nil?
460
+
461
+ unless extpath.nil?
441
462
  add_extension(extpath, dest) unless dest.nil?
442
463
 
443
464
  if $config["platform"] != "bb"
@@ -469,8 +490,10 @@ def init_extensions(startdir, dest)
469
490
  extlibs += libs
470
491
  end
471
492
  end
472
- end
493
+ end
494
+
473
495
  end
496
+
474
497
  end
475
498
 
476
499
  exts = File.join($startdir, "platform", "shared", "ruby", "ext", "rho", "extensions.c")
@@ -519,6 +542,8 @@ def init_extensions(startdir, dest)
519
542
  nativelib.each { |lib| add_linker_library(lib) }
520
543
 
521
544
  set_linker_flags
545
+
546
+ #exit
522
547
  end
523
548
 
524
549
  unless $app_config["constants"].nil?
@@ -539,6 +564,28 @@ def init_extensions(startdir, dest)
539
564
 
540
565
  end
541
566
 
567
+ def public_folder_cp_r(src_dir,dst_dir,level,obfuscate)
568
+ mkdir_p dst_dir if not File.exists? dst_dir
569
+ Dir.foreach(src_dir) do |filename|
570
+ next if filename.eql?('.') || filename.eql?('..')
571
+ filepath = src_dir + '/' + filename
572
+ dst_path = dst_dir + '/' + filename
573
+ if File.directory?(filepath)
574
+ public_folder_cp_r(filepath,dst_path,(level+1),((obfuscate==1) && ((level>0) || $obfuscate_exclude.nil? || !$obfuscate_exclude.include?(filename)) ? 1 : 0))
575
+ else
576
+ if (obfuscate==1) && (((!$obfuscate_js.nil?) && File.extname(filename).eql?(".js")) || ((!$obfuscate_css.nil?) && File.extname(filename).eql?(".css")))
577
+ puts Jake.run('java',['-jar', $obfuscator, filepath, '-o', dst_path])
578
+ unless $? == 0
579
+ puts "Obfuscation error"
580
+ exit 1
581
+ end
582
+ else
583
+ cp filepath, dst_path, :preserve => true
584
+ end
585
+ end
586
+ end
587
+ end
588
+
542
589
  def common_bundle_start(startdir, dest)
543
590
  puts "common_bundle_start"
544
591
 
@@ -569,8 +616,14 @@ def common_bundle_start(startdir, dest)
569
616
  chdir startdir
570
617
  #throw "ME"
571
618
  cp_r app + '/app',File.join($srcdir,'apps'), :preserve => true
572
- cp_r app + '/public', File.join($srcdir,'apps'), :preserve => true if File.exists? app + '/public'
573
- cp app + '/rhoconfig.txt', File.join($srcdir,'apps'), :preserve => true
619
+ if File.exists? app + '/public'
620
+ if $obfuscate_js.nil? && $obfuscate_css.nil?
621
+ cp_r app + '/public', File.join($srcdir,'apps'), :preserve => true
622
+ else
623
+ public_folder_cp_r app + '/public', File.join($srcdir,'apps/public'), 0, 1
624
+ end
625
+ end
626
+ cp app + '/rhoconfig.txt', File.join($srcdir,'apps'), :preserve => true
574
627
 
575
628
  app_version = "\r\napp_version='#{$app_config["version"]}'"
576
629
  File.open(File.join($srcdir,'apps/rhoconfig.txt'), "a"){ |f| f.write(app_version) }
@@ -601,7 +654,7 @@ def common_bundle_start(startdir, dest)
601
654
  end
602
655
 
603
656
  Dir.glob("**/*.wm.*").each { |f| rm f }
604
- Dir.glob("**/*.wp7.*").each { |f| rm f }
657
+ Dir.glob("**/*.wp7.*").each { |f| rm f }
605
658
  Dir.glob("**/*.iphone.*").each { |f| rm f }
606
659
  Dir.glob("**/*.bb.*").each { |f| rm f }
607
660
  Dir.glob("**/*.bb6.*").each { |f| rm f }
@@ -637,11 +690,11 @@ def process_exclude_folders
637
690
  excl << $config["excludedirs"][exclude_platform] if $config["excludedirs"][exclude_platform]
638
691
  end
639
692
 
640
- if excl
641
- chdir File.join($srcdir, 'apps')
693
+ if excl.size() > 0
694
+ chdir File.join($srcdir)#, 'apps')
642
695
 
643
696
  excl.each do |mask|
644
- Dir.glob(mask).each {|f| rm_rf f}
697
+ Dir.glob(mask).each {|f| puts "f: #{f}"; rm_rf f}
645
698
  end
646
699
  end
647
700
 
@@ -824,21 +877,17 @@ namespace "build" do
824
877
  sh %{zip -r upgrade_bundle.zip .}
825
878
  end
826
879
 
827
-
828
880
  cp new_zip_file, $bindir
829
881
 
830
882
  rm new_zip_file
831
883
 
832
-
833
-
834
884
  end
835
885
 
836
-
837
-
886
+
838
887
  task :noiseq do
839
888
  app = $app_path
840
889
  rhodeslib = File.dirname(__FILE__) + "/lib/framework"
841
- compileERB = "lib/build/compileERB/bb.rb"
890
+ compileERB = "lib/build/compileERB/bb.rb"
842
891
  startdir = pwd
843
892
  dest = $srcdir + "/lib"
844
893
 
@@ -0,0 +1,54 @@
1
+ YUI Compressor Copyright License Agreement (BSD License)
2
+
3
+ Copyright (c) 2011, Yahoo! Inc.
4
+ All rights reserved.
5
+
6
+ Redistribution and use of this software in source and binary forms,
7
+ with or without modification, are permitted provided that the following
8
+ conditions are met:
9
+
10
+ * Redistributions of source code must retain the above
11
+ copyright notice, this list of conditions and the
12
+ following disclaimer.
13
+
14
+ * Redistributions in binary form must reproduce the above
15
+ copyright notice, this list of conditions and the
16
+ following disclaimer in the documentation and/or other
17
+ materials provided with the distribution.
18
+
19
+ * Neither the name of Yahoo! Inc. nor the names of its
20
+ contributors may be used to endorse or promote products
21
+ derived from this software without specific prior
22
+ written permission of Yahoo! Inc.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
28
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+ This software also requires access to software from the following sources:
36
+
37
+ The Jarg Library v 1.0 ( http://jargs.sourceforge.net/ ) is available
38
+ under a BSD License � Copyright (c) 2001-2003 Steve Purcell,
39
+ Copyright (c) 2002 Vidar Holen, Copyright (c) 2002 Michal Ceresna and
40
+ Copyright (c) 2005 Ewan Mellor.
41
+
42
+ The Rhino Library ( http://www.mozilla.org/rhino/ ) is dually available
43
+ under an MPL 1.1/GPL 2.0 license, with portions subject to a BSD license.
44
+
45
+ Additionally, this software contains modified versions of the following
46
+ component files from the Rhino Library:
47
+
48
+ [org/mozilla/javascript/Decompiler.java]
49
+ [org/mozilla/javascript/Parser.java]
50
+ [org/mozilla/javascript/Token.java]
51
+ [org/mozilla/javascript/TokenStream.java]
52
+
53
+ The modified versions of these files are distributed under the MPL v 1.1
54
+ ( http://www.mozilla.org/MPL/MPL-1.1.html )
Binary file
@@ -15,6 +15,7 @@
15
15
  <%% end %>
16
16
 
17
17
  <%% if System::get_property('platform') == 'WP7' %>
18
+ <meta http-equiv="X-UA-Compatible" content="IE=9"/>
18
19
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
19
20
  <%% end %>
20
21
 
@@ -67,6 +67,13 @@
67
67
 
68
68
  var _ajax = $.ajax;
69
69
 
70
+ function isLocalUrl(url) {
71
+ //console.log('isLocalUrl: ' +url);
72
+ if (url.match(/^https?:\/\//) &&
73
+ !url.match(/^https?:\/\/(127\.0\.0\.1|localhost)/)) return false;
74
+ return true;
75
+ }
76
+
70
77
  function wp7ajax() {
71
78
  //console.log('in wp7ajax');
72
79
  //console.log('window.location: ' +window.location);
@@ -75,8 +82,7 @@
75
82
  //console.log('options has been normalized, options.url == "' +options.url +'"');
76
83
 
77
84
  // if we have URL in request options and it is a local URL
78
- if (options.url.match(/^https?:\/\/(127\.0\.0\.1|localhost)/) ||
79
- options.url.match(/^x-wmapp1:/)) {
85
+ if (isLocalUrl(options.url)) {
80
86
  //console.log('it is a local app URL');
81
87
  // then call proxy
82
88
  return wp7notifyProxy.apply(this, [options]);
@@ -0,0 +1,147 @@
1
+ (function(){
2
+ // =========================================================================================
3
+ // This library is for performing ajax calls to sync engine from javascript, no jQuery used.
4
+ // =========================================================================================
5
+
6
+ var URL_dosync = "/system/syncengine/dosync";
7
+ var URL_syncdb = "/system/syncdb";
8
+
9
+ function buildQuery(params) {
10
+ var query = "";
11
+ for (var key in params) {
12
+ if (params.hasOwnProperty(key)) {
13
+ var type = typeof params[key];
14
+ if ('string' == type || 'number' == type) {
15
+ if (0 < query.length) query = query + '&';
16
+ query = query + encodeURI(key) + '=' + encodeURI(params[key]);
17
+ }
18
+ }
19
+ }
20
+ return query;
21
+ }
22
+
23
+ var xhr=false;
24
+ /*
25
+ Option names are:
26
+ type - request type (optional, 'GET' by default)
27
+ url - request URL
28
+ query - request query string, may be defined as string or an object with properties (optional)
29
+ body - request body (optional)
30
+ success - request success handler (optional)
31
+ error - request error handler (optional)
32
+ */
33
+ function request(opts, that) {
34
+
35
+ // attempt to create XHR
36
+ if (!xhr) {
37
+ try {
38
+ if ('undefined' != typeof XMLHttpRequest)
39
+ xhr = new XMLHttpRequest();
40
+ else if (window.createRequest)
41
+ xhr = window.createRequest();
42
+ } catch(ex) {
43
+ xhr = false;
44
+ }
45
+ }
46
+
47
+ if (xhr) {
48
+ // ensure required opts are defined
49
+ if ('object' != typeof opts)
50
+ opts = {};
51
+ if ('string' != typeof opts.type)
52
+ opts.type = 'GET';
53
+ if ('string' != typeof opts.url)
54
+ opts.url = '';
55
+ if ('undefined' == typeof opts.query)
56
+ opts.query = '';
57
+ if ('object' == typeof opts.query)
58
+ opts.query = buildQuery(opts.query);
59
+ if ('undefined' == typeof opts.body)
60
+ opts.body = null;
61
+ if ('function' != typeof opts.success)
62
+ opts.success = function(){};
63
+ if ('function' != typeof opts.error)
64
+ opts.error = function(){};
65
+
66
+ var q = opts.query;
67
+ if (0 < q.length)
68
+ q = '?' + q;
69
+
70
+ xhr.open(opts.type, opts.url + q, true /*it is async request*/);
71
+ xhr.onreadystatechange = function () {
72
+ if (xhr.readyState == 4) {
73
+ opts.success.apply('undefined' == typeof that ? this : that, [
74
+ xhr.response, xhr.status, xhr
75
+ ]);
76
+ }
77
+ };
78
+ xhr.onerror = function () {
79
+ opts.error.apply('undefined' == typeof that ? this : that, [
80
+ xhr.response, "error", xhr
81
+ ]);
82
+ }
83
+ xhr.ontimeout = function () {
84
+ opts.error.apply('undefined' == typeof that ? this : that, [
85
+ "", "timeout", xhr
86
+ ]);
87
+ }
88
+ xhr.send(opts.body);
89
+ }
90
+ }
91
+
92
+
93
+ function dosync(/*bool*/ show_status_popup, /*const char **/ query_params) {
94
+ request({
95
+ url: URL_syncdb,
96
+ query: {
97
+ show_status_popup: 'undefined' != show_status_popup && show_status_popup ? 'true' : 'false',
98
+ query_params: query_params
99
+ }
100
+ });
101
+ }
102
+
103
+
104
+
105
+ /*
106
+ extern VALUE dosync_source(VALUE source_id, bool show_status_popup, const char * query_params);
107
+
108
+ // extern VALUE dosearch(VALUE ar_sources, const char *from, const char *params, bool sync_changes, int nProgressStep, const char* callback, const char* callback_params);
109
+ // extern VALUE login(const char *login, const char *password, const char* callback);
110
+
111
+ extern int logged_in();
112
+ extern void logout();
113
+ extern void stop_sync();
114
+ extern void set_notification(int source_id, const char *url, char* params);
115
+ extern void clear_notification(int source_id);
116
+
117
+ extern int set_pollinterval(int interval);
118
+ extern int get_pollinterval();
119
+
120
+ extern void set_syncserver(char* syncserver);
121
+
122
+ //extern VALUE get_src_attrs(const char* szPartition, int source_id);
123
+ //extern VALUE is_blob_attr(const char* szPartition, int source_id, const char* szAttrName);
124
+
125
+ extern void set_objectnotify_url(const char* szUrl);
126
+ extern void add_objectnotify(int nSrcID, const char* szObject);
127
+ extern void clean_objectnotify();
128
+
129
+ //extern int get_lastsync_objectcount(int nSrcID);
130
+ //extern int get_pagesize();
131
+
132
+ extern void set_pagesize(int pagesize);
133
+ extern void set_threaded_mode(bool b);
134
+ extern void enable_status_popup(bool b);
135
+ extern void set_source_property(int nSrcID, const char* szPropName, const char* szPropValue);
136
+ extern void set_ssl_verify_peer(bool b);
137
+ extern void update_blob_attribs(const char* szPartition, int source_id);
138
+
139
+ extern VALUE is_syncing();
140
+
141
+ extern void register_push();
142
+ */
143
+
144
+ window.Rho = window.Rho || {};
145
+ window.Rho.dosync = dosync;
146
+
147
+ })();