Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 846618 - applications data customization #8396

Merged
merged 1 commit into from Mar 4, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 43 additions & 4 deletions build/applications-data.js
Expand Up @@ -96,6 +96,17 @@ function iconDescriptor(directory, app_name, entry_point) {
};
}

function getCustomize(name) {
var content;
if (Gaia.customizeFolder) {
let customize = getFile(Gaia.customizeFolder, name + '.json');
if (customize.exists()) {
content = getJSON(customize);
}
}
return content;
}

// zeroth grid page is the dock
let customize = {"homescreens": [
[
Expand Down Expand Up @@ -123,9 +134,9 @@ if (DOGFOOD == 1) {
customize.homescreens[0].push(["dogfood_apps", "feedback"]);
}

let init = getFile(GAIA_DIR, 'customize.json');
if (init.exists()) {
customize = getJSON(init);
let homescreens = getCustomize('homescreens');
if (homescreens) {
customize = homescreens;
}

let content = {
Expand Down Expand Up @@ -157,7 +168,7 @@ let content = {
)
};

init = getFile(GAIA_DIR, GAIA_CORE_APP_SRCDIR, 'homescreen', 'js', 'init.json');
let init = getFile(GAIA_DIR, GAIA_CORE_APP_SRCDIR, 'homescreen', 'js', 'init.json');
writeContent(init, JSON.stringify(content));

// Apps that should never appear in settings > app permissions
Expand Down Expand Up @@ -207,11 +218,22 @@ content = {
default_low_limit_threshold: 3
};

let costcontrol = getCustomize('costcontrol');
if (costcontrol) {
content = costcontrol;
}

writeContent(init, JSON.stringify(content));

// SMS
init = getFile(GAIA_DIR, 'apps', 'sms', 'js', 'blacklist.json');
content = ["1515", "7000"];

let blacklist = getCustomize('sms-blacklist');
if (blacklist) {
content = blacklist;
}

writeContent(init, JSON.stringify(content));

// Browser
Expand All @@ -235,6 +257,11 @@ content = {
]
}

let browser = getCustomize('browser');
if (browser) {
content = browser;
}

writeContent(init, JSON.stringify(content));

// Support
Expand All @@ -255,11 +282,23 @@ content = {
}
]
}

let support = getCustomize('support');
if (support) {
content = support;
}

writeContent(init, JSON.stringify(content));

// ICC / STK
init = getFile(GAIA_DIR, 'apps', 'settings', 'resources', 'icc.json');
content = {
"defaultURL": "http://www.mozilla.org/en-US/firefoxos/"
}

let icc = getCustomize('icc');
if (icc) {
content = icc;
}

writeContent(init, JSON.stringify(content));