refactoring logic, to make intention more clear and reduce complexity
This commit is contained in:
parent
b912c07cd1
commit
ad096b80a1
@ -2145,6 +2145,18 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||||||
return isPreview;
|
return isPreview;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the visibility of the editor
|
||||||
|
*
|
||||||
|
* @name Editor.isHidden
|
||||||
|
* @function
|
||||||
|
* @return {bool}
|
||||||
|
*/
|
||||||
|
me.isHidden = function()
|
||||||
|
{
|
||||||
|
return $message.hasClass('hidden');
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset the Editor view
|
* reset the Editor view
|
||||||
*
|
*
|
||||||
@ -2221,18 +2233,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||||||
return $message.val();
|
return $message.val();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* returns if status is editing
|
|
||||||
*
|
|
||||||
* @name Editor.isEditing
|
|
||||||
* @function
|
|
||||||
* @return {bool}
|
|
||||||
*/
|
|
||||||
me.isEditing = function()
|
|
||||||
{
|
|
||||||
return !$message.hasClass('hidden');
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* init status manager
|
* init status manager
|
||||||
*
|
*
|
||||||
@ -2855,7 +2855,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
||||||
if (!Editor.isEditing()) {
|
if (Editor.isHidden()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2873,7 +2873,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||||||
|
|
||||||
$(document).draghover().on({
|
$(document).draghover().on({
|
||||||
'draghoverstart': function(e) {
|
'draghoverstart': function(e) {
|
||||||
if (!Editor.isEditing()) {
|
if (Editor.isHidden()) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
@ -2903,7 +2903,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||||||
*/
|
*/
|
||||||
function addClipboardEventHandler() {
|
function addClipboardEventHandler() {
|
||||||
$(document).on('paste', function (event) {
|
$(document).on('paste', function (event) {
|
||||||
if (!Editor.isEditing()) {
|
if (Editor.isHidden()) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
|
@ -71,7 +71,7 @@ if ($MARKDOWN):
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-q+3evRUejYtbFztcSu0VbyS7GDYocPGE26ir4yRpe5AAeJPdn3l2imP1KNVLBjWMKJ0ujTTbRwxutHjFrjgwPw==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-sbttN5BzzD/cAqT1Edc2CEcDUYezir6lumxlxa5byimoxnlHv8IK7kRnb/9EEhMyItl0DZIQhylaKCbCknUhAw==" crossorigin="anonymous"></script>
|
||||||
<!--[if IE]>
|
<!--[if IE]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
@ -49,7 +49,7 @@ if ($MARKDOWN):
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-q+3evRUejYtbFztcSu0VbyS7GDYocPGE26ir4yRpe5AAeJPdn3l2imP1KNVLBjWMKJ0ujTTbRwxutHjFrjgwPw==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-sbttN5BzzD/cAqT1Edc2CEcDUYezir6lumxlxa5byimoxnlHv8IK7kRnb/9EEhMyItl0DZIQhylaKCbCknUhAw==" crossorigin="anonymous"></script>
|
||||||
<!--[if IE]>
|
<!--[if IE]>
|
||||||
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
|
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
Loading…
Reference in New Issue
Block a user