Git Product home page Git Product logo

wymeditor's Introduction

About WYMeditor

Description

WYMeditor is an open source web-based WYSIWYM editor with semantics and standards in mind.

The "WYM" part stands for What You Mean (is what you get). This is in contrast with the more common WYSIWYG—What You See Is What You Get.

Thus WYMeditor is different from the more common editors (like TinyMCE and CKEditor).

Its focus is on providing a simple experience for users as well as the separation of the content of the document from the presentation of the document.

It also adheres to web standards.

And its versioning adheres to Semantic Versioning 2.

Resources

Documentation WYMeditor documentation documentation badge
Code repository WYMeditor GitHub repository GitHub Mark
Website WYMeditor website http://wymeditor.github.io/wymeditor
Chat Gitter.im room Join the chat at https://gitter.im/wymeditor/wymeditor
Support WYMeditor questions in Stack Overflow Stack Overflow icon
Issues WYMeditor issue tracker  
Examples WYMeditor online examples  
CI testing WYMeditor Travis-CI report Travis CI badge
Bower Bower manifest Bower logo
Project mgmt Waffle.io board 'Project Management'

Why WYMeditor?

If your project requires that users produce consistent, standards-compliant and clean content, they'll thank you for implementing WYMeditor.

There are lots of choices when it comes to a browser–based editor and many of them are stable, mature projects with thousands of users.

If you require an editor that gives the end–user total control and flexibility then WYMeditor is probably not for you. On the other hand, if you want an editor that can be customized to provide the specific capabilities that are required in your project, and you want to ensure that users are focused on the structure of their content instead of tweaking fonts and margins, perhaps you should give WYMeditor a try.

WYMeditor also fully supports Internet Explorer 8.

Try It

Want to see what WYMeditor can do? Try the examples online, right now.

Browser Compatibility

Internet Explorer Internet Explorer logo 8 – 11
Mozilla Firefox Firefox logo LTS and latests two major versions
Opera Opera logo Latest version
Safari Safari logo Latest version
Google Chrome Chrome logo Latest two major versions

Requirements

  • jQuery: any version between 1.4.4 and 2.1.x. With jQuery 2.x and newer, there is no support for IE8 and older.
  • For IE8, ES5 shims are required. Tested with es5-shim and shams.

Global Pollution

  • window.jQuery.browser: jquery.browser v``~0.0.6``
  • window.rangy: Rangy v``1.2.2`` (includes the selection save and restore module)

Copyright

Copyright (c) 2005 - 2015 Jean-Francois Hovinne, Dual licensed under the MIT (MIT-license.txt) and GPL (GPL-license.txt) licenses.

wymeditor's People

Contributors

akx avatar anze555 avatar bermi avatar caffodian avatar citadelgrad avatar corphi avatar craigerm avatar evildmp avatar gyuris avatar jfhovinne avatar jonatansberg avatar jsalinas avatar kylegibson avatar lulalala avatar marijn avatar micolous avatar mightyiam avatar mireq avatar mpj17 avatar nickhammond avatar nickmcl avatar rogerhu avatar samuelcole avatar simi avatar teleological avatar totoro avatar travi avatar vrana avatar waffle-iron avatar winhamwr 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

wymeditor's Issues

FF: Table resizing

It is possible to size tables by dragging handles. Doing so is reflected in the markup. That needs to be filtered out at some stage before saving the page to the database.

Anchor relationship

To futher improve the semantic and accessibility aspects of the anchor element I think support for the ''rel'' attribute is nessecary.

More i18n

If I'm not wrong there left two words, which are not translated: "Containers" and "Classes".
It would be nice to have localized this words.

Acronyms and abbreviations

I think support for '''' and '''' with at least the ''title'' attribute should be implemented (editable) in WYMeditor. This would improve the semantics and accessibility of what the editor will output.

Utilize Mustache.js for templating

Mustache.js is an easy to use template engine for, amongst other languages, JavaScript.

It seems to me this would help the project focus more on the other parts of the system and help with a more flexible skinning system.

What are your thoughts on this?

default stylesheet link font color missing

When choosing Paragraph/Heading/... in the list at the right side the background color is set to #F2F2F2, but no font color is set. On a site with a light link color this will not work.

Patch to the default screen.css file:

change:
.wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; }

to:
.wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: #000000;}

SAPI: Mozilla: cursorToStart error

When you press enter after 'WYMeditor instance', that creates a new paragraph.
If you type some text, and if the cursor is at the end of the new paragraph, you get 'endNode is not defined', line 610, when you click on the link button.

[PATCH] Safari integration

This is my first take on the WymClassSafari.

It prevents the default behavior and preserves the selection for further processing (as suggested on the development wiki).

The class handles Apple-style-span elements and sets the correct tag for them.

Unsupported commands can be implemented using a simple name convention like:

{{{
WymClassSafari.prototype.InsertOrderedList = function(param) {
// InsertOrderedList implementation
}
}}}

This can lead to hackish code which might not be worth the effort, as new safari update with better execCommand support seem to be coming http://webkit.org/blog/?p=65

It also implements a commented version (as requested by Jean-Francois) of the duplicated tag removal procedure I added to WymClassMozilla #26 plus introduces some improvements and bug fixes.

There is a small annoyance when toggling into HTML mode. You need to click the textarea in order to see the html code. It seems like a CSS problem. Perhaps calling to focus() if the textarea is visible might help here.

Class and Container handler is not implemented yet.

Table accessibility

There is no way to add elements and attributes (th, caption, scope, etc) needed for accessibility to data tables.

Implement a way to detect available features

Not all WYM features are available in all browsers (safari lacks most of them) so there should be a way to detect/define which functionality is available in order to avoid showing no-working buttons.

FF issues

  1. When I click "enter" to create new paragraph at the end of it tag "br" is inserted. When I click "enter" once again this tag will move to the end of new paragraph.
    I'm attaching screenshot where you can see what I mean.
  2. Put the cursor at the end of last list item in list (ul or ol). Click "enter" once - new list item is created, click once more... and there should be new paragraph created. In IE this works good. In FF there is no new paragraph but the cursor is pointed outside the list block. New paragraph appear not till when you enter some text. I'm attaching screenshot where I've marked the cursor position.

Both issues noticed on Firefox 2.0.0.3 on Windows. On IE7 this works fine.

Select all breaks lists on Mac + Firefox

When editing the first box of the advanced.html file, if COMMAND + A is pressed for selecting all this contents

{{{

WYMeditor instance 0 with some text.

SourceForge Logo

  • One
  • Two
  • Three

}}}

is converted into this

{{{

WYMeditor instance 0 with some text.

SourceForge Logo

  • One

  • Two

  • Three

}}}

as you can see it encloses each list item into a paragraph block.

This is caused by the keyup reformatting so undoing using COMMAND + Z doesn't even work.

When undoing the editor should not perform any sanitizing or formatting as this might lead to data/format loss.

After a little bit of testing I've found that other blocks like "pre" are also converted into paragraphs.

This might happen in other browsers/OS

Text insertion breaks in IE7

Testing the 0.3 version on the demo page with IE7 under Windows XP. When I start entering text, I get the result shown in the first attached image: the text appears but there is no white box to indicate a paragraph.

If I press Enter and type more text, I get the second attached image: the new text appears above the old text, instead of below it. The white paragraph boxes appear, the new text is still above both of them, and the second box stays empty.

Table accessibility

There is no way to add elements and attributes (th, caption, scope, etc) needed for accessibility to data tables.

Address element support

To further the semantic nature of Wymeditor, I think we need to add support for the address element. This is pretty minor but I think it would be a nice feature to have.

Patch for removing nested tags in mozilla

This patch came up when trying to fix issue #22.

I found that Mozilla designMode does insert tags even if they are repeated. This leads to situations where generated code looks like this (emphasis can not be removed on wysiwm mode)

{{{

Welcome to MetaDesign.

}}}

when it should be just

{{{

Welcome to MetaDesign.

}}}

As you can see it takes the outermost tag.

This might also needed on other browsers and it can be easily moved to jquery.wymeditor.js

Browser detection

Proposal for browser detection

var d=document;
var moz=(d.designMode&&!d.uniqueID); //op9+ and gecko
var ie=(d.uniqueID&&!d.childNodes); //ie and !ie4

Select all in FF

When selecting all content of the editor (command + a / ctrl + a), all formatting like h1, table etc., is removed in favour of p-elements.

This happens in FF on both mac and pc.

Mozilla : can't set designMode when editor is hidden

While integrating WYM into Drupal, I met this problem : if WYM is embedded into a hidden container (collapsed fieldset, hidden div...), it will fail on load (exception : can't set designmode).

This is a known Gecko bug and the fix consists in[[BR]]

  • catching the exception when setting designMode[[BR]]
  • Resetting designMode when WYM's body gets focus

Attached are a test file and a patch against jquery.wymeditor.mozilla.js (Latest SVN).
Might need some work.

SAPI: Opera: iframe looses the focus

When you click on e.g. the Link button, cursorToStart is called (for debugging purposes), and the iframe looses the focus, so the cursor disappears.

Ctrl+B for bold, Ctrl+I for italic on Firefox

Testing with Firefox on MacOS X, using the 0.3 version of WYMeditor on the demo page, I can't use the Ctrl+B/Ctrl+I key combinations to toggle bold and italic text. The same keys do work under IE7 on Windows XP.

Indent / Outdent Button suggests wrong action

IMHO, the buttons representing indent/outdent actions suggest that they create nested lists instead of blockquote. Besides I would appreciate such a "nested list" functionality.

Coding standard

I would love to help to enhance the code legibility but I cannot find anything about a coding standard.

Are there currently any efforts to create a coding standard? As I'm not familiar with the defaults of the jQuery community I'm not really sure if my style is too deviant from what people are used to...

I'd be willing to start working on a draft if required.

[PATCH] Automatic path setting

The default path should be automatically guessed by WYM, allowing users to overwrite it if desired.

This patch computes the base path by analyzing the '''src''' attribute in
{{{

<script src="/javascripts/wymeditor/jquery.wymeditor.js" type="text/javascript"> </script>

}}}

Setable root path for WYMeditor scripts

It would be very useful to be able to set a ''root path for the wymeditor-folder''. At the moment I'm building a CMS system and WYMEditor as a plugin. This could be done in one of the constants.

sWYM_PATH = "/cms/plugins/orlokwymeditor/wymeditor/";

I can of course change the paths by replacing strings in the affected variables (for example in sIframeHtml and sDialogHtml). And maybe that's the idea altogether. But I figured I'd post a ticket just in case.

== Example ==

My WYMeditor-folder is places in a plugin-folder, as such:

{{{
/cms/plugins/orlokwymeditor/wymeditor/jquery.wymeditor.js
}}}

I include this script, and others, from:

{{{
/cms/admin/index.php?page=pageform
}}}

This, however, makes the paths in the script wrong (in the ''sIframeHtml'' variable):
{{{
/cms/admin/wymeditor/wymiframe.html
}}}

This also appears in the WYMeditor-generated dialogs (in sDialogHtml variable):
{{{
/cms/admin/jquery/jquery.js
/cms/admin/wymeditor/jquery.wymeditor.js
}}}

Link Edit broken in Firefox (2.0.0.3)

I am unable to edit existing links in Firefox.

When I put the cursor on a link and click the Link-button the window pops up as normal with the correct values in the textboxes. But when I click Submit, the window closes but no changes are made on the link.

I tested the same thing on the same page in IE7, and that worked fine.

Regards
David

Item focus is lost when switching container

Reference : [http://forum.wymeditor.org/forum/viewtopic.php?t=80]
In Mozilla, when switching a container, focus is lost, so you must click on the container to give the focus back to it.

This piece of (hacky) code might do the trick :

{{{
function setFocusToNode(node) {
if (moz) {
r=document.createRange();
r.selectNode(node);
sel=iframe().contentWindow.getSelection();
sel.addRange(r);
sel.collapse(node,0);
iframe().contentWindow.focus();
}
}
}}}

Attached is a modified 'wym.js' file, implementing the function above (for WYMeditor '''0.2.2'''), in case someone wants to see this function in action.

Request for Special Characters feature

I have run into a real-world situation where one of the users of SkyBlueCanvas with Wymeditor needs to be able to insert html special characters without editing the raw HTML (¨ » etc.). I think this is going to be a necessity in a fully developed version of Wymeditor.

Core functionality to modify edited documments

In order to acomplish Safari integration and adding support for semantic tags like

, WYM needs to be able to replace selected text and insert code before/after the caret.

As jf.hovinne suggested at #12 insertAtCaret should be implemented in the core.

Other useful methods to implement might include

  • hasContentSelected
  • getSelectedContent
  • replaceSelectedContent
  • insertAtCaret
  • deleteSelection
  • moveCaretTo
  • getCaretPosition

If this sounds OK, I will start adding this features at the [https://trac.wymeditor.org/trac/browser/branches/new_parser New parser] branch.

Continuously update HTML box with current HTML

As of 0.3 you can make changes in the HTML textarea and they are immediately reflected it the WYMeditor portion below, but why doesn't it work the other way around? You have to click the HTML button to close the HTML pane and then click again to reopen and see the latest HTML.

Paste from Word in FF

If you paste directly into the window from MS Word (in FF), you still get a big mess in WYM Editor

... and if I click the "paste from word button" with an entirely empty main textarea, nothing pastes at all.

Mozilla : can't unset bold and italics when using 'strong' and 'em'

Steps to reproduce :[[BR]]

  • edit "advanced.html"[[BR]]
  • in the 'wym.html' call, add some html containing 'strong' and 'em' tags :
    {{{

    Bold, Italics

    }}}
  • open "advanced.html"[[BR]]
  • try to remove bold or italics

The same problem occurs with WYMeditor 0.2.2 when dynamically inserting the html content (see the issue on drupal.org : [http://drupal.org/node/134278] ).

The workaround is to convert 'strong' and 'em' tags to 'b' and 'i', ''before'' inserting the content. To test this, I used the following quick fix :

{{{
Wymeditor.prototype.html = function(sHtml) {
if(sHtml) {
sHtml=sHtml.replace(//g,'').replace(/</strong>/g,'');
sHtml=sHtml.replace(//g,'').replace(/</em>/g,'');
$j(this._doc.body).html(sHtml);
}
else return($j(this._doc.body).html());
};
}}}

Hope this will help you.

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.