[
  {
    "path": ".gitignore",
    "content": "node_modules"
  },
  {
    "path": "README.md",
    "content": "# InlineTweet.js\n\n![InlineTweet.js allows you to easily create tweetable links out of any text on a webpage. Just wrap the tweetable text in a container with data-inline-tweet and you're good to go!](screenshot.png)\n\n[SEE DEMO](http://ireade.github.io/inlinetweetjs/)\n\nWant to use this in Wordpress? [Check out this plugin](https://github.com/ireade/wp-inlinetweetjs/)\n\n\n## How to Use\n\n\n#### 1 - Include Script\n\n[Download the file from here](https://raw.githubusercontent.com/ireade/inlinetweetjs/gh-pages/src/inline-tweet.min.js) and include it in your webpage.\n\n```html\n<script src=\"path/to/inline-tweet.min.js\"></script>\n```\n\n\n#### 2 - Wrap Text\n\nWrap the tweetable text in a container element of your choice (`span` recommended) with the data attribute, `data-inline-tweet`\n\n\n```html\n<span data-inline-tweet>Lorem Khaled Ipsum is a major key to success</span>\n```\n\n\n#### 3 - Additional Options\n\nYou can add more data attributes to cutomise the tweeted output -\n\n- `data-inline-tweet-via` — Add a twitter username (without the @) to append to the tweet\n- `data-inline-tweet-tags` - Add hashtags to the tweet (comma-separated, no spaces)\n- `data-inline-tweet-url` — Tweet a URL different to the current page url\n\n```html\n<span data-inline-tweet       \n\t  data-inline-tweet-via=\"ireaderinokun\"   \n\t  data-inline-tweet-tags=\"webdesign,webdev,js,yolo\"    \n\t  data-inline-tweet-url=\"bitsofco.de\">   \n\tLorem Khaled Ipsum is a major key to success \n</span>\n```\n\n\n#### 4 - Add Styles\n\nAdd the following styles to your stylesheet -\n\n```css\n[data-inline-tweet] a {   \n\ttext-decoration: none;   \n\tcolor: #000; \n} \n[data-inline-tweet] a span {   \n\tborder-bottom: 1px dotted rgb(0,172,237);   \n\tfont-style: italic;      \n\tmargin-right: 10px; \n} \n[data-inline-tweet] a:hover span {   \n\tbackground-color: rgba(0,172,237,0.1);   \n\tcolor: rgb(0,172,237); \n}\n```\n\n\n## Licence\n\n[GNU GENERAL PUBLIC LICENSE](https://www.gnu.org/licenses/gpl-3.0.en.html)\n\n"
  },
  {
    "path": "gulpfile.js",
    "content": "var gulp = require('gulp'),\n    gutil = require('gulp-util'),\n    uglify = require('gulp-uglifyjs');\n\ngulp.task('script', function() {\n    gulp.src('src/inline-tweet.js')\n        .pipe(\n            uglify('inline-tweet.min.js')\n            .on('error', gutil.log)\n        )\n        .pipe(gulp.dest('src'));\n});\n\ngulp.task('watch', function() {\n    gulp.watch('src/inline-tweet.js',['script']); \n});\n\ngulp.task('default', ['script', 'watch']);"
  },
  {
    "path": "index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>InlineTweet.js</title>\n\t\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t<meta name=\"description\" content=\"\">\n\t\n\t<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Source+Code+Pro' rel='stylesheet'>\n\t<link rel=\"stylesheet\" href=\"style.css\">\n</head>\n<body>\n\t<div class=\"container\">\n\n\t\t<section>\n\t\t\n\t\t<h1>InlineTweet.js</h1>\n\n\t\t<p class=\"about\"><span data-inline-tweet data-inline-tweet-via=\"ireaderinokun\" data-inline-tweet-url=\"http://ireade.github.io/inlinetweetjs/\" data-inline-tweet-tags=\"js\">InlineTweet.js allows you to easily create tweetable links out of any text on a webpage</span>. Just wrap the tweetable text in a container with <code>data-inline-tweet</code> and you're good to go!</p>\n\n\t\t<br>\n\t\t<iframe src=\"https://ghbtns.com/github-btn.html?user=ireade&repo=inlinetweetjs&type=star&count=false\" frameborder=\"0\" scrolling=\"0\" width=\"60px\" height=\"20px\"></iframe>\n\n\n\t\t<br><br>\n\n\t\t<p>\n\t\t\t<strong>UPDATE: </strong>\n\t\t\t<span data-inline-tweet data-inline-tweet-via=\"ireaderinokun @CreativeCatApps\" data-inline-tweet-url=\"https://github.com/ireade/wp-inlinetweetjs\">You can now use InlineTweet.js in Wordpress with this new plugin!</span>\n\n\t\t\t(<a href=\"https://github.com/ireade/wp-inlinetweetjs\">Check it out</a>)\n\t\t</p>\n\t\t\n\t\t\n\t\t</section>\n\n\t\t\n\t\t<section class=\"site-section\" id=\"how-to-use\">\n\t\t\t<h2>How To Use</h2>\n\n\t\t\t<section>\n\t\t\t\t<h3>1 - Include Script</h3>\n\n\t\t\t\t<p><a href=\"https://raw.githubusercontent.com/ireade/inlinetweetjs/gh-pages/src/inline-tweet.min.js\">Download the file from here</a> and include it in your webpage.</p>\n<pre id=\"stepOne\">&lt;script src=\"path/to/inline-tweet.min.js\"&gt;&lt;/script&gt;</pre>\n\t\t\t</section>\n\n\n\t\t\t<section>\n\t\t\t\t<h3>2 - Wrap Text</h3>\n\n\t\t\t\t<p>Wrap the tweetable text in a container element of your choice (<code>span</code> recommended) with the data attribute, <code>data-inline-tweet</code></p>\n\n<pre>&lt;span data-inline-tweet&gt;Lorem Khaled Ipsum is a major key to success&lt;/span&gt;</pre>\n\t\t\t</section>\n\n\n\t\t\t<section>\n\t\t\t\t<h3>3 - Additional Options</h3>\n\n\t\t\t\t<p>You can add more data attributes to cutomise the tweeted output -</p>\n\t\t\t\t<ul class=\"ul\">\n\t\t\t\t\t<li><code>data-inline-tweet-via</code> — Add a twitter username (without the @) to append to the tweet </li>\n\t\t\t\t\t<li><code>data-inline-tweet-tags</code> - Add hashtags to the tweet (comma-separated, no spaces)</li>\n\t\t\t\t\t<li><code>data-inline-tweet-url</code> — Tweet a URL different to the current page url</li>\n\t\t\t\t</ul>\n<pre>&lt;span data-inline-tweet\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data-inline-tweet-via=\"ireaderinokun\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data-inline-tweet-tags=\"webdesign,webdev,js,yolo\"\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data-inline-tweet-url=\"bitsofco.de\"&gt;\n&nbsp;&nbsp;Lorem Khaled Ipsum is a major key to success\n&lt;/span&gt;</pre>\n\t\t\t</section>\n\n\n\t\t\t<section>\n\t\t\t\t<h3>4 - Add Styles</h3>\n\t\t\t\t<p>Add the following styles to your stylesheet -</p>\n\n<pre id=\"stepOne\">[data-inline-tweet] a {\n&nbsp;&nbsp;text-decoration: none;\n&nbsp;&nbsp;color: #000;\n}\n[data-inline-tweet] a span {\n&nbsp;&nbsp;border-bottom: 1px dotted rgb(0,172,237);\n&nbsp;&nbsp;font-style: italic;\n&nbsp;&nbsp;margin-right: 10px;\n}\n[data-inline-tweet] a:hover span {\n&nbsp;&nbsp;background-color: rgba(0,172,237,0.1);\n&nbsp;&nbsp;color: rgb(0,172,237);\n}</pre>\n\t\t\t</section>\n\n\n\t\t</section>\n\n\n\t\t<p>Made with <i class=\"twa twa-heart\"></i> by <a href=\"https://twitter.com/ireaderinokun\" target=\"_blank\">@IreAderinokun</a></p>\n\n\t</div>\n\n\n\t<script src=\"src/inline-tweet.min.js\"></script>\n</body>\n</html>"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"inline-tweet-js\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"gulpfile.js\",\n  \"devDependencies\": {\n    \"gulp\": \"^3.9.1\",\n    \"gulp-util\": \"^3.0.7\",\n    \"gulp-uglifyjs\": \"^0.6.2\"\n  },\n  \"scripts\": {\n    \"start\": \"gulp\"\n  },\n  \"author\": \"Ire Aderinokun\",\n  \"license\": \"ISC\"\n}\n"
  },
  {
    "path": "src/inline-tweet.js",
    "content": "var inlineTweets = document.querySelectorAll('*[data-inline-tweet]');\n\nif ( inlineTweets ) {\n\n\tvar twitterLogo = '<svg style=\"height: 0.7em;\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" version=\"1.1\" xmlns:cc=\"http://creativecommons.org/ns#\" viewBox=\"0 0 182.66667 150.66667\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\"><metadata id=\"metadata8\"><rdf:RDF><cc:Work rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/></cc:Work></rdf:RDF></metadata><defs id=\"defs6\"><clipPath id=\"clipPath20\" clipPathUnits=\"userSpaceOnUse\"><path id=\"path18\" d=\"m0 10.012h1366.9v1110.9h-1366.9z\"/></clipPath></defs><g id=\"g10\" transform=\"matrix(1.3333 0 0 -1.3333 0 150.67)\"><g id=\"g12\" transform=\"scale(.1)\"><g id=\"g14\"><g id=\"g16\" clip-path=\"url(#clipPath20)\"><path id=\"path22\" d=\"m1366.9 989.39c-50.27-22.309-104.33-37.387-161.05-44.18 57.89 34.723 102.34 89.679 123.28 155.15-54.18-32.15-114.18-55.47-178.09-68.04-51.13 54.49-124.02 88.55-204.68 88.55-154.89 0-280.43-125.55-280.43-280.43 0-21.988 2.457-43.398 7.258-63.91-233.08 11.68-439.72 123.36-578.04 293.01-24.141-41.4-37.969-89.567-37.969-140.97 0-97.308 49.489-183.13 124.76-233.44-45.969 1.437-89.218 14.058-127.03 35.078-0.043-1.18-0.043-2.348-0.043-3.52 0-135.9 96.68-249.22 224.96-275-23.512-6.41-48.281-9.8-73.86-9.8-18.089 0-35.628 1.711-52.781 5 35.711-111.41 139.26-192.5 262-194.77-96.058-75.23-216.96-120.04-348.36-120.04-22.621 0-44.961 1.332-66.918 3.91 124.16-79.568 271.55-125.98 429.94-125.98 515.82 0 797.86 427.31 797.86 797.93 0 12.153-0.28 24.223-0.79 36.25 54.77 39.571 102.31 88.95 139.93 145.2\" fill=\"#55ACEE\"/></g></g></g></g></svg>';\n\n\n\n\n\tfunction buildInlineTweet(inlineTweet) {\n\n\t\tvar tweetText = inlineTweet.innerHTML;\n\n\n\t\t// TWEET LINK VARIABLES\n\t\tvar tweetTextEncoded = \"%22\" + encodeURIComponent(tweetText) + \"%22\";\n\t\tvar pageURL = inlineTweet.dataset.inlineTweetUrl ? inlineTweet.dataset.inlineTweetUrl : window.location.href;\n\t\tvar tweetVia = inlineTweet.dataset.inlineTweetVia ? \"&via=\"+inlineTweet.dataset.inlineTweetVia : \"\";\n\t\tvar tweetHashtags = inlineTweet.dataset.inlineTweetTags ? \"&hashtags=\"+inlineTweet.dataset.inlineTweetTags : \"\";\n\t\tvar tweetLink = \"https://twitter.com/intent/tweet/?text=\"+tweetTextEncoded+\"&url=\"+pageURL+tweetVia+tweetHashtags;\n\n\n\t\t// SPAN ELEMENT\n\t\tvar tweetTextContainer = document.createElement('span');\n\t\ttweetTextContainer.innerHTML = tweetText;\n\n\n\t\t// ANCHOR ELEMENT\n\t\tvar link = document.createElement('a');\n\t\tlink.target = \"_blank\";\n\t\tlink.href = tweetLink;\n\t\tlink.appendChild(tweetTextContainer);\n\t\tlink.innerHTML += twitterLogo;\n\n\n\t\tinlineTweet.innerHTML = \"\";\n\t\tinlineTweet.appendChild(link);\n\n\t}\n\n\n\tfor ( var i = 0; i < inlineTweets.length; i++ ) {\n\t\tbuildInlineTweet(inlineTweets[i])\n\t}\n\n}\n\n\n\n\n"
  },
  {
    "path": "style.css",
    "content": "html, body, div, span, applet, object, iframe,\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\na, abbr, acronym, address, big, cite, code,\ndel, dfn, em, img, ins, kbd, q, s, samp,\nsmall, strike, strong, sub, sup, tt, var,\nb, u, i, center,\ndl, dt, dd, ol, ul, li,\nfieldset, form, label, legend,\ntable, caption, tbody, tfoot, thead, tr, th, td,\narticle, aside, canvas, details, embed,\nfigure, figcaption, footer, header, hgroup,\nmenu, nav, output, ruby, section, summary,\ntime, mark, audio, video {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tfont: inherit;\n\tfont-size: 100%;\n\tvertical-align: baseline;\n}\n\narticle, aside, details, figcaption, figure,\nfooter, header, hgroup, menu, nav, section {\n\tdisplay: block;\n}\nul {\n\tlist-style: none;\n}\nblockquote, q {\n\tquotes: none;\n}\nblockquote:before, blockquote:after,\nq:before, q:after {\n\tcontent: '';\n\tcontent: none;\n}\ntable {\n\tborder-collapse: collapse;\n\tborder-spacing: 0;\n}\n\n/* Box sizing */\n\nhtml {\n  box-sizing: border-box;\n}\n\n*, *:before, *:after {\n  box-sizing: inherit;\n}\n\n\n\n\n/* ---------------*/\n\n\n\nhtml {\n    font-size: 62.5%;\n}\nbody {\n    font-size: 1.6rem;\n    line-height: 1.4;\n    font-family: 'Source Sans Pro', sans-serif;\n    color: rgb(50, 50, 50);\n\n}\na {\n    color: inherit; \n}\n\nsmall {\n\tfont-size: 1rem;\n\tdisplay: block;\n\ttext-align: right;\n}\nstrong {\n\tfont-weight: 600;\n}\n\nh1 {\n\tfont-size: 4rem;\n\tmargin-bottom: 20px;\n\tfont-weight: 600;\n}\n\n\n\n\np.about {\n\tfont-size: 2rem;\n\tmargin-bottom: 20px;\n}\n\np {\n\tmargin-bottom: 15px;\n}\n\nh2 {\n\tfont-size: 2.5rem;\n\tfont-weight: 600;\n\tmargin-bottom: 20px;\n}\n\n\nh3 {\n\tfont-size: 2rem;\n\tfont-weight: 600;\n\tmargin-bottom: 20px;\n}\n\n.uo {\n\tcolor: rgb(180, 180, 180);\n}\n\n\n.ul {\n\tdisplay: block;\n\tmargin-bottom: 20px;\n\tmargin-left: 20px;\n\n}\n\n.ul li {\n\tlist-style-type: disc;\n\tlist-style-position: inside;\n}\n\n.container {\n\tmargin: 100px auto;\n\twidth: 90%;\n\tmax-width: 800px;\n}\n\n@media screen and (max-width: 600px) {\n\t.container {\n\t\tmargin: 50px auto;\n\t}\n}\n\n\n\nsection.site-section {\n\tmargin-bottom: 50px;\n\tpadding-bottom: 30px;\n\tborder-bottom: 1px solid rgb(220, 220, 220);\n}\nsection:not(.site-section) {\n\tmargin-bottom: 40px;\n}\n\n.highlight {\n\tmargin-bottom: 15px;\n}\n\npre {\n\tbackground-color: rgb(220, 220, 220);\n\tpadding: 10px;\n\tdisplay: block;\n\tfont-family: 'Source Code Pro', monospace;\n\tfont-size: 1.2rem;\n\tcolor: #000;\n\t\n\twhite-space: pre-line;\n\tword-wrap: break-word;\n\tposition: relative;\n}\n\ncode {\n\tbackground-color: rgb(220, 220, 220);\n\tfont-family: 'Source Code Pro', monospace;\n\tfont-size: 1.2rem;\n\tcolor: #000;\n\tpadding: 2px 5px;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* Twemoji Awesome - http://ellekasai.github.io/twemoji-awesome/ */\n .twa {\n  display: inline-block;\n  height: 1em;\n  width: 1em;\n  margin: 0 .05em 0 .1em;\n  vertical-align: -0.1em;\n  background-repeat: no-repeat;\n  background-position: center center;\n  background-size: 1em 1em; }\n\n.twa-heart {\n  background-image: url(\"https://twemoji.maxcdn.com/svg/2764.svg\"); \n}\n\n\n\n\n\n\n\n\n[data-inline-tweet] a {\n\ttext-decoration: none;\n\tcolor: #000;\n}\n[data-inline-tweet] a span {\n\tborder-bottom: 1px dotted rgb(0,172,237);\n\tfont-style: italic;\n\tmargin-right: 8px;\n}\n[data-inline-tweet] a:hover span {\n\tbackground-color: rgba(0,172,237, 0.1);\n\tcolor: rgb(0,172,237);\n}\n\n\n\n\n\n"
  }
]