writting mode resize editor

This commit is contained in:
life committed 2014-05-15 22:36:32 +08:00
1 parent 1fa03e901d
commit 8f86baa616
4 files changed
+19 -22

No files matched your search

+7 -8
View File
@@ -783,19 +783,18 @@ body {
line-height: 60px; line-height: 60px;
margin: auto; margin: auto;
} }
#header .pull-right:hover a {
color: #000;
}
#newNoteWrap { #newNoteWrap {
line-height: 40px; line-height: 40px;
margin-top: 10px; margin-top: 10px;
margin-left: 10px; margin-left: 10px;
} }
#newNoteWrap:hover { #newNoteWrap,
color: #000; #topNav {
opacity: 0;
} }
#newNoteWrap:hover a { #newNoteWrap:hover,
color: #000; #topNav:hover {
opacity: 1;
} }
#mainContainer { #mainContainer {
overflow-y: hidden; overflow-y: hidden;
@@ -945,7 +944,7 @@ body {
#leanoteNav { #leanoteNav {
background-color: #fbfcf7; background-color: #fbfcf7;
opacity: 0.3; opacity: 0.3;
right: -20px; right: -30px;
} }
.new-note-right { .new-note-right {
padding: 0 2px; padding: 0 2px;
+6 -12
View File
@@ -877,23 +877,17 @@ html,body {
margin:auto; margin:auto;
} }
color: #ccc; color: #ccc;
.pull-right {
&:hover {
a {
color: #000;
}
}
}
} }
#newNoteWrap { #newNoteWrap {
line-height: 40px; margin-top: 10px; line-height: 40px; margin-top: 10px;
margin-left: 10px; margin-left: 10px;
}
#newNoteWrap, #topNav {
opacity: 0;
&:hover { &:hover {
color: #000; opacity: 1;
a {
color: #000;
}
} }
} }
@@ -1043,7 +1037,7 @@ html,body {
#leanoteNav { #leanoteNav {
background-color: @bgColor; background-color: @bgColor;
opacity: 0.3; opacity: 0.3;
right: -20px; right: -30px;
} }
.new-note-right { .new-note-right {
+1 -1
View File
@@ -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,"&nbsp;&nbsp;&nbsp;&nbsp;")}}else{}e.preventDefault();e.stopPropagation();return false}});ed.on("click",function(e){$("body").trigger("click")});ed.on("click",function(){log(ed.selection.getNode())})},selector:"#editorContent",content_css:["css/bootstrap.css","css/editor/editor.css"].concat(em.getWritingCss()),skin:"custom",language:LEA.locale,plugins:["autolink link leanote_image lists charmap hr","paste","searchreplace leanote_nav leanote_code tabfocus","table directionality textcolor codemirror"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leanote_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<len;++i){if(navs[i]==self){break}}if(target.size()>=i+1){target=target.eq(i);var top=target.offset().top;var nowTop=iframe.scrollTop();var d=200;for(var i=0;i<d;i++){setTimeout(function(top){return function(){iframe.scrollTop(top)}}(nowTop+1*i*(top-nowTop)/d),i)}setTimeout(function(){iframe.scrollTop(top)},d+5);retLine truncated 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,"&nbsp;&nbsp;&nbsp;&nbsp;")}}else{}e.preventDefault();e.stopPropagation();return false}});ed.on("click",function(e){$("body").trigger("click")});ed.on("click",function(){log(ed.selection.getNode())})},selector:"#editorContent",content_css:["css/bootstrap.css","css/editor/editor.css"].concat(em.getWritingCss()),skin:"custom",language:LEA.locale,plugins:["autolink link leanote_image lists charmap hr","paste","searchreplace leanote_nav leanote_code tabfocus","table directionality textcolor codemirror"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leanote_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<len;++i){if(navs[i]==self){break}}if(target.size()>=i+1){target=target.eq(i);var top=target.offset().top;var nowTop=iframe.scrollTop();var d=200;for(var i=0;i<d;i++){setTimeout(function(top){return function(){iframe.scrollTop(top)}}(nowTop+1*i*(top-nowTop)/d),i)}setTimeout(function(){iframe.scrollTop(top)},d+5);retLine truncated
+5 -1
View File
@@ -744,7 +744,7 @@ editorMode.prototype.normalMode = function() {
$c.contents().find("#writtingMode").remove(); $c.contents().find("#writtingMode").remove();
$c.contents().find('link[href$="editor-writting-mode.css"]').remove(); $c.contents().find('link[href$="editor-writting-mode.css"]').remove();
$("#noteItemListWrap, #notesAndSort").show(); $("#noteItemListWrap, #notesAndSort").show();
$("#noteList").unbind("mouseenter").unbind("mouseleave"); $("#noteList").unbind("mouseenter").unbind("mouseleave");
var theme = UserInfo.Theme || "default"; var theme = UserInfo.Theme || "default";
@@ -754,6 +754,8 @@ editorMode.prototype.normalMode = function() {
$("#mceToolbar").css("height", "30px"); $("#mceToolbar").css("height", "30px");
// $("#lock").animate({right:w},1000); // $("#lock").animate({right:w},1000);
resizeEditor();
} }
editorMode.prototype.writtingMode = function() { editorMode.prototype.writtingMode = function() {
/* /*
@@ -783,6 +785,8 @@ editorMode.prototype.writtingMode = function() {
// $("#lock").animate({right:w},1000); // $("#lock").animate({right:w},1000);
// $("body").fadeIn(); // $("body").fadeIn();
resizeEditor();
} }
editorMode.prototype.getWritingCss = function() { editorMode.prototype.getWritingCss = function() {