List of commits:
Subject Hash Author Date (UTC)
Added new views e4ba7fc0daf2c8a9200a76e8d122ea52a9e56972 EyadMohammedOsama 2019-08-04 23:12:09
Added a helper file 86cd8e39ae94a78b3caa4e5eedea0f465c5716dd EyadMohammedOsama 2019-08-04 23:11:00
Deleted some files 9c2486581af5e537a7f9ffa64b2b02e8c9d5f42e EyadMohammedOsama 2019-08-02 23:30:55
Updated to ignore Thumbs.db files 3baa87ecef6d298d4a8a2904baf08f7102f23074 EyadMohammedOsama 2019-08-01 21:27:32
Added SnackBar library 99f7cc6ce12deccc4c37ff89eb54d49e0e48d9c9 EyadMohammedOsama 2019-08-01 21:25:47
Added custom style file 99bb9924d4314c9e42be2f3be869b04aeaec134c EyadMohammedOsama 2019-08-01 21:25:28
Added Index view 667711e6118a09a284371bc12fc29c767ded5e9c EyadMohammedOsama 2019-08-01 21:25:18
Added layout views a2c90b3e7b9f5ff340ac8e59a5b48d89758681c1 EyadMohammedOsama 2019-08-01 21:25:08
Added Index controller 9dd0b66b1b62d562af373cfcc3bcf78d250f5ee3 EyadMohammedOsama 2019-08-01 21:24:43
Added Index router 3ff42e9e886700b0bde981bbe2e3c2252215b575 EyadMohammedOsama 2019-08-01 21:24:33
Added carousel images cb9537d5fcf4df2aa2d7ddddaeec4eacc179f84c EyadMohammedOsama 2019-08-01 21:24:03
Updated to skip /public/avatars 00aae37be4441d132f567125ac52dcbb7fea8173 EyadMohammedOsama 2019-08-01 21:23:26
Initial Commit 85fd17c94da1aae46dbd6c80b5376a4dcc4b15ef EyadMohammedOsama 2019-08-01 20:45:13
Commit e4ba7fc0daf2c8a9200a76e8d122ea52a9e56972 - Added new views
Author: EyadMohammedOsama
Author date (UTC): 2019-08-04 23:12
Committer name: EyadMohammedOsama
Committer date (UTC): 2019-08-04 23:12
Parent(s): 86cd8e39ae94a78b3caa4e5eedea0f465c5716dd
Signing key:
Tree: 29aa2f903927a99017cd0f0b51e696b3094644e2
File Lines added Lines deleted
resources/views/About.blade.php 98 0
resources/views/Fiddle.blade.php 615 0
resources/views/Fiddles.blade.php 23 0
resources/views/Layout/Navbar.blade.php 4 4
resources/views/Login.blade.php 95 0
resources/views/TermsOfService.blade.php 16 0
resources/views/User.blade.php 82 0
resources/views/UserProfile/AvatarUploadForm.blade.php 13 0
resources/views/UserProfile/FavoriteFiddles.blade.php 21 0
resources/views/UserProfile/Info.blade.php 47 0
resources/views/UserProfile/LatestFiddles.blade.php 21 0
resources/views/UserProfile/PrivateFiddles.blade.php 21 0
resources/views/UserProfile/Script.blade.php 160 0
resources/views/UserProfile/Settings.blade.php 46 0
resources/views/Users.blade.php 24 0
File resources/views/About.blade.php added (mode: 100644) (index 0000000..2fc2957)
1 <div class="container-fluid">
2 <h1 class="text-center">About SICSF<h1>
3 <h3>What is SICSF?</h3>
4 <p>The acronym <b>SICSF</b> stands for <b>S</b>yrian <b>I</b>nformative <b>C</b>lient <b>S</b>ide <b>F</b>iddle.</p>
5 <p>SICSF is a web application built with simplicity and ease in mind to help people save and share their client side code online.</p>
6 <p>In this context, client side code is HTML,CSS & JavaScript. </p>
7 <p>Registered users can create, update, delete, share, and favorite fiddles, also they can edit their profiles, they have the ability to add links for their accounts on some social networks, like Facebook, plus the ability to add a biography to describe themselves in a nice formatted way using special codes.</p>
8 <p>If you have any questions, errors, suggestions, please visit the offical github repository, <a href="https://github.com/Eyad-Mohammed-Osama/SICSF-Alternative" target="_blank">SICSF-Alternative</a> (warning: opens in new tab), and act their according to the document on the main page.</p>
9 <h3>Features</h3>
10 <p>Here's a list of the features of SICSF:</p>
11 <ul>
12 <li>Easy-to-use and user friendly UI.</li>
13 <li>A wide set of options and settings.</li>
14 <li>A customizable editor.</li>
15 <li>Offline support for cases where you loose your internet connection.</li>
16 </ul>
17 <h3>Formatting codes</h3>
18 <p>In your profile page, there's an <code>About</code> tab that contains your biography, the contents in this area can be formatted to look nice and beautiful, here's a list of the supported formatting codes:</p>
19 <div class="table-responsive">
20 <table class="table table-hover">
21 <tr>
22 <th>Code</th>
23 <th>Example</th>
24 <th>Output</th>
25 </tr>
26 <tr>
27 <td>[url]</td>
28 <td><code>[url]http://www.example.com[/url]</code></td>
29 <td><a href="http://www.example.com" target="_blank">http://www.example.com</a></td>
30 </tr>
31 <tr>
32 <td>[bold]</td>
33 <td><code>[bold]This is a bold text[/bold]</code></td>
34 <td><b>This is a bold text</b></td>
35 </tr>
36 <tr>
37 <td>[italic]</td>
38 <td><code>[italic]This is an italic text[/italic]</code></td>
39 <td><i>This is an italic text</i></td>
40 </tr>
41 <tr>
42 <td>[underlined]</td>
43 <td><code>[underlined]This is an underlined text[/underlined]</code></td>
44 <td><u>This is an italic text</u></td>
45 </tr>
46 <tr>
47 <td>[center]</td>
48 <td><code>[center]This is an centered text[/center]</code></td>
49 <td><div class="text-center">This is an centered text</div></td>
50 </tr>
51 <tr>
52 <td>[right]</td>
53 <td><code>[right]This is a right aligned text[/right]</code></td>
54 <td><div class="text-right">This is a right aligned text</div></td>
55 </tr>
56 <tr>
57 <td>[left]</td>
58 <td><code>[left]This is a left aligned text[/left]</code></td>
59 <td><div class="text-left">This is a left aligned text</div></td>
60 </tr>
61 <tr>
62 <td>[uppercase]</td>
63 <td><code>[uppercase]This is an upper case text[/uppercase]</code></td>
64 <td><span class="text-uppercase">This is an upper case text</span></td>
65 </tr>
66 <tr>
67 <td>[lowercase]</td>
68 <td><code>[lowercase]This is an upper case text[/lowercase]</code></td>
69 <td><span class="text-lowercase">THIS IS A LOWER CASE TEXT</span></td>
70 </tr>
71 <tr>
72 <td>[capitalized]</td>
73 <td><code>[capitalized]This is a capitalized text[/capitalized]</code></td>
74 <td><span class="text-capitalize">This is a capitalized text</span></td>
75 </tr>
76 <tr>
77 <td>[color]</td>
78 <td><code>[color=0000ff]This is a blue text[/color]</code></td>
79 <td><span style="color:#0000ff;">This is a blue text</span></td>
80 </tr>
81 <tr>
82 <td>[background]</td>
83 <td><code>[background=00ff7f]This text has a spring green background[/background]</code></td>
84 <td><span style="background-color:#00ff7f;">This text has a spring green background</span></td>
85 </tr>
86 <tr>
87 <td>[youtube]</td>
88 <td><code>[youtube]https://www.youtube.com/watch?v=phL6fDiYNJk[/youtube]</code></td>
89 <td>
90 <div class="embed-responsive embed-responsive-16by9">
91 <iframe src="https://www.youtube.com/embed/phL6fDiYNJk" class="embed-responsive-item border border-0"></iframe>
92 </div>
93 </td>
94 </tr>
95 </table>
96 </div>
97 <br/>
98 </div>
File resources/views/Fiddle.blade.php added (mode: 100644) (index 0000000..e488b7f)
1 <style>
2 #code, #result {
3 width:100%;
4 height:300px;
5 }
6
7 #result {
8 background-color: white;
9 border:0;
10 }
11
12 .example {
13 background-color:#f1f1f1;
14 padding:0.01em 16px;
15 margin:20px 0;
16 box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;
17 }
18
19 #code {
20 width:auto;
21 padding:8px 12px;
22 border-left:4px solid #2F3129;
23 font-size:20px;
24 }
25 </style>
26
27 <h5 class="text-center">{!! $fiddle_header !!}</h5>
28 <div class="container">
29 <div class="row example">
30 <div class="col-md-6">
31 <div id="code" class="mt-4 mb-3"></div>
32 </div>
33 <div class="col-md-6">
34 <iframe id="result" srcdoc="{!! htmlspecialchars($code) !!}" class="mt-4 mb-3" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>
35 </div>
36 <button class="btn btn-dark btn-block" id="run-fiddle">Run <span class="fa fa-gear"></span></button>
37 <?php
38 if (isset($_SESSION["username"])) {
39 if (empty($id)) {
40 ?>
41 <button class="btn btn-dark btn-block mt-2" id="save-fiddle">Save <span class="fa fa-save"></span></button>
42 <?php
43 }
44 if (!empty($id)) {
45 $Owner = $FiddleInfo->Username;
46 if ($Owner !== $_SESSION["username"]) {
47 if ($this->Fiddles->IsFavoriteFiddle($_SESSION["username"], $id)) {
48 ?>
49 <button class="btn btn-dark btn-block mt-2" id="unfavorite-fiddle">Unfavorite <span class="fa fa-star"></span></button>
50 <?php
51 }
52 else {
53 ?>
54 <button class="btn btn-dark btn-block mt-2" id="favorite-fiddle">Favorite <span class="fa fa-star-o"></span></button>
55 <?php
56 }
57 }
58
59 if ($Owner === $_SESSION["username"]) {
60 ?>
61 <button class="btn btn-dark btn-block mt-2" id="update-fiddle">Update <span class="fa fa-edit"></span></button>
62 <button class="btn btn-dark btn-block mt-2" id="delete-fiddle">Delete <span class="fa fa-trash"></span></button>
63 <?php
64 }
65 }
66 }
67
68 if (!empty($id) && ((empty($_SESSION["username"])) || (isset($_SESSION["username"]) && $_SESSION["username"] !== $this->Fiddles->GetFiddle($id)["Username"]))) {
69 ?>
70 <button class="btn btn-dark btn-block mt-2" id="report-fiddle">Report <span class="fa fa-exclamation-triangle"></span></button>
71 <?php
72 }
73 ?>
74 <div id="message" class="w-100 text-center mt-2"></div>
75 <div class="h-25">&nbsp;</div>
76 </div>
77 </div>
78
79 <div class="modal fade" id="save-modal">
80 <div class="modal-dialog">
81 <div class="modal-content">
82 <div class="modal-header">
83 <h4 class="modal-title text-center">Save fiddle</h4>
84 <button type="button" class="close" data-dismiss="modal"><span class="fa fa-times"></span></button>
85 </div>
86
87 <div class="modal-body">
88 <p>Your fiddle will now be saved, please fill the following form to complete.</p>
89 <table class="table">
90 <tr>
91 <td>Enter fiddle title: </td>
92 <td><input type="text" class="form-control" id="title"/></td>
93 </tr>
94 <tr>
95 <td>Choose privacy: </td>
96 <td>
97 <select class="form-control" id="privacy">
98 <option value="Public">Public</option>
99 <option value="Private">Private</option>
100 </select>
101 </td>
102 </tr>
103 </table>
104 <button class="btn btn-block btn-dark" id="save-fiddle-button">
105 Okay <span class="fa fa-check"></span>
106 </button>
107 <br/>
108 <div id="save-result"></div>
109 </div>
110
111 <div class="modal-footer">
112 &nbsp;
113 </div>
114 </div>
115 </div>
116 </div>
117
118 <div class="modal fade" id="update-modal">
119 <?php
120 $PrivacyOption = empty($FiddleInfo->Privacy) ? "Public" : ($FiddleInfo->Privacy);
121 ?>
122 <div class="modal-dialog">
123 <div class="modal-content">
124 <div class="modal-header">
125 <h4 class="modal-title text-center">Update fiddle</h4>
126 <button type="button" class="close" data-dismiss="modal"><span class="fa fa-times"></span></button>
127 </div>
128
129 <div class="modal-body">
130 <p>Your fiddle will now be updated, please fill the following form to complete.</p>
131 <table class="table">
132 <tr>
133 <td>Enter fiddle title: </td>
134 <td><input type="text" class="form-control" id="update-title" value="{{ empty($FiddleInfo->Title) ? "" : ($FiddleInfo->Title) }}"/></td>
135 </tr>
136 <tr>
137 <td>Choose privacy: </td>
138 <td>
139 <select class="form-control" id="update-privacy">
140 <option value="Public" {{ $PrivacyOption === 'Public' ? 'selected' : '' }} >Public</option>
141 <option value="Private" {{ $PrivacyOption === 'Private' ? 'selected' : '' }}>Private</option>
142 </select>
143 </td>
144 </tr>
145 </table>
146 <button class="btn btn-block btn-dark" id="update-fiddle-button">
147 Okay <span class="fa fa-check"></span>
148 </button>
149 <br/>
150 <div id="update-result"></div>
151 </div>
152
153 <div class="modal-footer">
154 &nbsp;
155 </div>
156 </div>
157 </div>
158 </div>
159
160 <div class="modal fade" id="delete-modal">
161 <div class="modal-dialog">
162 <div class="modal-content">
163 <div class="modal-header">
164 <h4 class="modal-title text-center">Delete fiddle</h4>
165 <button type="button" class="close" data-dismiss="modal"><span class="fa fa-times"></span></button>
166 </div>
167
168 <div class="modal-body">
169 <b class="text-danger">DANGER:</b>
170 <p class="text-danger">You're about to delete this fiddle.<br>This action CANNOT be undone.</p>
171 <p>Do you wish to delete this fiddle ?</p>
172 <button class="btn btn-block btn-success" id="delete-fiddle-button">
173 Yes <span class="fa fa-check"></span>
174 </button>
175 <button class="btn btn-block btn-danger" onclick="$('#delete-modal').modal('hide');">
176 No <span class="fa fa-times"></span>
177 </button>
178 <br/>
179 <div id="delete-result"></div>
180 </div>
181
182 <div class="modal-footer">
183 &nbsp;
184 </div>
185 </div>
186 </div>
187 </div>
188
189 <div class="modal fade" id="report-modal">
190 <div class="modal-dialog">
191 <div class="modal-content">
192 <div class="modal-header">
193 <h4 class="modal-title text-center">Report fiddle</h4>
194 <button type="button" class="close" data-dismiss="modal"><span class="fa fa-times"></span></button>
195 </div>
196
197 <div class="modal-body">
198 <p>Have you found anything wrong with this fiddle ?</p>
199 <p>If so please report this fiddle immediately, but first please tell me why do you want to report it:</p>
200 <textarea class="form-control" rows="5" id="report-reason"></textarea>
201 <br/>
202 <button class="btn btn-block btn-dark" id="report-fiddle-button">
203 Send <span class="fa fa-envelope"></span></button>
204 </button>
205 <br/>
206 <div id="report-result"></div>
207 </div>
208
209 <div class="modal-footer">
210 &nbsp;
211 </div>
212 </div>
213 </div>
214 </div>
215
216 <script>
217 $(document).ready(function() {
218 var editor = ace.edit("code");
219 editor.setTheme("ace/theme/monokai");
220 editor.session.setMode("ace/mode/php");
221 editor.session.setUseWrapMode(true);
222
223 var code = null;
224 <?php
225 if ($show_index) {
226 ?>
227 if (typeof(localStorage["code-backup"]) !== typeof(undefined)) {
228 code = localStorage["code-backup"];
229 editor.session.setValue(code);
230 }
231 <?php
232 }
233 else {
234 ?>
235 code = <?php echo(json_encode($code)); ?>;
236 var ID = "{{ $id }}";
237 editor.session.setValue(code);
238 <?php
239 }
240 ?>
241
242 $("#run-fiddle").on("mouseover", function() {
243 $("#run-fiddle > .fa.fa-gear").addClass("fa-spin")
244 });
245
246 $("#run-fiddle").on("mouseout", function() {
247 $("#run-fiddle > .fa.fa-gear").removeClass("fa-spin")
248 });
249
250 $("#run-fiddle").on("click", function() {
251 $("#result").attr("srcdoc", editor.session.getValue());
252 });
253
254 $("#save-fiddle").on("click", function() {
255 $("#save-modal").modal("show");
256 });
257
258 $("#report-fiddle").on("click", function() {
259 $("#report-modal").modal("show");
260 });
261
262 $("#update-fiddle").on("click", function() {
263 $("#update-modal").modal("show");
264 });
265
266 $("#delete-fiddle").on("click", function() {
267 $("#delete-modal").modal("show");
268 });
269
270 $("#save-fiddle-button").on("click", function() {
271 var Code = editor.session.getValue().trim();
272 var Title = $("#title").val().trim();
273 var Privacy = $("#privacy").val().trim();
274
275 var TitlePattern = /^([A-Za-z0-9_\s]){10,200}$/;
276
277 var IsValid = true;
278 var Message = "";
279
280 if (Code.length === 0) {
281 IsValid = false;
282 Message += "Code cannot be empty.<br/>";
283 }
284
285 if (!TitlePattern.test(Title)) {
286 IsValid = false;
287 Message += "Title must only contain alphanumeric characters, underscores, and spaces, and must be between 10 and 200 characters in length.<br/>";
288 }
289
290 if (Privacy !== "Public" && Privacy !== "Private") {
291 IsValid = false;
292 Message += "Privacy must be either 'Public' or 'Private'.<br/>";
293 }
294
295 if (!IsValid) {
296 Message = "<div class='alert alert-danger'>" + Message + "</div>";
297 $("#save-result").html(Message);
298 }
299 else {
300 $.ajax({
301 url : "{{ URL::to('fiddle/save') }}",
302 type : "POST",
303 data : {
304 "_token" : window.CSRFHashToken,
305 "code" : Code,
306 "title" : Title,
307 "privacy" : Privacy
308 },
309 success : function(result, status, xhr) {
310 var Response = JSON.parse(result);
311 window.CSRFHashToken = Response.CSRFHashToken;
312 if (Response.IsValid) {
313 $("#save-modal").modal("hide");
314 Snackbar.show({
315 text : "Your fiddle has been saved successfully.<br/>You will be redirected to it within 5 seconds.",
316 pos : "top-center",
317 backgroundColor : "#212529",
318 actionText : "Dismiss",
319 actionTextColor : "lime",
320 customClass : "mt-5",
321 textColor : "rgba(255, 255, 255, 0.8)",
322 duration : 5000,
323 onClose : function() {
324 var link = "{{ URL::to('fiddle/') }}";
325 link += Response.ID;
326 window.location.href = link;
327 }
328 });
329 }
330
331 delete localStorage["code-backup"];
332 },
333 error : function(xhr, status, error) {
334 $("#save-result").html("<div class='alert alert-danger'>An internal error has occured.<br>Please try again later.<br/>Your code will now be stored locally so that it don't get lost.</div>");
335 localStorage["code-backup"] = Code;
336 }
337 });
338 }
339 });
340
341 $("#update-fiddle-button").on("click", function() {
342 var Code = editor.session.getValue().trim();
343 var Title = $("#update-title").val().trim();
344 var Privacy = $("#update-privacy").val().trim();
345
346 var TitlePattern = /^([A-Za-z0-9_\s]){10,200}$/;
347
348 var IsValid = true;
349 var Message = "";
350
351 if (Code.length === 0) {
352 IsValid = false;
353 Message += "Code cannot be empty.<br/>";
354 }
355
356 if (!TitlePattern.test(Title)) {
357 IsValid = false;
358 Message += "Title must only contain alphanumeric characters, underscores, and spaces, and must be between 10 and 200 characters in length.<br/>";
359 }
360
361 if (Privacy !== "Public" && Privacy !== "Private") {
362 IsValid = false;
363 Message += "Privacy must be either 'Public' or 'Private'.<br/>";
364 }
365
366 if (!IsValid) {
367 Message = "<div class='alert alert-danger'>" + Message + "</div>";
368 $("#update-result").html(Message);
369 }
370 else {
371 $.ajax({
372 url : "{{ URL::to('fiddle/update') }}",
373 type : "POST",
374 data : {
375 "_token" : window.CSRFHashToken,
376 "code" : Code,
377 "title" : Title,
378 "privacy" : Privacy,
379 "ID" : ID
380 },
381 success : function(result, status, xhr) {
382 var Response = JSON.parse(result);
383 window.CSRFHashToken = Response.CSRFHashToken;
384 if (Response.IsValid) {
385 $("#update-modal").modal("hide");
386 Snackbar.show({
387 text : "Your fiddle has been updated successfully.<br/>You will be redirected to it within 5 seconds.",
388 pos : "top-center",
389 backgroundColor : "#212529",
390 actionText : "Dismiss",
391 actionTextColor : "lime",
392 customClass : "mt-5",
393 textColor : "rgba(255, 255, 255, 0.8)",
394 duration : 5000,
395 onClose : function() {
396 window.location.reload();
397 }
398 });
399 }
400
401 delete localStorage["code-backup"];
402 },
403 error : function(xhr, status, error) {
404 $("#save-result").html("<div class='alert alert-danger'>An internal error has occured.<br>Please try again later.<br/>Your code will now be stored locally so that it don't get lost.</div>");
405 localStorage["code-backup"] = Code;
406 }
407 });
408 }
409 });
410
411 $("#delete-fiddle-button").on("click", function() {
412 $.ajax({
413 url : "{{ URL::to('fiddle/delete') }}",
414 type : "POST",
415 data : {
416 "_token" : window.CSRFHashToken,
417 "ID" : ID
418 },
419 success : function(result, status, xhr) {
420 var Response = JSON.parse(result);
421 window.CSRFHashToken = Response.CSRFHashToken;
422 $("#delete-modal").modal("hide");
423 Snackbar.show({
424 text : "Your fiddle has been deleted successfully.",
425 pos : "top-center",
426 backgroundColor : "#212529",
427 actionText : "Dismiss",
428 actionTextColor : "lime",
429 customClass : "mt-5",
430 textColor : "rgba(255, 255, 255, 0.8)",
431 duration : 5000,
432 onClose : function() {
433 window.location.href = "{{ URL::to('/') }}";
434 }
435 });
436 },
437 error : function(xhr, status, error) {
438 $("#delete-result").html("<div class='alert alert-danger'>An internal error has occured.</div>");
439 }
440 });
441 });
442
443 $("#report-fiddle-button").on("click", function() {
444 var ReportReason = $("#report-reason").val();
445
446 var Message = "";
447 var IsValid = true;
448
449 if (ReportReason.length > 4000) {
450 Message = "The reason field can't exceed 4000 characters in length.<br/>";
451 IsValid = false;
452 }
453
454 if (!IsValid) {
455 Message = "<div class='alert alert-danger'>" + Message + "</div>";
456 $("#report-result").html(Message);
457 }
458 else {
459 $.ajax({
460 url : "{{ URL::to('fiddle/report') }}",
461 type : "POST",
462 data : {
463 "_token" : window.CSRFHashToken,
464 "ID" : ID,
465 "ReportReason" : ReportReason
466 },
467 success : function(result, status, xhr) {
468 var Response = JSON.parse(result);
469 window.CSRFHashToken = Response.CSRFHashToken;
470 $("#report-modal").modal("hide");
471 Snackbar.show({
472 text : "This fiddle has been reported successfully.<br/>Sorry for your inconvenience.",
473 pos : "top-center",
474 backgroundColor : "#212529",
475 actionText : "Dismiss",
476 actionTextColor : "lime",
477 customClass : "mt-5",
478 textColor : "rgba(255, 255, 255, 0.8)",
479 duration : 5000,
480 onClose : function() {
481 window.location.href = "{{ URL::to('/') }}";
482 }
483 });
484 },
485 error : function(xhr, status, error) {
486 $("#report-result").html("<div class='alert alert-danger'>An internal error has occured.<br/>Please try again later.</div>");
487 }
488 });
489 }
490 });
491
492 $("#favorite-fiddle").on("click", function() {
493 var IDPattern = /^([0-9a-f]){32}\-([0-9a-f]){32}$/;
494
495 var IsValid = true;
496 var Message = "";
497
498 if (!IDPattern.test(ID)) {
499 Message += "Fiddle ID doesn't match specified pattern.";
500 IsValid = false;
501 }
502
503 if (!IsValid) {
504 Message += "<div class='alert alert-danger'>" + Message + "</div>";
505 $("#message").html(Message);
506 }
507 else {
508 $("#message").html("");
509 $.ajax({
510 type : "POST",
511 url : "{{ URL::to('fiddle/favorite') }}",
512 data : {
513 "_token" : window.CSRFHashToken,
514 "ID" : ID
515 },
516 success : function(result) {
517 var Response = JSON.parse(result);
518 window.CSRFHashToken = Response.CSRFHashToken;
519 if (Response.IsValid) {
520 Snackbar.show({
521 text : "This fiddle has been favorited successfully.<br/>You can find it under \"Favorite fiddles\" tab in your profile.",
522 pos : "top-center",
523 backgroundColor : "#212529",
524 actionText : "Dismiss",
525 actionTextColor : "lime",
526 customClass : "mt-5",
527 textColor : "rgba(255, 255, 255, 0.8)",
528 duration : 5000,
529 onClose : function() {
530 window.location.reload();
531 }
532 });
533 }
534 else {
535 $("#message").html(Response.Message);
536 }
537 },
538 error : function(xhr, status, error) {
539 $("#message").html("<div class='alert alert-danger'>An internal error has occured.<br/>Please try again later.</div>");
540 }
541 });
542 }
543 });
544
545 $("#unfavorite-fiddle").on("click", function() {
546 var IDPattern = /^([0-9a-f]){32}\-([0-9a-f]){32}$/;
547
548 var IsValid = true;
549 var Message = "";
550
551 if (!IDPattern.test(ID)) {
552 Message += "Fiddle ID doesn't match specified pattern.";
553 IsValid = false;
554 }
555
556 if (!IsValid) {
557 Message += "<div class='alert alert-danger'>" + Message + "</div>";
558 $("#message").html(Message);
559 }
560 else {
561 $("#message").html("");
562 $.ajax({
563 type : "POST",
564 url : "{{ URL::to('fiddle/unfavorite') }}",
565 data : {
566 "_token" : window.CSRFHashToken,
567 "ID" : ID
568 },
569 success : function(result) {
570 var Response = JSON.parse(result);
571 window.CSRFHashToken = Response.CSRFHashToken;
572 if (Response.IsValid) {
573 Snackbar.show({
574 text : "This fiddle has been successfully unfavorited.",
575 pos : "top-center",
576 backgroundColor : "#212529",
577 actionText : "Dismiss",
578 actionTextColor : "lime",
579 customClass : "mt-5",
580 textColor : "rgba(255, 255, 255, 0.8)",
581 duration : 5000,
582 onClose : function() {
583 window.location.reload();
584 }
585 });
586 }
587 else {
588 $("#message").html(Response.Message);
589 }
590 },
591 error : function(xhr, status, error) {
592 $("#message").html("<div class='alert alert-danger'>An internal error has occured.<br/>Please try again later.</div>");
593 }
594 });
595 }
596 });
597
598 $(window).bind("keydown", function(e) {
599 if (e.which === 116) {
600 e.preventDefault();
601 $("#run-fiddle").click();
602 }
603 if ((e.ctrlKey || e.metaKey) && e.which !== 67 && e.which !== 86 && e.which !== 65 && e.which !== 90 && e.which !== 88 && e.which !== 89) {
604 e.preventDefault();
605 var key = String.fromCharCode(e.which).toLowerCase();
606 if (key === "s") {
607 $("#save-fiddle").click();
608 }
609 else if (key === "f") {
610 $("#favorite-fiddle").click();
611 }
612 }
613 });
614 });
615 </script>
File resources/views/Fiddles.blade.php added (mode: 100644) (index 0000000..5b80179)
1 <div class="container-fluid">
2 <div class="row">
3 <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
4 <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
5 <table class="table">
6 @foreach ($Fiddles as $Fiddle)
7 <tr>
8 <td>
9 <a href="{{ URL::to('fiddle/' . $Fiddle->ID) }}"><?php echo($Fiddle->Title);?></a>
10 </td>
11 <td>
12 By <a href="{{ URL::to("user/" . $Fiddle->Username) }}">{{ $Fiddle->Username }}</a> on {{ date("Y/m/d h:i:sa", $Fiddle->Date) }}
13 </td>
14 </tr>
15 @endforeach
16 </table>
17 <div class="text-center">
18
19 </div>
20 </div>
21 <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
22 </div>
23 </div>
File resources/views/Layout/Navbar.blade.php changed (mode: 100644) (index c7978e0..a19e57a)
28 28
29 29 <ul class="navbar-nav text-center"> <ul class="navbar-nav text-center">
30 30 <?php <?php
31 if (empty($_SESSION["username"])) {
31 if (!Request::session()->has("username")) {
32 32 ?> ?>
33 33 <li class="nav-item"><a class="nav-link" href="{{ URL::to('signup') }}">Signup <span class="fa fa-user-circle"></span></a></li> <li class="nav-item"><a class="nav-link" href="{{ URL::to('signup') }}">Signup <span class="fa fa-user-circle"></span></a></li>
34 34 <li class="nav-item"><a class="nav-link" href="{{ URL::to('login') }}">Login <span class="fa fa-sign-in"></span></a></li> <li class="nav-item"><a class="nav-link" href="{{ URL::to('login') }}">Login <span class="fa fa-sign-in"></span></a></li>
 
37 37 else { else {
38 38 ?> ?>
39 39 <li class="nav-item"> <li class="nav-item">
40 <a class="nav-link" href="{{ URL::to('user/' . $_SESSION['username']) }}">
41 {{ $_SESSION["username"] }}
40 <a class="nav-link" href="{{ URL::to('user/' . Request::session()->get("username")) }}">
41 {{ Request::session()->get("username") }}
42 42 <span class="fa fa-user-circle"></span> <span class="fa fa-user-circle"></span>
43 43 </a> </a>
44 44 </li> </li>
 
55 55 </nav> </nav>
56 56 <br> <br>
57 57 <?php <?php
58 if (isset($_SESSION["username"])) {
58 if (Request::session()->has("username")) {
59 59 ?> ?>
60 60 <div class="modal fade" id="logout-modal"> <div class="modal fade" id="logout-modal">
61 61 <div class="modal-dialog"> <div class="modal-dialog">
File resources/views/Login.blade.php added (mode: 100644) (index 0000000..c284080)
1 <div class="container-fluid">
2 <div class="row">
3 <div class="col-xs-2 col-sm-2 col-md-3 col-lg-3"></div>
4 <div class="col-xs-8 col-sm-8 col-md-6 col-lg-6 border border-dark rounded">
5 <h2 class="text-center">Login to your account</h2>
6 <br/>
7 <form id="login-form">
8 <div class="form-group">
9 <div class="row">
10 <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">
11 <p>Enter your E-mail:</p>
12 </div>
13 <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">
14 <input type="email" class="form-control" id="email">
15 </div>
16 </div>
17 </div>
18
19 <div class="form-group">
20 <div class="row">
21 <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">
22 <p>Enter your password:</p>
23 </div>
24 <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">
25 <input type="password" class="form-control" id="password">
26 </div>
27 </div>
28 </div>
29
30 <button class="btn btn-block btn-dark">Login</button>
31 <br/>
32 <div id="result"></div>
33 </form>
34 </div>
35 <div class="col-xs-2 col-sm-2 col-md-3 col-lg-3"></div>
36 </div>
37 <br/>
38 </div>
39
40 <script>
41 $(document).ready(function() {
42 $("#login-form").on("submit", function(e) {
43 e.preventDefault();
44 var Email = $("#email").val();
45 var Password = $("#password").val();
46
47 var EmailPattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
48 var PasswordPattern = /^([\S\s]){8,}$/;
49 var IsValid = true;
50 var Message = "";
51
52 if (!EmailPattern.test(Email)) {
53 IsValid = false;
54 Message += "E-mail cannot be empty, and must be formatted correctly.<br>";
55 }
56
57 if (!PasswordPattern.test(Password)) {
58 IsValid = false;
59 Message += "Password must be at least 8 characters in length.<br>";
60 }
61
62 if (!IsValid) {
63 Message = "<div class='alert alert-danger'>" + Message + "</div>";
64 $("#result").html(Message);
65 }
66 else {
67 $.ajax({
68 type : "POST",
69 url : "{{ URL::to('login') }}",
70 data : {
71 "_token" : window.CSRFHashToken,
72 "email" : Email,
73 "password" : Password,
74 },
75 success : function(result, status, xhr) {
76 if ("errors" in result) {
77 if (Array.isArray(result.errors)) {
78 $("#result").html("<div class='alert alert-danger'>" + result.errors.join("<br/>") + "</div>");
79 }
80 else {
81 $("#result").html("<div class='alert alert-danger'>" + result.errors + "</div>")
82 }
83 }
84 else {
85 $("#result").html("<div class='alert alert-success'>" + result.success + "</div>");
86 }
87 },
88 error : function(xhr, status, error) {
89 $("#result").html("<div class='alert alert-danger'>An internal error has occured.<br>Please try again later.</div>")
90 }
91 });
92 }
93 });
94 });
95 </script>
File resources/views/TermsOfService.blade.php added (mode: 100644) (index 0000000..5251ef0)
1 <div class="container-fluid">
2 <h1 class="text-center">SICSF - Terms Of Service</h1>
3 <h3>Terms of service</h3>
4 <p>By using this site and its services you agree to the following conditions:</p>
5 <ul>
6 <li>No offensive content is allowed in any direct or indirect way, this includes what you upload as your avatar, what you save in your fiddles, and any information sent by you.</li>
7 <li>Abusing other users in any way.</li>
8 <li>Content that encourage/support terrorism is strictly forbidden under any circumstances, terrorism is bad and it will always stay like this.</li>
9 <li>Content related to politics is strictly forbidden, the point of this website is to provide client-side code storage, so don't turn it into a battlefield.</li>
10 </ul>
11 <h3>Only you ...</h3>
12 <p>With your help, i can make this website appropriate for everyone.</p>
13 <p><b>Only You</b> can help with this, if you find any content that violates the above terms simply report it and i'll do the rest.</p>
14 <p>Thanks for your help to keep the environment safe and appropriate for all users and visitors.</p>
15 <br/>
16 </div>
File resources/views/User.blade.php added (mode: 100644) (index 0000000..4aaf896)
1 <h2 class="text-center"><?php echo($username);?> - Profile</h2>
2 <br/>
3 <div class="container-fluid">
4 <?php
5 if (!$is_confirmed) {
6 ?>
7 <div class="alert alert-danger">
8 <b>Your account isn't confirmed.</b><br/>
9 <p>A confirmation e-mail was already sent to the e-mail you used to register, please check it and confirm your registeration.</p>
10 </div>
11 <?php
12 }
13
14 $Avatar = isset($UserSettings->Avatar) ? ($UserSettings->Avatar) : ("default.png");
15 $Avatar = URL::to("avatars/" . $Avatar);
16 ?>
17 <div class="row">
18 <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
19 <div class="media">
20 <img src="{{ URL::to($Avatar) }}" style="width:225px;height:225px;" class="mx-auto rounded-circle"/>
21 </div>
22 <br/>
23 <table class="table table-hover">
24 <?php
25 if ($show_authorized) {
26 ?>
27 <tr>
28 <td colspan="2">
29 @include("UserProfile/AvatarUploadForm")
30 </td>
31 </tr>
32 <?php
33 }
34 ?>
35 @include("UserProfile/Info")
36 </table>
37 </div>
38 <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
39 <ul class="nav nav-tabs">
40 <li class="nav-item">
41 <a class="nav-link active" data-toggle="tab" href="#about">About</a>
42 </li>
43 <li class="nav-item">
44 <a class="nav-link" data-toggle="tab" href="#latest-fiddles">Latest fiddles</a>
45 </li>
46 <li class="nav-item">
47 <a class="nav-link" data-toggle="tab" href="#favorite-fiddles">Favorite fiddles</a>
48 </li>
49 <?php
50 if ($show_authorized) {
51 ?>
52 <li class="nav-item">
53 <a class="nav-link" data-toggle="tab" href="#private-fiddles">Private fiddles</a>
54 </li>
55 <li class="nav-item">
56 <a class="nav-link" data-toggle="tab" href="#settings">Settings</a>
57 </li>
58 <?php
59 }
60 ?>
61 </ul>
62
63 <div class="tab-content">
64 <div id="about" class="container tab-pane active"><br>
65 {!! empty($UserSettings->Biography) ? ("This user hasn't added any biography.") : (StringToHTML(htmlspecialchars($UserSettings->Biography))) !!}
66 </div>
67 @include("UserProfile/LatestFiddles")
68 @include("UserProfile/FavoriteFiddles")
69 <?php
70 if ($show_authorized) {
71 ?>
72 @include("UserProfile/PrivateFiddles")
73 @include("UserProfile/Settings")
74 @include("UserProfile/Script")
75 <?php
76 }
77 ?>
78 </div>
79 </div>
80 </div>
81 </div>
82 <br>
File resources/views/UserProfile/AvatarUploadForm.blade.php added (mode: 100644) (index 0000000..5567052)
1 <form id="upload-avatar-form" enctype="multipart/form-data">
2 <input type="text" name="_token" value="{{ csrf_token() }}" style="display:none;"/>
3 <input type="file" name="avatar-native" id="avatar" style="display:none;"/>
4 <button class="btn btn-info btn-block">
5 <label for="avatar">
6 Pick an avatar <span class="fa fa-image"></span>
7 </label>
8 </button>
9
10 <button type="submit" class="btn btn-block btn-success">Upload <span class="fa fa-upload"></span></button>
11 </form>
12 <br/>
13 <div id="upload-avatar-result"></div>
File resources/views/UserProfile/FavoriteFiddles.blade.php added (mode: 100644) (index 0000000..5742666)
1 <div id="favorite-fiddles" class="container tab-pane fade"><br>
2 <?php
3 if ($FavoriteFiddlesCount == 0) {
4 echo "<p>This user hasn't favorited any fiddles yet.</p>";
5 }
6 else {
7 ?>
8 <table class="table table-hover">
9 @foreach($FavoriteFiddles as $Fiddle)
10 <tr>
11 <td>
12 <a href="{{ URL::to("fiddle/" . $Fiddle->FiddleID) }}"> {{ $Fiddle->Title }} </a>
13 </td>
14 <td>{{ date("Y/m/d h:i:sa", $Fiddle->FavoritingDate) }}</td>
15 </tr>
16 @endforeach
17 </table>
18 <?php
19 }
20 ?>
21 </div>
File resources/views/UserProfile/Info.blade.php added (mode: 100644) (index 0000000..5046c04)
1 <tr class="text-center">
2 <td colspan="2">
3 <?php
4 if (isset($UserSettings->WebsiteURL)) {
5 ?>
6 <a href="{{ $UserSettings->WebsiteURL }}" target="_blank" class="mr-2"><span class="fa fa-external-link" style="color:#272822;"></span></a>
7 <?php
8 }
9 ?>
10
11 <?php
12 if (isset($UserSettings->FacebookURL)) {
13 ?>
14 <a href="{{ $UserSettings->FacebookURL }}" target="_blank" class="mr-2"><span class="fa fa-facebook-official facebook-logo"></span></a>
15 <?php
16 }
17 ?>
18
19 <?php
20 if (isset($UserSettings->TwitterURL)) {
21 ?>
22 <a href="{{ $UserSettings->TwitterURL }}" target="_blank" class="mr-2"><span class="fa fa-twitter twitter-logo"></span></a>
23 <?php
24 }
25 ?>
26
27 <?php
28 if (isset($UserSettings->YoutubeURL)) {
29 ?>
30 <a href="{{ $UserSettings->YoutubeURL }}" target="_blank" class="mr-2"><span class="fa fa-youtube-play youtube-logo"></span></a>
31 <?php
32 }
33 ?>
34 </td>
35 </tr>
36 <tr>
37 <td>Registeration date</td>
38 <td>{{ date("Y/m/d", $RegisterationDate) }}</td>
39 </tr>
40 <tr>
41 <td>Number of fiddles</td>
42 <td>{{ $FiddlesCount }}</td>
43 </tr>
44 <tr>
45 <td>Number of favorite fiddles</td>
46 <td>{{ $FavoriteFiddlesCount }}</td>
47 </tr>
File resources/views/UserProfile/LatestFiddles.blade.php added (mode: 100644) (index 0000000..01c6e74)
1 <div id="latest-fiddles" class="container tab-pane fade"><br>
2 <?php
3 if ($PublicFiddlesCount == 0) {
4 echo "<p>This user hasn't created any fiddles yet.</p>";
5 }
6 else {
7 ?>
8 <table class="table table-hover">
9 @foreach($PublicFiddles as $Fiddle)
10 <tr>
11 <td>
12 <a href="{{ URL::to("fiddle/" . $Fiddle->ID) }}"> {{ $Fiddle->Title }} </a>
13 </td>
14 <td>{{ date("Y/m/d h:i:sa", $Fiddle->Date) }}</td>
15 </tr>
16 @endforeach
17 </table>
18 <?php
19 }
20 ?>
21 </div>
File resources/views/UserProfile/PrivateFiddles.blade.php added (mode: 100644) (index 0000000..dc42e7a)
1 <div id="private-fiddles" class="container tab-pane fade"><br/>
2 <?php
3 if ($PrivateFiddlesCount == 0) {
4 echo "<p>You haven't created any private fiddles yet.</p>";
5 }
6 else {
7 ?>
8 <table class="table table-hover">
9 @foreach($PrivateFiddles as $Fiddle)
10 <tr>
11 <td>
12 <a href="{{ URL::to("fiddle/" . $Fiddle->ID) }}"> {{ $Fiddle->Title }} </a>
13 </td>
14 <td>{{ date("Y/m/d h:i:sa", $Fiddle->Date) }}</td>
15 </tr>
16 @endforeach
17 </table>
18 <?php
19 }
20 ?>
21 </div>
File resources/views/UserProfile/Script.blade.php added (mode: 100644) (index 0000000..8eb58af)
1 <?php
2 if (URL::previous() === URL::to("login")) {
3 ?>
4 <script>
5 Snackbar.show({
6 text : "Welcome back, <?php echo(session('username'));?> !",
7 pos : "top-center",
8 backgroundColor : "#212529",
9 actionTextColor : "lime",
10 customClass : "mt-5",
11 textColor : "rgba(255, 255, 255, 0.8)"
12 });
13 </script>
14 <?php
15 }
16 ?>
17
18 <script>
19 $(document).ready(function() {
20 $(window).bind("keydown", function(e) {
21 if (e.ctrlKey || e.metaKey) {
22 e.preventDefault();
23 var key = String.fromCharCode(e.which).toLowerCase();
24 if (key === "s") {
25 $("#save-changes-button").click();
26 }
27 }
28 });
29
30 $("#upload-avatar-form").on("submit", function(e) {
31 e.preventDefault();
32 $.ajax({
33 url : "{{ URL::to('user/upload-avatar') }}",
34 type : "POST",
35 data : new FormData(this),
36 contentType : false,
37 cache : false,
38 processData : false,
39 success : function(result) {
40 if ("errors" in result) {
41 if (Array.isArray(result.errors)) {
42 $("#upload-avatar-result").html("<div class='alert alert-danger'>" + result.errors.join("<br/>") + "</div>");
43 }
44 else {
45 $("#upload-avatar-result").html("<div class='alert alert-danger'>" + result.errors + "</div>")
46 }
47 }
48 else {
49 $("#upload-avatar-result").html("<div class='alert alert-success'>" + result.success + "</div>");
50
51 Snackbar.show({
52 text : "Your avatar image has been updated",
53 pos : "top-center",
54 backgroundColor : "#212529",
55 actionTextColor : "lime",
56 customClass : "mt-5",
57 textColor : "rgba(255, 255, 255, 0.8)",
58 onClose : function() {
59 window.location.reload();
60 }
61 });
62 }
63 },
64 error : function(xhr) {
65 //$("#upload-avatar-result").html("<div class='alert alert-danger'>An internal error has occured.<br/>Please try again later.</div>");
66 $("#upload-avatar-result").html(xhr.responseText);
67 }
68 });
69 });
70
71 $("#save-changes-button").on("click", function() {
72
73 var WebsiteURL = $("#website-url").val();
74 var FacebookURL = $("#facebook-url").val();
75 var TwitterURL = $("#twitter-url").val();
76 var YoutubeURL = $("#youtube-url").val();
77 var Biography = $("#biography").val();
78
79 var WebsiteURLPattern = /(^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}\-\x{ffff}0-9]+-?)*[a-z\x{00a1}\-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}\-\x{ffff}0-9]+-?)*[a-z\x{00a1}\-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}\-\x{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$)|($^)/;
80 var FacebookURLPattern = /(^https?:\/\/(www\.)?facebook\.com\/([-a-zA-Z0-9()@:%_\+.~#?&//=]+)$)|($^)/;
81 var TwitterURLPattern = /(^https?:\/\/(www\.)?twitter\.com\/([-a-zA-Z0-9()@:%_\+.~#?&//=]+)$)|($^)/;
82 var YoutubeURLPattern = /(^https?:\/\/(www\.)?youtube\.com\/([-a-zA-Z0-9()@:%_\+.~#?&//=]+)$)|($^)/;
83
84 var Message = "";
85 var IsValid = true;
86
87 if (!WebsiteURLPattern.test(WebsiteURL)) {
88 Message += "The website URL must be formed correctly, it must contain <b>http://</b> or <b>https://</b> in the beginning.<br/>";
89 IsValid = false;
90 }
91
92 if (!FacebookURLPattern.test(FacebookURL)) {
93 Message += "The Facebook URL must be formed correctly.<br/>";
94 IsValid = false;
95 }
96
97 if (!TwitterURLPattern.test(TwitterURL)) {
98 Message += "The Twitter URL must be formed correctly.<br/>";
99 IsValid = false;
100 }
101
102 if (!YoutubeURLPattern.test(YoutubeURL)) {
103 Message += "The Youtube URL must be formed correctly.<br/>";
104 IsValid = false;
105 }
106
107 if (Biography.length > 4000) {
108 Message += "The biography must be less than or equal to 4000 characters in length.<br/>";
109 IsValid = false;
110 }
111
112 if (!IsValid) {
113 Message = "<div class='alert alert-danger'>" + Message + "</div>"
114 $("#result").html(Message);
115 }
116 else {
117 $.ajax({
118 type : "POST",
119 url : "{{ URL::to('user/save-changes') }}",
120 data : {
121 "_token" : window.CSRFHashToken,
122 "WebsiteURL" : WebsiteURL,
123 "FacebookURL" : FacebookURL,
124 "TwitterURL" : TwitterURL,
125 "YoutubeURL" : YoutubeURL,
126 "Biography" : Biography
127 },
128 success : function(result, status, xhr) {
129 if ("errors" in result) {
130 if (Array.isArray(result.errors)) {
131 $("#result").html("<div class='alert alert-danger'>" + result.errors.join("<br/>") + "</div>");
132 }
133 else {
134 $("#result").html("<div class='alert alert-danger'>" + result.errors + "</div>")
135 }
136 }
137 else {
138 $("#result").html("<div class='alert alert-success'>" + result.success + "</div>");
139
140 Snackbar.show({
141 text : "Your changes has been saved",
142 pos : "top-center",
143 backgroundColor : "#212529",
144 actionTextColor : "lime",
145 customClass : "mt-5",
146 textColor : "rgba(255, 255, 255, 0.8)",
147 onClose : function() {
148 window.location.reload();
149 }
150 });
151 }
152 },
153 error : function(xhr, status, error) {
154 $("#result").html("<div class='alert alert-danger'>An internal error has occured.<br>Please try again later.</div>");
155 }
156 });
157 }
158 });
159 });
160 </script>
File resources/views/UserProfile/Settings.blade.php added (mode: 100644) (index 0000000..47d5a0d)
1 <div id="settings" class="container tab-pane fade"><br>
2 <h3>General settings</h3>
3 <br/>
4 <table class="table">
5 <tr>
6 <td>
7 <p>Your website:</p>
8 </td>
9 <td>
10 <input type="text" class="form-control" placeholder="Website..." id="website-url" value="{{ isset($UserSettings->WebsiteURL) ? ($UserSettings->WebsiteURL) : ("") }}"/>
11 </td>
12 </tr>
13 <tr>
14 <td>
15 <p>Facebook:</p>
16 </td>
17 <td>
18 <input type="text" class="form-control" placeholder="Facebook ..." id="facebook-url" value="{{ isset($UserSettings->FacebookURL) ? ($UserSettings->FacebookURL) : ("") }}"/>
19 </td>
20 </tr>
21 <tr>
22 <td>
23 <p>Twitter:</p>
24 </td>
25 <td>
26 <input type="text" class="form-control" placeholder="Twitter..." id="twitter-url" value="{{ isset($UserSettings->TwitterURL) ? ($UserSettings->TwitterURL) : ("") }}"/>
27 </td>
28 </tr>
29 <tr>
30 <td>
31 <p>Youtube:</p>
32 </td>
33 <td>
34 <input type="text" class="form-control" placeholder="Youtube..." id="youtube-url" value="{{ isset($UserSettings->YoutubeURL) ? ($UserSettings->YoutubeURL) : ("") }}"/>
35 </td>
36 </tr>
37 </table>
38 <br/>
39 <p>Add a small biography about yourself:</p>
40 <textarea class="form-control" rows="10" placeholder="Must be less than or equal to 1000 characters in length..." id="biography">{{ isset($UserSettings->Biography) ? ($UserSettings->Biography) : ("") }}</textarea>
41 <br/>
42 <button class="btn btn-info" id="save-changes-button">Save changes <span class="fa fa-save"></span></button>
43 <br/>
44 <br/>
45 <div id="result"></div>
46 </div>
File resources/views/Users.blade.php added (mode: 100644) (index 0000000..62742bb)
1 <div class="container-fluid">
2 <div class="row">
3 <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
4 <div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
5 <table class="table">
6 <tr>
7 <th>Username</th>
8 <th>Registeration date</th>
9 </tr>
10 @foreach ($Users as $User)
11 <tr>
12 <td>
13 <a href="{{ URL::to('user/' . $User->Username) }}">{{ $User->Username }}</a>
14 </td>
15 <td>
16 {{ date("Y/m/d", $User->RegisterationDate) }}
17 </td>
18 </tr>
19 @endforeach
20 </table>
21 </div>
22 <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
23 </div>
24 </div>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/EyadMohammedOsama/sicsf

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/EyadMohammedOsama/sicsf

Clone this repository using git:
git clone git://git.rocketgit.com/user/EyadMohammedOsama/sicsf

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main