Показать сообщение отдельно
  #4 (permalink)  
Старый 28.01.2014, 19:23
Кандидат Javascript-наук
Отправить личное сообщение для Ingiborn Посмотреть профиль Найти все сообщения от Ingiborn
 
Регистрация: 02.12.2009
Сообщений: 139

tabOpened: function (event) {
        if (countryTool.prefManager.getBoolPref("extensions.countrytool.rotate_country_on_new_window") == true) {
            countryTool.switchCountry()
        }
    },
    switchCountry: function () {
        var countries, menu, context_menu;
        switch (countryTool.prefManager.getCharPref("extensions.countrytool.country_type")) {
        case "english":
            countries = countryTool.prefManager.getCharPref("extensions.countrytool.english_countries").split("|");
            menu = document.getElementById("countrytool-menupopup-english-countries-uploaded");
            context_menu = document.getElementById("countrytool-context-menupopup-english-countries-uploaded");
            break;
        case "russian":
            countries = countryTool.prefManager.getCharPref("extensions.countrytool.russian_countries").split("|");
            menu = document.getElementById("countrytool-menupopup-russian-countries-uploaded");
            context_menu = document.getElementById("countrytool-context-menupopup-russian-countries-uploaded");
            break;
        case "belarus":
            countries = countryTool.prefManager.getCharPref("extensions.countrytool.belarus_countries").split("|");
            menu = document.getElementById("countrytool-menupopup-belarus-countries-uploaded");
            context_menu = document.getElementById("countrytool-context-menupopup-belarus-countries-uploaded");
            break
        }
        countryTool.clearAllCountriesStyles();
        var menuitem_country = menu.childNodes[countryTool.currentRotateCountryIndex];
        var context_menuitem_country = context_menu.childNodes[countryTool.currentRotateCountryIndex];
        menuitem_country.setAttribute("checked", true);
        context_menuitem_country.setAttribute("checked", true);
        menuitem_country.setAttribute("style", "font-weight: bold");
        context_menuitem_country.setAttribute("style", "font-weight: bold");
        if (menuitem_country.hasChildNodes()) countryTool.selectedCountryFlag = menuitem_country.childNodes[0].getAttribute("src");
        else countryTool.selectedCountryFlag = "";
        var country_info = menuitem_country.getAttribute('value').split(",");
        countryTool.countryChanged(country_info[0].split(":"));
        countryTool.selectedCountryCity = (country_info[1] == "undefined") ? "" : country_info[1];
        if (country_info[2] != "undefined") countryTool.selectedCountryCity += "," + country_info[2];
        var labelText = menuitem_country.getAttribute('label');
        var index = labelText.substring(0, labelText.indexOf("."));
        var stringbundle = document.getElementById("countrytool-strings");
        countryTool.showPopup("country", stringbundle.getString("currentcountryindex") + ": " + index);
        countryTool.currentRotateCountryIndex++;
        if (countryTool.currentRotateCountryIndex == countries.length || countries.length == 0) countryTool.currentRotateCountryIndex = 0
    },


Помогите!
Ответить с цитированием