$e[1] = mb_strtoupper($lang);
}
$lang = implode('_', $e);
+
+ $langsMap = ['fr' => 'fr_FR', 'en' => 'en_US'];
+
+ if (isset($langsMap[$lang])) {
+ $lang = $langsMap[$lang];
+ }
+
$this->beginBody[] = "<div id=\"fb-root\"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
* Duplicate paths are ignored.
* @param $path
*/
- public function addJs($path) {
+ public function addJs($path, $collection = null) {
+ if (null === $collection) {
// If JS is external, it will be included via the pluginJs collection
// Otherwise, it will be compiled into the main JS file
$collection = (preg_match('#^https?://#i', $path) === 1) ? 'pluginJs' : 'jsFiles';
+ }
if (!in_array($path, $this->$collection)) {
$this->{$collection}[] = $path;
}
}
- $securitypolicywhitelist = implode(' ', array_unique($this->securityPolicyWhitelist));
-
- $vars = array('titre', 'credits', 'statsfooter', 'ga', 'style', 'script', 'pagesContents', 'description', 'print', 'hiddenContents', 'splash', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'securitypolicywhitelist');
+ if ($this->phonegap) {
+ $csp = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' data: gap: 'unsafe-inline' *; style-src 'self' 'unsafe-inline'; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' " . implode(' ', array_unique($this->securityPolicyWhitelist)) . "; img-src * data:\">";
+ }
+ $vars = array('titre', 'credits', 'statsfooter', 'ga', 'style', 'script', 'pagesContents', 'description', 'print', 'hiddenContents', 'splash', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp');
foreach ($vars as $v) {
$html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
}
$lessVariables['menu-breakpoint'] = $menuBreakpoint;
$lessVariables['menu-background'] = $menuColor->toCSS();
+ if ($this->theme->parametres->subSecondaryColor) {
+ $lessVariables['menu-button-background'] = wsHTML5::colorToCSS($this->theme->parametres->subSecondaryColor);
+ } else {
+ $lessVariables['menu-background-green'] = 'max(@max, min(255-45, green(@menu-background)))';
+ $lessVariables['menu-background-red'] = 'max(@max, min(255-45, red(@menu-background)))';
+ $lessVariables['menu-background-blue'] = 'max(@max, min(255-45, blue(@menu-background)))';
+ $lessVariables['menu-button-background'] = 'overlay(rgb(@menu-background-red, @menu-background-green, @menu-background-blue), #c0c0c0)';
+ }
+
$lessVariables['menu-text'] = $menuTextColor;
$lessVariables['menu-field-background'] = wsHTML5::colorToCSS($this->theme->parametres->subFieldColor);
$lessVariables['menu-field-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextFieldColor);
$lessVariables['menu-select-text'] = wsHTML5::colorToCSS($this->theme->parametres->subTextSelectColor);
$lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
-
- $menuMultiply = $menuColor->multiply($menuColor);
- $menuMultiply2 = $menuMultiply->multiply($menuColor);
-
-
// Archives
if ($this->book->parametres->externalArchivesBack) {
$this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack);