Use onlyoffice spreadsheets without ooserver
This commit is contained in:
1 parent
b2b23446e8
commit
1e672c4a6b
7 files changed
+419
-92
No files matched your search
@@ -258,7 +258,7 @@ app.use(function (req, res, next) {
|
|||||||
var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app);
|
var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app);
|
||||||
|
|
||||||
/* Install sockjs websocket server */
|
/* Install sockjs websocket server */
|
||||||
OOServer.install(httpServer, config.httpPort, () => {
|
//OOServer.install(httpServer, config.httpPort, () => {
|
||||||
httpServer.listen(config.httpPort,config.httpAddress,function(){
|
httpServer.listen(config.httpPort,config.httpAddress,function(){
|
||||||
var host = config.httpAddress;
|
var host = config.httpAddress;
|
||||||
var hostName = !host.indexOf(':') ? '[' + host + ']' : host;
|
var hostName = !host.indexOf(':') ? '[' + host + ']' : host;
|
||||||
@@ -268,11 +268,11 @@ OOServer.install(httpServer, config.httpPort, () => {
|
|||||||
|
|
||||||
console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps);
|
console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps);
|
||||||
});
|
});
|
||||||
});
|
//});
|
||||||
if (config.httpSafePort) {
|
if (config.httpSafePort) {
|
||||||
var safeHttpServer = Http.createServer(app).listen(config.httpSafePort, config.httpAddress);
|
var safeHttpServer = Http.createServer(app).listen(config.httpSafePort, config.httpAddress);
|
||||||
OOServer.install(safeHttpServer, config.httpSafePort, () => {
|
//OOServer.install(safeHttpServer, config.httpSafePort, () => {
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
var wsConfig = { server: httpServer };
|
var wsConfig = { server: httpServer };
|
||||||
|
|||||||
+148
-80
@@ -3174,6 +3174,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
DocsCoApi.prototype._send = function(data) {
|
DocsCoApi.prototype._send = function(data) {
|
||||||
if (data !== null && typeof data === "object") {
|
if (data !== null && typeof data === "object") {
|
||||||
if (this._state > 0) {
|
if (this._state > 0) {
|
||||||
|
console.log(data);
|
||||||
this.sockjs.send(JSON.stringify(data));
|
this.sockjs.send(JSON.stringify(data));
|
||||||
} else {
|
} else {
|
||||||
this._msgBuffer.push(JSON.stringify(data));
|
this._msgBuffer.push(JSON.stringify(data));
|
||||||
@@ -3184,6 +3185,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
DocsCoApi.prototype._sendRaw = function(data) {
|
DocsCoApi.prototype._sendRaw = function(data) {
|
||||||
if (data !== null && typeof data === "string") {
|
if (data !== null && typeof data === "string") {
|
||||||
if (this._state > 0) {
|
if (this._state > 0) {
|
||||||
|
console.log(data);
|
||||||
this.sockjs.send(data);
|
this.sockjs.send(data);
|
||||||
} else {
|
} else {
|
||||||
this._msgBuffer.push(data);
|
this._msgBuffer.push(data);
|
||||||
@@ -3755,6 +3757,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
var t = this;
|
var t = this;
|
||||||
|
|
||||||
var sockjs;
|
var sockjs;
|
||||||
|
/*
|
||||||
if (window['IS_NATIVE_EDITOR']) {
|
if (window['IS_NATIVE_EDITOR']) {
|
||||||
sockjs = this.sockjs = window['SockJS'];
|
sockjs = this.sockjs = window['SockJS'];
|
||||||
sockjs.open();
|
sockjs.open();
|
||||||
@@ -3763,21 +3766,27 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
||||||
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
||||||
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
||||||
}
|
}*/
|
||||||
|
sockjs = this.sockjs = {};
|
||||||
|
//t._state = true;
|
||||||
|
|
||||||
sockjs.onopen = function() {
|
sockjs.onopen = function() {
|
||||||
|
/*
|
||||||
if (t.reconnectTimeout) {
|
if (t.reconnectTimeout) {
|
||||||
clearTimeout(t.reconnectTimeout);
|
clearTimeout(t.reconnectTimeout);
|
||||||
t.reconnectTimeout = null;
|
t.reconnectTimeout = null;
|
||||||
t.attemptCount = 0;
|
t.attemptCount = 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
t._state = ConnectionState.WaitAuth;
|
t._state = ConnectionState.WaitAuth;
|
||||||
t.onFirstConnect();
|
t.onFirstConnect();
|
||||||
};
|
};
|
||||||
|
sockjs.onopen();
|
||||||
sockjs.onmessage = function(e) {
|
sockjs.onmessage = function(e) {
|
||||||
//TODO: add checks and error handling
|
//TODO: add checks and error handling
|
||||||
//Get data type
|
//Get data type
|
||||||
|
console.log(e.data);
|
||||||
var dataObject = JSON.parse(e.data);
|
var dataObject = JSON.parse(e.data);
|
||||||
switch (dataObject['type']) {
|
switch (dataObject['type']) {
|
||||||
case 'auth' :
|
case 'auth' :
|
||||||
@@ -3847,6 +3856,68 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sockjs.close = function () {
|
||||||
|
console.error('Close realtime');
|
||||||
|
};
|
||||||
|
|
||||||
|
var send = function (data) {
|
||||||
|
setTimeout(function () {
|
||||||
|
console.log(data);
|
||||||
|
sockjs.onmessage({
|
||||||
|
data: JSON.stringify(data)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
sockjs.send = function (data) {
|
||||||
|
console.log(data);
|
||||||
|
try {
|
||||||
|
var obj = JSON.parse(data);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var msg, msg2;
|
||||||
|
switch (obj.type) {
|
||||||
|
case 'auth':
|
||||||
|
msg = {
|
||||||
|
"type":"auth",
|
||||||
|
"result":1,
|
||||||
|
"sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b",
|
||||||
|
"sessionTimeConnect":+new Date(),
|
||||||
|
"participants":[]
|
||||||
|
};
|
||||||
|
msg2 = {
|
||||||
|
"type":"documentOpen",
|
||||||
|
"data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}}
|
||||||
|
};
|
||||||
|
send(msg);
|
||||||
|
send(msg2);
|
||||||
|
break;
|
||||||
|
case 'getMessages':
|
||||||
|
msg = {};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var license = {
|
||||||
|
type: 'license',
|
||||||
|
license: {
|
||||||
|
type: 3,
|
||||||
|
light: false,
|
||||||
|
trial: false,
|
||||||
|
rights: 1,
|
||||||
|
buildVersion: "4.3.3",
|
||||||
|
buildNumber: 4,
|
||||||
|
branding: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
send(license);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
sockjs.onclose = function(evt) {
|
sockjs.onclose = function(evt) {
|
||||||
if (ConnectionState.SaveChanges === t._state) {
|
if (ConnectionState.SaveChanges === t._state) {
|
||||||
// Мы сохраняли изменения и разорвалось соединение
|
// Мы сохраняли изменения и разорвалось соединение
|
||||||
@@ -3871,6 +3942,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
t._tryReconnect();
|
t._tryReconnect();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
return sockjs;
|
return sockjs;
|
||||||
};
|
};
|
||||||
@@ -3918,6 +3990,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
window['AscCommon'] = window['AscCommon'] || {};
|
window['AscCommon'] = window['AscCommon'] || {};
|
||||||
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
||||||
})(window);
|
})(window);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) Copyright Ascensio System SIA 2010-2017
|
* (c) Copyright Ascensio System SIA 2010-2017
|
||||||
*
|
*
|
||||||
@@ -9205,7 +9278,6 @@ function saveWithParts(fSendCommand, fCallback, fCallbackRequest, oAdditionalDat
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadFileContent(url, callback) {
|
function loadFileContent(url, callback) {
|
||||||
console.error(url);
|
|
||||||
asc_ajax({
|
asc_ajax({
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "text",
|
dataType: "text",
|
||||||
@@ -9229,89 +9301,85 @@ function getImageFromChanges (name) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
function openFileCommand(binUrl, changesUrl, Signature, callback) {
|
||||||
var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false;
|
var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false;
|
||||||
var onEndOpen = function() {
|
var onEndOpen = function() {
|
||||||
console.error("this is where we should decrypt");
|
if (bEndLoadFile && bEndLoadChanges) {
|
||||||
if (bEndLoadFile && bEndLoadChanges) {
|
if (callback) {
|
||||||
if (callback) {
|
callback(bError, oResult);
|
||||||
callback(bError, oResult);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var sFileUrl = binUrl;
|
|
||||||
sFileUrl = sFileUrl.replace(/\\/g, "/");
|
|
||||||
|
|
||||||
if (!window['IS_NATIVE_EDITOR']) {
|
|
||||||
asc_ajax({
|
|
||||||
url: sFileUrl,
|
|
||||||
dataType: "text",
|
|
||||||
success: function(result) {
|
|
||||||
//получаем url к папке с файлом
|
|
||||||
var url;
|
|
||||||
var nIndex = sFileUrl.lastIndexOf("/");
|
|
||||||
url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl;
|
|
||||||
if (0 < result.length) {
|
|
||||||
oResult.bSerFormat = Signature === result.substring(0, Signature.length);
|
|
||||||
oResult.data = result;
|
|
||||||
oResult.url = url;
|
|
||||||
} else {
|
|
||||||
bError = true;
|
|
||||||
}
|
|
||||||
bEndLoadFile = true;
|
|
||||||
onEndOpen();
|
|
||||||
console.error(oResult); // XXX
|
|
||||||
},
|
|
||||||
error: function() {
|
|
||||||
bEndLoadFile = true;
|
|
||||||
bError = true;
|
|
||||||
onEndOpen();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
var sFileUrl = binUrl;
|
||||||
|
sFileUrl = sFileUrl.replace(/\\/g, "/");
|
||||||
|
|
||||||
if (null != changesUrl) {
|
if (!window['IS_NATIVE_EDITOR']) {
|
||||||
console.error("null changesUrl"); // XXX
|
asc_ajax({
|
||||||
getJSZipUtils().getBinaryContent(changesUrl, function(err, data) {
|
url: sFileUrl,
|
||||||
bEndLoadChanges = true;
|
dataType: "text",
|
||||||
if (err) {
|
success: function(result) {
|
||||||
bError = true;
|
//получаем url к папке с файлом
|
||||||
onEndOpen();
|
var url;
|
||||||
return;
|
var nIndex = sFileUrl.lastIndexOf("/");
|
||||||
}
|
url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl;
|
||||||
|
if (0 < result.length) {
|
||||||
oZipChanges = new (require('jszip'))(data);
|
oResult.bSerFormat = Signature === result.substring(0, Signature.length);
|
||||||
oResult.changes = [];
|
oResult.data = result;
|
||||||
for (var i in oZipChanges.files) {
|
oResult.url = url;
|
||||||
if (i.endsWith('.json')) {
|
} else {
|
||||||
// Заглушка на имя файла (стоило его начинать с цифры)
|
bError = true;
|
||||||
oResult.changes[parseInt(i.slice('changes'.length))] =
|
}
|
||||||
JSON.parse(oZipChanges.files[i].asText());
|
bEndLoadFile = true;
|
||||||
}
|
onEndOpen();
|
||||||
}
|
},
|
||||||
onEndOpen();
|
error: function() {
|
||||||
});
|
bEndLoadFile = true;
|
||||||
} else {
|
bError = true;
|
||||||
bEndLoadChanges = true;
|
onEndOpen();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (window['IS_NATIVE_EDITOR']) {
|
if (null != changesUrl) {
|
||||||
console.error("is native editor");
|
getJSZipUtils().getBinaryContent(changesUrl, function(err, data) {
|
||||||
var result = window["native"]["openFileCommand"](sFileUrl, changesUrl, Signature);
|
bEndLoadChanges = true;
|
||||||
|
if (err) {
|
||||||
var url;
|
bError = true;
|
||||||
var nIndex = sFileUrl.lastIndexOf("/");
|
|
||||||
url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl;
|
|
||||||
if (0 < result.length) {
|
|
||||||
oResult.bSerFormat = Signature === result.substring(0, Signature.length);
|
|
||||||
oResult.data = result;
|
|
||||||
oResult.url = url;
|
|
||||||
} else {
|
|
||||||
bError = true;
|
|
||||||
}
|
|
||||||
bEndLoadFile = true;
|
|
||||||
onEndOpen();
|
onEndOpen();
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oZipChanges = new (require('jszip'))(data);
|
||||||
|
oResult.changes = [];
|
||||||
|
for (var i in oZipChanges.files) {
|
||||||
|
if (i.endsWith('.json')) {
|
||||||
|
// Заглушка на имя файла (стоило его начинать с цифры)
|
||||||
|
oResult.changes[parseInt(i.slice('changes'.length))] = JSON.parse(oZipChanges.files[i].asText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onEndOpen();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
bEndLoadChanges = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window['IS_NATIVE_EDITOR']) {
|
||||||
|
var result = window["native"]["openFileCommand"](sFileUrl, changesUrl, Signature);
|
||||||
|
|
||||||
|
var url;
|
||||||
|
var nIndex = sFileUrl.lastIndexOf("/");
|
||||||
|
url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl;
|
||||||
|
if (0 < result.length) {
|
||||||
|
oResult.bSerFormat = Signature === result.substring(0, Signature.length);
|
||||||
|
oResult.data = result;
|
||||||
|
oResult.url = url;
|
||||||
|
} else {
|
||||||
|
bError = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bEndLoadFile = true;
|
||||||
|
onEndOpen();
|
||||||
|
}
|
||||||
|
}
|
||||||
function sendCommand(editor, fCallback, rdata, dataContainer) {
|
function sendCommand(editor, fCallback, rdata, dataContainer) {
|
||||||
//json не должен превышать размера 2097152, иначе при его чтении будет exception
|
//json не должен превышать размера 2097152, иначе при его чтении будет exception
|
||||||
var docConnectionId = editor.CoAuthoringApi.getDocId();
|
var docConnectionId = editor.CoAuthoringApi.getDocId();
|
||||||
|
|||||||
+69
-1
@@ -3755,6 +3755,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
var t = this;
|
var t = this;
|
||||||
|
|
||||||
var sockjs;
|
var sockjs;
|
||||||
|
/*
|
||||||
if (window['IS_NATIVE_EDITOR']) {
|
if (window['IS_NATIVE_EDITOR']) {
|
||||||
sockjs = this.sockjs = window['SockJS'];
|
sockjs = this.sockjs = window['SockJS'];
|
||||||
sockjs.open();
|
sockjs.open();
|
||||||
@@ -3763,8 +3764,11 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
||||||
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
||||||
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
||||||
}
|
}*/
|
||||||
|
sockjs = {};
|
||||||
|
t._state = true;
|
||||||
|
|
||||||
|
/*
|
||||||
sockjs.onopen = function() {
|
sockjs.onopen = function() {
|
||||||
if (t.reconnectTimeout) {
|
if (t.reconnectTimeout) {
|
||||||
clearTimeout(t.reconnectTimeout);
|
clearTimeout(t.reconnectTimeout);
|
||||||
@@ -3775,6 +3779,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
t._state = ConnectionState.WaitAuth;
|
t._state = ConnectionState.WaitAuth;
|
||||||
t.onFirstConnect();
|
t.onFirstConnect();
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
sockjs.onmessage = function(e) {
|
sockjs.onmessage = function(e) {
|
||||||
//TODO: add checks and error handling
|
//TODO: add checks and error handling
|
||||||
//Get data type
|
//Get data type
|
||||||
@@ -3847,6 +3852,67 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sockjs.close = function () {
|
||||||
|
console.error('Close realtime');
|
||||||
|
};
|
||||||
|
|
||||||
|
var send = function (data) {
|
||||||
|
setTimeout(function () {
|
||||||
|
this.onmessage(JSON.stringify(data));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
sockjs.send = function (data) {
|
||||||
|
try {
|
||||||
|
var obj = JSON.parse(data);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(data);
|
||||||
|
console.error(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var msg, msg2;
|
||||||
|
switch (obj.type) {
|
||||||
|
case 'auth':
|
||||||
|
msg = {
|
||||||
|
"type":"auth",
|
||||||
|
"result":1,
|
||||||
|
"sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b",
|
||||||
|
"sessionTimeConnect":+new Date(),
|
||||||
|
"participants":[]
|
||||||
|
};
|
||||||
|
msg2 = {
|
||||||
|
"type":"documentOpen",
|
||||||
|
"data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}}
|
||||||
|
};
|
||||||
|
send(msg);
|
||||||
|
send(msg2);
|
||||||
|
break;
|
||||||
|
case 'getMessages':
|
||||||
|
msg = {};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var license = {
|
||||||
|
type: 'license',
|
||||||
|
license: {
|
||||||
|
type: 3,
|
||||||
|
light: false,
|
||||||
|
trial: false,
|
||||||
|
rights: 1,
|
||||||
|
buildVersion: "4.3.3",
|
||||||
|
buildNumber: 4,
|
||||||
|
branding: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
sockjs.onmessage({
|
||||||
|
data: JSON.stringify(license)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
sockjs.onclose = function(evt) {
|
sockjs.onclose = function(evt) {
|
||||||
if (ConnectionState.SaveChanges === t._state) {
|
if (ConnectionState.SaveChanges === t._state) {
|
||||||
// Мы сохраняли изменения и разорвалось соединение
|
// Мы сохраняли изменения и разорвалось соединение
|
||||||
@@ -3871,6 +3937,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
t._tryReconnect();
|
t._tryReconnect();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
return sockjs;
|
return sockjs;
|
||||||
};
|
};
|
||||||
@@ -3918,6 +3985,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
window['AscCommon'] = window['AscCommon'] || {};
|
window['AscCommon'] = window['AscCommon'] || {};
|
||||||
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
||||||
})(window);
|
})(window);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) Copyright Ascensio System SIA 2010-2017
|
* (c) Copyright Ascensio System SIA 2010-2017
|
||||||
*
|
*
|
||||||
|
|||||||
+69
-1
@@ -3755,6 +3755,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
var t = this;
|
var t = this;
|
||||||
|
|
||||||
var sockjs;
|
var sockjs;
|
||||||
|
/*
|
||||||
if (window['IS_NATIVE_EDITOR']) {
|
if (window['IS_NATIVE_EDITOR']) {
|
||||||
sockjs = this.sockjs = window['SockJS'];
|
sockjs = this.sockjs = window['SockJS'];
|
||||||
sockjs.open();
|
sockjs.open();
|
||||||
@@ -3763,8 +3764,11 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
//ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io
|
||||||
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
//при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4)
|
||||||
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']});
|
||||||
}
|
}*/
|
||||||
|
sockjs = {};
|
||||||
|
t._state = true;
|
||||||
|
|
||||||
|
/*
|
||||||
sockjs.onopen = function() {
|
sockjs.onopen = function() {
|
||||||
if (t.reconnectTimeout) {
|
if (t.reconnectTimeout) {
|
||||||
clearTimeout(t.reconnectTimeout);
|
clearTimeout(t.reconnectTimeout);
|
||||||
@@ -3775,6 +3779,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
t._state = ConnectionState.WaitAuth;
|
t._state = ConnectionState.WaitAuth;
|
||||||
t.onFirstConnect();
|
t.onFirstConnect();
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
sockjs.onmessage = function(e) {
|
sockjs.onmessage = function(e) {
|
||||||
//TODO: add checks and error handling
|
//TODO: add checks and error handling
|
||||||
//Get data type
|
//Get data type
|
||||||
@@ -3847,6 +3852,67 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sockjs.close = function () {
|
||||||
|
console.error('Close realtime');
|
||||||
|
};
|
||||||
|
|
||||||
|
var send = function (data) {
|
||||||
|
setTimeout(function () {
|
||||||
|
this.onmessage(JSON.stringify(data));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
sockjs.send = function (data) {
|
||||||
|
try {
|
||||||
|
var obj = JSON.parse(data);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(data);
|
||||||
|
console.error(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var msg, msg2;
|
||||||
|
switch (obj.type) {
|
||||||
|
case 'auth':
|
||||||
|
msg = {
|
||||||
|
"type":"auth",
|
||||||
|
"result":1,
|
||||||
|
"sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b",
|
||||||
|
"sessionTimeConnect":+new Date(),
|
||||||
|
"participants":[]
|
||||||
|
};
|
||||||
|
msg2 = {
|
||||||
|
"type":"documentOpen",
|
||||||
|
"data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}}
|
||||||
|
};
|
||||||
|
send(msg);
|
||||||
|
send(msg2);
|
||||||
|
break;
|
||||||
|
case 'getMessages':
|
||||||
|
msg = {};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var license = {
|
||||||
|
type: 'license',
|
||||||
|
license: {
|
||||||
|
type: 3,
|
||||||
|
light: false,
|
||||||
|
trial: false,
|
||||||
|
rights: 1,
|
||||||
|
buildVersion: "4.3.3",
|
||||||
|
buildNumber: 4,
|
||||||
|
branding: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
sockjs.onmessage({
|
||||||
|
data: JSON.stringify(license)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
sockjs.onclose = function(evt) {
|
sockjs.onclose = function(evt) {
|
||||||
if (ConnectionState.SaveChanges === t._state) {
|
if (ConnectionState.SaveChanges === t._state) {
|
||||||
// Мы сохраняли изменения и разорвалось соединение
|
// Мы сохраняли изменения и разорвалось соединение
|
||||||
@@ -3871,6 +3937,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
t._tryReconnect();
|
t._tryReconnect();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
return sockjs;
|
return sockjs;
|
||||||
};
|
};
|
||||||
@@ -3918,6 +3985,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
|
|||||||
window['AscCommon'] = window['AscCommon'] || {};
|
window['AscCommon'] = window['AscCommon'] || {};
|
||||||
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
window['AscCommon'].CDocsCoApi = CDocsCoApi;
|
||||||
})(window);
|
})(window);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) Copyright Ascensio System SIA 2010-2017
|
* (c) Copyright Ascensio System SIA 2010-2017
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,8 +1,53 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) Ascensio System SIA 2018. All rights reserved
|
* Copyright (c) Ascensio System SIA 2019. All rights reserved
|
||||||
*
|
*
|
||||||
* http://www.onlyoffice.com
|
* http://www.onlyoffice.com
|
||||||
*
|
*
|
||||||
* Version: 0.0.0 (build:0)
|
* Version: 0.0.0 (build:0)
|
||||||
*/
|
*/
|
||||||
function onDropDownKeyDown(e){var t=$(this),n=t.parent(),r=jQuery.Event("keydown.before.bs.dropdown"),i=jQuery.Event("keydown.after.bs.dropdown");n.trigger(r),n.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(e=arguments[1]),/^(38|40|27|13|9|37|39)$/.test(e.keyCode)&&!e.ctrlKey&&!e.altKey&&(patchDropDownKeyDownAdditional.call(this,e),/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation()))):(patchDropDownKeyDown.call(this,e),e.preventDefault(),e.stopPropagation()),n.trigger(i)}function patchDropDownKeyDown(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);e.preventDefault(),e.stopPropagation();if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&e.keyCode==27){if(e.which==27){i=$("[role=menu] li.dropdown-submenu.over:visible",n);if(i.size())return i.eq(i.size()-1).removeClass("over"),!1;n.hasClass("dropdown-submenu")&&n.hasClass("over")?(n.removeClass("over"),n.find("> a").focus()):n.find("[data-toggle=dropdown]").focus()}return r?t.click():undefined}var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(":focus"));if(e.keyCode==39){if(s<0)return;var o=i.eq(s).parent();o.hasClass("dropdown-submenu")&&!o.hasClass("over")&&(o.mouseenter(),o.addClass("focused-submenu"),_.delay(function(){var e=$("> [role=menu]",o),t=e.find("> li:not(.divider):not(.disabled):visible > a"),n=0;if(e.find("> .menu-scroll").length>0){var r=e.scrollTop();for(var i=0;i<t.length;i++)if(t[i].offsetTop>r){n=i;break}}t.length>0&&t.eq(n).focus()},250))}else e.keyCode==37?n.hasClass("dropdown-submenu")&&n.hasClass("over")&&(n.removeClass("over"),n.find("> a").focus()):(e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),n.hasClass("dropdown-submenu")&&n.hasClass("over")&&n.addClass("focused-submenu"),i.eq(s).focus())}function patchDropDownKeyDownAdditional(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation());if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&(e.keyCode==27||e.keyCode==37||e.keyCode==39))return r?t.click():undefined;var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(".focus"));e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),i.removeClass("focus"),i.eq(s).addClass("focus")}function getParent(e){var t=e.attr("data-target");t||(t=e.attr("href"),t=t&&/#/.test(t)&&t.replace(/.*(?=#[^\s]*$)/,""));var n=t&&$(t);return n&&n.length?n:e.parent()}function clearMenus(e){$(".dropdown-toggle").each(function(t){var n=$(this).parent();if(!n.hasClass("open"))return;n.trigger(t=$.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("open").trigger("hidden.bs.dropdown",e)})}(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){returnLine truncated
|
function onDropDownKeyDown(t){var e=$(this),i=e.parent(),n=jQuery.Event("keydown.before.bs.dropdown"),o=jQuery.Event("keydown.after.bs.dropdown");i.trigger(n),i.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(t=arguments[1]),!/^(38|40|27|13|9|37|39)$/.test(t.keyCode)||t.ctrlKey||t.altKey||(patchDropDownKeyDownAdditional.call(this,t),/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()))):(patchDropDownKeyDown.call(this,t),t.preventDefault(),t.stopPropagation()),i.trigger(o)}function patchDropDownKeyDown(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&27==t.keyCode){if(27==t.which){if(o=$("[role=menu] li.dropdown-submenu.over:visible",i),o.size())return o.eq(o.size()-1).removeClass("over"),!1;i.hasClass("dropdown-submenu")&&i.hasClass("over")?(i.removeClass("over"),i.find("> a").focus()):i.find("[data-toggle=dropdown]").focus()}return n?e.click():void 0}var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(":focus"));if(39==t.keyCode){if(s<0)return;var a=o.eq(s).parent();a.hasClass("dropdown-submenu")&&!a.hasClass("over")&&(a.mouseenter(),a.addClass("focused-submenu"),_.delay(function(){var t=$("> [role=menu]",a),e=t.find("> li:not(.divider):not(.disabled):visible > a"),i=0;if(t.find("> .menu-scroll").length>0)for(var n=t.scrollTop(),o=0;o<e.length;o++)if(e[o].offsetTop>n){i=o;break}e.length>0&&e.eq(i).focus()},250))}else 37==t.keyCode?i.hasClass("dropdown-submenu")&&i.hasClass("over")&&(i.removeClass("over"),i.find("> a").focus()):(38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),i.hasClass("dropdown-submenu")&&i.hasClass("over")&&i.addClass("focused-submenu"),o.eq(s).focus())}}}}function patchDropDownKeyDownAdditional(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&(27==t.keyCode||37==t.keyCode||39==t.keyCode))return n?e.click():void 0;var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(".focus"));38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),o.removeClass("focus"),o.eq(s).addClass("focus")}}}}function getParent(t){var e=t.attr("data-target");e||(e=t.attr("href"),e=e&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&$(e);return i&&i.length?i:t.parent()}function clearMenus(t){$(".dropdown-toggle").each(function(e){var i=$(this).parent();i.hasClass("open")&&(i.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",t))})}if(function(){var t=this,e=t._,i={},n=Array.prototype,o=Object.prototype,s=Function.prototype,a=n.push,r=n.slice,l=n.concat,c=o.toString,d=o.hasOwnProperty,h=n.forEach,p=n.map,m=n.reduce,u=n.reduceRight,g=n.filter,b=n.every,f=n.some,C=n.indexOf,v=n.lastIndexOf,_=Array.isArray,y=Object.keys,w=s.bind,x=function(t){return t instanceof x?t:this instanceof x?void(this._wrapped=t):new x(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):t._=x,x.VERSION="1.5.2";var S=x.each=x.forEach=function(t,e,n){if(null!=t)if(h&&t.forEach===h)t.forEach(e,n);else if(t.length===+t.length){for(var o=0,s=t.length;o<s;o++)if(e.call(n,t[o],o,t)===i)return}else for(var a=x.keys(t),o=0,s=a.length;o<s;o++)if(e.call(n,t[a[o]],a[o],t)===i)return};x.map=x.collect=function(t,e,i){var n=[];return null==t?n:p&&t.map===p?t.map(e,i):(S(t,function(t,o,s){n.push(e.call(i,t,o,s))}),n)};var A="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),m&&t.reduce===m)return n&&(e=x.bind(e,n)),o?t.reduce(e,i):t.reduce(e);if(S(t,function(t,s,a){o?i=e.call(n,i,t,s,a):(i=t,o=!0)}),!o)throw new TypeError(A);return i},x.reduceRight=x.foldr=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),u&&t.reduceRight===u)return n&&(e=x.bind(e,n)),o?t.reduceRight(e,i):t.reduceRight(e);var s=t.length;if(s!==+s){var a=x.keys(t);s=a.length}if(S(t,function(r,l,c){l=a?a[--s]:--s,o?i=e.call(n,i,t[l],l,c):(i=t[l],o=!0)}),!o)throw new TypeError(A);return i},x.find=x.detect=function(t,e,i){var n;return T(t,function(t,o,s){if(e.call(i,t,o,s))return n=t,!0}),n},x.filter=x.select=function(t,e,i){var n=[];return null==t?n:g&&t.filter===g?t.filter(e,i):(S(t,function(t,o,s){e.call(i,t,o,s)&&n.push(t)}),n)},x.reject=function(t,e,i){return x.filter(t,function(t,n,o){return!e.call(i,t,n,o)},i)},x.every=x.all=function(t,e,n){e||(e=x.identity);var o=!0;return nullLine truncated
|
||||||
|
;if(i(t))for(n=t.length;o<n&&!1!==e.call(t[o],o,t[o]);o++);else for(o in t)if(!1===e.call(t[o],o,t[o]))break;return t},trim:function(t){return null==t?"":(t+"").replace(st,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(i(Object(t))?ot.merge(n,"string"==typeof t?[t]:t):Z.call(n,t)),n},inArray:function(t,e,i){return null==e?-1:Q.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,o=t.length;n<i;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,i){for(var n=[],o=0,s=t.length,a=!i;o<s;o++)!e(t[o],o)!==a&&n.push(t[o]);return n},map:function(t,e,n){var o,s,a=0,r=[];if(i(t))for(o=t.length;a<o;a++)null!=(s=e(t[a],a,n))&&r.push(s);else for(a in t)null!=(s=e(t[a],a,n))&&r.push(s);return J.apply([],r)},guid:1,proxy:function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),ot.isFunction(t))return n=X.call(arguments,2),o=function(){return t.apply(e||this,n.concat(X.call(arguments)))},o.guid=t.guid=t.guid||ot.guid++,o},now:Date.now,support:nt}),"function"==typeof Symbol&&(ot.fn[Symbol.iterator]=K[Symbol.iterator]),ot.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){tt["[object "+e+"]"]=e.toLowerCase()});var ct=function(t){function e(t,e,i,n){var o,s,a,r,c,h,p,m,u=e&&e.ownerDocument,g=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return i;if(!n&&((e?e.ownerDocument||e:L)!==M&&P(e),e=e||M,U)){if(11!==g&&(h=gt.exec(t)))if(o=h[1]){if(9===g){if(!(a=e.getElementById(o)))return i;if(a.id===o)return i.push(a),i}else if(u&&(a=u.getElementById(o))&&R(e,a)&&a.id===o)return i.push(a),i}else{if(h[2])return X.apply(i,e.getElementsByTagName(t)),i;if((o=h[3])&&v.getElementsByClassName&&e.getElementsByClassName)return X.apply(i,e.getElementsByClassName(o)),i}if(v.qsa&&!$[t+" "]&&(!E||!E.test(t))){if(1!==g)u=e,m=t;else if("object"!==e.nodeName.toLowerCase()){for((r=e.getAttribute("id"))?r=r.replace(ft,"\\$&"):e.setAttribute("id",r=F),p=x(t),s=p.length,c=dt.test(r)?"#"+r:"[id='"+r+"']";s--;)p[s]=c+" "+d(p[s]);m=p.join(","),u=bt.test(t)&&l(e.parentNode)||e}if(m)try{return X.apply(i,u.querySelectorAll(m)),i}catch(t){}finally{r===F&&e.removeAttribute("id")}}}return A(t.replace(st,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>_.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[F]=!0,t}function o(t){var e=M.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=i.length;n--;)_.attrHandle[i[n]]=e}function a(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||G)-(~t.sourceIndex||G);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function r(t){return n(function(e){return e=+e,n(function(i,n){for(var o,s=t([],i.length,e),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function d(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function h(t,e,i){var n=e.dir,o=i&&"parentNode"===n,s=N++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,s)}:function(e,i,a){var r,l,c,d=[H,s];if(a){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(c=e[F]||(e[F]={}),l=c[e.uniqueID]||(c[e.uniqueID]={}),(r=l[n])&&r[0]===H&&r[1]===s)return d[2]=r[2];if(l[n]=d,d[2]=t(e,i,a))return!0}}}function p(t){return t.length>1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function m(t,i,n){for(var o=0,s=i.length;o<s;o++)e(t,i[o],n);return n}function u(t,e,i,n,o){for(var s,a=[],r=0,l=t.length,c=null!=e;r<l;r++)(s=t[r])&&(i&&!i(s,n,o)||(a.push(s),c&&e.push(r)));return a}function g(t,e,i,o,s,a){return o&&!o[F]&&(o=g(o)),s&&!s[F]&&(s=g(s,a)),n(function(n,a,r,l){var c,d,h,p=[],g=[],b=a.length,f=n||m(e||"*",r.nodeType?[r]:r,[]),C=!t||!n&&e?f:u(f,p,t,r,l),v=i?s||(n?t:b||o)?[]:a:C;if(i&&i(C,v,r,l),o)for(c=u(v,g),o(c,[],r,l),d=c.length;d--;)(h=c[d])&&(v[g[d]]=!(C[g[d]]=h));if(n){if(s||t){if(s){for(c=[],d=v.length;d--;)(h=v[d])&&c.push(C[d]=h);s(null,v=[],c,l)}for(d=v.length;d--;)(h=v[d])&&(c=s?Z(n,h):p[d])>-1&&(n[c]=!(a[c]=h))}}else v=u(v===a?v.splice(b,v.length):v),s?s(null,a,v,l):X.apply(a,v)})}function b(t){for(var e,i,n,o=t.length,s=_.relative[t[0].type],a=s||_.relative[" "],r=s?1:0,l=h(function(t){return t===e},a,!0),c=h(function(t){return Z(e,t)>-1},a,!0),m=[function(t,i,n){var o=!s&&(n||i!==T)||((e=i).nodeType?l(t,i,n):c(t,i,n));return e=null,o}];r<o;r++)if(i=_.relative[t[r].type])m=[h(p(m),i)];else{if(i=_.filter[t[r].type].apply(null,t[r].matches),i[F]){for(n=++r;n<o&&!_.relative[t[n].type];n++);return g(r>1&&p(m),r>1&&d(t.slice(0,r-1).concat({value:" "===t[r-2].type?"*":""})).replace(st,"$1"),i,r<n&&b(t.slice(r,n)),n<o&&b(t=t.slice(n)),n<o&&d(t))}m.push(i)}return p(m)}function f(t,i){var o=i.length>0,s=t.length>0,a=function(n,a,r,l,c){var d,h,p,m=0,g="0",b=n&&[],f=[],C=T,v=n||s&&_.find.TAG("*",c),Line truncated
|
||||||
|
return void 0!==ot&&ot.event.triggered!==e.type?ot.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(vt)||[""],c=e.length;c--;)r=Lt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m&&(h=ot.event.special[m]||{},m=(o?h.delegateType:h.bindType)||m,h=ot.event.special[m]||{},d=ot.extend({type:m,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:u.join(".")},s),(p=l[m])||(p=l[m]=[],p.delegateCount=0,h.setup&&!1!==h.setup.call(t,n,u,a)||t.addEventListener&&t.addEventListener(m,a)),h.add&&(h.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),ot.event.global[m]=!0)},remove:function(t,e,i,n,o){var s,a,r,l,c,d,h,p,m,u,g,b=xt.hasData(t)&&xt.get(t);if(b&&(l=b.events)){for(e=(e||"").match(vt)||[""],c=e.length;c--;)if(r=Lt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m){for(h=ot.event.special[m]||{},m=(n?h.delegateType:h.bindType)||m,p=l[m]||[],r=r[2]&&new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)d=p[s],!o&&g!==d.origType||i&&i.guid!==d.guid||r&&!r.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(p.splice(s,1),d.selector&&p.delegateCount--,h.remove&&h.remove.call(t,d));a&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,u,b.handle)||ot.removeEvent(t,m,b.handle),delete l[m])}else for(m in l)ot.event.remove(t,m+e[c],i,n,!0);ot.isEmptyObject(l)&&xt.remove(t,"handle events")}},dispatch:function(t){t=ot.event.fix(t);var e,i,n,o,s,a=[],r=X.call(arguments),l=(xt.get(this,"events")||{})[t.type]||[],c=ot.event.special[t.type]||{};if(r[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(a=ot.event.handlers.call(this,t,l),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(s.namespace)||(t.handleObj=s,t.data=s.data,void 0!==(n=((ot.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,r))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,s,a=[],r=e.delegateCount,l=t.target;if(r&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i<r;i++)s=e[i],o=s.selector+" ",void 0===n[o]&&(n[o]=s.needsContext?ot(o,this).index(l)>-1:ot.find(o,this,null,[l]).length),n[o]&&n.push(s);n.length&&a.push({elem:l,handlers:n})}return r<e.length&&a.push({elem:this,handlers:e.slice(r)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,o,s=e.button;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||Y,n=i.documentElement,o=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===s||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[ot.expando])return t;var e,i,n,o=t.type,s=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Ft.test(o)?this.mouseHooks:Rt.test(o)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,t=new ot.Event(s),e=n.length;e--;)i=n[e],t[i]=s[i];return t.target||(t.target=Y),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,s):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&ot.nodeName(this,"input"))return this.click(),!1},_default:function(t){return ot.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},ot.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},ot.Event=function(t,e){if(!(this instanceof ot.Event))return new ot.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?m:u):this.type=t,e&&ot.extend(this,e),this.timeStamp=t&&t.timeStamp||ot.now(),this[ot.expando]=!0},ot.Event.prototype={constructor:ot.Event,isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=m,t&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagatiLine truncated
|
||||||
|
ot.isArray(t)||t.jquery&&!ot.isPlainObject(t))ot.each(t,function(){o(this.name,this.value)});else for(i in t)j(i,t[i],e,o);return n.join("&").replace(ke,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ot.prop(this,"elements");return t?ot.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ot(this).is(":disabled")&&Be.test(this.nodeName)&&!Me.test(t)&&(this.checked||!Bt.test(t))}).map(function(t,e){var i=ot(this).val();return null==i?null:ot.isArray(i)?ot.map(i,function(t){return{name:e.name,value:t.replace(Pe,"\r\n")}}):{name:e.name,value:i.replace(Pe,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},Ee=ot.ajaxSettings.xhr();nt.cors=!!Ee&&"withCredentials"in Ee,nt.ajax=Ee=!!Ee,ot.ajaxTransport(function(e){var i,n;if(nt.cors||Ee&&!e.crossDomain)return{send:function(o,s){var a,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)r[a]=e.xhrFields[a];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===t?r.abort():"error"===t?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Ue[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ot.globalEval(t),t}}}),ot.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ot.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ot("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&o("error"===t.type?404:200,t.type)}),Y.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Ve=[],De=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ve.pop()||ot.expando+"_"+ge++;return this[t]=!0,t}}),ot.ajaxPrefilter("json jsonp",function(e,i,n){var o,s,a,r=!1!==e.jsonp&&(De.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&De.test(e.data)&&"data");if(r||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,r?e[r]=e[r].replace(De,"$1"+o):!1!==e.jsonp&&(e.url+=(be.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||ot.error(o+" was not called"),a[0]},e.dataTypes[0]="json",s=t[o],t[o]=function(){a=arguments},n.always(function(){void 0===s?ot(t).removeProp(o):t[o]=s,e[o]&&(e.jsonpCallback=i.jsonpCallback,Ve.push(o)),a&&ot.isFunction(s)&&s(a[0]),a=s=void 0}),"script"}),ot.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||Y;var n=mt.exec(t),o=!i&&[];return n?[e.createElement(n[1])]:(n=p([t],e,o),o&&o.length&&ot(o).remove(),ot.merge([],n.childNodes))};var Re=ot.fn.load;ot.fn.load=function(t,e,i){if("string"!=typeof t&&Re)return Re.apply(this,arguments);var n,o,s,a=this,r=t.indexOf(" ");return r>-1&&(n=ot.trim(t.slice(r)),t=t.slice(0,r)),ot.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&ot.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){s=arguments,a.html(n?ot("<div>").append(ot.parseHTML(t)).find(n):t)}).always(i&&function(t,e){a.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ot.fn[e]=function(t){return this.on(e,t)}}),ot.expr.filters.animated=function(t){return ot.grep(ot.timers,function(e){return t===e.elem}).length},ot.offset={setOffset:function(t,e,i){var n,o,s,a,r,l,c,d=ot.css(t,"position"),h=ot(t),p={};"static"===d&&(t.style.position="relative"),r=h.offset(),s=ot.css(t,"top"),l=ot.css(t,"left"),c=("absolute"===d||"fixed"===d)&&(s+l).indexOf("auto")>-1,c?(n=h.position(),a=n.top,o=n.left):(a=parseFloat(s)||0,o=parseFloat(l)||0),ot.isFunction(e)&&(e=e.call(t,i,ot.extend({},r))),null!=e.top&&(p.top=e.top-r.top+a),null!=e.left&&(p.left=e.left-r.left+o),"using"in e?e.using.call(t,p):h.css(p)}},ot.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ot.offset.setOffset(this,t,e)});var e,i,Line truncated
|
||||||
|
i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(e,n){var o=this.$element.find(".item.active"),s=n||this.getItemForDirection(e,o),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:c,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=t(this.$indicators.children()[this.getItemIndex(s)]);h&&h.addClass("active")}var p=t.Event("slid.bs.carousel",{relatedTarget:c,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,o.addClass(r),s.addClass(r),o.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),o.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(p)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),a&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var o=function(i){var n,o=t(this),s=t(o.attr("data-target")||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),o.data()),r=o.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),function(t){"use strict";function e(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(n)}function i(e){return this.each(function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},n.DEFAULTS,i.data(),"object"==typeof e&&e);!o&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),o||i.data("bs.collapse",o=new n(this,s)),"string"==typeof e&&o[e]()})}var n=function(e,i){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.7",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(e=o.data("bs.collapse"))&&e.transitioning)){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),e||o.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[a](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",t.proxy(o,this)).emulateTransitionEnd(n.TRANSITION_DURATION)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,n){var o=t(n);this.addAriaAndCollapsedClass(e(o),o)},this)).end()},n.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hLine truncated
|
||||||
|
this[t]=this[t]||{}},this)},initialize:function(){},onReady:function(){this.start()},start:function(){this.initializeControllers(this.controllers||{}),this.launchControllers(),this.launch.call(this)},getClasseRefs:function(e,i){var n={},o=this.allocationMap[e],s=this[o];return _.each(i,function(e){n[e]=t(e,e.indexOf(".")>-1?window:s)},this),n},initializeControllers:function(e){this.controllers={},_.each(e,function(e){var i=e.indexOf(".")>-1?window:this[this.allocationMap.controller],n=t(e,i),o=(e.split(".").pop(),new n({id:e,application:this}));o.views=this.getClasseRefs("view",o.views||[]),_.extend(this.models,this.getClasseRefs("model",o.models||[])),_.extend(this.collections,this.getClasseRefs("collection",o.collections||{})),this.buildCollections(),this.controllers[e]=o},this)},launchControllers:function(){_.each(this.controllers,function(t,e){t.onLaunch(this)},this)},launch:function(){},addListeners:function(t,e){this.eventbus.addListeners(t,e)},getController:function(t){return this.controllers[t]},getModel:function(t){this._modelsCache=this._modelsCache||{};var e=this._modelsCache[t],i=this.getModelConstructor(t);return!e&&i&&(e=this.createModel(t),this._modelsCache[t]=e),e||null},getModelConstructor:function(t){return this.models[t]},createModel:function(t,e){var i=this.getModelConstructor(t),n=null;return i&&(n=new i(_.extend(e||{}))),n},getCollection:function(t){this._collectionsCache=this._collectionsCache||{};var e=this._collectionsCache[t],i=this.getCollectionConstructor(t);return!e&&i&&(e=this.createCollection(t),this._collectionsCache[t]=e),e||null},getCollectionConstructor:function(t){return this.collections[t]},createCollection:function(t){var e=this.getCollectionConstructor(t),i=null;return e&&(i=new e),i},buildCollections:function(){_.each(this.collections,function(t,e){this.getCollection(e)},this)}}),void 0!==Backbone.Application)throw"Native Backbone.Application instance already defined.";Backbone.Application=e,Backbone.Application.extend=Backbone.Model.extend;var i=function(t){_.extend(this,t||{}),this.initialize.apply(this,arguments)};if(_.extend(i.prototype,{name:null,views:{},models:{},collections:{},initialize:function(t){},addListeners:function(t){this.getApplication().addListeners(t,this)},onLaunch:function(t){},getApplication:function(){return this.application},getView:function(t){return this._viewsCache[t]},getViewConstructor:function(t){return this.views[t]},createView:function(t,e){var i=this.getViewConstructor(t),n=_.extend(e||{},{alias:t});return this._viewsCache=this._viewsCache||{},this._viewsCache[t]=new i(n),this._viewsCache[t].options=_.extend({},n),this._viewsCache[t]},getModel:function(t){return this.application.getModel(t)},getModelConstructor:function(t){return this.application.getModelConstructor(t)},createModel:function(t,e){return this.application.createModel(t)},getCollection:function(t){return this.application.getCollection(t)},getCollectionConstructor:function(t){return this.application.getCollectionConstructor(t)},createCollection:function(t){return this.application.createCollection(t)},fireEvent:function(t,e,i){this.application.eventbus.fireEvent(t,e,i)},bindViewEvents:function(t,e){this.unbindViewEvents(t),e=_.isFunction(e)?e.call(this):e;for(var i in e){var n=e[i];_.isFunction(n)||(n=this[e[i]]);var o=i.match(/^(\S+)\s*(.*)$/),s=o[1],a=o[2];n=_.bind(n,this),s+=".bindViewEvents"+t.cid,t.$el.on(s,a,n)}return this},unbindViewEvents:function(t){return t.$el.off(".bindViewEvents"+t.cid),this}}),void 0!==Backbone.Controller)throw"Native Backbone.Controller instance already defined.";Backbone.Controller=i,Backbone.Controller.extend=Backbone.Model.extend;var n=function(t){var e=this;_.extend(this,t||{}),_.extend(Backbone.View.prototype,{alias:null,hidden:!1,getAlias:function(){return this.options.alias},fireEvent:function(t,i){this.trigger.apply(this,arguments),e.fireEvent(this.getAlias(),t,i)},hide:function(){this.$el.hide(),this.hidden=!0},show:function(){this.$el.show(),this.hidden=!1}})};if(_.extend(n.prototype,{pool:{},addListeners:function(t,e){this.pool[e.id]=this.pool[e.id]||{};var i=this.pool[e.id];_.isArray(t)?_.each(t,function(t){this.addListeners(t,e)},this):_.isObject(t)&&_.each(t,function(t,e){_.each(t,function(t,n){i[e]=i[e]||{},i[e][n]=i[e][n]||[],i[e][n].push(t)},this)},this)},fireEvent:function(t,e,i){var n=this.getApplication();_.each(this.pool,function(o,s){var a=o[t];if(a){var r=a[e],l=n.getController(s);_.each(r,function(t){t.apply(l,i)})}},this)},getApplication:function(){return this.application}}),void 0!==Backbone.EventBus)throw"Native Backbone.Application instance already defined.";Backbone.EventBus=n}(),define("core",["backbone","notification"],function(){}),void 0===Common)var Common={};if(Common.component=Common.component||{},Common.Analytics=Common.component.Analytics=new function(){var t;return{initialize:function(e,i){if(void 0===e)throw"Analytics: invalid id.";if(void 0===i||"[object String]"!==Object.prototype.toString.apply(i))tLine truncated
|
||||||
|
this.$window.append(_.template(n)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(r,this),e&&e.length>1&&(this.initConfig.minwidth=e[0]),e&&e.length>1&&(this.initConfig.minheight=e[1]),i&&i.length>1&&(this.initConfig.maxwidth=i[0]),i&&i.length>1&&(this.initConfig.maxheight=i[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=t}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">',"<label>"+this.textName+"</label>","</div>",'<div id="id-dlg-newname" class="input-row"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this;t.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!/[\t*\+:\"<>?|\\\\\/]/gim.test(e)||t.txtInvalidName+'*+:"<>?|/'}});var e=this.getChild();e.find(".btn").on("click",_.bind(this.onBtnClick,this)),t.inputNameEl=e.find("input"),t.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputName.setValue(t.options.filename),t.inputNameEl.focus().select()},100)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputName.checkValidate())return void this.inputNameEl.focus();this.options.handler.call(this,t,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(t,e){"use strict";Common.Views.Header=t.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(e),events:{"click #header-logo":function(t){var e=this.branding&&this.branding.logo&&this.branding.logo.url?this.branding.logo.url:"http://www.onlyoffice.com",i=window.open(e);i&&i.focus()}},initialize:function(t){this.options=this.options?_({}).extend(this.options,t):t,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var t=new Common.UI.MenuItem({caption:this.openNewTabText}).on("click",function(t,e){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[t]})},setVisible:function(t){t?this.show():this.hide()},setBranding:function(t){var e;this.branding=t,t&&t.logo&&t.logo.image&&(e=$("#header-logo"))&&(e.html('<img src="'+t.logo.image+'" style="max-width:86px; max-height:20px; margin: 0 8px 0 15px;"/>'),e.css({"background-image":"none",width:"auto"}))},setHeaderCaption:function(t){this.headerCaption=t;var e=$("#header-caption > div");return e&&e.html(t),t},getHeaderCaption:function(){return this.headerCaption},setDocumentCaption:function(t,e){void 0!==e&&(this.isModified=e),this.documentCaption=t,t||(t=""),this.isModified&&(t+="*");var i=$("#header-documentcaption div");return i&&i.html(Common.Utils.String.htmlEncode(t)),t},getDocumentCaption:function(){return this.documentCaption},setCanBack:function(t){this.canBack=t;var e=$("#header-back");e&&(e.off("mouseup"),e.css("display",t?"table-cell":"none"),t&&e.on("mouseup",_.bind(this.onBackClick,this)))Line truncated
|
||||||
|
e=!0):r&&!l&&(d?a.scrollLeft(a.scrollLeft()+d*s.wheelSpeed):a.scrollLeft(a.scrollLeft()-h*s.wheelSpeed),e=!0):(a.scrollTop(a.scrollTop()-h*s.wheelSpeed),a.scrollLeft(a.scrollLeft()+d*s.wheelSpeed)),P(),(e=e||U(d,h))&&(i.stopPropagation(),i.preventDefault())}),a.bind("MozMousePixelScroll"+S,function(t){e&&t.preventDefault()})},V=function(){var e=!1;a.bind("mouseenter"+S,function(t){e=!0}),a.bind("mouseleave"+S,function(t){e=!1});var i=!1;t(document).bind("keydown"+S,function(n){if(e&&!t(document.activeElement).is(":input,[contenteditable]")){var o=0,s=0;switch(n.which){case 37:o=-30;break;case 38:s=30;break;case 39:o=30;break;case 40:s=-30;break;case 33:s=90;break;case 32:case 34:s=-90;break;case 35:s=-d;break;case 36:s=d;break;default:return}a.scrollTop(a.scrollTop()-s),a.scrollLeft(a.scrollLeft()+o),i=U(o,s),i&&n.preventDefault()}})},D=function(){var t=function(t){t.stopPropagation()};y.bind("click"+S,t),v.bind("click"+S,function(t){var e=parseInt(g/2,10),i=t.pageY-v.offset().top-e,n=f-g,o=i/n;o<0?o=0:o>1&&(o=1),a.scrollTop((p-d)*o)}),_.bind("click"+S,t),C.bind("click"+S,function(t){var e=parseInt(m/2,10),i=t.pageX-C.offset().left-e,n=c-m,o=i/n;o<0?o=0:o>1&&(o=1),a.scrollLeft((h-c)*o)})},R=function(){var e=function(t,e){a.scrollTop(a.scrollTop()-e),a.scrollLeft(a.scrollLeft()-t),P()},i={},n=0,o={},s=null,r=!1;t(window).bind("touchstart"+S,function(t){r=!0}),t(window).bind("touchend"+S,function(t){r=!1}),a.bind("touchstart"+S,function(t){var e=t.originalEvent.targetTouches[0];i.pageX=e.pageX,i.pageY=e.pageY,n=(new Date).getTime(),null!==s&&clearInterval(s),t.stopPropagation()}),a.bind("touchmove"+S,function(t){if(!r&&1===t.originalEvent.targetTouches.length){var s=t.originalEvent.targetTouches[0],a={};a.pageX=s.pageX,a.pageY=s.pageY;var l=a.pageX-i.pageX,c=a.pageY-i.pageY;e(l,c),i=a;var d=(new Date).getTime(),h=d-n;h>0&&(o.x=l/h,o.y=c/h,n=d),t.preventDefault()}}),a.bind("touchend"+S,function(t){clearInterval(s),s=setInterval(function(){if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01)return void clearInterval(s);e(30*o.x,30*o.y),o.x*=.8,o.y*=.8},10)})},F=function(){a.bind("scroll"+S,function(t){P()})},L=function(){a.unbind(S),t(window).unbind(S),t(document).unbind(S),a.data("perfect-scrollbar",null),a.data("perfect-scrollbar-update",null),a.data("perfect-scrollbar-destroy",null),_.remove(),y.remove(),C.remove(),v.remove(),_=y=c=d=h=p=m=u=w=g=b=x=null},H=function(e){a.addClass("ie").addClass("ie"+e);6===e&&(function(){var e=function(){t(this).addClass("hover")},i=function(){t(this).removeClass("hover")};a.bind("mouseenter"+S,e).bind("mouseleave"+S,i),C.bind("mouseenter"+S,e).bind("mouseleave"+S,i),v.bind("mouseenter"+S,e).bind("mouseleave"+S,i),_.bind("mouseenter"+S,e).bind("mouseleave"+S,i),y.bind("mouseenter"+S,e).bind("mouseleave"+S,i)}(),function(){I=function(){_.css({left:u+a.scrollLeft(),bottom:w,width:m}),y.css({top:b+a.scrollTop(),right:x,height:g}),_.hide().show(),y.hide().show()}}())},N="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch;return function(){var t=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);t&&"msie"===t[1]&&H(parseInt(t[2],10)),P(),F(),M(),B(),D(),N&&R(),a.mousewheel&&E(),s.useKeyboard&&V(),a.data("perfect-scrollbar",a),a.data("perfect-scrollbar-update",P),a.data("perfect-scrollbar-destroy",L)}(),a})}}),void 0===Common)var Common={};if(define("common/main/lib/component/Scroller",["jmousewheel","perfectscrollbar","common/main/lib/component/BaseView"],function(){"use strict";Common.UI.Scroller=function(){var t;return _.extend(Common.UI.BaseView.extend({options:{wheelSpeed:20,wheelPropagation:!1,minScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:5,scrollYMarginOffset:5,includePadding:!0,includeMargin:!0,alwaysVisibleX:!1,alwaysVisibleY:!1},initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t),this.options.el&&this.render()},render:function(){var t=this;return t.cmpEl=$(this.el),t.rendered||(t.cmpEl.perfectScrollbar(_.extend({},t.options)),t.rendered=!0,this.setAlwaysVisibleX(t.options.alwaysVisibleX),this.setAlwaysVisibleY(t.options.alwaysVisibleY)),this},remove:function(){this.destroy(),Backbone.View.prototype.remove.call(this)},update:function(e){var i=this.options;e?(this.destroy(),i=_.extend(this.options,e),this.cmpEl.perfectScrollbar(i)):this.cmpEl.perfectScrollbar("update"),this.setAlwaysVisibleX(i.alwaysVisibleX),this.setAlwaysVisibleY(i.alwaysVisibleY);var n=function(e){t=!0;var i=function(e){$(document).unbind("mouseup",i),_.delay(function(){t=!1},10)};$(document).mouseup(i)};$(".ps-scrollbar-x-rail, .ps-scrollbar-y-rail, .ps-scrollbar-x, .ps-scrollbar-y",this.cmpEl).off("mousedown",n).on("mousedown",n)},destroy:function(){this.cmpEl.perfectScrollbar("destroy")},scrollLeft:function(t){this.cmpEl.scrollLeft(t),this.update()},scrollTop:function(t){this.cmpEl.scrollTop(t),this.update()},getScrollTop:function(){return this.cmpEl.scrollTop()},getScrollLeLine truncated
|
||||||
|
;e.innerHTML='<div class="app-error-panel"><div class="message-block"><div class="message-inner"><div class="title">Your browser is not supported.</div><div class="text">Sorry, '+t+' Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div></div></div><div class="message-auxiliary"></div></div>',document.body.appendChild(e),$("#loading-mask").hide().remove(),$("#viewport").hide().remove()},Common.Utils.applyCustomization=function(t,e){for(var i in t){var n;if(e[i]&&(n=$(e[i]),n.length)){var o=t[i];!1===o||!1===o.visible?n.hide():(o.text&&n.text(o.text),!1===o.visible&&n.hide())}}},Common.Utils.applyCustomizationPlugins=function(plugins){if(plugins&&!(plugins.length<1)){var _createXMLHTTPObject=function(){var t;try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){t=!1}}return t||"undefined"==typeof XMLHttpRequest||(t=new XMLHttpRequest),t},_getPluginCode=function(url){if(!url)return"";try{var xhrObj=_createXMLHTTPObject();xhrObj&&url&&(xhrObj.open("GET",url,!1),xhrObj.send(""),200==xhrObj.status&&eval(xhrObj.responseText))}catch(t){}return null};plugins.forEach(function(t){t&&_getPluginCode(t)})}},Common.Utils.fillUserInfo=function(t,e,i){var n=t||{};return!n.id&&(n.id="uid-"+Date.now()),_.isEmpty(n.name)?(_.isEmpty(n.firstname)&&_.isEmpty(n.lastname)&&(n.firstname=i),_.isEmpty(n.firstname)?n.fullname=n.lastname:_.isEmpty(n.lastname)?n.fullname=n.firstname:n.fullname=/^ru/.test(e)?n.lastname+" "+n.firstname:n.firstname+" "+n.lastname):n.fullname=n.name,n},String.prototype.strongMatch=function(t){if(t&&t instanceof RegExp){var e=this.toString().match(t);return!!(e&&e.length>0&&e[0].length==this.length)}return!1},define("common/main/lib/util/utils",function(){}),void 0===Common)var Common={};if(define("common/main/lib/component/ComboBox",["common/main/lib/component/BaseView","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.ComboBoxModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),value:null,displayValue:null}}}),Common.UI.ComboBoxStore=Backbone.Collection.extend({model:Common.UI.ComboBoxModel}),Common.UI.ComboBox=Common.UI.BaseView.extend(function(){return{options:{id:null,cls:"",style:"",hint:!1,editable:!0,disabled:!1,menuCls:"",menuStyle:"",displayField:"displayValue",valueField:"value",scrollAlwaysVisible:!1},template:_.template(['<span class="input-group combobox <%= cls %>" id="<%= id %>" style="<%= style %>">','<input type="text" class="form-control">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>','<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',"<% _.each(items, function(item) { %>",'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem"><%= scope.getDisplayValue(item) %></a></li>',"<% }); %>","</ul>","</span>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);this.id=e.options.id||Common.UI.getId(),this.cls=e.options.cls,this.style=e.options.style,this.menuCls=e.options.menuCls,this.menuStyle=e.options.menuStyle,this.template=e.options.template||e.template,this.itemsTemplate=e.options.itemsTemplate,this.hint=e.options.hint,this.editable=e.options.editable,this.disabled=e.options.disabled,this.store=e.options.store||new Common.UI.ComboBoxStore,this.displayField=e.options.displayField,this.valueField=e.options.valueField,this.scrollAlwaysVisible=e.options.scrollAlwaysVisible,e.rendered=e.options.rendered||!1,this.lastValue=null,e.store.add(e.options.data),e.options.el&&e.render()},render:function(t){var e=this;if(e.rendered)this.cmpEl=$(this.el);else{var i=this.store.toJSON();this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,menuCls:this.menuCls,menuStyle:this.menuStyle,items:i,scope:e})),this.itemsTemplate&&this.cmpEl.find("ul").append($(this.itemsTemplate({items:i,scope:e}))),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl)}if(!e.rendered){var n=this.cmpEl;this._input=n.find("input"),this._button=n.find(".btn"),n.on("click","a",_.bind(this.itemClicked,this)),n.on("mousedown","a",_.bind(this.itemMouseDown,this)),this.editable?(n.on("change","input",_.bind(this.onInputChanged,this)),n.on("keydown","input",_.bind(this.onInputKeyDown,this)),n.on("focusin","input",_.bind(this.onInputFocusIn,this)),n.on("click",".form-control",_.bind(this.onEditableInputClick,this))):(n.on("click",".form-control",_.bind(this.onInputClick,this)),this._input.attr("readonly","readonly"),this._input.attr("data-can-copy",!1)),e.options.hint&&(n.attr("data-toggle","tooltip"),n.tooltip({title:e.options.hint,placement:e.options.hintAnchor||"cursor"})),n.on("show.bs.dropdown",_.bind(e.onBeforeShowMenu,e)),n.on("shown.bs.dropdown",_.bind(e.onAfterShowMenu,e)),n.on("hide.bs.dropdown",_.bind(e.onBeforeHideMenLine truncated
|
||||||
|
t.calculateSizeOfContent(),e.fireEvent("comment:show",[d]),a();else if(r.hasClass("btn-inner-edit",!1)){if(o.get("dummy"))return void e.fireEvent("comment:addDummyComment",[this.getActiveTextBoxVal()]);this.clearTextBoxBind(),_.isUndefined(this.replyId)?l&&(e.fireEvent("comment:change",[d,this.getActiveTextBoxVal()]),e.fireEvent("comment:closeEditing"),t.calculateSizeOfContent()):(e.fireEvent("comment:changeReply",[d,this.replyId,this.getActiveTextBoxVal()]),this.replyId=void 0,e.fireEvent("comment:closeEditing")),a()}else if(r.hasClass("btn-inner-close",!1)){if(o.get("dummy"))return void t.hide();p&&this.getActiveTextBoxVal().length>0?(t.saveText(),o.set("hideAddReply",!1),this.getTextBox().val(t.textVal),this.autoHeightTextBox()):(this.clearTextBoxBind(),e.fireEvent("comment:closeEditing",[d])),this.replyId=void 0,t.calculateSizeOfContent(),t.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),t.calculateSizeOfContent(),a()}else if(r.hasClass("btn-resolve",!1)){var m=r.data("bs.tooltip");m&&(m.dontShow=!0),e.fireEvent("comment:resolve",[d]),a()}else if(r.hasClass("btn-resolve-check",!1)){var m=r.data("bs.tooltip");m&&(m.dontShow=!0),e.fireEvent("comment:resolve",[d]),a()}}}),t.on({show:function(){t.commentsView.autoHeightTextBox(),t.$window.find("textarea").keydown(function(e){e.keyCode==Common.UI.Keys.ESC&&t.hide()})},"animate:before":function(){var e=t.$window.find("textarea");e&&e.length&&e.focus()}})}},show:function(t,e,i,n){this.options.animate=t;var o=this.commentsView.getTextBox();e&&this.textVal&&o&&o.val(this.textVal),n&&n.length&&o&&o.val(n),Common.UI.Window.prototype.show.call(this),this.commentsView.scroller&&this.commentsView.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0}),this.hookTextBox()},hide:function(){this.handlerHide&&this.handlerHide(),Common.UI.Window.prototype.hide.call(this),_.isUndefined(this.e)||this.e.keyCode!=Common.UI.Keys.ESC||(this.e.preventDefault(),this.e.stopImmediatePropagation(),this.e=void 0)},update:function(){this.commentsView&&this.commentsView.scroller&&this.commentsView.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0})},isVisible:function(){return this.$window&&this.$window.is(":visible")},setLeftTop:function(t,e,i,n,o){if(this.$window||this.render(),n&&(t=this.arrowPosX,e=this.arrowPosY,i=this.leftX),!_.isUndefined(t)||!_.isUndefined(e)){this.arrowPosX=t,this.arrowPosY=e,this.leftX=i;var s=$("#id-comments-popover"),a=$("#id-comments-arrow"),r=$("#editor_sdk"),l=null,c=0,d="",h=0,p="",m=0,u="",g=0,b="",f=0,C=0,v=0,y=0,w=0,x=0;s&&a&&r&&r.get(0)&&(l=r.get(0).getBoundingClientRect())&&(c=l.height-2*this.sdkBounds.padding,this.$window.css({maxHeight:c+"px"}),this.sdkBounds.width=l.width,this.sdkBounds.height=l.height,_.isUndefined(t)||(d=$("#id_vertical_scroll"),d.length?h="none"!==d.css("display")?d.width():0:(d=$("#ws-v-scrollbar"),d.length&&(h="none"!==d.css("display")?d.width():0)),this.sdkBounds.width-=h,p=$("#id_panel_left"),p.length&&(m="none"!==p.css("display")?p.width():0),u=$("#id_panel_thumbnails"),u.length&&(g="none"!==u.css("display")?u.width():0,this.sdkBounds.width-=g),C=Math.min(0+t+this.arrow.width,0+this.sdkBounds.width-this.$window.outerWidth()-25),C=Math.max(0+m+this.arrow.width,C),a.removeClass("right").addClass("left"),_.isUndefined(i)||(v=this.$window.outerWidth())&&(t+v>this.sdkBounds.width-this.arrow.width+5&&this.leftX>v?(C=this.leftX-v+0-this.arrow.width,a.removeClass("left").addClass("right")):C=0+t+this.arrow.width),this.$window.css("left",C+"px")),_.isUndefined(e)||(b=$("#id_panel_top"),x=0,b.length?(f="none"!==b.css("display")?b.height():0,x+=this.sdkBounds.paddingTop):(b=$("#ws-h-scrollbar"),b.length&&(f="none"!==b.css("display")?b.height():0)),this.sdkBounds.height-=f,y=this.$window.outerHeight(),w=Math.min(0+c-y,this.arrowPosY+0-this.arrow.height),w=Math.max(w,x),this.$window.css("top",w+"px"))),o||this.calculateSizeOfContent()}},calculateSizeOfContent:function(t){if(!t||this.$window.is(":visible")){this.$window.css({overflow:"hidden"});var e=$("#id-comments-arrow"),i=$("#id-comments-popover"),n=null,o=null,s=null,a=0,r="",l=0,c=0,d=0,h=0,p=0,m=0;i&&e&&i.get(0)&&(i.css({height:"100%"}),(n=i.get(0).getBoundingClientRect())&&(o=$("#editor_sdk"))&&o.get(0)&&(s=o.get(0).getBoundingClientRect())&&(a=s.height-2*this.sdkBounds.padding,m=0,d=this.$window.outerHeight(),r=$("#id_panel_top"),r.length?(l="none"!==r.css("display")?r.height():0,m+=this.sdkBounds.paddingTop):(r=$("#ws-h-scrollbar"),r.length&&(l="none"!==r.css("display")?r.height():0)),h=Math.max(i.outerHeight(),this.$window.outerHeight()),a<=h?(this.$window.css({maxHeight:a-l+"px",top:0+l+"px"}),i.css({height:a-l-3+"px"}),c=Math.min(c,a-(l+this.arrow.margin+this.arrow.width)),e.css({top:c+"px"})):(h=d,h>0&&(n.top+h>a+0||0===n.height)&&(p=Math.min(0+a-h,this.arrowPosY+0-this.arrow.height),p=Math.max(p,m),this.$window.css({top:p+"px"})),c=Math.max(this.arrow.margin,this.arrowPosY-(a-h)-this.arrow.width),c=Math.min(c,h-this.arrow.margin-this.arrow.width),e.css({top:c+"px"Line truncated
|
||||||
|
this.pluginsMask.css("display",t?"block":"none"))},openInsideMode:function(t,e){return!!this.pluginsPanel&&(this.pluginsPanel.toggleClass("hidden",!0),this.currentPluginPanel.toggleClass("hidden",!1),this.pluginName.text(t),this.iframePlugin||(this.iframePlugin=document.createElement("iframe"),this.iframePlugin.id="plugin_iframe",this.iframePlugin.name="pluginFrameEditor",this.iframePlugin.width="100%",this.iframePlugin.height="100%",this.iframePlugin.align="top",this.iframePlugin.frameBorder=0,this.iframePlugin.scrolling="no",this.iframePlugin.onload=_.bind(this._onLoad,this),this.currentPluginFrame.append(this.iframePlugin),this.loadMask||(this.loadMask=new Common.UI.LoadMask({owner:this.currentPluginFrame})),this.loadMask.setTitle(this.textLoading),this.loadMask.show(),this.iframePlugin.src=e),!0)},closeInsideMode:function(){this.pluginsPanel&&(this.iframePlugin&&(this.currentPluginFrame.empty(),this.iframePlugin=null),this.currentPluginPanel.toggleClass("hidden",!0),this.pluginsPanel.toggleClass("hidden",!1))},openNotVisualMode:function(t){var e=this.viewPluginsList.store.findWhere({guid:t});e&&this.viewPluginsList.cmpEl.find("#"+e.get("id")).parent().addClass("selected")},closeNotVisualMode:function(){this.viewPluginsList.cmpEl.find(".selected").removeClass("selected")},_onLoad:function(){this.loadMask&&this.loadMask.hide()},strPlugins:"Plugins",textLoading:"Loading",textStart:"Start"},Common.Views.Plugins||{})),Common.Views.PluginDlg=Common.UI.Window.extend(_.extend({initialize:function(t){var e={};_.extend(e,{cls:"advanced-settings-dlg",header:!0,enableKeyEvents:!1},t);var i=e.buttons&&_.size(e.buttons)>0?85:34;e.width=Common.Utils.innerWidth()-e.width<0?Common.Utils.innerWidth():e.width,e.height+=i,e.height=Common.Utils.innerHeight()-e.height<0?Common.Utils.innerHeight():e.height,this.template=['<div id="id-plugin-container" class="box" style="height:'+(e.height-i)+'px;">','<div id="id-plugin-placeholder" style="width: 100%;height: 100%;"></div>',"</div>","<% if (_.size(buttons) > 0) { %>",'<div class="separator horizontal"/>','<div class="footer" style="text-align: center;">',"<% for(var bt in buttons) { %>",'<button class="btn normal dlg-btn <%= buttons[bt].cls %>" result="<%= bt %>" style="margin-right: 10px;"><%= buttons[bt].text %></button>',"<% } %>","</div>","<% } %>"].join(""),e.tpl=_.template(this.template,e),this.url=t.url||"",Common.UI.Window.prototype.initialize.call(this,e)},render:function(){Common.UI.Window.prototype.render.call(this),this.$window.find("> .body").css({height:"auto",overflow:"hidden"}),this.boxEl=this.$window.find(".body > .box"),this._headerFooterHeight=this.options.buttons&&_.size(this.options.buttons)>0?85:34,this._headerFooterHeight+=parseInt(this.$window.css("border-top-width"))+parseInt(this.$window.css("border-bottom-width"));var t=document.createElement("iframe");t.id="plugin_iframe",t.name="pluginFrameEditor",t.width="100%",t.height="100%",t.align="top",t.frameBorder=0,t.scrolling="no",t.onload=_.bind(this._onLoad,this);var e=this;setTimeout(function(){e.isLoaded||(e.loadMask=new Common.UI.LoadMask({owner:$("#id-plugin-placeholder")}),e.loadMask.setTitle(e.textLoading),e.loadMask.show(),e.isLoaded&&e.loadMask.hide())},500),t.src=this.url,$("#id-plugin-placeholder").append(t),this.on("resizing",function(t){e.boxEl.css("height",parseInt(e.$window.css("height"))-e._headerFooterHeight)})},_onLoad:function(){this.isLoaded=!0,this.loadMask&&this.loadMask.hide()},setInnerSize:function(t,e){var i=Common.Utils.innerHeight(),n=Common.Utils.innerWidth(),o=parseInt(this.$window.css("border-left-width"))+parseInt(this.$window.css("border-right-width"));i<e+this._headerFooterHeight&&(e=i-this._headerFooterHeight),n<t+o&&(t=n-o),this.boxEl.css("height",e),Common.UI.Window.prototype.setHeight.call(this,e+this._headerFooterHeight),Common.UI.Window.prototype.setWidth.call(this,t+o),this.$window.css("left",(n-t-o)/2),this.$window.css("top",(i-e-this._headerFooterHeight)/2*.9)},textLoading:"Loading"},Common.Views.PluginDlg||{}))}),define("common/main/lib/view/SearchDialog",["common/main/lib/component/Window"],function(){"use strict";Common.UI.SearchDialog=Common.UI.Window.extend(_.extend({options:{width:550,title:"Search & Replace",modal:!1,cls:"search",toolclose:"hide",alias:"SearchDialog"},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">','<span class="btn-placeholder" id="search-placeholder-btn-options"></span>','<input type="text" id="sd-text-search" class="form-control" maxlength="100" placeholder="'+this.textSearchStart+'">',"</div>",'<div class="input-row">','<input type="text" id="sd-text-replace" class="form-control" maxlength="100" placeholder="'+this.textReplaceDef+'">',"</div>",'<div class="input-row">','<label class="link" id="search-label-replace" result="replaceshow">'+this.txtBtnReplace+"</label>","</div>","</div>",'<div class="separator horizontal"/>','<div class="footer right">','<button class="btn
Line truncated
|
||||||
|
;if(e.cmpEl.hasClass("dropdown-submenu")&&e.cmpEl.hasClass("over")&&(t&&t.relatedTarget&&e.cmpEl.find(t.relatedTarget).length>0||e.cmpEl.hasClass("focused-submenu")))return void e.cmpEl.removeClass("focused-submenu");if(e.menu&&!e.disabled&&(clearTimeout(e.expandMenuTimer),e.hideMenuTimer=_.delay(function(){e.menu.isOver||e.cmpEl.removeClass("over")},200),t&&"focusout"!==t.type)){var i=e.cmpEl.children(":focus");i.length>0&&(i.blur(),e.cmpEl.closest("ul").focus())}}}),Common.UI.MenuItemSeparator=function(t){return t=t||{},t.caption="--",new Common.UI.MenuItem(t)}}),void 0===Common)var Common={};if(define("common/main/lib/component/Menu",["common/main/lib/extend/Bootstrap","common/main/lib/component/BaseView","common/main/lib/component/MenuItem","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.Menu=function(){var t=function(){var t=[],e={};return{register:function(i){e[i.id]=i,i.on("show:after",function(e){t.push(e)}).on("hide:after",function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})},unregister:function(i){var n=t.indexOf(i);delete e[i.id],n>-1&&t.splice(n,1),i.off("show:after").off("hide:after")},hideAll:function(){return Common.NotificationCenter.trigger("menumanager:hideall"),!!(t&&t.length>0)&&(_.each(t,function(t){t&&t.hide()}),!0)}}}();return _.extend(Common.UI.BaseView.extend({options:{cls:"",style:"",itemTemplate:null,items:[],menuAlign:"tl-bl",menuAlignEl:null,offset:[0,0],cyclic:!0},template:_.template(['<ul class="dropdown-menu <%= options.cls %>" oo_editor_input="true" style="<%= options.style %>" role="menu"></ul>'].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var i=this;this.id=this.options.id||Common.UI.getId(),this.itemTemplate=this.options.itemTemplate||Common.UI.MenuItem.prototype.template,this.rendered=!1,this.items=[],this.offset=[0,0],this.menuAlign=this.options.menuAlign,this.menuAlignEl=this.options.menuAlignEl,this.options.cyclic||(this.options.cls+=" no-cyclic"),_.each(this.options.items,function(t){t instanceof Common.UI.MenuItem?i.items.push(t):i.items.push(new Common.UI.MenuItem(_.extend({tagName:"li",template:i.itemTemplate},t)))}),this.options.el&&this.render(),t.register(this)},remove:function(){t.unregister(this),Common.UI.BaseView.prototype.remove.call(this)},render:function(t){var e=this;this.trigger("render:before",this),this.cmpEl=$(this.el),t?(this.setElement(t,!1),e.rendered||(this.cmpEl=$(this.template({options:e.options})),t.append(this.cmpEl))):e.rendered||(this.cmpEl=this.template({options:e.options}),$(this.el).append(this.cmpEl));var i=this.cmpEl.parent(),n="menu"===i.attr("role")?i:i.find("[role=menu]");return n&&(e.rendered||_.each(e.items||[],function(t){n.append(t.render().el),t.on("click",_.bind(e.onItemClick,e)),t.on("toggle",_.bind(e.onItemToggle,e))}),n.css({"max-height":e.options.maxHeight||"none",position:"fixed",right:"auto",left:-1e3,top:-1e3}),this.parentEl=n.parent(),this.parentEl.on("show.bs.dropdown",_.bind(e.onBeforeShowMenu,e)),this.parentEl.on("shown.bs.dropdown",_.bind(e.onAfterShowMenu,e)),this.parentEl.on("hide.bs.dropdown",_.bind(e.onBeforeHideMenu,e)),this.parentEl.on("hidden.bs.dropdown",_.bind(e.onAfterHideMenu,e)),this.parentEl.on("keydown.after.bs.dropdown",_.bind(e.onAfterKeydownMenu,e)),n.on("scroll",_.bind(e.onScroll,e)),n.hover(function(t){e.isOver=!0},function(t){e.isOver=!1})),this.rendered=!0,this.trigger("render:after",this),this},isVisible:function(){return this.rendered&&this.cmpEl.is(":visible")},show:function(){this.rendered&&this.parentEl&&!this.parentEl.hasClass("open")&&this.cmpEl.dropdown("toggle")},hide:function(){this.rendered&&this.parentEl&&(this.parentEl.hasClass("open")?this.cmpEl.dropdown("toggle"):this.parentEl.hasClass("over")&&this.parentEl.removeClass("over"))},insertItem:function(t,e){var i=this,n=this.cmpEl;if(e instanceof Common.UI.MenuItem||(e=new Common.UI.MenuItem(_.extend({tagName:"li",template:i.itemTemplate},e))),t<0||t>=i.items.length?i.items.push(e):i.items.splice(t,0,e),this.rendered){var o="menu"===n.attr("role")?n:n.find("[role=menu]");o&&(t<0?o.append(e.render().el):0===t?o.prepend(e.render().el):$("li:nth-child("+(t+1)+")",o).before(e.render().el),e.on("click",_.bind(i.onItemClick,i)),e.on("toggle",_.bind(i.onItemToggle,i)))}},doLayout:function(){if(this.options.maxHeight>0){if(!this.rendered)return void(this.mustLayout=!0);var t=this.cmpEl,e="menu"===t.attr("role")?t:t.find("[role=menu]");if(!e.is(":visible")){var i=[e.css("left"),e.css("top")];e.css({left:"-1000px",top:"-1000px",display:"block"})}var n=e.find("li");if(n.height()*n.length>this.options.maxHeight){var o='<div class="menu-scroll top"></div>';e.prepend(o),o='<div class="menu-scroll bottom"></div>',e.append(o),e.css({"box-shadow":"none","overflow-y":"hidden","padding-top":"18px"}),e.find("> li:last-of-type").css("margin-bottom",18);var s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";!function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):Line truncated
|
||||||
|
var e=_.isFunction(t.get_Name)?t.get_Name():t.asc_getName();if(this.getRawValue()!==e){var i=this.store.findWhere({name:e});if($(".selected",$(this.el)).removeClass("selected"),i){this.setRawValue(i.get(this.displayField));var n=$("#"+i.get("id"),$(this.el)),o=$("ul.dropdown-menu",this.cmpEl);n&&o&&(n.addClass("selected"),this.recent<=0&&o.scrollTop(n.offset().top-o.offset().top))}else this.setRawValue(e)}},itemClicked:function(t){var e=$(t.target).closest("li"),i=this.store.findWhere({id:e.attr("id")});this.addItemToRecent(i),Common.UI.ComboBox.prototype.itemClicked.apply(this,arguments)},onInsertItem:function(t){$(this.el).find("ul").prepend(_.template(['<li id="<%= item.id %>">','<a class="font-item" tabindex="-1" type="menuitem" style="vertical-align:middle; margin: 0 0 0 -10px; height:<%=scope.getListItemHeight()%>px;"/>',"</li>"].join(""),{item:t.attributes,scope:this}))},onRemoveItem:function(t,e,i){$(this.el).find("ul > li#"+t.id).remove()},onBeforeShowMenu:function(t){if(Common.UI.ComboBox.prototype.onBeforeShowMenu.apply(this,arguments),!this.getSelectedRecord()&&this.getRawValue()){var e=this.store.where({name:this.getRawValue()});e&&e.length&&this.selectRecord(e[e.length-1])}},onAfterShowMenu:function(t){this.recent>0?(this.scroller&&!this._scrollerIsInited&&(this.scroller.update(),this._scrollerIsInited=!0),$(this.el).find("ul").scrollTop(0),this.trigger("show:after",this,t)):Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this,arguments),this.flushVisibleFontsTiles(),this.updateVisibleFontsTiles(null,0)},onAfterHideMenu:function(t){this.lastValue!==this._input.val()&&this._input.val(this.lastValue),Common.UI.ComboBox.prototype.onAfterHideMenu.apply(this,arguments)},addItemToRecent:function(t){if(t.get("type")!=FONT_TYPE_RECENT&&!this.store.findWhere({name:t.get("name"),type:FONT_TYPE_RECENT})){var e=this.store.where({type:FONT_TYPE_RECENT});e.length<this.recent||this.store.remove(e[this.recent-1]);var i=t.clone();i.set({type:FONT_TYPE_RECENT,id:Common.UI.getId(),cloneid:t.id}),this.store.add(i,{at:0})}},selectCandidate:function(t){var e=this,i=this._input.val().toLowerCase();this._fontsArray||(this._fontsArray=this.store.toJSON());var n=_.find(this._fontsArray,function(n){return t?n[e.displayField].toLowerCase()==i:0==n[e.displayField].toLowerCase().indexOf(i)});if(this._selectedItem=n?this.store.findWhere({id:n.id}):null,$(".selected",$(this.el)).removeClass("selected"),this._selectedItem){var o=$("#"+this._selectedItem.get("id"),$(this.el)),s=$("ul[role=menu]",$(this.el));if(o.length>0&&s.length>0){o.addClass("selected");var a=o.position().top,r=s.scrollTop();0!=a&&s.scrollTop(r+a)}}},updateVisibleFontsTiles:function(i,n){var o=this,s=0,a=o.store.length,r=0;if(o.tiles||(o.tiles=[]),a!==o.tiles.length)for(s=o.tiles.length;s<a;++s)o.tiles.unshift(null);_.isUndefined(n)&&(n=parseInt($(o.el).find(".ps-scrollbar-x-rail").css("bottom")));var l=$(o.el).find(".dropdown-menu").height(),c=Math.max(Math.floor(l/36)+3,0),d=Math.max(Math.floor(-n/36)-1,0),h=d+c,p=$(o.el).find("a");for(s=0;s<a;++s)if(d<=s&&s<h){if(null===o.tiles[s]){var m=document.createElement("canvas"),u=m.getContext("2d");m.height=e?2*t:t,m.width=e?604:302,m.style.width="302px",m.style.height=t+"px",r=o.store.at(s).get("imgidx"),e?(u.clearRect(0,0,604,2*t),u.drawImage(o.spriteThumbs,0,2*-Asc.FONT_THUMBNAIL_HEIGHT*r)):(u.clearRect(0,0,302,t),u.drawImage(o.spriteThumbs,0,-Asc.FONT_THUMBNAIL_HEIGHT*r)),o.tiles[s]=m,$(p[s]).get(0).appendChild(m)}}else o.tiles[s]&&(o.tiles[s].parentNode.removeChild(o.tiles[s]),o.tiles[s]=null)},flushVisibleFontsTiles:function(){for(var t=this.tiles.length-1;t>=0;--t)this.tiles[t]&&(this.tiles[t].parentNode.removeChild(this.tiles[t]),this.tiles[t]=null)}}}())}),void 0===Common)var Common={};if(define("common/main/lib/component/MetricSpinner",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.MetricSpinner=Common.UI.BaseView.extend({options:{minValue:0,maxValue:100,step:1,defaultUnit:"px",allowAuto:!1,autoText:"Auto",hold:!0,speed:"medium",width:90,allowDecimal:!0},disabled:!1,value:"0 px",rendered:!1,template:'<input type="text" class="form-control"><div class="spinner-buttons"><button type="button" class="spinner-up"><i class="img-commonctrl"></i></button><button type="button" class="spinner-down"><i class="img-commonctrl"></i></button></div>',initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=$(this.el);e.addClass("spinner"),e.on("mousedown",".spinner-up",_.bind(this.onMouseDown,this,!0)),e.on("mousedown",".spinner-down",_.bind(this.onMouseDown,this,!1)),e.on("mouseup",".spinner-up",_.bind(this.onMouseUp,this,!0)),e.on("mouseup",".spinner-down",_.bind(this.onMouseUp,this,!1)),e.on("mouseover",".spinner-up, .spinner-down",_.bind(this.onMouseOver,this)),e.on("mouseout",".spinner-up, .spinner-down",_.bind(this.onMouseOut,this)),e.on("keydown",".form-control",_.bind(this.onKeyDown,this)),e.on("keyup",".form-control",_.bind(this.onKeyUp,this)),e.on("blur"Line truncated
|
||||||
|
h:d,s:h,b:p})}},f=function(t,e,i){$(document).on("mouseup",C),$(document).on("mousemove",g)},C=function(t,e,i){$(document).off("mouseup",C),$(document).off("mousemove",g),g(t)},v=function(t,e,i){$(document).on("mouseup",_),$(document).on("mousemove",b),b(t)},_=function(t,e,i){$(document).off("mouseup",_),$(document).off("mousemove",b)},y=function(t){var e=new Common.util.RGBColor(c.color).toHSB();m(e,!0)},w=function(t){var m,g=$(c.el);g&&(e=g.find(".cnt-hb-arrow"),i=g.find(".cnt-sat-arrow"),n=g.find(".cnt-hb"),o=g.find(".cnt-sat"),s=g.find(".color-value"),r=g.find(".color-text"),l=g.find(".empty-color"),s.length>0&&(a=s.find(".transparent-color")),n.length>0&&(n.off("mousedown"),n.on("mousedown",f)),o.length>0&&(o.off("mousedown"),o.on("mousedown",v)),l.length>0&&(l.off("click"),l.on("click",y)),m="transparent"==c.color?{h:0,s:100,b:100}:new Common.Utils.RGBColor(c.color).toHSB(),d=m.h,h=m.s,p=m.b,d==h&&d==p&&0==d&&(h=100),u())};c.setColor=function(t){if(c.color!=t){var e;e="transparent"==t?{h:0,s:100,b:100}:new Common.Utils.RGBColor(t).toHSB(),d=e.h,h=e.s,p=e.b,d==h&&d==p&&0==d&&(h=100),c.color=t,u()}},c.getColor=function(){return c.color},c.on("render:after",w),c.render()},render:function(){return $(this.el).html(this.template()),this.trigger("render:after",this),this},textNoColor:"No Color"})}),void 0===Common)var Common={};if(define("common/main/lib/component/MaskedField",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.MaskedField=Common.UI.BaseView.extend({options:{maskExp:"",maxLength:999},initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this,i=$(this.el);i.addClass("masked-field user-select"),i.attr("maxlength",e.options.maxLength),i.on("keypress",function(t){var n=String.fromCharCode(t.which);e.options.maskExp.test(n)||t.ctrlKey||t.keyCode===Common.UI.Keys.DELETE||t.keyCode===Common.UI.Keys.BACKSPACE||t.keyCode===Common.UI.Keys.LEFT||t.keyCode===Common.UI.Keys.RIGHT||t.keyCode===Common.UI.Keys.HOME||t.keyCode===Common.UI.Keys.END||t.keyCode===Common.UI.Keys.ESC||t.keyCode===Common.UI.Keys.INSERT||t.keyCode===Common.UI.Keys.TAB||(t.keyCode==Common.UI.Keys.RETURN&&e.trigger("changed",e,i.val()),t.preventDefault(),t.stopPropagation())}),i.on("input",function(t){e.trigger("change",e,i.val())}),i.on("blur",function(t){e.trigger("changed",e,i.val())})},render:function(){return this},setValue:function(t){this.options.maskExp.test(t)&&t.length<=this.options.maxLength&&$(this.el).val(t)},getValue:function(){$(this.el).val()}})}),void 0===Common)var Common={};if(define("common/main/lib/view/ExtendedColorDialog",["text!common/main/lib/template/ExtendedColorDialog.template","common/main/lib/component/HSBColorPicker","common/main/lib/component/MetricSpinner","common/main/lib/component/MaskedField","common/main/lib/component/Window"],function(t){"use strict";Common.UI.ExtendedColorDialog=Common.UI.Window.extend(_.extend({tpl:_.template(t),options:{},rendered:!1,initialize:function(t){Common.UI.Window.prototype.initialize.call(this,{cls:"extended-color-dlg",tpl:this.tpl({txtNew:this.textNew,txtCurrent:this.textCurrent,txtAdd:this.addButtonText,txtCancel:this.cancelButtonText}),header:!1,width:340,height:272}),this.hexRe=/\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/},render:function(){function t(t){e.trigger("onmodalresult",parseInt(t.currentTarget.attributes.result.value)),e.close(!0)}var e=this;return Common.UI.Window.prototype.render.call(this),this.colorsPicker=new Common.UI.HSBColorPicker({el:$("#id-hsb-colorpicker"),showCurrentColor:!1}),this.colorsPicker.on("changecolor",_.bind(this.onChangeColor,this)),this.colorNew=$("#field-new-color"),this.colorSaved=$("#field-start-color"),this.spinR=new Common.UI.MetricSpinner({el:$("#extended-spin-r"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:1,maskExp:/[0-9]/,allowDecimal:!1}),this.spinG=new Common.UI.MetricSpinner({el:$("#extended-spin-g"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:2,maskExp:/[0-9]/,allowDecimal:!1}),this.spinB=new Common.UI.MetricSpinner({el:$("#extended-spin-b"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:3,maskExp:/[0-9]/,allowDecimal:!1}),this.textColor=new Common.UI.MaskedField({el:$("#extended-text-color"),width:55,maskExp:/[a-fA-F0-9]/,maxLength:6}),this.spinR.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,1)),this.spinG.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,2)),this.spinB.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,3)),this.textColor.on("change",_.bind(this.onChangeMaskedField,this)),this.textColor.on("changed",_.bind(this.onChangedMaskedField,this)),this.textColor.$el.attr("tabindex",4),this.spinR.$el.find("input").attr("maxlength",3),this.spinG.$el.find("input").attr("maxlength",3),this.spinB.$el.findLine truncated
|
||||||
|
t._changedProps&&(t.cmbWidth.suspendEvents(),t.cmbWidth.setValue(this._arrWidth[1].value),t.cmbWidth.resumeEvents(),t._changedProps.put_W(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},t)),this._arrHeight=[{displayValue:this.textAuto,value:0},{displayValue:this.textExact,value:1},{displayValue:this.textAtLeast,value:2}],this.cmbHeight=new Common.UI.ComboBox({el:$("#frame-advanced-input-heighttype"),cls:"input-group-nr",menuStyle:"min-width: 130px;",editable:!1,data:this._arrHeight}).on("selected",_.bind(function(e,i){t._changedProps&&(t.spnHeight.suspendEvents(),t.spnHeight.setValue(0==i.value?"":1),t.spnHeight.resumeEvents(),t._changedProps.put_HRule(0==i.value?Asc.linerule_Auto:1==i.value?Asc.linerule_Exact:Asc.linerule_AtLeast),i.value>0&&this._changedProps.put_H(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue())))},t)),this.cmbHeight.setValue(this._arrHeight[0].value),this.spnHeight=new Common.UI.MetricSpinner({el:$("#frame-advanced-input-height"),maxValue:55.88,minValue:.02,step:.1,defaultUnit:"cm",value:""}).on("change",_.bind(function(e,i,n){if(t._changedProps){var o=Asc.linerule_Auto;t.cmbHeight.getValue()==t._arrHeight[1].value?o=Asc.linerule_Exact:t.cmbHeight.getValue()==t._arrHeight[2].value&&(o=Asc.linerule_AtLeast),o==Asc.linerule_Auto&&(t.cmbHeight.suspendEvents(),t.cmbHeight.setValue(t._arrHeight[2].value),o=Asc.linerule_AtLeast,t.cmbHeight.resumeEvents()),t._changedProps.put_HRule(o),t._changedProps.put_H(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue()))}},t)),this.spnX=new Common.UI.MetricSpinner({el:$("#frame-advanced-input-hdist"),maxValue:55.87,minValue:0,step:.1,defaultUnit:"cm",value:"0 cm",width:"auto"}).on("change",_.bind(function(e,i,n){t._changedProps&&t._changedProps.put_HSpace(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue()))},t)),this.spnY=new Common.UI.MetricSpinner({el:$("#frame-advanced-input-vdist"),maxValue:55.87,minValue:0,step:.1,defaultUnit:"cm",value:"0 cm",width:"auto"}).on("change",_.bind(function(e,i,n){t._changedProps&&t._changedProps.put_VSpace(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue()))},t)),this._arrHAlign=[{displayValue:this.textLeft,value:Asc.c_oAscXAlign.Left},{displayValue:this.textCenter,value:Asc.c_oAscXAlign.Center},{displayValue:this.textRight,value:Asc.c_oAscXAlign.Right}],this.cmbHAlign=new Common.UI.ComboBox({el:$("#frame-advanced-input-hposition"),cls:"input-group-nr",menuStyle:"min-width: 130px;",data:this._arrHAlign}).on("changed:after",_.bind(function(e,i){t._changedProps&&(t._changedProps.put_XAlign(void 0),t._changedProps.put_X(Common.Utils.Metric.fnRecalcToMM(parseFloat(i.value))))},t)).on("selected",_.bind(function(e,i){t._changedProps&&t._changedProps.put_XAlign(i.value)},t)),this.cmbHAlign.setValue(this._arrHAlign[0].value),this._arrHRelative=[{displayValue:this.textMargin,value:Asc.c_oAscHAnchor.Margin},{displayValue:this.textPage,value:Asc.c_oAscHAnchor.Page},{displayValue:this.textColumn,value:Asc.c_oAscHAnchor.Text}],this.cmbHRelative=new Common.UI.ComboBox({el:$("#frame-advanced-input-hrelative"),cls:"input-group-nr",menuStyle:"min-width: 95px;",data:this._arrHRelative,editable:!1}).on("selected",_.bind(function(e,i){t._changedProps&&t._changedProps.put_HAnchor(i.value)},t)),this.cmbHRelative.setValue(this._arrHRelative[1].value),this._arrVAlign=[{displayValue:this.textTop,value:Asc.c_oAscYAlign.Top},{displayValue:this.textCenter,value:Asc.c_oAscYAlign.Center},{displayValue:this.textBottom,value:Asc.c_oAscYAlign.Bottom}],this.cmbVAlign=new Common.UI.ComboBox({el:$("#frame-advanced-input-vposition"),cls:"input-group-nr",menuStyle:"min-width: 130px;",data:this._arrVAlign}).on("changed:after",_.bind(function(e,i){t._changedProps&&(t._changedProps.put_YAlign(void 0),t._changedProps.put_Y(Common.Utils.Metric.fnRecalcToMM(parseFloat(i.value))))},t)).on("selected",_.bind(function(e,i){t._changedProps&&t._changedProps.put_YAlign(i.value)},t)),this.cmbVAlign.setValue(this._arrVAlign[0].value),this._arrVRelative=[{displayValue:this.textMargin,value:Asc.c_oAscVAnchor.Margin},{displayValue:this.textPage,value:Asc.c_oAscVAnchor.Page},{displayValue:this.textParagraph,value:Asc.c_oAscVAnchor.Text}],this.cmbVRelative=new Common.UI.ComboBox({el:$("#frame-advanced-input-vrelative"),cls:"input-group-nr",menuStyle:"min-width: 95px;",data:this._arrVRelative,editable:!1}).on("selected",_.bind(function(e,i){t._changedProps&&(t._changedProps.put_VAnchor(i.value),this.chMove.setValue(i.value==Asc.c_oAscVAnchor.Text,!0))},t)),this.cmbVRelative.setValue(this._arrVRelative[2].value),this.chMove=new Common.UI.CheckBox({el:$("#frame-advanced-checkbox-move"),labelText:this.textMove}).on("change",_.bind(function(e,i){if(t._changedProps){var n=this.cmbVRelative.store.at("checked"==i?2:1);t.cmbVRelative.setValue(n.get("value")),t._changedProps.put_VAnchor(n.get("value"))}},t)),this.btnNone.render($("#drop-advanced-button-none")),this.btnInText.render($("#drop-advanced-button-intext")),this.btnInMargin.render($("#drop-advanced-buLine truncated
|
||||||
|
maxLength:Asc.c_oAscMaxTooltipLength}),e.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.find("input").on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputUrl.cmpEl.find("input").focus()},500)},setSettings:function(t){if(t){var e=this;t.get_Value()?e.inputUrl.setValue(t.get_Value().replace(new RegExp(" ","g"),"%20")):e.inputUrl.setValue(""),null!==t.get_Text()?(e.inputDisplay.setValue(t.get_Text()),e.inputDisplay.setDisabled(!1)):(e.inputDisplay.setValue(this.textDefault),e.inputDisplay.setDisabled(!0)),this.isTextChanged=!1,e.inputTip.setValue(t.get_ToolTip())}},getSettings:function(){var t=this,e=new Asc.CHyperlinkProperty,i=$.trim(t.inputUrl.getValue());return/(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(i)||(i=(t.isEmail?"mailto:":"http://")+i),i=i.replace(new RegExp("%20","g")," "),e.put_Value(i),t.inputDisplay.isDisabled()||!this.isTextChanged&&!_.isEmpty(t.inputDisplay.getValue())?e.put_Text(null):(_.isEmpty(t.inputDisplay.getValue())&&t.inputDisplay.setValue(i),e.put_Text(t.inputDisplay.getValue())),e.put_ToolTip(t.inputTip.getValue()),e},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onKeyPress:function(t){if(t.keyCode==Common.UI.Keys.RETURN)return this._handleInput("ok"),!1},_handleInput:function(t){if(this.options.handler){if("ok"==t){var e=this.inputUrl.checkValidate(),i=this.inputDisplay.checkValidate();if(!0!==e)return void this.inputUrl.cmpEl.find("input").focus();if(!0!==i)return void this.inputDisplay.cmpEl.find("input").focus()}this.options.handler.call(this,this,t)}this.close()},textUrl:"Link to",textDisplay:"Display",cancelButtonText:"Cancel",okButtonText:"Ok",txtEmpty:"This field is required",txtNotUrl:'This field should be a URL in the format "http://www.example.com"',textTooltip:"ScreenTip text",textDefault:"Selected text",textTitle:"Hyperlink Settings"},DE.Views.HyperlinkSettingsDialog||{}))}),define("text!documenteditor/main/app/template/ParagraphSettingsAdvanced.template",[],function(){return'<div id="id-adv-paragraph-indents" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="3" style="width: 100%;">\r\n <tr>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsFirstLine %></label>\r\n <div id="paragraphadv-spin-first-line" style="width: 85px;"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsLeftText %></label>\r\n <div id="paragraphadv-spin-indent-left"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsRightText %></label>\r\n <div id="paragraphadv-spin-indent-right"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="separator horizontal padding-large text-only"></div>\r\n <div class="inner-content text-only" style="padding-right: 0px;" >\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-break-before"></div>\r\n </td>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-keep-lines"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-orphan"></div>\r\n </td>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-keep-next"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-adv-paragraph-borders" class="settings-panel">\r\n <div class="inner-content">\r\n <div style="width: 100%;" class="padding-small">\r\n <label class="input-label"><%= scope.textBorderWidth %></label>\r\n <div id="paragraphadv-combo-border-size" style="display: inline-block; vertical-align: middle; width: 93px;"></div>\r\n <div style="display: inline-block; float:right;vertical-align: middle;">\r\n <label class="input-label" ><%= scope.textBorderColor %></label>\r\n <div id="paragraphadv-border-color-btn" style="display: inline-block;"></div>\r\n </div>\r\n </div>\r\n <label class="input-label padding-small" style="width: 100%;"><%= scope.textBorderDesc %></label>\r\n <div style="width: 100%;" class="padding-large">\r\n <div id="id-deparagraphstyler" style="display: inline-block; vertical-align: middle; width: 200px; height: 170px;outline: 1px solid #ccc;"></div>\r\n <div style="display: inline-block; float:rigLine truncated
|
||||||
|
i=null!==e&&void 0!==e&&null!==e.get_Space()&&void 0!==e.get_Space()?Common.Utils.Metric.fnRecalcFromMM(e.get_Space()):"",this.spnMarginBottom.setValue(i,!0)}var n=t.get_Shade();if(null!==n&&void 0!==n&&n.get_Value()===Asc.c_oAscShdClear){var o=n.get_Color();o?o.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.paragraphShade={color:Common.Utils.ThemeColor.getHexColor(o.get_r(),o.get_g(),o.get_b()),effectValue:o.get_value()}:this.paragraphShade=Common.Utils.ThemeColor.getHexColor(o.get_r(),o.get_g(),o.get_b()):this.paragraphShade="transparent"}else this.paragraphShade="transparent";if(this.btnBackColor.setColor(this.paragraphShade),"object"==typeof this.paragraphShade){for(var s=!1,a=0;a<10;a++)if(Common.Utils.ThemeColor.ThemeValues[a]==this.paragraphShade.effectValue){this.colorsBack.select(this.paragraphShade,!0),s=!0;break}s||this.colorsBack.clearSelection()}else this.colorsBack.select(this.paragraphShade,!0);this._UpdateBorders(),this._noApply=!0,this.chStrike.setValue(null!==t.get_Strikeout()&&void 0!==t.get_Strikeout()?t.get_Strikeout():"indeterminate",!0),this.chDoubleStrike.setValue(null!==t.get_DStrikeout()&&void 0!==t.get_DStrikeout()?t.get_DStrikeout():"indeterminate",!0),this.chSubscript.setValue(null!==t.get_Subscript()&&void 0!==t.get_Subscript()?t.get_Subscript():"indeterminate",!0),this.chSuperscript.setValue(null!==t.get_Superscript()&&void 0!==t.get_Superscript()?t.get_Superscript():"indeterminate",!0),this.chSmallCaps.setValue(null!==t.get_SmallCaps()&&void 0!==t.get_SmallCaps()?t.get_SmallCaps():"indeterminate",!0),this.chAllCaps.setValue(null!==t.get_AllCaps()&&void 0!==t.get_AllCaps()?t.get_AllCaps():"indeterminate",!0),this.numSpacing.setValue(null!==t.get_TextSpacing()&&void 0!==t.get_TextSpacing()?Common.Utils.Metric.fnRecalcFromMM(t.get_TextSpacing()):"",!0),this.numPosition.setValue(null!==t.get_Position()&&void 0!==t.get_Position()?Common.Utils.Metric.fnRecalcFromMM(t.get_Position()):"",!0),this.api.SetDrawImagePlaceParagraph("paragraphadv-font-img",this._originalProps),this.numDefaultTab.setValue(null!==t.get_DefaultTab()&&void 0!==t.get_DefaultTab()?Common.Utils.Metric.fnRecalcFromMM(parseFloat(t.get_DefaultTab().toFixed(1))):"",!0);var r=this.tabList.store,l=t.get_Tabs();if(l){for(var c=[],d=l.get_Count(),a=0;a<d;a++){var h=l.get_Tab(a),p=Common.Utils.Metric.fnRecalcFromMM(parseFloat(h.get_Pos().toFixed(1))),m=new Common.UI.DataViewModel;m.set({tabPos:p,value:parseFloat(p.toFixed(3))+" "+Common.Utils.Metric.getCurrentMetricName(),tabAlign:h.get_Value()}),c.push(m)}r.reset(c,{silent:!1}),this.tabList.selectByIndex(0)}this._noApply=!1,this._changedProps=new Asc.asc_CParagraphProperty,this.ChangedBorders=void 0}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),"paragraphadv-spin-spacing"==e.el.id||"paragraphadv-spin-position"==e.el.id?e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01):e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.1)}},updateThemeColors:function(){this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},afterRender:function(){if(this.updateMetricUnit(),this.updateThemeColors(),this._setDefaults(this._originalProps),void 0!==this.borderProps){this.btnBorderColor.setColor(this.borderProps.borderColor),this.BordersImage.setVirtualBorderColor("object"==typeof this.borderProps.borderColor?this.borderProps.borderColor.color:this.borderProps.borderColor),this.cmbBorderSize.setValue(this.borderProps.borderSize.ptValue);var t=this.cmbBorderSize.getSelectedRecord();t&&this.onBorderSizeSelect(this.cmbBorderSize,t),this.colorsBorder.select(this.borderProps.borderColor,!0)}for(var e=0;e<this.BordersImage.rows;e++)for(var i=0;i<this.BordersImage.columns;i++)this.BordersImage.getCell(i,e).on("borderclick",function(t,e,i,n){void 0===this.ChangedBorders&&(this.ChangedBorders=new Asc.asc_CParagraphBorders),this._UpdateCellBordersStyle(t,e,i,n,this.Borders)},this);this.BordersImage.on("borderclick",function(t,e,i,n){void 0===this.ChangedBorders&&(this.ChangedBorders=new Asc.asc_CParagraphBorders),this._UpdateTableBordersStyle(t,e,i,n,this.Borders)},this);var n="object"==typeof this.paragraphShade?this.paragraphShade.color:this.paragraphShade;if(this.BordersImage.setCellsColor(n),this.storageName){var o=Common.localStorage.getItem(this.storageName);this.setActiveCategory(null!==o?parseInt(o):0)}},onStrikeChange:function(t,e,i,n){if(this._changedProps&&1!=this.checkGroup&&this._changedProps.put_Strikeout("checked"==t.getValue()),this.checkGroup=0,"checked"==t.getValue()&&(this.checkGroup=1,this.chDoubleStrike.setValue(0),this._changedProps&&this._changedProps.put_DStrikeout(!1),this.checkGroup=0),this.apLine truncated
|
||||||
|
return'<div id="id-adv-table-width" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="3">\r\n <tr>\r\n <td colspan="3" class="padding-small">\r\n <label class="header"><%= scope.textTableSize %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="vertical-align: bottom; padding-bottom: 11px;">\r\n <div id="tableadv-checkbox-width"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textWidth %></label>\r\n <div id="tableadv-number-width" style="margin-right: 10px;"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textMeasure %></label>\r\n <div id="tableadv-cmb-unit" style="width: 115px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="3" class="padding-large">\r\n <div id="tableadv-checkbox-autofit"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n <div class="padding-small"></div>\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textDefaultMargins %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="125px">\r\n <label class="input-label"><%= scope.textTop %></label>\r\n <div id="tableadv-number-margin-table-top"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textLeft %></label>\r\n <div id="tableadv-number-margin-table-left"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textBottom %></label>\r\n <div id="tableadv-number-margin-table-bottom"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textRight %></label>\r\n <div id="tableadv-number-margin-table-right"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n <div class="padding-small"></div>\r\n <table cols="2">\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label class="header"><%= scope.textOptions %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="vertical-align: bottom; padding-bottom: 19px;">\r\n <div id="tableadv-checkbox-spacing"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textAllowSpacing %></label>\r\n <div id="tableadv-number-spacing"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="inner-content">\r\n </div>\r\n</div>\r\n<div id="id-adv-table-cell-props" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="3">\r\n <tr>\r\n <td colspan="3" class="padding-small">\r\n <label class="header"><%= scope.textCellSize %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="vertical-align: bottom; padding-bottom: 19px;">\r\n <div id="tableadv-checkbox-prefwidth"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textPrefWidth %></label>\r\n <div id="tableadv-number-prefwidth" style="margin-right: 10px;"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textMeasure %></label>\r\n <div id="tableadv-combo-prefwidth-unit" style="width: 115px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n <div class="padding-small"></div>\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textMargins %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <div id="tableadv-checkbox-margins"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="125px">\r\n <label Line truncated
|
||||||
|
cls:"btn-options huge",iconCls:"icon-right-panel btn-wrap-parallel",posId:c_tableWrap.TABLE_WRAP_PARALLEL,hint:this.textWrapParallelTooltip,enableToggle:!0,allowDepress:!1,toggleGroup:"advtablewrapGroup"}),this.btnWrapParallel.render($("#tableadv-button-wrap-parallel")),this.btnWrapParallel.on("click",_.bind(this.onBtnFlowWrapClick,this)),this.btnAlignLeft=new Common.UI.Button({cls:"btn-options huge",iconCls:"icon-right-panel btn-table-align-left",posId:c_tableAlign.TABLE_ALIGN_LEFT,hint:this.textLeftTooltip,enableToggle:!0,allowDepress:!1,toggleGroup:"advtablealignGroup"}),this.btnAlignLeft.render($("#tableadv-button-align-left")),this.btnAlignLeft.on("click",_.bind(function(t){this._changedProps&&t.pressed&&(this._changedProps.put_TableAlignment(t.options.posId),this._changedProps.put_TableIndent(Common.Utils.Metric.fnRecalcToMM(this.spnIndentLeft.getNumberValue())),this.spnIndentLeft.setDisabled(!t.pressed),this._state.alignChanged=!0)},this)),this.btnAlignCenter=new Common.UI.Button({cls:"btn-options huge",iconCls:"icon-right-panel btn-table-align-center",posId:c_tableAlign.TABLE_ALIGN_CENTER,hint:this.textCenterTooltip,enableToggle:!0,allowDepress:!1,toggleGroup:"advtablealignGroup"}),this.btnAlignCenter.render($("#tableadv-button-align-center")),this.btnAlignCenter.on("click",_.bind(function(t){this._changedProps&&t.pressed&&(this._changedProps.put_TableAlignment(t.options.posId),this._changedProps.put_TableIndent(0),this.spnIndentLeft.setDisabled(t.pressed),this._state.alignChanged=!0)},this)),this.btnAlignRight=new Common.UI.Button({cls:"btn-options huge",iconCls:"icon-right-panel btn-table-align-right",posId:c_tableAlign.TABLE_ALIGN_RIGHT,hint:this.textRightTooltip,enableToggle:!0,allowDepress:!1,toggleGroup:"advtablealignGroup"}),this.btnAlignRight.render($("#tableadv-button-align-right")),this.btnAlignRight.on("click",_.bind(function(t){this._changedProps&&t.pressed&&(this._changedProps.put_TableAlignment(t.options.posId),this._changedProps.put_TableIndent(0),this.spnIndentLeft.setDisabled(t.pressed),this._state.alignChanged=!0)},this)),this.spnIndentLeft=new Common.UI.MetricSpinner({el:$("#tableadv-number-indent"),step:.1,width:85,defaultUnit:"cm",defaultValue:0,value:"0 cm",maxValue:38.09,minValue:-38.09}),this.spnIndentLeft.on("change",_.bind(function(t,e,i,n){this._changedProps&&this._changedProps.put_TableIndent(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue()))},this)),this.spinners.push(this.spnIndentLeft),this.spnDistanceTop=new Common.UI.MetricSpinner({el:$("#tableadv-number-distance-top"),step:.1,width:85,defaultUnit:"cm",value:"1 cm",maxValue:55.87,minValue:0}),this.spnDistanceTop.on("change",_.bind(function(t,e,i,n){this._changedProps&&(void 0===this._changedProps.get_TablePaddings()&&this._changedProps.put_TablePaddings(new Asc.asc_CPaddings),this._changedProps.get_TablePaddings().put_Top(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())))},this)),this.spinners.push(this.spnDistanceTop),this.spnDistanceBottom=new Common.UI.MetricSpinner({el:$("#tableadv-number-distance-bottom"),step:.1,width:85,defaultUnit:"cm",value:"1 cm",maxValue:55.87,minValue:0}),this.spnDistanceBottom.on("change",_.bind(function(t,e,i,n){this._changedProps&&(void 0===this._changedProps.get_TablePaddings()&&this._changedProps.put_TablePaddings(new Asc.asc_CPaddings),this._changedProps.get_TablePaddings().put_Bottom(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())))},this)),this.spinners.push(this.spnDistanceBottom),this.spnDistanceLeft=new Common.UI.MetricSpinner({el:$("#tableadv-number-distance-left"),step:.1,width:85,defaultUnit:"cm",value:"1 cm",maxValue:9.34,minValue:0}),this.spnDistanceLeft.on("change",_.bind(function(t,e,i,n){this._changedProps&&(void 0===this._changedProps.get_TablePaddings()&&this._changedProps.put_TablePaddings(new Asc.asc_CPaddings),this._changedProps.get_TablePaddings().put_Left(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())))},this)),this.spinners.push(this.spnDistanceLeft),this.spnDistanceRight=new Common.UI.MetricSpinner({el:$("#tableadv-number-distance-right"),step:.1,width:85,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnDistanceRight.on("change",_.bind(function(t,e,i,n){this._changedProps&&(void 0===this._changedProps.get_TablePaddings()&&this._changedProps.put_TablePaddings(new Asc.asc_CPaddings),this._changedProps.get_TablePaddings().put_Right(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())))},this)),this.spinners.push(this.spnDistanceRight),this.spnX=new Common.UI.MetricSpinner({el:$("#tableadv-spin-x"),step:.1,width:115,disabled:!0,defaultUnit:"cm",defaultValue:0,value:"1 cm",maxValue:55.87,minValue:-55.87}),this.spnX.on("change",_.bind(function(t,e,i,n){this._changedProps&&(null!==this._changedProps.get_PositionH()&&void 0!==this._changedProps.get_PositionH()||this._changedProps.put_PositionH(new Asc.CTablePositionH),this._changedProps.get_PositionH().put_UseAlign(!1),this._changedProps.get_PositionH().put_RelativeFrom(this._stateLine truncated
|
||||||
|
this._changedProps.get_PositionH().put_RelativeFrom(this._state.HPositionFrom),!this._state.spnXChanged){var i=this._originalProps.get_Value_X(this._state.HPositionFrom);this.spnX.setValue(Common.Utils.Metric.fnRecalcFromMM(i),!0)}this._changedProps.get_PositionH().put_Value(Common.Utils.Metric.fnRecalcToMM(this.spnX.getNumberValue()))}},onVAlignSelect:function(t,e){this._changedProps&&(null!==this._changedProps.get_PositionV()&&void 0!==this._changedProps.get_PositionV()||this._changedProps.put_PositionV(new Asc.CTablePositionV),this._state.VAlignType=e.value,this._changedProps.get_PositionV().put_UseAlign(!0),this._changedProps.get_PositionV().put_RelativeFrom(this._state.VAlignFrom),this._changedProps.get_PositionV().put_Align(this._state.VAlignType))},onVRelativeSelect:function(t,e){this._changedProps&&(null!==this._changedProps.get_PositionV()&&void 0!==this._changedProps.get_PositionV()||this._changedProps.put_PositionV(new Asc.CTablePositionV),this._state.VAlignFrom=e.value,this._changedProps.get_PositionV().put_UseAlign(!0),this._changedProps.get_PositionV().put_RelativeFrom(this._state.VAlignFrom),this._changedProps.get_PositionV().put_Align(this._state.VAlignType),this.chMove.setValue(this._state.VAlignFrom==Asc.c_oAscVAnchor.Text,!0))},onVPositionSelect:function(t,e){if(this._changedProps){if(null!==this._changedProps.get_PositionV()&&void 0!==this._changedProps.get_PositionV()||this._changedProps.put_PositionV(new Asc.CTablePositionV),this._state.VPositionFrom=e.value,this._changedProps.get_PositionV().put_UseAlign(!1),this._changedProps.get_PositionV().put_RelativeFrom(this._state.VPositionFrom),!this._state.spnYChanged){var i=this._originalProps.get_Value_Y(this._state.VPositionFrom);this.spnY.setValue(Common.Utils.Metric.fnRecalcFromMM(i),!0)}this._changedProps.get_PositionV().put_Value(Common.Utils.Metric.fnRecalcToMM(this.spnY.getNumberValue())),this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscVAnchor.Text,!0)}},onRadioHAlignChange:function(t,e,i){this._changedProps&&(null!==this._changedProps.get_PositionH()&&void 0!==this._changedProps.get_PositionH()||this._changedProps.put_PositionH(new Asc.CTablePositionH),this._changedProps.get_PositionH().put_UseAlign(e),e&&(this._changedProps.get_PositionH().put_Align(this._state.HAlignType),this._changedProps.get_PositionH().put_RelativeFrom(this._state.HAlignFrom))),e&&(this.cmbHAlign.setDisabled(!1),this.cmbHRelative.setDisabled(!1),this.spnX.setDisabled(!0),this.cmbHPosition.setDisabled(!0),this._state.horizontalPropChanged=!0,this._state.alignChanged=!0)},onRadioHPositionChange:function(t,e,i){if(this._changedProps&&(null!==this._changedProps.get_PositionH()&&void 0!==this._changedProps.get_PositionH()||this._changedProps.put_PositionH(new Asc.CTablePositionH),this._changedProps.get_PositionH().put_UseAlign(!e),e)){if(!this._state.spnXChanged){var n=this._originalProps.get_Value_X(this._state.HPositionFrom);this.spnX.setValue(Common.Utils.Metric.fnRecalcFromMM(n))}this._changedProps.get_PositionH().put_Value(Common.Utils.Metric.fnRecalcToMM(this.spnX.getNumberValue())),this._changedProps.get_PositionH().put_RelativeFrom(this._state.HPositionFrom)}e&&(this.cmbHAlign.setDisabled(!0),this.cmbHRelative.setDisabled(!0),this.spnX.setDisabled(!1),this.cmbHPosition.setDisabled(!1),this._state.alignChanged=!1)},onRadioVAlignChange:function(t,e,i){this._changedProps&&(null!==this._changedProps.get_PositionV()&&void 0!==this._changedProps.get_PositionV()||this._changedProps.put_PositionV(new Asc.CTablePositionV),this._changedProps.get_PositionV().put_UseAlign(e),e&&(this._changedProps.get_PositionV().put_Align(this._state.VAlignType),this._changedProps.get_PositionV().put_RelativeFrom(this._state.VAlignFrom),this._state.verticalPropChanged=!0)),e&&(this.cmbVAlign.setDisabled(!1),this.cmbVRelative.setDisabled(!1),this.spnY.setDisabled(!0),this.cmbVPosition.setDisabled(!0),this.chMove.setValue(this._state.VAlignFrom==Asc.c_oAscVAnchor.Text,!0))},onRadioVPositionChange:function(t,e,i){if(this._changedProps&&(null!==this._changedProps.get_PositionV()&&void 0!==this._changedProps.get_PositionV()||this._changedProps.put_PositionV(new Asc.CTablePositionV),this._changedProps.get_PositionV().put_UseAlign(!e),e)){if(!this._state.spnYChanged){var n=this._originalProps.get_Value_Y(this._state.VPositionFrom);this.spnY.setValue(Common.Utils.Metric.fnRecalcFromMM(n))}this._changedProps.get_PositionV().put_Value(Common.Utils.Metric.fnRecalcToMM(this.spnY.getNumberValue())),this._changedProps.get_PositionV().put_RelativeFrom(this._state.VPositionFrom)}e&&(this.cmbVAlign.setDisabled(!0),this.cmbVRelative.setDisabled(!0),this.spnY.setDisabled(!1),this.cmbVPosition.setDisabled(!1),this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscVAnchor.Text,!0))},onBorderSizeSelect:function(t,e){this.BorderSize={ptValue:e.value,pxValue:e.pxValue},this.tableBordersImage.setVirtualBorderSize(this.BorderSize.pxValue),this.tableBordersImageSpacing.setVirtualBorderSize(this.BoLine truncated
|
||||||
|
caption:n.get_HideVer()?i.txtAddVer:i.txtHideVer,equationProps:{type:e,callback:"put_HideVer",value:!n.get_HideVer()}},{caption:n.get_HideTopLTR()?i.txtAddLT:i.txtHideLT,equationProps:{type:e,callback:"put_HideTopLTR",value:!n.get_HideTopLTR()}},{caption:n.get_HideTopRTL()?i.txtAddLB:i.txtHideLB,equationProps:{type:e,callback:"put_HideTopRTL",value:!n.get_HideTopRTL()}}]})}),o.push(t);break;case Asc.c_oAscMathInterfaceType.Bar:t=new Common.UI.MenuItem({caption:i.txtRemoveBar,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"remove_Bar"}}),o.push(t),t=new Common.UI.MenuItem({caption:n.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top?i.txtUnderbar:i.txtOverbar,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_Pos",value:n.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top?Asc.c_oAscMathInterfaceBarPos.Bottom:Asc.c_oAscMathInterfaceBarPos.Top}}),o.push(t);break;case Asc.c_oAscMathInterfaceType.Script:var s=n.get_ScriptType();s==Asc.c_oAscMathInterfaceScript.PreSubSup?(t=new Common.UI.MenuItem({caption:i.txtScriptsAfter,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_ScriptType",value:Asc.c_oAscMathInterfaceScript.SubSup}}),o.push(t),t=new Common.UI.MenuItem({caption:i.txtRemScripts,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_ScriptType",value:Asc.c_oAscMathInterfaceScript.None}}),o.push(t)):(s==Asc.c_oAscMathInterfaceScript.SubSup&&(t=new Common.UI.MenuItem({caption:i.txtScriptsBefore,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_ScriptType",value:Asc.c_oAscMathInterfaceScript.PreSubSup}}),o.push(t)),s!=Asc.c_oAscMathInterfaceScript.SubSup&&s!=Asc.c_oAscMathInterfaceScript.Sub||(t=new Common.UI.MenuItem({caption:i.txtRemSubscript,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_ScriptType",value:s==Asc.c_oAscMathInterfaceScript.SubSup?Asc.c_oAscMathInterfaceScript.Sup:Asc.c_oAscMathInterfaceScript.None}}),o.push(t)),s!=Asc.c_oAscMathInterfaceScript.SubSup&&s!=Asc.c_oAscMathInterfaceScript.Sup||(t=new Common.UI.MenuItem({caption:i.txtRemSuperscript,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_ScriptType",value:s==Asc.c_oAscMathInterfaceScript.SubSup?Asc.c_oAscMathInterfaceScript.Sub:Asc.c_oAscMathInterfaceScript.None}}),o.push(t)));break;case Asc.c_oAscMathInterfaceType.Fraction:var a=n.get_FractionType();a!=Asc.c_oAscMathInterfaceFraction.Skewed&&a!=Asc.c_oAscMathInterfaceFraction.Linear||(t=new Common.UI.MenuItem({caption:i.txtFractionStacked,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_FractionType",value:Asc.c_oAscMathInterfaceFraction.Bar}}),o.push(t)),a!=Asc.c_oAscMathInterfaceFraction.Bar&&a!=Asc.c_oAscMathInterfaceFraction.Linear||(t=new Common.UI.MenuItem({caption:i.txtFractionSkewed,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_FractionType",value:Asc.c_oAscMathInterfaceFraction.Skewed}}),o.push(t)),a!=Asc.c_oAscMathInterfaceFraction.Bar&&a!=Asc.c_oAscMathInterfaceFraction.Skewed||(t=new Common.UI.MenuItem({caption:i.txtFractionLinear,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_FractionType",value:Asc.c_oAscMathInterfaceFraction.Linear}}),o.push(t)),a!=Asc.c_oAscMathInterfaceFraction.Bar&&a!=Asc.c_oAscMathInterfaceFraction.NoBar||(t=new Common.UI.MenuItem({caption:a==Asc.c_oAscMathInterfaceFraction.Bar?i.txtRemFractionBar:i.txtAddFractionBar,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_FractionType",value:a==Asc.c_oAscMathInterfaceFraction.Bar?Asc.c_oAscMathInterfaceFraction.NoBar:Asc.c_oAscMathInterfaceFraction.Bar}}),o.push(t));break;case Asc.c_oAscMathInterfaceType.Limit:t=new Common.UI.MenuItem({caption:n.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top?i.txtLimitUnder:i.txtLimitOver,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_Pos",value:n.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top?Asc.c_oAscMathInterfaceLimitPos.Bottom:Asc.c_oAscMathInterfaceLimitPos.Top}}),o.push(t),t=new Common.UI.MenuItem({caption:i.txtRemLimit,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_Pos",value:Asc.c_oAscMathInterfaceLimitPos.None}}),o.push(t);break;case Asc.c_oAscMathInterfaceType.Matrix:t=new Common.UI.MenuItem({caption:n.get_HidePlaceholder()?i.txtShowPlaceholder:i.txtHidePlaceholder,equation:!0,disabled:i._currentParaObjDisabled,equationProps:{type:e,callback:"put_HidePlaceholder",value:!n.get_HidePlaceholder()}}),o.push(t),t=new Common.UI.MenuItem({caption:i.insertText,equation:!0,disabled:i._currentParaObjDisabled,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:i.insertRowAboveText,equationProps:{type:e,callback:"insert_MatrixRow",value:!0}},{caption:i.insertRowBelowText,equationProps:{type:e,callback:"insert_MatrixRow",value:!1}},{caption:i.inserLine truncated
|
||||||
|
}),f=new Common.UI.MenuItem({caption:i.splitCellsText}).on("click",function(t){i.api&&new Common.Views.InsertTableDialog({handler:function(t,e){"ok"==t&&(i.api&&i.api.SplitCell(e.columns,e.rows),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Table"))}}).show()}),C=function(t,e){if(i.api){var n=new Asc.CTableProp;n.put_CellsVAlign(t.options.valign),i.api.tblApply(n)}},v=new Common.UI.MenuItem({caption:i.cellAlignText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[i.menuTableCellTop=new Common.UI.MenuItem({caption:i.topCellText,toggleGroup:"popuptablecellalign",checkable:!0,checked:!1,valign:Asc.c_oAscVertAlignJc.Top}).on("click",e.bind(C,i)),i.menuTableCellCenter=new Common.UI.MenuItem({caption:i.centerCellText,toggleGroup:"popuptablecellalign",checkable:!0,checked:!1,valign:Asc.c_oAscVertAlignJc.Center}).on("click",e.bind(C,i)),i.menuTableCellBottom=new Common.UI.MenuItem({caption:i.bottomCellText,toggleGroup:"popuptablecellalign",checkable:!0,checked:!1,valign:Asc.c_oAscVertAlignJc.Bottom}).on("click",e.bind(C,i))]})}),_=new Common.UI.MenuItem({caption:i.advancedTableText}).on("click",function(t,n,o){var s;if(i.api){var a=i.api.getSelectedElements();if(a&&e.isArray(a))for(var r=a.length-1;r>=0;r--){var l,c;if(l=a[r].get_ObjectType(),c=a[r].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Table==l){s=new DE.Views.TableSettingsAdvanced({tableStylerRows:null===c.get_CellBorders().get_InsideH()&&1==c.get_CellSelect()?1:2,tableStylerColumns:null===c.get_CellBorders().get_InsideV()&&1==c.get_CellSelect()?1:2,tableProps:c,borderProps:i.borderAdvancedProps,sectionProps:i.api.asc_GetSectionProps(),handler:function(t,e){"ok"==t&&i.api&&(i.borderAdvancedProps=e.borderProps,i.api.tblApply(e.tableProps)),i.fireEvent("editcomplete",i)}});break}}}s&&s.show()}),y=new Common.UI.MenuItem({caption:i.advancedParagraphText}).on("click",e.bind(i.advancedParagraphClick,i)),w=new Common.UI.MenuItem({caption:"--"}),x=new Common.UI.MenuItem({caption:i.editHyperlinkText}).on("click",e.bind(i.editHyperlink,i)),S=new Common.UI.MenuItem({caption:i.removeHyperlinkText}).on("click",function(t,e){i.api&&i.api.remove_Hyperlink(),i.fireEvent("editcomplete",i)}),A=new Common.UI.MenuItem({caption:i.hyperlinkText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[x,S]})}),T=new Common.UI.MenuItem({caption:i.addCommentText}).on("click",e.bind(i.addComment,i)),k=new Common.UI.MenuItem({caption:i.hyperlinkText}).on("click",e.bind(i.addHyperlink,i));i.menuSpellTable=new Common.UI.MenuItem({caption:i.loadSpellText,disabled:!0}),i.menuSpellMoreTable=new Common.UI.MenuItem({caption:i.moreText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[]})}),i.langTableMenu=new Common.UI.MenuItem({caption:i.langText,menu:new Common.UI.Menu({menuAlign:"tl-tr",maxHeight:300,items:[]}).on("show:after",function(t){})});var I=new Common.UI.MenuItem({caption:i.ignoreSpellText}).on("click",function(t){i.api&&(i.api.asc_ignoreMisspelledWord(i._currentSpellObj,!1),i.fireEvent("editcomplete",i))}),P=new Common.UI.MenuItem({caption:i.ignoreAllSpellText}).on("click",function(t){i.api&&(i.api.asc_ignoreMisspelledWord(i._currentSpellObj,!0),i.fireEvent("editcomplete",i))}),M=new Common.UI.MenuItem({caption:"--"}),B=new Common.UI.MenuItem({caption:"--"});i.menuSpellCheckTable=new Common.UI.MenuItem({caption:i.spellcheckText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[i.menuSpellTable,i.menuSpellMoreTable,M,I,P,{caption:"--"},i.langTableMenu]})});var U=new Common.UI.MenuItem({caption:i.textCopy,value:"copy"}).on("click",e.bind(i.onCutCopyPaste,i)),E=new Common.UI.MenuItem({caption:i.textPaste,value:"paste"}).on("click",e.bind(i.onCutCopyPaste,i)),V=new Common.UI.MenuItem({caption:i.textCut,value:"cut"}).on("click",e.bind(i.onCutCopyPaste,i)),D=new Common.UI.MenuItem({caption:"--"}),R=function(t,e){if(i.api){var n=new Asc.CTableProp;n.put_CellsTextDirection(t.options.direction),i.api.tblApply(n)}},F=new Common.UI.MenuItem({caption:i.directionText,menu:new Common.UI.Menu({cls:"ppm-toolbar",menuAlign:"tl-tr",items:[i.menuTableDirectH=new Common.UI.MenuItem({caption:i.directHText,iconCls:"mnu-direct-horiz",checkable:!0,checked:!1,toggleGroup:"popuptabledirect",direction:Asc.c_oAscCellTextDirection.LRTB}).on("click",e.bind(R,i)),i.menuTableDirect90=new Common.UI.MenuItem({caption:i.direct90Text,iconCls:"mnu-direct-rdown",checkable:!0,checked:!1,toggleGroup:"popuptabledirect",direction:Asc.c_oAscCellTextDirection.TBRL}).on("click",e.bind(R,i)),i.menuTableDirect270=new Common.UI.MenuItem({caption:i.direct270Text,iconCls:"mnu-direct-rup",checkable:!0,checked:!1,toggleGroup:"popuptabledirect",direction:Asc.c_oAscCellTextDirection.BTLR}).on("click",e.bind(R,i))]})});this.tableMenu=new Common.UI.Menu({initMenu:function(t){if(!e.isUndefined(t.tableProps)){for(var n=t.mathProps&&t.mathProps.value,o=7;o<22;o++)i.tableMenu.items[o].setVisible(!n);var s=t.tableProps.value.get_CellsVAlign();i.menuTableCellTop.setChecked(s==Asc.c_oAscVertAlignJc.Top)Line truncated
|
||||||
|
LargeOperator_CoProd_SubSup:83951623,LargeOperator_CoProd_CenterSub:83951624,LargeOperator_CoProd_Sub:83951625,LargeOperator_Union:84017152,LargeOperator_Union_CenterSubSup:84017153,LargeOperator_Union_SubSup:84017154,LargeOperator_Union_CenterSub:84017155,LargeOperator_Union_Sub:84017156,LargeOperator_Intersection:84017157,LargeOperator_Intersection_CenterSubSup:84017158,LargeOperator_Intersection_SubSup:84017159,LargeOperator_Intersection_CenterSub:84017160,LargeOperator_Intersection_Sub:84017161,LargeOperator_Disjunction:84082688,LargeOperator_Disjunction_CenterSubSup:84082689,LargeOperator_Disjunction_SubSup:84082690,LargeOperator_Disjunction_CenterSub:84082691,LargeOperator_Disjunction_Sub:84082692,LargeOperator_Conjunction:84082693,LargeOperator_Conjunction_CenterSubSup:84082694,LargeOperator_Conjunction_SubSup:84082695,LargeOperator_Conjunction_CenterSub:84082696,LargeOperator_Conjunction_Sub:84082697,LargeOperator_Custom_1:84148224,LargeOperator_Custom_2:84148225,LargeOperator_Custom_3:84148226,LargeOperator_Custom_4:84148227,LargeOperator_Custom_5:84148228,Bracket_Round:100663296,Bracket_Square:100663297,Bracket_Curve:100663298,Bracket_Angle:100663299,Bracket_LowLim:100663300,Bracket_UppLim:100663301,Bracket_Line:100663302,Bracket_LineDouble:100663303,Bracket_Square_OpenOpen:100663304,Bracket_Square_CloseClose:100663305,Bracket_Square_CloseOpen:100663306,Bracket_SquareDouble:100663307,Bracket_Round_Delimiter_2:100728832,Bracket_Curve_Delimiter_2:100728833,Bracket_Angle_Delimiter_2:100728834,Bracket_Angle_Delimiter_3:100728835,Bracket_Round_OpenNone:100794368,Bracket_Round_NoneOpen:100794369,Bracket_Square_OpenNone:100794370,Bracket_Square_NoneOpen:100794371,Bracket_Curve_OpenNone:100794372,Bracket_Curve_NoneOpen:100794373,Bracket_Angle_OpenNone:100794374,Bracket_Angle_NoneOpen:100794375,Bracket_LowLim_OpenNone:100794376,Bracket_LowLim_NoneNone:100794377,Bracket_UppLim_OpenNone:100794378,Bracket_UppLim_NoneOpen:100794379,Bracket_Line_OpenNone:100794380,Bracket_Line_NoneOpen:100794381,Bracket_LineDouble_OpenNone:100794382,Bracket_LineDouble_NoneOpen:100794383,Bracket_SquareDouble_OpenNone:100794384,Bracket_SquareDouble_NoneOpen:100794385,Bracket_Custom_1:100859904,Bracket_Custom_2:100859905,Bracket_Custom_3:100859906,Bracket_Custom_4:100859907,Bracket_Custom_5:100925440,Bracket_Custom_6:100925441,Bracket_Custom_7:100925442,Function_Sin:117440512,Function_Cos:117440513,Function_Tan:117440514,Function_Csc:117440515,Function_Sec:117440516,Function_Cot:117440517,Function_1_Sin:117506048,Function_1_Cos:117506049,Function_1_Tan:117506050,Function_1_Csc:117506051,Function_1_Sec:117506052,Function_1_Cot:117506053,Function_Sinh:117571584,Function_Cosh:117571585,Function_Tanh:117571586,Function_Csch:117571587,Function_Sech:117571588,Function_Coth:117571589,Function_1_Sinh:117637120,Function_1_Cosh:117637121,Function_1_Tanh:117637122,Function_1_Csch:117637123,Function_1_Sech:117637124,Function_1_Coth:117637125,Function_Custom_1:117702656,Function_Custom_2:117702657,Function_Custom_3:117702658,Accent_Dot:134217728,Accent_DDot:134217729,Accent_DDDot:134217730,Accent_Hat:134217731,Accent_Check:134217732,Accent_Accent:134217733,Accent_Grave:134217734,Accent_Smile:134217735,Accent_Tilde:134217736,Accent_Bar:134217737,Accent_DoubleBar:134217738,Accent_CurveBracketTop:134217739,Accent_CurveBracketBot:134217740,Accent_GroupTop:134217741,Accent_GroupBot:134217742,Accent_ArrowL:134217743,Accent_ArrowR:134217744,Accent_ArrowD:134217745,Accent_HarpoonL:134217746,Accent_HarpoonR:134217747,Accent_BorderBox:134283264,Accent_BorderBoxCustom:134283265,Accent_BarTop:134348800,Accent_BarBot:134348801,Accent_Custom_1:134414336,Accent_Custom_2:134414337,Accent_Custom_3:134414338,LimitLog_LogBase:150994944,LimitLog_Log:150994945,LimitLog_Lim:150994946,LimitLog_Min:150994947,LimitLog_Max:150994948,LimitLog_Ln:150994949,LimitLog_Custom_1:151060480,LimitLog_Custom_2:151060481,Operator_ColonEquals:167772160,Operator_EqualsEquals:167772161,Operator_PlusEquals:167772162,Operator_MinusEquals:167772163,Operator_Definition:167772164,Operator_UnitOfMeasure:167772165,Operator_DeltaEquals:167772166,Operator_ArrowL_Top:167837696,Operator_ArrowR_Top:167837697,Operator_ArrowL_Bot:167837698,Operator_ArrowR_Bot:167837699,Operator_DoubleArrowL_Top:167837700,Operator_DoubleArrowR_Top:167837701,Operator_DoubleArrowL_Bot:167837702,Operator_DoubleArrowR_Bot:167837703,Operator_ArrowD_Top:167837704,Operator_ArrowD_Bot:167837705,Operator_DoubleArrowD_Top:167837706,Operator_DoubleArrowD_Bot:167837707,Operator_Custom_1:167903232,Operator_Custom_2:167903233,Matrix_1_2:184549376,Matrix_2_1:184549377,Matrix_1_3:184549378,Matrix_3_1:184549379,Matrix_2_2:184549380,Matrix_2_3:184549381,Matrix_3_2:184549382,Matrix_3_3:184549383,Matrix_Dots_Center:184614912,Matrix_Dots_Baseline:184614913,Matrix_Dots_Vertical:184614914,Matrix_Dots_Diagonal:184614915,Matrix_Identity_2:184680448,Matrix_Identity_2_NoZeros:184680449,Matrix_Identity_3:184680450,Matrix_Identity_3_NoZeros:1Line truncated
|
||||||
|
target:$(document.body),text:"",placement:"right"},template:_.template(['<div class="synch-tip-root <%= scope.placement %>">','<div class="asc-synchronizetip">','<div class="tip-arrow <%= scope.placement %>"></div>',"<div>",'<div class="tip-text" style="width: 260px;"><%= scope.text %></div>','<div class="close img-commonctrl"></div>',"</div>",'<div class="show-link"><label><%= scope.textDontShow %></label></div>',"</div>","</div>"].join("")),initialize:function(t){this.textSynchronize+=Common.Utils.String.platformKey("Ctrl+S"),Common.UI.BaseView.prototype.initialize.call(this,t),this.target=this.options.target,this.text=_.isEmpty(this.options.text)?this.textSynchronize:this.options.text,this.placement=this.options.placement},render:function(){return t=$(this.template({scope:this})),t.find(".close").on("click",_.bind(function(){this.trigger("closeclick")},this)),t.find(".show-link label").on("click",_.bind(function(){this.trigger("dontshowclick")},this)),$(document.body).append(t),this.applyPlacement(),this},show:function(){t?(this.applyPlacement(),t.show()):this.render()},hide:function(){t&&t.hide()},applyPlacement:function(){var e=this.target.offset();"top"==this.placement?t.css({bottom:Common.Utils.innerHeight()-e.top+"px",right:Common.Utils.innerWidth()-e.left-this.target.width()/2+"px"}):t.css({top:e.top+this.target.height()/2+"px",left:e.left+this.target.width()+"px"})},textDontShow:"Don't show this message again",textSynchronize:"The document has been changed by another user.<br/>Please click to save your changes and reload the updates."}}(),Common.UI.SynchronizeTip||{}))}),define("documenteditor/main/app/view/Toolbar",["jquery","underscore","backbone","text!documenteditor/main/app/template/Toolbar.template","common/main/lib/collection/Fonts","common/main/lib/component/Button","common/main/lib/component/ComboBox","common/main/lib/component/DataView","common/main/lib/component/ColorPalette","common/main/lib/component/ThemeColorPalette","common/main/lib/component/Menu","common/main/lib/component/DimensionPicker","common/main/lib/component/Window","common/main/lib/component/ComboBoxFonts","common/main/lib/component/ComboDataView","common/main/lib/component/SynchronizeTip"],function(t,e,i,n){"use strict";DE.Views.Toolbar=i.View.extend(e.extend({el:"#toolbar",template:e.template(n),events:{},initialize:function(){var i=this;this.SchemeNames=[this.txtScheme1,this.txtScheme2,this.txtScheme3,this.txtScheme4,this.txtScheme5,this.txtScheme6,this.txtScheme7,this.txtScheme8,this.txtScheme9,this.txtScheme10,this.txtScheme11,this.txtScheme12,this.txtScheme13,this.txtScheme14,this.txtScheme15,this.txtScheme16,this.txtScheme17,this.txtScheme18,this.txtScheme19,this.txtScheme20,this.txtScheme21],this.paragraphControls=[],this.toolbarControls=[],this.textOnlyControls=[],this._state={hasCollaborativeChanges:void 0},this.btnSaveCls="btn-save",this.btnSaveTip=this.tipSave+Common.Utils.String.platformKey("Ctrl+S"),this.btnNewDocument=new Common.UI.Button({id:"id-toolbar-btn-newdocument",cls:"btn-toolbar",iconCls:"btn-newdocument"}),this.toolbarControls.push(this.btnNewDocument),this.btnOpenDocument=new Common.UI.Button({id:"id-toolbar-btn-opendocument",cls:"btn-toolbar",iconCls:"btn-opendocument"}),this.toolbarControls.push(this.btnOpenDocument),this.btnPrint=new Common.UI.Button({id:"id-toolbar-btn-print",cls:"btn-toolbar",iconCls:"btn-print no-mask"}),this.toolbarControls.push(this.btnPrint),this.btnSave=new Common.UI.Button({id:"id-toolbar-btn-save",cls:"btn-toolbar",iconCls:"no-mask "+this.btnSaveCls}),this.toolbarControls.push(this.btnSave),this.btnUndo=new Common.UI.Button({id:"id-toolbar-btn-undo",cls:"btn-toolbar",iconCls:"btn-undo"}),this.toolbarControls.push(this.btnUndo),this.btnRedo=new Common.UI.Button({id:"id-toolbar-btn-redo",cls:"btn-toolbar",iconCls:"btn-redo"}),this.toolbarControls.push(this.btnRedo),this.btnCopy=new Common.UI.Button({id:"id-toolbar-btn-copy",cls:"btn-toolbar",iconCls:"btn-copy"}),this.toolbarControls.push(this.btnCopy),this.btnPaste=new Common.UI.Button({id:"id-toolbar-btn-paste",cls:"btn-toolbar",iconCls:"btn-paste"}),this.paragraphControls.push(this.btnPaste),this.btnIncFontSize=new Common.UI.Button({id:"id-toolbar-btn-incfont",cls:"btn-toolbar",iconCls:"btn-incfont"}),this.paragraphControls.push(this.btnIncFontSize),this.btnDecFontSize=new Common.UI.Button({id:"id-toolbar-btn-decfont",cls:"btn-toolbar",iconCls:"btn-decfont"}),this.paragraphControls.push(this.btnDecFontSize),this.btnBold=new Common.UI.Button({id:"id-toolbar-btn-bold",cls:"btn-toolbar",iconCls:"btn-bold",enableToggle:!0}),this.paragraphControls.push(this.btnBold),this.btnItalic=new Common.UI.Button({id:"id-toolbar-btn-italic",cls:"btn-toolbar",iconCls:"btn-italic",enableToggle:!0}),this.paragraphControls.push(this.btnItalic),this.btnUnderline=new Common.UI.Button({id:"id-toolbar-btn-underline",cls:"btn-toolbar",iconCls:"btn-underline",enableToggle:!0}),this.paragraphControls.push(this.btnUnderline),this.btnStrikeout=nLine truncated
|
||||||
|
n("#id-toolbar-"+i+"-placeholder-btn-hidebars",this.btnHide),n("#id-toolbar-"+i+"-placeholder-btn-settings",this.btnAdvSettings),n("#id-toolbar-full-placeholder-btn-paracolor",this.btnParagraphColor),n("#id-toolbar-full-placeholder-field-styles",this.listStyles),n("#id-toolbar-short-placeholder-btn-halign",this.btnHorizontalAlign),n("#id-toolbar-full-placeholder-btn-mailrecepients",this.btnMailRecepients),n("#id-toolbar-"+i+"-placeholder-btn-notes",this.btnNotes)},createDelayedElements:function(){this.api&&(this.mnuNonPrinting.items[0].setChecked(this.api.get_ShowParaMarks(),!0),this.mnuNonPrinting.items[1].setChecked(this.api.get_ShowTableEmptyLine(),!0),this.btnShowHidenChars.toggle(this.mnuNonPrinting.items[0].checked,!0),this.updateMetricUnit()),this.btnNewDocument.updateHint(this.tipNewDocument),this.btnOpenDocument.updateHint(this.tipOpenDocument),this.btnPrint.updateHint(this.tipPrint+Common.Utils.String.platformKey("Ctrl+P")),this.btnSave.updateHint(this.btnSaveTip),this.btnUndo.updateHint(this.tipUndo+Common.Utils.String.platformKey("Ctrl+Z")),this.btnRedo.updateHint(this.tipRedo+Common.Utils.String.platformKey("Ctrl+Y")),this.btnCopy.updateHint(this.tipCopy+Common.Utils.String.platformKey("Ctrl+C")),this.btnPaste.updateHint(this.tipPaste+Common.Utils.String.platformKey("Ctrl+V")),this.btnIncFontSize.updateHint(this.tipIncFont+Common.Utils.String.platformKey("Ctrl+]")),this.btnDecFontSize.updateHint(this.tipDecFont+Common.Utils.String.platformKey("Ctrl+[")),this.btnBold.updateHint(this.textBold+Common.Utils.String.platformKey("Ctrl+B")),this.btnItalic.updateHint(this.textItalic+Common.Utils.String.platformKey("Ctrl+I")),this.btnUnderline.updateHint(this.textUnderline+Common.Utils.String.platformKey("Ctrl+U")),this.btnStrikeout.updateHint(this.textStrikeout),this.btnSuperscript.updateHint(this.textSuperscript),this.btnSubscript.updateHint(this.textSubscript),this.btnHighlightColor.updateHint(this.tipHighlightColor),this.btnFontColor.updateHint(this.tipFontColor),this.btnParagraphColor.updateHint(this.tipPrColor),this.btnAlignLeft.updateHint(this.tipAlignLeft+Common.Utils.String.platformKey("Ctrl+L")),this.btnAlignCenter.updateHint(this.tipAlignCenter+Common.Utils.String.platformKey("Ctrl+E")),this.btnAlignRight.updateHint(this.tipAlignRight+Common.Utils.String.platformKey("Ctrl+R")),this.btnAlignJust.updateHint(this.tipAlignJust+Common.Utils.String.platformKey("Ctrl+J")),this.btnHorizontalAlign.updateHint(this.tipHAligh),this.btnDecLeftOffset.updateHint(this.tipDecPrLeft+Common.Utils.String.platformKey("Ctrl+Shift+M")),this.btnIncLeftOffset.updateHint(this.tipIncPrLeft+Common.Utils.String.platformKey("Ctrl+M")),this.btnLineSpace.updateHint(this.tipLineSpace),this.btnShowHidenChars.updateHint(this.tipShowHiddenChars),this.btnMarkers.updateHint(this.tipMarkers),this.btnNumbers.updateHint(this.tipNumbers),this.btnMultilevels.updateHint(this.tipMultilevels),this.btnInsertTable.updateHint(this.tipInsertTable),this.btnInsertImage.updateHint(this.tipInsertImage),this.btnInsertChart.updateHint(this.tipInsertChart),this.btnInsertText.updateHint(this.tipInsertText),this.btnInsertPageBreak.updateHint(this.tipPageBreak),this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink+Common.Utils.String.platformKey("Ctrl+K")),this.btnEditHeader.updateHint(this.tipEditHeader),this.btnInsertShape.updateHint(this.tipInsertShape),this.btnInsertEquation.updateHint(this.tipInsertEquation),this.btnDropCap.updateHint(this.tipDropCap),this.btnColumns.updateHint(this.tipColumns),this.btnPageOrient.updateHint(this.tipPageOrient),this.btnPageSize.updateHint(this.tipPageSize),this.btnPageMargins.updateHint(this.tipPageMargins),this.btnClearStyle.updateHint(this.tipClearStyle),this.btnCopyStyle.updateHint(this.tipCopyStyle+Common.Utils.String.platformKey("Ctrl+Shift+C")),this.btnColorSchemas.updateHint(this.tipColorSchemas),this.btnMailRecepients.updateHint(this.tipMailRecepients),this.btnHide.updateHint(this.tipViewSettings),this.btnAdvSettings.updateHint(this.tipAdvSettings),this.btnNotes.updateHint(this.tipNotes);var i=this;this.btnHide.setMenu(new Common.UI.Menu({cls:"pull-right",style:"min-width: 180px;",items:[this.mnuitemCompactToolbar=new Common.UI.MenuItem({caption:this.textCompactView,checkable:!0}),this.mnuitemHideTitleBar=new Common.UI.MenuItem({caption:this.textHideTitleBar,checkable:!0}),this.mnuitemHideStatusBar=new Common.UI.MenuItem({caption:this.textHideStatusBar,checkable:!0}),this.mnuitemHideRulers=new Common.UI.MenuItem({caption:this.textHideLines,checkable:!0}),{caption:"--"},this.btnFitPage=new Common.UI.MenuItem({caption:this.textFitPage,checkable:!0,checked:this.btnFitPage.isChecked()}),this.btnFitWidth=new Common.UI.MenuItem({caption:this.textFitWidth,checkable:!0,checked:this.btnFitWidth.isChecked()}),this.mnuZoom=new Common.UI.MenuItem({template:e.template(['<div id="id-toolbar-menu-zoom" class="menu-zoom" style="height: 25px;" ',"<% if(!_.isUndefined(options.stopPropagation)) { %>",'data-stopPropagatiLine truncated
|
||||||
|
this.loadMask&&this.loadMask.hide()},textTitle:"Select Data Source",textLoading:"Loading"},DE.Views.MailMergeRecepients||{}))}),void 0===Common)var Common={};if(define("documenteditor/main/app/view/StyleTitleDialog",["common/main/lib/util/utils","common/main/lib/component/InputField","common/main/lib/component/Window"],function(){"use strict";DE.Views.StyleTitleDialog=Common.UI.Window.extend(_.extend({options:{width:350,height:200,style:"min-width: 230px;",cls:"modal-dlg"},initialize:function(t){_.extend(this.options,{title:this.textHeader},t||{}),this.template=['<div class="box">','<label class="input-row" style="margin-bottom: -5px;">'+this.textTitle+" </label>",'<div id="id-dlg-style-title" class="input-row" style="margin-bottom: 5px;"></div>','<label class="input-row" style="margin-bottom: -5px; margin-top: 5px;">'+this.textNextStyle+"</label>",'<div id="id-dlg-style-next-par" class="input-group-nr" style="margin-bottom: 5px;" ></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this,e=this.getChild();t.inputTitle=new Common.UI.InputField({el:$("#id-dlg-style-title"),allowBlank:!1,blankError:t.txtEmpty,style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!(""==e)||t.txtNotEmpty}}),e.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.find("input").on("keypress",_.bind(this.onKeyPress,this)),this.cmbNextStyle=new Common.UI.ComboBox({el:$("#id-dlg-style-next-par"),style:"width: 100%;",menuStyle:"width: 100%; max-height: 290px;",editable:!1,cls:"input-group-nr",data:this.options.formats}),this.cmbNextStyle.setValue(this.options.formats[0].value)},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputTitle.cmpEl.find("input").focus()},500)},getTitle:function(){return this.inputTitle.getValue()},getNextStyle:function(){return this.cmbNextStyle.getValue()},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onKeyPress:function(t){if(t.keyCode==Common.UI.Keys.RETURN)return this._handleInput("ok"),!1},_handleInput:function(t){if(this.options.handler){if("ok"==t){if(!0!==this.inputTitle.checkValidate())return void this.inputTitle.cmpEl.find("input").focus()}this.options.handler.call(this,this,t)}this.close()},textTitle:"Title",textHeader:"Create New Style",txtEmpty:"This field is required",txtNotEmpty:"Field must not be empty",textNextStyle:"Next paragraph style"},DE.Views.StyleTitleDialog||{}))}),define("documenteditor/main/app/view/PageMarginsDialog",["common/main/lib/component/Window","common/main/lib/component/MetricSpinner"],function(){"use strict";DE.Views.PageMarginsDialog=Common.UI.Window.extend(_.extend({options:{width:215,header:!0,style:"min-width: 216px;",cls:"modal-dlg",id:"window-page-margins"},initialize:function(t){_.extend(this.options,{title:this.textTitle},t||{}),this.template=['<div class="box" style="height: 85px;">','<table cols="2" style="width: 100%;margin-bottom: 10px;">',"<tr>",'<td style="padding-right: 10px;padding-bottom: 8px;">','<label class="input-label">'+this.textTop+"</label>",'<div id="page-margins-spin-top"></div>',"</td>",'<td style="padding-bottom: 8px;">','<label class="input-label">'+this.textBottom+"</label>",'<div id="page-margins-spin-bottom"></div>',"</td>","</tr>","<tr>",'<td class="padding-small" style="padding-right: 10px;">','<label class="input-label">'+this.textLeft+"</label>",'<div id="page-margins-spin-left"></div>',"</td>",'<td class="padding-small">','<label class="input-label">'+this.textRight+"</label>",'<div id="page-margins-spin-right"></div>',"</td>","</tr>","</table>","</div>",'<div class="separator horizontal"/>','<div class="footer center">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),this.spinners=[],this._noApply=!1,this.maxMarginsW=this.maxMarginsH=0,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this),this.spnTop=new Common.UI.MetricSpinner({el:$("#page-margins-spin-top"),step:.1,width:86,defaultUnit:"cm",value:"1 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnTop),this.spnBottom=new Common.UI.MetricSpinner({el:$("#page-margins-spin-bottom"),step:.1,width:86,defaultUnit:"cm",value:"1 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnBottom),this.spnLeft=new Common.UI.MetricSpinner({el:$("#page-margins-spin-left"),step:.1Line truncated
|
||||||
|
this.api.asc_registerCallback("asc_onMathTypes",_.bind(this.onMathTypes,this)),this.api.asc_registerCallback("asc_onColumnsProps",_.bind(this.onColumnsProps,this)),this.api.asc_registerCallback("asc_onSectionProps",_.bind(this.onSectionProps,this))},onChangeCompactView:function(t,e){Common.localStorage.setItem("de-compact-toolbar",e?1:0),Common.NotificationCenter.trigger("layout:changed","toolbar"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onApiFontSize:function(t){this._state.fontsize!==t&&(this.toolbar.cmbFontSize.setValue(t),this._state.fontsize=t)},onApiBold:function(t){this._state.bold!==t&&(this.toolbar.btnBold.toggle(!0===t,!0),this._state.bold=t)},onApiItalic:function(t){this._state.italic!==t&&(this.toolbar.btnItalic.toggle(!0===t,!0),this._state.italic=t)},onApiUnderline:function(t){this._state.underline!==t&&(this.toolbar.btnUnderline.toggle(!0===t,!0),this._state.underline=t)},onApiStrikeout:function(t){this._state.strike!==t&&(this.toolbar.btnStrikeout.toggle(!0===t,!0),this._state.strike=t)},onApiVerticalAlign:function(t){this._state.valign!==t&&(this.toolbar.btnSuperscript.toggle(1==t,!0),this.toolbar.btnSubscript.toggle(2==t,!0),this._state.valign=t)},onApiCanRevert:function(t,e){"undo"==t?this._state.can_undo!==e&&(this.toolbar.btnUndo.setDisabled(!e),this._state.can_undo=e):this._state.can_redo!==e&&(this.toolbar.btnRedo.setDisabled(!e),this._state.can_redo=e)},onApiCanCopyCut:function(t){this._state.can_copycut!==t&&(this.toolbar.btnCopy.setDisabled(!t),this._state.can_copycut=t)},onApiBullets:function(t){var e=t.get_ListType();if(this._state.bullets.type!=e||this._state.bullets.subtype!=t.get_ListSubType()||this.toolbar.btnMarkers.pressed&&0!==e||this.toolbar.btnNumbers.pressed&&1!==e||this.toolbar.btnMultilevels.pressed&&2!==e)switch(this._state.bullets.type=e,this._state.bullets.subtype=t.get_ListSubType(),this._clearBullets(),this._state.bullets.type){case 0:this.toolbar.btnMarkers.toggle(!0,!0),this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype,!0);break;case 1:var i=0;switch(this._state.bullets.subtype){case 1:i=4;break;case 2:i=5;break;case 3:i=6;break;case 4:i=1;break;case 5:i=2;break;case 6:i=3;break;case 7:i=7}this.toolbar.btnNumbers.toggle(!0,!0),this.toolbar.mnuNumbersPicker.selectByIndex(i,!0);break;case 2:this.toolbar.btnMultilevels.toggle(!0,!0),this.toolbar.mnuMultilevelPicker.selectByIndex(this._state.bullets.subtype,!0)}},onApiParagraphAlign:function(t){if(this._state.pralign!==t){this._state.pralign=t;var e,i=-1,n=this.toolbar;switch(t){case 0:i=2,e="btn-align-right";break;case 1:i=0,e="btn-align-left";break;case 2:i=1,e="btn-align-center";break;case 3:i=3,e="btn-align-just";break;default:i=-255,e="btn-align-left"}i<0?-255==i&&this._clearChecked(this.toolbar.btnHorizontalAlign.menu):this.toolbar.btnHorizontalAlign.menu.items[i].setChecked(!0);var o=this.toolbar.btnHorizontalAlign;if(o.rendered){var s=$(".btn-icon",o.cmpEl);s&&(s.removeClass(o.options.icls),o.options.icls=e,s.addClass(o.options.icls))}if(null===t||void 0===t)return n.btnAlignRight.toggle(!1,!0),n.btnAlignLeft.toggle(!1,!0),n.btnAlignCenter.toggle(!1,!0),void n.btnAlignJust.toggle(!1,!0);n.btnAlignRight.toggle(0===t,!0),n.btnAlignLeft.toggle(1===t,!0),n.btnAlignCenter.toggle(2===t,!0),n.btnAlignJust.toggle(3===t,!0)}},onApiLineSpacing:function(t){var e=null===t.get_Line()||null===t.get_LineRule()||1!=t.get_LineRule()?-1:t.get_Line();if(this._state.linespace!==e){if(this._state.linespace=e,_.each(this.toolbar.mnuLineSpace.items,function(t){t.setChecked(!1,!0)}),e<0)return;Math.abs(e-1)<1e-4?this.toolbar.mnuLineSpace.items[0].setChecked(!0,!0):Math.abs(e-1.15)<1e-4?this.toolbar.mnuLineSpace.items[1].setChecked(!0,!0):Math.abs(e-1.5)<1e-4?this.toolbar.mnuLineSpace.items[2].setChecked(!0,!0):Math.abs(e-2)<1e-4?this.toolbar.mnuLineSpace.items[3].setChecked(!0,!0):Math.abs(e-2.5)<1e-4?this.toolbar.mnuLineSpace.items[4].setChecked(!0,!0):Math.abs(e-3)<1e-4&&this.toolbar.mnuLineSpace.items[5].setChecked(!0,!0)}},onApiCanAddHyperlink:function(t){var e=!t||this._state.prcontrolsdisable;e!=this.toolbar.btnInsertHyperlink.isDisabled()&&this.editMode&&this.toolbar.btnInsertHyperlink.setDisabled(e)},onApiPageSize:function(t,e){(Math.abs(this._state.pgsize[0]-t)>.01||Math.abs(this._state.pgsize[1]-e)>.01)&&(this._state.pgsize=[t,e],this.toolbar.mnuPageSize&&(this._clearChecked(this.toolbar.mnuPageSize),_.each(this.toolbar.mnuPageSize.items,function(i){if(i.value&&"object"==typeof i.value&&Math.abs(i.value[0]-t)<.01&&Math.abs(i.value[1]-e)<.01)return i.setChecked(!0),!1},this)))},onSectionProps:function(t){if(t){var e=t.get_LeftMargin(),i=t.get_TopMargin(),n=t.get_RightMargin(),o=t.get_BottomMargin();(!this._state.pgmargins||Math.abs(this._state.pgmargins[0]-i)>.01||Math.abs(this._state.pgmargins[1]-e)>.01||Math.abs(this._state.pgmargins[2]-o)>.01||Math.abs(this._state.pgmargins[3]-n)>.01)&&(this._state.pgmargins=[i,e,o,n],this.toolbar.btnPageMargins.menu&&(this._clearChecked(Line truncated
|
||||||
|
o.render(m),o.cmpEl.attr({tabindex:"-1"})),m.css({left:n[0],top:n[1]});var u=$(o.el);u.trigger($.Event("show.bs.dropdown")),u.trigger($.Event("hide.bs.dropdown")),o.isVisible()&&$(o).toggleClass("open").trigger("shown.bs.dropdown"),this.toolbar.listStyles.isStylesNotClosable=!0,o.show()}}},onSaveStyle:function(t){window.styles_loaded=!1;var e,i=this;if(i.api){var n=function(e,n){if("ok"==n){var o=e.getTitle(),s=e.getNextStyle(),a=t.get_Link();i._state.prstyle=o,t.put_Name(o),a.put_Name(o+"_character"),t.put_Next(s.asc_getName()),i.api.asc_AddNewStyle(t)}Common.NotificationCenter.trigger("edit:complete",i.toolbar)},o=[];_.each(window.styles.get_MergedStyles(),function(t){o.push({value:t,displayValue:t.get_Name()})}),e=new DE.Views.StyleTitleDialog({handler:n,formats:o}),e.show()}Common.component.Analytics.trackEvent("ToolBar","Save as Style")},onMenuSaveStyle:function(t,e){var i=this;i.api&&!i.toolbar.listStylesAdditionalMenuItem.isDisabled()&&i.onSaveStyle(i.api.asc_GetStyleFromFormatting())},onUpdateStyle:function(t){this.api&&(t.put_Name(this._state.prstyle),this.api.asc_AddNewStyle(t))},onHideTitleBar:function(t,e){var i=this.getApplication().getController("Viewport").getView("Common.Views.Header");i&&i.setVisible(!e),Common.localStorage.setItem("de-hidden-title",e?1:0),Common.NotificationCenter.trigger("layout:changed","header"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideStatusBar:function(t,e){var i=this.getApplication().getController("Statusbar").getView("Statusbar");i&&i.setVisible(!e),Common.localStorage.setItem("de-hidden-status",e?1:0),Common.NotificationCenter.trigger("layout:changed","status"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideRulers:function(t,e){this.api&&this.api.asc_SetViewRulers(!e),Common.localStorage.setItem("de-hidden-rulers",e?1:0),Common.NotificationCenter.trigger("layout:changed","rulers"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomToPageToggle:function(t,e){this.api&&(e?this.api.zoomFitToPage():this.api.zoomCustomMode()),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomToWidthToggle:function(t,e){this.api&&(e?this.api.zoomFitToWidth():this.api.zoomCustomMode()),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomInClick:function(t){this.api&&this.api.zoomIn(),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomOutClick:function(t){this.api&&this.api.zoomOut(),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onNotesClick:function(){this.api&&this.api.asc_AddFootnote()},onNotesMenuClick:function(t,e){if(this.api){if("ins_footnote"==e.value)this.api.asc_AddFootnote();else if("delele"==e.value)Common.UI.warning({msg:this.confirmDeleteFootnotes,buttons:["yes","no"],primary:"yes",callback:_.bind(function(t){"yes"==t&&this.api.asc_RemoveAllFootnotes(),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},this)});else{if("settings"!=e.value)return;var i=this;new DE.Views.NoteSettingsDialog({api:i.api,handler:function(t,e){e&&(i.api.asc_SetFootnoteProps(e.props,e.applyToAll),"insert"==t&&i.api.asc_AddFootnote(e.custom)),Common.NotificationCenter.trigger("edit:complete",i.toolbar)},props:i.api.asc_GetFootnoteProps()}).show()}Common.NotificationCenter.trigger("edit:complete",this.toolbar)}},onFootnotePrevClick:function(t){this.api&&this.api.asc_GotoFootnote(!1);var e=this;setTimeout(function(){Common.NotificationCenter.trigger("edit:complete",e.toolbar)},50)},onFootnoteNextClick:function(t){this.api&&this.api.asc_GotoFootnote(!0);var e=this;setTimeout(function(){Common.NotificationCenter.trigger("edit:complete",e.toolbar)},50)},_clearBullets:function(){this.toolbar.btnMarkers.toggle(!1,!0),this.toolbar.btnNumbers.toggle(!1,!0),this.toolbar.btnMultilevels.toggle(!1,!0),this.toolbar.mnuMarkersPicker.selectByIndex(0,!0),this.toolbar.mnuNumbersPicker.selectByIndex(0,!0),this.toolbar.mnuMultilevelPicker.selectByIndex(0,!0)},_getApiTextSize:function(){var t=12,e=this.api.get_TextProps();return e&&e.get_TextPr&&(t=e.get_TextPr().get_FontSize()),t},onNewFontColor:function(t,e){this.toolbar.mnuFontColorPicker.addNewColor()},onAutoFontColor:function(t){this._state.clrtext=this._state.clrtext_asccolor=void 0;var e=new Asc.asc_CColor;e.put_auto(!0),this.api.put_TextColor(e),this.toolbar.btnFontColor.currentColor={color:e,isAuto:!0},$(".btn-color-value-line",this.toolbar.btnFontColor.cmpEl).css("background-color","#000"),this.toolbar.mnuFontColorPicker.clearSelection(),this.toolbar.mnuFontColorPicker.currentColor={color:e,isAuto:!0}},onNewParagraphColor:function(t,e){this.toolbar.mnuParagraphColorPicker.addNewColor()},onSelectHighlightColor:function(t,e){this._setMarkerColor(e,"menu")},onSelectFontColor:function(t,e){this._state.clrtext=this._state.clrtext_asccolor=void 0;var i="object"==typeof e?e.isAuto?"#000":e.color:e;this.toolbar.btnFontColor.currentColor=e,$(".btn-color-value-line",this.toolbar.btnFontColor.cmpEl).css("backLine truncated
|
||||||
|
txtMatrix_Flat_Square:"Sparse Matrix",confirmAddFontName:"The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the device fonts, the saved font will be used when it is available.<br>Do you want to continue?",notcriticalErrorTitle:"Warning",txtMarginsW:"Left and right margins are too high for a given page wight",txtMarginsH:"Top and bottom margins are too high for a given page height",confirmDeleteFootnotes:"Do you want to delete all footnotes?"},DE.Controllers.Toolbar||{}))}),define("text!documenteditor/main/app/template/StatusBar.template",[],function(){return'\r\n<div class="statusbar" style="display:table;">\r\n <div class="status-group dropup">\r\n <label id="label-pages" class="status-label dropdown-toggle" style="margin-left: 40px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>\r\n <div id="status-goto-box" class="dropdown-menu">\r\n <label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>\r\n <div id="status-goto-page" style="display:inline-block;"></div>\r\n </div>\r\n </div>\r\n \x3c!-- /** coauthoring begin **/ --\x3e\r\n <div id="status-users-ct" class="status-group dropup" style="display:none;">\r\n <div class="separator short" style="margin-right: 12px; margin-left: 40px;" />\r\n <div id="status-users-block" style="display:inline-block; cursor:pointer;">\r\n <span id="users-icon" class="img-commonctrl" style="margin-bottom: 2px;"/>\r\n <label id="status-users-count" class="status-label" style="font-size: 14px; font-weight: normal; margin-top: -1px;">+</label>\r\n </div>\r\n <div id="status-users-menu" class="dropdown-menu">\r\n <label style="display: block;margin-right: 14px;"><%= scope.tipUsers %></label>\r\n <div id="status-users-list"></div>\r\n <label id="status-change-rights" class="link" style="margin-top: 15px;"><%= scope.txAccessRights %></label>\r\n </div>\r\n <div class="separator short" style="margin-left: 10px;" />\r\n </div>\r\n \x3c!-- /** coauthoring end **/ --\x3e\r\n <div class="status-group" style="width:100%; text-align:center;">\r\n <label id="label-action" class="status-label"></label>\r\n </div>\r\n <div class="status-group" style="">\r\n <div class="separator short el-edit"></div>\r\n <div class="cnt-lang el-edit">\r\n <div class="dropdown-toggle" data-toggle="dropdown" style="margin-right: 6px;">\r\n <span class="icon-lang-flag img-toolbarmenu lang-flag" data-vertical-offset="10" />\r\n <label id="status-label-lang" class="status-label">English (United States)</label>\r\n <div class="caret up img-commonctrl" />\r\n </div>\r\n </div>\r\n <button id="btn-doc-lang" type="button" class="btn small btn-toolbar el-edit"><span class="btn-icon btn-ic-doclang"> </span></button>\r\n <button id="btn-doc-spell" type="button" class="btn small btn-toolbar el-edit"><span class="btn-icon btn-ic-docspell"> </span></button>\r\n <div class="separator short el-edit"></div>\r\n <div id="btn-doc-review" class="el-edit el-review" style="display: inline-block;"></div>\r\n <div class="separator short el-edit el-review"></div>\r\n <button id="btn-zoom-topage" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-ic-zoomtopage"> </span></button>\r\n <button id="btn-zoom-towidth" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-ic-zoomtowidth"> </span></button>\r\n <button id="btn-zoom-down" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-ic-zoomdown"> </span></button>\r\n <div class="cnt-zoom">\r\n <div class="dropdown-toggle" data-toggle="dropdown">\r\n <label id="label-zoom" class="status-label">Zoom 100%</label>\r\n </div>\r\n </div>\r\n <button id="btn-zoom-up" type="button" class="btn small btn-toolbar" style="margin-right:40px;"><span class="btn-icon btn-ic-zoomup"> </span></button>\r\n </div>\r\n</div>\r\n'}),define("documenteditor/main/app/model/Pages",["underscore","backbone"],function(t,e){"use strict";DE.Models=DE.Models||{},DE.Models.Pages=e.Model.extend({defaults:{current:0,count:0}})}),define("documenteditor/main/app/view/Statusbar",["text!documenteditor/main/app/template/StatusBar.template","jquery","underscore","backbone","tip","common/main/lib/component/Menu","common/main/lib/component/Window","documenteditor/main/app/model/Pages"],function(t,e,i,n){"use strict";function o(t){this.pages.set("count",t)}function s(t){this.pages.set("current",t+1)}function a(t,i,n){e(".statusbar #label-pages",this.$el).text(Common.Utils.String.format(this.pageIndexText,t.get("current"),t.get("count")))}functioLine truncated
|
||||||
|
return'<div id="<%=id%>" class="user-comment-item">\r\n <div class="user-name-colored"><span style="background-color:<%=usercolor%>;"><%=scope.getUserName(username)%></span></div>\r\n <div class="user-date"><%=date%></div>\r\n <div class="user-message limit-height"><%=changetext%></div>\r\n <div class="edit-ct">\r\n <% if (scope.isReviewOnly) { %>\r\n <div class="btn-delete img-commonctrl"></div>\r\n <% } else { %>\r\n <div class="btn-accept img-commonctrl"></div>\r\n <div class="btn-reject img-commonctrl"></div>\r\n <% } %>\r\n </div>\r\n</div>'}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/ReviewChanges",["text!common/main/lib/template/ReviewChangesPopover.template","common/main/lib/util/utils","common/main/lib/component/Button","common/main/lib/component/DataView","common/main/lib/component/Layout","common/main/lib/component/Window"],function(t){"use strict";Common.Views.ReviewChangesPopover=Common.UI.Window.extend({initialize:function(t){var e={};_.extend(e,{closable:!1,width:265,height:120,header:!1,modal:!1},t),this.template=t.template||['<div class="box">','<div id="id-review-popover" class="comments-popover dataview-ct"></div>','<div id="id-review-arrow" class="comments-arrow review"></div>',"</div>"].join(""),this.store=t.store,this.delegate=t.delegate,e.tpl=_.template(this.template,e),this.arrow={margin:20,width:12,height:34},this.sdkBounds={width:0,height:0,padding:10,paddingTop:20},Common.UI.Window.prototype.initialize.call(this,e)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this,i=this.delegate,n=this.$window;n.css({height:"",minHeight:"",overflow:"hidden",position:"absolute",zIndex:"991"});var o=n.find(".body");o&&o.css("position","relative"),n.on("click",function(){n.css({zIndex:"991"}),Common.NotificationCenter.trigger("review:click")}),Common.NotificationCenter.on("comments:click",function(){n.css({zIndex:"990"})});var s=Common.UI.DataView.extend(function(){return{options:{handleSelect:!1,scrollable:!0,template:_.template('<div class="dataview-ct inner" style="overflow-y: hidden;"></div><div class="lock-area" style="cursor: default;"></div><div class="lock-author" style="cursor: default;"></div>')}}}());s&&(this.reviewChangesView?(this.reviewChangesView.render($("#id-review-popover")),this.reviewChangesView.onResetItems()):(this.reviewChangesView=new s({el:$("#id-review-popover"),store:e.store,itemTemplate:_.template(t)}),this.reviewChangesView.on("item:click",function(t,e,n,o){var s=$(o.target);s&&(s.hasClass("btn-accept")?i.fireEvent("reviewchange:accept",[n.get("changedata")]):s.hasClass("btn-reject")?i.fireEvent("reviewchange:reject",[n.get("changedata")]):s.hasClass("btn-delete")&&i.fireEvent("reviewchange:delete",[n.get("changedata")]))})))},show:function(t,e,i){this.options.animate=t;Common.UI.Window.prototype.show.call(this),this.reviewChangesView.scroller&&this.reviewChangesView.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0}),this.reviewChangesView.cmpEl.find(".lock-area").toggleClass("hidden",!e),this.reviewChangesView.cmpEl.find(".lock-author").toggleClass("hidden",!e||_.isEmpty(i)).text(i)},hide:function(){this.handlerHide&&this.handlerHide(),Common.UI.Window.prototype.hide.call(this),_.isUndefined(this.e)||this.e.keyCode!=Common.UI.Keys.ESC||(this.e.preventDefault(),this.e.stopImmediatePropagation(),this.e=void 0)},update:function(){this.reviewChangesView&&this.reviewChangesView.scroller&&this.reviewChangesView.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0})},isVisible:function(){return this.$window&&this.$window.is(":visible")},setLeftTop:function(t,e,i,n){if(this.$window||this.render(),n&&(t=this.arrowPosX,e=this.arrowPosY,i=this.leftX),!_.isUndefined(t)||!_.isUndefined(e)){this.arrowPosX=t,this.arrowPosY=e,this.leftX=i;var o=$("#id-review-popover"),s=$("#id-review-arrow"),a=$("#editor_sdk"),r=null,l=0,c="",d=0,h="",p=0,m="",u=0,g="",b=0,f=0,C=0,v=0,y=0,w=0;o&&s&&a&&a.get(0)&&(r=a.get(0).getBoundingClientRect())&&(l=r.height-2*this.sdkBounds.padding,this.$window.css({maxHeight:l+"px"}),this.sdkBounds.width=r.width,this.sdkBounds.height=r.height,_.isUndefined(t)||(c=$("#id_vertical_scroll"),c.length?d="none"!==c.css("display")?c.width():0:(c=$("#ws-v-scrollbar"),c.length&&(d="none"!==c.css("display")?c.width():0)),this.sdkBounds.width-=d,h=$("#id_panel_left"),h.length&&(p="none"!==h.css("display")?h.width():0),m=$("#id_panel_thumbnails"),m.length&&(u="none"!==m.css("display")?m.width():0,this.sdkBounds.width-=u),f=Math.min(0+t+this.arrow.width,0+this.sdkBounds.width-this.$window.outerWidth()),f=Math.max(0+p+this.arrow.width,f),s.removeClass("right").addClass("left"),_.isUndefined(i)||(C=this.$window.outerWidth())&&(t+C>this.sdkBounds.width-this.arrow.width+5&&this.leftX>C?(f=this.leftX-C+0-this.arrow.width,s.removeClass("left").addClass("right")):f=0+t+this.arrow.width),this.$window.css("left",f+"px")),_.isUndefined(e)||(g=$(Line truncated
|
||||||
|
null!==this._state.LineRuleIdx&&(this.numLineHeight.setDefaultUnit(this._arrLineRule[this._state.LineRuleIdx].defaultUnit),this.numLineHeight.setStep(this._arrLineRule[this._state.LineRuleIdx].step))},createDelayedElements:function(){this.UpdateThemeColors(),this.updateMetricUnit(),this._initSettings=!1},openAdvancedSettings:function(t){if(!this.linkAdvanced.hasClass("disabled")){var e=this;if(e.api&&!this._locked){var i=e.api.getSelectedElements();if(i&&i.length>0)for(var n,o,s=i.length-1;s>=0;s--)if(n=i[s].get_ObjectType(),o=i[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Paragraph==n){new DE.Views.ParagraphSettingsAdvanced({tableStylerRows:2,tableStylerColumns:1,paragraphProps:o,borderProps:e.borderAdvancedProps,isChart:e.isChart,api:e.api,handler:function(t,i){"ok"==t&&e.api&&(e.borderAdvancedProps=i.borderProps,e.api.paraApply(i.paragraphProps)),e.fireEvent("editcomplete",e)}}).show();break}}}},addNewColor:function(){this.mnuColorPicker.addNewColor("object"==typeof this.btnColor.color?this.btnColor.color.color:this.btnColor.color)},UpdateThemeColors:function(){this.mnuColorPicker||(this.btnColor.setMenu(new Common.UI.Menu({items:[{template:i.template('<div id="paragraph-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="paragraph-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})),this.mnuColorPicker=new Common.UI.ThemeColorPalette({el:e("#paragraph-color-menu"),transparent:!0}),this.mnuColorPicker.on("select",i.bind(this.onColorPickerSelect,this))),this.mnuColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},onHideMenus:function(t,e,i){i||this.fireEvent("editcomplete",this)},setLocked:function(t){this._locked=t},disableControls:function(t){this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},hideTextOnlySettings:function(t){this._state.HideTextOnlySettings!==t&&(this._state.HideTextOnlySettings=t,this.TextOnlySettings.toggleClass("hidden",1==t))},strParagraphSpacing:"Paragraph Spacing",strSomeParagraphSpace:"Don't add interval between paragraphs of the same style",strLineHeight:"Line Spacing",strSpacingBefore:"Before",strSpacingAfter:"After",textAuto:"Multiple",textAtLeast:"At least",textExact:"Exactly",textAdvanced:"Show advanced settings",textAt:"At",txtAutoText:"Auto",textBackColor:"Background color",textNewColor:"Add New Custom Color"},DE.Views.ParagraphSettings||{}))}),define("text!documenteditor/main/app/template/HeaderFooterSettings.template",[],function(){return'<table cols="1">\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.textPageNum %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="headerfooter-button-top-left" style="display: inline-block; margin-right:5px;"></div>\r\n <div id="headerfooter-button-top-center" style="display: inline-block; margin-right:5px;"></div>\r\n <div id="headerfooter-button-top-right" style="display: inline-block; margin-right:5px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="headerfooter-button-bottom-left" style="display: inline-block; margin-right:5px;"></div>\r\n <div id="headerfooter-button-bottom-center" style="display: inline-block; margin-right:5px;"></div>\r\n <div id="headerfooter-button-bottom-right" style="display: inline-block; margin-right:5px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.textPosition %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <label id="headerfooter-label-position" class="input-label"><%= scope.textHeaderFromTop %></label>\r\n <div id="headerfooter-spin-position"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.textOptions %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="headerfooter-check-diff-first"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="headerfooter-check-diff-odd"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <div id="headerfooter-check-same-as"></div>\r\n </td>\r\n </tr>\r\n <tr class="finish-cell"></tr>\r\n</table>'}),define("documenteditor/main/app/view/HeaderFooterSettings",["text!documenteditor/main/app/template/HeaderFooterSettinLine truncated
|
||||||
|
this.spnWidth.setValue(o,!0)),this.spnHeight.setValue(s,!0)}this._changedProps&&(this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue())))},this)),this.spinners.push(this.spnWidth),this.spnHeight=new Common.UI.MetricSpinner({el:$("#image-advanced-spin-height"),step:.1,width:80,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spnHeight.on("change",_.bind(function(t,e,i,n){var o=t.getNumberValue(),s=null;this.btnRatio.pressed&&(s=o*this._nRatio,s>this.sizeMax.width&&(s=this.sizeMax.width,o=s/this._nRatio,this.spnHeight.setValue(o,!0)),this.spnWidth.setValue(s,!0)),this._changedProps&&(this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnWidth.getNumberValue())))},this)),this.spinners.push(this.spnHeight),this.btnOriginalSize=new Common.UI.Button({el:$("#image-advanced-button-original-size")}),this.btnOriginalSize.on("click",_.bind(function(t,e){this.spnWidth.setValue(this.sizeOriginal.width,!0),this.spnHeight.setValue(this.sizeOriginal.height,!0),this._nRatio=this.sizeOriginal.width/this.sizeOriginal.height,this._changedProps&&(this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue())),this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnWidth.getNumberValue())))},this)),this.btnRatio=new Common.UI.Button({cls:"btn-toolbar",iconCls:"advanced-btn-ratio",style:"margin-bottom: 1px;",enableToggle:!0,hint:this.textKeepRatio}),this.btnRatio.render($("#image-advanced-button-ratio")),this.btnRatio.on("click",_.bind(function(t,e){t.pressed&&this.spnHeight.getNumberValue()>0&&(this._nRatio=this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue()),this._changedProps&&this._changedProps.asc_putLockAspect(t.pressed)},this)),this.radioHSize=new Common.UI.RadioBox({el:$("#shape-radio-hsize"),name:"asc-radio-width",checked:!0}),this.radioHSize.on("change",_.bind(this.onRadioHSizeChange,this)),this.radioHSizePc=new Common.UI.RadioBox({el:$("#shape-radio-hsizepc"),name:"asc-radio-width"}),this.radioHSizePc.on("change",_.bind(this.onRadioHSizePcChange,this)),this.radioVSize=new Common.UI.RadioBox({el:$("#shape-radio-vsize"),name:"asc-radio-height",checked:!0}),this.radioVSize.on("change",_.bind(this.onRadioVSizeChange,this)),this.radioVSizePc=new Common.UI.RadioBox({el:$("#shape-radio-vsizepc"),name:"asc-radio-height"}),this.radioVSizePc.on("change",_.bind(this.onRadioVSizePcChange,this)),this.chRatio=new Common.UI.CheckBox({el:$("#shape-checkbox-ratio"),labelText:this.textAspectRatio}),this.chRatio.on("change",_.bind(function(t,e,i,n){"checked"==t.getValue()&&this.spnShapeHeight.getNumberValue()>0&&(this._nRatio=this.spnShapeWidth.getNumberValue()/this.spnShapeHeight.getNumberValue()),this._changedProps&&this._changedProps.asc_putLockAspect("checked"==t.getValue())},this)),this.spnShapeWidth=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-width"),step:.1,width:80,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spnShapeWidth.on("change",_.bind(function(t,e,i,n){if("checked"==this.chRatio.getValue()&&!this.chRatio.isDisabled()){var o=t.getNumberValue(),s=o/this._nRatio;s>this.sizeMax.height&&(s=this.sizeMax.height,o=s*this._nRatio,this.spnShapeWidth.setValue(o,!0)),this.spnShapeHeight.setValue(s,!0)}this._changedProps&&(this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),this.fillShapeHeight())},this)),this.spinners.push(this.spnShapeWidth),this.spnShapeHeight=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-height"),step:.1,width:80,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spnShapeHeight.on("change",_.bind(function(t,e,i,n){var o=t.getNumberValue(),s=null;"checked"!=this.chRatio.getValue()||this.chRatio.isDisabled()||(s=o*this._nRatio,s>this.sizeMax.width&&(s=this.sizeMax.width,o=s/this._nRatio,this.spnShapeHeight.setValue(o,!0)),this.spnShapeWidth.setValue(s,!0)),this._changedProps&&(this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),this.fillShapeWidth())},this)),this.spinners.push(this.spnShapeHeight),this.spnShapeWidthPc=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-width-rel"),disabled:!0,step:1,width:80,defaultUnit:"%",value:"1 %",maxValue:1e3,minValue:1}),this.spnShapeWidthPc.on("change",_.bind(function(t,e,i,n){this._changedProps&&(null!==this._changedProps.get_SizeRelH()&&void 0!==this._changedProps.get_SizeRelH()||this._changedProps.put_SizeRelH(new Asc.CImagePositionH),this._changedProps.get_SizeRelH().put_Value(t.getNumberValue()),this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom),this.fillShapeHeight())},this)),this.spnShapeHeightPc=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-height-rel"),disabled:!0,step:1,width:80,defaultUnit:"%",value:"1 %",maxValue:1e3Line truncated
|
||||||
|
for(e=n.get_RelativeFrom(),o=0;o<this._arrVRelative.length;o++)if(e==this._arrVRelative[o].value){this.cmbVRelative.setValue(e),this._state.VAlignFrom=e;break}}else if(n.get_Percent()){for(this.radioVPositionPc.setValue(!0),this.spnYPc.setValue(n.get_Value()),e=n.get_RelativeFrom(),o=0;o<this._arrVRelativePc.length;o++)if(e==this._arrVRelativePc[o].value){this.cmbVPositionPc.setValue(e),this._state.VPositionPcFrom=e;break}}else for(this.radioVPosition.setValue(!0),e=n.get_Value(),this.spnY.setValue(Common.Utils.Metric.fnRecalcFromMM(e)),e=n.get_RelativeFrom(),o=0;o<this._arrVRelative.length;o++)if(e==this._arrVRelative[o].value){this.cmbVPosition.setValue(e),this._state.VPositionFrom=e;break}this.chMove.setValue(e==Asc.c_oAscRelativeFromV.Line||e==Asc.c_oAscRelativeFromV.Paragraph,!0),this.chMove.setDisabled(!n.get_UseAlign()&&n.get_Percent())}this.chOverlap.setValue(null!==t.get_AllowOverlap()&&void 0!==t.get_AllowOverlap()?t.get_AllowOverlap():"indeterminate",!0),t.get_Height()>0&&(this._nRatio=t.get_Width()/t.get_Height());var s=t.get_ShapeProperties(),a=t.get_ChartProperties();if(this.btnOriginalSize.setVisible(!(s||a)),this.btnOriginalSize.setDisabled(null===t.get_ImageUrl()||void 0===t.get_ImageUrl()),this.btnsCategory[4].setVisible(null!==s&&!s.get_FromChart()),this.btnsCategory[5].setVisible(null!==s&&!s.get_FromChart()),this.btnsCategory[2].setDisabled(t.get_FromGroup()),s){this._objectType=Asc.c_oAscTypeSelectElement.Shape,this._setShapeDefaults(s),this.setTitle(this.textTitleShape),e=t.asc_getLockAspect(),this.chRatio.setValue(e),this.spnShapeWidth.setMaxValue(this.sizeMax.width),this.spnShapeHeight.setMaxValue(this.sizeMax.height);var r=t.get_SizeRelH();if(r){for(this.radioHSizePc.setValue(!0),this.spnShapeWidthPc.setValue(r.get_Value()),e=r.get_RelativeFrom(),o=0;o<this._arrHRelativePc.length;o++)if(e==this._arrHRelativePc[o].value){this.cmbWidthPc.setValue(e),this.spnShapeWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrHRelativePc[o].size*r.get_Value()/100).toFixed(2),!0),this._state.ShapeWidthPcFrom=e;break}}else this.radioHSize.setValue(!0),e=t.get_Width(),this.spnShapeWidth.setValue(void 0!==e?Common.Utils.Metric.fnRecalcFromMM(e).toFixed(2):"",!0);var l=t.get_SizeRelV();if(l){for(this.radioVSizePc.setValue(!0),this.spnShapeHeightPc.setValue(l.get_Value()),e=l.get_RelativeFrom(),o=0;o<this._arrVRelativePc.length;o++)if(e==this._arrVRelativePc[o].value){this.cmbHeightPc.setValue(e),this.spnShapeHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(this._arrVRelativePc[o].size*l.get_Value()/100).toFixed(2),!0),this._state.ShapeHeightPcFrom=e;break}}else this.radioVSize.setValue(!0),e=t.get_Height(),this.spnShapeHeight.setValue(void 0!==e?Common.Utils.Metric.fnRecalcFromMM(e).toFixed(2):"",!0);this.chRatio.setDisabled(this.radioVSizePc.getValue()||this.radioHSizePc.getValue());var c=s.get_paddings();if(c){var d=c.get_Left();this.spnMarginLeft.setValue(null!==d&&void 0!==d?Common.Utils.Metric.fnRecalcFromMM(d):"",!0),d=c.get_Top(),this.spnMarginTop.setValue(null!==d&&void 0!==d?Common.Utils.Metric.fnRecalcFromMM(d):"",!0),d=c.get_Right(),this.spnMarginRight.setValue(null!==d&&void 0!==d?Common.Utils.Metric.fnRecalcFromMM(d):"",!0),d=c.get_Bottom(),this.spnMarginBottom.setValue(null!==d&&void 0!==d?Common.Utils.Metric.fnRecalcFromMM(d):"",!0)}this.btnsCategory[5].setDisabled(null===c)}else e=t.asc_getLockAspect(),a?(this._objectType=Asc.c_oAscTypeSelectElement.Chart,this.setTitle(this.textTitleChart)):this.setTitle(this.textTitle),this.btnRatio.toggle(e),this.spnWidth.setMaxValue(this.sizeMax.width),this.spnHeight.setMaxValue(this.sizeMax.height),e=t.get_Width(),this.spnWidth.setValue(void 0!==e?Common.Utils.Metric.fnRecalcFromMM(e).toFixed(2):"",!0),e=t.get_Height(),this.spnHeight.setValue(void 0!==e?Common.Utils.Metric.fnRecalcFromMM(e).toFixed(2):"",!0);e=t.asc_getTitle(),this.inputAltTitle.setValue(e||""),e=t.asc_getDescription(),this.textareaAltDescription.val(e||""),this._changedProps=new Asc.asc_CImgProperty}},getSettings:function(){var t=this._changedProps;if(this._objectType==Asc.c_oAscTypeSelectElement.Shape&&(t.put_ShapeProperties(this._changedShapeProps),this.Margins&&(null!==t.get_ShapeProperties()&&void 0!==t.get_ShapeProperties()||t.put_ShapeProperties(new Asc.asc_CShapeProperty),t.get_ShapeProperties().put_paddings(this.Margins))),this._originalProps.get_WrappingStyle()===Asc.c_oAscWrapStyle2.Inline&&void 0!==t.get_WrappingStyle()&&t.get_WrappingStyle()!==Asc.c_oAscWrapStyle2.Inline){if(null===t.get_PositionH()||void 0===t.get_PositionH()){t.put_PositionH(new Asc.CImagePositionH),t.get_PositionH().put_UseAlign(!1),t.get_PositionH().put_Percent(!1),t.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Column);var e=this._originalProps.get_Value_X(Asc.c_oAscRelativeFromH.Column);t.get_PositionH().put_Value(e)}null!==t.get_PositionV()&&void 0!==t.get_PositionV()||(t.put_PositionV(new Asc.CImagePositionV),t.get_PositionV().put_UseAlign(!1),t.get_PositionV().put_Percent(Line truncated
|
||||||
|
a.get_PositionV().put_RelativeFrom(Asc.c_oAscRelativeFromV.Paragraph),r=this._originalProps.get_Value_Y(Asc.c_oAscRelativeFromV.Paragraph),a.get_PositionV().put_Value(r)}this.api.ImgApply(a)}this.fireEvent("editcomplete",this)}},setOriginalSize:function(){if(this.api){var t=this.api.get_OriginalSizeImage(),e=t.get_ImageWidth(),i=t.get_ImageHeight();this.labelWidth[0].innerHTML=this.textWidth+": "+Common.Utils.Metric.fnRecalcFromMM(e).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName(),this.labelHeight[0].innerHTML=this.textHeight+": "+Common.Utils.Metric.fnRecalcFromMM(i).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName();var n=new Asc.asc_CImgProperty;n.put_Width(e),n.put_Height(i),this.api.ImgApply(n),this.fireEvent("editcomplete",this)}},insertFromUrl:function(){var t=this;new Common.Views.ImageFromUrlDialog({handler:function(e,n){if("ok"==e&&t.api){var o=n.replace(/ /g,"");if(!i.isEmpty(o)){var s=new Asc.asc_CImgProperty;s.put_ImageUrl(o),t.api.ImgApply(s)}}t.fireEvent("editcomplete",t)}}).show()},openAdvancedSettings:function(t){if(!this.linkAdvanced.hasClass("disabled")){var e=this;if(e.api&&!this._locked){var i=e.api.getSelectedElements();if(i&&i.length>0)for(var n,o,s=i.length-1;s>=0;s--)if(n=i[s].get_ObjectType(),o=i[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Image==n){var a;e.btnOriginalSize.isDisabled()||(a=e.api.get_OriginalSizeImage())&&(a={width:a.get_ImageWidth(),height:a.get_ImageHeight()});var r=this.api.GetSectionInfo();r={width:r.get_PageWidth()-(r.get_MarginLeft()+r.get_MarginRight()),height:r.get_PageHeight()-(r.get_MarginTop()+r.get_MarginBottom())},new DE.Views.ImageSettingsAdvanced({imageProps:o,sizeOriginal:a,sizeMax:r,sectionProps:e.api.asc_GetSectionProps(),handler:function(t,i){"ok"==t&&e.api&&e.api.ImgApply(i.imageProps),e.fireEvent("editcomplete",e)}}).show();break}}}},setLocked:function(t){this._locked=t},disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},textSize:"Size",textWrap:"Wraping Style",textWidth:"Width",textHeight:"Height",textOriginalSize:"Default Size",textInsert:"Replace Image",textFromUrl:"From URL",textFromFile:"From File",textAdvanced:"Show advanced settings",txtInline:"Inline",txtSquare:"Square",txtTight:"Tight",txtThrough:"Through",txtTopAndBottom:"Top and bottom",txtBehind:"Behind",txtInFront:"In front",textEditObject:"Edit Object",textEdit:"Edit"},DE.Views.ImageSettings||{}))}),define("text!documenteditor/main/app/template/ChartSettings.template",[],function(){return'<table cols="2">\r\n <tr>\r\n <td colspan=2>\r\n <label class="header"><%= scope.textSize %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label id="chart-label-width" class="input-label"><%= scope.textWidth %></label>\r\n </td>\r\n <td class="padding-small" width="50%">\r\n <label id="chart-label-height" class="input-label"><%= scope.textHeight %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2>\r\n <label class="header"><%= scope.textWrap %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div id="chart-button-wrap" style=""></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2>\r\n <label class="header"><%= scope.textChartType %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div id="chart-button-type" style=""></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div class="" id="chart-combo-style" style="width: 100%;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <button type="button" class="btn btn-text-default" id="chart-button-edit-data" style="width:115px;"><%= scope.textEditData %></button>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" colspan=2>\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align="center" colspan=2>\r\n <label class="link" id="chart-advanced-link"><%= scope.textAdvanced %></label>\r\n </td>\r\n </tr>\r\n <tr class="finish-cell"></tr>\r\n</table>'}),define("documenteditor/main/app/view/ChartSettings"Line truncated
|
||||||
|
define("documenteditor/main/app/view/TableSettings",["text!documenteditor/main/app/template/TableSettings.template","jquery","underscore","backbone","common/main/lib/component/Button","common/main/lib/component/CheckBox","common/main/lib/component/ThemeColorPalette","common/main/lib/component/ColorButton","common/main/lib/component/ComboBorderSize","common/main/lib/component/ComboDataView","common/main/lib/view/InsertTableDialog","documenteditor/main/app/view/TableSettingsAdvanced"],function(t,e,i,n){"use strict";DE.Views.TableSettings=n.View.extend(i.extend({el:"#id-table-settings",template:i.template(t),events:{},options:{alias:"TableSettings"},initialize:function(){this._initSettings=!0,this._state={TemplateId:0,CheckHeader:!1,CheckTotal:!1,CheckBanded:!1,CheckFirst:!1,CheckLast:!1,CheckColBanded:!1,WrapStyle:-1,CanBeFlow:!0,TableAlignment:-1,TableIndent:0,BackColor:"#000000",RepeatRow:!1,DisabledControls:!1},this.lockedControls=[],this._locked=!1,this._originalLook=new Asc.CTablePropLook,this._originalProps=null,this.CellBorders={},this.CellColor={Value:1,Color:"transparent"},this.BorderSize=1,this._noApply=!1,this._wrapHandled=!1,this.render()},onCheckTemplateChange:function(t,e,i,n,o){if(this.api){var s=new Asc.CTableProp,a=this._originalLook?this._originalLook:new Asc.CTablePropLook;switch(t){case 0:a.put_FirstRow("checked"==e.getValue());break;case 1:a.put_LastRow("checked"==e.getValue());break;case 2:a.put_BandHor("checked"==e.getValue());break;case 3:a.put_FirstCol("checked"==e.getValue());break;case 4:a.put_LastCol("checked"==e.getValue());break;case 5:a.put_BandVer("checked"==e.getValue())}s.put_TableLook(a),this.api.tblApply(s)}this.fireEvent("editcomplete",this)},onTableTemplateSelect:function(t,e){if(this.api&&!this._noApply){var i=new Asc.CTableProp;i.put_TableStyle(e.get("templateId")),this.api.tblApply(i)}this.fireEvent("editcomplete",this)},onBtnWrapClick:function(t,e){if(this.api&&t.pressed&&!this._noApply){var i=new Asc.CTableProp;i.put_TableWrap(t.options.posId),t.options.posId==c_tableWrap.TABLE_WRAP_NONE&&(this._state.TableAlignment<0&&(this._state.TableAlignment=c_tableAlign.TABLE_ALIGN_LEFT),i.put_TableAlignment(this._state.TableAlignment),i.put_TableIndent(this._state.TableIndent)),i.put_CellSelect(!0),this.api.tblApply(i)}if(this._wrapHandled)return void(this._wrapHandled=!1);this._wrapHandled=!0,this.fireEvent("editcomplete",this)},onCheckRepeatRowChange:function(t,e,i,n){if(this.api){var o=new Asc.CTableProp;o.put_RowsInHeader("checked"==t.getValue()?1:0),this.api.tblApply(o)}this.fireEvent("editcomplete",this)},onColorsBackSelect:function(t,e){if(this.btnBackColor.setColor(e),this.CellColor={Value:1,Color:e},this.api){var i=new Asc.CTableProp,n=new Asc.CBackground;i.put_CellsBackground(n),"transparent"==this.CellColor.Color?n.put_Value(1):(n.put_Value(0),n.put_Color(Common.Utils.ThemeColor.getRgbColor(this.CellColor.Color))),i.put_CellSelect(!0),this.api.tblApply(i)}this.fireEvent("editcomplete",this)},addNewColor:function(t,e){t.addNewColor("object"==typeof e.color?e.color.color:e.color)},onColorsBorderSelect:function(t,e){this.btnBorderColor.setColor(e)},onBtnBordersClick:function(t,e){if(this._UpdateBordersStyle(t.options.strId,!0),this.api){var i=new Asc.CTableProp;i.put_CellBorders(this.CellBorders),i.put_CellSelect(!0),this.api.tblApply(i)}this.fireEvent("editcomplete",this)},onBorderSizeSelect:function(t,e){this.BorderSize=e.value},onEditClick:function(t,e,i){if(this.api)switch(e.value){case 0:this.api.selectRow();break;case 1:this.api.selectColumn();break;case 2:this.api.selectCell();break;case 3:this.api.selectTable();break;case 4:this.api.addRowAbove();break;case 5:this.api.addRowBelow();break;case 6:this.api.addColumnLeft();break;case 7:this.api.addColumnRight();break;case 8:this.api.remRow();break;case 9:this.api.remColumn();break;case 10:this.api.remTable();break;case 11:this.api.MergeCells();break;case 12:this.splitCells(t,e,i)}this.fireEvent("editcomplete",this)},splitCells:function(t,e,i){var n=this;new Common.Views.InsertTableDialog({handler:function(t,e){"ok"==t&&(n.api&&n.api.SplitCell(e.columns,e.rows),n.fireEvent("editcomplete",n))}}).show()},render:function(){e(this.el).html(this.template({scope:this}))},setApi:function(t){return this.api=t,t&&(this.api.asc_registerCallback("asc_onTblWrapStyleChanged",i.bind(this._TblWrapStyleChanged,this)),this.api.asc_registerCallback("asc_onTblAlignChanged",i.bind(this._TblAlignChanged,this)),this.api.asc_registerCallback("asc_onInitTableTemplates",i.bind(this._onInitTemplates,this))),this},createDelayedControls:function(){this.chHeader=new Common.UI.CheckBox({el:e("#table-checkbox-header"),labelText:this.textHeader}),this.lockedControls.push(this.chHeader),this.chTotal=new Common.UI.CheckBox({el:e("#table-checkbox-total"),labelText:this.textTotal}),this.lockedControls.push(this.chTotal),this.chBanded=new Common.UI.CheckBox({el:e("#table-checkbox-banded"),labelText:this.textBanded}),this.lockedControls.push(this.chBanLine truncated
|
||||||
|
maxValue:100,values:[0,100]},disabled:!1,template:e.template(['<div class="slider multi-slider">','<div class="track">','<div class="track-left"></div>','<div class="track-center""></div>','<div class="track-right" style=""></div>',"</div>","<% _.each(items, function(item) { %>",'<div class="thumb" style=""></div>',"<% }); %>","</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);e.width=e.options.width,e.minValue=e.options.minValue,e.maxValue=e.options.maxValue,e.delta=100/(e.maxValue-e.minValue),e.thumbs=[],e.options.el&&e.render()},render:function(t){var i=this;i.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({items:this.options.values})),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl));var n=this.cmpEl;n.find(".track-center").width(i.options.width-14),n.width(i.options.width);var o=function(t){t.preventDefault(),t.stopPropagation();var e=t.data,n=i.thumbs[e].value,a=e-1<0?0:i.thumbs[e-1].position,r=e+1<i.thumbs.length?i.thumbs[e+1].position:100,l=Math.max(a,Math.min(r,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100))),c=l/i.delta+i.minValue;i.setThumbPosition(e,l),i.thumbs[e].value=c,$(document).off("mouseup",o),$(document).off("mousemove",s),i._dragstart=void 0,i.trigger("changecomplete",i,c,n)},s=function(t){if(!i.disabled&&void 0!==i._dragstart){t.preventDefault(),t.stopPropagation();var e=t.data,n=i.thumbs[e].value,o=e-1<0?0:i.thumbs[e-1].position,s=e+1<i.thumbs.length?i.thumbs[e+1].position:100,a=Math.max(o,Math.min(s,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100))),r=a/i.delta+i.minValue;i.setThumbPosition(e,a),i.thumbs[e].value=r,Math.abs(r-n)>.001&&i.trigger("change",i,r,n)}},a=function(t){if(!i.disabled){var n=t.data,a=i.thumbs[n].thumb;i._dragstart=t.pageX*Common.Utils.zoom()-a.offset().left-a.width()/2,i.setActiveThumb(n),e.each(i.thumbs,function(t,e){n==e?t.thumb.css("z-index",500):t.thumb.css("z-index","")}),$(document).on("mouseup",null,n,o),$(document).on("mousemove",null,n,s)}},r=function(t){if(!i.disabled){var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left)/i.width*100))),n=l(e),o=i.thumbs[n].value,s=e/i.delta+i.minValue;i.setThumbPosition(n,e),i.thumbs[n].value=s,i.trigger("change",i,s,o),i.trigger("changecomplete",i,s,o)}},l=function(t){for(var e,n=100,o=0,s=i.thumbs.length,a=0;a<s;a++)if(e=Math.abs(i.thumbs[a].position-t),Math.abs(e<=n)){var r=i.thumbs[a+1],l=i.thumbs[a-1];if(void 0!==l&&t<l.position)continue;if(void 0!==r&&t>r.position)continue;o=a,n=e}return o};return this.$thumbs=n.find(".thumb"),e.each(this.$thumbs,function(t,e){var n=$(t);i.thumbs.push({thumb:n,index:e}),i.setValue(e,i.options.values[e]),n.on("mousedown",null,e,a)}),i.setActiveThumb(0,!0),i.rendered||n.on("mousedown",".track",r),i.rendered=!0,this},setActiveThumb:function(t,e){this.currentThumb=t,this.$thumbs.removeClass("active"),this.thumbs[t].thumb.addClass("active"),!0!==e&&this.trigger("thumbclick",this,t)},setThumbPosition:function(t,e){this.thumbs[t].position=e,this.thumbs[t].thumb.css({left:e+"%"})},setValue:function(t,e){this.thumbs[t].value=Math.max(this.minValue,Math.min(this.maxValue,e)),this.setThumbPosition(t,Math.round((e-this.minValue)*this.delta))},getValue:function(t){return this.thumbs[t].value},getValues:function(){var t=[];return e.each(this.thumbs,function(e){t.push(e.value)}),t},setDisabled:function(t){t!==this.disabled&&this.cmpEl.toggleClass("disabled",t),this.disabled=t}})}),void 0===Common)var Common={};if(define("common/main/lib/component/MultiSliderGradient",["common/main/lib/component/Slider","underscore"],function(t,e){"use strict";Common.UI.MultiSliderGradient=Common.UI.MultiSlider.extend({options:{width:100,minValue:0,maxValue:100,values:[0,100],colorValues:["#000000","#ffffff"],currentThumb:0},disabled:!1,template:e.template(['<div class="slider multi-slider-gradient">','<div class="track"></div>',"<% _.each(items, function(item) { %>",'<div class="thumb img-commonctrl" style="">','<div class="thumb-top"></div>','<div class="thumb-bottom"></div>',"</div>","<% }); %>","</div>"].join("")),initialize:function(t){this.styleStr="",Common.Utils.isChrome&&Common.Utils.chromeVersion<10||Common.Utils.isSafari&&Common.Utils.safariVersion<5.1?this.styleStr="-webkit-gradient(linear, left top, right top, color-stop({1}%,{0}), color-stop({3}%,{2})); /* Chrome,Safari4+ */":Common.Utils.isChrome||Common.Utils.isSafari?this.styleStr="-webkit-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isGecko?this.styleStr="-moz-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isOpera&&Common.Utils.operaVersion>11?this.styleStr="-o-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isIE&&(this.styleStr="-ms-linear-gradient(left, {0} {1}%, {2} {3}%)"),this.colorValues=this.options.colorValues,Common.UI.MultiSlider.prototype.initialize.call(this,t)},render:function(t){CLine truncated
|
||||||
|
;null!==b&&(b/=1e3,this.GradColor.values[0]=b),b=g[1],null!==b&&(b/=1e3,this.GradColor.values[1]=b)}this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}","object"==typeof this.GradColor.colors[0]?this.GradColor.colors[0].color:this.GradColor.colors[0]),0),this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}","object"==typeof this.GradColor.colors[1]?this.GradColor.colors[1].color:this.GradColor.colors[1]),1),this.sldrGradient.setValue(0,this.GradColor.values[0]),this.sldrGradient.setValue(1,this.GradColor.values[1]),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_GRAD,this.FGColor={Value:1,Color:this.GradColor.colors[0]},this.BGColor={Value:1,Color:"ffffff"},this.ShapeColor={Value:1,Color:this.GradColor.colors[0]}}this._state.FillType!==this.OriginalFillType&&(this.cmbFillSrc.setValue(null===this.OriginalFillType?"":this.OriginalFillType),this._state.FillType=this.OriginalFillType,this.ShowHideElem(this.OriginalFillType)),e(this.btnTexture.el).find(".form-control").prop("innerHTML",this.textSelectTexture);var f=typeof this.ShapeColor.Color,C=typeof this._state.ShapeColor;if(f!==C||"object"==f&&(this.ShapeColor.Color.effectValue!==this._state.ShapeColor.effectValue||this._state.ShapeColor.color.indexOf(this.ShapeColor.Color.color)<0)||"object"!=f&&this._state.ShapeColor.indexOf(this.ShapeColor.Color)<0){if(this.btnBackColor.setColor(this.ShapeColor.Color),"object"==typeof this.ShapeColor.Color){for(var v=!1,_=0;_<10;_++)if(Common.Utils.ThemeColor.ThemeValues[_]==this.ShapeColor.Color.effectValue){this.colorsBack.select(this.ShapeColor.Color,!0),v=!0;break}v||this.colorsBack.clearSelection()}else this.colorsBack.select(this.ShapeColor.Color,!0);this._state.ShapeColor=this.ShapeColor.Color}var y,w=n.get_stroke(),x=w.get_type();if(w?(x==Asc.c_oAscStrokeType.STROKE_COLOR?(h=w.get_color(),h?h.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BorderColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(h.get_r(),h.get_g(),h.get_b()),effectValue:h.get_value()}}:this.BorderColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(h.get_r(),h.get_g(),h.get_b())}:this.BorderColor={Value:1,Color:"transparent"}):this.BorderColor={Value:1,Color:"transparent"},y=w.asc_getPrstDash()):(x=null,this.BorderColor={Value:0,Color:"transparent"}),f=typeof this.BorderColor.Color,C=typeof this._state.StrokeColor,f!==C||"object"==f&&(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue||this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)||"object"!=f&&(this._state.StrokeColor.indexOf(this.BorderColor.Color)<0||"object"==typeof this.btnBorderColor.color)){if(this.btnBorderColor.setColor(this.BorderColor.Color),"object"==typeof this.BorderColor.Color){for(var v=!1,_=0;_<10;_++)if(Common.Utils.ThemeColor.ThemeValues[_]==this.BorderColor.Color.effectValue){this.colorsBorder.select(this.BorderColor.Color,!0),v=!0;break}v||this.colorsBorder.clearSelection()}else this.colorsBorder.select(this.BorderColor.Color,!0);this._state.StrokeColor=this.BorderColor.Color}if(this._state.StrokeType!==x||x==Asc.c_oAscStrokeType.STROKE_COLOR){if(x==Asc.c_oAscStrokeType.STROKE_COLOR){var S=w.get_width(),A=Math.abs(this._state.StrokeWidth-S)<.001&&!new RegExp(this.txtPt+"\\s*$").test(this.cmbBorderSize.getRawValue());if(Math.abs(this._state.StrokeWidth-S)>.001||A||(null===this._state.StrokeWidth||null===S)&&this._state.StrokeWidth!==S){this._state.StrokeWidth=S,null!==S&&(S=this._mm2pt(S));var T=null===S?S:i.find(this.cmbBorderSize.store.models,function(t){if(S<t.attributes.value+.01&&S>t.attributes.value-.01)return!0});T?this.cmbBorderSize.selectRecord(T):this.cmbBorderSize.setValue(null!==S?parseFloat(S.toFixed(2))+" "+this.txtPt:""),this.BorderSize=S}}else x==Asc.c_oAscStrokeType.STROKE_NONE?(this._state.StrokeWidth=0,this.BorderSize=this.cmbBorderSize.store.at(0).get("value"),this.cmbBorderSize.setValue(this.BorderSize)):(this._state.StrokeWidth=null,this.BorderSize=-1,this.cmbBorderSize.setValue(null));this._state.StrokeType=x}if(this._state.StrokeBorderType!==y&&(this.BorderType=this._state.StrokeBorderType=y,this.cmbBorderType.setValue(y)),f=typeof this.FGColor.Color,C=typeof this._state.FGColor,f!==C||"object"==f&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||"object"!=f&&this._state.FGColor.indexOf(this.FGColor.Color)<0){if(this.btnFGColor.setColor(this.FGColor.Color),"object"==typeof this.FGColor.Color){for(var v=!1,_=0;_<10;_++)if(Common.Utils.ThemeColor.ThemeValues[_]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),v=!0;break}v||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}if(f=typeof this.BGColor.Color,C=typeof this._state.BGColor,f!==C||"object"==f&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||"object"!=Line truncated
|
||||||
|
var e={};_.extend(e,{title:this.textTitle,width:420,height:681,header:!0},t),this.template=['<div id="id-mail-merge-folder-placeholder"></div>'].join(""),e.tpl=_.template(this.template,e),this.mergeFolderUrl=t.mergeFolderUrl||"",this.mergedFileUrl=t.mergedFileUrl||"",this.defFileName=t.defFileName||"",this.mergeFolderUrl=this.mergeFolderUrl.replace("{title}",encodeURIComponent(this.defFileName)).replace("{fileuri}",encodeURIComponent(this.mergedFileUrl)),Common.UI.Window.prototype.initialize.call(this,e)},render:function(){Common.UI.Window.prototype.render.call(this),this.$window.find("> .body").css({height:"auto",overflow:"hidden"});var t=document.createElement("iframe");t.width="100%",t.height=645,t.align="top",t.frameBorder=0,t.scrolling="no",t.onload=_.bind(this._onLoad,this),$("#id-mail-merge-folder-placeholder").append(t),this.loadMask=new Common.UI.LoadMask({owner:$("#id-mail-merge-folder-placeholder")}),this.loadMask.setTitle(this.textLoading),this.loadMask.show(),t.src=this.mergeFolderUrl;var e=this;this._eventfunc=function(t){e._onWindowMessage(t)},this._bindWindowEvents.call(this),this.on("close",function(t){e._unbindWindowEvents()})},_bindWindowEvents:function(){window.addEventListener?window.addEventListener("message",this._eventfunc,!1):window.attachEvent&&window.attachEvent("onmessage",this._eventfunc)},_unbindWindowEvents:function(){window.removeEventListener?window.removeEventListener("message",this._eventfunc):window.detachEvent&&window.detachEvent("onmessage",this._eventfunc)},_onWindowMessage:function(t){if(t&&window.JSON)try{this._onMessage.call(this,window.JSON.parse(t.data))}catch(t){}},_onMessage:function(t){t&&(_.isEmpty(t.error)||this.trigger("mailmergeerror",this,t.error),Common.NotificationCenter.trigger("window:close",this))},_onLoad:function(){this.loadMask&&this.loadMask.hide()},textTitle:"Folder for save",textLoading:"Loading"},DE.Views.MailMergeSaveDlg||{}))}),define("text!documenteditor/main/app/template/MailMergeEmailDlg.template",[],function(){return'<div id="id-merge-email-dlg" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;" cellpadding="10">\r\n <tr>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textFrom %></label>\r\n <div id="merge-email-dlg-from"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textTo %></label>\r\n <div id="merge-email-dlg-to"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label class="input-label"><%= scope.textSubject %></label>\r\n <div id="merge-email-dlg-subject" style="width: 100%;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label class="input-label"><%= scope.textFormat %></label>\r\n <div id="merge-email-dlg-format" style="width: 170px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label id="merge-email-dlg-lbl-filename" class="input-label disabled"><%= scope.textFileName %></label>\r\n <div id="merge-email-dlg-filename" style="width: 100%;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label id="merge-email-dlg-lbl-message" class="input-label disabled"><%= scope.textMessage %></label>\r\n <textarea id="merge-email-dlg-message" class="disabled form-control" disabled="disabled" style="width: 100%;height: 70px;margin-bottom: 0;"></textarea>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2" class="padding-small">\r\n <label style="font-weight: bold;"><%= scope.textWarning %></label>\r\n <label class=""><%= scope.textWarningMsg %></label>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>'}),define("documenteditor/main/app/view/MailMergeEmailDlg",["text!documenteditor/main/app/template/MailMergeEmailDlg.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/ComboBox","common/main/lib/component/InputField"],function(t){"use strict";DE.Views.MailMergeEmailDlg=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{alias:"MailMergeEmail",contentWidth:500,height:460},initialize:function(e){_.extend(this.options,{title:this.textTitle,template:['<div class="box" style="height:'+(this.options.height-85)+'px;">','<div class="content-panel" style="padding: 0;">'+_.template(t)({scope:this})+"</div>","</div>",'<div class="separatoLine truncated
|
||||||
|
return'<table cols="1">\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.textTemplate %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="" id="textart-combo-template" style="width: 100%; height: 64px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.strFill %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="textart-combo-fill-src" style="width: 100%;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <div id="textart-panel-color-fill" class="padding-small" style="width: 100%;">\r\n <div id="textart-back-color-btn" style=""></div>\r\n </div>\r\n <div id="textart-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">\r\n <div style="height:80px;">\r\n <div style="display: inline-block;">\r\n <label class="input-label" style=""><%= scope.textStyle %></label>\r\n <div id="textart-combo-grad-type" style="width: 90px;"></div>\r\n </div>\r\n <div style="display: inline-block;float: right;">\r\n <label class="input-label" style=""><%= scope.textDirection %></label>\r\n <div id="textart-button-direction" style=""></div>\r\n </div>\r\n </div>\r\n <label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>\r\n <div style="display: inline-block; margin-top: 3px;">\r\n <div id="textart-slider-gradient" style="display: inline-block; vertical-align: middle;"></div>\r\n </div>\r\n <div id="textart-gradient-color-btn" style="display: inline-block;float: right;"></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <div class="padding-small" id="textart-panel-transparent-fill" style="width: 100%;">\r\n <label class="header" style="display:block;"><%= scope.strTransparency %></label>\r\n <div style="display: inline-block; margin-top: 3px;">\r\n <label id="textart-lbl-transparency-start">0</label>\r\n <div id="textart-slider-transparency" style="display: inline-block;margin: 0 4px; vertical-align: middle;"></div>\r\n <label id="textart-lbl-transparency-end">100</label>\r\n </div>\r\n <div id="textart-spin-transparency" style="display: inline-block;float: right;"></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.strStroke %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div style="display:inline-block;width:100px;vertical-align: middle;">\r\n <label class="input-label" style=""><%= scope.strSize %></label>\r\n <div id="textart-combo-border-size" style="width: 93px;"></div>\r\n </div>\r\n <div style="display:inline-block;vertical-align: middle;">\r\n <label class="input-label" style=""><%= scope.strColor %></label>\r\n <div id="textart-border-color-btn" style=""></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div style="display:inline-block;width:100px;vertical-align: middle;">\r\n <label class="input-label" style=""><%= scope.strType %></label>\r\n <div id="textart-combo-border-type" style="width: 93px;"></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.textTransform %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div class="" id="textart-combo-transform" style="width: 100%; height: 42px;"></div>\r\n </td>\r\n </tr>\r\n <tr class="finish-cell"></tr>\r\n</table>'}),define("documenteditor/main/app/view/TextArtSettings",["text!documenteditor/main/app/template/TextArtSettings.template","jquery","underscore","backbone","common/main/lib/component/ComboBox","common/main/lib/component/ComboBorderSize","common/main/lib/component/MetricSpinner","common/main/lib/component/ThemeColorPalette","common/main/lib/component/ColorButtonLine truncated
|
||||||
|
s[e].set("imageUrl",t.get("imageUrl"))})}else this.cmbTextArt.menuPicker.store.reset(n),this.cmbTextArt.menuPicker.store.length>0&&this.cmbTextArt.fillComboView(this.cmbTextArt.menuPicker.store.at(0))},onTextArtSelect:function(t,e){if(this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties;i.asc_putStyle(e.get("data")),this.shapeprops.put_TextArtProperties(i),this.api.ImgApply(this.imgprops)}this.fireEvent("editcomplete",this)},fillTransform:function(t){if(t&&t.length>1&&t[1]){for(var e=[],n=t[1],o=0;o<n.length;o++){var s=n[o];s&&s.length>0&&i.each(s,function(t){e.push({imageUrl:t.Image,type:t.Type,selected:!1})})}this.cmbTransform.menuPicker.store.add(e),this.cmbTransform.menuPicker.store.length>0&&this.cmbTransform.fillComboView(this.cmbTransform.menuPicker.store.at(0),!0)}},onTransformSelect:function(t,e){if(this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties;i.asc_putForm(e.get("type")),this.shapeprops.put_TextArtProperties(i),this.api.ImgApply(this.imgprops)}this.fireEvent("editcomplete",this)},UpdateThemeColors:function(){this.btnBackColor||(this.btnBorderColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-border-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-border-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnBorderColor.render(e("#textart-border-color-btn")),this.btnBorderColor.setColor("000000"),this.lockedControls.push(this.btnBorderColor),this.colorsBorder=new Common.UI.ThemeColorPalette({el:e("#textart-border-color-menu"),value:"000000"}),this.colorsBorder.on("select",i.bind(this.onColorsBorderSelect,this)),e(this.el).on("click","#textart-border-color-new",i.bind(this.addNewColor,this,this.colorsBorder,this.btnBorderColor)),this.btnGradColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-gradient-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-gradient-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnGradColor.render(e("#textart-gradient-color-btn")),this.btnGradColor.setColor("000000"),this.lockedControls.push(this.btnGradColor),this.colorsGrad=new Common.UI.ThemeColorPalette({el:e("#textart-gradient-color-menu"),value:"000000"}),this.colorsGrad.on("select",i.bind(this.onColorsGradientSelect,this)),e(this.el).on("click","#textart-gradient-color-new",i.bind(this.addNewColor,this,this.colorsGrad,this.btnGradColor)),this.btnBackColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-back-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-back-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnBackColor.render(e("#textart-back-color-btn")),this.btnBackColor.setColor("transparent"),this.lockedControls.push(this.btnBackColor),this.colorsBack=new Common.UI.ThemeColorPalette({el:e("#textart-back-color-menu"),value:"transparent",transparent:!0}),this.colorsBack.on("select",i.bind(this.onColorsBackSelect,this)),e(this.el).on("click","#textart-back-color-new",i.bind(this.addNewColor,this,this.colorsBack,this.btnBackColor))),this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},_pt2mm:function(t){return 25.4*t/72},_mm2pt:function(t){return 72*t/25.4},ShowHideElem:function(t){this.FillColorContainer.toggleClass("settings-hidden",t!==Asc.c_oAscFill.FILL_TYPE_SOLID),this.FillGradientContainer.toggleClass("settings-hidden",t!==Asc.c_oAscFill.FILL_TYPE_GRAD),this.TransparencyContainer.toggleClass("settings-hidden",t===Asc.c_oAscFill.FILL_TYPE_NOFILL||null===t)},setLocked:function(t){this._locked=t},disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}))},txtNoBorders:"No Line",strStroke:"Stroke",strColor:"Color",strSize:"Size",strFill:"Fill",textColor:"Color Fill",textNewColor:"Add New Custom Color",strTransparency:"Opacity",textNoFill:"No Fill",textSelectTexture:"Select",textGradientFill:"Gradient Fill",textLinear:"Linear",textRadial:"Radial",textDirection:"Direction",textStyle:"Style",textGradient:"Gradient",textBorderSizeErr:"The entered value is incorrect.<br>Please enter a value between 0 pt and 1584 pt.",textTransform:"Transform",textTemplate:"Template",strType:"Type"},DE.Views.TextArtSettings||{}))});var SCALE_MIN=40,MENU_SCALE_PART=260;if(define("documenteditor/main/app/view/RightMenu",["text!documenLine truncated
|
||||||
|
Common.NotificationCenter.trigger("goback");break;case"edit":this.getApplication().getController("Statusbar").setStatusCaption(this.requestEditRightsText),Common.Gateway.requestEditRights();break;case"new":i?n=!1:this.onCreateNew(void 0,"blank");break;case"history":if(!this.leftMenu.panelHistory.isVisible())if(this.api.isDocumentModified()){var o=this;this.api.asc_stopSaving(),Common.UI.warning({closable:!1,width:500,title:this.notcriticalErrorTitle,msg:this.leavePageText,buttons:["ok","cancel"],primary:"ok",callback:function(t){"ok"==t?(o.api.asc_undoAllChanges(),o.showHistory()):o.api.asc_continueSaving()}})}else this.showHistory();break;case"rename":var o=this,s=o.api.asc_getDocumentName();new Common.Views.RenameDialog({filename:s,handler:function(t,e){"ok"!=t||_.isEmpty(e.trim())||s===e.trim()||Common.Gateway.requestRename(e),Common.NotificationCenter.trigger("edit:complete",o)}}).show();break;default:n=!1}n&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},clickSaveAsFormat:function(t,e){t?e==Asc.c_oAscFileType.TXT?Common.UI.warning({closable:!1,title:this.notcriticalErrorTitle,msg:this.warnDownloadAs,buttons:["ok","cancel"],callback:_.bind(function(i){"ok"==i&&(this.api.asc_DownloadAs(e),t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},this)}):(this.api.asc_DownloadAs(e),t.hide(),this.leftMenu.btnFile.toggle(!1,!0)):this.api.asc_DownloadOrigin()},applySettings:function(t){var e=Common.localStorage.getItem("de-settings-inputmode");if(this.api.SetTextBoxInputMode(1==parseInt(e)),this.mode.isEdit&&!this.mode.isOffline&&this.mode.canCoAuthoring){e=Common.localStorage.getItem("de-settings-coauthmode");var i=null===e||1==parseInt(e);switch(this.api.asc_SetFastCollaborative(i),e=Common.localStorage.getItem(i?"de-settings-showchanges-fast":"de-settings-showchanges-strict")){case"all":e=Asc.c_oAscCollaborativeMarksShowType.All;break;case"none":e=Asc.c_oAscCollaborativeMarksShowType.None;break;case"last":e=Asc.c_oAscCollaborativeMarksShowType.LastChanges;break;default:e=i?Asc.c_oAscCollaborativeMarksShowType.None:Asc.c_oAscCollaborativeMarksShowType.LastChanges}this.api.SetCollaborativeMarksShowType(e)}switch(e=Common.localStorage.getItem("de-settings-livecomment"),null===e||0!=parseInt(e)?this.api.asc_showComments():this.api.asc_hideComments(),e=Common.localStorage.getItem("de-settings-fontrender")){case"1":this.api.SetFontRenderingMode(1);break;case"2":this.api.SetFontRenderingMode(2);break;case"0":this.api.SetFontRenderingMode(3)}e=Common.localStorage.getItem("de-settings-autosave"),this.api.asc_setAutoSaveGap(parseInt(e)),e=Common.localStorage.getItem("de-settings-spellcheck"),this.api.asc_setSpellCheck(null===e||1==parseInt(e)),e=Common.localStorage.getItem("de-settings-showsnaplines"),this.api.put_ShowSnapLines(null===e||1==parseInt(e)),t.hide(),this.leftMenu.btnFile.toggle(!1,!0)},onCreateNew:function(t,e){if(!0===this.mode.nativeApp)this.api.OpenNewDocument("blank"==e?"":e);else{var i=window.open("blank"==e?this.mode.createUrl:e,"_blank");i&&i.focus()}t&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},onOpenRecent:function(t,e){t&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0));var i=window.open(e);i&&i.focus(),Common.component.Analytics.trackEvent("Open Recent")},clickToolbarSettings:function(t){this.leftMenu.btnFile.pressed&&"opts"==this.leftMenu.btnFile.panel.active?this.leftMenu.close():this.leftMenu.showMenu("file:opts")},clickStatusbarUsers:function(){this.leftMenu.btnFile.panel.panels.rights.changeAccessRights()},onHideChat:function(){$(this.leftMenu.btnChat.el).blur(),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onQuerySearch:function(t,e,i){if(i.textsearch&&i.textsearch.length&&!this.api.asc_findText(i.textsearch,"back"!=t,i.matchcase,i.matchword)){var n=this;Common.UI.info({msg:this.textNoTextFound,callback:function(){n.dlgSearch.focus()}})}},onQueryReplace:function(t,e){if(!_.isEmpty(e.textsearch)&&!this.api.asc_replaceText(e.textsearch,e.textreplace,!1,e.matchcase,e.matchword)){var i=this;Common.UI.info({msg:this.textNoTextFound,callback:function(){i.dlgSearch.focus()}})}},onQueryReplaceAll:function(t,e){_.isEmpty(e.textsearch)||this.api.asc_replaceText(e.textsearch,e.textreplace,!0,e.matchcase,e.matchword)},onSearchHighlight:function(t,e){this.api.asc_selectSearchingResults(e)},showSearchDlg:function(t,e){if(this.dlgSearch||(this.dlgSearch=new Common.UI.SearchDialog({matchcase:!0,markresult:{applied:!0}})),t){var i=this.mode.isEdit?e||void 0:"no-replace";this.dlgSearch.isVisible()?(this.dlgSearch.setMode(i),this.dlgSearch.focus()):this.dlgSearch.show(i)}else this.dlgSearch.hide()},onMenuSearch:function(t,e){this.showSearchDlg(e)},onSearchDlgHide:function(){this.leftMenu.btnSearch.toggle(!1,!0),this.api.asc_selectSearchingResults(!1),$(this.leftMenu.btnSearch.el).blur(),this.api.asc_enableKeyEvents(!0)},onApiTextReplaced:function(t,e){t?t-e>0?Common.UI.warning({msg:Common.Utils.String.format(this.textReplaceSkipped,t-e)}):Common.UI.info({msg:Common.Utils.String.format(this.teLine truncated
|
||||||
|
selected:t.data.currentVersion==s.version,canRestore:this.appOptions.canHistoryRestore&&o<i.length-1,isExpanded:!0})),t.data.currentVersion==s.version&&(n=a[a.length-1]),r=s.versionGroup,l!==s.version){for(l=s.version,c.reverse(),g=0;g<c.length;g++)a[a.length-g-2].set("arrColors",c);c=[]}c.push(p.get("colorval"));var u,g,b=s.changes;if(b&&b.length>0){if(a[a.length-1].set("docIdPrev",d),!_.isEmpty(s.serverVersion)&&s.serverVersion==this.appOptions.buildVersion)for(a[a.length-1].set("changeid",b.length-1),a[a.length-1].set("hasChanges",b.length>1),g=b.length-2;g>=0;g--)u=b[g],p=h.findUser(u.user.id),p||(p=new Common.Models.User({id:u.user.id,username:u.user.name,colorval:Asc.c_oAscArrUserColors[m],color:this.generateUserColor(Asc.c_oAscArrUserColors[m++])}),h.add(p)),a.push(new Common.Models.HistoryVersion({version:s.versionGroup,revision:s.version,changeid:g,userid:u.user.id,username:u.user.name,usercolor:p.get("color"),created:u.created,docId:s.key,docIdPrev:d,selected:!1,canRestore:this.appOptions.canHistoryRestore,isRevision:!1,isVisible:!0})),c.push(p.get("colorval"))}else 0==o&&1==i.length&&a[a.length-1].set("docId",s.key+"1")}if(c.length>0){for(c.reverse(),g=0;g<c.length;g++)a[a.length-g-1].set("arrColors",c);c=[]}e.reset(a),null===n&&e.size()>0&&(n=e.at(0),n.set("selected",!0)),n&&this.getApplication().getController("Common.Controllers.History").onSelectRevision(null,null,n)}}},generateUserColor:function(t){return"#"+("000000"+t.toString(16)).substr(-6)},disableEditing:function(t){var e=this.getApplication();if(this.appOptions.canEdit&&"view"!==this.editorConfig.mode){e.getController("RightMenu").getView("RightMenu").clearSelection(),e.getController("Toolbar").DisableToolbar(t,t),e.getController("RightMenu").SetDisabled(t,!1),e.getController("Statusbar").getView("Statusbar").SetDisabled(t);var i=e.getController("Toolbar").getView("Toolbar").synchTooltip;i&&i.hide()}e.getController("LeftMenu").SetDisabled(t,!0)},goBack:function(t){var e=this.appOptions.customization.goback.url;t?window.open(e,"_blank"):parent.location.href=e},onEditComplete:function(t){var e=this.getApplication(),i=e.getController("Toolbar"),n=i.getView("Toolbar");if(!this.appOptions.isEdit||!n||!n.btnInsertShape.pressed&&!n.btnInsertText.pressed||_.isObject(arguments[1])&&"id-toolbar-btn-insertshape"===arguments[1].id||(this.api&&this.api.StartAddShape("",!1),n.btnInsertShape.toggle(!1,!1),n.btnInsertText.toggle(!1,!1)),this.appOptions.isEdit&&n&&n.btnHighlightColor.pressed&&(!_.isObject(arguments[1])||"id-toolbar-btn-highlight"!==arguments[1].id)&&(this.api.SetMarkerFormat(!1),n.btnHighlightColor.toggle(!1,!1)),e.getController("DocumentHolder").getView("DocumentHolder").focus(),this.api){var o=this.api.asc_isDocumentCanSave(),s=this.appOptions.forcesave,a=$(".btn-icon",n.btnSave.cmpEl).hasClass("btn-synch");n.btnSave.isDisabled()!==(!o&&!a&&!s||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!s)&&n.btnSave.setDisabled(!o&&!a&&!s||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!s)}},onLongActionBegin:function(t,e){var i={id:e,type:t};this.stackLongActions.push(i),this.setLongActionView(i)},onLongActionEnd:function(t,e){var i={id:e,type:t};if(this.stackLongActions.pop(i),this.getApplication().getController("Viewport").getView("Common.Views.Header").setDocumentCaption(this.api.asc_getDocumentName()),this.updateWindowTitle(!0),i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.Information}))this.setLongActionView(i);else if(e==Asc.c_oAscAsyncAction.Save||e==Asc.c_oAscAsyncAction.ForceSaveButton)if(this._state.fastCoauth&&this._state.usersCount>1){var n=this;n._state.timerSave=setTimeout(function(){n.getApplication().getController("Statusbar").setStatusCaption(n.textChangesSaved,!1,3e3)},500)}else this.getApplication().getController("Statusbar").setStatusCaption(this.textChangesSaved,!1,3e3);else this.getApplication().getController("Statusbar").setStatusCaption("");i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.BlockInteraction}),i?this.setLongActionView(i):this.loadMask&&this.loadMask.hide(),e!=Asc.c_oAscAsyncAction.Save&&e!=Asc.c_oAscAsyncAction.ForceSaveButton||this._state.fastCoauth&&!(this._state.usersCount<2)||this.synchronizeChanges(),t!=Asc.c_oAscAsyncActionType.BlockInteraction||this.getApplication().getController("LeftMenu").dlgSearch&&this.getApplication().getController("LeftMenu").dlgSearch.isVisible()||e==Asc.c_oAscAsyncAction.ApplyChanges&&(this.dontCloseDummyComment||this.dontCloseChat)||this.api.asc_enableKeyEvents(!0)},setLongActionView:function(t){var e="",i="",n=!1;switch(t.id){case Asc.c_oAscAsyncAction.Open:e=this.openTitleText,i=this.openTextText;break;case Asc.c_oAscAsyncAction.Save:case Asc.c_oAscAsyncAction.ForceSaveButton:clearTimeout(this._state.timerSave),n=!0,e=this.saveTitleText,i=this.saveTextText;break;case Asc.c_oAscAsyncAction.ForceSaveTimeout:break;case Asc.c_oAscAsyncAction.LoadDocumentFonts:e=this.loadFontsTitleText,i=tLine truncated
|
||||||
|
;_.each(e,function(e,n,o){t=Common.util.LanguageInfo.getLocalLanguageName(e.asc_getId()),i.push({title:t[1],tip:t[0],code:e.asc_getId()})},this),i.sort(function(t,e){return t.tip<e.tip?-1:t.tip>e.tip?1:0}),this.getApplication().getController("DocumentHolder").getView("DocumentHolder").setLanguages(i),this.getApplication().getController("Statusbar").setLanguages(i)},onInsertTable:function(){this.getApplication().getController("RightMenu").onInsertTable()},onInsertImage:function(){this.getApplication().getController("RightMenu").onInsertImage()},onInsertChart:function(){this.getApplication().getController("RightMenu").onInsertChart()},onInsertShape:function(){this.getApplication().getController("RightMenu").onInsertShape()},onInsertTextArt:function(){this.getApplication().getController("RightMenu").onInsertTextArt()},unitsChanged:function(t){var e=Common.localStorage.getItem("de-settings-unit");e=null!==e?parseInt(e):Common.Utils.Metric.getDefaultMetric(),Common.Utils.Metric.setCurrentMetric(e),this.api.asc_SetDocumentUnits(e==Common.Utils.Metric.c_MetricUnits.inch?Asc.c_oAscDocumentUnits.Inch:e==Common.Utils.Metric.c_MetricUnits.pt?Asc.c_oAscDocumentUnits.Point:Asc.c_oAscDocumentUnits.Millimeter),this.getApplication().getController("RightMenu").updateMetricUnit(),this.getApplication().getController("Toolbar").getView("Toolbar").updateMetricUnit()},onAdvancedOptions:function(t){var e,i=t.asc_getOptionId(),n=this;i==Asc.c_oAscAdvancedOptionsID.TXT?e=new Common.Views.OpenDialog({type:i,codepages:t.asc_getOptions().asc_getCodePages(),settings:t.asc_getOptions().asc_getRecommendedSettings(),handler:function(t){n.isShowOpenDialog=!1,n&&n.api&&(n.api.asc_setAdvancedOptions(i,new Asc.asc_CTXTAdvancedOptions(t)),n.loadMask&&n.loadMask.show())}}):i==Asc.c_oAscAdvancedOptionsID.DRM&&(e=new Common.Views.OpenDialog({type:i,handler:function(t){n.isShowOpenDialog=!1,n&&n.api&&(n.api.asc_setAdvancedOptions(i,new Asc.asc_CDRMAdvancedOptions(t)),n.loadMask&&n.loadMask.show())}})),e&&(this.isShowOpenDialog=!0,this.loadMask&&this.loadMask.hide(),this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction,LoadingDocument),e.show())},onTryUndoInFastCollaborative:function(){var t=window.localStorage.getItem("de-hide-try-undoredo");t&&1==parseInt(t)||Common.UI.info({width:500,msg:this.textTryUndoRedo,iconCls:"info",buttons:["custom","cancel"],primary:"custom",customButtonText:this.textStrict,dontshow:!0,callback:_.bind(function(t,e){e&&window.localStorage.setItem("de-hide-try-undoredo",1),"custom"==t&&(Common.localStorage.setItem("de-settings-coauthmode",0),this.api.asc_SetFastCollaborative(!1),this._state.fastCoauth=!1,Common.localStorage.setItem("de-settings-showchanges-strict","last"),this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.LastChanges)),this.fireEvent("editcomplete",this)},this)})},onAuthParticipantsChanged:function(t){var e=0;_.each(t,function(t){t.asc_getView()||e++}),this._state.usersCount=e},applySettings:function(){if(this.appOptions.isEdit&&!this.appOptions.isOffline&&this.appOptions.canCoAuthoring){var t=Common.localStorage.getItem("de-settings-coauthmode"),e=this._state.fastCoauth;this._state.fastCoauth=null===t||1==parseInt(t),this._state.fastCoauth&&!e&&this.synchronizeChanges()}this.appOptions.canForcesave&&(t=Common.localStorage.getItem("de-settings-forcesave"),this.appOptions.forcesave=null===t?this.appOptions.canForcesave:1==parseInt(t),this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave))},onDocumentName:function(t){this.getApplication().getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t),this.updateWindowTitle(!0)},onMeta:function(t){var e=this.getApplication(),i=e.getController("LeftMenu").getView("LeftMenu").getMenu("file");e.getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t.title),this.updateWindowTitle(!0),this.document.title=t.title,i.loadDocument({doc:this.document}),i.panels.info.updateInfo(this.document),Common.Gateway.metaChange(t)},onPrint:function(){this.appOptions.canPrint&&(this.api&&this.api.asc_Print(Common.Utils.isChrome||Common.Utils.isSafari||Common.Utils.isOpera),Common.component.Analytics.trackEvent("Print"))},onPrintUrl:function(t){if(this.iframePrint&&(this.iframePrint.parentNode.removeChild(this.iframePrint),this.iframePrint=null),!this.iframePrint){var e=this;this.iframePrint=document.createElement("iframe"),this.iframePrint.id="id-print-frame",this.iframePrint.style.display="none",this.iframePrint.style.visibility="hidden",this.iframePrint.style.position="fixed",this.iframePrint.style.right="0",this.iframePrint.style.bottom="0",document.body.appendChild(this.iframePrint),this.iframePrint.onload=function(){e.iframePrint.contentWindow.focus(),e.iframePrint.contentWindow.print(),e.iframePrint.contentWindow.blur(),window.focus()}}t&&(this.iframePrint.src=t)},requestPlugins:function(pluginsPath){if(pluginsPath){var _createXMLHTTPObject=function(){var t;try{t=new ActiveXObject("Msxml2.XMLine truncated
|
||||||
|
newDescriptionText:"Create a new blank text document which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a document of a certain type or purpose where some styles have already been pre-applied.",fromTemplateText:"From Template",noTemplatesText:"There are no templates"},DE.Views.FileMenuPanels.CreateNew||{})),DE.Views.FileMenuPanels.DocumentInfo=Common.UI.BaseView.extend(_.extend({el:"#panel-info",menu:void 0,initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,arguments),this.rendered=!1,this.template=_.template(['<table class="main">',"<tr>",'<td class="left"><label>'+this.txtTitle+"</label></td>",'<td class="right"><label id="id-info-title">-</label></td>',"</tr>",'<tr class="author">','<td class="left"><label>'+this.txtAuthor+"</label></td>",'<td class="right"><span class="userLink img-commonctrl" id="id-info-author">-</span></td>',"</tr>",'<tr class="placement">','<td class="left"><label>'+this.txtPlacement+"</label></td>",'<td class="right"><label id="id-info-placement">-</label></td>',"</tr>",'<tr class="date">','<td class="left"><label>'+this.txtDate+"</label></td>",'<td class="right"><label id="id-info-date">-</label></td>',"</tr>",'<tr class="divider date"></tr>',"<tr>",'<td class="left" style="vertical-align: top;"><label>'+this.txtStatistics+"</label></td>",'<td class="right" style="vertical-align: top;"><div id="id-info-statistic">',"<table>","<tr>","<td><label>"+this.txtPages+"</label></td>",'<td><label id="id-info-pages"></label></td>',"</tr>","<tr>","<td><label>"+this.txtParagraphs+"</label></td>",'<td><label id="id-info-paragraphs"></label></td>',"</tr>","<tr>","<td><label>"+this.txtWords+"</label></td>",'<td><label id="id-info-words"></label></td>',"</tr>","<tr>","<td><label>"+this.txtSymbols+"</label></td>",'<td><label id="id-info-symbols"></label></td>',"</tr>","<tr>","<td><label>"+this.txtSpaces+"</label></td>",'<td><label id="id-info-spaces"></label></td>',"</tr>","</table>","</div></td>","</tr>","</table>"].join("")),this.infoObj={PageCount:0,WordsCount:0,ParagraphCount:0,SymbolsCount:0,SymbolsWSCount:0},this.inProgress=!1,this.menu=t.menu},render:function(){return $(this.el).html(this.template()),this.lblTitle=$("#id-info-title"),this.lblPlacement=$("#id-info-placement"),this.lblDate=$("#id-info-date"),this.lblAuthor=$("#id-info-author"),this.lblStatPages=$("#id-info-pages"),this.lblStatWords=$("#id-info-words"),this.lblStatParagraphs=$("#id-info-paragraphs"),this.lblStatSymbols=$("#id-info-symbols"),this.lblStatSpaces=$("#id-info-spaces"),this.rendered=!0,this.updateInfo(this.doc),_.isUndefined(this.scroller)&&(this.scroller=new Common.UI.Scroller({el:$(this.el),suppressScrollX:!0})),this},show:function(){Common.UI.BaseView.prototype.show.call(this,arguments),this.updateStatisticInfo()},hide:function(){Common.UI.BaseView.prototype.hide.call(this,arguments),this.stopUpdatingStatisticInfo()},updateInfo:function(t){this.doc=t,this.rendered&&(t=t||{},this.lblTitle.text(t.title?t.title:"-"),t.info?(t.info.author&&this.lblAuthor.text(t.info.author),this._ShowHideInfoItem("author",void 0!==t.info.author&&null!==t.info.author),t.info.created&&this.lblDate.text(t.info.created),this._ShowHideInfoItem("date",void 0!==t.info.created&&null!==t.info.created),t.info.folder&&this.lblPlacement.text(t.info.folder),this._ShowHideInfoItem("placement",void 0!==t.info.folder&&null!==t.info.folder)):this._ShowHideDocInfo(!1))},_ShowHideInfoItem:function(t,e){$("tr."+t,this.el)[e?"show":"hide"]()},_ShowHideDocInfo:function(t){this._ShowHideInfoItem("date",t),this._ShowHideInfoItem("placement",t),this._ShowHideInfoItem("author",t)},updateStatisticInfo:function(){this.api&&this.doc&&this.api.startGetDocInfo()},stopUpdatingStatisticInfo:function(){this.api&&this.api.stopGetDocInfo()},setApi:function(t){return this.api=t,this.api.asc_registerCallback("asc_onGetDocInfoStart",_.bind(this._onGetDocInfoStart,this)),this.api.asc_registerCallback("asc_onGetDocInfoStop",_.bind(this._onGetDocInfoEnd,this)),this.api.asc_registerCallback("asc_onDocInfo",_.bind(this._onDocInfo,this)),this.api.asc_registerCallback("asc_onGetDocInfoEnd",_.bind(this._onGetDocInfoEnd,this)),this.api.asc_registerCallback("asc_onDocumentName",_.bind(this.onDocumentName,this)),this},setMode:function(t){return this},_onGetDocInfoStart:function(){var t=this;this.inProgress=!0,this.infoObj={PageCount:0,WordsCount:0,ParagraphCount:0,SymbolsCount:0,SymbolsWSCount:0},_.defer(function(){t.inProgress&&(t.lblStatPages.text(t.txtLoading),t.lblStatWords.text(t.txtLoading),t.lblStatParagraphs.text(t.txtLoading),t.lblStatSymbols.text(t.txtLoading),t.lblStatSpaces.text(t.txtLoading))},2e3)},_onDocInfo:function(t){t&&(t.get_PageCount()>-1&&(this.infoObj.PageCount=t.get_PageCount()),t.get_WordsCount()>-1&&(this.infoObj.WordsCount=t.get_WordsCount()),t.get_ParagraphCount()>-1&&(this.infoObj.ParagraphCount=t.get_ParagraphCount()),t.get_SymbolsCount()>-1&&(this.infoObj.SymbLine truncated
|
||||||
|
r=e.asc_getRepliesCount(),o=0;o<r;++o)l=""==e.asc_getReply(o).asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getReply(o).asc_getTime())),a.push(new Common.Models.Reply({id:Common.UI.getId(),userid:e.asc_getReply(o).asc_getUserId(),username:e.asc_getReply(o).asc_getUserName(),date:n.dateToLocaleTimeString(l),reply:e.asc_getReply(o).asc_getText(),time:l.getTime(),editText:!1,editTextInPopover:!1,showReplyInPopover:!1,scope:n.view,editable:n.mode.canEditComments||e.asc_getReply(o).asc_getUserId()==n.currentUserId}));a.sort(function(t,e){return t.get("time")-e.get("time")}),c.set("replys",a),i||(this.updateComments(!1,!0),this.getPopover()&&this.getPopover().isVisible()&&(this._dontScrollToComment=!0,this.api.asc_showComment(t,!0)))}},onApiLockComment:function(t,e){var i=this.findComment(t),n=null,o=null;i&&(n=this.getApplication().getCollection("Common.Collections.Users"))&&(o=n.findWhere({id:e}))&&(this.getPopover()&&this.getPopover().saveText(),i.set("lock",!0),i.set("lockuserid",this.view.getUserName(o.get("username"))))},onApiUnLockComment:function(t){var e=this.findComment(t);e&&(e.set("lock",!1),this.getPopover()&&this.getPopover().loadText())},onApiShowComment:function(t,e,i,n,o,s){if(this.isModeChanged=!1,(!s||!this.isSelectedComment||0!==_.difference(this.uids,t).length)&&(this.mode&&!this.mode.canComments&&(s=!0),this.getPopover())){if(this.clearDummyComment(),this.isSelectedComment&&0===_.difference(this.uids,t).length)return void(this.api&&(this.getPopover().commentsView.setFocusToTextBox(!0),this.api.asc_enableKeyEvents(!0)));var a=0,r="",l="",c=null,d="",h=!0;for(this.popoverComments.reset(),a=0;a<t.length;++a)r=t[a],l=t[a]+"-R",c=this.findComment(r),this.subEditStrings[r]&&!s?(c.set("editTextInPopover",!0),d=this.subEditStrings[r]):this.subEditStrings[l]&&!s&&(c.set("showReplyInPopover",!0),d=this.subEditStrings[l]),c.set("hint",!_.isUndefined(s)&&s),!s&&this.hintmode&&(0===_.difference(this.uids,t).length&&0===this.uids.length&&(h=!1),this.oldUids.length&&0===_.difference(this.oldUids,t).length&&(h=!1,this.oldUids=[])),this.animate&&(h=this.animate,this.animate=!1),this.isSelectedComment=!s||!this.hintmode,this.uids=_.clone(t),this.popoverComments.push(c),this._dontScrollToComment||this.view.commentsView.scrollToRecord(c),this._dontScrollToComment=!1;this.getPopover().isVisible()&&this.getPopover().hide(),this.getPopover().setLeftTop(e,i,n),this.getPopover().show(h,!1,!0,d)}},onApiHideComment:function(t){var e=this;if(this.getPopover()){if(this.isSelectedComment&&t)return;if(t&&this.getPopover().isCommentsViewMouseOver())return;this.popoverComments.each(function(t){t.get("editTextInPopover")&&(e.subEditStrings[t.get("uid")]=e.getPopover().getEditText()),t.get("showReplyInPopover")&&(e.subEditStrings[t.get("uid")+"-R"]=e.getPopover().getEditText())}),this.getPopover().saveText(!0),this.getPopover().hide(),this.collection.clearEditing(),this.popoverComments.clearEditing(),this.oldUids=_.clone(this.uids),this.isSelectedComment=!1,this.uids=[],this.popoverComments.reset()}},onApiUpdateCommentPosition:function(t,e,i,n){var o,s=!1,a=null,r=void 0,l="",c="";if(this.getPopover())if(this.getPopover().saveText(),this.getPopover().hideTips(),i<0||this.getPopover().sdkBounds.height<i||!_.isUndefined(n)&&this.getPopover().sdkBounds.width<n)this.getPopover().hide();else{if(this.isModeChanged&&this.onApiShowComment(t,e,i,n),0===this.popoverComments.length){for(this.popoverComments.reset(),o=0;o<t.length;++o)l=t[o],c=t[o]+"-R",a=this.findComment(l),this.subEditStrings[l]?(a.set("editTextInPopover",!0),r=this.subEditStrings[l]):this.subEditStrings[c]&&(a.set("showReplyInPopover",!0),r=this.subEditStrings[c]),this.popoverComments.push(a);s=!0,this.getPopover().show(s,void 0,void 0,r)}else this.getPopover().isVisible()||this.getPopover().show(!1,void 0,void 0,r);this.getPopover().setLeftTop(e,i,n,void 0,!0)}},onDocumentPlaceChanged:function(){if(this.isDummyComment&&this.getPopover()&&this.getPopover().isVisible()){var t=this.api.asc_getAnchorPosition();t&&this.getPopover().setLeftTop(t.asc_getX()+t.asc_getWidth(),t.asc_getY(),this.hintmode?t.asc_getX():void 0)}},updateComments:function(t,e){var i=this;i.updateCommentsTime=new Date,void 0===i.timerUpdateComments&&(i.timerUpdateComments=setInterval(function(){new Date-i.updateCommentsTime>100&&(clearInterval(i.timerUpdateComments),i.timerUpdateComments=void 0,i.updateCommentsView(t,e))},25))},updateCommentsView:function(t,e){var i,n=!0;if(_.isUndefined(e)&&this.collection.sort(),t){for(i=this.collection.length-1;i>=0;--i)n?this.collection.at(i).set("last",!0,{silent:!0}):this.collection.at(i).get("last")&&this.collection.at(i).set("last",!1,{silent:!0}),n=!1;this.onUpdateFilter(this.filter,!0),this.view.render()}this.view.update()},findComment:function(t,e){return _.isUndefined(t)?this.collection.findWhere({id:e}):this.collection.findWhere({uid:t})},findPopupComment:function(t){return this.popoverComments.findWhere({id:t})},closeEditing:function(Line truncated
|
||||||
|
textTitle:"Mail Merge Recipients"},Common.Views.ExternalMergeEditor||{}))}),void 0===Common)var Common={};if(Common.Controllers=Common.Controllers||{},define("common/main/lib/controller/ExternalMergeEditor",["core","common/main/lib/view/ExternalMergeEditor"],function(){"use strict";Common.Controllers.ExternalMergeEditor=Backbone.Controller.extend(_.extend(function(){var t="en",e=void 0,i="",n=null,o=function(){n=new DocsAPI.DocEditor("id-merge-editor-placeholder",{width:"100%",height:"100%",documentType:"spreadsheet",document:{url:"_offline_",permissions:{edit:!0,download:!1}},editorConfig:{mode:"editmerge",targetApp:i,lang:t,canCoAuthoring:!1,canBackToFolder:!1,canCreateNew:!1,customization:e,user:{id:"uid-"+Date.now()}},events:{onReady:function(){},onDocumentStateChange:function(){},onError:function(){},onInternalMessage:_.bind(this.onInternalMessage,this)}}),Common.Gateway.on("processmouse",_.bind(this.onProcessMouse,this))};return{views:["Common.Views.ExternalMergeEditor"],initialize:function(){this.addListeners({"Common.Views.ExternalMergeEditor":{setmergedata:_.bind(this.setMergeData,this),drag:_.bind(function(t,e){n&&n.serviceCommand("window:drag","start"==e)},this),show:_.bind(function(t){var e=this.mergeEditorView.getHeight(),i=Common.Utils.innerHeight();(i>e&&e<700||i<e)&&(e=Math.min(i,700),this.mergeEditorView.setHeight(e)),n?(n.serviceCommand("setAppDisabled",!1),this.needDisableEditing&&this.mergeEditorView._isExternalDocReady&&this.onMergeEditingDisabled(),n.attachMouseEvents()):o.apply(this),this.isExternalEditorVisible=!0},this),hide:_.bind(function(t){n&&(n.detachMouseEvents(),this.isExternalEditorVisible=!1)},this)}})},onLaunch:function(){this.mergeEditorView=this.createView("Common.Views.ExternalMergeEditor",{handler:_.bind(this.handler,this)})},setApi:function(t){return this.api=t,this.api.asc_registerCallback("asc_onCloseMergeEditor",_.bind(this.onMergeEditingDisabled,this)),this},handler:function(t,e){return n&&n.serviceCommand("queryClose",{mr:t}),!0},setMergeData:function(){n&&n.serviceCommand("setMergeData",this.mergeEditorView._mergeData),this.mergeEditorView.setEditMode(!0),this.mergeEditorView._mergeData=null},loadConfig:function(n){n&&n.config&&(n.config.lang&&(t=n.config.lang),n.config.customization&&(e=n.config.customization),n.config.targetApp&&(i=n.config.targetApp))},onMergeEditingDisabled:function(){if(!this.mergeEditorView.isVisible()||!this.mergeEditorView._isExternalDocReady)return void(this.needDisableEditing=!0);this.mergeEditorView.setControlsDisabled(!0),Common.UI.alert({title:this.warningTitle,msg:this.warningText,iconCls:"warn",buttons:["ok"],callback:_.bind(function(t){this.setControlsDisabled(!1),this.mergeEditorView.hide()},this)}),this.needDisableEditing=!1},onInternalMessage:function(t){var e=t.data;if(this.mergeEditorView)if("documentReady"==e.type)this.mergeEditorView._isExternalDocReady=!0,this.mergeEditorView.setControlsDisabled(!1),this.mergeEditorView._mergeData&&(n&&n.serviceCommand("setMergeData",this.mergeEditorView._mergeData),this.mergeEditorView._mergeData=null),this.needDisableEditing&&this.onMergeEditingDisabled();else if("shortcut"==e.type)"escape"==e.data.key&&this.mergeEditorView.hide();else if("canClose"==e.type)!0===e.data.answer&&(n&&(n.serviceCommand("setAppDisabled",!0),"ok"==e.data.mr&&n.serviceCommand("getMergeData")),this.mergeEditorView.hide());else if("processMouse"==e.type){if("mouse:up"==e.data.event)this.mergeEditorView.binding.dragStop();else if("mouse:move"==e.data.event){var i=parseInt(this.mergeEditorView.$window.css("left"))+e.data.pagex,o=parseInt(this.mergeEditorView.$window.css("top"))+e.data.pagey+34;this.mergeEditorView.binding.drag({pageX:i,pageY:o})}}else this.mergeEditorView.fireEvent("internalmessage",this.mergeEditorView,e)},onProcessMouse:function(t){"mouseup"==t.type&&this.isExternalEditorVisible&&n&&n.serviceCommand("processmouse",t)},warningTitle:"Warning",warningText:"The object is disabled because of editing by another user.",textClose:"Close",textAnonymous:"Anonymous"}}(),Common.Controllers.ExternalMergeEditor||{}))}),void 0===Common)var Common={};if(Common.Models=Common.Models||{},define("common/main/lib/model/ReviewChange",["underscore","backbone","common/main/lib/component/BaseView"],function(t,e){"use strict";Common.Models.ReviewChange=e.Model.extend({defaults:{uid:0,userid:0,username:"Guest",usercolor:"#ee3525",date:void 0,changetext:"",lock:!1,lockuser:"",type:0,changedata:null,id:Common.UI.getId(),scope:null}})}),void 0===Common)var Common={};if(Common.Collections=Common.Collections||{},define("common/main/lib/collection/ReviewChanges",["underscore","backbone","common/main/lib/model/ReviewChange"],function(t,e){"use strict";Common.Collections.ReviewChanges=e.Collection.extend({model:Common.Models.ReviewChange})}),void 0===Common)var Common={};Common.Controllers=Common.Controllers||{},define("common/main/lib/controller/ReviewChanges",["core","common/main/lib/model/ReviewChange","common/main/lib/collecLine truncated
|
||||||
@@ -1,8 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) Ascensio System SIA 2018. All rights reserved
|
* Copyright (c) Ascensio System SIA 2019. All rights reserved
|
||||||
*
|
*
|
||||||
* http://www.onlyoffice.com
|
* http://www.onlyoffice.com
|
||||||
*
|
*
|
||||||
* Version: 0.0.0 (build:0)
|
* Version: 0.0.0 (build:0)
|
||||||
*/
|
*/
|
||||||
function onDropDownKeyDown(e){var t=$(this),n=t.parent(),r=jQuery.Event("keydown.before.bs.dropdown"),i=jQuery.Event("keydown.after.bs.dropdown");n.trigger(r),n.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(e=arguments[1]),/^(38|40|27|13|9|37|39)$/.test(e.keyCode)&&!e.ctrlKey&&!e.altKey&&(patchDropDownKeyDownAdditional.call(this,e),/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation()))):(patchDropDownKeyDown.call(this,e),e.preventDefault(),e.stopPropagation()),n.trigger(i)}function patchDropDownKeyDown(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);e.preventDefault(),e.stopPropagation();if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&e.keyCode==27){if(e.which==27){i=$("[role=menu] li.dropdown-submenu.over:visible",n);if(i.size())return i.eq(i.size()-1).removeClass("over"),!1;n.hasClass("dropdown-submenu")&&n.hasClass("over")?(n.removeClass("over"),n.find("> a").focus()):n.find("[data-toggle=dropdown]").focus()}return r?t.click():undefined}var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(":focus"));if(e.keyCode==39){if(s<0)return;var o=i.eq(s).parent();o.hasClass("dropdown-submenu")&&!o.hasClass("over")&&(o.mouseenter(),o.addClass("focused-submenu"),_.delay(function(){var e=$("> [role=menu]",o),t=e.find("> li:not(.divider):not(.disabled):visible > a"),n=0;if(e.find("> .menu-scroll").length>0){var r=e.scrollTop();for(var i=0;i<t.length;i++)if(t[i].offsetTop>r){n=i;break}}t.length>0&&t.eq(n).focus()},250))}else e.keyCode==37?n.hasClass("dropdown-submenu")&&n.hasClass("over")&&(n.removeClass("over"),n.find("> a").focus()):(e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),n.hasClass("dropdown-submenu")&&n.hasClass("over")&&n.addClass("focused-submenu"),i.eq(s).focus())}function patchDropDownKeyDownAdditional(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation());if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&(e.keyCode==27||e.keyCode==37||e.keyCode==39))return r?t.click():undefined;var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(".focus"));e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),i.removeClass("focus"),i.eq(s).addClass("focus")}function getParent(e){var t=e.attr("data-target");t||(t=e.attr("href"),t=t&&/#/.test(t)&&t.replace(/.*(?=#[^\s]*$)/,""));var n=t&&$(t);return n&&n.length?n:e.parent()}function clearMenus(e){$(".dropdown-toggle").each(function(t){var n=$(this).parent();if(!n.hasClass("open"))return;n.trigger(t=$.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("open").trigger("hidden.bs.dropdown",e)})}(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){returnLine truncated
|
function onDropDownKeyDown(t){var e=$(this),i=e.parent(),n=jQuery.Event("keydown.before.bs.dropdown"),o=jQuery.Event("keydown.after.bs.dropdown");i.trigger(n),i.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(t=arguments[1]),!/^(38|40|27|13|9|37|39)$/.test(t.keyCode)||t.ctrlKey||t.altKey||(patchDropDownKeyDownAdditional.call(this,t),/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()))):(patchDropDownKeyDown.call(this,t),t.preventDefault(),t.stopPropagation()),i.trigger(o)}function patchDropDownKeyDown(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&27==t.keyCode){if(27==t.which){if(o=$("[role=menu] li.dropdown-submenu.over:visible",i),o.size())return o.eq(o.size()-1).removeClass("over"),!1;i.hasClass("dropdown-submenu")&&i.hasClass("over")?(i.removeClass("over"),i.find("> a").focus()):i.find("[data-toggle=dropdown]").focus()}return n?e.click():void 0}var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(":focus"));if(39==t.keyCode){if(s<0)return;var a=o.eq(s).parent();a.hasClass("dropdown-submenu")&&!a.hasClass("over")&&(a.mouseenter(),a.addClass("focused-submenu"),_.delay(function(){var t=$("> [role=menu]",a),e=t.find("> li:not(.divider):not(.disabled):visible > a"),i=0;if(t.find("> .menu-scroll").length>0)for(var n=t.scrollTop(),o=0;o<e.length;o++)if(e[o].offsetTop>n){i=o;break}e.length>0&&e.eq(i).focus()},250))}else 37==t.keyCode?i.hasClass("dropdown-submenu")&&i.hasClass("over")&&(i.removeClass("over"),i.find("> a").focus()):(38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),i.hasClass("dropdown-submenu")&&i.hasClass("over")&&i.addClass("focused-submenu"),o.eq(s).focus())}}}}function patchDropDownKeyDownAdditional(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&(27==t.keyCode||37==t.keyCode||39==t.keyCode))return n?e.click():void 0;var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(".focus"));38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),o.removeClass("focus"),o.eq(s).addClass("focus")}}}}function getParent(t){var e=t.attr("data-target");e||(e=t.attr("href"),e=e&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&$(e);return i&&i.length?i:t.parent()}function clearMenus(t){$(".dropdown-toggle").each(function(e){var i=$(this).parent();i.hasClass("open")&&(i.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",t))})}if(function(){var t=this,e=t._,i={},n=Array.prototype,o=Object.prototype,s=Function.prototype,a=n.push,r=n.slice,l=n.concat,c=o.toString,h=o.hasOwnProperty,d=n.forEach,p=n.map,u=n.reduce,m=n.reduceRight,g=n.filter,f=n.every,b=n.some,C=n.indexOf,v=n.lastIndexOf,_=Array.isArray,y=Object.keys,x=s.bind,w=function(t){return t instanceof w?t:this instanceof w?void(this._wrapped=t):new w(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):t._=w,w.VERSION="1.5.2";var S=w.each=w.forEach=function(t,e,n){if(null!=t)if(d&&t.forEach===d)t.forEach(e,n);else if(t.length===+t.length){for(var o=0,s=t.length;o<s;o++)if(e.call(n,t[o],o,t)===i)return}else for(var a=w.keys(t),o=0,s=a.length;o<s;o++)if(e.call(n,t[a[o]],a[o],t)===i)return};w.map=w.collect=function(t,e,i){var n=[];return null==t?n:p&&t.map===p?t.map(e,i):(S(t,function(t,o,s){n.push(e.call(i,t,o,s))}),n)};var T="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),u&&t.reduce===u)return n&&(e=w.bind(e,n)),o?t.reduce(e,i):t.reduce(e);if(S(t,function(t,s,a){o?i=e.call(n,i,t,s,a):(i=t,o=!0)}),!o)throw new TypeError(T);return i},w.reduceRight=w.foldr=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),m&&t.reduceRight===m)return n&&(e=w.bind(e,n)),o?t.reduceRight(e,i):t.reduceRight(e);var s=t.length;if(s!==+s){var a=w.keys(t);s=a.length}if(S(t,function(r,l,c){l=a?a[--s]:--s,o?i=e.call(n,i,t[l],l,c):(i=t[l],o=!0)}),!o)throw new TypeError(T);return i},w.find=w.detect=function(t,e,i){var n;return A(t,function(t,o,s){if(e.call(i,t,o,s))return n=t,!0}),n},w.filter=w.select=function(t,e,i){var n=[];return null==t?n:g&&t.filter===g?t.filter(e,i):(S(t,function(t,o,s){e.call(i,t,o,s)&&n.push(t)}),n)},w.reject=function(t,e,i){return w.filter(t,function(t,n,o){return!e.call(i,t,n,o)},i)},w.every=w.all=function(t,e,n){e||(e=w.identity);var o=!0;return nullLine truncated
|
||||||
|
;if(i(t))for(n=t.length;o<n&&!1!==e.call(t[o],o,t[o]);o++);else for(o in t)if(!1===e.call(t[o],o,t[o]))break;return t},trim:function(t){return null==t?"":(t+"").replace(st,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(i(Object(t))?ot.merge(n,"string"==typeof t?[t]:t):Z.call(n,t)),n},inArray:function(t,e,i){return null==e?-1:Q.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,o=t.length;n<i;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,i){for(var n=[],o=0,s=t.length,a=!i;o<s;o++)!e(t[o],o)!==a&&n.push(t[o]);return n},map:function(t,e,n){var o,s,a=0,r=[];if(i(t))for(o=t.length;a<o;a++)null!=(s=e(t[a],a,n))&&r.push(s);else for(a in t)null!=(s=e(t[a],a,n))&&r.push(s);return J.apply([],r)},guid:1,proxy:function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),ot.isFunction(t))return n=X.call(arguments,2),o=function(){return t.apply(e||this,n.concat(X.call(arguments)))},o.guid=t.guid=t.guid||ot.guid++,o},now:Date.now,support:nt}),"function"==typeof Symbol&&(ot.fn[Symbol.iterator]=K[Symbol.iterator]),ot.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){tt["[object "+e+"]"]=e.toLowerCase()});var ct=function(t){function e(t,e,i,n){var o,s,a,r,c,d,p,u,m=e&&e.ownerDocument,g=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return i;if(!n&&((e?e.ownerDocument||e:R)!==P&&E(e),e=e||P,U)){if(11!==g&&(d=gt.exec(t)))if(o=d[1]){if(9===g){if(!(a=e.getElementById(o)))return i;if(a.id===o)return i.push(a),i}else if(m&&(a=m.getElementById(o))&&L(e,a)&&a.id===o)return i.push(a),i}else{if(d[2])return X.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&v.getElementsByClassName&&e.getElementsByClassName)return X.apply(i,e.getElementsByClassName(o)),i}if(v.qsa&&!$[t+" "]&&(!D||!D.test(t))){if(1!==g)m=e,u=t;else if("object"!==e.nodeName.toLowerCase()){for((r=e.getAttribute("id"))?r=r.replace(bt,"\\$&"):e.setAttribute("id",r=V),p=w(t),s=p.length,c=ht.test(r)?"#"+r:"[id='"+r+"']";s--;)p[s]=c+" "+h(p[s]);u=p.join(","),m=ft.test(t)&&l(e.parentNode)||e}if(u)try{return X.apply(i,m.querySelectorAll(u)),i}catch(t){}finally{r===V&&e.removeAttribute("id")}}}return T(t.replace(st,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>_.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[V]=!0,t}function o(t){var e=P.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=i.length;n--;)_.attrHandle[i[n]]=e}function a(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||j)-(~t.sourceIndex||j);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function r(t){return n(function(e){return e=+e,n(function(i,n){for(var o,s=t([],i.length,e),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function h(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function d(t,e,i){var n=e.dir,o=i&&"parentNode"===n,s=z++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,s)}:function(e,i,a){var r,l,c,h=[O,s];if(a){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(c=e[V]||(e[V]={}),l=c[e.uniqueID]||(c[e.uniqueID]={}),(r=l[n])&&r[0]===O&&r[1]===s)return h[2]=r[2];if(l[n]=h,h[2]=t(e,i,a))return!0}}}function p(t){return t.length>1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function u(t,i,n){for(var o=0,s=i.length;o<s;o++)e(t,i[o],n);return n}function m(t,e,i,n,o){for(var s,a=[],r=0,l=t.length,c=null!=e;r<l;r++)(s=t[r])&&(i&&!i(s,n,o)||(a.push(s),c&&e.push(r)));return a}function g(t,e,i,o,s,a){return o&&!o[V]&&(o=g(o)),s&&!s[V]&&(s=g(s,a)),n(function(n,a,r,l){var c,h,d,p=[],g=[],f=a.length,b=n||u(e||"*",r.nodeType?[r]:r,[]),C=!t||!n&&e?b:m(b,p,t,r,l),v=i?s||(n?t:f||o)?[]:a:C;if(i&&i(C,v,r,l),o)for(c=m(v,g),o(c,[],r,l),h=c.length;h--;)(d=c[h])&&(v[g[h]]=!(C[g[h]]=d));if(n){if(s||t){if(s){for(c=[],h=v.length;h--;)(d=v[h])&&c.push(C[h]=d);s(null,v=[],c,l)}for(h=v.length;h--;)(d=v[h])&&(c=s?Z(n,d):p[h])>-1&&(n[c]=!(a[c]=d))}}else v=m(v===a?v.splice(f,v.length):v),s?s(null,a,v,l):X.apply(a,v)})}function f(t){for(var e,i,n,o=t.length,s=_.relative[t[0].type],a=s||_.relative[" "],r=s?1:0,l=d(function(t){return t===e},a,!0),c=d(function(t){return Z(e,t)>-1},a,!0),u=[function(t,i,n){var o=!s&&(n||i!==A)||((e=i).nodeType?l(t,i,n):c(t,i,n));return e=null,o}];r<o;r++)if(i=_.relative[t[r].type])u=[d(p(u),i)];else{if(i=_.filter[t[r].type].apply(null,t[r].matches),i[V]){for(n=++r;n<o&&!_.relative[t[n].type];n++);return g(r>1&&p(u),r>1&&h(t.slice(0,r-1).concat({value:" "===t[r-2].type?"*":""})).replace(st,"$1"),i,r<n&&f(t.slice(r,n)),n<o&&f(t=t.slice(n)),n<o&&h(t))}u.push(i)}return p(u)}function b(t,i){var o=i.length>0,s=t.length>0,a=function(n,a,r,l,c){var h,d,p,u=0,g="0",f=n&&[],b=[],C=A,v=n||s&&_.find.TAG("*",c),Line truncated
|
||||||
|
return void 0!==ot&&ot.event.triggered!==e.type?ot.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(vt)||[""],c=e.length;c--;)r=Rt.exec(e[c])||[],u=g=r[1],m=(r[2]||"").split(".").sort(),u&&(d=ot.event.special[u]||{},u=(o?d.delegateType:d.bindType)||u,d=ot.event.special[u]||{},h=ot.extend({type:u,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:m.join(".")},s),(p=l[u])||(p=l[u]=[],p.delegateCount=0,d.setup&&!1!==d.setup.call(t,n,m,a)||t.addEventListener&&t.addEventListener(u,a)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),ot.event.global[u]=!0)},remove:function(t,e,i,n,o){var s,a,r,l,c,h,d,p,u,m,g,f=wt.hasData(t)&&wt.get(t);if(f&&(l=f.events)){for(e=(e||"").match(vt)||[""],c=e.length;c--;)if(r=Rt.exec(e[c])||[],u=g=r[1],m=(r[2]||"").split(".").sort(),u){for(d=ot.event.special[u]||{},u=(n?d.delegateType:d.bindType)||u,p=l[u]||[],r=r[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)h=p[s],!o&&g!==h.origType||i&&i.guid!==h.guid||r&&!r.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,d.remove&&d.remove.call(t,h));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,m,f.handle)||ot.removeEvent(t,u,f.handle),delete l[u])}else for(u in l)ot.event.remove(t,u+e[c],i,n,!0);ot.isEmptyObject(l)&&wt.remove(t,"handle events")}},dispatch:function(t){t=ot.event.fix(t);var e,i,n,o,s,a=[],r=X.call(arguments),l=(wt.get(this,"events")||{})[t.type]||[],c=ot.event.special[t.type]||{};if(r[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(a=ot.event.handlers.call(this,t,l),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(s.namespace)||(t.handleObj=s,t.data=s.data,void 0!==(n=((ot.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,r))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,s,a=[],r=e.delegateCount,l=t.target;if(r&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i<r;i++)s=e[i],o=s.selector+" ",void 0===n[o]&&(n[o]=s.needsContext?ot(o,this).index(l)>-1:ot.find(o,this,null,[l]).length),n[o]&&n.push(s);n.length&&a.push({elem:l,handlers:n})}return r<e.length&&a.push({elem:this,handlers:e.slice(r)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,o,s=e.button;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||Y,n=i.documentElement,o=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===s||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[ot.expando])return t;var e,i,n,o=t.type,s=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Vt.test(o)?this.mouseHooks:Lt.test(o)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,t=new ot.Event(s),e=n.length;e--;)i=n[e],t[i]=s[i];return t.target||(t.target=Y),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,s):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&ot.nodeName(this,"input"))return this.click(),!1},_default:function(t){return ot.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},ot.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},ot.Event=function(t,e){if(!(this instanceof ot.Event))return new ot.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?u:m):this.type=t,e&&ot.extend(this,e),this.timeStamp=t&&t.timeStamp||ot.now(),this[ot.expando]=!0},ot.Event.prototype={constructor:ot.Event,isDefaultPrevented:m,isPropagationStopped:m,isImmediatePropagationStopped:m,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=u,t&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagatiLine truncated
|
||||||
|
ot.isArray(t)||t.jquery&&!ot.isPlainObject(t))ot.each(t,function(){o(this.name,this.value)});else for(i in t)W(i,t[i],e,o);return n.join("&").replace(ke,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ot.prop(this,"elements");return t?ot.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ot(this).is(":disabled")&&Me.test(this.nodeName)&&!Pe.test(t)&&(this.checked||!Mt.test(t))}).map(function(t,e){var i=ot(this).val();return null==i?null:ot.isArray(i)?ot.map(i,function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}}):{name:e.name,value:i.replace(Ee,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},De=ot.ajaxSettings.xhr();nt.cors=!!De&&"withCredentials"in De,nt.ajax=De=!!De,ot.ajaxTransport(function(e){var i,n;if(nt.cors||De&&!e.crossDomain)return{send:function(o,s){var a,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)r[a]=e.xhrFields[a];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===t?r.abort():"error"===t?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Ue[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ot.globalEval(t),t}}}),ot.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ot.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ot("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&o("error"===t.type?404:200,t.type)}),Y.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Be=[],Fe=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Be.pop()||ot.expando+"_"+ge++;return this[t]=!0,t}}),ot.ajaxPrefilter("json jsonp",function(e,i,n){var o,s,a,r=!1!==e.jsonp&&(Fe.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fe.test(e.data)&&"data");if(r||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,r?e[r]=e[r].replace(Fe,"$1"+o):!1!==e.jsonp&&(e.url+=(fe.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||ot.error(o+" was not called"),a[0]},e.dataTypes[0]="json",s=t[o],t[o]=function(){a=arguments},n.always(function(){void 0===s?ot(t).removeProp(o):t[o]=s,e[o]&&(e.jsonpCallback=i.jsonpCallback,Be.push(o)),a&&ot.isFunction(s)&&s(a[0]),a=s=void 0}),"script"}),ot.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||Y;var n=ut.exec(t),o=!i&&[];return n?[e.createElement(n[1])]:(n=p([t],e,o),o&&o.length&&ot(o).remove(),ot.merge([],n.childNodes))};var Le=ot.fn.load;ot.fn.load=function(t,e,i){if("string"!=typeof t&&Le)return Le.apply(this,arguments);var n,o,s,a=this,r=t.indexOf(" ");return r>-1&&(n=ot.trim(t.slice(r)),t=t.slice(0,r)),ot.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&ot.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){s=arguments,a.html(n?ot("<div>").append(ot.parseHTML(t)).find(n):t)}).always(i&&function(t,e){a.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ot.fn[e]=function(t){return this.on(e,t)}}),ot.expr.filters.animated=function(t){return ot.grep(ot.timers,function(e){return t===e.elem}).length},ot.offset={setOffset:function(t,e,i){var n,o,s,a,r,l,c,h=ot.css(t,"position"),d=ot(t),p={};"static"===h&&(t.style.position="relative"),r=d.offset(),s=ot.css(t,"top"),l=ot.css(t,"left"),c=("absolute"===h||"fixed"===h)&&(s+l).indexOf("auto")>-1,c?(n=d.position(),a=n.top,o=n.left):(a=parseFloat(s)||0,o=parseFloat(l)||0),ot.isFunction(e)&&(e=e.call(t,i,ot.extend({},r))),null!=e.top&&(p.top=e.top-r.top+a),null!=e.left&&(p.left=e.left-r.left+o),"using"in e?e.using.call(t,p):d.css(p)}},ot.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ot.offset.setOffset(this,t,e)});var e,i,Line truncated
|
||||||
|
i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(e,n){var o=this.$element.find(".item.active"),s=n||this.getItemForDirection(e,o),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],h=t.Event("slide.bs.carousel",{relatedTarget:c,direction:r});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=t(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var p=t.Event("slid.bs.carousel",{relatedTarget:c,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,o.addClass(r),s.addClass(r),o.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),o.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(p)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),a&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var o=function(i){var n,o=t(this),s=t(o.attr("data-target")||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),o.data()),r=o.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),function(t){"use strict";function e(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(n)}function i(e){return this.each(function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},n.DEFAULTS,i.data(),"object"==typeof e&&e);!o&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),o||i.data("bs.collapse",o=new n(this,s)),"string"==typeof e&&o[e]()})}var n=function(e,i){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.7",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(e=o.data("bs.collapse"))&&e.transitioning)){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),e||o.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[a](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",t.proxy(o,this)).emulateTransitionEnd(n.TRANSITION_DURATION)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,n){var o=t(n);this.addAriaAndCollapsedClass(e(o),o)},this)).end()},n.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hLine truncated
|
||||||
|
this[t]=this[t]||{}},this)},initialize:function(){},onReady:function(){this.start()},start:function(){this.initializeControllers(this.controllers||{}),this.launchControllers(),this.launch.call(this)},getClasseRefs:function(e,i){var n={},o=this.allocationMap[e],s=this[o];return _.each(i,function(e){n[e]=t(e,e.indexOf(".")>-1?window:s)},this),n},initializeControllers:function(e){this.controllers={},_.each(e,function(e){var i=e.indexOf(".")>-1?window:this[this.allocationMap.controller],n=t(e,i),o=(e.split(".").pop(),new n({id:e,application:this}));o.views=this.getClasseRefs("view",o.views||[]),_.extend(this.models,this.getClasseRefs("model",o.models||[])),_.extend(this.collections,this.getClasseRefs("collection",o.collections||{})),this.buildCollections(),this.controllers[e]=o},this)},launchControllers:function(){_.each(this.controllers,function(t,e){t.onLaunch(this)},this)},launch:function(){},addListeners:function(t,e){this.eventbus.addListeners(t,e)},getController:function(t){return this.controllers[t]},getModel:function(t){this._modelsCache=this._modelsCache||{};var e=this._modelsCache[t],i=this.getModelConstructor(t);return!e&&i&&(e=this.createModel(t),this._modelsCache[t]=e),e||null},getModelConstructor:function(t){return this.models[t]},createModel:function(t,e){var i=this.getModelConstructor(t),n=null;return i&&(n=new i(_.extend(e||{}))),n},getCollection:function(t){this._collectionsCache=this._collectionsCache||{};var e=this._collectionsCache[t],i=this.getCollectionConstructor(t);return!e&&i&&(e=this.createCollection(t),this._collectionsCache[t]=e),e||null},getCollectionConstructor:function(t){return this.collections[t]},createCollection:function(t){var e=this.getCollectionConstructor(t),i=null;return e&&(i=new e),i},buildCollections:function(){_.each(this.collections,function(t,e){this.getCollection(e)},this)}}),void 0!==Backbone.Application)throw"Native Backbone.Application instance already defined.";Backbone.Application=e,Backbone.Application.extend=Backbone.Model.extend;var i=function(t){_.extend(this,t||{}),this.initialize.apply(this,arguments)};if(_.extend(i.prototype,{name:null,views:{},models:{},collections:{},initialize:function(t){},addListeners:function(t){this.getApplication().addListeners(t,this)},onLaunch:function(t){},getApplication:function(){return this.application},getView:function(t){return this._viewsCache[t]},getViewConstructor:function(t){return this.views[t]},createView:function(t,e){var i=this.getViewConstructor(t),n=_.extend(e||{},{alias:t});return this._viewsCache=this._viewsCache||{},this._viewsCache[t]=new i(n),this._viewsCache[t].options=_.extend({},n),this._viewsCache[t]},getModel:function(t){return this.application.getModel(t)},getModelConstructor:function(t){return this.application.getModelConstructor(t)},createModel:function(t,e){return this.application.createModel(t)},getCollection:function(t){return this.application.getCollection(t)},getCollectionConstructor:function(t){return this.application.getCollectionConstructor(t)},createCollection:function(t){return this.application.createCollection(t)},fireEvent:function(t,e,i){this.application.eventbus.fireEvent(t,e,i)},bindViewEvents:function(t,e){this.unbindViewEvents(t),e=_.isFunction(e)?e.call(this):e;for(var i in e){var n=e[i];_.isFunction(n)||(n=this[e[i]]);var o=i.match(/^(\S+)\s*(.*)$/),s=o[1],a=o[2];n=_.bind(n,this),s+=".bindViewEvents"+t.cid,t.$el.on(s,a,n)}return this},unbindViewEvents:function(t){return t.$el.off(".bindViewEvents"+t.cid),this}}),void 0!==Backbone.Controller)throw"Native Backbone.Controller instance already defined.";Backbone.Controller=i,Backbone.Controller.extend=Backbone.Model.extend;var n=function(t){var e=this;_.extend(this,t||{}),_.extend(Backbone.View.prototype,{alias:null,hidden:!1,getAlias:function(){return this.options.alias},fireEvent:function(t,i){this.trigger.apply(this,arguments),e.fireEvent(this.getAlias(),t,i)},hide:function(){this.$el.hide(),this.hidden=!0},show:function(){this.$el.show(),this.hidden=!1}})};if(_.extend(n.prototype,{pool:{},addListeners:function(t,e){this.pool[e.id]=this.pool[e.id]||{};var i=this.pool[e.id];_.isArray(t)?_.each(t,function(t){this.addListeners(t,e)},this):_.isObject(t)&&_.each(t,function(t,e){_.each(t,function(t,n){i[e]=i[e]||{},i[e][n]=i[e][n]||[],i[e][n].push(t)},this)},this)},fireEvent:function(t,e,i){var n=this.getApplication();_.each(this.pool,function(o,s){var a=o[t];if(a){var r=a[e],l=n.getController(s);_.each(r,function(t){t.apply(l,i)})}},this)},getApplication:function(){return this.application}}),void 0!==Backbone.EventBus)throw"Native Backbone.Application instance already defined.";Backbone.EventBus=n}(),define("core",["backbone","notification"],function(){}),void 0===Common)var Common={};if(Common.component=Common.component||{},Common.Analytics=Common.component.Analytics=new function(){var t;return{initialize:function(e,i){if(void 0===e)throw"Analytics: invalid id.";if(void 0===i||"[object String]"!==Object.prototype.toString.apply(i))tLine truncated
|
||||||
|
this.$window.append(_.template(n)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(r,this),e&&e.length>1&&(this.initConfig.minwidth=e[0]),e&&e.length>1&&(this.initConfig.minheight=e[1]),i&&i.length>1&&(this.initConfig.maxwidth=i[0]),i&&i.length>1&&(this.initConfig.maxheight=i[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=t}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">',"<label>"+this.textName+"</label>","</div>",'<div id="id-dlg-newname" class="input-row"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this;t.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!/[\t*\+:\"<>?|\\\\\/]/gim.test(e)||t.txtInvalidName+'*+:"<>?|/'}});var e=this.getChild();e.find(".btn").on("click",_.bind(this.onBtnClick,this)),t.inputNameEl=e.find("input"),t.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputName.setValue(t.options.filename),t.inputNameEl.focus().select()},100)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputName.checkValidate())return void this.inputNameEl.focus();this.options.handler.call(this,t,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(t,e){"use strict";Common.Views.Header=t.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(e),events:{"click #header-logo":function(t){var e=this.branding&&this.branding.logo&&this.branding.logo.url?this.branding.logo.url:"http://www.onlyoffice.com",i=window.open(e);i&&i.focus()}},initialize:function(t){this.options=this.options?_({}).extend(this.options,t):t,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var t=new Common.UI.MenuItem({caption:this.openNewTabText}).on("click",function(t,e){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[t]})},setVisible:function(t){t?this.show():this.hide()},setBranding:function(t){var e;this.branding=t,t&&t.logo&&t.logo.image&&(e=$("#header-logo"))&&(e.html('<img src="'+t.logo.image+'" style="max-width:86px; max-height:20px; margin: 0 8px 0 15px;"/>'),e.css({"background-image":"none",width:"auto"}))},setHeaderCaption:function(t){this.headerCaption=t;var e=$("#header-caption > div");return e&&e.html(t),t},getHeaderCaption:function(){return this.headerCaption},setDocumentCaption:function(t,e){void 0!==e&&(this.isModified=e),this.documentCaption=t,t||(t=""),this.isModified&&(t+="*");var i=$("#header-documentcaption div");return i&&i.html(Common.Utils.String.htmlEncode(t)),t},getDocumentCaption:function(){return this.documentCaption},setCanBack:function(t){this.canBack=t;var e=$("#header-back");e&&(e.off("mouseup"),e.css("display",t?"table-cell":"none"),t&&e.on("mouseup",_.bind(this.onBackClick,this)))Line truncated
|
||||||
|
if("object"==typeof t&&void 0!==t.effectValue&&this.effectcolors)for(var e=0;e<this.effectcolors.length;e++)if(this.effectcolors[e].effectValue===t.effectValue&&t.color.toUpperCase()===this.effectcolors[e].color.toUpperCase()){t.effectId=this.effectcolors[e].effectId;break}return t}}},Common.Utils.Metric=_.extend(new function(){var t=this;return t.c_MetricUnits={cm:0,pt:1,inch:2},t.currentMetric=t.c_MetricUnits.pt,t.metricName=["Cm","Pt","Inch"],t.defaultMetric=t.c_MetricUnits.cm,{c_MetricUnits:t.c_MetricUnits,txtCm:"cm",txtPt:"pt",txtInch:'"',setCurrentMetric:function(e){t.currentMetric=e},getCurrentMetric:function(){return t.currentMetric},getCurrentMetricName:function(){return this["txt"+t.metricName[t.currentMetric]]},getMetricName:function(e){return this["txt"+t.metricName[void 0!==e?e:0]]},setDefaultMetric:function(e){t.defaultMetric=e},getDefaultMetric:function(){return t.defaultMetric},fnRecalcToMM:function(e){if(null!==e&&void 0!==e)switch(t.currentMetric){case t.c_MetricUnits.cm:return 10*e;case t.c_MetricUnits.pt:return 25.4*e/72;case t.c_MetricUnits.inch:return 25.4*e}return e},fnRecalcFromMM:function(e){switch(t.currentMetric){case t.c_MetricUnits.cm:return parseFloat((e/10).toFixed(4));case t.c_MetricUnits.pt:return parseFloat((72*e/25.4).toFixed(3));case t.c_MetricUnits.inch:return parseFloat((e/25.4).toFixed(3))}return e}}},Common.Utils.Metric||{}),Common.Utils.RGBColor=function(t){var e,i,n;"#"==t.charAt(0)&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase();for(var o=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^hsb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(t){var e={},i=Math.round(t[1]),n=Math.round(255*t[2]/100),o=Math.round(255*t[3]/100);if(0==n)e.r=e.g=e.b=o;else{var s=o,a=(255-n)*o/255,r=i%60*(s-a)/60;360==i&&(i=0),i<60?(e.r=s,e.b=a,e.g=a+r):i<120?(e.g=s,e.b=a,e.r=s-r):i<180?(e.g=s,e.r=a,e.b=a+r):i<240?(e.b=s,e.r=a,e.g=s-r):i<300?(e.b=s,e.g=a,e.r=a+r):i<360?(e.r=s,e.g=a,e.b=s-r):(e.r=0,e.g=0,e.b=0)}return[Math.round(e.r),Math.round(e.g),Math.round(e.b)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],s=0;s<o.length;s++){var a=o[s].re,r=o[s].process,l=a.exec(t);if(l){var c=r(l);e=c[0],i=c[1],n=c[2]}}return e=e<0||isNaN(e)?0:e>255?255:e,i=i<0||isNaN(i)?0:i>255?255:i,n=n<0||isNaN(n)?0:n>255?255:n,{r:e,g:i,b:n,isEqual:function(t){return e==t.r&&i==t.g&&n==t.b},toRGB:function(){return"rgb("+e+", "+i+", "+n+")"},toRGBA:function(t){return void 0===t&&(t=1),"rgba("+e+", "+i+", "+n+", "+t+")"},toHex:function(){var t=e.toString(16),o=i.toString(16),s=n.toString(16);return 1==t.length&&(t="0"+t),1==o.length&&(o="0"+o),1==s.length&&(s="0"+s),"#"+t+o+s},toHSB:function(){var t={h:0,s:0,b:0},o=Math.min(e,i,n),s=Math.max(e,i,n),a=s-o;return t.b=s,t.s=0!=s?255*a/s:0,0!=t.s?t.h=e==s?0+(i-n)/a:i==s?2+(n-e)/a:4+(e-i)/a:t.h=0,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t.h=parseInt(t.h),t.s=parseInt(t.s),t.b=parseInt(t.b),t}}},Common.Utils.String=new function(){return{format:function(t){var e=_.toArray(arguments).slice(1);return t.replace(/\{(\d+)\}/g,function(t,i){return e[i]})},htmlEncode:function(t){return _.escape(t)},htmlDecode:function(t){return _.unescape(t)},ellipsis:function(t,e,i){if(t&&t.length>e){if(i){var n=t.substr(0,e-2),o=Math.max(n.lastIndexOf(" "),n.lastIndexOf("."),n.lastIndexOf("!"),n.lastIndexOf("?"));if(-1!==o&&o>=e-15)return n.substr(0,o)+"..."}return t.substr(0,e-3)+"..."}return t},platformKey:function(t,e,i){return _.isEmpty(e)&&(e=" ({0})"),Common.Utils.isMac?(_.isFunction(i)&&(t=i.call(this,t)),Common.Utils.String.format(e,t.replace(/\+(?=\S)/g,"").replace(/Ctrl|ctrl/g,"⌘").replace(/Alt|alt/g,"⌥").replace(/Shift|shift/g,"⇧"))):Common.Utils.String.format(e,t)}}},Common.Utils.isBrowserSupported=function(){return!(0!=Common.Utils.ieVersion&&Common.Utils.ieVersion<9||0!=Common.Utils.safariVersion&&Common.Utils.safariVersion<5||0!=Common.Utils.firefoxVersion&&Common.Utils.firefoxVersion<4||0!=Common.Utils.chromeVersion&&Common.Utils.chromeVersion<7||0!=Common.Utils.operaVersion&&Common.Utils.operaVersion<10.5)},Common.Utils.showBrowserRestriction=function(){var t=window.DE?"Document":window.SSE?"Spreadsheet":window.PE?"Presentation":"that",e=document.createElement("div");e.innerHTML='<div class="app-error-panel"><div class="message-block"><div class="message-inner"><div class="title">Your browser is not supported.</div><div class="text">Sorry, '+t+' Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div></div></div><div class="message-auxiliary"></div></div>',document.body.appendChild(e),$("#loading-mask").hide().remove(),$("#viewport").hide().remove()},Common.Utils.applyCustomization=function(tLine truncated
|
||||||
|
var t="menu"===this.cmpEl.attr("role")?this.cmpEl:this.cmpEl.find("[role=menu]"),e=this.menuAlignEl||t.parent(),i=this.menuAlign.match(/^([a-z]+)-([a-z]+)/),n=e.offset(),o=Common.Utils.innerWidth(),s=Common.Utils.innerHeight()-10,a=t.outerWidth(),r=t.outerHeight(),l=e.outerWidth(),c=e.outerHeight(),h={tl:[0,0],bl:[0,r],tr:[a,0],br:[a,r]},d={tl:[0,0],tr:[l,0],bl:[0,c],br:[l,c]},p=n.left-h[i[1]][0]+d[i[2]][0]+this.offset[0],u=n.top-h[i[1]][1]+d[i[2]][1]+this.offset[1];p+a>o&&(p=e.is("li.dropdown-submenu")?n.left-a+2:o-a),u+r>s&&(u=s-r),u<0&&(u=0),this.options.additionalAlign?this.options.additionalAlign.call(this,t,p,u):t.css({left:p,top:u})}}),{Manager:function(){return t}()})}()}),void 0===Common)var Common={};if(define("common/main/lib/view/CopyWarningDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.CopyWarningDialog=Common.UI.Window.extend(_.extend({options:{width:500,height:325,cls:"modal-dlg copy-warning"},initialize:function(t){_.extend(this.options,{title:this.textTitle},t||{}),this.template=['<div class="box">','<p class="message">'+this.textMsg+"</p>",'<div class="hotkeys">',"<div>",'<p class="hotkey">'+Common.Utils.String.platformKey("Ctrl+C","{0}")+"</p>",'<p class="message">'+this.textToCopy+"</p>","</div>","<div>",'<p class="hotkey">'+Common.Utils.String.platformKey("Ctrl+X","{0}")+"</p>",'<p class="message">'+this.textToCut+"</p>","</div>","<div>",'<p class="hotkey">'+Common.Utils.String.platformKey("Ctrl+V","{0}")+"</p>",'<p class="message">'+this.textToPaste+"</p>","</div>","</div>",'<div id="copy-warning-checkbox" style="margin-top: 20px; text-align: left;"></div>',"</div>",'<div class="separator horizontal"/>','<div class="footer center">','<button class="btn normal dlg-btn primary">'+this.okButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this),this.chDontShow=new Common.UI.CheckBox({el:$("#copy-warning-checkbox"),labelText:this.textDontShow}),this.getChild().find(".btn").on("click",_.bind(this.onBtnClick,this)),this.autoSize()},autoSize:function(){var t=this.getChild(".box"),e=this.getChild(".footer"),i=this.getChild(".header"),n=this.getChild(".body");n.height(parseInt(t.height())+parseInt(e.css("height"))),this.setHeight(parseInt(n.css("height"))+parseInt(i.css("height")))},onBtnClick:function(t){this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close()},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&(this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close())},getSettings:function(){return"checked"==this.chDontShow.getValue()},textTitle:"Copy, Cut and Paste Actions",textMsg:"Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",textToCopy:"for Copy",textToPaste:"for Paste",textToCut:"for Cut",textDontShow:"Don't show this message again"},Common.Views.CopyWarningDialog||{}))}),function(t){var e=t.fn.tooltip;e.prototype=t.fn.tooltip.Constructor.prototype,t.extend(t.fn.tooltip.Constructor.DEFAULTS,{container:"body",delay:{show:500},arrow:!1});var i=function(t,e){this.init("tooltip",t,e)};i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype,{constructor:i,init:function(){e.prototype.init.apply(this,arguments),"cursor"==this.options.placement&&/hover/.exec(this.options.trigger)&&this.$element.on("mousemove.tooltip",this.options.selector,t.proxy(this.mousemove,this)),this.options.zIndex&&this.tip().css("z-index",this.options.zIndex);var i=this;Common.NotificationCenter.on({"layout:changed":function(t){!i.options.hideonclick&&i.tip().is(":visible")&&i.hide()}})},mousemove:function(t){this.targetXY=[t.clientX*Common.Utils.zoom(),t.clientY*Common.Utils.zoom()]},leave:function(t){e.prototype.leave.apply(this,arguments),this.dontShow=void 0},show:function(i){if(this.hasContent()&&this.enabled&&!this.dontShow){if(!this.$element.is(":visible")&&this.$element.closest("[role=menu]").length>0)return;var n=this.tip(),o="function"==typeof this.options.placement?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement;!1===this.options.arrow&&n.addClass("arrow-free"),this.options.cls&&n.addClass(this.options.cls);var s=/^([a-zA-Z]+)-?([a-zA-Z]*)$/.exec(o);if(i||s[2].length){var a=t.Event("show.bs.tooltip");if(this.$element.trigger(a),a.isDefaultPrevented())return;if(this.setContent(),this.options.animation&&n.addClass("fade"),n.detach().css({top:0,left:0,display:"block"}),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element),"object"==typeof i){var r={top:i[1]+15,left:i[0]+18},l=Common.Utils.innerWidth();r.left+n.width()>l&&(r.left=l-n.width()-30),n.offseLine truncated
|
||||||
|
if(this.options.handler){if("ok"==t){var e=this.cmbLinkType.getValue()!=c_oHyperlinkType.WebLink||this.inputUrl.checkValidate(),i=this.inputDisplay.checkValidate();if(!0!==e)return void this.inputUrl.cmpEl.find("input").focus();if(!0!==i)return void this.inputDisplay.cmpEl.find("input").focus()}this.options.handler.call(this,this,t)}this.close()},ShowHideElem:function(t){this.externalPanel.toggleClass("hidden",t!==c_oHyperlinkType.WebLink),this.internalPanel.toggleClass("hidden",t!==c_oHyperlinkType.InternalLink)},parseUrl:function(t){if(null===t||void 0===t||""==t)return c_oHyperlinkType.WebLink;if(0==t.indexOf("ppaction://hlink")){if("ppaction://hlinkshowjump?jump=firstslide"==t)this.radioFirst.setValue(!0);else if("ppaction://hlinkshowjump?jump=lastslide"==t)this.radioLast.setValue(!0);else if("ppaction://hlinkshowjump?jump=nextslide"==t)this.radioNext.setValue(!0);else if("ppaction://hlinkshowjump?jump=previousslide"==t)this.radioPrev.setValue(!0);else{this.radioSlide.setValue(!0);var e="ppaction://hlinksldjumpslide",i=t.indexOf(e);if(0==i){var n=parseInt(t.substring(e.length));n>=0&&n<this.slides.length&&this.cmbSlides.setValue(n)}}return c_oHyperlinkType.InternalLink}return this.inputUrl.setValue(t?t.replace(new RegExp(" ","g"),"%20"):""),c_oHyperlinkType.WebLink},textTitle:"Hyperlink Settings",textInternalLink:"Place In This Document",textExternalLink:"File or Web Page",textEmptyLink:"Enter link here",textEmptyDesc:"Enter caption here",textEmptyTooltip:"Enter tooltip here",txtSlide:"Slide",textLinkType:"Link Type",strDisplay:"Display",textTipText:"Screen Tip Text",strLinkTo:"Link To",txtEmpty:"This field is required",txtNotUrl:'This field should be a URL in the format "http://www.example.com"',strPlaceInDocument:"Select a Place in This Document",cancelButtonText:"Cancel",okButtonText:"Ok",txtNext:"Next Slide",txtPrev:"Previous Slide",txtFirst:"First Slide",txtLast:"Last Slide",textDefault:"Selected text"},PE.Views.HyperlinkSettingsDialog||{}))}),define("text!presentationeditor/main/app/template/ParagraphSettingsAdvanced.template",[],function(){return'<div id="id-adv-paragraph-indents" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="3" style="width: 100%;">\r\n <tr>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsFirstLine %></label>\r\n <div id="paragraphadv-spin-first-line" style="width: 85px;"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsLeftText %></label>\r\n <div id="paragraphadv-spin-indent-left"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsRightText %></label>\r\n <div id="paragraphadv-spin-indent-right"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-adv-paragraph-font" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textEffects %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-strike"></div>\r\n </td>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-subscript"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-double-strike"></div>\r\n </td>\r\n <td class="padding-small">\r\n <div id="paragraphadv-checkbox-small-caps"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-large">\r\n <div id="paragraphadv-checkbox-superscript"></div>\r\n </td>\r\n <td class="padding-large">\r\n <div id="paragraphadv-checkbox-all-caps"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textCharacterSpacing %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2 class="padding-large" width="50%">\r\n <div id="paragraphadv-spin-spacing"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2>\r\n <div style="border: 1px solid #cbcbcb;">\r\n <div id="paragraphadv-font-img" style="width: 300px; height: 80px; positiLine truncated
|
||||||
|
e.keyCode==Common.UI.Keys.LEFT)for(;void 0===n;){if(--a<0){var o=$(t.target).closest(".dropdown-submenu.over");if(o.length>0){o.removeClass("over"),o.find("> a").focus();break}a=this._layoutParams.columns-1}n=this._layoutParams.itemsIndexes[s][a]}else if(e.keyCode==Common.UI.Keys.RIGHT)for(;void 0===n;)a++,a>this._layoutParams.columns-1&&(a=0),n=this._layoutParams.itemsIndexes[s][a];else if(e.keyCode==Common.UI.Keys.UP)for(;void 0===n;)s--,s<0&&(s=this._layoutParams.rows-1),n=this._layoutParams.itemsIndexes[s][a];else for(;void 0===n;)s++,s>this._layoutParams.rows-1&&(s=0),n=this._layoutParams.itemsIndexes[s][a]}else n=e.keyCode==Common.UI.Keys.UP||e.keyCode==Common.UI.Keys.LEFT?Math.max(0,n-1):Math.min(this.store.length-1,n+1);void 0!==n&&n>=0&&(i=this.store.at(n)),i&&(this._fromKeyDown=!0,this.selectRecord(i),this._fromKeyDown=!1,this.scrollToRecord(i))}}else this.trigger("item:keydown",this,i,t)},attachKeyEvents:function(){if(this.enableKeyEvents&&this.handleSelect){var t=$(this.el).find(".inner").andSelf().filter(".inner");t.addClass("canfocused"),t.attr("tabindex","0"),t.on(this.parentMenu&&this.useBSKeydown?"dataview:keydown":"keydown",_.bind(this.onKeyDown,this))}},showLastSelected:function(){if(this.lastSelectedRec)this.selectRecord(this.lastSelectedRec,!0),this.scrollToRecord(this.lastSelectedRec),this.lastSelectedRec=null;else{var t=this.getSelectedRec()[0];t&&this.scrollToRecord(t)}},setDisabled:function(t){this.disabled=t,$(this.el).find(".inner").andSelf().filter(".inner").toggleClass("disabled",t)},isDisabled:function(){return this.disabled},setEmptyText:function(t){this.emptyText=t},alignPosition:function(){var t="menu"===this.parentMenu.cmpEl.attr("role")?this.parentMenu.cmpEl:this.parentMenu.cmpEl.find("[role=menu]"),e=$(this.el).find(".inner").andSelf().filter(".inner"),i=Common.Utils.innerHeight(),n=t.outerHeight(),o=parseInt(t.css("top"));n>i?(e.css("max-height",i-parseInt(t.css("padding-top"))-parseInt(t.css("padding-bottom"))-5+"px"),this.allowScrollbar&&this.scroller.update({minScrollbarLength:40})):e.height()<this.options.restoreHeight&&(e.css("max-height",Math.min(i-parseInt(t.css("padding-top"))-parseInt(t.css("padding-bottom"))-5,this.options.restoreHeight)+"px"),n=t.outerHeight(),o+n>i&&t.css("top",0),this.allowScrollbar&&this.scroller.update({minScrollbarLength:40}))},fillIndexesArray:function(){if(!(this.dataViewItems.length<=0)){this._layoutParams={itemsIndexes:[],columns:0,rows:0};for(var t=$(this.dataViewItems[0].el),e=t.outerWidth()+parseInt(t.css("margin-left"))+parseInt(t.css("margin-right")),i=this.$el.offset().left,n=-1,o=0,s=0,a=0;a<this.dataViewItems.length;a++){var r=$(this.dataViewItems[a].el).offset().top;s=Math.floor(($(this.dataViewItems[a].el).offset().left-i)/e),r>n&&(n=r,this._layoutParams.itemsIndexes.push([]),o=this._layoutParams.itemsIndexes.length-1),this._layoutParams.itemsIndexes[o][s]=a,this.dataViewItems[a].topIdx=o,this.dataViewItems[a].leftIdx=s,this._layoutParams.columns<s&&(this._layoutParams.columns=s)}this._layoutParams.rows=this._layoutParams.itemsIndexes.length,this._layoutParams.columns++}},onResize:function(){this._layoutParams=void 0}}),$(document).on("keydown.dataview","[data-toggle=dropdown], [role=menu]",function(t){t.keyCode!==Common.UI.Keys.UP&&t.keyCode!==Common.UI.Keys.DOWN&&t.keyCode!==Common.UI.Keys.LEFT&&t.keyCode!==Common.UI.Keys.RIGHT&&t.keyCode!==Common.UI.Keys.RETURN||_.defer(function(){var e=$(t.target).closest(".dropdown-toggle");e.length?e.parent().find(".inner.canfocused").trigger("dataview:keydown",t):$(t.target).closest(".dropdown-submenu").find(".inner.canfocused").trigger("dataview:keydown",t)},100)})}),void 0===Common)var Common={};define("common/main/lib/component/ListView",["common/main/lib/component/DataView"],function(){"use strict";Common.UI.ListView=Common.UI.DataView.extend(function(){return{options:{handleSelect:!0,enableKeyEvents:!0,showLast:!0,simpleAddMode:!1,keyMoveDirection:"vertical",itemTemplate:_.template('<div id="<%= id %>" class="list-item" style=""><%= value %></div>')},template:_.template(['<div class="listview inner"></div>'].join("")),onResetItems:function(){this.innerEl=null,Common.UI.DataView.prototype.onResetItems.call(this)},onAddItem:function(t,e){var i=new Common.UI.DataViewItem({template:this.itemTemplate,model:t});if(this.innerEl||(this.innerEl=$(this.el).find(".inner"),this.innerEl.find(".empty-text").remove()),i&&this.innerEl){if(this.options.simpleAddMode)this.innerEl.append(i.render().el);else{var n=_.indexOf(this.store.models,t),o=this.innerEl.find("> div");n>0?$(o.get(n-1)).after(i.render().el):o.length>0?$(o[n]).before(i.render().el):this.innerEl.append(i.render().el)}this.dataViewItems.push(i),this.listenTo(i,"change",this.onChangeItem),this.listenTo(i,"remove",this.onRemoveItem),this.listenTo(i,"click",this.onClickItem),this.listenTo(i,"dblclick",this.onDblClickItem),this.listenTo(i,"select",this.onSelectItem),this.isSuspendEvents||this.trigger("item:add",this,i,t)}}}}())}),defiLine truncated
|
||||||
|
i[1].type=Asc.c_oAscLineBeginSize.small_mid,i[2].type=Asc.c_oAscLineBeginSize.small_large,i[3].type=Asc.c_oAscLineBeginSize.mid_small,i[4].type=Asc.c_oAscLineBeginSize.mid_mid,i[5].type=Asc.c_oAscLineBeginSize.mid_large,i[6].type=Asc.c_oAscLineBeginSize.large_small,i[7].type=Asc.c_oAscLineBeginSize.large_mid,i[8].type=Asc.c_oAscLineBeginSize.large_large,this.btnBeginStyle=new Common.UI.ComboBox({el:$("#shape-advanced-begin-style"),template:_.template(['<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle combo-arrow-style" data-toggle="dropdown">','<div class="form-control image" style="width: 100px;"></div>','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',"</div>"].join(""))}),this.btnBeginStyleMenu=new Common.UI.Menu({style:"min-width: 105px;",items:[{template:_.template('<div id="shape-advanced-menu-begin-style" style="width: 105px; margin: 0 5px;"></div>')}]}).render($("#shape-advanced-begin-style")),this.mnuBeginStylePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-begin-style"),parentMenu:this.btnBeginStyleMenu,store:new Common.UI.DataViewStore(e),itemTemplate:_.template('<div id="<%= id %>" class="item-arrow" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')}),this.mnuBeginStylePicker.on("item:click",_.bind(this.onSelectBeginStyle,this)),this._selectStyleItem(this.btnBeginStyle,null),this.btnBeginSize=new Common.UI.ComboBox({el:$("#shape-advanced-begin-size"),template:_.template(['<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle combo-arrow-style" data-toggle="dropdown">','<div class="form-control image" style="width: 100px;"></div>','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',"</div>"].join(""))}),this.btnBeginSizeMenu=new Common.UI.Menu({style:"min-width: 160px;",items:[{template:_.template('<div id="shape-advanced-menu-begin-size" style="width: 160px; margin: 0 5px;"></div>')}]}).render($("#shape-advanced-begin-size")),this.mnuBeginSizePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-begin-size"),parentMenu:this.btnBeginSizeMenu,store:new Common.UI.DataViewStore(i),itemTemplate:_.template('<div id="<%= id %>" class="item-arrow" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')}),this.mnuBeginSizePicker.on("item:click",_.bind(this.onSelectBeginSize,this)),this._selectStyleItem(this.btnBeginSize,null),n=0;n<e.length;n++)e[n].offsety+=200;for(n=0;n<i.length;n++)i[n].offsety+=200;this.btnEndStyle=new Common.UI.ComboBox({el:$("#shape-advanced-end-style"),template:_.template(['<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle combo-arrow-style" data-toggle="dropdown">','<div class="form-control image" style="width: 100px;"></div>','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',"</div>"].join(""))}),this.btnEndStyleMenu=new Common.UI.Menu({style:"min-width: 105px;",items:[{template:_.template('<div id="shape-advanced-menu-end-style" style="width: 105px; margin: 0 5px;"></div>')}]}).render($("#shape-advanced-end-style")),this.mnuEndStylePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-end-style"),parentMenu:this.btnEndStyleMenu,store:new Common.UI.DataViewStore(e),itemTemplate:_.template('<div id="<%= id %>" class="item-arrow" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')}),this.mnuEndStylePicker.on("item:click",_.bind(this.onSelectEndStyle,this)),this._selectStyleItem(this.btnEndStyle,null),this.btnEndSize=new Common.UI.ComboBox({el:$("#shape-advanced-end-size"),template:_.template(['<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle combo-arrow-style" data-toggle="dropdown">','<div class="form-control image" style="width: 100px;"></div>','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',"</div>"].join(""))}),this.btnEndSizeMenu=new Common.UI.Menu({style:"min-width: 160px;",items:[{template:_.template('<div id="shape-advanced-menu-end-size" style="width: 160px; margin: 0 5px;"></div>')}]}).render($("#shape-advanced-end-size")),this.mnuEndSizePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-end-size"),parentMenu:this.btnEndSizeMenu,store:new Common.UI.DataViewStore(i),itemTemplate:_.template('<div id="<%= id %>" class="item-arrow" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')}),this.mnuEndSizePicker.on("item:click",_.bind(this.onSelectEndSize,this)),this._selectStyleItem(this.btnEndSize,null),this.inputAltTitle=new Common.UI.InputField({el:$("#shape-advanced-alt-title"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"}).on("changed:after",function()Line truncated
|
||||||
|
return t.preventDefault(),t.stopPropagation(),!1}),n.on("click",function(t){"canvas"==t.target.localName&&n.focus()}),n.on("mousedown",function(t){"canvas"==t.target.localName&&Common.UI.Menu.Manager.hideAll()});var o=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";!function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent("on"+e,i)}(i.el,o,c)}t(document).on("mousewheel",c),t(document).on("keydown",h),t(window).on("resize",d),PE.getController("Viewport").getView("Viewport").hlayout.on("layout:resizedrag",d)},u=function(t){if(n){var e=n.findUser(t);if(e)return e.get("username")}return i.guestText},m={toolTip:new Common.UI.Tooltip({owner:this,html:!0,title:"<br><b>Press Ctrl and click link</b>"}),strTip:"",isHidden:!0,isVisible:!1},g=!0,f=function(t,e,n){!0===g&&(g=new Common.UI.Tooltip({owner:t.currentTarget,title:i.tipIsLocked}),g.show())},b=function(){if("object"==typeof g){g.hide(),g=void 0;for(var t=0;t<i.usertips.length;t++)i.usertips[t].off("mouseover",f),i.usertips[t].off("mouseout",C)}},C=function(t,e,i){"object"==typeof g&&g.$element&&t.currentTarget===g.$element[0]&&b()};Common.NotificationCenter.on({"window:show":function(t){m.toolTip.hide(),m.isVisible=!1,b()},"modal:show":function(t){i.hideTips()},"layout:changed":function(t){m.toolTip.hide(),m.isVisible=!1,b(),i.hideTips(),d()}});var v=function(t){t&&i.api.asc_getUrlType(t)>0&&window.open(t)},_=function(){m.isHidden=!0,i.usertips.length>0&&("object"==typeof g&&(g.hide(),g=!0),e.each(i.usertips,function(t){t.remove()})),i.usertips=[],i.usertipcount=0},y=function(){m.isHidden&&m.isVisible&&(m.isVisible=!1,m.toolTip.hide())},x=function(n){if(e.isUndefined(i._XY)&&(i._XY=[i.cmpEl.offset().left-t(window).scrollLeft(),i.cmpEl.offset().top-t(window).scrollTop()],i._Width=i.cmpEl.width(),i._Height=i.cmpEl.height(),i._BodyWidth=t("body").width()),n){var o,s;if(1==n.get_Type()){var a=n.get_Hyperlink(),r=!1;a&&(m.isHidden=!1,s=e.isEmpty(a.get_ToolTip())?a.get_Value():a.get_ToolTip(),s=Common.Utils.String.htmlEncode(s),(m.tipLength!==s.length||m.strTip.indexOf(s)<0)&&(m.toolTip.setTitle(s+"<br><b>"+i.txtPressLink+"</b>"),m.tipLength=s.length,m.strTip=s,r=!0),o=[n.get_X(),n.get_Y()],o[1]+=i._XY[1]-15,o[0]+=i._XY[0]+5,m.isVisible&&!r||(m.isVisible=!0,m.toolTip.show([-1e4,-1e4])),r&&(m.tipHeight=m.toolTip.getBSTip().$tip.height(),m.tipWidth=m.toolTip.getBSTip().$tip.width()),o[1]-=m.tipHeight,o[0]+m.tipWidth>i._BodyWidth&&(o[0]=i._BodyWidth-m.tipWidth),m.toolTip.getBSTip().$tip.css({top:o[1]+"px",left:o[0]+"px"}))}else if(2==n.get_Type()&&i.mode.isEdit){var l;i.usertipcount>=i.usertips.length&&(l=t(document.createElement("div")),l.addClass("username-tip"),l.css({height:i._TtHeight+"px",position:"absolute",zIndex:"900",visibility:"visible"}),t(document.body).append(l),g&&(l.on("mouseover",f),l.on("mouseout",C)),i.usertips.push(l)),l=i.usertips[i.usertipcount],i.usertipcount++,s=u(n.get_UserId()),o=[n.get_X()+i._XY[0],n.get_Y()+i._XY[1]],o[0]=i._BodyWidth-o[0],o[1]-=2==n.get_LockedObjectType()?i._TtHeight:0,o[1]>i._XY[1]&&o[1]+i._TtHeight<i._XY[1]+i._Height&&(l.text(s),l.css({visibility:"visible",top:o[1]+"px",right:o[0]+"px"}))}}},w=function(e,n,o,s){for(var a,r=0;r<i.fastcoauthtips.length;r++)if(i.fastcoauthtips[r].attr("userid")==e){a=i.fastcoauthtips[r];break}a||(a=t(document.createElement("div")),a.addClass("username-tip"),a.attr("userid",e),a.css({height:i._TtHeight+"px",position:"absolute",zIndex:"900",display:"none","pointer-events":"none","background-color":"#"+Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b())}),a.text(u(e)),t("#id_main_view").append(a),i.fastcoauthtips.push(a),a.fadeIn(150)),a.css({top:o-i._TtHeight+"px",left:n+"px"})},S=function(t){for(var e=0;e<i.fastcoauthtips.length;e++)if(i.fastcoauthtips[e].attr("userid")==t){var n=i.fastcoauthtips[e];i.fastcoauthtips[e].fadeOut(150,function(){n.remove()}),i.fastcoauthtips.splice(e,1);break}},T=function(){var t,n,o;if(i.api&&i.mode.isEdit){var s=function(t,e){"ok"==e&&(n=t.getSettings(),!1!==o?i.api.add_Hyperlink(n):i.api.change_Hyperlink(n)),i.fireEvent("editcomplete",i)};o=i.api.can_AddHyperlink();for(var a=[],r=0;r<i.api.getCountPages();r++)a.push({displayValue:r+1,value:r});if(!1!==o)t=new PE.Views.HyperlinkSettingsDialog({api:i.api,handler:s,slides:a}),n=new Asc.CHyperlinkProperty,n.put_Text(o),t.show(),t.setSettings(n);else{var l=i.api.getSelectedElements();l&&e.isArray(l)&&e.each(l,function(t,e){l[e].get_ObjectType()==Asc.c_oAscTypeSelectElement.Hyperlink&&(n=l[e].get_ObjectValue())}),n&&(t=new PE.Views.HyperlinkSettingsDialog({api:i.api,handler:s,slides:a}),t.show(),t.setSettings(n))}}Common.component.Analytics.trackEvent("DocumentHolder","Add Hyperlink")},A=function(n){e.isUndefined(i._XY)&&(i._XY=[i.cmpEl.offset().left-t(window).scrollLeft(),i.cmpEl.offset().top-t(window).scrollTop()],i._Width=i.cmpEl.width(),i._Height=i.cmpEl.height(),i._BodyWidth=t("body").width()),e.isUndefined(i.slideNumDiv)&&(i.slideNumDiv=t(document.createEleLine truncated
|
||||||
|
}).on("click",e.bind(t,i)),i.menuTableCellCenter=new Common.UI.MenuItem({caption:i.centerCellText,checkable:!0,toggleGroup:"popuptablecellalign",value:Asc.c_oAscVertAlignJc.Center}).on("click",e.bind(t,i)),i.menuTableCellBottom=new Common.UI.MenuItem({caption:i.bottomCellText,checkable:!0,toggleGroup:"popuptablecellalign",value:Asc.c_oAscVertAlignJc.Bottom}).on("click",e.bind(t,i))]})}()}),p=new Common.UI.MenuItem({caption:i.advancedTableText}).on("click",function(t){if(i.api){var e=i.api.getSelectedElements();if(e&&e.length>0)for(var n,o,s=e.length-1;s>=0;s--)if(n=e[s].get_ObjectType(),o=e[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Table==n){new PE.Views.TableSettingsAdvanced({tableProps:o,handler:function(t,e){"ok"==t&&i.api&&i.api.tblApply(e.tableProps),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Table Settings Advanced")}}).show();break}}}),u=new Common.UI.MenuItem({caption:i.advancedImageText}).on("click",function(t){if(i.api){var e=i.api.getSelectedElements();if(e&&e.length>0)for(var n,o,s=e.length-1;s>=0;s--)if(n=e[s].get_ObjectType(),o=e[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Image==n){var a;F.isDisabled()||(a=i.api.get_OriginalSizeImage())&&(a={width:a.get_ImageWidth(),height:a.get_ImageHeight()}),new PE.Views.ImageSettingsAdvanced({imageProps:o,sizeOriginal:a,handler:function(t,e){"ok"==t&&i.api&&i.api.ImgApply(e.imageProps),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Image Settings Advanced")}}).show();break}}}),m=new Common.UI.MenuItem({caption:i.advancedShapeText}).on("click",function(t){if(i.api){var e=i.api.getSelectedElements();if(e&&e.length>0)for(var n,o,s=e.length-1;s>=0;s--)if(n=e[s].get_ObjectType(),o=e[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Shape==n){new PE.Views.ShapeSettingsAdvanced({shapeProps:o,handler:function(t,e){"ok"==t&&i.api&&i.api.ShapeApply(e.shapeProps),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Image Shape Advanced")}}).show();break}}}),g=new Common.UI.MenuItem({caption:i.advancedParagraphText}).on("click",function(t){if(i.api){var e=i.api.getSelectedElements();if(e&&e.length>0)for(var n,o,s=e.length-1;s>=0;s--)if(n=e[s].get_ObjectType(),o=e[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Paragraph==n){new PE.Views.ParagraphSettingsAdvanced({paragraphProps:o,api:i.api,handler:function(t,e){"ok"==t&&i.api&&i.api.paraApply(e.paragraphProps),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Image Paragraph Advanced")}}).show();break}}}),f=new Common.UI.MenuItem({caption:"--"}),b=new Common.UI.MenuItem({caption:i.hyperlinkText}).on("click",e.bind(i.addHyperlink,i)),C=new Common.UI.MenuItem({caption:i.editHyperlinkText}).on("click",e.bind(i.editHyperlink,i)),v=new Common.UI.MenuItem({caption:i.removeHyperlinkText}).on("click",function(t){i.api&&i.api.remove_Hyperlink(),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Remove Hyperlink")}),_=new Common.UI.MenuItem({caption:i.hyperlinkText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[C,v]})}),y=new Common.UI.MenuItem({caption:i.hyperlinkText}).on("click",e.bind(i.addHyperlink,i)),x=new Common.UI.MenuItem({caption:i.editHyperlinkText}).on("click",e.bind(i.editHyperlink,i)),w=new Common.UI.MenuItem({caption:i.removeHyperlinkText}).on("click",function(t){i.api&&i.api.remove_Hyperlink(),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Remove Hyperlink Table")}),S=new Common.UI.MenuItem({caption:i.hyperlinkText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[x,w]})}),T=new Common.UI.MenuItem({caption:"--"}),A=new Common.UI.MenuItem({caption:this.txtGroup,iconCls:"mnu-group"}).on("click",function(t){i.api&&i.api.groupShapes(),i.fireEvent("editcomplete",this),Common.component.Analytics.trackEvent("DocumentHolder","Group Image")}),k=new Common.UI.MenuItem({caption:this.txtUngroup,iconCls:"mnu-ungroup"}).on("click",function(t){i.api&&i.api.unGroupShapes(),i.fireEvent("editcomplete",this),Common.component.Analytics.trackEvent("DocumentHolder","Ungroup Image")}),I=new Common.UI.MenuItem({caption:i.txtArrange,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[new Common.UI.MenuItem({caption:this.textArrangeFront,iconCls:"mnu-arrange-front"}).on("click",function(t){i.api&&i.api.shapes_bringToFront(),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Bring To Front")}),new Common.UI.MenuItem({caption:this.textArrangeBack,iconCls:"mnu-arrange-back"}).on("click",function(t){i.api&&i.api.shapes_bringToBack(),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Bring To Back")}),new Common.UI.MenuItem({caption:this.textArrangeForward,iconCls:"mnu-arrange-forward"}).on("click",function(t){i.api&&i.api.shapes_bringForward(),i.fireEvent("editcomplete",i),Common.component.Analytics.trackEvent("DocumentHolder","Send ForLine truncated
|
||||||
|
LargeOperator_Intersection_CenterSubSup:84017158,LargeOperator_Intersection_SubSup:84017159,LargeOperator_Intersection_CenterSub:84017160,LargeOperator_Intersection_Sub:84017161,LargeOperator_Disjunction:84082688,LargeOperator_Disjunction_CenterSubSup:84082689,LargeOperator_Disjunction_SubSup:84082690,LargeOperator_Disjunction_CenterSub:84082691,LargeOperator_Disjunction_Sub:84082692,LargeOperator_Conjunction:84082693,LargeOperator_Conjunction_CenterSubSup:84082694,LargeOperator_Conjunction_SubSup:84082695,LargeOperator_Conjunction_CenterSub:84082696,LargeOperator_Conjunction_Sub:84082697,LargeOperator_Custom_1:84148224,LargeOperator_Custom_2:84148225,LargeOperator_Custom_3:84148226,LargeOperator_Custom_4:84148227,LargeOperator_Custom_5:84148228,Bracket_Round:100663296,Bracket_Square:100663297,Bracket_Curve:100663298,Bracket_Angle:100663299,Bracket_LowLim:100663300,Bracket_UppLim:100663301,Bracket_Line:100663302,Bracket_LineDouble:100663303,Bracket_Square_OpenOpen:100663304,Bracket_Square_CloseClose:100663305,Bracket_Square_CloseOpen:100663306,Bracket_SquareDouble:100663307,Bracket_Round_Delimiter_2:100728832,Bracket_Curve_Delimiter_2:100728833,Bracket_Angle_Delimiter_2:100728834,Bracket_Angle_Delimiter_3:100728835,Bracket_Round_OpenNone:100794368,Bracket_Round_NoneOpen:100794369,Bracket_Square_OpenNone:100794370,Bracket_Square_NoneOpen:100794371,Bracket_Curve_OpenNone:100794372,Bracket_Curve_NoneOpen:100794373,Bracket_Angle_OpenNone:100794374,Bracket_Angle_NoneOpen:100794375,Bracket_LowLim_OpenNone:100794376,Bracket_LowLim_NoneNone:100794377,Bracket_UppLim_OpenNone:100794378,Bracket_UppLim_NoneOpen:100794379,Bracket_Line_OpenNone:100794380,Bracket_Line_NoneOpen:100794381,Bracket_LineDouble_OpenNone:100794382,Bracket_LineDouble_NoneOpen:100794383,Bracket_SquareDouble_OpenNone:100794384,Bracket_SquareDouble_NoneOpen:100794385,Bracket_Custom_1:100859904,Bracket_Custom_2:100859905,Bracket_Custom_3:100859906,Bracket_Custom_4:100859907,Bracket_Custom_5:100925440,Bracket_Custom_6:100925441,Bracket_Custom_7:100925442,Function_Sin:117440512,Function_Cos:117440513,Function_Tan:117440514,Function_Csc:117440515,Function_Sec:117440516,Function_Cot:117440517,Function_1_Sin:117506048,Function_1_Cos:117506049,Function_1_Tan:117506050,Function_1_Csc:117506051,Function_1_Sec:117506052,Function_1_Cot:117506053,Function_Sinh:117571584,Function_Cosh:117571585,Function_Tanh:117571586,Function_Csch:117571587,Function_Sech:117571588,Function_Coth:117571589,Function_1_Sinh:117637120,Function_1_Cosh:117637121,Function_1_Tanh:117637122,Function_1_Csch:117637123,Function_1_Sech:117637124,Function_1_Coth:117637125,Function_Custom_1:117702656,Function_Custom_2:117702657,Function_Custom_3:117702658,Accent_Dot:134217728,Accent_DDot:134217729,Accent_DDDot:134217730,Accent_Hat:134217731,Accent_Check:134217732,Accent_Accent:134217733,Accent_Grave:134217734,Accent_Smile:134217735,Accent_Tilde:134217736,Accent_Bar:134217737,Accent_DoubleBar:134217738,Accent_CurveBracketTop:134217739,Accent_CurveBracketBot:134217740,Accent_GroupTop:134217741,Accent_GroupBot:134217742,Accent_ArrowL:134217743,Accent_ArrowR:134217744,Accent_ArrowD:134217745,Accent_HarpoonL:134217746,Accent_HarpoonR:134217747,Accent_BorderBox:134283264,Accent_BorderBoxCustom:134283265,Accent_BarTop:134348800,Accent_BarBot:134348801,Accent_Custom_1:134414336,Accent_Custom_2:134414337,Accent_Custom_3:134414338,LimitLog_LogBase:150994944,LimitLog_Log:150994945,LimitLog_Lim:150994946,LimitLog_Min:150994947,LimitLog_Max:150994948,LimitLog_Ln:150994949,LimitLog_Custom_1:151060480,LimitLog_Custom_2:151060481,Operator_ColonEquals:167772160,Operator_EqualsEquals:167772161,Operator_PlusEquals:167772162,Operator_MinusEquals:167772163,Operator_Definition:167772164,Operator_UnitOfMeasure:167772165,Operator_DeltaEquals:167772166,Operator_ArrowL_Top:167837696,Operator_ArrowR_Top:167837697,Operator_ArrowL_Bot:167837698,Operator_ArrowR_Bot:167837699,Operator_DoubleArrowL_Top:167837700,Operator_DoubleArrowR_Top:167837701,Operator_DoubleArrowL_Bot:167837702,Operator_DoubleArrowR_Bot:167837703,Operator_ArrowD_Top:167837704,Operator_ArrowD_Bot:167837705,Operator_DoubleArrowD_Top:167837706,Operator_DoubleArrowD_Bot:167837707,Operator_Custom_1:167903232,Operator_Custom_2:167903233,Matrix_1_2:184549376,Matrix_2_1:184549377,Matrix_1_3:184549378,Matrix_3_1:184549379,Matrix_2_2:184549380,Matrix_2_3:184549381,Matrix_3_2:184549382,Matrix_3_3:184549383,Matrix_Dots_Center:184614912,Matrix_Dots_Baseline:184614913,Matrix_Dots_Vertical:184614914,Matrix_Dots_Diagonal:184614915,Matrix_Identity_2:184680448,Matrix_Identity_2_NoZeros:184680449,Matrix_Identity_3:184680450,Matrix_Identity_3_NoZeros:184680451,Matrix_2_2_RoundBracket:184745984,Matrix_2_2_SquareBracket:184745985,Matrix_2_2_LineBracket:184745986,Matrix_2_2_DLineBracket:184745987,Matrix_Flat_Round:184811520,Matrix_Flat_Square:184811521}}),define("text!presentationeditor/main/app/template/Toolbar.template",[],function(){return'<div class="toolbar" style="<%=
Line truncated
|
||||||
|
Common.UI.Window.prototype.initialize.call(this,{cls:"extended-color-dlg",tpl:this.tpl({txtNew:this.textNew,txtCurrent:this.textCurrent,txtAdd:this.addButtonText,txtCancel:this.cancelButtonText}),header:!1,width:340,height:272}),this.hexRe=/\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/},render:function(){function t(t){e.trigger("onmodalresult",parseInt(t.currentTarget.attributes.result.value)),e.close(!0)}var e=this;return Common.UI.Window.prototype.render.call(this),this.colorsPicker=new Common.UI.HSBColorPicker({el:$("#id-hsb-colorpicker"),showCurrentColor:!1}),this.colorsPicker.on("changecolor",_.bind(this.onChangeColor,this)),this.colorNew=$("#field-new-color"),this.colorSaved=$("#field-start-color"),this.spinR=new Common.UI.MetricSpinner({el:$("#extended-spin-r"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:1,maskExp:/[0-9]/,allowDecimal:!1}),this.spinG=new Common.UI.MetricSpinner({el:$("#extended-spin-g"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:2,maskExp:/[0-9]/,allowDecimal:!1}),this.spinB=new Common.UI.MetricSpinner({el:$("#extended-spin-b"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:3,maskExp:/[0-9]/,allowDecimal:!1}),this.textColor=new Common.UI.MaskedField({el:$("#extended-text-color"),width:55,maskExp:/[a-fA-F0-9]/,maxLength:6}),this.spinR.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,1)),this.spinG.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,2)),this.spinB.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,3)),this.textColor.on("change",_.bind(this.onChangeMaskedField,this)),this.textColor.on("changed",_.bind(this.onChangedMaskedField,this)),this.textColor.$el.attr("tabindex",4),this.spinR.$el.find("input").attr("maxlength",3),this.spinG.$el.find("input").attr("maxlength",3),this.spinB.$el.find("input").attr("maxlength",3),this.on("close",function(){e.trigger("onmodalresult",0)}),$(this)[0].getChild(".footer .dlg-btn").on("click",t),this.rendered=!0,void 0!==this.color&&this.setColor(this.color),this},onChangeColor:function(t,e){this.colorNew.css({"background-color":e}),this.stopevents=!0;var i=e.match(this.hexRe);this.spinR.setValue(parseInt(i[1],16)),this.spinG.setValue(parseInt(i[2],16)),this.spinB.setValue(parseInt(i[3],16)),this.textColor.setValue((i[1]+i[2]+i[3]).toUpperCase()),this.stopevents=!1},showColor:function(t,e){if(!this.stopevents){var i=this.spinR.getNumberValue(),n=null==i||i<0?0:i>255?255:i;e&&this.spinR.setValue(n,!0),n=n.toString(16),i=this.spinG.getNumberValue();var o=null==i||i<0?0:i>255?255:i;e&&this.spinG.setValue(o,!0),o=o.toString(16),i=this.spinB.getNumberValue();var s=null==i||i<0?0:i>255?255:i;e&&this.spinB.setValue(s,!0),s=s.toString(16);var a=(1==n.length?"0"+n:n)+(1==o.length?"0"+o:o)+(1==s.length?"0"+s:s);this.colorsPicker.setColor("#"+a),"hex"!=t&&this.textColor.setValue(a.toUpperCase()),this.colorNew.css("background-color","#"+a)}},onChangingRGB:function(t,e,i,n){if(!this.stopevents){var o,s,a,r;switch(i=_.isEmpty(i)||isNaN(parseInt(i))?parseInt(e.getValue()):parseInt(i),t){case 1:o=(null==i||isNaN(i)||i<0?0:i>255?255:i).toString(16),r=this.spinG.getNumberValue(),s=(null==r||r<0?0:r>255?255:r).toString(16),r=this.spinB.getNumberValue(),a=(null==r||r<0?0:r>255?255:r).toString(16);break;case 2:r=this.spinR.getNumberValue(),o=(null==r||r<0?0:r>255?255:r).toString(16),s=(null==i||isNaN(i)||i<0?0:i>255?255:i).toString(16),r=this.spinB.getNumberValue(),a=(null==r||r<0?0:r>255?255:r).toString(16);break;case 3:r=this.spinR.getNumberValue(),o=(null==r||r<0?0:r>255?255:r).toString(16),r=this.spinG.getNumberValue(),s=(null==r||r<0?0:r>255?255:r).toString(16),a=(null==i||isNaN(i)||i<0?0:i>255?255:i).toString(16)}var l=(1==o.length?"0"+o:o)+(1==s.length?"0"+s:s)+(1==a.length?"0"+a:a);this.colorsPicker.setColor("#"+l),this.textColor.setValue(l.toUpperCase()),this.colorNew.css("background-color","#"+l)}},onChangeMaskedField:function(t,e){e=/^[a-fA-F0-9]{0,6}$/.test(e)?e:"000000",e="000000"+e;var i=e.match(/([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/i);this.stopevents=!0,this.spinR.setValue(parseInt(i[1],16)),this.spinG.setValue(parseInt(i[2],16)),this.spinB.setValue(parseInt(i[3],16)),this.stopevents=!1,this.rendered&&this.showColor("hex")},onChangedMaskedField:function(t,e){/^[a-fA-F0-9]{0,6}$/.test(e)&&!_.isEmpty(e)||t.setValue("000000"),this.rendered&&this.showColor("",!0)},getColor:function(){var t=/#?([a-fA-F0-9]{6})/.exec(this.colorsPicker.getColor());return t?t[1]:null},setColor:function(t){var e=this;if(!0!==this.rendered)return void(this.color=t);var i=/#?([a-fA-F0-9]{6})/.test(t)?t:"ff0000";e.colorsPicker.setColor("#"+i),function(){"transparent"==t?e.colorSaved.addClass("color-transparent"):(e.colorSaved.removeClass("color-transparent"),e.colorSaved.css("background-color","#"+t)),e.colorLine truncated
|
||||||
|
if(e.options.hint){var o=e.cmpEl.data("bs.tooltip");o&&(void 0===o.dontShow&&(o.dontShow=!0),o.hide())}this.menuPicker.selectedBeforeHideRec=null},onBeforeHideMenu:function(t){if(this.trigger("hide:before",this,t),Common.UI.Scroller.isMouseCapture()&&t.preventDefault(),this.isStylesNotClosable)return!1},onAfterShowMenu:function(t){var e=this;e.menuPicker.scroller&&e.menuPicker.scroller.update({includePadding:!0,suppressScrollX:!0,alwaysVisibleY:!0})},onAfterHideMenu:function(t,e){this.menuPicker.selectedBeforeHideRec=this.menuPicker.getSelectedRec()[0],this.showLast?this.menuPicker.showLastSelected():this.menuPicker.deselectAll(),this.trigger("hide:after",this,t,e)},onFieldPickerSelect:function(t,e,i){},onMenuPickerSelect:function(t,e,i,n){this.needFillComboView=this.disabled,this.disabled||!0===n||(this.fillComboView(i,!1),i&&!this.isSuspendEvents&&this.trigger("select",this,i))},onFieldPickerClick:function(t,e,i){if(!this.disabled){if(this.isSuspendEvents||this.trigger("click",this,i),this.options.hint){var n=this.cmpEl.data("bs.tooltip");n&&(void 0===n.dontShow&&(n.dontShow=!0),n.hide())}this.showLast||this.fieldPicker.deselectAll()}},onMenuPickerClick:function(t,e,i){this.disabled||this.isSuspendEvents||this.trigger("click",this,i)},onPickerItemContextMenu:function(t,e,i,n){if(!this.disabled)return this.isSuspendEvents||this.trigger("contextmenu",this,i,n),n.preventDefault(),n.stopPropagation(),!1},onPickerComboContextMenu:function(t){this.disabled||this.isSuspendEvents||this.trigger("contextmenu",this,void 0,t)},setDisabled:function(t){if(this.disabled=t,this.rendered&&(this.cmpEl.toggleClass("disabled",t),$("button",this.openButton.cmpEl).toggleClass("disabled",t),this.fieldPicker.setDisabled(t),this.needFillComboView&&!t)){var e=this.menuPicker;if(e){var i=e.getSelectedRec();i&&(i=i[0],this.fillComboView(i||e.store.at(0),!1))}}},isDisabled:function(){return this.disabled},fillComboView:function(t,e,i){if(!_.isUndefined(t)&&t instanceof Backbone.Model){this.needFillComboView=!1;var n=this,o=n.menuPicker.store,s=$(n.fieldPicker.el);if(o){if(i||!n.fieldPicker.store.findWhere({id:t.get("id")})){if(void 0===n.itemMarginLeft){var a=$($(this.menuPicker.el).find(".inner > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)")[0]);a.length>0&&(n.itemMarginLeft=parseInt(a.css("margin-left")),n.itemMarginRight=parseInt(a.css("margin-right")),n.itemPaddingLeft=parseInt(a.css("padding-left")),n.itemPaddingRight=parseInt(a.css("padding-right")),n.itemBorderLeft=parseInt(a.css("border-left-width")),n.itemBorderRight=parseInt(a.css("border-right-width")))}n.fieldPicker.store.reset([]);var r=o.indexOf(t),l=o.length,c=Math.floor(s.width()/(n.itemWidth+(n.itemMarginLeft||0)+(n.itemMarginRight||0)+(n.itemPaddingLeft||0)+(n.itemPaddingRight||0)+(n.itemBorderLeft||0)+(n.itemBorderRight||0))),h=[];if(s.height()/n.itemHeight>2&&(c*=Math.floor(s.height()/n.itemHeight)),r<0)return;r=Math.floor(r/c)*c,l-r<c&&(r=Math.max(l-c,0));for(var d=r,p=0;d<l&&p<c;d++,p++)h.push(o.at(d));n.fieldPicker.store.add(h)}if(e){var u=n.fieldPicker.store.findWhere({id:t.get("id")});u&&(n.suspendEvents(),n.fieldPicker.selectRecord(u,!0),n.resumeEvents())}}}},selectByIndex:function(t){t<0&&this.fieldPicker.deselectAll(),this.menuPicker.selectByIndex(t)},setItemWidth:function(t){this.itemWidth!=t&&(this.itemWidth=window.devicePixelRatio>1?t/2:t)},setItemHeight:function(t){this.itemHeight!=t&&(this.itemHeight=window.devicePixelRatio>1?t/2:t)},removeTips:function(){var t=this.menuPicker;_.each(t.dataViewItems,function(t){var e=t.$el.data("bs.tooltip");e&&e.tip().remove()},t)}})}),void 0===Common)var Common={};if(define("common/main/lib/component/SynchronizeTip",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.SynchronizeTip=Common.UI.BaseView.extend(_.extend(function(){var t;return{options:{target:$(document.body),text:"",placement:"right"},template:_.template(['<div class="synch-tip-root <%= scope.placement %>">','<div class="asc-synchronizetip">','<div class="tip-arrow <%= scope.placement %>"></div>',"<div>",'<div class="tip-text" style="width: 260px;"><%= scope.text %></div>','<div class="close img-commonctrl"></div>',"</div>",'<div class="show-link"><label><%= scope.textDontShow %></label></div>',"</div>","</div>"].join("")),initialize:function(t){this.textSynchronize+=Common.Utils.String.platformKey("Ctrl+S"),Common.UI.BaseView.prototype.initialize.call(this,t),this.target=this.options.target,this.text=_.isEmpty(this.options.text)?this.textSynchronize:this.options.text,this.placement=this.options.placement},render:function(){return t=$(this.template({scope:this})),t.find(".close").on("click",_.bind(function(){this.trigger("closeclick")},this)),t.find(".show-link label").on("click",_.bind(function(){this.trigger("dontshowclick")},this)),$(document.body).append(t),this.applyPlacement(),this},show:function(){t?(this.applyPlacement(),t.show()):this.render()},hide:function(){t&&t.hide()},applyPlacement:funLine truncated
|
||||||
|
i("#id-toolbar-"+e+"-placeholder-btn-preview",this.btnPreview),i("#id-toolbar-"+e+"-placeholder-btn-print",this.btnPrint),i("#id-toolbar-"+e+"-placeholder-btn-save",this.btnSave),i("#id-toolbar-"+e+"-placeholder-btn-undo",this.btnUndo),i("#id-toolbar-"+e+"-placeholder-btn-redo",this.btnRedo),i("#id-toolbar-"+e+"-placeholder-btn-copy",this.btnCopy),i("#id-toolbar-"+e+"-placeholder-btn-paste",this.btnPaste),i("#id-toolbar-"+e+"-placeholder-btn-bold",this.btnBold),i("#id-toolbar-"+e+"-placeholder-btn-italic",this.btnItalic),i("#id-toolbar-"+e+"-placeholder-btn-underline",this.btnUnderline),i("#id-toolbar-"+e+"-placeholder-btn-strikeout",this.btnStrikeout),i("#id-toolbar-"+e+"-placeholder-btn-superscript",this.btnSuperscript),i("#id-toolbar-"+e+"-placeholder-btn-subscript",this.btnSubscript),i("#id-toolbar-"+e+"-placeholder-btn-fontcolor",this.btnFontColor),i("#id-toolbar-"+e+"-placeholder-btn-clearstyle",this.btnClearStyle),i("#id-toolbar-"+e+"-placeholder-btn-copystyle",this.btnCopyStyle),i("#id-toolbar-"+e+"-placeholder-btn-markers",this.btnMarkers),i("#id-toolbar-"+e+"-placeholder-btn-numbering",this.btnNumbers),i("#id-toolbar-"+e+"-placeholder-btn-incoffset",this.btnIncLeftOffset),i("#id-toolbar-"+e+"-placeholder-btn-decoffset",this.btnDecLeftOffset),i("#id-toolbar-"+e+"-placeholder-btn-halign",this.btnHorizontalAlign),i("#id-toolbar-"+e+"-placeholder-btn-valign",this.btnVerticalAlign),i("#id-toolbar-"+e+"-placeholder-btn-linespace",this.btnLineSpace),i("#id-toolbar-"+e+"-placeholder-btn-arrange-shape",this.btnShapeArrange),i("#id-toolbar-"+e+"-placeholder-btn-align-shape",this.btnShapeAlign),i("#id-toolbar-"+e+"-placeholder-btn-insertshape",this.btnInsertShape),i("#id-toolbar-"+e+"-placeholder-btn-inserttext",this.btnInsertText),i("#id-toolbar-"+e+"-placeholder-btn-insertequation",this.btnInsertEquation),i("#id-toolbar-"+e+"-placeholder-btn-inserthyperlink",this.btnInsertHyperlink),i("#id-toolbar-"+e+"-placeholder-btn-inserttable",this.btnInsertTable),i("#id-toolbar-"+e+"-placeholder-btn-insertimage",this.btnInsertImage),i("#id-toolbar-"+e+"-placeholder-btn-insertchart",this.btnInsertChart),i("#id-toolbar-"+e+"-placeholder-btn-colorschemas",this.btnColorSchemas),i("#id-toolbar-"+e+"-placeholder-btn-slidesize",this.btnSlideSize),i("#id-toolbar-full-placeholder-field-styles",this.listTheme),i("#id-toolbar-"+e+"-placeholder-btn-hidebars",this.btnHide),i("#id-toolbar-"+e+"-placeholder-btn-settings",this.btnAdvSettings),i("#id-toolbar-full-placeholder-field-styles",this.listTheme)},createDelayedElements:function(){this.btnNewDocument.updateHint(this.tipNewDocument),this.btnOpenDocument.updateHint(this.tipOpenDocument),this.btnAddSlide.updateHint(this.tipAddSlide+Common.Utils.String.platformKey("Ctrl+M")),this.btnChangeSlide.updateHint(this.tipChangeSlide),this.btnPreview.updateHint(this.tipPreview),this.btnPrint.updateHint(this.tipPrint+Common.Utils.String.platformKey("Ctrl+P")),this.btnSave.updateHint(this.btnSaveTip),this.btnUndo.updateHint(this.tipUndo+Common.Utils.String.platformKey("Ctrl+Z")),this.btnRedo.updateHint(this.tipRedo+Common.Utils.String.platformKey("Ctrl+Y")),this.btnCopy.updateHint(this.tipCopy+Common.Utils.String.platformKey("Ctrl+C")),this.btnPaste.updateHint(this.tipPaste+Common.Utils.String.platformKey("Ctrl+V")),this.btnBold.updateHint(this.textBold+Common.Utils.String.platformKey("Ctrl+B")),this.btnItalic.updateHint(this.textItalic+Common.Utils.String.platformKey("Ctrl+I")),this.btnUnderline.updateHint(this.textUnderline+Common.Utils.String.platformKey("Ctrl+U")),this.btnStrikeout.updateHint(this.textStrikeout),this.btnSuperscript.updateHint(this.textSuperscript),this.btnSubscript.updateHint(this.textSubscript),this.btnFontColor.updateHint(this.tipFontColor),this.btnClearStyle.updateHint(this.tipClearStyle),this.btnCopyStyle.updateHint(this.tipCopyStyle+Common.Utils.String.platformKey("Ctrl+Shift+C")),this.btnMarkers.updateHint(this.tipMarkers),this.btnNumbers.updateHint(this.tipNumbers),this.btnHorizontalAlign.updateHint(this.tipHAligh),this.btnVerticalAlign.updateHint(this.tipVAligh),this.btnDecLeftOffset.updateHint(this.tipDecPrLeft+Common.Utils.String.platformKey("Ctrl+Shift+M")),this.btnIncLeftOffset.updateHint(this.tipIncPrLeft),this.btnLineSpace.updateHint(this.tipLineSpace),this.btnInsertTable.updateHint(this.tipInsertTable),this.btnInsertImage.updateHint(this.tipInsertImage),this.btnInsertChart.updateHint(this.tipInsertChart),this.btnInsertText.updateHint(this.tipInsertText),this.btnInsertEquation.updateHint(this.tipInsertEquation),this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink+Common.Utils.String.platformKey("Ctrl+K")),this.btnInsertShape.updateHint(this.tipInsertShape),this.btnColorSchemas.updateHint(this.tipColorSchemas),this.btnHide.updateHint(this.tipViewSettings),this.btnAdvSettings.updateHint(this.tipAdvSettings),this.btnShapeAlign.updateHint(this.tipShapeAlign),this.btnShapeArrange.updateHint(this.tipShapeArrange),this.btnSlideSize.updateHint(this.tipSlideSLine truncated
|
||||||
|
t.btnSuperscript.on("click",_.bind(this.onSuperscript,this)),t.btnSubscript.on("click",_.bind(this.onSubscript,this)),t.btnHorizontalAlign.menu.on("item:click",_.bind(this.onMenuHorizontalAlignSelect,this)),t.btnVerticalAlign.menu.on("item:click",_.bind(this.onMenuVerticalAlignSelect,this)),t.btnDecLeftOffset.on("click",_.bind(this.onDecOffset,this)),t.btnIncLeftOffset.on("click",_.bind(this.onIncOffset,this)),t.btnMarkers.on("click",_.bind(this.onMarkers,this)),t.btnNumbers.on("click",_.bind(this.onNumbers,this)),t.cmbFontName.on("selected",_.bind(this.onFontNameSelect,this)),t.cmbFontName.on("show:after",_.bind(this.onComboOpen,this,!0)),t.cmbFontName.on("hide:after",_.bind(this.onHideMenus,this)),t.cmbFontName.on("combo:blur",_.bind(this.onComboBlur,this)),t.cmbFontName.on("combo:focusin",_.bind(this.onComboOpen,this,!1)),t.cmbFontSize.on("selected",_.bind(this.onFontSizeSelect,this)),t.cmbFontSize.on("changed:before",_.bind(this.onFontSizeChanged,this,!0)),t.cmbFontSize.on("changed:after",_.bind(this.onFontSizeChanged,this,!1)),t.cmbFontSize.on("show:after",_.bind(this.onComboOpen,this,!0)),t.cmbFontSize.on("hide:after",_.bind(this.onHideMenus,this)),t.cmbFontSize.on("combo:blur",_.bind(this.onComboBlur,this)),t.cmbFontSize.on("combo:focusin",_.bind(this.onComboOpen,this,!1)),t.mnuMarkersPicker.on("item:click",_.bind(this.onSelectBullets,this,t.btnMarkers)),t.mnuNumbersPicker.on("item:click",_.bind(this.onSelectBullets,this,t.btnNumbers)),t.btnFontColor.on("click",_.bind(this.onBtnFontColor,this)),t.mnuFontColorPicker.on("select",_.bind(this.onSelectFontColor,this)),$("#id-toolbar-menu-new-fontcolor").on("click",_.bind(this.onNewFontColor,this)),t.btnLineSpace.menu.on("item:toggle",_.bind(this.onLineSpaceToggle,this)),t.btnShapeAlign.menu.on("item:click",_.bind(this.onShapeAlign,this)),t.btnShapeArrange.menu.on("item:click",_.bind(this.onShapeArrange,this)),t.btnInsertHyperlink.on("click",_.bind(this.onHyperlinkClick,this)),t.mnuTablePicker.on("select",_.bind(this.onTablePickerSelect,this)),t.btnInsertTable.menu.on("item:click",_.bind(this.onInsertTableClick,this)),t.btnInsertImage.menu.on("item:click",_.bind(this.onInsertImageClick,this)),t.btnInsertText.on("click",_.bind(this.onBtnInsertTextClick,this)),t.btnInsertText.menu.on("item:click",_.bind(this.onInsertTextClick,this)),t.btnInsertShape.menu.on("hide:after",_.bind(this.onInsertShapeHide,this)),t.btnClearStyle.on("click",_.bind(this.onClearStyleClick,this)),t.btnCopyStyle.on("toggle",_.bind(this.onCopyStyleToggle,this)),t.btnAdvSettings.on("click",_.bind(this.onAdvSettingsClick,this)),t.btnColorSchemas.menu.on("item:click",_.bind(this.onColorSchemaClick,this)),t.btnSlideSize.menu.on("item:click",_.bind(this.onSlideSize,this)),t.mnuInsertChartPicker.on("item:click",_.bind(this.onSelectChart,this)),t.listTheme.on("click",_.bind(this.onListThemeSelect,this)),t.mnuitemHideTitleBar.on("toggle",_.bind(this.onHideTitleBar,this)),t.mnuitemHideStatusBar.on("toggle",_.bind(this.onHideStatusBar,this)),t.mnuitemHideRulers.on("toggle",_.bind(this.onHideRulers,this)),t.btnFitPage.on("toggle",_.bind(this.onZoomToPageToggle,this)),t.btnFitWidth.on("toggle",_.bind(this.onZoomToWidthToggle,this)),t.mnuZoomIn.on("click",_.bind(this.onZoomInClick,this)),t.mnuZoomOut.on("click",_.bind(this.onZoomOutClick,this)),t.btnInsertEquation.on("click",_.bind(this.onInsertEquationClick,this))},setApi:function(t){this.api=t,this.toolbar.setApi(t),this.api.asc_registerCallback("asc_onFontSize",_.bind(this.onApiFontSize,this)),this.api.asc_registerCallback("asc_onBold",_.bind(this.onApiBold,this)),this.api.asc_registerCallback("asc_onItalic",_.bind(this.onApiItalic,this)),this.api.asc_registerCallback("asc_onUnderline",_.bind(this.onApiUnderline,this)),this.api.asc_registerCallback("asc_onStrikeout",_.bind(this.onApiStrikeout,this)),this.api.asc_registerCallback("asc_onVerticalAlign",_.bind(this.onApiVerticalAlign,this)),this.api.asc_registerCallback("asc_onCanUndo",_.bind(this.onApiCanRevert,this,"undo")),this.api.asc_registerCallback("asc_onCanRedo",_.bind(this.onApiCanRevert,this,"redo")),this.api.asc_registerCallback("asc_onPaintFormatChanged",_.bind(this.onApiStyleChange,this)),this.api.asc_registerCallback("asc_onListType",_.bind(this.onApiBullets,this)),this.api.asc_registerCallback("asc_canIncreaseIndent",_.bind(this.onApiCanIncreaseIndent,this)),this.api.asc_registerCallback("asc_canDecreaseIndent",_.bind(this.onApiCanDecreaseIndent,this)),this.api.asc_registerCallback("asc_onLineSpacing",_.bind(this.onApiLineSpacing,this)),this.api.asc_registerCallback("asc_onPrAlign",_.bind(this.onApiParagraphAlign,this)),this.api.asc_registerCallback("asc_onVerticalTextAlign",_.bind(this.onApiVerticalTextAlign,this)),this.api.asc_registerCallback("asc_onCanAddHyperlink",_.bind(this.onApiCanAddHyperlink,this)),this.api.asc_registerCallback("asc_onTextColor",_.bind(this.onApiTextColor,this)),this.api.asc_registerCallback("asc_onUpdateThemeIndex",_.bind(this.onApiUpdateThemeIndex,this)),Line truncated
|
||||||
|
n.toolbar.fireEvent("insertchart",n.toolbar))},onListThemeSelect:function(t,e){this._state.themeId=void 0,this.api&&this.api.ChangeTheme(e.get("themeId")),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Style")},onHideTitleBar:function(t,e){var i=this.getApplication().getController("Viewport").getView("Common.Views.Header");i&&i.setVisible(!e),Common.localStorage.setItem("pe-hidden-title",e?1:0),Common.NotificationCenter.trigger("layout:changed","header"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideStatusBar:function(t,e){var i=this.getApplication().getController("Statusbar").getView("Statusbar");i&&i.setVisible(!e),Common.localStorage.setItem("pe-hidden-status",e?1:0),Common.NotificationCenter.trigger("layout:changed","status"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideRulers:function(t,e){this.api&&this.api.asc_SetViewRulers(!e),Common.localStorage.setItem("pe-hidden-rulers",e?1:0),Common.NotificationCenter.trigger("layout:changed","rulers"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomToPageToggle:function(t,e){this.api&&(this._state.zoom_type=void 0,this._state.zoom_percent=void 0,e?this.api.zoomFitToPage():this.api.zoomCustomMode()),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomToWidthToggle:function(t,e){this.api&&(this._state.zoom_type=void 0,this._state.zoom_percent=void 0,e?this.api.zoomFitToWidth():this.api.zoomCustomMode()),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomInClick:function(t){this._state.zoom_type=void 0,this._state.zoom_percent=void 0,this.api&&this.api.zoomIn(),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomOutClick:function(t){this._state.zoom_type=void 0,this._state.zoom_percent=void 0,this.api&&this.api.zoomOut(),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},_clearBullets:function(){this.toolbar.btnMarkers.toggle(!1,!0),this.toolbar.btnNumbers.toggle(!1,!0),this.toolbar.mnuMarkersPicker.selectByIndex(0,!0),this.toolbar.mnuNumbersPicker.selectByIndex(0,!0)},_getApiTextSize:function(){var t=12,e=this.api.get_TextProps();return e&&e.get_TextPr&&(t=e.get_TextPr().get_FontSize()),t},onNewFontColor:function(t,e){this.toolbar.mnuFontColorPicker.addNewColor()},onSelectFontColor:function(t,e){this._state.clrtext=this._state.clrtext_asccolor=void 0;var i="object"==typeof e?e.color:e;this.toolbar.btnFontColor.currentColor=e,$(".btn-color-value-line",this.toolbar.btnFontColor.cmpEl).css("background-color","#"+i),this.toolbar.mnuFontColorPicker.currentColor=e,this.api&&this.api.put_TextColor(Common.Utils.ThemeColor.getRgbColor(e)),Common.component.Analytics.trackEvent("ToolBar","Text Color")},onBtnFontColor:function(){this.toolbar.mnuFontColorPicker.trigger("select",this.toolbar.mnuFontColorPicker,this.toolbar.mnuFontColorPicker.currentColor)},onApiTextColor:function(t){var e,i=this.toolbar.mnuFontColorPicker;t&&(e=t.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?{color:Common.Utils.ThemeColor.getHexColor(t.get_r(),t.get_g(),t.get_b()),effectValue:t.get_value()}:Common.Utils.ThemeColor.getHexColor(t.get_r(),t.get_g(),t.get_b()));var n=typeof e;if(n!==typeof this._state.clrtext||"object"==n&&(e.effectValue!==this._state.clrtext.effectValue||this._state.clrtext.color.indexOf(e.color)<0)||"object"!=n&&this._state.clrtext.indexOf(e)<0){if("object"==typeof e){for(var o=!1,s=0;s<10;s++)if(Common.Utils.ThemeColor.ThemeValues[s]==e.effectValue){i.select(e,!0),o=!0;break}o||i.clearSelection()}else i.select(e,!0);this._state.clrtext=e}this._state.clrtext_asccolor=t},fillAutoShapes:function(){for(var t=this,e=this.getApplication().getCollection("ShapeGroups"),i=0;i<e.length;i++){var n=e.at(i),o=new Common.UI.MenuItem({caption:n.get("groupName"),menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{template:_.template('<div id="id-toolbar-menu-shapegroup'+i+'" class="menu-shape" style="width: '+(n.get("groupWidth")-8)+'px; margin-left: 5px;"></div>')}]})});t.toolbar.btnInsertShape.menu.addItem(o);new Common.UI.DataView({el:$("#id-toolbar-menu-shapegroup"+i),store:n.get("groupStore"),parentMenu:o.menu,showLast:!1,itemTemplate:_.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')}).on("item:click",function(e,i,n,o){t.api&&(t._addAutoshape(!0,n.get("data").shapeType),t._isAddingShape=!0,t.toolbar.btnInsertText.pressed&&t.toolbar.btnInsertText.toggle(!1,!0),"click"!==o.type&&t.toolbar.btnInsertShape.menu.hide(),Common.NotificationCenter.trigger("edit:complete",t.toolbar,t.toolbar.btnInsertShape),Common.component.Analytics.trackEvent("ToolBar","Add Shape"))})}},fillTextArt:function(){var t=this;if(this.toolbar.mnuTextArtPicker){var e=this.getApplication().getCollection("Common.Collections.TextArt").models,i=this.toolbar.mnuTextArtPicker.store.length;if(i>0&&i==e.length){var n=this.toolbar.mnuTextArtPicker.store.models;_.each(e,function(t,e){n[Line truncated
|
||||||
|
maskExp:/[0-9]/,validation:function(e){return!!(/(^[0-9]+$)/.test(e)&&void 0!==(e=parseInt(e))&&e>0&&e<=t.pages.get("count"))||t.txtPageNumInvalid}}).on("keypress:after",function(e,i){if(i.keyCode===Common.UI.Keys.RETURN){var n=t.$el.find("#status-goto-box"),o=n.find("input[type=text]"),s=parseInt(o.val());return!s||s-- >t.pages.get("count")||s<0?(o.select(),!1):(n.focus(),n.parent().removeClass("open"),t.api.goToPage(s),t.api.asc_enableKeyEvents(!0),!1)}}).on("keyup:after",function(e,i){if(i.keyCode===Common.UI.Keys.ESC){var n=t.$el.find("#status-goto-box");return n.focus(),n.parent().removeClass("open"),t.api.asc_enableKeyEvents(!0),!1}});var e=this.$el.find("#status-goto-box");return e.on("click",function(){return!1}),e.parent().on("show.bs.dropdown",function(){t.txtGoToPage.setValue(t.api.getCurrentPage()+1),t.txtGoToPage.checkValidate();var e=t.txtGoToPage.$el.find("input");_.defer(function(){e.focus(),e.select()},100)}),e.parent().on("hide.bs.dropdown",function(){var e=t.$el.find("#status-goto-box");t.api&&e&&(e.focus(),e.parent().removeClass("open"),t.api.asc_enableKeyEvents(!0))}),this.btnPreview=new Common.UI.Button({el:$("#status-btn-preview",this.el),hint:this.tipPreview,hintAnchor:"top"}),this},setApi:function(t){return this.api=t,this.api&&(this.api.asc_registerCallback("asc_onCountPages",_.bind(i,this)),this.api.asc_registerCallback("asc_onCurrentPage",_.bind(n,this)),this.api.asc_registerCallback("asc_onAuthParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_registerCallback("asc_onParticipantsChanged",_.bind(this.onApiUsersChanged,this))),this},setMode:function(t){this.mode=t,this.$el.find(".el-edit")[this.mode.isEdit?"show":"hide"](),this.lblChangeRights[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.panelUsers[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"]()},setVisible:function(t){t?this.show():this.hide()},onUsersClick:function(){this.panelUsers.removeClass("open"),this.fireEvent("click:users",this)},onApiUsersChanged:function(t){var e=0;_.each(t,function(t){t.asc_getView()||e++}),this.panelUsers[e>1||this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.lblUserCount.css({"font-size":e>1?"11px":"14px","font-weight":e>1?"bold":"normal","margin-top":e>1?"0":"-1px"}),this.lblUserCount.text(e>1?e:"+"),$("#status-users-icon").css("margin-bottom",e>1?"0":"2px");var i=this.panelUsersBlock.data("bs.tooltip");i&&(i.options.title=e>1?this.tipViewUsers:this.tipAccessRights,i.setContent()),e>1?this.panelUsersBlock.attr("data-toggle","dropdown"):this.panelUsersBlock.removeAttr("data-toggle"),this.panelUsersBlock.toggleClass("dropdown-toggle",e>1),e>1?this.panelUsersBlock.off("click"):this.panelUsersBlock.on("click",_.bind(this.onUsersClick,this))},_onAddUser:function(t,e,i){this.panelUsersList&&(this.panelUsersList.find("ul").append(_.template(this.tplUser,{user:t,scope:this})),this.panelUsersList.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0}))},_onUsersChanged:function(t){void 0!=t.changed.online&&this.panelUsersList&&(this.panelUsersList.find("#status-chat-user-"+t.get("id"))[t.changed.online?"removeClass":"addClass"]("offline"),this.panelUsersList.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0}))},_onResetUsers:function(t,e){this.panelUsersList&&(this.panelUsersList.html(this.templateUserList({users:t.models,usertpl:this.tplUser,scope:this})),this.panelUsersList.scroller=new Common.UI.Scroller({el:$("#status-users-list ul"),useKeyboard:!0,minScrollbarLength:40,alwaysVisibleY:!0}))},getUserName:function(t){return Common.Utils.String.htmlEncode(t)},showStatusMessage:function(t){$("#status-label-action").text(t)},clearStatusMessage:function(){$("#status-label-action").text("")},pageIndexText:"Slide {0} of {1}",goToPageText:"Go to Slide",tipUsers:"Document is currently being edited by several users.",tipMoreUsers:"and %1 users.",tipShowUsers:"To see all users click the icon below.",tipFitPage:"Fit to Slide",tipFitWidth:"Fit to Width",tipZoomIn:"Zoom In",tipZoomOut:"Zoom Out",tipZoomFactor:"Magnification",txtPageNumInvalid:"Slide number invalid",tipPreview:"Start Slideshow",tipAccessRights:"Manage document access rights",tipViewUsers:"View users and manage document access rights",txAccessRights:"Change access rights"},PE.Views.Statusbar||{}))}),define("presentationeditor/main/app/controller/Statusbar",["core","presentationeditor/main/app/view/Statusbar"],function(){"use strict";PE.Controllers.Statusbar=Backbone.Controller.extend(_.extend({models:[],collections:[],views:["Statusbar"],initialize:function(){this.addListeners({Statusbar:{}}),this._state={zoom_type:void 0,zoom_percent:void 0}},events:function(){return{"click #btn-zoom-down":_.bind(this.zoomDocument,this,"down"),"click #btn-zoom-up":_.bind(this.zoomDocument,this,"up")}},onLaunch:function(){this.statusbar=this.createView("Statusbar",{storeUsers:this.gLine truncated
|
||||||
|
initialize:function(){this._initSettings=!0,this._state={Width:0,Height:0,DisabledControls:!1,isOleObject:!1},this.lockedControls=[],this._locked=!1,this._noApply=!1,this._originalProps=null,this.render(),this.labelWidth=e(this.el).find("#image-label-width"),this.labelHeight=e(this.el).find("#image-label-height")},render:function(){e(this.el).html(this.template({scope:this}))},setApi:function(t){return this.api=t,this},updateMetricUnit:function(){var t=Common.Utils.Metric.fnRecalcFromMM(this._state.Width);this.labelWidth[0].innerHTML=this.textWidth+": "+t.toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName(),t=Common.Utils.Metric.fnRecalcFromMM(this._state.Height),this.labelHeight[0].innerHTML=this.textHeight+": "+t.toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName()},createDelayedControls:function(){this.btnOriginalSize=new Common.UI.Button({el:e("#image-button-original-size")}),this.lockedControls.push(this.btnOriginalSize),this.btnInsertFromFile=new Common.UI.Button({el:e("#image-button-from-file")}),this.lockedControls.push(this.btnInsertFromFile),this.btnInsertFromUrl=new Common.UI.Button({el:e("#image-button-from-url")}),this.lockedControls.push(this.btnInsertFromUrl),this.btnEditObject=new Common.UI.Button({el:e("#image-button-edit-object")}),this.lockedControls.push(this.btnEditObject),this.btnOriginalSize.on("click",i.bind(this.setOriginalSize,this)),this.btnInsertFromFile.on("click",i.bind(function(t){this.api&&this.api.ChangeImageFromFile(),this.fireEvent("editcomplete",this)},this)),this.btnInsertFromUrl.on("click",i.bind(this.insertFromUrl,this)),this.btnEditObject.on("click",i.bind(function(t){this.api&&this.api.asc_startEditCurrentOleObject(),this.fireEvent("editcomplete",this)},this)),this.linkAdvanced=e("#image-advanced-link"),this.lblReplace=e("#image-lbl-replace"),e(this.el).on("click","#image-advanced-link",i.bind(this.openAdvancedSettings,this))},createDelayedElements:function(){this.createDelayedControls(),this.updateMetricUnit(),this._initSettings=!1},ChangeSettings:function(t){if(this._initSettings&&this.createDelayedElements(),this.disableControls(this._locked),t){this._originalProps=new Asc.asc_CImgProperty(t);var e=t.get_Width();Math.abs(this._state.Width-e)>.001&&(this.labelWidth[0].innerHTML=this.textWidth+": "+Common.Utils.Metric.fnRecalcFromMM(e).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName(),this._state.Width=e),e=t.get_Height(),Math.abs(this._state.Height-e)>.001&&(this.labelHeight[0].innerHTML=this.textHeight+": "+Common.Utils.Metric.fnRecalcFromMM(e).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName(),this._state.Height=e),this.btnOriginalSize.setDisabled(null===t.get_ImageUrl()||void 0===t.get_ImageUrl()||this._locked);var i=t.asc_getPluginGuid();if(e=null!==i&&void 0!==i,this._state.isOleObject!==e&&(this.btnInsertFromUrl.setVisible(!e),this.btnInsertFromFile.setVisible(!e),this.btnEditObject.setVisible(e),this.lblReplace.text(e?this.textEditObject:this.textInsert),this._state.isOleObject=e),this._state.isOleObject){var n=PE.getCollection("Common.Collections.Plugins").findWhere({guid:i});this.btnEditObject.setDisabled(null===n||void 0===n||this._locked)}else this.btnInsertFromUrl.setDisabled(null===i||this._locked),this.btnInsertFromFile.setDisabled(null===i||this._locked)}},setOriginalSize:function(){if(this.api){var t=this.api.get_OriginalSizeImage(),e=t.get_ImageWidth(),i=t.get_ImageHeight();this.labelWidth[0].innerHTML=this.textWidth+": "+Common.Utils.Metric.fnRecalcFromMM(e).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName(),this.labelHeight[0].innerHTML=this.textHeight+": "+Common.Utils.Metric.fnRecalcFromMM(i).toFixed(1)+" "+Common.Utils.Metric.getCurrentMetricName();var n=new Asc.asc_CImgProperty;n.put_Width(e),n.put_Height(i),this.api.ImgApply(n),this.fireEvent("editcomplete",this)}},insertFromUrl:function(){var t=this;new Common.Views.ImageFromUrlDialog({handler:function(e,n){if("ok"==e&&t.api){var o=n.replace(/ /g,"");if(!i.isEmpty(o)){var s=new Asc.asc_CImgProperty;s.put_ImageUrl(o),t.api.ImgApply(s)}}t.fireEvent("editcomplete",t)}}).show()},openAdvancedSettings:function(t){if(!this.linkAdvanced.hasClass("disabled")){var e=this;if(e.api&&!this._locked){var i=e.api.getSelectedElements();if(i&&i.length>0)for(var n,o,s=i.length-1;s>=0;s--)if(n=i[s].get_ObjectType(),o=i[s].get_ObjectValue(),Asc.c_oAscTypeSelectElement.Image==n){var a;e.btnOriginalSize.isDisabled()||(a=e.api.get_OriginalSizeImage())&&(a={width:a.get_ImageWidth(),height:a.get_ImageHeight()}),new PE.Views.ImageSettingsAdvanced({imageProps:o,sizeOriginal:a,handler:function(t,i){"ok"==t&&e.api&&e.api.ImgApply(i.imageProps),e.fireEvent("editcomplete",e)}}).show();break}}}},setLocked:function(t){this._locked=t},disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},textSize:"Size",textWidth:"Width",textHeightLine truncated
|
||||||
|
template:_.template(['<span class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">','<input type="text" class="form-control text">','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>','<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',"<% _.each(items, function(item) { %>",'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',"<span><%= item.displayValue %></span>","<% if (item.offsety!==undefined) { %>",'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" align="right" style="background-position: 0 -<%= item.offsety %>px;">',"<% } %>","</a></li>","<% }); %>","</ul>","</span>"].join("")),initialize:function(t){this.txtNoBorders=t.txtNoBorders||this.txtNoBorders;var e=Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt),i=[{displayValue:"0.5 "+e,value:.5,pxValue:.5,offsety:0},{displayValue:"1 "+e,value:1,pxValue:1,offsety:20},{displayValue:"1.5 "+e,value:1.5,pxValue:2,offsety:40},{displayValue:"2.25 "+e,value:2.25,pxValue:3,offsety:60},{displayValue:"3 "+e,value:3,pxValue:4,offsety:80},{displayValue:"4.5 "+e,value:4.5,pxValue:5,offsety:100},{displayValue:"6 "+e,value:6,pxValue:6,offsety:120}];!1!==t.allowNoBorders&&i.unshift({displayValue:this.txtNoBorders,value:0,pxValue:0}),Common.UI.ComboBox.prototype.initialize.call(this,_.extend({editable:!0,store:new Common.UI.BordersStore,data:i,menuStyle:"min-width: 150px;"},t))},render:function(t){return Common.UI.ComboBox.prototype.render.call(this,t),this},txtNoBorders:"No Borders"},Common.UI.ComboBorderSizeEditable||{})),Common.UI.ComboBorderType=Common.UI.ComboBorderSize.extend(_.extend({template:_.template(['<div class="input-group combobox combo-border-size input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">','<div class="form-control" style="<%= style %>"></div>','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>','<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">',"<% _.each(items, function(item) { %>",'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem" style="padding: 2px 0;">','<span style="margin-top: 0;"></span>',"<% if (item.offsety!==undefined) { %>",'<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" align="left" style="background-position: 0 -<%= item.offsety %>px;">',"<% } %>","</a></li>","<% }); %>","</ul>","</div>"].join("")),initialize:function(t){Common.UI.ComboBorderSize.prototype.initialize.call(this,_.extend({store:new Common.UI.BordersStore,data:[{value:Asc.c_oDashType.solid,offsety:140},{value:Asc.c_oDashType.sysDot,offsety:160},{value:Asc.c_oDashType.sysDash,offsety:180},{value:Asc.c_oDashType.dash,offsety:200},{value:Asc.c_oDashType.dashDot,offsety:220},{value:Asc.c_oDashType.lgDash,offsety:240},{value:Asc.c_oDashType.lgDashDot,offsety:260},{value:Asc.c_oDashType.lgDashDotDot,offsety:280}]},t))},render:function(t){return Common.UI.ComboBorderSize.prototype.render.call(this,t),this},updateFormControl:function(t){var e=$(this.el).find(".form-control");e[0].innerHTML="",e.removeClass("text").addClass("image"),e.css("background-position","0 -"+t.get("offsety")+"px")}},Common.UI.ComboBorderType||{}))}),define("presentationeditor/main/app/view/TableSettings",["text!presentationeditor/main/app/template/TableSettings.template","jquery","underscore","backbone","common/main/lib/component/Button","common/main/lib/component/CheckBox","common/main/lib/component/ThemeColorPalette","common/main/lib/component/ColorButton","common/main/lib/component/ComboBorderSize","common/main/lib/component/ComboDataView","common/main/lib/view/InsertTableDialog","presentationeditor/main/app/view/TableSettingsAdvanced"],function(t,e,i,n){"use strict";PE.Views.TableSettings=n.View.extend(i.extend({el:"#id-table-settings",template:i.template(t),events:{},options:{alias:"TableSettings"},initialize:function(){this._initSettings=!0,this._state={TemplateId:0,CheckHeader:!1,CheckTotal:!1,CheckBanded:!1,CheckFirst:!1,CheckLast:!1,CheckColBanded:!1,BackColor:"#000000",DisabledControls:!1},this.lockedControls=[],this._locked=!1,this._originalLook=new Asc.CTablePropLook,this._originalProps=null,this.CellBorders={},this.CellColor={Value:1,Color:"transparent"},this.BorderSize=1,this._noApply=!1,this.render()},onCheckTemplateChange:function(t,e,i,n,o){if(this.api){var s=new Asc.CTableProp,a=this._originalLook?this._originalLook:new Asc.CTablePropLook;switch(t){case 0:a.put_FirstRow("checked"==e.getValue());break;case 1:a.put_LastRow("checked"==e.getValue());break;case 2:a.put_BandHor("checked"==e.getValue());break;case 3:a.put_FirstCol("checked"==e.getValue());break;case 4Line truncated
|
||||||
|
template:e.template(['<div class="slider multi-slider">','<div class="track">','<div class="track-left"></div>','<div class="track-center""></div>','<div class="track-right" style=""></div>',"</div>","<% _.each(items, function(item) { %>",'<div class="thumb" style=""></div>',"<% }); %>","</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);e.width=e.options.width,e.minValue=e.options.minValue,e.maxValue=e.options.maxValue,e.delta=100/(e.maxValue-e.minValue),e.thumbs=[],e.options.el&&e.render()},render:function(t){var i=this;i.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({items:this.options.values})),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl));var n=this.cmpEl;n.find(".track-center").width(i.options.width-14),n.width(i.options.width);var o=function(t){t.preventDefault(),t.stopPropagation();var e=t.data,n=i.thumbs[e].value,a=e-1<0?0:i.thumbs[e-1].position,r=e+1<i.thumbs.length?i.thumbs[e+1].position:100,l=Math.max(a,Math.min(r,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100))),c=l/i.delta+i.minValue;i.setThumbPosition(e,l),i.thumbs[e].value=c,$(document).off("mouseup",o),$(document).off("mousemove",s),i._dragstart=void 0,i.trigger("changecomplete",i,c,n)},s=function(t){if(!i.disabled&&void 0!==i._dragstart){t.preventDefault(),t.stopPropagation();var e=t.data,n=i.thumbs[e].value,o=e-1<0?0:i.thumbs[e-1].position,s=e+1<i.thumbs.length?i.thumbs[e+1].position:100,a=Math.max(o,Math.min(s,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100))),r=a/i.delta+i.minValue;i.setThumbPosition(e,a),i.thumbs[e].value=r,Math.abs(r-n)>.001&&i.trigger("change",i,r,n)}},a=function(t){if(!i.disabled){var n=t.data,a=i.thumbs[n].thumb;i._dragstart=t.pageX*Common.Utils.zoom()-a.offset().left-a.width()/2,i.setActiveThumb(n),e.each(i.thumbs,function(t,e){n==e?t.thumb.css("z-index",500):t.thumb.css("z-index","")}),$(document).on("mouseup",null,n,o),$(document).on("mousemove",null,n,s)}},r=function(t){if(!i.disabled){var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left)/i.width*100))),n=l(e),o=i.thumbs[n].value,s=e/i.delta+i.minValue;i.setThumbPosition(n,e),i.thumbs[n].value=s,i.trigger("change",i,s,o),i.trigger("changecomplete",i,s,o)}},l=function(t){for(var e,n=100,o=0,s=i.thumbs.length,a=0;a<s;a++)if(e=Math.abs(i.thumbs[a].position-t),Math.abs(e<=n)){var r=i.thumbs[a+1],l=i.thumbs[a-1];if(void 0!==l&&t<l.position)continue;if(void 0!==r&&t>r.position)continue;o=a,n=e}return o};return this.$thumbs=n.find(".thumb"),e.each(this.$thumbs,function(t,e){var n=$(t);i.thumbs.push({thumb:n,index:e}),i.setValue(e,i.options.values[e]),n.on("mousedown",null,e,a)}),i.setActiveThumb(0,!0),i.rendered||n.on("mousedown",".track",r),i.rendered=!0,this},setActiveThumb:function(t,e){this.currentThumb=t,this.$thumbs.removeClass("active"),this.thumbs[t].thumb.addClass("active"),!0!==e&&this.trigger("thumbclick",this,t)},setThumbPosition:function(t,e){this.thumbs[t].position=e,this.thumbs[t].thumb.css({left:e+"%"})},setValue:function(t,e){this.thumbs[t].value=Math.max(this.minValue,Math.min(this.maxValue,e)),this.setThumbPosition(t,Math.round((e-this.minValue)*this.delta))},getValue:function(t){return this.thumbs[t].value},getValues:function(){var t=[];return e.each(this.thumbs,function(e){t.push(e.value)}),t},setDisabled:function(t){t!==this.disabled&&this.cmpEl.toggleClass("disabled",t),this.disabled=t}})}),void 0===Common)var Common={};define("common/main/lib/component/MultiSliderGradient",["common/main/lib/component/Slider","underscore"],function(t,e){"use strict";Common.UI.MultiSliderGradient=Common.UI.MultiSlider.extend({options:{width:100,minValue:0,maxValue:100,values:[0,100],colorValues:["#000000","#ffffff"],currentThumb:0},disabled:!1,template:e.template(['<div class="slider multi-slider-gradient">','<div class="track"></div>',"<% _.each(items, function(item) { %>",'<div class="thumb img-commonctrl" style="">','<div class="thumb-top"></div>','<div class="thumb-bottom"></div>',"</div>","<% }); %>","</div>"].join("")),initialize:function(t){this.styleStr="",Common.Utils.isChrome&&Common.Utils.chromeVersion<10||Common.Utils.isSafari&&Common.Utils.safariVersion<5.1?this.styleStr="-webkit-gradient(linear, left top, right top, color-stop({1}%,{0}), color-stop({3}%,{2})); /* Chrome,Safari4+ */":Common.Utils.isChrome||Common.Utils.isSafari?this.styleStr="-webkit-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isGecko?this.styleStr="-moz-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isOpera&&Common.Utils.operaVersion>11?this.styleStr="-o-linear-gradient(left, {0} {1}%, {2} {3}%)":Common.Utils.isIE&&(this.styleStr="-ms-linear-gradient(left, {0} {1}%, {2} {3}%)"),this.colorValues=this.options.colorValues,Common.UI.MultiSlider.prototype.initialize.call(this,t)},render:function(t){Common.UI.MultiSlider.prototype.render.call(tLine truncated
|
||||||
|
;this._state.StrokeColor=this.BorderColor.Color}if(this._state.StrokeType!==y||y==Asc.c_oAscStrokeType.STROKE_COLOR){if(y==Asc.c_oAscStrokeType.STROKE_COLOR){var x=_.get_width(),w=Math.abs(this._state.StrokeWidth-x)<.001&&!new RegExp(this.txtPt+"\\s*$").test(this.cmbBorderSize.getRawValue());if(Math.abs(this._state.StrokeWidth-x)>.001||w||(null===this._state.StrokeWidth||null===x)&&this._state.StrokeWidth!==x){this._state.StrokeWidth=x,null!==x&&(x=this._mm2pt(x));var S=null===x?x:i.find(this.cmbBorderSize.store.models,function(t){if(x<t.attributes.value+.01&&x>t.attributes.value-.01)return!0});S?this.cmbBorderSize.selectRecord(S):this.cmbBorderSize.setValue(null!==x?parseFloat(x.toFixed(2))+" "+this.txtPt:""),this.BorderSize=x}}else y==Asc.c_oAscStrokeType.STROKE_NONE?(this._state.StrokeWidth=0,this.BorderSize=this.cmbBorderSize.store.at(0).get("value"),this.cmbBorderSize.setValue(this.BorderSize)):(this._state.StrokeWidth=null,this.BorderSize=-1,this.cmbBorderSize.setValue(null));this._state.StrokeType=y}if(this._state.StrokeBorderType!==v&&(this.BorderType=this._state.StrokeBorderType=v,this.cmbBorderType.setValue(v)),g=typeof this.FGColor.Color,f=typeof this._state.FGColor,g!==f||"object"==g&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||"object"!=g&&this._state.FGColor.indexOf(this.FGColor.Color)<0){if(this.btnFGColor.setColor(this.FGColor.Color),"object"==typeof this.FGColor.Color){for(var b=!1,C=0;C<10;C++)if(Common.Utils.ThemeColor.ThemeValues[C]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),b=!0;break}b||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}if(g=typeof this.BGColor.Color,f=typeof this._state.BGColor,g!==f||"object"==g&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||"object"!=g&&this._state.BGColor.indexOf(this.BGColor.Color)<0){if(this.btnBGColor.setColor(this.BGColor.Color),"object"==typeof this.BGColor.Color){for(var b=!1,C=0;C<10;C++)if(Common.Utils.ThemeColor.ThemeValues[C]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),b=!0;break}b||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGColor.Color}if(r=this.GradColor.colors[this.GradColor.currentIdx],g=typeof r,f=typeof this._state.GradColor,g!==f||"object"==g&&(r.effectValue!==this._state.GradColor.effectValue||this._state.GradColor.color.indexOf(r.color)<0)||"object"!=g&&this._state.GradColor.indexOf(r)<0){if(this.btnGradColor.setColor(r),"object"==typeof r){for(var b=!1,C=0;C<10;C++)if(Common.Utils.ThemeColor.ThemeValues[C]==r.effectValue){this.colorsGrad.select(r,!0),b=!0;break}b||this.colorsGrad.clearSelection()}else this.colorsGrad.select(r,!0);this._state.GradColor=r}this._noApply=!1}},createDelayedControls:function(){var t=this;this._arrFillSrc=[{displayValue:this.textColor,value:Asc.c_oAscFill.FILL_TYPE_SOLID},{displayValue:this.textGradientFill,value:Asc.c_oAscFill.FILL_TYPE_GRAD},{displayValue:this.textImageTexture,value:Asc.c_oAscFill.FILL_TYPE_BLIP},{displayValue:this.textPatternFill,value:Asc.c_oAscFill.FILL_TYPE_PATT},{displayValue:this.textNoFill,value:Asc.c_oAscFill.FILL_TYPE_NOFILL}],this.cmbFillSrc=new Common.UI.ComboBox({el:e("#shape-combo-fill-src"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrFillSrc}),this.cmbFillSrc.setValue(this._arrFillSrc[0].value),this.cmbFillSrc.on("selected",i.bind(this.onFillSrcSelect,this)),this.fillControls.push(this.cmbFillSrc),this.cmbPattern=new Common.UI.ComboDataView({itemWidth:28,itemHeight:28,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-pattern"}),this.cmbPattern.menuPicker.itemTemplate=this.cmbPattern.fieldPicker.itemTemplate=i.template(['<div class="style" id="<%= id %>">','<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="combo-pattern-item" ','width="'+this.cmbPattern.itemWidth+'" height="'+this.cmbPattern.itemHeight+'" ','style="background-position: -<%= offsetx %>px -<%= offsety %>px;"/>',"</div>"].join("")),this.cmbPattern.render(e("#shape-combo-pattern")),this.cmbPattern.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbPattern.on("click",i.bind(this.onPatternSelect,this)),this.cmbPattern.openButton.menu.on("show:after",function(){t.cmbPattern.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.fillControls.push(this.cmbPattern),this.btnInsertFromFile=new Common.UI.Button({el:e("#shape-button-from-file")}),this.fillControls.push(this.btnInsertFromFile),this.btnInsertFromUrl=new Common.UI.Button({el:e("#shape-button-from-url")}),this.fillControls.push(this.btnInsertFromUrl),this.btnInsertFromFile.on("click",i.bind(function(t){this.api&&this.api.ChangeShapeImageFromFile(),this.fireEvent("editcompLine truncated
|
||||||
|
value:Asc.c_oAscSlideTransitionParams.Clock_Clockwise},{displayValue:this.textCounterclockwise,value:Asc.c_oAscSlideTransitionParams.Clock_Counterclockwise},{displayValue:this.textWedge,value:Asc.c_oAscSlideTransitionParams.Clock_Wedge},{displayValue:this.textZoomIn,value:Asc.c_oAscSlideTransitionParams.Zoom_In},{displayValue:this.textZoomOut,value:Asc.c_oAscSlideTransitionParams.Zoom_Out},{displayValue:this.textZoomRotate,value:Asc.c_oAscSlideTransitionParams.Zoom_AndRotate}],this.cmbEffectType=new Common.UI.ComboBox({el:e("#slide-combo-effect-type"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrEffectType,disabled:!0}),this.cmbEffectType.setValue(""),this.cmbEffectType.on("selected",i.bind(this.onEffectTypeSelect,this)),this.numDuration=new Common.UI.MetricSpinner({el:e("#slide-spin-duration"),step:1,width:65,value:"",defaultUnit:this.textSec,maxValue:300,minValue:0,disabled:!0}),this.numDuration.on("change",i.bind(this.onDurationChange,this)),this.numDelay=new Common.UI.MetricSpinner({el:e("#slide-spin-delay"),step:1,width:70,value:"",defaultUnit:this.textSec,maxValue:300,minValue:0,disabled:!0}),this.numDelay.on("change",i.bind(this.onDelayChange,this)),this.chStartOnClick=new Common.UI.CheckBox({el:e("#slide-checkbox-start-click"),labelText:this.strStartOnClick,disabled:!0}),this.chStartOnClick.on("change",i.bind(this.onStartOnClickChange,this)),this.chDelay=new Common.UI.CheckBox({el:e("#slide-checkbox-delay"),labelText:this.strDelay,disabled:!0}),this.chDelay.on("change",i.bind(this.onCheckDelayChange,this)),this.btnPreview=new Common.UI.Button({el:e("#slide-button-preview"),disabled:!0}),this.btnPreview.on("click",i.bind(function(t){this.api&&this.api.SlideTransitionPlay(),this.fireEvent("editcomplete",this)},this)),this.btnApplyToAll=new Common.UI.Button({el:e("#slide-button-apply-all"),disabled:!0}),this.btnApplyToAll.on("click",i.bind(function(t){this.api&&this.api.SlideTimingApplyToAll(),this.fireEvent("editcomplete",this)},this))},render:function(){e(this.el).html(this.template({scope:this}))},setApi:function(t){return this.api=t,this.api&&(this.api.SetInterfaceDrawImagePlaceSlide("slide-texture-img"),this.api.asc_registerCallback("asc_onInitStandartTextures",i.bind(this.onInitStandartTextures,this))),this},onFillSrcSelect:function(t,e){switch(this.ShowHideElem(e.value),e.value){case Asc.c_oAscFill.FILL_TYPE_SOLID:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_SOLID,!this._noApply){var i=new Asc.CAscSlideProps,n=new Asc.asc_CShapeFill;n.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID),n.put_fill(new Asc.asc_CFillSolid),n.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor("transparent"==this.SlideColor.Color?{color:"4f81bd",effectId:24}:this.SlideColor.Color)),i.put_background(n),this.api.SetSlideProps(i)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD,!this._noApply){var i=new Asc.CAscSlideProps,n=new Asc.asc_CShapeFill;if(n.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),n.put_fill(new Asc.asc_CFillGrad),n.get_fill().put_grad_type(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.get_fill().put_linear_angle(6e4*this.GradLinearDirectionType),n.get_fill().put_linear_scale(!0)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var o=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();o="ffffff"===o&&"ffffff"===s?{color:"4f81bd",effectId:24}:this.GradColor.colors[0],n.get_fill().put_positions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]]),n.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(o),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}i.put_background(n),this.api.SetSlideProps(i)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT,!this._noApply){var i=new Asc.CAscSlideProps,n=new Asc.asc_CShapeFill;n.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),n.put_fill(new Asc.asc_CFillHatch),n.get_fill().put_pattern_type(this.PatternFillType);var a=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();a="ffffff"===Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex()&&"ffffff"===a?{color:"4f81bd",effectId:24}:this.FGColor.Color,n.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(a)),n.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),i.put_background(n),this.api.SetSlideProps(i)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL,!this._noApply){var i=new Asc.CAscSlideProps,n=new Asc.asc_CShapeFill;n.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.put_fill(null),i.put_background(n),this.api.SetSlideProps(i)}}this.fireEvent("editcomplete",this)},onColorsBackSelect:functionLine truncated
|
||||||
|
;var p=typeof this.SlideColor.Color,u=typeof this._state.SlideColor;if(p!==u||"object"==p&&(this.SlideColor.Color.effectValue!==this._state.SlideColor.effectValue||this._state.SlideColor.color.indexOf(this.SlideColor.Color.color)<0)||"object"!=p&&this._state.SlideColor.indexOf(this.SlideColor.Color)<0){if(this.btnBackColor.setColor(this.SlideColor.Color),"object"==typeof this.SlideColor.Color){for(var m=!1,g=0;g<10;g++)if(Common.Utils.ThemeColor.ThemeValues[g]==this.SlideColor.Color.effectValue){this.colorsBack.select(this.SlideColor.Color,!0),m=!0;break}m||this.colorsBack.clearSelection()}else this.colorsBack.select(this.SlideColor.Color,!0);this._state.SlideColor=this.SlideColor.Color}var f=t.get_timing();if(f){var r=f.get_TransitionType(),b=!1;if(this._state.Effect!==r){var C=this.cmbEffectName.store.findWhere({value:r});C?(b=!0,this.cmbEffectName.setValue(C.get("value"))):this.cmbEffectName.setValue(""),this.fillEffectTypeCombo(b?r:void 0),this.Effect=r,this._state.Effect=r}r=f.get_TransitionOption(),(this._state.EffectType!==r||b)&&(b=!1,C=this.cmbEffectType.store.findWhere({value:r}),C?(b=!0,this.cmbEffectType.setValue(C.get("value"))):this.cmbEffectType.setValue(""),this._state.EffectType=r),r=f.get_TransitionDuration(),(Math.abs(this._state.Duration-r)>.001||(null===this._state.Duration||null===r)&&this._state.Duration!==r||(void 0===this._state.Duration||void 0===r)&&this._state.Duration!==r)&&(this.numDuration.setValue(null!==r&&void 0!==r?r/1e3:"",!0),this._state.Duration=r),r=f.get_SlideAdvanceDuration(),(Math.abs(this._state.Delay-r)>.001||(null===this._state.Delay||null===r)&&this._state.Delay!==r||(void 0===this._state.Delay||void 0===r)&&this._state.Delay!==r)&&(this.numDelay.setValue(null!==r&&void 0!==r?r/1e3:"",!0),this._state.Delay=r),r=f.get_SlideAdvanceOnMouseClick(),this._state.OnMouseClick!==r&&(this.chStartOnClick.setValue(null!==r&&void 0!==r?r:"indeterminate",!0),this._state.OnMouseClick=r),r=f.get_SlideAdvanceAfter(),this._state.AdvanceAfter!==r&&(this.chDelay.setValue(null!==r&&void 0!==r?r:"indeterminate",!0),this.numDelay.setDisabled("checked"!==this.chDelay.getValue()),this._state.AdvanceAfter=r)}if(p=typeof this.FGColor.Color,u=typeof this._state.FGColor,p!==u||"object"==p&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||"object"!=p&&this._state.FGColor.indexOf(this.FGColor.Color)<0){if(this.btnFGColor.setColor(this.FGColor.Color),"object"==typeof this.FGColor.Color){for(var m=!1,g=0;g<10;g++)if(Common.Utils.ThemeColor.ThemeValues[g]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),m=!0;break}m||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}if(p=typeof this.BGColor.Color,u=typeof this._state.BGColor,p!==u||"object"==p&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||"object"!=p&&this._state.BGColor.indexOf(this.BGColor.Color)<0){if(this.btnBGColor.setColor(this.BGColor.Color),"object"==typeof this.BGColor.Color){for(var m=!1,g=0;g<10;g++)if(Common.Utils.ThemeColor.ThemeValues[g]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),m=!0;break}m||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGColor.Color}if(s=this.GradColor.colors[this.GradColor.currentIdx],p=typeof s,u=typeof this._state.GradColor,p!==u||"object"==p&&(s.effectValue!==this._state.GradColor.effectValue||this._state.GradColor.color.indexOf(s.color)<0)||"object"!=p&&this._state.GradColor.indexOf(s)<0){if(this.btnGradColor.setColor(s),"object"==typeof s){for(var m=!1,g=0;g<10;g++)if(Common.Utils.ThemeColor.ThemeValues[g]==s.effectValue){this.colorsGrad.select(s,!0),m=!0;break}m||this.colorsGrad.clearSelection()}else this.colorsGrad.select(s,!0);this._state.GradColor=s}this._noApply=!1}},SetSlideDisabled:function(t,e,i){if(!this._initSettings){if(t!==this._stateDisabled.background){this.cmbFillSrc.setDisabled(t);for(var n=0;n<this.FillItems.length;n++)this.FillItems[n].setDisabled(t);this._stateDisabled.background=t}if(e!==this._stateDisabled.effects){var o=this.cmbEffectType.store.length;this.cmbEffectName.setDisabled(e),this.cmbEffectType.setDisabled(o<1||e),this.numDuration.setDisabled(o<1||e),this.btnPreview.setDisabled(o<1||e),this._stateDisabled.effects=e}i!==this._stateDisabled.timing&&(this.chStartOnClick.setDisabled(i),this.chDelay.setDisabled(i),this.numDelay.setDisabled(i||"checked"!==this.chDelay.getValue()),this.btnApplyToAll.setDisabled(i),this._stateDisabled.timing=i)}},strColor:"Color",strFill:"Fill",textColor:"Color Fill",textImageTexture:"Picture or Texture",textTexture:"From Texture",textFromUrl:"From URL",textFromFile:"From File",textStretch:"Stretch",textTile:"Tile",txtCanvas:"Canvas",txtCarton:"Carton",txtDarkFabric:"Dark Fabric",txtGrain:"Grain",tLine truncated
|
||||||
|
if(null===s||void 0===s||null===a)this.OriginalFillType=null;else if(a==Asc.c_oAscFill.FILL_TYPE_NOFILL)this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_NOFILL;else if(a==Asc.c_oAscFill.FILL_TYPE_SOLID)s=s.get_fill(),r=s.get_color(),r?r.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.ShapeColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()),effectValue:r.get_value()}}:this.ShapeColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b())}:this.ShapeColor={Value:0,Color:"transparent"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_SOLID,this.FGColor="transparent"!==this.ShapeColor.Color?{Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.ShapeColor.Color)}:{Value:1,Color:"000000"},this.BGColor={Value:1,Color:"ffffff"},this.GradColor.colors[0]="transparent"!==this.ShapeColor.Color?Common.Utils.ThemeColor.colorValue2EffectId(this.ShapeColor.Color):"000000",this.GradColor.colors[1]="ffffff";else if(a==Asc.c_oAscFill.FILL_TYPE_BLIP)s=s.get_fill(),this.BlipFillType=s.get_type(),this._state.BlipFillType!==this.BlipFillType&&(this.BlipFillType==Asc.c_oAscFillBlipType.STRETCH||this.BlipFillType==Asc.c_oAscFillBlipType.TILE?this.cmbFillType.setValue(this.BlipFillType):this.cmbFillType.setValue(""),this._state.BlipFillType=this.BlipFillType),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_BLIP;else if(a==Asc.c_oAscFill.FILL_TYPE_PATT){if(s=s.get_fill(),this.PatternFillType=s.get_pattern_type(),this._state.PatternFillType!==this.PatternFillType){this.cmbPattern.suspendEvents();var o=this.cmbPattern.menuPicker.store.findWhere({type:this.PatternFillType});this.cmbPattern.menuPicker.selectRecord(o),this.cmbPattern.resumeEvents(),this._state.PatternFillType=this.PatternFillType}r=s.get_color_fg(),r?r.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.FGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()),effectValue:r.get_value()}}:this.FGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b())}:this.FGColor={Value:1,Color:"000000"},r=s.get_color_bg(),r?r.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()),effectValue:r.get_value()}}:this.BGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b())}:this.BGColor={Value:1,Color:"ffffff"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_PATT,this.ShapeColor={Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color)},this.GradColor.colors[0]=Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color),this.GradColor.colors[1]="ffffff"}else if(a==Asc.c_oAscFill.FILL_TYPE_GRAD){s=s.get_fill();var c=s.get_grad_type();if(this._state.GradFillType===c&&this.GradFillType===c||(this.GradFillType=c,o=void 0,this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR||this.GradFillType==Asc.c_oAscFillGradType.GRAD_PATH?(this.cmbGradType.setValue(this.GradFillType),o=this.cmbGradType.store.findWhere({value:this.GradFillType}),this.onGradTypeSelect(this.cmbGradType,o.attributes)):(this.cmbGradType.setValue(""),this.btnDirection.setIconCls("")),this._state.GradFillType=this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var h=Math.floor(s.get_linear_angle()/6e4);if(Math.abs(this.GradLinearDirectionType-h)>.001){this.GradLinearDirectionType=h;var d=this.mnuDirectionPicker.store.findWhere({type:h});this.mnuDirectionPicker.selectRecord(d,!0),d?this.btnDirection.setIconCls("item-gradient "+d.get("iconcls")):this.btnDirection.setIconCls("")}}var p=s.get_colors();p&&p.length>0&&(r=p[0],r?r.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[0]={color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()),effectValue:r.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0])):this.GradColor.colors[0]=Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()):this.GradColor.colors[0]="000000",r=p[1],r?r.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[1]={color:Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()),effectValue:r.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[1])):this.GradColor.colors[1]=Common.Utils.ThemeColor.getHexColor(r.get_r(),r.get_g(),r.get_b()):this.GradColor.colors[1]="ffffff");var u=s.get_positions();if(u&&u.length>0){var m=u[0];null!==m&&(m/=1e3,this.GradColor.values[0]=m),m=u[1],null!==m&&(m/=1e3,this.GradColor.values[1]=m)}this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}","object"==typeof this.GradColor.colors[0]?this.GradColor.colors[0].color:this.GradColor.colors[0]),0),this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}","object"==typeof this.GradColor.colors[1]?this.GradColor.colors[1].color:this.GradColor.colors[1]),1),this.sldrGradient.setValue(0,this.GradColor.values[0]),this.sldrGradient.setValLine truncated
|
||||||
|
;this.trigger("render:before",this);var n=Common.localStorage.getItem("pe-hide-right-settings");return n=null===n||0==parseInt(n),t.css("width",(n?MENU_SCALE_PART:SCALE_MIN)+"px"),t.show(),t.html(this.template({})),this.btnText.el=e("#id-right-menu-text"),this.btnText.render(),this.btnTable.el=e("#id-right-menu-table"),this.btnTable.render(),this.btnImage.el=e("#id-right-menu-image"),this.btnImage.render(),this.btnSlide.el=e("#id-right-menu-slide"),this.btnSlide.render(),this.btnChart.el=e("#id-right-menu-chart"),this.btnChart.render(),this.btnShape.el=e("#id-right-menu-shape"),this.btnShape.render(),this.btnTextArt.el=e("#id-right-menu-textart"),this.btnTextArt.render(),this.btnText.on("click",i.bind(this.onBtnMenuClick,this)),this.btnTable.on("click",i.bind(this.onBtnMenuClick,this)),this.btnImage.on("click",i.bind(this.onBtnMenuClick,this)),this.btnSlide.on("click",i.bind(this.onBtnMenuClick,this)),this.btnChart.on("click",i.bind(this.onBtnMenuClick,this)),this.btnShape.on("click",i.bind(this.onBtnMenuClick,this)),this.btnTextArt.on("click",i.bind(this.onBtnMenuClick,this)),this.paragraphSettings=new PE.Views.ParagraphSettings,this.slideSettings=new PE.Views.SlideSettings,this.imageSettings=new PE.Views.ImageSettings,this.chartSettings=new PE.Views.ChartSettings,this.tableSettings=new PE.Views.TableSettings,this.shapeSettings=new PE.Views.ShapeSettings,this.textartSettings=new PE.Views.TextArtSettings,i.isUndefined(this.scroller)&&(this.scroller=new Common.UI.Scroller({el:e(this.el).find(".right-panel"),suppressScrollX:!0,useKeyboard:!1})),n&&(e("#id-slide-settings").parent().css("display","inline-block"),e("#id-slide-settings").addClass("active")),this.trigger("render:after",this),this},setApi:function(t){this.api=t;var e=function(){this.fireEvent("editcomplete",this)};this.paragraphSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.slideSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.imageSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.chartSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.tableSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.shapeSettings.setApi(t).on("editcomplete",i.bind(e,this)),this.textartSettings.setApi(t).on("editcomplete",i.bind(e,this))},setMode:function(t){},onBtnMenuClick:function(t,i){var n=e("#"+this._settings[t.options.asctype].panel),o=n.parent();t.pressed?(this.minimizedMode&&(e(this.el).width(MENU_SCALE_PART),o.css("display","inline-block"),this.minimizedMode=!1,Common.localStorage.setItem("pe-hide-right-settings",0)),o.find("> .active").removeClass("active"),n.addClass("active"),this.scroller&&this.scroller.scrollTop(0),this._settings[Common.Utils.documentSettingsType.Slide].isCurrent=t.options.asctype==Common.Utils.documentSettingsType.Slide):(o.css("display","none"),e(this.el).width(SCALE_MIN),this.minimizedMode=!0,Common.localStorage.setItem("pe-hide-right-settings",1)),this.fireEvent("rightmenuclick",[this,t.options.asctype,this.minimizedMode])},SetActivePane:function(t,i){if(!(this.minimizedMode&&!0!==i||void 0===this._settings[t]))if(this.minimizedMode)this._settings[t].btn.toggle(!0,!1),this._settings[t].btn.trigger("click",this._settings[t].btn);else{var n=e("#"+this._settings[t].panel);n.hasClass("active")||(n.parent().find("> .active").removeClass("active"),n.addClass("active"),this.scroller&&this.scroller.update()),this._settings[t].btn.isActive()||this._settings[t].btn.toggle(!0,!1)}},GetActivePane:function(){return this.minimizedMode?null:this.$el.find(".settings-panel.active")[0].id},SetDisabled:function(t,i,n){if(n)this.slideSettings.SetSlideDisabled(i,i,i),this.paragraphSettings.disableControls(i),this.shapeSettings.disableControls(i),this.tableSettings.disableControls(i),this.imageSettings.disableControls(i),this.chartSettings.disableControls(i);else{var o=e("#"+t);i!==o.hasClass("disabled")&&(o.toggleClass("disabled",i),i?o.attr({disabled:i}):o.removeAttr("disabled"))}},clearSelection:function(){var t=e(".right-panel");t.find("> .active").removeClass("active"),this._settings.forEach(function(t){t.btn.isActive()&&t.btn.toggle(!1,!0)}),t.css("display","none"),e(this.el).width(SCALE_MIN),this.minimizedMode=!0,Common.NotificationCenter.trigger("layout:changed","rightmenu")},txtParagraphSettings:"Text Settings",txtImageSettings:"Image Settings",txtTableSettings:"Table Settings",txtShapeSettings:"Shape Settings",txtTextArtSettings:"Text Art Settings",txtSlideSettings:"Slide Settings",txtChartSettings:"Chart Settings"},PE.Views.RightMenu||{}))}),define("presentationeditor/main/app/controller/RightMenu",["core","presentationeditor/main/app/view/RightMenu"],function(){"use strict";PE.Controllers.RightMenu=Backbone.Controller.extend({models:[],collections:[],views:["RightMenu"],initialize:function(){this.editMode=!0,this._state={no_slides:void 0},this.addListeners({RightMenu:{rightmenuclick:this.onRightMenuClick}})},onLaunch:function(){this.rightmenu=this.createView("RightMenu"),this.rightmenu.on("render:after",_.bLine truncated
|
||||||
|
return'<div id="<%=id%>" class="user-comment-item">\r\n\r\n \x3c!-- comment block --\x3e\r\n\r\n <div class="user-name"><%=scope.getUserName(username)%></div>\r\n <div class="user-date"><%=date%></div>\r\n <% if (!editTextInPopover || hint) { %>\r\n <div class="user-message"><%=scope.pickLink(comment)%></div>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea>\r\n <% if (hideAddReply) { %>\r\n <button class="btn normal dlg-btn primary btn-inner-edit" id="id-comments-change-popover">textAdd</button>\r\n <% } else { %>\r\n <button class="btn normal dlg-btn primary btn-inner-edit" id="id-comments-change-popover">textEdit</button>\r\n <% } %>\r\n <button class="btn normal dlg-btn btn-inner-close">textCancel</button>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- replys elements --\x3e\r\n\r\n <% if (replys.length) { %>\r\n <div class="reply-arrow img-commonctrl"></div>\r\n <% _.each(replys, function (item) { %>\r\n <div class="reply-item-ct">\r\n <div class="user-name"><%=scope.getUserName(item.get("username"))%></div>\r\n <div class="user-date"><%=item.get("date")%></div>\r\n <% if (!item.get("editTextInPopover")) { %>\r\n <div class="user-message"><%=scope.pickLink(item.get("reply"))%></div>\r\n <% if (!hint) { %>\r\n <div class="btns-reply-ct">\r\n <% if (item.get("editable")) { %>\r\n <div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n <%}%>\r\n <div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n </div>\r\n <%}%>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>\r\n <button class="btn normal dlg-btn primary btn-inner-edit btn-fix" id="id-comments-change-popover">textEdit</button>\r\n <button class="btn normal dlg-btn btn-inner-close">textClose</button>\r\n </div>\r\n <% } %>\r\n </div>\r\n <% }); %>\r\n\r\n <% } %>\r\n\r\n \x3c!-- add reply button --\x3e\r\n\r\n <% if (!showReplyInPopover && !hideAddReply && !hint) { %>\r\n <% if (replys.length) { %>\r\n <label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } else { %>\r\n <label class="user-reply" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } %>\r\n <% } %>\r\n\r\n \x3c!-- edit buttons --\x3e\r\n\r\n <% if (!editTextInPopover && !lock && !hint) { %>\r\n <div class="edit-ct">\r\n <% if (editable) { %>\r\n <div class="btn-edit img-commonctrl"></div>\r\n <% } %>\r\n <div class="btn-delete img-commonctrl"></div>\r\n <% if (resolved) { %>\r\n <div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>\r\n <% } else { %>\r\n <div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>\r\n <% } %>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- reply --\x3e\r\n\r\n <% if (showReplyInPopover) { %>\r\n <div class="reply-ct">\r\n <textarea class="msg-reply user-select" placeholder="textAddReply" maxlength="maxCommLength"></textarea>\r\n <button class="btn normal dlg-btn primary btn-reply" id="id-comments-change-popover">textReply</button>\r\n <button class="btn normal dlg-btn btn-close">textClose</button>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- locked user --\x3e\r\n\r\n <% if (lock) { %>\r\n <div class="lock-area" style="cursor: default;"></div>\r\n <div class="lock-author" style="cursor: default;"><%=lockuserid%></div>\r\n <% } %>\r\n\r\n</div>'}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Comments",["text!common/main/lib/template/Comments.template","text!common/main/lib/template/CommentsPanel.template","text!common/main/lib/template/CommentsPopover.template","common/main/lib/util/utils","common/main/lib/component/Button","common/main/lib/component/ComboBox","common/main/lib/component/DataView","common/main/lib/component/Layout","common/main/lib/component/Window"],function(t,e,i){"use strict";function n(t,e){var i,n,o=t;for(i in e)void 0!==i&&(n=e[i],o=o.replace(new RegExp(i,"g"),n));return o}Common.Views.CommentsPopover=Common.UI.WLine truncated
|
||||||
|
this.panelMessages.scroller.scrollTop(n.get(0).getBoundingClientRect().height))}},_onResetMessages:function(t,e){if(this.panelMessages){t.each(function(t){this._prepareMessage(t)},this),this.panelMessages.html(this.templateMsgList({messages:t.models,msgtpl:this.tplMsg,scope:this})),this.panelMessages.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0})}},_onBtnAddMessage:function(t){this.txtMessage&&(this.fireEvent("message:add",[this,this.txtMessage.val().trim()]),this.txtMessage.val(""),this.focus())},_prepareMessage:function(t){var e=this.storeUsers.findUser(t.get("userid"));t.set({usercolor:e?e.get("color"):"#000",message:this._pickLink(Common.Utils.String.htmlEncode(t.get("message")))},{silent:!0})},_pickLink:function(t){var e,i,n=[];t.replace(Common.Utils.ipStrongRe,function(t){return e=arguments[arguments.length-2],n.push({start:e,end:t.length+e,str:'<a href="'+t+'" target="_blank" data-can-copy="true">'+t+"</a>"}),""}),(t.length<1e3||t.search(/\S{255,}/)<0)&&t.replace(Common.Utils.hostnameStrongRe,function(t){var o=/(((^https?)|(^ftp)):\/\/)/i.test(t)?t:"http://"+t;return e=arguments[arguments.length-2],i=t.length,_.find(n,function(t){return e>=t.start&&e<t.end||e<=t.start&&e+i>t.start})||n.push({start:e,end:i+e,str:'<a href="'+o+'" target="_blank" data-can-copy="true">'+t+"</a>"}),""}),t.replace(Common.Utils.emailStrongRe,function(t){var o=/((^mailto:)\/\/)/i.test(t)?t:"mailto:"+t;return e=arguments[arguments.length-2],i=t.length,_.find(n,function(t){return e>=t.start&&e<t.end||e<=t.start&&e+i>t.start})||n.push({start:e,end:i+e,str:'<a href="'+o+'">'+t+"</a>"}),""}),n=_.sortBy(n,function(t){return t.start});for(var o=n.length>0?t.substring(0,n[0].start)+n[0].str:t,s=1;s<n.length;s++)o+=t.substring(n[s-1].end,n[s].start)+n[s].str;return n.length>0&&(o+=t.substring(n[s-1].end,t.length)),o},getUserName:function(t){return Common.Utils.String.htmlEncode(t)},hide:function(){Common.UI.BaseView.prototype.hide.call(this,arguments),this.fireEvent("hide",this),this.textBoxAutoSizeLocked=void 0},setupLayout:function(){var t=this,e=$(t.el),i=this.panelBox.find(" > .layout-item");t.layout=new Common.UI.VBoxLayout({box:this.panelBox,items:[{el:i[0],rely:!0,behaviour:"splitter",resize:{hidden:!1,autohide:!1,fmin:function(){return t.usersBoxHeight},fmax:function(){return.5*t.panelBox.height()-t.messageBoxHeight}}},{el:i[1],rely:!0,behaviour:"splitter",resize:{hidden:!1,autohide:!1,fmin:function(){return Math.max(t.messageBoxHeight+t.usersBoxHeight,.5*t.panelBox.height())},fmax:function(){return t.panelBox.height()-t.addMessageBoxHeight}}},{el:i[2],stretch:!0}]}),t.layout.on("layout:resizedrag",function(e){t.updateScrolls(),t.usersCachedHeigt=t.panelUsers.height()+8+1,e.index||(t.textBoxAutoSizeLocked=!0)},this),$(window).on("resize",function(){"none"!==e.css("display")&&t.updateLayout()}),this.updateLayout();var n=this.panelBox.height();this.layout.setResizeValue(0,this.usersBoxHeight),this.layout.setResizeValue(1,Math.max(this.addMessageBoxHeight,Math.max(.5*n,n-t.panelOptions.height()-4))),this.setupAutoSizingTextBox(),this.txtMessage.bind("input propertychange",_.bind(this.updateHeightTextBox,this))},updateLayout:function(t){var e=this,i=this.panelBox.height();if(e.layout.setResizeValue(1,Math.max(e.addMessageBoxHeight,Math.max(.5*i,i-e.panelOptions.height()-4))),t){this.panelUsers.css("height");this.panelUsers.css("height","1px");var n=this.panelUsers.get(0).scrollHeight;e.layout.setResizeValue(0,Math.max(e.usersBoxHeight,Math.min(n+2,Math.floor(.5*i)-e.messageBoxHeight)))}else e.layout.setResizeValue(0,Math.max(e.usersBoxHeight,Math.min(e.usersCachedHeigt+2,Math.floor(.5*i)-e.messageBoxHeight)));e.updateScrolls(),e.updateHeightTextBox(null)},setupAutoSizingTextBox:function(){this.lineHeight=0,this.minHeight=44,this.lineHeight=1.25*parseInt(this.txtMessage.css("lineHeight"),10),this.updateHeightTextBox(!0)},updateHeightTextBox:function(t){var e,i,n=this.txtMessage;if(i=this.panelBox.height(),t&&0==n.val().length)return this.layout.setResizeValue(1,Math.max(this.addMessageBoxHeight,i-this.addMessageBoxHeight)),void(this.textBoxAutoSizeLocked=void 0);_.isUndefined(this.textBoxAutoSizeLocked)&&(n.height(),e=n.get(0).scrollHeight,n.css({height:this.minHeight+"px"}),n.height(),e=Math.max(n.get(0).scrollHeight+this.lineHeight,1),n.css({height:"100%"}),i=this.panelBox.height(),this.layout.setResizeValue(1,Math.max(this.addMessageBoxHeight,Math.min(i-e-40,i-this.addMessageBoxHeight))))},updateScrolls:function(){this.panelUsers&&this.panelUsers.scroller&&this.panelMessages&&this.panelMessages.scroller&&(this.panelUsers.scroller.update({minScrollbarLength:25,alwaysVisibleY:!0}),this.panelMessages.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0}))},textSend:"Send"},Common.Views.Chat||{}))}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Plugins",["common/main/lib/util/utils","common/main/lib/component/BaseView","common/main/lib/component/Layout","common/main/libLine truncated
|
||||||
|
this.onBtnMenuClick(this.btnComments),this.onCoauthOptions()))},getMenu:function(t){switch(t){default:return null;case"file":return this.btnFile.panel;case"about":return this.btnAbout.panel}},setMode:function(t){return this.mode=t,this.btnAbout.panel.setMode(t),this},setDeveloperMode:function(t){if(this.$el.is(":visible")){this.developerHint||(this.developerHint=e('<div id="developer-hint">'+this.txtDeveloper+"</div>").appendTo(this.$el),this.devHeight=this.developerHint.outerHeight(),e(window).on("resize",i.bind(this.onWindowResize,this))),this.developerHint.toggleClass("hidden",!t);var n=this.$el.find("button.btn-category:visible:last-of-type");this.minDevPosition=n.offset().top-n.offsetParent().offset().top+n.height()+20,this.onWindowResize()}},onWindowResize:function(){this.developerHint.css("top",Math.max((this.$el.height()-this.devHeight)/2,this.minDevPosition))},tipComments:"Comments",tipChat:"Chat",tipAbout:"About",tipSupport:"Feedback & Support",tipFile:"File",tipSearch:"Search",tipSlides:"Slides",tipPlugins:"Plugins",txtDeveloper:"DEVELOPER MODE"},PE.Views.LeftMenu||{}))}),define("presentationeditor/main/app/controller/LeftMenu",["core","common/main/lib/util/Shortcuts","presentationeditor/main/app/view/LeftMenu","presentationeditor/main/app/view/FileMenu"],function(){"use strict";PE.Controllers.LeftMenu=Backbone.Controller.extend(_.extend({views:["LeftMenu","FileMenu"],initialize:function(){this._state={no_slides:void 0},this.addListeners({"Common.Views.Chat":{hide:_.bind(this.onHideChat,this)},Statusbar:{"click:users":_.bind(this.clickStatusbarUsers,this)},LeftMenu:{"panel:show":_.bind(this.menuExpand,this),"comments:show":_.bind(this.commentsShowHide,this,"show"),"comments:hide":_.bind(this.commentsShowHide,this,"hide")},"Common.Views.About":{show:_.bind(this.aboutShowHide,this,!1),hide:_.bind(this.aboutShowHide,this,!0)},FileMenu:{"filemenu:hide":_.bind(this.menuFilesHide,this),"item:click":_.bind(this.clickMenuFileItem,this),"saveas:format":_.bind(this.clickSaveAsFormat,this),"settings:apply":_.bind(this.applySettings,this),"create:new":_.bind(this.onCreateNew,this),"recent:open":_.bind(this.onOpenRecent,this)},Toolbar:{"file:settings":_.bind(this.clickToolbarSettings,this)},SearchDialog:{hide:_.bind(this.onSearchDlgHide,this),"search:back":_.bind(this.onQuerySearch,this,"back"),"search:next":_.bind(this.onQuerySearch,this,"next")}})},onLaunch:function(){this.leftMenu=this.createView("LeftMenu").render(),this.leftMenu.btnSearch.on("toggle",_.bind(this.onMenuSearch,this)),this.leftMenu.btnThumbs.on("toggle",_.bind(this.onShowTumbnails,this)),this.isThumbsShown=!0,Common.util.Shortcuts.delegateShortcuts({shortcuts:{"command+shift+s,ctrl+shift+s":_.bind(this.onShortcut,this,"save"),"command+f,ctrl+f":_.bind(this.onShortcut,this,"search"),"alt+f":_.bind(this.onShortcut,this,"file"),esc:_.bind(this.onShortcut,this,"escape"),"alt+q":_.bind(this.onShortcut,this,"chat"),"command+shift+h,ctrl+shift+h":_.bind(this.onShortcut,this,"comments"),f1:_.bind(this.onShortcut,this,"help")}}),Common.util.Shortcuts.suspendEvents()},setApi:function(t){if(this.api=t,this.api.asc_registerCallback("asc_onThumbnailsShow",_.bind(this.onThumbnailsShow,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onApiServerDisconnect,this,!0)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onApiServerDisconnect,this)),this.mode.canCoAuthoring&&(this.mode.canChat&&this.api.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage",_.bind(this.onApiChatMessage,this)),this.mode.canComments)){this.api.asc_registerCallback("asc_onAddComment",_.bind(this.onApiAddComment,this)),this.api.asc_registerCallback("asc_onAddComments",_.bind(this.onApiAddComments,this));for(var e=this.getApplication().getCollection("Common.Collections.Comments"),i=0;i<e.length;++i)if(e.at(i).get("userid")!==this.mode.user.id){this.leftMenu.markCoauthOptions("comments",!0);break}}return this.api.asc_registerCallback("asc_onCountPages",_.bind(this.onApiCountPages,this)),this.onApiCountPages(this.api.getCountPages()),this.leftMenu.getMenu("file").setApi(t),this},setMode:function(t){return this.mode=t,this.leftMenu.setMode(t),this.leftMenu.getMenu("file").setMode(t),this},createDelayedElements:function(){return this.mode.canCoAuthoring?(this.leftMenu.btnComments[this.mode.isEdit&&this.mode.canComments&&!this.mode.isLightVersion?"show":"hide"](),this.mode.canComments&&this.leftMenu.setOptionsPanel("comment",this.getApplication().getController("Common.Controllers.Comments").getView("Common.Views.Comments")),this.leftMenu.btnChat[this.mode.canChat&&!this.mode.isLightVersion?"show":"hide"](),this.mode.canChat&&this.leftMenu.setOptionsPanel("chat",this.getApplication().getController("Common.Controllers.Chat").getView("Common.Views.Chat"))):(this.leftMenu.btnChat.hide(),this.leftMenu.btnComments.hide()),this.mode.isTrial&&this.leftMenu.setDeveloperMode(!0),Common.util.Shortcuts.resumeEvents(),this.leftMenu.btnThumbs.toggle(!0),this},Line truncated
|
||||||
|
this.appOptions.canOpenRecent=!0!==this.editorConfig.nativeApp&&void 0!==this.editorConfig.recent&&!this.appOptions.isDesktopApp,this.appOptions.templates=this.editorConfig.templates,this.appOptions.recent=this.editorConfig.recent,this.appOptions.createUrl=this.editorConfig.createUrl,this.appOptions.lang=this.editorConfig.lang,this.appOptions.location="string"==typeof this.editorConfig.location?this.editorConfig.location.toLowerCase():"",this.appOptions.sharingSettingsUrl=this.editorConfig.sharingSettingsUrl,this.appOptions.canAnalytics=!1,this.appOptions.customization=this.editorConfig.customization,this.appOptions.canBackToFolder=!1!==this.editorConfig.canBackToFolder&&"object"==typeof this.editorConfig.customization&&"object"==typeof this.editorConfig.customization.goback&&!_.isEmpty(this.editorConfig.customization.goback.url),this.appOptions.canBack=!0!==this.editorConfig.nativeApp&&!0===this.appOptions.canBackToFolder,this.appOptions.canPlugins=!1,this.plugins=this.editorConfig.plugins,this.getApplication().getController("Viewport").getView("Common.Views.Header").setCanBack(!0===this.appOptions.canBackToFolder),this.editorConfig.lang&&this.api.asc_setLocale(this.editorConfig.lang),"us"!=this.appOptions.location&&"ca"!=this.appOptions.location||Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch)},loadDocument:function(t){this.permissions={},this.document=t.doc;var e={};if(t.doc){this.permissions=$.extend(this.permissions,t.doc.permissions);var i=new Asc.asc_CUserInfo;i.put_Id(this.appOptions.user.id),i.put_FullName(this.appOptions.user.fullname),e=new Asc.asc_CDocInfo,e.put_Id(t.doc.key),e.put_Url(t.doc.url),e.put_Title(t.doc.title),e.put_Format(t.doc.fileType),e.put_VKey(t.doc.vkey),e.put_Options(t.doc.options),e.put_UserInfo(i),e.put_CallbackUrl(this.editorConfig.callbackUrl),e.put_Token(t.doc.token)}this.api.asc_registerCallback("asc_onGetEditorPermissions",_.bind(this.onEditorPermissions,this)),this.api.asc_setDocInfo(e),this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl,this.editorConfig.customerId),t.doc&&this.getApplication().getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t.doc.title)},onProcessSaveResult:function(t){this.api.asc_OnSaveEnd(t.result),t&&!1===t.result&&Common.UI.error({title:this.criticalErrorTitle,msg:_.isEmpty(t.message)?this.errorProcessSaveResult:t.message})},onProcessRightsChange:function(t){if(t&&!1===t.enabled){var e=this,i=this._state.lostEditingRights;this._state.lostEditingRights=!this._state.lostEditingRights,this.api.asc_coAuthoringDisconnect(),this.getApplication().getController("LeftMenu").leftMenu.getMenu("file").panels.rights.onLostEditRights(),Common.NotificationCenter.trigger("api:disconnect"),i||Common.UI.warning({title:this.notcriticalErrorTitle,maxwidth:600,msg:_.isEmpty(t.message)?this.warnProcessRightsChange:t.message,callback:function(){e._state.lostEditingRights=!1,e.onEditComplete()}})}},onDownloadAs:function(){this.api.asc_DownloadAs(Asc.c_oAscFileType.PPTX,!0)},onProcessMouse:function(t){if("mouseup"==t.type){var e=document.getElementById("editor_sdk");if(e){var i=e.getBoundingClientRect();this.api.OnMouseUp(t.x-i.left,t.y-i.top)}}},goBack:function(t){var e=this.appOptions.customization.goback.url;t?window.open(e,"_blank"):parent.location.href=e},onEditComplete:function(t){var e=this.getApplication(),i=e.getController("Toolbar"),n=i.getView("Toolbar");if(e.getController("DocumentHolder").getView("DocumentHolder").focus(),this.api&&this.api.asc_isDocumentCanSave){var o=this.api.asc_isDocumentCanSave(),s=this.appOptions.forcesave,a=$(".btn-icon",n.btnSave.cmpEl).hasClass("btn-synch");n.btnSave.isDisabled()!==(!o&&!a&&!s||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!s)&&n.btnSave.setDisabled(!o&&!a&&!s||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!s)}},onLongActionBegin:function(t,e){var i={id:e,type:t};this.stackLongActions.push(i),this.setLongActionView(i)},onLongActionEnd:function(t,e){var i={id:e,type:t};if(this.stackLongActions.pop(i),this.getApplication().getController("Viewport").getView("Common.Views.Header").setDocumentCaption(this.api.asc_getDocumentName()),this.updateWindowTitle(!0),i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.Information}))this.setLongActionView(i);else if(e==Asc.c_oAscAsyncAction.Save||e==Asc.c_oAscAsyncAction.ForceSaveButton)if(this._state.fastCoauth&&this._state.usersCount>1){var n=this;n._state.timerSave=setTimeout(function(){n.getApplication().getController("Statusbar").setStatusCaption(n.textChangesSaved,!1,3e3)},500)}else this.getApplication().getController("Statusbar").setStatusCaption(this.textChangesSaved,!1,3e3);else this.getApplication().getController("Statusbar").setStatusCaption("");i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.BlockInteraction}),i?this.setLongActionView(i):this.loadMask&&this.loadMask.hide(),e!=Asc.c_oAscAsyncAction.Save&&e!=Asc.c_oAscALine truncated
|
||||||
|
var t=Common.localStorage.getItem("pe-settings-coauthmode"),e=this._state.fastCoauth;this._state.fastCoauth=null===t||1==parseInt(t),this._state.fastCoauth&&!e&&this.synchronizeChanges()}this.appOptions.canForcesave&&(t=Common.localStorage.getItem("pe-settings-forcesave"),this.appOptions.forcesave=null===t?this.appOptions.canForcesave:1==parseInt(t),this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave))},onDocumentName:function(t){this.getApplication().getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t),this.updateWindowTitle(!0)},onMeta:function(t){var e=this.getApplication(),i=e.getController("LeftMenu").getView("LeftMenu").getMenu("file");e.getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t.title),this.updateWindowTitle(!0),this.document.title=t.title,i.loadDocument({doc:this.document}),i.panels.info.updateInfo(this.document),Common.Gateway.metaChange(t)},onPrint:function(){this.appOptions.canPrint&&(this.api&&this.api.asc_Print(Common.Utils.isChrome||Common.Utils.isSafari||Common.Utils.isOpera),Common.component.Analytics.trackEvent("Print"))},onPrintUrl:function(t){if(this.iframePrint&&(this.iframePrint.parentNode.removeChild(this.iframePrint),this.iframePrint=null),!this.iframePrint){var e=this;this.iframePrint=document.createElement("iframe"),this.iframePrint.id="id-print-frame",this.iframePrint.style.display="none",this.iframePrint.style.visibility="hidden",this.iframePrint.style.position="fixed",this.iframePrint.style.right="0",this.iframePrint.style.bottom="0",document.body.appendChild(this.iframePrint),this.iframePrint.onload=function(){e.iframePrint.contentWindow.focus(),e.iframePrint.contentWindow.print(),e.iframePrint.contentWindow.blur(),window.focus()}}t&&(this.iframePrint.src=t)},onAdvancedOptions:function(t){var e,i=t.asc_getOptionId(),n=this;i==Asc.c_oAscAdvancedOptionsID.DRM&&(e=new Common.Views.OpenDialog({type:i,handler:function(t){n.isShowOpenDialog=!1,n&&n.api&&(n.api.asc_setAdvancedOptions(i,new Asc.asc_CDRMAdvancedOptions(t)),n.loadMask&&n.loadMask.show())}})),e&&(this.isShowOpenDialog=!0,this.loadMask&&this.loadMask.hide(),this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction,LoadingDocument),e.show())},requestPlugins:function(pluginsPath){if(pluginsPath){var _createXMLHTTPObject=function(){var t;try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){t=!1}}return t||"undefined"==typeof XMLHttpRequest||(t=new XMLHttpRequest),t},_getPluginJson=function(plugin){if(!plugin)return"";try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&plugin){xhrObj.open("GET",plugin,!1),xhrObj.send("");var pluginJson=eval("("+xhrObj.responseText+")");return pluginJson}}catch(t){}return null},value=_getPluginJson(pluginsPath);value&&this.updatePlugins(value,!1)}},updatePlugins:function(plugins,uiCustomize){if(plugins){var pluginsData=uiCustomize?plugins.UIpluginsData:plugins.pluginsData;if(pluginsData&&!(pluginsData.length<1)){var _createXMLHTTPObject=function(){var t;try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){t=!1}}return t||"undefined"==typeof XMLHttpRequest||(t=new XMLHttpRequest),t},_getPluginJson=function(plugin){if(!plugin)return"";try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&plugin){xhrObj.open("GET",plugin,!1),xhrObj.send("");var pluginJson=eval("("+xhrObj.responseText+")");return pluginJson}}catch(t){}return null},arr=[],baseUrl=_.isEmpty(plugins.url)?"":plugins.url;""!==baseUrl&&console.log("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connection configuration."),pluginsData.forEach(function(t){t=baseUrl+t;var e=_getPluginJson(t);e&&(e.baseUrl=t.substring(0,t.lastIndexOf("config.json")),e.oldVersion=""!==baseUrl,arr.push(e))}),arr.length>0&&this.updatePluginsList({autoStartGuid:plugins.autoStartGuid,pluginsData:arr},!!uiCustomize)}}},updatePluginsList:function(t,e){var i=this.getApplication().getCollection("Common.Collections.Plugins"),n=this.appOptions.isEdit;if(t){var o=[],s=[];t.pluginsData.forEach(function(t){if(void 0===e||!i.findWhere({baseUrl:t.baseUrl})&&!i.findWhere({guid:t.guid})){var a=t.variations,r=[];a.forEach(function(e){for(var i=!1,o=0;o<e.EditorsSupport.length;o++)if("slide"==e.EditorsSupport[o]){i=!0;break}if(i&&(n||e.isViewer)){var a=e.icons;t.oldVersion&&(a=[],e.icons.forEach(function(t){a.push(t.substring(t.lastIndexOf("/")+1))})),t.isUICustomizer?s.push(t.baseUrl+e.url):r.push(new Common.Models.PluginVariation({description:e.description,index:r.length,url:t.oldVersion?e.url.substring(e.url.lastIndexOf("/")+1):e.url,icons:a,isViewer:e.isViewer,EditorsSupport:e.EditorsSupport,isVisual:e.isVisual,isModal:e.isModal,isInsideMode:e.isInsideMode,initDataType:e.initDataType,initData:e.initData,isUpdateOleOnResize:e.isUpdateOleOnResize,buttons:e.buttons,size:e.size,initOnSelectionChanged:e.initOnSelectionChanged}))}}),r.length>0&&!t.isUICustomizer&&o.pLine truncated
|
||||||
|
n._docAccessDlg.on("accessrights",function(t,e){n.doc.info.sharingSettings=e,n._ShowHideInfoItem("rights",void 0!==n.doc.info.sharingSettings&&null!==n.doc.info.sharingSettings&&n.doc.info.sharingSettings.length>0),n.cntRights.html(n.templateRights({users:n.doc.info.sharingSettings}))}).on("close",function(t){n._docAccessDlg=void 0}),n._docAccessDlg.show()}},onLostEditRights:function(){this._readonlyRights=!0,this.rendered&&this._ShowHideInfoItem("edit-rights",!1)},txtRights:"Persons who have rights",txtBtnAccessRights:"Change access rights"},PE.Views.FileMenuPanels.DocumentRights||{})),PE.Views.FileMenuPanels.Help=Common.UI.BaseView.extend({el:"#panel-help",menu:void 0,template:_.template(['<div style="width:100%; height:100%; position: relative;">','<div id="id-help-contents" style="position: absolute; width:200px; top: 0; bottom: 0;" class="no-padding"></div>','<div id="id-help-frame" style="position: absolute; left: 200px; top: 0; right: 0; bottom: 0;" class="no-padding"></div>',"</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,arguments),this.menu=t.menu,this.urlPref="resources/help/en/",this.en_data=[{src:"UsageInstructions/SetPageParameters.htm",name:"Set page parameters",headername:"Usage Instructions"},{src:"UsageInstructions/CopyPasteUndoRedo.htm",name:"Copy/paste text passages, undo/redo your actions"},{src:"UsageInstructions/LineSpacing.htm",name:"Set paragraph line spacing"},{src:"UsageInstructions/CopyClearFormatting.htm",name:"Copy/clear text formatting"},{src:"UsageInstructions/CreateLists.htm",name:"Create lists"},{src:"UsageInstructions/InsertImages.htm",name:"Insert images"},{src:"UsageInstructions/ViewDocInfo.htm",name:"View document information"},{src:"UsageInstructions/SavePrintDownload.htm",name:"Save/print/download your document"},{src:"UsageInstructions/OpenCreateNew.htm",name:"Create a new document or open an existing one"},{src:"HelpfulHints/About.htm",name:"About ONLYOFFICE Document Editor",headername:"Helpful Hints"},{src:"HelpfulHints/SupportedFormats.htm",name:"Supported Formats of Electronic Documents"},{src:"HelpfulHints/Navigation.htm",name:"Navigation through Your Document"},{src:"HelpfulHints/Search.htm",name:"Search Function"},{src:"HelpfulHints/KeyboardShortcuts.htm",name:"Keyboard Shortcuts"}],Common.Utils.isIE&&(window.onhelp=function(){return!1})},render:function(){var t=this;return $(this.el).html(this.template()),this.viewHelpPicker=new Common.UI.DataView({el:$("#id-help-contents"),store:new Common.UI.DataViewStore([]),keyMoveDirection:"vertical",itemTemplate:_.template(['<div id="<%= id %>" class="help-item-wrap">','<div class="caption"><%= name %></div>',"</div>"].join(""))}),this.viewHelpPicker.on("item:add",function(t,e,i){i.has("headername")&&$(e.el).before('<div class="header-name">'+i.get("headername")+"</div>")}),this.viewHelpPicker.on("item:select",function(e,i,n){t.iFrame.src=t.urlPref+n.get("src")}),this.iFrame=document.createElement("iframe"),this.iFrame.src="",this.iFrame.align="top",this.iFrame.frameBorder="0",this.iFrame.width="100%",this.iFrame.height="100%",Common.Gateway.on("internalcommand",function(e){if("help:hyperlink"==e.type){var i=e.data,n=t.viewHelpPicker.store.find(function(t){return i.indexOf(t.get("src"))>0});n&&(t.viewHelpPicker.selectRecord(n,!0),t.viewHelpPicker.scrollToRecord(n))}}),$("#id-help-frame").append(this.iFrame),this},setLangConfig:function(t){var e=this,i=this.viewHelpPicker.store;if(t){t=t.split("-")[0];var n={dataType:"json",error:function(){e.urlPref.indexOf("resources/help/en/")<0?(e.urlPref="resources/help/en/",i.url="resources/help/en/Contents.json",i.fetch(n)):(e.urlPref="resources/help/en/",i.reset(e.en_data))},success:function(){var t=i.at(0);e.viewHelpPicker.selectRecord(t),e.iFrame.src=e.urlPref+t.get("src")}};i.url="resources/help/"+t+"/Contents.json",i.fetch(n),this.urlPref="resources/help/"+t+"/"}},show:function(){Common.UI.BaseView.prototype.show.call(this),this._scrollerInited||(this.viewHelpPicker.scroller.update(),this._scrollerInited=!0)}})}),void 0===Common)var Common={};if(Common.Models=Common.Models||{},define("common/main/lib/model/Comment",["underscore","backbone","common/main/lib/component/BaseView"],function(t,e){"use strict";Common.Models.Comment=e.Model.extend({defaults:{uid:0,userid:0,username:"Guest",date:void 0,quote:"",comment:"",resolved:!1,lock:!1,lockuserid:"",unattached:!1,id:Common.UI.getId(),time:0,showReply:!1,showReplyInPopover:!1,editText:!1,editTextInPopover:!1,last:void 0,replys:[],hideAddReply:!1,scope:null,hide:!1,hint:!1,dummy:void 0,editable:!0}}),Common.Models.Reply=e.Model.extend({defaults:{time:0,userid:0,username:"Guest",reply:"",date:void 0,id:Common.UI.getId(),editText:!1,editTextInPopover:!1,scope:null,editable:!0}})}),void 0===Common)var Common={};if(Common.Collections=Common.Collections||{},define("common/main/lib/collection/Comments",["underscore","backbone","common/main/lib/model/Comment"],function(t,e){"use strict";CommoLine truncated
|
||||||
|
size:[800,600],initOnSelectionChanged:!1}}}),Common.Models.Plugin=e.Model.extend({defaults:function(){return{id:Common.UI.getId(),name:"",baseUrl:"",guid:Common.UI.getId(),variations:[],currentVariation:0,pluginObj:void 0,allowSelected:!1,selected:!1}}})}),void 0===Common)var Common={};if(Common.Collections=Common.Collections||{},define("common/main/lib/collection/Plugins",["underscore","backbone","common/main/lib/model/Plugin"],function(t,e){"use strict";Common.Collections.Plugins=e.Collection.extend({model:Common.Models.Plugin})}),define("common/main/lib/controller/Plugins",["core","common/main/lib/collection/Plugins","common/main/lib/view/Plugins"],function(){"use strict";Common.Controllers.Plugins=Backbone.Controller.extend(_.extend({models:[],collections:["Common.Collections.Plugins"],views:["Common.Views.Plugins"],initialize:function(){},events:function(){return{"click #id-plugin-close":_.bind(this.onToolClose,this)}},onLaunch:function(){this.panelPlugins=this.createView("Common.Views.Plugins",{storePlugins:this.getApplication().getCollection("Common.Collections.Plugins")}),this.panelPlugins.on("render:after",_.bind(this.onAfterRender,this)),this._moveOffset={x:0,y:0}},setApi:function(t){return this.api=t,this.api.asc_registerCallback("asc_onPluginShow",_.bind(this.onPluginShow,this)),this.api.asc_registerCallback("asc_onPluginClose",_.bind(this.onPluginClose,this)),this.api.asc_registerCallback("asc_onPluginResize",_.bind(this.onPluginResize,this)),this.api.asc_registerCallback("asc_onPluginMouseUp",_.bind(this.onPluginMouseUp,this)),this.api.asc_registerCallback("asc_onPluginMouseMove",_.bind(this.onPluginMouseMove,this)),this},setMode:function(t){t.canPlugins&&this.updatePluginsList()},onAfterRender:function(t){t.viewPluginsList.on("item:click",_.bind(this.onSelectPlugin,this)),this.bindViewEvents(this.panelPlugins,this.events);var e=this;Common.NotificationCenter.on({"layout:resizestart":function(t){if(e.panelPlugins.isVisible()){var i=e.panelPlugins.currentPluginFrame.offset();e._moveOffset={x:i.left+parseInt(e.panelPlugins.currentPluginFrame.css("padding-left")),y:i.top+parseInt(e.panelPlugins.currentPluginFrame.css("padding-top"))},e.api.asc_pluginEnableMouseEvents(!0)}},"layout:resizestop":function(t){e.panelPlugins.isVisible()&&e.api.asc_pluginEnableMouseEvents(!1)}})},updatePluginsList:function(){var t=this.getApplication().getCollection("Common.Collections.Plugins"),e=[];t.each(function(t){var i=new Asc.CPlugin;i.set_Name(t.get("name")),i.set_Guid(t.get("guid")),i.set_BaseUrl(t.get("baseUrl"));var n=t.get("variations"),o=[];n.forEach(function(t){var e=new Asc.CPluginVariation;e.set_Description(t.get("description")),e.set_Url(t.get("url")),e.set_Icons(t.get("icons")),e.set_Visual(t.get("isVisual")),e.set_Viewer(t.get("isViewer")),e.set_EditorsSupport(t.get("EditorsSupport")),e.set_Modal(t.get("isModal")),e.set_InsideMode(t.get("isInsideMode")),e.set_InitDataType(t.get("initDataType")),e.set_InitData(t.get("initData")),e.set_UpdateOleOnResize(t.get("isUpdateOleOnResize")),e.set_Buttons(t.get("buttons")),e.set_Size(t.get("size")),e.set_InitOnSelectionChanged(t.get("initOnSelectionChanged")),o.push(e)}),i.set_Variations(o),t.set("pluginObj",i),e.push(i)}),this.api.asc_pluginsRegister("",e)},onSelectPlugin:function(t,e,i,n){var o=$(n.target);if(o&&o.hasClass("plugin-caret")){var s=this.panelPlugins.pluginMenu;if(s.isVisible())return void s.hide();var a,r=this,l=$(n.currentTarget),c=$(this.panelPlugins.el),h=l.offset(),d=c.offset();if(a=[h.left-d.left+l.width(),h.top-d.top+l.height()/2],void 0!=i){for(var p=0;p<s.items.length;p++)s.removeItem(s.items[p]),p--;s.removeAll();for(var u=i.get("variations"),p=0;p<u.length;p++){var m=u[p],g=new Common.UI.MenuItem({caption:p>0?m.get("description"):r.panelPlugins.textStart,value:parseInt(m.get("index"))}).on("click",function(t,e){r.api&&r.api.asc_pluginRun(i.get("guid"),t.value,"")});s.addItem(g)}}var f=c.find("#menu-plugin-container");s.rendered||(f.length<1&&(f=$('<div id="menu-plugin-container" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>',s.id),c.append(f)),s.render(f),s.cmpEl.attr({tabindex:"-1"}),s.on("show:after",function(t){t&&t.menuAlignEl&&t.menuAlignEl.toggleClass("over",!0)}).on("hide:after",function(t){t&&t.menuAlignEl&&t.menuAlignEl.toggleClass("over",!1)})),f.css({left:a[0],top:a[1]}),s.menuAlignEl=l,s.setOffset(-20,-l.height()/2-3),s.show(),_.delay(function(){s.cmpEl.focus()},10),n.stopPropagation(),n.preventDefault()}else this.api.asc_pluginRun(i.get("guid"),0,"")},onPluginShow:function(t,e){var i=t.get_Variations()[e];if(i.get_Visual()){var n=i.get_Url();if(n=(0==t.get_BaseUrl().length?n:t.get_BaseUrl())+n,i.get_InsideMode())this.panelPlugins.openInsideMode(t.get_Name(),n)||this.api.asc_pluginButtonClick(-1);else{var o=this,s=i.get_Buttons(),a={},r=i.get_Size();(!r||r.length<2)&&(r=[800,600]),_.isArray(s)&&_.each(s,function(t,e){a[e]={text:t.text,cls:"custom"+(t.primary?" pLine truncated
|
||||||
@@ -1,8 +1,51 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) Ascensio System SIA 2018. All rights reserved
|
* Copyright (c) Ascensio System SIA 2019. All rights reserved
|
||||||
*
|
*
|
||||||
* http://www.onlyoffice.com
|
* http://www.onlyoffice.com
|
||||||
*
|
*
|
||||||
* Version: 0.0.0 (build:0)
|
* Version: 0.0.0 (build:0)
|
||||||
*/
|
*/
|
||||||
function onDropDownKeyDown(e){var t=$(this),n=t.parent(),r=jQuery.Event("keydown.before.bs.dropdown"),i=jQuery.Event("keydown.after.bs.dropdown");n.trigger(r),n.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(e=arguments[1]),/^(38|40|27|13|9|37|39)$/.test(e.keyCode)&&!e.ctrlKey&&!e.altKey&&(patchDropDownKeyDownAdditional.call(this,e),/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation()))):(patchDropDownKeyDown.call(this,e),e.preventDefault(),e.stopPropagation()),n.trigger(i)}function patchDropDownKeyDown(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);e.preventDefault(),e.stopPropagation();if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&e.keyCode==27){if(e.which==27){i=$("[role=menu] li.dropdown-submenu.over:visible",n);if(i.size())return i.eq(i.size()-1).removeClass("over"),!1;n.hasClass("dropdown-submenu")&&n.hasClass("over")?(n.removeClass("over"),n.find("> a").focus()):n.find("[data-toggle=dropdown]").focus()}return r?t.click():undefined}var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(":focus"));if(e.keyCode==39){if(s<0)return;var o=i.eq(s).parent();o.hasClass("dropdown-submenu")&&!o.hasClass("over")&&(o.mouseenter(),o.addClass("focused-submenu"),_.delay(function(){var e=$("> [role=menu]",o),t=e.find("> li:not(.divider):not(.disabled):visible > a"),n=0;if(e.find("> .menu-scroll").length>0){var r=e.scrollTop();for(var i=0;i<t.length;i++)if(t[i].offsetTop>r){n=i;break}}t.length>0&&t.eq(n).focus()},250))}else e.keyCode==37?n.hasClass("dropdown-submenu")&&n.hasClass("over")&&(n.removeClass("over"),n.find("> a").focus()):(e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),n.hasClass("dropdown-submenu")&&n.hasClass("over")&&n.addClass("focused-submenu"),i.eq(s).focus())}function patchDropDownKeyDownAdditional(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation());if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&(e.keyCode==27||e.keyCode==37||e.keyCode==39))return r?t.click():undefined;var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(".focus"));e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s<i.length-1?s++:t.hasClass("no-cyclic")?s=i.length-1:s=0),~s||(s=0),i.removeClass("focus"),i.eq(s).addClass("focus")}function getParent(e){var t=e.attr("data-target");t||(t=e.attr("href"),t=t&&/#/.test(t)&&t.replace(/.*(?=#[^\s]*$)/,""));var n=t&&$(t);return n&&n.length?n:e.parent()}function clearMenus(e){$(".dropdown-toggle").each(function(t){var n=$(this).parent();if(!n.hasClass("open"))return;n.trigger(t=$.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("open").trigger("hidden.bs.dropdown",e)})}(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){returnLine truncated
|
function onDropDownKeyDown(t){var e=$(this),i=e.parent(),n=jQuery.Event("keydown.before.bs.dropdown"),o=jQuery.Event("keydown.after.bs.dropdown");i.trigger(n),i.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(t=arguments[1]),!/^(38|40|27|13|9|37|39)$/.test(t.keyCode)||t.ctrlKey||t.altKey||(patchDropDownKeyDownAdditional.call(this,t),/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()))):(patchDropDownKeyDown.call(this,t),t.preventDefault(),t.stopPropagation()),i.trigger(o)}function patchDropDownKeyDown(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&27==t.keyCode){if(27==t.which){if(o=$("[role=menu] li.dropdown-submenu.over:visible",i),o.size())return o.eq(o.size()-1).removeClass("over"),!1;i.hasClass("dropdown-submenu")&&i.hasClass("over")?(i.removeClass("over"),i.find("> a").focus()):i.find("[data-toggle=dropdown]").focus()}return n?e.click():void 0}var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(":focus"));if(39==t.keyCode){if(s<0)return;var a=o.eq(s).parent();a.hasClass("dropdown-submenu")&&!a.hasClass("over")&&(a.mouseenter(),a.addClass("focused-submenu"),_.delay(function(){var t=$("> [role=menu]",a),e=t.find("> li:not(.divider):not(.disabled):visible > a"),i=0;if(t.find("> .menu-scroll").length>0)for(var n=t.scrollTop(),o=0;o<e.length;o++)if(e[o].offsetTop>n){i=o;break}e.length>0&&e.eq(i).focus()},250))}else 37==t.keyCode?i.hasClass("dropdown-submenu")&&i.hasClass("over")&&(i.removeClass("over"),i.find("> a").focus()):(38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),i.hasClass("dropdown-submenu")&&i.hasClass("over")&&i.addClass("focused-submenu"),o.eq(s).focus())}}}}function patchDropDownKeyDownAdditional(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&(27==t.keyCode||37==t.keyCode||39==t.keyCode))return n?e.click():void 0;var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(".focus"));38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),o.removeClass("focus"),o.eq(s).addClass("focus")}}}}function getParent(t){var e=t.attr("data-target");e||(e=t.attr("href"),e=e&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&$(e);return i&&i.length?i:t.parent()}function clearMenus(t){$(".dropdown-toggle").each(function(e){var i=$(this).parent();i.hasClass("open")&&(i.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",t))})}if(function(){var t=this,e=t._,i={},n=Array.prototype,o=Object.prototype,s=Function.prototype,a=n.push,r=n.slice,l=n.concat,c=o.toString,h=o.hasOwnProperty,d=n.forEach,p=n.map,m=n.reduce,u=n.reduceRight,g=n.filter,f=n.every,b=n.some,C=n.indexOf,v=n.lastIndexOf,y=Array.isArray,_=Object.keys,x=s.bind,w=function(t){return t instanceof w?t:this instanceof w?void(this._wrapped=t):new w(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):t._=w,w.VERSION="1.5.2";var S=w.each=w.forEach=function(t,e,n){if(null!=t)if(d&&t.forEach===d)t.forEach(e,n);else if(t.length===+t.length){for(var o=0,s=t.length;o<s;o++)if(e.call(n,t[o],o,t)===i)return}else for(var a=w.keys(t),o=0,s=a.length;o<s;o++)if(e.call(n,t[a[o]],a[o],t)===i)return};w.map=w.collect=function(t,e,i){var n=[];return null==t?n:p&&t.map===p?t.map(e,i):(S(t,function(t,o,s){n.push(e.call(i,t,o,s))}),n)};var A="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),m&&t.reduce===m)return n&&(e=w.bind(e,n)),o?t.reduce(e,i):t.reduce(e);if(S(t,function(t,s,a){o?i=e.call(n,i,t,s,a):(i=t,o=!0)}),!o)throw new TypeError(A);return i},w.reduceRight=w.foldr=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),u&&t.reduceRight===u)return n&&(e=w.bind(e,n)),o?t.reduceRight(e,i):t.reduceRight(e);var s=t.length;if(s!==+s){var a=w.keys(t);s=a.length}if(S(t,function(r,l,c){l=a?a[--s]:--s,o?i=e.call(n,i,t[l],l,c):(i=t[l],o=!0)}),!o)throw new TypeError(A);return i},w.find=w.detect=function(t,e,i){var n;return T(t,function(t,o,s){if(e.call(i,t,o,s))return n=t,!0}),n},w.filter=w.select=function(t,e,i){var n=[];return null==t?n:g&&t.filter===g?t.filter(e,i):(S(t,function(t,o,s){e.call(i,t,o,s)&&n.push(t)}),n)},w.reject=function(t,e,i){return w.filter(t,function(t,n,o){return!e.call(i,t,n,o)},i)},w.every=w.all=function(t,e,n){e||(e=w.identity);var o=!0;return nullLine truncated
|
||||||
|
;if(i(t))for(n=t.length;o<n&&!1!==e.call(t[o],o,t[o]);o++);else for(o in t)if(!1===e.call(t[o],o,t[o]))break;return t},trim:function(t){return null==t?"":(t+"").replace(st,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(i(Object(t))?ot.merge(n,"string"==typeof t?[t]:t):J.call(n,t)),n},inArray:function(t,e,i){return null==e?-1:Q.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,o=t.length;n<i;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,i){for(var n=[],o=0,s=t.length,a=!i;o<s;o++)!e(t[o],o)!==a&&n.push(t[o]);return n},map:function(t,e,n){var o,s,a=0,r=[];if(i(t))for(o=t.length;a<o;a++)null!=(s=e(t[a],a,n))&&r.push(s);else for(a in t)null!=(s=e(t[a],a,n))&&r.push(s);return Z.apply([],r)},guid:1,proxy:function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),ot.isFunction(t))return n=X.call(arguments,2),o=function(){return t.apply(e||this,n.concat(X.call(arguments)))},o.guid=t.guid=t.guid||ot.guid++,o},now:Date.now,support:nt}),"function"==typeof Symbol&&(ot.fn[Symbol.iterator]=K[Symbol.iterator]),ot.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){tt["[object "+e+"]"]=e.toLowerCase()});var ct=function(t){function e(t,e,i,n){var o,s,a,r,c,d,p,m,u=e&&e.ownerDocument,g=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return i;if(!n&&((e?e.ownerDocument||e:R)!==M&&E(e),e=e||M,P)){if(11!==g&&(d=gt.exec(t)))if(o=d[1]){if(9===g){if(!(a=e.getElementById(o)))return i;if(a.id===o)return i.push(a),i}else if(u&&(a=u.getElementById(o))&&L(e,a)&&a.id===o)return i.push(a),i}else{if(d[2])return X.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&v.getElementsByClassName&&e.getElementsByClassName)return X.apply(i,e.getElementsByClassName(o)),i}if(v.qsa&&!z[t+" "]&&(!F||!F.test(t))){if(1!==g)u=e,m=t;else if("object"!==e.nodeName.toLowerCase()){for((r=e.getAttribute("id"))?r=r.replace(bt,"\\$&"):e.setAttribute("id",r=B),p=w(t),s=p.length,c=ht.test(r)?"#"+r:"[id='"+r+"']";s--;)p[s]=c+" "+h(p[s]);m=p.join(","),u=ft.test(t)&&l(e.parentNode)||e}if(m)try{return X.apply(i,u.querySelectorAll(m)),i}catch(t){}finally{r===B&&e.removeAttribute("id")}}}return A(t.replace(st,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>y.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[B]=!0,t}function o(t){var e=M.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=i.length;n--;)y.attrHandle[i[n]]=e}function a(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||W)-(~t.sourceIndex||W);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function r(t){return n(function(e){return e=+e,n(function(i,n){for(var o,s=t([],i.length,e),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function h(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function d(t,e,i){var n=e.dir,o=i&&"parentNode"===n,s=O++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,s)}:function(e,i,a){var r,l,c,h=[N,s];if(a){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(c=e[B]||(e[B]={}),l=c[e.uniqueID]||(c[e.uniqueID]={}),(r=l[n])&&r[0]===N&&r[1]===s)return h[2]=r[2];if(l[n]=h,h[2]=t(e,i,a))return!0}}}function p(t){return t.length>1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function m(t,i,n){for(var o=0,s=i.length;o<s;o++)e(t,i[o],n);return n}function u(t,e,i,n,o){for(var s,a=[],r=0,l=t.length,c=null!=e;r<l;r++)(s=t[r])&&(i&&!i(s,n,o)||(a.push(s),c&&e.push(r)));return a}function g(t,e,i,o,s,a){return o&&!o[B]&&(o=g(o)),s&&!s[B]&&(s=g(s,a)),n(function(n,a,r,l){var c,h,d,p=[],g=[],f=a.length,b=n||m(e||"*",r.nodeType?[r]:r,[]),C=!t||!n&&e?b:u(b,p,t,r,l),v=i?s||(n?t:f||o)?[]:a:C;if(i&&i(C,v,r,l),o)for(c=u(v,g),o(c,[],r,l),h=c.length;h--;)(d=c[h])&&(v[g[h]]=!(C[g[h]]=d));if(n){if(s||t){if(s){for(c=[],h=v.length;h--;)(d=v[h])&&c.push(C[h]=d);s(null,v=[],c,l)}for(h=v.length;h--;)(d=v[h])&&(c=s?J(n,d):p[h])>-1&&(n[c]=!(a[c]=d))}}else v=u(v===a?v.splice(f,v.length):v),s?s(null,a,v,l):X.apply(a,v)})}function f(t){for(var e,i,n,o=t.length,s=y.relative[t[0].type],a=s||y.relative[" "],r=s?1:0,l=d(function(t){return t===e},a,!0),c=d(function(t){return J(e,t)>-1},a,!0),m=[function(t,i,n){var o=!s&&(n||i!==T)||((e=i).nodeType?l(t,i,n):c(t,i,n));return e=null,o}];r<o;r++)if(i=y.relative[t[r].type])m=[d(p(m),i)];else{if(i=y.filter[t[r].type].apply(null,t[r].matches),i[B]){for(n=++r;n<o&&!y.relative[t[n].type];n++);return g(r>1&&p(m),r>1&&h(t.slice(0,r-1).concat({value:" "===t[r-2].type?"*":""})).replace(st,"$1"),i,r<n&&f(t.slice(r,n)),n<o&&f(t=t.slice(n)),n<o&&h(t))}m.push(i)}return p(m)}function b(t,i){var o=i.length>0,s=t.length>0,a=function(n,a,r,l,c){var h,d,p,m=0,g="0",f=n&&[],b=[],C=T,v=n||s&&y.find.TAG("*",c),Line truncated
|
||||||
|
return void 0!==ot&&ot.event.triggered!==e.type?ot.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(vt)||[""],c=e.length;c--;)r=Rt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m&&(d=ot.event.special[m]||{},m=(o?d.delegateType:d.bindType)||m,d=ot.event.special[m]||{},h=ot.extend({type:m,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:u.join(".")},s),(p=l[m])||(p=l[m]=[],p.delegateCount=0,d.setup&&!1!==d.setup.call(t,n,u,a)||t.addEventListener&&t.addEventListener(m,a)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),ot.event.global[m]=!0)},remove:function(t,e,i,n,o){var s,a,r,l,c,h,d,p,m,u,g,f=wt.hasData(t)&&wt.get(t);if(f&&(l=f.events)){for(e=(e||"").match(vt)||[""],c=e.length;c--;)if(r=Rt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m){for(d=ot.event.special[m]||{},m=(n?d.delegateType:d.bindType)||m,p=l[m]||[],r=r[2]&&new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)h=p[s],!o&&g!==h.origType||i&&i.guid!==h.guid||r&&!r.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,d.remove&&d.remove.call(t,h));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,u,f.handle)||ot.removeEvent(t,m,f.handle),delete l[m])}else for(m in l)ot.event.remove(t,m+e[c],i,n,!0);ot.isEmptyObject(l)&&wt.remove(t,"handle events")}},dispatch:function(t){t=ot.event.fix(t);var e,i,n,o,s,a=[],r=X.call(arguments),l=(wt.get(this,"events")||{})[t.type]||[],c=ot.event.special[t.type]||{};if(r[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(a=ot.event.handlers.call(this,t,l),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(s.namespace)||(t.handleObj=s,t.data=s.data,void 0!==(n=((ot.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,r))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,s,a=[],r=e.delegateCount,l=t.target;if(r&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i<r;i++)s=e[i],o=s.selector+" ",void 0===n[o]&&(n[o]=s.needsContext?ot(o,this).index(l)>-1:ot.find(o,this,null,[l]).length),n[o]&&n.push(s);n.length&&a.push({elem:l,handlers:n})}return r<e.length&&a.push({elem:this,handlers:e.slice(r)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,o,s=e.button;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||Y,n=i.documentElement,o=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===s||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[ot.expando])return t;var e,i,n,o=t.type,s=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Bt.test(o)?this.mouseHooks:Lt.test(o)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,t=new ot.Event(s),e=n.length;e--;)i=n[e],t[i]=s[i];return t.target||(t.target=Y),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,s):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&ot.nodeName(this,"input"))return this.click(),!1},_default:function(t){return ot.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},ot.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},ot.Event=function(t,e){if(!(this instanceof ot.Event))return new ot.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?m:u):this.type=t,e&&ot.extend(this,e),this.timeStamp=t&&t.timeStamp||ot.now(),this[ot.expando]=!0},ot.Event.prototype={constructor:ot.Event,isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=m,t&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagatiLine truncated
|
||||||
|
ot.isArray(t)||t.jquery&&!ot.isPlainObject(t))ot.each(t,function(){o(this.name,this.value)});else for(i in t)j(i,t[i],e,o);return n.join("&").replace(ke,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ot.prop(this,"elements");return t?ot.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ot(this).is(":disabled")&&De.test(this.nodeName)&&!Me.test(t)&&(this.checked||!Dt.test(t))}).map(function(t,e){var i=ot(this).val();return null==i?null:ot.isArray(i)?ot.map(i,function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}}):{name:e.name,value:i.replace(Ee,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Pe={0:200,1223:204},Fe=ot.ajaxSettings.xhr();nt.cors=!!Fe&&"withCredentials"in Fe,nt.ajax=Fe=!!Fe,ot.ajaxTransport(function(e){var i,n;if(nt.cors||Fe&&!e.crossDomain)return{send:function(o,s){var a,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)r[a]=e.xhrFields[a];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===t?r.abort():"error"===t?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Pe[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ot.globalEval(t),t}}}),ot.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ot.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ot("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&o("error"===t.type?404:200,t.type)}),Y.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Ue=[],Ve=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ue.pop()||ot.expando+"_"+ge++;return this[t]=!0,t}}),ot.ajaxPrefilter("json jsonp",function(e,i,n){var o,s,a,r=!1!==e.jsonp&&(Ve.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ve.test(e.data)&&"data");if(r||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,r?e[r]=e[r].replace(Ve,"$1"+o):!1!==e.jsonp&&(e.url+=(fe.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||ot.error(o+" was not called"),a[0]},e.dataTypes[0]="json",s=t[o],t[o]=function(){a=arguments},n.always(function(){void 0===s?ot(t).removeProp(o):t[o]=s,e[o]&&(e.jsonpCallback=i.jsonpCallback,Ue.push(o)),a&&ot.isFunction(s)&&s(a[0]),a=s=void 0}),"script"}),ot.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||Y;var n=mt.exec(t),o=!i&&[];return n?[e.createElement(n[1])]:(n=p([t],e,o),o&&o.length&&ot(o).remove(),ot.merge([],n.childNodes))};var Le=ot.fn.load;ot.fn.load=function(t,e,i){if("string"!=typeof t&&Le)return Le.apply(this,arguments);var n,o,s,a=this,r=t.indexOf(" ");return r>-1&&(n=ot.trim(t.slice(r)),t=t.slice(0,r)),ot.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&ot.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){s=arguments,a.html(n?ot("<div>").append(ot.parseHTML(t)).find(n):t)}).always(i&&function(t,e){a.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ot.fn[e]=function(t){return this.on(e,t)}}),ot.expr.filters.animated=function(t){return ot.grep(ot.timers,function(e){return t===e.elem}).length},ot.offset={setOffset:function(t,e,i){var n,o,s,a,r,l,c,h=ot.css(t,"position"),d=ot(t),p={};"static"===h&&(t.style.position="relative"),r=d.offset(),s=ot.css(t,"top"),l=ot.css(t,"left"),c=("absolute"===h||"fixed"===h)&&(s+l).indexOf("auto")>-1,c?(n=d.position(),a=n.top,o=n.left):(a=parseFloat(s)||0,o=parseFloat(l)||0),ot.isFunction(e)&&(e=e.call(t,i,ot.extend({},r))),null!=e.top&&(p.top=e.top-r.top+a),null!=e.left&&(p.left=e.left-r.left+o),"using"in e?e.using.call(t,p):d.css(p)}},ot.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ot.offset.setOffset(this,t,e)});var e,i,Line truncated
|
||||||
|
i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(e,n){var o=this.$element.find(".item.active"),s=n||this.getItemForDirection(e,o),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],h=t.Event("slide.bs.carousel",{relatedTarget:c,direction:r});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=t(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var p=t.Event("slid.bs.carousel",{relatedTarget:c,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,o.addClass(r),s.addClass(r),o.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),o.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(p)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),a&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var o=function(i){var n,o=t(this),s=t(o.attr("data-target")||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),o.data()),r=o.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),function(t){"use strict";function e(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(n)}function i(e){return this.each(function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},n.DEFAULTS,i.data(),"object"==typeof e&&e);!o&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),o||i.data("bs.collapse",o=new n(this,s)),"string"==typeof e&&o[e]()})}var n=function(e,i){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.7",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(e=o.data("bs.collapse"))&&e.transitioning)){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),e||o.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[a](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",t.proxy(o,this)).emulateTransitionEnd(n.TRANSITION_DURATION)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,n){var o=t(n);this.addAriaAndCollapsedClass(e(o),o)},this)).end()},n.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hLine truncated
|
||||||
|
this[t]=this[t]||{}},this)},initialize:function(){},onReady:function(){this.start()},start:function(){this.initializeControllers(this.controllers||{}),this.launchControllers(),this.launch.call(this)},getClasseRefs:function(e,i){var n={},o=this.allocationMap[e],s=this[o];return _.each(i,function(e){n[e]=t(e,e.indexOf(".")>-1?window:s)},this),n},initializeControllers:function(e){this.controllers={},_.each(e,function(e){var i=e.indexOf(".")>-1?window:this[this.allocationMap.controller],n=t(e,i),o=(e.split(".").pop(),new n({id:e,application:this}));o.views=this.getClasseRefs("view",o.views||[]),_.extend(this.models,this.getClasseRefs("model",o.models||[])),_.extend(this.collections,this.getClasseRefs("collection",o.collections||{})),this.buildCollections(),this.controllers[e]=o},this)},launchControllers:function(){_.each(this.controllers,function(t,e){t.onLaunch(this)},this)},launch:function(){},addListeners:function(t,e){this.eventbus.addListeners(t,e)},getController:function(t){return this.controllers[t]},getModel:function(t){this._modelsCache=this._modelsCache||{};var e=this._modelsCache[t],i=this.getModelConstructor(t);return!e&&i&&(e=this.createModel(t),this._modelsCache[t]=e),e||null},getModelConstructor:function(t){return this.models[t]},createModel:function(t,e){var i=this.getModelConstructor(t),n=null;return i&&(n=new i(_.extend(e||{}))),n},getCollection:function(t){this._collectionsCache=this._collectionsCache||{};var e=this._collectionsCache[t],i=this.getCollectionConstructor(t);return!e&&i&&(e=this.createCollection(t),this._collectionsCache[t]=e),e||null},getCollectionConstructor:function(t){return this.collections[t]},createCollection:function(t){var e=this.getCollectionConstructor(t),i=null;return e&&(i=new e),i},buildCollections:function(){_.each(this.collections,function(t,e){this.getCollection(e)},this)}}),void 0!==Backbone.Application)throw"Native Backbone.Application instance already defined.";Backbone.Application=e,Backbone.Application.extend=Backbone.Model.extend;var i=function(t){_.extend(this,t||{}),this.initialize.apply(this,arguments)};if(_.extend(i.prototype,{name:null,views:{},models:{},collections:{},initialize:function(t){},addListeners:function(t){this.getApplication().addListeners(t,this)},onLaunch:function(t){},getApplication:function(){return this.application},getView:function(t){return this._viewsCache[t]},getViewConstructor:function(t){return this.views[t]},createView:function(t,e){var i=this.getViewConstructor(t),n=_.extend(e||{},{alias:t});return this._viewsCache=this._viewsCache||{},this._viewsCache[t]=new i(n),this._viewsCache[t].options=_.extend({},n),this._viewsCache[t]},getModel:function(t){return this.application.getModel(t)},getModelConstructor:function(t){return this.application.getModelConstructor(t)},createModel:function(t,e){return this.application.createModel(t)},getCollection:function(t){return this.application.getCollection(t)},getCollectionConstructor:function(t){return this.application.getCollectionConstructor(t)},createCollection:function(t){return this.application.createCollection(t)},fireEvent:function(t,e,i){this.application.eventbus.fireEvent(t,e,i)},bindViewEvents:function(t,e){this.unbindViewEvents(t),e=_.isFunction(e)?e.call(this):e;for(var i in e){var n=e[i];_.isFunction(n)||(n=this[e[i]]);var o=i.match(/^(\S+)\s*(.*)$/),s=o[1],a=o[2];n=_.bind(n,this),s+=".bindViewEvents"+t.cid,t.$el.on(s,a,n)}return this},unbindViewEvents:function(t){return t.$el.off(".bindViewEvents"+t.cid),this}}),void 0!==Backbone.Controller)throw"Native Backbone.Controller instance already defined.";Backbone.Controller=i,Backbone.Controller.extend=Backbone.Model.extend;var n=function(t){var e=this;_.extend(this,t||{}),_.extend(Backbone.View.prototype,{alias:null,hidden:!1,getAlias:function(){return this.options.alias},fireEvent:function(t,i){this.trigger.apply(this,arguments),e.fireEvent(this.getAlias(),t,i)},hide:function(){this.$el.hide(),this.hidden=!0},show:function(){this.$el.show(),this.hidden=!1}})};if(_.extend(n.prototype,{pool:{},addListeners:function(t,e){this.pool[e.id]=this.pool[e.id]||{};var i=this.pool[e.id];_.isArray(t)?_.each(t,function(t){this.addListeners(t,e)},this):_.isObject(t)&&_.each(t,function(t,e){_.each(t,function(t,n){i[e]=i[e]||{},i[e][n]=i[e][n]||[],i[e][n].push(t)},this)},this)},fireEvent:function(t,e,i){var n=this.getApplication();_.each(this.pool,function(o,s){var a=o[t];if(a){var r=a[e],l=n.getController(s);_.each(r,function(t){t.apply(l,i)})}},this)},getApplication:function(){return this.application}}),void 0!==Backbone.EventBus)throw"Native Backbone.Application instance already defined.";Backbone.EventBus=n}(),define("core",["backbone","notification"],function(){}),void 0===Common)var Common={};if(Common.component=Common.component||{},Common.Analytics=Common.component.Analytics=new function(){var t;return{initialize:function(e,i){if(void 0===e)throw"Analytics: invalid id.";if(void 0===i||"[object String]"!==Object.prototype.toString.apply(i))tLine truncated
|
||||||
|
this.$window.append(_.template(n)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(r,this),e&&e.length>1&&(this.initConfig.minwidth=e[0]),e&&e.length>1&&(this.initConfig.minheight=e[1]),i&&i.length>1&&(this.initConfig.maxwidth=i[0]),i&&i.length>1&&(this.initConfig.maxheight=i[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=t}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">',"<label>"+this.textName+"</label>","</div>",'<div id="id-dlg-newname" class="input-row"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this;t.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!/[\t*\+:\"<>?|\\\\\/]/gim.test(e)||t.txtInvalidName+'*+:"<>?|/'}});var e=this.getChild();e.find(".btn").on("click",_.bind(this.onBtnClick,this)),t.inputNameEl=e.find("input"),t.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputName.setValue(t.options.filename),t.inputNameEl.focus().select()},100)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputName.checkValidate())return void this.inputNameEl.focus();this.options.handler.call(this,t,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(t,e){"use strict";Common.Views.Header=t.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(e),events:{"click #header-logo":function(t){var e=this.branding&&this.branding.logo&&this.branding.logo.url?this.branding.logo.url:"http://www.onlyoffice.com",i=window.open(e);i&&i.focus()}},initialize:function(t){this.options=this.options?_({}).extend(this.options,t):t,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var t=new Common.UI.MenuItem({caption:this.openNewTabText}).on("click",function(t,e){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[t]})},setVisible:function(t){t?this.show():this.hide()},setBranding:function(t){var e;this.branding=t,t&&t.logo&&t.logo.image&&(e=$("#header-logo"))&&(e.html('<img src="'+t.logo.image+'" style="max-width:86px; max-height:20px; margin: 0 8px 0 15px;"/>'),e.css({"background-image":"none",width:"auto"}))},setHeaderCaption:function(t){this.headerCaption=t;var e=$("#header-caption > div");return e&&e.html(t),t},getHeaderCaption:function(){return this.headerCaption},setDocumentCaption:function(t,e){void 0!==e&&(this.isModified=e),this.documentCaption=t,t||(t=""),this.isModified&&(t+="*");var i=$("#header-documentcaption div");return i&&i.html(Common.Utils.String.htmlEncode(t)),t},getDocumentCaption:function(){return this.documentCaption},setCanBack:function(t){this.canBack=t;var e=$("#header-back");e&&(e.off("mouseup"),e.css("display",t?"table-cell":"none"),t&&e.on("mouseup",_.bind(this.onBackClick,this)))Line truncated
|
||||||
|
this.getChild().find(".btn").on("click",_.bind(this.onBtnClick,this)),this.autoSize()},autoSize:function(){var t=this.getChild(".box"),e=this.getChild(".footer"),i=this.getChild(".header"),n=this.getChild(".body");n.height(parseInt(t.height())+parseInt(e.css("height"))),this.setHeight(parseInt(n.css("height"))+parseInt(i.css("height")))},onBtnClick:function(t){this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close()},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&(this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close())},getSettings:function(){return"checked"==this.chDontShow.getValue()},textTitle:"Copy, Cut and Paste Actions",textMsg:"Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",textToCopy:"for Copy",textToPaste:"for Paste",textToCut:"for Cut",textDontShow:"Don't show this message again"},Common.Views.CopyWarningDialog||{}))}),$(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api","[data-toggle=dropdown], [role=menu]",onDropDownKeyDown),function(){function t(t){1!=t.which&&void 0!=t.which||clearMenus(/form-control/.test(t.target.className))}var e,i=$._data($(document).get(0),"events");i&&i.click&&i.click.every(function(t,i,n){return/click/.test(t.type)&&!t.selector&&/bs\..+\.dropdown/.test(t.namespace)&&(e=t.handler),!e}),e&&$(document).off("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",t)}(),define("common/main/lib/extend/Bootstrap",function(){}),void 0===Common)var Common={};if(define("common/main/lib/component/ToggleManager",["common/main/lib/component/BaseView"],function(){"use strict";function t(t,i){var n,o,s;if(i)for(n=e[t.toggleGroup],o=0,s=n.length;o<s;o++)n[o]!==t&&(n[o].isActive?n[o].isActive()&&n[o].toggle(!1):n[o].toggle(!1))}var e={};Common.UI.ToggleManager={register:function(i){if(i.toggleGroup){var n=e[i.toggleGroup];n||(n=e[i.toggleGroup]=[]),n.push(i),i.on("toggle",t)}},unregister:function(i){if(i.toggleGroup){var n=e[i.toggleGroup];n&&(_.without(n,i),i.off("toggle",t))}},getToggled:function(t){var i,n=e[t],o=0;if(n)for(i=n.length;o<i;o++)if(!0===n[o].pressed||!0===n[o].checked)return n[o];return null}}}),void 0===Common)var Common={};if(define("common/main/lib/component/MenuItem",["common/main/lib/component/BaseView","common/main/lib/component/ToggleManager"],function(){"use strict";Common.UI.MenuItem=Common.UI.BaseView.extend({options:{id:null,cls:"",style:"",hint:!1,checkable:!1,checked:!1,allowDepress:!1,disabled:!1,value:null,toggleGroup:null,iconCls:"",menu:null,canFocused:!0},tagName:"li",template:_.template(['<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; %> >',"<% if (!_.isEmpty(iconCls)) { %>",'<span class="menu-item-icon <%= iconCls %>"></span>',"<% } %>","<%= caption %>","</a>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);this.id=e.options.id||Common.UI.getId(),this.cls=e.options.cls,this.style=e.options.style,this.caption=e.options.caption,this.menu=e.options.menu||null,this.checkable=e.options.checkable,this.checked=e.options.checked,e.allowDepress=e.options.allowDepress,this.disabled=e.options.disabled,this.value=e.options.value,this.toggleGroup=e.options.toggleGroup,this.template=e.options.template||this.template,this.iconCls=e.options.iconCls,this.rendered=!1,null===this.menu||this.menu instanceof Common.UI.Menu||(this.menu=new Common.UI.Menu(_.extend({},e.options.menu))),e.options.el&&this.render()},render:function(){var t=this,e=$(this.el);if(t.trigger("render:before",t),"--"===t.caption)e.addClass("divider");else if(!this.rendered){e.off("click"),Common.UI.ToggleManager.unregister(t),$(this.el).html(this.template({id:t.id,caption:t.caption,iconCls:t.iconCls,style:t.style,options:t.options})),t.menu&&(e.addClass("dropdown-submenu"),t.menu.render($(this.el)),e.mouseenter(_.bind(t.menu.alignPosition,t.menu)),e.focusout(_.bind(t.onBlurItem,t)),e.hover(_.bind(t.onHoverItem,t),_.bind(t.onUnHoverItem,t)));var i=e.children(":first");this.checkable&&i&&(i.toggleClass("checkable",this.checkable),i.toggleClass("checked",this.checked),_.isEmpty(this.iconCls)||i.css("background-image","none")),this.disabled&&$(this.el).toggleClass("disabled",this.disabled),e.on("click",_.bind(this.onItemClick,this)),e.on("mousedown",_.bind(this.onItemMouseDown,this)),Common.UI.ToggleManager.register(t)}return t.cmpEl=$(this.el),t.rendered=!0,t.trigger("render:after",t),this},setCaption:function(t,e){this.caption=t,this.rendered&&(this.cmpEl.find("a").contents().last()[0].textContent=e?t:Common.Utils.String.htmlEncode(t))},setChecked:function(t,e){thLine truncated
|
||||||
|
value:"row-height"}]})}),e.pmiColumnWidth=new Common.UI.MenuItem({caption:e.txtColumnWidth,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:e.txtAutoColumnWidth,value:"auto-column-width"},{caption:e.txtCustomColumnWidth,value:"column-width"}]})}),e.pmiEntireHide=new Common.UI.MenuItem({caption:e.txtHide}),e.pmiEntireShow=new Common.UI.MenuItem({caption:e.txtShow}),e.pmiAddComment=new Common.UI.MenuItem({id:"id-context-menu-item-add-comment",caption:e.txtAddComment}),e.pmiCellMenuSeparator=new Common.UI.MenuItem({caption:"--"}),e.pmiAddNamedRange=new Common.UI.MenuItem({id:"id-context-menu-item-add-named-range",caption:e.txtAddNamedRange}),e.pmiFreezePanes=new Common.UI.MenuItem({caption:e.textFreezePanes}),e.pmiEntriesList=new Common.UI.MenuItem({caption:e.textEntriesList}),e.pmiSparklines=new Common.UI.MenuItem({caption:e.txtSparklines,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:e.txtClearSparklines,value:Asc.c_oAscCleanOptions.Sparklines},{caption:e.txtClearSparklineGroups,value:Asc.c_oAscCleanOptions.SparklineGroups}]})}),e.ssMenu=new Common.UI.Menu({id:"id-context-menu-cell",items:[e.pmiCut,e.pmiCopy,e.pmiPaste,{caption:"--"},e.pmiSelectTable,e.pmiInsertEntire,e.pmiInsertCells,e.pmiInsertTable,e.pmiDeleteEntire,e.pmiDeleteCells,e.pmiDeleteTable,e.pmiClear,{caption:"--"},e.pmiSparklines,e.pmiSortCells,e.pmiFilterCells,e.pmiReapply,{caption:"--"},e.pmiAddComment,e.pmiCellMenuSeparator,e.pmiEntriesList,e.pmiAddNamedRange,e.pmiInsFunction,e.menuAddHyperlink,e.menuHyperlink,e.pmiRowHeight,e.pmiColumnWidth,e.pmiEntireHide,e.pmiEntireShow,e.pmiFreezePanes]}),e.mnuGroupImg=new Common.UI.MenuItem({caption:this.txtGroup,iconCls:"mnu-group",type:"group",value:"grouping"}),e.mnuUnGroupImg=new Common.UI.MenuItem({caption:this.txtUngroup,iconCls:"mnu-ungroup",type:"group",value:"ungrouping"}),e.mnuShapeSeparator=new Common.UI.MenuItem({caption:"--"}),e.mnuShapeAdvanced=new Common.UI.MenuItem({caption:e.advancedShapeText}),e.mnuImgAdvanced=new Common.UI.MenuItem({caption:e.advancedImgText}),e.mnuChartEdit=new Common.UI.MenuItem({caption:e.chartText}),e.pmiImgCut=new Common.UI.MenuItem({caption:e.txtCut,value:"cut"}),e.pmiImgCopy=new Common.UI.MenuItem({caption:e.txtCopy,value:"copy"}),e.pmiImgPaste=new Common.UI.MenuItem({caption:e.txtPaste,value:"paste"}),this.imgMenu=new Common.UI.Menu({items:[e.pmiImgCut,e.pmiImgCopy,e.pmiImgPaste,{caption:"--"},{caption:this.textArrangeFront,iconCls:"mnu-arrange-front",type:"arrange",value:Asc.c_oAscDrawingLayerType.BringToFront},{caption:this.textArrangeBack,iconCls:"mnu-arrange-back",type:"arrange",value:Asc.c_oAscDrawingLayerType.SendToBack},{caption:this.textArrangeForward,iconCls:"mnu-arrange-forward",type:"arrange",value:Asc.c_oAscDrawingLayerType.BringForward},{caption:this.textArrangeBackward,iconCls:"mnu-arrange-backward",type:"arrange",value:Asc.c_oAscDrawingLayerType.SendBackward},{caption:"--"},e.mnuGroupImg,e.mnuUnGroupImg,e.mnuShapeSeparator,e.mnuChartEdit,e.mnuShapeAdvanced,e.mnuImgAdvanced]}),this.menuParagraphVAlign=new Common.UI.MenuItem({caption:this.vertAlignText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[e.menuParagraphTop=new Common.UI.MenuItem({caption:e.topCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Top}),e.menuParagraphCenter=new Common.UI.MenuItem({caption:e.centerCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Center}),this.menuParagraphBottom=new Common.UI.MenuItem({caption:e.bottomCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Bottom})]})}),e.menuParagraphDirection=new Common.UI.MenuItem({caption:e.directionText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[e.menuParagraphDirectH=new Common.UI.MenuItem({caption:e.directHText,iconCls:"mnu-direct-horiz",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.normal}),e.menuParagraphDirect90=new Common.UI.MenuItem({caption:e.direct90Text,iconCls:"mnu-direct-rdown",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.vert}),e.menuParagraphDirect270=new Common.UI.MenuItem({caption:e.direct270Text,iconCls:"mnu-direct-rup",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.vert270})]})}),e.menuAddHyperlinkShape=new Common.UI.MenuItem({caption:e.txtInsHyperlink}),e.menuEditHyperlinkShape=new Common.UI.MenuItem({caption:e.editHyperlinkText}),e.menuRemoveHyperlinkShape=new Common.UI.MenuItem({caption:e.removeHyperlinkText}),e.menuHyperlinkShape=new Common.UI.MenuItem({caption:e.txtInsHyperlink,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[e.menuEditHyperlinkShape,e.menuRemoveHyperlinkShape]})}),this.pmiTextAdvanced=new Common.UI.MenuItem({caption:e.txtTextAdvanced}),e.pmiTextCut=new Common.UI.MenuItem({caption:e.txtCut,value:"cut"}),e.pmiTextCopy=new Common.UI.MenuItem({caption:e.txtCopy,value:"copy"}),e.pmiTextPaste=new Common.UI.MenuItem({caption:eLine truncated
|
||||||
|
el:$("#id-dlg-hyperlink-sheet"),cls:"input-group-nr",editable:!1,menuStyle:"min-width: 100%;max-height: 150px;"}),e.inputUrl=new Common.UI.InputField({el:$("#id-dlg-hyperlink-url"),allowBlank:!1,blankError:e.txtEmpty,validateOnBlur:!1,style:"width: 100%;",validation:function(t){var i=e.api.asc_getUrlType($.trim(t));return e.isEmail=2==i,i>0||e.txtNotUrl}}),e.inputRange=new Common.UI.InputField({el:$("#id-dlg-hyperlink-range"),allowBlank:!1,blankError:e.txtEmpty,style:"width: 100%;",validateOnChange:!0,validateOnBlur:!1,validation:function(t){var i=/^[A-Z]+[1-9]\d*:[A-Z]+[1-9]\d*$/.test(t);return i||(i=/^[A-Z]+[1-9]\d*$/.test(t)),!!i||e.textInvalidRange}}),e.inputDisplay=new Common.UI.InputField({el:$("#id-dlg-hyperlink-display"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"}),e.inputTip=new Common.UI.InputField({el:$("#id-dlg-hyperlink-tip"),style:"width: 100%;",maxLength:Asc.c_oAscMaxTooltipLength}),t.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),t.find("input").on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.focusedInput&&t.focusedInput.focus()},500)},setSettings:function(t){if(t){this.cmbSheets.setData(t.sheets),t.props?(this.cmbLinkType.setValue(t.props.asc_getType()),this.cmbLinkType.setDisabled(!t.allowInternal),t.props.asc_getType()==Asc.c_oAscHyperlinkType.RangeLink?($("#id-dlg-hyperlink-external").hide(),$("#id-dlg-hyperlink-internal").show(),this.cmbSheets.setValue(t.props.asc_getSheet()),this.inputRange.setValue(t.props.asc_getRange()),this.focusedInput=this.inputRange.cmpEl.find("input")):(this.inputUrl.setValue(t.props.asc_getHyperlinkUrl().replace(new RegExp(" ","g"),"%20")),this.focusedInput=this.inputUrl.cmpEl.find("input"),this.cmbSheets.setValue(t.currentSheet)),this.inputDisplay.setValue(t.isLock?this.textDefault:t.props.asc_getText()),this.inputTip.setValue(t.props.asc_getTooltip())):(this.cmbLinkType.setValue(Asc.c_oAscHyperlinkType.WebLink),this.cmbLinkType.setDisabled(!t.allowInternal),this.inputDisplay.setValue(t.isLock?this.textDefault:t.text),this.focusedInput=this.inputUrl.cmpEl.find("input"),this.cmbSheets.setValue(t.currentSheet)),this.inputDisplay.setDisabled(t.isLock)}},getSettings:function(){var t=new Asc.asc_CHyperlink,e="";if(t.asc_setType(this.cmbLinkType.getValue()),this.cmbLinkType.getValue()==Asc.c_oAscHyperlinkType.RangeLink)t.asc_setSheet(this.cmbSheets.getValue()),t.asc_setRange(this.inputRange.getValue()),e=this.cmbSheets.getValue()+"!"+this.inputRange.getValue();else{var i=this.inputUrl.getValue().replace(/^\s+|\s+$/g,"");/(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(i)||(i=(this.isEmail?"mailto:":"http://")+i),i=i.replace(new RegExp("%20","g")," "),t.asc_setHyperlinkUrl(i),e=i}return this.inputDisplay.isDisabled()?t.asc_setText(null):(_.isEmpty(this.inputDisplay.getValue())&&this.inputDisplay.setValue(e),t.asc_setText(this.inputDisplay.getValue())),t.asc_setTooltip(this.inputTip.getValue()),t},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onKeyPress:function(t){if(t.keyCode==Common.UI.Keys.RETURN)return this._handleInput("ok"),!1},_handleInput:function(t){if(this.options.handler){if("ok"==t){var e=this.cmbLinkType.getValue()!==Asc.c_oAscHyperlinkType.WebLink||this.inputUrl.checkValidate(),i=this.cmbLinkType.getValue()!==Asc.c_oAscHyperlinkType.RangeLink||this.inputRange.checkValidate(),n=this.inputDisplay.checkValidate();if(!0!==e)return void this.inputUrl.cmpEl.find("input").focus();if(!0!==i)return void this.inputRange.cmpEl.find("input").focus();if(!0!==n)return void this.inputDisplay.cmpEl.find("input").focus()}this.options.handler.call(this,this,t)}this.close()},textTitle:"Hyperlink Settings",textInternalLink:"Internal Data Range",textExternalLink:"Web Link",textEmptyLink:"Enter link here",textEmptyDesc:"Enter caption here",textEmptyTooltip:"Enter tooltip here",strSheet:"Sheet",strRange:"Range",textLinkType:"Link Type",strDisplay:"Display",textTipText:"Screen Tip Text",strLinkTo:"Link To",txtEmpty:"This field is required",textInvalidRange:"ERROR! Invalid cells range",txtNotUrl:'This field should be a URL in the format "http://www.example.com"',cancelButtonText:"Cancel",textDefault:"Selected range"},SSE.Views.HyperlinkSettingsDialog||{}))}),define("text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.template",[],function(){return'<div id="id-adv-paragraph-indents" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="3" style="width: 100%;">\r\n <tr>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsFirstLine %></label>\r\n <div id="paragraphadv-spin-first-line" style="width: 85px;"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.strIndentsLeftText %></label>\r\n Line truncated
|
||||||
|
this.dataViewItems.push(n),t.get("tip")){var a=$(n.el);a.attr("data-toggle","tooltip"),a.tooltip({title:t.get("tip"),placement:"cursor",zIndex:this.tipZIndex})}this.listenTo(n,"change",this.onChangeItem),this.listenTo(n,"remove",this.onRemoveItem),this.listenTo(n,"click",this.onClickItem),this.listenTo(n,"dblclick",this.onDblClickItem),this.listenTo(n,"select",this.onSelectItem),this.listenTo(n,"contextmenu",this.onContextMenuItem),this.isSuspendEvents||this.trigger("item:add",this,n,t)}}},onResetItems:function(){_.each(this.dataViewItems,function(t){var e=t.$el.data("bs.tooltip");e&&e.tip().remove()},this),$(this.el).html(this.template({groups:this.groups?this.groups.toJSON():null,style:this.style})),_.isUndefined(this.scroller)||(this.scroller.destroy(),delete this.scroller),this.store.length<1&&this.emptyText.length>0&&$(this.el).find(".inner").andSelf().filter(".inner").append('<table cellpadding="10" class="empty-text"><tr><td>'+this.emptyText+"</td></tr></table>"),_.each(this.dataViewItems,function(t){this.stopListening(t),t.stopListening(t.model)},this),this.dataViewItems=[],this.store.each(this.onAddItem,this),this.allowScrollbar&&(this.scroller=new Common.UI.Scroller({el:$(this.el).find(".inner").andSelf().filter(".inner"),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,wheelSpeed:10})),this.attachKeyEvents(),this.lastSelectedRec=null,this._layoutParams=void 0},onChangeItem:function(t,e){this.isSuspendEvents||this.trigger("item:change",this,t,e)},onRemoveItem:function(t,e){if(this.stopListening(t),t.stopListening(),this.store.length<1&&this.emptyText.length>0){var i=$(this.el).find(".inner").andSelf().filter(".inner");i.find(".empty-text").length<=0&&i.append('<table cellpadding="10" class="empty-text"><tr><td>'+this.emptyText+"</td></tr></table>")}for(var n=0;n<this.dataViewItems.length;n++)if(_.isEqual(t,this.dataViewItems[n])){this.dataViewItems.splice(n,1);break}this.isSuspendEvents||this.trigger("item:remove",this,t,e)},onClickItem:function(t,e,i){if(!this.disabled){window._event=i,this.showLast&&this.selectRecord(e),this.lastSelectedRec=null;var n=t.$el.data("bs.tooltip");n&&n.tip().remove(),this.isSuspendEvents||this.trigger("item:click",this,t,e,i)}},onDblClickItem:function(t,e,i){this.disabled||(window._event=i,this.selectRecord(e),this.lastSelectedRec=null,this.isSuspendEvents||this.trigger("item:dblclick",this,t,e,i))},onSelectItem:function(t,e,i){this.isSuspendEvents||this.trigger(i?"item:select":"item:deselect",this,t,e,this._fromKeyDown)},onContextMenuItem:function(t,e,i){this.isSuspendEvents||this.trigger("item:contextmenu",this,t,e,i)},scrollToRecord:function(t){var e=$(this.el).find(".inner"),i=e.offset().top,n=_.indexOf(this.store.models,t),o=n>=0&&this.dataViewItems.length>n?$(this.dataViewItems[n].el):e.find("#"+t.get("id"));if(!(o.length<=0)){var s=o.offset().top;(s<i||s+o.outerHeight()>i+e.height())&&(this.scroller&&this.allowScrollbar?this.scroller.scrollTop(e.scrollTop()+s-i,0):e.scrollTop(e.scrollTop()+s-i))}},onKeyDown:function(t,e){if(!this.disabled)if(void 0===e&&(e=t),_.indexOf(this.moveKeys,e.keyCode)>-1||e.keyCode==Common.UI.Keys.RETURN){e.preventDefault(),e.stopPropagation();var i=this.getSelectedRec()[0];if(null===this.lastSelectedRec&&(this.lastSelectedRec=i),e.keyCode==Common.UI.Keys.RETURN)this.lastSelectedRec=null,this.selectedBeforeHideRec&&(i=this.selectedBeforeHideRec),this.trigger("item:click",this,this,i,t),this.trigger("item:select",this,this,i,t),this.trigger("entervalue",this,i,t),this.parentMenu&&this.parentMenu.hide();else{var n=_.indexOf(this.store.models,i);if(n<0)if(e.keyCode==Common.UI.Keys.LEFT){var o=$(t.target).closest(".dropdown-submenu.over");o.length>0?(o.removeClass("over"),o.find("> a").focus()):n=0}else n=0;else if("both"==this.options.keyMoveDirection){void 0===this._layoutParams&&this.fillIndexesArray();var s=this.dataViewItems[n].topIdx,a=this.dataViewItems[n].leftIdx;if(n=void 0,e.keyCode==Common.UI.Keys.LEFT)for(;void 0===n;){if(--a<0){var o=$(t.target).closest(".dropdown-submenu.over");if(o.length>0){o.removeClass("over"),o.find("> a").focus();break}a=this._layoutParams.columns-1}n=this._layoutParams.itemsIndexes[s][a]}else if(e.keyCode==Common.UI.Keys.RIGHT)for(;void 0===n;)a++,a>this._layoutParams.columns-1&&(a=0),n=this._layoutParams.itemsIndexes[s][a];else if(e.keyCode==Common.UI.Keys.UP)for(;void 0===n;)s--,s<0&&(s=this._layoutParams.rows-1),n=this._layoutParams.itemsIndexes[s][a];else for(;void 0===n;)s++,s>this._layoutParams.rows-1&&(s=0),n=this._layoutParams.itemsIndexes[s][a]}else n=e.keyCode==Common.UI.Keys.UP||e.keyCode==Common.UI.Keys.LEFT?Math.max(0,n-1):Math.min(this.store.length-1,n+1);void 0!==n&&n>=0&&(i=this.store.at(n)),i&&(this._fromKeyDown=!0,this.selectRecord(i),this._fromKeyDown=!1,this.scrollToRecord(i))}}else this.trigger("item:keydown",this,i,t)},attachKeyEvents:function(){if(this.enableKeyEvents&&this.handleSelect){var t=$(this.el).find(".inner").andSelf().filter(".inner");t.addCLine truncated
|
||||||
|
n.addClass(i.selectedCls),i.value="transparent",i.trigger("select",i,"transparent");else if((!/^[a-fA-F0-9]{6}$/.test(i.value)||_.indexOf(i.colors,i.value)<0)&&(i.value=!1),$(i.el).find("div."+i.selectedCls).removeClass(i.selectedCls),n.addClass(i.selectedCls),e=n[0].className.match(i.colorRe)[1],n.hasClass("palette-color-effect")){var o=parseInt(n.attr("effectid"));e&&(i.value=e.toUpperCase(),i.trigger("select",i,{color:e,effectId:o}))}else/#?[a-fA-F0-9]{6}/.test(e)&&(e=/#?([a-fA-F0-9]{6})/.exec(e)[1].toUpperCase(),i.value=e,i.trigger("select",i,e))},select:function(t,e){var i=$(this.el);if(i.find("div."+this.selectedCls).removeClass(this.selectedCls),t)if("object"==typeof t){var n;void 0!==t.effectId?(n=i.find('div[effectid="'+t.effectId+'"]').first(),n.length>0?(n.addClass(this.selectedCls),this.value=n[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1):void 0!==t.effectValue&&(n=i.find('div[effectvalue="'+t.effectValue+'"].color-'+t.color.toUpperCase()).first(),n.length>0?(n.addClass(this.selectedCls),this.value=n[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1)}else if(/#?[a-fA-F0-9]{6}/.test(t)&&(t=/#?([a-fA-F0-9]{6})/.exec(t)[1].toUpperCase(),this.value=t),/^[a-fA-F0-9]{6}|transparent$/.test(t)&&_.indexOf(this.colors,t)>=0)_.indexOf(this.colors,this.value)<0&&(this.value=!1),(t!=this.value||this.options.allowReselect)&&("transparent"==t?i.find("div.color-transparent").addClass(this.selectedCls):i.find("div.palette-color.color-"+t).first().addClass(this.selectedCls),this.value=t,!0!==e&&this.fireEvent("select",this,t));else{var o=i.find("#"+t).first();0==o.length&&(o=i.find('div[color="'+t+'"]').first()),o.length>0&&(o.addClass(this.selectedCls),this.value=t.toUpperCase())}},updateColors:function(t){void 0!==t&&(this.colors=t,this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,colors:this.colors})),$(this.el).html(this.cmpEl),this.cmpEl.on("click",_.bind(this.handleClick,this)))},clearSelection:function(t){$(this.el).find("div."+this.selectedCls).removeClass(this.selectedCls),this.value=void 0}})}),define("spreadsheeteditor/main/app/view/AutoFilterDialog",["common/main/lib/component/Window","common/main/lib/component/ColorPaletteExt"],function(){"use strict";SSE.Views=SSE.Views||{},SSE.Views.DigitalFilterDialog=Common.UI.Window.extend(_.extend({initialize:function(t){var e=this,i={};_.extend(i,{width:501,height:230,contentWidth:180,header:!0,cls:"filter-dlg",contentTemplate:"",title:e.txtTitle,items:[]},t),this.template=t.template||['<div class="box" style="height:'+(i.height-85)+'px;">','<div class="content-panel" >','<label class="header">',e.textShowRows,"</label>",'<div style="margin-top:15px;">','<div id="id-search-begin-digital-combo" class="input-group-nr" style="vertical-align:top;width:225px;display:inline-block;"></div>','<div id="id-sd-cell-search-begin" class="" style="width:225px;display:inline-block;margin-left:18px;"></div>',"</div>","<div>",'<div id="id-and-radio" class="padding-small" style="display: inline-block; margin-top:10px;"></div>','<div id="id-or-radio" class="padding-small" style="display: inline-block; margin-left:25px;"></div>',"</div>",'<div style="margin-top:10px;">','<div id="id-search-end-digital-combo" class="input-group-nr" style="vertical-align:top;width:225px;display:inline-block;"></div>','<div id="id-sd-cell-search-end" class="" style="width:225px;display:inline-block;margin-left:18px;"></div>',"</div>","</div>","</div>",'<div class="separator horizontal" style="width:100%"></div>','<div class="footer right" style="margin-left:-15px;">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right:10px;">',e.okButtonText,"</button>",'<button class="btn normal dlg-btn" result="cancel">',e.cancelButtonText,"</button>","</div>"].join(""),this.api=t.api,this.handler=t.handler,this.type=t.type||"number",i.tpl=_.template(this.template,i),Common.UI.Window.prototype.initialize.call(this,i)},render:function(){Common.UI.Window.prototype.render.call(this),this.conditions=[{value:Asc.c_oAscCustomAutoFilter.equals,displayValue:this.capCondition1},{value:Asc.c_oAscCustomAutoFilter.doesNotEqual,displayValue:this.capCondition2},{value:Asc.c_oAscCustomAutoFilter.isGreaterThan,displayValue:this.capCondition3},{value:Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo,displayValue:this.capCondition4},{value:Asc.c_oAscCustomAutoFilter.isLessThan,displayValue:this.capCondition5},{value:Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo,displayValue:this.capCondition6}],"text"==this.type&&(this.conditions=this.conditions.concat([{value:Asc.c_oAscCustomAutoFilter.beginsWith,displayValue:this.capCondition7},{value:Asc.c_oAscCustomAutoFilter.doesNotBeginWith,displayValue:this.capCondition8},{value:Asc.c_oAscCustomAutoFilter.endsWith,displayValue:this.capCondition9},{value:Asc.c_oAscCustomAutoFilter.doesNotEndWith,displayValue:this.capCondition10},{value:Asc.c_oAscCustomAutoFilter.contains,displayValue:this.capCondition11},{value:ALine truncated
|
||||||
|
null===b.asc_getCellColor()?(this.miFilterCellColor.setChecked(!0,!0),this.mnuFilterColorCellsPicker.select(C||"transparent",!0)):!1===b.asc_getCellColor()&&(this.miFilterFontColor.setChecked(!0,!0),this.mnuFilterColorFontPicker.select(C||"000000",!0))}else if(i||n){var v=i?t.asc_getFilter().asc_getType():null,g=this.miNumFilter.menu.items;g.forEach(function(t){t.setChecked(i&&t.options.type==Asc.c_oAscAutoFilterTypes.DynamicFilter&&t.value==v||n&&t.options.type==Asc.c_oAscAutoFilterTypes.Top10,!0)})}this.miClear.setDisabled(this.initialFilterType===Asc.c_oAscAutoFilterTypes.None),this.miReapply.setDisabled(this.initialFilterType===Asc.c_oAscAutoFilterTypes.None),this.btnOk.setDisabled(this.initialFilterType!==Asc.c_oAscAutoFilterTypes.Filters&&this.initialFilterType!==Asc.c_oAscAutoFilterTypes.None)},setupDataCells:function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}var e,i,n=this,o=0,s=2,a=!0,r=!1,l=0,c=[],h=[],d=n.filter?n.filteredIndexes:n.throughIndexes;this.configTo.asc_getValues().forEach(function(r){i=r.asc_getText(),e=t(i),a=!0,n.filter?(null===i.match(n.filter)&&(a=!1),d[s]=a):void 0==d[s]&&(d[s]=r.asc_getVisible()),a?(c.push(new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,cellvalue:i,value:e?i:i.length>0?i:n.textEmptyItem,intval:e?parseFloat(i):void 0,strval:e?"":i,groupid:"1",check:d[s],throughIndex:s})),d[s]&&l++):h.push(new Common.UI.DataViewModel({cellvalue:i})),++s}),l==c.length?r=!0:l>0&&(r="indeterminate"),(n.filter||void 0==d[0])&&(d[0]=!0),(!n.filter||c.length>0)&&c.unshift(new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,value:n.filter?this.textSelectAllResults:this.textSelectAll,groupid:"0",check:d[0],throughIndex:0})),n.filter&&c.length>1&&(void 0==d[1]&&(d[1]=!1),c.splice(1,0,new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,value:this.textAddSelection,groupid:"2",check:d[1],throughIndex:1}))),this.cells.reset(c),this.filterExcludeCells.reset(h),this.cells.length&&(this.checkCellTrigerBlock=!0,this.cells.at(0).set("check",r),this.checkCellTrigerBlock=void 0),this.btnOk.setDisabled(this.cells.length<1),this.cellsList.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0,suppressScrollX:!0})},testFilter:function(){var t=this,e=!1;return this.cells&&(this.filter&&this.filteredIndexes[1]?e=!0:this.cells.forEach(function(t){if("1"==t.get("groupid")&&t.get("check"))return e=!0,!0})),e||(t._skipCheckDocumentClick=!0,Common.UI.warning({title:this.textWarning,msg:this.warnNoSelected,callback:function(){t._skipCheckDocumentClick=!1,_.delay(function(){t.input.$el.find("input").focus()},100,this)}})),e},save:function(){if(this.api&&this.configTo&&this.cells&&this.filterExcludeCells){var t=this.configTo.asc_getValues(),e=!1;if(this.filter&&this.filteredIndexes[1])this.initialFilterType===Asc.c_oAscAutoFilterTypes.CustomFilters&&t.forEach(function(t,e){t.asc_setVisible(!0)}),this.cells.each(function(e){"1"==e.get("groupid")&&t[parseInt(e.get("throughIndex"))-2].asc_setVisible(e.get("check"))}),t.forEach(function(t,i){if(t.asc_getVisible())return e=!0,!0});else{var i=this.filter?this.filteredIndexes:this.throughIndexes;t.forEach(function(t,e){t.asc_setVisible(i[e+2])}),e=!0}e&&(this.configTo.asc_getFilterObj().asc_setType(Asc.c_oAscAutoFilterTypes.Filters),this.api.asc_applyAutoFilter(this.configTo))}},onPrimary:function(){return this.save(),this.close(),!1},okButtonText:"Ok",btnCustomFilter:"Custom Filter",textSelectAll:"Select All",txtTitle:"Filter",warnNoSelected:"You must choose at least one value",textWarning:"Warning",cancelButtonText:"Cancel",textEmptyItem:"{Blanks}",txtEmpty:"Enter cell's filter",txtSortLow2High:"Sort Lowest to Highest",txtSortHigh2Low:"Sort Highest to Lowest",txtSortCellColor:"Sort by cells color",txtSortFontColor:"Sort by font color",txtNumFilter:"Number filter",txtTextFilter:"Text filter",txtFilterCellColor:"Filter by cells color",txtFilterFontColor:"Filter by font color",txtClear:"Clear",txtReapply:"Reapply",txtEquals:"Equals...",txtNotEquals:"Does not equal...",txtGreater:"Greater than...",txtGreaterEquals:"Greater than or equal to...",txtLess:"Less than...",txtLessEquals:"Less than or equal to...",txtBetween:"Between...",txtTop10:"Top 10",txtAboveAve:"Above average",txtBelowAve:"Below average",txtBegins:"Begins with...",txtNotBegins:"Does not begin with...",txtEnds:"Ends with...",txtNotEnds:"Does not end with...",txtContains:"Contains...",txtNotContains:"Does not contain...",textSelectAllResults:"Select All Search Results",textAddSelection:"Add current selection to filter"},SSE.Views.AutoFilterDialog||{}))}),define("spreadsheeteditor/main/app/controller/DocumentHolder",["core","common/main/lib/util/utils","common/main/lib/view/CopyWarningDialog","spreadsheeteditor/main/app/view/DocumentHolder","spreadsheeteditor/main/app/view/HyperlinkSettingsDialog","spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced","spreadsheeteditor/main/app/view/ImageSettingsAdvanced","spreadsheeteditor/main/app/view/SetValLine truncated
|
||||||
|
p.pmiImgPaste.setDisabled(f),p.mnuImgAdvanced.setVisible(l&&!h&&!r),p.mnuImgAdvanced.setDisabled(f),e&&this.showPopupMenu(p.imgMenu,{},i),p.mnuShapeSeparator.setVisible(p.mnuShapeAdvanced.isVisible()||p.mnuChartEdit.isVisible()||p.mnuImgAdvanced.isVisible())}else if(c||d){if(!e&&!p.textInShapeMenu.isVisible())return;p.pmiTextAdvanced.textInfo=void 0;for(var x=this.api.asc_getGraphicObjectProps(),T=!1,w=0;w<x.length;w++){var k=x[w].asc_getObjectType();if(k==Asc.c_oAscTypeSelectElement.Image){var I=x[w].asc_getObjectValue(),E=I.asc_getVerticalTextAlign(),M=I.asc_getVert();f=f||I.asc_getLocked(),p.menuParagraphTop.setChecked(E==Asc.c_oAscVAlign.Top),p.menuParagraphCenter.setChecked(E==Asc.c_oAscVAlign.Center),p.menuParagraphBottom.setChecked(E==Asc.c_oAscVAlign.Bottom),p.menuParagraphDirectH.setChecked(M==Asc.c_oAscVertDrawingText.normal),p.menuParagraphDirect90.setChecked(M==Asc.c_oAscVertDrawingText.vert),p.menuParagraphDirect270.setChecked(M==Asc.c_oAscVertDrawingText.vert270)}else k==Asc.c_oAscTypeSelectElement.Paragraph?(p.pmiTextAdvanced.textInfo=x[w].asc_getObjectValue(),f=f||p.pmiTextAdvanced.textInfo.asc_getLocked()):k==Asc.c_oAscTypeSelectElement.Math&&(this._currentMathObj=x[w].asc_getObjectValue(),T=!0)}var D=t.asc_getHyperlink(),P=this.api.asc_canAddShapeHyperlink();p.menuHyperlinkShape.setVisible(c&&!1!==P&&D),p.menuAddHyperlinkShape.setVisible(c&&!1!==P&&!D),p.menuParagraphVAlign.setVisible(!0!==d&&!T),p.menuParagraphDirection.setVisible(!0!==d&&!T),p.pmiTextAdvanced.setVisible(void 0!==p.pmiTextAdvanced.textInfo),_.each(p.textInShapeMenu.items,function(t){t.setDisabled(f)}),p.pmiTextCopy.setDisabled(!1);this._currentParaObjDisabled=f,T?this.addEquationMenu(4):this.clearEquationMenu(4),e&&this.showPopupMenu(p.textInShapeMenu,{},i),p.textInShapeMenu.items[3].setVisible(p.menuHyperlinkShape.isVisible()||p.menuAddHyperlinkShape.isVisible()||p.menuParagraphVAlign.isVisible()||T)}else if(!this.permissions.isEditMailMerge&&!this.permissions.isEditDiagram||m!==Asc.c_oAscSelectionType.RangeImage&&m!==Asc.c_oAscSelectionType.RangeShape&&m!==Asc.c_oAscSelectionType.RangeChart&&m!==Asc.c_oAscSelectionType.RangeChartText&&m!==Asc.c_oAscSelectionType.RangeShapeText){if(!e&&!p.ssMenu.isVisible())return;var F=this.api.isCellEdited,U=t.asc_getFormatTableInfo(),V=null!==t.asc_getSparklineInfo(),L=null!==U,B=t.asc_getFlags().asc_getMultiselect();p.ssMenu.formatTableName=L?U.asc_getTableName():null,p.ssMenu.cellColor=t.asc_getFill().asc_getColor(),p.ssMenu.fontColor=t.asc_getFont().asc_getColor(),p.pmiInsertEntire.setVisible(o||s),p.pmiInsertEntire.setCaption(o?this.textInsertTop:this.textInsertLeft),p.pmiDeleteEntire.setVisible(o||s),p.pmiInsertCells.setVisible(n&&!F&&!L),p.pmiDeleteCells.setVisible(n&&!F&&!L),p.pmiSelectTable.setVisible(n&&!F&&L),p.pmiInsertTable.setVisible(n&&!F&&L),p.pmiDeleteTable.setVisible(n&&!F&&L),p.pmiSparklines.setVisible(V),p.pmiSortCells.setVisible((n||a||v)&&!F),p.pmiFilterCells.setVisible((n||v)&&!F),p.pmiReapply.setVisible((n||a||v)&&!F),p.ssMenu.items[12].setVisible((n||a||v||V)&&!F),p.pmiInsFunction.setVisible(n||C),p.pmiAddNamedRange.setVisible(n&&!F),L&&(p.pmiInsertTable.menu.items[0].setDisabled(!U.asc_getIsInsertRowAbove()),p.pmiInsertTable.menu.items[1].setDisabled(!U.asc_getIsInsertRowBelow()),p.pmiInsertTable.menu.items[2].setDisabled(!U.asc_getIsInsertColumnLeft()),p.pmiInsertTable.menu.items[3].setDisabled(!U.asc_getIsInsertColumnRight()),p.pmiDeleteTable.menu.items[0].setDisabled(!U.asc_getIsDeleteRow()),p.pmiDeleteTable.menu.items[1].setDisabled(!U.asc_getIsDeleteColumn()),p.pmiDeleteTable.menu.items[2].setDisabled(!U.asc_getIsDeleteTable()));var D=t.asc_getHyperlink();p.menuHyperlink.setVisible(n&&D&&!F&&!B),p.menuAddHyperlink.setVisible(n&&!D&&!F&&!B),p.pmiRowHeight.setVisible(o||a),p.pmiColumnWidth.setVisible(s||a),p.pmiEntireHide.setVisible(s||o),p.pmiEntireShow.setVisible(s||o),p.pmiFreezePanes.setVisible(!F),p.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane()?p.textUnFreezePanes:p.textFreezePanes),p.pmiEntriesList.setVisible(!F),p.ssMenu.items[17].setVisible(n&&!F&&this.permissions.canCoAuthoring&&this.permissions.canComments),p.pmiAddComment.setVisible(n&&!F&&this.permissions.canCoAuthoring&&this.permissions.canComments),p.pmiCellMenuSeparator.setVisible(n||o||s||a||C),p.pmiEntireHide.isrowmenu=o,p.pmiEntireShow.isrowmenu=o,p.setMenuItemCommentCaptionMode(t.asc_getComments().length<1,this.permissions.canEditComments),b&&b.blockPopover(!0),p.pmiClear.menu.items[1].setDisabled(F),p.pmiClear.menu.items[2].setDisabled(F),p.pmiClear.menu.items[3].setDisabled(F),p.pmiClear.menu.items[4].setDisabled(F),p.pmiClear.menu.items[3].setVisible(!this.permissions.isEditDiagram),p.pmiClear.menu.items[4].setVisible(!this.permissions.isEditDiagram);var R=t.asc_getAutoFilterInfo(),N=!!R&&R.asc_getIsApplyAutoFilter();R=R?R.asc_getIsAutoFilter():null,p.pmiInsertCells.menu.items[0].setDisabled(N),p.pmiDeleteCells.menu.items[0].setDisabled(N),p.pmiInLine truncated
|
||||||
|
txtGroupCharUnder:"Char under text",txtDeleteGroupChar:"Delete char",txtHideDegree:"Hide degree",txtShowDegree:"Show degree",txtIncreaseArg:"Increase argument size",txtDecreaseArg:"Decrease argument size",txtInsertBreak:"Insert manual break",txtDeleteBreak:"Delete manual break",txtAlignToChar:"Align to character",txtDeleteRadical:"Delete radical",txtDeleteChars:"Delete enclosing characters",txtDeleteCharsAndSeparators:"Delete enclosing characters and separators",insertText:"Insert",alignmentText:"Alignment",leftText:"Left",rightText:"Right",centerText:"Center",insertRowAboveText:"Row Above",insertRowBelowText:"Row Below",insertColumnLeftText:"Column Left",insertColumnRightText:"Column Right",deleteText:"Delete",deleteRowText:"Delete Row",deleteColumnText:"Delete Column",txtNoChoices:"There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.",txtExpandSort:"The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?",txtExpand:"Expand and sort",txtSorting:"Sorting",txtSortSelected:"Sort selected",txtPaste:"Paste",txtPasteFormulas:"Paste only formula",txtPasteFormulaNumFormat:"Formula + number format",txtPasteKeepSourceFormat:"Formula + all formatting",txtPasteBorders:"Formula without borders",txtPasteColWidths:"Formula + column width",txtPasteMerge:"Merge conditional formatting",txtPasteTranspose:"Transpose",txtPasteValues:"Paste only value",txtPasteValNumFormat:"Value + number format",txtPasteValFormat:"Value + all formatting",txtPasteFormat:"Paste only formatting",txtPasteLink:"Paste Link",txtPastePicture:"Picture",txtPasteLinkPicture:"Linked Picture",txtPasteSourceFormat:"Source formatting",txtPasteDestFormat:"Destination formatting"},SSE.Controllers.DocumentHolder||{}))}),define("text!spreadsheeteditor/main/app/template/CellEditor.template",[],function(){return'<div class="ce-group-name">\r\n <input id="ce-cell-name" class="aslabel form-control" type="text">\r\n <div id="ce-cell-name-menu"></div>\r\n <button id="ce-func-label" type="button" class="btn small btn-toolbar"><span class="btn-icon"> </span></button>\r\n</div>\r\n<div class="ce-group-expand">\r\n <button id="ce-btn-expand" type="button" class="btn"><span class="caret img-commonctrl"> </span></button>\r\n</div>\r\n<div class="ce-group-content">\r\n <textarea id="ce-cell-content" class="form-control" spellcheck="false" rows="1" cols="20"></textarea>\r\n</div>\r\n'}),define("spreadsheeteditor/main/app/view/CellEditor",["text!spreadsheeteditor/main/app/template/CellEditor.template","common/main/lib/component/BaseView"],function(t){"use strict";SSE.Views.CellEditor=Common.UI.BaseView.extend(_.extend({template:_.template(t),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t)},render:function(){$(this.el).html(this.template()),this.btnNamedRanges=new Common.UI.Button({menu:new Common.UI.Menu({style:"min-width: 70px;max-width:400px;",maxHeight:250,items:[{caption:this.textManager,value:"manager"},{caption:"--"}]}).on("render:after",function(t){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40})}).on("show:after",function(){this.scroller.update({alwaysVisibleY:!0})})}),this.btnNamedRanges.render($("#ce-cell-name-menu")),this.btnNamedRanges.setVisible(!1),this.btnNamedRanges.menu.setOffset(-55),this.$cellname=$("#ce-cell-name",this.el),this.$btnexpand=$("#ce-btn-expand",this.el),this.$btnfunc=$("#ce-func-label",this.el);var t=this;return this.$cellname.on("focusin",function(e){t.$cellname.select().one("mouseup",function(t){t.preventDefault()})}),this.$btnfunc.addClass("disabled"),this.$btnfunc.tooltip({title:this.tipFormula,placement:"cursor"}),this},updateCellInfo:function(t){t&&this.$cellname.val("string"==typeof t?t:t.asc_getName())},cellNameDisabled:function(t){t?this.$cellname.attr("disabled","disabled"):this.$cellname.removeAttr("disabled"),this.btnNamedRanges.setDisabled(t)},tipFormula:"Insert Function",textManager:"Manager"},SSE.Views.CellEditor||{}))}),define("text!spreadsheeteditor/main/app/template/NameManagerDlg.template",[],function(){return'<div class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textFilter %></label>\r\n <div id="name-manager-combo-filter" class="input-group-nr" style="width:210px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2>\r\n <div style="width: 169px;display: inline-block;"><span id="name-manager-sort-name" class="header-sorted">\r\n <label class="header"><%= scope.textRanges %></label><div sLine truncated
|
||||||
|
Accent_BorderBoxCustom:134283265,Accent_BarTop:134348800,Accent_BarBot:134348801,Accent_Custom_1:134414336,Accent_Custom_2:134414337,Accent_Custom_3:134414338,LimitLog_LogBase:150994944,LimitLog_Log:150994945,LimitLog_Lim:150994946,LimitLog_Min:150994947,LimitLog_Max:150994948,LimitLog_Ln:150994949,LimitLog_Custom_1:151060480,LimitLog_Custom_2:151060481,Operator_ColonEquals:167772160,Operator_EqualsEquals:167772161,Operator_PlusEquals:167772162,Operator_MinusEquals:167772163,Operator_Definition:167772164,Operator_UnitOfMeasure:167772165,Operator_DeltaEquals:167772166,Operator_ArrowL_Top:167837696,Operator_ArrowR_Top:167837697,Operator_ArrowL_Bot:167837698,Operator_ArrowR_Bot:167837699,Operator_DoubleArrowL_Top:167837700,Operator_DoubleArrowR_Top:167837701,Operator_DoubleArrowL_Bot:167837702,Operator_DoubleArrowR_Bot:167837703,Operator_ArrowD_Top:167837704,Operator_ArrowD_Bot:167837705,Operator_DoubleArrowD_Top:167837706,Operator_DoubleArrowD_Bot:167837707,Operator_Custom_1:167903232,Operator_Custom_2:167903233,Matrix_1_2:184549376,Matrix_2_1:184549377,Matrix_1_3:184549378,Matrix_3_1:184549379,Matrix_2_2:184549380,Matrix_2_3:184549381,Matrix_3_2:184549382,Matrix_3_3:184549383,Matrix_Dots_Center:184614912,Matrix_Dots_Baseline:184614913,Matrix_Dots_Vertical:184614914,Matrix_Dots_Diagonal:184614915,Matrix_Identity_2:184680448,Matrix_Identity_2_NoZeros:184680449,Matrix_Identity_3:184680450,Matrix_Identity_3_NoZeros:184680451,Matrix_2_2_RoundBracket:184745984,Matrix_2_2_SquareBracket:184745985,Matrix_2_2_LineBracket:184745986,Matrix_2_2_DLineBracket:184745987,Matrix_Flat_Round:184811520,Matrix_Flat_Square:184811521}}),define("text!spreadsheeteditor/main/app/template/Toolbar.template",[],function(){return'<div class="toolbar" style="<%= (isCompactView || isEditDiagram || isEditMailMerge) ? \'height: 41px;\' : \'height: 67px;\' %>">\n \x3c!-----------------------\x3e\n \x3c!-- Edit diagram mode --\x3e\n \x3c!-----------------------\x3e\n <div id="id-toolbar-diagramm" style="<%= isEditDiagram ? \'display: table;\' : \'display: none;\' %> width: 100%;" >\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-copy"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-paste"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-undo"></span>\n <span class="btn-placeholder" id="id-toolbar-diagram-placeholder-btn-redo"></span>\n </div>\n </div>\n <div class="separator short"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-formula"></span>\n </div>\n </div>\n <div class="separator short" style="margin-left: 5px;"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-digit-dec"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-digit-inc"></span>\n <span class="btn-placeholder" id="id-toolbar-diagram-placeholder-btn-format" style="width: 84px; margin-left: 10px; vertical-align: middle;"></span>\n </div>\n </div>\n <div class="separator short"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder border" id="id-toolbar-diagram-placeholder-btn-chart" style="width: auto;"></span>\n </div>\n </div>\n <div class="toolbar-group" style="width: 100%;"></div>\n </div>\n \x3c!-----------------------\x3e\n \x3c!-- Edit mail merge mode --\x3e\n \x3c!-----------------------\x3e\n <div id="id-toolbar-merge" style="<%= isEditMailMerge ? \'display: table;\' : \'display: none;\' %> width: 100%;" >\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-merge-placeholder-btn-copy"></span>\n <span class="btn-placeholder split" id="id-toolbar-merge-placeholder-btn-paste"></span>\n <span class="btn-placeholder split" id="id-toolbar-merge-placeholder-btn-undo"></span>\n <span class="btn-placeholder" id="id-toolbar-merge-placeholder-btn-redo"></span>\n </div>\n </div>\n <div class="separator short"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-merge-placeholder-btn-sortdesc"></span>\n <span class="btn-placeholder" id="id-toolbar-merge-placeholder-btn-sortasc"></span>\n </div>\n </div>\n <div class="separator short" style="margLine truncated
|
||||||
|
$(document).on("mousemove",g)},C=function(t,e,i){$(document).off("mouseup",C),$(document).off("mousemove",g),g(t)},v=function(t,e,i){$(document).on("mouseup",y),$(document).on("mousemove",f),f(t)},y=function(t,e,i){$(document).off("mouseup",y),$(document).off("mousemove",f)},_=function(t){var e=new Common.util.RGBColor(c.color).toHSB();m(e,!0)},x=function(t){var m,g=$(c.el);g&&(e=g.find(".cnt-hb-arrow"),i=g.find(".cnt-sat-arrow"),n=g.find(".cnt-hb"),o=g.find(".cnt-sat"),s=g.find(".color-value"),r=g.find(".color-text"),l=g.find(".empty-color"),s.length>0&&(a=s.find(".transparent-color")),n.length>0&&(n.off("mousedown"),n.on("mousedown",b)),o.length>0&&(o.off("mousedown"),o.on("mousedown",v)),l.length>0&&(l.off("click"),l.on("click",_)),m="transparent"==c.color?{h:0,s:100,b:100}:new Common.Utils.RGBColor(c.color).toHSB(),h=m.h,d=m.s,p=m.b,h==d&&h==p&&0==h&&(d=100),u())};c.setColor=function(t){if(c.color!=t){var e;e="transparent"==t?{h:0,s:100,b:100}:new Common.Utils.RGBColor(t).toHSB(),h=e.h,d=e.s,p=e.b,h==d&&h==p&&0==h&&(d=100),c.color=t,u()}},c.getColor=function(){return c.color},c.on("render:after",x),c.render()},render:function(){return $(this.el).html(this.template()),this.trigger("render:after",this),this},textNoColor:"No Color"})}),void 0===Common)var Common={};if(define("common/main/lib/component/MaskedField",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.MaskedField=Common.UI.BaseView.extend({options:{maskExp:"",maxLength:999},initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this,i=$(this.el);i.addClass("masked-field user-select"),i.attr("maxlength",e.options.maxLength),i.on("keypress",function(t){var n=String.fromCharCode(t.which);e.options.maskExp.test(n)||t.ctrlKey||t.keyCode===Common.UI.Keys.DELETE||t.keyCode===Common.UI.Keys.BACKSPACE||t.keyCode===Common.UI.Keys.LEFT||t.keyCode===Common.UI.Keys.RIGHT||t.keyCode===Common.UI.Keys.HOME||t.keyCode===Common.UI.Keys.END||t.keyCode===Common.UI.Keys.ESC||t.keyCode===Common.UI.Keys.INSERT||t.keyCode===Common.UI.Keys.TAB||(t.keyCode==Common.UI.Keys.RETURN&&e.trigger("changed",e,i.val()),t.preventDefault(),t.stopPropagation())}),i.on("input",function(t){e.trigger("change",e,i.val())}),i.on("blur",function(t){e.trigger("changed",e,i.val())})},render:function(){return this},setValue:function(t){this.options.maskExp.test(t)&&t.length<=this.options.maxLength&&$(this.el).val(t)},getValue:function(){$(this.el).val()}})}),void 0===Common)var Common={};if(define("common/main/lib/view/ExtendedColorDialog",["text!common/main/lib/template/ExtendedColorDialog.template","common/main/lib/component/HSBColorPicker","common/main/lib/component/MetricSpinner","common/main/lib/component/MaskedField","common/main/lib/component/Window"],function(t){"use strict";Common.UI.ExtendedColorDialog=Common.UI.Window.extend(_.extend({tpl:_.template(t),options:{},rendered:!1,initialize:function(t){Common.UI.Window.prototype.initialize.call(this,{cls:"extended-color-dlg",tpl:this.tpl({txtNew:this.textNew,txtCurrent:this.textCurrent,txtAdd:this.addButtonText,txtCancel:this.cancelButtonText}),header:!1,width:340,height:272}),this.hexRe=/\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/},render:function(){function t(t){e.trigger("onmodalresult",parseInt(t.currentTarget.attributes.result.value)),e.close(!0)}var e=this;return Common.UI.Window.prototype.render.call(this),this.colorsPicker=new Common.UI.HSBColorPicker({el:$("#id-hsb-colorpicker"),showCurrentColor:!1}),this.colorsPicker.on("changecolor",_.bind(this.onChangeColor,this)),this.colorNew=$("#field-new-color"),this.colorSaved=$("#field-start-color"),this.spinR=new Common.UI.MetricSpinner({el:$("#extended-spin-r"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:1,maskExp:/[0-9]/,allowDecimal:!1}),this.spinG=new Common.UI.MetricSpinner({el:$("#extended-spin-g"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:2,maskExp:/[0-9]/,allowDecimal:!1}),this.spinB=new Common.UI.MetricSpinner({el:$("#extended-spin-b"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:3,maskExp:/[0-9]/,allowDecimal:!1}),this.textColor=new Common.UI.MaskedField({el:$("#extended-text-color"),width:55,maskExp:/[a-fA-F0-9]/,maxLength:6}),this.spinR.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,1)),this.spinG.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,2)),this.spinB.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,3)),this.textColor.on("change",_.bind(this.onChangeMaskedField,this)),this.textColor.on("changed",_.bind(this.onChangedMaskedField,this)),this.textColor.$el.attr("tabindex",4),this.spinR.$el.find("input").attr("maxlength",3),this.spinG.$el.find("input").attr("maxlength",3),this.spinB.$el.find("input").attr("maxlength",3),this.on("close",function(){e.triLine truncated
|
||||||
|
itemTemplate:_.template(['<div class="style" id="<%= id %>">','<img src="<%= imageUrl %>" width="'+this.itemWidth+'" height="'+this.itemHeight+'"/>','<% if (typeof title !== "undefined") {%>','<span class="title"><%= title %></span>',"<% } %>","</div>"].join(""))}),setInterval(_.bind(this.checkSize,this),500),this.options.el&&this.render()},render:function(t){if(!this.rendered){var e=this;e.trigger("render:before",e),e.cmpEl=$(e.el);var i=e.template({id:e.id,cls:e.cls,style:e.style});t?(e.setElement(t,!1),e.cmpEl=$(i),t.html(e.cmpEl)):e.cmpEl.html(i),e.rootWidth=e.cmpEl.width(),e.rootHeight=e.cmpEl.height(),e.fieldPicker.render($(".view",e.cmpEl)),e.openButton.render($(".button",e.cmpEl)),e.menuPicker.render($(".menu-picker-container",e.cmpEl)),e.openButton.menu.cmpEl&&e.openButton.menu.cmpEl&&(e.openButton.menu.menuAlignEl=e.cmpEl,e.openButton.menu.cmpEl.css("min-width",e.itemWidth),e.openButton.menu.on("show:before",_.bind(e.onBeforeShowMenu,e)),e.openButton.menu.on("show:after",_.bind(e.onAfterShowMenu,e)),e.openButton.cmpEl.on("hide.bs.dropdown",_.bind(e.onBeforeHideMenu,e)),e.openButton.cmpEl.on("hidden.bs.dropdown",_.bind(e.onAfterHideMenu,e))),e.options.hint&&(e.cmpEl.attr("data-toggle","tooltip"),e.cmpEl.tooltip({title:e.options.hint,placement:e.options.hintAnchor||"cursor"})),e.fieldPicker.on("item:select",_.bind(e.onFieldPickerSelect,e)),e.menuPicker.on("item:select",_.bind(e.onMenuPickerSelect,e)),e.fieldPicker.on("item:click",_.bind(e.onFieldPickerClick,e)),e.menuPicker.on("item:click",_.bind(e.onMenuPickerClick,e)),e.fieldPicker.on("item:contextmenu",_.bind(e.onPickerItemContextMenu,e)),e.menuPicker.on("item:contextmenu",_.bind(e.onPickerItemContextMenu,e)),e.fieldPicker.el.addEventListener("contextmenu",_.bind(e.onPickerComboContextMenu,e),!1),e.menuPicker.el.addEventListener("contextmenu",_.bind(e.onPickerComboContextMenu,e),!1),e.onResize(),e.rendered=!0,e.trigger("render:after",e)}return this},checkSize:function(){if(this.cmpEl&&this.cmpEl.is(":visible")){var t=this,e=this.cmpEl.width(),i=this.cmpEl.height();this.rootWidth==e&&this.rootHeight==i||(this.rootWidth=e,this.rootHeight=i,setTimeout(function(){t.openButton.menu.cmpEl.outerWidth(),t.rootWidth=t.cmpEl.width()},10),this.onResize())}},onResize:function(){if(this.openButton){var t=$("button",this.openButton.cmpEl);t&&t.css({width:$(".button",this.cmpEl).width(),height:$(".button",this.cmpEl).height()}),this.openButton.menu.hide();var e=this.menuPicker;if(e){var i=e.getSelectedRec();i&&(i=i[0],this.fillComboView(i||e.store.at(0),!!i,!0)),e.onResize()}}this.isSuspendEvents||this.trigger("resize",this)},onBeforeShowMenu:function(t){var e=this;if(_.isFunction(e.beforeOpenHandler))e.beforeOpenHandler(e,t);else if(e.openButton.menu.cmpEl){var i=0;try{var n=$($(".dropdown-menu .dataview.inner .style",e.cmpEl)[0]);i=n?parseInt(n.css("margin-left"))+parseInt(n.css("margin-right")):0}catch(t){}e.openButton.menu.cmpEl.css({width:Math.round((e.cmpEl.width()+i*e.fieldPicker.store.length)/e.itemWidth-.2)*(e.itemWidth+i),"min-height":this.cmpEl.height()})}if(e.options.hint){var o=e.cmpEl.data("bs.tooltip");o&&(void 0===o.dontShow&&(o.dontShow=!0),o.hide())}this.menuPicker.selectedBeforeHideRec=null},onBeforeHideMenu:function(t){if(this.trigger("hide:before",this,t),Common.UI.Scroller.isMouseCapture()&&t.preventDefault(),this.isStylesNotClosable)return!1},onAfterShowMenu:function(t){var e=this;e.menuPicker.scroller&&e.menuPicker.scroller.update({includePadding:!0,suppressScrollX:!0,alwaysVisibleY:!0})},onAfterHideMenu:function(t,e){this.menuPicker.selectedBeforeHideRec=this.menuPicker.getSelectedRec()[0],this.showLast?this.menuPicker.showLastSelected():this.menuPicker.deselectAll(),this.trigger("hide:after",this,t,e)},onFieldPickerSelect:function(t,e,i){},onMenuPickerSelect:function(t,e,i,n){this.needFillComboView=this.disabled,this.disabled||!0===n||(this.fillComboView(i,!1),i&&!this.isSuspendEvents&&this.trigger("select",this,i))},onFieldPickerClick:function(t,e,i){if(!this.disabled){if(this.isSuspendEvents||this.trigger("click",this,i),this.options.hint){var n=this.cmpEl.data("bs.tooltip");n&&(void 0===n.dontShow&&(n.dontShow=!0),n.hide())}this.showLast||this.fieldPicker.deselectAll()}},onMenuPickerClick:function(t,e,i){this.disabled||this.isSuspendEvents||this.trigger("click",this,i)},onPickerItemContextMenu:function(t,e,i,n){if(!this.disabled)return this.isSuspendEvents||this.trigger("contextmenu",this,i,n),n.preventDefault(),n.stopPropagation(),!1},onPickerComboContextMenu:function(t){this.disabled||this.isSuspendEvents||this.trigger("contextmenu",this,void 0,t)},setDisabled:function(t){if(this.disabled=t,this.rendered&&(this.cmpEl.toggleClass("disabled",t),$("button",this.openButton.cmpEl).toggleClass("disabled",t),this.fieldPicker.setDisabled(t),this.needFillComboView&&!t)){var e=this.menuPicker;if(e){var i=e.getSelectedRec();i&&(i=i[0],this.fillComboView(i||e.store.at(0),!1))}}},isDisabled:function(){return this.disabled},fillComboView:functLine truncated
|
||||||
|
icls:"btn-align-right",checkable:!0,allowDepress:!0,toggleGroup:"halignGroup",value:"right"},{caption:n.tipAlignJust,iconCls:"mnu-align-just",icls:"btn-align-just",checkable:!0,allowDepress:!0,toggleGroup:"halignGroup",value:"justify"}]})}),n.btnVerticalAlign=new Common.UI.Button({id:"id-toolbar-btn-valign",cls:"btn-toolbar",iconCls:"btn-valign-bottom",icls:"btn-valign-bottom",lock:[o.editCell,o.selChart,o.selChartText,o.lostConnect,o.coAuth,o.coAuthText],menu:new Common.UI.Menu({items:[{caption:n.tipAlignTop,iconCls:"mnu-valign-top",icls:"btn-valign-top",checkable:!0,allowDepress:!0,toggleGroup:"valignGroup",value:"top"},{caption:n.tipAlignCenter,iconCls:"mnu-valign-middle",icls:"btn-valign-middle",checkable:!0,allowDepress:!0,toggleGroup:"valignGroup",value:"center"},{caption:n.tipAlignBottom,iconCls:"mnu-valign-bottom",icls:"btn-valign-bottom",checkable:!0,allowDepress:!0,checked:!0,toggleGroup:"valignGroup",value:"bottom"}]})}),n.btnAutofilter=new Common.UI.Button({id:"id-toolbar-btn-autofilter",cls:"btn-toolbar",iconCls:"btn-autofilter",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter],menu:new Common.UI.Menu({items:[n.mnuitemSortAZ=new Common.UI.MenuItem({caption:n.txtSortAZ,iconCls:"mnu-sort-asc",lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:Asc.c_oAscSortOptions.Ascending}),n.mnuitemSortZA=new Common.UI.MenuItem({caption:n.txtSortZA,iconCls:"mnu-sort-desc",lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:Asc.c_oAscSortOptions.Descending}),n.mnuitemAutoFilter=new Common.UI.MenuItem({caption:n.txtFilter,iconCls:"mnu-filter-add",checkable:!0,lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:"set-filter"}),n.mnuitemClearFilter=new Common.UI.MenuItem({caption:n.txtClearFilter,iconCls:"mnu-filter-clear",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleDelFilter],value:"clear-filter"})]})}),n.lockControls=[n.cmbFontName,n.cmbFontSize,n.btnIncFontSize,n.btnDecFontSize,n.btnBold,n.btnItalic,n.btnUnderline,n.btnTextColor,n.btnHorizontalAlign,n.btnAlignLeft,n.btnAlignCenter,n.btnAlignRight,n.btnAlignJust,n.btnVerticalAlign,n.btnAlignTop,n.btnAlignMiddle,n.btnAlignBottom,n.btnWrap,n.btnTextOrient,n.btnBackColor,n.btnMerge,n.btnInsertFormula,n.btnNamedRange,n.btnIncDecimal,n.btnInsertShape,n.btnInsertEquation,n.btnInsertText,n.btnSortUp,n.btnSortDown,n.btnSetAutofilter,n.btnClearAutofilter,n.btnTableTemplate,n.btnPercentStyle,n.btnCurrencyStyle,n.btnDecDecimal,n.btnAddCell,n.btnDeleteCell,n.cmbNumberFormat,n.btnBorders,n.btnInsertImage,n.btnInsertHyperlink,n.btnInsertChart,n.btnColorSchemas,n.btnAutofilter,n.btnCopy,n.btnPaste,n.btnSettings,n.listStyles,n.btnPrint,n.btnShowMode,n.btnClearStyle,n.btnCopyStyle];var r=Common.localStorage.getItem("sse-hide-synch");n.showSynchTip=!(r&&1==parseInt(r)),n.needShowSynchTip=!1;var l=[n.cmbFontName,n.cmbFontSize,n.btnAlignLeft,n.btnAlignCenter,n.btnAlignRight,n.btnAlignJust,n.btnAlignTop,n.btnAlignMiddle,n.btnAlignBottom,n.btnHorizontalAlign,n.btnVerticalAlign,n.btnInsertImage,n.btnInsertText,n.btnInsertShape,n.btnInsertEquation,n.btnIncFontSize,n.btnDecFontSize,n.btnBold,n.btnItalic,n.btnUnderline,n.btnTextColor,n.btnBackColor,n.btnInsertHyperlink,n.btnBorders,n.btnTextOrient,n.btnPercentStyle,n.btnCurrencyStyle,n.btnColorSchemas,n.btnSettings,n.btnInsertFormula,n.btnNamedRange,n.btnDecDecimal,n.btnIncDecimal,n.cmbNumberFormat,n.btnWrap,n.btnInsertChart,n.btnMerge,n.btnAddCell,n.btnDeleteCell,n.btnShowMode,n.btnPrint,n.btnAutofilter,n.btnSortUp,n.btnSortDown,n.btnTableTemplate,n.btnSetAutofilter,n.btnClearAutofilter,n.btnSave,n.btnClearStyle,n.btnCopyStyle,n.btnCopy,n.btnPaste];return e.each(l,function(t){t&&e.isFunction(t.setDisabled)&&t.setDisabled(!0)}),this},lockToolbar:function(t,i,n){function o(t,n){if(e.contains(t.options.lock,n)){var o=t.keepState.indexOf(n);i?o<0&&t.keepState.push(n):o<0||t.keepState.splice(o,1)}}!n&&(n={});var s=n.array||this.lockControls;n.merge&&(s=e.union(this.lockControls,s)),e.each(s,function(i){e.isFunction(i.setDisabled)&&(!i.keepState&&(i.keepState=[]),n.clear&&n.clear.length>0&&i.keepState.length>0&&(i.keepState=e.difference(i.keepState,n.clear)),e.isArray(t)?e.each(t,function(t){o(i,t)}):o(i,t),i.keepState.length>0?!i.isDisabled()&&i.setDisabled(!0):i.isDisabled()&&i.setDisabled(!1))})},render:function(e){var i=this,n=t(this.el),o=JSON.parse(Common.localStorage.getItem("sse-toolbar-compact"));return o=!!(null!==o&&1==parseInt(o)||null===o&&e.customization&&e.customization.compactToolbar),this.trigger("render:before",this),n.html(this.template({isEditDiagram:e.isEditDiagram,isEditMailMerge:e.isEditMailMerge,isCompactView:o})),i.rendererComponents(e.isEditDiagram?"diagram":e.isEditMailMerge?"merge":o?"short":"full"),this.trigger("render:after",this),this},rendererComponents:functLine truncated
|
||||||
|
define("spreadsheeteditor/main/app/model/TableTemplate",["backbone"],function(t){"use strict";SSE.Models=SSE.Models||{},SSE.Models.TableTemplate=t.Model.extend({defaults:function(){return{id:Common.UI.getId(),name:null,caption:null,type:null,imageUrl:null}}})}),define("spreadsheeteditor/main/app/collection/TableTemplates",["backbone","spreadsheeteditor/main/app/model/TableTemplate"],function(t){"use strict";if(void 0===e)var e={};e.Collections=e.Collections||{},SSE.Collections.TableTemplates=t.Collection.extend({model:SSE.Models.TableTemplate})}),void 0===Common)var Common={};if(define("spreadsheeteditor/main/app/view/TableOptionsDialog",["common/main/lib/component/ComboBox","common/main/lib/component/CheckBox","common/main/lib/component/InputField","common/main/lib/component/Window"],function(){"use strict";SSE.Views.TableOptionsDialog=Common.UI.Window.extend(_.extend({options:{width:350,cls:"modal-dlg",modal:!1},initialize:function(t){_.extend(this.options,{title:this.txtFormat},t),this.template=['<div class="box">','<div id="id-dlg-tableoptions-range" class="input-row" style="margin-bottom: 5px;"></div>','<div class="input-row" id="id-dlg-tableoptions-title" style="margin-top: 5px;"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),this.checkRangeType=Asc.c_oAscSelectionDialogType.FormatTable,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this.getChild(),e=this;e.inputRange=new Common.UI.InputField({el:$("#id-dlg-tableoptions-range"),name:"range",style:"width: 100%;",allowBlank:!1,blankError:this.txtEmpty,validateOnChange:!0}),e.cbTitle=new Common.UI.CheckBox({el:$("#id-dlg-tableoptions-title"),labelText:this.txtTitle}),t.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.inputRange.cmpEl.find("input").on("keypress",_.bind(this.onKeyPress,this)),this.on("close",_.bind(this.onClose,this))},onPrimary:function(){return this._handleInput("ok"),!1},setSettings:function(t){var e=this;if(t.api){if(e.api=t.api,t.range)e.cbTitle.setVisible(!1),e.setHeight(130),e.checkRangeType=Asc.c_oAscSelectionDialogType.FormatTableChangeRange,e.inputRange.setValue(t.range),e.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable,t.range);else{var i=e.api.asc_getAddFormatTableOptions();e.inputRange.setValue(i.asc_getRange()),e.cbTitle.setValue(i.asc_getIsTitle()),e.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable,i.asc_getRange())}t.title&&e.setTitle(t.title),e.api.asc_unregisterCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),e.api.asc_registerCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),Common.NotificationCenter.trigger("cells:range",Asc.c_oAscSelectionDialogType.FormatTable)}e.inputRange.validation=function(t){return e.api.asc_checkDataRange(e.checkRangeType,t,!1)!=Asc.c_oAscError.ID.DataRangeError||e.txtInvalidRange}},getSettings:function(){if(this.checkRangeType==Asc.c_oAscSelectionDialogType.FormatTable){var t=this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());return t.asc_setIsTitle(this.cbTitle.checked),t}return this.inputRange.getValue()},onApiRangeChanged:function(t){this.inputRange.setValue(t),this.inputRange.cmpEl.hasClass("error")&&this.inputRange.cmpEl.removeClass("error")},isRangeValid:function(){var t=this.api.asc_checkDataRange(this.checkRangeType,this.inputRange.getValue(),!0);return t==Asc.c_oAscError.ID.No||(t==Asc.c_oAscError.ID.AutoFilterDataRangeError?Common.UI.warning({msg:this.errorAutoFilterDataRange}):t==Asc.c_oAscError.ID.FTChangeTableRangeError?Common.UI.warning({msg:this.errorFTChangeTableRangeError}):t==Asc.c_oAscError.ID.FTRangeIncludedOtherTables&&Common.UI.warning({msg:this.errorFTRangeIncludedOtherTables}),!1)},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onClose:function(t){this.api&&this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None),Common.NotificationCenter.trigger("cells:range",Asc.c_oAscSelectionDialogType.None),Common.NotificationCenter.trigger("edit:complete",this),SSE.getController("RightMenu").SetDisabled(!1)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.isRangeValid())return;this.options.handler.call(this,this,t)}this.close()},show:function(){Common.UI.Window.prototype.show.call(this),SSE.getController("RightMenu").SetDisabled(!0)},txtTitle:"Title",txtFormat:"Create table",textCancel:"Cancel",txtEmpty:"This field is required",txtInvalidRange:"ERROR! Invalid cells range",errorAutoFilterDataRange:"The operation could not be done for the selected range of cLine truncated
|
||||||
|
define("spreadsheeteditor/main/app/controller/Toolbar",["core","common/main/lib/component/Window","common/main/lib/view/CopyWarningDialog","common/main/lib/view/ImageFromUrlDialog","common/main/lib/util/define","spreadsheeteditor/main/app/view/Toolbar","spreadsheeteditor/main/app/collection/TableTemplates","spreadsheeteditor/main/app/view/HyperlinkSettingsDialog","spreadsheeteditor/main/app/view/TableOptionsDialog","spreadsheeteditor/main/app/view/NamedRangeEditDlg","spreadsheeteditor/main/app/view/NamedRangePasteDlg","spreadsheeteditor/main/app/view/NameManagerDlg","spreadsheeteditor/main/app/view/FormatSettingsDialog"],function(){"use strict";SSE.Controllers.Toolbar=Backbone.Controller.extend(_.extend({models:[],collections:[],views:["Toolbar"],initialize:function(){var t=this;this.addListeners({Statusbar:{"sheet:changed":_.bind(this.onApiSheetChanged,this)},LeftMenu:{"settings:apply":_.bind(this.applyFormulaSettings,this)}}),this.editMode=!0,this._isAddingShape=!1,this._state={prstyle:void 0,clrtext:void 0,pralign:void 0,clrback:void 0,valign:void 0,can_undo:void 0,can_redo:void 0,bold:void 0,italic:void 0,underline:void 0,wrap:void 0,merge:void 0,angle:void 0,controlsdisabled:{rows:void 0,cols:void 0,cells_right:void 0,cells_down:void 0,filters:void 0},selection_type:void 0,filter:void 0,filterapplied:!1,tablestylename:void 0,tablename:void 0,namedrange_locked:!1,fontsize:void 0,multiselect:!1,sparklines_disabled:!1,numformatinfo:void 0,numformattype:void 0,numformat:void 0,langId:void 0};var e=function(e,i){var n=$(e.target),o=n.closest("#editor_sdk"),s=n.closest("button").attr("id");void 0===s&&(s=n.closest(".btn-group").attr("id")),t.api&&t.api.asc_isAddAutoshape()&&(o.length<=0||"cancel"==i)&&(t.toolbar.btnInsertText.pressed&&s!=t.toolbar.btnInsertText.id||t.toolbar.btnInsertShape.pressed&&s!=t.toolbar.btnInsertShape.id?(t._isAddingShape=!1,t._addAutoshape(!1),t.toolbar.btnInsertShape.toggle(!1,!0),t.toolbar.btnInsertText.toggle(!1,!0),Common.NotificationCenter.trigger("edit:complete",t.toolbar)):t.toolbar.btnInsertShape.pressed&&s==t.toolbar.btnInsertShape.id&&_.defer(function(){t.api.asc_endAddShape(),Common.NotificationCenter.trigger("edit:complete",t.toolbar)},100))};this.checkInsertAutoshape=function(t){e({},t.action)},this._addAutoshape=function(t,i){this.api&&(t?(this.api.asc_startAddShape(i),$(document.body).on("mouseup",e)):(this.api.asc_endAddShape(),$(document.body).off("mouseup",e)))},this.onApiEndAddShape=function(){this.toolbar.btnInsertShape.pressed&&this.toolbar.btnInsertShape.toggle(!1,!0),this.toolbar.btnInsertText.pressed&&this.toolbar.btnInsertText.toggle(!1,!0),$(document.body).off("mouseup",e)}},onLaunch:function(){this.toolbar=this.createView("Toolbar")},onToolbarAfterRender:function(t){t.btnNewDocument.on("click",_.bind(this.onNewDocument,this)),t.btnOpenDocument.on("click",_.bind(this.onOpenDocument,this)),t.btnPrint.on("click",_.bind(this.onPrint,this)),t.btnSave.on("click",_.bind(this.onSave,this)),t.btnUndo.on("click",_.bind(this.onUndo,this)),t.btnRedo.on("click",_.bind(this.onRedo,this)),t.btnCopy.on("click",_.bind(this.onCopyPaste,this,!0)),t.btnPaste.on("click",_.bind(this.onCopyPaste,this,!1)),t.btnIncFontSize.on("click",_.bind(this.onIncreaseFontSize,this)),t.btnDecFontSize.on("click",_.bind(this.onDecreaseFontSize,this)),t.btnBold.on("click",_.bind(this.onBold,this)),t.btnItalic.on("click",_.bind(this.onItalic,this)),t.btnUnderline.on("click",_.bind(this.onUnderline,this)),t.btnTextColor.on("click",_.bind(this.onTextColor,this)),t.btnBackColor.on("click",_.bind(this.onBackColor,this)),t.mnuTextColorPicker.on("select",_.bind(this.onTextColorSelect,this)),t.mnuBackColorPicker.on("select",_.bind(this.onBackColorSelect,this)),t.btnBorders.on("click",_.bind(this.onBorders,this)),t.btnBorders.rendered&&(t.btnBorders.menu.on("item:click",_.bind(this.onBordersMenu,this)),t.mnuBorderWidth.on("item:toggle",_.bind(this.onBordersWidth,this)),t.mnuBorderColorPicker.on("select",_.bind(this.onBordersColor,this))),t.btnAlignLeft.on("click",_.bind(this.onHorizontalAlign,this,"left")),t.btnAlignCenter.on("click",_.bind(this.onHorizontalAlign,this,"center")),t.btnAlignRight.on("click",_.bind(this.onHorizontalAlign,this,"right")),t.btnAlignJust.on("click",_.bind(this.onHorizontalAlign,this,"justify")),t.btnHorizontalAlign.menu.on("item:click",_.bind(this.onHorizontalAlignMenu,this)),t.btnVerticalAlign.menu.on("item:click",_.bind(this.onVerticalAlignMenu,this)),t.btnMerge.on("click",_.bind(this.onMergeCellsMenu,this,t.btnMerge.menu,t.btnMerge.menu.items[0])),t.btnMerge.menu.on("item:click",_.bind(this.onMergeCellsMenu,this)),t.btnAlignTop.on("click",_.bind(this.onVerticalAlign,this,"top")),t.btnAlignMiddle.on("click",_.bind(this.onVerticalAlign,this,"center")),t.btnAlignBottom.on("click",_.bind(this.onVerticalAlign,this,"bottom")),t.btnWrap.on("click",_.bind(this.onWrap,this)),t.btnTextOrient.menu.on("item:click",_.bind(this.onTextOrientationMenu,this)),t.btnInsertImage.menu.on("item:Line truncated
|
||||||
|
Common.NotificationCenter.trigger("edit:complete",this.toolbar,{restorefocus:!0}),Common.component.Analytics.trackEvent("ToolBar","Font Size")},onFontSizeChanged:function(t,e,i,n){var o;if(t){if(!e.store.findWhere({displayValue:i.value})&&!(o=/^\+?(\d*\.?\d+)$|^\+?(\d+\.?\d*)$/.exec(i.value)))return o=this._getApiTextSize(),Common.UI.warning({msg:this.textFontSizeErr,callback:function(){_.defer(function(t){$("input",e.cmpEl).focus()})}}),e.setRawValue(o),n.preventDefault(),!1}else o=parseFloat(i.value),o=o>409?409:o<1?1:Math.floor(2*(o+.4))/2,e.setRawValue(o),this._state.fontsize=void 0,this.api&&this.api.asc_setCellFontSize(o),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onAdvSettingsClick:function(t,e){this.toolbar.fireEvent("file:settings",this),t.cmpEl.blur()},onZoomInClick:function(t){if(this.api){var e=Math.floor(10*this.api.asc_getZoom())/10;e+=.1,e>0&&!(e>2)&&this.api.asc_setZoom(e)}Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomOutClick:function(t){if(this.api){var e=Math.ceil(10*this.api.asc_getZoom())/10;e-=.1,e<.5||this.api.asc_setZoom(e)}Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideMenu:function(t,e){var i,n={};switch(e.value){case"title":n.title=e.checked,i="sse-hidden-title";break;case"formula":n.formula=e.checked,i="sse-hidden-formula";break;case"headings":n.headings=e.checked;break;case"gridlines":n.gridlines=e.checked;break;case"freezepanes":n.freezepanes=e.checked}this.hideElements(n),i&&Common.localStorage.setItem(i,e.checked),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onListStyleSelect:function(t,e){this._state.prstyle=void 0,this.api&&(this.api.asc_setCellStyle(e.get("name")),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Style"))},createDelayedElements:function(){var t=this;this.toolbar.createDelayedElements(),this.onToolbarAfterRender(this.toolbar),this.api.asc_registerCallback("asc_onShowChartDialog",_.bind(this.onApiChartDblClick,this)),this.api.asc_registerCallback("asc_onCanUndoChanged",_.bind(this.onApiCanRevert,this,"undo")),this.api.asc_registerCallback("asc_onCanRedoChanged",_.bind(this.onApiCanRevert,this,"redo")),this.api.asc_registerCallback("asc_onEditCell",_.bind(this.onApiEditCell,this)),this.api.asc_registerCallback("asc_onEndAddShape",_.bind(this.onApiEndAddShape,this)),this.api.asc_registerCallback("asc_onSheetsChanged",_.bind(this.onApiSheetChanged,this)),this.api.asc_registerCallback("asc_onStopFormatPainter",_.bind(this.onApiStyleChange,this)),this.api.asc_registerCallback("asc_onUpdateSheetViewSettings",_.bind(this.onApiSheetChanged,this)),Common.util.Shortcuts.delegateShortcuts({shortcuts:{"command+l,ctrl+l":function(e){if(t.editMode&&!t._state.multiselect){var i=t.api.asc_getCellInfo().asc_getFormatTableInfo();if(!i){_.isUndefined(t.toolbar.mnuTableTemplatePicker)&&t.onApiInitTableTemplates(t.api.asc_getTablePictures(i));var n=t.getCollection("TableTemplates");t._setTableFormat(n.at(23).get("name"))}}return!1},"command+shift+l,ctrl+shift+l":function(e){var i=t._state.filter;return t._state.filter=void 0,t.editMode&&t.api&&!t._state.multiselect&&(t._state.tablename||i?t.api.asc_changeAutoFilter(t._state.tablename,Asc.c_oAscChangeFilterOptions.filter,!i):t.api.asc_addAutoFilter()),!1},"command+s,ctrl+s":function(e){t.onSave(),e.preventDefault(),e.stopPropagation()},"command+k,ctrl+k":function(e){!t.editMode||t.toolbar.mode.isEditMailMerge||t.toolbar.mode.isEditDiagram||t.api.isCellEdited||t._state.multiselect||t.onHyperlink(),e.preventDefault()},"command+1,ctrl+1":function(e){return!t.editMode||t.toolbar.mode.isEditMailMerge||t.api.isCellEdited||t.toolbar.cmbNumberFormat.isDisabled()||t.onCustomNumberFormat(),!1}}}),this.wrapOnSelectionChanged=_.bind(this.onApiSelectionChanged,this),this.api.asc_registerCallback("asc_onSelectionChanged",this.wrapOnSelectionChanged),this.onApiSelectionChanged(this.api.asc_getCellInfo()),this.api.asc_registerCallback("asc_onEditorSelectionChanged",_.bind(this.onApiEditorSelectionChanged,this)),this.attachToControlEvents(),this.onApiSheetChanged(),this.applyFormulaSettings(),Common.NotificationCenter.on("cells:range",_.bind(this.onCellsRange,this))},onChangeViewMode:function(t,e){var i=this,n=$("#id-toolbar-full"),o=$("#id-toolbar-short");i.toolbar.isCompactView=e,n&&o&&(i.api.asc_unregisterCallback("asc_onSelectionChanged",i.wrapOnSelectionChanged),e?(o.css({display:"table"}),n.css({display:"none"}),o.parent().css({height:"41px"}),i.toolbar.rendererComponents("short")):(o.css({display:"none"}),n.css({display:"table"}),o.parent().css({height:"67px"}),i.toolbar.rendererComponents("full"),_.defer(function(){var t=i.toolbar.listStyles.rendered;i.toolbar.listStyles.menuPicker.store.length>0&&t&&i.toolbar.listStyles.fillComboView(i.toolbar.listStyles.menuPicker.getSelectedRec(),!0),i.toolbar.btnInsertText.rendered&&i.fillTextArt(),i.toolbar.btnTableTemplate.rendered&&i.fillTableTemLine truncated
|
||||||
|
onSetupCopyStyleButton:function(){this.modeAlwaysSetStyle=!1;var t={kOff:0,kOn:1,kMultiple:2},e=this;Common.NotificationCenter.on({"edit:complete":function(){e.api&&e.modeAlwaysSetStyle&&(e.api.asc_formatPainter(t.kOff),e.toolbar.btnCopyStyle.toggle(!1,!0),e.modeAlwaysSetStyle=!1)}}),$(e.toolbar.btnCopyStyle.cmpEl).dblclick(function(){e.api&&(e.modeAlwaysSetStyle=!0,e.toolbar.btnCopyStyle.toggle(!0,!0),e.api.asc_formatPainter(t.kMultiple))})},onCellsRange:function(t){this.api.isRangeSelection=t!=Asc.c_oAscSelectionDialogType.None,this.onApiEditCell(this.api.isRangeSelection?Asc.c_oAscCellEditorState.editStart:Asc.c_oAscCellEditorState.editEnd);var e=this.toolbar;e.lockToolbar(SSE.enumLock.selRange,this.api.isRangeSelection),this.setDisabledComponents([e.btnUndo],this.api.isRangeSelection||!this.api.asc_getCanUndo()),this.setDisabledComponents([e.btnRedo],this.api.isRangeSelection||!this.api.asc_getCanRedo()),this.onApiSelectionChanged(this.api.asc_getCellInfo())},onLockDefNameManager:function(t){this._state.namedrange_locked=t==Asc.c_oAscDefinedNameReason.LockDefNameManager},DisableToolbar:function(t){var e=$(".toolbar-mask");if(!(t&&e.length>0||!t&&0==e.length)){var i=this.toolbar;if(i.$el.find(".toolbar").toggleClass("masked",t),this.toolbar.lockToolbar(SSE.enumLock.menuFileOpen,t,{array:[i.btnShowMode]}),t){e=$("<div class='toolbar-mask'>").appendTo(i.$el);var n=i.isCompactView?75:i.mode.nativeApp?80:48;e.css("left",n+"px"),e.css("right",(i.isCompactView?0:45)+"px"),Common.util.Shortcuts.suspendEvents("command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1")}else e.remove(),Common.util.Shortcuts.resumeEvents("command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1")}},applyFormulaSettings:function(){for(var t=this.toolbar.btnInsertFormula.menu.items,e=0;e<Math.min(4,t.length);e++)t[e].setCaption(this.api.asc_getFormulaLocaleName(t[e].value))},textEmptyImgUrl:"You need to specify image URL.",warnMergeLostData:"Operation can destroy data in the selected cells.<br>Continue?",textWarning:"Warning",textFontSizeErr:"The entered value is incorrect.<br>Please enter a numeric value between 1 and 409",textCancel:"Cancel",confirmAddFontName:"The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the device fonts, the saved font will be used when it is available.<br>Do you want to continue?",textSymbols:"Symbols",textFraction:"Fraction",textScript:"Script",textRadical:"Radical",textIntegral:"Integral",textLargeOperator:"Large Operator",textBracket:"Bracket",textFunction:"Function",textAccent:"Accent",textLimitAndLog:"Limit And Log",textOperator:"Operator",textMatrix:"Matrix",txtSymbol_pm:"Plus Minus",txtSymbol_infinity:"Infinity",txtSymbol_equals:"Equal",txtSymbol_neq:"Not Equal To",txtSymbol_about:"Approximately",txtSymbol_times:"Multiplication Sign",txtSymbol_div:"Division Sign",txtSymbol_factorial:"Factorial",txtSymbol_propto:"Proportional To",txtSymbol_less:"Less Than",txtSymbol_ll:"Much Less Than",txtSymbol_greater:"Greater Than",txtSymbol_gg:"Much Greater Than",txtSymbol_leq:"Less Than or Equal To",txtSymbol_geq:"Greater Than or Equal To",txtSymbol_mp:"Minus Plus",txtSymbol_cong:"Approximately Equal To",txtSymbol_approx:"Almost Equal To",txtSymbol_equiv:"Identical To",txtSymbol_forall:"For All",txtSymbol_additional:"Complement",txtSymbol_partial:"Partial Differential",txtSymbol_sqrt:"Radical Sign",txtSymbol_cbrt:"Cube Root",txtSymbol_qdrt:"Fourth Root",txtSymbol_cup:"Union",txtSymbol_cap:"Intersection",txtSymbol_emptyset:"Empty Set",txtSymbol_percent:"Percentage",txtSymbol_degree:"Degrees",txtSymbol_fahrenheit:"Degrees Fahrenheit",txtSymbol_celsius:"Degrees Celsius",txtSymbol_inc:"Increment",txtSymbol_nabla:"Nabla",txtSymbol_exists:"There Exist",txtSymbol_notexists:"There Does Not Exist",txtSymbol_in:"Element Of",txtSymbol_ni:"Contains as Member",txtSymbol_leftarrow:"Left Arrow",txtSymbol_uparrow:"Up Arrow",txtSymbol_rightarrow:"Right Arrow",txtSymbol_downarrow:"Down Arrow",txtSymbol_leftrightarrow:"Left-Right Arrow",txtSymbol_therefore:"Therefore",txtSymbol_plus:"Plus",txtSymbol_minus:"Minus",txtSymbol_not:"Not Sign",txtSymbol_ast:"Asterisk Operator",txtSymbol_bullet:"Bulet Operator",txtSymbol_vdots:"Vertical Ellipsis",txtSymbol_cdots:"Midline Horizontal Ellipsis",txtSymbol_rddots:"Up Right Diagonal Ellipsis",txtSymbol_ddots:"Down Right Diagonal Ellipsis",txtSymbol_aleph:"Alef",txtSymbol_beth:"Bet",txtSymbol_qed:"End of Proof",txtSymbol_alpha:"Alpha",txtSymbol_beta:"Beta",txtSymbol_gamma:"Gamma",txtSymbol_delta:"Delta",txtSymbol_varepsilon:"Epsilon Variant",txtSymbol_epsilon:"Epsilon",txtSymbol_zeta:"Zeta",txtSymbol_eta:"Eta",txtSymbol_theta:"Theta",txtSymbol_vartheta:"Theta Variant",txtSymbol_iota:"Iota",txtSymbol_kappa:"Kappa",txtSymbol_lambda:"Lambda",txtSymbol_mu:"Mu",txtSymbol_nu:"Nu",txtSymbol_xsi:"Xi",txtSymbol_o:"Omicron"Line truncated
|
||||||
|
t.editMode&&t.rangeSelectionMode!==Asc.c_oAscSelectionDialogType.Chart&&t.rangeSelectionMode!==Asc.c_oAscSelectionDialogType.FormatTable&&t.fireEvent("sheet:changename")},this),"tab:move":_.bind(function(e,i){t.tabBarScroll={scrollLeft:t.tabbar.scrollX},_.isUndefined(i)||e===i||(e<i&&++i,t.fireEvent("sheet:move",[!1,!0,e,i]))},this)});var e=new Common.UI.Menu({maxHeight:260,menuAlign:"tl-tr"}).on("render:after",function(t){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,alwaysVisibleY:!0})}).on("show:after",function(){this.scroller.update({alwaysVisibleY:!0})});e.on("item:click",function(e,i,n){t.fireEvent("show:hidden",[t,i.value])});var i=new Common.UI.Menu({menuAlign:"tl-tr",cls:"color-tab",items:[{template:_.template('<div id="id-tab-menu-color" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:_.template('<a id="id-tab-menu-new-color" style="padding-left:12px;">'+t.textNewColor+"</a>")}]});return t.mnuTabColor=function(){return{isDummy:!0,on:function(){}}}(),this.tabMenu=new Common.UI.Menu({menuAlign:"bl-tl",items:[{caption:this.itemInsert,value:"ins"},{caption:this.itemDelete,value:"del"},{caption:this.itemRename,value:"ren"},{caption:this.itemCopy,value:"copy"},{caption:this.itemMove,value:"move"},{caption:this.itemHide,value:"hide"},{caption:this.itemHidden,menu:e},{caption:this.itemTabColor,menu:i}]}).on("render:after",function(e){var i=$('<div class="btn-color-value-line"></div>');$("button:first-child",e.cmpEl).append(i),i.css("background-color",e.currentColor||"transparent"),t.mnuTabColor=new Common.UI.ThemeColorPalette({el:$("#id-tab-menu-color"),transparent:!0}),t.mnuTabColor.on("select",function(e,i){t.fireEvent("sheet:setcolor",[i])})}),this.tabbar.$el.append('<div class="dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>'),this.tabMenu.render(this.tabbar.$el),this.tabMenu.cmpEl.attr({tabindex:-1}),this.tabMenu.on("show:after",_.bind(this.onTabMenuAfterShow,this)),this.tabMenu.on("hide:after",_.bind(this.onTabMenuAfterHide,this)),this.tabMenu.on("item:click",_.bind(this.onTabMenuClick,this)),this.boxMath=$("#status-math-box",this.el),this.labelSum=$("#status-math-sum",this.boxMath),this.labelCount=$("#status-math-count",this.boxMath),this.labelAverage=$("#status-math-average",this.boxMath),this.boxMath.hide(),this.boxFiltered=$("#status-filtered-box",this.el),this.labelFiltered=$("#status-filtered-records",this.boxFiltered),this.boxFiltered.hide(),this.boxZoom=$("#status-zoom-box",this.el),this.boxZoom.find(".separator").css("border-left-color","transparent"),this},setApi:function(t){return this.api=t,this.api.asc_registerCallback("asc_onSheetsChanged",_.bind(this.update,this)),this.api.asc_registerCallback("asc_onAuthParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_registerCallback("asc_onParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_coAuthoringGetUsers(),this},setMode:function(t){this.mode=_.extend({},this.mode,t),this.btnAddWorksheet.setVisible(this.mode.isEdit),this.btnAddWorksheet.setDisabled(this.mode.isDisconnected),this.lblChangeRights[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.panelUsers[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.updateTabbarBorders()},setVisible:function(t){t?this.show():this.hide()},update:function(){var t=this;if(this.tabbar.empty(!0),this.tabMenu.items[6].menu.removeAll(),this.tabMenu.items[6].hide(),this.btnAddWorksheet.setDisabled(!0),this.api){for(var e,i,n=this.api.asc_getWorksheetsCount(),o=-1,s=[],a=[],r=this.api.asc_getActiveWorksheetIndex();++o<n;)i=t.api.asc_isWorksheetLockedOrDeleted(o),e={sheetindex:o,active:r==o,label:t.api.asc_getWorksheetName(o),cls:i?"coauth-locked":"",isLockTheDrag:i},this.api.asc_isWorksheetHidden(o)?s.push(e):a.push(e);s.length&&(s.forEach(function(e){t.tabMenu.items[6].menu.addItem(new Common.UI.MenuItem({style:"white-space: pre-wrap",caption:Common.Utils.String.htmlEncode(e.label),value:e.sheetindex}))}),this.tabMenu.items[6].show()),this.tabbar.add(a),_.isUndefined(this.tabBarScroll)||(this.tabbar.$bar.scrollLeft(this.tabBarScroll.scrollLeft),this.tabBarScroll=void 0),this.tabbar.isTabVisible(r)||this.tabbar.setTabVisible(r),this.btnAddWorksheet.setDisabled(t.mode.isDisconnected||t.api.asc_isWorkbookLocked()),$("#status-label-zoom").text(Common.Utils.String.format(this.zoomText,Math.floor(100*(this.api.asc_getZoom()+.005)))),t.fireEvent("sheet:changed",[t,r]),t.fireEvent("sheet:updateColors",[!0]),Common.NotificationCenter.trigger("comments:updatefilter",{property:"uid",value:new RegExp("^(doc_|sheet"+t.api.asc_getActiveWorksheetId()+"_)")},!1)}},setMathInfo:function(t){t.count>1?(this.boxMath.is(":visible")||this.boxMath.show(),this.labelCount.text(this.textCount+": "+t.count),this.labelSum.text(t.sum&&t.sLine truncated
|
||||||
|
scope:this})),this.linkAdvanced=e("#paragraph-advanced-link")},setApi:function(t){return this.api=t,this.api&&this.api.asc_registerCallback("asc_onParaSpacingLine",i.bind(this._onLineSpacing,this)),this},onNumLineHeightChange:function(t,e,i,n){""!==this.cmbLineRule.getRawValue()&&(this.api&&this.api.asc_putPrLineSpacing(this.cmbLineRule.getValue(),this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO?t.getNumberValue():Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),Common.NotificationCenter.trigger("edit:complete",this))},onNumSpacingBeforeChange:function(t,e,i,n){if(this.api){t.getNumberValue()<0?this.api.asc_putLineSpacingBeforeAfter(0,-1):this.api.asc_putLineSpacingBeforeAfter(0,Common.Utils.Metric.fnRecalcToMM(t.getNumberValue()))}Common.NotificationCenter.trigger("edit:complete",this)},onNumSpacingAfterChange:function(t,e,i,n){if(this.api){t.getNumberValue()<0?this.api.asc_putLineSpacingBeforeAfter(1,-1):this.api.asc_putLineSpacingBeforeAfter(1,Common.Utils.Metric.fnRecalcToMM(t.getNumberValue()))}Common.NotificationCenter.trigger("edit:complete",this)},onLineRuleSelect:function(t,e){this.api&&this.api.asc_putPrLineSpacing(e.value,e.defaultValue),this.numLineHeight.setDefaultUnit(e.defaultUnit),this.numLineHeight.setMinValue(e.minValue),this.numLineHeight.setStep(e.step),Common.NotificationCenter.trigger("edit:complete",this)},_onLineSpacing:function(t){if(!this._initSettings){var e=t.asc_getLineRule(),i=t.asc_getLine();if(this._state.LineRule!==e){var n,o=this.cmbLineRule.store.findWhere((n={},n.value=e,n));o||(o=this.cmbLineRule.store.at(0)),this.cmbLineRule.setValue(null!==e?e:""),this.numLineHeight.setMinValue(o.get("minValue")),this.numLineHeight.setDefaultUnit(o.get("defaultUnit")),this.numLineHeight.setStep(o.get("step")),this._state.LineRule=e}if(Math.abs(this._state.LineHeight-i)>.001||(null===this._state.LineHeight||null===i)&&this._state.LineHeight!==i){var s="";e==c_paragraphLinerule.LINERULE_AUTO?s=i:null!==e&&null!==i&&(s=Common.Utils.Metric.fnRecalcFromMM(i)),this.numLineHeight.setValue(null!==s?s:"",!0),this._state.LineHeight=i}}},ChangeSettings:function(t){if(this._initSettings&&this.createDelayedElements(),this.disableControls(this._locked),t){var e={Line:t.asc_getSpacing().asc_getLine(),Before:t.asc_getSpacing().asc_getBefore(),After:t.asc_getSpacing().asc_getAfter(),LineRule:t.asc_getSpacing().asc_getLineRule()};if(this._state.LineRule!==e.LineRule){var i,n=this.cmbLineRule.store.findWhere((i={},i.value=e.LineRule,i));n||(n=this.cmbLineRule.store.at(0)),this.cmbLineRule.setValue(null!==e.LineRule?e.LineRule:""),this.numLineHeight.setMinValue(n.get("minValue")),this.numLineHeight.setDefaultUnit(n.get("defaultUnit")),this.numLineHeight.setStep(n.get("step")),this._state.LineRule=e.LineRule}if(Math.abs(this._state.LineHeight-e.Line)>.001||(null===this._state.LineHeight||null===e.Line)&&this._state.LineHeight!==e.Line){var o="";e.LineRule==c_paragraphLinerule.LINERULE_AUTO?o=e.Line:null!==e.LineRule&&null!==e.Line&&(o=Common.Utils.Metric.fnRecalcFromMM(e.Line)),this.numLineHeight.setValue(null!==o?o:"",!0),this._state.LineHeight=e.Line}(Math.abs(this._state.LineSpacingBefore-e.Before)>.001||(null===this._state.LineSpacingBefore||null===e.Before)&&this._state.LineSpacingBefore!==e.Before)&&(this.numSpacingBefore.setValue(null!==e.Before?e.Before<0?e.Before:Common.Utils.Metric.fnRecalcFromMM(e.Before):"",!0),this._state.LineSpacingBefore=e.Before),(Math.abs(this._state.LineSpacingAfter-e.After)>.001||(null===this._state.LineSpacingAfter||null===e.After)&&this._state.LineSpacingAfter!==e.After)&&(this.numSpacingAfter.setValue(null!==e.After?e.After<0?e.After:Common.Utils.Metric.fnRecalcFromMM(e.After):"",!0),this._state.LineSpacingAfter=e.After)}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01)}if(this.cmbLineRule){var i=this.cmbLineRule.store.at(1);if(i.set({defaultUnit:Common.Utils.Metric.getCurrentMetricName(),minValue:parseFloat(Common.Utils.Metric.fnRecalcFromMM(.3).toFixed(2)),step:Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01}),null!==this._state.LineRule){var n;i=this.cmbLineRule.store.findWhere((n={},n.value=this._state.LineRule,n)),i||(i=this.cmbLineRule.store.at(0)),this.numLineHeight.setDefaultUnit(i.get("defaultUnit")),this.numLineHeight.setStep(i.get("step"))}}},createDelayedControls:function(){this._arrLineRule=[{displayValue:this.textAuto,defaultValue:1,value:c_paragraphLinerule.LINERULE_AUTO,minValue:.5,step:.01,defaultUnit:""},{displayValue:this.textExact,defaultValue:5,value:c_paragraphLinerule.LINERULE_EXACT,minValue:.03,step:.01,defaultUnit:"cm"}],this.cmbLineRule=new Common.UI.ComboBox({el:e("#paragraph-combo-line-rule"),cls:"input-group-nr",menuStyle:"min-width: 85px;",editable:!1,data:this._arrLineRuleLine truncated
|
||||||
|
return'<div id="id-chart-settings-dlg-style" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="1" style="">\r\n <tr>\r\n <td class="padding-large">\r\n <label class="header"><%= scope.textType %></label>\r\n <div id="chart-dlg-button-type" style="margin-right: 15px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="separator horizontal padding-large"></div>\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 >\r\n <label class="header"><%= scope.textDataRange %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="200">\r\n <div id="chart-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>\r\n </td>\r\n <td class="padding-small" style="text-align: right;">\r\n <button type="button" class="btn btn-text-default" id="chart-dlg-btn-data" style="min-width: 100px;width: auto;"><%= scope.textSelectData %></button>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="input-label"><%= scope.textDataSeries %></label>\r\n <div id="chart-dlg-combo-range" class="input-group-nr" style="width:120px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-chart-settings-dlg-layout" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textChartTitle %></label>\r\n <div id="chart-dlg-combo-chart-title" class="input-group-nr" style="margin-right: 7px;"></div>\r\n </td>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label" style="margin-left: 7px;"><%= scope.textLegendPos %></label>\r\n <div id="chart-dlg-combo-legend-pos" class="input-group-nr" style="margin-left: 7px;" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textDataLabels %></label>\r\n <div id="chart-dlg-combo-data-labels" class="input-group-nr" style="margin-right: 7px;"></div>\r\n </td>\r\n <td rowspan="2" class="padding-small" width="50%">\r\n <div id="chart-dlg-check-series" style="margin: 20px 0 9px 7px;"></div>\r\n <div id="chart-dlg-check-category" style="margin: 0 0 9px 7px;"></div>\r\n <div id="chart-dlg-check-value" style="margin: 0 0 5px 7px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textSeparator %></label>\r\n <div id="chart-dlg-txt-separator" class="input-row" style="margin-right: 7px;"/>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td width="50%">\r\n <label id="chart-dlg-label-lines" class="input-label"><%= scope.textLines %></label>\r\n <div id="chart-dlg-combo-lines" class="input-group-nr padding-small" style="margin-right: 7px;"></div>\r\n </td>\r\n <td style="vertical-align: bottom;" width="50%">\r\n <div id="chart-dlg-check-markers" style="margin: 0 0 12px 7px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2">\r\n <label class="header padding-small" style="padding-top: 8px;"><%= scope.textAxisSettings %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textHorAxis %></label>\r\n <div id="chart-dlg-combo-hor-show" class="input-group-nr" style="margin-right: 7px;"></div>\r\n </td>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label" style="margin-left: 7px;"><%= scope.textVertAxis %></label>\r\n <div id="chart-dlg-combo-vert-show" class="input-group-nr" style="margin-left: 7px;" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-large" width="50%">\r\n <label class="input-label"><%= scope.textHorTitle %></label>\r\n Line truncated
|
||||||
|
value:Asc.c_oAscChartLegendShowSettings.bottom,displayValue:this.textLegendBottom},{value:Asc.c_oAscChartLegendShowSettings.top,displayValue:this.textLegendTop},{value:Asc.c_oAscChartLegendShowSettings.right,displayValue:this.textLegendRight},{value:Asc.c_oAscChartLegendShowSettings.left,displayValue:this.textLegendLeft},{value:Asc.c_oAscChartLegendShowSettings.leftOverlay,displayValue:this.textLeftOverlay},{value:Asc.c_oAscChartLegendShowSettings.rightOverlay,displayValue:this.textRightOverlay}]}),this.cmbHorTitle=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-title"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartHorAxisLabelShowSettings.none,displayValue:this.textNone},{value:Asc.c_oAscChartHorAxisLabelShowSettings.noOverlay,displayValue:this.textNoOverlay}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putHorAxisLabel(e.value)},this)),this.cmbVertTitle=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-title"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartVertAxisLabelShowSettings.none,displayValue:this.textNone},{value:Asc.c_oAscChartVertAxisLabelShowSettings.rotated,displayValue:this.textRotated},{value:Asc.c_oAscChartVertAxisLabelShowSettings.horizontal,displayValue:this.textHorizontal}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putVertAxisLabel(e.value)},this)),this.cmbHorShow=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-show"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:!0,displayValue:this.textShow},{value:!1,displayValue:this.textHide}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putShowHorAxis(e.value)},this)),this.cmbVertShow=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-show"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:!0,displayValue:this.textShow},{value:!1,displayValue:this.textHide}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putShowVerAxis(e.value)},this)),this.cmbHorGrid=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-grid"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscGridLinesSettings.none,displayValue:this.textNone},{value:Asc.c_oAscGridLinesSettings.major,displayValue:this.textMajor},{value:Asc.c_oAscGridLinesSettings.minor,displayValue:this.textMinor},{value:Asc.c_oAscGridLinesSettings.majorMinor,displayValue:this.textMajorMinor}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putHorGridLines(e.value)},this)),this.cmbVertGrid=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-grid"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscGridLinesSettings.none,displayValue:this.textNone},{value:Asc.c_oAscGridLinesSettings.major,displayValue:this.textMajor},{value:Asc.c_oAscGridLinesSettings.minor,displayValue:this.textMinor},{value:Asc.c_oAscGridLinesSettings.majorMinor,displayValue:this.textMajorMinor}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putVertGridLines(e.value)},this)),this.cmbDataLabels=new Common.UI.ComboBox({el:$("#chart-dlg-combo-data-labels"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartDataLabelsPos.none,displayValue:this.textNone},{value:Asc.c_oAscChartDataLabelsPos.ctr,displayValue:this.textCenter},{value:Asc.c_oAscChartDataLabelsPos.inBase,displayValue:this.textInnerBottom},{value:Asc.c_oAscChartDataLabelsPos.inEnd,displayValue:this.textInnerTop},{value:Asc.c_oAscChartDataLabelsPos.outEnd,displayValue:this.textOuterTop}]}),this.cmbDataLabels.on("selected",_.bind(t.onSelectDataLabels,this)),this.txtSeparator=new Common.UI.InputField({el:$("#chart-dlg-txt-separator"),name:"range",style:"width: 100%;",allowBlank:!0,blankError:this.txtEmpty}),this.chSeriesName=new Common.UI.CheckBox({el:$("#chart-dlg-check-series"),labelText:this.textSeriesName}),this.chCategoryName=new Common.UI.CheckBox({el:$("#chart-dlg-check-category"),labelText:this.textCategoryName}),this.chValue=new Common.UI.CheckBox({el:$("#chart-dlg-check-value"),labelText:this.textValue}),this.cmbLines=new Common.UI.ComboBox({el:$("#chart-dlg-combo-lines"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:0,displayValue:this.textNone},{value:1,displayValue:this.textStraight},{value:2,displayValue:this.textSmooth}]}).on("selected",_.bind(function(t,e){this.chartSettings&&(this.chartSettings.putLine(0!==e.value),e.value>0&&this.chartSettings.putSmooth(2==e.value))},this)),this.chMarkers=new Common.UI.CheckBox({el:$("#chart-dlg-check-markers"),labelText:this.textMarkers}).on("change",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putShowMarker("checked"==e)},this)),this.lblLines=$("#chart-dlg-label-lines"),this.cmbMinType=new Common.UI.ComboBox({el:$("#chart-dlg-combo-mintype"),cls:"input-group-nLine truncated
|
||||||
|
this.updateDataLabels(this._state.ChartType,t.getDataLabelsPos()),this.chSeriesName.setValue(this.chartSettings.getShowSerName(),!0),this.chCategoryName.setValue(this.chartSettings.getShowCatName(),!0),this.chValue.setValue(this.chartSettings.getShowVal(),!0),n=t.getSeparator(),this.txtSeparator.setValue(n||""),this.vertAxisProps=t.getVertAxisProps(),this.horAxisProps=t.getHorAxisProps(),this.updateAxisProps(this._state.ChartType),this.currentChartType=this._state.ChartType,this.imageSettings&&(n=this.imageSettings.asc_getTitle(),this.inputAltTitle.setValue(n||""),n=this.imageSettings.asc_getDescription(),this.textareaAltDescription.val(n||""))}else{this._state.SparkType=t.asc_getType();var i=this.mnuSparkTypePicker.store.findWhere({type:this._state.SparkType});this.mnuSparkTypePicker.selectRecord(i,!0),i&&this.btnSparkType.setIconCls("item-chartlist "+i.get("iconCls")),this.updateSparkStyles(t.asc_getStyles()),this._state.SparkType!==Asc.c_oAscSparklineType.Line&&this._arrEmptyCells.pop(),this.cmbEmptyCells.setData(this._arrEmptyCells);var n=t.asc_getDisplayEmpty();this.cmbEmptyCells.setValue(this._state.SparkType!==Asc.c_oAscSparklineType.Line&&n==Asc.c_oAscEDispBlanksAs.Span?this.textEmptyLine:n),this.chShowEmpty.setValue(t.asc_getDisplayHidden(),!0),this.chShowAxis.setValue(t.asc_getDisplayXAxis(),!0),this.chReverse.setValue(t.asc_getRightToLeft(),!0),this.cmbSparkMinType.setValue(t.asc_getMinAxisType(),!0),this.cmbSparkMaxType.setValue(t.asc_getMaxAxisType(),!0),this.spnSparkMinValue.setDisabled(t.asc_getMinAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom),this.spnSparkMaxValue.setDisabled(t.asc_getMaxAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom),this.spnSparkMinValue.setValue(null!==t.asc_getManualMin()?t.asc_getManualMin():"",!0),this.spnSparkMaxValue.setValue(null!==t.asc_getManualMax()?t.asc_getManualMax():"",!0),this._changedProps=new Asc.sparklineGroup,this._noApply=!1}},getSettings:function(){var t,e=this.mnuChartTypePicker.getSelectedRec()[0].get("type");if(this.isChart){this.chartSettings.putType(e),this.chartSettings.putInColumns(1==this.cmbDataDirect.getValue()),this.chartSettings.putRange(this.txtDataRange.getValue()),this.chartSettings.putTitle(this.cmbChartTitle.getValue()),this.chartSettings.putLegendPos(this.cmbLegendPos.getValue()),this.chartSettings.putShowHorAxis(this.cmbHorShow.getValue()),this.chartSettings.putShowVerAxis(this.cmbVertShow.getValue()),this.chartSettings.putHorAxisLabel(this.cmbHorTitle.getValue()),this.chartSettings.putVertAxisLabel(this.cmbVertTitle.getValue()),this.chartSettings.putHorGridLines(this.cmbHorGrid.getValue()),this.chartSettings.putVertGridLines(this.cmbVertGrid.getValue()),this.chartSettings.putDataLabelsPos(this.cmbDataLabels.getValue()),this.chartSettings.putShowSerName("checked"==this.chSeriesName.getValue()),this.chartSettings.putShowCatName("checked"==this.chCategoryName.getValue()),this.chartSettings.putShowVal("checked"==this.chValue.getValue()),this.chartSettings.putSeparator(_.isEmpty(this.txtSeparator.getValue())?" ":this.txtSeparator.getValue()),this.chartSettings.putShowMarker("checked"==this.chMarkers.getValue()),t=e==Asc.c_oAscChartTypeSettings.lineNormal||e==Asc.c_oAscChartTypeSettings.lineStacked||e==Asc.c_oAscChartTypeSettings.lineStackedPer||e==Asc.c_oAscChartTypeSettings.scatter,t&&(t=this.cmbLines.getValue(),this.chartSettings.putLine(0!==t),t>0&&this.chartSettings.putSmooth(2==t)),this.chartSettings.putVertAxisProps(this.vertAxisProps),this.chartSettings.putHorAxisProps(this.horAxisProps);var i=this.isAltTitleChanged||this.isAltDescChanged?new Asc.asc_CImgProperty:null;return this.isAltTitleChanged&&i.asc_putTitle(this.inputAltTitle.getValue()),this.isAltDescChanged&&i.asc_putDescription(this.textareaAltDescription.val()),{chartSettings:this.chartSettings,imageSettings:i}}return{chartSettings:this._changedProps}},isRangeValid:function(){if(this.isChart){var t;if(_.isEmpty(this.txtDataRange.getValue()))this.txtDataRange.showError([this.txtEmpty]);else if((t=this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart,this.txtDataRange.getValue(),!0,0==this.cmbDataDirect.getValue(),this.mnuChartTypePicker.getSelectedRec()[0].get("type")))==Asc.c_oAscError.ID.No)return!0;return this.setActiveCategory(0),t==Asc.c_oAscError.ID.StockChartError?Common.UI.warning({msg:this.errorStockChart}):t==Asc.c_oAscError.ID.MaxDataSeriesError?Common.UI.warning({msg:this.errorMaxRows}):this.txtDataRange.cmpEl.find("input").focus(),!1}return!0},onSelectData:function(){var t=this;if(t.api){var e=function(e,i){"ok"==i&&(t.dataRangeValid=e.getSettings(),t.txtDataRange.setValue(t.dataRangeValid),t.txtDataRange.checkValidate())},i=new SSE.Views.CellRangeDialog({handler:e}).on("close",function(){t.show()}),n=t.$window.offset();t.hide(),i.show(n.left+160,n.top+125),i.setSettings({api:t.api,isRows:0==t.cmbDataDirect.getValue(),range:_.isEmpty(t.txtDataRange.getValue())||1!=t.txtDataRange.checkValidate()?t.dataRangeValid:t.txtDataRange.getValue(),typeLine truncated
|
||||||
|
type:Asc.c_oAscChartTypeSettings.barNormal3d,iconCls:"column-3d-normal"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStacked3d,iconCls:"column-3d-stack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStackedPer3d,iconCls:"column-3d-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3dPerspective,iconCls:"column-3d-normal-per"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineNormal,iconCls:"line-normal"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStacked,iconCls:"line-stack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStackedPer,iconCls:"line-pstack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.line3d,iconCls:"line-3d"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie,iconCls:"pie-normal"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.doughnut,iconCls:"pie-doughnut"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie3d,iconCls:"pie-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal,iconCls:"bar-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked,iconCls:"bar-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer,iconCls:"bar-pstack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal3d,iconCls:"bar-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked3d,iconCls:"bar-3d-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer3d,iconCls:"bar-3d-pstack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaNormal,iconCls:"area-normal"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStacked,iconCls:"area-stack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStackedPer,iconCls:"area-pstack"},{group:"menu-chart-group-scatter",type:Asc.c_oAscChartTypeSettings.scatter,iconCls:"point-normal"},{group:"menu-chart-group-stock",type:Asc.c_oAscChartTypeSettings.stock,iconCls:"stock-normal"}]),itemTemplate:i.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')})}),this.btnChartType.render(e("#chart-button-type")),this.mnuChartTypePicker.on("item:click",i.bind(this.onSelectType,this,this.btnChartType)),this.lockedControls.push(this.btnChartType),this.spnWidth=new Common.UI.MetricSpinner({el:e("#chart-spin-width"),step:.1,width:78,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnWidth),this.lockedControls.push(this.spnWidth),this.spnHeight=new Common.UI.MetricSpinner({el:e("#chart-spin-height"),step:.1,width:78,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnHeight),this.lockedControls.push(this.spnHeight),this.spnWidth.on("change",i.bind(this.onWidthChange,this)),this.spnHeight.on("change",i.bind(this.onHeightChange,this)),this.btnRatio=new Common.UI.Button({cls:"btn-toolbar",iconCls:"advanced-btn-ratio",style:"margin-bottom: 1px;",enableToggle:!0,hint:this.textKeepRatio}),this.btnRatio.render(e("#chart-button-ratio")),this.lockedControls.push(this.btnRatio),this.btnRatio.on("click",i.bind(function(t,e){if(t.pressed&&this.spnHeight.getNumberValue()>0&&(this._nRatio=this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue()),this.api){var i=new Asc.asc_CImgProperty;i.asc_putLockAspect(t.pressed),this.api.asc_setGraphicObjectProps(i)}},this)),this.btnSparkType=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-chartlist spark-column",menu:new Common.UI.Menu({style:"width: 200px; padding-top: 12px;",items:[{template:i.template('<div id="id-spark-menu-type" class="menu-insertchart" style="margin: 5px 5px 0 10px;"></div>')}]})}),this.btnSparkType.on("render:after",function(n){t.mnuSparkTypePicker=new Common.UI.DataView({el:e("#id-spark-menu-type"),parentMenu:n.menu,restoreHeight:120,allowScrollbar:!1,groups:new Common.UI.DataViewGroupStore([{id:"menu-chart-group-sparkcolumn",inline:!0},{id:"menu-chart-group-sparkline",inline:!0},{id:"menu-chart-group-sparkwin",inline:!0}]),store:new Common.UI.DataViewStore([{group:"menu-chart-group-sparkcolumn",type:Asc.c_oAscSparklineType.Column,allowSelected:!0,iconCls:"spark-column",tip:t.textColumnSpark},{group:"menu-chart-group-sparkline",type:Asc.c_oAscSparklineType.Line,allowSelected:!0,iconCls:"spark-line",tip:t.textLineSpark},{group:"menu-chart-group-sparkwin",type:Asc.c_oAscSparklineType.Stacked,allowSelected:!0,iconCls:"spark-win",tip:t.textWinLossSpark}]),itemTemplate:i.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')})}),this.btnSparkType.render(e("#spark-button-type")),this.mnuSparkTypePicker.on("item:click",i.bind(this.onSelectSparkType,this,this.btnSparkType)),this.lockedControls.push(this.btnSparkType),this.cmbBorderSize=new Common.UI.ComboBorderSizeEditable({el:e("#spark-combo-line-type")Line truncated
|
||||||
|
template:_.template(['<div class="btn-group" id="<%= id %>">','<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',"<span> </span>","</button>","</div>"].join("")),setColor:function(t){var e,i,n=$(this.cmpEl).find("button span");this.color=t,"transparent"==t?(e="#BEBEBE",i=t,n.addClass("color-transparent")):(e="transparent",i="object"==typeof t?"#"+t.color:"#"+t,n.removeClass("color-transparent")),n.css({"background-color":i,"border-color":e})}})}),void 0===Common)var Common={};if(define("common/main/lib/component/Slider",["common/main/lib/component/BaseView","underscore"],function(t,e){"use strict";Common.UI.SingleSlider=Common.UI.BaseView.extend({options:{width:100,minValue:0,maxValue:100,step:1,value:100,enableKeyEvents:!1},disabled:!1,template:e.template(['<div class="slider single-slider" style="">','<div class="track">','<div class="track-left img-commonctrl"></div>','<div class="track-center img-commonctrl"></div>','<div class="track-right img-commonctrl" style=""></div>',"</div>",'<div class="thumb img-commonctrl" style=""></div>',"<% if (this.options.enableKeyEvents) { %>",'<input type="text" style="position: absolute; top:-10px; width: 1px; height: 1px;">',"<% } %>","</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);e.width=e.options.width,e.minValue=e.options.minValue,e.maxValue=e.options.maxValue,e.delta=100/(e.maxValue-e.minValue),e.step=e.options.step,e.options.el&&e.render(),this.setValue(e.options.value)},render:function(t){var i=this;i.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({})),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl)),this.cmpEl.find(".track-center").width(i.options.width-14),this.cmpEl.width(i.options.width),this.thumb=this.cmpEl.find(".thumb");var n,o=function(t){t.preventDefault(),t.stopPropagation();var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,i.thumb.removeClass("active"),$(document).off("mouseup",o),$(document).off("mousemove",s),i._dragstart=void 0,i.trigger("changecomplete",i,i.value,i.lastValue)},s=function(t){if(!i.disabled&&void 0!==i._dragstart){t.preventDefault(),t.stopPropagation();var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,Math.abs(i.value-i.lastValue)>.001&&i.trigger("change",i,i.value,i.lastValue)}},a=function(t){i.disabled||(i._dragstart=t.pageX*Common.Utils.zoom()-i.thumb.offset().left-7,i.thumb.addClass("active"),$(document).on("mouseup",o),$(document).on("mousemove",s),i.options.enableKeyEvents&&setTimeout(function(){i.input.focus()},10))},r=function(t){if(!i.disabled){var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,i.trigger("change",i,i.value,i.lastValue),i.trigger("changecomplete",i,i.value,i.lastValue)}},l=function(t){i.lastValue=i.value,i.value=Math.max(i.minValue,Math.min(i.maxValue,i.value+(t?i.step:-i.step))),i.setThumbPosition(Math.round((i.value-i.minValue)*i.delta)),i.trigger("change",i,i.value,i.lastValue)},c=function(t){i.disabled||t.keyCode!=Common.UI.Keys.UP&&t.keyCode!=Common.UI.Keys.DOWN&&t.keyCode!=Common.UI.Keys.LEFT&&t.keyCode!=Common.UI.Keys.RIGHT||(t.preventDefault(),t.stopPropagation(),d.off("keydown","input",c),n=setInterval(e.bind(l,i,t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.RIGHT),100))},h=function(t){i.disabled||(t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.DOWN||Common.UI.Keys.LEFT||Common.UI.Keys.RIGHT)&&(t.stopPropagation(),t.preventDefault(),clearInterval(n),l(t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.RIGHT),d.on("keydown","input",c),i.trigger("changecomplete",i,i.value,i.lastValue))};if(!i.rendered){var d=i.cmpEl;d.on("mousedown",".thumb",a),d.on("mousedown",".track",r),this.options.enableKeyEvents&&(d.on("keydown","input",c),d.on("keyup","input",h))}return i.rendered=!0,this},setThumbPosition:function(t){this.thumb.css({left:t+"%"})},setValue:function(t){this.lastValue=this.value,this.value=Math.max(this.minValue,Math.min(this.maxValue,t)),this.setThumbPosition(Math.round((t-this.minValue)*this.delta))},getValue:function(){return this.value},setDisabled:function(t){t!==this.disabled&&this.cmpEl.toggleClass("disabled",t),this.disabled=t}}),Common.UI.MultiSlider=Common.UI.BaseView.extend({options:{width:100,minValue:0,maxValue:100,values:[0,100]},disabled:!1,template:e.template(['<div class="slider multi-slider">','<div class="track">','<div class="track-left"></div>','<div class="track-center""></div>','<div class="track-right" style=""></div>',"</div>","<% _.each(items, function(item) { %>",Line truncated
|
||||||
|
for(var i=e.asc_getLinejoin(),n=0;n<this._arrJoinType.length;n++)if(i==this._arrJoinType[n].value){this.cmbJoinType.setValue(i);break}for(i=e.asc_getLinecap(),n=0;n<this._arrCapType.length;n++)if(i==this._arrCapType[n].value){this.cmbCapType.setValue(i);break}var o=e.asc_getCanChangeArrows();if(this.btnBeginStyle.setDisabled(!o),this.btnEndStyle.setDisabled(!o),this.btnBeginSize.setDisabled(!o),this.btnEndSize.setDisabled(!o),o){i=e.asc_getLinebeginsize();var s=this.mnuBeginSizePicker.store.findWhere({type:i});s?this._beginSizeIdx=s.get("value"):(this._beginSizeIdx=null,this._selectStyleItem(this.btnBeginSize,null)),i=e.asc_getLinebeginstyle(),s=this.mnuBeginStylePicker.store.findWhere({type:i}),s?(this.mnuBeginStylePicker.selectRecord(s,!0),this._updateSizeArr(this.btnBeginSize,this.mnuBeginSizePicker,s,this._beginSizeIdx),this._selectStyleItem(this.btnBeginStyle,s)):this._selectStyleItem(this.btnBeginStyle,null),i=e.asc_getLineendsize(),s=this.mnuEndSizePicker.store.findWhere({type:i}),s?this._endSizeIdx=s.get("value"):(this._endSizeIdx=null,this._selectStyleItem(this.btnEndSize,null)),i=e.asc_getLineendstyle(),s=this.mnuEndStylePicker.store.findWhere({type:i}),s?(this.mnuEndStylePicker.selectRecord(s,!0),this._updateSizeArr(this.btnEndSize,this.mnuEndSizePicker,s,this._endSizeIdx),this._selectStyleItem(this.btnEndStyle,s)):this._selectStyleItem(this.btnEndStyle,null)}else this._selectStyleItem(this.btnBeginStyle),this._selectStyleItem(this.btnEndStyle),this._selectStyleItem(this.btnBeginSize),this._selectStyleItem(this.btnEndSize)}}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01)}this.sizeMax={width:Common.Utils.Metric.fnRecalcFromMM(10*this.options.sizeMax.width),height:Common.Utils.Metric.fnRecalcFromMM(10*this.options.sizeMax.height)},this.options.sizeOriginal&&(this.sizeOriginal={width:Common.Utils.Metric.fnRecalcFromMM(this.options.sizeOriginal.width),height:Common.Utils.Metric.fnRecalcFromMM(this.options.sizeOriginal.height)})},_updateSizeArr:function(t,e,i,n){i.get("value")>0?(e.store.each(function(t){t.set({offsetx:80*i.get("value")+10})},this),t.setDisabled(!1),null!==n?(e.selectByIndex(n,!0),this._selectStyleItem(t,e.store.at(n))):this._selectStyleItem(t,null)):(this._selectStyleItem(t,null),t.setDisabled(!0))},_selectStyleItem:function(t,e){$(t.el).find(".form-control").css("background-position",(e?20-e.get("offsetx")+"px":"0")+" "+(e?"-"+e.get("offsety")+"px":"-30px"))},onSelectBeginStyle:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLinebeginstyle(i.get("type"))),null!==this._beginSizeIdx&&void 0!==this._beginSizeIdx||(this._beginSizeIdx=4),this._updateSizeArr(this.btnBeginSize,this.mnuBeginSizePicker,i,this._beginSizeIdx),this._selectStyleItem(this.btnBeginStyle,i)},onSelectBeginSize:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLinebeginsize(i.get("type"))),this._beginSizeIdx=i.get("value"),this._selectStyleItem(this.btnBeginSize,i)},onSelectEndStyle:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLineendstyle(i.get("type"))),null!==this._endSizeIdx&&void 0!==this._endSizeIdx||(this._endSizeIdx=4),this._updateSizeArr(this.btnEndSize,this.mnuEndSizePicker,i,this._endSizeIdx),this._selectStyleItem(this.btnEndStyle,i)},onSelectEndSize:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLineendLine truncated
|
||||||
|
if(this.btnBackColor.setColor(this.ShapeColor.Color),"object"==typeof this.ShapeColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.ShapeColor.Color.effectValue){this.colorsBack.select(this.ShapeColor.Color,!0),C=!0;break}C||this.colorsBack.clearSelection()}else this.colorsBack.select(this.ShapeColor.Color,!0);this._state.ShapeColor=this.ShapeColor.Color}var y,_=n.asc_getStroke(),x=_.asc_getType();if(_?(x==Asc.c_oAscStrokeType.STROKE_COLOR?(l=_.asc_getColor(),l?l.asc_getType()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BorderColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(l.asc_getR(),l.asc_getG(),l.asc_getB()),effectValue:l.asc_getValue()}}:this.BorderColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(l.asc_getR(),l.asc_getG(),l.asc_getB())}:this.BorderColor={Value:1,Color:"transparent"}):this.BorderColor={Value:1,Color:"transparent"},y=_.asc_getPrstDash()):(x=null,this.BorderColor={Value:0,Color:"transparent"}),f=typeof this.BorderColor.Color,b=typeof this._state.StrokeColor,f!==b||"object"==f&&(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue||this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)||"object"!=f&&(this._state.StrokeColor.indexOf(this.BorderColor.Color)<0||"object"==typeof this.btnBorderColor.color)){if(this.btnBorderColor.setColor(this.BorderColor.Color),"object"==typeof this.BorderColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.BorderColor.Color.effectValue){this.colorsBorder.select(this.BorderColor.Color,!0),C=!0;break}C||this.colorsBorder.clearSelection()}else this.colorsBorder.select(this.BorderColor.Color,!0);this._state.StrokeColor=this.BorderColor.Color}if(this._state.StrokeType!==x||x==Asc.c_oAscStrokeType.STROKE_COLOR){if(x==Asc.c_oAscStrokeType.STROKE_COLOR){var w=_.asc_getWidth(),S=Math.abs(this._state.StrokeWidth-w)<.001&&!new RegExp(this.txtPt+"\\s*$").test(this.cmbBorderSize.getRawValue());if(Math.abs(this._state.StrokeWidth-w)>.001||S||(null===this._state.StrokeWidth||null===w)&&this._state.StrokeWidth!==w){this._state.StrokeWidth=w,null!==w&&(w=this._mm2pt(w));var A=null===w?w:i.find(this.cmbBorderSize.store.models,function(t){if(w<t.attributes.value+.01&&w>t.attributes.value-.01)return!0});A?this.cmbBorderSize.selectRecord(A):this.cmbBorderSize.setValue(null!==w?parseFloat(w.toFixed(2))+" "+this.txtPt:""),this.BorderSize=w}}else x==Asc.c_oAscStrokeType.STROKE_NONE?(this._state.StrokeWidth=0,this.BorderSize=this.cmbBorderSize.store.at(0).get("value"),this.cmbBorderSize.setValue(this.BorderSize)):(this._state.StrokeWidth=null,this.BorderSize=-1,this.cmbBorderSize.setValue(null));this._state.StrokeType=x}if(this._state.StrokeBorderType!==y&&(this.BorderType=this._state.StrokeBorderType=y,this.cmbBorderType.setValue(y)),f=typeof this.FGColor.Color,b=typeof this._state.FGColor,f!==b||"object"==f&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||"object"!=f&&this._state.FGColor.indexOf(this.FGColor.Color)<0){if(this.btnFGColor.setColor(this.FGColor.Color),"object"==typeof this.FGColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),C=!0;break}C||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}if(f=typeof this.BGColor.Color,b=typeof this._state.BGColor,f!==b||"object"==f&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||"object"!=f&&this._state.BGColor.indexOf(this.BGColor.Color)<0){if(this.btnBGColor.setColor(this.BGColor.Color),"object"==typeof this.BGColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),C=!0;break}C||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGColor.Color}if(l=this.GradColor.colors[this.GradColor.currentIdx],f=typeof l,b=typeof this._state.GradColor,f!==b||"object"==f&&(l.effectValue!==this._state.GradColor.effectValue||this._state.GradColor.color.indexOf(l.color)<0)||"object"!=f&&this._state.GradColor.indexOf(l)<0){if(this.btnGradColor.setColor(l),"object"==typeof l){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==l.effectValue){this.colorsGrad.select(l,!0),C=!0;break}C||this.colorsGrad.clearSelection()}else this.colorsGrad.select(l,!0);this._state.GradColor=l}this._noApply=!1}},createDelayedControls:function(){var t=this;this._arrFillSrc=[{displayValue:this.textColor,value:Asc.c_oAscFill.FILL_TYPE_SOLID},{displayValue:this.textGradientFill,value:Asc.c_oAscFill.FILL_TYPE_GRAD},{displayValue:this.textImageTexture,value:Asc.c_oAscFill.FILL_TYPE_BLIP},{displayValue:this.textPatternFill,value:Asc.c_oAscFill.FILL_TYLine truncated
|
||||||
|
this.FillImageContainer=e("#textart-panel-image-fill"),this.FillPatternContainer=e("#textart-panel-pattern-fill"),this.FillGradientContainer=e("#textart-panel-gradient-fill"),this.TransparencyContainer=e("#textart-panel-transparent-fill")},render:function(){e(this.el).html(this.template({scope:this}))},setApi:function(t){return this.api=t,this.api&&(this.api.asc_setInterfaceDrawImagePlaceTextArt("textart-texture-img"),this.api.asc_registerCallback("asc_onInitStandartTextures",i.bind(this.onInitStandartTextures,this))),this},onFillSrcSelect:function(t,e){switch(this.ShowHideElem(e.value),e.value){case Asc.c_oAscFill.FILL_TYPE_SOLID:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_SOLID,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_SOLID),n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor("transparent"==this.ShapeColor.Color?{color:"4f81bd",effectId:24}:this.ShapeColor.Color)),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;if(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),n.asc_putFill(new Asc.asc_CFillGrad),n.asc_getFill().asc_putGradType(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),n.asc_getFill().asc_putLinearScale(!0)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var o=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();o="ffffff"===o&&"ffffff"===s?{color:"4f81bd",effectId:24}:this.GradColor.colors[0],n.asc_getFill().asc_putPositions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]]),n.asc_getFill().asc_putColors([Common.Utils.ThemeColor.getRgbColor(o),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_PATT),n.asc_putFill(new Asc.asc_CFillHatch),n.asc_getFill().asc_putPatternType(this.PatternFillType);var a=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();a="ffffff"===Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex()&&"ffffff"===a?{color:"4f81bd",effectId:24}:this.FGColor.Color,n.asc_getFill().asc_putColorFg(Common.Utils.ThemeColor.getRgbColor(a)),n.asc_getFill().asc_putColorBg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}}Common.NotificationCenter.trigger("edit:complete",this)},onColorsBackSelect:function(t,e){if(this.btnBackColor.setColor(e),this.ShapeColor={Value:1,Color:e},this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;"transparent"==this.ShapeColor.Color?(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null)):(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_SOLID),n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color))),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)},addNewColor:function(t,e){t.addNewColor("object"==typeof e.color?e.color.color:e.color)},onPatternSelect:function(t,e){if(this.api&&!this._noApply){this.PatternFillType=e.get("type");var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_PATT),n.asc_putFill(new Asc.asc_CFillHatch),n.asc_getFill().asc_putPatternType(this.PatternFillType),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(n.asc_getFill().asc_putColorFg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),n.asc_getFill().asc_putColorBg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)},onColorsFGSelect:function(Line truncated
|
||||||
|
offsety:50,type:0,subtype:6,iconcls:"gradient-left",cls:"item-gradient-separator",selected:!0},{offsetx:100,offsety:50,type:180,subtype:1,iconcls:"gradient-right"},{offsetx:0,offsety:100,type:315,subtype:2,iconcls:"gradient-left-bottom"},{offsetx:50,offsety:100,type:270,subtype:3,iconcls:"gradient-bottom"},{offsetx:100,offsety:100,type:225,subtype:7,iconcls:"gradient-right-bottom"}],this._viewDataRadial=[{offsetx:100,offsety:150,type:2,subtype:5,iconcls:"gradient-radial-center"}],this.btnDirection=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-gradient gradient-left",menu:new Common.UI.Menu({style:"min-width: 60px;",menuAlign:"tr-br",items:[{template:i.template('<div id="id-textart-menu-direction" style="width: 175px; margin: 0 5px;"></div>')}]})}),this.btnDirection.on("render:after",function(n){t.mnuDirectionPicker=new Common.UI.DataView({el:e("#id-textart-menu-direction"),parentMenu:n.menu,restoreHeight:174,store:new Common.UI.DataViewStore(t._viewDataLinear),itemTemplate:i.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')})}),this.btnDirection.render(e("#textart-button-direction")),this.mnuDirectionPicker.on("item:click",i.bind(this.onSelectGradient,this,this.btnDirection)),this.lockedControls.push(this.btnDirection),this.sldrGradient=new Common.UI.MultiSliderGradient({el:e("#textart-slider-gradient"),width:125,minValue:0,maxValue:100,values:[0,100]}),this.sldrGradient.on("change",i.bind(this.onGradientChange,this)),this.sldrGradient.on("changecomplete",i.bind(this.onGradientChangeComplete,this)),this.sldrGradient.on("thumbclick",function(e,i){t.GradColor.currentIdx=i;var n=t.GradColor.colors[t.GradColor.currentIdx];t.btnGradColor.setColor(n),t.colorsGrad.select(n,!1)}),this.sldrGradient.on("thumbdblclick",function(e){t.btnGradColor.cmpEl.find("button").dropdown("toggle")}),this.lockedControls.push(this.sldrGradient),this.cmbBorderSize=new Common.UI.ComboBorderSizeEditable({el:e("#textart-combo-border-size"),style:"width: 93px;",txtNoBorders:this.txtNoBorders}).on("selected",i.bind(this.onBorderSizeSelect,this)).on("changed:before",i.bind(this.onBorderSizeChanged,this,!0)).on("changed:after",i.bind(this.onBorderSizeChanged,this,!1)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderSize=this.cmbBorderSize.store.at(2).get("value"),this.cmbBorderSize.setValue(this.BorderSize),this.lockedControls.push(this.cmbBorderSize),this.cmbBorderType=new Common.UI.ComboBorderType({el:e("#textart-combo-border-type"),style:"width: 93px;",menuStyle:"min-width: 93px;"}).on("selected",i.bind(this.onBorderTypeSelect,this)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderType=Asc.c_oDashType.solid,this.cmbBorderType.setValue(this.BorderType),this.lockedControls.push(this.cmbBorderType),this.cmbTransform=new Common.UI.ComboDataView({itemWidth:50,itemHeight:50,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-textart"}),this.cmbTransform.render(e("#textart-combo-transform")),this.cmbTransform.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbTransform.on("click",i.bind(this.onTransformSelect,this)),this.cmbTransform.openButton.menu.on("show:after",function(){t.cmbTransform.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.lockedControls.push(this.cmbTransform)},createDelayedElements:function(){this.createDelayedControls();var t=[0,1,3,2,4,53,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52];this.patternViewData=[];for(var e=0;e<13;e++)for(var i=0;i<4;i++){var n=4*e+i;this.patternViewData[n]={offsetx:28*i,offsety:28*e,type:t[n]}}this.patternViewData.splice(this.patternViewData.length-2,2);for(var e=0;e<this.patternViewData.length;e++)this.patternViewData[e].id=Common.UI.getId();this.cmbPattern.menuPicker.store.add(this.patternViewData),this.cmbPattern.menuPicker.store.length>0&&(this.cmbPattern.fillComboView(this.cmbPattern.menuPicker.store.at(0),!0),this.PatternFillType=this.patternViewData[0].type),this.UpdateThemeColors(),this.fillTransform(this.api.asc_getPropertyEditorTextArts()),this._initSettings=!1},onInitStandartTextures:function(t){var n=this;if(t&&t.length>0){this.btnTexture=new Common.UI.ComboBox({el:e("#textart-combo-fill-texture"),template:i.template(['<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">','<div class="form-control text" style="width: 90px;">'+this.textSelectTexture+"</div>",'<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',"</div>"].join(""))}),this.textureMenu=new Common.UI.Menu({items:[{template:i.template('<div id="id-textart-menu-texture" style="width: 233px; margin: 0 5px;"></div>')}]}),this.textureMenu.render(e("#textart-combo-fill-texture")),this.lockedControls.push(this.btnTexture);var o=[];i.each(t,function(t){o.push(Line truncated
|
||||||
|
disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},textEdit:"Rows & Columns",selectRowText:"Select Row",selectColumnText:"Select Entire Column",selectDataText:"Select Column Data",selectTableText:"Select Table",insertRowAboveText:"Insert Row Above",insertRowBelowText:"Insert Row Below",insertColumnLeftText:"Insert Column Left",insertColumnRightText:"Insert Column Right",deleteRowText:"Delete Row",deleteColumnText:"Delete Column",deleteTableText:"Delete Table",textOK:"OK",textCancel:"Cancel",textTemplate:"Select From Template",textRows:"Rows",textColumns:"Columns",textHeader:"Header",textTotal:"Total",textBanded:"Banded",textFirst:"First",textLast:"Last",textEmptyTemplate:"No templates",textFilter:"Filter button",textTableName:"Table Name",textResize:"Resize table",textSelectData:"Select Data",textInvalidName:"ERROR! Invalid table name",textExistName:"ERROR! Range with such a name already exists",textIsLocked:"This element is being edited by another user.",notcriticalErrorTitle:"Warning",textReservedName:"The name you are trying to use is already referenced in cell formulas. Please use some other name.",textAdvanced:"Show advanced settings",textConvertRange:"Convert to range"},SSE.Views.TableSettings||{}))});var SCALE_MIN=40,MENU_SCALE_PART=260;if(define("spreadsheeteditor/main/app/view/RightMenu",["text!spreadsheeteditor/main/app/template/RightMenu.template","jquery","underscore","backbone","common/main/lib/component/Button","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","spreadsheeteditor/main/app/view/ParagraphSettings","spreadsheeteditor/main/app/view/ImageSettings","spreadsheeteditor/main/app/view/ChartSettings","spreadsheeteditor/main/app/view/ShapeSettings","spreadsheeteditor/main/app/view/TextArtSettings","spreadsheeteditor/main/app/view/TableSettings","common/main/lib/component/Scroller"],function(t,e,i,n){"use strict";SSE.Views.RightMenu=n.View.extend(i.extend({el:"#right-menu",template:i.template(t),events:{},initialize:function(){return this.minimizedMode=!0,this.btnText=new Common.UI.Button({hint:this.txtParagraphSettings,asctype:Common.Utils.documentSettingsType.Paragraph,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnImage=new Common.UI.Button({hint:this.txtImageSettings,asctype:Common.Utils.documentSettingsType.Image,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnChart=new Common.UI.Button({hint:this.txtChartSettings,asctype:Common.Utils.documentSettingsType.Chart,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnShape=new Common.UI.Button({hint:this.txtShapeSettings,asctype:Common.Utils.documentSettingsType.Shape,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTextArt=new Common.UI.Button({hint:this.txtTextArtSettings,asctype:Common.Utils.documentSettingsType.TextArt,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTable=new Common.UI.Button({hint:this.txtTableSettings,asctype:Common.Utils.documentSettingsType.Table,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this._settings=[],this._settings[Common.Utils.documentSettingsType.Paragraph]={panel:"id-paragraph-settings",btn:this.btnText},this._settings[Common.Utils.documentSettingsType.Image]={panel:"id-image-settings",btn:this.btnImage},this._settings[Common.Utils.documentSettingsType.Shape]={panel:"id-shape-settings",btn:this.btnShape},this._settings[Common.Utils.documentSettingsType.Chart]={panel:"id-chart-settings",btn:this.btnChart},this._settings[Common.Utils.documentSettingsType.TextArt]={panel:"id-textart-settings",btn:this.btnTextArt},this._settings[Common.Utils.documentSettingsType.Table]={panel:"id-table-settings",btn:this.btnTable},this},render:function(){var t=e(this.el);return this.trigger("render:before",this),t.css("width","40px"),t.css("z-index",101),t.show(),t.html(this.template({})),this.btnText.el=e("#id-right-menu-text"),this.btnText.render(),this.btnImage.el=e("#id-right-menu-image"),this.btnImage.render(),this.btnChart.el=e("#id-right-menu-chart"),this.btnChart.render(),this.btnShape.el=e("#id-right-menu-shape"),this.btnShape.render(),this.btnTextArt.el=e("#id-right-menu-textart"),this.btnTextArt.render(),this.btnTable.el=e("#id-right-menu-table"),this.btnTable.render(),this.btnText.on("click",i.bind(this.onBtnMenuClick,this)),this.btnImage.on("click",i.bind(this.onBtnMenuClick,this)),this.btnChart.on("click",i.bind(this.onBtnMenuClick,this)),this.btnShape.on("click",i.bind(this.onBtnMenuClick,this)),this.btnTextArt.on("click",i.bind(this.onBtnMenuClick,this)),this.btnTable.on("click",i.bind(this.onBtnMenuClick,this)),this.paLine truncated
|
||||||
|
return'<% if (!hide) { %>\r\n <div id="<%= id %>" class="user-comment-item">\r\n\r\n \x3c!-- comment block --\x3e\r\n\r\n <div class="user-name"><%=scope.getUserName(username)%></div>\r\n <div class="user-date"><%=date%></div>\r\n <% if (quote!==null) { %>\r\n <div class="user-quote"><%=scope.getFixedQuote(quote)%></div>\r\n <% } %>\r\n <% if (!editText) { %>\r\n <div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea>\r\n <button class="btn normal dlg-btn primary btn-inner-edit" id="id-comments-change">textEdit</button>\r\n <button class="btn normal dlg-btn btn-inner-close">textCancel</button>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- replys elements --\x3e\r\n\r\n <% if (replys.length) { %>\r\n <div class="reply-arrow img-commonctrl"></div>\r\n <% _.each(replys, function (item) { %>\r\n <div class="reply-item-ct">\r\n <div class="user-name"><%=scope.getUserName(item.get("username"))%></div>\r\n <div class="user-date"><%=item.get("date")%></div>\r\n <% if (!item.get("editText")) { %>\r\n <div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>\r\n <div class="btns-reply-ct">\r\n <% if (item.get("editable")) { %>\r\n <div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n <% } %>\r\n <div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n </div>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>\r\n <button class="btn normal dlg-btn primary btn-inner-edit btn-fix" id="id-comments-change">textEdit</button>\r\n <button class="btn normal dlg-btn btn-inner-close">textClose</button>\r\n </div>\r\n <% } %>\r\n </div>\r\n <% }); %>\r\n <% } %>\r\n\r\n \x3c!-- add reply button --\x3e\r\n\r\n <% if (!showReply) { %>\r\n <% if (replys.length) { %>\r\n <label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } else { %>\r\n <label class="user-reply" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } %>\r\n <% } %>\r\n\r\n \x3c!-- edit buttons --\x3e\r\n\r\n <% if (!editText && !lock) { %>\r\n <div class="edit-ct">\r\n <% if (editable) { %>\r\n <div class="btn-edit img-commonctrl"></div>\r\n <% } %>\r\n <div class="btn-delete img-commonctrl"></div>\r\n <% if (resolved) { %>\r\n <div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>\r\n <% } else { %>\r\n <div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>\r\n <% } %>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- reply --\x3e\r\n\r\n <% if (showReply) { %>\r\n <div class="reply-ct">\r\n <textarea class="msg-reply user-select" placeholder="textAddReply" maxlength="maxCommLength"></textarea>\r\n <button class="btn normal dlg-btn primary btn-reply" id="id-comments-change">textReply</button>\r\n <button class="btn normal dlg-btn btn-close">textClose</button>\r\n </div>\r\n <% } %>\r\n <% if (lock) { %>\r\n <div class="lock-area"></div>\r\n <div class="lock-author"><%=lockuserid%></div>\r\n <% } %>\r\n <% if (!last) { %>\r\n <div class="separator-cmt"></div>\r\n <% } %>\r\n </div>\r\n<% } %>\r\n'}),define("text!common/main/lib/template/CommentsPanel.template",[],function(){return'<div id="comments-box" class="layout-ct vbox">\r\n <div class="layout-item messages-ct"/>\r\n <div class="layout-item add-link-ct">\r\n <label class="btn new"><%=textAddCommentToDoc%></label>\r\n </div>\r\n <div style="display: none;" class="layout-item new-comment-ct">\r\n <div class="inner-ct">\r\n <textarea id="comment-msg-new" class="user-select" placeholder="<%=textEnterCommentHint%>" maxlength="<%=maxCommLength%>"/>\r\n </div>\r\n Line truncated
|
||||||
|
var o=/((^mailto:)\/\/)/i.test(t)?t:"mailto:"+t;return e=arguments[arguments.length-2],i=t.length,_.find(n,function(t){return e>=t.start&&e<t.end||e<=t.start&&e+i>t.start})||n.push({start:e,end:i+e,str:'<a href="'+o+'">'+t+"</a>"}),""}),n=_.sortBy(n,function(t){return t.start});for(var o=n.length>0?t.substring(0,n[0].start)+n[0].str:t,s=1;s<n.length;s++)o+=t.substring(n[s-1].end,n[s].start)+n[s].str;return n.length>0&&(o+=t.substring(n[s-1].end,t.length)),o},textComments:"Comments",textAnonym:"Guest",textAddCommentToDoc:"Add Comment to Document",textAddComment:"Add Comment",textCancel:"Cancel",textAddReply:"Add Reply",textReply:"Reply",textClose:"Close",textResolved:"Resolved",textResolve:"Resolve",textEnterCommentHint:"Enter your comment here",textEdit:"Edit",textAdd:"Add",textOpenAgain:"Open Again"},Common.Views.Comments||{}))}),define("text!common/main/lib/template/Chat.template",[],function(){return'<div id="chat-box" class="layout-ct vbox">\r\n <div id="chat-users" class="layout-item area">\r\n <div id="chat-user-ct"></div>\r\n </div>\r\n <div id="chat-messages" class="layout-item area">\r\n <div id="chat-message-ct"></div>\r\n </div>\r\n <div id="chat-options" class="layout-item">\r\n <div id="chat-options-ct">\r\n <textarea id="chat-msg-text" class="user-select" maxlength="<%=maxMsgLength%>"></textarea>\r\n <button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>\r\n </div>\r\n </div>\r\n</div>'}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Chat",["text!common/main/lib/template/Chat.template","common/main/lib/util/utils","common/main/lib/component/BaseView","common/main/lib/component/Layout"],function(t){"use strict";Common.Views.Chat=Common.UI.BaseView.extend(_.extend({el:"#left-panel-chat",template:_.template(t),storeUsers:void 0,storeMessages:void 0,tplUser:['<li id="chat-user-<%= user.get("id") %>"<% if (!user.get("online")) { %> class="offline"<% } %>>','<div class="color" style="background-color: <%= user.get("color") %>;" >','<label class="name"><%= scope.getUserName(user.get("username")) %></label>',"</div>","</li>"].join(""),templateUserList:_.template("<ul><% _.each(users, function(item) { %><%= _.template(usertpl, {user: item, scope: scope}) %><% }); %></ul>"),tplMsg:["<li>",'<% if (msg.get("type")==1) { %>','<div class="message service" data-can-copy="true"><%= msg.get("message") %></div>',"<% } else { %>",'<div class="user" data-can-copy="true" style="color: <%= msg.get("usercolor") %>;"><%= scope.getUserName(msg.get("username")) %></div>','<label class="message user-select" data-can-copy="true"><%= msg.get("message") %></label>',"<% } %>","</li>"].join(""),templateMsgList:_.template("<ul><% _.each(messages, function(item) { %><%= _.template(msgtpl, {msg: item, scope: scope}) %><% }); %></ul>"),events:{},usersBoxHeight:72,messageBoxHeight:70,addMessageBoxHeight:110,initialize:function(t){_.extend(this,t),Common.UI.BaseView.prototype.initialize.call(this,arguments),this.storeUsers.bind({add:_.bind(this._onAddUser,this),change:_.bind(this._onUsersChanged,this),reset:_.bind(this._onResetUsers,this)}),this.storeMessages.bind({add:_.bind(this._onAddMessage,this),reset:_.bind(this._onResetMessages,this)})},render:function(t){return t=t||this.el,$(t).html(this.template({scope:this,maxMsgLength:Asc.c_oAscMaxCellOrCommentLength})),this.panelBox=$("#chat-box",this.el),this.panelUsers=$("#chat-users",this.el),this.panelMessages=$("#chat-messages",this.el),this.txtMessage=$("#chat-msg-text",this.el),this.panelOptions=$("#chat-options",this.el),this.panelUsers.scroller=new Common.UI.Scroller({el:$("#chat-users"),useKeyboard:!0,minScrollbarLength:25}),this.panelMessages.scroller=new Common.UI.Scroller({el:$("#chat-messages"),includePadding:!0,useKeyboard:!0,minScrollbarLength:40}),$("#chat-msg-btn-add",this.el).on("click",_.bind(this._onBtnAddMessage,this)),this.txtMessage.on("keydown",_.bind(this._onKeyDown,this)),this.setupLayout(),this},focus:function(){var t=this;_.defer(function(){t.txtMessage.focus()},100),this.updateLayout(!0),this.setupAutoSizingTextBox()},_onKeyDown:function(t){t.keyCode==Common.UI.Keys.RETURN?!t.ctrlKey&&!t.metaKey||t.altKey||this._onBtnAddMessage(t):t.keyCode==Common.UI.Keys.ESC&&this.hide()},_onAddUser:function(t,e,i){this.panelUsers&&(this.panelUsers.find("ul").append(_.template(this.tplUser,{user:t,scope:this})),this.panelUsers.scroller.update({minScrollbarLength:25,alwaysVisibleY:!0}))},_onUsersChanged:function(t){void 0!=t.changed.online&&this.panelUsers&&(this.panelUsers.find("#chat-user-"+t.get("id"))[t.changed.online?"removeClass":"addClass"]("offline"),this.panelUsers.scroller.update({minScrollbarLength:25,alwaysVisibleY:!0}))},_onResetUsers:function(t,e){this.panelUsers&&(this.panelUsers.html(this.templateUserList({users:t.models,usertpl:this.tplUser,scope:this})),this.panelUsers.scroller.update({minScrollbarLengLine truncated
|
||||||
|
el:e("#left-btn-support",this.el),hint:this.tipSupport,disabled:!0}),this.btnComments=new Common.UI.Button({el:e("#left-btn-comments",this.el),hint:this.tipComments+Common.Utils.String.platformKey("Ctrl+Shift+H"),enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnChat=new Common.UI.Button({el:e("#left-btn-chat",this.el),hint:this.tipChat+Common.Utils.String.platformKey("Alt+Q"),enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnComments.hide(),this.btnChat.hide(),this.btnComments.on("click",i.bind(this.onBtnMenuClick,this)),this.btnChat.on("click",i.bind(this.onBtnMenuClick,this)),this.btnPlugins=new Common.UI.Button({el:e("#left-btn-plugins"),hint:this.tipPlugins,enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnPlugins.hide(),this.btnPlugins.on("click",i.bind(this.onBtnMenuClick,this)),this.btnSearch.on("click",i.bind(this.onBtnMenuClick,this)),this.btnAbout.on("toggle",i.bind(this.onBtnMenuToggle,this)),this.btnFile.on("toggle",i.bind(this.onBtnMenuToggle,this));var t=new SSE.Views.FileMenu({});return t.options={alias:"FileMenu"},this.btnFile.panel=t.render(),this.btnAbout.panel=new Common.Views.About({el:e("#about-menu-panel"),appName:"Spreadsheet Editor"}).render(),this},onBtnMenuToggle:function(t,e){e?(this.btnFile.pressed&&this.fireEvent("file:show",this),t.panel.show(),this.$el.width(40),this.btnSearch.isActive()&&this.btnSearch.toggle(!1)):(this.btnFile.id==t.id&&this.fireEvent("file:hide",this),t.panel.hide()),this.mode.isEdit&&SSE.getController("Toolbar").DisableToolbar(1==e),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onBtnMenuClick:function(t,e){this.btnFile.toggle(!1),this.btnAbout.toggle(!1),"search"==t.options.action||(t.pressed?this.$el.width()>40||this.$el.width(Common.localStorage.getItem("sse-mainmenu-width")||300):(Common.localStorage.setItem("sse-mainmenu-width",this.$el.width()),this.$el.width(40))),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onCoauthOptions:function(t){this.mode.canCoAuthoring&&(this.mode.canComments&&(this.btnComments.pressed&&this.btnComments.$el.hasClass("notify")&&this.btnComments.$el.removeClass("notify"),this.panelComments[this.btnComments.pressed?"show":"hide"](),this.fireEvent(this.btnComments.pressed?"comments:show":"comments:hide",this)),this.mode.canChat&&(this.btnChat.pressed?(this.btnChat.$el.hasClass("notify")&&this.btnChat.$el.removeClass("notify"),this.panelChat.show(),this.panelChat.focus()):this.panelChat.hide())),this.mode.canPlugins&&this.panelPlugins&&(this.btnPlugins.pressed?this.panelPlugins.show():this.panelPlugins.hide())},setOptionsPanel:function(t,e){"chat"==t?this.panelChat=e.render("#left-panel-chat"):"comment"==t?this.panelComments=e:"plugins"!=t||this.panelPlugins||(this.panelPlugins=e.render("#left-panel-plugins"))},markCoauthOptions:function(t,e){"chat"!=t||!this.btnChat.isVisible()||this.btnChat.isDisabled()||this.btnChat.pressed||this.btnChat.$el.addClass("notify"),"comments"!=t||!this.btnComments.isVisible()||this.btnComments.pressed||this.btnComments.isDisabled()&&!e||this.btnComments.$el.addClass("notify")},close:function(t){this.btnFile.toggle(!1),this.btnAbout.toggle(!1),this.$el.width(40),this.mode.canCoAuthoring&&(this.mode.canComments&&(this.panelComments.hide(),this.btnComments.pressed&&this.fireEvent("comments:hide",this),this.btnComments.toggle(!1,!0)),this.mode.canChat&&(this.panelChat.hide(),this.btnChat.toggle(!1,!0))),this.mode.canPlugins&&this.panelPlugins&&(this.panelPlugins.hide(),this.btnPlugins.toggle(!1,!0))},isOpened:function(){var t=this.btnFile.pressed||this.btnSearch.pressed;return!t&&(t=this.btnComments.pressed||this.btnChat.pressed),t},disableMenu:function(t,e){this.btnFile.setDisabled(!1),this.btnAbout.setDisabled(!1),this.btnSupport.setDisabled(!1),this.btnSearch.setDisabled(!1),this.btnComments.setDisabled(!1),this.btnChat.setDisabled(!1),this.btnPlugins.setDisabled(!1)},showMenu:function(t){var e=/^(\w+):?(\w*)$/.exec(t);"file"==e[1]&&this.btnFile.isVisible()?(this.btnFile.pressed||(this.btnFile.toggle(!0),this.btnFile.$el.focus()),this.btnFile.panel.show(e[2].length?e[2]:void 0)):"chat"==t?!this.btnChat.isVisible()||this.btnChat.isDisabled()||this.btnChat.pressed||(this.btnChat.toggle(!0),this.onBtnMenuClick(this.btnChat),this.onCoauthOptions(),this.panelChat.focus()):"comments"==t&&(!this.btnComments.isVisible()||this.btnComments.isDisabled()||this.btnComments.pressed||(this.btnComments.toggle(!0),this.onBtnMenuClick(this.btnComments),this.onCoauthOptions(),this.btnComments.$el.focus()))},getMenu:function(t){switch(t){case"file":return this.btnFile.panel;case"about":return this.btnAbout.panel;default:return null}},setMode:function(t){return this.mode=t,this.btnAbout.panel.setMode(t),this},setDeveloperMode:function(t){if(this.$el.is(":visible")){this.developerHint||(this.developerHint=e('<div id="developer-hint">'+this.txtDeveloper+"</div>").appendTo(this.$el),this.devHeight=this.developerHint.outerHeight(),e(windowLine truncated
|
||||||
|
n.push(e);else n=[[37,"IBM EBCDIC (US-Canada)"],[437,"OEM United States"],[500,"IBM EBCDIC (International)"],[708,"Arabic (ASMO 708)"],[720,"Arabic (DOS)"],[737,"Greek (DOS)"],[775,"Baltic (DOS)"],[850,"Western European (DOS)"],[852,"Central European (DOS)"],[855,"OEM Cyrillic"],[857,"Turkish (DOS)"],[858,"OEM Multilingual Latin I"],[860,"Portuguese (DOS)"],[861,"Icelandic (DOS)"],[862,"Hebrew (DOS)"],[863,"French Canadian (DOS)"],[864,"Arabic (864) "],[865,"Nordic (DOS)"],[866,"Cyrillic (DOS)"],[869,"Greek, Modern (DOS)"],[870,"IBM EBCDIC (Multilingual Latin-2)"],[874,"Thai (Windows)"],[875,"IBM EBCDIC (Greek Modern)"],[932,"Japanese (Shift-JIS)"],[936,"Chinese Simplified (GB2312)"],[949,"Korean"],[950,"Chinese Traditional (Big5)"],[1026,"IBM EBCDIC (Turkish Latin-5)"],[1047,"IBM Latin-1"],[1140,"IBM EBCDIC (US-Canada-Euro)"],[1141,"IBM EBCDIC (Germany-Euro)"],[1142,"IBM EBCDIC (Denmark-Norway-Euro)"],[1143,"IBM EBCDIC (Finland-Sweden-Euro)"],[1144,"IBM EBCDIC (Italy-Euro)"],[1145,"IBM EBCDIC (Spain-Euro)"],[1146,"IBM EBCDIC (UK-Euro)"],[1147,"IBM EBCDIC (France-Euro)"],[1148,"IBM EBCDIC (International-Euro)"],[1149,"IBM EBCDIC (Icelandic-Euro)"],[1200,"Unicode"],[1201,"Unicode (Big-Endian)"],[1250,"Central European (Windows)"],[1251,"Cyrillic (Windows)"],[1252,"Western European (Windows)"],[1253,"Greek (Windows)"],[1254,"Turkish (Windows)"],[1255,"Hebrew (Windows) "],[1256,"Arabic (Windows) "],[1257,"Baltic (Windows)"],[1258,"Vietnamese (Windows)"],[1361,"Korean (Johab)"],[1e4,"Western European (Mac)"],[10001,"Japanese (Mac)"],[10002,"Chinese Traditional (Mac)"],[10003,"Korean (Mac)"],[10004,"Arabic (Mac) "],[10005,"Hebrew (Mac)"],[10006,"Greek (Mac) "],[10007,"Cyrillic (Mac)"],[10008,"Chinese Simplified (Mac)"],[10010,"Romanian (Mac)"],[10017,"Ukrainian (Mac)"],[10021,"Thai (Mac)"],[10029,"Central European (Mac) "],[10079,"Icelandic (Mac)"],[10081,"Turkish (Mac)"],[10082,"Croatian (Mac)"],[12e3,"Unicode (UTF-32)"],[12001,"Unicode (UTF-32 Big-Endian)"],[2e4,"Chinese Traditional (CNS)"],[20001,"TCA Taiwan"],[20002,"Chinese Traditional (Eten)"],[20003,"IBM5550 Taiwan"],[20004,"TeleText Taiwan"],[20005,"Wang Taiwan"],[20105,"Western European (IA5)"],[20106,"German (IA5)"],[20107,"Swedish (IA5) "],[20108,"Norwegian (IA5) "],[20127,"US-ASCII"],[20261,"T.61 "],[20269,"ISO-6937"],[20273,"IBM EBCDIC (Germany)"],[20277,"IBM EBCDIC (Denmark-Norway) "],[20278,"IBM EBCDIC (Finland-Sweden)"],[20280,"IBM EBCDIC (Italy)"],[20284,"IBM EBCDIC (Spain)"],[20285,"IBM EBCDIC (UK)"],[20290,"IBM EBCDIC (Japanese katakana)"],[20297,"IBM EBCDIC (France)"],[20420,"IBM EBCDIC (Arabic)"],[20423,"IBM EBCDIC (Greek)"],[20424,"IBM EBCDIC (Hebrew)"],[20833,"IBM EBCDIC (Korean Extended)"],[20838,"IBM EBCDIC (Thai)"],[20866,"Cyrillic (KOI8-R)"],[20871,"IBM EBCDIC (Icelandic) "],[20880,"IBM EBCDIC (Cyrillic Russian)"],[20905,"IBM EBCDIC (Turkish)"],[20924,"IBM Latin-1 "],[20932,"Japanese (JIS 0208-1990 and 0212-1990)"],[20936,"Chinese Simplified (GB2312-80) "],[20949,"Korean Wansung "],[21025,"IBM EBCDIC (Cyrillic Serbian-Bulgarian)"],[21866,"Cyrillic (KOI8-U)"],[28591,"Western European (ISO) "],[28592,"Central European (ISO)"],[28593,"Latin 3 (ISO)"],[28594,"Baltic (ISO)"],[28595,"Cyrillic (ISO) "],[28596,"Arabic (ISO)"],[28597,"Greek (ISO) "],[28598,"Hebrew (ISO-Visual)"],[28599,"Turkish (ISO)"],[28603,"Estonian (ISO)"],[28605,"Latin 9 (ISO)"],[29001,"Europa"],[38598,"Hebrew (ISO-Logical)"],[50220,"Japanese (JIS)"],[50221,"Japanese (JIS-Allow 1 byte Kana) "],[50222,"Japanese (JIS-Allow 1 byte Kana - SO/SI)"],[50225,"Korean (ISO)"],[50227,"Chinese Simplified (ISO-2022)"],[51932,"Japanese (EUC)"],[51936,"Chinese Simplified (EUC) "],[51949,"Korean (EUC)"],[52936,"Chinese Simplified (HZ)"],[54936,"Chinese Simplified (GB18030)"],[57002,"ISCII Devanagari "],[57003,"ISCII Bengali "],[57004,"ISCII Tamil"],[57005,"ISCII Telugu "],[57006,"ISCII Assamese "],[57007,"ISCII Oriya"],[57008,"ISCII Kannada"],[57009,"ISCII Malayalam "],[57010,"ISCII Gujarati"],[57011,"ISCII Punjabi"],[65e3,"Unicode (UTF-7)"],[65001,"Unicode (UTF-8)"]];if(s=n.length){for(t=0;t<s;++t)o.push({value:n[t][0],displayValue:n[t][1]});this.cmbEncoding=new Common.UI.ComboBox({el:$("#id-codepages-combo",this.$window),menuStyle:"min-width: 218px; max-height: 200px;",cls:"input-group-nr",menuCls:"scrollable-menu",data:o,editable:!1}),this.cmbEncoding.setValue(this.settings&&this.settings.asc_getCodePage()?this.settings.asc_getCodePage():n[0][0]),this.type==Asc.c_oAscAdvancedOptionsID.CSV&&(this.cmbDelimiter=new Common.UI.ComboBox({el:$("#id-delimiters-combo",this.$window),menuStyle:"min-width: 110px;",cls:"input-group-nr",data:[{value:4,displayValue:","},{value:2,displayValue:";"},{value:3,displayValue:":"},{value:1,displayValue:this.txtTab},{value:5,displayValue:this.txtSpace}],editable:!1}),this.cmbDelimiter.setValue(this.settings&&this.settings.asc_getDelimiter()?this.settings.asc_getDelimiter():4))}},okButtonText:"OK",cancelButtonText:"Cancel",txtDelimiter:"Delimiter",txtEncodingLine truncated
|
||||||
|
langJson[lang])return langJson[lang];if("en"!=lang){try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&lang)return xhrObj.open("GET","resources/formula-lang/"+lang+".json",!1),xhrObj.send(""),langJson[lang]=eval("("+xhrObj.responseText+")"),langJson[lang]}catch(t){}return null}},_getDescription=function(lang){if(!lang)return"";if(lang=lang.toLowerCase(),langDescJson[lang])return langDescJson[lang];try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&lang)return xhrObj.open("GET","resources/formula-lang/"+lang+"_desc.json",!1),xhrObj.send(""),200==xhrObj.status?langDescJson[lang]=eval("("+xhrObj.responseText+")"):(xhrObj.open("GET","resources/formula-lang/en_desc.json",!1),xhrObj.send(""),langDescJson[lang]=eval("("+xhrObj.responseText+")")),langDescJson[lang]}catch(t){}return null};return{get:_get,getDescription:_getDescription}}}),define("spreadsheeteditor/main/app/controller/Main",["core","irregularstack","common/main/lib/component/Window","common/main/lib/component/LoadMask","common/main/lib/component/Tooltip","common/main/lib/controller/Fonts","common/main/lib/collection/TextArt","common/main/lib/view/OpenDialog","common/main/lib/util/LanguageInfo","common/main/lib/util/LocalStorage","spreadsheeteditor/main/app/collection/ShapeGroups","spreadsheeteditor/main/app/collection/TableTemplates","spreadsheeteditor/main/app/collection/EquationGroups","spreadsheeteditor/main/app/controller/FormulaDialog","spreadsheeteditor/main/app/view/FormulaLang"],function(){"use strict";SSE.Controllers.Main=Backbone.Controller.extend(_.extend(function(){var InitApplication=-254,ApplyEditRights=-255,LoadingDocument=-256,mapCustomizationElements={about:"button#left-btn-about",feedback:"button#left-btn-support",goback:"#fm-btn-back > a, #header-back > div"},mapCustomizationExtElements={toolbar:"#viewport #toolbar",leftMenu:"#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings",rightMenu:"#viewport #right-menu",header:"#viewport #header",statusBar:"#statusbar"};return Common.localStorage.setId("table"),Common.localStorage.setKeysFilter("sse-,asc.table"),Common.localStorage.sync(),{models:[],collections:["ShapeGroups","EquationGroups","TableTemplates","Common.Collections.TextArt"],views:[],initialize:function(){this.addListeners({FileMenu:{"settings:apply":_.bind(this.applySettings,this)}})},onLaunch:function(){if(this._state={isDisconnected:!1,usersCount:1,fastCoauth:!0,lostEditingRights:!1,licenseWarning:!1},!Common.Utils.isBrowserSupported())return Common.Utils.showBrowserRestriction(),void Common.Gateway.reportError(void 0,this.unsupportedBrowserErrorText);var t=Common.localStorage.getItem("sse-settings-fontrender");null===t&&(t=window.devicePixelRatio>1?"1":"3"),this.api=new Asc.spreadsheet_api({"id-view":"editor_sdk","id-input":"ce-cell-content"}),this.api.asc_setFontRenderingMode(parseInt(t)),this.api.asc_registerCallback("asc_onOpenDocumentProgress",_.bind(this.onOpenDocument,this)),this.api.asc_registerCallback("asc_onEndAction",_.bind(this.onLongActionEnd,this)),this.api.asc_registerCallback("asc_onError",_.bind(this.onError,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onCoAuthoringDisconnect,this)),this.api.asc_registerCallback("asc_onAdvancedOptions",_.bind(this.onAdvancedOptions,this)),this.api.asc_registerCallback("asc_onDocumentUpdateVersion",_.bind(this.onUpdateVersion,this)),this.api.asc_registerCallback("asc_onServerVersion",_.bind(this.onServerVersion,this)),this.api.asc_registerCallback("asc_onDocumentName",_.bind(this.onDocumentName,this)),this.api.asc_registerCallback("asc_onPrintUrl",_.bind(this.onPrintUrl,this)),this.api.asc_registerCallback("asc_onMeta",_.bind(this.onMeta,this)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onCoAuthoringDisconnect,this)),Common.NotificationCenter.on("goback",_.bind(this.goBack,this)),Common.NotificationCenter.on("namedrange:locked",_.bind(this.onNamedRangeLocked,this)),this.stackLongActions=new Common.IrregularStack({strongCompare:this._compareActionStrong,weakCompare:this._compareActionWeak}),this.stackLongActions.push({id:InitApplication,type:Asc.c_oAscAsyncActionType.BlockInteraction}),this.isShowOpenDialog=!1,this.editorConfig={},this.plugins=void 0,this.UICustomizePlugins=[],Common.Gateway.on("init",_.bind(this.loadConfig,this)),Common.Gateway.on("showmessage",_.bind(this.onExternalMessage,this)),Common.Gateway.on("opendocument",_.bind(this.loadDocument,this)),Common.Gateway.on("internalcommand",_.bind(this.onInternalCommand,this)),Common.Gateway.ready(),this.getApplication().getController("Viewport").setApi(this.api);var e=this;$(document.body).on("focus","input, textarea:not(#ce-cell-content)",function(t){!0!==e.isAppDisabled&&t&&t.target&&!/area_id/.test(t.target.id)&&(/msg-reply/.test(t.target.className)?e.dontCloseDummyComment=!0:/chat-msg-text/.test(t.target.id)&&(e.dontCloseChat=!0))}),$(document.body).on("blur","input, textarea",function(t){!0==Line truncated
|
||||||
|
this.appOptions.isDesktopApp&&this.appOptions.isOffline?this.api.asc_DownloadAs():this.getApplication().getController("LeftMenu").leftMenu.showMenu("file:saveas")),this._state.lostEditingRights=!1,this.onEditComplete()},this)),$(".asc-window.modal.alert:visible").length<1&&(Common.UI.alert(n),Common.component.Analytics.trackEvent("Internal Error",t.toString()))},onCoAuthoringDisconnect:function(){this.getApplication().getController("Viewport").getView("Viewport").setMode({isDisconnected:!0}),this.getApplication().getController("Viewport").getView("Common.Views.Header").setCanRename(!1),this.appOptions.canRename=!1,this._state.isDisconnected=!0},showTips:function(t){function e(){var e=t.shift();e&&(e+="\n"+i.textCloseTip,n.setTitle(e),n.show())}var i=this;if(t.length){"object"!=typeof t&&(t=[t]),this.tooltip||(this.tooltip=new Common.UI.Tooltip({owner:this.getApplication().getController("Toolbar").getView("Toolbar"),hideonclick:!0,placement:"bottom",cls:"main-info",offset:30}));var n=this.tooltip;n.on("tooltip:hide",function(){setTimeout(e,300)}),e()}},updateWindowTitle:function(t,e){if(this._state.isDocModified!==t||e){var i=this.defaultTitleText;if(_.isEmpty(this.headerView.getDocumentCaption())||(i=this.headerView.getDocumentCaption()+" - "+i),t)clearTimeout(this._state.timerCaption),_.isUndefined(i)||(i="* "+i,this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(),!0));else if(this._state.fastCoauth&&this._state.usersCount>1){var n=this;this._state.timerCaption=setTimeout(function(){n.headerView.setDocumentCaption(n.headerView.getDocumentCaption(),!1)},500)}else this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(),!1);window.document.title!=i&&(window.document.title=i),Common.Gateway.setDocumentModified(t),this._state.isDocModified=t}},onDocumentChanged:function(){},onDocumentModifiedChanged:function(t){if(this.updateWindowTitle(t),Common.Gateway.setDocumentModified(t),this.toolbarView&&this.api){var e=$(".btn-icon",this.toolbarView.btnSave.cmpEl).hasClass("btn-synch"),i=this.appOptions.forcesave,n=this.api.asc_isDocumentCanSave();this.toolbarView.btnSave.isDisabled()!==(!n&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)&&this.toolbarView.btnSave.setDisabled(!n&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)}},onDocumentCanSaveChanged:function(t){if(this.toolbarView){var e=$(".btn-icon",this.toolbarView.btnSave.cmpEl).hasClass("btn-synch"),i=this.appOptions.forcesave;this.toolbarView.btnSave.isDisabled()!==(!t&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)&&this.toolbarView.btnSave.setDisabled(!t&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)}},onBeforeUnload:function(){if(Common.localStorage.save(),!1!==this.permissions.edit&&"view"!==this.editorConfig.mode&&"editdiagram"!==this.editorConfig.mode&&this.api.asc_isDocumentModified()){var t=this;return this.api.asc_stopSaving(),this.continueSavingTimer=window.setTimeout(function(){t.api.asc_continueSaving()},500),this.leavePageText}},onUnload:function(){this.continueSavingTimer&&clearTimeout(this.continueSavingTimer)},hidePreloader:function(){this._state.customizationDone||(this._state.customizationDone=!0,this.appOptions.customization&&(this.appOptions.isDesktopApp?this.appOptions.customization.about=!1:this.appOptions.canBrandingExt||(this.appOptions.customization.about=!0)),Common.Utils.applyCustomization(this.appOptions.customization,mapCustomizationElements),this.appOptions.canBrandingExt&&(Common.Utils.applyCustomization(this.appOptions.customization,mapCustomizationExtElements),Common.Utils.applyCustomizationPlugins(this.UICustomizePlugins))),this.stackLongActions.pop({id:InitApplication,type:Asc.c_oAscAsyncActionType.BlockInteraction}),Common.NotificationCenter.trigger("layout:changed","main"),$("#loading-mask").hide().remove()},onDownloadUrl:function(t){Common.Gateway.downloadAs(t)},onUpdateVersion:function(t){var e=this;e.needToUpdateVersion=!0,e.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction,LoadingDocument),Common.UI.error({msg:this.errorUpdateVersion,callback:function(){_.defer(function(){Common.Gateway.updateVersion(),t&&t.call(e),e.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction,LoadingDocument)})}})},onServerVersion:function(t){return!1},onAdvancedOptions:function(t){var e,i=t.asc_getOptionId(),n=this;i==Asc.c_oAscAdvancedOptionsID.CSV?e=new Common.Views.OpenDialog({type:i,codepages:t.asc_getOptions().asc_getCodePages(),settings:t.asc_getOptions().asc_getRecommendedSettings(),handler:function(t,e){n.isShowOpenDialog=!1,n&&n.api&&(n.api.asc_setAdvancedOptions(i,new Asc.asc_CCSVAdvancedOptions(t,e)),n.loadMask&&n.loadMask.show())}}):i==Asc.c_oAscAdvancedOptionsID.DRM&&(e=new Common.Views.OpenDialog({type:i,handler:function(t){n.isShowOpenDialog=!1,n&&n.api&&(n.api.asc_setAdvancedOptions(i,new Asc.asc_CDRMAdvancLine truncated
|
||||||
|
template:_.template(['<table class="main"><tbody>',"<tr>",'<td class="left"><label><%= scope.textSettings %></label></td>','<td class="right"><div id="advsettings-print-combo-sheets" class="input-group-nr" /></td>',"</tr>",'<tr class="divider"></tr>','<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageSize %></label></td>','<td class="right"><div id="advsettings-print-combo-pages" class="input-group-nr" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageOrientation %></label></td>','<td class="right"><span id="advsettings-print-combo-orient" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageScaling %></label></td>','<td class="right"><span id="advsettings-print-combo-layout" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left" style="vertical-align: top;"><label><%= scope.strMargins %></label></td>','<td class="right" style="vertical-align: top;"><div id="advsettings-margins">','<table cols="2" class="no-padding">',"<tr>","<td><label><%= scope.strTop %></label></td>","<td><label><%= scope.strBottom %></label></td>","</tr>","<tr>",'<td><div id="advsettings-spin-margin-top"></div></td>','<td><div id="advsettings-spin-margin-bottom"></div></td>',"</tr>","<tr>","<td><label><%= scope.strLeft %></label></td>","<td><label><%= scope.strRight %></label></td>","</tr>","<tr>",'<td><div id="advsettings-spin-margin-left"></div></td>','<td><div id="advsettings-spin-margin-right"></div></td>',"</tr>","</table>","</div></td>","</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left" style="vertical-align: top;"><label><%= scope.strPrint %></label></td>','<td class="right" style="vertical-align: top;"><div id="advsettings-print">','<div id="advsettings-print-chb-grid" style="margin-bottom: 10px;"/>','<div id="advsettings-print-chb-rows"/>',"</div></td>","</tr>",'<tr class="divider"></tr>','<tr class="divider"></tr>',"<tr>",'<td class="left"></td>','<td class="right"><button id="advsettings-print-button-save" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',"</tr>","</tbody></table>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,arguments),this.menu=t.menu,this.spinners=[],this._initSettings=!0},render:function(t){return t&&this.setElement(t,!1),$(this.el).html(this.template({scope:this})),this.cmbSheet=new Common.UI.ComboBox({el:$("#advsettings-print-combo-sheets"),style:"width: 242px;",menuStyle:"min-width: 242px;max-height: 280px;",editable:!1,cls:"input-group-nr",data:[]}),this.cmbPaperSize=new Common.UI.ComboBox({el:$("#advsettings-print-combo-pages"),style:"width: 242px;",menuStyle:"max-height: 280px; min-width: 242px;",editable:!1,cls:"input-group-nr",data:[{value:"215.9|279.4",displayValue:"US Letter (21,59cm x 27,94cm)",caption:"US Letter"},{value:"215.9|355.6",displayValue:"US Legal (21,59cm x 35,56cm)",caption:"US Legal"},{value:"210|297",displayValue:"A4 (21cm x 29,7cm)",caption:"A4"},{value:"148.1|209.9",displayValue:"A5 (14,81cm x 20,99cm)",caption:"A5"},{value:"176|250.1",displayValue:"B5 (17,6cm x 25,01cm)",caption:"B5"},{value:"104.8|241.3",displayValue:"Envelope #10 (10,48cm x 24,13cm)",caption:"Envelope #10"},{value:"110.1|220.1",displayValue:"Envelope DL (11,01cm x 22,01cm)",caption:"Envelope DL"},{value:"279.4|431.7",displayValue:"Tabloid (27,94cm x 43,17cm)",caption:"Tabloid"},{value:"297|420.1",displayValue:"A3 (29,7cm x 42,01cm)",caption:"A3"},{value:"304.8|457.1",displayValue:"Tabloid Oversize (30,48cm x 45,71cm)",caption:"Tabloid Oversize"},{value:"196.8|273",displayValue:"ROC 16K (19,68cm x 27,3cm)",caption:"ROC 16K"},{value:"119.9|234.9",displayValue:"Envelope Choukei 3 (11,99cm x 23,49cm)",caption:"Envelope Choukei 3"},{value:"330.2|482.5",displayValue:"Super B/A3 (33,02cm x 48,25cm)",caption:"Super B/A3"}]}),this.cmbPaperOrientation=new Common.UI.ComboBox({el:$("#advsettings-print-combo-orient"),style:"width: 132px;",menuStyle:"min-width: 132px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscPageOrientation.PagePortrait,displayValue:this.strPortrait},{value:Asc.c_oAscPageOrientation.PageLandscape,displayValue:this.strLandscape}]}),this.cmbLayout=new Common.UI.ComboBox({el:$("#advsettings-print-combo-layout"),style:"width: 242px;",menuStyle:"min-width: 242px;",editable:!1,cls:"input-group-nr",data:[{value:0,displayValue:this.textActualSize},{value:1,displayValue:this.textFitPage},{value:2,displayValue:this.textFitCols},{value:3,displayValue:this.textFitRows}]}),this.chPrintGrid=new Common.UI.CheckBox({el:$("#advsettings-print-chb-grid"),labelText:this.textPrintGrid}),this.chPrintRows=new Common.UI.CheckBox({el:$("#advsettings-print-chb-rows"),labelText:this.textPrintHeadings}),this.spnMarginTop=new Common.UI.MetricSpinner({el:$("#advsettings-spin-margin-top"),step:.1,width:110,defaultUnit:"cm",value:"0 cm",maxValue:48.25,minValue:0}),this.spinners.push(this.spnMarginTop),this.spnMarginBottLine truncated
|
||||||
|
itemTemplate:_.template(['<div id="<%= id %>" class="help-item-wrap">','<div class="caption"><%= name %></div>',"</div>"].join(""))}),this.viewHelpPicker.on("item:add",function(t,e,i){i.has("headername")&&$(e.el).before('<div class="header-name">'+i.get("headername")+"</div>")}),this.viewHelpPicker.on("item:select",function(e,i,n){t.iFrame.src=t.urlPref+n.get("src")}),this.iFrame=document.createElement("iframe"),this.iFrame.src="",this.iFrame.align="top",this.iFrame.frameBorder="0",this.iFrame.width="100%",this.iFrame.height="100%",Common.Gateway.on("internalcommand",function(e){if("help:hyperlink"==e.type){var i=e.data,n=t.viewHelpPicker.store.find(function(t){return i.indexOf(t.get("src"))>0});n&&(t.viewHelpPicker.selectRecord(n,!0),t.viewHelpPicker.scrollToRecord(n))}}),$("#id-help-frame").append(this.iFrame),this},setLangConfig:function(t){var e=this,i=this.viewHelpPicker.store;if(t){t=t.split("-")[0];var n={dataType:"json",error:function(){e.urlPref.indexOf("resources/help/en/")<0?(e.urlPref="resources/help/en/",i.url="resources/help/en/Contents.json",i.fetch(n)):(e.urlPref="resources/help/en/",i.reset(e.en_data))},success:function(){var t=i.at(0);e.viewHelpPicker.selectRecord(t),e.iFrame.src=e.urlPref+t.get("src")}};i.url="resources/help/"+t+"/Contents.json",i.fetch(n),this.urlPref="resources/help/"+t+"/"}},show:function(){Common.UI.BaseView.prototype.show.call(this),this._scrollerInited||(this.viewHelpPicker.scroller.update(),this._scrollerInited=!0)}})}),define("text!spreadsheeteditor/main/app/template/PrintSettings.template",[],function(){return'<div class="settings-panel active">\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-range" class="input-group-nr" /> </div>\r\n <div class="padding-large"/>\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-sheets" class="input-group-nr" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-pages" class="input-group-nr" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <span id="printadv-dlg-combo-orient" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <span id="printadv-dlg-combo-layout" />\r\n </div>\r\n <div id="printadv-dlg-content-to-hide">\r\n <div class="padding-large inner-content" >\r\n <table cols="2" class="no-padding">\r\n <tr>\r\n <td><label><%= scope.strTop %></label></td>\r\n <td><label><%= scope.strBottom %></label></td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small"><div id="printadv-dlg-spin-margin-top" style="margin-right: 19px;"></div></td>\r\n <td class="padding-small"><div id="printadv-dlg-spin-margin-bottom"></div></td>\r\n </tr>\r\n <tr>\r\n <td><label><%= scope.strLeft %></label></td>\r\n <td><label><%= scope.strRight %></label></td>\r\n </tr>\r\n <tr>\r\n <td><div id="printadv-dlg-spin-margin-left" style="margin-right: 15px;"></div></td>\r\n <td><div id="printadv-dlg-spin-margin-right"></div></td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="padding-small"/>\r\n <div class="inner-content">\r\n <div id="printadv-dlg-chb-grid" style="margin-bottom: 10px;"/>\r\n <div id="printadv-dlg-chb-rows"/>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("spreadsheeteditor/main/app/view/PrintSettings",["text!spreadsheeteditor/main/app/template/PrintSettings.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","common/main/lib/component/RadioBox","common/main/lib/component/ListView"],function(t){"use strict";SSE.Views.PrintSettings=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{alias:"PrintSettings",contentWidth:280,height:471},initialize:function(e){_.extend(this.options,{title:this.textTitle,template:['<div class="box" style="height:'+(this.options.height-85)+'px;">','<div class="menu-panel" style="overflow: hidden;">','<div style="height: 42px; line-height: 42px;" class="div-category">'+this.textPrintRange+"</div>",'<div style="height: 52px; line-height: 66px;" class="div-category">'+this.textSettings+"</div>",'<div style="height: 38px; line-height: 38px;" class="div-category">'+this.textPageSize+"</div>",'<div style="height: 38px; line-height: 38px;" class="div-category">'+this.textPageOrientation+"</div>",'<div style="height: 38px; line-height: 38px;" class="div-category">'+this.textPageScaling+"</div>",'<div style="height: 108px; line-height: 33px;" class="div-category">'+this.strMargins+"</div>",'<div style="height: 58px; line-height: 40px;" class="div-category">'+this.strPrint+"</div>","</div>",'<div class="content-panel">'+_.template(t)({scopeLine truncated
|
||||||
|
0===this.popoverComments.length&&this.getPopover()&&this.getPopover().hide())}},onChangeComments:function(t){for(var e=0;e<t.length;++e)this.onApiChangeCommentData(t[e].Comment.Id,t[e].Comment,!0);this.updateComments(!0)},onRemoveComments:function(t){for(var e=0;e<t.length;++e)this.onApiRemoveComment(t[e],!0);this.updateComments(!0)},onApiChangeCommentData:function(t,e,i){var n=this,o=0,s=null,a=null,r=0,l=null,c=this.findComment(t);if(c){for(n=this,s=""==e.asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getTime())),c.set("comment",e.asc_getText()),c.set("userid",e.asc_getUserId()),c.set("username",e.asc_getUserName()),c.set("resolved",e.asc_getSolved()),c.set("quote",e.asc_getQuoteText()),c.set("time",s.getTime()),c.set("date",n.dateToLocaleTimeString(s)),a=_.clone(c.get("replys")),a.length=0,r=e.asc_getRepliesCount(),o=0;o<r;++o)l=""==e.asc_getReply(o).asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getReply(o).asc_getTime())),a.push(new Common.Models.Reply({id:Common.UI.getId(),userid:e.asc_getReply(o).asc_getUserId(),username:e.asc_getReply(o).asc_getUserName(),date:n.dateToLocaleTimeString(l),reply:e.asc_getReply(o).asc_getText(),time:l.getTime(),editText:!1,editTextInPopover:!1,showReplyInPopover:!1,scope:n.view,editable:n.mode.canEditComments||e.asc_getReply(o).asc_getUserId()==n.currentUserId}));a.sort(function(t,e){return t.get("time")-e.get("time")}),c.set("replys",a),i||(this.updateComments(!1,!0),this.getPopover()&&this.getPopover().isVisible()&&(this._dontScrollToComment=!0,this.api.asc_showComment(t,!0)))}},onApiLockComment:function(t,e){var i=this.findComment(t),n=null,o=null;i&&(n=this.getApplication().getCollection("Common.Collections.Users"))&&(o=n.findWhere({id:e}))&&(this.getPopover()&&this.getPopover().saveText(),i.set("lock",!0),i.set("lockuserid",this.view.getUserName(o.get("username"))))},onApiUnLockComment:function(t){var e=this.findComment(t);e&&(e.set("lock",!1),this.getPopover()&&this.getPopover().loadText())},onApiShowComment:function(t,e,i,n,o,s){if(this.isModeChanged=!1,(!s||!this.isSelectedComment||0!==_.difference(this.uids,t).length)&&(this.mode&&!this.mode.canComments&&(s=!0),this.getPopover())){if(this.clearDummyComment(),this.isSelectedComment&&0===_.difference(this.uids,t).length)return void(this.api&&(this.getPopover().commentsView.setFocusToTextBox(!0),this.api.asc_enableKeyEvents(!0)));var a=0,r="",l="",c=null,h="",d=!0;for(this.popoverComments.reset(),a=0;a<t.length;++a)r=t[a],l=t[a]+"-R",c=this.findComment(r),this.subEditStrings[r]&&!s?(c.set("editTextInPopover",!0),h=this.subEditStrings[r]):this.subEditStrings[l]&&!s&&(c.set("showReplyInPopover",!0),h=this.subEditStrings[l]),c.set("hint",!_.isUndefined(s)&&s),!s&&this.hintmode&&(0===_.difference(this.uids,t).length&&0===this.uids.length&&(d=!1),this.oldUids.length&&0===_.difference(this.oldUids,t).length&&(d=!1,this.oldUids=[])),this.animate&&(d=this.animate,this.animate=!1),this.isSelectedComment=!s||!this.hintmode,this.uids=_.clone(t),this.popoverComments.push(c),this._dontScrollToComment||this.view.commentsView.scrollToRecord(c),this._dontScrollToComment=!1;this.getPopover().isVisible()&&this.getPopover().hide(),this.getPopover().setLeftTop(e,i,n),this.getPopover().show(d,!1,!0,h)}},onApiHideComment:function(t){var e=this;if(this.getPopover()){if(this.isSelectedComment&&t)return;if(t&&this.getPopover().isCommentsViewMouseOver())return;this.popoverComments.each(function(t){t.get("editTextInPopover")&&(e.subEditStrings[t.get("uid")]=e.getPopover().getEditText()),t.get("showReplyInPopover")&&(e.subEditStrings[t.get("uid")+"-R"]=e.getPopover().getEditText())}),this.getPopover().saveText(!0),this.getPopover().hide(),this.collection.clearEditing(),this.popoverComments.clearEditing(),this.oldUids=_.clone(this.uids),this.isSelectedComment=!1,this.uids=[],this.popoverComments.reset()}},onApiUpdateCommentPosition:function(t,e,i,n){var o,s=!1,a=null,r=void 0,l="",c="";if(this.getPopover())if(this.getPopover().saveText(),this.getPopover().hideTips(),i<0||this.getPopover().sdkBounds.height<i||!_.isUndefined(n)&&this.getPopover().sdkBounds.width<n)this.getPopover().hide();else{if(this.isModeChanged&&this.onApiShowComment(t,e,i,n),0===this.popoverComments.length){for(this.popoverComments.reset(),o=0;o<t.length;++o)l=t[o],c=t[o]+"-R",a=this.findComment(l),this.subEditStrings[l]?(a.set("editTextInPopover",!0),r=this.subEditStrings[l]):this.subEditStrings[c]&&(a.set("showReplyInPopover",!0),r=this.subEditStrings[c]),this.popoverComments.push(a);s=!0,this.getPopover().show(s,void 0,void 0,r)}else this.getPopover().isVisible()||this.getPopover().show(!1,void 0,void 0,r);this.getPopover().setLeftTop(e,i,n,void 0,!0)}},onDocumentPlaceChanged:function(){if(this.isDummyComment&&this.getPopover()&&this.getPopover().isVisible()){var t=this.api.asc_getAnchorPosition();t&&this.getPopover().setLeftTop(t.asc_getX()+t.asc_getWidth(),t.asc_getY(),this.hintmode?t.asc_getX():void 0)}},updateComments:function(t,eLine truncated
|
||||||
Reference in new issue
Block a user