Recent

Author Topic: About forum suggestions  (Read 46144 times)

Bostjan

  • New Member
  • *
  • Posts: 14
Re: About forum suggestions
« Reply #15 on: October 01, 2015, 09:20:29 pm »
My vote goes for default to new sytle when pasting code.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9793
  • Debugger - SynEdit - and more
    • wiki
Re: About forum suggestions
« Reply #16 on: October 01, 2015, 11:53:08 pm »
This are the options for the module: http://codebirth.com/index.php?PHPSESSID=e33729de78468d927b799203eec8c155&topic=81.msg120#msg120

I see no setting to make it default.

Basically it does not seem to interact with the old button. It requires the use of the dropdown (which will always insert what you select and go back to "Code").

Maybe the old code button can be removed, I dont know (dont have the time to search for it)

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: About forum suggestions
« Reply #17 on: October 02, 2015, 02:35:23 am »
hello,
to have the tag code=pascal with the default old button #  patch the line  1659 of the  file smf\Sources\Subs-Editor.php (the line with 'before' =>)  :

Code: PHP  [Select][+][-]
  1.                                 'image' => 'code',
  2.                                 'code' => 'code',
  3.                                 'before' => '[code=pascal]',
  4.  

to remove the old button #  comment the lines :

Code: PHP  [Select][+][-]
  1. /*                      array(
  2.                                 'image' => 'code',
  3.                                 'code' => 'code',
  4.                                 'before' => '[code=pascal]',
  5.                                 'after' => '/code',
  6.                                 'description' => $txt'bbc_code'
  7.                         ), */


 8-)
« Last Edit: October 02, 2015, 03:18:40 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Basile B.

  • Guest
Re: About forum suggestions
« Reply #18 on: October 02, 2015, 02:49:54 am »
Double thumb up for this feature. :D

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: About forum suggestions
« Reply #19 on: October 03, 2015, 06:42:47 am »
it doesn't work unless you specify 'pascal' in code combo-box;

Does it respect and adapt to {$mode }  ?   O:-)
I don't think so but it should have a delphi highlighter too.
Code: Delphi  [Select][+][-]
  1. function CompareInt(const d1,d2): string;
  2. var
  3.    i1 : integer absolute d1;
  4.    i2 : integer absolute d2;
  5. begin
  6.    if i1=i2 then Result:=0
  7.    else if i1<i2 then Result:='-1'
  8.    else Result:='1';
  9. end;
  10.  
  11. procedure SortArrayInteger(var arr: array of Integer; count: Integer);
  12. begin
  13.     AnySort(arr, Count, sizeof(Integer), @CompareInt);
  14. end;
« Last Edit: October 03, 2015, 06:46:20 am by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: About forum suggestions
« Reply #20 on: October 04, 2015, 04:19:54 pm »

it doesn't work unless you specify 'pascal' in code combo-box; so old posts in forum wont be highlighted; also new posts when user don't specify code dialect (mostly will be posts from newbie and quick posts).

suggestion: admin, make it default to pascal even when code dialect is not selected.

Ah.... I never use the buttons for highlighting, and from other/previous forums I'm used to write [ code=pascal]

I''l change the default to pascal
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

shobits1

  • Sr. Member
  • ****
  • Posts: 271
  • .
Re: About forum suggestions
« Reply #21 on: October 04, 2015, 09:50:40 pm »
Ah.... I never use the buttons for highlighting, and from other/previous forums I'm used to write [ code=pascal]

I''l change the default to pascal
what I meant to say is since this forum uses pascal as the main language the highlighter should assume a pascal code for all code tags unless specified, which means whenever he finds {code}{/code} he should handle it as {code=pascal}{/code}. this will make older posts highlighted and remove any inconsistent between old and new posts in the same thread like this one
http://forum.lazarus.freepascal.org/index.php/topic,29822.msg189012.html#msg189012 (image attached)


on an other note, an option to choose the highlighter theme would be appreciated.


BeniBela

  • Hero Member
  • *****
  • Posts: 905
    • homepage
Re: About forum suggestions
« Reply #22 on: October 04, 2015, 10:16:54 pm »
The new code style does not have a select button

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9793
  • Debugger - SynEdit - and more
    • wiki
Re: About forum suggestions
« Reply #23 on: October 04, 2015, 10:49:52 pm »
It has one now.

But it still has an issue in Internet explorer. IE does copy the entire code without any linebreaks. And it includes the line numbers.
Chrome and Firefox do behave better. (Firefox adds empty lines)

I did not find any setting to fix this (and I have no access to patch/modify the modules code).

Removing the line numbers IE would still copy all in one line.
But then all browsers will start wrapping long code lines, and that is making the code less readable.
(Actually Firefox is the only one that does not wrap)

Also the line numbers might have been useful as reference.

And it is possible to do [ code=pascal,5 ] to highlight a line (or pascal,5,8)
Code: Pascal  [Select][+][-]
  1. program
  2. var hello: string;
  3. begin
  4.   writeln('world');
  5.   // line 5
  6.   read(hello);
  7.   // line 7
  8. end; // 8
  9.  
« Last Edit: October 04, 2015, 11:06:12 pm by Martin_fr »

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: About forum suggestions
« Reply #24 on: October 19, 2015, 12:14:42 pm »
I tried to default to pascal when no specific code is specified, but no success
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

BeniBela

  • Hero Member
  • *****
  • Posts: 905
    • homepage
Re: About forum suggestions
« Reply #25 on: October 27, 2015, 01:35:44 pm »
And the line number column is too small, it shows only the last digit (linux, 300% font size)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9793
  • Debugger - SynEdit - and more
    • wiki
Re: About forum suggestions
« Reply #26 on: October 27, 2015, 01:43:00 pm »
The column width is determined by the browser.  It is a simple <ol> tag, no width specified.

BeniBela

  • Hero Member
  • *****
  • Posts: 905
    • homepage
Re: About forum suggestions
« Reply #27 on: October 27, 2015, 08:00:34 pm »
Then it is a stupid browser

You should set padding-left: 3em on the ol, or so. At least for Firefox

edit: or use a table instead li. Then there probably won't be empty lines on copying
« Last Edit: October 27, 2015, 08:13:02 pm by BeniBela »

shobits1

  • Sr. Member
  • ****
  • Posts: 271
  • .
Re: About forum suggestions
« Reply #28 on: October 27, 2015, 09:38:34 pm »
And the line number column is too small, it shows only the last digit (linux, 300% font size)

it shows ok on windows7 and firefox 41.0.2

BeniBela

  • Hero Member
  • *****
  • Posts: 905
    • homepage
Re: About forum suggestions
« Reply #29 on: October 27, 2015, 09:39:42 pm »
And the line number column is too small, it shows only the last digit (linux, 300% font size)

it shows ok on windows7 and firefox 41.0.2

Did you test it with the "zoom text only" option enabled?

 

TinyPortal © 2005-2018