better handling of /cc on Linux
This commit is contained in:
parent
595d751449
commit
3238b06c27
3 changed files with 7 additions and 5 deletions
|
@ -338,8 +338,9 @@ class NewPost(Helper.RestorableWindow):
|
||||||
self.textInput.setPlainText(string)
|
self.textInput.setPlainText(string)
|
||||||
|
|
||||||
cursor = self.textInput.textCursor()
|
cursor = self.textInput.textCursor()
|
||||||
cursor.movePosition(QtGui.QTextCursor.NextWord, QtGui.QTextCursor.MoveAnchor)
|
cursor.movePosition(QtGui.QTextCursor.End, QtGui.QTextCursor.MoveAnchor)
|
||||||
cursor.movePosition(QtGui.QTextCursor.NextWord, QtGui.QTextCursor.MoveAnchor)
|
cursor.movePosition(QtGui.QTextCursor.Start, QtGui.QTextCursor.KeepAnchor)
|
||||||
|
cursor.movePosition(QtGui.QTextCursor.EndOfLine, QtGui.QTextCursor.KeepAnchor)
|
||||||
self.textInput.setTextCursor(cursor)
|
self.textInput.setTextCursor(cursor)
|
||||||
|
|
||||||
def onChanged(self):
|
def onChanged(self):
|
||||||
|
|
|
@ -453,6 +453,7 @@ function(HostApp, Core, Paths, URI) {
|
||||||
this.setFollowingButton(true);
|
this.setFollowingButton(true);
|
||||||
var url = URI(Paths.mkApiRootPath("/followings"));
|
var url = URI(Paths.mkApiRootPath("/followings"));
|
||||||
var data = JSON.stringify({"entity": this.entity });
|
var data = JSON.stringify({"entity": this.entity });
|
||||||
|
debug(data)
|
||||||
Paths.getURL(url.toString(), "POST", function(resp) {
|
Paths.getURL(url.toString(), "POST", function(resp) {
|
||||||
if (resp.status >= 200 && resp.status < 300) {
|
if (resp.status >= 200 && resp.status < 300) {
|
||||||
_this.following_id = JSON.parse(resp.responseText).id
|
_this.following_id = JSON.parse(resp.responseText).id
|
||||||
|
|
|
@ -643,7 +643,7 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
var text = node.innerHTML;
|
var text = node.innerHTML;
|
||||||
var mentions_in_text = [];
|
var mentions_in_text = [];
|
||||||
|
|
||||||
var res = text.match(/(\^[\w:/.]+(?:[\w]))/ig);
|
var res = text.match(/(\^[\w:/.-]+(?:[\w]))/ig);
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
for (var i = 0; i < res.length; i++) {
|
for (var i = 0; i < res.length; i++) {
|
||||||
|
@ -740,7 +740,7 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = text.match(/(\^[\w:/]+\.[\w:/.]+(?:[\w]))/ig);
|
var res = text.match(/(\^[\w:/]+\.[\w:/.-]+(?:[\w]))/ig);
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
for (var i = 0; i < res.length; i++) {
|
for (var i = 0; i < res.length; i++) {
|
||||||
|
@ -868,7 +868,7 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
if(mentions.length > 0) string += "\n\n/cc ";
|
if(mentions.length > 0) string += "\n\n/cc ";
|
||||||
for (var i = 0; i < mentions.length; i++) {
|
for (var i = 0; i < mentions.length; i++) {
|
||||||
var e = mentions[i].entity.replace("https://", "");
|
var e = mentions[i].entity.replace("https://", "");
|
||||||
if(string.indexOf(e) == -1) string += "^" + e + " ";
|
if(string.indexOf(e) == -1) string += "^" + e;
|
||||||
}
|
}
|
||||||
|
|
||||||
HostApp.openNewMessageWidow(entity, status_id, string, is_private);
|
HostApp.openNewMessageWidow(entity, status_id, string, is_private);
|
||||||
|
|
Reference in a new issue