18 Commits

Author SHA1 Message Date
3bf111a868 Merge branch 'master' into production 2022-11-13 21:12:13 -03:00
082e12051e Merge branch 'master' into production 2022-11-13 21:05:23 -03:00
2cfec55c36 Merge branch 'master' into production 2022-11-13 16:20:19 -03:00
125a40d351 Merge branch 'master' into production 2022-11-10 00:02:25 -03:00
332ed47805 Merge branch 'master' into production 2022-09-05 18:57:49 -03:00
b3c00d388d Merge branch 'master' into production 2022-04-24 17:17:22 -03:00
740c66cd52 Merge branch 'master' into production 2022-02-24 00:17:56 -03:00
b5da2f5fe9 Merge branch 'master' into production 2022-02-24 00:03:02 -03:00
a8201ff2b4 build: update composer and npm 2022-02-24 00:01:00 -03:00
ab117ec74c Merge branch 'master' into production 2021-10-12 22:39:37 -03:00
b6eeef7e62 Merge branch 'master' into production 2021-06-12 12:09:53 -03:00
4d8b5aba6a Merge branch 'master' into production 2021-05-29 19:58:24 -03:00
21646ac2fd Merge branch 'master' into production 2021-05-29 16:00:30 -03:00
7e47708c4b Merge branch 'master' into production 2021-05-20 21:06:52 -03:00
54a44946cd Merge branch 'master' into production 2021-05-02 11:23:02 -03:00
f01b516ca9 chore: fix composer.lock version in production branch 2021-04-21 07:44:29 -03:00
a699738aa8 Merge branch 'master' into production 2021-04-21 07:29:32 -03:00
51ec05f5de chore: update composer packages 2021-04-20 10:59:21 -03:00
18 changed files with 6521 additions and 2591 deletions

View File

@@ -51,7 +51,7 @@ class Kernel extends HttpKernel
* *
* @var array * @var array
*/ */
protected $middlewareAliases = [ protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class, 'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,

View File

@@ -22,6 +22,7 @@ class AuthServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
$this->registerPolicies();
// //
} }

View File

@@ -6,11 +6,11 @@
"type": "project", "type": "project",
"require": { "require": {
"php": "^8.0.2", "php": "^8.0.2",
"inertiajs/inertia-laravel": "^0.6.11", "inertiajs/inertia-laravel": "^0.6.3",
"laravel/framework": "^10.0", "laravel/framework": "^9.19.0",
"laravel/ui": "^4.0",
"laravel/helpers": "^1.4", "laravel/helpers": "^1.4",
"laravel/tinker": "^2.4.1", "laravel/tinker": "^2.4.1",
"laravel/ui": "^3.0",
"pusher/pusher-php-server": "^7.2" "pusher/pusher-php-server": "^7.2"
}, },
"require-dev": { "require-dev": {
@@ -18,11 +18,11 @@
"filp/whoops": "^2.0", "filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"nunomaduro/collision": "^7.0", "nunomaduro/collision": "^6.1",
"nunomaduro/larastan": "^2.9.5", "nunomaduro/larastan": "^0.7.4",
"nunomaduro/phpinsights": "*", "nunomaduro/phpinsights": "*",
"phpstan/phpstan": "^1.10.66", "phpstan/phpstan": "^0.12.85",
"phpunit/phpunit": "^10.0" "phpunit/phpunit": "^9.0"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
@@ -64,6 +64,6 @@
"dealerdirect/phpcodesniffer-composer-installer": true "dealerdirect/phpcodesniffer-composer-installer": true
} }
}, },
"minimum-stability": "stable", "minimum-stability": "dev",
"prefer-stable": true "prefer-stable": true
} }

4553
composer.lock generated

File diff suppressed because it is too large Load Diff

4376
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -19,8 +19,5 @@
"sass": "^1.56.1", "sass": "^1.56.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"vite": "^3.2.3" "vite": "^3.2.3"
},
"dependencies": {
"moment": "^2.29.4"
} }
} }

35
public/build/assets/app.0299f74e.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"resources/js/app.js": { "resources/js/app.js": {
"file": "assets/app.4993c47e.js", "file": "assets/app.0299f74e.js",
"src": "resources/js/app.js", "src": "resources/js/app.js",
"isEntry": true "isEntry": true
}, },

0
public/favicon.ico Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

52
resources/js/app.js vendored
View File

