Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/webdoc
diff options
context:
space:
mode:
authorNina Vyedin <nina.vyedin@gmail.com>2013-03-05 06:59:55 +0400
committerNina Vyedin <nina.vyedin@gmail.com>2013-03-05 07:57:37 +0400
commit6d63ba2d7867682cb21159b483a3cdfcd1ec2568 (patch)
tree4a3eb1a87d5645a23d3ebb0249c94656f1befea3 /webdoc
parentcc1c0b498515fff818a4f3d2fc859779f5b2cc11 (diff)
[webdoc] some more refactoring work with webdoc and the plugins
Diffstat (limited to 'webdoc')
-rw-r--r--webdoc/api.master17
-rw-r--r--webdoc/common.css39
-rw-r--r--webdoc/common.js46
-rw-r--r--webdoc/index.aspx40
-rw-r--r--webdoc/monodoc.ashx54
-rw-r--r--webdoc/plugins.def11
-rw-r--r--webdoc/web.config13
7 files changed, 50 insertions, 170 deletions
diff --git a/webdoc/api.master b/webdoc/api.master
index 10ea2d1d..bf25924b 100644
--- a/webdoc/api.master
+++ b/webdoc/api.master
@@ -13,28 +13,25 @@
<title><% = WebConfigurationManager.AppSettings["Title"] %></title>
<link href="favicon.ico" type="image/png" rel="icon">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
- <link type="text/css" rel="stylesheet" href="reset.css"/>
- <link type="text/css" rel="stylesheet" href="common.css"/>
+ <link type="text/css" rel="stylesheet" href="/views/reset.css"/>
+ <link type="text/css" rel="stylesheet" href="/views/common.css"/>
<% = Plugin.GetPluginContent (Plugin.PluginContent.Css) %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <script type="text/javascript" src="common.js"></script>
+ <script type="text/javascript" src="http://new.xamarin.com/js/jquery.easing.1.3.js"></script>
+ <script type="text/javascript" src="/views/common.js"></script>
</head>
<body>
<% = Plugin.GetPluginContent (Plugin.PluginContent.Header) %>
<form id="application_content" runat="server">
<asp:contentplaceholder id="Main" runat="server" />
+ <asp:contentplaceholder id="FastSearch" runat="server" />
- <!--uncomment if you want to use the contrib plugin
- <asp:contentplaceholder id="Login" runat="server" />-->
-
- <!--uncomment if you want to use the fastsearch plugin
- <asp:contentplaceholder id="FastSearch" runat="server" />-->
- <% = Plugin.GetPluginContent (Plugin.PluginContent.Footer) %>
+ <% = Plugin.GetPluginContent (Plugin.PluginContent.Footer) %>
<% = Plugin.GetPluginContent (Plugin.PluginContent.Javascript) %>
<!--uncomment if you want to use the sidebar plugin-->
- <asp:contentplaceholder id="TreeGenerator" runat="server" />
+ <asp:contentplaceholder id="CustomTreeGenerator" runat="server" />
</form>
</body>
diff --git a/webdoc/common.css b/webdoc/common.css
deleted file mode 100644
index 34478fb5..00000000
--- a/webdoc/common.css
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****Common.css*****/
-/*bare-bones css for most layouts*/
-body {
- padding: 0;
- height: 100%;
-}
-html {
- padding: 0;
- margin: 0 auto;
- height: 100%;
-}
-.code {
- font-family: "Courier New", Courier;
-}
-.table {
- padding-left:2px;
- padding-right:2px;
- padding-top:0px;
- padding-bottom:0px;
-}
-div.Content {
- margin-right: 1em;
-}
-iframe {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-#content_frame {
- width: 100%;
- height: 100%;
-}
-#main_part {
- width: 100%;
- height: 100%;
-}
diff --git a/webdoc/common.js b/webdoc/common.js
deleted file mode 100644
index 887b731f..00000000
--- a/webdoc/common.js
+++ /dev/null
@@ -1,46 +0,0 @@
-$(function () {
-//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 resize_mainpart = function () {
-// main_part.height (getHeight() - 75);
-// main_part.children('#side').css ('height', '100%');
- content_frame.css ('height', '97.5%');
- }
-
- var resizeTimer;
- $(window).resize(function() {
- clearTimeout(resizeTimer);
- resizeTimer = setTimeout(resize_mainpart, 100);
- });
-
- resize_mainpart ();*/
-});
diff --git a/webdoc/index.aspx b/webdoc/index.aspx
index 249eaf68..a5125054 100644
--- a/webdoc/index.aspx
+++ b/webdoc/index.aspx
@@ -26,35 +26,7 @@ string nQueryString=monodocUrl+"?";
}
</script>
-<div id="main_part">
- <!--TODO: wrap this as an option for the sidebar plugin...-->
- <div id="side">
- <a class="doc-sidebar-toggle shrink" href="#"></a>
- <a class="doc-sidebar-toggle expand" href="#"></a>
- <div id="contents" class="activeTab">
- <div id="contentList"></div>
- </div>
- </div>
- <div id="content_frame_wrapper"><iframe id="content_frame" src="<% =getContentFrame() %>"></iframe></div>
-</div>
-</asp:Content>
-
-<asp:Content ID="Login" ContentPlaceHolderID="Login" Runat="Server">
-<script language="C#" runat="server">
-void Page_Load (object sender, EventArgs e)
-{
- if (User.Identity.IsAuthenticated){
- login.NavigateUrl = "plugins/contributor-plugin/logout.aspx";
- login.Text = "Logged in as " + User.Identity.Name;
- } else {
- login.NavigateUrl = "javascript:parent.content.login (parent.content.window.location)";
- //login.Text = "Sign in / create account";
- }
-}
-</script>
-<div id="dlogin">
- <asp:HyperLink id="login" runat="server"/>
-</div>
+<div id="content_frame_wrapper"><iframe id="content_frame" src="<% =getContentFrame() %>"></iframe></div>
</asp:Content>
<asp:Content ID="fsearch" ContentPlaceHolderID="FastSearch" Runat="Server">
@@ -62,8 +34,13 @@ void Page_Load (object sender, EventArgs e)
<div id="fsearch_window"></div>
</asp:Content>
-<asp:Content ID="Tree" ContentPlaceHolderID="TreeGenerator" Runat="Server">
+<asp:Content ID="CustomTree" ContentPlaceHolderID="CustomTreeGenerator" Runat="Server">
<script type="text/javascript">
+ //create a container for the sidebar to sit in
+ var container = $("#sidebar_container");
+ container.append("<div id=\"side\"><div id=\"contents\" class=\"activeTab\"><div id=\"contentList\"></div></div></div>");
+
+ //populate the sidebar with our data
var tree = new PTree ();
tree.strSrcBase = 'monodoc.ashx?tree=';
tree.strActionBase = '?link=';
@@ -71,8 +48,9 @@ void Page_Load (object sender, EventArgs e)
tree.strImageExt = '.gif';
tree.onClickCallback = function (url) { change_page (url); };
var content = document.getElementById ('contentList');
- var root = tree.CreateItem (null, 'Documentation List', 'root:', '', true);
+ var root = tree.CreateItem (null, '', 'root:', '', true);
content.appendChild (root);
<% = Global.CreateTreeBootFragment () %>
</script>
</asp:Content>
+
diff --git a/webdoc/monodoc.ashx b/webdoc/monodoc.ashx
index 83c68e6c..8fdf59ce 100644
--- a/webdoc/monodoc.ashx
+++ b/webdoc/monodoc.ashx
@@ -24,7 +24,6 @@ using System.Xml;
using System.Xml.Xsl;
using System.Linq;
using Monodoc;
-using Monodoc.Generators;
using System.Text.RegularExpressions;
namespace Mono.Website.Handlers
@@ -32,7 +31,6 @@ namespace Mono.Website.Handlers
public class MonodocHandler : IHttpHandler
{
static DateTime monodoc_timestamp, handler_timestamp;
- HtmlGenerator generator = new HtmlGenerator (null);
static MonodocHandler ()
{
@@ -115,7 +113,7 @@ namespace Mono.Website.Handlers
// Walk the url, found what we are supposed to render.
//
string [] nodes = tree.Split (new char [] {'@'});
- Node current_node = Global.help_tree.RootNode;
+ Node current_node = Global.help_tree;
for (int i = 0; i < nodes.Length; i++){
try {
current_node = (Node)current_node.Nodes [int.Parse (nodes [i])];
@@ -134,7 +132,7 @@ namespace Mono.Website.Handlers
w.WriteStartElement ("tree");
w.WriteAttributeString ("text", n.Caption);
- if (n.Tree != null && n.Tree.HelpSource != null)
+ if (n.tree != null && n.tree.HelpSource != null)
w.WriteAttributeString ("action", HttpUtility.UrlEncode (n.PublicUrl));
if (n.Nodes != null){
@@ -223,13 +221,13 @@ namespace Mono.Website.Handlers
return;
Node n;
//Console.WriteLine ("Considering {0}", link);
+ string content = Global.help_tree.RenderUrl (link, out n);
CheckLastModified (context);
if (context.Response.StatusCode == 304){
//Console.WriteLine ("Keeping", link);
return;
}
- string content = Global.help_tree.RenderUrl (link, generator, out n);
PrintDocs (content, n, context, GetHelpSource (n));
}
@@ -300,7 +298,7 @@ namespace Mono.Website.Handlers
HelpSource GetHelpSource (Node n)
{
if (n != null)
- return n.Tree.HelpSource;
+ return n.tree.HelpSource;
return null;
}
@@ -333,7 +331,7 @@ namespace Mono.Website.Handlers
p, li, span, table, pre, .Content {
font-family: Helvetica, Verdana, Arial !important;
}
- .named-header { padding: 8px 0 20px 10px !important; font-weight: 600 !important; font-size: 2.3em !important; margin: 0.3em 0 0.6em 0 !important; margin-top: 0 !important; font-size: 2.3em !important; }
+ .named-header { height: auto !important; padding: 8px 0 20px 10px !important; font-weight: 600 !important; font-size: 2.3em !important; margin: 0.3em 0 0.6em 0 !important; margin-top: 0 !important; font-size: 2.3em !important; }
h2 { padding-top: 1em !important; margin-top: 0 !important; font-weight: 600 !important; font-size: 1.8em !important; color: #333 !important; }
p { margin: 0 0 1.3em !important; color: #555753 !important; line-height: 1.8 !important; }
body, table, pre { line-height: 1.8 !important; color: #55753 !important; }
@@ -341,24 +339,25 @@ namespace Mono.Website.Handlers
</style>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
-<script type='text/javascript'>
-function printFrame() {
- window.print();
- return false;
+ <script type='text/javascript'>
-}
-//pass the function object to parent
-parent.printFrame = printFrame;
+ function printFrame() {
+ window.print();
+ return false;
+ }
+
+ //pass the function object to parent
+ parent.printFrame = printFrame;
-function try_change_page (link, e)
-{
- if (!e)
- e = window.event;
- if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || e.modifiers > 0)
- return;
- window.parent.change_page (link)
-}
+ function try_change_page (link, e)
+ {
+ if (!e)
+ e = window.event;
+ if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || e.modifiers > 0)
+ return;
+ window.parent.change_page (link)
+ }
function login (rurl)
{
@@ -425,17 +424,18 @@ s.parentNode.insertBefore(ga, s);
ctx.Response.Write (title);
ctx.Response.Write ("</title>\n");
- if (hs != null && HtmlGenerator.InlineCss != null) {
+ if (hs != null && hs.InlineCss != null) {
ctx.Response.Write ("<style type=\"text/css\">\n");
- ctx.Response.Write (HtmlGenerator.InlineCss);
+ ctx.Response.Write (hs.InlineCss);
ctx.Response.Write ("</style>\n");
}
- /*if (hs != null && hs.InlineJavaScript != null) {
+ if (hs != null && hs.InlineJavaScript != null) {
ctx.Response.Write ("<script type=\"text/JavaScript\">\n");
ctx.Response.Write (hs.InlineJavaScript);
ctx.Response.Write ("</script>\n");
- }*/
- ctx.Response.Write (@"</head><body onLoad='load()'>");
+ }
+ ctx.Response.Write (@"</head><body onload='load()'>");
+ ctx.Response.Write (@"<iframe id='helpframe' src='' height='0' width='0' frameborder='0'></iframe>");
// Set up object variable, as it's required by the MakeLink delegate
requestPath=ctx.Request.Path;
diff --git a/webdoc/plugins.def b/webdoc/plugins.def
index ed267783..2bff8003 100644
--- a/webdoc/plugins.def
+++ b/webdoc/plugins.def
@@ -1,9 +1,10 @@
#####SKIN (pick ONE)#####
-#skins/xamarin-external
-skins/mono-external
+skins/xamarin-external
+#skins/mono-external
+#skins/xamarin-new
######PLUGINS######
-#plugins/search-plugin/fastsearch
-#plugins/search-plugin/fullsearch
+plugins/search-plugin/fastsearch
+plugins/search-plugin/fullsearch
+plugins/iframe-plugin
plugins/sidebar-plugin
-# plugins/contributior-plugin
diff --git a/webdoc/web.config b/webdoc/web.config
index d01792a7..0951f119 100644
--- a/webdoc/web.config
+++ b/webdoc/web.config
@@ -26,20 +26,9 @@
<appSettings>
<add key="Title" value="Xamarin API Documentation" />
<add key="MonoServerDefaultIndexFiles" value="index.aspx, Default.aspx, default.aspx, index.html, index.htm" />
- <add key="MonodocRootDir" value="/mono/lib/monodoc/" />
+ <add key="MonodocRootDir" value="/mono/lib/monodoc-ios/" />
<add key="Plugins" value="plugins.def" />
</appSettings>
- <!--FAIR WARNING: Contribution as a plugin is not tested or really enabled here, sorry. I'll fix that at a later date-->
- <location path="plugins/contribution-plugin/edit.aspx">
- <system.web>
- <authentication mode="Forms">
- <forms name=".MONOAUTH" loginUrl="plugins/contribution-plugin/login.aspx"/>
- </authentication>
- <authorization>
- <deny users="?" />
- </authorization>
- </system.web>
- </location>
</configuration>