Comments (19)
It seems that this also disables the accordion feature of the admin menu. Menu items are revealed if you click on the parent, but clicking on the arrow does nothing when the Codemirror javascript is loaded. I'm looking into it.
from sage.
What kind of feature set are we looking for with CodeMirror? Pretty much anything that the normal Wordpress editor does needs to be re-implemented to work. I've just removed the quicktag buttons from the HTML editor because I figure if you're using a code-editor you won't be using those. Word count and resizing shouldn't be too big of an issue, but what else?
from sage.
ideally codemirror would just be replacing the textarea on the html editor and have all the buttons still work, if that's not easy then we can ignore it for now
need to also make sure that drafts still get automatically saved
from sage.
I'll dig into the TinyMCE source more and see what's possible. I've got drafts saving automatically.
from sage.
Ok, sweet, the insertion buttons are working. Had some thoughts about a couple of enhancements. How about making the b and i buttons actually insert their respective tags instead of strong and em, and adding buttons for those two now that all four are a part of the html5 spec. My other thought was to add a prompts for title to the link insertion dialog.
from sage.
all of the above sounds good, i'll check out your repo tonight :)
from sage.
Haven't added any enhancements yet, still working on getting resize working. I pushed my current hack so you can take a look, there are some comments in there detailing the problem as it stands.
Other than that it's all good I think, though some of it could use to be cleaned up a bit. Any pointers are appreciated--this is my first time coding after nine months in Africa so I'm a little rusty.
Once resize is done, I'll add the other features I mentioned. Is it worth adding a page to the wiki outlining my changes?
from sage.
sorry, still haven't checked this out yet but i haven't forgotten! will get back to you soon
from sage.
@chadskeers: I'm testing your fork. CodeMirror is great and working. Word count and autosave too.
It's too bad that CodeMirror disable the TinyMCE. It would be amazing if the work tab "Visual" also works.
@retlehs: I flew over the code. There are plenty of code and files only for CodeMirror.
This is not a problem for Roots?
from sage.
@monsiert: I think I can get the visual tab working. I'll get back to you on that. As for the numerous files: this isn't production quality code. The workarounds for word count and the quicktag toolbar require dequeueing some stuff that wordpress inserts all packaged up and minified. I want to minify all of the business logic for codemirror, quicktags, and the word count so that it can be one file.
What I was really hoping or was some input about the resizing problem that I discuss in scripts.js. For now how about I make a production quality branch that doesn't have resizing enabled and continue work on resizing and enabling the visual editor?
from sage.
@chadskeers - production branch sounds good. i'd say resizing and visual tab are necessary in order for us to roll this out
thx a lot for working on this
edit: might be best to work on this in a wordpress 3.2 environment just to be safe
from sage.
Visual tab is working, going to dig into TinyMCE to see how they do resizing. Hopefully I can make it consistent between the two.
from sage.
Awesome ! :)
There is a place where you can test it?
Did you commit on your repo?
from sage.
@monsiert: Well, to be honest I somehow bricked my repo so I deleted it and reforked. I think it's better this way anyway though because I'm keeping all the CodeMirror stuff in a branch now. I'm hoping to have the whole thing sorted out and pushed to my repo by Sunday night.
What do you mean exactly by a place to test it? I'm testing it on my local machine...
from sage.
I mean: where can I download/test/fork it ? But you already answered to my question.
Thank you. :)
from sage.
@chadskeers: ty sir!
from sage.
Ok ran into some snags, there's a branch up called codemirror you can look at though. I think I'm going to have to add editor.js to my list of WP script files to override. That script does a ton of substitutions when switching back and forth between HTML and Visual mode, and it ends up stripping out some
tags as well as removing all the indenting that codemirror does--essentially undoing all the prettification that codemirror provides.
Still no resize, though it will check cookies and take on the size of TinyMCE. I'm going to be relocating over the next week so I doubt I'll get time to work on it in the short-term. My first priority for the moment is figuring out a way to retain the structure between editor modes.
Right now there are a whopping 8 files just for codemirror, 9 if I rework editor.js, but I think it could be feasibly cut down to three. Minification can wait til the rest is working though.
from sage.
@chadskeers after talking with @swalkinshaw and based on how much modification has to be done to get this to work we suggest that you convert your work to be a plugin
there's a bunch of existing codemirror plugins but they either don't work or don't work on the post/page editor, it'd definitely be nice to have one up on the wordpress plugin directory
from sage.
Yeah that makes good sense. Still on the move but when I get settled down
I'll take a look at making the conversion.
On Thu, Jun 23, 2011 at 12:37 AM, retlehs <
[email protected]>wrote:
@chadskeers after talking with @swalkinshaw and based on how much
modification has to be done to get this to work we suggest that you convert
your work to be a pluginthere's a bunch of existing codemirror plugins but they either don't work
or don't work on the post/page editor, it'd definitely be nice to have one
up on the wordpress plugin directoryReply to this email directly or view it on GitHub:
#2 (comment)
from sage.
Related Issues (20)
- Bug: Failed to compile CSS/SCSS When curly braces is present on css class as dynamic value for mixin HOT 1
- Bug: tailwind plugins import issue HOT 3
- Method ReflectionParameter::getClass() is deprecated Bug: HOT 1
- Bug: > cache/acorn/framework/cache directory must be present and writable HOT 1
- ❤️ Feature Request: static analysis of blade templates HOT 1
- Sage is incompatible with symbolic links : Unrecognized file extension HOT 1
- Replace single line PHP statements HOT 1
- Sage 9 + Wordpress 6.3 : Notice: Error when decoding a JSON file at path... HOT 3
- Can Sage 10 integrate React and use shadcn/ui? HOT 1
- Hot reload not working (Redirecting to base URL when front page is set) HOT 1
- @import tailwind syntax is not supported and can cause issues with bud cache
- Unable to use @import on css files HOT 1
- Use modern Yarn install
- [sage 9] page-template not working on wordpress 6.4 HOT 1
- Sage 10 tailwind css is not working without small addition to tailwind.config.js HOT 5
- Sage 9 + Wordpress 6.4 and 6.4.1 create broken Gutenberg layout HOT 3
- Admin bar breaking error pages HOT 1
- Seems eslint --fix doesn't apply prettier changes HOT 1
- do_action('get_header') should occur before wp_head() HOT 13
- "editor.css" not included when Gutenberg (block) editor is in the new iframe mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sage.