steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
663 stars 1.7k forks source link

Strip core and make extendable for bootsrap, foundation, etc #18

Closed electricjones closed 9 years ago

electricjones commented 9 years ago

I love this library, but don't use bootstrap because I prefer Foundation 5. I've heard others request an angular port (Issue #13). So, I reorganized the library for my own purposes and wanted to send you the pull request. If you want any of this, you are welcome to it. I'll even transfer some repos to you if you like. If not, I'm sure I'll maintain some of these on my own.

Goals and Rational

  1. To create a core library that only depends on jQuery and jquery.hotkeys. The examples are all in (ugly) vanilla css, and the core library is not meant to be used by itself. Instead, users can include the core library into their own package and extend it to fit specific frameworks.
  2. To use bower to manage dependencies and gulp to build distribution files. Also, reorder into a more standard (bower-friendly) structure.
  3. To make easy documentation that allows users to create their own wrapper libraries.

    What I did

I did nothing to the javascript file. I just removed the extra dependencies from the bower file and worked through the example and index files to remove bootstrap for the core library. Then, I extended the core for bootstrap (a direct clone of your library) and foundation.

My Repos and Branches

The wrappers and the new core file include a gulp file that is used to build the distribution files. It automatically builds two versions of production files: a full and a standard. The full (full.wysiwyg-core.min.js) is a minified file for jquery.hotkeys and the library. The standard (wysiwyg-core.min.js) is the library alone. The user must include jquery.hotkeys.

I have also updated the bower.json files to include only the dependencies for the library itself, not the framework. So, my foundation library assumes they already have foundation, jquery, and modernizer. It only pulls in wysiwyg-core and jquery.hotkeys. It also includes a full_bower.json file that will pull in all the deps for them if they choose.

A couple notes

I know this sees like a lot, but I just wanted to let you know what I was up to. If you do decide to merge any of this, some of the links in bower files and readme's will have to be updated to point to the correct repos after the fact. I can update these if you like with a simple PR. Right now, some of the bower files pull in specific temporary branches to make everything work for my purposes.

Let me know if you have any questions. Thanks, Michael

steveathon commented 9 years ago

Hi Michael, I've reviewed this request and don't disagree with elements of it. Due to it's size and significant change to the codebase, perhaps it's a good idea to discuss this a bit further first? So I'm just going to leave it open for the minute.

electricjones commented 9 years ago

I agree. It's a pretty big departure. I most likely will maintain my fork with my foundation and bootstrap repos, but to be honest I won't do much more than clear up any issues that creep up. I will, however, pull from your repo any changes.

If there are parts of this that seem like a more manageable transition, let me know what you like and I can issue smaller pull requests. To me, the most important thing was to remove the bootstrap dependency. The glupfile and bower stuff was just for my own liking.

codewithtyler commented 9 years ago

I know this is a couple months old, but I definitely like the flexibility with this approach. It a developer wants to take a minimalists approach then they could use the core library with their own CSS/JS; otherwise, they could use whichever framework they prefer. If this particular PR isn't merged; I'd still be interested in seeing a core branch so anyone favors other frameworks can still get some use out of the project.

electricjones commented 9 years ago

I'm going to fashion my merge-pr into a full standalone branch next week. I'm also going to add a feature for custom tag support, I think.

electricjones commented 9 years ago

Well, I have decided to form this into a separate project for a more vanilla implementation with wrappers. It is now part of Phoenix Elements at https://github.com/phoenix-elements/wysiwyg. We will also be maintaining a bootstrap-wysiwyg implementation.

I will keep an eye out for relevant changes. Best of luck to everyone!