/* Add tab which loads dynamically. Returns $this for chaining
517811
public function addTabURL($page, $title = null)
    {
        if (is_null($title)) {
            $title = ucwords(preg_replace('/[_\/\.]+/', ' ', $page));
        }
        $this->tab_template->set(array(
                    'url' => $this->app->url($page, array('cut_page' => 1)),
                    'tab_name' => $title,
                    'tab_id' => basename($page),
                    ));
        $this->template->appendHTML('tabs', $this->tab_template->render());

        return $this;
    }
1206220
def addTab(self, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        index = len(self.items())
        self.layout().insertWidget(index, tab)

        self.setCurrentIndex(index)
        return tab
162971
function addOnload($js, $id = null) {
        if($id) {
            $this->js_onload[$id] = $js;
        } else {
            $this->js_onload[] = $js;
        }
        
        return $this;
    }
729898
public function addTab(string $name, BlockInterface $block){
        $this->tabs[]   = [
            "name"  => $name,
            "block" => $block,
        ];

        return $this;
    }
413060
public function addTab($name)
    {
        $tab = $this->createTab($name);

        $this->getFormBuilder()->add($tab);

        return $tab;
    }
870575
def insertTab(self, index, widget, title):
        
        self.insertWidget(index, widget)
        tab = self.tabBar().insertTab(index, title)
        tab.titleChanged.connect(widget.setWindowTitle)
556374
public function addTab($tabId, $tab)
    {
        parent::addTab($tabId, $tab);

        if ($this->_tabs[$tabId] instanceof Mage_Core_Block_Abstract && $this->_tabs[$tabId]->getParentBlock() === null) {
            $this->append($this->_tabs[$tabId]);
        }

        return $this;
    }
695603
function(tab) {
        tab = $(tab);

        var index = tab.data('tab-index'),
            section = this.sections.eq(index),
            options = this.options,
            url = this.readValue(tab, this.readOption(tab, 'getUrl'));

        this.fireEvent('showing', [this.index]);

        // Load content for AJAX requests
        if (url.substr(0, 10) !== 'javascript' && url.substr(0, 1) !== '#') {
            this.loadContent(url, { section: section });
        }

        // Toggle tabs
        this.tabs
            .aria('toggled', false)
            .removeClass('is-active');

        // Toggle sections
        if (index === this.index && options.collapsible) {
            if (section.is(':shown')) {
                section.conceal();

            } else {
                tab.aria('toggled', true).addClass('is-active');
                section.reveal();
            }
        } else {
            this.hide();

            tab.aria('toggled', true).addClass('is-active');
            section.reveal();
        }

        // Persist the state using a cookie
        if (options.persistState && $.cookie) {
            $.cookie('toolkit.tab.' + options.cookie, index, {
                expires: options.cookieDuration
            });
        }

        this.index = index;
        this.node = tab;

        this.fireEvent('shown', [index]);
    }
578930
public function setsTabs($tabs)
    {
        if (is_array($tabs)) {
            $tabs = new ArrayCollection($tabs);
        }
        if (!$tabs instanceof ArrayCollection) {
            throw new \UnexpectedValueException("Expected array or instance of " . ArrayCollection::class);
        }

        $this->tabs = $tabs;

        return $this;
    }
153556
function add_onload($js, $id = null) {
        $js = str_replace('{staticfiles_url}', \Kohana::$config->load('meerkat/staticfiles.static_url'), $js);
        $this->need_jquery();
        if ($id) {
            $this->js_onload[$id] = $js;
        } else {
            $this->js_onload[] = $js;
        }
        return $this;
    }
651139
function(items) {
        this.data = items;
        this.items.empty();
        this.tabs.empty();

        for (var li, a, item, i = 0; item = items[i]; i++) {
            li = $('<li/>');
            li.appendTo(this.items);

            a = $('<a/>')
                .attr('href', 'javascript:;')
                .data('showcase-index', i);

            li = $('<li/>');
            li.appendTo(this.tabs).append(a);
        }

        if (items.length <= 1) {
            this.element.addClass('is-single');
        }

        this.fireEvent('load', [items]);
    }
17449
public function render()
    {
        $this->removeReservedFields();

        $tabObj = $this->form->getTab();

        if (!$tabObj->isEmpty()) {
            $script = <<<'SCRIPT'

var hash = document.location.hash;
if (hash) {
    $('.nav-tabs a[href="' + hash + '"]').tab('show');
}

// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
    history.pushState(null,null, e.target.hash);
});

if ($('.has-error').length) {
    $('.has-error').each(function () {
        var tabId = '#'+$(this).closest('.tab-pane').attr('id');
        $('li a[href="'+tabId+'"] i').removeClass('hide');
    });

    var first = $('.has-error:first').closest('.tab-pane').attr('id');
    $('li a[href="#'+first+'"]').tab('show');
}

SCRIPT;
            Admin::script($script);
        }

        $data = [
            'form'   => $this,
            'tabObj' => $tabObj,
            'width'  => $this->width,
        ];

        return view($this->view, $data)->render();
    }
78341
public function add()
    {
        $page = $this->Pages->newEntity();

        if ($this->request->is('post')) {
            $page = $this->Pages->patchEntity($page, $this->request->getData());

            if ($this->Pages->save($page)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('page'));
    }
832882
function selectTab() {
        layout.resetTabState_(tabs);
        tab.classList.add(layout.CssClasses_.IS_ACTIVE);
    }
348713
function(tab, index) {
            var tabs = this.get('tabs'),
                before = this.getTab(index),
                tabParent = this._tabParent,
                contentParent = this._contentParent,
                tabElement = tab.get(ELEMENT),
                contentEl = tab.get(CONTENT_EL);

            if (!tabs) { // not ready yet
                this._queue[this._queue.length] = ['addTab', arguments];
                return false;
            }
            
            index = (index === undefined) ? tabs.length : index;
            
            tabs.splice(index, 0, tab);

            if ( before ) {
                tabParent.insertBefore(tabElement, before.get(ELEMENT));
            } else {
                tabParent.appendChild(tabElement);
            }

            if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
                contentParent.appendChild(contentEl);
            }
            
            if ( !tab.get(ACTIVE) ) {
                tab.set('contentVisible', false, true); /* hide if not active */
            } else {
                this.set(ACTIVE_TAB, tab, true);
                this.set('activeIndex', index, true);
            }

            this._initTabEvents(tab);
        }