@@ -6,7 +6,6 @@
*/ */
import './bootstrap'; import './bootstrap';
import moment from "moment";
// window.Vue = require('vue'); // window.Vue = require('vue');
@@ -21,54 +20,3 @@ import moment from "moment";
// const app = new Vue({ // const app = new Vue({
// el: '#app' // el: '#app'
// }); // });
function updateTime() {
var dates = document.getElementsByClassName("takenItemDate");
for (let i = 0; i < dates.length; i++) {
let time = dates.item(i).innerText;
let fromNow = moment(time).fromNow();
let id = "itemPassedTime_" + dates.item(i).id;
document.getElementById(id).innerText = fromNow;
}
}
updateTime();
setInterval(updateTime, 1 * 60 * 1000);
function setFaviconNumber(number) {
var canvas = document.createElement('canvas'),
ctx,
img = document.createElement('img'),
link = document.getElementById('favicon').cloneNode(true);
if (canvas.getContext) {
canvas.height = canvas.width = 48; // set the size
ctx = canvas.getContext('2d');
img.onload = function () { // once the image has loaded
ctx.drawImage(this, 0, 0);
ctx.font = 'bold 35px "helvetica", sans-serif';
ctx.fillStyle = '#ffff66';
ctx.fillText(number, 3, 25);
link.href = canvas.toDataURL('image/png');
document.body.appendChild(link);
};
img.src = 'favicon.png';
}
};
usedItems = document.getElementById("usedItems").innerText;
setFaviconNumber(usedItems);
/**
* Source:
* https://www.designcise.com/web/tutorial/how-to-detect-if-the-browser-tab-is-active-or-not-using-javascript
*/
document.addEventListener('visibilitychange', function (event) {
if (document.hidden) {
console.log('not visible');
} else {
updateTime();
}
});

View File

@@ -1,7 +1,6 @@
@if ($item->used_by == \Auth::id()) @if ($item->used_by == \Auth::id())
<form action="/take" method="POST" class="form-inline"> <form action="/take" method="POST" class="form-inline">
<em id="itemPassedTime_{{$item->id}}" class="pr-sm-2 ml-auto">{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em> <em class="pr-sm-2 ml-auto">{{\Carbon\Carbon::parse($item->updated_at)->diffForHumans()}}</em>
<div hidden class="takenItemDate" id="{{$item->id}}">{{\Carbon\Carbon::parse($item->updated_at)->format('Y-m-d\TH:i:s.uP')}}</div>
<div class="w-100 d-xm-block d-sm-none"></div> <div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }} {{ csrf_field() }}
@method('DELETE') @method('DELETE')
@@ -17,9 +16,8 @@
@if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id()) @if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id())
<strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong> <strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong>
@endif @endif
<small id="itemPassedTime_{{$item->id}}">({{$item->updated_at->diffForHumans()}})</small> <small>({{$item->updated_at->diffForHumans()}})</small>
</em> </em>
<div hidden class="takenItemDate" id="{{$item->id}}">{{$item->updated_at->format('Y-m-d\TH:i:s.uP')}}</div>
<div class="w-100 d-xm-block d-sm-none"></div> <div class="w-100 d-xm-block d-sm-none"></div>
{{ csrf_field() }} {{ csrf_field() }}
<input type="hidden" name="item" value="{{$item->id}}"> <input type="hidden" name="item" value="{{$item->id}}">
@@ -30,4 +28,4 @@
<button type="submit" class="btn btn-sm btn-outline-secondary ml-auto">@lang('home.alert_me')</button> <button type="submit" class="btn btn-sm btn-outline-secondary ml-auto">@lang('home.alert_me')</button>
@endif @endif
</form> </form>
@endif @endif

View File

@@ -19,12 +19,9 @@
<!-- Styles --> <!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet"> <link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link id="favicon" rel="icon" type="image/png" href="favicon.png" />
</head> </head>
<body> <body>
<div hidden id="usedItems">{{ isset($usedItems) && $usedItems > 0 ? $usedItems : '' }}</div>
<div id="app"> <div id="app">
<nav class="navbar navbar-expand-md navbar-light navbar-laravel"> <nav class="navbar navbar-expand-md navbar-light navbar-laravel">
<div class="container"> <div class="container">

View File

@@ -5,7 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Share It</title> <title>Share It</title>
<link id="favicon" rel="icon" type="image/png" href="favicon.png" />
<!-- Fonts --> <!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet" type="text/css">

View File

@@ -1,2 +1 @@
echo "Homestead password is: vagrant" ssh homestead -t "cd code/Bruno\ Fontes/shareit; bash --login"
ssh homestead -t "cd shareit; bash --login"

View File

@@ -1,7 +1,6 @@
#!/bin/zsh #!/bin/zsh
export VAGRANT_CWD=/home/bruno/development/Homestead/ export VAGRANT_CWD=/home/bruno/development/Homestead/
vagrant up vagrant up
eval $DEV_BROWSER http://shareit.test \ #builtin cd ~/development/laravelHomestead && /usr/bin/vagrant up && builtin cd -
https://mailtrap.io/inboxes/455614/messages \ #~/Apps/firefox/firefox-bin http://shareit.test
https://dashboard.pusher.com/apps/1505830/console \ #~/Apps/firefox/firefox-bin https://mailtrap.io/inboxes/455614/messages
&

View File

@@ -1 +1 @@
ssh homestead -t 'cd shareit; /usr/local/bin/composer update; npm update; echo; echo -n "Press enter to exit..."; read' ssh homestead -t 'cd shareit; php7.3 /usr/local/bin/composer update; npm update; echo; echo -n "Press enter to exit..."; read'