Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ES6 all the things ! * ESLint checks everything * CSS fixes (use stylelint) * Fix #2231
- Loading branch information
Showing
23 changed files
with
445 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": "airbnb", | ||
"installedESLint": true, | ||
"parser": "babel-eslint" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "stylelint-config-standard" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
|
||
top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>" | ||
top['bookmarklet-url@wallabag.org'] = | ||
'<!DOCTYPE html><html><head><title>bag it!</title>' + | ||
'<link rel="icon" href="tpl/img/favicon.ico" />' + | ||
'</head><body><script>window.onload=function(){window.setTimeout' + | ||
'(function(){history.back();},250);};</script></body></html>'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const $ = require('jquery'); | ||
|
||
function supportsLocalStorage() { | ||
try { | ||
return 'localStorage' in window && window.localStorage !== null; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
function savePercent(id, percent) { | ||
if (!supportsLocalStorage()) { return false; } | ||
localStorage[`wallabag.article.${id}.percent`] = percent; | ||
return true; | ||
} | ||
|
||
function retrievePercent(id) { | ||
if (!supportsLocalStorage()) { return false; } | ||
|
||
const bheight = $(document).height(); | ||
const percent = localStorage[`wallabag.article.${id}.percent`]; | ||
const scroll = bheight * percent; | ||
|
||
$('html,body').animate({ scrollTop: scroll }, 'fast'); | ||
|
||
return true; | ||
} | ||
|
||
function initFilters() { | ||
// no display if filters not available | ||
if ($('div').is('#filters')) { | ||
$('#button_filters').show(); | ||
$('.button-collapse-right').sideNav({ edge: 'right' }); | ||
$('#clear_form_filters').on('click', () => { | ||
$('#filters input').val(''); | ||
$('#filters :checked').removeAttr('checked'); | ||
return false; | ||
}); | ||
} | ||
} | ||
|
||
function initExport() { | ||
// no display if export not available | ||
if ($('div').is('#export')) { | ||
$('#button_export').show(); | ||
$('.button-collapse-right').sideNav({ edge: 'right' }); | ||
} | ||
} | ||
|
||
export { savePercent, retrievePercent, initFilters, initExport }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,8 @@ | ||
var $ = global.jquery = require('jquery'); | ||
function split(val) { | ||
return val.split(/,\s*/); | ||
} | ||
function extractLast(term) { | ||
return split(term).pop(); | ||
} | ||
|
||
jQuery(function ($) { | ||
function split(val) { | ||
return val.split(/,\s*/); | ||
} | ||
function extractLast(term) { | ||
return split(term).pop(); | ||
} | ||
|
||
|
||
$('#value').bind('keydown', function (event) { | ||
if (event.keyCode === $.ui.keyCode.TAB && $(this).data('ui-autocomplete').menu.active) { | ||
event.preventDefault(); | ||
} | ||
}).autocomplete({ | ||
source: function (request, response) { | ||
$.getJSON('./?view=tags', { | ||
term: extractLast(request.term), | ||
//id: $(':hidden#entry_id').val() | ||
}, response); | ||
}, | ||
search: function () { | ||
// custom minLength | ||
var term = extractLast(this.value); | ||
if (term.length < 1) { | ||
return false; | ||
} | ||
}, | ||
focus: function () { | ||
// prevent value inserted on focus | ||
return false; | ||
}, | ||
select: function (event, ui) { | ||
var terms = split(this.value); | ||
// remove the current input | ||
terms.pop(); | ||
// add the selected item | ||
terms.push(ui.item.value); | ||
// add placeholder to get the comma-and-space at the end | ||
terms.push(''); | ||
this.value = terms.join(', '); | ||
return false; | ||
}, | ||
}); | ||
}); | ||
export { split, extractLast }; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.