batchDestroyNodes

batchDestroyNodes(nodes: Array): undefined
Parameters
nodes (Array) {id|secure_random,file_type}
Returns
undefined: This function return nothing. You need to pass an array of objects identifying the nodes that needs to be destroyed

bindGlobalCommands

Main.bindCommands enables ixcanul's basic keyboard commands

bindGlobalCommands()

Main.createFile

Creates a new file

Main.createFile(nodeData: Object, callback: function, callback_2: function): type
Parameters
nodeData (Object) { path: 'templates/test.liquid', reference: 'test.liquid', file_type: 'template', content: 'code' }
callback (function)
callback_2 (function) an optional callback if there's content to be added
Returns
type: {description}

createFolder

createFolder(nodeData: type, callback: type): type
Parameters
nodeData (type) {description}
callback (type) {description}
Returns
type: {description}

loadAceAssets

Loads the Ace editor assets

loadAceAssets()

loadJS

loadJS(string) attaches a script tag to the body

loadJS
Parameters
url (string) the url to the dependency

pretty

Loads an ixcanul file from the database using the LoadFile backend API

pretty
Parameters
node (Object) an object representing a node on the file tree or the required fields in the save api
fileType (String) the file type.
path (String) the path for the file which you need to load
callback (Function) a callback function, runs after the file had finished loading.
passive (Boolean) load files silently without changes to the UI.
Returns
Boolean:

saveFile

Saves an ixcanul file to the database using the save backend API

saveFile(node: Object, filename: String, content: String, rename: Boolean, orgTitle: String)
Parameters
node (Object) an object representing a node on the file tree or the required fields in the save api
filename (String) title of the saved file.
content (String) the new content of the saved file.
rename (Boolean) is this a rename for the file?.
orgTitle (String) the old filename for matching during a savefile.

CollabEditor

new CollabEditor()

setUpEvents

setUpEvents(object: Object): boolean
Parameters
object (Object)
Returns
boolean: {description}

translator

Translates a delta line form from ACE undo stack into an input value

translator(line: type, lines: type): type
Parameters
line (type) {description}
lines (type) {description}
Returns
type: {description}

binder

binder(deltas: Object): Boolean
Parameters
deltas (Object)
Returns
Boolean: {description}

_inputHandler

on input handler

_inputHandler(session: Session): type
Parameters
session (Session) a session object
Returns
type: {description}

determineOTType

Find the type of the operation on string.

determineOTType(editor: String): type
Parameters
editor (String) {description}
Returns
type: {description}

last

Notice: sometimes the undoStack might be empty, when this happens, return the redoStack instead.

last

collab

initiate the collaborative action

collab(object: type): type
Parameters
object (type) {description}
Returns
type: {description}

addIncoming

addIncoming(timestamp: number): Boolean
Parameters
timestamp (number) the timestamp of the delta received.
Returns
Boolean: true

addOutgoing

addOutgoing(timestamp: number): Boolean
Parameters
timestamp (number) the timestamp of the delta sent.
Returns
Boolean: true

validateContent

Validate the content on the current file, flag any lines that are big for the presence event, and don't support them

validateContent(): Boolean
Returns
Boolean: {description}

ContextMenu

ContextMenu()

ContextMenu.moveElement

A move function is basically, creating a new file that mimics the original file into the desired directory and deleting the old file so you have one record of the file

ContextMenu.moveElement(sourceNode: Object, path: Object): Boolean
Parameters
sourceNode (Object)
path (Object)
Returns
Boolean:

Clock

new Clock()

Clock

new Clock()

defaultState

defaultState(): type
Returns
type: {description}

defaultState

defaultState(): type
Returns
type: {description}

destroy

destroy the component

destroy()

destroy

destroy

destroy

destroy the component

destroy()

destroy

destroy the component

destroy()

genDataGrid

genDataGrid(): HyperHTML
Returns
HyperHTML:

