Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Jul 2013, 09:08
tbworld tbworld is offline
 
Join Date: Oct 2008
vBulletin4 - Admincp Editor Replacement - CodeMirror, Any Interest?

I had a special project at work that needed code mirror so I took a look at vb4 and decided for the fun of it, if I could replace the template editor and the plugin editor. I haven't finished the plugin editor (still some more JavaScript to do), but the template editor is working nicely.

I am not sure what to do with this because it is unlikely that I can turn it into any sort of instructions for someone else to install -- since there are basically no hooks in the admincp and too many critical edits. Maybe I can auto-parse files, but that would only work for a single version most likely.

If anyone has a better suggestion please let me know and maybe I can share the work ...

I would also like to know if anyone is interested in this so I do not waste my time.
Attached Images
File Type: jpg admincp_vb4_codemirror.jpg (87.4 KB, 49 views)

Last edited by tbworld; 13 Jul 2013 at 10:16.
Reply With Quote
  #2  
Old 30 Jul 2014, 11:52
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Are you using the vbulletin mode? I grabbed it from vBulletin 5 but it's really ugly and it looks different on vB4. The css is the same but html codes are different, for example on vbulletin 5 one class is "lineNumbers" and on vB4 it is "lineNumber". That's why it's so different. Did you get it working completely?
Reply With Quote
  #3  
Old 31 Jul 2014, 21:14
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
bump
Reply With Quote
  #4  
Old 31 Jul 2014, 21:55
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Real name: James
This actually looks pretty interesting. I know it was necro'd but, might as well.
Reply With Quote
  #5  
Old 31 Jul 2014, 22:59
tbworld tbworld is offline
 
Join Date: Oct 2008
I think I finished this a year ago and no one commented. Since then a buddy of mine @Nerbert put out a modification, so I never bothered with turning mine into a modification. I have radically changed it since then, just kind of modding as I need features. I started the code before vBulletin included theirs, in fact I have never looked at their implementation -- I probably should, maybe I will learn something.

@nerbert's modification is very good as a base and it will quickly get you going. I recommend it! If you have any issues with @Nerbert's modification, I am always around and I will always talk code. Make sure you thank him.

I think the only thing that @nerbert's modification is really missing is enlarging. If I remember.

P.S. - It is a real time saver if you are constantly trying things out and making small changes.

--------------- Added 31 Jul 2014 at 15:46 ---------------

I am currently -- very slowly as I have time -- implementing CKeditor4 for vbulletin4, just for the kicks of it. It will never be released here, but I am happy to share the concepts and code fragments with others that might want to attempt it. vBulletin extensively tests their code, I do not have that luxury and editors are a sensitive area, so releasing or displaying the code on vBulletin could lead to an exploit on someones site.

I use to use photopost for a gallery on my daughter's board before my own programming out paced theirs. It lacked a real editor at the time -- I think they just recently (last six months) added MCE --, and so I implemented CKeditor4 and styled it more like CKeditor3 so as to not upset the users. I have also implemented CKeditor4 for her mobile platform. After working out most of the bugs on the current platforms, I have decided to implement a rendition for the main board. Currently, I have been trying to figure out away to make it switchable via the user so that I have a larger testing base with the new editor, yet give them the comfort of the old editor for everyday use.

Last edited by tbworld; 31 Jul 2014 at 23:56.
Reply With Quote
  #6  
Old 01 Aug 2014, 00:06
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
I've seen nerbert's solution but i don't really like EditArea
I'd love to use codemirror with vbulletin as mode, i get codemirror working but the html mixed mode don't fit well with vbulletin template syntax.
I ended up grabbing vbulletin mode from vb5 but it doesn't work very well, for example as i said the style is for some html reasons different and also I can't use anymore codemirror's addons, such as code folding and autoclose tag.. So i'd love to see how you implemented it if possible, i'm not asking to realease a modification of corse

Last edited by Scanu; 01 Aug 2014 at 00:17.
Reply With Quote
  #7  
Old 01 Aug 2014, 00:49
tbworld tbworld is offline
 
Join Date: Oct 2008
[quote=Scanu;2509223]I've seen nerbert's solution but i don't really like EditArea
I'd love to use codemirror with vbulletin as mode, i get codemirror working but the html mixed mode don't fit well with vbulletin template syntax.
I ended up grabbing vbulletin mode from vb5 but it doesn't work very well, for example as i said the style is for some html reasons different and also I can't use anymore codemirror's addons, such as code folding and autoclose tag.. So i'd love to see how you implemented it if possible, i'm not asking to realease a modification of corse

When I have time, I will take a look at what I did. Mine is really a kludge, meaning that I do not use the plugin system -- so I have to kind of hunt things down. I do remember writing/adding some helper JavaScript to get things working the way I wanted. It needed a little help in exception wording for vbulletin curly braces, <vb-if> tags and highlighting. Not sure if I ever added code folding and I am sure I stripped out the code dragging function. @Nerbert's code never did any of it and it worked perfectly fine. I remember helping a friend use codemirror on a vbulletin project and we pretty much used the standard distribution.

Unfortunately, I cannot find @Nerbert's code listed on the board; not sure what happened there, maybe I imagined he released it.

I am not hung-up on sharing or showing code, if it is legal to share. The company I work for, owns me so I have a few restrictions there, other than that I am happy to assist.

Last edited by tbworld; 04 Aug 2014 at 20:02.
Reply With Quote
  #8  
Old 01 Aug 2014, 20:14
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Ok then don't worry about that, seems like I better stay with the vbulletin 5 mode without addons (I've fixed css) or stay with the html mixed mode without vbulletin template syntax highlighting because I'm not skilled enough in javascript coding to fix one of these 2 problems.
I think you didn't imagine that. He said that he would have released a codemirror version but I think he never did. Nevermind thank you for your help

And for the plugins part, I guess it's impossible since there aren't many hooks there my solution is different from the nerbert's one and it's editing template.php file adding js resources at the start and adding Codemirror setup after the textarea is printed, and i Used the javascript variable textarea_id.

Last edited by Scanu; 01 Aug 2014 at 20:27.
Reply With Quote
  #9  
Old 04 Aug 2014, 04:05
nerbert nerbert is offline
 
Join Date: May 2008
It's pure chance I happened to log in here and stumble on this thread. Haven't been coding for months.

I do have a Code-Mirror editor for templates and plugins (and other admin textareas) for vB4 but it's part of a file manager project I've been working on. I could copy out the required parts I guess and make a product out of it. It will involve a direct file edit in includes/adminfunctions.php.

I don't know anything about vB5 so you're on your own there.

This could take a day or so. I have two different versions and I have to check out which is best. And i'm veeeeeeeeeeeeeery rusty at coding.
Reply With Quote
  #10  
Old 04 Aug 2014, 13:22
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Thank you very much for this, does your codemirror version recognize vbulletin template syntax?
Reply With Quote
  #11  
Old 04 Aug 2014, 15:00
nerbert nerbert is offline
 
Join Date: May 2008
Originally Posted by Scanu View Post
Thank you very much for this, does your codemirror version recognize vbulletin template syntax?
Here we go http://www.vbulletin.org/forum/showthread.php?t=313445

I have not worked on syntax highlighting for vBulletin template syntax
Reply With Quote
  #12  
Old 04 Aug 2014, 20:18
tbworld tbworld is offline
 
Join Date: Oct 2008
In reality syntax highlighting beyond codemirror basics is barely needed (just a nicety), but was not very hard to add -- since there are so little keywords for vbulletin. If you are creating a large template you are still better off using a local editor, but when you need to maintain or do a quick edit, then codemirror really shines.

If I remember correctly @Nerbert's code creatively added codemirror for plugins. That should be a pretty nice asset for most users.

When I find some time, I will post some code for highlighting. If I remember correctly I just had to expand on one of the plugins for codemirror, but it has been some time since I looked over that code.

-----------------------------------------
Shout-out: Greetz to @Nerbert!
-----------------------------------------
Reply With Quote
  #13  
Old 04 Aug 2014, 20:55
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Yes you're right, infact the vbulletin mode js file isn't that hard, is just some lines of code. I just don't get why i can't use anymore addons when using it, i'll have to look on how modes are made, and do more tests to understand this problem

Last edited by Scanu; 05 Aug 2014 at 02:11.
Reply With Quote
  #14  
Old 04 Aug 2014, 22:07
tbworld tbworld is offline
 
Join Date: Oct 2008
When I get a chance I will create a hightlighting plugin for @Nerbert's mod and he can add it to his modification.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show Thread Enhancements solved ranks in vbulletin4 yaghoub Modification Graveyard 23 15 Dec 2009 03:30



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:13.

Layout Options | Width: Wide Color: