-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
194 lines (169 loc) · 7.82 KB
/
index.html
File metadata and controls
194 lines (169 loc) · 7.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html>
<head>
<title>Should I Share My Code?</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Description" content="Check if your code is good enough to share publicly.">
<meta name="robots" content="ALL">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js"></script>
<!-- <script type="text/javascript" src="http://jquery.bassistance.de/validate/jquery.validate.js"></script> -->
<!-- <script type="text/javascript" src="http://jquery.bassistance.de/validate/additional-methods.js"></script> -->
<script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="style.css" rel="stylesheet" type="test/css">
<script type="text/javascript">
// Get a user file.
var input = $( "input:file" );
// Upload and analyse code.
function analyse() {
replace('#loading', '#analysing', 1000);
var randomnumber=Math.floor((Math.random()*5)+1);
var url=$("input[name='src_url']").val();
if (url.match('http://shouldisharemyco.de')) {
replace('#analysing', '#OSHC', 2000);
} else if (url.match('http://www.shouldisharemyco.de')) {
replace('#analysing', '#OSHC', 2000);
} else if (url.indexOf("hackerorslacker") != -1) {
// #CW14FLAMEWAR.
replace('#analysing', '#NO', 2000);
} else if (randomnumber==5) {
replace('#analysing', '#maybe', 2000);
replace('#maybe', '#done', 3000);
} else {
replace('#analysing', '#done', 2000);
}
};
// Hide divA and show divB.
function replace(divA, divB, t) {
setTimeout(
function() {
// Don't use replaceWith so resetting the page is easy!
$(divA).hide()
$(divB).show()
},
t
);
};
function reset() {
// Does it look like I know no javascript? Really?
$('#loading').hide();
$('#analysing').hide();
$('#done').hide();
$('#maybe').hide();
$('#OSHC').hide();
$('#NO').hide();
};
$(document).ready(function(){
reset();
jQuery.validator.setDefaults({
debug: true,
success: "valid"
});
// Ensure user enters *something*
var srcform = $( "#src_form");
srcform.validate({
rules: {
src_upload: {
require_from_group: [1, ".src"]
},
src_url: {
require_from_group: [1, ".src"]
},
}
});
// Submission.
$("#show").click(function(){
$('.dummy').hide();
if (srcform.valid()) {
reset();
$("#loading").show();
analyse();
}
});
});
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-49498120-1', 'shouldisharemyco.de');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="page-header">
<h1 class="text-center">Should I Share My Code?</h1>
</div>
<p>Unsure if your code is good enough or useful enough to share? Simply upload your code (any language in a zip file, tarball or a single file, using any compression algorithm if you like) or point to a online repository and we'll analyse your code and let you know.
</p>
<div class="form">
<form id="src_form" class="vspace" action="">
<!-- For styling see http://www.abeautifulsite.net/blog/2013/08/whipping-file-inputs-into-shape-with-bootstrap-3/ -->
<fieldset>
<label class="sr-only" for="src_upload">Source upload: </label>
<input class="src form-control" type="file" name="src_upload" id="src_upload">
<label class="error valid dummy" for="src_upload"></label>
</fieldset>
<p class="vspace text-center"><strong>or</strong></p>
<!-- The label element for errors brings an additional 14px of vspace, so balance that out. -->
<div class="fake_label"></div>
<fieldset>
<label class="sr-only" for="src_url">Repository URL: </label>
<input class="src form-control" type="url" name="src_url" id="src_url" placeholder="Repository URL">
<label class="error valid dummy" for="src_url"></label>
</fieldset>
</form>
</div>
<div class="text-center">
<button id="show" class="btn">Submit</button>
</div>
<div id="loading" class="share text-center">
<!-- Image from www.opengraphicdesign.com (CC-BY) -->
<img src="loaderB64.gif" alt="rotating arrows">
<p>Loading...</p>
</div>
<div id="analysing" class="share text-center">
<!-- Image from www.opengraphicdesign.com (CC-BY) -->
<img src="loaderB64.gif" alt="rotating arrows">
<p>Analysing...</p>
</div>
<div id="done" class="share text-center">
<p>YES</p>
</div>
<div id="maybe" class="share text-center">
<p>Maybe...</p>
</div>
<div id="OSHC" class="share text-center">
<p>HELL YES</p>
</div>
<div id="NO" class="share text-center">
<p>For the good of humanity, best not.</p>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<hr>
<p class="text-muted">By <a href="https://github.com/OpenSourceHealthCheck">OpenSourceHealthCheck</a>. Read the <a href="legalstuff.html">legal stuff</a>.</p>
<p class="text-muted"><a href="http://www.opengraphicdesign.com/web/ajax-loading-graphics/">Loading image</a> by <a href="http://www.opengraphicdesign.com">OpenGraphicDesign</a>. Used under <a href="http://creativecommons.org/licenses/by/3.0/deed.en">Creative Commons - Attribution</a>.</p>
</div>
</div>
</div>
</div>
</body>
</html>