Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C70E4F7BE for ; Wed, 21 Aug 2013 17:23:55 +0000 (UTC) Received: (qmail 86445 invoked by uid 500); 21 Aug 2013 17:23:55 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 86408 invoked by uid 500); 21 Aug 2013 17:23:52 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 86386 invoked by uid 99); 21 Aug 2013 17:23:51 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 17:23:51 +0000 Date: Wed, 21 Aug 2013 17:23:51 +0000 (UTC) From: "Jesse MacFadyen (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CB-4054) WP8 file requests are not relative to www folder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-4054?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Jesse MacFadyen reassigned CB-4054: ----------------------------------- Assignee: Jesse MacFadyen (was: Michael Brooks) =20 > WP8 file requests are not relative to www folder > ------------------------------------------------ > > Key: CB-4054 > URL: https://issues.apache.org/jira/browse/CB-4054 > Project: Apache Cordova > Issue Type: Bug > Components: Docs, Plugin File, WP8 > Affects Versions: 2.9.0 > Environment: Windows 8 x64 > Reporter: Frederico Costa Galv=C3=A3o > Assignee: Jesse MacFadyen > Labels: patch > > I started migrating my app (http://tippz.mobi) to *WP8* and found that al= l files requested via js (xhr) are expected to be served relative to the pr= oject root (at least on development/emulator, but I can't imagine it to be = different on other environments), which is not according to the way it happ= ens on iOS and Android. > On both iOS and Android, working directory for the code serving files via= xhr is the 'www' folder (or is it the folder where my 'index.html' is loca= ted?), while on WP8 it is 'www/..' (the project root, in other words). Reso= urces mapped directly on the html file however are served from the right di= rectory on all cases. > There is also no word about it on the docs, the only thing I found was an= answer on stackoverflow. > Adding the following code on line 717 of Plugins/File.cs@readResourceAsTe= xt() solved the problem (so far!, can't be sure it didn't have side effects= as I could not make my app work well enough on WP8 yet): > {code:java} > pathToResource =3D "www/" + pathToResource; > {code} > Also, on the same method and file, +optStrings+ variable is expected to a= lways have 5 fields, but everytime I ran my app Visual Studio threw me an e= xception because +optStrings+ never have more than 2 fields. I solved it su= rrounding remaining variables attribution with an if(optStrings.Length>2){}= . -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira