--- /dev/null
+{
+ "extends": "airbnb",
+ "installedESLint": true,
+}
material: {
options: {
map: {
- inline: false
+ inline: false,
},
processors: [
require('pixrem')(),
- require('autoprefixer')({browsers: 'last 2 versions'}),
- require('cssnano')()
- ]
+ require('autoprefixer')({ browsers: 'last 2 versions' }),
+ require('cssnano')(),
+ ],
},
src: '<%= buildDir %>/material.css',
- dest: '<%= buildDir %>/themes/material/css/style.min.css'
+ dest: '<%= buildDir %>/themes/material/css/style.min.css',
},
baggy: {
options: {
map: {
- inline: false
+ inline: false,
},
processors: [
require('pixrem')(),
- require('autoprefixer')({browsers: 'last 2 versions'}),
- require('cssnano')()
- ]
+ require('autoprefixer')({ browsers: 'last 2 versions' }),
+ require('cssnano')(),
+ ],
},
src: '<%= buildDir %>/baggy.css',
- dest: '<%= buildDir %>/themes/baggy/css/style.min.css'
- }
+ dest: '<%= buildDir %>/themes/baggy/css/style.min.css',
+ },
},
concat: {
options: {
- separator: ';'
+ separator: ';',
},
jsMaterial: {
src: [
- 'node_modules/jquery/dist/jquery.js',
- 'node_modules/jquery-ui/jquery-ui.js',
- 'node_modules/materialize-css/bin/materialize.js',
+ '<%= appDir %>/themes/material/js/init.js',
'<%= appDir %>/themes/_global/js/restoreScroll.js',
- '<%= appDir %>/themes/material/js/init.js'
],
- dest: '<%= buildDir %>/material.js'
+ dest: '<%= buildDir %>/material.js',
},
jsBaggy: {
src: [
- 'node_modules/jquery/dist/jquery.js',
- 'node_modules/jquery-ui/jquery-ui.js',
'<%= appDir %>/themes/baggy/js/init.js',
'<%= appDir %>/themes/_global/js/restoreScroll.js',
'<%= appDir %>/themes/baggy/js/autoClose.js',
'<%= appDir %>/themes/baggy/js/autoCompleteTags.js',
'<%= appDir %>/themes/baggy/js/closeMessage.js',
'<%= appDir %>/themes/baggy/js/popupForm.js',
- '<%= appDir %>/themes/baggy/js/saveLink.js'
+ // Save link is no more used for now
+ // '<%= appDir %>/themes/baggy/js/saveLink.js',
],
- dest: '<%= buildDir %>/baggy.js'
+ dest: '<%= buildDir %>/baggy.js',
},
cssMaterial: {
src: [
'node_modules/materialize-css/bin/materialize.css',
- '<%= appDir %>/themes/material/css/*.css'
+ '<%= appDir %>/themes/material/css/*.css',
],
- dest: '<%= buildDir %>/material.css'
+ dest: '<%= buildDir %>/material.css',
},
cssBaggy: {
src: [
- '<%= appDir %>/themes/baggy/css/*.css'
+ '<%= appDir %>/themes/baggy/css/*.css',
],
- dest: '<%= buildDir %>/baggy.css'
- }
+ dest: '<%= buildDir %>/baggy.css',
+ },
},
browserify: {
'<%= buildDir %>/material.browser.js': ['<%= buildDir %>/material.js'],
- '<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js']
+ '<%= buildDir %>/baggy.browser.js': ['<%= buildDir %>/baggy.js'],
},
uglify: {
material: {
files: {
'<%= buildDir %>/themes/material/js/material.min.js':
- ['<%= buildDir %>/material.browser.js']
+ ['<%= buildDir %>/material.browser.js'],
},
options: {
sourceMap: true,
baggy: {
files: {
'<%= buildDir %>/themes/baggy/js/baggy.min.js':
- ['<%= buildDir %>/baggy.browser.js']
+ ['<%= buildDir %>/baggy.browser.js'],
},
options: {
sourceMap: true,
expand: true,
cwd: 'node_modules/pickadate/lib',
src: 'picker.js',
- dest: '<%= buildDir %>'
+ dest: '<%= buildDir %>',
},
annotator: {
expand: true,
cwd: 'node_modules/annotator/pkg',
src: 'annotator.min.js',
- dest: '<%= buildDir %>/themes/_global/js/'
- }
+ dest: '<%= buildDir %>/themes/_global/js/',
+ },
},
symlink: {
baggyfonts: {
{
expand: true,
overwrite: true,
- cwd: "<%= appDir %>/lib/icomoon-bower/",
- src: "fonts",
- dest: "<%= buildDir %>/themes/baggy/"
+ cwd: '<%= appDir %>/lib/icomoon-bower/',
+ src: 'fonts',
+ dest: '<%= buildDir %>/themes/baggy/',
},
{
expand: true,
overwrite: true,
- cwd: "<%= appDir %>/lib/bower-pt-sans/fonts",
- src: "*",
- dest: "<%= buildDir %>/themes/baggy/fonts/"
- }
- ]
+ cwd: '<%= appDir %>/lib/bower-pt-sans/fonts',
+ src: '*',
+ dest: '<%= buildDir %>/themes/baggy/fonts/',
+ },
+ ],
},
materialfonts: {
files: [
{
expand: true,
overwrite: true,
- cwd: "<%= appDir %>/lib/icomoon-bower/",
- src: "fonts",
- dest: "<%= buildDir %>/themes/material/"
+ cwd: '<%= appDir %>/lib/icomoon-bower/',
+ src: 'fonts',
+ dest: '<%= buildDir %>/themes/material/',
},
{
expand: true,
overwrite: true,
- cwd: "node_modules/materialize-css/",
- src: "font",
- dest: "<%= buildDir %>/themes/material"
+ cwd: 'node_modules/materialize-css/',
+ src: 'font',
+ dest: '<%= buildDir %>/themes/material',
},
{
expand: true,
overwrite: true,
- cwd: "<%= appDir %>/lib/roboto-fontface/fonts/",
- src: "*",
- dest: "<%= buildDir %>/themes/material/fonts/roboto/"
+ cwd: '<%= appDir %>/lib/roboto-fontface/fonts/',
+ src: '*',
+ dest: '<%= buildDir %>/themes/material/fonts/roboto/',
},
{
expand: true,
overwrite: true,
- cwd: "<%= appDir %>/lib/material-design-icons/iconfont/",
- src: "*",
- dest: "<%= buildDir %>/themes/material/fonts/"
- }
- ]
+ cwd: '<%= appDir %>/lib/material-design-icons/iconfont/',
+ src: '*',
+ dest: '<%= buildDir %>/themes/material/fonts/',
+ },
+ ],
},
pics: {
files: [
overwrite: true,
cwd: '<%= appDir %>/themes/_global/',
src: 'img',
- dest: '<%= buildDir %>/themes/_global/'
- }
- ]
- }
+ dest: '<%= buildDir %>/themes/_global/',
+ },
+ ],
+ },
},
clean: {
css: {
- src: [ '<%= buildDir %>/**/*.css' ]
+ src: ['<%= buildDir %>/**/*.css'],
},
js: {
- src: ['<%= buildDir %>/**/*.js', '<%= buildDir %>/**/*.map']
+ src: ['<%= buildDir %>/**/*.js', '<%= buildDir %>/**/*.map'],
},
all: {
- src: ['./<%= buildDir %>']
- }
- }
+ src: ['./<%= buildDir %>'],
+ },
+ },
});
grunt.registerTask(
'Compiles the stylesheets.',
['clean:css', 'concat:cssMaterial', 'concat:cssBaggy', 'postcss']
);
-}
+};
function supportsLocalStorage() {
- try {
- return 'localStorage' in window && window['localStorage'] !== null;
- } catch (e) {
- return false;
- }
+ 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;
+ if (!supportsLocalStorage()) { return false; }
+ localStorage['wallabag.article.' + id + '.percent'] = percent;
+ return true;
}
function retrievePercent(id) {
- if (!supportsLocalStorage()) { return false; }
+ if (!supportsLocalStorage()) { return false; }
- var bheight = $(document).height();
- var percent = localStorage["wallabag.article." + id + ".percent"];
- var scroll = bheight * percent;
+ var bheight = $(document).height();
+ var percent = localStorage['wallabag.article.' + id + '.percent'];
+ var scroll = bheight * percent;
- $('html,body').animate({scrollTop: scroll}, 'fast');
+ $('html,body').animate({ scrollTop: scroll }, 'fast');
- return true;
+ return true;
}
-$(document).ready(function() {
- current_url = window.location.href
- if (current_url.match("&closewin=true")) {
- window.close();
- }
+var $ = global.jquery = require('jquery');
+
+$(document).ready(function () {
+ var currentUrl = window.location.href;
+ if (currentUrl.match('&closewin=true')) {
+ window.close();
+ }
});
-jQuery(function($) {
+var $ = global.jquery = require('jquery');
- function split( val ) {
- return val.split( /,\s*/ );
+jQuery(function ($) {
+ function split(val) {
+ return val.split(/,\s*/);
}
- function extractLast( term ) {
- return split( term ).pop();
+ function extractLast(term) {
+ return split(term).pop();
}
- $("#value").bind("keydown", function(event) {
- if (event.keyCode === $.ui.keyCode.TAB && $(this).data("ui-autocomplete").menu.active) {
+ $('#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),
+ source: function (request, response) {
+ $.getJSON('./?view=tags', {
+ term: extractLast(request.term),
//id: $(':hidden#entry_id').val()
}, response);
},
- search : function() {
+ search: function () {
// custom minLength
var term = extractLast(this.value);
if (term.length < 1) {
return false;
}
},
- focus : function() {
+ focus: function () {
// prevent value inserted on focus
return false;
},
- select : function(event, ui) {
+ 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(", ");
+ terms.push('');
+ this.value = terms.join(', ');
return false;
- }
+ },
});
-
-
});
-$(function(){
- //---------------------------------------------------------------------------
- // Show the close icon when the user hover over a message
- //---------------------------------------------------------------------------
- // $('.messages').on('mouseenter', function(){
- // $(this).find('a.closeMessage').stop(true, true).show();
- // }).on('mouseleave', function(){
- // $(this).find('a.closeMessage').stop(true, true).hide();
- // });
- //---------------------------------------------------------------------------
- // Close the message box when the user clicks the close icon
- //---------------------------------------------------------------------------
- $('a.closeMessage').on('click', function(){
- $(this).parents('div.messages').slideUp(300, function(){ $(this).remove(); });
- return false;
- });
-});
\ No newline at end of file
+var $ = global.jquery = require('jquery');
+
+$(function () {
+ //---------------------------------------------------------------------------
+ // Show the close icon when the user hover over a message
+ //---------------------------------------------------------------------------
+ // $('.messages').on('mouseenter', function(){
+ // $(this).find('a.closeMessage').stop(true, true).show();
+ // }).on('mouseleave', function(){
+ // $(this).find('a.closeMessage').stop(true, true).hide();
+ // });
+ //---------------------------------------------------------------------------
+ // Close the message box when the user clicks the close icon
+ //---------------------------------------------------------------------------
+ $('a.closeMessage').on('click', function () {
+ $(this).parents('div.messages').slideUp(300, function () { $(this).remove(); });
+ return false;
+ });
+});
var annotator = require('annotator');
-$.fn.ready(function() {
-
- var $listmode = $('#listmode'),
- $listentries = $("#list-entries");
+$.fn.ready(function () {
+ var $listmode = $('#listmode');
+ var $listentries = $('#list-entries');
/* ==========================================================================
Menu
========================================================================== */
- $("#menu").click(function(){
- $("#links").toggleClass('menu--open');
+ $('#menu').click(function () {
+ $('#links').toggleClass('menu--open');
if ($('#content').hasClass('opacity03')) {
- $('#content').removeClass('opacity03');
+ $('#content').removeClass('opacity03');
}
});
List mode or Table Mode
========================================================================== */
- $listmode.click(function(){
- if ( jquery.cookie("listmode") == 1 ) {
+ $listmode.click(function () {
+ if (jquery.cookie('listmode') === 1) {
// Cookie
- $.removeCookie("listmode");
+ $.removeCookie('listmode');
- $listentries.removeClass("listmode");
- $listmode.removeClass("tablemode");
- $listmode.addClass("listmode");
- }
- else {
+ $listentries.removeClass('listmode');
+ $listmode.removeClass('tablemode');
+ $listmode.addClass('listmode');
+ } else {
// Cookie
- jquery.cookie("listmode", 1, {expires: 365});
+ jquery.cookie('listmode', 1, { expires: 365 });
- $listentries.addClass("listmode");
- $listmode.removeClass("listmode");
- $listmode.addClass("tablemode");
+ $listentries.addClass('listmode');
+ $listmode.removeClass('listmode');
+ $listmode.addClass('tablemode');
}
-
});
/* ==========================================================================
Cookie listmode
========================================================================== */
- if ( jquery.cookie("listmode") == 1 ) {
- $listentries.addClass("listmode");
- $listmode.removeClass("listmode");
- $listmode.addClass("tablemode");
+ if (jquery.cookie('listmode') === 1) {
+ $listentries.addClass('listmode');
+ $listmode.removeClass('listmode');
+ $listmode.addClass('tablemode');
}
/* ==========================================================================
========================================================================== */
- $('#nav-btn-add-tag').on('click', function(){
- $(".nav-panel-add-tag").toggle(100);
- $(".nav-panel-menu").addClass('hidden');
- $("#tag_label").focus();
- return false;
- });
+ $('#nav-btn-add-tag').on('click', function () {
+ $('.nav-panel-add-tag').toggle(100);
+ $('.nav-panel-menu').addClass('hidden');
+ $('#tag_label').focus();
+ return false;
+ });
/* ==========================================================================
Annotations & Remember position
========================================================================== */
- if ($("article").length) {
- var app = new annotator.App();
+ if ($('article').length) {
+ var app = new annotator.App();
- app.include(annotator.ui.main, {
- element: document.querySelector('article')
- });
+ app.include(annotator.ui.main, {
+ element: document.querySelector('article'),
+ });
- var x = JSON.parse($('#annotationroutes').html());
- app.include(annotator.storage.http, x);
+ var x = JSON.parse($('#annotationroutes').html());
+ app.include(annotator.storage.http, x);
- app.start().then(function () {
- app.annotations.load({entry: x.entryId});
- });
+ app.start().then(function () {
+ app.annotations.load({ entry: x.entryId });
+ });
- $(window).scroll(function(e){
- var scrollTop = $(window).scrollTop();
- var docHeight = $(document).height();
- var scrollPercent = (scrollTop) / (docHeight);
- var scrollPercentRounded = Math.round(scrollPercent*100)/100;
- savePercent(x.entryId, scrollPercentRounded);
- });
+ $(window).scroll(function (e) {
+ var scrollTop = $(window).scrollTop();
+ var docHeight = $(document).height();
+ var scrollPercent = (scrollTop) / (docHeight);
+ var scrollPercentRounded = Math.round(scrollPercent * 100) / 100;
+ savePercent(x.entryId, scrollPercentRounded);
+ });
- retrievePercent(x.entryId);
+ retrievePercent(x.entryId);
- $(window).resize(function(){
- retrievePercent(x.entryId);
- });
+ $(window).resize(function () {
+ retrievePercent(x.entryId);
+ });
}
});
-$(document).ready(function() {
+var $ = global.jquery = require('jquery');
- $("#search-form").hide();
- $("#bagit-form").hide();
- $("#filter-form").hide();
- $("#download-form").hide();
+$(document).ready(function () {
+ $('#search-form').hide();
+ $('#bagit-form').hide();
+ $('#filter-form').hide();
+ $('#download-form').hide();
- //---------------------------------------------------------------------------
- // Toggle the "Search" popup in the sidebar
- //---------------------------------------------------------------------------
- function toggleSearch() {
- $("#search-form").toggle();
- $("#search").toggleClass("current");
- $("#search").toggleClass("active-current");
- $("#search-arrow").toggleClass("arrow-down");
- if ($("#search").hasClass("current")) {
- $("#content").addClass("opacity03");
- } else {
- $("#content").removeClass("opacity03");
- }
+ //---------------------------------------------------------------------------
+ // Toggle the 'Search' popup in the sidebar
+ //---------------------------------------------------------------------------
+ function toggleSearch() {
+ $('#search-form').toggle();
+ $('#search').toggleClass('current');
+ $('#search').toggleClass('active-current');
+ $('#search-arrow').toggleClass('arrow-down');
+ if ($('#search').hasClass('current')) {
+ $('#content').addClass('opacity03');
+ } else {
+ $('#content').removeClass('opacity03');
}
+ }
- //---------------------------------------------------------------------------
- // Toggle the "Filter" popup on entries list
- //---------------------------------------------------------------------------
- function toggleFilter() {
- $("#filter-form").toggle();
- }
+ //---------------------------------------------------------------------------
+ // Toggle the 'Filter' popup on entries list
+ //---------------------------------------------------------------------------
+ function toggleFilter() {
+ $('#filter-form').toggle();
+ }
- //---------------------------------------------------------------------------
- // Toggle the "Download" popup on entries list
- //---------------------------------------------------------------------------
- function toggleDownload() {
- $("#download-form").toggle();
- }
+ //---------------------------------------------------------------------------
+ // Toggle the 'Download' popup on entries list
+ //---------------------------------------------------------------------------
+ function toggleDownload() {
+ $('#download-form').toggle();
+ }
- //---------------------------------------------------------------------------
- // Toggle the "Save a Link" popup in the sidebar
- //---------------------------------------------------------------------------
- function toggleBagit() {
- $("#bagit-form").toggle();
- $("#bagit").toggleClass("current");
- $("#bagit").toggleClass("active-current");
- $("#bagit-arrow").toggleClass("arrow-down");
- if ($("#bagit").hasClass("current")) {
- $("#content").addClass("opacity03");
- } else {
- $("#content").removeClass("opacity03");
- }
+ //---------------------------------------------------------------------------
+ // Toggle the 'Save a Link' popup in the sidebar
+ //---------------------------------------------------------------------------
+ function toggleBagit() {
+ $('#bagit-form').toggle();
+ $('#bagit').toggleClass('current');
+ $('#bagit').toggleClass('active-current');
+ $('#bagit-arrow').toggleClass('arrow-down');
+ if ($('#bagit').hasClass('current')) {
+ $('#content').addClass('opacity03');
+ } else {
+ $('#content').removeClass('opacity03');
}
+ }
- //---------------------------------------------------------------------------
- // Close all #links popups in the sidebar
- //---------------------------------------------------------------------------
- function closePopups() {
- $("#links .messages").hide();
- $("#links > li > a").removeClass("active-current");
- $("#links > li > a").removeClass("current");
- $("[id$=-arrow]").removeClass("arrow-down");
- $("#content").removeClass("opacity03");
- }
+ //---------------------------------------------------------------------------
+ // Close all #links popups in the sidebar
+ //---------------------------------------------------------------------------
+ function closePopups() {
+ $('#links .messages').hide();
+ $('#links > li > a').removeClass('active-current');
+ $('#links > li > a').removeClass('current');
+ $('[id$=-arrow]').removeClass('arrow-down');
+ $('#content').removeClass('opacity03');
+ }
- $("#search").click(function(){
- closePopups();
- toggleSearch();
- $("#searchfield").focus();
- });
+ $('#search').click(function () {
+ closePopups();
+ toggleSearch();
+ $('#searchfield').focus();
+ });
- $(".filter-btn").click(function(){
- closePopups();
- toggleFilter();
- });
+ $('.filter-btn').click(function () {
+ closePopups();
+ toggleFilter();
+ });
- $(".download-btn").click(function(){
- closePopups();
- toggleDownload();
- });
+ $('.download-btn').click(function () {
+ closePopups();
+ toggleDownload();
+ });
- $("#bagit").click(function(){
- closePopups();
- toggleBagit();
- $("#plainurl").focus();
- });
+ $('#bagit').click(function () {
+ closePopups();
+ toggleBagit();
+ $('#plainurl').focus();
+ });
- $("#search-form-close").click(function(){
- toggleSearch();
- });
+ $('#search-form-close').click(function () {
+ toggleSearch();
+ });
- $("#filter-form-close").click(function(){
- toggleFilter();
- });
+ $('#filter-form-close').click(function () {
+ toggleFilter();
+ });
- $("#download-form-close").click(function(){
- toggleDownload();
- });
+ $('#download-form-close').click(function () {
+ toggleDownload();
+ });
- $("#bagit-form-close").click(function(){
- toggleBagit();
- });
+ $('#bagit-form-close').click(function () {
+ toggleBagit();
+ });
});
-$.fn.ready(function() {
+var $ = global.jquery = require('jquery');
- var $bagit = $('#bagit'),
- $bagitForm = $('#bagit-form'),
- $bagitFormForm = $('#bagit-form-form');
+$.fn.ready(function () {
+ var $bagit = $('#bagit');
+ var $bagitForm = $('#bagit-form');
+ var $bagitFormForm = $('#bagit-form-form');
/* ==========================================================================
bag it link and close button
========================================================================== */
function toggleSaveLinkForm(url, event) {
- $("#add-link-result").empty();
+ $('#add-link-result').empty();
- $bagit.toggleClass("active-current");
+ $bagit.toggleClass('active-current');
- //only if bag-it link is not presented on page
- if ( $bagit.length === 0 ) {
- if ( event !== 'undefined' && event ) {
- $bagitForm.css( {position:"absolute", top:event.pageY, left:event.pageX-200});
- }
- else {
- $bagitForm.css( {position:"relative", top:"auto", left:"auto"});
+ // only if bag-it link is not presented on page
+ if ($bagit.length === 0) {
+ if (event !== 'undefined' && event) {
+ $bagitForm.css({ position: 'absolute', top: event.pageY, left: event.pageX - 200 });
+ } else {
+ $bagitForm.css({ position: 'relative', top: 'auto', left: 'auto' });
}
}
- if ($("#search-form").length != 0) {
- $("#search").removeClass("current");
- $("#search-arrow").removeClass("arrow-down");
- $("#search-form").hide();
+ if ($('#search-form').length !== 0) {
+ $('#search').removeClass('current');
+ $('#search-arrow').removeClass('arrow-down');
+ $('#search-form').hide();
}
$bagitForm.toggle();
- $('#content').toggleClass("opacity03");
+ $('#content').toggleClass('opacity03');
if (url !== 'undefined' && url) {
$('#plainurl').val(url);
}
$('#plainurl').focus();
}
- //send "bag it link" form request via ajax
- $bagitFormForm.submit( function(event) {
- $("body").css("cursor", "wait");
- $("#add-link-result").empty();
+ // send 'bag it link' form request via ajax
+ $bagitFormForm.submit(function (event) {
+ $('body').css('cursor', 'wait');
+ $('#add-link-result').empty();
$.ajax({
type: $bagitFormForm.attr('method'),
url: $bagitFormForm.attr('action'),
data: $bagitFormForm.serialize(),
- success: function(data) {
- $('#add-link-result').html("Done!");
+ success: function (data) {
+ $('#add-link-result').html('Done!');
$('#plainurl').val('');
$('#plainurl').blur('');
- $("body").css("cursor", "auto");
+ $('body').css('cursor', 'auto');
+ },
+ error: function (data) {
+ $('#add-link-result').html('Failed!');
+ $('body').css('cursor', 'auto');
},
- error: function(data) {
- $('#add-link-result').html("Failed!");
- $("body").css("cursor", "auto");
- }
});
event.preventDefault();
Process all links inside an article
========================================================================== */
- $("article a[href^='http']").after(function() {
- return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\"></a> ";
+ $('article a[href^="http"]').after(function () {
+ return ' <a href="' + $(this).attr('href') + '" class="add-to-wallabag-link-after" alt="add to wallabag" title="add to wallabag"></a> ';
});
- $(".add-to-wallabag-link-after").click(function(event){
+ $('.add-to-wallabag-link-after').click(function (event) {
toggleSaveLinkForm($(this).attr('href'), event);
event.preventDefault();
});
-
});
-
-
-var $ = require("jquery"),
-materialize = require("materialize");
+var $ = require('jquery');
+require('materialize');
var annotator = require('annotator');
-function init_filters() {
- // no display if filters not aviable
- if ($("div").is("#filters")) {
- $('#button_filters').show();
- $('.button-collapse-right').sideNav({ edge: 'right' });
- $('#clear_form_filters').on('click', function(){
- $('#filters input').val('');
- $('#filters :checked').removeAttr('checked');
- return false;
- });
- }
+function initFilters() {
+ // no display if filters not aviable
+ if ($('div').is('#filters')) {
+ $('#button_filters').show();
+ $('.button-collapse-right').sideNav({ edge: 'right' });
+ $('#clear_form_filters').on('click', function () {
+ $('#filters input').val('');
+ $('#filters :checked').removeAttr('checked');
+ return false;
+ });
+ }
}
-function init_export() {
- // no display if export not aviable
- if ($("div").is("#export")) {
- $('#button_export').show();
- $('.button-collapse-right').sideNav({ edge: 'right' });
- }
+function initExport() {
+ // no display if export not aviable
+ if ($('div').is('#export')) {
+ $('#button_export').show();
+ $('.button-collapse-right').sideNav({ edge: 'right' });
+ }
}
-$(document).ready(function(){
- // sideNav
- $('.button-collapse').sideNav();
- $('select').material_select();
- $('.collapsible').collapsible({
- accordion : false
- });
- $('.datepicker').pickadate({
- selectMonths: true,
- selectYears: 15,
- formatSubmit: 'dd/mm/yyyy',
- hiddenName: true,
- format: 'dd/mm/yyyy',
- });
- init_filters();
- init_export();
+$(document).ready(function () {
+ // sideNav
+ $('.button-collapse').sideNav();
+ $('select').material_select();
+ $('.collapsible').collapsible({
+ accordion: false,
+ });
+ $('.datepicker').pickadate({
+ selectMonths: true,
+ selectYears: 15,
+ formatSubmit: 'dd/mm/yyyy',
+ hiddenName: true,
+ format: 'dd/mm/yyyy',
+ });
+ initFilters();
+ initExport();
- $('#nav-btn-add-tag').on('click', function(){
- $(".nav-panel-add-tag").toggle(100);
- $(".nav-panel-menu").addClass('hidden');
- $("#tag_label").focus();
- return false;
- });
- $('#nav-btn-add').on('click', function(){
- $(".nav-panel-buttom").hide(100);
- $(".nav-panel-add").show(100);
- $(".nav-panels .action").hide(100);
- $(".nav-panel-menu").addClass('hidden');
- $(".nav-panels").css('background', 'white');
- $("#entry_url").focus();
- return false;
- });
- $('#nav-btn-search').on('click', function(){
- $(".nav-panel-buttom").hide(100);
- $(".nav-panel-search").show(100);
- $(".nav-panels .action").hide(100);
- $(".nav-panel-menu").addClass('hidden');
- $(".nav-panels").css('background', 'white');
- $("#searchfield").focus();
- return false;
- });
- $('.close').on('click', function(){
- $(".nav-panel-add").hide(100);
- $(".nav-panel-search").hide(100);
- $(".nav-panel-buttom").show(100);
- $(".nav-panels .action").show(100);
- $(".nav-panel-menu").removeClass('hidden');
- $(".nav-panels").css('background', 'transparent');
- return false;
- });
- $(window).scroll(function () {
- var s = $(window).scrollTop(),
- d = $(document).height(),
- c = $(window).height();
- var scrollPercent = (s / (d-c)) * 100;
- $(".progress .determinate").css('width', scrollPercent+'%');
- });
+ $('#nav-btn-add-tag').on('click', function () {
+ $('.nav-panel-add-tag').toggle(100);
+ $('.nav-panel-menu').addClass('hidden');
+ $('#tag_label').focus();
+ return false;
+ });
+ $('#nav-btn-add').on('click', function () {
+ $('.nav-panel-buttom').hide(100);
+ $('.nav-panel-add').show(100);
+ $('.nav-panels .action').hide(100);
+ $('.nav-panel-menu').addClass('hidden');
+ $('.nav-panels').css('background', 'white');
+ $('#entry_url').focus();
+ return false;
+ });
+ $('#nav-btn-search').on('click', function () {
+ $('.nav-panel-buttom').hide(100);
+ $('.nav-panel-search').show(100);
+ $('.nav-panels .action').hide(100);
+ $('.nav-panel-menu').addClass('hidden');
+ $('.nav-panels').css('background', 'white');
+ $('#searchfield').focus();
+ return false;
+ });
+ $('.close').on('click', function () {
+ $('.nav-panel-add').hide(100);
+ $('.nav-panel-search').hide(100);
+ $('.nav-panel-buttom').show(100);
+ $('.nav-panels .action').show(100);
+ $('.nav-panel-menu').removeClass('hidden');
+ $('.nav-panels').css('background', 'transparent');
+ return false;
+ });
+ $(window).scroll(function () {
+ var s = $(window).scrollTop();
+ var d = $(document).height();
+ var c = $(window).height();
+ var scrollPercent = (s / (d - c)) * 100;
+ $('.progress .determinate').css('width', scrollPercent + '%');
+ });
+
+/* ==========================================================================
+ Annotations & Remember position
+ ========================================================================== */
- /* ==========================================================================
- Annotations & Remember position
- ========================================================================== */
+ if ($('article').length) {
+ var app = new annotator.App();
+ var x = JSON.parse($('#annotationroutes').html());
- if ($("article").length) {
- var app = new annotator.App();
- app.include(annotator.ui.main, {
- element: document.querySelector('article')
- });
+ app.include(annotator.ui.main, {
+ element: document.querySelector('article'),
+ });
- var x = JSON.parse($('#annotationroutes').html());
- app.include(annotator.storage.http, x);
+ app.include(annotator.storage.http, x);
- app.start().then(function () {
- app.annotations.load({entry: x.entryId});
- });
+ app.start().then(function () {
+ app.annotations.load({ entry: x.entryId });
+ });
- $(window).scroll(function(e){
- var scrollTop = $(window).scrollTop();
- var docHeight = $(document).height();
- var scrollPercent = (scrollTop) / (docHeight);
- var scrollPercentRounded = Math.round(scrollPercent*100)/100;
- savePercent(x.entryId, scrollPercentRounded);
- });
+ $(window).scroll(function (e) {
+ var scrollTop = $(window).scrollTop();
+ var docHeight = $(document).height();
+ var scrollPercent = (scrollTop) / (docHeight);
+ var scrollPercentRounded = Math.round(scrollPercent * 100) / 100;
+ savePercent(x.entryId, scrollPercentRounded);
+ });
- retrievePercent(x.entryId);
+ retrievePercent(x.entryId);
- $(window).resize(function(){
- retrievePercent(x.entryId);
- });
- }
+ $(window).resize(function () {
+ retrievePercent(x.entryId);
+ });
+ }
});
{
"name": "wallabag",
- "version": "2.0.0",
+ "version": "2.1.0",
"description": "wallabag is a self hostable application for saving web pages",
"main": "index.js",
"private": true,
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
- "grunt-contrib-cssmin": "^1.0.0",
"grunt-contrib-symlink": "^1.0.0",
"grunt-contrib-uglify": "^1.0.0",
"grunt-postcss": "^0.8.0",
- "grunt-shell": "^1.2.1",
"hammerjs": "^2.0.6",
"jquery": "^2.2.1",
"jquery-ui": "^1.10.5",
"license": "MIT",
"bugs": {
"url": "https://github.com/wallabag/wallabag/issues"
+ },
+ "devDependencies": {
+ "eslint": "^2.11.1",
+ "eslint-config-airbnb": "^9.0.1",
}
}