mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-26 05:02:48 +00:00
use html5 data- api
This commit is contained in:
parent
f4c2ec948e
commit
1b962e6688
|
|
@ -7,10 +7,10 @@ $(document).ready(() => {
|
|||
|
||||
var update_apt_file = (ev) => {
|
||||
var sel = $(ev.target);
|
||||
var os_name=sel.find("option:selected").attr('data-os'),
|
||||
release_name=sel.find("option:selected").attr('data-release'),
|
||||
tmpl_selector=sel.attr("data-template"),
|
||||
target_selector=sel.attr("data-target"),
|
||||
var os_name=sel.find("option:selected").data('os'),
|
||||
release_name=sel.find("option:selected").data('release'),
|
||||
tmpl_selector=sel.data("template"),
|
||||
target_selector=sel.data("target"),
|
||||
apt_template = $.trim($(tmpl_selector).text()),
|
||||
apt_content = Mark.up(
|
||||
apt_template,
|
||||
|
|
@ -28,7 +28,7 @@ $(document).ready(() => {
|
|||
});
|
||||
|
||||
$('#help-select').on('change', (ev) => {
|
||||
let help_url = $(ev.target).find("option:selected").attr('data-help-url');
|
||||
let help_url = $(ev.target).find("option:selected").data('help-url');
|
||||
window.location = `${window.location.protocol}//${window.location.host}${help_url}`;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
---
|
||||
$(document).ready(() => {
|
||||
|
||||
$.get("/news/news.md", function(data) {
|
||||
var rendered = marked(data);
|
||||
$("#news-content")
|
||||
.html(rendered)
|
||||
.find('table')
|
||||
.addClass("table table-bordered table-striped");
|
||||
$('#spinner').addClass('hidden');
|
||||
let target = window.location.hash.replace();
|
||||
$('html, body').animate({
|
||||
scrollTop: $(target).offset().top
|
||||
}, 100);
|
||||
});
|
||||
|
||||
});
|
||||
// vim: ts=2 sts=2 sw=2 noexpandtab
|
||||
Loading…
Reference in New Issue