htdocs: move inline JS to a separate file.

This commit is contained in:
XhmikosR 2013-07-31 14:24:05 +03:00 committed by Daniel Marjamäki
parent 6f278b9131
commit 3a9740b110
8 changed files with 50 additions and 45 deletions

View File

@ -14,28 +14,9 @@ uninitialized variables, unused functions" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="Project News" <link rel="alternate" type="application/rss+xml" title="Project News"
href="http://sourceforge.net/p/cppcheck/news/feed" /> href="http://sourceforge.net/p/cppcheck/news/feed" />
<script type="text/javascript"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
function addFile() { <script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script>
var name = prompt("Name of library/platform/etc", ""); <script src="/site/js/pack.js" type="text/javascript"></script></head>
if (name != null)
window.location = "http://cppcheck.sourceforge.net/cgi-bin/addfile.cgi?name=" + name;
}
function editFile(name,version) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/edit.cgi?name=" + name + "&version=" + version;
}
function renameFile(name1,version) {
var name2 = prompt("Name", name1);
if (name2 != null)
window.location = "http://cppcheck.sourceforge.net/cgi-bin/renamefile.cgi?name1=" + name1 + "&name2=" + name2;
}
function deleteFile(name,version) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/deletefile.cgi?name=" + name + "&version=" + version;
}
</script>
</head>
<body> <body>
<div id="header"> <div id="header">
<div class="wrap"> <div class="wrap">

View File

@ -6,15 +6,9 @@
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Orbitron&amp;text=Cppcheck" /> <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Orbitron&amp;text=Cppcheck" />
<link rel="stylesheet" type="text/css" href="/site/css/pack.css" /> <link rel="stylesheet" type="text/css" href="/site/css/pack.css" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<script type="text/javascript"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
function checkCodeLength() { <script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script>
if (document.f.code.value.length > 1024) { <script src="/site/js/pack.js" type="text/javascript"></script>
alert('code length exceeded');
return false;
}
return true;
}
</script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">

View File

@ -68,11 +68,6 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script> <script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script>
<script src="/site/js/pack.js" type="text/javascript"></script> <script src="/site/js/pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#resultsTable').tableFilter();
});
</script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">

View File

@ -13,11 +13,6 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script> <script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="/site/js/jquery-1.10.2.min.js"><\/script>')</script>
<script src="/site/js/pack.js" type="text/javascript"></script> <script src="/site/js/pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("#github-commits").listCommits("danmar", "cppcheck", "master");
});
</script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">

View File

@ -0,0 +1,39 @@
/* jshint unused:false, jquery:true */
function addFile() {
var name = prompt("Name of library/platform/etc", "");
if (name !== null) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/addfile.cgi?name=" + name;
}
}
function editFile(name, version) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/edit.cgi?name=" + name + "&version=" + version;
}
function renameFile(name1, version) {
var name2 = prompt("Name", name1);
if (name2 !== null) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/renamefile.cgi?name1=" + name1 + "&name2=" + name2;
}
}
function deleteFile(name, version) {
window.location = "http://cppcheck.sourceforge.net/cgi-bin/deletefile.cgi?name=" + name + "&version=" + version;
}
function checkCodeLength() {
if (document.f.code.value.length > 1024) {
alert("Code length exceeded.");
return false;
}
return true;
}
$(document).ready(function() {
$("#resultsTable").tableFilter();
});
$(function() {
$("#github-commits").listCommits("danmar", "cppcheck", "master");
});

File diff suppressed because one or more lines are too long

View File

@ -53,7 +53,8 @@
echo(); echo();
echo("### Minifying js files..."); echo("### Minifying js files...");
var inJs = cat(["js/github.js", var inJs = cat(["js/cppcheck.js",
"js/github.js",
"js/picnet.table.filter.min.js"]); "js/picnet.table.filter.min.js"]);
var minifiedJs = UglifyJS.minify(inJs, { var minifiedJs = UglifyJS.minify(inJs, {

View File

@ -32,7 +32,7 @@ if (!test("-f", jshintBin)) {
exit(1); exit(1);
} }
if (exec("node" + " " + jshintBin + " " + "make.js run-tests.js js/github.js").code !== 0) { if (exec("node" + " " + jshintBin + " " + "make.js run-tests.js js/cppcheck.js js/github.js").code !== 0) {
echo("*** JSHint failed! (return code != 0)"); echo("*** JSHint failed! (return code != 0)");
echo(); echo();
} else { } else {