Skip to content

Commit

Permalink
Change absolute URL to relative (#9)
Browse files Browse the repository at this point in the history
* Change absolute URL to relative
* Absolute to relative pathes in CSS
* Fix path
  • Loading branch information
bubeck authored Dec 19, 2023
1 parent d35d4e5 commit 7f177c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ body{

body:not(.light){
color: #cbcbcb;
background: linear-gradient( rgba(0, 0, 0, 0.51), rgba(0, 0, 0, 0.5) ), url("/assets/img/black_bg.png");
background: linear-gradient( rgba(0, 0, 0, 0.51), rgba(0, 0, 0, 0.5) ), url("../img/black_bg.png");
}

body.light{
color: #1a1a1a;
background-image: url("/assets/img/white_bg.png");
background-image: url("../img/white_bg.png");
}

.flex{
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
include 'inc/header.php';

// Main page
$code_js = 'javascript:(function () {var d = document;var w = window;var enc = encodeURIComponent;var f =\' ' . DEFAULT_URL . '\';var l = d.location;var p = \'/shorten.php?url=\' + enc(l.href) + \'&comment=\' + enc(d.title) + \'&token=' . $token . '\';var u = f + p;var a = function () {if (!w.open(u))l.href = u;};if (/Firefox/.test(navigator.userAgent))setTimeout(a, 0); else a();void(0);})()';
$code_js = 'javascript:(function () {var d = document;var w = window;var enc = encodeURIComponent;var f =\' ' . DEFAULT_URL . '\';var l = d.location;var p = \'shorten.php?url=\' + enc(l.href) + \'&comment=\' + enc(d.title) + \'&token=' . $token . '\';var u = f + p;var a = function () {if (!w.open(u))l.href = u;};if (/Firefox/.test(navigator.userAgent))setTimeout(a, 0); else a();void(0);})()';

?>
<a class="forkit" href="https://github.com/azlux/Simple-URL-Shortener/">
Expand All @@ -56,7 +56,7 @@
if(value === ""){
return disableCustomUrlField(false)
}
const result = await fetch('/shorten.php', {method: "POST", headers: {"Content-Type": "application/x-www-form-urlencoded"}, body: `is_short_free=${value}`})
const result = await fetch('shorten.php', {method: "POST", headers: {"Content-Type": "application/x-www-form-urlencoded"}, body: `is_short_free=${value}`})
if(!result.ok){
return disableCustomUrlField(true)
}
Expand Down Expand Up @@ -93,7 +93,7 @@ function disableCustomUrlField(isDisabled){
</div>
<div>
<input type="submit" value="Shorten" class="btn btn-primary"/>
<button class="btn float-right" onclick="event.preventDefault(); window.location.href = '/list.php'">List of shortened links</button>
<button class="btn float-right" onclick="event.preventDefault(); window.location.href = 'list.php'">List of shortened links</button>
</div>
</form>
<div class="flex">
Expand Down
2 changes: 1 addition & 1 deletion list.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</td>
<td>
<a href="<?php echo $deleteUrl; ?>" class="delete">
<img src="/assets/img/delete-icon.png"/>
<img src="assets/img/delete-icon.png"/>
</a>
</td>
</tr>
Expand Down

0 comments on commit 7f177c2

Please sign in to comment.