GithubHelp home page GithubHelp logo

grande.js's Issues

Can I bind to dynamically generated DOM elements?

Thanks for the work, this is beautiful.

I am looking for a light-weight text editor like this to apply in a CMS.

Instead of grande.bind() or grande.init() to the whole document, can I apply this to part of the DOM just when the editable area is generated?

H1 on LI element problem

Hello,
I have tried to set H1 tag on a list element and it works correctly. If I want to remove h1 it doesn't work well, I must delete all the phrase.

Try on the index.html.

Unable to make a heading bold in firefox

Text in a heading (tested h1-3) won't turn bold. It is possible to turn text that is already bold into a heading, but not the other way round. Occurs in firefox on both linux and mac. Works fine in chrome.
Thanks for the nice editor guys! Keep on that nice work!

Editor not working well when using Firefox.

I tried deleting the entire default content (select all then delete) in an attempt to start writing something from scratch. Editor seems to no longer work properly when I do.
Please see the video link:
http://www.screencast.com/t/tXqSBPGG

Note:
Editor works well with Safari and Chrome. Only Firefox seems to have this issue so far. (haven't tested in IE yet).

Thanks!

Cheers!

Non-selectable nodes unselectable.

Hey there Matt,

I've run into an issue (may well be the idiosyncrasies of my setup?) where the other elements on my page that are not contenteditable / selectable by grande then become non-selectable (i.e. can't highlight text / select a text input etc.).

