preact-highlight
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -86,4 +86,4 @@ | ||
}, | ||
version: '1.1.0', | ||
version: '1.1.1', | ||
}; | ||
@@ -13,6 +13,13 @@ 'use strict'; | ||
function themeManger(theme) { | ||
if (!THEME[theme]) return; | ||
if (!CACHE_STYLES[theme] && isBrowser) { | ||
CACHE_STYLES[theme] = ''; | ||
console.log(utils.cdn(version, THEME[theme])); | ||
if (!THEME[theme] || !isBrowser) return; | ||
var doc = document; | ||
var headDoc = doc.head; | ||
if (!CACHE_STYLES[theme]) { | ||
var link = doc.createElement('link'); | ||
var url = utils.cdn(version, THEME[theme]); | ||
link.setAttribute('href', url); | ||
link.setAttribute('rel', 'stylesheet'); | ||
CACHE_STYLES[theme] = true; | ||
headDoc.appendChild(link); | ||
console.log(url); | ||
} | ||
@@ -19,0 +26,0 @@ } |
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="1.1.1"></a> | ||
## [1.1.1](https://github.com/jasonChen1982/preact-highlight/compare/v1.1.0...v1.1.1) (2017-06-23) | ||
<a name="1.1.0"></a> | ||
@@ -7,0 +12,0 @@ # [1.1.0](https://github.com/jasonChen1982/preact-highlight/compare/v1.1.0-alpha.0...v1.1.0) (2017-06-23) |
{ | ||
"name": "preact-highlight", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "a syntax highlight component for preact", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -9,6 +9,13 @@ 'use strict'; | ||
function themeManger(theme) { | ||
if (!THEME[theme]) return; | ||
if (!CACHE_STYLES[theme] && isBrowser) { | ||
CACHE_STYLES[theme] = ''; | ||
console.log(utils.cdn(version, THEME[theme])); | ||
if (!THEME[theme] || !isBrowser) return; | ||
const doc = document; | ||
const headDoc = doc.head; | ||
if (!CACHE_STYLES[theme]) { | ||
const link = doc.createElement('link'); | ||
const url = utils.cdn(version, THEME[theme]); | ||
link.setAttribute('href', url); | ||
link.setAttribute('rel', 'stylesheet'); | ||
CACHE_STYLES[theme] = true; | ||
headDoc.appendChild(link); | ||
console.log(url); | ||
} | ||
@@ -15,0 +22,0 @@ } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
132560
102
5490