Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Commit

Permalink
fixed encode url in twitter share button
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 2, 2015
1 parent e09dc1d commit 698f48b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
14 changes: 10 additions & 4 deletions assets/js/src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ $ ->

if Uno.is 'page', 'post'
$('.main').readingTime readingTimeTarget: '.post.reading-time > span'
postTitle = $('#post-title').text()
postTitle = postTitle.substring(0, postTitle.length - 1); # delete dot
shareLink = "http://twitter.com/share?url=" + encodeURIComponent(document.URL)
shareLink += "&text=" + encodeURIComponent "#{postTitle} »"
$('#share_twitter').attr('href', shareLink)

$('#panic-button').click ->
s = document.createElement 'script'
s.setAttribute 'src','https://nthitz.github.io/turndownforwhatjs/tdfw.js'
document.body.appendChild s
if Uno.is 'page', 'error'
$('#panic-button').click ->
s = document.createElement 'script'
s.setAttribute 'src','https://nthitz.github.io/turndownforwhatjs/tdfw.js'
document.body.appendChild s
4 changes: 2 additions & 2 deletions assets/js/uno.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uno-zen",
"description": "Minimalist and Elegant theme for Ghost",
"homepage": "https://github.com/kikobeats/uno-zen",
"version": "2.1.1",
"version": "2.1.2",
"author": {
"name": "Kiko Beats",
"url": "https://github.com/kikobeats"
Expand All @@ -28,16 +28,19 @@
"gulp": "*",
"gulp-add-src": "*",
"gulp-autoprefixer": "*",
"gulp-sass": "*",
"gulp-changed": "*",
"gulp-coffee": "*",
"gulp-concat": "*",
"gulp-cssmin": "*",
"gulp-header": "*",
"gulp-minify-css": "*",
"gulp-sass": "1.3.1",
"gulp-strip-css-comments": "*",
"gulp-uglify": "*",
"gulp-util": "*"
},
"engines": {
"node": "~0.12.x"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<span class="post reading-time"> – <span></span> read.</span>
</div>

<a href="https://twitter.com/intent/tweet?url={{url absolute="true"}};text={{title}} » " alt="Tweet '{{title}}'" target="_blank">
<a id="share_twitter" alt="Tweet '{{title}}'" target="_blank">
{{#if image}}<img id="post-image" src={{image}} alt="{{{title}}}">{{/if}}
<h1 class="icon-reverse icon-social-twitter-post" id="post-title">{{{title}}}.</h1>
</a>
Expand Down

0 comments on commit 698f48b

Please sign in to comment.