Merge pull request #140 from pynej/search-node-type

Add node type to search results
This commit is contained in:
Sebastiaan Janssen
2013-12-08 07:56:50 -08:00
5 changed files with 28 additions and 15 deletions

View File

@@ -56,7 +56,10 @@
return parsed;
},
formatItem: function (item) {
return item.Fields.nodeName + " <span class='nodeId'>(" + item.Id + ")</span>";
return item.Fields.nodeName + " <span class='nodeId'>(" + item.Id + ") </span>";
},
focus: function (event, ui) {
$(ui).attr("title", $(ui).find("span[title]").attr("title"));
}
};

View File

@@ -18,6 +18,7 @@
</xsl:if>
<xsl:value-of select="@title"/>
</a>
<small><strong>Node Type: </strong> <xsl:value-of select="@type"/></small>
</h4>
<p>
<em>Last updated <xsl:value-of select="@author"/> on <xsl:value-of select="@changeDate"/>

View File

@@ -1,13 +1,13 @@
/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
*/
; (function($) {
@@ -429,7 +429,8 @@
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
},
scroll: true,
scrollHeight: 180
scrollHeight: 180,
focus: function (event, ui) { }
};
$.Autocompleter.Cache = function(options) {
@@ -526,9 +527,9 @@
load: function(q) {
if (!options.cacheLength || !length)
return null;
/*
* if dealing w/local data and matchContains than we must make sure
* to loop through all the data collections looking for matches
/*
* if dealing w/local data and matchContains than we must make sure
* to loop through all the data collections looking for matches
*/
if (!options.url && options.matchContains) {
// track all matches
@@ -599,6 +600,7 @@
if (target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
options.focus(event, target(event));
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
@@ -632,6 +634,8 @@
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
movePosition(step);
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
options.focus(null, activeItem);
if (options.scroll) {
var offset = 0;
listItems.slice(0, active).each(function() {

View File

@@ -35,6 +35,10 @@
{
font-weight: normal;
color: #666;
font-size: .9em;
}
.propertypane small strong {
color: #000;
}
.propertypane div.propertyItem{

View File

@@ -103,6 +103,7 @@ namespace umbraco.presentation.dialogs
x.Attributes.Append(XmlHelper.AddAttribute(result, "title", r.Fields["nodeName"]));
x.Attributes.Append(XmlHelper.AddAttribute(result, "author", r.Fields["writerName"]));
x.Attributes.Append(XmlHelper.AddAttribute(result, "changeDate", r.Fields["updateDate"]));
x.Attributes.Append(xmlHelper.addAttribute(result, "type", r.Fields["nodeTypeAlias"]));
result.DocumentElement.AppendChild(x);
}