diff --git a/public/js/app/page-min.js b/public/js/app/page-min.js index 67a27b4..e26f01d 100644 --- a/public/js/app/page-min.js +++ b/public/js/app/page-min.js @@ -1 +1 @@ -var em=new editorMode;var lineMove=false;var target=null;function stopResize3Columns(){if(lineMove){ajaxGet("/user/updateColumnWidth",{notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}lineMove=false;$(".noteSplit").css("background","none")}function resize3ColumnsEnd(notebookWidth,noteListWidth){if(notebookWidth<150||noteListWidth<100){}var noteWidth=$("body").width()-notebookWidth-noteListWidth;if(noteWidth<400){}$("#leftNotebook").width(notebookWidth);$("#notebookSplitter").css("left",notebookWidth);$("#noteAndEditor").css("left",notebookWidth);$("#noteList").width(noteListWidth);$("#noteSplitter").css("left",noteListWidth);$("#note").css("left",noteListWidth);UserInfo.NotebookWidth=notebookWidth;UserInfo.NoteListWidth=noteListWidth}function resize3Columns(event,isFromeIfr){if(isFromeIfr){event.clientX+=$("body").width()-$("#note").width()}var notebookWidth,noteListWidth;if(lineMove==true){if(target=="notebookSplitter"){notebookWidth=event.clientX;noteListWidth=$("#noteList").width();resize3ColumnsEnd(notebookWidth,noteListWidth)}else{notebookWidth=$("#leftNotebook").width();noteListWidth=event.clientX-notebookWidth;resize3ColumnsEnd(notebookWidth,noteListWidth)}resizeEditor()}}$(function(){$(".noteSplit").bind("mousedown",function(event){event.preventDefault();lineMove=true;$(this).css("background-color","#ccc");target=$(this).attr("id");$("#noteMask").css("z-index",99999)});$("body").bind("mouseup",function(event){stopResize3Columns();$("#noteMask").css("z-index",-1)});$("body").bind("mousemove",function(event){if(lineMove){event.preventDefault();resize3Columns(event)}});$("#moreBtn").click(function(){saveBookmark();var height=$("#mceToolbar").height();if(height<$("#popularToolbar").height()){$("#mceToolbar").height($("#popularToolbar").height());$(this).find("i").removeClass("fa-angle-down").addClass("fa-angle-up")}else{$("#mceToolbar").height(height/2);$(this).find("i").removeClass("fa-angle-up").addClass("fa-angle-down")}resizeEditor();restoreBookmark()});$(window).resize(function(){resizeEditor()});$(".folderHeader").click(function(){var body=$(this).next();var p=$(this).parent();if(!body.is(":hidden")){$(".folderNote").removeClass("opened").addClass("closed");p.removeClass("opened").addClass("closed");$(this).find(".fa-angle-down").removeClass("fa-angle-down").addClass("fa-angle-right")}else{$(".folderNote").removeClass("opened").addClass("closed");p.removeClass("closed").addClass("opened");$(this).find(".fa-angle-right").removeClass("fa-angle-right").addClass("fa-angle-down")}});tinymce.init({setup:function(ed){ed.on("keydown",Note.saveNote);ed.on("keydown",function(e){var num=e.which?e.which:e.keyCode;if(num==9){if(!e.shiftKey){var node=ed.selection.getNode();if(node.nodeName=="PRE"){ed.execCommand("mceInsertRawHTML",false," ")}else{ed.execCommand("mceInsertRawHTML",false,"    ")}}else{}e.preventDefault();e.stopPropagation();return false}});ed.on("click",function(e){$("body").trigger("click")});ed.on("click",function(){log(ed.selection.getNode())})},convert_urls:true,relative_urls:false,remove_script_host:false,selector:"#editorContent",content_css:["css/bootstrap.css","css/editor/editor.css"].concat(em.getWritingCss()),skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists charmap hr","paste","searchreplace leanote_nav leanote_code tabfocus","table directionality textcolor codemirror"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | code | pastetext | fontselect fontsizeselect",menubar:false,toolbar_items_size:"small",statusbar:false,url_converter:false,font_formats:"Arial=arial,helvetica,sans-serif;"+"Arial Black=arial black,avant garde;"+"Times New Roman=times new roman,times;"+"Courier New=courier new,courier;"+"Tahoma=tahoma,arial,helvetica,sans-serif;"+"Verdana=verdana,geneva;"+"宋体=SimSun;"+"新宋体=NSimSun;"+"黑体=SimHei;"+"微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3; Header 4=h4;Pre=pre;Paragraph=p",codemirror:{indentOnInit:true,path:"CodeMirror",config:{lineNumbers:true},jsFiles:[]},paste_data_images:true});window.onbeforeunload=function(e){Note.curChangedSaveIt()};$("body").on("keydown",Note.saveNote)});var random=1;function scrollTo(self,tagName,text){var iframe=$("#editorContent_ifr").contents();var target=iframe.find(tagName+":contains("+text+")");random++;var navs=$('#leanoteNavContent [data-a="'+tagName+"-"+encodeURI(text)+'"]');var len=navs.size();for(var i=0;i=i+1){target=target.eq(i);var top=target.offset().top;var nowTop=iframe.scrollTop();var d=200;for(var i=0;i立即验证","success")}else{showAlert("#emailMsg",e.Msg||"邮件发送失败","danger")}},"#emailBtn")});$("#leanoteDialog").on("click","#pwdBtn",function(e){e.preventDefault();var oldPwd=$("#oldPwd").val();var pwd=$("#pwd").val();var pwd2=$("#pwd2").val();if(!oldPwd){showAlert("#pwdMsg","请输入旧密码","danger","#oldPwd");return}else{if(oldPwd.length<6){showAlert("#pwdMsg","密码长度至少6位","danger","#oldPwd");return}}if(!pwd){showAlert("#pwdMsg","请输入新密码","danger","#pwd");return}else{if(pwd.length<6){showAlert("#pwdMsg","密码长度至少6位","danger","#pwd");return}}if(!pwd2){showAlert("#pwdMsg","请重复输入新密码","danger","#pwd2");return}else{if(pwd!=pwd2){showAlert("#pwdMsg","两次密码输入不一致","danger","#pwd2");return}}hideAlert("#pwdMsg");post("/user/updatePwd",{oldPwd:oldPwd,pwd:pwd},function(e){if(e.Ok){showAlert("#pwdMsg","修改密码成功","success")}else{showAlert("#pwdMsg",e.Msg,"danger")}},"#pwdBtn")});if(!UserInfo.Verified){}$("#wrongEmail").click(function(){openSetInfoDialog(1)});$("#leanoteDialog").on("click",".reSendActiveEmail",function(){showDialog("reSendActiveEmailDialog",{title:"发送验证邮件",postShow:function(){ajaxGet("/user/reSendActiveEmail",{},function(ret){if(typeof ret=="object"&&ret.Ok){$("#leanoteDialog .text").html("发送成功!");$("#leanoteDialog .viewEmailBtn").removeClass("disabled");$("#leanoteDialog .viewEmailBtn").click(function(){hideDialog();var url=getEmailLoginAddress(UserInfo.Email);window.open(url,"_blank")})}else{$("#leanoteDialog .text").html("发送失败")}})}})});$("#leanoteDialog").on("click",".nowToActive",function(){var url=getEmailLoginAddress(UserInfo.Email);window.open(url,"_blank")});$("#notebook, #newMyNote, #myProfile, #topNav, #notesAndSort","#leanoteNavTrigger").bind("selectstart",function(e){e.preventDefault();return false});function updateLeftIsMin(is){ajaxGet("/user/updateLeftIsMin",{leftIsMin:is})}function minLeft(save){$("#leftNotebook").width(30);$("#notebook").hide();$("#noteAndEditor").css("left",30);$("#notebookSplitter").hide();$("#logo").hide();$("#leftSwitcher").hide();$("#leftSwitcher2").show();$("#leftNotebook .slimScrollDiv").hide();if(save){updateLeftIsMin(true)}}function maxLeft(save){$("#noteAndEditor").css("left",UserInfo.NotebookWidth);$("#leftNotebook").width(UserInfo.NotebookWidth);$("#notebook").show();$("#notebookSplitter").show();$("#leftSwitcher2").hide();$("#logo").show();$("#leftSwitcher").show();$("#leftNotebook .slimScrollDiv").show();if(save){updateLeftIsMin(false)}}$("#leftSwitcher2").click(function(){maxLeft(true)});$("#leftSwitcher").click(function(){minLeft(true)});function getMaxDropdownHeight(obj){var offset=$(obj).offset();var maxHeight=$(document).height()-offset.top;maxHeight-=70;if(maxHeight<0){maxHeight=0}var preHeight=$(obj).find("ul").height();return preHeight')},0);$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});$("#mceToolbar").css("height","40px");$("#pageInner").addClass("animated fadeInUp");this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0)};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["css/editor/editor-writting-mode.css"]}return[]}; \ No newline at end of file +var em=new editorMode;var lineMove=false;var target=null;function stopResize3Columns(){if(lineMove){ajaxGet("/user/updateColumnWidth",{notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}lineMove=false;$(".noteSplit").css("background","none")}function resize3ColumnsEnd(notebookWidth,noteListWidth){if(notebookWidth<150||noteListWidth<100){}var noteWidth=$("body").width()-notebookWidth-noteListWidth;if(noteWidth<400){}$("#leftNotebook").width(notebookWidth);$("#notebookSplitter").css("left",notebookWidth);$("#noteAndEditor").css("left",notebookWidth);$("#noteList").width(noteListWidth);$("#noteSplitter").css("left",noteListWidth);$("#note").css("left",noteListWidth);UserInfo.NotebookWidth=notebookWidth;UserInfo.NoteListWidth=noteListWidth}function resize3Columns(event,isFromeIfr){if(isFromeIfr){event.clientX+=$("body").width()-$("#note").width()}var notebookWidth,noteListWidth;if(lineMove==true){if(target=="notebookSplitter"){notebookWidth=event.clientX;noteListWidth=$("#noteList").width();resize3ColumnsEnd(notebookWidth,noteListWidth)}else{notebookWidth=$("#leftNotebook").width();noteListWidth=event.clientX-notebookWidth;resize3ColumnsEnd(notebookWidth,noteListWidth)}resizeEditor()}}$(function(){$(".noteSplit").bind("mousedown",function(event){event.preventDefault();lineMove=true;$(this).css("background-color","#ccc");target=$(this).attr("id");$("#noteMask").css("z-index",99999)});$("body").bind("mouseup",function(event){stopResize3Columns();$("#noteMask").css("z-index",-1)});$("body").bind("mousemove",function(event){if(lineMove){event.preventDefault();resize3Columns(event)}});$("#moreBtn").click(function(){saveBookmark();var height=$("#mceToolbar").height();if(height<$("#popularToolbar").height()){$("#mceToolbar").height($("#popularToolbar").height());$(this).find("i").removeClass("fa-angle-down").addClass("fa-angle-up")}else{$("#mceToolbar").height(height/2);$(this).find("i").removeClass("fa-angle-up").addClass("fa-angle-down")}resizeEditor();restoreBookmark()});$(window).resize(function(){resizeEditor()});$(".folderHeader").click(function(){var body=$(this).next();var p=$(this).parent();if(!body.is(":hidden")){$(".folderNote").removeClass("opened").addClass("closed");p.removeClass("opened").addClass("closed");$(this).find(".fa-angle-down").removeClass("fa-angle-down").addClass("fa-angle-right")}else{$(".folderNote").removeClass("opened").addClass("closed");p.removeClass("closed").addClass("opened");$(this).find(".fa-angle-right").removeClass("fa-angle-right").addClass("fa-angle-down")}});tinymce.init({setup:function(ed){ed.on("keydown",Note.saveNote);ed.on("keydown",function(e){var num=e.which?e.which:e.keyCode;if(num==9){if(!e.shiftKey){var node=ed.selection.getNode();if(node.nodeName=="PRE"){ed.execCommand("mceInsertRawHTML",false," ")}else{ed.execCommand("mceInsertRawHTML",false,"    ")}}else{}e.preventDefault();e.stopPropagation();return false}});ed.on("click",function(e){$("body").trigger("click")});ed.on("click",function(){log(ed.selection.getNode())})},convert_urls:true,relative_urls:false,remove_script_host:false,selector:"#editorContent",content_css:["css/bootstrap.css","css/editor/editor.css"].concat(em.getWritingCss()),skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists charmap hr","paste","searchreplace leanote_nav leanote_code tabfocus","table directionality textcolor codemirror"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | code | pastetext | fontselect fontsizeselect",menubar:false,toolbar_items_size:"small",statusbar:false,url_converter:false,font_formats:"Arial=arial,helvetica,sans-serif;"+"Arial Black=arial black,avant garde;"+"Times New Roman=times new roman,times;"+"Courier New=courier new,courier;"+"Tahoma=tahoma,arial,helvetica,sans-serif;"+"Verdana=verdana,geneva;"+"宋体=SimSun;"+"新宋体=NSimSun;"+"黑体=SimHei;"+"微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3; Header 4=h4;Pre=pre;Paragraph=p",codemirror:{indentOnInit:true,path:"CodeMirror",config:{lineNumbers:true},jsFiles:[]},paste_data_images:true});window.onbeforeunload=function(e){Note.curChangedSaveIt()};$("body").on("keydown",Note.saveNote)});var random=1;function scrollTo(self,tagName,text){var iframe=$("#editorContent_ifr").contents();var target=iframe.find(tagName+":contains("+text+")");random++;var navs=$('#leanoteNavContent [data-a="'+tagName+"-"+encodeURI(text)+'"]');var len=navs.size();for(var i=0;i=i+1){target=target.eq(i);var top=target.offset().top;var nowTop=iframe.scrollTop();var d=200;for(var i=0;i立即验证","success")}else{showAlert("#emailMsg",e.Msg||"邮件发送失败","danger")}},"#emailBtn")});$("#leanoteDialog").on("click","#pwdBtn",function(e){e.preventDefault();var oldPwd=$("#oldPwd").val();var pwd=$("#pwd").val();var pwd2=$("#pwd2").val();if(!oldPwd){showAlert("#pwdMsg","请输入旧密码","danger","#oldPwd");return}else{if(oldPwd.length<6){showAlert("#pwdMsg","密码长度至少6位","danger","#oldPwd");return}}if(!pwd){showAlert("#pwdMsg","请输入新密码","danger","#pwd");return}else{if(pwd.length<6){showAlert("#pwdMsg","密码长度至少6位","danger","#pwd");return}}if(!pwd2){showAlert("#pwdMsg","请重复输入新密码","danger","#pwd2");return}else{if(pwd!=pwd2){showAlert("#pwdMsg","两次密码输入不一致","danger","#pwd2");return}}hideAlert("#pwdMsg");post("/user/updatePwd",{oldPwd:oldPwd,pwd:pwd},function(e){if(e.Ok){showAlert("#pwdMsg","修改密码成功","success")}else{showAlert("#pwdMsg",e.Msg,"danger")}},"#pwdBtn")});if(!UserInfo.Verified){}$("#wrongEmail").click(function(){openSetInfoDialog(1)});$("#leanoteDialog").on("click",".reSendActiveEmail",function(){showDialog("reSendActiveEmailDialog",{title:"发送验证邮件",postShow:function(){ajaxGet("/user/reSendActiveEmail",{},function(ret){if(typeof ret=="object"&&ret.Ok){$("#leanoteDialog .text").html("发送成功!");$("#leanoteDialog .viewEmailBtn").removeClass("disabled");$("#leanoteDialog .viewEmailBtn").click(function(){hideDialog();var url=getEmailLoginAddress(UserInfo.Email);window.open(url,"_blank")})}else{$("#leanoteDialog .text").html("发送失败")}})}})});$("#leanoteDialog").on("click",".nowToActive",function(){var url=getEmailLoginAddress(UserInfo.Email);window.open(url,"_blank")});$("#notebook, #newMyNote, #myProfile, #topNav, #notesAndSort","#leanoteNavTrigger").bind("selectstart",function(e){e.preventDefault();return false});function updateLeftIsMin(is){ajaxGet("/user/updateLeftIsMin",{leftIsMin:is})}function minLeft(save){$("#leftNotebook").width(30);$("#notebook").hide();$("#noteAndEditor").css("left",30);$("#notebookSplitter").hide();$("#logo").hide();$("#leftSwitcher").hide();$("#leftSwitcher2").show();$("#leftNotebook .slimScrollDiv").hide();if(save){updateLeftIsMin(true)}}function maxLeft(save){$("#noteAndEditor").css("left",UserInfo.NotebookWidth);$("#leftNotebook").width(UserInfo.NotebookWidth);$("#notebook").show();$("#notebookSplitter").show();$("#leftSwitcher2").hide();$("#logo").show();$("#leftSwitcher").show();$("#leftNotebook .slimScrollDiv").show();if(save){updateLeftIsMin(false)}}$("#leftSwitcher2").click(function(){maxLeft(true)});$("#leftSwitcher").click(function(){minLeft(true)});function getMaxDropdownHeight(obj){var offset=$(obj).offset();var maxHeight=$(document).height()-offset.top;maxHeight-=70;if(maxHeight<0){maxHeight=0}var preHeight=$(obj).find("ul").height();return preHeight')},0);$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});$("#mceToolbar").css("height","40px");this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0)};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["css/editor/editor-writting-mode.css"]}return[]}; \ No newline at end of file diff --git a/public/js/app/page.js b/public/js/app/page.js index 789346d..ccdaadb 100644 --- a/public/js/app/page.js +++ b/public/js/app/page.js @@ -811,7 +811,7 @@ editorMode.prototype.writtingMode = function() { $("#lock").css({right:0, bottom:0}); // $("#lock").animate({right:0}, 0); */ - $("#pageInner").removeClass("animated fadeInUp"); + // $("#pageInner").removeClass("animated fadeInUp"); $("#themeLink").attr("href", "/css/theme/writting-overwrite.css"); @@ -832,7 +832,7 @@ editorMode.prototype.writtingMode = function() { // $("#lock").animate({right:w},1000); // $("body").fadeIn(); - $("#pageInner").addClass("animated fadeInUp"); + //$("#pageInner").addClass("animated fadeInUp"); this.resizeEditor();