You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/08/09 16:13:47 UTC

svn commit: r1371221 - in /pivot/site/trunk/deploy/assets-for-tests: README.txt frame.bxml

Author: smartini
Date: Thu Aug  9 14:13:47 2012
New Revision: 1371221

URL: http://svn.apache.org/viewvc?rev=1371221&view=rev
Log:
update some bxml file (and related txt), to better test some remote loading of bxml files from Client applications

Modified:
    pivot/site/trunk/deploy/assets-for-tests/README.txt
    pivot/site/trunk/deploy/assets-for-tests/frame.bxml

Modified: pivot/site/trunk/deploy/assets-for-tests/README.txt
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/assets-for-tests/README.txt?rev=1371221&r1=1371220&r2=1371221&view=diff
==============================================================================
--- pivot/site/trunk/deploy/assets-for-tests/README.txt (original)
+++ pivot/site/trunk/deploy/assets-for-tests/README.txt Thu Aug  9 14:13:47 2012
@@ -1 +1 @@
-
This folder contains some files copied by hand, to be able to make some loading test from Client applications.

bxml (and related) resources are here to simulate bxml files (dynamically) generated at server side.

The full URL for this folder (live, from the production web site) is:
http://pivot.apache.org/assets-for-tests

Note on loading bxml files, but from remote (for example see JavascriptConsoleTest, under the tests subproject):
secondary bxml files (included by others) could not be found
loading in the usual (relative) way, so to handle safely even those cases by convention I use a variable
(accessible or defined directly in JavaScript inside bxml files) called baseURL
but it's not possible to test if undefined (like in standard JavaScript inside browsers), so must be defined
(at least as an empty string, or a good base URL terminated by /).
\ No newline at end of file
+
This folder contains some files copied by hand, to be able to make some loading test from Client applications.

bxml (and related) resources are here to simulate bxml files (dynamically) generated at server side.

The full URL for this folder (live, from the production web site) is:
http://pivot.apache.org/assets-for-tests

Note on loading bxml files, but from remote (for example see JavascriptConsoleTest, under the tests subproject):
secondary bxml files (included by others) could not be found
loading in the usual (relative) way, so to handle safely even those cases by convention I use a variable
(accessible or defined directly in JavaScript inside bxml files) called resourcesBaseURL
but it's not possible to test if undefined (like in standard JavaScript inside browsers), so must be defined
(at least as an empty string, or a good base URL terminated by /).
\ No newline at end of file

Modified: pivot/site/trunk/deploy/assets-for-tests/frame.bxml
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/assets-for-tests/frame.bxml?rev=1371221&r1=1371220&r2=1371221&view=diff
==============================================================================
--- pivot/site/trunk/deploy/assets-for-tests/frame.bxml (original)
+++ pivot/site/trunk/deploy/assets-for-tests/frame.bxml Thu Aug  9 14:13:47 2012
@@ -28,6 +28,10 @@ limitations under the License.
 
     <bxml:script>
     var palette = null;
+
+    if (resourcesBaseURL == null) {
+	    resourcesBaseURL = "";  // safer default
+    }
     </bxml:script>
 
     <BoxPane orientation="vertical">
@@ -82,11 +86,11 @@ limitations under the License.
                 function buttonPressed(button) {
                     if (palette == null) {
                         // palette = application.load("palette.bxml"); // original version
-                        // Alert.alert("baseURL is defined " + (baseURL != undefined), frame);  // debug
-                        // Alert.alert("baseURL = " + baseURL, frame);  // debug
+                        // Alert.alert("resourcesBaseURL is defined " + (resourcesBaseURL != undefined), frame);  // debug
+                        // Alert.alert("resourcesBaseURL = " + resourcesBaseURL, frame);  // debug
 						// new, for remote loading of this file (included by another):
-						// note thate this version requires the variable baseURL defined, at least an empty string ...
-                        palette = application.load(baseURL + "palette.bxml");
+						// note thate this version requires the variable resourcesBaseURL defined, at least an empty string ...
+                        palette = application.load(resourcesBaseURL + "palette.bxml");
                         palette.setLocation(frame.getX() + frame.getWidth() + 20, frame.getY() + 20);
                     }