This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profile> | |
<id>docs</id> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<version>1.2</version> | |
<executions> | |
<execution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#content { | |
border: 3px solid gray; | |
height: 300px; | |
width: 150px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getChildren = function(model, item){ | |
children = []; | |
if (model.mayHaveChildren(item){ | |
var ch = model.getChildren(item); | |
dojo.forEach(ch, function(child){ | |
children.push(child) | |
children = children.concat(getChildren(model, child)); | |
}); | |
} | |
return children; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check to see if this loaded module already exists. Returns a deferred that will already be resolved or | |
// or will resolve with an addOnLoad after the require | |
var dynrequire = function(names){ | |
var def = new dojo.Deferred(); | |
var loading=false; | |
dojo.forEach(names, function(n){ | |
if (!dojo._loadedModules[n]){ | |
dojo.require(n); | |
loading=true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var session = new Session({url: "http://192.168.5.16:4444/wd/hub"}) | |
var capabilities = session.startSession({browserName: "internet explorer"}); | |
var url = "http://google.com"; | |
when(capabilities,function(capabilities){ | |
print("Connected to Session"); | |
print("sessionId: " + capabilities.sessionId); | |
print("Session Props: " + json.stringify(capabilities)); | |
pshallow(capabilities); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.urlMap = function(map, nextApp){ | |
return function(request){ | |
for (var i = 0; i<map.length; i++){ | |
var match = map[i][0]; | |
var ctor = map[i][1]; | |
var returnRequest = map[i][2]; | |
if (request.pathInfo.match(match)){ | |
print("found match:", match); | |
var res = ctor(request, match); | |
if (res && returnRequest) return res; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (response.status > 400) { | |
//print("Error Response: " + response.status); | |
template = templateEngine.compile("/error/"+response.status); | |
}else{ | |
template = templateEngine.compile(templateId, (mediaParams && mediaParams.template)); | |
} | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodes = multiNode.listen({port: settings.port || 8080, nodes: settings.processes || 1}, | |
require( "http" ).createServer( | |
require("jsgi-node").Listener( | |
// uncomment this to enable compression with node-compress | |
//require("pintura/jsgi/compress").Compress( | |
// make the root url redirect to /Page/Root | |
require("pintura/jsgi/rewriter").Rewriter("\/$", "/page/test", | |
require("pintura/jsgi/cascade").Cascade([ | |
// cascade from static to pintura REST handling | |
// the main place for static files accessible from the web |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Defines the data model for the given user by request | |
pinturaConfig.getDataModel = function(request){ | |
var user = request.remoteUser; | |
if(user){ | |
if(admins.indexOf(user)>-1){ | |
return fullModel; // admin users can directly access the data model without facets | |
} | |
return getUserModel(user, publicModel); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ttrenka's connection counting function | |
(function(){ | |
var connect = 0, disconnect = 0; | |
dojo.connect(dojo, "connect", function(){ connect++; }); | |
dojo.connect(dojo, "disconnect", function(){ disconnect++; }); | |
dojo.__getConnectCount = function(){ | |
console.log("dojo.connect has run: ", connect); | |
console.log("dojo.disconnect has run: ", disconnect); | |
console.log("Total current connections: ", (connect - disconnect)); | |
}; |