зеркало из https://github.com/telerik/docs-seed.git
Merge pull request #6 from telerik/master
Merging dynamic controls table into to be able to use it in ajax docs
This commit is contained in:
Коммит
34bee082b8
|
@ -1,125 +1,18 @@
|
|||
<table id="allcontrols-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li class="control-category">Data Management</li>
|
||||
<li>{% mdslug %} [CollectionNavigator]({%slug collectionnavigator_overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [DataFilter]({%slug datafilter-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [DataForm]({%slug raddataform-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [DataPager]({%slug datapager-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [DataServiceDataSource]({%slug raddataservicedatasource-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'Silverlight' %}<li>{% mdslug %} [DomainDataSource]({%slug dds-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [EntityFrameworkDataSource]({%slug entityframework-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [ExpressionEditor]({%slug radexpressioneditor-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [GridView]({%slug gridview-overview2%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [VirtualGrid]({%slug virtualgrid-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [ListBox]({%slug radlistbox-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [PivotGrid]({%slug radpivotgrid-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [PropertyGrid]({%slug radpropertygrid-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TreeListView]({%slug radtreelistview-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [MultiColumnComboBox ]({%slug multicolumncombobox-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li class="control-category">Scheduling</li>
|
||||
<li>{% mdslug %} [Calendar]({%slug radcalendar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [DateTimePicker]({%slug raddatetimepicker-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ScheduleView]({%slug radscheduleview-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TimePicker]({%slug radtimepicker-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [TimeSpanPicker]({%slug radtimespanpicker-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li class="control-category">Data Visualization</li>
|
||||
<li>{% mdslug %} [Barcode]({%slug radbarcode-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [BulletGraph]({%slug radbulletgraph_overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Chart]({%slug radchart-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ChartView]({%slug radchartview-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [ChartView3D]({%slug radchartview3d-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [DataBar]({%slug raddatabar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Diagram Framework]({%slug raddiagram-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [GanttView]({%slug radganttview-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Gauge]({%slug radgauge-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [HeatMap]({%slug radheatmap-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Legend]({%slug radlegend-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Map]({%slug radmap-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Sparkline]({%slug radsparkline_overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TimeBar]({%slug radtimebar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Timeline]({%slug radtimeline-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TreeMap and PivotMap]({%slug radtreemap-overview%}) {% endmdslug %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li class="control-category">Editors</li>
|
||||
<li>{% mdslug %} [AutoCompleteBox]({%slug radautocompletebox-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Calculator]({%slug radcalculator-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ColorEditor]({%slug radcoloreditor-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ColorPicker]({%slug radcolorpicker-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ComboBox]({%slug radcombobox-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [MaskedInput]({%slug radmaskedinput-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [NumericUpDown]({%slug radnumericupdown-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [PasswordBox]({%slug radpasswordbox-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [Rating]({%slug radrating-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [RichTextBox]({%slug radrichtextbox-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Slider]({%slug radslider-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [SpellChecker]({%slug radspellchecker-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Spreadsheet]({%slug radspreadsheet-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [WatermarkTextBox]({%slug radwatermarktextbox-overview%}) {% endmdslug %}</li>
|
||||
<li class="control-category">Media</li>
|
||||
<li>{% mdslug %} [ImageEditor]({%slug radimageeditor-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'Silverlight' %}<li>{% mdslug %} [HtmlPlaceholder]({%slug radhtmlplaceholder-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
{% if site.site_name == 'Silverlight' %}<li>{% mdslug %} [MediaPlayer]({%slug radmediaplayer-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li class="control-category">Navigation</li>
|
||||
<li>{% mdslug %} [Breadcrumb]({%slug radbreadcrumb-overvew%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Buttons]({%slug radbuttons-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ContextMenu]({%slug contextmenu-overview1%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'Silverlight' %}<li>{% mdslug %} [ConverFlow]({%slug coverflow-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [Menu]({%slug radmenu-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [OutlookBar]({%slug radoutlookbar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [PanelBar]({%slug radpanelbar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [RadialMenu]({%slug radradialmenu-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [RibbonView]({%slug radribbonview-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TabControl]({%slug radtabcontrol-overview2%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ToolBar]({%slug radtoolbar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TreeView]({%slug radtreeview-overview2%}) {% endmdslug %}</li>
|
||||
<li class="control-category">Interactivity & UX</li>
|
||||
<li>{% mdslug %} [BusyIndicator]({%slug radbusyindicator-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [DesktopAlert]({%slug raddesktopalert-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [DragDropManager]({%slug dragdropmanager-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [PersistenceFramework]({%slug persistence-framework-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ProgressBar]({%slug radprogressbar-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [ToolTip]({%slug radtooltip-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TouchManager]({%slug touchmanager-overview%}) {% endmdslug %}</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li class="control-category">File Upload & Management</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [CloudUpload]({%slug radcloudupload-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [FileDialogs]({%slug radfiledialogs-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [PdfProcessing]({%slug radpdfprocessing-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [PdfViewer]({%slug radpdfviewer-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [SpreadProcessing]({%slug radspreadprocessing-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [SpreadStreamProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radspreadstreamprocessing/overview) {% endmdslug %}</li>{% endif %}
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [WordsProcessing]({%slug radwordsprocessing-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
{% if site.site_name == 'Silverlight' %}<li>{% mdslug %} [Upload]({%slug radupload-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [ZipLibrary]({%slug radziplibrary-overview%}) {% endmdslug %}</li>
|
||||
<li class="control-category">Layout</li>
|
||||
<li>{% mdslug %} [Book]({%slug radbook-visual-structure%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [Carousel]({%slug carousel-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [Docking]({%slug raddocking-overview2%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Expander]({%slug radexpander-overview%}) {% endmdslug %}</li>
|
||||
{% if site.site_name == 'WPF' %}<li>{% mdslug %} [LayoutControl]({%slug radlayoutcontrol-overview%}) {% endmdslug %}</li>{% endif %}
|
||||
<li>{% mdslug %} [TileList]({%slug radtilelist-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TileView]({%slug radtileview-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [TransitionControl]({%slug radtransition-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Window]({%slug radwindow-overview%}) {% endmdslug %}</li>
|
||||
<li>{% mdslug %} [Wizard]({%slug wizard-overview%}) {% endmdslug %}</li>
|
||||
</ul>
|
||||
{% for intro_column in site.intro_columns %}
|
||||
<td>
|
||||
<ul>
|
||||
{% for category in intro_column.categories %}
|
||||
<li class="control-category">{{ category.title }}</li>
|
||||
{% for item in category.items %}
|
||||
<li><a href="{% if item[1].isLink == true %}{{ item[1].value }}{% else %}{%slug {{ item[1] }}%}{% endif %}">{{ item[0] }}</a></li>
|
||||
{% endfor%}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -1,61 +1,63 @@
|
|||
class SlugTag < Liquid::Tag
|
||||
@@page_by_slug = nil
|
||||
@@page_by_slug = nil
|
||||
|
||||
def initialize(tag_name, text, tokens)
|
||||
@text = text.strip
|
||||
end
|
||||
def initialize(tag_name, text, tokens)
|
||||
@text = text.strip
|
||||
@template = Liquid::Template.parse(@text)
|
||||
end
|
||||
|
||||
def index_slugs(site)
|
||||
return if @@page_by_slug
|
||||
def index_slugs(site)
|
||||
return if @@page_by_slug
|
||||
|
||||
@@page_by_slug = Hash.new
|
||||
Jekyll.logger.info " Indexing slugs in #{site.pages.length} pages..."
|
||||
@@page_by_slug = Hash.new
|
||||
Jekyll.logger.info " Indexing slugs in #{site.pages.length} pages..."
|
||||
|
||||
duplicates = false
|
||||
site.pages.each do |p|
|
||||
slug = p.data['slug']
|
||||
if (slug)
|
||||
if @@page_by_slug.has_key?(slug)
|
||||
Jekyll.logger.warn "Duplicate slug '#{slug}' on #{p.url}"
|
||||
duplicates = true
|
||||
end
|
||||
duplicates = false
|
||||
site.pages.each do |p|
|
||||
slug = p.data['slug']
|
||||
if (slug)
|
||||
if @@page_by_slug.has_key?(slug)
|
||||
Jekyll.logger.warn "Duplicate slug '#{slug}' on #{p.url}"
|
||||
duplicates = true
|
||||
end
|
||||
|
||||
@@page_by_slug[slug] = p
|
||||
end
|
||||
end
|
||||
@@page_by_slug[slug] = p
|
||||
end
|
||||
end
|
||||
|
||||
if duplicates
|
||||
# raise "Duplicate slugs found. Aborting"
|
||||
else
|
||||
Jekyll.logger.info " Done. Found #{@@page_by_slug.length} unique slugs."
|
||||
end
|
||||
end
|
||||
if duplicates
|
||||
# raise "Duplicate slugs found. Aborting"
|
||||
else
|
||||
Jekyll.logger.info " Done. Found #{@@page_by_slug.length} unique slugs."
|
||||
end
|
||||
end
|
||||
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
index_slugs site
|
||||
slug_overrides = site.config['slug_overrides'] || Hash.new
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
index_slugs site
|
||||
slug_overrides = site.config['slug_overrides'] || Hash.new
|
||||
|
||||
page = @@page_by_slug[@text]
|
||||
page_url = context.environments.first["page"]["url"]
|
||||
@text = @template.render(context)
|
||||
page = @@page_by_slug[@text]
|
||||
page_url = context.environments.first["page"]["url"]
|
||||
|
||||
if !page && page_url =~ /\.X\//
|
||||
root_slug = @text.sub(/.*\.X_(.*)/, '\1')
|
||||
page = @@page_by_slug[root_slug]
|
||||
end
|
||||
if !page && page_url =~ /\.X\//
|
||||
root_slug = @text.sub(/.*\.X_(.*)/, '\1')
|
||||
page = @@page_by_slug[root_slug]
|
||||
end
|
||||
|
||||
if page
|
||||
return site.baseurl + page.url.sub('.html', '')
|
||||
elsif slug_overrides.has_key? @text
|
||||
return site.baseurl + slug_overrides[@text]
|
||||
else
|
||||
Jekyll.logger.warn "ERROR:", "No page with slug `#{@text}` in #{page_url}. Consider fixing the slug or use normal link."
|
||||
if page
|
||||
return site.baseurl + page.url.sub('.html', '')
|
||||
elsif slug_overrides.has_key? @text
|
||||
return site.baseurl + slug_overrides[@text]
|
||||
else
|
||||
Jekyll.logger.warn "ERROR:", "No page with slug `#{@text}` in #{page_url}. Consider fixing the slug or use normal link."
|
||||
|
||||
at_exit do
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
at_exit do
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('slug', SlugTag)
|
||||
|
|
|
@ -12,4 +12,4 @@ class TimeStampTag < Liquid::Block
|
|||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('timestamp', TimeStampTag)
|
||||
Liquid::Template.register_tag('timestamp', TimeStampTag)
|
||||
|
|
Загрузка…
Ссылка в новой задаче