Skip to content

Replaced function insertSyntax #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 2, 2018
Merged

Conversation

alexriss
Copy link
Contributor

I have had problems with the insertSyntax function. It worked only if no text edit was done.

Now I have rewritten the function. It looks similar to dokuwiki's own n insertTags function.

It even allows you to mark text, which then will be used as the image title.

@splitbrain splitbrain requested a review from micgro42 July 31, 2018 14:53
@micgro42
Copy link
Contributor

With which browsers have you seen this error?

@alexriss
Copy link
Contributor Author

Chrome on Windows. No error, just nothing happens - the link is not included in the text area. There is an open issue by someone else about exactly this behavior.

Copy link
Contributor

@micgro42 micgro42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this seems to be working fine. 👍
Could you test the behavior of the caret after inserting files in IE 11? This was a previous bug and I would like to prevent a regression.

src/upload.js Outdated




Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation behind all this empty lines?

src/upload.js Outdated
}

if(text){
text = '|' + text; // use text as image label
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not primarily intended for images, but for documents in general. Could you adjust that comment?

@micgro42
Copy link
Contributor

For the record: The alternative to merging this would be to replace the calls to $editarea.text( with $editarea.val(, because .text( refers to the original HTML but .val() references always the current value. In case of a textarea that would be its content.

However, this pull request provides a nice little extra feature and we should therefore go forward with it.

@alexriss
Copy link
Contributor Author

alexriss commented Aug 1, 2018

thanks for the fast response. The caret seems to be working fine in IE11. What does not work, though, is the label for the uploaded file. This is likely because once IE loses focus during drag-and-drop, the selection is unselected. Insertion still works without errors, just without the label-functionality.

@micgro42
Copy link
Contributor

micgro42 commented Aug 2, 2018

Awesome, thanks :)

@micgro42 micgro42 merged commit 2ee3e54 into cosmocode:develop Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants