Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
syntax highlighting
#31
It has its own button now. REmoved it from drop down BBCode Buttons
Quote:Have not time now shall look more into it later.
Me neither...At least its progress  :D
Recommended Tutorials:
Reply
#32
Quote:Very good what did you do
Oh i jsut saw this.

I replace PHP's nl2br function with a modified function to replace pre tags with the pytohn brush (since that is what we are using to insert codeboxes).

in class_parser.php ->
function my2_nl2br($string){
    $string = str_replace("\n", "<br />", $string);
    if(preg_match_all('/\<pre class="brush: python"\>(.*?)\<\/pre\>/', $string, $match)){
        foreach($match as $a){
            foreach($a as $b){
                $string = str_replace('<pre class="brush: python">'.$b.'</pre>','<pre class="brush:      python">'.str_replace("<br />", "\n", $b)."</pre>", $string);
                        }
                    }
                }

                return $string;

}
and used that in the post bit instead
Recommended Tutorials:
Reply
#33
Quote:I replace PHP's nl2br function with a modified function to replace pre tags with the pytohn brush (since that is what we are using to insert codeboxes).
Yeah nice i was messing around with class_parser.php,but could not figure it out.

Some more test,all using Python tag.
Now it's theme midnight,which i think look good.
Different theme is on Page-2,
i am gone change theme to see how it look in forum.
Theme on page-2 did i run in Flask.
Looking for a nice 16x16 icon we can use for button SyntaxHighlighter v4.

Python:
import re

class Hardware(object):
    def __init__(self, name, hardware_id):
        self.name = name
        self.hardware_id = hardware_id

    @property
    def show_info(self):
        '''Show hardwareinfo'''
        print 'Name: {} | hardware_id: {}'.format(self.name, self.hardware_id)

class Cpu(Hardware):
    max_temp = 72
    def __init__(self, name, hardware_id, socket, speed):
        Hardware.__init__(self, name, hardware_id)
        self.socket = socket
        self.speed = speed

    @classmethod
    def heat_advice(cls, current_temp):
        '''Give heat advice to user'''
        if current_temp < cls.max_temp:
            return 'Current temp: {} is ok,under Intel recommended  max temp of: {}'\
        .format(current_temp, cls.max_temp)
        return 'Current temp : {} is over Intel recommended max temp of: {}'\
       .format(current_temp, cls.max_temp)
Html:
<html>
<body>
  <div id='images'>
    <a href='image1.html'>My image 1 <br /><img src='image1_thumb.jpg' /></a>
  </div>
  <div>
    <p class="car">
      <a class="bmw" href="Link to bmw"></a>
      <a class="opel" href="Link to opel"></a>
    </p>
    <p class="end">
      all cars are great
    </p>
  </div>
</body>
</html>
Css:
.all {
    width: 100px;
    height: 100px;
    position: absolute;
    top:0px;
    bottom: 200px;
    left: 0px;
    right: 300px;
    margin: auto;
}

body {
  background: linear-gradient(to left, #616161, #9bc5c3);
}

.parent {
  width: 450px;
  height: 150px;
  text-align: center;
  padding: 20px 17px;
}
Js:
$("#delay input").click(function(e) {
  e.preventDefault();
  setTimeout(function() {
    $("#delay").submit();
  }, 2000);
});
Reply
#34
Quote:Now it's theme midnight,which i think look good.
I actually like the default theme better. The whole layout of the forum is light, and that codebox seems more for a dark theme. The one thing dislike though is there is no perimeter box on it though.
Recommended Tutorials:
Reply
#35
I think we should remove the php code button as it makes it more confusing.
Recommended Tutorials:
Reply
#36
(Oct-04-2016, 01:14 PM)metulburr Wrote:
Quote:Now it's theme midnight,which i think look good.
I actually like the default theme better. The whole layout of the forum is light, and that codebox seems more for a dark theme. The one thing dislike though is there is no perimeter box on it though.
Yes i can agree with this,have change to default theme now.
Look ok?
Reply
#37
Its still showing up as midnight to me. 

def func:
    pass
Recommended Tutorials:
Reply
#38
So just to get this straight...when we had the plugin, there was an option in aCP to switch between themes for the codebox. Now using V4, wiht no plugin, how are you switching between them?

and yes i see it now  :D
Recommended Tutorials:
Reply
#39
(Oct-04-2016, 01:27 PM)metulburr Wrote: I think we should remove the php code button as it makes it more confusing.
Yes agree,should be the main button for code tag.
Maybe we could remove both,seem work fine for all cases.
¨¨ `.,/*-+ just some sign test "#@£ 12999 <hello> """fine""" or '----'
Just some text 1234
print('hello world')
Quote:Now using V4, wiht no plugin, how are you switching between them?
I have build all Theme local,so now it's direct change to CSS file on server.
Reply
#40
Quote:Maybe we could remove both,seem work fine for all cases.
we could try it. Disabled both original codebox and php scheditor buttons.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Undo (Ctrl+z) doesn't work on highlighting CynthiaMoore 8 8,354 Apr-25-2020, 05:00 AM
Last Post: buran
  feature request: highlighting Skaperen 9 6,492 Jan-26-2017, 04:13 PM
Last Post: Kebap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020