Fix wodocollabeditor conflicts with other libraries because of global require and define AMD modulation

This commit is contained in:
Hadi Nategh 2016-10-27 18:47:02 +02:00
parent 3b76072885
commit 6038936cef
270 changed files with 476 additions and 18759 deletions

View File

@ -24,7 +24,7 @@
/*global runtime, define, document, core, odf, gui, ops*/
define("webodf/editor/EditorSession", [
webodfModule.define("webodf/editor/EditorSession", [
"dojo/text!resources/fonts/fonts.css"
], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin
"use strict";

View File

@ -24,7 +24,7 @@
/*global define, document, window */
define("webodf/editor/FullWindowZoomHelper", [], function () {
webodfModule.define("webodf/editor/FullWindowZoomHelper", [], function () {
"use strict";
// fullscreen pinch-zoom adaption

View File

@ -24,7 +24,7 @@
/*global define,runtime */
define("webodf/editor/MemberListView",
webodfModule.define("webodf/editor/MemberListView",
["webodf/editor/EditorSession"],
function (EditorSession) {

View File

@ -1,4 +1,4 @@
define("egwCollab/ServerFactory", [
webodfModule.define("egwCollab/ServerFactory", [
"webodf/editor/backend/pullbox/Server",
"webodf/editor/backend/pullbox/SessionBackend",
"webodf/editor/backend/pullbox/SessionList"],

View File

@ -24,7 +24,7 @@
/*global Node, define, runtime */
define("webodf/editor/SessionListView", [], function () {
webodfModule.define("webodf/editor/SessionListView", [], function () {
"use strict";
return function SessionListView(sessionList, sessionListDiv, cb) {

View File

@ -24,7 +24,7 @@
/*global define, document, dijit, dojo, runtime, ops*/
define("webodf/editor/Tools", [
webodfModule.define("webodf/editor/Tools", [
"dojo/ready",
"dijit/MenuItem",
"dijit/DropDownMenu",

View File

@ -24,7 +24,7 @@
/*global define, runtime, XMLHttpRequest */
define("webodf/editor/Translator", [], function () {
webodfModule.define("webodf/editor/Translator", [], function () {
"use strict";
return function Translator(translationsPath, locale, callback) {

View File

@ -24,7 +24,7 @@
/*global define, runtime, core, ops*/
define("webodf/editor/backend/jsglobal/OperationRouter", [], function () {
webodfModule.define("webodf/editor/backend/jsglobal/OperationRouter", [], function () {
"use strict";
var /**@const @type {!string}*/

View File

@ -24,7 +24,7 @@
/*global define, window, runtime, core*/
define("webodf/editor/backend/jsglobal/Server", [], function () {
webodfModule.define("webodf/editor/backend/jsglobal/Server", [], function () {
"use strict";
/**

View File

@ -24,7 +24,7 @@
/*global define, document, require, runtime, ops */
define("webodf/editor/backend/jsglobal/ServerFactory", [
webodfModule.define("webodf/editor/backend/jsglobal/ServerFactory", [
"webodf/editor/backend/jsglobal/Server",
"webodf/editor/backend/jsglobal/SessionBackend",
"webodf/editor/backend/jsglobal/SessionList"],

View File

@ -25,7 +25,7 @@
/*global define, ops*/
define("webodf/editor/backend/jsglobal/SessionBackend", [
webodfModule.define("webodf/editor/backend/jsglobal/SessionBackend", [
"webodf/editor/backend/jsglobal/OperationRouter"],
function (JsGlobalOperationRouter) {
"use strict";

View File

@ -24,7 +24,7 @@
/*global define, ops, runtime, core */
define("webodf/editor/backend/jsglobal/SessionList", [], function () {
webodfModule.define("webodf/editor/backend/jsglobal/SessionList", [], function () {
"use strict";
var /**@const @type {!string}*/

View File

@ -24,7 +24,7 @@
/*global define, runtime, core, ops*/
define("webodf/editor/backend/pullbox/OperationRouter", [], function () {
webodfModule.define("webodf/editor/backend/pullbox/OperationRouter", [], function () {
"use strict";
// TODO: these eventid strings should be defined at OperationRouter interface

View File

@ -24,7 +24,7 @@
/*global define, runtime, core, XMLHttpRequest*/
define("webodf/editor/backend/pullbox/Server", [], function () {
webodfModule.define("webodf/editor/backend/pullbox/Server", [], function () {
"use strict";
runtime.loadClass("core.Base64");

View File

@ -24,7 +24,7 @@
/*global define, document, require, runtime, ops */
define("webodf/editor/backend/pullbox/ServerFactory", [
webodfModule.define("webodf/editor/backend/pullbox/ServerFactory", [
"webodf/editor/backend/pullbox/Server",
"webodf/editor/backend/pullbox/SessionBackend",
"webodf/editor/backend/pullbox/SessionList"],

View File

@ -25,7 +25,7 @@
/*global define, ops*/
define("webodf/editor/backend/pullbox/SessionBackend", [
webodfModule.define("webodf/editor/backend/pullbox/SessionBackend", [
"webodf/editor/backend/pullbox/OperationRouter"],
function (PullBoxOperationRouter) {
"use strict";

View File

@ -24,7 +24,7 @@
/*global define, ops, runtime */
define("webodf/editor/backend/pullbox/SessionList", [], function () {
webodfModule.define("webodf/editor/backend/pullbox/SessionList", [], function () {
"use strict";
return function PullBoxSessionList(server) {

View File

@ -3,9 +3,9 @@
//
// $ node compile.js
var fs = require('fs'), // file system access
path = require('path'), // get directory from file name
less = require('../../../util/less'); // less processor
var fs = webodfModule.require('fs'), // file system access
path = webodfModule.require('path'), // get directory from file name
less = webodfModule.require('../../../util/less'); // less processor
var options = {
compress: false,

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
file.reference.wodocollabtexteditor-wodo=.
files.encoding=UTF-8
site.root.folder=${file.reference.wodocollabtexteditor-wodo}

View File

@ -56,11 +56,11 @@ r+" "+g),h(r.message)}};this.deleteFile=function(a,g){var h=new XMLHttpRequest;h
a+" is empty.",null))};try{h.send(null)}catch(d){g(d.message,null)}};this.log=e;this.enableAlerts=!0;this.assert=Runtime.assert;this.setTimeout=function(a,g){return setTimeout(function(){a()},g)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=
function(a){return(new DOMParser).parseFromString(a,"text/xml")};this.exit=function(a){e("Calling exit with code "+String(a)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame=function(a){var g=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,h=0;if(g)g.bind(window),h=g(a);else return setTimeout(a,15);return h};this.cancelAnimationFrame=function(a){var g=window.cancelAnimationFrame||
window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;g?(g.bind(window),g(a)):clearTimeout(a)}}
function NodeJSRuntime(){function f(a){var g=a.length,h,d=new Uint8Array(new ArrayBuffer(g));for(h=0;h<g;h+=1)d[h]=a[h];return d}function k(a,g,h){function d(d,r){if(d)return h(d,null);if(!r)return h("No data for "+a+".",null);if("string"===typeof r)return h(d,r);h(d,f(r))}a=c.resolve(m,a);"binary"!==g?e.readFile(a,g,d):e.readFile(a,null,d)}var a=this,e=require("fs"),c=require("path"),m="",n,p;this.byteArrayFromString=function(a,g){var h=new Buffer(a,g),d,b=h.length,r=new Uint8Array(new ArrayBuffer(b));
function NodeJSRuntime(){function f(a){var g=a.length,h,d=new Uint8Array(new ArrayBuffer(g));for(h=0;h<g;h+=1)d[h]=a[h];return d}function k(a,g,h){function d(d,r){if(d)return h(d,null);if(!r)return h("No data for "+a+".",null);if("string"===typeof r)return h(d,r);h(d,f(r))}a=c.resolve(m,a);"binary"!==g?e.readFile(a,g,d):e.readFile(a,null,d)}var a=this,e=webodfModule.require("fs"),c=webodfModule.require("path"),m="",n,p;this.byteArrayFromString=function(a,g){var h=new Buffer(a,g),d,b=h.length,r=new Uint8Array(new ArrayBuffer(b));
for(d=0;d<b;d+=1)r[d]=h[d];return r};this.byteArrayToString=Runtime.byteArrayToString;this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.readFile=k;this.loadXML=function(e,g){k(e,"utf-8",function(h,d){if(h)return g(h,null);if(!d)return g("No data for "+e+".",null);g(null,a.parseXML(d))})};this.writeFile=function(a,g,h){g=new Buffer(g);a=c.resolve(m,a);e.writeFile(a,g,"binary",function(d){h(d||null)})};this.deleteFile=function(a,g){a=c.resolve(m,a);
e.unlink(a,g)};this.read=function(a,g,h,d){a=c.resolve(m,a);e.open(a,"r+",666,function(b,r){if(b)d(b,null);else{var l=new Buffer(h);e.read(r,l,0,h,g,function(b){e.close(r);d(b,f(l))})}})};this.readFileSync=function(a,g){var h;h=e.readFileSync(a,"binary"===g?null:g);if(null===h)throw"File "+a+" could not be read.";"binary"===g&&(h=f(h));return h};this.log=function(a,e){var h;void 0!==e?h=a:e=a;"alert"===h&&process.stderr.write("\n!!!!! ALERT !!!!!\n");process.stderr.write(e+"\n");"alert"===h&&process.stderr.write("!!!!! ALERT !!!!!\n")};
this.assert=Runtime.assert;this.setTimeout=function(a,e){return setTimeout(function(){a()},e)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return[__dirname]};this.setCurrentDirectory=function(a){m=a};this.currentDirectory=function(){return m};this.type=function(){return"NodeJSRuntime"};this.getDOMImplementation=function(){return p};this.parseXML=function(a){return n.parseFromString(a,"text/xml")};this.exit=process.exit;this.getWindow=function(){return null};this.requestAnimationFrame=
function(a){return setTimeout(a,15)};this.cancelAnimationFrame=function(a){clearTimeout(a)};n=new (require("xmldom").DOMParser);p=a.parseXML("<a/>").implementation}
function(a){return setTimeout(a,15)};this.cancelAnimationFrame=function(a){clearTimeout(a)};n=new (webodfModule.require("xmldom").DOMParser);p=a.parseXML("<a/>").implementation}
function RhinoRuntime(){var f=this,k={},a=k.javax.xml.parsers.DocumentBuilderFactory.newInstance(),e,c,m="";a.setValidating(!1);a.setNamespaceAware(!0);a.setExpandEntityReferences(!1);a.setSchema(null);c=k.org.xml.sax.EntityResolver({resolveEntity:function(a,e){var c=new k.java.io.FileReader(e);return new k.org.xml.sax.InputSource(c)}});e=a.newDocumentBuilder();e.setEntityResolver(c);this.byteArrayFromString=function(a,e){var c,g=a.length,h=new Uint8Array(new ArrayBuffer(g));for(c=0;c<g;c+=1)h[c]=
a.charCodeAt(c)&255;return h};this.byteArrayToString=Runtime.byteArrayToString;this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.loadXML=function(a,c){var m=new k.java.io.File(a),g=null;try{g=e.parse(m)}catch(h){return print(h),c(h,null)}c(null,g)};this.readFile=function(a,e,c){m&&(a=m+"/"+a);var g=new k.java.io.File(a),h="binary"===e?"latin1":e;g.isFile()?((a=readFile(a,h))&&"binary"===e&&(a=f.byteArrayFromString(a,"binary")),c(null,a)):c(a+" is not a file.",
null)};this.writeFile=function(a,e,c){m&&(a=m+"/"+a);a=new k.java.io.FileOutputStream(a);var g,h=e.length;for(g=0;g<h;g+=1)a.write(e[g]);a.close();c(null)};this.deleteFile=function(a,e){m&&(a=m+"/"+a);var c=new k.java.io.File(a),g=a+Math.random(),g=new k.java.io.File(g);c.rename(g)?(g.deleteOnExit(),e(null)):e("Could not delete "+a)};this.read=function(a,e,c,g){m&&(a=m+"/"+a);var h;h=a;var d="binary";(new k.java.io.File(h)).isFile()?("binary"===d&&(d="latin1"),h=readFile(h,d)):h=null;h?g(null,this.byteArrayFromString(h.substring(e,

View File

@ -24,7 +24,7 @@
/*global define, dojo, runtime, webodf */
define("webodf/editor/widgets/aboutDialog", ["dijit/Dialog"], function (Dialog) {
webodfModule.define("webodf/editor/widgets/aboutDialog", ["dijit/Dialog"], function (Dialog) {
"use strict";
var editorBase = dojo.config && dojo.config.paths && dojo.config.paths["webodf/editor"],

View File

@ -24,7 +24,7 @@
/*global define, require, runtime, gui */
define("webodf/editor/widgets/annotation", [
webodfModule.define("webodf/editor/widgets/annotation", [
"dijit/form/Button"],
function (Button) {

View File

@ -24,7 +24,7 @@
/*global runtime,core,define,require,dijit */
define("webodf/editor/widgets/dialogWidgets/alignmentPane", [
webodfModule.define("webodf/editor/widgets/dialogWidgets/alignmentPane", [
"webodf/editor/widgets/dialogWidgets/idMangler"],
function (IdMangler) {
"use strict";
@ -85,7 +85,7 @@ function (IdMangler) {
};
function init(cb) {
require([
webodfModule.require([
"dojo",
"dojo/ready",
"dijit/layout/ContentPane"],

View File

@ -24,7 +24,7 @@
/*global runtime,core,define,require,document,dijit */
define("webodf/editor/widgets/dialogWidgets/editHyperlinkPane", [
webodfModule.define("webodf/editor/widgets/dialogWidgets/editHyperlinkPane", [
"dojo",
"dijit/layout/ContentPane",
"webodf/editor/widgets/dialogWidgets/idMangler"],

View File

@ -24,7 +24,7 @@
/*global runtime,define,require,document,dijit */
define("webodf/editor/widgets/dialogWidgets/fontEffectsPane", [
webodfModule.define("webodf/editor/widgets/dialogWidgets/fontEffectsPane", [
"webodf/editor/widgets/dialogWidgets/idMangler"],
function (IdMangler) {
"use strict";
@ -108,7 +108,7 @@ function (IdMangler) {
/*jslint unparam: true*/
function init(cb) {
require([
webodfModule.require([
"dojo",
"dojo/ready",
"dijit/layout/ContentPane",

View File

@ -24,7 +24,7 @@
/*global define, document, dojo, dijit */
define("webodf/editor/widgets/dialogWidgets/idMangler", ["dojo", "dijit"], function (dojo, dijit) {
webodfModule.define("webodf/editor/widgets/dialogWidgets/idMangler", ["dojo", "dijit"], function (dojo, dijit) {
"use strict";
var instanceCount = 0;

View File

@ -24,7 +24,7 @@
/*global define, require, document, odf, runtime, core, gui */
define("webodf/editor/widgets/editHyperlinks", [
webodfModule.define("webodf/editor/widgets/editHyperlinks", [
"webodf/editor/EditorSession",
"webodf/editor/widgets/dialogWidgets/editHyperlinkPane",
"dijit/form/Button",

View File

@ -22,7 +22,7 @@
* @source: https://github.com/kogmbh/WebODF/
*/
/*global define,require,document */
define("webodf/editor/widgets/fontPicker", [
webodfModule.define("webodf/editor/widgets/fontPicker", [
"dijit/form/Select",
"dojox/html/entities"],

View File

@ -24,7 +24,7 @@
/*global define, require, document, Image, FileReader, window, runtime, ops, gui */
define("webodf/editor/widgets/imageInserter", [
webodfModule.define("webodf/editor/widgets/imageInserter", [
"dijit/form/Button",
"webodf/editor/EditorSession"],

View File

@ -24,7 +24,7 @@
/*global define, require, ops, gui, runtime */
define("webodf/editor/widgets/paragraphAlignment", [
webodfModule.define("webodf/editor/widgets/paragraphAlignment", [
"dijit/form/ToggleButton",
"dijit/form/Button",
"webodf/editor/EditorSession"],

View File

@ -24,7 +24,7 @@
/*global define, require, runtime, ops */
define("webodf/editor/widgets/paragraphStyles", [
webodfModule.define("webodf/editor/widgets/paragraphStyles", [
"dijit/form/Select",
"dojox/html/entities",
"webodf/editor/EditorSession"],

View File

@ -24,7 +24,7 @@
/*global define, require, dojo, dijit, runtime */
define("webodf/editor/widgets/paragraphStylesDialog", [
webodfModule.define("webodf/editor/widgets/paragraphStylesDialog", [
"webodf/editor/widgets/dialogWidgets/idMangler"],
function (IdMangler) {
"use strict";
@ -36,7 +36,7 @@ function (IdMangler) {
stylePicker, alignmentPane, fontEffectsPane;
function makeWidget(callback) {
require([
webodfModule.require([
"dijit/Dialog",
"dijit/TooltipDialog",
"dijit/popup",
@ -272,7 +272,7 @@ function (IdMangler) {
dialog.domNode.appendChild(actionBar);
require([
webodfModule.require([
"webodf/editor/widgets/paragraphStyles",
"webodf/editor/widgets/dialogWidgets/alignmentPane",
"webodf/editor/widgets/dialogWidgets/fontEffectsPane"

View File

@ -24,7 +24,7 @@
/*global define, require, runtime, gui, ops */
define("webodf/editor/widgets/simpleStyles", [
webodfModule.define("webodf/editor/widgets/simpleStyles", [
"webodf/editor/widgets/fontPicker",
"dijit/form/ToggleButton",
"dijit/form/NumberSpinner"],

View File

@ -24,7 +24,7 @@
/*global define, require */
define("webodf/editor/widgets/toolbarWidgets/currentStyle",
webodfModule.define("webodf/editor/widgets/toolbarWidgets/currentStyle",
["webodf/editor/EditorSession"],
function (EditorSession) {
@ -51,7 +51,7 @@ define("webodf/editor/widgets/toolbarWidgets/currentStyle",
}
function makeWidget(callback) {
require(["webodf/editor/widgets/paragraphStyles"], function (ParagraphStyles) {
webodfModule.require(["webodf/editor/widgets/paragraphStyles"], function (ParagraphStyles) {
var p = new ParagraphStyles(function (pStyles) {
paragraphStyles = pStyles;

View File

@ -24,7 +24,7 @@
/*global define, require, runtime*/
define("webodf/editor/widgets/undoRedoMenu",
webodfModule.define("webodf/editor/widgets/undoRedoMenu",
["webodf/editor/EditorSession", "dijit/form/Button"],
function (EditorSession, Button) {

View File

@ -24,7 +24,7 @@
/*global define, require, gui*/
define("webodf/editor/widgets/zoomSlider", [
webodfModule.define("webodf/editor/widgets/zoomSlider", [
"dijit/form/HorizontalSlider"],
function (HorizontalSlider) {

View File

@ -60,7 +60,7 @@ window.Wodo = window.Wodo || (function () {
* @return {undefined}
*/
function initCollabTextEditor() {
require([
webodfModule.require([
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"webodf/editor/FullWindowZoomHelper",

View File

@ -167,7 +167,7 @@ window.Wodo = window.Wodo || (function () {
* @return {undefined}
*/
function initTextEditor() {
require([
webodfModule.require([
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"webodf/editor/FullWindowZoomHelper",

View File

@ -524,7 +524,7 @@ function BrowserRuntime() {
};
}
function NodeJSRuntime() {
var self = this, fs = require("fs"), pathmod = require("path"), currentDirectory = "", parser, domImplementation;
var self = this, fs = webodfModule.require("fs"), pathmod = webodfModule.require("path"), currentDirectory = "", parser, domImplementation;
function bufferToUint8Array(buffer) {
var l = buffer.length, i, a = new Uint8Array(new ArrayBuffer(l));
for (i = 0;i < l;i += 1) {
@ -672,7 +672,7 @@ function NodeJSRuntime() {
clearTimeout(requestId);
};
function init() {
var DOMParser = require("xmldom").DOMParser;
var DOMParser = webodfModule.require("xmldom").DOMParser;
parser = new DOMParser;
domImplementation = self.parseXML("<a/>").implementation;
}

View File

@ -56,11 +56,11 @@ m+" "+e),l(m.message)}};this.deleteFile=function(b,e){var l=new XMLHttpRequest;l
b+" is empty.",null))};try{l.send(null)}catch(a){e(a.message,null)}};this.log=b;this.enableAlerts=!0;this.assert=Runtime.assert;this.setTimeout=function(b,e){return setTimeout(function(){b()},e)};this.clearTimeout=function(b){clearTimeout(b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=
function(b){return(new DOMParser).parseFromString(b,"text/xml")};this.exit=function(d){b("Calling exit with code "+String(d)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame=function(b){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,l=0;if(e)e.bind(window),l=e(b);else return setTimeout(b,15);return l};this.cancelAnimationFrame=function(b){var e=window.cancelAnimationFrame||
window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;e?(e.bind(window),e(b)):clearTimeout(b)}}
function NodeJSRuntime(){function g(b){var e=b.length,l,a=new Uint8Array(new ArrayBuffer(e));for(l=0;l<e;l+=1)a[l]=b[l];return a}function k(d,e,l){function a(a,m){if(a)return l(a,null);if(!m)return l("No data for "+d+".",null);if("string"===typeof m)return l(a,m);l(a,g(m))}d=f.resolve(n,d);"binary"!==e?b.readFile(d,e,a):b.readFile(d,null,a)}var d=this,b=require("fs"),f=require("path"),n="",p,r;this.byteArrayFromString=function(b,e){var l=new Buffer(b,e),a,c=l.length,m=new Uint8Array(new ArrayBuffer(c));
function NodeJSRuntime(){function g(b){var e=b.length,l,a=new Uint8Array(new ArrayBuffer(e));for(l=0;l<e;l+=1)a[l]=b[l];return a}function k(d,e,l){function a(a,m){if(a)return l(a,null);if(!m)return l("No data for "+d+".",null);if("string"===typeof m)return l(a,m);l(a,g(m))}d=f.resolve(n,d);"binary"!==e?b.readFile(d,e,a):b.readFile(d,null,a)}var d=this,b=webodfModule.require("fs"),f=webodfModule.require("path"),n="",p,r;this.byteArrayFromString=function(b,e){var l=new Buffer(b,e),a,c=l.length,m=new Uint8Array(new ArrayBuffer(c));
for(a=0;a<c;a+=1)m[a]=l[a];return m};this.byteArrayToString=Runtime.byteArrayToString;this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.readFile=k;this.loadXML=function(b,e){k(b,"utf-8",function(l,a){if(l)return e(l,null);if(!a)return e("No data for "+b+".",null);e(null,d.parseXML(a))})};this.writeFile=function(d,e,l){e=new Buffer(e);d=f.resolve(n,d);b.writeFile(d,e,"binary",function(a){l(a||null)})};this.deleteFile=function(d,e){d=f.resolve(n,d);
b.unlink(d,e)};this.read=function(d,e,l,a){d=f.resolve(n,d);b.open(d,"r+",666,function(c,m){if(c)a(c,null);else{var h=new Buffer(l);b.read(m,h,0,l,e,function(c){b.close(m);a(c,g(h))})}})};this.readFileSync=function(d,e){var l;l=b.readFileSync(d,"binary"===e?null:e);if(null===l)throw"File "+d+" could not be read.";"binary"===e&&(l=g(l));return l};this.log=function(b,e){var l;void 0!==e?l=b:e=b;"alert"===l&&process.stderr.write("\n!!!!! ALERT !!!!!\n");process.stderr.write(e+"\n");"alert"===l&&process.stderr.write("!!!!! ALERT !!!!!\n")};
this.assert=Runtime.assert;this.setTimeout=function(b,e){return setTimeout(function(){b()},e)};this.clearTimeout=function(b){clearTimeout(b)};this.libraryPaths=function(){return[__dirname]};this.setCurrentDirectory=function(b){n=b};this.currentDirectory=function(){return n};this.type=function(){return"NodeJSRuntime"};this.getDOMImplementation=function(){return r};this.parseXML=function(b){return p.parseFromString(b,"text/xml")};this.exit=process.exit;this.getWindow=function(){return null};this.requestAnimationFrame=
function(b){return setTimeout(b,15)};this.cancelAnimationFrame=function(b){clearTimeout(b)};p=new (require("xmldom").DOMParser);r=d.parseXML("<a/>").implementation}
function(b){return setTimeout(b,15)};this.cancelAnimationFrame=function(b){clearTimeout(b)};p=new (webodfModule.require("xmldom").DOMParser);r=d.parseXML("<a/>").implementation}
function RhinoRuntime(){var g=this,k={},d=k.javax.xml.parsers.DocumentBuilderFactory.newInstance(),b,f,n="";d.setValidating(!1);d.setNamespaceAware(!0);d.setExpandEntityReferences(!1);d.setSchema(null);f=k.org.xml.sax.EntityResolver({resolveEntity:function(b,d){var f=new k.java.io.FileReader(d);return new k.org.xml.sax.InputSource(f)}});b=d.newDocumentBuilder();b.setEntityResolver(f);this.byteArrayFromString=function(b,d){var f,e=b.length,l=new Uint8Array(new ArrayBuffer(e));for(f=0;f<e;f+=1)l[f]=
b.charCodeAt(f)&255;return l};this.byteArrayToString=Runtime.byteArrayToString;this.getVariable=Runtime.getVariable;this.fromJson=Runtime.fromJson;this.toJson=Runtime.toJson;this.loadXML=function(d,f){var n=new k.java.io.File(d),e=null;try{e=b.parse(n)}catch(l){return print(l),f(l,null)}f(null,e)};this.readFile=function(b,d,f){n&&(b=n+"/"+b);var e=new k.java.io.File(b),l="binary"===d?"latin1":d;e.isFile()?((b=readFile(b,l))&&"binary"===d&&(b=g.byteArrayFromString(b,"binary")),f(null,b)):f(b+" is not a file.",
null)};this.writeFile=function(b,d,f){n&&(b=n+"/"+b);b=new k.java.io.FileOutputStream(b);var e,l=d.length;for(e=0;e<l;e+=1)b.write(d[e]);b.close();f(null)};this.deleteFile=function(b,d){n&&(b=n+"/"+b);var f=new k.java.io.File(b),e=b+Math.random(),e=new k.java.io.File(e);f.rename(e)?(e.deleteOnExit(),d(null)):d("Could not delete "+b)};this.read=function(b,d,f,e){n&&(b=n+"/"+b);var l;l=b;var a="binary";(new k.java.io.File(l)).isFile()?("binary"===a&&(a="latin1"),l=readFile(l,a)):l=null;l?e(null,this.byteArrayFromString(l.substring(d,

View File

@ -1,220 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>JsDoc Reference - File Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="index">
<div align="center"><a href="index.html">Class Index</a>
| <a href="files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
<li><a href="symbols/TextEditor.html">TextEditor</a></li>
<li><a href="symbols/Wodo.html">Wodo</a></li>
</ul>
<hr />
</div>
<div id="content">
<h1 class="classTitle">File Index</h1>
<div>
<h2><a href="symbols/src/wodotexteditor.js.html">wodotexteditor.js</a></h2>
<dl>
</dl>
</div>
<hr />
</div>
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST)
</div>
</body>
</html>

View File

@ -1,226 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>JsDoc Reference - Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<div id="header">
</div>
<div id="index">
<div align="center"><a href="index.html">Class Index</a>
| <a href="files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="symbols/_global_.html">_global_</a></i></li>
<li><a href="symbols/TextEditor.html">TextEditor</a></li>
<li><a href="symbols/Wodo.html">Wodo</a></li>
</ul>
<hr />
</div>
<div id="content">
<h1 class="classTitle">Class Index</h1>
<div>
<h2><a href="symbols/_global_.html">_global_</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/TextEditor.html">TextEditor</a></h2>
</div>
<hr />
<div>
<h2><a href="symbols/Wodo.html">Wodo</a></h2>
</div>
<hr />
</div>
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST)
</div>
</body>
</html>

View File

@ -1,989 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - TextEditor</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/TextEditor.html">TextEditor</a></li>
<li><a href="../symbols/Wodo.html">Wodo</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Class TextEditor
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/wodotexteditor.js.html">wodotexteditor.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class TextEditor.">
<caption>Class Summary</caption>
<thead>
<tr>
<th scope="col">Constructor Attributes</th>
<th scope="col">Constructor Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/TextEditor.html#constructor">TextEditor</a></b>(mainContainerElementId, editorOptions)
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class TextEditor.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#addEventListener">addEventListener</a></b>(eventId, callback)
</div>
<div class="description">Registers a callback which should be called if the given event happens.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#closeDocument">closeDocument</a></b>(callback)
</div>
<div class="description">Closes the document, and does cleanup.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#destroy">destroy</a></b>(callback)
</div>
<div class="description">Destructs the editor object completely.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#getDocumentAsByteArray">getDocumentAsByteArray</a></b>(callback)
</div>
<div class="description"></div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#getMetadata">getMetadata</a></b>(property)
</div>
<div class="description">Returns the value of the requested document metadata field.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#getUserData">getUserData</a></b>()
</div>
<div class="description">Returns the data set for the person that is editing the document.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#isDocumentModified">isDocumentModified</a></b>()
</div>
<div class="description">Returns if the current state of the document matches the unmodified state.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#openDocumentFromUrl">openDocumentFromUrl</a></b>(docUrl, callback)
</div>
<div class="description">Loads an ODT document into the editor.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#removeEventListener">removeEventListener</a></b>(eventId, callback)
</div>
<div class="description">Unregisters a callback for the given event.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#setDocumentModified">setDocumentModified</a></b>(modified)
</div>
<div class="description">Sets the current state of the document to be either the unmodified state
or a modified state.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#setMetadata">setMetadata</a></b>(setProperties, removedProperties)
</div>
<div class="description">Sets the metadata fields from the given properties map.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/TextEditor.html#setUserData">setUserData</a></b>(data)
</div>
<div class="description">Sets the data for the person that is editing the document.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Class Detail
</div>
<div class="fixedFont">
<b>TextEditor</b>(mainContainerElementId, editorOptions)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>mainContainerElementId</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{!Object.<!string|!*>}</span> <b>editorOptions</b>
</dt>
<dd></dd>
</dl>
</div>
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="addEventListener"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>addEventListener</b>(eventId, callback)
</div>
<div class="description">
Registers a callback which should be called if the given event happens.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>eventId</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{!Function}</span> <b>callback</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="closeDocument"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>closeDocument</b>(callback)
</div>
<div class="description">
Closes the document, and does cleanup.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!function(!Error=):undefined}</span> <b>callback</b>
</dt>
<dd>Called once the document has been closed, passes an error object in case of error</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="destroy"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>destroy</b>(callback)
</div>
<div class="description">
Destructs the editor object completely.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!function(!Error=):undefined}</span> <b>callback</b>
</dt>
<dd>Called once the destruction has been completed, passes an error object in case of error</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="getDocumentAsByteArray"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>getDocumentAsByteArray</b>(callback)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!function(err:?Error|file:!Uint8Array=):undefined}</span> <b>callback</b>
</dt>
<dd>Called with the current document as ODT file as bytearray, passes an error object in case of error</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="getMetadata"> </a>
<div class="fixedFont">
<span class="light">{?string}</span>
<b>getMetadata</b>(property)
</div>
<div class="description">
Returns the value of the requested document metadata field.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>property</b>
</dt>
<dd>A namespace-prefixed field name, for example
dc:creator</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{?string}</span> </dd>
</dl>
<hr />
<a name="getUserData"> </a>
<div class="fixedFont">
<span class="light">{!Object.<!string|!string>}</span>
<b>getUserData</b>()
</div>
<div class="description">
Returns the data set for the person that is editing the document.
</div>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{!Object.<!string|!string>}</span> </dd>
</dl>
<hr />
<a name="isDocumentModified"> </a>
<div class="fixedFont">
<span class="light">{!boolean}</span>
<b>isDocumentModified</b>()
</div>
<div class="description">
Returns if the current state of the document matches the unmodified state.
</div>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{!boolean}</span> </dd>
</dl>
<hr />
<a name="openDocumentFromUrl"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>openDocumentFromUrl</b>(docUrl, callback)
</div>
<div class="description">
Loads an ODT document into the editor.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>docUrl</b>
</dt>
<dd>url from which the ODT document can be loaded</dd>
<dt>
<span class="light fixedFont">{!function(!Error=):undefined}</span> <b>callback</b>
</dt>
<dd>Called once the document has been opened, passes an error object in case of error</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="removeEventListener"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>removeEventListener</b>(eventId, callback)
</div>
<div class="description">
Unregisters a callback for the given event.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>eventId</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{!Function}</span> <b>callback</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="setDocumentModified"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>setDocumentModified</b>(modified)
</div>
<div class="description">
Sets the current state of the document to be either the unmodified state
or a modified state.
If @p modified is @true and the current state was already a modified state,
this call has no effect and also does not remove the unmodified flag
from the state which has it set.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!boolean}</span> <b>modified</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="setMetadata"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>setMetadata</b>(setProperties, removedProperties)
</div>
<div class="description">
Sets the metadata fields from the given properties map.
Avoid setting certain fields since they are automatically set:
dc:creator
dc:date
meta:editing-cycles
The following properties are never used and will be removed for semantic
consistency from the document:
meta:editing-duration
meta:document-statistic
Setting any of the above mentioned fields using this method will have no effect.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{?Object.<!string|!string>}</span> <b>setProperties</b>
</dt>
<dd>A flat object that is a string->string map of field name -> value.</dd>
<dt>
<span class="light fixedFont">{?Array.<!string>}</span> <b>removedProperties</b>
</dt>
<dd>An array of metadata field names (prefixed).</dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<hr />
<a name="setUserData"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>setUserData</b>(data)
</div>
<div class="description">
Sets the data for the person that is editing the document.
The supported fields are:
"fullName": the full name of the editing person
"color": color to use for the user specific UI elements
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{?Object.<!string|!string>|undefined}</span> <b>data</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST)
</div>
</body>
</html>

View File

@ -1,687 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - Wodo</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/TextEditor.html">TextEditor</a></li>
<li><a href="../symbols/Wodo.html">Wodo</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Namespace Wodo
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
<br /><i>Defined in: </i> <a href="../symbols/src/wodotexteditor.js.html">wodotexteditor.js</a>.
</p>
<!-- ============================== constructor summary ==================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class Wodo.">
<caption>Namespace Summary</caption>
<thead>
<tr>
<th scope="col">Constructor Attributes</th>
<th scope="col">Constructor Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription" >
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#constructor">Wodo</a></b>
</div>
<div class="description">Namespace of the Wodo.TextEditor</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class Wodo.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#EVENT_DOCUMENTMODIFIEDCHANGED">EVENT_DOCUMENTMODIFIEDCHANGED</a></b>
</div>
<div class="description">Id of event if documentModified state changes</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#EVENT_METADATACHANGED">EVENT_METADATACHANGED</a></b>
</div>
<div class="description">Id of event if metadata changes</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#EVENT_UNKNOWNERROR">EVENT_UNKNOWNERROR</a></b>
</div>
<div class="description">Id of event for an unkown error</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#MODUS_FULLEDITING">MODUS_FULLEDITING</a></b>
</div>
<div class="description">Id of full editing modus</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/Wodo.html#MODUS_REVIEW">MODUS_REVIEW</a></b>
</div>
<div class="description">Id of review modus</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class Wodo.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/Wodo.html#createTextEditor">createTextEditor</a></b>(editorContainerElementId, editorOptions, onEditorCreated)
</div>
<div class="description">Creates a text editor object and returns it on success in the passed callback.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<div class="details"><a name="constructor"> </a>
<div class="sectionTitle">
Namespace Detail
</div>
<div class="fixedFont">
<b>Wodo</b>
</div>
<div class="description">
Namespace of the Wodo.TextEditor
</div>
</div>
<!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="EVENT_DOCUMENTMODIFIEDCHANGED"> </a>
<div class="fixedFont">
<b>EVENT_DOCUMENTMODIFIEDCHANGED</b>
</div>
<div class="description">
Id of event if documentModified state changes
</div>
<hr />
<a name="EVENT_METADATACHANGED"> </a>
<div class="fixedFont">
<b>EVENT_METADATACHANGED</b>
</div>
<div class="description">
Id of event if metadata changes
</div>
<hr />
<a name="EVENT_UNKNOWNERROR"> </a>
<div class="fixedFont">
<b>EVENT_UNKNOWNERROR</b>
</div>
<div class="description">
Id of event for an unkown error
</div>
<hr />
<a name="MODUS_FULLEDITING"> </a>
<div class="fixedFont">
<b>MODUS_FULLEDITING</b>
</div>
<div class="description">
Id of full editing modus
</div>
<hr />
<a name="MODUS_REVIEW"> </a>
<div class="fixedFont">
<b>MODUS_REVIEW</b>
</div>
<div class="description">
Id of review modus
</div>
<!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="createTextEditor"> </a>
<div class="fixedFont">
<span class="light">{undefined}</span>
<b>createTextEditor</b>(editorContainerElementId, editorOptions, onEditorCreated)
</div>
<div class="description">
Creates a text editor object and returns it on success in the passed callback.
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{!string}</span> <b>editorContainerElementId</b>
</dt>
<dd>id of the existing div element which will contain the editor (should be empty before)</dd>
<dt>
<b>editorOptions</b>
</dt>
<dd>options to configure the features of the editor. All entries are optional</dd>
<dt>
<b>editorOptions.modus</b>
<i>Optional, Default: Wodo.MODUS_FULLEDITING</i>
</dt>
<dd>set the editing modus. Current options: Wodo.MODUS_FULLEDITING, Wodo.MODUS_REVIEW</dd>
<dt>
<b>editorOptions.loadCallback</b>
<i>Optional</i>
</dt>
<dd>parameter-less callback method, adds a "Load" button to the toolbar which triggers this method</dd>
<dt>
<b>editorOptions.saveCallback</b>
<i>Optional</i>
</dt>
<dd>parameter-less callback method, adds a "Save" button to the toolbar which triggers this method</dd>
<dt>
<b>editorOptions.saveAsCallback</b>
<i>Optional</i>
</dt>
<dd>parameter-less callback method, adds a "Save as" button to the toolbar which triggers this method</dd>
<dt>
<b>editorOptions.downloadCallback</b>
<i>Optional</i>
</dt>
<dd>parameter-less callback method, adds a "Download" button to the right of the toolbar which triggers this method</dd>
<dt>
<b>editorOptions.closeCallback</b>
<i>Optional</i>
</dt>
<dd>parameter-less callback method, adds a "Save" button to the toolbar which triggers this method</dd>
<dt>
<b>editorOptions.allFeaturesEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', switches the default for all features from 'false' to 'true'</dd>
<dt>
<b>editorOptions.directTextStylingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the direct styling of text (e.g. bold/italic or font)</dd>
<dt>
<b>editorOptions.directParagraphStylingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the direct styling of paragraphs (e.g. indentation or alignement)</dd>
<dt>
<b>editorOptions.paragraphStyleSelectingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables setting of defined paragraph styles to paragraphs</dd>
<dt>
<b>editorOptions.paragraphStyleEditingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the editing of defined paragraph styles</dd>
<dt>
<b>editorOptions.imageEditingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the insertion of images</dd>
<dt>
<b>editorOptions.hyperlinkEditingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the editing of hyperlinks</dd>
<dt>
<b>editorOptions.annotationsEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the display and the editing of annotations</dd>
<dt>
<b>editorOptions.undoRedoEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the Undo and Redo of editing actions</dd>
<dt>
<b>editorOptions.zoomingEnabled</b>
<i>Optional, Default: false</i>
</dt>
<dd>if set to 'true', enables the zooming tool</dd>
<dt>
<b>editorOptions.userData</b>
<i>Optional</i>
</dt>
<dd>data about the user editing the document</dd>
<dt>
<b>editorOptions.userData.fullName</b>
<i>Optional</i>
</dt>
<dd>full name of the user, used for annotations and in the metadata of the document</dd>
<dt>
<b>editorOptions.userData.color</b>
<i>Optional, Default: "black"</i>
</dt>
<dd>color to use for any user related indicators like cursor or annotations</dd>
<dt>
<span class="light fixedFont">{!function(err:?Error|editor:!TextEditor=):undefined}</span> <b>onEditorCreated</b>
</dt>
<dd></dd>
</dl>
<dl class="detailList">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{undefined}</span> </dd>
</dl>
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST)
</div>
</body>
</html>

View File

@ -1,253 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - _global_</title>
<style type="text/css">
/* default.css */
body
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
{
clear: both;
background-color: #ccc;
padding: 8px;
}
h1
{
font-size: 150%;
font-weight: bold;
padding: 0;
margin: 1em 0 0 .3em;
}
hr
{
border: none 0;
border-top: 1px solid #7F8FB1;
height: 1px;
}
pre.code
{
display: block;
padding: 8px;
border: 1px dashed #ccc;
}
#index
{
margin-top: 24px;
float: left;
width: 160px;
position: absolute;
left: 8px;
background-color: #F3F3F3;
padding: 8px;
}
#content
{
margin-left: 190px;
width: 600px;
}
.classList
{
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
font-family: arial, sans-serif;
font-size: 1em;
overflow: auto;
}
.classList li
{
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
background-color: #7F8FB1;
color: #fff;
font-size:130%;
text-align: left;
padding: 2px 6px 2px 6px;
border: 1px #7F8FB1 solid;
}
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
border-right: 1px #7F8FB1 solid;
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
line-height: 15px;
padding: 4px;
padding-left: 4px;
}
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
list-style: square;
margin-left: 20px;
padding-left: 0;
}
.detailList {
margin-left: 20px;
line-height: 15px;
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
color: #777;
font-style: italic;
}
.fineprint
{
text-align: right;
font-size: 10px;
}
</style>
</head>
<body>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div id="header">
</div>
<!-- end static/header.html -->
<!-- ============================== classes index ============================ -->
<div id="index">
<!-- begin publish.classesIndex -->
<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
<li><a href="../symbols/TextEditor.html">TextEditor</a></li>
<li><a href="../symbols/Wodo.html">Wodo</a></li>
</ul>
<hr />
<!-- end publish.classesIndex -->
</div>
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Built-In Namespace _global_
</h1>
<!-- ============================== class summary ========================== -->
<p class="description">
</p>
<!-- ============================== constructor summary ==================== -->
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<!-- ============================== events summary ======================== -->
<!-- ============================== constructor details ==================== -->
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<!-- ============================== event details ========================= -->
<hr />
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST)
</div>
</body>
</html>

View File

@ -1,865 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Copyright (C) 2014 KO GmbH &lt;copyright@kogmbh.com>
<span class='line'> 3</span> *
<span class='line'> 4</span> * @licstart
<span class='line'> 5</span> * This file is part of WebODF.
<span class='line'> 6</span> *
<span class='line'> 7</span> * WebODF is free software: you can redistribute it and/or modify it
<span class='line'> 8</span> * under the terms of the GNU Affero General Public License (GNU AGPL)
<span class='line'> 9</span> * as published by the Free Software Foundation, either version 3 of
<span class='line'> 10</span> * the License, or (at your option) any later version.
<span class='line'> 11</span> *
<span class='line'> 12</span> * WebODF is distributed in the hope that it will be useful, but
<span class='line'> 13</span> * WITHOUT ANY WARRANTY; without even the implied warranty of
<span class='line'> 14</span> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<span class='line'> 15</span> * GNU Affero General Public License for more details.
<span class='line'> 16</span> *
<span class='line'> 17</span> * You should have received a copy of the GNU Affero General Public License
<span class='line'> 18</span> * along with WebODF. If not, see &lt;http://www.gnu.org/licenses/>.
<span class='line'> 19</span> * @licend
<span class='line'> 20</span> *
<span class='line'> 21</span> * @source: http://www.webodf.org/
<span class='line'> 22</span> * @source: https://github.com/kogmbh/WebODF/
<span class='line'> 23</span> */</span><span class="WHIT">
<span class='line'> 24</span>
<span class='line'> 25</span> </span><span class="COMM">/*global window, document, alert, navigator, require, dojo, runtime, core, gui, ops, odf, WodoFromSource*/</span><span class="WHIT">
<span class='line'> 26</span>
<span class='line'> 27</span> </span><span class="COMM">/**
<span class='line'> 28</span> * Namespace of the Wodo.TextEditor
<span class='line'> 29</span> * @namespace
<span class='line'> 30</span> * @name Wodo
<span class='line'> 31</span> */</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="NAME">window.Wodo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.Wodo</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span>
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">getInstallationPath</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 37</span> * Sees to get the url of this script on top of the stack trace.
<span class='line'> 38</span> * @param {!string|undefined} stack
<span class='line'> 39</span> * @return {!string|undefined}
<span class='line'> 40</span> */</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">getScriptUrlFromStack</span><span class="PUNC">(</span><span class="NAME">stack</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">matches</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 43</span>
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">stack</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">stack</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">/*jslint regexp: true*/</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">matches</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">stack.match</span><span class="PUNC">(</span><span class="REGX">/((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="COMM">/*jslint regexp: false*/</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">matches</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">matches</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 55</span>
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 57</span> * Tries by various tricks to get the url of this script.
<span class='line'> 58</span> * To be called if document.currentScript is not supported
<span class='line'> 59</span> * @return {!string|undefined}
<span class='line'> 60</span> */</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">getCurrentScriptElementSrcByTricks</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scriptElements</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">"script"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span>
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="COMM">// if there is only one script, it must be this</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scriptElements.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">scriptElements</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">src</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 68</span>
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="COMM">// otherwise get it from the stacktrace</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">getScriptUrlFromStack</span><span class="PUNC">(</span><span class="NAME">err.stack</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 76</span>
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">path</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"."</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scriptElementSrc</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pathname</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span>
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.currentScript</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">document.currentScript.src</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">scriptElementSrc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.currentScript.src</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">scriptElementSrc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getCurrentScriptElementSrcByTricks</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 85</span>
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scriptElementSrc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">'a'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">a.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">scriptElementSrc</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">pathname</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a.pathname</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pathname.charAt</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="COMM">// Various versions of Internet Explorer seems to neglect the leading slash under some conditions</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="COMM">// (not when watching it with the dev tools of course!). This was confirmed in IE10 + IE11</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">pathname</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pathname</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 95</span>
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pathname.lastIndexOf</span><span class="PUNC">(</span><span class="STRN">"/"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">path</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pathname.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"Could not estimate installation path of the Wodo.TextEditor."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">path</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>105</span>
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>107</span> @type{!string} */</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getInstallationPath</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @type{!boolean} */</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">isInitalized</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @type{!Array.&lt;!function():undefined>} */</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">pendingInstanceCreationCalls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @type{!number} */</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: avatar image url needs base-url setting.</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="COMM">// so far Wodo itself does not have a setup call,</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="COMM">// but then the avatar is also not used yet here</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">defaultUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">color</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"black"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">imageUrl</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"avatar-joe.png"</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>124</span> @type{!Array.&lt;!string>} */</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">userDataFieldNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"fullName"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"color"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"imageUrl"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>127</span> @type{!string} */</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">memberId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"localuser"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="COMM">// constructors</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="NAME">BorderContainer</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ContentPane</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">FullWindowZoomHelper</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">EditorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Tools</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>132</span> @type{!string} */</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">MODUS_FULLEDITING</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"fullediting"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>135</span> @type{!string} */</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">MODUS_REVIEW</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"review"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>138</span> @type{!string} */</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_UNKNOWNERROR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"unknownError"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>141</span> @type {!string} */</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_DOCUMENTMODIFIEDCHANGED</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"documentModifiedChanged"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>144</span> @type {!string} */</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_METADATACHANGED</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"metadataChanged"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span>
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="NAME">window.dojoConfig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">WebODFEditorDojoLocale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"C"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span>
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">navigator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">navigator.language</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">navigator.language.match</span><span class="PUNC">(</span><span class="REGX">/^(de)/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">WebODFEditorDojoLocale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">navigator.language.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>153</span>
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">locale</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">WebODFEditorDojoLocale</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">paths</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="STRN">"webodf/editor"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="STRN">"dijit"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/dijit"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="STRN">"dojox"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/dojox"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="STRN">"dojo"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/dojo"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="STRN">"resources"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/resources"</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span>
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>167</span> * @return {undefined}
<span class='line'>168</span> */</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">initTextEditor</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">require</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="STRN">"dijit/layout/BorderContainer"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="STRN">"dijit/layout/ContentPane"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="STRN">"webodf/editor/FullWindowZoomHelper"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="STRN">"webodf/editor/EditorSession"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="STRN">"webodf/editor/Tools"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="STRN">"webodf/editor/Translator"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">BC</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">CP</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">FWZH</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ES</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">T</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Translator</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">locale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">navigator.language</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"en-US"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">editorBase</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dojo.config</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dojo.config.paths</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dojo.config.paths</span><span class="PUNC">[</span><span class="STRN">"webodf/editor"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">translationsDir</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorBase</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/translations'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span>
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">BorderContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">BC</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="NAME">ContentPane</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CP</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">FullWindowZoomHelper</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">FWZH</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="NAME">EditorSession</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ES</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">Tools</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">T</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span>
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: locale cannot be set by the user, also different for different editors</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Translator</span><span class="PUNC">(</span><span class="NAME">translationsDir</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">locale</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">editorTranslator</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="NAME">runtime.setTranslator</span><span class="PUNC">(</span><span class="NAME">editorTranslator.translate</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="COMM">// Extend runtime with a convenient translation function</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">runtime.translateContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="NAME">placeholder</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">translatable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">node.querySelectorAll</span><span class="PUNC">(</span><span class="STRN">"*[text-i18n]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>199</span>
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">translatable.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">translatable</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">element.localName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="NAME">placeholder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">element.getAttribute</span><span class="PUNC">(</span><span class="STRN">'text-i18n'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"label"</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"span"</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="REGX">/h\d/i</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">tag</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">element.textContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runtime.tr</span><span class="PUNC">(</span><span class="NAME">placeholder</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span>
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">defaultUserData.fullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">runtime.tr</span><span class="PUNC">(</span><span class="STRN">"Unknown Author"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span>
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">isInitalized</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="NAME">pendingInstanceCreationCalls.forEach</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">create</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">create</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>217</span>
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="COMM">// only done to make jslint see the var used</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>223</span>
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>225</span> * Creates a new record with userdata, and for all official fields
<span class='line'>226</span> * copies over the value from the original or, if not present there,
<span class='line'>227</span> * sets it to the default value.
<span class='line'>228</span> * @param {?Object.&lt;!string,!string>|undefined} original, defaults to {}
<span class='line'>229</span> * @return {!Object.&lt;!string,!string>}
<span class='line'>230</span> */</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">cloneUserData</span><span class="PUNC">(</span><span class="NAME">original</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>233</span>
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">original</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="NAME">original</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>237</span>
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="NAME">userDataFieldNames.forEach</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">fieldName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">fieldName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">original</span><span class="PUNC">[</span><span class="NAME">fieldName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">defaultUserData</span><span class="PUNC">[</span><span class="NAME">fieldName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>241</span>
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>244</span>
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>246</span> * @name TextEditor
<span class='line'>247</span> * @constructor
<span class='line'>248</span> * @param {!string} mainContainerElementId
<span class='line'>249</span> * @param {!Object.&lt;!string,!*>} editorOptions
<span class='line'>250</span> */</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">TextEditor</span><span class="PUNC">(</span><span class="NAME">mainContainerElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorOptions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span>
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>255</span> * Returns true if either all features are wanted and this one is not explicitely disabled
<span class='line'>256</span> * or if not all features are wanted by default and it is explicitely enabled
<span class='line'>257</span> * @param {?boolean|undefined} isFeatureEnabled explicit flag which enables a feature
<span class='line'>258</span> * @return {!boolean}
<span class='line'>259</span> */</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">isFeatureEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">editorOptions.allFeaturesEnabled</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isFeatureEnabled</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">isFeatureEnabled</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>263</span>
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">userData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="NAME">mainContainerElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">mainContainerElementId</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">canvasElement</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="NAME">canvasContainerElement</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="NAME">toolbarElement</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="NAME">toolbarContainerElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// needed because dijit toolbar overwrites direct classList</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="NAME">editorElement</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>273</span> @type{!string} */</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">canvasElementId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-canvas"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>276</span> @type{!string} */</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">canvasContainerElementId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-canvascontainer"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>279</span> @type{!string} */</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="NAME">toolbarElementId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-toolbar"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>282</span> @type{!string} */</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">editorElementId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-editor"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">instanceCounter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="NAME">fullWindowZoomHelper</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">mainContainer</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="NAME">tools</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">session</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">loadOdtFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorOptions.loadCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">saveOdtFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorOptions.saveCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="NAME">saveAsOdtFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorOptions.saveAsCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="NAME">downloadOdtFile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorOptions.downloadCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="NAME">close</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editorOptions.closeCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT"> </span><span class="NAME">reviewModeEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">editorOptions.modus</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">MODUS_REVIEW</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT"> </span><span class="NAME">directTextStylingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.directTextStylingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="NAME">directParagraphStylingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.directParagraphStylingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleSelectingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">reviewModeEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.paragraphStyleSelectingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleEditingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">reviewModeEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.paragraphStyleEditingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="NAME">imageEditingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">reviewModeEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.imageEditingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="NAME">hyperlinkEditingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.hyperlinkEditingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="NAME">annotationsEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">reviewModeEnabled</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.annotationsEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="NAME">undoRedoEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.undoRedoEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT"> </span><span class="NAME">zoomingEnabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isEnabled</span><span class="PUNC">(</span><span class="NAME">editorOptions.zoomingEnabled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="NAME">pendingMemberId</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="NAME">pendingEditorReadyCallback</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="NAME">eventNotifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">core.EventNotifier</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_UNKNOWNERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_DOCUMENTMODIFIEDCHANGED</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_METADATACHANGED</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span>
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">Boolean</span><span class="PUNC">(</span><span class="NAME">mainContainerElement</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"No id of an existing element passed to Wodo.createTextEditor(): "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">mainContainerElementId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span>
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>323</span> * @param {!Object} changes
<span class='line'>324</span> * @return {undefined}
<span class='line'>325</span> */</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">relayMetadataSignal</span><span class="PUNC">(</span><span class="NAME">changes</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="NAME">eventNotifier.emit</span><span class="PUNC">(</span><span class="NAME">EVENT_METADATACHANGED</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">changes</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>329</span>
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>331</span> * @param {!Object} changes
<span class='line'>332</span> * @return {undefined}
<span class='line'>333</span> */</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">relayModifiedSignal</span><span class="PUNC">(</span><span class="NAME">modified</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT"> </span><span class="NAME">eventNotifier.emit</span><span class="PUNC">(</span><span class="NAME">EVENT_DOCUMENTMODIFIEDCHANGED</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">modified</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>337</span>
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>339</span> * @return {undefined}
<span class='line'>340</span> */</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">createSession</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">viewOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="NAME">editInfoMarkersInitiallyVisible</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT"> </span><span class="NAME">caretAvatarsInitiallyVisible</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT"> </span><span class="NAME">caretBlinksOnRangeSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span>
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="COMM">// create session around loaded document</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="NAME">session</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ops.Session</span><span class="PUNC">(</span><span class="NAME">odfCanvas</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="NAME">editorSession</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">EditorSession</span><span class="PUNC">(</span><span class="NAME">session</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pendingMemberId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="NAME">viewOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">viewOptions</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT"> </span><span class="NAME">directTextStylingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">directTextStylingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="NAME">directParagraphStylingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">directParagraphStylingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleSelectingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paragraphStyleSelectingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleEditingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paragraphStyleEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT"> </span><span class="NAME">imageEditingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">imageEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT"> </span><span class="NAME">hyperlinkEditingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hyperlinkEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="NAME">annotationsEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">annotationsEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT"> </span><span class="NAME">zoomingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">zoomingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT"> </span><span class="NAME">reviewModeEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">reviewModeEnabled</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undoRedoEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.setUndoManager</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">gui.TrivialUndoManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getUndoManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">subscribe</span><span class="PUNC">(</span><span class="NAME">gui.UndoManager.signalDocumentModifiedChanged</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">relayModifiedSignal</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>366</span>
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="COMM">// Relay any metadata changes to the Editor's consumer as an event</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getMetadataController</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">subscribe</span><span class="PUNC">(</span><span class="NAME">gui.MetadataController.signalMetadataChanged</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">relayMetadataSignal</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>369</span>
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="COMM">// and report back to caller</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT"> </span><span class="NAME">pendingEditorReadyCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT"> </span><span class="COMM">// reset</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT"> </span><span class="NAME">pendingEditorReadyCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT"> </span><span class="NAME">pendingMemberId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>376</span>
<span class='line'>377</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>378</span> * @return {undefined}
<span class='line'>379</span> */</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">startEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>382</span>
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="NAME">tools.setEditorSession</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.insertLocalCursor</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.startEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>387</span>
<span class='line'>388</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>389</span> * @return {undefined}
<span class='line'>390</span> */</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">endEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>393</span>
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="NAME">tools.setEditorSession</span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.endEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.removeLocalCursor</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>398</span>
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>400</span> * Loads an ODT document into the editor.
<span class='line'>401</span> * @name TextEditor#openDocumentFromUrl
<span class='line'>402</span> * @function
<span class='line'>403</span> * @param {!string} docUrl url from which the ODT document can be loaded
<span class='line'>404</span> * @param {!function(!Error=):undefined} callback Called once the document has been opened, passes an error object in case of error
<span class='line'>405</span> * @return {undefined}
<span class='line'>406</span> */</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT"> </span><span class="NAME">this.openDocumentFromUrl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">docUrl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorReadyCallback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">docUrl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"document should be defined here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">pendingEditorReadyCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"pendingEditorReadyCallback should not exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should not exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">session</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"session should not exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>412</span>
<span class='line'>413</span> </span><span class="WHIT"> </span><span class="NAME">pendingMemberId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">memberId</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT"> </span><span class="NAME">pendingEditorReadyCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ops.OpAddMember</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT"> </span><span class="NAME">op.init</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT"> </span><span class="NAME">memberid</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">memberId</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT"> </span><span class="NAME">setProperties</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">userData</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT"> </span><span class="NAME">session.enqueue</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">op</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="NAME">startEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">editorReadyCallback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT"> </span><span class="NAME">editorReadyCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>426</span>
<span class='line'>427</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas.load</span><span class="PUNC">(</span><span class="NAME">docUrl</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>429</span>
<span class='line'>430</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>431</span> * Closes the document, and does cleanup.
<span class='line'>432</span> * @name TextEditor#closeDocument
<span class='line'>433</span> * @function
<span class='line'>434</span> * @param {!function(!Error=):undefined} callback Called once the document has been closed, passes an error object in case of error
<span class='line'>435</span> * @return {undefined}
<span class='line'>436</span> */</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT"> </span><span class="NAME">this.closeDocument</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">session</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"session should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>439</span>
<span class='line'>440</span> </span><span class="WHIT"> </span><span class="NAME">endEditing</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>441</span>
<span class='line'>442</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ops.OpRemoveMember</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT"> </span><span class="NAME">op.init</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT"> </span><span class="NAME">memberid</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">memberId</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT"> </span><span class="NAME">session.enqueue</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">op</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>447</span>
<span class='line'>448</span> </span><span class="WHIT"> </span><span class="NAME">session.close</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getMetadataController</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unsubscribe</span><span class="PUNC">(</span><span class="NAME">gui.MetadataController.signalMetadataChanged</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">relayMetadataSignal</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.destroy</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT"> </span><span class="NAME">editorSession</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT"> </span><span class="NAME">session.destroy</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT"> </span><span class="NAME">session</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span>
<span class='line'>472</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>473</span> * @name TextEditor#getDocumentAsByteArray
<span class='line'>474</span> * @function
<span class='line'>475</span> * @param {!function(err:?Error, file:!Uint8Array=):undefined} callback Called with the current document as ODT file as bytearray, passes an error object in case of error
<span class='line'>476</span> * @return {undefined}
<span class='line'>477</span> */</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT"> </span><span class="NAME">this.getDocumentAsByteArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">odfContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">odfCanvas.odfContainer</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>480</span>
<span class='line'>481</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">odfContainer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT"> </span><span class="NAME">odfContainer.createByteArray</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ba</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ba</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorString</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">errorString</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"Could not create bytearray from OdfContainer."</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"No odfContainer set!"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>491</span>
<span class='line'>492</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>493</span> * Sets the metadata fields from the given properties map.
<span class='line'>494</span> * Avoid setting certain fields since they are automatically set:
<span class='line'>495</span> * dc:creator
<span class='line'>496</span> * dc:date
<span class='line'>497</span> * meta:editing-cycles
<span class='line'>498</span> *
<span class='line'>499</span> * The following properties are never used and will be removed for semantic
<span class='line'>500</span> * consistency from the document:
<span class='line'>501</span> * meta:editing-duration
<span class='line'>502</span> * meta:document-statistic
<span class='line'>503</span> *
<span class='line'>504</span> * Setting any of the above mentioned fields using this method will have no effect.
<span class='line'>505</span> *
<span class='line'>506</span> * @name TextEditor#setMetadata
<span class='line'>507</span> * @function
<span class='line'>508</span> * @param {?Object.&lt;!string, !string>} setProperties A flat object that is a string->string map of field name -> value.
<span class='line'>509</span> * @param {?Array.&lt;!string>} removedProperties An array of metadata field names (prefixed).
<span class='line'>510</span> * @return {undefined}
<span class='line'>511</span> */</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT"> </span><span class="NAME">this.setMetadata</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">setProperties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">removedProperties</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span>
<span class='line'>515</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getMetadataController</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setMetadata</span><span class="PUNC">(</span><span class="NAME">setProperties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">removedProperties</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>517</span>
<span class='line'>518</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>519</span> * Returns the value of the requested document metadata field.
<span class='line'>520</span> * @name TextEditor#getMetadata
<span class='line'>521</span> * @function
<span class='line'>522</span> * @param {!string} property A namespace-prefixed field name, for example
<span class='line'>523</span> * dc:creator
<span class='line'>524</span> * @return {?string}
<span class='line'>525</span> */</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT"> </span><span class="NAME">this.getMetadata</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>528</span>
<span class='line'>529</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getMetadataController</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getMetadata</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span>
<span class='line'>532</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>533</span> * Sets the data for the person that is editing the document.
<span class='line'>534</span> * The supported fields are:
<span class='line'>535</span> * "fullName": the full name of the editing person
<span class='line'>536</span> * "color": color to use for the user specific UI elements
<span class='line'>537</span> * @name TextEditor#setUserData
<span class='line'>538</span> * @function
<span class='line'>539</span> * @param {?Object.&lt;!string,!string>|undefined} data
<span class='line'>540</span> * @return {undefined}
<span class='line'>541</span> */</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setUserData</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT"> </span><span class="NAME">userData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cloneUserData</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT"> </span><span class="NAME">this.setUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">setUserData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span>
<span class='line'>547</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>548</span> * Returns the data set for the person that is editing the document.
<span class='line'>549</span> * @name TextEditor#getUserData
<span class='line'>550</span> * @function
<span class='line'>551</span> * @return {!Object.&lt;!string,!string>}
<span class='line'>552</span> */</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT"> </span><span class="NAME">this.getUserData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>554</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">cloneUserData</span><span class="PUNC">(</span><span class="NAME">userData</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>555</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>556</span>
<span class='line'>557</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>558</span> * Sets the current state of the document to be either the unmodified state
<span class='line'>559</span> * or a modified state.
<span class='line'>560</span> * If @p modified is @true and the current state was already a modified state,
<span class='line'>561</span> * this call has no effect and also does not remove the unmodified flag
<span class='line'>562</span> * from the state which has it set.
<span class='line'>563</span> *
<span class='line'>564</span> * @name TextEditor#setDocumentModified
<span class='line'>565</span> * @function
<span class='line'>566</span> * @param {!boolean} modified
<span class='line'>567</span> * @return {undefined}
<span class='line'>568</span> */</span><span class="WHIT">
<span class='line'>569</span> </span><span class="WHIT"> </span><span class="NAME">this.setDocumentModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">modified</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>571</span>
<span class='line'>572</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undoRedoEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getUndoManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setDocumentModified</span><span class="PUNC">(</span><span class="NAME">modified</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>576</span>
<span class='line'>577</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>578</span> * Returns if the current state of the document matches the unmodified state.
<span class='line'>579</span> * @name TextEditor#isDocumentModified
<span class='line'>580</span> * @function
<span class='line'>581</span> * @return {!boolean}
<span class='line'>582</span> */</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT"> </span><span class="NAME">this.isDocumentModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="NAME">editorSession</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"editorSession should exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span>
<span class='line'>586</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undoRedoEnabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getUndoManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">isDocumentModified</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>589</span>
<span class='line'>590</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span>
<span class='line'>593</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>594</span> * @return {undefined}
<span class='line'>595</span> */</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setFocusToOdfCanvas</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT"> </span><span class="NAME">editorSession.sessionController.getEventManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">focus</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>599</span>
<span class='line'>600</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>601</span> * @param {!function(!Error=):undefined} callback passes an error object in case of error
<span class='line'>602</span> * @return {undefined}
<span class='line'>603</span> */</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">destroyInternal</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT"> </span><span class="NAME">mainContainerElement.removeChild</span><span class="PUNC">(</span><span class="NAME">editorElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>606</span>
<span class='line'>607</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>609</span>
<span class='line'>610</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>611</span> * Destructs the editor object completely.
<span class='line'>612</span> * @name TextEditor#destroy
<span class='line'>613</span> * @function
<span class='line'>614</span> * @param {!function(!Error=):undefined} callback Called once the destruction has been completed, passes an error object in case of error
<span class='line'>615</span> * @return {undefined}
<span class='line'>616</span> */</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT"> </span><span class="NAME">this.destroy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">destroyCallbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>619</span>
<span class='line'>620</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: decide if some forced close should be done here instead of enforcing proper API usage</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT"> </span><span class="NAME">runtime.assert</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">session</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"session should not exist here."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>622</span>
<span class='line'>623</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: investigate what else needs to be done</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT"> </span><span class="NAME">mainContainer.destroyRecursive</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>625</span>
<span class='line'>626</span> </span><span class="WHIT"> </span><span class="NAME">destroyCallbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">destroyCallbacks.concat</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT"> </span><span class="NAME">fullWindowZoomHelper.destroy</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT"> </span><span class="NAME">tools.destroy</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas.destroy</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT"> </span><span class="NAME">destroyInternal</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>632</span>
<span class='line'>633</span> </span><span class="WHIT"> </span><span class="NAME">core.Async.destroyAll</span><span class="PUNC">(</span><span class="NAME">destroyCallbacks</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>635</span>
<span class='line'>636</span> </span><span class="WHIT"> </span><span class="COMM">// TODO:</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT"> </span><span class="COMM">// this.openDocumentFromByteArray = openDocumentFromByteArray; see also https://github.com/kogmbh/WebODF/issues/375</span><span class="WHIT">
<span class='line'>638</span> </span><span class="WHIT"> </span><span class="COMM">// setReadOnly: setReadOnly,</span><span class="WHIT">
<span class='line'>639</span>
<span class='line'>640</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>641</span> * Registers a callback which should be called if the given event happens.
<span class='line'>642</span> * @name TextEditor#addEventListener
<span class='line'>643</span> * @function
<span class='line'>644</span> * @param {!string} eventId
<span class='line'>645</span> * @param {!Function} callback
<span class='line'>646</span> * @return {undefined}
<span class='line'>647</span> */</span><span class="WHIT">
<span class='line'>648</span> </span><span class="WHIT"> </span><span class="NAME">this.addEventListener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">eventNotifier.subscribe</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>649</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>650</span> * Unregisters a callback for the given event.
<span class='line'>651</span> * @name TextEditor#removeEventListener
<span class='line'>652</span> * @function
<span class='line'>653</span> * @param {!string} eventId
<span class='line'>654</span> * @param {!Function} callback
<span class='line'>655</span> * @return {undefined}
<span class='line'>656</span> */</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT"> </span><span class="NAME">this.removeEventListener</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">eventNotifier.unsubscribe</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>658</span>
<span class='line'>659</span>
<span class='line'>660</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>661</span> * @return {undefined}
<span class='line'>662</span> */</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">editorPane</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT"> </span><span class="COMM">/** @inner @const
<span class='line'>666</span> @type{!string} */</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT"> </span><span class="NAME">documentns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.documentElement.namespaceURI</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>668</span>
<span class='line'>669</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>670</span> * @param {!string} tagLocalName
<span class='line'>671</span> * @param {!string|undefined} id
<span class='line'>672</span> * @param {!string} className
<span class='line'>673</span> * @return {!Element}
<span class='line'>674</span> */</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="NAME">tagLocalName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">className</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT"> </span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElementNS</span><span class="PUNC">(</span><span class="NAME">documentns</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tagLocalName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT"> </span><span class="NAME">element.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>680</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>681</span> </span><span class="WHIT"> </span><span class="NAME">element.classList.add</span><span class="PUNC">(</span><span class="NAME">className</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>682</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>683</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>684</span>
<span class='line'>685</span> </span><span class="WHIT"> </span><span class="COMM">// create needed tree structure</span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT"> </span><span class="NAME">canvasElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">canvasElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-canvas"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>687</span> </span><span class="WHIT"> </span><span class="NAME">canvasContainerElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">canvasContainerElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-canvascontainer"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>688</span> </span><span class="WHIT"> </span><span class="NAME">toolbarElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="STRN">'span'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">toolbarElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-toolbar"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT"> </span><span class="NAME">toolbarContainerElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="STRN">'span'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-toolbarcontainer"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>690</span> </span><span class="WHIT"> </span><span class="NAME">editorElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">createElement</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"webodfeditor-editor"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>691</span>
<span class='line'>692</span> </span><span class="WHIT"> </span><span class="COMM">// put into tree</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT"> </span><span class="NAME">canvasContainerElement.appendChild</span><span class="PUNC">(</span><span class="NAME">canvasElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT"> </span><span class="NAME">toolbarContainerElement.appendChild</span><span class="PUNC">(</span><span class="NAME">toolbarElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT"> </span><span class="NAME">editorElement.appendChild</span><span class="PUNC">(</span><span class="NAME">toolbarContainerElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT"> </span><span class="NAME">editorElement.appendChild</span><span class="PUNC">(</span><span class="NAME">canvasContainerElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>697</span> </span><span class="WHIT"> </span><span class="NAME">mainContainerElement.appendChild</span><span class="PUNC">(</span><span class="NAME">editorElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>698</span>
<span class='line'>699</span> </span><span class="WHIT"> </span><span class="COMM">// style all elements with Dojo's claro.</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT"> </span><span class="COMM">// Not nice to do this on body, but then there is no other way known</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT"> </span><span class="COMM">// to style also all dialogs, which are attached directly to body</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT"> </span><span class="NAME">document.body.classList.add</span><span class="PUNC">(</span><span class="STRN">"claro"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>703</span>
<span class='line'>704</span> </span><span class="WHIT"> </span><span class="COMM">// prevent browser translation service messing up internal address system</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT"> </span><span class="COMM">// TODO: this should be done more centrally, but where exactly?</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT"> </span><span class="NAME">canvasElement.setAttribute</span><span class="PUNC">(</span><span class="STRN">"translate"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"no"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT"> </span><span class="NAME">canvasElement.classList.add</span><span class="PUNC">(</span><span class="STRN">"notranslate"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>708</span>
<span class='line'>709</span> </span><span class="WHIT"> </span><span class="COMM">// create widgets</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT"> </span><span class="NAME">mainContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">BorderContainer</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mainContainerElementId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>711</span>
<span class='line'>712</span> </span><span class="WHIT"> </span><span class="NAME">editorPane</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ContentPane</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT"> </span><span class="NAME">region</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorElementId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT"> </span><span class="NAME">mainContainer.addChild</span><span class="PUNC">(</span><span class="NAME">editorPane</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>716</span>
<span class='line'>717</span> </span><span class="WHIT"> </span><span class="NAME">mainContainer.startup</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>718</span>
<span class='line'>719</span> </span><span class="WHIT"> </span><span class="NAME">tools</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Tools</span><span class="PUNC">(</span><span class="NAME">toolbarElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT"> </span><span class="NAME">onToolDone</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">setFocusToOdfCanvas</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>721</span> </span><span class="WHIT"> </span><span class="NAME">loadOdtFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">loadOdtFile</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT"> </span><span class="NAME">saveOdtFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">saveOdtFile</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT"> </span><span class="NAME">saveAsOdtFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">saveAsOdtFile</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT"> </span><span class="NAME">downloadOdtFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">downloadOdtFile</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT"> </span><span class="NAME">close</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">close</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT"> </span><span class="NAME">directTextStylingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">directTextStylingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT"> </span><span class="NAME">directParagraphStylingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">directParagraphStylingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleSelectingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paragraphStyleSelectingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>729</span> </span><span class="WHIT"> </span><span class="NAME">paragraphStyleEditingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">paragraphStyleEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT"> </span><span class="NAME">imageInsertingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">imageEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT"> </span><span class="NAME">hyperlinkEditingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hyperlinkEditingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT"> </span><span class="NAME">annotationsEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">annotationsEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT"> </span><span class="NAME">undoRedoEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">undoRedoEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT"> </span><span class="NAME">zoomingEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">zoomingEnabled</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT"> </span><span class="NAME">aboutEnabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>737</span>
<span class='line'>738</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">odf.OdfCanvas</span><span class="PUNC">(</span><span class="NAME">canvasElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas.enableAnnotations</span><span class="PUNC">(</span><span class="NAME">annotationsEnabled</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>740</span>
<span class='line'>741</span> </span><span class="WHIT"> </span><span class="NAME">odfCanvas.addListener</span><span class="PUNC">(</span><span class="STRN">"statereadychange"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">createSession</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>742</span>
<span class='line'>743</span> </span><span class="WHIT"> </span><span class="NAME">fullWindowZoomHelper</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">FullWindowZoomHelper</span><span class="PUNC">(</span><span class="NAME">toolbarContainerElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">canvasContainerElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>744</span>
<span class='line'>745</span> </span><span class="WHIT"> </span><span class="NAME">setUserData</span><span class="PUNC">(</span><span class="NAME">editorOptions.userData</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>747</span>
<span class='line'>748</span> </span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>750</span>
<span class='line'>751</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">loadDojoAndStuff</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">head</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">"head"</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT"> </span><span class="NAME">frag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createDocumentFragment</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT"> </span><span class="NAME">link</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT"> </span><span class="NAME">script</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>756</span>
<span class='line'>757</span> </span><span class="WHIT"> </span><span class="COMM">// append two link and two script elements to the header</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT"> </span><span class="NAME">link</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"link"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT"> </span><span class="NAME">link.rel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"stylesheet"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT"> </span><span class="NAME">link.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/app/resources/app.css"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>761</span> </span><span class="WHIT"> </span><span class="NAME">link.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/css"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT"> </span><span class="NAME">link.async</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT"> </span><span class="NAME">frag.appendChild</span><span class="PUNC">(</span><span class="NAME">link</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT"> </span><span class="NAME">link</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"link"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT"> </span><span class="NAME">link.rel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"stylesheet"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT"> </span><span class="NAME">link.href</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/wodotexteditor.css"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>767</span> </span><span class="WHIT"> </span><span class="NAME">link.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/css"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>768</span> </span><span class="WHIT"> </span><span class="NAME">link.async</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT"> </span><span class="NAME">frag.appendChild</span><span class="PUNC">(</span><span class="NAME">link</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT"> </span><span class="NAME">script</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"script"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT"> </span><span class="NAME">script.src</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/dojo-amalgamation.js"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT"> </span><span class="NAME">script</span><span class="PUNC">[</span><span class="STRN">"data-dojo-config"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"async: true"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT"> </span><span class="NAME">script.charset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"utf-8"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT"> </span><span class="NAME">script.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/javascript"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT"> </span><span class="NAME">script.async</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>776</span> </span><span class="WHIT"> </span><span class="NAME">frag.appendChild</span><span class="PUNC">(</span><span class="NAME">script</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT"> </span><span class="NAME">script</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"script"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT"> </span><span class="NAME">script.src</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">installationPath</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/webodf.js"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT"> </span><span class="NAME">script.charset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"utf-8"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT"> </span><span class="NAME">script.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/javascript"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT"> </span><span class="NAME">script.async</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT"> </span><span class="NAME">script.onload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>783</span> </span><span class="WHIT"> </span><span class="NAME">frag.appendChild</span><span class="PUNC">(</span><span class="NAME">script</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> </span><span class="WHIT"> </span><span class="NAME">head.appendChild</span><span class="PUNC">(</span><span class="NAME">frag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>785</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>786</span>
<span class='line'>787</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>788</span> * Creates a text editor object and returns it on success in the passed callback.
<span class='line'>789</span> * @name Wodo#createTextEditor
<span class='line'>790</span> * @function
<span class='line'>791</span> * @param {!string} editorContainerElementId id of the existing div element which will contain the editor (should be empty before)
<span class='line'>792</span> * @param editorOptions options to configure the features of the editor. All entries are optional
<span class='line'>793</span> * @param [editorOptions.modus=Wodo.MODUS_FULLEDITING] set the editing modus. Current options: Wodo.MODUS_FULLEDITING, Wodo.MODUS_REVIEW
<span class='line'>794</span> * @param [editorOptions.loadCallback] parameter-less callback method, adds a "Load" button to the toolbar which triggers this method
<span class='line'>795</span> * @param [editorOptions.saveCallback] parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
<span class='line'>796</span> * @param [editorOptions.saveAsCallback] parameter-less callback method, adds a "Save as" button to the toolbar which triggers this method
<span class='line'>797</span> * @param [editorOptions.downloadCallback] parameter-less callback method, adds a "Download" button to the right of the toolbar which triggers this method
<span class='line'>798</span> * @param [editorOptions.closeCallback] parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
<span class='line'>799</span> * @param [editorOptions.allFeaturesEnabled=false] if set to 'true', switches the default for all features from 'false' to 'true'
<span class='line'>800</span> * @param [editorOptions.directTextStylingEnabled=false] if set to 'true', enables the direct styling of text (e.g. bold/italic or font)
<span class='line'>801</span> * @param [editorOptions.directParagraphStylingEnabled=false] if set to 'true', enables the direct styling of paragraphs (e.g. indentation or alignement)
<span class='line'>802</span> * @param [editorOptions.paragraphStyleSelectingEnabled=false] if set to 'true', enables setting of defined paragraph styles to paragraphs
<span class='line'>803</span> * @param [editorOptions.paragraphStyleEditingEnabled=false] if set to 'true', enables the editing of defined paragraph styles
<span class='line'>804</span> * @param [editorOptions.imageEditingEnabled=false] if set to 'true', enables the insertion of images
<span class='line'>805</span> * @param [editorOptions.hyperlinkEditingEnabled=false] if set to 'true', enables the editing of hyperlinks
<span class='line'>806</span> * @param [editorOptions.annotationsEnabled=false] if set to 'true', enables the display and the editing of annotations
<span class='line'>807</span> * @param [editorOptions.undoRedoEnabled=false] if set to 'true', enables the Undo and Redo of editing actions
<span class='line'>808</span> * @param [editorOptions.zoomingEnabled=false] if set to 'true', enables the zooming tool
<span class='line'>809</span> * @param [editorOptions.userData] data about the user editing the document
<span class='line'>810</span> * @param [editorOptions.userData.fullName] full name of the user, used for annotations and in the metadata of the document
<span class='line'>811</span> * @param [editorOptions.userData.color="black"] color to use for any user related indicators like cursor or annotations
<span class='line'>812</span> * @param {!function(err:?Error, editor:!TextEditor=):undefined} onEditorCreated
<span class='line'>813</span> * @return {undefined}
<span class='line'>814</span> */</span><span class="WHIT">
<span class='line'>815</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">createTextEditor</span><span class="PUNC">(</span><span class="NAME">editorContainerElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorOptions</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">onEditorCreated</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>816</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>817</span> * @return {undefined}
<span class='line'>818</span> */</span><span class="WHIT">
<span class='line'>819</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">create</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>820</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">TextEditor</span><span class="PUNC">(</span><span class="NAME">editorContainerElementId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editorOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>821</span> </span><span class="WHIT"> </span><span class="NAME">onEditorCreated</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>822</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>823</span>
<span class='line'>824</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isInitalized</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>825</span> </span><span class="WHIT"> </span><span class="NAME">pendingInstanceCreationCalls.push</span><span class="PUNC">(</span><span class="NAME">create</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>826</span> </span><span class="WHIT"> </span><span class="COMM">// first request?</span><span class="WHIT">
<span class='line'>827</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pendingInstanceCreationCalls.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>828</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">String</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">WodoFromSource</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>829</span> </span><span class="WHIT"> </span><span class="NAME">loadDojoAndStuff</span><span class="PUNC">(</span><span class="NAME">initTextEditor</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>830</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>831</span> </span><span class="WHIT"> </span><span class="NAME">initTextEditor</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>833</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>834</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT"> </span><span class="NAME">create</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>838</span>
<span class='line'>839</span>
<span class='line'>840</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>841</span> * @lends Wodo#
<span class='line'>842</span> */</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT"> </span><span class="NAME">createTextEditor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">createTextEditor</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT"> </span><span class="COMM">// flags</span><span class="WHIT">
<span class='line'>846</span> </span><span class="WHIT"> </span><span class="COMM">/** Id of full editing modus */</span><span class="WHIT">
<span class='line'>847</span> </span><span class="WHIT"> </span><span class="NAME">MODUS_FULLEDITING</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">MODUS_FULLEDITING</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT"> </span><span class="COMM">/** Id of review modus */</span><span class="WHIT">
<span class='line'>849</span> </span><span class="WHIT"> </span><span class="NAME">MODUS_REVIEW</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">MODUS_REVIEW</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>850</span> </span><span class="WHIT"> </span><span class="COMM">/** Id of event for an unkown error */</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_UNKNOWNERROR</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">EVENT_UNKNOWNERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT"> </span><span class="COMM">/** Id of event if documentModified state changes */</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_DOCUMENTMODIFIEDCHANGED</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">EVENT_DOCUMENTMODIFIEDCHANGED</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT"> </span><span class="COMM">/** Id of event if metadata changes */</span><span class="WHIT">
<span class='line'>855</span> </span><span class="WHIT"> </span><span class="NAME">EVENT_METADATACHANGED</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">EVENT_METADATACHANGED</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>857</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>858</span> </span></pre></body></html>

View File

@ -1,659 +0,0 @@
/**
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
*
* @licstart
* This file is part of WebODF.
*
* WebODF is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License (GNU AGPL)
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* WebODF is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
* @licend
*
* @source: http://www.webodf.org/
* @source: https://github.com/kogmbh/WebODF/
*/
/*global runtime, define, document, core, odf, gui, ops*/
define("webodf/editor/EditorSession", [
"dojo/text!resources/fonts/fonts.css"
], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin
"use strict";
runtime.loadClass("core.Async");
runtime.loadClass("core.DomUtils");
runtime.loadClass("odf.OdfUtils");
runtime.loadClass("ops.OdtDocument");
runtime.loadClass("ops.OdtStepsTranslator");
runtime.loadClass("ops.Session");
runtime.loadClass("odf.Namespaces");
runtime.loadClass("odf.OdfCanvas");
runtime.loadClass("odf.OdfUtils");
runtime.loadClass("gui.CaretManager");
runtime.loadClass("gui.Caret");
runtime.loadClass("gui.OdfFieldView");
runtime.loadClass("gui.SessionController");
runtime.loadClass("gui.SessionView");
runtime.loadClass("gui.HyperlinkTooltipView");
runtime.loadClass("gui.TrivialUndoManager");
runtime.loadClass("gui.SvgSelectionView");
runtime.loadClass("gui.SelectionViewManager");
runtime.loadClass("core.EventNotifier");
runtime.loadClass("gui.ShadowCursor");
runtime.loadClass("gui.CommonConstraints");
/**
* Instantiate a new editor session attached to an existing operation session
* @constructor
* @implements {core.EventSource}
* @param {!ops.Session} session
* @param {!string} localMemberId
* @param {{viewOptions:gui.SessionViewOptions,directParagraphStylingEnabled:boolean,annotationsEnabled:boolean}} config
*/
var EditorSession = function EditorSession(session, localMemberId, config) {
var self = this,
currentParagraphNode = null,
currentCommonStyleName = null,
currentStyleName = null,
caretManager,
selectionViewManager,
hyperlinkTooltipView,
odtDocument = session.getOdtDocument(),
textns = odf.Namespaces.textns,
fontStyles = document.createElement('style'),
formatting = odtDocument.getFormatting(),
domUtils = core.DomUtils,
odfUtils = odf.OdfUtils,
odfFieldView,
eventNotifier = new core.EventNotifier([
EditorSession.signalMemberAdded,
EditorSession.signalMemberUpdated,
EditorSession.signalMemberRemoved,
EditorSession.signalCursorAdded,
EditorSession.signalCursorMoved,
EditorSession.signalCursorRemoved,
EditorSession.signalParagraphChanged,
EditorSession.signalCommonStyleCreated,
EditorSession.signalCommonStyleDeleted,
EditorSession.signalParagraphStyleModified,
EditorSession.signalUndoStackChanged]),
shadowCursor = new gui.ShadowCursor(odtDocument),
sessionConstraints,
/**@const*/
NEXT = core.StepDirection.NEXT;
/**
* @return {Array.<!string>}
*/
function getAvailableFonts() {
var availableFonts, regex, matches;
availableFonts = {};
/*jslint regexp: true*/
regex = /font-family *: *(?:\'([^']*)\'|\"([^"]*)\")/gm;
/*jslint regexp: false*/
matches = regex.exec(fontsCSS);
while (matches) {
availableFonts[matches[1] || matches[2]] = 1;
matches = regex.exec(fontsCSS);
}
availableFonts = Object.keys(availableFonts);
return availableFonts;
}
function checkParagraphStyleName() {
var newStyleName,
newCommonStyleName;
newStyleName = currentParagraphNode.getAttributeNS(textns, 'style-name');
if (newStyleName !== currentStyleName) {
currentStyleName = newStyleName;
// check if common style is still the same
newCommonStyleName = formatting.getFirstCommonParentStyleNameOrSelf(newStyleName);
if (!newCommonStyleName) {
// Default style, empty-string name
currentCommonStyleName = newStyleName = currentStyleName = "";
self.emit(EditorSession.signalParagraphChanged, {
type: 'style',
node: currentParagraphNode,
styleName: currentCommonStyleName
});
return;
}
// a common style
if (newCommonStyleName !== currentCommonStyleName) {
currentCommonStyleName = newCommonStyleName;
self.emit(EditorSession.signalParagraphChanged, {
type: 'style',
node: currentParagraphNode,
styleName: currentCommonStyleName
});
}
}
}
/**
* Creates a NCName from the passed string
* @param {!string} name
* @return {!string}
*/
function createNCName(name) {
var letter,
result = "",
i;
// encode
for (i = 0; i < name.length; i += 1) {
letter = name[i];
// simple approach, can be improved to not skip other allowed chars
if (letter.match(/[a-zA-Z0-9.-_]/) !== null) {
result += letter;
} else {
result += "_" + letter.charCodeAt(0).toString(16) + "_";
}
}
// ensure leading char is from proper range
if (result.match(/^[a-zA-Z_]/) === null) {
result = "_" + result;
}
return result;
}
function uniqueParagraphStyleNCName(name) {
var result,
i = 0,
ncMemberId = createNCName(localMemberId),
ncName = createNCName(name);
// create default paragraph style
// localMemberId is used to avoid id conflicts with ids created by other members
result = ncName + "_" + ncMemberId;
// then loop until result is really unique
while (formatting.hasParagraphStyle(result)) {
result = ncName + "_" + i + "_" + ncMemberId;
i += 1;
}
return result;
}
function trackCursor(cursor) {
var node;
node = odfUtils.getParagraphElement(cursor.getNode());
if (!node) {
return;
}
currentParagraphNode = node;
checkParagraphStyleName();
}
function trackCurrentParagraph(info) {
var cursor = odtDocument.getCursor(localMemberId),
range = cursor && cursor.getSelectedRange(),
paragraphRange = odtDocument.getDOMDocument().createRange();
paragraphRange.selectNode(info.paragraphElement);
if ((range && domUtils.rangesIntersect(range, paragraphRange)) || info.paragraphElement === currentParagraphNode) {
self.emit(EditorSession.signalParagraphChanged, info);
checkParagraphStyleName();
}
paragraphRange.detach();
}
function onMemberAdded(member) {
self.emit(EditorSession.signalMemberAdded, member.getMemberId());
}
function onMemberUpdated(member) {
self.emit(EditorSession.signalMemberUpdated, member.getMemberId());
}
function onMemberRemoved(memberId) {
self.emit(EditorSession.signalMemberRemoved, memberId);
}
function onCursorAdded(cursor) {
self.emit(EditorSession.signalCursorAdded, cursor.getMemberId());
trackCursor(cursor);
}
function onCursorRemoved(memberId) {
self.emit(EditorSession.signalCursorRemoved, memberId);
}
function onCursorMoved(cursor) {
// Emit 'cursorMoved' only when *I* am moving the cursor, not the other users
if (cursor.getMemberId() === localMemberId) {
self.emit(EditorSession.signalCursorMoved, cursor);
trackCursor(cursor);
}
}
function onStyleCreated(newStyleName) {
self.emit(EditorSession.signalCommonStyleCreated, newStyleName);
}
function onStyleDeleted(styleName) {
self.emit(EditorSession.signalCommonStyleDeleted, styleName);
}
function onParagraphStyleModified(styleName) {
self.emit(EditorSession.signalParagraphStyleModified, styleName);
}
/**
* Call all subscribers for the given event with the specified argument
* @param {!string} eventid
* @param {Object} args
*/
this.emit = function (eventid, args) {
eventNotifier.emit(eventid, args);
};
/**
* Subscribe to a given event with a callback
* @param {!string} eventid
* @param {!Function} cb
*/
this.subscribe = function (eventid, cb) {
eventNotifier.subscribe(eventid, cb);
};
/**
* @param {!string} eventid
* @param {!Function} cb
* @return {undefined}
*/
this.unsubscribe = function (eventid, cb) {
eventNotifier.unsubscribe(eventid, cb);
};
this.getCursorPosition = function () {
return odtDocument.getCursorPosition(localMemberId);
};
this.getCursorSelection = function () {
return odtDocument.getCursorSelection(localMemberId);
};
this.getOdfCanvas = function () {
return odtDocument.getOdfCanvas();
};
this.getCurrentParagraph = function () {
return currentParagraphNode;
};
this.getAvailableParagraphStyles = function () {
return formatting.getAvailableParagraphStyles();
};
this.getCurrentParagraphStyle = function () {
return currentCommonStyleName;
};
/**
* Applies the paragraph style with the given
* style name to all the paragraphs within
* the cursor selection.
* @param {!string} styleName
* @return {undefined}
*/
this.setCurrentParagraphStyle = function (styleName) {
var range = odtDocument.getCursor(localMemberId).getSelectedRange(),
paragraphs = odfUtils.getParagraphElements(range),
opQueue = [];
paragraphs.forEach(function (paragraph) {
var paragraphStartPoint = odtDocument.convertDomPointToCursorStep(paragraph, 0, NEXT),
paragraphStyleName = paragraph.getAttributeNS(odf.Namespaces.textns, "style-name"),
opSetParagraphStyle;
if (paragraphStyleName !== styleName) {
opSetParagraphStyle = new ops.OpSetParagraphStyle();
opSetParagraphStyle.init({
memberid: localMemberId,
styleName: styleName,
position: paragraphStartPoint
});
opQueue.push(opSetParagraphStyle);
}
});
if (opQueue.length > 0) {
session.enqueue(opQueue);
}
};
this.insertTable = function (initialRows, initialColumns, tableStyleName, tableColumnStyleName, tableCellStyleMatrix) {
var op = new ops.OpInsertTable();
op.init({
memberid: localMemberId,
position: self.getCursorPosition(),
initialRows: initialRows,
initialColumns: initialColumns,
tableStyleName: tableStyleName,
tableColumnStyleName: tableColumnStyleName,
tableCellStyleMatrix: tableCellStyleMatrix
});
session.enqueue([op]);
};
/**
* Takes a style name and returns the corresponding paragraph style
* element. If the style name is an empty string, the default style
* is returned.
* @param {!string} styleName
* @return {?Element}
*/
function getParagraphStyleElement(styleName) {
return (styleName === "")
? formatting.getDefaultStyleElement('paragraph')
: formatting.getStyleElement(styleName, 'paragraph');
}
this.getParagraphStyleElement = getParagraphStyleElement;
/**
* Returns if the style is used anywhere in the document
* @param {!Element} styleElement
* @return {boolean}
*/
this.isStyleUsed = function (styleElement) {
return formatting.isStyleUsed(styleElement);
};
/**
* Returns the attributes of a given paragraph style name
* (with inheritance). If the name is an empty string,
* the attributes of the default style are returned.
* @param {!string} styleName
* @return {?odf.Formatting.StyleData}
*/
this.getParagraphStyleAttributes = function (styleName) {
var styleNode = getParagraphStyleElement(styleName),
includeSystemDefault = styleName === "";
if (styleNode) {
return formatting.getInheritedStyleAttributes(styleNode, includeSystemDefault);
}
return null;
};
/**
* Creates and enqueues a paragraph-style cloning operation.
* Returns the created id for the new style.
* @param {!string} styleName id of the style to update
* @param {!{paragraphProperties,textProperties}} setProperties properties which are set
* @param {!{paragraphPropertyNames,textPropertyNames}=} removedProperties properties which are removed
* @return {undefined}
*/
this.updateParagraphStyle = function (styleName, setProperties, removedProperties) {
var op;
op = new ops.OpUpdateParagraphStyle();
op.init({
memberid: localMemberId,
styleName: styleName,
setProperties: setProperties,
removedProperties: (!removedProperties) ? {} : removedProperties
});
session.enqueue([op]);
};
/**
* Creates and enqueues a paragraph-style cloning operation.
* Returns the created id for the new style.
* @param {!string} styleName id of the style to clone
* @param {!string} newStyleDisplayName display name of the new style
* @return {!string}
*/
this.cloneParagraphStyle = function (styleName, newStyleDisplayName) {
var newStyleName = uniqueParagraphStyleNCName(newStyleDisplayName),
styleNode = getParagraphStyleElement(styleName),
op, setProperties, attributes, i;
setProperties = formatting.getStyleAttributes(styleNode);
// copy any attributes directly on the style
attributes = styleNode.attributes;
for (i = 0; i < attributes.length; i += 1) {
// skip...
// * style:display-name -> not copied, set to new string below
// * style:name -> not copied, set from op by styleName property
// * style:family -> "paragraph" always, set by op
if (!/^(style:display-name|style:name|style:family)/.test(attributes[i].name)) {
setProperties[attributes[i].name] = attributes[i].value;
}
}
setProperties['style:display-name'] = newStyleDisplayName;
op = new ops.OpAddStyle();
op.init({
memberid: localMemberId,
styleName: newStyleName,
styleFamily: 'paragraph',
setProperties: setProperties
});
session.enqueue([op]);
return newStyleName;
};
this.deleteStyle = function (styleName) {
var op;
op = new ops.OpRemoveStyle();
op.init({
memberid: localMemberId,
styleName: styleName,
styleFamily: 'paragraph'
});
session.enqueue([op]);
};
/**
* Returns an array of the declared fonts in the ODF document,
* with 'duplicates' like Arial1, Arial2, etc removed. The alphabetically
* first font name for any given family is kept.
* The elements of the array are objects containing the font's name and
* the family.
* @return {Array.<!Object>}
*/
this.getDeclaredFonts = function () {
var fontMap = formatting.getFontMap(),
usedFamilies = [],
array = [],
sortedNames,
key,
value,
i;
// Sort all the keys in the font map alphabetically
sortedNames = Object.keys(fontMap);
sortedNames.sort();
for (i = 0; i < sortedNames.length; i += 1) {
key = sortedNames[i];
value = fontMap[key];
// Use the font declaration only if the family is not already used.
// Therefore we are able to discard the alphabetic successors of the first
// font name.
if (usedFamilies.indexOf(value) === -1) {
array.push({
name: key,
family: value
});
if (value) {
usedFamilies.push(value);
}
}
}
return array;
};
this.getSelectedHyperlinks = function () {
var cursor = odtDocument.getCursor(localMemberId);
// no own cursor yet/currently added?
if (!cursor) {
return [];
}
return odfUtils.getHyperlinkElements(cursor.getSelectedRange());
};
this.getSelectedRange = function () {
var cursor = odtDocument.getCursor(localMemberId);
return cursor && cursor.getSelectedRange();
};
function undoStackModified(e) {
self.emit(EditorSession.signalUndoStackChanged, e);
}
this.undo = function () {
self.sessionController.undo();
};
this.redo = function () {
self.sessionController.redo();
};
/**
* @param {!string} memberId
* @return {?ops.Member}
*/
this.getMember = function (memberId) {
return odtDocument.getMember(memberId);
};
/**
* @param {!function(!Object=)} callback passing an error object in case of error
* @return {undefined}
*/
function destroy(callback) {
var head = document.getElementsByTagName('head')[0],
eventManager = self.sessionController.getEventManager();
head.removeChild(fontStyles);
odtDocument.unsubscribe(ops.Document.signalMemberAdded, onMemberAdded);
odtDocument.unsubscribe(ops.Document.signalMemberUpdated, onMemberUpdated);
odtDocument.unsubscribe(ops.Document.signalMemberRemoved, onMemberRemoved);
odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorAdded);
odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorRemoved);
odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorMoved);
odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated);
odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted);
odtDocument.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified);
odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph);
odtDocument.unsubscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified);
eventManager.unsubscribe("mousemove", hyperlinkTooltipView.showTooltip);
eventManager.unsubscribe("mouseout", hyperlinkTooltipView.hideTooltip);
delete self.sessionView;
delete self.sessionController;
callback();
}
/**
* @param {!function(!Error=)} callback passing an error object in case of error
* @return {undefined}
*/
this.destroy = function(callback) {
var cleanup = [
self.sessionView.destroy,
caretManager.destroy,
selectionViewManager.destroy,
self.sessionController.destroy,
hyperlinkTooltipView.destroy,
odfFieldView.destroy,
destroy
];
core.Async.destroyAll(cleanup, callback);
};
function init() {
var head = document.getElementsByTagName('head')[0],
odfCanvas = session.getOdtDocument().getOdfCanvas(),
eventManager;
// TODO: fonts.css should be rather done by odfCanvas, or?
fontStyles.type = 'text/css';
fontStyles.media = 'screen, print, handheld, projection';
fontStyles.appendChild(document.createTextNode(fontsCSS));
head.appendChild(fontStyles);
odfFieldView = new gui.OdfFieldView(odfCanvas);
odfFieldView.showFieldHighlight();
self.sessionController = new gui.SessionController(session, localMemberId, shadowCursor, {
annotationsEnabled: config.annotationsEnabled,
directTextStylingEnabled: config.directTextStylingEnabled,
directParagraphStylingEnabled: config.directParagraphStylingEnabled
});
sessionConstraints = self.sessionController.getSessionConstraints();
eventManager = self.sessionController.getEventManager();
hyperlinkTooltipView = new gui.HyperlinkTooltipView(odfCanvas,
self.sessionController.getHyperlinkClickHandler().getModifier);
eventManager.subscribe("mousemove", hyperlinkTooltipView.showTooltip);
eventManager.subscribe("mouseout", hyperlinkTooltipView.hideTooltip);
caretManager = new gui.CaretManager(self.sessionController, odfCanvas.getViewport());
selectionViewManager = new gui.SelectionViewManager(gui.SvgSelectionView);
self.sessionView = new gui.SessionView(config.viewOptions, localMemberId, session, sessionConstraints, caretManager, selectionViewManager);
self.availableFonts = getAvailableFonts();
selectionViewManager.registerCursor(shadowCursor, true);
// Session Constraints can be applied once the controllers are instantiated.
if (config.reviewModeEnabled) {
// Disallow deleting other authors' annotations.
sessionConstraints.setState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, true);
sessionConstraints.setState(gui.CommonConstraints.EDIT.REVIEW_MODE, true);
}
// Custom signals, that make sense in the Editor context. We do not want to expose webodf's ops signals to random bits of the editor UI.
odtDocument.subscribe(ops.Document.signalMemberAdded, onMemberAdded);
odtDocument.subscribe(ops.Document.signalMemberUpdated, onMemberUpdated);
odtDocument.subscribe(ops.Document.signalMemberRemoved, onMemberRemoved);
odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorAdded);
odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorRemoved);
odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorMoved);
odtDocument.subscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated);
odtDocument.subscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted);
odtDocument.subscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified);
odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph);
odtDocument.subscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified);
}
init();
};
/**@const*/EditorSession.signalMemberAdded = "memberAdded";
/**@const*/EditorSession.signalMemberUpdated = "memberUpdated";
/**@const*/EditorSession.signalMemberRemoved = "memberRemoved";
/**@const*/EditorSession.signalCursorAdded = "cursorAdded";
/**@const*/EditorSession.signalCursorRemoved = "cursorRemoved";
/**@const*/EditorSession.signalCursorMoved = "cursorMoved";
/**@const*/EditorSession.signalParagraphChanged = "paragraphChanged";
/**@const*/EditorSession.signalCommonStyleCreated = "styleCreated";
/**@const*/EditorSession.signalCommonStyleDeleted = "styleDeleted";
/**@const*/EditorSession.signalParagraphStyleModified = "paragraphStyleModified";
/**@const*/EditorSession.signalUndoStackChanged = "signalUndoStackChanged";
return EditorSession;
});

View File

@ -1,83 +0,0 @@
/**
* Copyright (C) 2014 KO GmbH <copyright@kogmbh.com>
*
* @licstart
* This file is part of WebODF.
*
* WebODF is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License (GNU AGPL)
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* WebODF is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
* @licend
*
* @source: http://www.webodf.org/
* @source: https://github.com/kogmbh/WebODF/
*/
/*global define, document, window */
define("webodf/editor/FullWindowZoomHelper", [], function () {
"use strict";
// fullscreen pinch-zoom adaption
var FullWindowZoomHelper = function FullWindowZoomHelper(toolbarContainerElement, canvasContainerElement) {
function translateToolbar() {
var y = document.body.scrollTop;
toolbarContainerElement.style.WebkitTransformOrigin = "center top";
toolbarContainerElement.style.WebkitTransform = 'translateY(' + y + 'px)';
}
function repositionContainer() {
canvasContainerElement.style.top = toolbarContainerElement.getBoundingClientRect().height + 'px';
}
this.destroy = function (callback) {
window.removeEventListener('scroll', translateToolbar);
window.removeEventListener('focusout', translateToolbar);
window.removeEventListener('touchmove', translateToolbar);
window.removeEventListener('resize', repositionContainer);
callback();
};
function init() {
var metaElement, toolbarStyle;
// prevent any zooming on the window TODO: do not overwrite any other existing content of viewport metadata
metaElement = document.createElement("meta");
metaElement.setAttribute("name", "viewport");
metaElement.setAttribute("content", "width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0");
document.head.appendChild(metaElement);
// set the toolbar absolute and fixed to top
toolbarStyle = toolbarContainerElement.style;
toolbarStyle.top = 0;
toolbarStyle.left = 0;
toolbarStyle.right = 0;
toolbarStyle.position = "absolute";
toolbarStyle.zIndex = 5;
toolbarStyle.boxShadow = "0 1px 5px rgba(0, 0, 0, 0.25)";
repositionContainer();
window.addEventListener('scroll', translateToolbar);
window.addEventListener('focusout', translateToolbar);
window.addEventListener('touchmove', translateToolbar);
window.addEventListener('resize', repositionContainer);
}
init();
};
return FullWindowZoomHelper;
});

View File

@ -1,317 +0,0 @@
/**
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
*
* @licstart
* This file is part of WebODF.
*
* WebODF is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License (GNU AGPL)
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* WebODF is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
* @licend
*
* @source: http://www.webodf.org/
* @source: https://github.com/kogmbh/WebODF/
*/
/*global window, define, require, document, dijit, dojo, runtime, ops*/
define("webodf/editor/Tools", [
"dojo/ready",
"dijit/MenuItem",
"dijit/DropDownMenu",
"dijit/form/Button",
"dijit/form/DropDownButton",
"dijit/Toolbar",
"webodf/editor/widgets/paragraphAlignment",
"webodf/editor/widgets/simpleStyles",
"webodf/editor/widgets/undoRedoMenu",
"webodf/editor/widgets/toolbarWidgets/currentStyle",
"webodf/editor/widgets/annotation",
"webodf/editor/widgets/editHyperlinks",
"webodf/editor/widgets/imageInserter",
"webodf/editor/widgets/paragraphStylesDialog",
"webodf/editor/widgets/zoomSlider",
"webodf/editor/widgets/aboutDialog",
"webodf/editor/EditorSession"],
function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, AnnotationControl, EditHyperlinks, ImageInserter, ParagraphStylesDialog, ZoomSlider, AboutDialog, EditorSession) {
"use strict";
return function Tools(toolbarElementId, args) {
var tr = runtime.tr,
onToolDone = args.onToolDone,
loadOdtFile = args.loadOdtFile,
saveOdtFile = args.saveOdtFile,
saveAsOdtFile = args.saveAsOdtFile,
downloadOdtFile = args.downloadOdtFile,
close = args.close,
toolbar,
loadButton, saveButton, closeButton, aboutButton,
saveAsButton, downloadButton,
formatDropDownMenu, formatMenuButton,
paragraphStylesMenuItem, paragraphStylesDialog,
editorSession,
aboutDialog,
sessionSubscribers = [];
function placeAndStartUpWidget(widget) {
widget.placeAt(toolbar);
widget.startup();
}
/**
* Creates a tool and installs it, if the enabled flag is set to true.
* Only supports tool classes whose constructor has a single argument which
* is a callback to pass the created widget object to.
* @param {!function(new:Object, function(!Object):undefined)} Tool constructor method of the tool
* @param {!boolean} enabled
* @param {!Object|undefined=} config
* @return {?Object}
*/
function createTool(Tool, enabled, config) {
var tool = null;
if (enabled) {
if (config) {
tool = new Tool(config, placeAndStartUpWidget);
} else {
tool = new Tool(placeAndStartUpWidget);
}
sessionSubscribers.push(tool);
tool.onToolDone = onToolDone;
tool.setEditorSession(editorSession);
}
return tool;
}
function handleCursorMoved(cursor) {
var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection;
if (formatMenuButton) {
formatMenuButton.setAttribute('disabled', disabled);
}
}
function setEditorSession(session) {
if (editorSession) {
editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved);
}
editorSession = session;
if (editorSession) {
editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved);
}
sessionSubscribers.forEach(function (subscriber) {
subscriber.setEditorSession(editorSession);
});
[saveButton, saveAsButton, downloadButton, closeButton, formatMenuButton].forEach(function (button) {
if (button) {
button.setAttribute('disabled', !editorSession);
}
});
}
this.setEditorSession = setEditorSession;
/**
* @param {!function(!Error=)} callback, passing an error object in case of error
* @return {undefined}
*/
this.destroy = function (callback) {
// TODO:
// 1. We don't want to use `document`
// 2. We would like to avoid deleting all widgets
// under document.body because this might interfere with
// other apps that use the editor not-in-an-iframe,
// but dojo always puts its dialogs below the body,
// so this works for now. Perhaps will be obsoleted
// once we move to a better widget toolkit
var widgets = dijit.findWidgets(document.body);
dojo.forEach(widgets, function(w) {
w.destroyRecursive(false);
});
callback();
};
// init
ready(function () {
toolbar = new Toolbar({}, toolbarElementId);
// About
if (args.aboutEnabled) {
aboutButton = new Button({
label: tr('About WebODF Text Editor'),
showLabel: false,
iconClass: 'webodfeditor-dijitWebODFIcon'
});
aboutDialog = new AboutDialog(function (dialog) {
aboutButton.onClick = function () {
dialog.startup();
dialog.show();
};
});
aboutDialog.onToolDone = onToolDone;
aboutButton.placeAt(toolbar);
}
// Load
if (loadOdtFile) {
loadButton = new Button({
label: tr('Open'),
showLabel: false,
iconClass: 'dijitIcon dijitIconFolderOpen',
onClick: function () {
loadOdtFile();
}
});
loadButton.placeAt(toolbar);
}
// Save
if (saveOdtFile) {
saveButton = new Button({
label: tr('Save'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconSave',
onClick: function () {
saveOdtFile();
onToolDone();
}
});
saveButton.placeAt(toolbar);
}
// SaveAs
if (saveAsOdtFile) {
saveAsButton = new Button({
label: tr('Save as...'),
showLabel: false,
disabled: true,
iconClass: 'webodfeditor-dijitSaveAsIcon',
onClick: function () {
saveAsOdtFile();
onToolDone();
}
});
saveAsButton.placeAt(toolbar);
}
// Download
if (downloadOdtFile) {
downloadButton = new Button({
label: tr('Download'),
showLabel: true,
disabled: true,
style: {
float: 'right'
},
onClick: function () {
downloadOdtFile();
onToolDone();
}
});
downloadButton.placeAt(toolbar);
}
// Format menu
if (args.paragraphStyleEditingEnabled) {
formatDropDownMenu = new DropDownMenu({});
paragraphStylesMenuItem = new MenuItem({
label: tr("Paragraph...")
});
formatDropDownMenu.addChild(paragraphStylesMenuItem);
paragraphStylesDialog = new ParagraphStylesDialog(function (dialog) {
paragraphStylesMenuItem.onClick = function () {
if (editorSession) {
dialog.startup();
dialog.show();
}
};
});
sessionSubscribers.push(paragraphStylesDialog);
paragraphStylesDialog.onToolDone = onToolDone;
formatMenuButton = new DropDownButton({
dropDown: formatDropDownMenu,
disabled: true,
label: tr('Format'),
iconClass: "dijitIconEditTask"
});
formatMenuButton.placeAt(toolbar);
}
// Undo/Redo
createTool(UndoRedoMenu, args.undoRedoEnabled);
// Add annotation
createTool(AnnotationControl, args.annotationsEnabled);
// Simple Style Selector [B, I, U, S]
createTool(SimpleStyles, args.directTextStylingEnabled);
// Paragraph direct alignment buttons
createTool(ParagraphAlignment, args.directParagraphStylingEnabled);
// Paragraph Style Selector
createTool(CurrentStyle, args.paragraphStyleSelectingEnabled);
// Zoom Level Selector
createTool(ZoomSlider, args.zoomingEnabled);
// hyper links
createTool(EditHyperlinks, args.hyperlinkEditingEnabled);
// image insertion
createTool(ImageInserter, args.imageInsertingEnabled);
// close button
if (close) {
closeButton = new Button({
label: tr('Close'),
showLabel: false,
disabled: true,
iconClass: 'dijitEditorIcon dijitEditorIconCancel',
style: {
float: 'right'
},
onClick: function () {
close();
}
});
closeButton.placeAt(toolbar);
}
// This is an internal hook for debugging/testing.
// Yes, you discovered something interesting. But:
// Do NOT rely on it, it will not be supported and can and will change in any version.
// It is not officially documented for a reason. A real plugin system is only on the wishlist
// so far, please file your suggestions/needs at the official WebODF issue system.
// You have been warned.
if (window.wodo_plugins) {
window.wodo_plugins.forEach(function (plugin) {
runtime.log("Creating plugin: "+plugin.id);
require([plugin.id], function (Plugin) {
runtime.log("Creating as tool now: "+plugin.id);
createTool(Plugin, true, plugin.config);
});
});
}
setEditorSession(editorSession);
});
};
});

View File

@ -1,81 +0,0 @@
/**
* Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
*
* @licstart
* This file is part of WebODF.
*
* WebODF is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License (GNU AGPL)
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* WebODF is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with WebODF. If not, see <http://www.gnu.org/licenses/>.
* @licend
*
* @source: http://www.webodf.org/
* @source: https://github.com/kogmbh/WebODF/
*/
/*global define, runtime, XMLHttpRequest */
define("webodf/editor/Translator", [], function () {
"use strict";
return function Translator(translationsPath, locale, callback) {
var self = this,
dictionary = {};
function translate(key) {
return dictionary[key];
}
function setLocale(newLocale, cb) {
// TODO: Add smarter locale resolution at some point
if (newLocale.split('-')[0] === "de" || newLocale.split('_')[0] === "de") {
newLocale = "de-DE";
} else if (newLocale.split('-')[0] === "nl" || newLocale.split('_')[0] === "nl") {
newLocale = "nl-NL";
} else if (newLocale.split('-')[0] === "fr" || newLocale.split('_')[0] === "fr") {
newLocale = "fr-FR";
} else if (newLocale.split('-')[0] === "it" || newLocale.split('_')[0] === "it") {
newLocale = "it-IT";
} else if (newLocale.split('-')[0] === "eu" || newLocale.split('_')[0] === "eu") {
newLocale = "eu";
} else if (newLocale.split('-')[0] === "en" || newLocale.split('_')[0] === "en") {
newLocale = "en-US";
} else {
newLocale = "en-US";
}
var xhr = new XMLHttpRequest(),
path = translationsPath + '/' + newLocale + ".json";
xhr.open("GET", path);
xhr.onload = function () {
if (xhr.status === 200) {// HTTP OK
dictionary = JSON.parse(xhr.response);
locale = newLocale;
}
cb();
};
xhr.send(null);
}
function getLocale() {
return locale;
}
this.translate = translate;
this.getLocale = getLocale;
function init() {
setLocale(locale, function () {
callback(self);
});
}
init();
};
});

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1 +0,0 @@
.dijitIconSave,.dijitIconPrint,.dijitIconCut,.dijitIconCopy,.dijitIconClear,.dijitIconDelete,.dijitIconUndo,.dijitIconEdit,.dijitIconNewTask,.dijitIconEditTask,.dijitIconEditProperty,.dijitIconTask,.dijitIconFilter,.dijitIconConfigure,.dijitIconSearch,.dijitIconApplication,.dijitIconBookmark,.dijitIconChart,.dijitIconConnector,.dijitIconDatabase,.dijitIconDocuments,.dijitIconMail,.dijitLeaf,.dijitIconFile,.dijitIconFunction,.dijitIconKey,.dijitIconPackage,.dijitIconSample,.dijitIconTable,.dijitIconUsers,.dijitFolderClosed,.dijitIconFolderClosed,.dijitFolderOpened,.dijitIconFolderOpen,.dijitIconError {background-image: url('images/commonIconsObjActEnabled.png'); width: 16px; height: 16px;}.dj_ie6 .dijitIconSave,.dj_ie6 .dijitIconPrint,.dj_ie6 .dijitIconCut,.dj_ie6 .dijitIconCopy,.dj_ie6 .dijitIconClear,.dj_ie6 .dijitIconDelete,.dj_ie6 .dijitIconUndo,.dj_ie6 .dijitIconEdit,.dj_ie6 .dijitIconNewTask,.dj_ie6 .dijitIconEditTask,.dj_ie6 .dijitIconEditProperty,.dj_ie6 .dijitIconTask,.dj_ie6 .dijitIconFilter,.dj_ie6 .dijitIconConfigure,.dj_ie6 .dijitIconSearch,.dj_ie6 .dijitIconApplication,.dj_ie6 .dijitIconBookmark,.dj_ie6 .dijitIconChart,.dj_ie6 .dijitIconConnector,.dj_ie6 .dijitIconDatabase,.dj_ie6 .dijitIconDocuments,.dj_ie6 .dijitIconMail,.dj_ie6 .dijitLeaf,.dj_ie6 .dijitIconFile,.dj_ie6 .dijitIconFunction,.dj_ie6 .dijitIconKey,.dj_ie6 .dijitIconPackage,.dj_ie6 .dijitIconSample,.dj_ie6 .dijitIconTable,.dj_ie6 .dijitIconUsers,.dj_ie6 .dijitFolderClosed,.dj_ie6 .dijitIconFolderClosed,.dj_ie6 .dijitFolderOpened,.dj_ie6 .dijitIconFolderOpen,.dj_ie6 .dijitIconError {background-image: url('images/commonIconsObjActEnabled8bit.png');}.dijitDisabled .dijitIconSave,.dijitDisabled .dijitIconPrint,.dijitDisabled .dijitIconCut,.dijitDisabled .dijitIconCopy,.dijitDisabled .dijitIconClear,.dijitDisabled .dijitIconDelete,.dijitDisabled .dijitIconUndo,.dijitDisabled .dijitIconEdit,.dijitDisabled .dijitIconNewTask,.dijitDisabled .dijitIconEditTask,.dijitDisabled .dijitIconEditProperty,.dijitDisabled .dijitIconTask,.dijitDisabled .dijitIconFilter,.dijitDisabled .dijitIconConfigure,.dijitDisabled .dijitIconSearch,.dijitDisabled .dijitIconApplication,.dijitDisabled .dijitIconBookmark,.dijitDisabled .dijitIconChart,.dijitDisabled .dijitIconConnector,.dijitDisabled .dijitIconDatabase,.dijitDisabled .dijitIconDocuments,.dijitDisabled .dijitIconMail,.dijitDisabled .dijitLeaf,.dijitDisabled .dijitIconFile,.dijitDisabled .dijitIconFunction,.dijitDisabled .dijitIconKey,.dijitDisabled .dijitIconPackage,.dijitDisabled .dijitIconSample,.dijitDisabled .dijitIconTable,.dijitDisabled .dijitIconUsers,.dijitDisabled .dijitFolderClosed,.dijitDisabled .dijitIconFolderClosed,.dijitDisabled .dijitFolderOpened,.dijitDisabled .dijitIconFolderOpen,.dijitDisabled .dijitIconError {background-image: url('images/commonIconsObjActDisabled.png');}.dijitIconSave {background-position: 0;}.dijitIconPrint {background-position: -16px;}.dijitIconCut {background-position: -32px;}.dijitIconCopy {background-position: -48px;}.dijitIconClear {background-position: -64px;}.dijitIconDelete {background-position: -80px;}.dijitIconUndo {background-position: -96px;}.dijitIconEdit {background-position: -112px;}.dijitIconNewTask {background-position: -128px;}.dijitIconEditTask {background-position: -144px;}.dijitIconEditProperty {background-position: -160px;}.dijitIconTask {background-position: -176px;}.dijitIconFilter {background-position: -192px;}.dijitIconConfigure {background-position: -208px;}.dijitIconSearch {background-position: -224px;}.dijitIconError {background-position: -496px;} .dijitIconApplication {background-position: -240px;}.dijitIconBookmark {background-position: -256px;}.dijitIconChart {background-position: -272px;}.dijitIconConnector {background-position: -288px;}.dijitIconDatabase {background-position: -304px;}.dijitIconDocuments {background-position: -320px;}.dijitIconMail {background-position: -336px;}.dijitIconFile, .dijitLeaf {background-position: -352px;}.dijitIconFunction {background-position: -368px;}.dijitIconKey {background-position: -384px;}.dijitIconPackage{background-position: -400px;}.dijitIconSample {background-position: -416px;}.dijitIconTable {background-position: -432px;}.dijitIconUsers {background-position: -448px;}.dijitIconFolderClosed, .dijitFolderClosed {background-position: -464px;}.dijitIconFolderOpen, .dijitFolderOpened {background-position: -480px;}.dijitIconLoading {background:url('images/loadingAnimation_rtl.gif') no-repeat; height: 20px; width: 20px;}

View File

@ -1 +0,0 @@
.dijitRtl .dijitIconSave,.dijitRtl .dijitIconPrint,.dijitRtl .dijitIconCut,.dijitRtl .dijitIconCopy,.dijitRtl .dijitIconClear,.dijitRtl .dijitIconDelete,.dijitRtl .dijitIconUndo,.dijitRtl .dijitIconEdit,.dijitRtl .dijitIconNewTask,.dijitRtl .dijitIconEditTask,.dijitRtl .dijitIconEditProperty,.dijitRtl .dijitIconTask,.dijitRtl .dijitIconFilter,.dijitRtl .dijitIconConfigure,.dijitRtl .dijitIconSearch,.dijitRtl .dijitIconApplication,.dijitRtl .dijitIconBookmark,.dijitRtl .dijitIconChart,.dijitRtl .dijitIconConnector,.dijitRtl .dijitIconDatabase,.dijitRtl .dijitIconDocuments,.dijitRtl .dijitIconMail,.dijitRtl .dijitLeaf,.dijitRtl .dijitIconFile,.dijitRtl .dijitIconFunction,.dijitRtl .dijitIconKey,.dijitRtl .dijitIconPackage,.dijitRtl .dijitIconSample,.dijitRtl .dijitIconTable,.dijitRtl .dijitIconUsers,.dijitRtl .dijitFolderClosed,.dijitRtl .dijitIconFolderClosed,.dijitRtl .dijitFolderOpened,.dijitRtl .dijitIconFolderOpen,.dijitRtl .dijitIconError {background-image: url('images/commonIconsObjActEnabled_rtl.png'); width: 16px; height: 16px;}.dj_ie6 .dijitRtl .dijitIconSave,.dj_ie6 .dijitRtl .dijitIconPrint,.dj_ie6 .dijitRtl .dijitIconCut,.dj_ie6 .dijitRtl .dijitIconCopy,.dj_ie6 .dijitRtl .dijitIconClear,.dj_ie6 .dijitRtl .dijitIconDelete,.dj_ie6 .dijitRtl .dijitIconUndo,.dj_ie6 .dijitRtl .dijitIconEdit,.dj_ie6 .dijitRtl .dijitIconNewTask,.dj_ie6 .dijitRtl .dijitIconEditTask,.dj_ie6 .dijitRtl .dijitIconEditProperty,.dj_ie6 .dijitRtl .dijitIconTask,.dj_ie6 .dijitRtl .dijitIconFilter,.dj_ie6 .dijitRtl .dijitIconConfigure,.dj_ie6 .dijitRtl .dijitIconSearch,.dj_ie6 .dijitRtl .dijitIconApplication,.dj_ie6 .dijitRtl .dijitIconBookmark,.dj_ie6 .dijitRtl .dijitIconChart,.dj_ie6 .dijitRtl .dijitIconConnector,.dj_ie6 .dijitRtl .dijitIconDatabase,.dj_ie6 .dijitRtl .dijitIconDocuments,.dj_ie6 .dijitRtl .dijitIconMail,.dj_ie6 .dijitRtl .dijitLeaf,.dj_ie6 .dijitRtl .dijitIconFile,.dj_ie6 .dijitRtl .dijitIconFunction,.dj_ie6 .dijitRtl .dijitIconKey,.dj_ie6 .dijitRtl .dijitIconPackage,.dj_ie6 .dijitRtl .dijitIconSample,.dj_ie6 .dijitRtl .dijitIconTable,.dj_ie6 .dijitRtl .dijitIconUsers,.dj_ie6 .dijitRtl .dijitFolderClosed,.dj_ie6 .dijitRtl .dijitIconFolderClosed,.dj_ie6 .dijitRtl .dijitFolderOpened,.dj_ie6 .dijitRtl .dijitIconFolderOpen,.dj_ie6 .dijitRtl .dijitIconError {background-image: url('images/commonIconsObjActEnabled8bit_rtl.png');}.dijitRtl .dijitDisabled .dijitIconSave,.dijitRtl .dijitDisabled .dijitIconPrint,.dijitRtl .dijitDisabled .dijitIconCut,.dijitRtl .dijitDisabled .dijitIconCopy,.dijitRtl .dijitDisabled .dijitIconClear,.dijitRtl .dijitDisabled .dijitIconDelete,.dijitRtl .dijitDisabled .dijitIconUndo,.dijitRtl .dijitDisabled .dijitIconEdit,.dijitRtl .dijitDisabled .dijitIconNewTask,.dijitRtl .dijitDisabled .dijitIconEditTask,.dijitRtl .dijitDisabled .dijitIconEditProperty,.dijitRtl .dijitDisabled .dijitIconTask,.dijitRtl .dijitDisabled .dijitIconFilter,.dijitRtl .dijitDisabled .dijitIconConfigure,.dijitRtl .dijitDisabled .dijitIconSearch,.dijitRtl .dijitDisabled .dijitIconApplication,.dijitRtl .dijitDisabled .dijitIconBookmark,.dijitRtl .dijitDisabled .dijitIconChart,.dijitRtl .dijitDisabled .dijitIconConnector,.dijitRtl .dijitDisabled .dijitIconDatabase,.dijitRtl .dijitDisabled .dijitIconDocuments,.dijitRtl .dijitDisabled .dijitIconMail,.dijitRtl .dijitDisabled .dijitLeaf,.dijitRtl .dijitDisabled .dijitIconFile,.dijitRtl .dijitDisabled .dijitIconFunction,.dijitRtl .dijitDisabled .dijitIconKey,.dijitRtl .dijitDisabled .dijitIconPackage,.dijitRtl .dijitDisabled .dijitIconSample,.dijitRtl .dijitDisabled .dijitIconTable,.dijitRtl .dijitDisabled .dijitIconUsers,.dijitRtl .dijitDisabled .dijitFolderClosed,.dijitRtl .dijitDisabled .dijitIconFolderClosed,.dijitRtl .dijitDisabled .dijitFolderOpened,.dijitRtl .dijitDisabled .dijitIconFolderOpen,.dijitRtl .dijitDisabled .dijitIconError {background-image: url('images/commonIconsObjActDisabled_rtl.png');}

View File

@ -1 +0,0 @@
.dijitEditorIcon {background-image: url('images/editorIconsEnabled.png'); background-repeat: no-repeat; width: 18px; height: 18px; text-align: center;}.dijitDisabled .dijitEditorIcon {background-image: url('images/editorIconsDisabled.png');}.dijitEditorIconSep {background-position: 0;}.dijitEditorIconSave {background-position: -18px;}.dijitEditorIconPrint {background-position: -36px;}.dijitEditorIconCut {background-position: -54px;}.dijitEditorIconCopy {background-position: -72px;}.dijitEditorIconPaste {background-position: -90px;}.dijitEditorIconDelete {background-position: -108px;}.dijitEditorIconCancel {background-position: -126px;}.dijitEditorIconUndo {background-position: -144px;}.dijitEditorIconRedo {background-position: -162px;}.dijitEditorIconSelectAll {background-position: -180px;}.dijitEditorIconBold {background-position: -198px;}.dijitEditorIconItalic {background-position: -216px;}.dijitEditorIconUnderline {background-position: -234px;}.dijitEditorIconStrikethrough {background-position: -252px;}.dijitEditorIconSuperscript {background-position: -270px;}.dijitEditorIconSubscript {background-position: -288px;}.dijitEditorIconJustifyCenter {background-position: -306px;}.dijitEditorIconJustifyFull {background-position: -324px;}.dijitEditorIconJustifyLeft {background-position: -342px;}.dijitEditorIconJustifyRight {background-position: -360px;}.dijitEditorIconIndent {background-position: -378px;}.dijitEditorIconOutdent {background-position: -396px;}.dijitEditorIconListBulletIndent {background-position: -414px;}.dijitEditorIconListBulletOutdent {background-position: -432px;}.dijitEditorIconListNumIndent {background-position: -450px;}.dijitEditorIconListNumOutdent {background-position: -468px;}.dijitEditorIconTabIndent {background-position: -486px;}.dijitEditorIconLeftToRight {background-position: -504px;}.dijitEditorIconRightToLeft, .dijitEditorIconToggleDir {background-position: -522px;}.dijitEditorIconBackColor {background-position: -540px;}.dijitEditorIconForeColor {background-position: -558px;}.dijitEditorIconHiliteColor {background-position: -576px;}.dijitEditorIconNewPage {background-position: -594px;}.dijitEditorIconInsertImage {background-position: -612px;}.dijitEditorIconInsertTable {background-position: -630px;}.dijitEditorIconSpace {background-position: -648px;}.dijitEditorIconInsertHorizontalRule {background-position: -666px;}.dijitEditorIconInsertOrderedList {background-position: -684px;}.dijitEditorIconInsertUnorderedList {background-position: -702px;}.dijitEditorIconCreateLink {background-position: -720px;}.dijitEditorIconUnlink {background-position: -738px;}.dijitEditorIconViewSource {background-position: -756px;}.dijitEditorIconRemoveFormat {background-position: -774px;}.dijitEditorIconFullScreen {background-position: -792px;}.dijitEditorIconWikiword {background-position: -810px;}

View File

@ -1 +0,0 @@
.dijitEditorRtl .dijitEditorIcon {background-image: url('images/editorIconsEnabled_rtl.png');}.dijitEditorRtlDisabled .dijitEditorIcon {background-image: url('images/editorIconsDisabled_rtl.png');}.dijitToolbarRtl .dijitToolbarSeparator {background-image: url('images/editorIconsEnabled_rtl.png');}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,3 +0,0 @@
This folder contains images used by all themes when in "high-contrast" mode.
If you think you need to put something here, please talk to Becky or Bill first.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,290 +0,0 @@
/* Calendar
*
* Styling Calendar mainly includes:
*
* 1. Calendar container
* .dijitCalendar - main container
* .dijitCalendarHover / .dijitCalendarActive - states e.g. hover,active
*
* 2. Month
* .dijitCalendarMonthContainer
* .dijitCalendarMonthLabel
* .dijitCalendarDecrease / .dijitCalendarDecrease - icons for switching to previous/next month
* .dijitCalendarArrowActive .dijitCalendarDecrease - states e.g. hover,active
*
* 3. Date
* .dijitCalendarDayLabelTemplate - week day column header e.g. S M T W T F S
* .dijitCalendarDateTemplate - date label wrapper
* .dijitCalendarPreviousMonth .dijitCalendarDateLabel - special labels for previous or next month
* .dijitCalendarSelectedDate .dijitCalendarDateLabel - styles for selected date
* .dijitCalendarDisabledDate .dijitCalendarDateLabel - styles for disabled date
* .dijitCalendarActiveDate .dijitCalendarDateLabel - states e.g. hover,active
*
* 4. Year
* .dijitCalendarYearContainer
* .dijitCalendarYearLabel
* .dijitCalendarPreviousYear /.dijitCalendarNextYear
* .dijitCalendarNextYearHover / .dijitCalendarPreviousYearHover - states e.g. hover,active
*
* 5. Dropdown Month Menu
* .dijitCalendarMonthMenu - menu container
* .dijitCalendarMonthMenu .dijitCalendarMonthLabel - month label in menu item
* .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover - menu item hover state
*/
.claro .dijitCalendar {
border: solid 1px #b5bcc7;
border-collapse: separate;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #cfe5fa;
background-image: url("images/calendar.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%);
text-align: center;
padding: 6px 5px 3px 5px;
}
.dj_ie6 .claro .dijitCalendar {
background-image: none;
}
.claro .dijitCalendar img {
border: none;
}
.claro .dijitCalendarHover,
.claro .dijitCalendar:hover,
.claro .dijitCalendarActive {
/* treat dijitCalendarActive like hover since there's
* no concept of clicking a Calendar as a whole (although you can click things inside the calendar)
*/
background-color: #abd6ff;
border: solid 1px #759dc0;
}
.claro .dijitCalendarMonthContainer th {
text-align: center;
padding-bottom: 4px;
vertical-align: middle;
}
.claro .dijitCalendarMonthLabel {
color: #000;
font-size: 1.091em;
padding: 0 4px;
}
/* next/previous month arrows */
.claro .dijitCalendarIncrementControl {
width: 18px;
height: 16px;
background-image: url("images/calendarArrows.png");
background-repeat: no-repeat;
}
.dj_ie6 .claro .dijitCalendarIncrementControl {
background-image: url("images/calendarArrows8bit.png");
}
.claro .dijitCalendarIncrease {
background-position: -18px 0;
}
.claro .dijitCalendarArrowHover .dijitCalendarDecrease,
.claro .dijitCalendarArrow:hover .dijitCalendarDecrease {
background-position: -36px 0;
}
.claro .dijitCalendarArrowHover .dijitCalendarIncrease,
.claro .dijitCalendarArrow:hover .dijitCalendarIncrease {
background-position: -55px 0;
}
.claro .dijitCalendarArrowActive .dijitCalendarDecrease,
.claro .dijitCalendarArrow:active .dijitCalendarDecrease {
background-position: -72px 0;
}
.claro .dijitCalendarArrowActive .dijitCalendarIncrease,
.claro .dijitCalendarArrow:active .dijitCalendarIncrease {
background-position: -91px 0;
}
.claro .dijitA11ySideArrow {
/* text +/- labels instead of arrow icons, for high contrast mode */
display: none;
}
.claro .dijitCalendarDayLabelTemplate {
padding-bottom: 0;
text-align: center;
border-bottom: 1px solid #b5bcc7;
padding: 0 3px 2px;
}
.claro .dijitCalendarDayLabel {
padding: 0 4px 0 4px;
font-weight: bold;
font-size: 0.909em;
text-align: center;
color: #000;
}
.claro .dijitCalendarDateTemplate {
background-color: #fff;
border-bottom: 1px solid #d3d3d3;
padding-top: 0;
font-size: 0.909em;
font-family: Arial;
font-weight: bold;
letter-spacing: .05em;
text-align: center;
color: #000;
}
.dj_ie6 .claro .dijitCalendarDateTemplate {
background-image: none;
}
.claro .dijitCalendarPreviousMonth,
.claro .dijitCalendarNextMonth {
background-color: #e5f2fe;
background-image: none;
border-bottom: solid 1px #d3d3d3;
/* todo: redundant with above .dijitCalendarDateTemplate rule */
}
.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel {
text-decoration: none;
display: block;
padding: 3px 5px 3px 4px;
border: solid 1px #fff;
/* intentionally matches background-color, no visible border until hover/selection */
background-color: rgba(171, 212, 251, 0);
/* transparent causes black-flash animation problem on webkit */
-webkit-transition-property: background-color, border;
-moz-transition-property: background-color, border;
transition-property: background-color, border;
-webkit-transition-duration: 0.35s;
-moz-transition-duration: 0.35s;
transition-duration: 0.35s;
}
.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel,
.claro .dijitCalendarNextMonth .dijitCalendarDateLabel {
color: #759dc0;
border-color: #e5f2fe;
/* intentionally matches background-color, no visible border until hover/selection */
}
.claro .dijitCalendarYearContainer {
vertical-align: middle;
}
.claro .dijitCalendarYearControl {
padding: 1px 2px 2px 2px;
}
.claro .dijitCalendarYearLabel {
padding: 2px 0 0 0;
margin: 0;
font-size: 1.17em;
}
.claro .dijitCalendarYearLabel span {
/* trying to center next/current/previous year vertically, doesn't work on IE6/7 though */
vertical-align: middle;
}
.claro .dijitCalendarSelectedYear {
padding: 0 3px;
}
.claro .dijitCalendarNextYear,
.claro .dijitCalendarPreviousYear {
padding: 1px 6px 1px 6px;
font-size: 0.909em;
}
.claro .dijitCalendarSelectedYear {
font-size: 1.091em;
color: #000;
}
/* End Normal Calendar Style */
/* Hovered Calendar Style */
.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel,
.claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel {
background-color: #abd6ff;
border: solid 1px #759dc0;
color: #000;
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
}
.claro .dijitCalendarNextYearHover,
.claro .dijitCalendarNextYear:hover,
.claro .dijitCalendarPreviousYearHover,
.claro .dijitCalendarPreviousYear:hover {
color: #000;
border: solid 1px #fff;
padding: 0 5px 0 5px;
/* reduced by 1 to make room for border */
background-color: #e5f2fe;
}
/* End Hovered Calendar Style */
/* Active Calendar Style */
.claro .dijitCalendarNextYearActive,
.claro .dijitCalendarNextYear:active .claro .dijitCalendarPreviousYearActive,
.claro .dijitCalendarPreviousYear:active {
border: solid 1px #759dc0;
padding: 0 5px 0 5px;
/* reduced by 1 to make room for border */
background-color: #7dbdfa;
}
.claro .dijitCalendarActiveDate .dijitCalendarDateLabel,
.claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel {
background-color: #7dbdfa;
border: solid 1px #fff;
-webkit-transition-duration: 0.1s;
-moz-transition-duration: 0.1s;
transition-duration: 0.1s;
}
.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel {
background-image: none;
}
/* End Active Calendar Style */
/* Selected Calendar Style */
.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel {
color: #000;
background-color: #abd6ff;
border-color: #759dc0;
}
/* End Selected Calendar Style */
/* Disabled Calendar Style*/
.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel {
color: #818181;
text-decoration: line-through;
}
/* End Disabled Calendar Style */
/* Styling for month DropDownButton */
.claro .dijitCalendar .dijitDropDownButton {
margin: 0;
}
.claro .dijitCalendar .dijitButtonText {
padding: 1px 0 3px;
margin-right: -4px;
}
.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode {
padding: 0 3px 0 2px;
border: solid 1px #b5bcc7;
-webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
-moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
background-color: transparent;
background-image: none;
}
.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode,
.claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode {
background-color: #e5f2fe;
border: solid 1px #fff;
}
/* Styling for month drop down list */
.claro .dijitCalendarMonthMenu {
border-color: #759dc0;
background-color: #fff;
text-align: center;
background-image: none;
}
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel {
border-top: solid 1px #fff;
/* intentionally invisible until hover */
border-bottom: solid 1px #fff;
padding: 2px 0;
}
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover,
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover {
border-color: #759dc0;
border-width: 1px 0;
background-color: #abd6ff;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= #ffffff , endColorstr= #abd6ff );
}

View File

@ -1,277 +0,0 @@
/* Calendar
*
* Styling Calendar mainly includes:
*
* 1. Calendar container
* .dijitCalendar - main container
* .dijitCalendarHover / .dijitCalendarActive - states e.g. hover,active
*
* 2. Month
* .dijitCalendarMonthContainer
* .dijitCalendarMonthLabel
* .dijitCalendarDecrease / .dijitCalendarDecrease - icons for switching to previous/next month
* .dijitCalendarArrowActive .dijitCalendarDecrease - states e.g. hover,active
*
* 3. Date
* .dijitCalendarDayLabelTemplate - week day column header e.g. S M T W T F S
* .dijitCalendarDateTemplate - date label wrapper
* .dijitCalendarPreviousMonth .dijitCalendarDateLabel - special labels for previous or next month
* .dijitCalendarSelectedDate .dijitCalendarDateLabel - styles for selected date
* .dijitCalendarDisabledDate .dijitCalendarDateLabel - styles for disabled date
* .dijitCalendarActiveDate .dijitCalendarDateLabel - states e.g. hover,active
*
* 4. Year
* .dijitCalendarYearContainer
* .dijitCalendarYearLabel
* .dijitCalendarPreviousYear /.dijitCalendarNextYear
* .dijitCalendarNextYearHover / .dijitCalendarPreviousYearHover - states e.g. hover,active
*
* 5. Dropdown Month Menu
* .dijitCalendarMonthMenu - menu container
* .dijitCalendarMonthMenu .dijitCalendarMonthLabel - month label in menu item
* .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover - menu item hover state
*/
@import "variables";
.claro .dijitCalendar {
border: solid 1px @border-color;
border-collapse: separate; // in case user CSS has set border-collapse: collapse for tables
.border-radius(4px);
// Background color and alpha-gradient
background-color: @calendar-background-color;
background-image: url("images/calendar.png"); // fallback for browsers that don't support CSS gradients
background-repeat: repeat-x; // so bottom of calendar isn't affected by gradient image repeating
.alpha-white-gradient(1, 0px, 0.4, 2px, 0, 100%);
text-align:center;
padding:6px 5px 3px 5px;
}
.dj_ie6 .claro .dijitCalendar {
background-image:none; // because on IE6 background-image overrides background-color
}
.claro .dijitCalendar img {
border:none;
}
.claro .dijitCalendarHover, .claro .dijitCalendar:hover,
.claro .dijitCalendarActive {
/* treat dijitCalendarActive like hover since there's
* no concept of clicking a Calendar as a whole (although you can click things inside the calendar)
*/
background-color: @hovered-background-color;
border:solid 1px @hovered-border-color;
}
.claro .dijitCalendarMonthContainer th {
text-align:center;
padding-bottom:4px;
vertical-align:middle;
}
.claro .dijitCalendarMonthLabel {
color: @text-color;
font-size: 1.091em;
padding: 0 4px;
}
/* next/previous month arrows */
.claro .dijitCalendarIncrementControl {
width:18px;
height:16px;
background-image: url(@image-calendar-arrows);
background-repeat: no-repeat;
}
.dj_ie6 .claro .dijitCalendarIncrementControl {
background-image: url(@image-calendar-arrows-ie6);
}
.claro .dijitCalendarIncrease {
background-position:-18px 0;
}
.claro .dijitCalendarArrowHover .dijitCalendarDecrease,
.claro .dijitCalendarArrow:hover .dijitCalendarDecrease {
background-position:-36px 0;
}
.claro .dijitCalendarArrowHover .dijitCalendarIncrease,
.claro .dijitCalendarArrow:hover .dijitCalendarIncrease {
background-position:-55px 0;
}
.claro .dijitCalendarArrowActive .dijitCalendarDecrease,
.claro .dijitCalendarArrow:active .dijitCalendarDecrease {
background-position:-72px 0;
}
.claro .dijitCalendarArrowActive .dijitCalendarIncrease,
.claro .dijitCalendarArrow:active .dijitCalendarIncrease {
background-position:-91px 0;
}
.claro .dijitA11ySideArrow {
/* text +/- labels instead of arrow icons, for high contrast mode */
display: none;
}
.claro .dijitCalendarDayLabelTemplate {
padding-bottom:0;
text-align:center;
border-bottom:1px solid @border-color;
padding:0 3px 2px;
}
.claro .dijitCalendarDayLabel {
padding:0 4px 0 4px;
font-weight:bold;
font-size:0.909em;
text-align:center;
color: @text-color;
}
.claro .dijitCalendarDateTemplate {
text-align:center;
background-color:@calendar-currentmonth-background-color;
border-bottom: 1px solid @minor-border-color;
padding-top:0;
font-size:0.909em;
font-family: Arial;
font-weight:bold;
letter-spacing:.05em;
text-align:center;
color: @text-color;
}
.dj_ie6 .claro .dijitCalendarDateTemplate {
background-image: none;
}
.claro .dijitCalendarPreviousMonth,
.claro .dijitCalendarNextMonth {
background-color: @calendar-adjacentmonth-background-color;
background-image:none;
border-bottom:solid 1px @minor-border-color; /* todo: redundant with above .dijitCalendarDateTemplate rule */
}
.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel {
text-decoration:none;
display:block;
padding:3px 5px 3px 4px;
border:solid 1px @calendar-currentmonth-background-color; /* intentionally matches background-color, no visible border until hover/selection */
background-color:rgba(171,212,251,0); /* transparent causes black-flash animation problem on webkit */
.transition-property(background-color, border);
.transition-duration(.35s);
}
.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel,
.claro .dijitCalendarNextMonth .dijitCalendarDateLabel{
color: @calendar-adjacentmonth-text-color;
border-color: @calendar-adjacentmonth-background-color; /* intentionally matches background-color, no visible border until hover/selection */
}
.claro .dijitCalendarYearContainer {
vertical-align:middle;
}
.claro .dijitCalendarYearControl {
padding: 1px 2px 2px 2px;
}
.claro .dijitCalendarYearLabel {
padding: 2px 0 0 0;
margin: 0;
font-size: 1.17em;
}
.claro .dijitCalendarYearLabel span {
/* trying to center next/current/previous year vertically, doesn't work on IE6/7 though */
vertical-align:middle;
}
.claro .dijitCalendarSelectedYear {
padding:0 3px;
}
.claro .dijitCalendarNextYear,
.claro .dijitCalendarPreviousYear {
padding: 1px 6px 1px 6px;
font-size:0.909em;
}
.claro .dijitCalendarSelectedYear {
font-size:1.091em;
color:@selected-text-color;
}
/* End Normal Calendar Style */
/* Hovered Calendar Style */
.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel,
.claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel {
background-color:@hovered-background-color;
border:solid 1px @hovered-border-color;
color:@hovered-text-color;
.transition-duration(.2s);
}
.claro .dijitCalendarNextYearHover, .claro .dijitCalendarNextYear:hover,
.claro .dijitCalendarPreviousYearHover, .claro .dijitCalendarPreviousYear:hover {
color:@hovered-text-color;
border:solid 1px @calendar-button-hovered-border-color;
padding: 0 5px 0 5px; /* reduced by 1 to make room for border */
background-color: @calendar-button-hovered-background-color;
}
/* End Hovered Calendar Style */
/* Active Calendar Style */
.claro .dijitCalendarNextYearActive, .claro .dijitCalendarNextYear:active
.claro .dijitCalendarPreviousYearActive, .claro .dijitCalendarPreviousYear:active {
border: solid 1px @calendar-button-pressed-border-color;
padding: 0 5px 0 5px; /* reduced by 1 to make room for border */
background-color:@calendar-button-pressed-background-color;
}
.claro .dijitCalendarActiveDate .dijitCalendarDateLabel,
.claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel {
background-color: @calendar-date-pressed-background-color;
border:solid 1px @calendar-date-pressed-border-color;
.transition-duration(.1s);
}
.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel {
background-image:none;
}
/* End Active Calendar Style */
/* Selected Calendar Style */
.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel {
color:@selected-text-color;
background-color: @calendar-date-selected-background-color;
border-color: @calendar-date-selected-border-color;
}
/* End Selected Calendar Style */
/* Disabled Calendar Style*/
.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel {
color: @disabled-text-color;
text-decoration:line-through;
}
/* End Disabled Calendar Style */
/* Styling for month DropDownButton */
.claro .dijitCalendar .dijitDropDownButton {
margin: 0;
}
.claro .dijitCalendar .dijitButtonText {
padding: 1px 0 3px;
margin-right:-4px;
}
.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode {
padding: 0 3px 0 2px;
border:solid 1px @border-color;
.box-shadow(0 0 0 rgba(0,0,0,0));
// Override background settings from vanilla .dijitButtonNode. We want to inherit background of Calendar.
background-color: transparent;
background-image: none;
}
.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode,
.claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode {
background-color: @calendar-button-hovered-background-color;
border:solid 1px @calendar-button-hovered-border-color;
}
/* Styling for month drop down list */
.claro .dijitCalendarMonthMenu {
border-color: @popup-border-color;
background-color: @menu-background-color;
text-align:center;
background-image: none;
}
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel {
border-top: solid 1px @menu-background-color; /* intentionally invisible until hover */
border-bottom: solid 1px @menu-background-color;
padding: 2px 0;
}
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover,
.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover {
border-color: @hovered-border-color;
border-width:1px 0;
.gradient-and-filter(@hovered-background-color, 70, 0);
}

View File

@ -1,18 +0,0 @@
.claro .dijitCalendarRtl .dijitCalendarIncrease {
background-position: 0 0;
}
.claro .dijitCalendarRtl .dijitCalendarDecrease {
background-position: -18px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease {
background-position: -36px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease {
background-position: -55px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease {
background-position: -72px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease {
background-position: -91px 0;
}

View File

@ -1,19 +0,0 @@
.claro .dijitCalendarRtl .dijitCalendarIncrease{
background-position: 0 0;
}
.claro .dijitCalendarRtl .dijitCalendarDecrease {
background-position: -18px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease {
background-position: -36px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease {
background-position: -55px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease {
background-position: -72px 0;
}
.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease {
background-position: -91px 0;
}

View File

@ -1,41 +0,0 @@
/* ColorPalette
*
* Styling of the ColorPalette consists of the following:
*
* 1. the whole color palette
* .dijitColorPalette - for outline, border, and background color of the whole color palette
* Note: outline does not work for IE
*
* 2. the color swatch
* .dijitColorPalette .dijitPaletteImg
* transparent (but clickable) <img> node inside of each <td>, overlaying the color swatch.
* displays border around a color swatch
*
* 3. hovered swatch
* .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg
* the hovered state of the color swatch - adds border
*
* 4. active and selected swatch
* .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg
* .dijitColorPalette .dijitPaletteCellSelected .dijitPaletteImg
* adds border for active or selected state
*/
.claro .dijitColorPalette {
border: 1px solid #b5bcc7;
background: #fff;
-moz-border-radius: 0;
border-radius: 0;
}
.claro .dijitColorPalette .dijitPaletteImg {
/* transparent (but clickable) <img> node inside of each <td>, overlaying the color swatch.
* displays border around a color swatch
* overrides border color in dijit.css */
border: 1px solid #d3d3d3;
}
.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {
border: 1px solid #000;
}
.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg,
.claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {
border: 2px solid #000;
}

View File

@ -1,44 +0,0 @@
/* ColorPalette
*
* Styling of the ColorPalette consists of the following:
*
* 1. the whole color palette
* .dijitColorPalette - for outline, border, and background color of the whole color palette
* Note: outline does not work for IE
*
* 2. the color swatch
* .dijitColorPalette .dijitPaletteImg
* transparent (but clickable) <img> node inside of each <td>, overlaying the color swatch.
* displays border around a color swatch
*
* 3. hovered swatch
* .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg
* the hovered state of the color swatch - adds border
*
* 4. active and selected swatch
* .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg
* .dijitColorPalette .dijitPaletteCellSelected .dijitPaletteImg
* adds border for active or selected state
*/
@import "variables";
.claro .dijitColorPalette {
border: 1px solid @border-color;
background: @colorpalette-background-color;
.border-radius(0);
}
.claro .dijitColorPalette .dijitPaletteImg {
/* transparent (but clickable) <img> node inside of each <td>, overlaying the color swatch.
* displays border around a color swatch
* overrides border color in dijit.css */
border: 1px solid @minor-border-color;
}
.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {
border: 1px solid @swatch-hovered-border-color;
}
.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg,
.claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {
border: 2px solid @swatch-selected-border-color;
}

View File

@ -1,98 +0,0 @@
/* ========= Styling rules to affect widgets ========= */
.claro .dijitPopup {
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}
.claro .dijitTooltipDialogPopup {
/* exception popups: do not use a shadow on these because they aren't rectangular */
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/* The highlight is shown in the ComboBox menu. TODO: move to form/Common.less */
.claro .dijitComboBoxHighlightMatch {
background-color: #abd6ff;
}
.claro .dijitFocusedLabel {
/* for checkboxes or radio buttons, hatch border around the corresponding label, to indicate focus */
outline: 1px dotted #494949;
}
/* Drag and Drop*/
.claro .dojoDndItem {
border-color: rgba(0, 0, 0, 0);
-webkit-transition-duration: 0.25s;
-moz-transition-duration: 0.25s;
transition-duration: 0.25s;
-webkit-transition-property: background-color, border-color;
-moz-transition-property: background-color, border-color;
transition-property: background-color, border-color;
}
.claro .dojoDndItemOver {
background-color: #abd6ff;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
padding: 1px;
border: solid 1px #759dc0;
color: #000;
}
.claro .dojoDndItemAnchor,
.claro .dojoDndItemSelected {
background-color: #cfe5fa;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
padding: 1px;
border: solid 1px #759dc0;
color: #000;
}
.claro .dojoDndItemBefore,
.claro .dojoDndItemAfter {
border-color: #759dc0;
}
.claro table.dojoDndAvatar {
border: 1px solid #b5bcc7;
border-collapse: collapse;
background-color: #fff;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.claro .dojoDndAvatarHeader td {
height: 20px;
padding-left: 21px;
}
.claro.dojoDndMove .dojoDndAvatarHeader,
.claro.dojoDndCopy .dojoDndAvatarHeader {
background-image: url("images/dnd.png");
background-repeat: no-repeat;
background-position: 2px -122px;
}
.claro .dojoDndAvatarItem td {
padding: 5px;
}
.claro.dojoDndMove .dojoDndAvatarHeader {
background-color: #f58383;
background-position: 2px -103px;
}
.claro.dojoDndCopy .dojoDndAvatarHeader {
background-color: #f58383;
background-position: 2px -68px;
}
.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader {
background-color: #97e68d;
background-position: 2px -33px;
}
.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader {
background-color: #97e68d;
background-position: 2px 2px;
}

View File

@ -1,86 +0,0 @@
/* ========= Styling rules to affect widgets ========= */
@import "variables";
.claro .dijitPopup {
.box-shadow(0 1px 5px rgba(0,0,0,0.25));
}
.claro .dijitTooltipDialogPopup {
/* exception popups: do not use a shadow on these because they aren't rectangular */
.box-shadow(none);
}
/* The highlight is shown in the ComboBox menu. TODO: move to form/Common.less */
.claro .dijitComboBoxHighlightMatch {
background-color: @select-matchedtext-background-color;
}
.claro .dijitFocusedLabel {
/* for checkboxes or radio buttons, hatch border around the corresponding label, to indicate focus */
outline: 1px dotted @focus-outline-color;
}
/* Drag and Drop*/
.claro .dojoDndItem {
border-color: rgba(0,0,0,0); // rgba() instead of none to prevent flash on hover fade-in
.transition-duration(.25s);
.transition-property(background-color, border-color)
}
.claro .dojoDndItemOver {
// Hovered item. Matches dijitTreeRowHover.
background-color:@hovered-background-color;
.standard-gradient;
padding: 1px; // reduce from 2px in dijit.css
border:solid 1px @hovered-border-color;
color:@hovered-text-color;
}
.claro .dojoDndItemAnchor,
.claro .dojoDndItemSelected {
// Selected items(s). Matches dijitTreeRowSelected.
background-color:@selected-background-color;
.standard-gradient;
padding: 1px; // reduce from 2px in dijit.css
border:solid 1px @selected-border-color;
color:@selected-text-color;
}
.claro .dojoDndItemBefore,
.claro .dojoDndItemAfter {
// line to indicate that user is dropping before/after this dojoDndItem
border-color: @dnd-dropseparator-color;
}
.claro table.dojoDndAvatar {
border: 1px solid @border-color;
border-collapse: collapse;
background-color: @dnd-avatar-background-color;
.box-shadow(0 1px 3px rgba(0, 0, 0, .25));
}
.claro .dojoDndAvatarHeader td {
height: 20px;
padding-left:21px;
}
.claro.dojoDndMove .dojoDndAvatarHeader, .claro.dojoDndCopy .dojoDndAvatarHeader {
background-image: url(@image-dnd);
background-repeat: no-repeat;
background-position:2px -122px;
}
.claro .dojoDndAvatarItem td {
padding: 5px;
}
.claro.dojoDndMove .dojoDndAvatarHeader {
background-color: @dnd-avatar-header-background-color;
background-position:2px -103px;
}
.claro.dojoDndCopy .dojoDndAvatarHeader {
background-color: @dnd-avatar-header-background-color;
background-position:2px -68px;
}
.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader {
background-color: @dnd-avatar-candrop-header-background-color;
background-position:2px -33px;
}
.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader {
background-color: @dnd-avatar-candrop-header-background-color;
background-position:2px 2px;
}

View File

@ -1,205 +0,0 @@
/* Dialog
*
* Styling Dialog includes two sections: Dialog and Tooltip & TooltipDialog
*
* Dialog:
* 1. Dialog (default styling):
* .dijitDialog - styles for dialog's bounding box
*
* 2. Dialog title
* .dijitDialogTitleBar - styles for the title container at the top of dialog
* .dijitDialogTitle - the text container in dialog title
*
* 3. Dialog content
* .dijitDialogPaneContent - main container for content area and action bar
* .dijitDialogPaneContentArea - styles for content container
*
* 4. Dialog action bar
* .dijitDialogPaneActionBar - styles for action buttons lie at the bottom of dialog pane content
*
* 5. Dialog underlay
* .dijitDialogUnderlay - div under the dialog which used for separate dialog and page content
*
*
* Tooltip & TooltipDialog:
* 1. tooltip content container:
* .dijitTooltipContainer - tooltip content container
*
* 2. tooltip connector:
* .dijitTooltipConnector - tooltip anchor includes 4 direction(up, down, left, right)
*/
.claro .dijitDialog {
border: 1px solid #759dc0;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}
.claro .dijitDialogPaneContent {
background: #fff repeat-x top left;
border-top: 1px solid #759dc0;
padding: 10px 8px;
position: relative;
}
.claro .dijitDialogPaneContentArea {
/* trick to get action bar (gray bar at bottom with OK/cancel buttons) to span from
* left to right but still indent dialog content
*/
margin: -10px -8px;
padding: 10px 8px;
}
.claro .dijitDialogPaneActionBar {
/* gray bar at bottom of dialog with OK/Cancel buttons */
background-color: #efefef;
padding: 3px 5px 2px 7px;
text-align: right;
border-top: 1px solid #d3d3d3;
margin: 10px -8px -10px;
}
.claro .dijitTooltipDialog .dijitDialogPaneActionBar {
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
margin: 10px -10px -8px;
}
.claro .dijitDialogPaneActionBar .dijitButton {
float: none;
}
.claro .dijitDialogTitleBar {
/* outer container for the titlebar of the dialog */
border: 1px solid #fff;
border-top: none;
background-color: #abd6ff;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
padding: 5px 7px 4px 7px;
}
.claro .dijitDialogTitle {
/* typography and styling of the dialog title */
padding: 0 1px;
font-size: 1.091em;
color: #000;
}
.claro .dijitDialogCloseIcon {
/* the default close icon for the dialog */
background: url("images/dialogCloseIcon.png");
background-repeat: no-repeat;
position: absolute;
right: 5px;
height: 15px;
width: 21px;
}
.dj_ie6 .claro .dijitDialogCloseIcon {
background-image: url("images/dialogCloseIcon8bit.png");
}
.claro .dijitDialogCloseIconHover {
background-position: -21px;
}
.claro .dijitDialogCloseIconActive {
background-position: -42px;
}
/* Tooltip and TooltipDialog */
.claro .dijitTooltip,
.claro .dijitTooltipDialog {
/* the outermost dom node, holding the connector and container */
background: transparent;
/* make the area on the sides of the arrow transparent */
}
.dijitTooltipBelow {
/* leave room for arrow above content */
padding-top: 13px;
padding-left: 3px;
padding-right: 3px;
}
.dijitTooltipAbove {
/* leave room for arrow below content */
padding-bottom: 13px;
padding-left: 3px;
padding-right: 3px;
}
.claro .dijitTooltipContainer {
/* the part with the text */
background-color: #fff;
background-image: -moz-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px);
background-image: -webkit-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px);
background-image: -o-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px);
background-image: -ms-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px);
background-position: bottom;
border: 1px solid #759dc0;
padding: 6px 8px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
font-size: 1em;
color: #000;
}
.claro .dijitTooltipConnector {
/* the arrow piece */
border: 0;
z-index: 2;
background-image: url("images/tooltip.png");
background-repeat: no-repeat;
width: 16px;
height: 14px;
}
.dj_ie6 .claro .dijitTooltipConnector {
background-image: url("images/tooltip8bit.png");
}
.claro .dijitTooltipABRight .dijitTooltipConnector {
/* above or below tooltip, but the arrow appears on the right,
and the right edges of target and tooltip are aligned rather than the left */
left: auto !important;
right: 3px;
}
.claro .dijitTooltipBelow .dijitTooltipConnector {
/* the arrow piece for tooltips below an element */
top: 0;
left: 3px;
background-position: -31px 0;
width: 16px;
height: 14px;
}
.claro .dijitTooltipAbove .dijitTooltipConnector {
/* the arrow piece for tooltips above an element */
bottom: 0;
left: 3px;
background-position: -15px 0;
width: 16px;
height: 14px;
}
.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector,
.dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector {
bottom: -1px;
}
.claro .dijitTooltipLeft {
padding-right: 14px;
}
.claro .dijitTooltipLeft .dijitTooltipConnector {
/* the arrow piece for tooltips to the left of an element, bottom borders aligned */
right: 0;
background-position: 0 0;
width: 16px;
height: 14px;
}
.claro .dijitTooltipRight {
padding-left: 14px;
}
.claro .dijitTooltipRight .dijitTooltipConnector {
/* the arrow piece for tooltips to the right of an element, bottom borders aligned */
left: 0;
background-position: -48px 0;
width: 16px;
height: 14px;
}
.claro .dijitDialogUnderlay {
background: #fff;
}

View File

@ -1,209 +0,0 @@
/* Dialog
*
* Styling Dialog includes two sections: Dialog and Tooltip & TooltipDialog
*
* Dialog:
* 1. Dialog (default styling):
* .dijitDialog - styles for dialog's bounding box
*
* 2. Dialog title
* .dijitDialogTitleBar - styles for the title container at the top of dialog
* .dijitDialogTitle - the text container in dialog title
*
* 3. Dialog content
* .dijitDialogPaneContent - main container for content area and action bar
* .dijitDialogPaneContentArea - styles for content container
*
* 4. Dialog action bar
* .dijitDialogPaneActionBar - styles for action buttons lie at the bottom of dialog pane content
*
* 5. Dialog underlay
* .dijitDialogUnderlay - div under the dialog which used for separate dialog and page content
*
*
* Tooltip & TooltipDialog:
* 1. tooltip content container:
* .dijitTooltipContainer - tooltip content container
*
* 2. tooltip connector:
* .dijitTooltipConnector - tooltip anchor includes 4 direction(up, down, left, right)
*/
@import "variables";
.claro .dijitDialog {
border: 1px solid @popup-border-color;
.box-shadow(0 1px 5px rgba(0,0,0,0.25));
}
.claro .dijitDialogPaneContent {
background: @pane-background-color repeat-x top left;
border-top: 1px solid @popup-border-color;
padding:10px 8px;
position: relative;
}
.claro .dijitDialogPaneContentArea {
/* trick to get action bar (gray bar at bottom with OK/cancel buttons) to span from
* left to right but still indent dialog content
*/
margin: -10px -8px;
padding: 10px 8px;
}
.claro .dijitDialogPaneActionBar {
/* gray bar at bottom of dialog with OK/Cancel buttons */
background-color: @bar-background-color;
padding: 3px 5px 2px 7px;
text-align: right;
border-top: 1px solid @minor-border-color;
margin: 10px -8px -10px;
}
.claro .dijitTooltipDialog .dijitDialogPaneActionBar {
-webkit-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
margin: 10px -10px -8px;
}
.claro .dijitDialogPaneActionBar .dijitButton {
float: none;
}
.claro .dijitDialogTitleBar {
/* outer container for the titlebar of the dialog */
border: 1px solid @dialog-titlebar-border-color;
border-top:none;
background-color: @dialog-titlebar-background-color;
.standard-gradient;
padding: 5px 7px 4px 7px;
}
.claro .dijitDialogTitle {
/* typography and styling of the dialog title */
padding: 0 1px;
font-size:1.091em;
color: @text-color;
}
.claro .dijitDialogCloseIcon {
/* the default close icon for the dialog */
background: url(@image-dialog-close);
background-repeat:no-repeat;
position: absolute;
right: 5px;
height: 15px;
width: 21px;
}
.dj_ie6 .claro .dijitDialogCloseIcon {
background-image: url(@image-dialog-close-ie6);
}
.claro .dijitDialogCloseIconHover {
background-position:-21px;
}
.claro .dijitDialogCloseIconActive {
background-position:-42px;
}
/* Tooltip and TooltipDialog */
.claro .dijitTooltip,
.claro .dijitTooltipDialog {
/* the outermost dom node, holding the connector and container */
background: transparent; /* make the area on the sides of the arrow transparent */
}
.dijitTooltipBelow {
/* leave room for arrow above content */
padding-top: 13px;
padding-left:3px;
padding-right:3px;
}
.dijitTooltipAbove {
/* leave room for arrow below content */
padding-bottom: 13px;
padding-left:3px;
padding-right:3px;
}
.claro .dijitTooltipContainer {
/* the part with the text */
background-color:@popup-background-color;
.linear-gradient(bottom, @tooltip-gradient-color 0px, @popup-background-color 10px);
background-position:bottom;
border:1px solid @popup-border-color;
padding:6px 8px;
.border-radius(4px);
.box-shadow(0 1px 3px rgba(0,0,0,0.25));
font-size: 1em;
color: @text-color;
}
.claro .dijitTooltipConnector {
/* the arrow piece */
border: 0;
z-index: 2;
background-image:url(@image-tooltip);
background-repeat:no-repeat;
width:16px;
height:14px;
}
.dj_ie6 .claro .dijitTooltipConnector {
background-image:url(@image-tooltip-ie6);
}
.claro .dijitTooltipABRight .dijitTooltipConnector {
/* above or below tooltip, but the arrow appears on the right,
and the right edges of target and tooltip are aligned rather than the left */
left: auto !important;
right: 3px;
}
.claro .dijitTooltipBelow .dijitTooltipConnector {
/* the arrow piece for tooltips below an element */
top: 0;
left: 3px;
background-position:-31px 0;
width:16px;
height:14px;
}
.claro .dijitTooltipAbove .dijitTooltipConnector {
/* the arrow piece for tooltips above an element */
bottom: 0;
left: 3px;
background-position:-15px 0;
width:16px;
height:14px;
}
.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector,
.dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector {
bottom: -1px;
}
.claro .dijitTooltipLeft {
padding-right: 14px;
}
.claro .dijitTooltipLeft .dijitTooltipConnector {
/* the arrow piece for tooltips to the left of an element, bottom borders aligned */
right: 0;
background-position:0 0;
width:16px;
height:14px;
}
.claro .dijitTooltipRight {
padding-left: 14px;
}
.claro .dijitTooltipRight .dijitTooltipConnector {
/* the arrow piece for tooltips to the right of an element, bottom borders aligned */
left: 0;
background-position:-48px 0;
width:16px;
height:14px;
}
.claro .dijitDialogUnderlay {
background: @dialog-underlay-color;
}

View File

@ -1,9 +0,0 @@
/* Dialog */
.claro .dijitDialogRtl .dijitDialogCloseIcon {
right: auto;
left: 5px;
}
.claro .dijitDialogRtl .dijitDialogPaneActionBar {
text-align: left;
padding: 3px 7px 2px 5px;
}

View File

@ -1,13 +0,0 @@
/* Dialog */
@import "variables";
.claro .dijitDialogRtl .dijitDialogCloseIcon {
right: auto;
left: 5px;
}
.claro .dijitDialogRtl .dijitDialogPaneActionBar {
text-align: left;
padding: 3px 7px 2px 5px;
}

View File

@ -1,55 +0,0 @@
/* Editor
*
* Styling Editor means styling the Editor inside iframe container (dijitEditorIFrameContainer)
*
* 1. Editor iframe container (default styling):
* .dijitEditorIFrameContainer - normal state styles: background-color, border, padding
*
* 2. hovered Editor iframe container (ie, mouse hover on editor)
* .dijitEditorHover .dijitEditorIFrameContainer/dijitEditorIFrame - styles when mouse hover on the container
*
* 3. focused Editor iframe container (ie, mouse focus on the editor pane)
* .dijitEditorFocused .dijitEditorIFrameContainer/dijitEditorIFrame - styles when container focused
*
* 3. disabled Editor iframe container
* .dijitEditorDisabled - editor's inner iframe container disable status styles: background, border
*/
.claro .dijitEditorIFrameContainer {
padding: 3px 3px 1px 10px;
}
.claro .dijitEditorIFrame {
background-color: #fff;
}
.claro .dijitEditor {
border: 1px solid #b5bcc7;
}
.claro .dijitEditor .dijitEditorIFrameContainer {
background-color: #fff;
background-repeat: repeat-x;
}
.claro .dijitEditorHover .dijitEditorIFrameContainer,
.claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame {
background-color: #e5f2fe;
}
.claro .dijitEditorFocused .dijitEditorIFrameContainer,
.claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame {
background-color: #fff;
}
.claro .dijitEditorHover .dijitEditorIFrameContainer,
.claro .dijitEditorFocused .dijitEditorIFrameContainer {
background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);
background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);
background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);
background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);
}
/* Disabled */
.claro .dijitEditorDisabled {
border: 1px solid #d3d3d3;
color: #818181;
}
.claro .dijitDisabled .dijitEditorIFrame,
.claro .dijitDisabled .dijitEditorIFrameContainer,
.claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame {
background-color: #efefef;
background-image: none;
}

View File

@ -1,57 +0,0 @@
/* Editor
*
* Styling Editor means styling the Editor inside iframe container (dijitEditorIFrameContainer)
*
* 1. Editor iframe container (default styling):
* .dijitEditorIFrameContainer - normal state styles: background-color, border, padding
*
* 2. hovered Editor iframe container (ie, mouse hover on editor)
* .dijitEditorHover .dijitEditorIFrameContainer/dijitEditorIFrame - styles when mouse hover on the container
*
* 3. focused Editor iframe container (ie, mouse focus on the editor pane)
* .dijitEditorFocused .dijitEditorIFrameContainer/dijitEditorIFrame - styles when container focused
*
* 3. disabled Editor iframe container
* .dijitEditorDisabled - editor's inner iframe container disable status styles: background, border
*/
@import "variables";
.claro .dijitEditorIFrameContainer{
padding:3px 3px 1px 10px;
}
.claro .dijitEditorIFrame {
background-color: @textbox-background-color;
}
.claro .dijitEditor {
border: 1px solid @border-color;
}
.claro .dijitEditor .dijitEditorIFrameContainer{
background-color: @textbox-background-color;
background-repeat:repeat-x;
}
.claro .dijitEditorHover .dijitEditorIFrameContainer,
.claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame{
background-color: @textbox-hovered-background-color;
}
.claro .dijitEditorFocused .dijitEditorIFrameContainer,
.claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame{
background-color: @textbox-focused-background-color;
}
.claro .dijitEditorHover .dijitEditorIFrameContainer,
.claro .dijitEditorFocused .dijitEditorIFrameContainer {
.textbox-background-image;
}
/* Disabled */
.claro .dijitEditorDisabled {
border: 1px solid @disabled-border-color;
color: @disabled-text-color;
}
.claro .dijitDisabled .dijitEditorIFrame,
.claro .dijitDisabled .dijitEditorIFrameContainer,
.claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame {
background-color: @textbox-disabled-background-color;
background-image: none;
}

View File

@ -1,4 +0,0 @@
/* Editor */
.claro .dijitEditorRtl .dijitEditorIFrameContainer {
padding: 3px 10px 1px 3px;
}

View File

@ -1,9 +0,0 @@
/* Editor */
@import "variables";
.claro .dijitEditorRtl .dijitEditorIFrameContainer{
padding:3px 10px 1px 3px;
}

View File

@ -1,20 +0,0 @@
/* InlineEditBox
*
* Styling InlineEditBox mainly includes:
*
* 1. Normal state
* .dijitInlineEditBoxDisplayMode - for border
*
* 2. Hover state
* .dijitInlineEditBoxDisplayModeHover - for border and background color
*/
.claro .dijitInlineEditBoxDisplayMode {
border: 1px solid transparent;
}
.claro .dijitInlineEditBoxDisplayModeHover {
background-color: #e5f2fe;
border: solid 1px #759dc0;
}
.dj_ie6 .claro .dijitInlineEditBoxDisplayMode {
border: none;
}

View File

@ -1,25 +0,0 @@
/* InlineEditBox
*
* Styling InlineEditBox mainly includes:
*
* 1. Normal state
* .dijitInlineEditBoxDisplayMode - for border
*
* 2. Hover state
* .dijitInlineEditBoxDisplayModeHover - for border and background color
*/
@import "variables";
.claro .dijitInlineEditBoxDisplayMode {
border: 1px solid transparent;
}
.claro .dijitInlineEditBoxDisplayModeHover {
background-color: @textbox-hovered-background-color;
border: solid 1px @hovered-border-color;
}
.dj_ie6 .claro .dijitInlineEditBoxDisplayMode {
border: none;
}

View File

@ -1,183 +0,0 @@
/* Menu
There are three areas of styling for the Menu:
1. The menu
There are three types of menus:
i) Context Menu
ii) Drop down Menu
iii) Navigation Menu
All three types of menus are affected by the .dijitMenu class in which you can set the background-color, padding and border
.dijitMenu affects the drop down menu in TimeTextBox, Calendar, ComboBox and FilteringSelect
.dijitMenuTable - for padding - also affects Select widget
2. The menu bar
.dijitMenuBar - for border, margins, padding, background-color of the menu bar
.dijitMenuBar .dijitMenuItem - for padding, text color of menu items in the menu bar (overrides .dijitMenuItem)
3. Menu items - items in the menu.
.dijitMenuItem - for color
.dijitMenuItemHover, .dijitMenuItemSelected - for background-color, border, text color, padding of a menu item or menubar item that has been hovered over or selected
.dijitMenuItemActive - for background-color of an active (mousedown) menu item
td.dijitMenuItemIconCell - for padding around a menu item's icon
td.dijitMenuItemLabel - for padding around a menu item's label
.dijitMenuSeparatorTop - for border, top border, of the separator
.dijitMenuSeparatorBottom - for bottom margin of the separator
Styles specific to ComboBox and FilteringSelect widgets:
.dijitComboBoxMenu .dijitMenuItem - for padding and border of a menu item in a ComboBox or FilteringSelect widget's menu
.dijitComboBoxMenu .dijitMenuItemSelected- for text color, background-color and border of a menu item in a ComboBox or FilteringSelect widget's menu
*/
.claro .dijitMenuBar {
border: 1px solid #b5bcc7;
margin: 0;
padding: 0;
background-color: #efefef;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
}
.claro .dijitMenu {
background-color: #fff;
border: 1px solid #759dc0;
/* so adjoining borders of MenuBar/ComboBox and Menu overlap, avoiding double border */
margin: -1px 0;
}
.dj_ie6 .claro .dijitMenu {
margin: 0;
/* above -1px makes top/bottom borders disappear on IE6 */
}
.claro .dijitMenuItem {
color: #000;
}
.claro .dijitMenuBar .dijitMenuItem {
padding: 6px 10px 7px;
margin: -1px;
}
.claro .dijitMenuBar .dijitMenuItemHover,
.claro .dijitMenuBar .dijitMenuItemSelected {
border: solid 1px #759dc0;
padding: 5px 9px 6px;
}
/* this prevents jiggling upon hover of a menu item */
.claro .dijitMenuTable {
border-collapse: separate;
border-spacing: 0 0;
padding: 0;
}
.claro .dijitMenuItem td {
padding: 1px;
}
/* hover over a MenuItem or MenuBarItem */
.claro .dijitSelectMenu .dijitMenuItemHover td,
.claro .dijitSelectMenu .dijitMenuItemSelected td,
.claro .dijitMenuItemHover,
.claro .dijitMenuItemSelected {
background-color: #abd6ff;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
}
.claro .dijitMenuItemActive {
background-image: url("images/activeGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%);
_background-image: none;
}
.dj_ie .claro .dijitMenuActive .dijitMenuItemHover,
.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected,
.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover,
.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected {
padding-top: 6px;
padding-bottom: 5px;
margin-top: -3px;
}
.claro td.dijitMenuItemIconCell {
padding: 2px;
margin: 0 0 0 4px;
}
.claro td.dijitMenuItemLabel {
padding-top: 5px;
padding-bottom: 5px;
}
.claro .dijitMenuExpand {
width: 7px;
height: 7px;
background-image: url("images/spriteArrows.png");
background-position: -14px 0;
margin-right: 3px;
}
.claro .dijitMenuItemDisabled .dijitMenuItemIconCell {
opacity: 1;
}
.claro .dijitMenuSeparatorTop {
height: auto;
margin-top: 1px;
/* prevents spacing above/below separator */
border-bottom: 1px solid #b5bcc7;
}
.claro .dijitMenuSeparatorBottom {
height: auto;
margin-bottom: 1px;
}
/* the checked menu item */
.claro .dijitCheckedMenuItemIconChar {
display: none;
}
.claro .dijitCheckedMenuItemIcon {
background-image: url("form/images/checkboxRadioButtonStates.png");
background-repeat: no-repeat;
background-position: -15px 50%;
width: 15px;
height: 16px;
}
.dj_ie6 .claro .dijitCheckedMenuItemIcon {
background-image: url("form/images/checkboxAndRadioButtons_IE6.png");
}
.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon {
background-position: 0 50%;
}
/*ComboBox Menu*/
.claro .dijitComboBoxMenu {
margin-left: 0;
background-image: none;
}
.claro .dijitSelectMenu .dijitMenuItem td,
.claro .dijitComboBoxMenu .dijitMenuItem {
padding: 2px;
border-width: 1px 0 1px 0;
border-style: solid;
border-color: #fff;
}
.claro .dijitSelectMenu .dijitMenuItemSelected td,
.claro .dijitComboBoxMenu .dijitMenuItemSelected {
color: #000;
border-color: #759dc0;
background-color: #abd6ff;
}
.claro .dijitSelectMenu .dijitMenuItemHover td,
.claro .dijitComboBoxMenu .dijitMenuItemHover {
color: #000000;
border-color: #769dc0;
background-color: #abd6ff;
}
.claro .dijitComboBoxMenuActive .dijitMenuItemSelected {
background-color: #7dbdfa;
/* TODO: why is this a different color than normal .dijitMenuItemSelected? */
}
.claro .dijitMenuPreviousButton,
.claro .dijitMenuNextButton {
font-style: italic;
}

View File

@ -1,179 +0,0 @@
/* Menu
There are three areas of styling for the Menu:
1. The menu
There are three types of menus:
i) Context Menu
ii) Drop down Menu
iii) Navigation Menu
All three types of menus are affected by the .dijitMenu class in which you can set the background-color, padding and border
.dijitMenu affects the drop down menu in TimeTextBox, Calendar, ComboBox and FilteringSelect
.dijitMenuTable - for padding - also affects Select widget
2. The menu bar
.dijitMenuBar - for border, margins, padding, background-color of the menu bar
.dijitMenuBar .dijitMenuItem - for padding, text color of menu items in the menu bar (overrides .dijitMenuItem)
3. Menu items - items in the menu.
.dijitMenuItem - for color
.dijitMenuItemHover, .dijitMenuItemSelected - for background-color, border, text color, padding of a menu item or menubar item that has been hovered over or selected
.dijitMenuItemActive - for background-color of an active (mousedown) menu item
td.dijitMenuItemIconCell - for padding around a menu item's icon
td.dijitMenuItemLabel - for padding around a menu item's label
.dijitMenuSeparatorTop - for border, top border, of the separator
.dijitMenuSeparatorBottom - for bottom margin of the separator
Styles specific to ComboBox and FilteringSelect widgets:
.dijitComboBoxMenu .dijitMenuItem - for padding and border of a menu item in a ComboBox or FilteringSelect widget's menu
.dijitComboBoxMenu .dijitMenuItemSelected- for text color, background-color and border of a menu item in a ComboBox or FilteringSelect widget's menu
*/
@import "variables";
.claro .dijitMenuBar {
border: 1px solid @border-color;
margin: 0;
padding: 0;
background-color: @bar-background-color;
.standard-gradient;
}
.claro .dijitMenu {
background-color:@menu-background-color;
border: 1px solid @popup-border-color;
/* so adjoining borders of MenuBar/ComboBox and Menu overlap, avoiding double border */
margin: -1px 0;
}
.dj_ie6 .claro .dijitMenu {
margin: 0; /* above -1px makes top/bottom borders disappear on IE6 */
}
.claro .dijitMenuItem {
color: @text-color;
}
.claro .dijitMenuBar .dijitMenuItem {
padding: 6px 10px 7px;
margin:-1px;
}
.claro .dijitMenuBar .dijitMenuItemHover,
.claro .dijitMenuBar .dijitMenuItemSelected {
// on hover or selection of MenuBar item, add border and reduce padding to compensate
border:solid 1px @hovered-border-color;
padding: 5px 9px 6px;
}
/* this prevents jiggling upon hover of a menu item */
.claro .dijitMenuTable {
border-collapse:separate;
border-spacing:0 0;
padding:0;
}
.claro .dijitMenuItem td{
padding:1px;
}
/* hover over a MenuItem or MenuBarItem */
.claro .dijitSelectMenu .dijitMenuItemHover td,
.claro .dijitSelectMenu .dijitMenuItemSelected td,
.claro .dijitMenuItemHover,
.claro .dijitMenuItemSelected {
// note: seems like the selected MenuItem should use @pressed-background-color
// and .active-gradient, but claro didn't to that
background-color: @hovered-background-color;
.standard-gradient;
}
.claro .dijitMenuItemActive {
// todo: seems like the selected MenuItem should come here
// todo: seems like should use @pressed-background-color
.active-gradient;
}
.dj_ie .claro .dijitMenuActive .dijitMenuItemHover,
.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected,
.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover,
.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected {
// Selectivity set to override ComboBox rules below.
// If this rule isn't present, on IE6 hovering an item in the ComboBox drop down causes two
// items to be highlighted (except when hovering the first item in the list)
padding-top: 6px;
padding-bottom: 5px;
margin-top: -3px;
}
.claro td.dijitMenuItemIconCell {
padding: 2px;
margin: 0 0 0 4px;
}
.claro td.dijitMenuItemLabel {
padding-top: 5px;
padding-bottom: 5px;
}
.claro .dijitMenuExpand {
width: 7px;
height: 7px;
background-image: url(@image-arrow-sprite);
background-position: -14px 0;
margin-right:3px;
}
.claro .dijitMenuItemDisabled .dijitMenuItemIconCell {
opacity:1;
}
.claro .dijitMenuSeparatorTop {
height: auto;
margin-top:1px; /* prevents spacing above/below separator */
border-bottom: 1px solid @border-color
}
.claro .dijitMenuSeparatorBottom{
height: auto;
margin-bottom:1px;
}
/* the checked menu item */
.claro .dijitCheckedMenuItemIconChar {
display: none;
}
.claro .dijitCheckedMenuItemIcon {
background-image: url(@image-form-checkbox-and-radios);
background-repeat:no-repeat;
background-position: -15px 50%;
width:15px;
height:16px;
}
.dj_ie6 .claro .dijitCheckedMenuItemIcon {
background-image: url(@image-form-checkbox-and-radios-ie6);
}
.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon {
background-position: 0 50%;
}
/*ComboBox Menu*/
.claro .dijitComboBoxMenu {
margin-left:0;
background-image: none;
}
.claro .dijitSelectMenu .dijitMenuItem td,
.claro .dijitComboBoxMenu .dijitMenuItem {
padding: @textbox-padding; // Make drop down menu text line up with text in <input>.
border-width:1px 0 1px 0;
border-style:solid;
border-color: @select-dropdownitem-background-color;
}
.claro .dijitSelectMenu .dijitMenuItemSelected td,
.claro .dijitComboBoxMenu .dijitMenuItemSelected {
color:@selected-text-color;
border-color:@hovered-border-color;
background-color:@hovered-background-color;
}
.claro .dijitSelectMenu .dijitMenuItemHover td,
.claro .dijitComboBoxMenu .dijitMenuItemHover {
color: #000000;
border-color: #769dc0;
background-color: #abd6ff;
}
.claro .dijitComboBoxMenuActive .dijitMenuItemSelected {
background-color: @select-dropdownitem-hovered-background-color; /* TODO: why is this a different color than normal .dijitMenuItemSelected? */
}
.claro .dijitMenuPreviousButton, .claro .dijitMenuNextButton {
font-style: italic;
}

View File

@ -1,8 +0,0 @@
.claro .dijitMenuItemRtl .dijitMenuExpand {
background-position: -7px 0;
margin-right: 0;
margin-left: 3px;
}
.claro .dijitMenuItemRtl .dijitMenuItemIcon {
margin: 0 4px 0 0;
}

View File

@ -1,11 +0,0 @@
@import "variables";
.claro .dijitMenuItemRtl .dijitMenuExpand {
background-position: -7px 0;
margin-right: 0;
margin-left: 3px;
}
.claro .dijitMenuItemRtl .dijitMenuItemIcon {
margin:0 4px 0 0;
}

View File

@ -1,66 +0,0 @@
/* ProgressBar
*
* Styling of the ProgressBar consists of the following:
*
* 1. the base progress bar
* .dijitProgressBar - sets margins for the progress bar
*
* 2. the empty bar
* .dijitProgressBarEmpty - sets background img and color for bar or parts of bar that are not finished yet
* Also sets border color for whole bar
*
* 3. tile mode
* .dijitProgressBarTile
* inner container for finished portion when in 'tile' (image) mode
*
* 4. full bar mode
* .dijitProgressBarFull
* adds border to right side of the filled portion of bar
*
* 5. text for label of bar
* .dijitProgressBarLabel - sets text color, which must contrast with both the "Empty" and "Full" parts.
*
* 6. indeterminate mode
* .dijitProgressBarIndeterminate .dijitProgressBarTile
* sets animated gif for the progress bar in 'indeterminate' mode
*/
.claro .dijitProgressBar {
margin: 2px 0 2px 0;
}
.claro .dijitProgressBarEmpty {
/* outer container and background of the bar that's not finished yet*/
background-color: #fff;
border-color: #759dc0;
}
.claro .dijitProgressBarTile {
/* inner container for finished portion when in 'tile' (image) mode */
background-color: #abd6ff;
background-image: url("images/progressBarFull.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%);
background-attachment: scroll;
}
.dj_ie6 .claro .dijitProgressBarTile {
background-image: none;
}
.claro .dijitProgressBarFull {
border-right: 1px solid #759dc0;
-webkit-transition-property: width;
-moz-transition-property: width;
transition-property: width;
-webkit-transition-duration: 0.25s;
-moz-transition-duration: 0.25s;
transition-duration: 0.25s;
}
.claro .dijitProgressBarLabel {
/* Set to a color that contrasts with both the "Empty" and "Full" parts. */
color: #000;
}
.claro .dijitProgressBarIndeterminate .dijitProgressBarTile {
/* use an animated gif for the progress bar in 'indeterminate' mode;
background-color won't appear unless user has turned off background images */
background: #efefef url("images/progressBarAnim.gif") repeat-x top;
}

View File

@ -1,64 +0,0 @@
/* ProgressBar
*
* Styling of the ProgressBar consists of the following:
*
* 1. the base progress bar
* .dijitProgressBar - sets margins for the progress bar
*
* 2. the empty bar
* .dijitProgressBarEmpty - sets background img and color for bar or parts of bar that are not finished yet
* Also sets border color for whole bar
*
* 3. tile mode
* .dijitProgressBarTile
* inner container for finished portion when in 'tile' (image) mode
*
* 4. full bar mode
* .dijitProgressBarFull
* adds border to right side of the filled portion of bar
*
* 5. text for label of bar
* .dijitProgressBarLabel - sets text color, which must contrast with both the "Empty" and "Full" parts.
*
* 6. indeterminate mode
* .dijitProgressBarIndeterminate .dijitProgressBarTile
* sets animated gif for the progress bar in 'indeterminate' mode
*/
@import "variables";
.claro .dijitProgressBar {
margin:2px 0 2px 0;
}
.claro .dijitProgressBarEmpty {
/* outer container and background of the bar that's not finished yet*/
background-color: @progressbar-empty-background-color;
border-color: @progressbar-border-color;
}
.claro .dijitProgressBarTile {
/* inner container for finished portion when in 'tile' (image) mode */
background-color: @progressbar-full-background-color;
// gradient background using CSS gradient, with fallback to image for IE
background-image: url("images/progressBarFull.png");
background-repeat: repeat-x;
.alpha-white-gradient(0.93,0px, 0.41,1px, 0.7,2px, 0,100%);
background-attachment: scroll; // override strange "fixed" setting from dijit.css
}
.dj_ie6 .claro .dijitProgressBarTile {
background-image: none;
}
.claro .dijitProgressBarFull {
border-right:1px solid @progressbar-border-color;
.transition-property(width);
.transition-duration(.25s);
}
.claro .dijitProgressBarLabel {
/* Set to a color that contrasts with both the "Empty" and "Full" parts. */
color: @progressbar-text-color;
}
.claro .dijitProgressBarIndeterminate .dijitProgressBarTile {
/* use an animated gif for the progress bar in 'indeterminate' mode;
background-color won't appear unless user has turned off background images */
background: @bar-background-color url(@image-progressbar-anim) repeat-x top;
}

View File

@ -1,11 +0,0 @@
These are "less" files that compile into the CSS of claro.
1. Install node from http://nodejs.org/#download
2. To compile all the files:
$ cd dijit/themes/claro
$ node compile.js
See http://lesscss.org/ and https://github.com/cloudhead/less.js/ for more information.

View File

@ -1,127 +0,0 @@
/* Time Picker
*
* Styling the Time Picker consists of the following:
*
* 1. minor time values
* .dijitTimePickerTick - set text color, size, background color of minor values
* .dijitTimePickerTickHover - set hover style of minor time values
* dijitTimePickerTickSelected - set selected style of minor time values
*
* 2. major time values - 1:00, 2:00, times on the hour
* set text color, size, background color, left/right margins for "zoom" affect
* .dijitTimePickerMarkerHover - to set hover style of major time values
* .dijitTimePickerMarkerSelected - set selected style of major time values
*
* 3. up and down arrow buttons
* .dijitTimePicker .dijitButtonNode - background-color, border
* .dijitTimePicker .dijitUpArrowHover, .dijitTimePicker .dijitDownArrowHover - set background-color for hover state
*
* Other classes provide the fundamental structure of the TimePicker and should not be modified.
*/
/* override Button.css */
.claro .dijitTimePicker .dijitButtonNode {
padding: 0 0;
-moz-border-radius: 0;
border-radius: 0;
}
.claro .dijitTimePicker {
border: 1px #b5bcc7 solid;
border-top: none;
border-bottom: none;
background-color: #fff;
/* TODO: useless? Appears to be overridden by settings on individual elements */
}
.claro .dijitTimePickerItem {
/* dijitTimePickerItem refers to both Tick's (minor values like 2:15, 2:30, 2:45) and Marker's (major values like 2PM, 3PM) */
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
border-top: solid 1px #b5bcc7;
border-bottom: solid 1px #b5bcc7;
margin-right: -1px;
margin-left: -1px;
margin-top: -1px;
}
.claro .dijitTimePickerTick {
/* minor value */
color: #818181;
background-color: #efefef;
font-size: 0.818em;
}
.claro .dijitTimePickerMarker {
/* major value - 1:00, 2:00, times on the hour */
background-color: #e5f2fe;
font-size: 1em;
white-space: nowrap;
}
.claro .dijitTimePickerTickHover,
.claro .dijitTimePickerMarkerHover,
.claro .dijitTimePickerMarkerSelected,
.claro .dijitTimePickerTickSelected {
background-color: #7dbdfa;
border: solid 1px #b5bcc7;
margin-left: -7px;
margin-right: -7px;
color: #000;
}
.claro .dijitTimePickerMarkerSelected,
.claro .dijitTimePickerTickSelected {
font-size: 1em;
}
.dj_ie .claro .dijitTimePickerTickHover,
.dj_ie .claro .dijitTimePickerMarkerHover,
.dj_ie .claro .dijitTimePickerMarkerSelected,
.dj_ie .claro .dijitTimePickerTickSelected {
width: 114%;
}
.dj_ie6 .claro .dijitTimePickerTickHover,
.dj_ie6 .claro .dijitTimePickerMarkerHover,
.dj_ie6 .claro .dijitTimePickerMarkerSelected,
.dj_ie6 .claro .dijitTimePickerTickSelected {
position: relative;
/* creates widening of element */
zoom: 1;
/* creates widening of element */
}
.claro .dijitTimePickerTick .dijitTimePickerItemInner {
padding: 1px;
margin: 0;
}
.claro .dijitTimePicker .dijitButtonNode {
border-left: none;
border-right: none;
border-color: #b5bcc7;
background-color: #efefef;
background-image: url("images/standardGradient.png");
background-repeat: repeat-x;
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
_background-image: none;
}
.claro .dijitTimePicker .dijitArrowButtonInner {
height: 100%;
/* hack claro.button.css */
background-image: url("form/images/commonFormArrows.png");
background-repeat: no-repeat;
background-position: -140px 45%;
}
.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner {
background-position: -35px 45%;
}
/* hover */
.claro .dijitTimePicker .dijitUpArrowHover,
.claro .dijitTimePicker .dijitDownArrowHover {
background-color: #abd6ff;
}
.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner {
background-position: -175px 45%;
}
.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner {
background-position: -70px 45%;
}

View File

@ -1,115 +0,0 @@
/* Time Picker
*
* Styling the Time Picker consists of the following:
*
* 1. minor time values
* .dijitTimePickerTick - set text color, size, background color of minor values
* .dijitTimePickerTickHover - set hover style of minor time values
* dijitTimePickerTickSelected - set selected style of minor time values
*
* 2. major time values - 1:00, 2:00, times on the hour
* set text color, size, background color, left/right margins for "zoom" affect
* .dijitTimePickerMarkerHover - to set hover style of major time values
* .dijitTimePickerMarkerSelected - set selected style of major time values
*
* 3. up and down arrow buttons
* .dijitTimePicker .dijitButtonNode - background-color, border
* .dijitTimePicker .dijitUpArrowHover, .dijitTimePicker .dijitDownArrowHover - set background-color for hover state
*
* Other classes provide the fundamental structure of the TimePicker and should not be modified.
*/
@import "variables";
/* override Button.css */
.claro .dijitTimePicker .dijitButtonNode {
padding: 0 0;
.border-radius(0);
}
.claro .dijitTimePicker{
border:1px @border-color solid;
border-top:none;
border-bottom:none;
background-color:#fff; /* TODO: useless? Appears to be overridden by settings on individual elements */
}
.claro .dijitTimePickerItem{
/* dijitTimePickerItem refers to both Tick's (minor values like 2:15, 2:30, 2:45) and Marker's (major values like 2PM, 3PM) */
.standard-gradient;
border-top:solid 1px @border-color;
border-bottom:solid 1px @border-color;
margin-right:-1px;
margin-left:-1px;
margin-top:-1px;
}
.claro .dijitTimePickerTick {
/* minor value */
color:@timepicker-minorvalue-text-color;
background-color:@timepicker-minorvalue-background-color;
font-size:0.818em;
}
.claro .dijitTimePickerMarker {
/* major value - 1:00, 2:00, times on the hour */
background-color: @timepicker-majorvalue-background-color;
font-size: 1em;
white-space: nowrap;
}
.claro .dijitTimePickerTickHover,
.claro .dijitTimePickerMarkerHover,
.claro .dijitTimePickerMarkerSelected,
.claro .dijitTimePickerTickSelected {
background-color: @timepicker-value-hovered-background-color;
border:solid 1px @border-color;
margin-left:-7px;
margin-right:-7px;
color:@timepicker-value-hovered-text-color;
}
.claro .dijitTimePickerMarkerSelected,
.claro .dijitTimePickerTickSelected {
font-size: 1em;
}
.dj_ie .claro .dijitTimePickerTickHover,
.dj_ie .claro .dijitTimePickerMarkerHover,
.dj_ie .claro .dijitTimePickerMarkerSelected,
.dj_ie .claro .dijitTimePickerTickSelected {
width: 114%;
}
.dj_ie6 .claro .dijitTimePickerTickHover,
.dj_ie6 .claro .dijitTimePickerMarkerHover,
.dj_ie6 .claro .dijitTimePickerMarkerSelected,
.dj_ie6 .claro .dijitTimePickerTickSelected {
position: relative; /* creates widening of element */
zoom: 1; /* creates widening of element */
}
.claro .dijitTimePickerTick .dijitTimePickerItemInner {
padding:1px;
margin:0;
}
.claro .dijitTimePicker .dijitButtonNode {
border-left:none;
border-right:none;
border-color:@border-color;
background-color: @unselected-background-color;
.standard-gradient;
}
.claro .dijitTimePicker .dijitArrowButtonInner{
height: 100%; /* hack claro.button.css */
background-image: url(@image-form-common-arrows);
background-repeat: no-repeat;
background-position:-140px 45%;
}
.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner{
background-position:-35px 45%;
}
/* hover */
.claro .dijitTimePicker .dijitUpArrowHover,
.claro .dijitTimePicker .dijitDownArrowHover {
background-color: @timepicker-arrow-hovered-background-color;
}
.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner {
background-position:-175px 45%;
}
.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner {
background-position:-70px 45%;
}
// TODO: should have active rule, for clicking a .dijitTimePickerItem

View File

@ -1,9 +0,0 @@
/* TimePicker */
.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover,
.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover,
.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected,
.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected {
margin-left: -6px;
margin-right: -8px;
width: 114%;
}

Some files were not shown because too many files have changed in this diff Show More