addTags

add tags to tephra snippet

addTags(event: object)
Parameters
event (object) form event

render

render(): html
Returns
html: returns the component template.

render

render(): type
Returns
type: {description}

render

render(): type
Returns
type: {description}

buildView

Builds and returns a visual diff view. The single parameter, `params', should contain the following values:

  • baseTextLines: the array of strings that was used as the base text input to SequenceMatcher
  • newTextLines: the array of strings that was used as the new text input to SequenceMatcher
  • opcodes: the array of arrays returned by SequenceMatcher.get_opcodes()
  • baseTextName: the title to be displayed above the base text listing in the diff view; defaults to "Base Text"
  • newTextName: the title to be displayed above the new text listing in the diff view; defaults to "New Text"
  • contextSize: the number of lines of context to show around differences; by default, all lines are shown
  • viewType: if 0, a side-by-side diff view is generated (default); if 1, an inline diff view is generated
buildView(params: any)
Parameters
params (any)

addCells

Adds two cells to the given row; if the given row corresponds to a real line number (based on the line index tidx and the endpoint of the range in question tend), then the cells will contain the line number and the line of text from textLines at position tidx (with the class of the second cell set to the name of the change represented), and tidx + 1 will be returned. Otherwise, tidx is returned, and two empty cells are added to the given row.

addCells(row: any, tidx: any, tend: any, textLines: any, change: any)
Parameters
row (any)
tidx (any)
tend (any)
textLines (any)
change (any)

setDraggable

setDraggable(config: Object): type
Parameters
config (Object)
Returns
type: {description}

positionRestorPoint

positionRestorPoint()

_handler

_handler()

_handler

_handler(f: type): type
Parameters
f (type) {description}
Returns
type: {description}

editElement

editElement(params: type): type
Parameters
params (type) {description}
Returns
type: {description}

uploadDropzone

uploadDropzone(params: type): type
Parameters
params (type) {description}
Returns
type: {description}

s4

s4(): type
Returns
type: {description}

Main

Main(options: type)
Parameters
options (type) {description}
Static Members
refreshContent()
updateEditor(node, clearUndo)
generateReference(node, filename, fileType)
bindCommands
attachEditor(id)
editorCommands()

_upload_files

_upload_files(filesPromise: type, options: type): type
Parameters
filesPromise (type) {description}
options (type) {description}
Returns
type: {description}

_destroyDz

removes the dz uploader

_destroyDz()

_overwriteFiles

overwite files

_overwriteFiles()

Main.generatePath

Generate file path based on file tree node, accepts tree nodes

Main.generatePath(node: Object, filename: String): String
Parameters
node (Object) an object representing a node on the file tree or the required fields in the save api
filename (String) the filename
Returns
String: {description}

CodeEditor.Main.fileType

CodeEditor.Main.fileType(node: object): string
Parameters
node (object) or {String} as the path
Returns
string: the file type

Main.updatePaths

Update paths index.

Main.updatePaths(node: type): type
Parameters
node (type) {description}
Returns
type: {description}

Main.disableEditor

Disable the editor

Main.disableEditor(): Boolean
Returns
Boolean:

Main.enableEditor

Disable the editor

Main.enableEditor(): Boolean
Returns
Boolean:

getImageNaturalSize

getImageNaturalSize(src: String): Promise
Parameters
src (String) the url for the image
Returns
Promise: an object that contains the width and the height of the image in pixels value { width: 200, height: 200 }

decodeHtmlEntity

String.decodeHtmlEntity decodes HTML entities to raw HTML text

decodeHtmlEntity(null: null): String
Parameters
null (null) this function doesn't require any params
Returns
String:

encodeHtmlEntity

String.encodeHtmlEntity encodes raw HTML text to HTML entities

encodeHtmlEntity(null: null): String
Parameters
null (null) this function doesn't require any params
Returns
String:

toggleText

$(DOM).toggleText toggles text on each call (extended from Jquery $.fn.)

toggleText(a: String, b: String): String
Parameters
a (String) first case string to be toggled
b (String) last case string to be toggled
Returns
String:

getLastItem

getLastItem(stack: type): type
Parameters
stack (type) {description}
Returns
type: {description}

CodeEditor.bindChannels.constructor

CodeEditor.bindChannels.constructor()

bindChannels

sets the binders for the channels

bindChannels(): undefined
Returns
undefined:

bindClientChannels

bindClientChannels(): undefined
Returns
undefined:

triggerEvent

Trigger an event on the fly from outside the constructor

triggerEvent(options: Object): Boolean
Parameters
options (Object) an object containing information about the event
Returns
Boolean: {description}

bindEvent

bindEvent(eventName: String, callback: Function): Boolean
Parameters
eventName (String) a string contains the name of the client event
callback (Function) a callback for the event
Returns
Boolean: {description}

subscribe

subscribe(channel: string): undefined
Parameters
channel (string) a string that defines the channel id
Returns
undefined: undefined

presenceChannel

presenceChannel(channel: string): undefined
Parameters
channel (string) a string that defines the channel id
Returns
undefined: undefined

setSocket

set the socket and binds the channels

setSocket(socket: String): undefined
Parameters
socket (String) the socket_id
Returns
undefined:

SearchFolder

SearchFolder(): Object
Returns
Object:

social

new social()

fileOpened

fileOpened(data: type): type
Parameters
data (type) {description}
Returns
type: {description}

setListeners

setListeners(): type
Returns
type: {description}

listTags

listTags(): HTMLString
Returns
HTMLString: template literal with LI elements as list items

loadList

returns a list of tephra snippets

loadList(): html
Returns
html: {description}

loadResults

returns a list of tephra snippets

loadResults(tags: Object): html
Parameters
tags (Object)
Returns
html: {description}

TephraSnippetItem

new TephraSnippetItem()

addSnippet

addSnippet(): type
Returns
type: {description}

prettyTephraLine

cover the following: 1- comment blocks 2- tephra destruct 3- include tags data structure { ignored: Boolean tephra: Boolean snippet: Boolean raw: String }

prettyTephraLine(serialized: any)
Parameters
serialized (any)

Toast

Toast(): type
Returns
type: {description}

Tree

Tree()

findNodeByContext

Finds a targetted node on the tree by providing a context for the required node

findNodeByContext(triggerNode: object): object
Parameters
triggerNode (object) an object representing a node on the file tree or the required fields in the save api
Returns
object: node a single node from the tree as a fancyTree object

prototype.removeDuplicates

prototype.removeDuplicates(): undefined
Returns
undefined: {description}

uniq

uniq(jo: type)
Parameters
jo (type) {description}

dupCheck

dupCheck(idx: type, array: type): type
Parameters
idx (type) {description}
array (type) {description}
Returns
type: {description}

Tree.duplicateNode

Tree.duplicateNode(parentNode: type, nweNode: type)
Parameters
parentNode (type) {description}
nweNode (type) {description}

Tree.createNode

Tree.createNode(parentNode: NodeObject, newNode: Object)
Parameters
parentNode (NodeObject) {description}
newNode (Object) {description}

Tree.nodeExists

Find if a node or a path string represents a node in the tree

Tree.nodeExists(node: Object/String): boolean
Parameters
node (Object/String) an object that contains a path property or a string that represents the path
Returns
boolean:

Tree.findNode

Find a node in the tree with a tree node object

Tree.findNode(node: Object): Object
Parameters
node (Object) a fancyTree node object
Returns
Object: if not found the function will return null

replaceNotif

replaceNotif(): type
Returns
type: {description}

extendData

This function adds some flexibility to the iziTast data structure

extendData(settings: type): Object
Parameters
settings (type) {description}
Returns
Object: the new settings object