Skip to content

Commit

Permalink
Merge pull request #1572 from cb1kenobi/timob-7899
Browse files Browse the repository at this point in the history
[TIMOB-7899] Fixed commonjs support. Also fixed tiapp.xml parsing for mo...
  • Loading branch information
nebrius committed Mar 7, 2012
2 parents 04a0f89 + fba3830 commit 0a52115
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion mobileweb/src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
: null
)
)
|| _t.cjs.exports;
|| _t.cjs.module.exports || _t.cjs.exports;

// we might have just executed code above that could have caused a couple
// define()'s to queue up
Expand Down
6 changes: 2 additions & 4 deletions mobileweb/titanium/Ti/_/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ define(["Ti/_", "Ti/_/string", "Ti/Filesystem"], function(_, string, Filesystem)
return "url(" + url.toString() + ")";
}
var match = url && url.match(/^(.+):\/\//),
file = match && ~Filesystem.protocols.indexOf(match[1]) && Filesystem.getFile(url),
isFile = file && file.exists();
url = isFile ? url : "";
return isFile
file = match && ~Filesystem.protocols.indexOf(match[1]) && Filesystem.getFile(url);
return file && file.exists()
? "url(" + file.read().toString() + ")"
: !url || url === "none"
? ""
Expand Down
33 changes: 19 additions & 14 deletions support/mobileweb/tiapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,29 +319,34 @@ def parse_requires(node):
local_objects['parse_'+child.nodeName](child)

def parse_mobileweb(self, node):
def parse_filesystem(node):
val = node.getAttribute('externalStorage')
if val is not None:
def parse_filesystem_backend(node):
val = getText(node.childNodes)
if val is not None and val != '':
self.mobileweb['filesystem']['backend'] = val

def parse_filesystem_registry(node):
val = getText(node.childNodes)
if val is not None and val != '':
self.mobileweb['filesystem']['registry'] = val

def parse_image(node):
val = node.getAttribute('src')
if val is not None:
def parse_preload_image(node):
val = getText(node.childNodes)
if val is not None and val != '':
self.mobileweb['preload']['images'].append(val)

def parse_require(node):
val = node.getAttribute('src')
if val is not None:
def parse_precache_require(node):
val = getText(node.childNodes)
if val is not None and val != '':
self.mobileweb['precache']['requires'].append(val)

def parse_include(node):
val = node.getAttribute('src')
if val is not None:
def parse_precache_include(node):
val = getText(node.childNodes)
if val is not None and val != '':
self.mobileweb['precache']['includes'].append(val)

local_objects = locals()
parse_tags = {
'filesystem': None,
'filesystem': ['backend', 'registry'],
'preload': ['image'],
'precache': ['require', 'include']
}
Expand All @@ -353,7 +358,7 @@ def parse_include(node):
else:
for child_child in child.childNodes:
if child_child.nodeName in parse_tags[child.nodeName]:
local_objects['parse_'+child_child.nodeName](child_child)
local_objects['parse_'+child.nodeName+'_'+child_child.nodeName](child_child)

def has_app_property(self, property):
return property in self.app_properties
Expand Down

0 comments on commit 0a52115

Please sign in to comment.