Skip to content

Commit

Permalink
Merge branch 'DT27-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed Mar 29, 2018
2 parents a243a87 + 398b63a commit eafce58
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function displayLostPasswordPage(Request $request) {

public function performLogoutUser(Request $request) {
$request->session()->forget('username');
$request->session()->forget('role');
return redirect()->route('index');
}

Expand Down
10 changes: 10 additions & 0 deletions public/css/shorten_result.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@
.qr-code-container img {
display: inline !important;
}

.input-group {
width: 40vw;
margin: 0 auto;
}

.input-group-addon {
padding: 0px 10px;
cursor: pointer;
}
7 changes: 7 additions & 0 deletions public/js/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions public/js/shorten_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ $('#generate-qr-code').click(function () {
container.show();
});


var clipboard = new Clipboard('#clipboard-copy');
clipboard.on('success', function(e) {
e.clearSelection();
$('#clipboard-copy').tooltip('show');
});

$('#clipboard-copy').on('blur',function () {
$(this).tooltip('destroy');
}).on('mouseleave',function () {
$(this).tooltip('destroy');
});

$(function () {
original_link = $('.result-box').val();
select_text();
Expand Down
8 changes: 7 additions & 1 deletion resources/views/shorten_result.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

@section('content')
<h3>Shortened URL</h3>
<input type='text' class='result-box form-control' value='{{$short_url}}' />
<div class="input-group">
<input type='text' class='result-box form-control' value='{{$short_url}}' id='short_url' />
<div class='input-group-addon' id='clipboard-copy' data-clipboard-target='#short_url' data-toggle='tooltip' data-placement='bottom' data-title='Copied!'>
<i class='fa fa-clipboard' aria-hidden='true' title='Copy to clipboard'></i>
</div>
</div>
<a id="generate-qr-code" class='btn btn-primary'>Generate QR Code</a>
<a href='{{route('index')}}' class='btn btn-info'>Shorten another</a>

Expand All @@ -17,5 +22,6 @@

@section('js')
<script src='/js/qrcode.min.js'></script>
<script src='/js/clipboard.min.js'></script>
<script src='/js/shorten_result.js'></script>
@endsection

0 comments on commit eafce58

Please sign in to comment.