Update bootstrap to 3.3.7 and jQuery to 3.1.0 with related patches

This commit is contained in:
Wu Cheng-Han 2016-07-30 12:19:42 +08:00
parent 3a5bda3067
commit 65cff038a3
12 changed files with 59 additions and 59 deletions

View file

@ -15,8 +15,8 @@
"tests"
],
"dependencies": {
"bootstrap": "~3.3.6",
"jquery": "~2.2.4",
"bootstrap": "~3.3.7",
"jquery": "~3.1.0",
"font-awesome": "~4.6.3",
"Ionicons": "ionicons#~2.0.1",
"reveal.js": "~3.3.0",
@ -60,6 +60,6 @@
"gist-embed": "*"
},
"resolutions": {
"jquery": "~2.2.4"
"jquery": "~3.1.0"
}
}

View file

@ -10,7 +10,7 @@ body {
font-family: "Source Sans Pro", Helvetica, Arial, sans-serif;
letter-spacing: 0.025em;
}
:focus {
:focus, .focus {
outline: none !important;
}
::-moz-focus-inner {

View file

@ -810,10 +810,10 @@ $(window).resize(function () {
windowResize();
});
//when page unload
$(window).unload(function () {
$(window).on('unload', function () {
updateHistoryInner();
});
$(window).error(function () {
$(window).on('error', function () {
//setNeedRefresh();
});
@ -1357,7 +1357,7 @@ ui.toolbar.export.gist.attr("href", noteurl + "/gist");
ui.toolbar.export.snippet.click(function() {
ui.spinner.show();
$.get(serverurl + '/auth/gitlab/callback/' + noteid + '/projects')
.success(function (data) {
.done(function (data) {
$("#snippetExportModalAccessToken").val(data.accesstoken);
$("#snippetExportModalBaseURL").val(data.baseURL);
$("#snippetExportModalLoading").hide();
@ -1380,10 +1380,10 @@ ui.toolbar.export.snippet.click(function() {
}
$("#snippetExportModalLoading").hide();
})
.error(function (data) {
.fail(function (data) {
showMessageModal('<i class="fa fa-gitlab"></i> Import from Snippet', 'Unable to fetch gitlab parameters :(', '', '', false);
})
.complete(function () {
.always(function () {
ui.spinner.hide();
});
});
@ -1443,7 +1443,7 @@ ui.toolbar.import.gist.click(function () {
ui.toolbar.import.snippet.click(function () {
ui.spinner.show();
$.get(serverurl + '/auth/gitlab/callback/' + noteid + '/projects')
.success(function (data) {
.done(function (data) {
$("#snippetImportModalAccessToken").val(data.accesstoken);
$("#snippetImportModalBaseURL").val(data.baseURL);
$("#snippetImportModalContent").prop('disabled', false);
@ -1468,10 +1468,10 @@ ui.toolbar.import.snippet.click(function () {
}
$("#snippetImportModalLoading").hide();
})
.error(function (data) {
.fail(function (data) {
showMessageModal('<i class="fa fa-gitlab"></i> Import from Snippet', 'Unable to fetch gitlab parameters :(', '', '', false);
})
.complete(function () {
.always(function () {
ui.spinner.hide();
});
});
@ -1503,14 +1503,14 @@ var revision = null;
var revisionTime = null;
ui.modal.revision.on('show.bs.modal', function (e) {
$.get(noteurl + '/revision')
.success(function(data) {
.done(function(data) {
parseRevisions(JSON.parse(data).revision);
initRevisionViewer();
})
.error(function(err) {
.fail(function(err) {
})
.complete(function() {
.always(function() {
//na
});
});
@ -1555,7 +1555,7 @@ function parseRevisions(_revisions) {
function selectRevision(time) {
if (time == revisionTime) return;
$.get(noteurl + '/revision/' + time)
.success(function(data) {
.done(function(data) {
revision = JSON.parse(data);
revisionTime = time;
var lastScrollInfo = revisionViewer.getScrollInfo();
@ -1613,10 +1613,10 @@ function selectRevision(time) {
revisionInsertAnnotation.update(revisionInsert);
revisionDeleteAnnotation.update(revisionDelete);
})
.error(function(err) {
.fail(function(err) {
})
.complete(function() {
.always(function() {
//na
});
}
@ -1662,7 +1662,7 @@ ui.modal.snippetImportProjects.change(function() {
$("#snippetImportModalLoading").show();
$("#snippetImportModalContent").val('/projects/' + project);
$.get(baseURL + '/api/v3/projects/' + project + '/snippets?access_token=' + accesstoken)
.success(function(data) {
.done(function(data) {
$("#snippetImportModalSnippets").find('option').remove().end().append('<option value="init" selected="selected" disabled="disabled">Select From Available Snippets</option>');
data.forEach(function(snippet) {
$('<option>').val(snippet.id).text(snippet.title).appendTo($("#snippetImportModalSnippets"));
@ -1670,10 +1670,10 @@ ui.modal.snippetImportProjects.change(function() {
$("#snippetImportModalLoading").hide();
$("#snippetImportModalSnippets").prop('disabled', false);
})
.error(function(err) {
.fail(function(err) {
})
.complete(function() {
.always(function() {
//na
});
});
@ -1807,7 +1807,7 @@ $("#gistImportModalConfirm").click(function () {
} else {
ui.spinner.show();
$.get('https://api.github.com/gists/' + url('-1', gisturl))
.success(function (data) {
.done(function (data) {
if (data.files) {
var contents = "";
Object.keys(data.files).forEach(function (key) {
@ -1821,10 +1821,10 @@ $("#gistImportModalConfirm").click(function () {
showMessageModal('<i class="fa fa-github"></i> Import from Gist', 'Unable to fetch gist files :(', '', '', false);
}
})
.error(function (data) {
.fail(function (data) {
showMessageModal('<i class="fa fa-github"></i> Import from Gist', 'Not a valid Gist URL :(', '', JSON.stringify(data), false);
})
.complete(function () {
.always(function () {
ui.spinner.hide();
});
}
@ -1850,12 +1850,12 @@ $("#snippetImportModalConfirm").click(function () {
var accessToken = '?access_token=' + $("#snippetImportModalAccessToken").val();
var fullURL = $("#snippetImportModalBaseURL").val() + '/api/v3' + snippeturl;
$.get(fullURL + accessToken)
.success(function(data) {
.done(function(data) {
var content = '# ' + (data.title || "Snippet Import");
var fileInfo = data.file_name.split('.');
fileInfo[1] = (fileInfo[1]) ? fileInfo[1] : "md";
$.get(fullURL + '/raw' + accessToken)
.success(function (raw) {
.done(function (raw) {
if (raw) {
content += "\n\n";
if (fileInfo[1] != "md") {
@ -1868,14 +1868,14 @@ $("#snippetImportModalConfirm").click(function () {
replaceAll(content);
}
})
.error(function (data) {
.fail(function (data) {
showMessageModal('<i class="fa fa-gitlab"></i> Import from Snippet', 'Not a valid Snippet URL :(', '', JSON.stringify(data), false);
})
.complete(function () {
.always(function () {
ui.spinner.hide();
});
})
.error(function (data) {
.fail(function (data) {
showMessageModal('<i class="fa fa-gitlab"></i> Import from Snippet', 'Not a valid Snippet URL :(', '', JSON.stringify(data), false);
});
}

View file

@ -12,7 +12,7 @@
<span class="ui-lastchange text-uppercase"></span>
</span>
<span class="ui-permission dropdown pull-right">
<a id="permissionLabel" class="ui-permission-label text-uppercase" data-target="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<a id="permissionLabel" class="ui-permission-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
</a>
<ul class="dropdown-menu" aria-labelledby="permissionLabel">
<li class="ui-permission-freely"><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li>
@ -26,7 +26,7 @@
<div id="doc" class="markdown-body container-fluid"></div>
<div class="ui-toc dropup unselectable hidden-print" style="display:none;">
<div class="pull-right dropdown">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-target="#" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
<ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">

View file

@ -3,11 +3,11 @@
</script>
<% if(useCDN) { %>
<script src="//cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js" defer></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js" defer></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.6/socket.io.min.js" defer></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-yaml/3.6.1/js-yaml.min.js" defer></script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment-with-locales.min.js" defer></script>

View file

@ -8,7 +8,7 @@
<link rel="icon" type="image/png" href="<%- url %>/favicon.png">
<link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png">
<% if(useCDN) { %>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css">
@ -43,7 +43,7 @@
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.2.0/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js"></script>
<![endif]-->

View file

@ -8,7 +8,7 @@
<div class="visible-lg">&nbsp;</div>
</span>
<div class="nav-mobile nav-status visible-xs" id="short-online-user-list">
<a class="ui-short-status" data-target="#" data-toggle="dropdown"><span class="label label-danger"><i class="fa fa-plug"></i> </span>
<a class="ui-short-status" data-toggle="dropdown"><span class="label label-danger"><i class="fa fa-plug"></i> </span>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu">
</ul>
@ -18,7 +18,7 @@
<span class="btn btn-link btn-file ui-upload-image" title="Upload Image" style="display:none;">
<i class="fa fa-camera"></i><input type="file" accept="image/*" name="upload" multiple>
</span>
<a data-target="#" data-toggle="dropdown" class="btn btn-link">
<a data-toggle="dropdown" class="btn btn-link">
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu">
@ -101,7 +101,7 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<li id="online-user-list">
<a class="ui-status" data-target="#" data-toggle="dropdown">
<a class="ui-status" data-toggle="dropdown">
<span class="label label-danger"><i class="fa fa-plug"></i> OFFLINE</span>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu" style="right: 15px;width: 200px;">
@ -120,7 +120,7 @@
</a>
</li>
<li>
<a data-target="#" data-toggle="dropdown">
<a data-toggle="dropdown">
Menu <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu list" role="menu" aria-labelledby="menu">

View file

@ -15,7 +15,7 @@
<link rel="icon" type="image/png" href="{{{url}}}/favicon.png">
<link rel="apple-touch-icon" href="{{{url}}}/apple-touch-icon.png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css">
@ -26,9 +26,9 @@
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.2.0/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js"></script>
<![endif]-->
</head>
@ -36,7 +36,7 @@
{{{html}}}
<div class="ui-toc dropup unselectable hidden-print" style="display:none;">
<div class="pull-right dropdown">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-target="#" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
<ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
@ -47,8 +47,8 @@
<div id="toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:17px;display:none;" {{{lang}}} {{{dir}}}>
{{{toc-affix}}}
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" defer></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.5/gist-embed.min.js" defer></script>
<script>
var markdown = $(".markdown-body");

View file

@ -16,7 +16,7 @@
<!-- Bootstrap core CSS -->
<% if(useCDN) { %>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.9.0/bootstrap-social.min.css">
<% } else { %>
@ -154,9 +154,9 @@
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<% if(useCDN) { %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js" defer></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js" defer></script>
<script src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js" defer></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" defer></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment-with-locales.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-url/2.3.0/url.min.js" defer></script>

View file

@ -18,7 +18,7 @@
<link rel="icon" type="image/png" href="<%- url %>/favicon.png">
<link rel="apple-touch-icon" href="<%- url %>/apple-touch-icon.png">
<% if(useCDN) { %>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css">
@ -40,9 +40,9 @@
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.2.0/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js"></script>
<![endif]-->
</head>
@ -64,7 +64,7 @@
<div id="doc" class="container markdown-body"><%- body %></div>
<div class="ui-toc dropup unselectable hidden-print" style="display:none;">
<div class="pull-right dropdown">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-target="#" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
<i class="fa fa-bars"></i>
</a>
<ul id="toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
@ -79,8 +79,8 @@
MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }});
</script>
<% if(useCDN) { %>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" defer></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.6.1/js-yaml.min.js" defer></script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment-with-locales.min.js" defer></script>

View file

@ -54,7 +54,7 @@
MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }});
</script>
<% if(useCDN) { %>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.6.1/js-yaml.min.js" defer></script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>

View file

@ -6,7 +6,7 @@
<div class="status-indicators">
<div class="status-length"></div>
<div class="status-keymap dropup pull-right">
<a id="keymapLabel" class="ui-keymap-label text-uppercase" data-target="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="Click to change keymap">
<a id="keymapLabel" class="ui-keymap-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" title="Click to change keymap">
Sublime
</a>
<ul class="dropdown-menu" aria-labelledby="keymapLabel">
@ -21,10 +21,10 @@
<input class="indent-width-input hidden" type="number" min="1" max="10" maxlength="2" size="2">
</div>
<div class="status-theme">
<a class="ui-theme-toggle" data-target="#" title="Toggle editor theme"><i class="fa fa-sun-o fa-fw"></i></a>
<a class="ui-theme-toggle" title="Toggle editor theme"><i class="fa fa-sun-o fa-fw"></i></a>
</div>
<div class="status-spellcheck">
<a class="ui-spellcheck-toggle" data-target="#" title="Toggle spellcheck"><i class="fa fa-check fa-fw"></i></a>
<a class="ui-spellcheck-toggle" title="Toggle spellcheck"><i class="fa fa-check fa-fw"></i></a>
</div>
</div>
</div>