Skip to content

Commit

Permalink
v8.0.0 πŸ’£ πŸš€ πŸŽ‰ Typescript
Browse files Browse the repository at this point in the history
[instangram] Migrate to typescript which has fixed many bugs.
  • Loading branch information
saschaheim committed May 26, 2021
1 parent f990fa8 commit fcfa560
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/de-de/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/en-us/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/pt-br/index.html

Large diffs are not rendered by default.

26 changes: 11 additions & 15 deletions scripts/bookmarkletify.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const fs = require('fs');
const pkg = require('../package.json')
const browserify = require('browserify');
const bookmarkletify = require('bookmarkletify');
const process = require('process');
const signale = require('signale');
var bookmarkletify = require('bookmarkletify');
var fs = require('fs');
const process = require('process');
const pkg = require('../package.json')

signale.pending('Bookmarklet generating...');

var instantgram = fs.readFileSync('./dist/main.js', 'utf8');
var bookmarkletString = bookmarkletify(instantgram);

function hash() {
if (process.argv[2] && process.argv[2] === '--dev') {
return ' ' + Math.random().toString(36).substring(5, 15);
Expand All @@ -15,17 +17,11 @@ function hash() {
return ' ' + pkg.version;
}

// Fix es6 generation
var b = browserify({ basedir: './', standalone: 'instantgram' }).transform('babelify').add('./dist/main.js').bundle((err, buf) => {
if (err) {
return console.log(err);
}

let script = buf.toString();
let output = bookmarkletify(script);
function button(bookmarklet) {
return '<a href="' + bookmarklet + '" class="btn" style="cursor: move;">[instantgram' + hash() + ']</a>';
}

fs.writeFileSync('./src/_langs/partials/button.html', '<a href="' + output + '" class="btn" style="cursor: move;">[instantgram' + hash() + ']</a>');
});
fs.writeFileSync('./src/_langs/partials/button.html', button(bookmarkletString));

signale.success('Bookmarklet generated');

Expand Down
2 changes: 1 addition & 1 deletion src/_langs/partials/button.html

Large diffs are not rendered by default.

0 comments on commit fcfa560

Please sign in to comment.