This commit is contained in:
Kevin Ngo 2015-03-18 17:11:35 -07:00
Родитель 0a2f5ea78f
Коммит 2465bc6517
7 изменённых файлов: 52 добавлений и 63 удалений

Просмотреть файл

@ -29,7 +29,7 @@ var localConfig = extend(true, {
// 'underscore': { 'exports': '_' }
}
},
PORT: 8675
PORT: 8674
}, config);
localConfig.inlineRequireConfig = config.makeInlineRequireConfig(

Просмотреть файл

@ -1,9 +1,9 @@
{
"name": "my-commonplace-app",
"name": "marketplace-app",
"version": "0.0.0",
"private": true,
"repository": {
"url": "git://github.com/mozilla/my-commonplace-app.git",
"url": "git://github.com/mozilla/marketplace-app.git",
"type": "git"
},
"engines": {

Просмотреть файл

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no,
initial-scale=1, maximum-scale=1">
<title>Sample App</title>
<title>Firefox Marketplace App</title>
<!--Remove me.-->
<link rel="stylesheet"
@ -25,26 +25,15 @@
<header id="site-header" class="header site-header"></header>
<div class="cloak"></div>
<main>
<div id="page" class="page" role="main"></div>
</main>
<footer id="site-footer"></footer>
<div id="lightbox">
<section>
<ul class="content"></ul>
<a class="close" href="#">&times;</a>
</section>
</div>
{% if compiled %}
<script src="/media/js/l10n.js"></script>
<script src="/media/js/include.js" defer></script>
{% else %}
<script src="/media/js/lib/core/l10n.js"></script>
<script data-main="/media/js/main" src="/media/js/lib/require.js"></script>
{% endif %}
</body>

10
src/media/js/init.js Normal file
Просмотреть файл

@ -0,0 +1,10 @@
/*
Contains things to initialize before we kick off the app.
Exposes a promise that the `main` module should wait on.
*/
define('init',
['core/init', 'helpers_local', 'routes', 'settings_app', 'templates'],
function(init, helpersLocal, routes, settingsApp, templates) {
return init.ready;
});

Просмотреть файл

@ -5,27 +5,22 @@
*/
console.log('Firefox Marketplace App');
define('main', ['routes', 'settings_app'], function() {
define('main', ['core/init'], function() {
require([
'core/forms', // Comment this if your app has no forms.
'core/l10n',
'core/log',
'core/login', // Comment this if your app does not have accounts.
'core/navigation',
'core/settings',
'core/user', // Comment this if your app does not have accounts.
'core/z',
'helpers_local',
'templates',
], function(forms, l10n, log, login, navigation, settings, user, z, nunjucks) {
define('main', ['init'], function(init) {
init.done(function() {
require(
[// Modules actually used in main.
'core/l10n', 'core/log', 'core/navigation', 'core/nunjucks',
'core/settings', 'core/user', 'core/z',
// Modules we require to initialize global stuff.
'core/forms', 'core/login'],
function(l10n, log, navigation, nunjucks,
settings, user, z) {
var logger = log('main');
z.body.addClass('html-' + l10n.getDirection());
// Do some last minute template compilation.
z.page.on('reload_chrome', function() {
// Last minute template compilation.
logger.log('Reloading chrome');
$('#site-header').html(
nunjucks.env.render('header.html'));
@ -42,8 +37,9 @@ require([
});
// Perform initial navigation.
z.page.trigger('navigate', [window.location.pathname + window.location.search]);
logger.log('Initialization complete');
z.page.trigger('navigate',
[window.location.pathname + window.location.search]);
logger.log('Done');
});
});
});

Просмотреть файл

@ -10,18 +10,15 @@ define('settings_app',
}
settings._extend({
app_name: 'Firefox Marketplace App',
default_locale: 'en-US',
api_url: 'http://' + window.location.hostname,
param_whitelist: ['q', 'sort'],
api_param_blacklist: null,
api_cdn_whitelist: {},
// These are the only URLs that should be cached
// (key: URL; value: TTL [time to live] in seconds).
// Keep in mind that the cache is always refreshed asynchronously;
// these TTLs apply to only when the app is first launched.
// Specifies URLs to be cached (key: URL; value: TTL in seconds).
// Cache is always refreshed asynchronously; TTLs only apply to when
// app is first launched.
offline_cache_whitelist: {},
offline_cache_enabled: offline_cache_enabled,
offline_cache_limit: 1024 * 1024 * 4, // 4 MB

Просмотреть файл

@ -1,40 +1,37 @@
<div id="directory-footer" class="main full c">
<div class="group">
<a class="button devhub" href="/developers/">{{ _('Develop Apps') }}</a>
</div>
<div class="group links">
<a href="/developers/">{{ _('Developer Hub') }}</a>
<a href="#" class="submit-feedback">{{ _('Feedback') }}</a>
{% if capabilities.firefoxOS %}
<a href="https://support.mozilla.org/products/firefox-os/marketplace" target="_blank">{{ _('Support') }}</a>
<div id="footer" class="footer">
<ul class="footer-support-navigation">
{% if capabilities.device_type() == 'desktop' %}
<li>
<a href="https://support.mozilla.org/en-US/kb/marketplace-apps-firefox-desktop" target="_blank">{{ _('Support') }}</a>
</li>
{% elif capabilities.firefoxOS %}
<li>
<a href="https://support.mozilla.org/products/firefox-os/marketplace" target="_blank">{{ _('Support') }}</a>
</li>
{% elif capabilities.firefoxAndroid %}
<a href="https://support.mozilla.org/kb/install-android-apps-using-marketplace" target="_blank">{{ _('Support') }}</a>
<li>
<a href="https://support.mozilla.org/kb/install-android-apps-using-marketplace" target="_blank">{{ _('Support') }}</a>
</li>
{% endif %}
</div>
<div class="language group links">
{# <a href="{{ url('purchases') }}">{{ _('My Apps') }}</a> #}
<li><a href="/developers/">{{ _('Develop Apps') }}</a></li>
{% if user.get_permission('developer') %}
<a href="/developers/submissions" rel="external">{{ _('My Submissions') }}</a>
<li><a href="/developers/submissions" rel="external">{{ _('My Submissions') }}</a></li>
{% endif %}
{% if user.get_permission('reviewer') %}
<a href="/reviewers/apps/queue/" rel="external" class="only-logged-in">{{ _('Reviewer Tools') }}</a>
<li><a href="/reviewers/apps/queue/" rel="external" class="only-logged-in">{{ _('Reviewer Tools') }}</a></li>
{% endif %}
{% if user.get_permission('lookup') %}
<a href="/lookup/" rel="external" class="only-logged-in">{{ _('Lookup Tool') }}</a>
<li><a href="/lookup/" rel="external" class="only-logged-in">{{ _('Lookup Tool') }}</a></li>
{% endif %}
</div>
</div>
<div id="footer">
<div class="pad">
<h1 id="footzilla"><a href="https://www.mozilla.org/" target="_blank">mozilla</a></h1>
</ul>
<div class="footer-content">
<h1 class="footzilla"><a href="https://www.mozilla.org/" target="_blank">mozilla</a></h1>
<p>
{{ _('Except where otherwise <a href="{legal_url}" target="_blank">noted</a>, content on this site is licensed under the <a href="{cc_url}" target="_blank">Creative Commons Attribution Share-Alike License v3.0</a> or any later version.',
legal_url='http://www.mozilla.org/about/legal.html#site',
cc_url='http://creativecommons.org/licenses/by-sa/3.0/') }}
</p>
<ul>
<li><a href="https://marketplace.firefox.com/privacy-policy">{{ _('Privacy Policy') }}</a></li>
<li><a href="https://marketplace.firefox.com/terms-of-use">{{ _('Terms of Use') }}</a></li>
<ul class="footer-extras">
<li><a href="https://www.mozilla.org/legal/fraud-report/index.html" target="_blank">
{{ _('Report Trademark Abuse') }}</a></li>
</ul>