Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"server":"https://apisdev.acdh.oeaw.ac.at/entities/autocomplete/",
"server":"https://mpr.acdh-dev.oeaw.ac.at/apis/entities/entity/autocomplete/",
"types":{
"person":"Person",
"place":"Ort"
"place":"Ort",
"institution":"Institution"
},
"strings":[
"Vom Editor verbessert für",
Expand Down
63 changes: 50 additions & 13 deletions entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,69 @@
<head>
<meta charset="utf-8" />
<base target="_top"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css" integrity="sha256-xJOZHfpxLR/uhh1BwYFS5fhmOAdIRQaiOul5F/b7v3s=" crossorigin="anonymous" />
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js" integrity="sha256-FA14tBI8v+/1BtcH9XtJpcNbComBEpdawUZA6BPXRVw=" crossorigin="anonymous"></script>
<script src="https://appsforoffice.microsoft.com/lib/1.0/hosted/office.js" type="text/javascript"></script>
<script src="process.js" type="text/javascript"></script>
<script src="entity.js" type="text/javascript"></script>
<script src="form.js" type="text/javascript"></script>
<style>
.select2-container--default .select2-results>.select2-results__options{
max-height: 90%;
}
</style>
</head>
<body>
<form action="entity.html" method="post" id="entity-form" onsubmit="return insertLink();">
<select id="type">
</select>
<label for="search-entity">Suchbegriff:</label>
<select id="search-entity" style="width: 100%"></select>
<form action="#" method="post" id="person-form">
<div class="form-group">
<select id="type">
<option value="person">Personen</option>
<option value="place">Orte</option>
<option value="institution">Institutionen</option>
</select>
<label for="form_people">Suchbegriff:</label>
<select id="form_people" style="width: 100%"></select>
</div>
<input name="submit" value="Create" class="btn btn-primary" id="submit-id-submit" type="submit"/>
<a name="check" value="Check" class="btn btn-primary" id="id-check" type="button" href="#">Check</a>
</form>
<!--<div id="form_people"></div>-->
<div id="form_people"></div>
<div id="history"></div>
<script type="text/javascript">
$('#entity-form').on('submit', function (event) {
$('#form_people').select2({
minimumInputLength: 2,
escapeMarkup: function(markup) {
return markup;
},
templateResult: function(data) {
return data.text;
},
templateSelection: function(data) {
return data.text;
},
ajax: {
url: function() { return 'https://mpr.acdh-dev.oeaw.ac.at/entities/autocomplete/' + $('#type').val() + '/' },
dataType: 'json',
processResults: function (data) {
return { results: process(data) };
}
}
});

$('body').on('submit', 'form#person-form', function(event) {
event.stopPropagation();
event.preventDefault();
var link = $('select#search-entity').val();
console.log(link);
insertLink (link);
var link = $('select#form_people').val();
console.log( link );
insertLink ( link );
});
</script>

$("#id-check").on("click", function(){
var link = $('select#form_people').val();
$("#id-check").attr('href',link).trigger('change');
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion entityManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Host Name="Document"/>
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost/oep/entity.html" />
<SourceLocation DefaultValue="\\w07ds2\INZ_Share$\entity.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>