2 /*******************************************************************************
3 * Copyright (c) 2012-2013 University of Stuttgart.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * and the Apache License 2.0 which both accompany this distribution,
7 * and are available at http://www.eclipse.org/legal/epl-v10.html
8 * and http://www.apache.org/licenses/LICENSE-2.0
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 * Yves Schubert - switch to bootstrap 3
13 *******************************************************************************/
15 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
16 <%@ taglib uri="http://www.eclipse.org/winery/repository/functions" prefix="w" %>
18 var namespacePrefixesTableInfo = {
19 id : '#namespacePrefixesTable'
23 require(["winery-support"], function(ws) {
24 ws.initTable(namespacePrefixesTableInfo);
28 function addNSprefix() {
30 url: "${pageContext.request.contextPath}/admin/namespaces/",
33 data: $('#addNamespacePrefixForm').serialize(),
34 error: function(jqXHR, textStatus, errorThrown) {
35 vShowAJAXError("Could not add namespace prefix", jqXHR, errorThrown);
37 success: function(data, textSTatus, jqXHR) {
38 namespacePrefixesTableInfo.table.fnAddData([$('#nsPrefixAdded').val(), $('#namespaceAdded').val()]);
39 $('#addNamespacePrefixDiag').modal('hide');
40 vShowSuccess("Successfully added namespace prefix.");
47 <div class="modal fade" id="addNamespacePrefixDiag">
48 <div class="modal-dialog">
49 <div class="modal-content">
50 <div class="modal-header">
51 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
52 <h4 class="modal-title">Add namespace prefix</h4>
54 <div class="modal-body">
55 <form id="addNamespacePrefixForm" enctype="multipart/form-data">
57 <div class="form-group">
58 <label for="nsPrefixAdded">Prefix</label>
59 <input name="nsPrefix" id="nsPrefixAdded" class="form-control" type="text" />
62 <div class="form-group">
63 <label for="namespaceAdded">Namespace</label>
64 <input name="namespace" id="namespaceAdded" class="form-control" type="text" />
70 <div class="modal-footer">
71 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
72 <button type="button" class="btn btn-primary" onclick="addNSprefix()">Add</button>
79 <div class="listheading">
80 <label>Defined Prefixes for Namespaces</label>
81 <button class="rightbutton btn btn-danger btn-xs" type="button" onclick="deleteOnServerAndInTable(namespacePrefixesTableInfo, 'namespace', 'namespaces/', 1);">Remove</button>
82 <button class="rightbutton btn btn-primary btn-xs" type="button" onclick="$('#addNamespacePrefixDiag').modal('show')">Add</button>
84 <table cellpadding="0" cellspacing="0" border="0" class="display" id="namespacePrefixesTable">
92 <c:forEach var="ns" items="${it.namespacesForJSP}">
94 <td class="prefix">${w:getPrefix(ns.decoded)}</td>
95 <td>${ns.decoded}</td>
103 $(document).on("click", "td.prefix",
104 vCreateTdClickFunction(
105 "${pageContext.request.contextPath}/admin/namespaces/",