Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2013, 07:08 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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, 0 views)
Reply With Quote
  #2  
Old 07-30-2014, 09:52 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-31-2014, 07:14 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #4  
Old 07-31-2014, 07:55 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This actually looks pretty interesting. I know it was necro'd but, might as well.
Reply With Quote
  #5  
Old 07-31-2014, 08:59 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 07-31-2014, 10:06 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 07-31-2014, 10:49 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[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.
Reply With Quote
Благодарность от:
Scanu
  #8  
Old 08-01-2014, 06:14 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 08-04-2014, 02:05 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Благодарность от:
Scanu
  #10  
Old 08-04-2014, 11:22 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much for this, does your codemirror version recognize vbulletin template syntax?
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 12:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04892 seconds
  • Memory Usage 2,278KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete