Skip to content

Commit

Permalink
update to 3.0RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
2613df committed Dec 28, 2019
1 parent deabb58 commit 5e9449b
Show file tree
Hide file tree
Showing 19 changed files with 737 additions and 543 deletions.
43 changes: 0 additions & 43 deletions assets/js/offline.js

This file was deleted.

24 changes: 0 additions & 24 deletions assets/js/script.js

This file was deleted.

225 changes: 225 additions & 0 deletions content/templates/default/assets/js/ajax.edit.js.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
$("#pwChangeShare").click(function(){
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"s","name":"<?php echo dencrypt(1,$name)?>","do":"pwChange","opw":$("#oldPwShare").val(),"npw":$("#newPwShare").val()},
//data:{"1":"1"},
success:function(data){
if(data.status=='OK'){
alert("修改成功");
}else{
alert("旧密码错误");
//history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});

$("#shareCloseBtn").click(function(){
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"shareClose"},
//data:{"1":"1"},
success:function(data){
if(data.status=='OK'){
alert("关闭分享成功");
}else{
alert("关闭分享失败,请尝试刷新后再试");
history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});
$("#shareBtn").click(function(){
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"shareOpen"},
//data:{"1":"1"},
success:function(data){
if(data.status=='OK'){
document.getElementById("shareSuccessBtn").click();
}else{
alert("分享失败,请尝试刷新后再试");
history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});
$("#pwChange").click(function(){
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"pwChange","opw":$("#oldPw").val(),"npw":$("#newPw").val()},
//data:{"1":"1"},
success:function(data){
if(data.status!='OK'){
alert("旧密码错误");
}else{
alert("修改成功");
history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});
$("#pwJudge").click(function(){
//$("Pw").click();
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"pwJudge","pw":$("#Pw").val()},
//data:{"1":"1"},
success:function(data){
if(data.status!='OK'){
alert("密码错误");
}else{
history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});
$(function() {
var $textarea = $(".content");
var content = $textarea.val();

// Use jQuery Tabby Plugin to enable the tab key on textareas.
$textarea.tabby();
$textarea.focus();

// Make content available to print.
//$(".print").text(content);

//初次访问
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"noteRead"},
//data:{"1":"1"},
success:function(data){
if(data.status=='OK'){
$textarea.text(data.result);
$("#processOK").text(' √');
}else if(data.status=='permissionDenied'){
document.getElementById("keyJudgeBtn").click();
}else if(data.status!='notExist'){
alert(data.status);
$("#processOK").text(' X');

}

},
//error:function(){
// alert("请求失败1");
// $("#processOK").text(' X');
//
//},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},
dataType:"json"
});

// If content changes, update it.
setInterval(function() {
if (content !== $textarea.val()) {
content = $textarea.val();
//$("#processOK").text('&nbsp;...');
$.ajax({
url: './lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"noteChange","data":content},
//data:{"1":"1"},
success:function(data){
if(data.status!='OK'){
alert(data.status);
$("#processOK").text(' X');
}else{
$textarea.text(data.result);
$("#processOK").text(' ...');

}
},
error:function(){
alert("请求失败");
$("#processOK").text(' X');

},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

}else{
$("#processOK").text(' √');

}
}, 500);
});
75 changes: 75 additions & 0 deletions content/templates/default/assets/js/ajax.share.js.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
$("#pwJudge").click(function(){
//$("Pw").click();
$.ajax({
url: '../lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"pwJudge","pw":$("#Pw").val()},
//data:{"1":"1"},
success:function(data){
if(data.status!='OK'){
alert("密码错误");
}else{
history.go(0);
//$("#pwChangeCancel").CLICK();
}
},
error:function(){
alert("请求失败");
},
/*error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},*/
dataType:"json"
});

});
$(function() {
$("#goto").attr("style","display:none");
$("#keyBtn").attr("style","display:none");
$("#shareBtn").attr("style","display:none");
var $textarea = $(".content");
var content = $textarea.val();

// Use jQuery Tabby Plugin to enable the tab key on textareas.
$textarea.tabby();
//$textarea.focus();
$textarea.attr("disabled","disabled");
$textarea.attr("style","background-color:white;");
// Make content available to print.
//$(".print").text(content);

//初次访问
$.ajax({
url: '../lib/handle.php',
type: "POST",
//data: "&t=" + encodeURIComponent(content)
data:{"es":"<?php echo $es?>","name":"<?php echo $name?>","do":"noteRead"},
//data:{"1":"1"},
success:function(data){
if(data.status=='OK'){
$textarea.text(data.result);
$("#processOK").text(' √');
}else if(data.status=='permissionDenied'){
document.getElementById("keyJudgeBtn").click();
}else if(data.status!='notExist'){
alert(data.status);
$("#processOK").text(' X');

}
},
//error:function(){
// alert("请求失败1");
// $("#processOK").text(' X');
//
//},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(errorThrown);
},
dataType:"json"
});
});
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5e9449b

Please sign in to comment.