From 27dbd6552cb28dd68f69781929b4e0b2c2560030 Mon Sep 17 00:00:00 2001 From: iiuazz Date: Sat, 13 Sep 2014 00:20:18 +0800 Subject: [PATCH] contexmenu dynamic --- public/css/theme/default.css | 6 +- public/css/theme/default.less | 10 +- public/css/zTreeStyle/zTreeStyle.css | 89 +++------------ public/js/all.js | 2 +- public/js/app/note-min.js | 2 +- public/js/app/note.js | 12 +- public/js/app/notebook-min.js | 2 +- public/js/app/notebook.js | 18 ++- public/js/contextmenu/css/contextmenu.css | 1 + .../js/contextmenu/jquery.contextmenu-min.js | 2 +- public/js/contextmenu/jquery.contextmenu.js | 105 ++++++++++-------- public/js/jquery.ztree.all-3.5.js | 11 +- 12 files changed, 118 insertions(+), 142 deletions(-) diff --git a/public/css/theme/default.css b/public/css/theme/default.css index cea7288..6643b2d 100644 --- a/public/css/theme/default.css +++ b/public/css/theme/default.css @@ -1340,12 +1340,13 @@ background-position:-1px -670px list-style: none; } #searchNotebookForList { - border: 1px solid rgba(255, 255, 255, 0.3); color: #ccc; + border: 1px solid rgba(255, 255, 255, 0.1); background-color: #37485e; } #searchNotebookForList:focus { outline: none !important; + border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: none; } .label-default { @@ -1358,3 +1359,6 @@ background-position:-1px -670px #myShareNotebooks .folderBody { background: none; } +.tmpzTreeMove_arrow { + color: #fff; +} diff --git a/public/css/theme/default.less b/public/css/theme/default.less index 38024ea..6b62c19 100644 --- a/public/css/theme/default.less +++ b/public/css/theme/default.less @@ -1169,12 +1169,13 @@ background-position:-1px -670px //---------------------- #searchNotebookForList { - border: 1px solid rgba(255, 255, 255, 0.3); color: #ccc; + border: 1px solid rgba(255, 255, 255, 0.1); background-color: @leftBgColor; &:focus { - outline: none !important; - box-shadow: none; + outline: none !important; + border: 1px solid rgba(255, 255, 255, 0.3); + box-shadow: none; } } .label-default { @@ -1186,4 +1187,7 @@ background-position:-1px -670px } #myShareNotebooks .folderBody { background: none; +} +.tmpzTreeMove_arrow { + color: #fff; } \ No newline at end of file diff --git a/public/css/zTreeStyle/zTreeStyle.css b/public/css/zTreeStyle/zTreeStyle.css index b052174..2fcecb3 100644 --- a/public/css/zTreeStyle/zTreeStyle.css +++ b/public/css/zTreeStyle/zTreeStyle.css @@ -1,18 +1,7 @@ -/*------------------------------------- -zTree Style - -version: 3.4 -author: Hunter.z -email: hunter.z@263.net -website: http://code.google.com/p/jquerytree/ - --------------------------------------*/ - .ztree * {padding:0; margin:0; font-size:12px;} .ztree {margin:0; padding:5px; color:#333} .ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} .ztree li ul{ margin:0; padding:0 0 0 18px} -.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; text-decoration:none; vertical-align:top; display: block; @@ -21,67 +10,25 @@ website: http://code.google.com/p/jquerytree/ .ztree li a:hover {text-decoration:underline} .ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} + /* 拖动到上面 */ .ztree li a.tmpTargetNode_inner { - padding-top:0px; background-color:#316AC5; - color:white; height:30px; border:1px #316AC5 solid; + padding-top:0px; + background-color:#316AC5; + color:white; height:30px; + border:1px #316AC5 solid; opacity:0.8; filter:alpha(opacity=80) } -.ztree li a.tmpTargetNode_prev {} -.ztree li a.tmpTargetNode_next {} - .ztree li span {line-height:16px; margin-right:2px} .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; - border:0 none; cursor: pointer;outline:none; - background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; - background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} - -.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} -.ztree li span.button.chk.checkbox_false_full {background-position:0 0} -.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} -.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} -.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} -.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} -.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} -.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} -.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} -.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} -.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} -.ztree li span.button.chk.radio_false_full {background-position:-28px 0} -.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} -.ztree li span.button.chk.radio_false_part {background-position:-28px -28px} -.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} -.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} -.ztree li span.button.chk.radio_true_full {background-position:-42px 0} -.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} -.ztree li span.button.chk.radio_true_part {background-position:-42px -28px} -.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} -.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} - + border:0 none; cursor: pointer;outline:none;} .ztree li span.button.switch {width:18px; height:18px} -.ztree li span.button.root_open{background-position:-92px -54px} -.ztree li span.button.root_close{background-position:-74px -54px} -.ztree li span.button.roots_open{background-position:-92px 0} -.ztree li span.button.roots_close{background-position:-74px 0} -.ztree li span.button.center_open{background-position:-92px -18px} -.ztree li span.button.center_close{background-position:-74px -18px} -.ztree li span.button.bottom_open{background-position:-92px -36px} -.ztree li span.button.bottom_close{background-position:-74px -36px} -.ztree li span.button.noline_open{background-position:-92px -72px} -.ztree li span.button.noline_close{background-position:-74px -72px} -.ztree li span.button.root_docu{ background:none;} -.ztree li span.button.roots_docu{background-position:-56px 0} -.ztree li span.button.center_docu{background-position:-56px -18px} -.ztree li span.button.bottom_docu{background-position:-56px -36px} -.ztree li span.button.noline_docu{ background:none;} - -.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} -.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} -.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} -.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} -.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} - -.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} +.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; +} +.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; } +.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; } +.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; } +.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; } ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} @@ -94,16 +41,6 @@ span.tmpzTreeMove_arrow { ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} .zTreeMask {z-index:1000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} - -/* level style*/ -/*.ztree li span.button.level0 { - display:none; -} -.ztree li ul.level0 { - padding:0; - background:none; -}*/ - .ztree li ul{ margin:0; padding:0} .ztree li {line-height:30px;} .ztree > li { @@ -120,7 +57,7 @@ ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width .ztree li a.level0 span {font-size: 14px;} .ztree li span.button { - background-image: none; /* url("./img/left_menuForOutLook.png"); */ + background-image: none; } .ztree li span.button.switch.level0 {width: 20px;} .ztree li span.button.switch.level1 {width: 20px;} diff --git a/public/js/all.js b/public/js/all.js index 00fed45..ec7f077 100644 --- a/public/js/all.js +++ b/public/js/all.js @@ -1,2 +1,2 @@ (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{factory(jQuery)}})(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setTime(+t+days*864e5)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;ithis.$items.length-1||pos<0)return;if(this.sliding)return this.$element.one("slid",function(){that.to(pos)});if(activeIndex==pos)return this.pause().cycle();return this.slide(pos>activeIndex?"next":"prev",$(this.$items[pos]))};Carousel.prototype.pause=function(e){e||(this.paused=true);if(this.$element.find(".next, .prev").length&&$.support.transition.end){this.$element.trigger($.support.transition.end);this.cycle(true)}this.interval=clearInterval(this.interval);return this};Carousel.prototype.next=function(){if(this.sliding)return;return this.slide("next")};Carousel.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")};Carousel.prototype.slide=function(type,next){var $active=this.$element.find(".item.active");var $next=next||$active[type]();var isCycling=this.interval;var direction=type=="next"?"left":"right";var fallback=type=="next"?"first":"last";var that=this;if(!$next.length){if(!this.options.wrap)return;$next=this.$element.find(".item")[fallback]()}this.sliding=true;isCycling&&this.pause();var e=$.Event("slide.bs.carousel",{relatedTarget:$next[0],direction:direction});if($next.hasClass("active"))return;if(this.$indicators.length){this.$indicators.find(".active").removeClass("active");this.$element.one("slid",function(){var $nextIndicator=$(that.$indicators.children()[that.getActiveIndex()]);$nextIndicator&&$nextIndicator.addClass("active")})}if($.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(e);if(e.isDefaultPrevented())return;$next.addClass(type);$next[0].offsetWidth;$active.addClass(direction);$next.addClass(direction);$active.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active");$active.removeClass(["active",direction].join(" "));that.sliding=false;setTimeout(function(){that.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{this.$element.trigger(e);if(e.isDefaultPrevented())return;$active.removeClass("active");$next.addClass("active");this.sliding=false;this.$element.trigger("slid")}isCycling&&this.cycle();return this};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.carousel");var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=="object"&&option);var action=typeof option=="string"?option:options.slide;if(!data)$this.data("bs.carousel",data=new Carousel(this,options));if(typeof option=="number")data.to(option);else if(action)data[action]();else if(options.interval)data.pause().cycle()})};$.fn.carousel.Constructor=Carousel;$.fn.carousel.noConflict=function(){$.fn.carousel=old;return this};$(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(e){var $this=$(this),href;var $target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""));var options=$.extend({},$target.data(),$this.data());var slideIndex=$this.attr("data-slide-to");if(slideIndex)options.interval=false;$target.carousel(options);if(slideIndex=$this.attr("data-slide-to")){$target.data("bs.carousel").to(slideIndex)}e.preventDefault()});$(window).on("load",function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this);$carousel.carousel($carousel.data())})})}(jQuery);+function($){"use strict";var Collapse=function(element,options){this.$element=$(element);this.options=$.extend({},Collapse.DEFAULTS,options);this.transitioning=null;if(this.options.parent)this.$parent=$(this.options.parent);if(this.options.toggle)this.toggle()};Collapse.DEFAULTS={toggle:true};Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"};Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var startEvent=$.Event("show.bs.collapse");this.$element.trigger(startEvent);if(startEvent.isDefaultPrevented())return;var actives=this.$parent&&this.$parent.find("> .panel > .in");if(actives&&actives.length){var hasData=actives.data("bs.collapse");if(hasData&&hasData.transitioning)return;actives.collapse("hide");hasData||actives.data("bs.collapse",null)}var dimension=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[dimension](0);this.transitioning=1;var complete=function(){this.$element.removeClass("collapsing").addClass("in")[dimension]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")};if(!$.support.transition)return complete.call(this);var scrollSize=$.camelCase(["scroll",dimension].join("-"));this.$element.one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])};Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var startEvent=$.Event("hide.bs.collapse");this.$element.trigger(startEvent);if(startEvent.isDefaultPrevented())return;var dimension=this.dimension();this.$element[dimension](this.$element[dimension]())[0].offsetHeight;this.$element.addClass("collapsing").removeClass("collapse").removeClass("in");this.transitioning=1;var complete=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!$.support.transition)return complete.call(this);this.$element[dimension](0).one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)};Collapse.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.collapse");var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=="object"&&option);if(!data)$this.data("bs.collapse",data=new Collapse(this,options));if(typeof option=="string")data[option]()})};$.fn.collapse.Constructor=Collapse;$.fn.collapse.noConflict=function(){$.fn.collapse=old;return this};$(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(e){var $this=$(this),href;var target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"");var $target=$(target);var data=$target.data("bs.collapse");var option=data?"toggle":$this.data();var parent=$this.attr("data-parent");var $parent=parent&&$(parent);if(!data||!data.transitioning){if($parent)$parent.find('[data-toggle=collapse][data-parent="'+parent+'"]').not($this).addClass("collapsed");$this[$target.hasClass("in")?"addClass":"removeClass"]("collapsed")}$target.collapse(option)})}(jQuery);+function($){"use strict";var backdrop=".dropdown-backdrop";var toggle="[data-toggle=dropdown]";var Dropdown=function(element){var $el=$(element).on("click.bs.dropdown",this.toggle)};Dropdown.prototype.toggle=function(e){var $this=$(this);if($this.is(".disabled, :disabled"))return;var $parent=getParent($this);var isActive=$parent.hasClass("open");clearMenus();if(!isActive){if("ontouchstart"in document.documentElement&&!$parent.closest(".navbar-nav").length){$('");MarkdownEditor.refreshPreview()}else{setTimeout(function(){setEditorContent(content,true,preview)},200)}}}}function previewIsEmpty(preview){if(!preview||preview.substr(0,previewToken.length)==previewToken){return true}return false}function getEditorContent(isMarkdown){if(!isMarkdown){var editor=tinymce.activeEditor;if(editor){var content=$(editor.getBody());content.find("pinit").remove();content.find(".thunderpin").remove();content.find(".pin").parent().remove();content=$(content).html();if(content){while(true){var lastEndScriptPos=content.lastIndexOf("");if(lastEndScriptPos==-1){return content}var length=content.length;if(length-9==lastEndScriptPos){var lastScriptPos=content.lastIndexOf("");if(lastEndScriptPos==-1){return content}var length=content.length;if(length-9==lastEndScriptPos){var lastScriptPos=content.lastIndexOf("