moving auto complete forms to VIVO b/c rely on autocomplete javascript that exists in VIVO

This commit is contained in:
hjkhjk54 2011-12-06 18:46:41 +00:00
parent ba94069ac5
commit 750d77c31c
2 changed files with 0 additions and 160 deletions

View file

@ -1,69 +0,0 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- autocomplete template for data properties -->
<#-- NOTE the jsp contained the following which has not been converted
<jsp:include page="${preForm}">
<jsp:param name="useTinyMCE" value="false"/>
<jsp:param name="useAutoComplete" value="true"/>
</jsp:include>
-->
<script type="text/javascript" language="javascript">
$(this).load($(this).parent().children('a').attr('src')+" .editForm");
$(document).ready(function() {
var key = $("input[name='editKey']").attr("value");
$.getJSON("<c:url value="/dataservice"/>", {getN3EditOptionList:"1", field: "${dataLiteral}", editKey: key}, function(json){
$("select#${dataLiteral}").replaceWith("<input type='hidden' id='${dataLiteral}' name='${dataLiteral}' /><input type='text' id='${dataLiteral}-entry' name='${dataLiteral}-entry' />");
$("#${dataLiteral}-entry").autocomplete(json, {
minChars: 1,
width: 320,
matchContains: true,
mustMatch: 0,
autoFill: false,
// formatItem: function(row, i, max) {
// return row[0];
// },
// formatMatch: function(row, i, max) {
// return row[0];
// },
// formatResult: function(row) {
// return row[0];
// }
}).result(function(event, data, formatted) {
$("input#${dataLiteral}-entry").attr("value", data[0]); // dump the string into the text box
$("input#${dataLiteral}").attr("value", data[1]); // dump the uri into the hidden form input
});
}
);
})
</script>
<h2>${formTitle}</h2>
<form id="autoCompleteDatapropForm" class="editForm" action="${submitUrl}" role="autocomplete">
<#if predicate.publicDescription?has_content >
<p class="propEntryHelpText">${predicate.publicDescription}</p>
</#if>
<p>
<select id="dataLiteral" name="dataLiteral">
<#list dataLiteral as key>
<opton value="${key}"
<#if editConfiguration.objectUri?has_contant && editConfiguration.object.Uri = key>selected</#if>
</#list>
</select>
</p>
<p class="submit">
<input type="submit" id="submit" value="editConfiguration.submitLabel"/>
<span class="or"> or <a class="cancel" href="${editConfiguration.cancelUrl}" title="cancel">Cancel</a>
</p>
</form>

View file

@ -1,91 +0,0 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--Assign variables from editConfig-->
<#assign rangeOptions = editConfiguration.pageData.objectVar />
<#assign rangeOptionsExist = false />
<#if (rangeOptions?keys?size > 0)>
<#assign rangeOptionsExist = true/>
</#if>
<h2>${editConfiguration.formTitle}</h2>
<#if editConfiguration.propertySelectFromExisting = true>
<#if rangeOptionsExist = true >
<#assign rangeOptionKeys = rangeOptions?keys />
<form class="editForm" action = "${submitUrl}">
<input type="hidden" name="editKey" id="editKey" value="${editKey}" role="input" />
<#if editConfiguration.propertyPublicDescription?has_content>
<p>${editConfiguration.propertyPublicDescription}</p>
</#if>
<#---This section should become autocomplete instead-->
<p>
<label for="relatedIndLabel">Concept <span class='requiredHint'> *</span></label>
<input class="acSelector" size="50" type="text" id="relatedIndLabel" name="objectLabel" value="" />
</p>
<div class="acSelection">
<p class="inline">
<label>Selected:</label>
<span class="acSelectionInfo"></span>
<a href="/vivo/individual?uri="
class="verifyMatch">(Verify this match)</a>
</p> <input class="acUriReceiver" type="hidden" id="objectVar" name="objectVar" value="" />
</div>
<#--The above section should be autocomplete-->
<p>
<input type="submit" id="submit" value="${editConfiguration.submitLabel}" role="button "/>
<span class="or"> or </span>
<a title="Cancel" class="cancel" href="${cancelUrl}">Cancel</a>
</p>
</form>
<#else>
<p> There are no entries in the system from which to select. </p>
</#if>
</#if>
<#if editConfiguration.propertyOfferCreateNewOption = true>
<#include "defaultOfferCreateNewOptionForm.ftl">
</#if>
<#if editConfiguration.propertySelectFromExisting = false && editConfiguration.propertyOfferCreateNewOption = false>
<p>This property is currently configured to prohibit editing. </p>
</#if>
<#if editConfiguration.includeDeletionForm = true>
<#include "defaultDeletePropertyForm.ftl">
</#if>
<#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" >
<script type="text/javascript">
var customFormData = {
acUrl: '${urls.base}/autocomplete?tokenize=true',
acType: 'http://vivoweb.org/ontology/core#FacultyMember,http://vivoweb.org/ontology/core#Librarian',
acMultipleTypes: 'true',
submitButtonTextType: 'simple',
editMode: 'add',
defaultTypeName: 'thing' // used in repair mode to generate button text
};
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customFormWithAutocomplete.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/edit/forms/js/customFormWithAutocomplete.js"></script>')}