From 733cc709670cefda1f38e4661264a3e663e1aa62 Mon Sep 17 00:00:00 2001 From: rugk Date: Tue, 22 May 2018 10:19:53 +0200 Subject: [PATCH] Improve code style of function names Thx https://github.com/PrivateBin/PrivateBin/commit/429d43dc78ad5b722d547a4082bc106f702f5d1d#r29068381 --- js/privatebin.js | 33 ++++++++++++++++----------------- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index d72d0cf..f7b7dd6 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -2135,7 +2135,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { * @param {object} loadedFile The loaded file. * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/FileReader#readAsDataURL()} */ - readFileData = function (loadedFile) { + function readFileData(loadedFile) { if (typeof FileReader === 'undefined') { // revert loading status… me.hideAttachment(); @@ -2165,7 +2165,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { } }; fileReader.readAsDataURL(loadedFile); - }; + } /** * handle the preview of files that can either be an image, video, audio or pdf element @@ -2246,7 +2246,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { * @private * @function */ - addDragDropHandler = function () { + function addDragDropHandler() { if (typeof $fileInput === 'undefined' || $fileInput.length === 0) { return; } @@ -2279,7 +2279,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { $fileInput.on('change', function () { readFileData(); }); - }; + } /** * attaches the clipboard attachment handler to the page @@ -2288,20 +2288,19 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { * @private * @function */ - addClipboardEventHandler = function () { - $(document).on('paste', - function (event) { - var items = (event.clipboardData || event.originalEvent.clipboardData).items; - for (var i in items) { - if (items.hasOwnProperty(i)) { - var item = items[i]; - if (item.kind === 'file') { - readFileData(item.getAsFile()); - } - } + function addClipboardEventHandler() { + $(document).on('paste', function (event) { + var items = (event.clipboardData || event.originalEvent.clipboardData).items; + for (var i in items) { + if (items.hasOwnProperty(i)) { + var item = items[i]; + if (item.kind === 'file') { + readFileData(item.getAsFile()); } - }); - }; + } + } + }); + } /** diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 7dca0fd..e3e14ca 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -75,7 +75,7 @@ if ($MARKDOWN): - + diff --git a/tpl/page.php b/tpl/page.php index 07e26cd..a786702 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -54,7 +54,7 @@ if ($QRCODE): - +