Added error page
This commit is contained in:
parent
94398bb439
commit
fa80570157
3 changed files with 22 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
* Basic
|
* Basic
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.cutomjs {
|
.customjs {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
|
@ -14,6 +14,15 @@
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.customjs.customjs--error {
|
||||||
|
width: 400px;
|
||||||
|
height: 75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customjs.customjs--error form {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
a,
|
a,
|
||||||
a:hover,
|
a:hover,
|
||||||
.blue-text,
|
.blue-text,
|
||||||
|
@ -158,8 +167,8 @@ a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls__save input {
|
.controls__save input {
|
||||||
font-size: 18px;
|
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls__remove-draft {
|
.controls__remove-draft {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
var popup = {
|
var popup = {
|
||||||
key: 'popup',
|
key: 'popup',
|
||||||
el: {
|
el: {
|
||||||
|
popup: $('#customjs'),
|
||||||
popupForm: $('#popup-form'),
|
popupForm: $('#popup-form'),
|
||||||
hostSelect: $('#host'),
|
hostSelect: $('#host'),
|
||||||
hostGoToLink: $('#goto-host'),
|
hostGoToLink: $('#goto-host'),
|
||||||
|
@ -16,7 +17,8 @@
|
||||||
sourceEditor: $('#ace-editor'),
|
sourceEditor: $('#ace-editor'),
|
||||||
saveBtn: $('#save'),
|
saveBtn: $('#save'),
|
||||||
resetBtn: $('#reset'),
|
resetBtn: $('#reset'),
|
||||||
draftRemoveLink: $('#draft-remove')
|
draftRemoveLink: $('#draft-remove'),
|
||||||
|
error: $('#error')
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
host: {
|
host: {
|
||||||
|
@ -367,7 +369,8 @@
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
alert('err');
|
popup.el.popup.addClass('customjs--error');
|
||||||
|
popup.el.error.removeClass('is-hidden');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<script type="text/javascript" src="lib/ace/ace.js" charset="utf-8"></script>
|
<script type="text/javascript" src="lib/ace/ace.js" charset="utf-8"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="cutomjs" id="cutomjs">
|
<div class="customjs" id="customjs">
|
||||||
<form action="" method="post" accept-charset="utf-8" id="popup-form" class="pure-form">
|
<form action="" method="post" accept-charset="utf-8" id="popup-form" class="pure-form">
|
||||||
|
|
||||||
<div class="pure-g host">
|
<div class="pure-g host">
|
||||||
|
@ -69,6 +69,11 @@
|
||||||
</div><!-- .controls -->
|
</div><!-- .controls -->
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
<div id="error" class="error is-hidden">
|
||||||
|
<strong>Custom JavaScript says:</strong>
|
||||||
|
<p class="red-text">It seems that this page cannot be modified with me..</p>
|
||||||
|
<span>tip: Try refresh page</span>
|
||||||
|
</div><!-- .error -->
|
||||||
</div>
|
</div>
|
||||||
<script src="lib/popup.js"></script>
|
<script src="lib/popup.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in a new issue