diff options
author | Nina Vyedin <nina.vyedin@gmail.com> | 2013-03-05 03:58:53 +0400 |
---|---|---|
committer | Nina Vyedin <nina.vyedin@gmail.com> | 2013-03-05 07:57:22 +0400 |
commit | 5e782c027696ee173f17e7147f75179b90a3b057 (patch) | |
tree | ae507db61254708b4368fa18ef46819f90d17e01 /webdoc/plugins | |
parent | 3c7ab1998891fe3a22fefaf5c9b1ace9b1f4026c (diff) |
[webdoc] some refactoring of the sidebar plugin
Diffstat (limited to 'webdoc/plugins')
6 files changed, 22 insertions, 83 deletions
diff --git a/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.css b/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.css index d2cf6310..a115b541 100755 --- a/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.css +++ b/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.css @@ -13,8 +13,6 @@ margin: 0px; padding: 0px; border: 0px; - height: 33px; - line-height: 21px; } .tree-node-collapsed .tree-node, @@ -27,19 +25,16 @@ .tree-label-selected a:hover { text-decoration: none; - color: #2a2c2f; } .tree-label a { text-decoration: none; - color: #2a2c2f; } .tree-label a:hover { text-decoration: none; - color: #2a2c2f; } .tree-node img diff --git a/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.js b/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.js index 6f5de0a4..c352c7ed 100755 --- a/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.js +++ b/webdoc/plugins/sidebar-plugin/dependencies/ptree/tree.js @@ -95,19 +95,21 @@ function PTree () if (strAction) { - eltDescription = document.createElement ("a"); + eltDescription = document.createElement ("span"); + eltDescription.className = "link"; + eltD = document.createElement ("a"); if (strAction.indexOf ('http://') === 0) - eltDescription.href = strAction; + eltD.href = strAction; else - eltDescription.href = this.strActionBase + strAction; - eltDescription.title = strText; + eltD.href = this.strActionBase + strAction; + eltD.title = strText; if (strTarget) - eltDescription.target = strTarget; + eltD.target = strTarget; else if (this.strTargetDefault) - eltDescription.target = this.strTargetDefault; - eltDescription.appendChild (eltText); + eltD.target = this.strTargetDefault; + eltD.appendChild (eltText); var parent = this; - eltDescription.onclick = function (e) { + eltD.onclick = function (e) { if (!e) e = window.event; if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || e.modifiers > 0) @@ -123,8 +125,9 @@ function PTree () parent.onClickCallback(strAction); } } - eltDescription.onmouseover = function () { this.blur (); } - eltDescription.onmouseup = function () { this.blur (); } + eltD.onmouseover = function () { this.blur (); } + eltD.onmouseup = function () { this.blur (); } + eltDescription.appendChild(eltD); } else { diff --git a/webdoc/plugins/sidebar-plugin/dependencies/xtree/xtree.js b/webdoc/plugins/sidebar-plugin/dependencies/xtree/xtree.js index 518dacdd..25654607 100644 --- a/webdoc/plugins/sidebar-plugin/dependencies/xtree/xtree.js +++ b/webdoc/plugins/sidebar-plugin/dependencies/xtree/xtree.js @@ -363,9 +363,9 @@ WebFXTree.prototype.keydown = function(key) { WebFXTree.prototype.toString = function() { var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this, event)\">" + "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + - "<a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + + "<p><a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + (this.target ? " target=\"" + this.target + "\"" : "") + - ">" + this.text + "</a></div>" + + ">" + this.text + "</a></p></div>" + "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; var sb = []; for (var i = 0; i < this.childNodes.length; i++) { @@ -527,9 +527,9 @@ WebFXTreeItem.prototype.toString = function (nItem, nItemCount) { indent + "<img id=\"" + this.id + "-plus\" src=\"" + ((this.folder)?((this.open)?((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon):((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon)):((this.parentNode._last)?webFXTreeConfig.lIcon:webFXTreeConfig.tIcon)) + "\" onclick=\"webFXTreeHandler.toggle(this);\">" + "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + - "<a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + + "<p><a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + (this.target ? " target=\"" + this.target + "\"" : "") + - ">" + label + "</a></div>" + + ">" + label + "</a></p></div>" + "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; var sb = []; for (var i = 0; i < this.childNodes.length; i++) { diff --git a/webdoc/plugins/sidebar-plugin/make-tree.js b/webdoc/plugins/sidebar-plugin/make-tree.js index 19de56ba..27b42db8 100644 --- a/webdoc/plugins/sidebar-plugin/make-tree.js +++ b/webdoc/plugins/sidebar-plugin/make-tree.js @@ -4,9 +4,10 @@ $(function() { change_page = function (pagename) { content_frame.attr ('src', 'monodoc.ashx?link=' + pagename); - page_link.attr ('href', '?link=' + pagename); - if (window.history && window.history.pushState) - window.history.pushState (null, '', '/?link=' + pagename); + page_link.attr ('href', '?link=' + pagename); + if (window.history && window.history.pushState) { + window.history.pushState (null, '', '/?link=' + pagename); + } }; update_tree = function () { @@ -24,7 +25,7 @@ $(function() { var id = contentDiv.attr ('id').replace (':Summary', ''); var h2 = contentDiv.children ('h2').first (); if (h2.prev ().attr ('class') != 'native-browser') - h2.before ('<p><a class="native-browser" href="mdoc://' + encodeURIComponent (id) + '"><span class="native-icon"><img src="images/native-browser-icon.png" /></span>Open in Native Browser</a></p>'); + h2.before ('<p><a class="native-browser" href="mdoc://' + encodeURIComponent (id) + '"><span class="native-icon"><img src="/views/images/native-browser-icon.png" /></span>Open in Native Browser</a></p>'); } }; add_native_browser_link (); diff --git a/webdoc/plugins/sidebar-plugin/sidebar.css b/webdoc/plugins/sidebar-plugin/sidebar.css index 97a5f115..5cb10ba3 100644 --- a/webdoc/plugins/sidebar-plugin/sidebar.css +++ b/webdoc/plugins/sidebar-plugin/sidebar.css @@ -6,7 +6,6 @@ } .activeTab { - padding-top: 15px; padding-left: 10px; padding-right: 10px; display: block !important; @@ -124,10 +123,3 @@ a.selected { margin-top: 10px; } -#contentList > div.tree-node:first-child > span { - font-size: 18px; - height: 35px; - line-height: 35px; - padding: 0 10px; -} - diff --git a/webdoc/plugins/sidebar-plugin/viewport.js b/webdoc/plugins/sidebar-plugin/viewport.js deleted file mode 100644 index 2350601d..00000000 --- a/webdoc/plugins/sidebar-plugin/viewport.js +++ /dev/null @@ -1,52 +0,0 @@ -$(function () { - - var sidebar_width = '251px'; -//a hack for sizing our iframe correctly - var getHeight = function () { - <!-- - var viewportwidth; - var viewportheight; - // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight - if (typeof window.innerWidth != 'undefined') - { - viewportwidth = window.innerWidth, - viewportheight = window.innerHeight - } - // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) - else if (typeof document.documentElement != 'undefined' - && typeof document.documentElement.clientWidth != - 'undefined' && document.documentElement.clientWidth != 0) - { - viewportwidth = document.documentElement.clientWidth, - viewportheight = document.documentElement.clientHeight - } - // older versions of IE - else - { - viewportwidth = document.getElementsByTagName('body')[0].clientWidth, - viewportheight = document.getElementsByTagName('body')[0].clientHeight - } - return viewportheight; - //--> - } - - var main_part = $('#main_part'); - var content_frame = main_part.find('#content_frame'); - var content_frame_wrapper = main_part.find('#content_frame_wrapper'); - var resize_mainpart = function () { - main_part.height (getHeight() - 75); - main_part.children('#side').css ('height', '100%'); - main_part.children('#side').css ('width', sidebar_width); - content_frame.css ('height', '97.5%'); - content_frame_wrapper.css('margin-left', sidebar_width); - } - - var resizeTimer; - $(window).resize(function() { - clearTimeout(resizeTimer); - resizeTimer = setTimeout(resize_mainpart, 100); - }); - - resize_mainpart (); -}); - |