mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-01-31 20:21:36 +01:00
parent
1a7de4c2d6
commit
2e7345f4f0
@ -4,6 +4,7 @@ use Activity;
|
|||||||
use BookStack\Exceptions\NotFoundException;
|
use BookStack\Exceptions\NotFoundException;
|
||||||
use BookStack\Repos\UserRepo;
|
use BookStack\Repos\UserRepo;
|
||||||
use BookStack\Services\ExportService;
|
use BookStack\Services\ExportService;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use BookStack\Http\Requests;
|
use BookStack\Http\Requests;
|
||||||
use BookStack\Repos\BookRepo;
|
use BookStack\Repos\BookRepo;
|
||||||
@ -214,8 +215,14 @@ class PageController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown']));
|
$draft = $this->pageRepo->saveUpdateDraft($page, $request->only(['name', 'html', 'markdown']));
|
||||||
}
|
}
|
||||||
$updateTime = $draft->updated_at->format('H:i');
|
|
||||||
return response()->json(['status' => 'success', 'message' => 'Draft saved at ' . $updateTime]);
|
$updateTime = $draft->updated_at->timestamp;
|
||||||
|
$utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset;
|
||||||
|
return response()->json([
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Draft saved at ',
|
||||||
|
'timestamp' => $utcUpdateTimestamp
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"dropzone": "^4.0.1",
|
"dropzone": "^4.0.1",
|
||||||
"laravel-elixir": "^3.4.0",
|
"laravel-elixir": "^3.4.0",
|
||||||
"marked": "^0.3.5",
|
"marked": "^0.3.5",
|
||||||
|
"moment": "^2.12.0",
|
||||||
"zeroclipboard": "^2.2.0"
|
"zeroclipboard": "^2.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var moment = require('moment');
|
||||||
|
|
||||||
module.exports = function (ngApp, events) {
|
module.exports = function (ngApp, events) {
|
||||||
|
|
||||||
ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService',
|
ngApp.controller('ImageManagerController', ['$scope', '$attrs', '$http', '$timeout', 'imageManagerService',
|
||||||
@ -367,7 +369,8 @@ module.exports = function (ngApp, events) {
|
|||||||
if (isMarkdown) data.markdown = $scope.editContent;
|
if (isMarkdown) data.markdown = $scope.editContent;
|
||||||
|
|
||||||
$http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => {
|
$http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => {
|
||||||
$scope.draftText = responseData.data.message;
|
var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate();
|
||||||
|
$scope.draftText = responseData.data.message + moment(updateTime).format('H:m');
|
||||||
if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true;
|
if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user