Narrowed it down to line 529 in the triggerTextSelection() function which returned false when an element wasn't contenteditable (i.e. 'cancelled' the selection event).

  function triggerTextSelection(e) {
      // The selected text is not editable
      if (!e.srcElement.isContentEditable) {
          return false;
      }

Again this could well be the particularities of my page setup, but if anyone else runs into the same issue, I got things back on track by returning from the function, but not returning false.

i.e.:

  function triggerTextSelection(e) {
      // The selected text is not editable
      if (!e.srcElement.isContentEditable) {
          return;
      }

Great work on this plugin!

Cheers,

Dylan.

Support for hr

One of the lesser known features of the medium composer is the ability to add horizontal breaks by hitting enter twice.

I have a patch ready that implements this but it's probably better to land it on a separate branch for review and further testing. Would you mind creating a branch so I can send a pull request? :)

Replace execCommand defaults with semantic tags

Currently execCommand with bold and italic produce the <b> and <i> tags respectively. There should be an override to the document.execCommand to support the additional args and fall back to the standard if necessary, Medium looks like they implement a function queryCommandValue in the main-posters.bundle.js that provides some of this additional functionality.

Editing hyperlink text results in underlined text

Problem: Changing the text of a link results in <u> elements instead of the text being changed inside the <a> element.

Steps to Reproduce:

  • Type some text
  • Create a hyperlink using the editor
  • Place cursor at the end of the hyperlink
  • Press BACKSPACE
  • Type new text
  • This new text is wrapped in <u>

missing feature

it's just missing the image tag

and what about youtube tag and other social media tags like the new wordpress editor

Add 'destroy' function

A destroy function that removes all grande-specific DOM elements & event handlers would be incredibly handy.

Add 'destroy' function

A destroy function that removes all grande-specific DOM elements & event handlers would be incredibly handy.

Backspace bugs

Right now, backspaces in grande behave a bit differently than on medium. Here's a non-exhaustive list of issues I noticed:

H1 WTF in Chrome

Carret at the start of an h1 which is preceeded by a paragraph, hit backspace; the content of the node is appended to the previous paragraph but surrounded with a <span style="font-size:2em"> (i wiish I were kidding :p)

On medium the nodes content is simply appended to the previous paragraph.

Cancelling lis

On medium, when the carret is at the start of an li and the user presses backspaces, the li is turned into a p, regardless of the content of that li or the number of surrounding lis.

In grande the behavior differs depending on the browser. Chrome usually deletes the li and appends the content to the previous tag, regardless of what that previous tag is.
Firefox has a range of different behaviors depending on whether the li contains text or not, whether it's inside and ol or ul or even the lis position in the list.

Deleting hrs

I didn't mention it in #19 but hr deletion will need adressing too. Chrome handles it rather fine, but Firefox and IE do very different (and non-sensical) things.

Headings not inline with Medium

Medium's toolbar contains buttons for adding H1 and H2 level headings. But the HTML output is H2 and H3 respectively at the dom level.

Grade.js insets H1 as H2, and so forth...

Description is too awesome.

It's a Medium at Starbucks. Pinky ring out.

I mean, seriously. Isn't a Medium-inspired editor good enough??

Code support

Hitting ctrl + 6 should trigger...

a code block

Test harness for visual and logical regression

The code's getting to a point where a test automation framework will be useful in order to merge code at a higher cadence.

Catching logical regression should be fairly straightforward, could use either Jasmine or QUnit, no real preference.

This plugin needs to maintain visual consistency between major browsers (Safari, Chrome, and FF for now) and checking all these by hand is a bit taxing for innocuous fixes. Was thinking of a visual regression tool such as Huxley, PhantomCSS, or Wraith.

ul/ol Differentiation

It seems that sometimes I start with an

    , even if I double return after the last element it will keep the ordered list tag rather than either starting over and/or allowing me to use a
      . I couldn't replicate it the other way around. It appears I would have otttriple return or soft return to get it to stop.

Do images work?

Are image uploads supported? There reason I ask is because the roadmap says they will eventually be included, but there seems to be some commit that indicates they might have been included: #17

Are there any examples of how to use inline images if they are supported?

Demo link not working

Hi @mduvall! I wasn't sure if it was still being maintained but incase it is - the demo link doesn't seem to be working, could you please take a look?

Add support for <figure>

Implement how Medium inserts images into the contenteditable region, the corresponding HTML tag is <figure>, see image below:

out

Lists!

I know the whole idea is minimal but ordered and unordered lists as a plugin option would be great - and that is the only missing thing.

The way I see it is you highlight the text choose list icon and it indents the line and starts the list returning creates the new item deleting that breaks out of list.

<h1> backspace merges previousSibling

Stated in ticket #20

This needs to handle backspace events to merge the nodes gracefully. Medium probably has a transformation map of what to do with element types (<h1>s =><p>s as an example).

Backspace on start/empty removes wrapper tags

You can see this on the demo page. Select everything, delete and delete again. You can now type and your text won't be formatted properly. Start a new line and you're back inside a paragraph tag.

screen shot 2014-01-12 at 13 23 54

<article class="content" contenteditable="true">
  Look ma, no tags!
  <div><p>
    From tags to riches.
  </p></div>
</article>

Unable to install through bower.

I tried to install this through Bower but it is showing the following error :

bower grande#*              not-cached git://github.com:mduvall/grande.js.git#*
bower grande#*                 resolve git://github.com:mduvall/grande.js.git#*
bower grande#*                 ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com:mduvall/grande.js.git", exit code of #128

Additional error details:
fatal: unable to connect to github.com:
github.com: Servname not supported for ai_socktype

I did a google search and I got this StackOverflow result.

Can you have a look, I would really like to use grande.Thanks!

Changes in Medium 1.0

Is Grande.js looking for parity with Medium in terms of features? If so, this means a couple of new features concerning images since Medium changed their interface.

Images can now be floated inline, floated inline and offset to the left, small, large, or cover mode, taking the full width of the screen. Attached is a screen shot.

screen shot 2013-12-05 at 01 08 44

Inserting hr before non empty paragraph

In 7b45776, prevSibling is assigned the previousSibling of selection.anchorNode. The problem is that when the user presses enter and the caret is at the beginning of a non-empty paragraph, selection.anchorNode is the text node inside the paragraph, not the paragprah itself.

Because of this, inserting a hr before an existing paragraph is broken right now, as prevSibling isn't the expected node.

In that situation in medium, the first enter keypress inserts an hr, the second a paragraph, etc. This makes it possible to stack empty paragraph and hrs, so that might be a bug on their end but not a very important one.

Using selection.anchorNode.parentNode is probably not robust enough either, because if the paragraph starts with an i tag, we'll get the text node inside the i. This is why I initially used getParentWithTag but it feels a bit hacky.

Selection shows Grande's toolbar even in elements there were not binded

I'm using Grande.js in an app and I'm binding Grande.js to a specific element. However, if I select text in a totally unrelated element, Grande's toolbar (with the tools h1, h2, h3, etc) pops up anyway.

I'm sure I'm only binding Grande to the desired element.

Is this normal or could I be doing something wrong?

This is how I am binding Grande:

window.grande.bind(document.getElementById("editor-article"));

Any appetite for tables?

It seems that most 'medium-style' editing experiences eschew HTML tables. I think I get the reasoning, but I also think there's certainly a place for one that includes simplified table management. Is there any appetite for this in your project?

Emit a typing event to be used with autosave scripts?

Just wondering if this belongs in here. While it's easy enough to do on it's own, I imagine a lot of people trying to use this to emulate Medium will also use autosave.

I'm imagining something like an 'updated' event fired on every keystroke, throttled to emit every second or so during rapid typing.

<li> backspace merges previousSibling

Stated in ticket #20.

Medium's behavior seems to merge all non-paragraph elements into the previousSibling paragraph. This will probably be good enough for now.

This fix will likely be related to #23 since the transformation table should take care of the issue.

Feature request: Test link

Would be great if you could test the link you type. This could be done by detecting holding down Ctrl or Cmd key while you hover the link, making it clickable... or you could add a little button to the link dialog box that you can click to test it.

This link should only open in a new window/tab also, of course. 😄

Add 'destroy' function

A destroy function that removes all grande-specific DOM elements & event handlers would be incredibly handy.

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.