mirror of
https://github.com/writefreely/writefreely
synced 2024-11-24 17:43:05 +00:00
Clean up lang field setting in pad.tmpl
This continues work by @cjeller1592 in #435.
This commit is contained in:
parent
50c4e944a4
commit
11e636359d
1 changed files with 7 additions and 10 deletions
|
@ -186,21 +186,14 @@
|
|||
var xpostTarg = H.get('crosspostTarget', '[]');
|
||||
|
||||
var http = new XMLHttpRequest();
|
||||
var lang = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
|
||||
lang = lang.substring(0, 2);
|
||||
var post = H.getTitleStrict(content);
|
||||
|
||||
var params = {
|
||||
body: post.content,
|
||||
title: post.title,
|
||||
font: font,
|
||||
{{ if or .Post.Slug .Post.Id }}
|
||||
};
|
||||
{{ else }}
|
||||
lang: lang
|
||||
};
|
||||
{{ end }}
|
||||
|
||||
font: font
|
||||
};
|
||||
|
||||
{{ if .Post.Slug }}
|
||||
var url = "/api/collections/{{.EditCollection.Alias}}/posts/{{.Post.Id}}";
|
||||
{{ else if .Post.Id }}
|
||||
|
@ -210,6 +203,10 @@
|
|||
}
|
||||
params.token = token;
|
||||
{{ else }}
|
||||
var lang = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
|
||||
lang = lang.substring(0, 2);
|
||||
params.lang = lang;
|
||||
|
||||
var url = "/api/posts";
|
||||
var postTarget = H.get('postTarget', 'anonymous');
|
||||
if (postTarget != 'anonymous') {
|
||||
|
|
Loading…
Reference in a new issue