platform/bb/RubyVM/src/com/rho/RhodesApp.java in rhodes-3.0.2 vs platform/bb/RubyVM/src/com/rho/RhodesApp.java in rhodes-3.1.0.beta.1
- old
+ new
@@ -1,5 +1,31 @@
+/*------------------------------------------------------------------------
+* (The MIT License)
+*
+* Copyright (c) 2008-2011 Rhomobile, Inc.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*
+* http://rhomobile.com
+*------------------------------------------------------------------------*/
+
package com.rho;
import com.rho.net.*;
import com.xruby.runtime.lang.RubyValue;
import java.util.Vector;
@@ -76,11 +102,11 @@
m_strDBDirPath = getRhoRootPath() + "db";
}
public String resolveDBFilesPath(String strFilePath)
{
- if ( strFilePath.startsWith(getRhoRootPath()) )
+ if ( strFilePath.length() == 0 || strFilePath.startsWith(getRhoRootPath()) )
return strFilePath;
return FilePath.join(getRhoRootPath(), strFilePath);
}
@@ -112,11 +138,11 @@
RubyValue res = (RubyValue)m_arCallbackObjects.elementAt(nIndex);
m_arCallbackObjects.setElementAt(null,nIndex);
return res;
}
- boolean isExternalUrl(String strUrl)
+ public boolean isExternalUrl(String strUrl)
{
return strUrl.indexOf(':') != -1;
//strUrl.startsWith("http://") || strUrl.startsWith("https://") ||
// strUrl.startsWith("javascript:") || strUrl.startsWith("mailto:")
// || strUrl.startsWith("tel:")|| strUrl.startsWith("wtai:") ||
@@ -212,10 +238,13 @@
return;
strCallbackUrl = canonicalizeRhoUrl(strCallbackUrl);
String strBody = "button_id=" + id + "&button_title=" + title;
strBody += "&rho_callback=1";
- getNet().pushData( strCallbackUrl, strBody, null );
+ //getNet().pushData( strCallbackUrl, strBody, null );
+
+ IRhoRubyHelper helper = RhoClassFactory.createRhoRubyHelper();
+ helper.postUrlNoWait(strCallbackUrl,strBody);
}
public String getCurrentUrl(int index)
{
return m_currentUrls[m_currentTabIndex];
\ No newline at end of file