Code Monkey home page Code Monkey logo

pell's People

Contributors

dylanpiercey avatar geppy avatar jaredreich avatar sidkwok avatar sufuf3 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  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

pell's Issues

Editor doesn't initialize on the IE 11.

After trying to open the editor on IE the console throws an error:
przechwytywanie

The same happens for IE 9 and 10, console throws the same exact error for both of those browsers.

Please provide a way to add commands without overiding defaults

Hi
Can you provide an option of adding more commands to default actions on initialization?
I suggest you use a different variable example (extend) which is an object that will eventually be merged with actions. That way we can add other commands like h3 h4 etc.
thanks

Custom Actions with Promises not Working

Hey,

I was using SweetAlert to retrieve input in custom actions:

actions: [
  {
    name: 'link'
    result: () => {
      swal('Enter Image URL', { content: 'input' })
        .then(url => pell.exec('createLink', ensureHTTP(url))
    }
  }
]

This doesn't seem to do anything? The URL does get returned properly though. I'm guessing it has to do with document.execCommand() and trusted events... but I'm not so sure.

Thanks!

A11y Issue: Keyboard/Tab Trap

Keyboard trapping occurs due to the tab key feature (#13). When a keyboard user tabs through an the interface and reaches the Pell editor, they will be stuck inside it if they are without mouse control. There's also the issue of missing WAI-ARIA support in the editor's markup but I'll open a separate issue for that πŸ˜„ .

There's a short discussion regarding how to handle keyboard trapping with regards to the text fields: 'What keyboard input makes sense for tabbing out of a rich text field?', and also a case study from the WCAG 'No Keyboard Trap'.

I can see two fixes for this issue:

  1. Add config property to permanently disable tab key input, or
  2. Binding the esc key to temporarily disable the tab key input until the user starts typing again to allow them to hit tab again to leave the text area

Remove horizontal line

Hi!
Good job for Pell.
But a little things make me crazy:

  1. Can't remove the horizontal line.
  2. Can't white under the horizontal line.
  3. adding undo et redo doesn't works.

Thanks you for help!

Saving/Loading documents to various formats.

Hi there!

I've got a Cloud PaaS I've been working on and I've figured out a way for pell to load/save files to/from a users Cloud Drive. It's still in the very early stages and I haven't got a working version yet. I am getting very close though, and I'll get it eventually.

In the meantime, I've added a bunch of PHP code to start Unoconv, take in inputs from the user, and display primitive options and a table full of compatible files from the users Cloud Drive.

What I've found is that the pell textbox is very fragile and disappeared on me while developing around it. I've been unable to repeatably pinpoint the offending code. Maybe the pell experts could take a look and tell me what I broke? I am eager to provide whatever info I can to help get past this hurdle. Let me know if I forgot anything important.

Thanks, guys!
zelon88

Undo or Clear Formats

Hi guys
I think it would be nice to add the option of undo, remove or clear formats.
What about the ability to preview editor code
thanks

Filtered paste: Remove all but basic formatting on paste

I realize that eventually a "Clear Formatting" feature might be added later, however, I wonder if there's a way to (on paste) clear all formatting except what is allowed by the interface buttons. I get I can "cmd shift alt v", but the specific thing I'm looking for is a filtered paste instead of just removing all formatting.

Allow `styleWithCSS` option

This option would allow HMTL output to look like this:

<span style="font-style:italic;">Blah</span>

Instead of

<i>Blah</i>

Putting pell in a form

I tried to put pell in a form, and i found each pell-button press will perform a form submit
how could i avoid that?

HTML Code Preview Option

Hello Pell Team,

I believe a code preview action button or plugin that reflects changes in the editor preview would be a great feature.

Indicate text formatting on highlight

When a section of text is highlighted, the formatting bar (Bold, Italic, Underlined, etc...) should show which formatting options are applied to the highlighted text.

Pre-populate Pell textbox with PHP.

Hello again!

I was reading this issue and it did not seem to help.

I am trying to pre-populate the Pell textbox with content loaded by PHP. So far I've tried using PHP to generate a Jscript function that will change the innerHtml of the "pell" div with a PHP variable.

Here's the code...

if (isset($_POST['pellOpen']) && $pellOpen !== '') {
echo ('
function pellOpenData() {
document.getElementById('pell').innerHTML = ''.str_replace('"', '', json_encode($pellOpenFileData)).''; }

window.onload = pellOpenData;'); }

and the Jscript function it generates...

function pellOpenData() {
document.getElementById('pell').innerHTML = 'fs<b/>dfsda</b/>\n'; }

What I get for an output is a textbox with no styles and no options bar at the top. It's just pre-formatted text from the textfile I'm feeding it.

Any advice would be greatly appreciated.
Thanks guys!

User cannot restore the original size once applied Header style

When the highlighted text is applied with H1 or H2 button in the formatting bar. There is no option for user to restore back to original size of that particular text. The indication or toggle-able buttons on the formatting bar might be an enhancement to mitigate this issue.

Preload existing content

Maybe I'm missing something but how can I show pre-existing content inside an editor istance?

Allow multiple instances

Are multiple editor instances possible?
Is it just a matter of calling pell.init a couple of times with different root IDs?

How do I remove an anchor link

I'm really keen on this plugin. However, when using your demo version I add a link there doesn't seem to be a way to remove it. I highlight the linked text, then click on the link icon again (usual UI behaviour) but it brings up another modal box.

Am I missing something?

Font size buttons

What do you think to implement two buttons to increment / decrement font-size?

PS. of course I will personally make PRs for all of the issues I'm opening if you'll accept them.

Using it inside a form

Related: #35

@jaredreich Do you think we can have a type for button?

PS: I am using the following fix right now:

const pellButtons = document.getElementsByClassName('pell-button')
for (let i = 0; i < pellButtons.length; i++) {
  pellButtons[i].setAttribute('type', 'button')
}

what do we do about something like c++ code?

such as
#include <header>
?
its all good the time you wrote them, but when you store them somewhere and restore them back to the editor, them disappeared(they are filtered?)

Highlight Formatting Option on Mouseover

When the mouse cursor is overtop of a button on the formatting bar (Bold, Italic, Underlined, etc...), the button's background color should change to indicate that it will be used when the user clicks.

It's a little difficult to tell which option is selected until you click, in some cases.

Format Default Output

Hello Pell Team,

When you type in the pell editor and press enter, the html output adds a div with text in it. Can you change this to be another element (like a p tag) instead or have all text be wrapped by a p tag? Currently, it sets it to <div></div>.

Example, http://recordit.co/O5dBRBdKbw

Return key behavior

Hi, is it possible to change the behavior of the return key? In particular I would like to create a "p" tag instead of a "div".

Thanks!

[Question] How can pell to keep the selection in editable area?

I found something interesting when I was using pell. I clicked the action button, then execCommand API worked with current selection, it seems everything is OK.But, as far as I know, clicking buttons means blur, blur means losing selection.

If I write a rich editor, I prefer to save the selection on blur and restore it on focus, however, I found handlers like this nowhere in the source code of pell.

How can pell do that?

Allow HTMLElement as root

Hi, awesome minimal library! I was playing around with pell and found that the root option only takes an id string as its value. I think it would be great if it supports HTMLElements as well. That way it's easily pluggable into any framework/library.

Just to make a point, I am working on a library called cell, and currently the only way to integrate pell into cell is by using the default syntax, I have to have an id set to the pell element. Here's an example https://jsfiddle.net/ps91th2L/2/

However if we allow an HTMLElement to be passed as root (See the commit here: https://github.com/gliechtenstein/pell/blob/master/src/pell.js#L118), we can get rid of the id, resulting in something like this: https://jsfiddle.net/ps91th2L/1/ (Note that I'm passing this as root, which in this case is the node itself instead of an id string)

But anyway I'm pretty sure you don't want to add all kinds of features to bloat up the library so just wanted to create an issue instead of sending a PR (it's just that one line change I linked to above)

Demo Style

It seems has some style problem in demo page
pic

`icon` in `actions` may cause xss attack.

    button.innerHTML = action.icon

I see this line in your code.

and if I did this:

...
actions: [
    name: 'attack',
    icon: '<button onclick="console.log(\'you are under attack\')">attack<\/button>',
]
...

When I click the attack button, I will see "attack" in my console.

I think it's dangerous to render the string from users in our website.

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.