mirror of
https://github.com/correl/melpa.git
synced 2025-03-07 04:45:08 -10:00
Differentiate the MELPA Stable page from the MELPA page (closes #1785)
This commit is contained in:
parent
55a937aed8
commit
550bf0e44f
3 changed files with 37 additions and 9 deletions
|
@ -1,9 +1,12 @@
|
|||
body {
|
||||
padding-top: 60px;
|
||||
}
|
||||
h1 {
|
||||
h1, .navbar, .navbar .brand, .navbar a, .navbar .nav>li>a {
|
||||
color: #922793;
|
||||
}
|
||||
.stable h1, .stable .navbar, .stable .navbar .brand, .stable .navbar a, .stable .navbar .nav>li>a {
|
||||
color: #3e999f;
|
||||
}
|
||||
.table .text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
@ -27,9 +30,6 @@ pre code { /* Match highlight.js styles to bootstrap */
|
|||
font-size: 18px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.navbar, .navbar .brand, .navbar a, .navbar .nav>li>a {
|
||||
color: #922793;
|
||||
}
|
||||
a[name] { /* Stop navbar from hiding anchors */
|
||||
padding-top: 60px;
|
||||
margin-top: -60px;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<header class="navbar navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a href="#/" class="navbar-brand">MELPA</a>
|
||||
<a href="#/" class="navbar-brand archive-name">MELPA</a>
|
||||
</div>
|
||||
<nav class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
@ -28,7 +28,7 @@
|
|||
</header>
|
||||
<main class="container" id="content">
|
||||
<noscript>
|
||||
<h1>MELPA (Milkypostman’s Emacs Lisp Package Archive)</h1>
|
||||
<h1><span class="archive-name">MELPA</span> (Milkypostman’s Emacs Lisp Package Archive)</h1>
|
||||
<ul>
|
||||
<li>Up-to-date packages built on our servers from upstream source</li>
|
||||
<li>Installable in any recent Emacs using 'package.el' - no need to install svn/cvs/hg/bzr/git/darcs etc.</li>
|
||||
|
@ -46,6 +46,7 @@
|
|||
<script src="//cdnjs.cloudflare.com/ajax/libs/mithril/0.1.15/mithril.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.0.0/moment.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="js/melpa.js"></script>
|
||||
<script src="http://platform.twitter.com/widgets.js" type="text/javascript" async="async"></script>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* global window */
|
||||
(function(m, document, _, moment){
|
||||
(function(m, document, _, moment, jQuery){
|
||||
"use strict";
|
||||
|
||||
// TODO Disqus
|
||||
|
@ -354,6 +354,32 @@
|
|||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Changing the appearance of the MELPA Stable page
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
melpa.stable = m.prop(window.location.host === 'melpa-stable.milkbox.net');
|
||||
melpa.archivename = {};
|
||||
melpa.archivename.controller = function() {
|
||||
this.archiveName = function() {
|
||||
return melpa.stable() ? "MELPA Stable" : "MELPA";
|
||||
};
|
||||
};
|
||||
melpa.archivename.view = function(ctrl) {
|
||||
return m("span", ctrl.archiveName());
|
||||
};
|
||||
|
||||
jQuery(function($) {
|
||||
document.title = (new melpa.archivename.controller()).archiveName();
|
||||
$(".archive-name").each(function(i, e) {
|
||||
$(e).empty();
|
||||
m.module(e, melpa.archivename);
|
||||
});
|
||||
if (melpa.stable()) {
|
||||
$("html").addClass("stable");
|
||||
}
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Static pages
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -379,12 +405,13 @@
|
|||
melpa.frontpage.controller = function() {
|
||||
this.packagelist = new melpa.packagelist.controller();
|
||||
this.buildstatus = new melpa.buildstatus.controller();
|
||||
this.archivename = new melpa.archivename.controller();
|
||||
};
|
||||
melpa.frontpage.view = function(ctrl) {
|
||||
return m("div", [
|
||||
m("section.page-header", [
|
||||
m("h1", [
|
||||
"MELPA",
|
||||
melpa.archivename.view(ctrl.archivename),
|
||||
m("small", " (Milkypostman’s Emacs Lisp Package Archive)")
|
||||
])
|
||||
]),
|
||||
|
@ -431,4 +458,4 @@
|
|||
if (window.twttr && window.twttr.widgets) window.twttr.widgets.load();
|
||||
}, 100);
|
||||
|
||||
})(window.m, window.document, window._, window.moment);
|
||||
})(window.m, window.document, window._, window.moment, window.jQuery);
|
||||
|
|
Loading…
Add table
Reference in a new issue