Skip to content

Commit

Permalink
Use HTTPS / canonical URLs (#1390)
Browse files Browse the repository at this point in the history
Also, remove the broken link in `/index.html`.
  • Loading branch information
valtlai authored and Golmote committed Apr 16, 2018
1 parent dac0485 commit 95146c8
Show file tree
Hide file tree
Showing 31 changed files with 118 additions and 119 deletions.
2 changes: 1 addition & 1 deletion download.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

Expand Down
68 changes: 34 additions & 34 deletions download.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var storedTheme = localStorage.getItem('theme');

for (var category in components) {
var all = components[category];

all.meta.section = $u.element.create('section', {
className: 'options',
id: 'category-' + category,
Expand Down Expand Up @@ -116,18 +116,18 @@ for (var category in components) {
if(id === 'meta') {
continue;
}

var checked = false, disabled = false;
var option = all[id].option || all.meta.option;
switch (option) {

switch (option) {
case 'mandatory': disabled = true; // fallthrough
case 'default': checked = true;
}
if (category === 'themes' && storedTheme) {
checked = id === storedTheme;
}

var filepath = all.meta.path.replace(/\{id}/g, id);

var info = all[id] = {
Expand All @@ -149,7 +149,7 @@ for (var category in components) {
}
}
};

if (info.require) {
info.require.forEach(function (v) {
dependencies[v] = (dependencies[v] || []).concat(id);
Expand All @@ -160,15 +160,15 @@ for (var category in components) {
info.files.minified.paths.push(filepath.replace(/(\.js)?$/, '.min.js'));
info.files.dev.paths.push(filepath.replace(/(\.js)?$/, '.js'));
}


if ((!all[id].noCSS && !/\.js$/.test(filepath)) || /\.css$/.test(filepath)) {
var cssFile = filepath.replace(/(\.css)?$/, '.css');

info.files.minified.paths.push(cssFile);
info.files.dev.paths.push(cssFile);
}

var label = $u.element.create('label', {
attributes: {
'data-id': id
Expand Down Expand Up @@ -205,7 +205,7 @@ for (var category in components) {
input.onclick();
});
}

update(category, id);
};
})(id, category, all)
Expand All @@ -221,7 +221,7 @@ for (var category in components) {
all[id].owner? {
tag: 'a',
properties: {
href: 'http://github.com/' + all[id].owner,
href: 'https://github.com/' + all[id].owner,
className: 'owner',
target: '_blank'
},
Expand Down Expand Up @@ -253,10 +253,10 @@ for (var category in components) {
}
}

form.elements.compression[0].onclick =
form.elements.compression[0].onclick =
form.elements.compression[1].onclick = function() {
minified = !!+this.value;

getFilesSizes();
};

Expand All @@ -273,18 +273,18 @@ function getFileSize(filepath) {
function getFilesSizes() {
for (var category in components) {
var all = components[category];

for (var id in all) {
if(id === 'meta') {
continue;
}

var distro = all[id].files[minified? 'minified' : 'dev'],
files = distro.paths;

files.forEach(function (filepath) {
var file = cache[filepath] = cache[filepath] || {};

if(!file.size) {

(function(category, id) {
Expand Down Expand Up @@ -330,7 +330,7 @@ function prettySize(size) {
function update(updatedCategory, updatedId){
// Update total size
var total = {js: 0, css: 0}, updated = {js: 0, css: 0};

for (var category in components) {
var all = components[category];
var allChecked = true;
Expand All @@ -340,14 +340,14 @@ function update(updatedCategory, updatedId){

if (info.enabled || id == updatedId) {
var distro = info.files[minified? 'minified' : 'dev'];

distro.paths.forEach(function(path) {
if (cache[path]) {
var file = cache[path];

var type = path.match(/\.(\w+)$/)[1],
size = file.size || 0;

if (info.enabled) {

if (!file.contentsPromise) {
Expand All @@ -356,7 +356,7 @@ function update(updatedCategory, updatedId){

total[type] += size;
}

if (id == updatedId) {
updated[type] += size;
}
Expand All @@ -381,7 +381,7 @@ function update(updatedCategory, updatedId){
$('input[name="check-all-' + category + '"]').checked = allChecked;
}
}

total.all = total.js + total.css;

if (updatedId) {
Expand All @@ -394,19 +394,19 @@ function update(updatedCategory, updatedId){
(updated.css ? Math.round(100 * updated.css / updated.all) + '% CSS' : '')
});
}

$('#filesize').textContent = prettySize(total.all);

$u.element.prop($('#percent-js'), {
textContent: Math.round(100 * total.js / total.all) + '%',
title: prettySize(total.js)
});

$u.element.prop($('#percent-css'), {
textContent: Math.round(100 * total.css / total.all) + '%',
title: prettySize(total.css)
});

delayedGenerateCode();
}

Expand Down Expand Up @@ -459,10 +459,10 @@ function getSortedComponentsByRequirements(components){
function generateCode(){
var promises = [];
var redownload = {};

for (var category in components) {
var all = components[category];

// In case if one component requires other, required component should go first.
var sorted = getSortedComponentsByRequirements(all);

Expand All @@ -472,17 +472,17 @@ function generateCode(){
if(id === 'meta') {
continue;
}

var info = all[id];
if (info.enabled) {
if (info.enabled) {
if (category !== 'core') {
redownload[category] = redownload[category] || [];
redownload[category].push(id);
}
info.files[minified? 'minified' : 'dev'].paths.forEach(function (path) {
if (cache[path]) {
var type = path.match(/\.(\w+)$/)[1];

promises.push({
contentsPromise: cache[path].contentsPromise,
path: path,
Expand All @@ -509,7 +509,7 @@ function generateCode(){
error.innerHTML = '';
$u.element.contents(error, errors);
}

var redownloadUrl = window.location.href.split("#")[0] + "#";
for (var category in redownload) {
redownloadUrl += category + "=" + redownload[category].join('+') + "&";
Expand All @@ -521,10 +521,10 @@ function generateCode(){

for (var type in code) {
var codeElement = $('#download-' + type + ' code');

codeElement.textContent = versionComment + "\n" + code[type];
Prism.highlightElement(codeElement, true);

$('#download-' + type + ' .download-button').href = 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(versionComment + "\n" + code[type]);
}
});
Expand Down
2 changes: 1 addition & 1 deletion examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion extending.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body class="language-javascript">

Expand Down
2 changes: 1 addition & 1 deletion faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

Expand Down
19 changes: 9 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ <h1>Used By</h1>
<p>Prism is used on several websites, small and large. Some of them are:</p>

<div class="used-by-logos">
<a href="http://smashingmagazine.com" target="_blank"><img src="img/logo-smashing.png" alt="Smashing Magazine" /></a>
<a href="http://alistapart.com" target="_blank"><img src="img/logo-ala.png" alt="A List Apart" /></a>
<a href="https://www.smashingmagazine.com/" target="_blank"><img src="img/logo-smashing.png" alt="Smashing Magazine" /></a>
<a href="http://alistapart.com/" target="_blank"><img src="img/logo-ala.png" alt="A List Apart" /></a>
<a href="https://developer.mozilla.org/" target="_blank"><img src="img/logo-mdn.png" alt="Mozilla Developer Network (MDN)" /></a>
<a href="http://css-tricks.com" target="_blank"><img src="img/logo-css-tricks.png" alt="CSS-Tricks" /></a>
<a href="http://www.sitepoint.com" target="_blank"><img src="img/logo-sitepoint.png" alt="SitePoint" /></a>
<a href="https://www.drupal.org" target="_blank"><img src="img/logo-drupal.png" alt="Drupal" /></a>
<a href="https://css-tricks.com/" target="_blank"><img src="img/logo-css-tricks.png" alt="CSS-Tricks" /></a>
<a href="https://www.sitepoint.com/" target="_blank"><img src="img/logo-sitepoint.png" alt="SitePoint" /></a>
<a href="https://www.drupal.org/" target="_blank"><img src="img/logo-drupal.png" alt="Drupal" /></a>
<a href="https://reactjs.org/" target="_blank"><img src="img/logo-react.png" alt="React" /></a>
<a href="https://stripe.com/" target="_blank"><img src="img/logo-stripe.png" alt="Stripe" /></a>
</div>
Expand Down Expand Up @@ -218,11 +218,10 @@ <h1>Third-party tutorials</h1>
<li><a href="https://websitebeaver.com/escape-html-inside-code-or-pre-tag-to-entities-to-display-raw-code-with-prismjs">Escape HTML Inside &lt;code&gt; or &lt;pre&gt; Tag to Entities to Display Raw Code with PrismJS</a></li>
<li><a href="http://crambler.com/how-to-implement-prism-js-syntax-highlighting-into-your-wordpress-site/">How To Implement Prism.js Syntax Highlighting Into Your WordPress Site</a></li>
<li><a href="http://wp.tutsplus.com/tutorials/plugins/adding-a-syntax-highlighter-shortcode-using-prism-js/">Adding a Syntax Highlighter Shortcode Using Prism.js | WPTuts+</a></li>
<li><a href="http://www.stramaxon.com/2012/07/prism-syntax-highlighter-for-blogger.html">Implement PrismJs Syntax Highlighting to your Blogger/BlogSpot</a></li>
<li><a href="https://www.stramaxon.com/2012/07/prism-syntax-highlighter-for-blogger.html">Implement PrismJs Syntax Highlighting to your Blogger/BlogSpot</a></li>
<li><a href="http://www.allblogtools.com/tricks-and-hacks/beautify-source-codes-in-your-posts-with-prism-syntax-highlighter-for-blogger/">Beautify Source Codes In Your Posts With Prism Syntax Highlighter For Blogger</a></li>
<li><a href="http://schier.co/blog/2013/01/07/how-to-re-run-prismjs-on-ajax-content.html">How To Re-Run Prism.js On AJAX Content</a></li>
<li><a href="http://www.semisedlak.com/article/highlight-your-code-syntax-with-prismjs/">Highlight your code syntax with Prism.js</a></li>
<li><a href="http://byverdu.es/2013/06/tutorial-sobre-prism-js-inserta-ejemplos-de-codigo-en-web-wordpress-y-blogger/">[Spanish] Tutorial sobre Prism.js Como utilizarlo en Web, Wordpress y Blogger</a></li>
<li><a href="https://schier.co/blog/2013/01/07/how-to-re-run-prismjs-on-ajax-content.html">How To Re-Run Prism.js On AJAX Content</a></li>
<li><a href="https://www.semisedlak.com/highlight-your-code-syntax-with-prismjs">Highlight your code syntax with Prism.js</a></li>
<li><a href="https://usetypo3.com/fs-code-snippet.html">A code snippet content element powered by Prism.js for TYPO3 CMS</a></li>
</ul>

Expand All @@ -237,7 +236,7 @@ <h1>Credits</h1>
<li>Special thanks to <a href="https://github.com/Golmote">Golmote</a> and <a href="https://github.com/apfelbox">Jannik Zschiesche</a> for their contributions and for being <strong>amazing maintainers</strong>. Prism would not have been able to keep up without their help.</li>
<li>To <a href="https://twitter.com/kizmarh">Roman Komarov</a> for his contributions, feedback and testing.</li>
<li>To <a href="https://twitter.com/zdfs">Zachary Forrest</a> for <a href="https://twitter.com/zdfs/statuses/217834980871639041">coming up with the name “Prism”</a></li>
<li>To <a href="http://stellarr.deviantart.com/">stellarr</a> for the <a href="http://stellarr.deviantart.com/art/Spectra-Wallpaper-Pack-97785901?q=gallery%3Astellarr%2F185512&qo=2">spectrum background</a> used on this page</li>
<li>To <a href="https://stellarr.deviantart.com/">stellarr</a> for the <a href="https://stellarr.deviantart.com/art/Spectra-Wallpaper-Pack-97785901">spectrum background</a> used on this page</li>
<li>To <a href="https://twitter.com/thecodezombie">Jason Hobbs</a> for <a href="https://twitter.com/thecodezombie/status/217663703825399809">encouraging me</a> to release this script as standalone</li>
</ul>
</section>
Expand Down
14 changes: 7 additions & 7 deletions plugins/autolinker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

<header>
<div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>

<h2>Autolinker</h2>
<p>Converts URLs and emails in code to clickable links. Parses <a href="http://daringfireball.net/projects/markdown/">Markdown</a> links in comments.</p>
<p>Converts URLs and emails in code to clickable links. Parses <a href="https://daringfireball.net/projects/markdown/">Markdown</a> links in comments.</p>
</header>

<section>
<h1>How to use</h1>
<p>URLs and emails will be linked automatically, you don’t need to do anything. To link some text inside a comment to a certain URL,
you may use the Markdown syntax:
you may use the Markdown syntax:
<pre><code class="language-markdown">[Text you want to see](http://url-goes-here.com)</code></pre>
</section>

<section>
<h1>Examples</h1>

<h2>JavaScript</h2>
<pre><code class="language-javascript">/**
* Prism: Lightweight, robust, elegant syntax highlighting
* MIT license http://www.opensource.org/licenses/mit-license.php/
* @author Lea Verou http://lea.verou.me
* @author Lea Verou http://lea.verou.me
* Reach Lea at [email protected] (no, not really)
* And this is [a Markdown link](http://prismjs.com). Sweet, huh?
*/
var foo = 5;
// And a single line comment http://google.com</code></pre>

<h2>CSS</h2>
<pre><code class="language-css">@font-face {
src: url(http://lea.verou.me/logo.otf);
font-family: 'LeaVerou';
}</code></pre>

<h2>HTML</h2>
<pre><code class="language-markup">&lt;!-- Links in HTML, woo!
Lea Verou http://lea.verou.me or, with Markdown, [Lea Verou](http://lea.verou.me) -->
Expand Down
2 changes: 1 addition & 1 deletion plugins/autoloader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion plugins/command-line/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion plugins/copy-to-clipboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script src="prefixfree.min.js"></script>

<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body class="language-markup">

Expand Down
Loading

0 comments on commit 95146c8

Please sign in to comment.