1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't Fix Redactor is no longer maintaining tabs

Discussion in 'Resolved Bug Reports' started by Chris D, Jul 11, 2013.

  1. Chris D

    Chris D XenForo Developer Staff Member

    Noticed it yesterday too but again, today. I am trying to paste this bit of code:

    upload_2013-7-11_19-5-45.png

    But it produces this instead:

    PHP:
    <?php



    class YourAddOn_Listener

    {

    public static function 
    extendThreadController($class, array &$extend)

    {

    $extend[] = 'YourAddOn_ControllerPublic_Thread';

    }

    }
    I suspect some sort of bug fix has broken this as this is now back to TinyMCE behaviour, unfortunately. When Redactor first launched here, it kept indentations via tabs etc. by converting the tabs to 4-5 spaces. Worked great.

    I'm using Chrome 28 on Mac OS X Mountain Lion. Haven't tested it on Windows yet.
     
    TheComputerGuy likes this.
  2. MattW

    MattW Well-Known Member

    Code:
    {
            if ($line =~ /(?:\d)\s(?:\d)\s(\d{4}\-\d{2}\-\d{2})\s(\d{2}\:\d{2}\:\d{2})\s(\d+\.\d)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\d+)\s(\w+|\*)\s([A-Z,0-9]\w+|\*)\s(\d+)\s(\d+)\s(\w+)\s(\d{1,2})\s\d+/)
            {
                    my ($date,$time,$dur,$nac,$mod,$et,$chan,$baud,$calling,$called,$btx,$brx,$flag)=($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13);
                    my $dtime = $date . " " . $time;
                    if ($called =~ /^([1-3])\d+/)            #strip off DI
                    {
                    $called =~ s/^([1-3])(\d+)/$2/;
                    $dial=$1;                              #put DI in its own column
                    }
                    else
                    {
                    $dial="undef";
                    }
                    $sthins2->execute(undef,$dtime,$dur,$nac,$et,$chan,$mod,$baud,$calling,$called,$dial,$btx,$brx,$flag);
            }
            else
            {
                    #print LOGERROR "$line ";
            }
    }
    Windows 7 Chrome
     
  3. MattW

    MattW Well-Known Member

    PHP:
    // Pull the data for the dial attempts and the totals
    while ($row mysqli_fetch_assoc($result)) {
            
    extract($row);
            
    $percent number_format($totals $payp_total_calls 1002);
            if ( 
    $dial == "1" && $percent "94" )
            {
            echo 
    '<tr><td class="error">'$dial '</td>
            <td class="error">' 
    number_format($totals) . '</td>
            <td class="error">' 
    $percent.'%</td></tr>';
            } else {
            echo 
    '<tr><td>'$dial '</td>
            <td>' 
    number_format($totals) . '</td>
            <td>' 
    $percent.'%</td></tr>';
            }
    }
    mysqli_free_result($result);
     
  4. AlexT

    AlexT Well-Known Member

    Tabs working here when I wrap the text in [ PHP ] tags.
     
  5. Bob

    Bob Well-Known Member

    Win 8/Chrome 28

    PHP:
        public static function extendDataWriter($class, array &$extend)
        {
            if (!
    self::$_addedUsernameChange && $class == 'XenForo_DataWriter_User')
            {
                
    self::$_addedUsernameChange true;
                
    XenForo_DataWriter_User::$usernameChangeUpdates['permanent']['showcase_username'] =
                    array(
    'xf_nflj_showcase_item''username''user_id');
            }
                   
            switch (
    $class)
            {
                case 
    'XenForo_DataWriter_AttachmentData':
       
                    
    $extend[] = 'NFLJ_Showcase_DataWriter_AttachmentData';
                    break;
            }
        }
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Damn. Are you using Mac OS X?

    EDIT: Seems to be exclusive to my IDE. Copy pasting from there messes something up.

    EDIT 2: It seems to be getting confused because if I post as plain text is fine. So that would suggest it's trying to copy formatting over from the IDE or something. Which is odd. And never happened before.

    Thanks for confirming guys.
     
  7. EQnoble

    EQnoble Well-Known Member

    Win 7, ff21, pasted from notepad++

    Code:
    <?php
    class MediaSites_Soundcloud
    {
        public static function buildEmbed($mediaKey, array $site)
        {
            $urlKey = urlencode($mediaKey);
            $scUrl = 'http://soundcloud.com/oembed?iframe=true&url=http%3A%2F%2F' . $urlKey;
           
           
            $ci = curl_init();
            curl_setopt($ci, CURLOPT_URL, $scUrl); 
            curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
            $datas = curl_exec($ci);
            curl_close($ci);   
            if (!isset($datas)) {
                $datas = @file_get_contents($scUrl);
            }
            $xObj = simplexml_load_string($datas);
            $embedHtml5 = $xObj->html;
            if (isset($embedHtml5)) {
                    return $embedHtml5;   
            }   
            else return '<a href="http://' . $mediaKey . '">http://' . $mediaKey . '</a>';
        }
    }
    
    PHP:
    <?php
    class MediaSites_Soundcloud
    {
        public static function 
    buildEmbed($mediaKey, array $site)
        {
            
    $urlKey urlencode($mediaKey);
            
    $scUrl 'http://soundcloud.com/oembed?iframe=true&url=http%3A%2F%2F' $urlKey;
           
           
            
    $ci curl_init();
            
    curl_setopt($ciCURLOPT_URL$scUrl); 
            
    curl_setopt($ciCURLOPT_RETURNTRANSFERTRUE);
            
    $datas curl_exec($ci);
            
    curl_close($ci);   
            if (!isset(
    $datas)) {
                
    $datas = @file_get_contents($scUrl);
            }
            
    $xObj simplexml_load_string($datas);
            
    $embedHtml5 $xObj->html;
            if (isset(
    $embedHtml5)) {
                    return 
    $embedHtml5;   
            }   
            else return 
    '<a href="http://' $mediaKey '">http://' $mediaKey '</a>';
        }
    }
    Have you tried copying from your ide and pasting it to an editor, then copy something else to clear ide text from your clipboard, then copy that same text in your ide from the text editor in which you pasted it in?

    Just curious what happens there.
     
  8. SneakyDave

    SneakyDave Well-Known Member

    I've had to do that in the past. Copy from Zend Studio to UltraEdit/Notepad, and then past here, I assumed it was an editor issue on xF copying the formatting incorrectly.

    Haven't had that problem in a long while though (Windows)
     
  9. Mike

    Mike XenForo Developer Staff Member

    What IDE are we talking about? It might be how it's copying (and then being converted to HTML). It may not be detectable though.
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Eclipse PDT
     
  11. SneakyDave

    SneakyDave Well-Known Member

    I've had this same problem with Eclipse PDT itself, in the past on my windows machine, copying and pasting code with tabs. A PDT update fixed it I think, (only PHP files were affected), or maybe that's when I moved to Zend Studio, which doesn't have the problem. Do you use Indigo, Juno, Helios(?)?

    I originally thought that the problem was that PDT didn't recognize the END-IF structure that PHP supports, but it wasn't that.
     
    Last edited: Jul 13, 2013
  12. Chris D

    Chris D XenForo Developer Staff Member

    It's the same with the most recent version of Aptana (on Mac).

    I'm still to test it on Windows.

    As for Eclipse I have tried it in Juno with PDT and the latest version 4.3... Kepler without PDT installed... so it basically seems to be Eclipse exclusive. If someone can confirm if it's the same on Windows too that would be useful.

    This should mean it affects Zend Studio as well, in theory.
     
  13. Bob

    Bob Well-Known Member

    I cut/pasted the above straight from Zend Studio 10.1 Build ID: 10.1.0.201306250232

    I used to have the same issues as you are having when I used Eclipse PDT tho.
     
    SneakyDave likes this.
  14. Chris D

    Chris D XenForo Developer Staff Member

    I will give it a go on Zend Studio trial on Mac as thinking of buying it anyway. And will report back.
     
    Bob likes this.
  15. Chris D

    Chris D XenForo Developer Staff Member

    I get the same issue with Zend Studio 10.1 on Mac OS X Mountain Lion.
     
  16. Mike

    Mike XenForo Developer Staff Member

    Doesn't seem to happen in Windows PDT (though admittedly, my PDT isn't totally updated as I stopped using it a while a go).
     
  17. Chris D

    Chris D XenForo Developer Staff Member

    I am on Windows today.

    It works fine in Windows PDT.

    So it's just Mac + any Eclipse based IDE
     
  18. karll

    karll Well-Known Member

    Seems to work for me with Eclipse 4.3 + PDT on (Ubuntu) Linux.
     
  19. Chris D

    Chris D XenForo Developer Staff Member

    Bloody Macs.
     
    Autonamus, fattony69 and Paul like this.
  20. Mike

    Mike XenForo Developer Staff Member

    So finally got a chance to dig into this and it's not something we can fix without compromising other things.

    Eclipse (in Mac) actually pastes <p> tags which mean something different. In Windows, it seems to only copy the plain text version (which then gets formatted by the browser on paste).

    Nothing that we can really do unfortunately.
     
    Chris D likes this.

Share This Page