Added "Enable Section Achors" configuration option.

This commit is contained in:
Dario Solera 2009-10-06 15:21:59 +00:00
parent 84618e26e7
commit 947e8cdce0
26 changed files with 161 additions and 10 deletions

View file

@ -871,13 +871,15 @@ namespace ScrewTurn.Wiki {
/// <param name="buffer">The string builder.</param>
/// <param name="id">The anchor ID.</param>
private static void BuildHeaderAnchor(StringBuilder buffer, string id) {
buffer.Append(@"<a class=""headeranchor"" id=""");
buffer.Append(id);
buffer.Append(@""" href=""#");
buffer.Append(id);
buffer.Append(@""" title=""");
buffer.Append(Exchanger.ResourceExchanger.GetResource("LinkToThisSection"));
buffer.Append(@""">&#0182;</a>");
if(Settings.EnableSectionAnchors) {
buffer.Append(@"<a class=""headeranchor"" id=""");
buffer.Append(id);
buffer.Append(@""" href=""#");
buffer.Append(id);
buffer.Append(@""" title=""");
buffer.Append(Exchanger.ResourceExchanger.GetResource("LinkToThisSection"));
buffer.Append(@""">&#0182;</a>");
}
}
/// <summary>

View file

@ -696,6 +696,18 @@ namespace ScrewTurn.Wiki {
}
}
/// <summary>
/// Gets or sets a value indicating whether to display section anchors.
/// </summary>
public static bool EnableSectionAnchors {
get {
return GetBool(Provider.GetSetting("EnableSectionAnchors"), true);
}
set {
Provider.SetSetting("EnableSectionAnchors", PrintBool(value));
}
}
/// <summary>
/// Gets or sets a value indicating whether to disable the Breadcrumbs Trail.
/// </summary>