623541
function _add_tabs_before_content() {
            $this->_logger->entrance();

            if ( ! $this->should_page_include_tabs() ) {
                return false;
            }

            /**
             * Enqueue the original stylesheets that are included in the
             * theme settings page. That way, if the theme settings has
             * some custom _styled_ content above the tabs UI, this
             * will make sure that the styling is preserved.
             */
            $stylesheets = $this->_cache->get( 'tabs_stylesheets', array() );
            if ( is_array( $stylesheets ) ) {
                for ( $i = 0, $len = count( $stylesheets ); $i < $len; $i ++ ) {
                    wp_enqueue_style( "fs_{$this->_module_id}_tabs_{$i}", $stylesheets[ $i ] );
                }
            }

            // Cut closing </div> tag.
            echo substr( trim( $this->get_tabs_html() ), 0, - 6 );

            return true;
        }
367046
def __addTab(self, filePath):
        """"""
        for i in range(self.tabBar.count()):
            widget = self.pages.widget(i)
            if not widget.isStatic and filePath == widget.filePath:
                return i
        tab = SubtitleEditor(filePath, self._subtitleData, self)
        newIndex = self.tabBar.addTab(self._createTabName(tab.name, tab.history.isClean()))
        tab.history.cleanChanged.connect(
            lambda clean: self._cleanStateForFileChanged(filePath, clean))
        self.pages.addWidget(tab)
        return newIndex