<header id="header">
    <div class="br-header">
    <span class="br-img-span"><span ng-if="isBrazilianEdition" class="br-edition brContentSpan">Edição Brasileira<div class="br-img"></div></span></span>
    <div class="headerUlDiv">
    <ul class="icons-system">
        <li ng-repeat="navigationItem in topMenuItems | orderBy: '+position'" class="{{::navigationItem.parentClass}}">
            <a id="{{::navigationItem.linkId}}" ng-click="switchToApp(navigationItem)" class="{{::navigationItem.iconClass}}" ng-class="{'disabled': navigationItem.onlyInPro && !$root.license.isProVersion}" title="{{navigationItem.onlyInPro && !$root.license.isProVersion ? onlyInProTitle : navigationItem.title}}"
                data-toggle="tooltip" data-container="body" data-placement="bottom">{{navigationItem.showText ? navigationItem.title : ''}}</a>
        </li>

        <li ng-if="$root.developmentMode" onclick="regenerate()">
            <a class="icons-system-regenerate fa fa-refresh" data-toggle="tooltip" title="Regenerate"></a>
        </li>
        <li ng-if="$root.developmentMode" ng-click="dataTrialPopup()">
            <a class="icons-system-regenerate fa fa-database" data-toggle="tooltip" title="Data trial"></a>
        </li>
        <li>
            <div class="dropdown">
                <a class="icons-system-settings fa fa-cog dropdown-toggle" data-toggle="dropdown" aria-expanded="true" title="Settings" id="global-settings-cog"></a>
                <ul class="dropdown-menu">
                    <li ng-click="showPopup('#performanceDialog')">
                        <a><i class="fa fa-cog"></i>
                            <tsq>Configuration...</tsq>
                        </a>
                    </li>
                    <li ng-click="showBenchmark()">
                        <a><i class="fa fa-bar-chart" aria-hidden="true"></i>
                            <tsq>Benchmark...</tsq>
                        </a>
                    </li>
                    <li ng-click="showRemoteAccessSettings()">
                        <a><i class="fa fa-globe" aria-hidden="true"></i>
                            <tsq>Remote access...</tsq>
                        </a>
                    </li>
                    <li ng-click="showSMTPSettings()">
                        <a><i class="fa fa-envelope-o" aria-hidden="true"></i>
                            <tsq>SMTP server...</tsq>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li class="dropdown-submenu">
                        <a tabindex="-1" class="dropdown-dont-close">
                            <i class="fa fa-flag-checkered" aria-hidden="true"></i>
                            <tsq>Language</tsq>
                        </a>
                        <language-menu />
                    </li>
                    <li class="divider"></li>
                    <li class="dropdown-submenu">
                        <a tabindex="-1" class="dropdown-dont-close">
                            <i class="fa fa-paint-brush" aria-hidden="true"></i>
                            <tsq>Skin</tsq>
                        </a>
                        <skin-picker />
                    </li>
                    <li class="divider"></li>
                    <li class="item-nolink dropdown-dont-close">
                        <tsq>Zoom</tsq>
                        <span class="menu-zoom">
                            <apps-zoom /> &nbsp;|&nbsp;
                            <a ng-click="fullscreen()" class="menu-zoom-fullscreen"></a>
                        </span>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a ng-click="openlink('https://www.strategyquant.com/')"><i class="fa fa-external-link"
                                aria-hidden="true"></i>
                            <tsq>StrategyQuant Website</tsq>
                        </a>
                    </li>
                    <li>
                        <a ng-click="openlink('https://docs.strategyquant.com')"><i class="fa fa-external-link"
                                aria-hidden="true"></i>
                            <tsq>Help center</tsq>
                        </a>
                    </li>
                    <li>
                        <a ng-click="openlink('https://strategyquant.com/contactus/')"><i class="fa fa-external-link"
                                aria-hidden="true"></i>
                            <tsq>Support</tsq>
                        </a>
                    </li>
                    <li>
                        <a ng-click="updateLicense()"><i class="fa fa-user-o" aria-hidden="true"></i>
                            <tsq>Update license</tsq>
                        </a>
                    </li>
                    <li>
                        <a ng-click="about()"><i class="fa fa-info-circle" aria-hidden="true"></i>
                            <tsq>About</tsq>
                        </a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a ng-click="exitapp()"><i class="fa fa-times" aria-hidden="true"></i>
                            <tsq>Exit</tsq>
                        </a>
                    </li>
                </ul>
            </div>
        </li>
        <!--<li ng-click="fullscreen()"><a class="icons-system-fullscreen"></a></li> -->
    </ul>
</div>
    <!--skin-picker/-->
    </div>
</header>

<script>
    function regenerate() {
        var iframes = $(".sq4-maincontent iframe");

        for (var i = 0; i < iframes.length; i++) {
            var iframe = $(iframes[i]);
            if (iframe.css('display') != 'none') {
                if(iframe[0].contentWindow.regenerate) {
                    iframe[0].contentWindow.regenerate();
                } else {
                    console.log("Not implemented.");
                }

                break;
            }
        }
    }
</script>