[Libreoffice-commits] online.git: 5 commits - loleaflet/build loleaflet/dist loleaflet/.gitignore loleaflet/src
Pranav Kant
pranavk at collabora.com
Fri Mar 25 12:55:09 UTC 2016
loleaflet/.gitignore | 1
loleaflet/build/deps.js | 8
loleaflet/dist/admin/admin-src.js | 710 --------------------------
loleaflet/dist/toolbar/toolbar.js | 66 +-
loleaflet/src/admin/AdminSocketAnalytics.js | 1
loleaflet/src/admin/AdminSocketBase.js | 2
loleaflet/src/admin/AdminSocketOverview.js | 1
loleaflet/src/admin/AdminSocketSettings.js | 1
loleaflet/src/admin/Util.js | 1
loleaflet/src/control/Control.ColumnHeader.js | 2
loleaflet/src/control/Control.RowHeader.js | 2
loleaflet/src/control/Control.Styles.js | 305 -----------
loleaflet/src/control/Styles.js | 301 +++++++++++
13 files changed, 380 insertions(+), 1021 deletions(-)
New commits:
commit 18e1f2f8e7b732bb599045bac4b3428a8669bb7f
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Mar 25 18:19:52 2016 +0530
loleaflet: Do not track built admin-src.js
Also delete the admin-src from there. It is not supposed to be
under git. This is generated during make from all the files in
src/admin
Change-Id: Ib1c8b637c40bf7bec7924a9582262f50fb093e47
diff --git a/loleaflet/.gitignore b/loleaflet/.gitignore
index cbfb08b..1423824 100644
--- a/loleaflet/.gitignore
+++ b/loleaflet/.gitignore
@@ -10,6 +10,7 @@ component.json
_site
dist/*.js
+dist/admin/*.js
plugins/draw-0.2.4/dist/*.js
coverage/
/load_test_out
diff --git a/loleaflet/dist/admin/admin-src.js b/loleaflet/dist/admin/admin-src.js
deleted file mode 100644
index 26de51f..0000000
--- a/loleaflet/dist/admin/admin-src.js
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- Base.js, version 1.1a
- Copyright 2006-2010, Dean Edwards
- License: http://www.opensource.org/licenses/mit-license.php
-*/
-
-var Base = function() {
- // dummy
-};
-
-Base.extend = function(_instance, _static) { // subclass
- var extend = Base.prototype.extend;
-
- // build the prototype
- Base._prototyping = true;
- var proto = new this;
- extend.call(proto, _instance);
- proto.base = function() {
- // call this method from any other method to invoke that method's ancestor
- };
- delete Base._prototyping;
-
- // create the wrapper for the constructor function
- //var constructor = proto.constructor.valueOf(); //-dean
- var constructor = proto.constructor;
- var klass = proto.constructor = function() {
- if (!Base._prototyping) {
- if (this._constructing || this.constructor == klass) { // instantiation
- this._constructing = true;
- constructor.apply(this, arguments);
- delete this._constructing;
- } else if (arguments[0] != null) { // casting
- return (arguments[0].extend || extend).call(arguments[0], proto);
- }
- }
- };
-
- // build the class interface
- klass.ancestor = this;
- klass.extend = this.extend;
- klass.forEach = this.forEach;
- klass.implement = this.implement;
- klass.prototype = proto;
- klass.toString = this.toString;
- klass.valueOf = function(type) {
- //return (type == "object") ? klass : constructor; //-dean
- return (type == "object") ? klass : constructor.valueOf();
- };
- extend.call(klass, _static);
- // class initialisation
- if (typeof klass.init == "function") klass.init();
- return klass;
-};
-
-Base.prototype = {
- extend: function(source, value) {
- if (arguments.length > 1) { // extending with a name/value pair
- var ancestor = this[source];
- if (ancestor && (typeof value == "function") && // overriding a method?
- // the valueOf() comparison is to avoid circular references
- (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) &&
- /\bbase\b/.test(value)) {
- // get the underlying method
- var method = value.valueOf();
- // override
- value = function() {
- var previous = this.base || Base.prototype.base;
- this.base = ancestor;
- var returnValue = method.apply(this, arguments);
- this.base = previous;
- return returnValue;
- };
- // point to the underlying method
- value.valueOf = function(type) {
- return (type == "object") ? value : method;
- };
- value.toString = Base.toString;
- }
- this[source] = value;
- } else if (source) { // extending with an object literal
- var extend = Base.prototype.extend;
- // if this object has a customised extend method then use it
- if (!Base._prototyping && typeof this != "function") {
- extend = this.extend || extend;
- }
- var proto = {toSource: null};
- // do the "toString" and other methods manually
- var hidden = ["constructor", "toString", "valueOf"];
- // if we are prototyping then include the constructor
- var i = Base._prototyping ? 0 : 1;
- while (key = hidden[i++]) {
- if (source[key] != proto[key]) {
- extend.call(this, key, source[key]);
-
- }
- }
- // copy each of the source object's properties to this object
- for (var key in source) {
- if (!proto[key]) extend.call(this, key, source[key]);
- }
- }
- return this;
- }
-};
-
-// initialise
-Base = Base.extend({
- constructor: function() {
- this.extend(arguments[0]);
- }
-}, {
- ancestor: Object,
- version: "1.1",
-
- forEach: function(object, block, context) {
- for (var key in object) {
- if (this.prototype[key] === undefined) {
- block.call(context, object[key], key, object);
- }
- }
- },
-
- implement: function() {
- for (var i = 0; i < arguments.length; i++) {
- if (typeof arguments[i] == "function") {
- // if it's a function, call it
- arguments[i](this.prototype);
- } else {
- // add the interface using the extend method
- this.prototype.extend(arguments[i]);
- }
- }
- return this;
- },
-
- toString: function() {
- return String(this.valueOf());
- }
-});
-
-
-
-/*
- Utility class
-*/
-/* global Base */
-var Util = Base.extend({
- constructor: null
-
-}, { // class itnerface
-
- humanize: function humanFileSize(kbytes) {
- var unit = 1000;
- var units = ['kB', 'MB', 'GB', 'TB'];
- for (var i = 0; Math.abs(kbytes) >= unit && i < units.length; i++) {
- kbytes /= unit;
- }
-
- return kbytes.toFixed(1) + ' ' + units[i];
- }
-});
-
-
-/*
- Abstract class
-*/
-
-/* global vex Base */
-/* exported AdminSocketBase */
-var AdminSocketBase = Base.extend({
- socket: null,
-
- constructor: function(host) {
- // because i am abstract
- if (this.constructor === AdminSocketBase) {
- throw new Error('Cannot instantiate abstract class');
- }
-
- // We do not allow such child class to instantiate websocket that do not implement
- // onSocketMessage and onSocketOpen.
- if (typeof this.onSocketMessage === 'function' && typeof this.onSocketOpen === 'function') {
- this.socket = new WebSocket(host);
- this.socket.onopen = this.onSocketOpen.bind(this);
- this.socket.onclose = this.onSocketClose.bind(this);
- this.socket.onmessage = this.onSocketMessage.bind(this);
- this.socket.onerror = this.onSocketError.bind(this);
- this.socket.binaryType = 'arraybuffer';
- }
- },
-
- onSocketOpen: function() {
- /* Implemented by child */
- },
-
- onSocketMessage: function() {
- /* Implemented by child */
- },
-
- onSocketClose: function() {
- this.socket.onerror = function() {};
- this.socket.onclose = function() {};
- this.socket.onmessage = function() {};
- this.socket.close();
- },
-
- onSocketError: function() {
- vex.dialog.alert('Connection error');
- }
-});
-
-
-/*
- Socket to be intialized on opening the overview page in Admin console
-*/
-/* global vex $ Util AdminSocketBase */
-var AdminSocketOverview = AdminSocketBase.extend({
- constructor: function(host) {
- this.base(host);
- },
-
- _basicStatsIntervalId: 0,
-
- _getBasicStats: function() {
- this.socket.send('total_mem');
- this.socket.send('active_docs_count');
- this.socket.send('active_users_count');
- },
-
- onSocketOpen: function() {
- this.socket.send('documents');
- this.socket.send('subscribe document addview rmview rmdoc');
-
- this._getBasicStats();
- var socketOverview = this;
- this._basicStatsIntervalId =
- setInterval(function() {
- return socketOverview._getBasicStats();
- }, 5000);
-
- // Allow table rows to have a context menu for killing children
- $('body').on('contextmenu', 'table tr', function(ev) {
- $('#rowContextMenu').css({
- display: 'block',
- left: ev.pageX,
- top: ev.pageY
- })
- .data('rowToKill', ev.target.parentElement.id);
-
- return false;
- })
- .click(function() {
- $('#rowContextMenu').hide();
- });
-
- $('#rowContextMenu').on('click', 'a', function() {
- vex.dialog.confirm({
- message: 'Are you sure you want to kill this child ?',
- callback: function(value) {
- if (value) {
- var killPid = ($('#rowContextMenu').data('rowToKill')).substring('doc'.length);
- socketOverview.socket.send('kill ' + killPid);
- }
- $('#rowContextMenu').hide();
- }
- });
- });
- },
-
- onSocketMessage: function(e) {
- var textMsg;
- if (typeof e.data === 'string') {
- textMsg = e.data;
- }
- else {
- textMsg = '';
- }
-
- var tableContainer = document.getElementById('doclist');
- var rowContainer;
- var pidEle, urlEle, viewsEle, memEle, docEle;
- var nViews, nTotalViews;
- var docProps, sPid, sUrl, sViews, sMem;
- if (textMsg.startsWith('documents')) {
- var documents = textMsg.substring('documents'.length);
- documents = documents.trim().split('\n');
- for (var i = 0; i < documents.length; i++) {
- if (documents[i] === '') {
- continue;
- }
- docProps = documents[i].trim().split(' ');
- sPid = docProps[0];
- sUrl = docProps[1];
- sViews = docProps[2];
- sMem = docProps[3];
- if (sUrl === '0') {
- continue;
- }
- rowContainer = document.createElement('tr');
- rowContainer.id = 'doc' + sPid;
- tableContainer.appendChild(rowContainer);
-
- pidEle = document.createElement('td');
- pidEle.innerHTML = sPid;
- rowContainer.appendChild(pidEle);
-
- urlEle = document.createElement('td');
- urlEle.innerHTML = sUrl;
- rowContainer.appendChild(urlEle);
-
- viewsEle = document.createElement('td');
- viewsEle.id = 'docview' + sPid;
- viewsEle.innerHTML = sViews;
- rowContainer.appendChild(viewsEle);
-
- memEle = document.createElement('td');
- memEle.innerHTML = Util.humanize(parseInt(sMem));
- rowContainer.appendChild(memEle);
- }
- }
- else if (textMsg.startsWith('addview')) {
- sPid = textMsg.substring('addview'.length).trim().split(' ')[0];
- nViews = parseInt(document.getElementById('docview' + sPid).innerHTML);
- document.getElementById('docview' + sPid).innerHTML = nViews + 1;
- nTotalViews = parseInt(document.getElementById('active_users_count').innerHTML);
- document.getElementById('active_users_count').innerHTML = nTotalViews + 1;
- }
- else if (textMsg.startsWith('rmview')) {
- sPid = textMsg.substring('addview'.length).trim().split(' ')[0];
- nViews = parseInt(document.getElementById('docview' + sPid).innerHTML);
- document.getElementById('docview' + sPid).innerHTML = nViews - 1;
- nTotalViews = parseInt(document.getElementById('active_users_count').innerHTML);
- document.getElementById('active_users_count').innerHTML = nTotalViews - 1;
- }
- else if (textMsg.startsWith('document')) {
- textMsg = textMsg.substring('document'.length);
- docProps = textMsg.trim().split(' ');
- sPid = docProps[0];
- sUrl = docProps[1];
- sMem = docProps[2];
-
- docEle = document.getElementById('doc' + sPid);
- if (docEle) {
- tableContainer.removeChild(docEle);
- }
- if (sUrl === '0') {
- return;
- }
-
- rowContainer = document.createElement('tr');
- rowContainer.id = 'doc' + docProps[0];
- tableContainer.appendChild(rowContainer);
-
- pidEle = document.createElement('td');
- pidEle.innerHTML = docProps[0];
- rowContainer.appendChild(pidEle);
-
- urlEle = document.createElement('td');
- urlEle.innerHTML = docProps[1];
- rowContainer.appendChild(urlEle);
-
- viewsEle = document.createElement('td');
- viewsEle.innerHTML = 0;
- viewsEle.id = 'docview' + docProps[0];
- rowContainer.appendChild(viewsEle);
-
- memEle = document.createElement('td');
- memEle.innerHTML = Util.humanize(parseInt(sMem));
- rowContainer.appendChild(memEle);
-
- var totalUsersEle = document.getElementById('active_docs_count');
- totalUsersEle.innerHTML = parseInt(totalUsersEle.innerHTML) + 1;
- }
- else if (textMsg.startsWith('total_mem') ||
- textMsg.startsWith('active_docs_count') ||
- textMsg.startsWith('active_users_count'))
- {
- textMsg = textMsg.split(' ');
- var sCommand = textMsg[0];
- var nData = parseInt(textMsg[1]);
-
- if (sCommand === 'total_mem') {
- nData = Util.humanize(nData);
- }
- document.getElementById(sCommand).innerHTML = nData;
- }
- else if (textMsg.startsWith('rmdoc')) {
- textMsg = textMsg.substring('rmdoc'.length);
- docProps = textMsg.trim().split(' ');
- sPid = docProps[0];
- docEle = document.getElementById('doc' + sPid);
- if (docEle) {
- tableContainer.removeChild(docEle);
- }
- }
- },
-
- onSocketClose: function() {
- clearInterval(this._basicStatsIntervalId);
- }
-});
-
-
-/*
- Socket to be intialized on opening the analytics page in Admin console
- containing various graphs to show to the user on specified interval
-*/
-
-/* global d3 Util AdminSocketBase */
-var AdminSocketAnalytics = AdminSocketBase.extend({
- constructor: function(host) {
- this.base(host);
- },
-
- _memStatsData: [],
- _cpuStatsData: [],
-
- _memStatsSize: 0,
- _memStatsInterval: 0,
-
- _cpuStatsSize: 0,
- _cpuStatsInterval: 0,
-
- _initMemStatsData: function(memStatsSize, memStatsInterval, reset) {
- if (reset) {
- this._memStatsData = [];
- }
-
- var offset = this._memStatsData.length * memStatsInterval;
- for (var i = 0; i < memStatsSize; i++) {
- this._memStatsData.unshift({time: -(offset), value: 0});
- offset += memStatsInterval;
- }
- },
-
- _initCpuStatsData: function() {
- for (var i = 0; i < this._cpuStatsSize; i++) {
- this._cpuStatsData.push({time: -((this._cpuStatsSize - i - 1) * this._cpuStatsInterval), value: 0});
- }
- },
-
- onSocketOpen: function() {
- this.socket.send('subscribe mem_stats cpu_stats settings');
- this.socket.send('settings');
- this.socket.send('mem_stats');
- },
-
- _createMemData: function() {
- for (var i = this._memStatsRawData.length - 1, j = this._memStatsData.length - 1; i >= 0 && j >= 0; i--, j--) {
- this._memStatsData[j].value = parseInt(this._memStatsRawData[i]);
- }
- },
-
- _d3xAxis: null,
- _d3yAxis: null,
- _d3line: null,
- _xScale: null,
- _yScale: null,
-
- _graphWidth: 1000,
- _graphHeight: 500,
- _graphMargins: {
- top: 20,
- right: 20,
- bottom: 20,
- left: 100
- },
-
- _setUpAxis: function() {
- this._xScale = d3.scale.linear().range([this._graphMargins.left, this._graphWidth - this._graphMargins.right]).domain([d3.min(this._memStatsData, function(d) {
- return d.time;
- }), d3.max(this._memStatsData, function(d) {
- return d.time;
- })]);
-
-
- this._yScale = d3.scale.linear().range([this._graphHeight - this._graphMargins.bottom, this._graphMargins.top]).domain([d3.min(this._memStatsData, function(d) {
- return d.value;
- }), d3.max(this._memStatsData, function(d) {
- return d.value;
- })]);
-
- this._d3xAxis = d3.svg.axis()
- .scale(this._xScale)
- .tickFormat(function(d) {
- d = Math.abs(d / 1000);
- var units = ['s', 'min', 'hr'];
- for (var i = 0; i < units.length && Math.abs(d) >= 60; i++) {
- d = parseInt(d / 60);
- }
- return parseInt(d) + units[i] + ' ago';
- });
-
- this._d3yAxis = d3.svg.axis()
- .scale(this._yScale)
- .tickFormat(function (d) {
- return Util.humanize(d);
- })
- .orient('left');
-
- var xScale = this._xScale;
- var yScale = this._yScale;
-
- this._d3line = d3.svg.line()
- .x(function(d) {
- return xScale(d.time);
- })
- .y(function(d) {
- return yScale(d.value);
- });
- },
-
- _createMemGraph: function() {
- var vis = d3.select('#visualisation');
-
- this._setUpAxis();
-
- vis.append('svg:g')
- .attr('class', 'x-axis')
- .attr('transform', 'translate(0,' + (this._graphHeight - this._graphMargins.bottom) + ')')
- .call(this._d3xAxis);
-
- vis.append('svg:g')
- .attr('class', 'y-axis')
- .attr('transform', 'translate(' + this._graphMargins.left + ',0)')
- .call(this._d3yAxis);
-
- vis.append('svg:path')
- .attr('d', this._d3line(this._memStatsData))
- .attr('class', 'line')
- .attr('stroke', 'blue')
- .attr('stroke-width', 2)
- .attr('fill', 'none');
- },
-
- _addNewMemData: function(data) {
- // make a space for new data
- for (var i = this._memStatsData.length - 1; i > 0; i--) {
- this._memStatsData[i].time = this._memStatsData[i - 1].time;
- }
-
- // push new data at time '0'
- this._memStatsData.push({time: 0, value: parseInt(data)});
-
- // remove extra items
- if (this._memStatsData.length > this._memStatsSize) {
- this._memStatsData.shift();
- }
- },
-
- _updateMemGraph: function() {
- var svg = d3.select('#visualisation');
-
- this._setUpAxis();
-
- svg.select('.line')
- .attr('d', this._d3line(this._memStatsData));
-
- svg.select('.x-axis')
- .call(this._d3xAxis);
-
- svg.select('.y-axis')
- .call(this._d3yAxis);
- },
-
- onSocketMessage: function(e) {
- var textMsg;
- if (typeof e.data === 'string') {
- textMsg = e.data;
- }
- else {
- textMsg = '';
- }
-
-
- if (textMsg.startsWith('settings')) {
- textMsg = textMsg.substring('settings '.length);
- textMsg = textMsg.split(' ');
-
- //TODO: Add CPU statistics
- var memStatsSize, memStatsInterval, cpuStatsSize, cpuStatsInterval;
- var i, j, data;
- memStatsSize = this._memStatsSize;
- memStatsInterval = this._memStatsInterval;
- cpuStatsSize = this._cpuStatsSize;
- cpuStatsInterval = this._cpuStatsInterval;
- for (i = 0; i < textMsg.length; i++) {
- var setting = textMsg[i].split('=');
- if (setting[0] === 'mem_stats_size') {
- memStatsSize = parseInt(setting[1]);
- }
- else if (setting[0] === 'mem_stats_interval') {
- memStatsInterval = parseInt(setting[1]);
- }
- else if (setting[0] === 'cpu_stats_size') {
- cpuStatsSize = parseInt(setting[1]);
- }
- else if (setting[0] === 'cpu_stats_interval') {
- cpuStatsInterval = parseInt(setting[1]);
- }
- }
-
- // Fix the axes according to changed data
- if (memStatsInterval !== this._memStatsInterval) {
- // We can possibly reuse the data with a bit of work
- this._initMemStatsData(memStatsSize, memStatsInterval, true);
- }
- else if (memStatsSize > this._memStatsSize) {
- this._initMemStatsData(memStatsSize - this._memStatsSize, memStatsInterval, false);
- }
- else {
- // just strip the extra items
- for (i = 0; i < this._memStatsSize - memStatsSize; i++) {
- this._memStatsData.shift();
- }
- }
-
- this._memStatsSize = memStatsSize;
- this._memStatsInterval = memStatsInterval;
- this._cpuStatsSize = cpuStatsSize;
- this._cpuStatsInterval = cpuStatsInterval;
- }
- else if (textMsg.startsWith('mem_stats') ||
- textMsg.startsWith('cpu_stats')) {
- textMsg = textMsg.split(' ')[1];
- if (textMsg.endsWith(',')) {
- // This is the result of query, not notification
- data = textMsg.substring(0, textMsg.length - 1).split(',');
- for (i = this._memStatsData.length - 1, j = data.length - 1; i >= 0 && j >= 0; i--, j--) {
- this._memStatsData[i].value = parseInt(data[j]);
- }
-
- //this._createMemData(data);
- this._createMemGraph();
- }
- else {
- // this is a notification data; append to _memStatsData
- data = textMsg.trim();
- this._addNewMemData(data);
- this._updateMemGraph();
- }
- }
- },
-
- onSocketClose: function() {
- clearInterval(this._basicStatsIntervalId);
- }
-});
-
-
-/*
- Socket to be intialized on opening the settings page in Admin console
-*/
-/* global $ AdminSocketBase */
-var AdminSocketSettings = AdminSocketBase.extend({
- constructor: function(host) {
- this.base(host);
- this._init();
- },
-
- _init: function() {
- var socketSettings = this.socket;
- $(document).ready(function() {
- $('#admin_settings').on('submit', function(e) {
- e.preventDefault();
- var memStatsSize = $('#mem_stats_size').val();
- var memStatsInterval = $('#mem_stats_interval').val();
- var cpuStatsSize = $('#cpu_stats_size').val();
- var cpuStatsInterval = $('#cpu_stats_interval').val();
- var command = 'set';
- command += ' mem_stats_size=' + memStatsSize;
- command += ' mem_stats_interval=' + memStatsInterval;
- command += ' cpu_stats_size=' + cpuStatsSize;
- command += ' cpu_stats_interval=' + cpuStatsInterval;
- socketSettings.send(command);
- });
- });
- },
-
- onSocketOpen: function() {
- this.socket.send('subscribe settings');
- this.socket.send('settings');
- },
-
- onSocketMessage: function(e) {
- var textMsg;
- if (typeof e.data === 'string') {
- textMsg = e.data;
- }
- else {
- textMsg = '';
- }
-
- if (textMsg.startsWith('settings')) {
- textMsg = textMsg.substring('settings '.length);
- var settings = textMsg.split(' ');
- for (var i = 0; i < settings.length; i++) {
- var setting = settings[i].split('=');
- var settingKey = setting[0];
- var settingVal = setting[1];
- document.getElementById(settingKey).value = settingVal;
- }
- }
- },
-
- onSocketClose: function() {
- clearInterval(this._basicStatsIntervalId);
- }
-});
-
-
commit bc64cae93e8f1c10f29703f46cf993f656e13444
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Mar 25 17:40:41 2016 +0530
loleaflet: eslint no-unused-vars:0 for exported items
These are exported objects which lint complains about.
/* eslint exported */ doesn't seem to work well here.
Change-Id: I2b55d1ddeca84a89b72b3bcc05be22f078563456
diff --git a/loleaflet/src/admin/AdminSocketAnalytics.js b/loleaflet/src/admin/AdminSocketAnalytics.js
index 2f34b76..fa25324 100644
--- a/loleaflet/src/admin/AdminSocketAnalytics.js
+++ b/loleaflet/src/admin/AdminSocketAnalytics.js
@@ -4,6 +4,7 @@
*/
/* global d3 Util AdminSocketBase */
+/* eslint no-unused-vars:0 */
var AdminSocketAnalytics = AdminSocketBase.extend({
constructor: function(host) {
this.base(host);
diff --git a/loleaflet/src/admin/AdminSocketBase.js b/loleaflet/src/admin/AdminSocketBase.js
index c0216d0..a18fa4d 100644
--- a/loleaflet/src/admin/AdminSocketBase.js
+++ b/loleaflet/src/admin/AdminSocketBase.js
@@ -3,7 +3,7 @@
*/
/* global vex Base */
-/* exported AdminSocketBase */
+/* eslint no-unused-vars:0 */
var AdminSocketBase = Base.extend({
socket: null,
diff --git a/loleaflet/src/admin/AdminSocketOverview.js b/loleaflet/src/admin/AdminSocketOverview.js
index ea62e55..28b83fb 100644
--- a/loleaflet/src/admin/AdminSocketOverview.js
+++ b/loleaflet/src/admin/AdminSocketOverview.js
@@ -2,6 +2,7 @@
Socket to be intialized on opening the overview page in Admin console
*/
/* global vex $ Util AdminSocketBase */
+/* eslint no-unused-vars:0 */
var AdminSocketOverview = AdminSocketBase.extend({
constructor: function(host) {
this.base(host);
diff --git a/loleaflet/src/admin/AdminSocketSettings.js b/loleaflet/src/admin/AdminSocketSettings.js
index 070cd69..241150f 100644
--- a/loleaflet/src/admin/AdminSocketSettings.js
+++ b/loleaflet/src/admin/AdminSocketSettings.js
@@ -2,6 +2,7 @@
Socket to be intialized on opening the settings page in Admin console
*/
/* global $ AdminSocketBase */
+/* eslint no-unused-vars:0 */
var AdminSocketSettings = AdminSocketBase.extend({
constructor: function(host) {
this.base(host);
diff --git a/loleaflet/src/admin/Util.js b/loleaflet/src/admin/Util.js
index a409328..61db108 100644
--- a/loleaflet/src/admin/Util.js
+++ b/loleaflet/src/admin/Util.js
@@ -2,6 +2,7 @@
Utility class
*/
/* global Base */
+/* eslint no-unused-vars:0 */
var Util = Base.extend({
constructor: null
commit 1c452c9c6c877cd8eb6ae3f5b22af825f0b65749
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Mar 25 17:28:16 2016 +0530
loleaflet: fix lint errors
Change-Id: Idc363f92f065f405a764b472d30faa090e0b791b
diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index 9a0cd16..d464e90 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -2,7 +2,7 @@
* Control.ColumnHeader
*/
-/* global $ */
+/* global */
L.Control.ColumnHeader = L.Control.extend({
onAdd: function (map) {
map.on('updatepermission', this._onUpdatePermission, this);
diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js
index fff931a..a99dac5 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -2,7 +2,7 @@
* L.Control.RowHeader
*/
-/* global $ */
+/* global */
L.Control.RowHeader = L.Control.extend({
onAdd: function (map) {
map.on('updatepermission', this._onUpdatePermission, this);
diff --git a/loleaflet/src/control/Styles.js b/loleaflet/src/control/Styles.js
index 3b5ebf1..124d652 100644
--- a/loleaflet/src/control/Styles.js
+++ b/loleaflet/src/control/Styles.js
@@ -3,6 +3,7 @@
*/
L.Styles = {
+ /* eslint no-dupe-keys:0 */
// Programming names -> UI names mapping
styleMappings: {
'Default':'Default',
commit c013b407353c5860530db71d8d99e86138272b3f
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Mar 25 17:21:35 2016 +0530
loleaflet: Fix 'Outline' styles in impress
Change-Id: I1815dcfae7d7b0c107357d13a6dbe70a7d9ef4bc
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 0b513a8..5f1da68 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -607,7 +607,7 @@ map.on('commandstatechanged', function (e) {
$(".styles-select option").each(function () {
value = this.value;
- // Sometimes we get UI names; ideally we should be getting only programmatic ones
+ // For writer we get UI names; ideally we should be getting only programmatic ones
// For eg: 'Text body' vs 'Text Body'
// (likely to be fixed in core to make the pattern consistent)
if (value.toLowerCase() === state.toLowerCase()) {
diff --git a/loleaflet/src/control/Control.Styles.js b/loleaflet/src/control/Control.Styles.js
index 393fede..7ce6fca 100644
--- a/loleaflet/src/control/Control.Styles.js
+++ b/loleaflet/src/control/Control.Styles.js
@@ -79,9 +79,9 @@ L.Control.Styles = L.Control.extend({
var item = L.DomUtil.create('option', '', container);
item.value = style;
var localeStyle;
- if (style.startsWith('Outline')) {
- var outlineLevel = style.split('Outline')[1];
- localeStyle = 'Outline'.toLocaleString() + outlineLevel;
+ if (style.startsWith('outline')) {
+ var outlineLevel = style.split('outline')[1];
+ localeStyle = 'Outline'.toLocaleString() + ' ' + outlineLevel;
} else {
localeStyle = L.Styles.styleMappings[style].toLocaleString();
}
@@ -132,10 +132,10 @@ L.Control.Styles = L.Control.extend({
if (e.commandName === '.uno:StyleApply') {
for (var i = 0; i < this._container.length; i++) {
var value = this._container[i].value;
- var innerHTML = this._container[i].innerHTML;
- // For writer, we get UI names, but for others we seem to get internal names
- // (likely to be fixed in core to keep it consistent)
- if (value === e.state || innerHTML === e.state) {
+ // For writer we get UI names; ideally we should be getting only programmatic ones
+ // For eg: 'Text body' vs 'Text Body'
+ // (likely to be fixed in core to make the pattern consistent)
+ if (value.toLowerCase() === e.state.toLowerCase()) {
this._container.value = value;
return;
}
commit 32e24dcab3b45469d05d011de9d3e2a29986a589
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Mar 25 17:16:42 2016 +0530
loleaflet: Make style l10n work in new toolbar
Please note that this is just a workaround because there is no
consistent pattern between LO sending us programmatic, UI names.
During the initial command value event, we get programmatic names
from it. During the state change event, we get UI names for
Writer, but programmatic ones for others.
Change-Id: I7e69e1d437b22a34e54d2026b76e81951c4cc601
diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js
index b525cbf..9f0131f 100644
--- a/loleaflet/build/deps.js
+++ b/loleaflet/build/deps.js
@@ -281,7 +281,7 @@ var deps = {
heading: 'Controls',
desc: 'Parts preview sidebar'
},
-
+
ControlPresentation: {
src: ['control/Control.js',
'control/Control.Presentation.js'],
@@ -355,6 +355,7 @@ var deps = {
ControlStyles: {
src: ['control/Control.js',
'control/Control.Styles.js'],
+ deps: ['Styles'],
heading: 'Controls',
desc: 'Handles styles selection'
},
@@ -416,6 +417,11 @@ var deps = {
desc: 'Scroll handler.'
},
+ Styles: {
+ src: ['control/Styles.js'],
+ desc: 'Contains LibreOffice programmatic to UI name style mappings'
+ },
+
AnimationPan: {
src: [
'dom/DomEvent.js',
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 53c620d..0b513a8 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -595,11 +595,21 @@ map.on('commandstatechanged', function (e) {
var state = e.state;
var found = false;
if (commandName === '.uno:StyleApply') {
- if (map.getDocType() === 'presentation' || map.getDocType() === 'drawing')
+ if (!state)
return;
- // Fix 'Text Body' vs 'Text body'
+
+ // For impress documents, template name is prefixed with style name.
+ // Strip the template name until we support it
+ if (map.getDocType() === 'presentation') {
+ state = state.split('~LT~')[1];
+ state = L.Styles.impressMapping[state];
+ }
+
$(".styles-select option").each(function () {
value = this.value;
+ // Sometimes we get UI names; ideally we should be getting only programmatic ones
+ // For eg: 'Text body' vs 'Text Body'
+ // (likely to be fixed in core to make the pattern consistent)
if (value.toLowerCase() === state.toLowerCase()) {
state = value;
found = true;
@@ -612,7 +622,7 @@ map.on('commandstatechanged', function (e) {
.append($("<option></option>")
.text(state));
}
- $(".styles-select").val(state).trigger('change');
+ $(".styles-select").val(state).trigger('change');
}
else if (commandName === '.uno:CharFontName') {
$(".fonts-select option").each(function () {
@@ -629,7 +639,7 @@ map.on('commandstatechanged', function (e) {
.append($("<option></option>")
.text(state));
}
- $(".fonts-select").val(state).trigger('change');
+ $(".fonts-select").val(state).trigger('change');
}
else if (commandName === '.uno:FontHeight') {
if (state === '0') {
@@ -711,26 +721,57 @@ map.on('search', function (e) {
map.on('updatetoolbarcommandvalues', function (e) {
// we need an empty option for the place holder to work
- var data = [''];
+ var data = [{text: ''}];
+ var styles = [];
+ var topStyles = [];
if (e.commandName === '.uno:StyleApply') {
var commands = e.commandValues.Commands;
if (commands && commands.length > 0) {
- data = data.concat(commands);
// Inserts a separator element
data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
+
+ commands.forEach(function (command) {
+ data = data.concat({id: command.id, text: L.Styles.styleMappings[command.text].toLocaleString()});
+ }, this);
}
+
if (map.getDocType() === 'text') {
- data = data.concat(e.commandValues.ParagraphStyles);
- $('.styles-select').prop('disabled', false);
+ styles = e.commandValues.ParagraphStyles.slice(7, 19);
+ topStyles = e.commandValues.ParagraphStyles.slice(0, 7);
}
else if (map.getDocType() === 'spreadsheet') {
- data = data.concat(e.commandValues.CellStyles);
- $('.styles-select').prop('disabled', false);
+ styles = e.commandValues.CellStyles;
}
else if (map.getDocType() === 'presentation' || map.getDocType() === 'drawing') {
- data = data.concat(e.commandValues.Default);
- $('.styles-select').prop('disabled', true);
+ styles = e.commandValues.Default;
}
+
+ if (topStyles.length > 0) {
+ // Inserts a separator element
+ data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
+
+ topStyles.forEach(function (style) {
+ data = data.concat({id: style, text: L.Styles.styleMappings[style].toLocaleString()});
+ }, this);
+ }
+
+ if (styles.length > 0) {
+ // Inserts a separator element
+ data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
+
+ styles.forEach(function (style) {
+ var localeStyle;
+ if (style.startsWith('outline')) {
+ var outlineLevel = style.split('outline')[1];
+ localeStyle = 'Outline'.toLocaleString() + ' ' + outlineLevel;
+ } else {
+ localeStyle = L.Styles.styleMappings[style].toLocaleString();
+ }
+
+ data = data.concat({id: style, text: localeStyle});
+ }, this);
+ }
+
$(".styles-select").select2({
data: data,
placeholder: _("Style")
@@ -863,4 +904,3 @@ function resizeToolbar() {
toolbar.uncheck('more');
}
}
-
diff --git a/loleaflet/src/control/Control.Styles.js b/loleaflet/src/control/Control.Styles.js
index 9797a78..393fede 100644
--- a/loleaflet/src/control/Control.Styles.js
+++ b/loleaflet/src/control/Control.Styles.js
@@ -7,281 +7,6 @@ L.Control.Styles = L.Control.extend({
info: '- Styles -'
},
- // Programming names -> UI names mapping
- styleMappings: {
- "Default":"Default",
- "Result":"Result",
- "Result2":"Result2",
- "Heading":"Heading",
- "Heading1":"Heading1",
- "Default":"Default",
- "Report":"Report",
- "standard":"Default",
- "objectwitharrow":"Object with arrow",
- "objectwithshadow":"Object with shadow",
- "objectwithoutfill":"Object without fill",
- "Object with no fill and no line":"Object with no fill and no line",
- "text":"Text",
- "textbody":"Text body",
- "textbodyjustfied":"Text body justified",
- "textbodyindent":"First line indent",
- "title":"Title",
- "title1":"Title1",
- "title2":"Title2",
- "headline":"Heading",
- "headline1":"Heading1",
- "headline2":"Heading2",
- "measure":"Dimension Line",
- "Normal":"Normal",
- "Heading 1":"Heading 1",
- "Heading 2":"Heading 2",
- "Heading 3":"Heading 3",
- "Numbering Symbols":"Numbering Symbols",
- "Bullets":"Bullets",
- "Table Contents":"Table Contents",
- "Quotations":"Quotations",
- "Index":"Index",
- "Caption":"Caption",
- "List":"List",
- "Text Body":"Text Body",
- "default":"default",
- "gray1":"gray1",
- "gray2":"gray2",
- "gray3":"gray3",
- "bw1":"bw1",
- "bw2":"bw2",
- "bw3":"bw3",
- "orange1":"orange1",
- "orange2":"orange2",
- "orange3":"orange3",
- "turquoise1":"turquoise1",
- "turquoise2":"turquoise2",
- "turquoise3":"turquoise3",
- "blue1":"blue1",
- "blue2":"blue2",
- "blue3":"blue3",
- "sun1":"sun1",
- "sun2":"sun2",
- "sun3":"sun3",
- "earth1":"earth1",
- "earth2":"earth2",
- "earth3":"earth3",
- "green1":"green1",
- "green2":"green2",
- "green3":"green3",
- "seetang1":"seetang1",
- "seetang2":"seetang2",
- "seetang3":"seetang3",
- "lightblue1":"lightblue1",
- "lightblue2":"lightblue2",
- "lightblue3":"lightblue3",
- "yellow1":"yellow1",
- "yellow2":"yellow2",
- "yellow3":"yellow3",
- "default":"default",
- "bw":"bw",
- "orange":"orange",
- "turquoise":"turquoise",
- "blue":"blue",
- "sun":"sun",
- "earth":"earth",
- "green":"green",
- "seetang":"seetang",
- "lightblue":"lightblue",
- "yellow":"yellow",
- "background":"Background",
- "backgroundobjects":"Background objects",
- "notes":"Notes",
- "outline1":"Outline 1",
- "outline2":"Outline 2",
- "outline3":"Outline 3",
- "outline4":"Outline 4",
- "outline5":"Outline 5",
- "outline6":"Outline 6",
- "outline7":"Outline 7",
- "outline8":"Outline 8",
- "outline9":"Outline 9",
- "subtitle":"Subtitle",
- "title":"Title",
- "Clear formatting":"Clear formatting",
- "Default Style":"Default Style",
- "Bullet Symbols":"Bullets",
- "Numbering Symbols":"Numbering Symbols",
- "Footnote Symbol":"Footnote Characters",
- "Page Number":"Page Number",
- "Caption characters":"Caption Characters",
- "Drop Caps":"Drop Caps",
- "Internet link":"Internet Link",
- "Visited Internet Link":"Visited Internet Link",
- "Placeholder":"Placeholder",
- "Index Link":"Index Link",
- "Endnote Symbol":"Endnote Characters",
- "Line numbering":"Line Numbering",
- "Main index entry":"Main Index Entry",
- "Footnote anchor":"Footnote Anchor",
- "Endnote anchor":"Endnote Anchor",
- "Rubies":"Rubies",
- "Vertical Numbering Symbols":"Vertical Numbering Symbols",
- "Emphasis":"Emphasis",
- "Citation":"Quotation",
- "Strong Emphasis":"Strong Emphasis",
- "Source Text":"Source Text",
- "Example":"Example",
- "User Entry":"User Entry",
- "Variable":"Variable",
- "Definition":"Definition",
- "Teletype":"Teletype",
- "Text body":"Text Body",
- "Quotations":"Quotations",
- "Title":"Title",
- "Subtitle":"Subtitle",
- "Heading 1":"Heading 1",
- "Heading 2":"Heading 2",
- "Heading 3":"Heading 3",
- "Standard":"Default Style",
- "Heading":"Heading",
- "List":"List",
- "Caption":"Caption",
- "Index":"Index",
- "Table Contents":"Table Contents",
- "First line indent":"First Line Indent",
- "Hanging indent":"Hanging Indent",
- "Text body indent":"Text Body Indent",
- "Salutation":"Complimentary Close",
- "Signature":"Signature",
- "List Indent":"List Indent",
- "Marginalia":"Marginalia",
- "Heading 4":"Heading 4",
- "Heading 5":"Heading 5",
- "Heading 6":"Heading 6",
- "Heading 7":"Heading 7",
- "Heading 8":"Heading 8",
- "Heading 9":"Heading 9",
- "Heading 10":"Heading 10",
- "Numbering 1 Start":"Numbering 1 Start",
- "Numbering 1":"Numbering 1",
- "Numbering 1 End":"Numbering 1 End",
- "Numbering 1 Cont.":"Numbering 1 Cont.",
- "Numbering 2 Start":"Numbering 2 Start",
- "Numbering 2":"Numbering 2",
- "Numbering 2 End":"Numbering 2 End",
- "Numbering 2 Cont.":"Numbering 2 Cont.",
- "Numbering 3 Start":"Numbering 3 Start",
- "Numbering 3":"Numbering 3",
- "Numbering 3 End":"Numbering 3 End",
- "Numbering 3 Cont.":"Numbering 3 Cont.",
- "Numbering 4 Start":"Numbering 4 Start",
- "Numbering 4":"Numbering 4",
- "Numbering 4 End":"Numbering 4 End",
- "Numbering 4 Cont.":"Numbering 4 Cont.",
- "Numbering 5 Start":"Numbering 5 Start",
- "Numbering 5":"Numbering 5",
- "Numbering 5 End":"Numbering 5 End",
- "Numbering 5 Cont.":"Numbering 5 Cont.",
- "List 1 Start":"List 1 Start",
- "List 1":"List 1",
- "List 1 End":"List 1 End",
- "List 1 Cont.":"List 1 Cont.",
- "List 2 Start":"List 2 Start",
- "List 2":"List 2",
- "List 2 End":"List 2 End",
- "List 2 Cont.":"List 2 Cont.",
- "List 3 Start":"List 3 Start",
- "List 3":"List 3",
- "List 3 End":"List 3 End",
- "List 3 Cont.":"List 3 Cont.",
- "List 4 Start":"List 4 Start",
- "List 4":"List 4",
- "List 4 End":"List 4 End",
- "List 4 Cont.":"List 4 Cont.",
- "List 5 Start":"List 5 Start",
- "List 5":"List 5",
- "List 5 End":"List 5 End",
- "List 5 Cont.":"List 5 Cont.",
- "Index Heading":"Index Heading",
- "Index 1":"Index 1",
- "Index 2":"Index 2",
- "Index 3":"Index 3",
- "Index Separator":"Index Separator",
- "Contents Heading":"Contents Heading",
- "Contents 1":"Contents 1",
- "Contents 2":"Contents 2",
- "Contents 3":"Contents 3",
- "Contents 4":"Contents 4",
- "Contents 5":"Contents 5",
- "User Index Heading":"User Index Heading",
- "User Index 1":"User Index 1",
- "User Index 2":"User Index 2",
- "User Index 3":"User Index 3",
- "User Index 4":"User Index 4",
- "User Index 5":"User Index 5",
- "Contents 6":"Contents 6",
- "Contents 7":"Contents 7",
- "Contents 8":"Contents 8",
- "Contents 9":"Contents 9",
- "Contents 10":"Contents 10",
- "Illustration Index Heading":"Illustration Index Heading",
- "Illustration Index 1":"Illustration Index 1",
- "Object index heading":"Object Index Heading",
- "Object index 1":"Object Index 1",
- "Table index heading":"Table Index Heading",
- "Table index 1":"Table Index 1",
- "Bibliography Heading":"Bibliography Heading",
- "Bibliography 1":"Bibliography 1",
- "User Index 6":"User Index 6",
- "User Index 7":"User Index 7",
- "User Index 8":"User Index 8",
- "User Index 9":"User Index 9",
- "User Index 10":"User Index 10",
- "Header":"Header",
- "Header left":"Header Left",
- "Header right":"Header Right",
- "Footer":"Footer",
- "Footer left":"Footer Left",
- "Footer right":"Footer Right",
- "Table Heading":"Table Heading",
- "Illustration":"Illustration",
- "Table":"Table",
- "Text":"Text",
- "Frame contents":"Frame Contents",
- "Footnote":"Footnote",
- "Addressee":"Addressee",
- "Sender":"Sender",
- "Endnote":"Endnote",
- "Drawing":"Drawing",
- "Preformatted Text":"Preformatted Text",
- "Horizontal Line":"Horizontal Line",
- "List Contents":"List Contents",
- "List Heading":"List Heading",
- "Standard":"Default Style",
- "First Page":"First Page",
- "Left Page":"Left Page",
- "Right Page":"Right Page",
- "Envelope":"Envelope",
- "Index":"Index",
- "HTML":"HTML",
- "Footnote":"Footnote",
- "Endnote":"Endnote",
- "Landscape":"Landscape",
- "Graphics":"Graphics",
- "Frame":"Frame",
- "OLE":"OLE",
- "Formula":"Formula",
- "Marginalia":"Marginalia",
- "Watermark":"Watermark",
- "Labels":"Labels",
- "Numbering 1":"Numbering 1",
- "Numbering 2":"Numbering 2",
- "Numbering 3":"Numbering 3",
- "Numbering 4":"Numbering 4",
- "Numbering 5":"Numbering 5",
- "List 1":"List 1",
- "List 2":"List 2",
- "List 3":"List 3",
- "List 4":"List 4",
- "List 5":"List 5"
- },
-
onAdd: function (map) {
var stylesName = 'leaflet-control-styles';
this._container = L.DomUtil.create('select', stylesName + ' leaflet-bar');
@@ -335,7 +60,7 @@ L.Control.Styles = L.Control.extend({
commands.forEach(function (command) {
var item = L.DomUtil.create('option', '', container);
item.value = command.id;
- item.innerHTML = this.styleMappings[command.text].toLocaleString();;
+ item.innerHTML = L.Styles.styleMappings[command.text].toLocaleString();
}, this);
}
@@ -344,7 +69,7 @@ L.Control.Styles = L.Control.extend({
topStyles.forEach(function (style) {
var item = L.DomUtil.create('option', '', container);
item.value = style;
- item.innerHTML = this.styleMappings[style].toLocaleString();
+ item.innerHTML = L.Styles.styleMappings[style].toLocaleString();
}, this);
}
@@ -358,7 +83,7 @@ L.Control.Styles = L.Control.extend({
var outlineLevel = style.split('Outline')[1];
localeStyle = 'Outline'.toLocaleString() + outlineLevel;
} else {
- localeStyle = this.styleMappings[style].toLocaleString();
+ localeStyle = L.Styles.styleMappings[style].toLocaleString();
}
item.innerHTML = localeStyle;
@@ -397,20 +122,12 @@ L.Control.Styles = L.Control.extend({
if (!e.state) {
return;
}
- // For impress documents, LOK STATE_CHANGED callback return these internal names
- // which are different from what is returned by initial .uno:StyleApply.
- // Convert these names to our stored internal names before processing
- var impressMapping = {'Titel':'title', 'Untertitel':'subtitle',
- 'Gliederung 1':'outline1', 'Gliederung 2':'outline2', 'Gliederung 3':'outline3',
- 'Gliederung 4':'outline4', 'Gliederung 5':'outline5', 'Gliederung 6':'outline6',
- 'Gliederung 7':'outline7', 'Gliederung 8':'outline8', 'Gliederung 9':'outline9',
- 'Hintergrund':'background', 'Hintergrundobjekte':'backgroundobjects', 'Notizen':'notes'};
// For impress documents, template name is prefixed with style name.
// Strip the template name until we support it
if (this._map.getDocType() === 'presentation') {
e.state = e.state.split('~LT~')[1];
- e.state = impressMapping[e.state];
+ e.state = L.Styles.impressMapping[e.state];
}
if (e.commandName === '.uno:StyleApply') {
for (var i = 0; i < this._container.length; i++) {
diff --git a/loleaflet/src/control/Styles.js b/loleaflet/src/control/Styles.js
new file mode 100644
index 0000000..3b5ebf1
--- /dev/null
+++ b/loleaflet/src/control/Styles.js
@@ -0,0 +1,300 @@
+/*
+ * Objects containing LO style mappings
+ */
+
+L.Styles = {
+ // Programming names -> UI names mapping
+ styleMappings: {
+ 'Default':'Default',
+ 'Result':'Result',
+ 'Result2':'Result2',
+ 'Heading':'Heading',
+ 'Heading1':'Heading1',
+ 'Default':'Default',
+ 'Report':'Report',
+ 'standard':'Default',
+ 'objectwitharrow':'Object with arrow',
+ 'objectwithshadow':'Object with shadow',
+ 'objectwithoutfill':'Object without fill',
+ 'Object with no fill and no line':'Object with no fill and no line',
+ 'text':'Text',
+ 'textbody':'Text body',
+ 'textbodyjustfied':'Text body justified',
+ 'textbodyindent':'First line indent',
+ 'title':'Title',
+ 'title1':'Title1',
+ 'title2':'Title2',
+ 'headline':'Heading',
+ 'headline1':'Heading1',
+ 'headline2':'Heading2',
+ 'measure':'Dimension Line',
+ 'Normal':'Normal',
+ 'Heading 1':'Heading 1',
+ 'Heading 2':'Heading 2',
+ 'Heading 3':'Heading 3',
+ 'Numbering Symbols':'Numbering Symbols',
+ 'Bullets':'Bullets',
+ 'Table Contents':'Table Contents',
+ 'Quotations':'Quotations',
+ 'Index':'Index',
+ 'Caption':'Caption',
+ 'List':'List',
+ 'Text Body':'Text Body',
+ 'default':'default',
+ 'gray1':'gray1',
+ 'gray2':'gray2',
+ 'gray3':'gray3',
+ 'bw1':'bw1',
+ 'bw2':'bw2',
+ 'bw3':'bw3',
+ 'orange1':'orange1',
+ 'orange2':'orange2',
+ 'orange3':'orange3',
+ 'turquoise1':'turquoise1',
+ 'turquoise2':'turquoise2',
+ 'turquoise3':'turquoise3',
+ 'blue1':'blue1',
+ 'blue2':'blue2',
+ 'blue3':'blue3',
+ 'sun1':'sun1',
+ 'sun2':'sun2',
+ 'sun3':'sun3',
+ 'earth1':'earth1',
+ 'earth2':'earth2',
+ 'earth3':'earth3',
+ 'green1':'green1',
+ 'green2':'green2',
+ 'green3':'green3',
+ 'seetang1':'seetang1',
+ 'seetang2':'seetang2',
+ 'seetang3':'seetang3',
+ 'lightblue1':'lightblue1',
+ 'lightblue2':'lightblue2',
+ 'lightblue3':'lightblue3',
+ 'yellow1':'yellow1',
+ 'yellow2':'yellow2',
+ 'yellow3':'yellow3',
+ 'default':'default',
+ 'bw':'bw',
+ 'orange':'orange',
+ 'turquoise':'turquoise',
+ 'blue':'blue',
+ 'sun':'sun',
+ 'earth':'earth',
+ 'green':'green',
+ 'seetang':'seetang',
+ 'lightblue':'lightblue',
+ 'yellow':'yellow',
+ 'background':'Background',
+ 'backgroundobjects':'Background objects',
+ 'notes':'Notes',
+ 'outline1':'Outline 1',
+ 'outline2':'Outline 2',
+ 'outline3':'Outline 3',
+ 'outline4':'Outline 4',
+ 'outline5':'Outline 5',
+ 'outline6':'Outline 6',
+ 'outline7':'Outline 7',
+ 'outline8':'Outline 8',
+ 'outline9':'Outline 9',
+ 'subtitle':'Subtitle',
+ 'title':'Title',
+ 'Clear formatting':'Clear formatting',
+ 'Default Style':'Default Style',
+ 'Bullet Symbols':'Bullets',
+ 'Numbering Symbols':'Numbering Symbols',
+ 'Footnote Symbol':'Footnote Characters',
+ 'Page Number':'Page Number',
+ 'Caption characters':'Caption Characters',
+ 'Drop Caps':'Drop Caps',
+ 'Internet link':'Internet Link',
+ 'Visited Internet Link':'Visited Internet Link',
+ 'Placeholder':'Placeholder',
+ 'Index Link':'Index Link',
+ 'Endnote Symbol':'Endnote Characters',
+ 'Line numbering':'Line Numbering',
+ 'Main index entry':'Main Index Entry',
+ 'Footnote anchor':'Footnote Anchor',
+ 'Endnote anchor':'Endnote Anchor',
+ 'Rubies':'Rubies',
+ 'Vertical Numbering Symbols':'Vertical Numbering Symbols',
+ 'Emphasis':'Emphasis',
+ 'Citation':'Quotation',
+ 'Strong Emphasis':'Strong Emphasis',
+ 'Source Text':'Source Text',
+ 'Example':'Example',
+ 'User Entry':'User Entry',
+ 'Variable':'Variable',
+ 'Definition':'Definition',
+ 'Teletype':'Teletype',
+ 'Text body':'Text Body',
+ 'Quotations':'Quotations',
+ 'Title':'Title',
+ 'Subtitle':'Subtitle',
+ 'Heading 1':'Heading 1',
+ 'Heading 2':'Heading 2',
+ 'Heading 3':'Heading 3',
+ 'Standard':'Default Style',
+ 'Heading':'Heading',
+ 'List':'List',
+ 'Caption':'Caption',
+ 'Index':'Index',
+ 'Table Contents':'Table Contents',
+ 'First line indent':'First Line Indent',
+ 'Hanging indent':'Hanging Indent',
+ 'Text body indent':'Text Body Indent',
+ 'Salutation':'Complimentary Close',
+ 'Signature':'Signature',
+ 'List Indent':'List Indent',
+ 'Marginalia':'Marginalia',
+ 'Heading 4':'Heading 4',
+ 'Heading 5':'Heading 5',
+ 'Heading 6':'Heading 6',
+ 'Heading 7':'Heading 7',
+ 'Heading 8':'Heading 8',
+ 'Heading 9':'Heading 9',
+ 'Heading 10':'Heading 10',
+ 'Numbering 1 Start':'Numbering 1 Start',
+ 'Numbering 1':'Numbering 1',
+ 'Numbering 1 End':'Numbering 1 End',
+ 'Numbering 1 Cont.':'Numbering 1 Cont.',
+ 'Numbering 2 Start':'Numbering 2 Start',
+ 'Numbering 2':'Numbering 2',
+ 'Numbering 2 End':'Numbering 2 End',
+ 'Numbering 2 Cont.':'Numbering 2 Cont.',
+ 'Numbering 3 Start':'Numbering 3 Start',
+ 'Numbering 3':'Numbering 3',
+ 'Numbering 3 End':'Numbering 3 End',
+ 'Numbering 3 Cont.':'Numbering 3 Cont.',
+ 'Numbering 4 Start':'Numbering 4 Start',
+ 'Numbering 4':'Numbering 4',
+ 'Numbering 4 End':'Numbering 4 End',
+ 'Numbering 4 Cont.':'Numbering 4 Cont.',
+ 'Numbering 5 Start':'Numbering 5 Start',
+ 'Numbering 5':'Numbering 5',
+ 'Numbering 5 End':'Numbering 5 End',
+ 'Numbering 5 Cont.':'Numbering 5 Cont.',
+ 'List 1 Start':'List 1 Start',
+ 'List 1':'List 1',
+ 'List 1 End':'List 1 End',
+ 'List 1 Cont.':'List 1 Cont.',
+ 'List 2 Start':'List 2 Start',
+ 'List 2':'List 2',
+ 'List 2 End':'List 2 End',
+ 'List 2 Cont.':'List 2 Cont.',
+ 'List 3 Start':'List 3 Start',
+ 'List 3':'List 3',
+ 'List 3 End':'List 3 End',
+ 'List 3 Cont.':'List 3 Cont.',
+ 'List 4 Start':'List 4 Start',
+ 'List 4':'List 4',
+ 'List 4 End':'List 4 End',
+ 'List 4 Cont.':'List 4 Cont.',
+ 'List 5 Start':'List 5 Start',
+ 'List 5':'List 5',
+ 'List 5 End':'List 5 End',
+ 'List 5 Cont.':'List 5 Cont.',
+ 'Index Heading':'Index Heading',
+ 'Index 1':'Index 1',
+ 'Index 2':'Index 2',
+ 'Index 3':'Index 3',
+ 'Index Separator':'Index Separator',
+ 'Contents Heading':'Contents Heading',
+ 'Contents 1':'Contents 1',
+ 'Contents 2':'Contents 2',
+ 'Contents 3':'Contents 3',
+ 'Contents 4':'Contents 4',
+ 'Contents 5':'Contents 5',
+ 'User Index Heading':'User Index Heading',
+ 'User Index 1':'User Index 1',
+ 'User Index 2':'User Index 2',
+ 'User Index 3':'User Index 3',
+ 'User Index 4':'User Index 4',
+ 'User Index 5':'User Index 5',
+ 'Contents 6':'Contents 6',
+ 'Contents 7':'Contents 7',
+ 'Contents 8':'Contents 8',
+ 'Contents 9':'Contents 9',
+ 'Contents 10':'Contents 10',
+ 'Illustration Index Heading':'Illustration Index Heading',
+ 'Illustration Index 1':'Illustration Index 1',
+ 'Object index heading':'Object Index Heading',
+ 'Object index 1':'Object Index 1',
+ 'Table index heading':'Table Index Heading',
+ 'Table index 1':'Table Index 1',
+ 'Bibliography Heading':'Bibliography Heading',
+ 'Bibliography 1':'Bibliography 1',
+ 'User Index 6':'User Index 6',
+ 'User Index 7':'User Index 7',
+ 'User Index 8':'User Index 8',
+ 'User Index 9':'User Index 9',
+ 'User Index 10':'User Index 10',
+ 'Header':'Header',
+ 'Header left':'Header Left',
+ 'Header right':'Header Right',
+ 'Footer':'Footer',
+ 'Footer left':'Footer Left',
+ 'Footer right':'Footer Right',
+ 'Table Heading':'Table Heading',
+ 'Illustration':'Illustration',
+ 'Table':'Table',
+ 'Text':'Text',
+ 'Frame contents':'Frame Contents',
+ 'Footnote':'Footnote',
+ 'Addressee':'Addressee',
+ 'Sender':'Sender',
+ 'Endnote':'Endnote',
+ 'Drawing':'Drawing',
+ 'Preformatted Text':'Preformatted Text',
+ 'Horizontal Line':'Horizontal Line',
+ 'List Contents':'List Contents',
+ 'List Heading':'List Heading',
+ 'Standard':'Default Style',
+ 'First Page':'First Page',
+ 'Left Page':'Left Page',
+ 'Right Page':'Right Page',
+ 'Envelope':'Envelope',
+ 'Index':'Index',
+ 'HTML':'HTML',
+ 'Footnote':'Footnote',
+ 'Endnote':'Endnote',
+ 'Landscape':'Landscape',
+ 'Graphics':'Graphics',
+ 'Frame':'Frame',
+ 'OLE':'OLE',
+ 'Formula':'Formula',
+ 'Marginalia':'Marginalia',
+ 'Watermark':'Watermark',
+ 'Labels':'Labels',
+ 'Numbering 1':'Numbering 1',
+ 'Numbering 2':'Numbering 2',
+ 'Numbering 3':'Numbering 3',
+ 'Numbering 4':'Numbering 4',
+ 'Numbering 5':'Numbering 5',
+ 'List 1':'List 1',
+ 'List 2':'List 2',
+ 'List 3':'List 3',
+ 'List 4':'List 4',
+ 'List 5':'List 5'
+ },
+
+ // For impress documents, LOK STATE_CHANGED callback return these internal names
+ // which are different from what is returned by initial .uno:StyleApply.
+ // Convert these names to our stored internal names before processing
+ impressMapping : {
+ 'Titel':'title',
+ 'Untertitel':'subtitle',
+ 'Gliederung 1':'outline1',
+ 'Gliederung 2':'outline2',
+ 'Gliederung 3':'outline3',
+ 'Gliederung 4':'outline4',
+ 'Gliederung 5':'outline5',
+ 'Gliederung 6':'outline6',
+ 'Gliederung 7':'outline7',
+ 'Gliederung 8':'outline8',
+ 'Gliederung 9':'outline9',
+ 'Hintergrund':'background',
+ 'Hintergrundobjekte':'backgroundobjects',
+ 'Notizen':'notes'
+ }
+};
More information about the Libreoffice-commits
mailing list