init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
[publish]
|
||||
placeholder = "What’s new?"
|
||||
brief_title = Brief
|
||||
post_title = Post
|
||||
post = Write a post
|
||||
add_link = Add a link
|
||||
add_snap = Take a picture
|
||||
no_title = Please provide a title
|
||||
no_picture = At least one picture is required
|
||||
preview = Preview
|
||||
attach = Add a file or a picture
|
||||
no_publication = You cannot publish a post here
|
||||
#no_content_preview = No content to preview
|
||||
new = New post
|
||||
title = Post title
|
||||
content = Markdown content
|
||||
valid_url = Please enter a valid URL
|
||||
content_text= You can format your content using Markdown
|
||||
draft_saved = Draft saved
|
||||
rich_editor = Rich text editor
|
||||
help_hashtag = "Add #hashtags in your title or content to allow your post to be discovered"
|
||||
publish_error_forbidden = You are not authorized to publish there
|
||||
publish_error_payload_to_big = Your post is too big to be published
|
||||
too_long = Your text is too long, %s characters max
|
||||
|
||||
blog_presence = "Your blog is only accessible to your subscribers. You can make it accessible to anyone in the settings page."
|
||||
embedded_link = The media will be embedded
|
||||
|
||||
web_title = Create a public HTTP URL from this publication
|
||||
web_text = This will allow anyone outside Movim to have access to your publication
|
||||
@@ -0,0 +1,89 @@
|
||||
#publishembeds li {
|
||||
border: 1px solid rgba(var(--movim-font), 0.12);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
#publishembeds li {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
#publishpreview h3:first-child {
|
||||
margin: 1rem 2rem 0;
|
||||
}
|
||||
|
||||
#publish label span.save {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#publish>div.block {
|
||||
margin: 0 0.75rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
#publish label span.save.saved {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
#publish textarea[name=content] {
|
||||
min-height: 25rem;
|
||||
}
|
||||
|
||||
#publish span.privacy form>div .checkbox>input[type="checkbox"]+label,
|
||||
#publish span.comments_disabled form>div .checkbox>input[type="checkbox"]+label {
|
||||
top: 0.5rem;
|
||||
left: 0.5rem;
|
||||
height: 3rem;
|
||||
width: 3rem;
|
||||
}
|
||||
|
||||
section#sidebar:has(+#publish) {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
section#sidebar:has(+#publish div[data-type="article"] textarea[name="content"]:focus),
|
||||
section#sidebar:has(+#publish div[data-type="article"]):hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#publish span.privacy form>div .checkbox>input[type="checkbox"]:checked+label,
|
||||
#publish span.comments_disabled form>div .checkbox>input[type="checkbox"]:checked+label {
|
||||
left: 2.5rem;
|
||||
}
|
||||
|
||||
#publish span.privacy form>div .checkbox>input[type="checkbox"]+label i:before {
|
||||
content: 'lock';
|
||||
}
|
||||
|
||||
#publish span.privacy form>div .checkbox>input[type="checkbox"]:checked+label i:before {
|
||||
content: 'wifi_tethering';
|
||||
}
|
||||
|
||||
#publish span.comments_disabled form>div .checkbox>input[type="checkbox"]+label i:before {
|
||||
content: 'insert_comment';
|
||||
}
|
||||
|
||||
#publish span.comments_disabled form>div .checkbox>input[type="checkbox"]:checked+label i:before {
|
||||
content: 'comments_disabled';
|
||||
}
|
||||
|
||||
#publishreply {
|
||||
margin-bottom: -1rem;
|
||||
}
|
||||
|
||||
#publish form[data-type="brief"] div#title textarea {
|
||||
min-height: 10rem;
|
||||
padding-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
#publish form[data-type="brief"] div#title label {
|
||||
top: initial;
|
||||
bottom: -3rem;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#publish #publish_open_link_preview:empty,
|
||||
#publish form[data-type="brief"] div#content {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
var Publish = {
|
||||
titleTimeout: null,
|
||||
contentTimeout: null,
|
||||
|
||||
get: function(type) {
|
||||
let parts = MovimUtils.urlParts();
|
||||
|
||||
Publish_ajaxHttpGet(
|
||||
type ?? null,
|
||||
parts.params[0],
|
||||
parts.params[1],
|
||||
parts.params[2],
|
||||
parts.params[3],
|
||||
parts.params[4],
|
||||
parts.params[5],
|
||||
)
|
||||
},
|
||||
|
||||
init: function () {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
|
||||
Publish_ajaxTryResolveShareUrl(id);
|
||||
|
||||
document.querySelector('#publish textarea[name=title]').addEventListener('keyup', function (event) {
|
||||
if (Publish.titleTimeout) clearTimeout(Publish.titleTimeout);
|
||||
document.querySelector('#publish textarea[name=title] + label span.save').classList.remove('saved');
|
||||
|
||||
Publish.titleTimeout = setTimeout(function () {
|
||||
Publish.saveTitle();
|
||||
Publish_ajaxOpenlinkPreview(id);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
document.querySelector('#publish textarea[name=content]').addEventListener('keyup', function (event) {
|
||||
if (Publish.contentTimeout) clearTimeout(Publish.contentTimeout);
|
||||
document.querySelector('#publish textarea[name=content] + label span.save').classList.remove('saved');
|
||||
|
||||
Publish.contentTimeout = setTimeout(function () {
|
||||
Publish.saveContent();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Publish_ajaxOpenlinkPreview(id);
|
||||
Publish_ajaxCheckPrivacy(id);
|
||||
},
|
||||
|
||||
saveTitle: function () {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
return Publish_ajaxHttpSaveTitle(id, document.querySelector('#publish textarea[name=title]').value);
|
||||
},
|
||||
|
||||
saveContent: function () {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
return Publish_ajaxHttpSaveContent(id, document.querySelector('#publish textarea[name=content]').value);
|
||||
},
|
||||
|
||||
enableSend: function () {
|
||||
document.querySelector('.button.send').classList.remove('disabled');
|
||||
document.querySelector('.button.send i').classList.remove('spin');
|
||||
document.querySelector('.button.send i').innerText = 'send';
|
||||
},
|
||||
|
||||
disableSend: function () {
|
||||
document.querySelector('.button.send').classList.add('disabled');
|
||||
document.querySelector('.button.send i').classList.add('spin');
|
||||
document.querySelector('.button.send i').innerText = 'autorenew';
|
||||
},
|
||||
|
||||
preview: function () {
|
||||
Publish.saveTitle().then(e => {
|
||||
Publish.saveContent().then(e => {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
Publish_ajaxPreview(id);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
publish: function () {
|
||||
Publish.saveTitle().then(e => {
|
||||
Publish.saveContent().then(e => {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
Publish_ajaxPublish(id);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
clearReply: function () {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
Publish_ajaxClearReply(id);
|
||||
},
|
||||
|
||||
addUrl: function () {
|
||||
let id = document.querySelector('#publish input[name=id]').value;
|
||||
var url = document.querySelector('#url').value;
|
||||
|
||||
Publish_ajaxAddUrl(id, url);
|
||||
}
|
||||
}
|
||||
|
||||
MovimWebsocket.attach(() => {
|
||||
Publish.get('brief');
|
||||
});
|
||||
|
||||
MovimEvents.registerWindow('loaded', 'publish', () => {
|
||||
if (typeof Upload != 'undefined') {
|
||||
Upload.attach((file) => {
|
||||
if (MovimUtils.urlParts().page == 'publish') {
|
||||
Publish_ajaxAddUpload(document.querySelector('#publish input[name=id]').value, file.id);
|
||||
}
|
||||
});
|
||||
|
||||
Upload.initiate((file) => {
|
||||
if (MovimUtils.urlParts().page == 'publish') {
|
||||
Upload.prependName = 'post';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user