Commit eaba2556 authored by Constantin Jucovschi's avatar Constantin Jucovschi

adding text and repo

parent cd43385b
var info_kwarc_sally_comm_repository = {
name: 'info_kwarc_sally_comm_repository',
defaultElementNamespaceURI: 'http:\/\/kwarc.info\/sally\/comm\/repository',
typeInfos: [{
type: 'classInfo',
localName: 'GetDocumentMetaResponse',
propertyInfos: [{
type: 'element',
name: 'sessionid',
elementName: 'sessionid',
typeInfo: 'String'
}, {
type: 'element',
name: 'repoURL',
elementName: 'repoURL',
typeInfo: 'String'
}, {
type: 'element',
name: 'docPath',
elementName: 'docPath',
typeInfo: 'String'
}]
}, {
type: 'classInfo',
localName: 'GetDocumentMeta',
propertyInfos: []
}],
elementInfos: [{
elementName: 'GetDocumentMetaResponse',
typeInfo: 'info_kwarc_sally_comm_repository.GetDocumentMetaResponse'
}, {
elementName: 'GetDocumentMeta',
typeInfo: 'info_kwarc_sally_comm_repository.GetDocumentMeta'
}]
};
var info_kwarc_sally_comm_text = {
name: 'info_kwarc_sally_comm_text',
defaultElementNamespaceURI: 'http:\/\/kwarc.info\/sally\/comm\/text',
typeInfos: [{
type: 'classInfo',
localName: 'SelectText',
propertyInfos: [{
type: 'element',
name: 'startrow',
elementName: 'startrow',
typeInfo: 'Int'
}, {
type: 'element',
name: 'endrow',
elementName: 'endrow',
typeInfo: 'Int'
}, {
type: 'element',
name: 'startcolumn',
elementName: 'startcolumn',
typeInfo: 'Int'
}, {
type: 'element',
name: 'endcolumn',
elementName: 'endcolumn',
typeInfo: 'Int'
}]
}, {
type: 'classInfo',
localName: 'GetCurrentSelection',
propertyInfos: []
}, {
type: 'classInfo',
localName: 'GetText',
propertyInfos: []
}, {
type: 'classInfo',
localName: 'AutocompleteResponse',
propertyInfos: [{
type: 'element',
name: 'suggestion',
collection: true,
elementName: 'suggestion',
typeInfo: 'info_kwarc_sally_comm_text.AutocompleteResponse.Suggestion'
}]
}, {
type: 'classInfo',
localName: 'AutocompleteResponse.Suggestion',
propertyInfos: [{
type: 'element',
name: 'concept',
elementName: 'concept',
typeInfo: 'String'
}, {
type: 'element',
name: 'text',
elementName: 'text',
typeInfo: 'String'
}]
}, {
type: 'classInfo',
localName: 'AutocompleteRequest',
propertyInfos: [{
type: 'element',
name: 'path',
elementName: 'path',
typeInfo: 'String'
}, {
type: 'element',
name: 'text',
elementName: 'text',
typeInfo: 'String'
}, {
type: 'element',
name: 'prefix',
elementName: 'prefix',
typeInfo: 'String'
}, {
type: 'element',
name: 'col',
elementName: 'col',
typeInfo: 'Int'
}, {
type: 'element',
name: 'line',
elementName: 'line',
typeInfo: 'Int'
}]
}, {
type: 'classInfo',
localName: 'GetCurrentSelectionResponse',
propertyInfos: [{
type: 'element',
name: 'startrow',
elementName: 'startrow',
typeInfo: 'Int'
}, {
type: 'element',
name: 'endrow',
elementName: 'endrow',
typeInfo: 'Int'
}, {
type: 'element',
name: 'startcolumn',
elementName: 'startcolumn',
typeInfo: 'Int'
}, {
type: 'element',
name: 'endcolumn',
elementName: 'endcolumn',
typeInfo: 'Int'
}]
}, {
type: 'classInfo',
localName: 'GetTextResponse',
propertyInfos: [{
type: 'element',
name: 'text',
elementName: 'text',
typeInfo: 'String'
}]
}],
elementInfos: [{
elementName: 'SelectText',
typeInfo: 'info_kwarc_sally_comm_text.SelectText'
}, {
elementName: 'GetCurrentSelection',
typeInfo: 'info_kwarc_sally_comm_text.GetCurrentSelection'
}, {
elementName: 'GetText',
typeInfo: 'info_kwarc_sally_comm_text.GetText'
}, {
elementName: 'AutocompleteResponse',
typeInfo: 'info_kwarc_sally_comm_text.AutocompleteResponse'
}, {
elementName: 'AutocompleteRequest',
typeInfo: 'info_kwarc_sally_comm_text.AutocompleteRequest'
}, {
elementName: 'GetCurrentSelectionResponse',
typeInfo: 'info_kwarc_sally_comm_text.GetCurrentSelectionResponse'
}, {
elementName: 'GetTextResponse',
typeInfo: 'info_kwarc_sally_comm_text.GetTextResponse'
}]
};
define (require) ->
require "sally_client"
require "info_kwarc_sally_comm_repository"
context = new Jsonix.Context([ info_kwarc_sally_comm_repository ]);
marshaller = context.createMarshaller();
unmarshaller = context.createUnmarshaller();
class Frames
constructor : (@repoURL, @docPath, @repoInstanceID = null) ->
getName : () -> "repository"
marshal : (obj) -> marshaller.marshalString(obj)
unmarshal : (str) -> unmarshaller.unmarshalString(str)
handleMessage : (msg, sendBack) ->
if (msg.name.localPart == "GetDocumentMeta")
response =
name :
localPart : "GetDocumentMetaResponse"
namespaceURI : "http://kwarc.info/sally/comm/repository"
value :
sessionid : @repoInstanceID,
repoURL : @repoURL
docPath : @docPath
sendBack(response)
\ No newline at end of file
define (require) ->
require "sally_client"
require "info_kwarc_sally_comm_text"
context = new Jsonix.Context([ info_kwarc_sally_comm_text ]);
marshaller = context.createMarshaller();
unmarshaller = context.createUnmarshaller();
class Text
constructor : (@ace) ->
getName : () -> "text"
marshal : (obj) -> marshaller.marshalString(obj)
unmarshal : (str) -> unmarshaller.unmarshalString(str)
handleMessage : (msg, sendBack) ->
if (msg.name.localPart == "GetText")
response =
name :
localPart : "GetTextResponse"
namespaceURI : "http://kwarc.info/sally/comm/text"
value :
"text" : @ace.getSession().getValue(),
return sendBack(response)
if (msg.name.localPart == "GetCurrentSelection")
sel = @ace.getSelectionRange()
response =
name :
localPart : "GetCurrentSelectionResponse"
namespaceURI : "http://kwarc.info/sally/comm/text"
value :
"startrow" : sel.start.row,
"startcolumn" : sel.start.column,
"endrow" : sel.end.row,
"endcolumn" : sel.end.column,
return sendBack(response)
if (msg.name.localPart == "SelectText")
v = msg.value
@ace.selection.setRange({start:{row:v.startrow, column:v.startcolumn},end:{row:v.endrow, column:v.endcolumn}})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment