Giter Club home page Giter Club logo

oscargodson / epiceditor Goto Github PK

View Code? Open in Web Editor NEW
4.2K 4.2K 338.0 1.45 MB

EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.

Home Page: http://epiceditor.com

License: MIT License

JavaScript 83.20% CSS 4.11% HTML 12.68%

epiceditor's Introduction

epiceditor's People

Contributors

aj-acevedo avatar dadambickford avatar dobozysaurus avatar fabiankoestring avatar gankra avatar hongymagic avatar jeffhill avatar johnmdonahue avatar jpdevries avatar jwmcpeak avatar kkirsche avatar koorgoo avatar kousu avatar lamplightdev avatar loominade avatar madpew avatar massar avatar nkovacs2 avatar oscargodson avatar pbougie avatar phillipalexander avatar sagarjunnarkar avatar samkelleher avatar sebnitu avatar tiziano88 avatar yoloseem avatar zethussuen 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

epiceditor's Issues

iOS Support

We need to make the editor work on mobile devices, but for 1.0 just iOS5 for now. If more, awesome. I'm sure it'd mostly be CSS with some minor JS checks for touch support.

Maybe even on focus the editor fills the phone so it's just the editor and keyboard.

Revamp of theming

Putting a stub here because i don't really like the current theming style, but im also not entirely sure how to make it better.

Fullscreen preview display scrolling issue

Right now when you copy our README.md into EE, and go to fullscreen display, it doesn't want to let you scroll all the way down the preview half, cutting off quite a bit of the preview. Could be related to the HTML code that is in our md file.

Horizontal Fullscreen

If you have a monitor that's taller than it is wide, we should flip EE's duel screens to fill up space better.

Verify normal markdown links work

People reported that normal MD links weren't working. Like [some link](http://google.com) If it works fine in Chrome, FF, and IE9 sure it works elsewhere.

2px smaller preview in IE9

I thought this was fixed with this code:
https://github.com/OscarGodson/EpicEditor/blob/master/epiceditor.js#L343-346

And it's working here when i was testing it:
http://kneedeepincode.com/epiceditor

but on our gh-page its like the 2px is never getting added. On the kneedeepincode page I added a breakpoint inside the if and checked the height and it was like 329 (right) and then added another breakpoint right outside the if and checked the height again and it was indeed 331. On the gh-page tho, the 2nd breakpoint is reporting 329. So... im clueless.

The best fix would be to get rid of that _isIE() line and actually figure out wtf is going on exactly.

Allow custom .save() routes and other things

The .save() method should be configurable in .options() with custom API routes so that .save() doesn't only save to localStorage but also some external API.

Something like...

ee.options({
  routes:{
      create:'/api/create/', //on ...?
      read:'/api/read/',     //on .open()
      update:'/api/update/', //on .save()
      remove:'/api/delete/'  //on .remove()
    },
    saving:{
      saveInterval:500,
      saveOnKeyUp:false
    }
  }
}).load();

Above sets up 4 custom routes for all your CRUD commands. It also turns off the default saving on keyup and turns on saveInterval which will automatically .save() every half a second while focused on the editor. Each half second EE will emit a 'save' event for you to hook into.

Also, .save() will need to accept a callback if create/update is set.

Not entirely sure how the create route would work and read would basically run on .open() and remove on .remove(). All would have callbacks like .save().

NOTE: the D in CRUD stands for delete, but delete is a reserved word in JS. Rather than making users remember to quote 'delete', we should use remove instead.

cc: @techwraith

Remove localStorage cache every N days/weeks/months

If we don't auto clear the cache in LS shit's gonna fill up at some point (since we don't know what else is being saved on the domain; could be images for example) and then the user is going to get hit with errors or will no longer have localStorage saving their work in progress posts.

This should be configurabe in options so that domains that fill up LS can either disabled LS with clearCache:0 or set it to clear every N days/weeks/months like clearCache:1000*60*60*24. On the very first time loading this EE will save the current date in its LS stash and keep checking every reload after if it's been N time since the original set time.

Thinking something like this:

ee.options({
  clearCache:1000*60*60*24
}).load()

Flash of unstyled preview

Super annoying. On each page load when you switch to preview you'll see a flash of CSS on a remote server (not locally since it loads too fast) as you can see on the github page. To fix just preload the CSS with the private _insertCSSLink() function like i use in the preview() method. The preview() method should check if it's loaded or not anyways so it shouldn't break anything.

Finish README

Quickstart especially is missing the whole cloning/downloading piece

Docs don't have the .remove(name) method

Need to add to the index.html doc and the Markdown doc (don't forget to add it to the table of contents of both) and add an example. Bump version to 0.0.2 once it's done.

Edit/Preview icons should toggle

There should be a specific edit button and a specific preview button. When you click on one it should toggle between the two depending on which mode you're in.

Fullscreen in non-supported browsers

While not entirely important, it'd be great to still support fullscreen by doing "fullwindow" rather true fullscreen. i.e. the editor would fill the window and act just as if it would in fullscreen in supported browsers.

Have a pretty loader

Currently you get a flash of unstyledness while the editor loads. There should be a nice prettier loader.

Remember indentation

This is super useful for writing code. I.e.

If i type (where the pipe is the cursor):

if(){
  alert() |
}

and press enter it should appear in line with the alert() like

if(){
  alert()
  |
}

Scrollbar is hidden if previewer theme adds padding to the wrapper

It has to do with _getStyle() returning 0px even tho it's not 0px. If i set the padding with JS like this.previewer.style.padding = '10px' then _getStyle() magically works, but if it's set with CSS it doesn't. It's also strange because i can get the padding of any other element just fine.

Don't scroll parent window when focused on editor

Lets say you're scrolling through a large MD file, once you hit the bottom the entire page will start scrolling, not just the iframe. AFAIK you can't prevent scrolling, however, you can add a document.body.overflow = 'hidden' and it will make the page not scrollable.

We'll wanna probably see if it looks ok to do that, but this will make it so as long as you're focused on the editor (mouse hovering, or click inside the iframe) you can't start to scroll down the parent document.

Make editor work in IE7

Should work, but not look like IE8, 9 or FF/Chrome latest. We should go with a "lite" version which has no fullscreen or animations.

EE Packages

I want to enable 3rd party devs to easily script EE not just with the normal public API, but through packages or plugins. Ideas?

I have this idea currently:

EpicEditor.extend({
  name:'wiki'
, type:'parser'
},function(){
  //parser code...
  return html;
});

Above creates a parser package so you could replace Markdown parser we use, or in this case, add wiki support. There could be other types like plugin or extension or some other name that is a general extension of EE. By default it'd run it as a plugin, but offer alternatives like parser to change more of the core code programmatically and without worry about breakages during upgrades.

Don't lose scroll position switching between edit/preview

Currently if you are editing and you scroll down, click preview, then go back, your scroll position is lost. On previewing we need to save the scroll position and recover it when editing again. Because we don't know what kind of edits were made, preview mode should always jump back to the top, but edit should be saved... i think, unless anyone has any objections.

Add warning for browsers who don't support localStorage offline

Firefox won't let you save localStorage via the file:/// protocol so give a warning. We can do something ugly for now like an alert:

alert("Your browser doesn't support storing content via your file://. Please run epiceditor via http(s):// or use a different browser.")

Add .rename(current,replacement)

Add a .rename() method which will take a file name as the first param, and then the new name as the 2nd param. It'll just rename the key in the localStorage object.

Support key shortcuts

Key commands should allow for preview and edit modes.

Also, the key commands should only work if the editor is in focus.

Optional buttons for common styling

Sort of like a WYSIWYG, have buttons for bold, italics, links, etc. see GitHubs wiki editor for an example. This should be off by default tho.

Add .import(name,content)

We should have a .import() method that takes a string and is a proxy function of basically:

 EpicEditor.prototype.import = function(name,content){
   var self = this;
   content = content || '';
   self.open(name).get('editor').value = content;
   self.save();
   return this;
 }

Change out saving on keypress to on an interval

Add an option for performance if it's an issue, but by default save every 100ms rather than on keypress. This will also fix issues with copy and pasting using a right click context menu or the file menu and not your keyboard.

Filing as a bug since it's "technically" a bug that it wont save when you copy and paste and nothing shows up.

Support data-filename

You should be able to open a file via the data- attribute like:

<div id="my-editor" data-filename="foo"></div>

Currently it'll make a file called "my-editor" if no different .open() is used.

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.