GithubHelp home page GithubHelp logo

rangyinputs's People

Contributors

asgh avatar thebox193 avatar timdown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rangyinputs's Issues

Undo / redo support

I'm using this lovely little library to try to replace CodeMirror in the Ghost Editor with a plain textarea and I stumbled across the fact that making changes to a textarea with rangyinputs doesn't work with the browsers internal undo/redo.

I know that this is far from a simple problem to solve, and I'm also aware that you probably know far more about it than I do, seeing as researching the problem turned up this ๐Ÿ˜

As the answer to the question "can this be solved?" is "sort of", I was wondering if having support in rangyinputs would be welcomed either by default, or via an option?

Make getSelection()['start'] the default value for [Number Start]

It would be nice if the Start argument in insertText() and related functions was optional and defaulted to .getSelection()['start']

So one would not have to do

$('#foo').insertText('Bar', $('#foo').getSelection()['start']);

but simply

$('#foo').insertText('Bar');

to insert at current caret position.

IE8 and IE9 support

I tried to set the focus to an input element and used insertText ( with behavior as carettoend) to add a character the same text field. As per the document, I assume that the cursor position will be updated and it was visible though. For next insert, I tried to fetch the caret position (updated) using getSelection after setting focus() and proceed with next insertion. Every time it returns 0 and the insertion happens at 0th position only.

IE 8 Bug

Firstly, thanks this awesome tool helping my day.
Here is a bug report, hopes it can help others.

In IE 8, the return object of $().getSelection().text is buggy.
I found out the reason.
The reason is the new-line symbol in IE8 is \r\n and IE11 or FF or Chrome is \n
This makes setSelection() and getSelection() buggy.

/*
<textarea id="area"> a
b</textarea>
*/
$("#area").setSelection(1,3);
$("#area").getSelection();

Thanks.

Can I using this plugin for contenteditable div?

I am using editor and i want to be replace button in editor menu. so that i have problem that selection text paste as |%selected_text%|

Like that selected Text is that Dhaval
replaced by : |%Dhaval%|

remove this character second time replacement to selected text Dhaval remove this character.
http://jsfiddle.net/varsadadj/7gcr6/

please give me right solution for this issue. for a long time i have this problem in my application.

extractSelectedText() behaviour differs between normal and minified JS

With the minified JS, if you put the cursor in a <textarea>, and don't select anything, then issue $('textarea').extractSelectedText() in the browser console, it deletes the character before the cursor, as if you pressed backspace.

The -src.js file doesn't behave this way. The version of both files is allegedly 1.2.0.

IE 9 Bug

I love this library and it works great in across all browsers, except I found an IE 9 bug in surroundSelectedText(). I am testing with IE 9.0.8112.16421 in Windows 7; the version shipped in the modern.ie Windows 7 IE 9 virtual machine.

If I have the following text in a <textarea> let's wrap this text OK? and I select this text from left-to-right with the mouse, I get let's wrap <strong></strong>this text OK? with the following function call.

function stabButtonWrapSimple(event) {
    var tag = event.data.tag;

    // Drupal.settings.stab.textareaId is the id including # of the element.
    $(Drupal.settings.stab.textareaId).focus();

    // Wrap tag around selected text.
    $(Drupal.settings.stab.textareaId).surroundSelectedText("<" + tag + ">", "</" + tag + ">");    
}

Is this something you would / could address? I am using this code in production and haven't been able to find a workaround.

Convert to NPM module?

Would be useful to have this published as an NPM module. It's convenient when using webpack and not having to rely on bower.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.