cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Soref <>
Subject serving extra css
Date Mon, 03 Feb 2014 19:01:37 GMT
cordova serve is a pretty good way to test out how an application will
work on a device.

We¹d like to be able to easily transparently add in some platform specific
things (today, that¹s fonts which exist on the platform but aren¹t
necessarily on the system running the browser that¹s viewing the pages
from cordova serve).

Is a way to do this (for IE and Firefox **). I¹m looking for some feedback
on it.

That would be accompanied with a change to a platform¹s parser, such as:

diff --git a/src/metadata/blackberry10_parser.js
index 4ed280d..9244876 100644
--- a/src/metadata/blackberry10_parser.js
+++ b/src/metadata/blackberry10_parser.js
@@ -80,6 +80,15 @@ module.exports.prototype = {
     www_dir:function() {
         return path.join(this.path, 'www');
+    serve_extra_style:function() {
+        return 'fonts.css';
+    },
+    serve_extra_style_dir:function() {
+        var lib_path = path.join(util.libDirectory, 'blackberry10',
'cordova', require('../../platforms').blackberry10.version);
+        return path.join(lib_path, 'extra_www');
+    },
     staging_dir: function() {
         return path.join(this.path, '.staging', 'www');

And then the platform would have an extra_www/fonts.css file Š

I¹m not entirely happy with the use of the parser functionality to do this
‹ does anyone have a preference?
I could have serve automatically look for a ³well known file² within a
platform, and serve it if it exists.

View raw message