This commit is contained in:
Kevin Ngo 2014-10-04 14:21:37 -07:00
Родитель 9d3a427d16
Коммит 86bd4aa2c7
5 изменённых файлов: 117 добавлений и 5 удалений

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

@ -15,7 +15,8 @@ folders in ```dist``` that group the components:
but are possibly shared between some projects.
- ```core```: necessary JS modules that power all of our projects, the Commonplace framework.
- ```core-css```: base CSS components that ship with every project for visual consistency.
- ```templates```: reusable templates
- ```core-templates```: reusable templates that every project uses
- ```contrib-templates```: reusable templates that some projects use
### Adding a Core JS Component

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

44
dist/core-templates/app.html поставляемый Normal file
Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no,
initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#fff">
<title>Firefox Marketplace</title>
<link rel="stylesheet" href="/media/css/splash.css">
<link rel="stylesheet" href="/media/css/include.css">
<link rel="dns-prefetch" href="//ssl.google-analytics.com">
<link rel="dns-prefetch" href="//login.persona.org">
<link rel="dns-prefetch" href="//firefoxos.persona.org">
<link rel="dns-prefetch" href="//static.login.persona.org">
</head>
<body data-languages="[&#34;bg&#34;, &#34;bn-BD&#34;, &#34;ca&#34;, &#34;cs&#34;, &#34;da&#34;, &#34;de&#34;, &#34;el&#34;, &#34;en-US&#34;, &#34;es&#34;, &#34;fr&#34;, &#34;ga-IE&#34;, &#34;hr&#34;, &#34;hu&#34;, &#34;it&#34;, &#34;ja&#34;, &#34;ko&#34;, &#34;mk&#34;, &#34;nb-NO&#34;, &#34;nl&#34;, &#34;pl&#34;, &#34;pt-BR&#34;, &#34;ro&#34;, &#34;ru&#34;, &#34;sk&#34;, &#34;sq&#34;, &#34;sr&#34;, &#34;sr-Latn&#34;, &#34;tr&#34;, &#34;zh-CN&#34;, &#34;zh-TW&#34;]">
<noscript><p>Sorry, you need JavaScript to access the Marketplace.</p></noscript>
<div id="splash-overlay">
<div class="throbber"><b></b><b></b><b></b></div>
</div>
<header id="site-header" class="header site-header"></header>
<div class="cloak"></div>
<main>
<nav id="site-nav" class="site-nav" role="navigation"></nav>
<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>
<script src="/media/js/l10n.js"></script>
<script src="/media/js/include.js" defer></script>
</body>
</html>

56
dist/core-templates/server.html поставляемый Normal file
Просмотреть файл

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no,
initial-scale=1, maximum-scale=1">
<meta name="description"
content="The Firefox Marketplace is the official source of apps for the Web Platform.">
<meta name="theme-color" content="#fff">
<title>Firefox Marketplace</title>
<link rel="icon" href="/media/img/logos/128.png" sizes="128x128">
<link rel="icon" href="/media/img/logos/64.png" sizes="64x64">
<link rel="icon" href="/media/img/logos/32.png" sizes="32x32">
<link rel="stylesheet" href="/media/css/splash.css">
<link rel="stylesheet" href="/media/css/include.css">
<link title="Firefox Marketplace"
rel="search" type="application/opensearchdescription+xml"
href="/opensearch.xml" />
<!--<link rel="dns-prefetch" href="{{ MEDIA_URL }}">-->
<link rel="dns-prefetch" href="//ssl.google-analytics.com">
<link rel="dns-prefetch" href="//login.persona.org">
<link rel="dns-prefetch" href="//firefoxos.persona.org">
<link rel="dns-prefetch" href="//static.login.persona.org">
</head>
<body data-build-id-js="" data-spaceheater="false" data-media="">
<noscript><p>Sorry, you need JavaScript to access the Marketplace.</p></noscript>
<div id="splash-overlay">
<div class="throbber"><b></b><b></b><b></b></div>
</div>
<header id="site-header" class="header site-header"></header>
<div class="cloak"></div>
<main>
<div id="cat-dropdown"></div>
<div id="cat-list"></div>
<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>
<script src="https://login.persona.org/include.js" defer></script>
<script src="/media/js/l10n.js"></script>
<script src="/media/js/include.js" defer></script>
</body>
</html>

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

@ -27,16 +27,24 @@ var CORE_MODULES = [
'utils',
'z'
];
var CORE_SRC_PATH = 'commonplace/dist/core/';
var JS_DEST_PATH = 'src/media/js/';
var LIB_DEST_PATH = JS_DEST_PATH + 'lib/';
var CORE_DEST_PATH = LIB_DEST_PATH + 'commonplace/';
var CORE_VIEWS = [
'views/not_found',
'views/tests'
];
var BASE_TEMPLATES = [
'app.html',
'server.html'
];
var CORE_SRC_PATH = 'commonplace/dist/core/';
var CORE_TEMPLATE_PATH = 'commonplace/dist/core-templates/';
var JS_DEST_PATH = 'src/media/js/';
var LIB_DEST_PATH = JS_DEST_PATH + 'lib/';
var CORE_DEST_PATH = LIB_DEST_PATH + 'commonplace/';
// Build config object to tell Gulp which Bower files into project and where.
var bowerConfig = {
'jquery/jquery.js': LIB_DEST_PATH,
@ -50,6 +58,9 @@ _.each(CORE_MODULES, function(module) {
_.each(CORE_VIEWS, function(view) {
bowerConfig[CORE_SRC_PATH + view + '.js'] = CORE_DEST_PATH + 'views/';
});
_.each(BASE_TEMPLATES, function(template) {
bowerConfig[CORE_TEMPLATE_PATH + template] = 'src/';
});
// Build require config, to be used in development and AMD optimizers.