trijin.ru форум

Проэкты сайты, и прочее - прочее.

  • Вы не зашли.

#1 2006-06-20 02:09:51

trijin
aka triny
Зарегистрирован: 2006-06-18
Сообщений: 176
Профиль

Modern_BB_Code_v1.0.0.trijin.RePack.zip

Пересобранный пакет от neutral (Огромное уважение за проделанный !полезный многим! труд)
со всеми изменениями темы http://punbb.ru/viewtopic.php?id=203&p=1
Сам файл:
http://trijin.ru/forum/upload/Modern_BB … RePack.zip

Неактивен

 

#2 2007-04-18 19:57:58

lans
New member
Откуда: Маркс
Зарегистрирован: 2007-04-18
Сообщений: 6
Профиль  Вебсайт

Re: Modern_BB_Code_v1.0.0.trijin.RePack.zip

Modern_BB_Code прекрасно работает, но... ошибочку в IE выдает: ....ошибка: "id" есть null...  и т.п. Хоть она и не мешает функционированию, но... как то раздражает.
Сам стараюсь быстренько с таких сайтов уходить, обычно че нить там не в полную меру отрабатывает.
Не хотелось бы, что бы и с моего форума кто нибудь так же линял (да еще советчики всякие: "исправляй ошибки, а затем привлекай на форум посетителей...".
У Вас, уважаемый trijin, тоже такая ошибка. Как исправить? Если бы я разбирался в этом... Может кто подскажет, а?

Нашел ошибку: исправляем код modern_bbcode.js и в IE нет ошибок (исправьте пожалуйста в своем архиве)

Код:

/* =================================================================== */
/*         MOD "MODERN BBCODE" JAVASCRIPT FUNCTIONS            */
/*                 Author: neutral                           */
/* =================================================================== */

/* ======================= */
/* Common script variables */
/* ======================= */

var uagent    = navigator.userAgent.toLowerCase();
var is_safari = ((uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc."));
var is_opera  = (uagent.indexOf('opera') != -1);
var is_webtv  = (uagent.indexOf('webtv') != -1);
var is_ie     = ((uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) && (!is_webtv));

var menu_ids = new Array(0, 1, 2, 3, 4);

var dropdown_buttons = new Array(
    "color", "smiley", "size", "img", "list"
);

var popup_panels = new Array(
    "colorpalette",    "smilespanel", "sizepanel", "imgpanel",    "listpanel"
);

var opened_popup = -1;

// only for ie fix
var none_ie = new Array(
    "colorbtn", "smilesbtn", "sizebtn", "imgbtn", "listbtn"
);

var none_ie_2 = new Array(
    "colorcontent", "smilescontent", "sizecontent", "imgcontent", "listcontent"
);

/* =========================================== */
/* This function fixes toolbar width for Opera */
/* =========================================== */

function fixOperaWidth()
{
    if (is_opera) 
    {
        document.getElementById('bbcode').style.width = "99%";
        document.getElementById('bbcode_adv').style.width = "99%";
    }
}

/* ================================ */
/* Returns left posititon of object */
/* ================================ */

function getObjectLeftpos (obj)
{
    var left = obj.offsetLeft;
    
    while ((obj = obj.offsetParent) != null)
    {
        left += obj.offsetLeft;
    }
    
    return left;
}

/* ================================ */
/* Returns top posititon of object  */
/* ================================ */

function getObjectToppos(obj)
{
    var top = obj.offsetTop;
    
    while ((obj = obj.offsetParent) != null)
    {
        top += obj.offsetTop;
    }
    
    return top;
}


/* ============================ */
/* Generates list tag structure */
/* ============================ */

function tag_list( type )
{
    var listitem = "init";
    var thelist   = "";
    
    opentag = ( type == 'ordered' ) ? '[listo]' : '[list]';
    closetag = ( type == 'ordered' ) ? '[/listo]' : '[/list]';
    
    while ((listitem != "") && (listitem != null))
    {
        listitem = prompt(list_prompt, "");
        
        if ((listitem != "") && (listitem != null))
        {
            thelist = thelist + "[li]" + listitem + "[/li]";
        }
    }
    
    if ( thelist != "" )
    {
        thelist = opentag + thelist + closetag;
        insert_text(thelist, "");
    }
}

/* =================== */
/* Hides poped up menu */
/* =================== */

function hide_poped_menu()
{
    if (opened_popup >= 0)
    {
        var btn_id = dropdown_buttons[opened_popup];
        var popup_id = popup_panels[opened_popup];

        document.getElementById(popup_id).style.visibility = "hidden";
        document.getElementById(popup_id).style.display    = "none";

        opened_popup = -1;
        document.getElementById(btn_id).className = 'dropdown';
    }
}

function documentClickHandler(target)
{
    if (!is_ie)
    {
        for (var i = 0; i < menu_ids.length; i++)
        {
            if (target.id == dropdown_buttons[i])
            return true;
        }

        if (target.className == "abtn")
        return true;

        hide_poped_menu();
        return true;
    }
}

/* ===================================== */
/* Shows popup menu specified by menu_id */
/* ===================================== */

function popup_menu(menu_id)
{
    var btn_id = dropdown_buttons[menu_id];

    btnElement = document.getElementById(btn_id);

    var iLeftPos  = getObjectLeftpos(btnElement);
    var iTopPos   = getObjectToppos(btnElement) + (btnElement.offsetHeight - 1);

    if (is_ie) 
    {
        iLeftPos += 3;
        iTopPos += -9;
    }

    var popup_id = popup_panels[menu_id];

    document.getElementById(popup_id).style.left = (iLeftPos) + "px";
    document.getElementById(popup_id).style.top  = (iTopPos)  + "px";

    if (opened_popup == menu_id)
    {
        hide_poped_menu();
        return;
    }

    hide_poped_menu();

    document.getElementById(popup_id).style.visibility = "visible";
    document.getElementById(popup_id).style.display    = "inline";

    document.getElementById(btn_id).className = 'dropdown_opened';
    if (is_ie)
    {
        document.getElementById(none_ie[menu_id]).style.visibility = "hidden";
        document.getElementById(none_ie_2[menu_id]).className = "popupcontent_ie";
    }

    opened_popup = menu_id;
    
    return;
}

function mouseover_menu(menu_id)
{
    if (opened_popup < 0)
        return;

    if (opened_popup != menu_id)
        popup_menu(menu_id);
}

Отредактированно lans (2007-04-18 22:16:34)

Неактивен

 

#3 2007-04-19 20:28:49

trijin
aka triny
Зарегистрирован: 2006-06-18
Сообщений: 176
Профиль

Re: Modern_BB_Code_v1.0.0.trijin.RePack.zip

Благодарю. Вечером разберусь, исправлю и перезалью.

Неактивен

 

#4 2007-04-20 02:25:37

trijin
aka triny
Зарегистрирован: 2006-06-18
Сообщений: 176
Профиль

Re: Modern_BB_Code_v1.0.0.trijin.RePack.zip

Изменил. И внес изменения, только немного иные.

Код:

function documentClickHandler(target)
{
    try {
        for (var i = 0; i < menu_ids.length; i++)
        {
            if (target.id == dropdown_buttons[i])
            return true;
        }

        if (target.className == "abtn")
        return true;

        hide_poped_menu();
        return true;
    } catch(e) {
        // IE Error
        hide_poped_menu();
        return true;
    }
}

Неактивен

 

#5 2007-08-01 21:28:57

lans
New member
Откуда: Маркс
Зарегистрирован: 2007-04-18
Сообщений: 6
Профиль  Вебсайт

Re: Modern_BB_Code_v1.0.0.trijin.RePack.zip

После вставки картинки с тегом "без обтекания" в предварительном просмотре сообщения выдавало ошибку Fatal error: Call to undefined function handle_img_tag() in /home/users/l/lans/vmarx.net/doc/include/parser.php(450) : regexp code on line 1

В файле readme.txt:

Код:

#
#---------[ 6. FIND (line:449) ]---------------------------------------------------
#

        if ($pun_config['p_message_img_tag'] == '1')
        {
//            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
        }

#
#---------[ 6. REPLACE WITH ]---------------------------------------------------

и далее..

Вместо

Код:

$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);

вставил

Код:

$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_modern(\'none\', \'$1$3\')', $text);

Только после этого стало работать. Если я прав - не плохо было бы в Modern_BB_Code_v1.0.0.trijin.RePack.zip подправить readme.txt

P.S. И "function documentClickHandler(target)" от ошибки IE тоже что то не нашел изменений

Отредактированно lans (2007-08-01 21:56:47)

Неактивен

 

#6 2007-10-01 03:01:12

trijin
aka triny
Зарегистрирован: 2006-06-18
Сообщений: 176
Профиль

Re: Modern_BB_Code_v1.0.0.trijin.RePack.zip

lans написал:

После вставки картинки с тегом "без обтекания" в предварительном просмотре сообщения выдавало ошибку Fatal error: Call to undefined function handle_img_tag() in /home/users/l/lans/vmarx.net/doc/include/parser.php(450) : regexp code on line 1

При правильной инсталляции дополнения - такой ошибки нет.

Возможно вы вместо "BEFORE ADD"
сделали "REPLACE"?

потому что после установки дополнения функция handle_img_tag() остается.

lans написал:

P.S. И "function documentClickHandler(target)" от ошибки IE тоже что то не нашел изменений

действительно забыл залить. Исправил.

Неактивен

 

Board footer