Merge pull request #2204 from pixelfed/staging
Update PostComponent, improve embed model. Fixes #2189
This commit is contained in:
commit
75f6fdcbda
5 changed files with 63 additions and 9 deletions
|
@ -38,6 +38,7 @@
|
|||
- Updated checkpoint view, fix recovery code bug ([3385583f](https://github.com/pixelfed/pixelfed/commit/3385583f))
|
||||
- Updated Inbox, move expensive HTTP Signature validation to job queue ([f2ae45e5a](https://github.com/pixelfed/pixelfed/commit/f2ae45e5a))
|
||||
- Updated MomentUI, fix bugs and improve UI ([90b89cb8](https://github.com/pixelfed/pixelfed/commit/90b89cb8))
|
||||
- Updated PostComponent, improve embed model. Fixes ([#2189](https://github.com/pixelfed/pixelfed/issues/2189)) ([b12e504e](https://github.com/pixelfed/pixelfed/commit/b12e504e))
|
||||
|
||||
|
||||
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
||||
|
|
|
@ -446,12 +446,16 @@ class AccountController extends Controller
|
|||
}
|
||||
|
||||
if($request->session()->has('2fa.attempts')) {
|
||||
$count = (int) $request->session()->has('2fa.attempts');
|
||||
$request->session()->push('2fa.attempts', $count + 1);
|
||||
$count = (int) $request->session()->get('2fa.attempts');
|
||||
if($count == 3) {
|
||||
Auth::logout();
|
||||
return redirect('/');
|
||||
}
|
||||
$request->session()->put('2fa.attempts', $count + 1);
|
||||
} else {
|
||||
$request->session()->push('2fa.attempts', 1);
|
||||
$request->session()->put('2fa.attempts', 1);
|
||||
}
|
||||
return redirect()->back()->withErrors([
|
||||
return redirect('/i/auth/checkpoint')->withErrors([
|
||||
'code' => 'Invalid code'
|
||||
]);
|
||||
}
|
||||
|
|
2
public/js/status.js
vendored
2
public/js/status.js
vendored
File diff suppressed because one or more lines are too long
|
@ -24,7 +24,7 @@
|
|||
"/js/rempos.js": "/js/rempos.js?id=219479dc2456e6b5959e",
|
||||
"/js/rempro.js": "/js/rempro.js?id=750317b23c9c1b3b7ede",
|
||||
"/js/search.js": "/js/search.js?id=2d76d7d28de3b4691bc7",
|
||||
"/js/status.js": "/js/status.js?id=57d2bafa055f24a2f6dc",
|
||||
"/js/status.js": "/js/status.js?id=c1b099f001f24d81c417",
|
||||
"/js/story-compose.js": "/js/story-compose.js?id=18ed9fcdfed5eb63d113",
|
||||
"/js/theme-monokai.js": "/js/theme-monokai.js?id=3b6e62701f12b717cc5c",
|
||||
"/js/timeline.js": "/js/timeline.js?id=8228cee82c077c873e5f"
|
||||
|
|
|
@ -512,7 +512,29 @@
|
|||
size="md"
|
||||
body-class="p-2 rounded">
|
||||
<div>
|
||||
<textarea class="form-control disabled" rows="1" style="border: 1px solid #efefef; font-size: 14px; line-height: 12px; height: 37px; margin: 0 0 7px; resize: none; white-space: nowrap;" v-model="ctxEmbedPayload"></textarea>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control disabled text-monospace" rows="8" style="overflow-y:hidden;border: 1px solid #efefef; font-size: 12px; line-height: 18px; margin: 0 0 7px;resize:none;" v-model="ctxEmbedPayload" disabled=""></textarea>
|
||||
</div>
|
||||
<div class="form-group pl-2 d-flex justify-content-center">
|
||||
<div class="form-check mr-3">
|
||||
<input class="form-check-input" type="checkbox" v-model="ctxEmbedShowCaption" :disabled="ctxEmbedCompactMode == true">
|
||||
<label class="form-check-label font-weight-light">
|
||||
Show Caption
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check mr-3">
|
||||
<input class="form-check-input" type="checkbox" v-model="ctxEmbedShowLikes" :disabled="ctxEmbedCompactMode == true">
|
||||
<label class="form-check-label font-weight-light">
|
||||
Show Likes
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" v-model="ctxEmbedCompactMode">
|
||||
<label class="form-check-label font-weight-light">
|
||||
Compact Mode
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button :class="copiedEmbed ? 'btn btn-primary btn-block btn-sm py-1 font-weight-bold disabed': 'btn btn-primary btn-block btn-sm py-1 font-weight-bold'" @click="ctxCopyEmbed" :disabled="copiedEmbed">{{copiedEmbed ? 'Embed Code Copied!' : 'Copy Embed Code'}}</button>
|
||||
<p class="mb-0 px-2 small text-muted">By using this embed, you agree to our <a href="/site/terms">Terms of Use</a></p>
|
||||
|
@ -650,10 +672,36 @@ export default {
|
|||
showCaption: true,
|
||||
ctxEmbedPayload: false,
|
||||
copiedEmbed: false,
|
||||
ctxEmbedShowCaption: true,
|
||||
ctxEmbedShowLikes: false,
|
||||
ctxEmbedCompactMode: false,
|
||||
layout: this.profileLayout
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
ctxEmbedShowCaption: function (n,o) {
|
||||
if(n == true) {
|
||||
this.ctxEmbedCompactMode = false;
|
||||
}
|
||||
let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
|
||||
this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
|
||||
},
|
||||
ctxEmbedShowLikes: function (n,o) {
|
||||
if(n == true) {
|
||||
this.ctxEmbedCompactMode = false;
|
||||
}
|
||||
let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
|
||||
this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
|
||||
},
|
||||
ctxEmbedCompactMode: function (n,o) {
|
||||
if(n == true) {
|
||||
this.ctxEmbedShowCaption = false;
|
||||
this.ctxEmbedShowLikes = false;
|
||||
}
|
||||
let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
|
||||
this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
let u = new URLSearchParams(window.location.search);
|
||||
let forceMetro = localStorage.getItem('pf_metro_ui.exp.forceMetro') == 'true';
|
||||
|
@ -1195,7 +1243,8 @@ export default {
|
|||
},
|
||||
|
||||
showEmbedPostModal() {
|
||||
this.ctxEmbedPayload = window.App.util.embed.post(this.status.url)
|
||||
let mode = this.ctxEmbedCompactMode ? 'compact' : 'full';
|
||||
this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode);
|
||||
this.$refs.embedModal.show();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue