Skip to content

Commit

Permalink
Uppercase according to [IETF](http://tools.ietf.org/html/rfc3629#sect…
Browse files Browse the repository at this point in the history
…ion-4)

Applies to #198 and #200

**NOTE**
* Why is there a `defer` flag for ace? Could be related to #148
* Currently ignoring `./public/js`
  • Loading branch information
Martii committed Jun 26, 2014
1 parent 775428a commit 780fd54
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (process.env.NODE_ENV === 'production') {
scripts.forEach(function (script) {
//console.log(script.installName);
var oldPath = script.installName;
var newPath = cleanFilename(script.author) + '/'
var newPath = cleanFilename(script.author) + '/'
+ cleanFilename(script.name) + (script.isLib ? '.js' : '.user.js');
var newCat = (script.isLib ? 'libs' : 'scripts') + '/' + newPath
.replace(/(\.user)?\.js$/, '') + '/issues';
Expand All @@ -48,7 +48,7 @@ if (process.env.NODE_ENV === 'production') {
discussion.save(function (){ console.log(newCat, path); });
});
});
var params = {
Bucket: bucketName,
CopySource: bucketName + '/' + oldPath,
Expand All @@ -60,7 +60,7 @@ if (process.env.NODE_ENV === 'production') {
if (err) { return console.log(oldPath + ' - copy fail'); }
script.save(function () {});
s3.deleteObject({ Bucket : params.Bucket, Key : oldPath},
s3.deleteObject({ Bucket : params.Bucket, Key : oldPath},
function (err, data) {
if (err) {
console.log(oldPath + '- delete fail');
Expand All @@ -79,7 +79,7 @@ function getInstallName (req) {
exports.getInstallName = getInstallName;

function caseInsensitive (installName) {
return new RegExp('^' + installName.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1")
return new RegExp('^' + installName.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1")
+ '$', 'i');
}
exports.caseInsensitive = caseInsensitive;
Expand Down Expand Up @@ -112,7 +112,7 @@ exports.sendScript = function (req, res, next) {
if (!script) { return next(); }

// Send the script
res.set('Content-Type', 'text/javascript; charset=utf-8');
res.set('Content-Type', 'text/javascript; charset=UTF-8');
stream.pipe(res);

// Don't count installs on libraries
Expand All @@ -134,7 +134,7 @@ exports.sendMeta = function (req, res, next) {

if (!script) { return next(); }

res.set('Content-Type', 'text/javascript; charset=utf-8');
res.set('Content-Type', 'text/javascript; charset=UTF-8');
meta = script.meta;

res.write('// ==UserScript==\n');
Expand Down
2 changes: 1 addition & 1 deletion libs/muExpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function renderFile(res, path, options) {
// If you need to render a file with a different content
// type, do it directly on the response object
if (process.env.NODE_ENV !== 'production') { mu.clearCache(); }
res.set('Content-Type', 'text/html; charset=utf-8');
res.set('Content-Type', 'text/html; charset=UTF-8');
mu.compileAndRender(path, options).pipe(res);
}

Expand Down
2 changes: 1 addition & 1 deletion views/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{{title}}</title>
<link rel="shortcut icon" href="/images/favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Squada+One' rel='stylesheet' type='text/css'>
Expand Down
4 changes: 2 additions & 2 deletions views/includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
</footer>

<!-- JS -->
<script type="text/javascript" charset="utf-8" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" defer src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" charset="UTF-8" defer src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
2 changes: 1 addition & 1 deletion views/includes/head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<meta charset="utf-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{#pageMetaDescription}}<meta name="description" content="{{pageMetaDescription}}">{{/pageMetaDescription}}
Expand Down
2 changes: 1 addition & 1 deletion views/pages/scriptViewSourcePage.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
{{> includes/footer.html }}
<!-- Script Editor -->
<script type="text/javascript" charset="utf-8" defer src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script type="text/javascript" charset="UTF-8" defer src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>

This comment has been minimized.

Copy link
@sizzlemctwizzle

sizzlemctwizzle Jun 27, 2014

Member

@Zren

Is there a reason we are using the "defer" attribute here? Are we gaining anything by waiting to execute this script until the page loads? Is that guaranteed to happen before the document ready event fires below?

<script type="text/javascript">
$(document).ready(function () {
var editor = ace.edit("editor");
Expand Down
4 changes: 2 additions & 2 deletions views/scriptEditor.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{> header.html}}
<style type="text/css">
#editor {
#editor {
position: relative;
width: 70%;
height: 550px;
Expand All @@ -10,7 +10,7 @@
</style>
<div id="main">
<pre id="editor">{{source}}</pre>
<script src="/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/ace/ace.js" type="text/javascript" charset="UTF-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/dawn");
Expand Down

0 comments on commit 780fd54

Please sign in to comment.