Skip to content

Revert "Remove old media/static files" #12210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions media/css/autocomplete.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

.ui-autocomplete-input { width: 225px; }
.ui-autocomplete { background: #fff; text-align: left; }
.ui-state-hover { background: #eee; }
.ui-menu-item a { display: block; padding: 5px 10px; }
1 change: 1 addition & 0 deletions media/css/badge_only.css
1,400 changes: 1,400 additions & 0 deletions media/css/core.css

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions media/css/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

#rtfd-header *:focus { outline: none; }

/* header */

#rtfd-header { font: 16px/20px "ff-meta-web-pro-1", "ff-meta-web-pro-2", Arial, "Helvetica Neue", sans-serif; height: 50px; min-width: 780px; background: url(../images/header-bg.png) bottom left repeat-x #465158; overflow: hidden; text-align: left; border-bottom: 1px solid #000; }
#rtfd-header ul { margin: 0; padding: 0; list-style: none; }
#rtfd-header ul li { margin: 0; padding: 0; list-style: none; }

/* header title */
.rtfd-header-title { position: relative; margin: 0; padding: 0; height: 50px; width: 180px; }
.rtfd-header-title h1 { background: url(../images/logo.png) top left no-repeat; position: absolute; top: 0; left: -30px; margin: 0; padding: 0; font-size: 20px; line-height: 20px; color: #fff; text-indent: -9999em; }
.rtfd-header-title h1 a { display: block; color: #fff; text-decoration: none; height: 50px; width: 200px; }

/* header search */
.rtfd-header-search { position: absolute; top: 12px; left: 190px; width: 300px; }
.rtfd-header-search input { padding: 0 5px; margin: 0; height: 25px; font-size: 14px; float: left; -moz-border-radius: 0; -webkit-border-radius: 0; border: none; }
.rtfd-header-search input[type="text"] { -moz-border-radius-topleft: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; width: 225px; }
.rtfd-header-search input[type="submit"] { font-family: "ff-meta-web-pro-1", "ff-meta-web-pro-2", Arial, "Helvetica Neue", sans-serif; -moz-border-radius-topright: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-top-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; padding: 0 12px; background: #e6e6e6 url(../images/gradient.png) repeat-x bottom left; font-weight: bold; color: #666; }
.rtfd-header-search input[type="submit"]:hover { text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); background-color: #8ECC4C; color: #fff; }

/* bookmarking */
.rtfd-header-bookmark { position: absolute; top: 10px; left: 500px; }
.rtfd-header-bookmark-icon { display: block; text-indent: -99999em; height: 25px; width: 25px; background: url(../images/bookmark-icon-default.png) 50% 50% no-repeat #697983; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
.rtfd-header-bookmark-icon.active { background-image: url(../images/bookmark-icon-active.png); }
.rtfd-header-bookmark-icon:hover { background-image: url(../images/bookmark-icon-hover.png); }

/* header nav */
.rtfd-header-nav { position: absolute; top: 0; right: 10px; }
.rtfd-header-nav ul li { float: left; }
.rtfd-header-nav ul li a { font-size: 14px; font-weight: bold; display: block; text-decoration: none; padding: 5px 10px; margin: 10px 0 0 10px; color: #fff; text-shadow: 0 1px 0px rgba(0, 0, 0, 0.5); background: #7C8F99 url(../images/gradient-light.png) bottom left repeat-x; border-bottom: 1px solid #465158; -moz-border-radius: 3px; -webkit-border-radius: 3px;}
.rtfd-header-nav ul li a:hover { background-color: #8CA1AF; }
.rtfd-header-nav ul li.active a, .header-nav ul li.active a:hover { background-color: #BAC7CF; }
.rtfd-header-nav .overview-link a { padding: 4px 10px; margin: 10px 15px; line-height: 20px; height: 22px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
#rtfd-header + div { position:relative; }


/* autocomplete */

.ui-autocomplete { background: #fff; text-align: left; border: 1px solid #bfbfbf; }
.ui-state-hover { background: #eee; }
.ui-menu-item a { display: block; padding: 3px 10px; }
1 change: 1 addition & 0 deletions media/css/sphinx_rtd_theme.css
1 change: 1 addition & 0 deletions media/font/fontawesome_webfont.eot
1 change: 1 addition & 0 deletions media/font/fontawesome_webfont.svg
1 change: 1 addition & 0 deletions media/font/fontawesome_webfont.ttf
1 change: 1 addition & 0 deletions media/font/fontawesome_webfont.woff
1 change: 1 addition & 0 deletions media/font/fontawesome_webfont.woff2
1 change: 1 addition & 0 deletions media/fonts
Binary file added media/images/badge-revsys-sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/badge-revsys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/badge-rtd-sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/badge-rtd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions media/images/body-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/bookmark-delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/bookmark-icon-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/bookmark-icon-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/bookmark-icon-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/bookmark-icon-wait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/close-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/gear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/gradient-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/header-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions media/images/header-home-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/home-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions media/images/project-bar-bg-admin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/project-bar-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/switch-grid-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/images/switch-list-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions media/javascript/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
$(function() {
$('body')
.on('click', '.dropdown > span > a:last-child', open_dropdown)
.on('keyup', '.dropdown input[type=search]', filter_dropdown_results)
.click(hide_dropdown)

$('select.dropdown').each(function(i, e) { build_dropdown_from_select($(e)) })

function open_dropdown(ev) {
console.log('open_dropdown')
ev.preventDefault()
$('.dropdown > ul').removeClass('js-open')
var el = $(ev.target)
, dropdown = el.parents('.dropdown')

dropdown.find('li').show()
dropdown.find('ul').addClass('js-open')
dropdown.find('input[type=search]').val('').focus()
}

function filter_dropdown_results(ev) {
console.log('is this getting called')

var el = $(ev.target)
, dropdown = el.parents('.dropdown')
, value = this.value

dropdown.find('li').show()

if(value.length) {
dropdown.find('li').hide()
dropdown.find('li').filter(function(i, el) {
return ($(el).text().indexOf(value) === 0)
}).show()
el.parent().show()
}

if(ev.keyCode === 13) {
ev.preventDefault()
var anchor = dropdown.find('li:visible > a').eq(0)

setTimeout(function() {
anchor.click()
})
} else if(ev.keyCode === 27) {
el.val('')
dropdown.find('li').show()
}
}

function hide_dropdown(ev) {
if(!$(ev.target).parents('.dropdown').length) {
$('.dropdown > ul').removeClass('js-open')
}
}


function build_dropdown_from_select(select) {
var options = {}
, selected = null
, option_ul
, framing


framing = $('<span class="dropdown"><span>'+
'<a href="#"></a><a href="#">&#x25BC;</a></span>'+
'<ul></ul></span>'
)
option_ul = framing.find('ul')

select.find('option').each(function(idx, el) {
el = $(el)
var value = el.attr('value')

options[value] = el.text()
selected = selected === null ? value : selected

option_ul.append(
$('<li></li>').append(
$('<a href="#"></a>')
.text(options[value])
.attr('data-value', value)
)
)

})

console.log('norp', select, select.find('option'), options, selected)
selected = options[select.val() || selected]


framing.find('span > a:first-child').text(selected)

framing.on('click', '[data-value]', function(ev) {
ev.preventDefault()
framing.find('span > a:first-child').text($(this).text())
select.val($(this).attr('data-value'))

option_ul.removeClass('js-open')
})

select.after(framing)

}

// Install events handlers user menu button the window, to open the menu and
// close it if it loses click focus.
(function () {
var menu = $('.menu-user'),
menu_button = menu.find('button.menu-drop'),
menu_dropdown = menu.find('div.menu-dropdown');

menu_button.on('click', function (ev) {
ev.stopPropagation();
if (menu_dropdown.hasClass('menu-dropped')) {
menu_dropdown.removeClass('menu-dropped');
}
else {
$('html').on('click', function () {
menu_dropdown.removeClass('menu-dropped');
});
menu_dropdown.on('click', function (ev) {
ev.stopPropagation();
});
menu_dropdown.addClass('menu-dropped');
}
});
})();
})
141 changes: 141 additions & 0 deletions media/javascript/build_updater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
(function () {

// An updater that renders details about a build.
this.BuildUpdater = function(buildId) {
this.buildId = buildId;
this.buildUrl = '/api/v1/build/' + this.buildId + '/';
this.buildDiv = 'div#build-' + this.buildId;
this.buildLoadingImg = this.buildDiv + ' img.build-loading';
this.intervalId = null;
return this;
};

BuildUpdater.prototype.stopPolling = function() {
$(this.buildLoadingImg).addClass('hide');
clearInterval(this.intervalId);
};

// Show an animated 'loading' gif while we get the current details of the build
// with `buildId` from the server.
//
// If the build was successful, hide the loading gif, populate any <span>
// nodes that have ids matching the pattern "build-<field name in `data`
// object>" and clear `this.intervalId`.
BuildUpdater.prototype.render = function(data) {
var _this = this;

for (var prop in data) {
if (data.hasOwnProperty(prop)) {
var val = data[prop];
var el = $(this.buildDiv + ' span#build-' + prop);

if (prop == 'success') {
if (data.hasOwnProperty('state') && data['state'] != 'finished') && data['state'] != 'cancelled' {
val = "Not yet finished";
}
else {
// TODO: I'm not sure what to do with these. We are
// adding a third option here ("Cancelled") that's not
// "Passed" nor "Failed". There are many other places in
// the code where we are assuming only two possible
// options.
val = val ? "Passed" : "Failed";
}
}

if (prop == 'state') {
val = val.charAt(0).toUpperCase() + val.slice(1);

if (val == 'Finished' || val == 'Cancelled') {
_this.stopPolling();
}
}

if (el) {
el.text(val);
}
}
}
};

BuildUpdater.prototype.getBuild = function() {
_this = this;

$.get(this.buildUrl, function(data) {
_this.render(data);
});
};

// If the build with ID `this.buildId` has a state other than finished or
// cancelled, poll the server every 5 seconds for the current status. Update
// the details page with the latest values from the server, to keep the user
// informed of progress.
//
// If we haven't received a 'finished'/'cancelled' state back the server in 10 minutes,
// stop polling.
BuildUpdater.prototype.startPolling = function() {
var stateSpan = $(this.buildDiv + ' span#build-state');
var _this = this;

// If the build is already finished, or it isn't displayed on the page,
// ignore it.
if (stateSpan.text() == 'Finished' || stateSpan.text() == 'Cancelled' || stateSpan.length === 0) {
return;
}

$(this.buildLoadingImg).removeClass('hide');

// Get build data and render.
this.getBuild();

// Get build data and render every 5 seconds until finished.
var intervalId = setInterval(function () {
_this.getBuild();
}, 5000);

// Stop polling after 10 minutes, in case the build never finishes.
setTimeout(function() {
_this.stopPolling();
}, 600000);
};


// An updater that renders builds in a list of builds.
this.BuildListUpdater = function(buildId) {
BuildUpdater.call(this, buildId);
return this;
};

BuildListUpdater.prototype = new BuildUpdater();

BuildListUpdater.prototype.render = function(data) {
var _this = this;

data['success'] = data['success'] ? "Passed" : "Failed";
data['state'] = data['state'].charAt(0).toUpperCase() + data['state'].slice(1);

for (var prop in data) {
if (data.hasOwnProperty(prop)) {
var val = data[prop];
var el = $(this.buildDiv + ' span#build-' + prop);

if (prop == 'state') {
// Show the success value ("Passed" or "Failed") if the build
// finished. Otherwise, show the state value.
if (val == 'Finished' || val == 'Cancelled') {
val = data['success'];
_this.stopPolling();
} else {
data['success'] = '';
}
}

if (el) {
el.text(val);
}
}
}
};


}).call(this);
Loading