Skip to content

Commit

Permalink
Support https url.
Browse files Browse the repository at this point in the history
Create link url which depends on current protocol.
  • Loading branch information
garafu committed Oct 9, 2016
1 parent 53fcf63 commit a855003
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This script creates TOC of your blogger posts using feed data.
Demo
--------------------------

[Try it out !!](http://garafu.github.io/blogger.toc/demo/index.html)
[Try it out !!](//garafu.github.io/blogger.toc/demo/index.html)


Usage
Expand Down Expand Up @@ -40,7 +40,7 @@ var POSTSTOC_SETTINGS = {
}
};
</script>
<script type="text/javascript" src="http://garafu.github.io/blogger.toc/release/0.0.7/blogger.toc.min.js"></script>
<script type="text/javascript" src="//garafu.github.io/blogger.toc/release/0.0.7/blogger.toc.min.js"></script>
```
4. Modify user settings.
Expand Down Expand Up @@ -70,4 +70,4 @@ For details of options are following.
License
--------------------------
blogger.toc plugin released under the MIT license.
Please see [MIT-LICENSE.txt](https://github.com/garafu/blogger.toc/blob/master/MIT-LICENSE.txt) for details.
Please see [MIT-LICENSE.txt](//github.com/garafu/blogger.toc/blob/master/MIT-LICENSE.txt) for details.
6 changes: 3 additions & 3 deletions build/blogger.toc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/blogger/toc/printer/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ garafu.blogger.toc.printer.Category.prototype.initialize = function () {
var url = '';

// Create label search URL.
url += 'http://'
url += '//'
url += settings.blogURL;
url += '/search/label/';
url += categoryName;
Expand Down
3 changes: 2 additions & 1 deletion src/blogger/toc/printer/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ garafu.blogger.toc.printer.Entry.prototype.getRootElement = function () {
garafu.blogger.toc.printer.Entry.prototype.initialize = function () {
var settings = this._settings;
var entry = this._data;
var regexp = /https?:(\/\/[\w\-\.~#\$&\+\/:=\?%]+)/;
var container, published, updated, thumbnail, title, newsymbol, datetime, text, img;

// Create container DOM element.
Expand Down Expand Up @@ -106,7 +107,7 @@ garafu.blogger.toc.printer.Entry.prototype.initialize = function () {
// Create title
title = document.createElement('a');
title.appendChild(document.createTextNode(entry.title.$t));
title.href = entry.link[entry.link.length - 1].href;
title.href = regexp.exec(entry.link[entry.link.length - 1].href)[1];
title.className = 'poststoc-title';
container.appendChild(title);

Expand Down

0 comments on commit a855003

Please sign in to comment.