• We've added extra Spam Protection. if you get problem with account registration / registration rejected. please contact us
  • You need minimum 5 good posts for download files. Don´t push posting-counter with posts copy paste, thx, good, smileys..... Read This.
  • Note: don´t push posting-counter with messages like thx, good, haha, only use reactions! threads will be deleted without any comment or notification. Read Rules.
Voltear

Code 2.1.2

No permission to download
proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Fcodelogotype-png.182661%2F&hash=50a284d226003bacf5e5a784180da01c


Description

This addon makes code bbcode and code editor way more functional by adding copy, expand, collapse buttons, resizer bar and automatically adjusting the colors to fit chosen forum style.

If you appreciate my work, please consider leaving a like, review and a contribution via PayPal (PM me for details)

This is an open source addon. Visit GitHub repository for source code.
___________________________________________________________

Features

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Ffunc_features-png.182662%2F&hash=bd9eaabeaf237653a9f108b0357a5284


Custom title

You can now specify a custom code block header title. For example, users can provide a filename for code blocks instead of writing it in the text or putting the whole code block inside a spoiler with filename title.

Custom title can be set via "Insert code" dialog:


proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Fcode_block_title-png.182664%2F&hash=560e0cbb330ef89cb1a48c87a70cd795


You can also set the title directly in text editor by putting | charater and title text after language name in code bbcode.

Example:
Code:
<? .... ?>
will produce this codeblock:


proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535718915924-png.182669%2F&hash=c4c87fd631c36c5a9c9635cd9e799d4b


Hovering custom title will show the code language:

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535719001075-png.182670%2F&hash=698bbadb68b7e60397d58c94d6835299


Expand/Collapse buttons

Expand button smoothly increasing the height of code block until all the code is showing. It is visible only when code block height is LESS than the actual code size.

Collapse button smoothly decreasing the height of code block to it's default height which you can set in style properties. It is visible only when code block height is LARGER than default code block height.

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Fexpand-collapse-gif.182671%2F&hash=fd8a00d17a55cfd5f761ecc72a16e9e0


Both expand and collapse buttons are visible when code block height is within min and max limits and invisible on code blocks that are smaller than default code block height.

The default height of code block can be set in style properties ("Code" section below "Messages"):


proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535723219891-png.182677%2F&hash=3b8baa3e423d7eafb1026298eb8d2d6d

Copy button

Copy button simply copy the code right into your clipboard:


proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Fcopy-gif.182673%2F&hash=50b1f1c743a0b086f12046a222ba05cb


Line numbers

All code blocks have line numbers (up to 1000 lines). Line numbers can be turned off via style properties:


proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535721681160-png.182674%2F&hash=19a611a2ffdf5dfd7fc0088e1931a7f9


Resizer

Every code block which code height is larger than the default height has a resizer bar. It allows users to vertically resize code block:
proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2Fresizer-gif.182675%2F&hash=1d4a6bc7ac5a009fee8c6d0fd9e87fd6


Common languages

I always thought there is something wrong about "Common languages". Why can't we set which languages are "common" to our specific forum? Weird...

With Code addon you can now set common languages right after "Allowed code languages" option in "Messages" option-group:

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535723658651-png.182678%2F&hash=4b6855aa83f5aaf12fb3e25acaabf1a8

Hurray!

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535723826755-png.182681%2F&hash=99edf140b1a1db4e1283e3fcbd7fd23a



Default language

You can also set a default language code for "Insert code" dialog via "Default code language" option after common languages in "Messages" option-group:

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535743202787-png.182689%2F&hash=0479af8672c3996a2c90bc9a05cc17f3



Adaptive style

Code block colors and properties are not defined directly (hardcoded) — they inherit from forum style variables.

What does this mean?

It means that code blocks and all its parts (including scrollbars!) will be looking great automatically no matter what style/color palette forum is using.

However, you have to manually set code style type: light (by default) or dark depending on general style type of your forum:

proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535744407707-png.182694%2F&hash=4a393423b936eff567e2345039d7194d


This is how a code block will look like on the forum with dark theme:
proxy.php?image=https%3A%2F%2Fxenforo.com%2Fcommunity%2Fattachments%2F1535744921126-png.182696%2F&hash=37632786be213cbaee8f60ae88eb513a

___________________________________________________________

Installation
  1. Download the addon
  2. Upload contents of upload folder to your forum root
  3. In admin control panel go to "Addons" section and install Code
Unistallation

WARNING: after unistalling all code blocks with custom titles will have an incorrect highlighting or will not be highlighted at all!
  1. Uninstall the addon from ACP
  2. Go to forum root folder and remove js/Code folder.

That's it!
Author
Voltear
Downloads
11
Views
133
First release
Last update
Rating
4.00 star(s) 1 ratings

More resources from Voltear

Latest updates

  1. Hotfix 2.1.2

    Fixes a problem with upgrading. If any other errors happen, try to fully remove the addon. Than...
  2. Bug fixes 2.1.1

    Fixed bugs Fixed an ACP error when XF sends an email notification about new post in the thread...
  3. Update 2.1.0 – XenForo 2.1 support & New features

    Code 2.1.0 was rewritten from scratch. It is not compatible with previous addon version and XF...
Top

AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock