Skip to content
Snippets Groups Projects
Commit 3159936d authored by Mark M. Florida's avatar Mark M. Florida
Browse files

Adding starter files for working with the XNAT.spawner methods, which are...

Adding starter files for working with the XNAT.spawner methods, which are different than the spawn() $('p').spawn() and $.spawn() functions!
parent 5f862f19
No related branches found
No related tags found
No related merge requests found
<%@ page session="true" contentType="text/html" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="pg" tagdir="/WEB-INF/tags/page" %>
<%--<%@ taglib prefix="sp" tagdir="/WEB-INF/tags/spawner" %>--%>
<c:if test="${empty hasInit}">
<pg:init>
<c:if test="${empty hasVars}">
<pg:jsvars/>
</c:if>
</pg:init>
</c:if>
<c:set var="MSG">
Playground clossed.
</c:set>
<pg:restricted msg="${MSG}">
<c:set var="_siteRoot" value="${sessionScope.siteRoot}"/>
<!-- playground for XNAT.spawner methods -->
<div id="spawn-container"></div>
<script src="${_siteRoot}/scripts/xnat/spawner.js"></script>
<script>
</script>
</pg:restricted>
\ No newline at end of file
<%@ page session="true" contentType="text/html" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="pg" tagdir="/WEB-INF/tags/page" %>
<pg:wrapper>
<pg:xnat>
<jsp:include page="content.jsp"/>
</pg:xnat>
</pg:wrapper>
/*!
* Spawn UI elements using the Spawner service
*/
var XNAT = getObject(XNAT);
(function(factory){
if (typeof define === 'function' && define.amd) {
define(factory);
}
else if (typeof exports === 'object') {
module.exports = factory();
}
else {
return factory();
}
}(function(){
var undefined,
spawner = getObject(XNAT.spawner||{});
function Spawner(obj){
extend(true, this, obj);
this.spawned = null;
this.children = {};
}
Spawner.p = Spawner.prototype;
Spawner.p.init = function(obj){
};
Spawner.p.render = function($container){
$$($container).append(this.spawned);
return this;
};
spawner.spawn = function(obj){
return new Spawner(obj);
};
return XNAT.spawner = spawner;
}));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment