diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c22a0b..bd327309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,38 @@ > 有空会补补BUG、添添新功能。 > 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT. +## 2019/03/04 `v(2.0.5)` + +### 后端模块 + +* 新增 chunked 流式传输 + +![chunk-2.png](https://i.loli.net/2019/01/28/5c4e8869c83ae.png) + +### Shell 管理 + +* 新增「测试连接」功能 +* 其它设置增加「开启分块传输」开关,设置「最小分块」和「最大分块」。每次分块大小为[n, m]区间。 + +![chunk-1.png](https://i.loli.net/2019/01/28/5c4e8868f178a.png) + +### 文件管理 + +* 编辑文件标签打开时显示正在编辑的文件的「IP地址」和「绝对路径」 (#129) +* 编辑文件「保存」按钮移动到右侧 + +### 插件市场 + +* 支持使用代理访问插件市场,当配置了代理之后,默认开启 + +### 浏览网站 + +* 新增代理开关, 在配置了代理之后,可通过该开关控制是否使用代理浏览目标网站 + +### Other + +* 调整 aproxy uri 初始化 URL 格式 + ## 2019/01/21 `v(2.0.4)` ### 后端模块 diff --git a/README.md b/README.md index 3e9164e6..fd8bd88d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AntSword [![release](https://img.shields.io/badge/release-v2.0.4-blue.svg?style=flat-square)][url-release] +# AntSword [![release](https://img.shields.io/badge/release-v2.0.5-blue.svg?style=flat-square)][url-release] > AntSword in your hands, no worries in your mind! @@ -22,6 +22,17 @@ This software, of which the development thought is modularization, is intended t ![][url-mainui] +
+ +More Screenshots + +![][url-filemanager] +![][url-terminal] +![][url-database] +![][url-pluginstore] + +
+ ## Quick Start See document: [Quick Start][url-quickstart] @@ -41,7 +52,7 @@ See document: [Make contributions to AntSword][url-contribute] [url-doczh]: README_CN.md [url-changelog]: CHANGELOG.md [url-document]: http://doc.u0u.us/en/ -[url-release]: https://github.com/AntSwordProject/AntSword/releases/tag/2.0.0 +[url-release]: https://github.com/AntSwordProject/AntSword/releases/ [url-electron]: http://electron.atom.io/ [url-es6]: http://es6.ruanyifeng.com/ [url-dhtmlx]: http://dhtmlx.com/ @@ -50,4 +61,8 @@ See document: [Make contributions to AntSword][url-contribute] [url-release]: https://github.com/AntSwordProject/AntSword/releases [url-quickstart]: https://doc.u0u.us/en/getting_started/index.html [url-contribute]: https://doc.u0u.us/en/contribute_docs.html -[url-mainui]: http://7xtigg.com1.z0.glb.clouddn.com/doc/getting_started/get_antsword_2.jpg \ No newline at end of file +[url-mainui]: http://as.xuanbo.cc/doc/getting_started/get_antsword_2.jpg +[url-filemanager]: http://as.xuanbo.cc/doc/file_manager/main_page_1.png +[url-terminal]: http://as.xuanbo.cc/doc/terminal/main_page_1.png +[url-database]: http://as.xuanbo.cc/doc/database/main_page_1.png +[url-pluginstore]: http://as.xuanbo.cc/doc/plugin_store/main_page_2.jpg diff --git a/README_CN.md b/README_CN.md index e2505ede..3e681b53 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,4 +1,4 @@ -# 中国蚁剑 [![release](https://img.shields.io/badge/release-v2.0.4-blue.svg?style=flat-square)][url-release] +# 中国蚁剑 [![release](https://img.shields.io/badge/release-v2.0.5-blue.svg?style=flat-square)][url-release] > 一剑在手,纵横无忧! @@ -20,6 +20,17 @@ ![][url-mainui] +
+ +更多截图 + +![][url-filemanager] +![][url-terminal] +![][url-database] +![][url-pluginstore] + +
+ ## 快速入门 参见文档 [快速入门][url-quickstart] @@ -41,7 +52,7 @@ [url-docen]: README.md [url-changelog]: CHANGELOG.md [url-document]: http://doc.u0u.us/zh-hans/ -[url-release]: https://github.com/AntSwordProject/AntSword/releases/tag/2.0.0 +[url-release]: https://github.com/AntSwordProject/AntSword/releases/ [url-electron]: http://electron.atom.io/ [url-es6]: http://es6.ruanyifeng.com/ [url-dhtmlx]: http://dhtmlx.com/ @@ -50,4 +61,8 @@ [url-release]: https://github.com/AntSwordProject/AntSword/releases [url-quickstart]: https://doc.u0u.us/zh-hans/getting_started/index.html [url-contribute]: https://doc.u0u.us/zh-hans/contribute_docs.html -[url-mainui]: http://7xtigg.com1.z0.glb.clouddn.com/doc/getting_started/get_antsword_2.jpg \ No newline at end of file +[url-mainui]: http://as.xuanbo.cc/doc/getting_started/get_antsword_2.jpg +[url-filemanager]: http://as.xuanbo.cc/doc/file_manager/main_page_1.png +[url-terminal]: http://as.xuanbo.cc/doc/terminal/main_page_1.png +[url-database]: http://as.xuanbo.cc/doc/database/main_page_1.png +[url-pluginstore]: http://as.xuanbo.cc/doc/plugin_store/main_page_2.jpg diff --git a/modules/request.js b/modules/request.js index c3998316..6be932f0 100644 --- a/modules/request.js +++ b/modules/request.js @@ -12,6 +12,7 @@ const fs = require('fs'), CONF = require('./config'), superagent = require('superagent'), superagentProxy = require('superagent-proxy'); +const { Readable } = require("stream"); let logger; // 请求UA @@ -109,49 +110,95 @@ class Request { } // 自定义body const _postData = Object.assign({}, opts.body, opts.data); - // 通过替换函数方式来实现发包方式切换, 后续可改成别的 - const old_send = _request.send; - if(opts['useMultipart'] == 1) { - _request.send = _request.field; - }else{ - _request.send = old_send; - } - _request - .proxy(APROXY_CONF['uri']) - .type('form') - // 超时 - .timeout(opts.timeout || REQ_TIMEOUT) - // 忽略HTTPS - .ignoreHTTPS(opts['ignoreHTTPS']) - .send(_postData) - .parse((res, callback) => { - this.parse(opts['tag_s'], opts['tag_e'], (chunk) => { - event.sender.send('request-chunk-' + opts['hash'], chunk); - }, res, callback); - }) - .end((err, ret) => { - if (!ret) { - // 请求失败 TIMEOUT - return event.sender.send('request-error-' + opts['hash'], err); + if (opts['useChunk'] == 1){ + logger.debug("request with Chunked"); + let _postarr = []; + for(var key in _postData){ + if(_postData.hasOwnProperty(key)){ + _postarr.push(`${key}=${encodeURIComponent(_postData[key])}`); } - let buff = ret.hasOwnProperty('body') ? ret.body : new Buffer(); - // 解码 - let text = ""; - // 自动猜测编码 - let encoding = detectEncoding(buff, {defaultEncoding:"unknown"}); - logger.debug("detect encoding:", encoding); - encoding = encoding != "unknown" ? encoding : opts['encode']; - text = iconv.decode(buff, encoding); - if (err && text == "") { - return event.sender.send('request-error-' + opts['hash'], err); - }; - // 回调数据 - event.sender.send('request-' + opts['hash'], { - text: text, - buff: buff, - encoding: encoding + } + let antstream = new AntRead(_postarr.join("&"), {'step': parseInt(opts['chunkStepMin']), 'stepmax': parseInt(opts['chunkStepMax'])}); + let _datasuccess = false; // 表示是否是 404 类shell + _request + .proxy(APROXY_CONF['uri']) + .type('form') + // .set('Content-Type', 'application/x-www-form-urlencoded') + .timeout(opts.timeout || REQ_TIMEOUT) + .ignoreHTTPS(opts['ignoreHTTPS']) + .parse((res, callback) => { + this.parse(opts['tag_s'], opts['tag_e'], (chunk) => { + event.sender.send('request-chunk-' + opts['hash'], chunk); + }, res, (err, ret)=>{ + let buff = ret ? ret : new Buffer(); + // 自动猜测编码 + let encoding = detectEncoding(buff, {defaultEncoding: "unknown"}); + logger.debug("detect encoding:", encoding); + encoding = encoding != "unknown" ? encoding : opts['encode']; + let text = iconv.decode(buff, encoding); + if (err && text == "") { + return event.sender.send('request-error-' + opts['hash'], err); + }; + // 回调数据 + event.sender.send('request-' + opts['hash'], { + text: text, + buff: buff, + encoding: encoding + }); + _datasuccess = true; + callback(null, ret); + }); + }).on('error', (err) => { + if(_datasuccess == false) { + return event.sender.send('request-error-' + opts['hash'], err); + } }); - }); + antstream.pipe(_request); + }else{ + // 通过替换函数方式来实现发包方式切换, 后续可改成别的 + const old_send = _request.send; + if(opts['useMultipart'] == 1) { + _request.send = _request.field; + }else{ + _request.send = old_send; + } + _request + .proxy(APROXY_CONF['uri']) + .type('form') + // 超时 + .timeout(opts.timeout || REQ_TIMEOUT) + // 忽略HTTPS + .ignoreHTTPS(opts['ignoreHTTPS']) + .send(_postData) + .parse((res, callback) => { + this.parse(opts['tag_s'], opts['tag_e'], (chunk) => { + event.sender.send('request-chunk-' + opts['hash'], chunk); + }, res, callback); + }) + .end((err, ret) => { + if (!ret) { + // 请求失败 TIMEOUT + return event.sender.send('request-error-' + opts['hash'], err); + } + let buff = ret.hasOwnProperty('body') ? ret.body : new Buffer(); + // 解码 + let text = ""; + // 自动猜测编码 + let encoding = detectEncoding(buff, {defaultEncoding:"unknown"}); + logger.debug("detect encoding:", encoding); + encoding = encoding != "unknown" ? encoding : opts['encode']; + text = iconv.decode(buff, encoding); + if (err && text == "") { + return event.sender.send('request-error-' + opts['hash'], err); + }; + // 回调数据 + event.sender.send('request-' + opts['hash'], { + text: text, + buff: buff, + encoding: encoding + }); + }); + } } /** @@ -181,48 +228,92 @@ class Request { } // 自定义body const _postData = Object.assign({}, opts.body, opts.data); - // 通过替换函数方式来实现发包方式切换, 后续可改成别的 - const old_send = _request.send; - if(opts['useMultipart'] == 1) { - _request.send = _request.field; - }else{ - _request.send = old_send; - } - _request - .proxy(APROXY_CONF['uri']) - .type('form') - // 设置超时会导致文件过大时写入出错 - // .timeout(timeout) - // 忽略HTTPS - .ignoreHTTPS(opts['ignoreHTTPS']) - .send(_postData) - .pipe(through( - (chunk) => { - // 判断数据流中是否包含后截断符?长度++ - let temp = chunk.indexOf(opts['tag_e']); - if (temp !== -1) { - indexEnd = Buffer.concat(tempData).length + temp; - }; - tempData.push(chunk); - event.sender.send('download-progress-' + opts['hash'], chunk.length); - }, - () => { - let tempDataBuffer = Buffer.concat(tempData); - - indexStart = tempDataBuffer.indexOf(opts['tag_s']) || 0; - // 截取最后的数据 - let finalData = new Buffer(tempDataBuffer.slice( - indexStart + opts['tag_s'].length, - indexEnd - ), 'binary'); - // 写入文件流&&关闭 - rs.write(finalData); - rs.close(); - event.sender.send('download-' + opts['hash'], finalData.length); - // 删除内存数据 - finalData = tempDataBuffer = tempData = null; + if (opts['useChunk'] == 1){ + logger.debug("request with Chunked"); + let _postarr = []; + for(var key in _postData){ + if(_postData.hasOwnProperty(key)){ + _postarr.push(`${key}=${_postData[key]}`); } + } + let antstream = new AntRead(_postarr.join("&"), {'step': parseInt(opts['chunkStepMin']), 'stepmax': parseInt(opts['chunkStepMax'])}); + let _datasuccess = false; // 表示是否是 404 类shell + _request + .proxy(APROXY_CONF['uri']) + .type('form') + .ignoreHTTPS(opts['ignoreHTTPS']) + .pipe(through( + (chunk) => { + // 判断数据流中是否包含后截断符?长度++ + let temp = chunk.indexOf(opts['tag_e']); + if (temp !== -1) { + indexEnd = Buffer.concat(tempData).length + temp; + }; + tempData.push(chunk); + event.sender.send('download-progress-' + opts['hash'], chunk.length); + }, + () => { + let tempDataBuffer = Buffer.concat(tempData); + + indexStart = tempDataBuffer.indexOf(opts['tag_s']) || 0; + // 截取最后的数据 + let finalData = new Buffer(tempDataBuffer.slice( + indexStart + opts['tag_s'].length, + indexEnd + ), 'binary'); + // 写入文件流&&关闭 + rs.write(finalData); + rs.close(); + event.sender.send('download-' + opts['hash'], finalData.length); + // 删除内存数据 + finalData = tempDataBuffer = tempData = null; + } + )); + antstream.pipe(_request); + }else{ + // 通过替换函数方式来实现发包方式切换, 后续可改成别的 + const old_send = _request.send; + if(opts['useMultipart'] == 1) { + _request.send = _request.field; + }else{ + _request.send = old_send; + } + _request + .proxy(APROXY_CONF['uri']) + .type('form') + // 设置超时会导致文件过大时写入出错 + // .timeout(timeout) + // 忽略HTTPS + .ignoreHTTPS(opts['ignoreHTTPS']) + .send(_postData) + .pipe(through( + (chunk) => { + // 判断数据流中是否包含后截断符?长度++ + let temp = chunk.indexOf(opts['tag_e']); + if (temp !== -1) { + indexEnd = Buffer.concat(tempData).length + temp; + }; + tempData.push(chunk); + event.sender.send('download-progress-' + opts['hash'], chunk.length); + }, + () => { + let tempDataBuffer = Buffer.concat(tempData); + + indexStart = tempDataBuffer.indexOf(opts['tag_s']) || 0; + // 截取最后的数据 + let finalData = new Buffer(tempDataBuffer.slice( + indexStart + opts['tag_s'].length, + indexEnd + ), 'binary'); + // 写入文件流&&关闭 + rs.write(finalData); + rs.close(); + event.sender.send('download-' + opts['hash'], finalData.length); + // 删除内存数据 + finalData = tempDataBuffer = tempData = null; + } )); + } } /** @@ -326,4 +417,59 @@ function detectEncoding(buffer, options) { } }; + +/** + * 控步长的可读流 + * @param data [string|buffer] 输入源 + * @param options {} 配置 + * step 步长 + * stepmax 最大步长,默认与步长相等,如果大于步长,则每次读取时后随机返回 [step, stepmax] 长度的数据 + */ +class AntRead extends Readable { + constructor(data, options={}) { + super(); + this.index = 0; + let o = {}; + o.step = options.hasOwnProperty('step') ? parseInt(options['step']) : 2; + o.step = o.step < 1 ? 2 : o.step; + o.stepmax = options.hasOwnProperty('stepmax') ? options['stepmax'] : o.step ; + if (o.stepmax < o.step) { + o.stepmax = o.step; + } + let chunk; + if('string' === typeof data) { + chunk = data; + }else if('object' === typeof data && Buffer.isBuffer(data)) { // buffer + chunk = new Buffer(data).toString(); + }else{ + throw Error("data must be string, buffer."); + } + this.chunk = chunk; + this.o = o; + } + + // 重写自定义的可读流的 _read 方法 + _read() { + let step = this.randomNum(this.o.step, this.o.stepmax); + if (this.index >= this.chunk.length) { + this.push(null); + }else{ + this.push(this.chunk.substring(this.index, this.index + step) + ""); + } + this.index += step; + } + + // random [n, m] + randomNum(minNum, maxNum){ + switch(arguments.length){ + case 1: + return parseInt(Math.random()*minNum+1,10); + case 2: + return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); + default: + return 0; + } + } +} + module.exports = Request; diff --git a/package-lock.json b/package-lock.json index 0d9546dc..e2e76f7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "antsword", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b356a6c9..94853b77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antsword", - "version": "2.0.4", + "version": "2.0.5", "description": "中国蚁剑是一款跨平台的开源网站管理工具", "main": "app.js", "dependencies": { diff --git a/source/app.entry.js b/source/app.entry.js index 04531f00..7fee4318 100644 --- a/source/app.entry.js +++ b/source/app.entry.js @@ -189,7 +189,7 @@ antSword['aproxyauth'] = ( !aproxy['username'] || !aproxy['password'] ) ? '' : `${aproxy['username']}:${aproxy['password']}`; -antSword['aproxyuri'] = `${aproxy['protocol']}:\/\/${antSword['aproxyauth']}@${aproxy['server']}:${aproxy['port']}`; +antSword['aproxyuri'] = `${aproxy['protocol']}:\/\/${antSword['aproxyauth']}${antSword['aproxyauth']===""?"":"@"}${aproxy['server']}:${aproxy['port']}`; // 通知后端设置代理 ipcRenderer.send('aproxy', { diff --git a/source/core/base.js b/source/core/base.js index b7e52c5e..94026ae6 100644 --- a/source/core/base.js +++ b/source/core/base.js @@ -245,6 +245,9 @@ class Base { tag_e: opt['tag_e'], encode: this.__opts__['encode'], ignoreHTTPS: (this.__opts__['otherConf'] || {})['ignore-https'] === 1, + useChunk: (this.__opts__['otherConf'] || {})['use-chunk'] === 1, + chunkStepMin: (this.__opts__['otherConf'] || {})['chunk-step-byte-min'] || 2, + chunkStepMax: (this.__opts__['otherConf'] || {})['chunk-step-byte-max'] || 3, useMultipart: (this.__opts__['otherConf'] || {})['use-multipart'] === 1, timeout: parseInt((this.__opts__['otherConf'] || {})['request-timeout']), headers: (this.__opts__['httpConf'] || {})['headers'] || {}, diff --git a/source/language/en.js b/source/language/en.js index 48d1d5f4..90503e23 100644 --- a/source/language/en.js +++ b/source/language/en.js @@ -106,6 +106,7 @@ module.exports = { add: { title: 'Add shell', toolbar: { + test: 'Test Connection', add: 'Add', clear: 'Clear' }, @@ -117,6 +118,8 @@ module.exports = { type: 'Shell type', encoder: 'Encoder' }, + test_success: 'Connection Successful!', + test_warning: 'Response is null!', warning: 'Please enter the full!', success: 'Add shell success!', error: (err) => antSword.noxss(`Add shell failed!\n${err}`) @@ -169,6 +172,13 @@ module.exports = { otherConf: { nohttps: 'Ignore HTTPS certificate', usemultipart: 'Use Multipart send payload', + chunk: { + title: 'Chunked Transfer (Experimentally)', + usechunk: 'Use Chunked send payload.', + min: 'Min Block', + max: 'Max Block', + exphint: 'This feature is currently experimental and cannot be used with Multipart. Some types of servers may not support Chunked transfers. In addition, it is recommended to set the timeout period to 30s or more to avoid data transmission when the network speed is not good.', + }, terminalCache: "Use the terminal's cache", filemanagerCache: "Use the filemanager's cache", uploadFragment: "Upload File Fragmentation Size", @@ -700,6 +710,7 @@ module.exports = { }, viewsite: { toolbar: { + useproxy: (s) => `Proxy: ${s?'ON':'OFF'}`, save: 'Save', view: 'View' }, diff --git a/source/language/zh.js b/source/language/zh.js index 945bdce2..b9871d09 100644 --- a/source/language/zh.js +++ b/source/language/zh.js @@ -107,6 +107,7 @@ module.exports = { add: { title: '添加数据', toolbar: { + test: '测试连接', add: '添加', clear: '清空' }, @@ -118,6 +119,8 @@ module.exports = { type: '连接类型', encoder: '编码器' }, + test_success: '连接成功!', + test_warning: '返回数据为空', warning: '请输入完整!', success: '添加数据成功!', error: (err) => antSword.noxss(`添加数据失败!\n${err}`) @@ -170,6 +173,13 @@ module.exports = { otherConf: { nohttps: '忽略HTTPS证书', usemultipart: '使用 Multipart 发包', + chunk: { + title: '分块传输(实验性功能)', + usechunk: '开启分块传输发包', + min: '最小分块', + max: '最大分块', + exphint: '该功能目前为实验性功能, 无法与 Multipart 同时使用,部分类型的服务端可能不支持Chunked传输。此外,建议超时时长设置30s以上,避免网速不好的情况下影响数据传输。', + }, terminalCache: '虚拟终端使用缓存', filemanagerCache: '文件管理使用缓存', uploadFragment: '上传文件分片大小', @@ -700,6 +710,7 @@ module.exports = { }, viewsite: { toolbar: { + useproxy: (s) => `代理: ${s?'开':'关'}`, save: '保存', view: '浏览' }, diff --git a/source/modules/database/php/index.js b/source/modules/database/php/index.js index 3b958e62..8eb1bb2f 100644 --- a/source/modules/database/php/index.js +++ b/source/modules/database/php/index.js @@ -1503,7 +1503,6 @@ class PHP { dumpResult() { const grid = this.manager.result.layout.getAttachedObject(); let filename = `${this.core.__opts__.ip}_${new Date().format("yyyyMMddhhmmss")}.csv`; - antSword['test'] = this; dialog.showSaveDialog({ title: LANG['result']['dump']['title'], defaultPath: filename diff --git a/source/modules/filemanager/index.js b/source/modules/filemanager/index.js index f36eb4d5..4c0b06dd 100644 --- a/source/modules/filemanager/index.js +++ b/source/modules/filemanager/index.js @@ -809,6 +809,7 @@ class FileManager { let editor = null; let codes = ''; let win; + let hinttext = ''; if (openfileintab == false){ win = this.createWin({ title: LANG['editor']['title'](path), @@ -823,6 +824,7 @@ class FileManager { null, null, true, true ); win = antSword['tabbar'].cells(`tab_file_${_id}`); + hinttext = `IP:${this.opts['ip']} File:${path}`; } win.progressOn(); @@ -854,9 +856,11 @@ class FileManager { _options.push(_opt); } toolbar.loadStruct([ - { id: 'save', type: 'button', icon: 'save', text: LANG['editor']['toolbar']['save'] }, + { id: 'hinttext', type: 'text', text: hinttext}, { type: 'separator' }, { type: 'spacer' }, + { id: 'save', type: 'button', icon: 'save', text: LANG['editor']['toolbar']['save'] }, + { type: 'separator' }, { id: 'encode', type: 'buttonSelect', icon: 'language', openAll: true, text: LANG['editor']['toolbar']['encode'], diff --git a/source/modules/plugin/index.js b/source/modules/plugin/index.js index 9bead452..cf65db81 100644 --- a/source/modules/plugin/index.js +++ b/source/modules/plugin/index.js @@ -39,10 +39,17 @@ class Plugin { win.on('close', () => { this.win = win = null; }); - win.loadURL(url); - win.show(); - // win.openDevTools(); - this.win = win; + let ses = win.webContents.session; + let proxyuri = ""; + if(antSword.aproxymode != "noproxy") { + proxyuri = antSword.aproxyuri; + } + ses.setProxy({proxyRules: proxyuri}, ()=>{ + win.loadURL(url); + win.show(); + // win.openDevTools(); + this.win = win; + }); } diff --git a/source/modules/shellmanager/list/form.js b/source/modules/shellmanager/list/form.js index c172ca88..89d8206f 100644 --- a/source/modules/shellmanager/list/form.js +++ b/source/modules/shellmanager/list/form.js @@ -27,36 +27,82 @@ class Form { // toolbar点击事件 this.toolbar.attachEvent('onClick', (id) => { - if (id === 'clear') { - return this.baseForm.clear(); - } - // 检测表单数据 - if ( - !this.baseForm.validate() || - !this.httpForm.validate() || - !this.otherForm.validate() - ) { - return toastr.warning(LANG['list']['add']['warning'], LANG_T['warning']); - }; - // 回调数据 - if (callback) { - win.progressOn(); - setTimeout(() => { - callback(this._parseFormData( + switch(id){ + case 'clear': + this.baseForm.clear(); + break; + case 'test': + if ( + !this.baseForm.validate() || + !this.httpForm.validate() || + !this.otherForm.validate() + ) { + return toastr.warning(LANG['list']['add']['warning'], LANG_T['warning']); + }; + let opts = this._parseFormData( this.baseForm.getValues(), this.httpForm.getValues(), this.otherForm.getValues() - )).then((msg) => { - // 添加/保存完毕后回调 - win.close(); - toastr.success(msg, LANG_T['success']); - }).catch((msg) => { - // 添加/保存错误 + ); + let opt = { + "url": opts.base['url'], + "pwd": opts.base['pwd'], + "type": opts.base['type'], + "encode": opts.base['encode'], + "encoder": opts.base['encoder'], + "httpConf": opts.http, + "otherConf": opts.other, + } + win.progressOn(); + let core = new antSword["core"][opt['type']](opt); + core.request( + core.base.info() + ) + .then((ret) => { + if(ret['text'].length > 0){ + toastr.success(LANG['list']['add']['test_success'], LANG_T['success']); + }else{ + toastr.warning(LANG['list']['add']['test_warning'], LANG_T['warning']); + } + win.progressOff(); + }) + .catch((err)=>{ + toastr.error(JSON.stringify(err), LANG_T['error']); win.progressOff(); - toastr.error(msg, LANG_T['error']); }); - }, 100); - }; + break; + case 'act': + // 检测表单数据 + if ( + !this.baseForm.validate() || + !this.httpForm.validate() || + !this.otherForm.validate() + ) { + return toastr.warning(LANG['list']['add']['warning'], LANG_T['warning']); + }; + // 回调数据 + if (callback) { + win.progressOn(); + setTimeout(() => { + callback(this._parseFormData( + this.baseForm.getValues(), + this.httpForm.getValues(), + this.otherForm.getValues() + )).then((msg) => { + // 添加/保存完毕后回调 + win.close(); + toastr.success(msg, LANG_T['success']); + }).catch((msg) => { + // 添加/保存错误 + win.progressOff(); + toastr.error(msg, LANG_T['error']); + }); + }, 100); + }; + break; + default: + break; + } }); } @@ -109,7 +155,10 @@ class Form { type: 'button', icon: 'remove', text: LANG['list']['add']['toolbar']['clear'] - }]); + }, + { type: 'separator' }, + { id: 'test', type: 'button', 'icon': 'spinner', text: LANG['list']['add']['toolbar']['test'] }, + ]); return toolbar; } @@ -318,6 +367,9 @@ class Form { const opt = Object.assign({}, { 'ignore-https': 0, 'use-multipart': 0, + 'use-chunk': 0, + 'chunk-step-byte-min': 2, + 'chunk-step-byte-max': 3, 'terminal-cache': 0, 'filemanager-cache': 1, 'upload-fragment': '500', @@ -334,7 +386,60 @@ class Form { }, { type: "checkbox", name: 'use-multipart', label: LANG['list']['otherConf']['usemultipart'], checked: opt['use-multipart'] === 1 - }, { + }, { type: 'fieldset', offsetLeft: 0, label: LANG['list']['otherConf']['chunk']['title'], list: [ + { type: 'block', offsetLeft: 0, list: [ + { + type: "checkbox", name: 'use-chunk', label: LANG['list']['otherConf']['chunk']['usechunk'], checked: opt['use-chunk'] === 1 + }, + ]}, + { type: 'block', offsetLeft: 0, list: [ + { type:'label', label: LANG['list']['otherConf']['chunk']['min']}, + { type:'newcolumn' }, + { + type: 'combo', label: '/byte', validate: 'ValidNumeric', inputWidth: 50, name: "chunk-step-byte-min", + options: ((items) => { + let ret = []; + // 如果自定义的路径不在items里,则++ + if (items.indexOf(opt['chunk-step-byte-min']) === -1) { + items.unshift(opt['chunk-step-byte-min']); + } + items.map((_) => { + ret.push({ + text: _, + value: _, + selected: opt['chunk-step-byte-min'] === _ + }) + }); + return ret; + })([ + '2', '4', '10', '50', '100', '500' + ]) + }, + { type:'newcolumn',}, + { type:'label', label: LANG['list']['otherConf']['chunk']['max'], offsetLeft: 30,}, + { type:'newcolumn' }, + { + type: 'combo', label: '/byte', validate: 'ValidNumeric', inputWidth: 50, name: "chunk-step-byte-max", + options: ((items) => { + let ret = []; + // 如果自定义的路径不在items里,则++ + if (items.indexOf(opt['chunk-step-byte-max']) === -1) { + items.unshift(opt['chunk-step-byte-max']); + } + items.map((_) => { + ret.push({ + text: _, + value: _, + selected: opt['chunk-step-byte-max'] === _ + }) + }); + return ret; + })([ + '2', '4', '10', '50', '100', '500' + ]) + }, + ]}, + ]}, { type: "checkbox", name: 'terminal-cache', label: LANG['list']['otherConf']['terminalCache'], checked: opt['terminal-cache'] === 1 }, { @@ -405,6 +510,28 @@ class Form { ]) } ]}], true); + form.attachEvent('onChange', (name, value, state)=>{ + switch(name){ + case 'use-multipart': + if(state == true && form.isItemChecked('use-chunk')) { + form.uncheckItem('use-chunk'); + } + break; + case 'use-chunk': + if(state == true && form.isItemChecked('use-multipart')) { + form.uncheckItem('use-multipart'); + } + if(state == true) { + layer.open({ + title: LANG_T['info'] + ,content: LANG['list']['otherConf']['chunk']['exphint'] + }); + } + break; + default: + break; + } + }); return form; } diff --git a/source/modules/viewsite/index.js b/source/modules/viewsite/index.js index 9efe00c0..0432fefd 100644 --- a/source/modules/viewsite/index.js +++ b/source/modules/viewsite/index.js @@ -24,7 +24,7 @@ class ViewSite { this.opts = opts; this.cell = tabbar.cells(`tab_viewsite_${hash}`); - + this.useproxy = antSword.aproxymode !== "noproxy"; // 初始化工具栏 this.toolbar = this._initToolbar(); @@ -52,10 +52,21 @@ class ViewSite { const toolbar = this.cell.attachToolbar(); toolbar.loadStruct([ { id: 'url', width: 400, type: 'buttonInput', value: this.opts.url || 'loading..' }, + { type: 'separator' }, + { id: 'useproxy', type: 'buttonTwoState', icon: 'paper-plane', text: LANG['toolbar'].useproxy(this.useproxy), pressed: this.useproxy, disabled: antSword.aproxymode === "noproxy"}, + { type: 'separator' }, { id: 'view', type: 'button', icon: 'chrome', text: LANG['toolbar'].view }, { type: 'separator' }, { id: 'save', type: 'button', icon: 'save', text: LANG['toolbar'].save }, ]); + toolbar.attachEvent('onStateChange', (id, state) => { + switch(id) { + case 'useproxy': + this.useproxy = state; + toolbar.setItemText('useproxy', ` ${LANG['toolbar'].useproxy(this.useproxy)}`); + break; + } + }); toolbar.attachEvent('onClick', (id) => { switch(id) { case 'save': @@ -171,9 +182,19 @@ class ViewSite { }, title: url }); - win.loadURL(url); - win.show(); - win.openDevTools(); + win.on('close', () => { + win = null; + }); + let ses = win.webContents.session; + let proxyuri = ""; + if(this.useproxy && antSword.aproxymode != "noproxy") { + proxyuri = antSword.aproxyuri; + } + ses.setProxy({proxyRules: proxyuri}, ()=>{ + win.loadURL(url); + win.show(); + win.openDevTools(); + }); } } diff --git a/static/libs/dhtmlx/codebase/dhtmlx.js b/static/libs/dhtmlx/codebase/dhtmlx.js index cb3257b1..dbb1bfa2 100644 --- a/static/libs/dhtmlx/codebase/dhtmlx.js +++ b/static/libs/dhtmlx/codebase/dhtmlx.js @@ -18,7 +18,7 @@ if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.4",skin:null,skinDe // function dhtmlXToolbarObject(c,e){var a=this;this.conf={skin:(e||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtoolbar")||"dhx_skyblue"),align:"left",align_autostart:"left",icons_path:"",iconSize:18,sel_ofs_x:0,sel_ofs_y:0,xml_autoload:null,items_autoload:null};if(typeof(c)=="object"&&c!=null&&typeof(c.tagName)=="undefined"){if(c.icons_path!=null||c.icon_path!=null){this.conf.icons_path=(c.icons_path||c.icon_path)}if(c.icons_size!=null){this.conf.icons_size_autoload=c.icons_size}if(c.json!=null){this.conf.json_autoload=c.json}if(c.xml!=null){this.conf.xml_autoload=c.xml}if(c.onload!=null){this.conf.onload_autoload=c.onload}if(c.onclick!=null||c.onClick!=null){this.conf.auto_onclick=(c.onclick||c.onClick)}if(c.items!=null){this.conf.items_autoload=c.items}if(c.skin!=null){this.conf.skin=c.skin}if(c.align!=null){this.conf.align_autostart=c.align}c=c.parent}this.cont=(typeof(c)!="object")?document.getElementById(c):c;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}c=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);if(window.dhx4.isIPad){this.cont.ontouchstart=function(g){g=g||event;if((String(g.target.tagName||"").toLowerCase()=="input")){return true}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}g.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(g){var h="dhxId_";var m="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var l=0;l0){h.insertBefore(g,h.childNodes[0])}else{h.appendChild(g)}return g};this._setItemImage=function(m,h,g){if(g==true){m.imgEn=h}else{m.imgDis=h}if((!m.state&&g==true)||(m.state&&g==false)){return}var l=this._getObj(m.obj,"img");if(l==null){l=this._addImgObj(m.obj)}l.src=this.conf.icons_path+h};this._clearItemImage=function(l,g){if(g==true){l.imgEn=""}else{l.imgDis=""}if((!l.state&&g==true)||(l.state&&g==false)){return}var h=this._getObj(l.obj,"img");if(h!=null){h.parentNode.removeChild(h)}};this._setItemText=function(g,l){var h=this._getObj(g.obj,"div");if(l==null||l.length==0){if(h!=null){h.parentNode.removeChild(h)}return}if(h==null){h=document.createElement("DIV");h.className="dhxtoolbar_text";g.obj.appendChild(h)}h.innerHTML=l};this._getItemText=function(g){var h=this._getObj(g.obj,"div");if(h!=null){return h.innerHTML}return""};this._enableItem=function(h){if(h.state){return}h.state=true;if(this.objPull[h.id]["type"]=="buttonTwoState"&&this.objPull[h.id]["obj"]["pressed"]==true){h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.renderAs=h.obj.className}if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,"img");if(h.imgEn!=""){if(g==null){g=this._addImgObj(h.obj)}g.src=this.conf.icons_path+h.imgEn}else{if(g!=null){g.parentNode.removeChild(g)}}};this._disableItem=function(h){if(!h.state){return}h.state=false;h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[h.id]["type"]=="buttonTwoState"&&h.obj.pressed?"pres_":"")+"dis";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,"img");if(h.imgDis!=""){if(g==null){g=this._addImgObj(h.obj)}g.src=this.conf.icons_path+h.imgDis}else{if(g!=null){g.parentNode.removeChild(g)}}if(h.polygon!=null){if(h.polygon.style.display!="none"){window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(h.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var g in this.objPull){this._removeItem(String(g).replace(this.idPrefix,""))}};this._doOnClick=function(g){if(a&&a.forEachItem){a.forEachItem(function(l){if(a.objPull[a.idPrefix+l]["type"]=="buttonSelect"){var h=a.objPull[a.idPrefix+l];if(h.arw._skip===true){h.arw._skip=false}else{if(h.polygon.style.display!="none"){h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.className=h.obj.renderAs;h.arw.className=String(h.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(h.id,true)}}}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else{if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else{if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}}}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}if(typeof(this.conf.auto_onclick)=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else{if(typeof(this.conf.auto_onclick)=="string"&&typeof(window[this.conf.auto_onclick])=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}}return this}dhtmlXToolbarObject.prototype.addSpacer=function(e){var c=this.idPrefix+e;if(this._spacer!=null){if(this._spacer.idd==e){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var m=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(m==e||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=e;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var l=(this.objPull[c].arw!=null);while(a){var g=this.base.childNodes.length-1;if(l==true){if(this.base.childNodes[g]==this.objPull[c].arw){a=false}}if(this.base.childNodes[g].idd==e){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[g],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[g])}}}this._spacer.idd=e;this._fixSpacer();return}}else{var h=null;for(var g=0;gh+1){this._spacer.appendChild(this.base.childNodes[h+1])}this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer){return}while(this._spacer.childNodes.length>0){this.base.appendChild(this._spacer.childNodes[0])}this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof(window.addEventListener)=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};dhtmlXToolbarObject.prototype.getType=function(e){var g=this.getParentId(e);if(g!=null){var c=null;var a=this.objPull[this.idPrefix+g]._listOptions[e];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+e]==null){return null}return this.objPull[this.idPrefix+e]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(c){var a=this.getType(c);if(a=="buttonSelectButton"||a=="buttonSelectSeparator"){if(a=="buttonSelectButton"){a="button"}else{a="separator"}return a}return null};dhtmlXToolbarObject.prototype.inArray=function(e,c){for(var a=0;a0){g.obj.removeChild(g.obj.childNodes[0])}g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.state=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.setItemToolTipTemplate=null;g.getItemToolTipTemplate=null;g.setMaxValue=null;g.setMinValue=null;g.getMaxValue=null;g.getMinValue=null;g.setValue=null;g.getValue=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="separator"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="text"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setWidth=null;g.setItemText=null;g.getItemText=null}e=null;g=null;this.objPull[this.idPrefix+h]=null;delete this.objPull[this.idPrefix+h]};(function(){var g="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var c=function(h){return function(r,m,l,q,o,n){r=this.idPrefix+r;if(this.objPull[r]==null){return}if(this.objPull[r]["type"]!="buttonSelect"){return}return this.objPull[r][h].call(this.objPull[r],m,l,q,o,n)}};for(var e=0;e":""),(c.text!=null?"
"+c.text+"
":""));var e=this;this.obj.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(e.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(e.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(h){if(e.state==false){return}if(this.allowClick==false){return}h=h||event;var l=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](l)}catch(h){}}if(a&&a.callEvent){a.callEvent("onClick",[l])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(h){if(e.state==false){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}h.cancelBubble=true;return false}if(a.anyUsed!="none"){return}a.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(l){if(e.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var h=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&h!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(h){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(h){a._setItemText(this,h)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(h){a._setItemImage(this,h,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(h){a._setItemImage(this,h,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(h){this.obj.title=h};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(e,l,h){this.id=e.idPrefix+l;this.state=(h.enabled!=null?(h.enabled=="true"?true:false):true);this.imgEn=(h.img||"");this.imgDis=(h.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(h.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!h.text||h.text.length==0){h.text=" "}}else{this.openAll=(window.dhx4.s2b(h.openAll)==true);this.renderSelect=(h.renderSelect==null?true:window.dhx4.s2b(h.renderSelect))}this.maxOpen=(!isNaN(h.maxOpen?h.maxOpen:"")?h.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!e._sbw){var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test";document.body.appendChild(n);var m=document.createElement("DIV");m.className="dhxtoolbar_maxopen_test2";n.appendChild(m);e._sbw=n.offsetWidth-m.offsetWidth;n.removeChild(m);m=null;document.body.removeChild(n);n=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(h.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(h.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.obj.idd=String(l);this.obj.title=(h.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=e._rtlParseBtn((this.img!=""?"":""),(h.text!=null?"
"+h.text+"
":""));e.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="
 
";this.arw.title=this.obj.title;this.arw.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};e.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(m){m=m||event;if(e.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){a.obj.allowClick=false;if(e.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");a.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(m){m=m||event;if(!a.obj.allowClick){return}if(!a.state){return}if(e.anyUsed!="none"){return}var n=a.obj.idd.replace(e.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](n)}catch(m){}}e.callEvent("onClick",[n])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(m){m=m||event;if(e.anyUsed!="none"){return}if(!a.state){return}a.obj.allowClick=true;a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){m=m||event;m.cancelBubble=true;if(e.anyUsed!="none"){return}if(!a.state){return}a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad&&a.callEvent){var n=a.obj.idd.replace(e.idPrefix,"");e.callEvent("onClick",[n])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(o){o=o||event;var w=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(w._skip){o=o||event;o.cancelBubble=true}else{w._skip=true}w=null;if(!a.state){return}if(e.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");e.anyUsed="none";window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,true)}}else{if(e.anyUsed!="none"){if(e.objPull[e.idPrefix+e.anyUsed]["type"]=="buttonSelect"){var v=e.objPull[e.idPrefix+e.anyUsed];if(v.polygon.style.display!="none"){v.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";v.obj.className=v.obj.renderAs;v.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(v.polygon._idd);v.polygon.style.display="none";if(v.polygon._ie6cover){v.polygon._ie6cover.style.display="none"}if(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(v.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";e.anyUsed=a.obj.idd;a.polygon.style.top="0px";a.polygon.style.visibility="hidden";a.polygon.style.zIndex=window.dhx4.zim.reserve(a.polygon._idd);a.polygon.style.display="";if(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);e._autoDetectVisibleArea();var q=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+e.conf.sel_ofs_y;var s=a.polygon.offsetHeight;if(q+s>e.tY2){var r=(a.maxOpen!=null?Math.floor((e.tY2-q)/22):0);if(r>=1){a._fixMaxOpenHeight(r)}else{q=window.dhx4.absTop(a.obj)-s-e.conf.sel_ofs_y;if(q<0){q=0}}}a.polygon.style.top=q+"px";if(e.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+e.conf.sel_ofs_x+"px"}else{var n=document.body.scrollLeft;var m=n+(window.innerWidth||document.body.clientWidth);var u=window.dhx4.absLeft(a.obj)+e.conf.sel_ofs_x;if(u+a.polygon.offsetWidth>m){u=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(u,5)+"px"}a.polygon.style.visibility="visible";if(a.polygon._ie6cover){a.polygon._ie6cover.style.left=a.polygon.style.left;a.polygon._ie6cover.style.top=a.polygon.style.top;a.polygon._ie6cover.style.width=a.polygon.offsetWidth+"px";a.polygon._ie6cover.style.height=a.polygon.offsetHeight+"px";a.polygon._ie6cover.style.display=""}}return false};this.arw.onclick=function(m){m=m||event;m.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){m=m||event;m.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=e.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(r){var q="auto";var o=false;if(r!==null){var n=0;for(var m in this._listOptions){n++}if(n>r){this._ph=22*r;q=this._ph+"px"}else{o=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!o&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+e._sbw+"px";this.polygon.style.height=q}};this._separatorButtonSelectObject=function(o,m,n){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}return false};if(isNaN(n)){n=a.p_tbody.childNodes.length+1}else{if(n<1){n=1}}if(n>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[n-1])}this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[o]=this.obj;return this};this._buttonButtonSelectObject=function(r,o,q){var n=true;if(typeof(o.enabled)!="undefined"){n=window.dhx4.s2b(o.enabled)}else{if(typeof(o.disabled)!="undefined"){n=window.dhx4.s2b(o.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=n;this.obj.tr.extAction=(o.action||null);this.obj.tr._selected=(o.selected!=null);this.obj.tr.className="tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&a.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart=function(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}return false};this.obj.tr.idd=String(r);if(isNaN(q)){q=a.p_tbody.childNodes.length+1}else{if(q<1){q=1}}if(q>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[q-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}return false};if(e.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(o.img!=null){this.obj.td_a.innerHTML="";this.obj.tr._img=o.img}else{this.obj.td_a.innerHTML=" "}var m=(o.text!=null?o.text:(o.itemText||""));this.obj.td_b.innerHTML="
"+m+"
";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en){return}if(this._selected&&a.renderSelect){if(String(this.className).search("tr_btn_selected")==-1){this.className="tr_btn tr_btn_selected"}}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(s){s=s||event;s.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(e.idPrefix,""));a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,true)}e.anyUsed="none";var u=this.idd.replace(e.idPrefix,"");if(this.extAction){try{window[this.extAction](u)}catch(s){}}e.callEvent("onClick",[u])};a._listOptions[r]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+e.conf.skin+" dhxtoolbar_icons_"+e.conf.iconSize;this.polygon.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.polygon.onmousedown=function(m){m=m||event;m.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}m.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(h.options!=null){for(var g=0;g0){m.td_a.removeChild(m.td_a.childNodes[0])}while(m.td_b.childNodes.length>0){m.td_b.removeChild(m.td_b.childNodes[0])}m.tr.onselectstart=null;m.tr.onmouseover=null;m.tr.onmouseout=null;m.tr.onclick=null;while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.td_a=null;m.td_b=null;m.tr=null}else{m.sep.onselectstart=null;m.td.onselectstart=null;m.tr.onselectstart=null;while(m.td.childNodes.length>0){m.td.removeChild(m.td.childNodes[0])}while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.sep=null;m.td=null;m.tr=null}m=null;this._listOptions[o]=null;try{delete this._listOptions[o]}catch(n){}};this.showListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display=""};this.hideListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display="none"};this.isListOptionVisible=function(m){if(!this._isListButton(m,true)){return}return(this._listOptions[m].tr.style.display!="none")};this.enableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=true;this._listOptions[m].tr.className="tr_btn"+(this._listOptions[m].tr._selected&&e.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=false;this._listOptions[m].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.en};this.setListOptionPosition=function(o,n){if(!this._listOptions[o]||this.getListOptionPosition(o)==n||isNaN(n)){return}if(n<1){n=1}var m=this._listOptions[o].tr;this.p_tbody.removeChild(m);if(n>this.p_tbody.childNodes.length){this.p_tbody.appendChild(m)}else{this.p_tbody.insertBefore(m,this.p_tbody.childNodes[n-1])}m=null};this.getListOptionPosition=function(o){var n=-1;if(!this._listOptions[o]){return n}for(var m=0;m";n=null};this.getListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(e.rtl?1:0)];var m=null;if(n.childNodes.length>0){m=n.childNodes[0].src}n=null;return m};this.clearListOptionImage=function(n){if(!this._isListButton(n)){return}var m=this._listOptions[n].tr.childNodes[(e.rtl?1:0)];while(m.childNodes.length>0){m.removeChild(m.childNodes[0])}m.innerHTML=" ";m=null};this.setListOptionText=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.childNodes[(e.rtl?0:1)].childNodes[0].innerHTML=m};this.getListOptionText=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.childNodes[(e.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.title=m};this.getListOptionToolTip=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.title};this.forEachListOption=function(n){for(var m in this._listOptions){n(m)}};this.getAllListOptions=function(){var n=new Array();for(var m in this._listOptions){n[n.length]=m}return n};this.setListOptionSelected=function(o){for(var m in this._listOptions){var n=this._listOptions[m];if(n.td_a!=null&&n.td_b!=null&&n.tr.en){if(m==o){n.tr._selected=true;n.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(n.tr._img){this.setItemImage(n.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(o))}}else{n.tr._selected=false;n.tr.className="tr_btn"}}n=null}};this.getListOptionSelected=function(){var n=null;for(var m in this._listOptions){if(this._listOptions[m].tr._selected==true){n=m}}return n};this._isListButton=function(n,m){if(this._listOptions[n]==null){return false}if(!m&&this._listOptions[n].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(m){this._ph=null;if(typeof(m)=="number"){this.maxOpen=m;this._maxOpenTest();return}this.maxOpen=null};if(h.width){this.setWidth(h.width)}if(this.mode=="select"&&typeof(h.selected)!="undefined"){this.setListOptionSelected(h.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(e,h,g){this.id=e.idPrefix+h;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(g.hidden!=null?"none":"");this.obj.idd=String(h);this.obj.w=(g.width!=null?g.width:100);this.obj.title=(g.title!=null?g.title:"");this.obj.innerHTML="";var c=e;var a=this;this.obj.childNodes[0].onkeydown=function(l){l=l||event;if(l.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};e.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return(!this.obj.childNodes[0].disabled)};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display!="none")};this.setValue=function(l){this.obj.childNodes[0].value=l};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(l){this.obj.w=l;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(g.enabled)!="undefined"&&window.dhx4.s2b(g.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,g,c){this.id=a.idPrefix+g;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img!=null?c.img:"");this.imgDis=(c.imgdis!=null?c.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(c.selected!=null);this.obj.extAction=(c.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):(this.state?"def":"dis"));this.obj.style.display=(c.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(g);this.obj.title=(c.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"":""),(c.text!=null?"
"+c.text+"
":""));a.base.appendChild(this.obj);var e=this;this.obj.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(e.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(e.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(h){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(e.state==false){return}if(a.anyUsed!="none"){return}this.pressed=!this.pressed;this.className=(this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs);var l=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](l,this.pressed)}catch(h){}}a.callEvent("onStateChange",[l,this.pressed]);return false};this.setItemState=function(h,m){if(this.obj.pressed!=h){if(h==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(m==true){var n=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](n,this.obj.pressed)}catch(l){}}a.callEvent("onStateChange",[n,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(h){a._setItemText(this,h)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(h){a._setItemImage(this,h,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(h){a._setItemImage(this,h,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(h){this.obj.title=h};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(g,l,h){this.id=g.idPrefix+l;this.state=(h.enabled!=null?(h.enabled=="true"?true:false):true);this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(h.hidden!=null?"none":"");this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.obj.idd=String(l);this.obj.len=(h.length!=null?Number(h.length):50);this.obj.innerHTML="
"+(h.textMin||"")+"
"+(h.textMax||"")+"
";g.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var e=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+g.conf.skin+(g.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(h.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(h.valueMin!=null?Number(h.valueMin):0);this.pen.valueMax=(h.valueMax!=null?Number(h.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(h.valueNow!=null?Number(h.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNowwindow.dhx4.absLeft(e)+Math.round(e.offsetWidth/2)&&e.nowX==e.maxX){return}e.newNowX=e.nowX+o;if(e.newNowXe.maxX){e.newNowX=e.maxX}e.nowX=e.newNowX;e.style.left=e.nowX+"px";e.initXY=m;e.newValueNow=Math.round((e.valueMax-e.valueMin)*(e.newNowX-e.minX)/(e.maxX-e.minX)+e.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,e.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(e)+e.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(e)-c.offsetHeight-3+"px"}n.cancelBubble=true;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!e.allowMove){return}e.className="dhxtoolbar_sl_pen";e.allowMove=false;e.nowX=e.newNowX;e.valueNow=e.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}g.callEvent("onValueChange",[a.obj.idd.replace(g.idPrefix,""),e.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",e._doOnMouseMoveStart,false);document.addEventListener("touchend",e._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",e._doOnMouseMoveStart,false);window.addEventListener("mouseup",e._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",e._doOnMouseMoveStart);document.body.attachEvent("onmouseup",e._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state){return}this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state){return}this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setValue=function(m,n){m=Number(m);if(mthis.pen.valueMax){m=this.pen.valueMax}this.pen.valueNow=m;this.pen._definePos();if(n==true){g.callEvent("onValueChange",[this.obj.idd.replace(g.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(n,m){n=Number(n);if(n>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=m;this.obj.childNodes[0].style.display=(m.length>0?"":"none");this.pen.valueMin=n;if(this.pen.valueNow0?"":"none");this.pen.valueMax=n;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var m=this.obj.childNodes[0].innerHTML;var n=this.pen.valueMin;return new Array(n,m)};this.getMaxValue=function(){var m=this.obj.childNodes[4].innerHTML;var n=this.pen.valueMax;return new Array(n,m)};this.setItemToolTipTemplate=function(m){this.label.tip=m};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var a=window.dhx4.screenDim();this.tX1=a.left;this.tX2=a.right;this.tY1=a.top;this.tY2=a.bottom};dhtmlXToolbarObject.prototype._initObj=function(c){for(var a=0;a=0&&g[o][c-1]!=null&&h[g[o][c-1].type])){l=true}}r.node.style.borderRightWidth=(s?"1px":"0px");r.node.style.borderTopRightRadius=r.node.style.borderBottomRightRadius=(s?this.conf.terrace_radius:"0px");if(r.type=="buttonSelect"){r.node.previousSibling.style.borderTopLeftRadius=r.node.previousSibling.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px");r.node.previousSibling._br=s;r.node.previousSibling._bl=l}else{r.node.style.borderTopLeftRadius=r.node.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px")}r.node._br=s;r.node._bl=l}}for(var o=0;o0)this.cont.removeChild(this.cont.childNodes[0]);t=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);if(window.dhx4.isIPad){this.cont.ontouchstart=function(t){t=t||event;if(String(t.target.tagName||"").toLowerCase()=="input")return true;if(t.preventDefault)t.preventDefault();else t.returnValue=false;t.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(t){var e="dhxId_";var i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var n=0;n0)t.insertBefore(e,t.childNodes[0]);else t.appendChild(e);return e};this._setItemImage=function(t,e,i){if(i==true)t.imgEn=e;else t.imgDis=e;if(!t.state&&i==true||t.state&&i==false)return;var n=this._getObj(t.obj,"img");if(n==null)n=this._addImgObj(t.obj);n.src=this.conf.icons_path+e};this._clearItemImage=function(t,e){if(e==true)t.imgEn="";else t.imgDis="";if(!t.state&&e==true||t.state&&e==false)return;var i=this._getObj(t.obj,"img");if(i!=null)i.parentNode.removeChild(i)};this._setItemText=function(t,e){var i=this._getObj(t.obj,"div");if(e==null||e.length==0){if(i!=null)i.parentNode.removeChild(i);return}if(i==null){i=document.createElement("DIV");i.className="dhxtoolbar_text";t.obj.appendChild(i)}i.innerHTML=e};this._getItemText=function(t){var e=this._getObj(t.obj,"div");if(e!=null)return e.innerHTML;return""};this._enableItem=function(t){if(t.state)return;t.state=true;if(this.objPull[t.id]["type"]=="buttonTwoState"&&this.objPull[t.id]["obj"]["pressed"]==true){t.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";t.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{t.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";t.obj.renderAs=t.obj.className}if(t.arw)t.arw.className=String(t.obj.className).replace("btn","arw");var e=this._getObj(t.obj,"img");if(t.imgEn!=""){if(e==null)e=this._addImgObj(t.obj);e.src=this.conf.icons_path+t.imgEn}else{if(e!=null)e.parentNode.removeChild(e)}};this._disableItem=function(t){if(!t.state)return;t.state=false;t.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[t.id]["type"]=="buttonTwoState"&&t.obj.pressed?"pres_":"")+"dis";t.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(t.arw)t.arw.className=String(t.obj.className).replace("btn","arw");var e=this._getObj(t.obj,"img");if(t.imgDis!=""){if(e==null)e=this._addImgObj(t.obj);e.src=this.conf.icons_path+t.imgDis}else{if(e!=null)e.parentNode.removeChild(e)}if(t.polygon!=null){if(t.polygon.style.display!="none"){window.dhx4.zim.clear(t.polygon._idd);t.polygon.style.display="none";if(t.polygon._ie6cover)t.polygon._ie6cover.style.display="none";if(this.conf.skin=="dhx_terrace")this._improveTerraceButtonSelect(t.id,true);this.callEvent("onButtonSelectHide",[t.obj.idd])}}this.anyUsed="none"};this.clearAll=function(){for(var t in this.objPull)this._removeItem(String(t).replace(this.idPrefix,""))};this._doOnClick=function(t){if(i&&i.forEachItem){i.forEachItem(function(t){if(i.objPull[i.idPrefix+t]["type"]=="buttonSelect"){var e=i.objPull[i.idPrefix+t];if(e.arw._skip===true){e.arw._skip=false}else if(e.polygon.style.display!="none"){e.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";e.obj.className=e.obj.renderAs;e.arw.className=String(e.obj.renderAs).replace("btn","arw");i.anyUsed="none";window.dhx4.zim.clear(e.polygon._idd);e.polygon.style.display="none";if(e.polygon._ie6cover)e.polygon._ie6cover.style.display="none";if(i.conf.skin=="dhx_terrace")i._improveTerraceButtonSelect(e.id,true);i.callEvent("onButtonSelectHide",[e.obj.idd])}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof window.addEventListener!="undefined"){window.addEventListener("mousedown",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}if(typeof this.conf.auto_onclick=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else if(typeof this.conf.auto_onclick=="string"&&typeof window[this.conf.auto_onclick]=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}return this}dhtmlXToolbarObject.prototype.addSpacer=function(t){var e=this.idPrefix+t;if(this._spacer!=null){if(this._spacer.idd==t)return;if(this._spacer==this.objPull[e].obj.parentNode){var i=true;while(i){var n=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(n==t||this._spacer.childNodes.length==0){if(this.objPull[e].arw!=null)this.base.appendChild(this.objPull[e].arw);i=false}}this._spacer.idd=t;this._fixSpacer();return}if(this.base==this.objPull[e].obj.parentNode){var i=true;var s=this.objPull[e].arw!=null;while(i){var l=this.base.childNodes.length-1;if(s==true)if(this.base.childNodes[l]==this.objPull[e].arw)i=false;if(this.base.childNodes[l].idd==t)i=false;if(i){if(this._spacer.childNodes.length>0)this._spacer.insertBefore(this.base.childNodes[l],this._spacer.childNodes[0]);else this._spacer.appendChild(this.base.childNodes[l])}}this._spacer.idd=t;this._fixSpacer();return}}else{var o=null;for(var l=0;lo+1)this._spacer.appendChild(this.base.childNodes[o+1]);this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace")this._improveTerraceSkin()};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer)return;while(this._spacer.childNodes.length>0)this.base.appendChild(this._spacer.childNodes[0]);this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace")this._improveTerraceSkin()};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof window.addEventListener=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var t=this._spacer;window.setTimeout(function(){t.style.borderLeft="0px solid #a4bed4";t=null},1)}};dhtmlXToolbarObject.prototype.getType=function(t){var e=this.getParentId(t);if(e!=null){var i=null;var n=this.objPull[this.idPrefix+e]._listOptions[t];if(n!=null)if(n.sep!=null)i="buttonSelectSeparator";else i="buttonSelectButton";return i}else{if(this.objPull[this.idPrefix+t]==null)return null;return this.objPull[this.idPrefix+t]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(t){var e=this.getType(t);if(e=="buttonSelectButton"||e=="buttonSelectSeparator"){if(e=="buttonSelectButton")e="button";else e="separator";return e}return null};dhtmlXToolbarObject.prototype.inArray=function(t,e){for(var i=0;i0)i.obj.removeChild(i.obj.childNodes[0]);i.obj.parentNode.removeChild(i.obj);i.obj=null;i.id=null;i.type=null;i.state=null;i.enableItem=null;i.disableItem=null;i.isEnabled=null;i.setItemToolTipTemplate=null;i.getItemToolTipTemplate=null;i.setMaxValue=null;i.setMinValue=null;i.getMaxValue=null;i.getMinValue=null;i.setValue=null;i.getValue=null;i.showItem=null;i.hideItem=null;i.isVisible=null}if(e=="separator"){i.obj.onselectstart=null;i.obj.idd=null;i.obj.parentNode.removeChild(i.obj);i.obj=null;i.id=null;i.type=null;i.showItem=null;i.hideItem=null;i.isVisible=null}if(e=="text"){i.obj.onselectstart=null;i.obj.idd=null;i.obj.parentNode.removeChild(i.obj);i.obj=null;i.id=null;i.type=null;i.showItem=null;i.hideItem=null;i.isVisible=null;i.setWidth=null;i.setItemText=null;i.getItemText=null}e=null;i=null;this.objPull[this.idPrefix+t]=null;delete this.objPull[this.idPrefix+t]};(function(){var t="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var e=function(t){return function(e,i,n,s,l,o){e=this.idPrefix+e;if(this.objPull[e]==null)return;if(this.objPull[e]["type"]!="buttonSelect")return;return this.objPull[e][t].call(this.objPull[e],i,n,s,l,o)}};for(var i=0;i"+(i.icon!=""?" ":"")+i.text+"":"");var n=this;this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(n.state==false)return;if(t.anyUsed!="none")return;this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(n.state==false)return;if(t.anyUsed!="none")return;this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(e){if(n.state==false)return;if(this.allowClick==false)return;e=e||event;var i=this.idd.replace(t.idPrefix,"");if(this.extAction)try{window[this.extAction](i)}catch(e){}if(t&&t.callEvent)t.callEvent("onClick",[i])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(e){if(n.state==false){e=e||event;if(e.preventDefault)e.preventDefault();else e.returnValue=false;e.cancelBubble=true;return false}if(t.anyUsed!="none")return;t.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){t.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(i){if(n.state==false)return;if(t.anyUsed!="none"){if(t.anyUsed!=this.idd)return}var s=t.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&s!="none"){if(this.extAction){var l=this;window.setTimeout(function(){try{window[l.extAction](e)}catch(t){}l=null},1)}t.callEvent("onClick",[this.idd.replace(t.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(t){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){t.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};t.base.appendChild(this.obj);this.enableItem=function(){t._enableItem(this)};this.disableItem=function(){t._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(e){t._setItemText(this,e)};this.getItemText=function(){return t._getItemText(this)};this.setItemImage=function(e){t._setItemImage(this,e,true)};this.clearItemImage=function(){t._clearItemImage(this,true)};this.setItemImageDis=function(e){t._setItemImage(this,e,false)};this.clearItemImageDis=function(){t._clearItemImage(this,false)};this.setItemToolTip=function(t){this.obj.title=t};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(t,e,i){this.id=t.idPrefix+e;this.state=i.enabled!=null?i.enabled=="true"?true:false:true;this.imgEn=i.img||"";this.imgDis=i.imgdis||"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.mode=i.mode||"button";if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!i.text||i.text.length==0)i.text=" "}else{this.openAll=window.dhx4.s2b(i.openAll)==true;this.renderSelect=i.renderSelect==null?true:window.dhx4.s2b(i.renderSelect)}this.maxOpen=!isNaN(i.maxOpen?i.maxOpen:"")?i.maxOpen:null;this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!t._sbw){var e=document.createElement("DIV");e.className="dhxtoolbar_maxopen_test";document.body.appendChild(e);var i=document.createElement("DIV");i.className="dhxtoolbar_maxopen_test2";e.appendChild(i);t._sbw=e.offsetWidth-i.offsetWidth;e.removeChild(i);i=null;document.body.removeChild(e);e=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=i.action||null;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=i.hidden!=null?"none":"";this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.idd=String(e);this.obj.title=i.title||"";this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=t._rtlParseBtn("",i.text!=null?"
"+(i.icon!=""?" ":"")+i.text+"
":"");t.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="
 
";this.arw.title=this.obj.title;this.arw.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};t.base.appendChild(this.arw);var n=this;this.obj.onmouseover=function(e){e=e||event;if(t.anyUsed!="none")return;if(!n.state)return;n.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){n.obj.allowClick=false;if(t.anyUsed!="none")return;if(!n.state)return;n.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw");n.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(e){e=e||event;if(!n.obj.allowClick)return;if(!n.state)return;if(t.anyUsed!="none")return;var i=n.obj.idd.replace(t.idPrefix,"");if(n.obj.extAction)try{window[n.obj.extAction](i)}catch(e){}t.callEvent("onClick",[i])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(e){e=e||event;if(t.anyUsed!="none")return;if(!n.state)return;n.obj.allowClick=true;n.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";n.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";n.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(e){e=e||event;e.cancelBubble=true;if(t.anyUsed!="none")return;if(!n.state)return;n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad){if(this.extAction){var i=this;window.setTimeout(function(){try{window[i.extAction](s)}catch(t){}i=null},1)}if(n.callEvent){var s=n.obj.idd.replace(t.idPrefix,"");t.callEvent("onClick",[s])}}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(e){e=e||event;var i=this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling;if(i._skip){e=e||event;e.cancelBubble=true}else{i._skip=true}i=null;if(!n.state)return;if(t.anyUsed==n.obj.idd){n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw");t.anyUsed="none";window.dhx4.zim.clear(n.polygon._idd);n.polygon.style.display="none";if(n.polygon._ie6cover)n.polygon._ie6cover.style.display="none";if(t.conf.skin=="dhx_terrace")t._improveTerraceButtonSelect(n.id,true);t.callEvent("onButtonSelectHide",[n.obj.idd])}else{if(t.anyUsed!="none"){if(t.objPull[t.idPrefix+t.anyUsed]["type"]=="buttonSelect"){var s=t.objPull[t.idPrefix+t.anyUsed];if(s.polygon.style.display!="none"){s.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";s.obj.className=s.obj.renderAs;s.arw.className=String(n.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(s.polygon._idd);s.polygon.style.display="none";if(s.polygon._ie6cover)s.polygon._ie6cover.style.display="none";if(t.conf.skin=="dhx_terrace")t._improveTerraceButtonSelect(s.id,true);t.callEvent("onButtonSelectHide",[s.obj.idd])}}}n.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";n.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";t.anyUsed=n.obj.idd;n.polygon.style.top="0px";n.polygon.style.visibility="hidden";n.polygon.style.zIndex=window.dhx4.zim.reserve(n.polygon._idd);n.polygon.style.display="";if(t.conf.skin=="dhx_terrace")t._improveTerraceButtonSelect(n.id,false);n._fixMaxOpenHeight(n.maxOpen||null);t._autoDetectVisibleArea();var l=window.dhx4.absTop(n.obj)+n.obj.offsetHeight+t.conf.sel_ofs_y;var o=n.polygon.offsetHeight;if(l+o>t.tY2){var a=n.maxOpen!=null?Math.floor((t.tY2-l)/22):0;if(a>=1){n._fixMaxOpenHeight(a)}else{l=window.dhx4.absTop(n.obj)-o-t.conf.sel_ofs_y;if(l<0)l=0}}n.polygon.style.top=l+"px";if(t.rtl){n.polygon.style.left=window.dhx4.absLeft(n.obj)+n.obj.offsetWidth-n.polygon.offsetWidth+t.conf.sel_ofs_x+"px"}else{var r=document.body.scrollLeft;var h=r+(window.innerWidth||document.body.clientWidth);var d=window.dhx4.absLeft(n.obj)+t.conf.sel_ofs_x;if(d+n.polygon.offsetWidth>h)d=window.dhx4.absLeft(n.arw)+n.arw.offsetWidth-n.polygon.offsetWidth;n.polygon.style.left=Math.max(d,5)+"px"}n.polygon.style.visibility="visible";if(n.polygon._ie6cover){n.polygon._ie6cover.style.left=n.polygon.style.left;n.polygon._ie6cover.style.top=n.polygon.style.top;n.polygon._ie6cover.style.width=n.polygon.offsetWidth+"px";n.polygon._ie6cover.style.height=n.polygon.offsetHeight+"px";n.polygon._ie6cover.style.display=""}t.callEvent("onButtonSelectShow",[n.obj.idd])}return false};this.arw.onclick=function(t){t=t||event;t.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(t){t=t||event; -t.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=t.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(e){var i="auto";var s=false;if(e!==null){var l=0;for(var o in this._listOptions)l++;if(l>e){this._ph=22*e;i=this._ph+"px"}else{s=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!s&&n.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+t._sbw+"px";this.polygon.style.height=i}};this._separatorButtonSelectObject=function(t,e,i){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};if(isNaN(i))i=n.p_tbody.childNodes.length+1;else if(i<1)i=1;if(i>n.p_tbody.childNodes.length)n.p_tbody.appendChild(this.obj.tr);else n.p_tbody.insertBefore(this.obj.tr,n.p_tbody.childNodes[i-1]);this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td.appendChild(this.obj.sep);n._listOptions[t]=this.obj;return this};this._buttonButtonSelectObject=function(e,i,s){var l=true;if(typeof i.enabled!="undefined"){l=window.dhx4.s2b(i.enabled)}else if(typeof i.disabled!="undefined"){l=window.dhx4.s2b(i.disabled)}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=l;this.obj.tr.extAction=i.action||null;this.obj.tr._selected=i.selected!=null;this.obj.tr.className="tr_btn"+(this.obj.tr.en?this.obj.tr._selected&&n.renderSelect?" tr_btn_selected":"":" tr_btn_disabled");this.obj.tr.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.tr.idd=String(e);if(isNaN(s))s=n.p_tbody.childNodes.length+1;else if(s<1)s=1;if(s>n.p_tbody.childNodes.length)n.p_tbody.appendChild(this.obj.tr);else n.p_tbody.insertBefore(this.obj.tr,n.p_tbody.childNodes[s-1]);this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};if(t.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(i.img!=null){this.obj.td_a.innerHTML="";this.obj.tr._img=i.img}else{this.obj.td_a.innerHTML=" "}if(i.icon!=null){this.obj.td_a.innerHTML=''}var o=i.text!=null?i.text:i.itemText||"";this.obj.td_b.innerHTML="
"+o+"
";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||this._selected&&n.renderSelect)return;this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en)return;if(this._selected&&n.renderSelect){if(String(this.className).search("tr_btn_selected")==-1)this.className="tr_btn tr_btn_selected"}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(e){e=e||event;e.cancelBubble=true;if(!this.en)return;n.setListOptionSelected(this.idd.replace(t.idPrefix,""));n.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(n.polygon._idd);n.polygon.style.display="none";if(n.polygon._ie6cover)n.polygon._ie6cover.style.display="none";if(t.conf.skin=="dhx_terrace")t._improveTerraceButtonSelect(n.id,true);t.anyUsed="none";t.callEvent("onButtonSelectHide",[n.obj.idd]);var i=this.idd.replace(t.idPrefix,"");if(this.extAction)try{window[this.extAction](i)}catch(e){}t.callEvent("onClick",[i])};n._listOptions[e]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+t.conf.skin+" dhxtoolbar_icons_"+t.conf.iconSize;this.polygon.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.polygon.onmousedown=function(t){t=t||event;t.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;t.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(i.options!=null){for(var s=0;s0)e.td_a.removeChild(e.td_a.childNodes[0]);while(e.td_b.childNodes.length>0)e.td_b.removeChild(e.td_b.childNodes[0]);e.tr.onselectstart=null;e.tr.onmouseover=null;e.tr.onmouseout=null;e.tr.onclick=null;while(e.tr.childNodes.length>0)e.tr.removeChild(e.tr.childNodes[0]);e.tr.parentNode.removeChild(e.tr);e.td_a=null;e.td_b=null;e.tr=null}else{e.sep.onselectstart=null;e.td.onselectstart=null;e.tr.onselectstart=null;while(e.td.childNodes.length>0)e.td.removeChild(e.td.childNodes[0]);while(e.tr.childNodes.length>0)e.tr.removeChild(e.tr.childNodes[0]);e.tr.parentNode.removeChild(e.tr);e.sep=null;e.td=null;e.tr=null}e=null;this._listOptions[t]=null;try{delete this._listOptions[t]}catch(i){}};this.showListOption=function(t){if(!this._isListButton(t,true))return;this._listOptions[t].tr.style.display=""};this.hideListOption=function(t){if(!this._isListButton(t,true))return;this._listOptions[t].tr.style.display="none"};this.isListOptionVisible=function(t){if(!this._isListButton(t,true))return;return this._listOptions[t].tr.style.display!="none"};this.enableListOption=function(e){if(!this._isListButton(e))return;this._listOptions[e].tr.en=true;this._listOptions[e].tr.className="tr_btn"+(this._listOptions[e].tr._selected&&t.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(t){if(!this._isListButton(t))return;this._listOptions[t].tr.en=false;this._listOptions[t].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(t){if(!this._isListButton(t))return;return this._listOptions[t].tr.en};this.setListOptionPosition=function(t,e){if(!this._listOptions[t]||this.getListOptionPosition(t)==e||isNaN(e))return;if(e<1)e=1;var i=this._listOptions[t].tr;this.p_tbody.removeChild(i);if(e>this.p_tbody.childNodes.length)this.p_tbody.appendChild(i);else this.p_tbody.insertBefore(i,this.p_tbody.childNodes[e-1]);i=null};this.getListOptionPosition=function(t){var e=-1;if(!this._listOptions[t])return e;for(var i=0;i";n=null};this.getListOptionImage=function(e){if(!this._isListButton(e))return;var i=this._listOptions[e].tr.childNodes[t.rtl?1:0];var n=null;if(i.childNodes.length>0)n=i.childNodes[0].src;i=null;return n};this.clearListOptionImage=function(e){if(!this._isListButton(e))return;var i=this._listOptions[e].tr.childNodes[t.rtl?1:0];while(i.childNodes.length>0)i.removeChild(i.childNodes[0]);i.innerHTML=" ";i=null};this.setListOptionText=function(e,i){if(!this._isListButton(e))return;this._listOptions[e].tr.childNodes[t.rtl?0:1].childNodes[0].innerHTML=i};this.getListOptionText=function(e){if(!this._isListButton(e))return;return this._listOptions[e].tr.childNodes[t.rtl?0:1].childNodes[0].innerHTML};this.setListOptionToolTip=function(t,e){if(!this._isListButton(t))return;this._listOptions[t].tr.title=e};this.getListOptionToolTip=function(t){if(!this._isListButton(t))return;return this._listOptions[t].tr.title};this.forEachListOption=function(t){for(var e in this._listOptions)t(e)};this.getAllListOptions=function(){var t=new Array;for(var e in this._listOptions)t[t.length]=e;return t};this.setListOptionSelected=function(t){for(var e in this._listOptions){var i=this._listOptions[e];if(i.td_a!=null&&i.td_b!=null&&i.tr.en){if(e==t){i.tr._selected=true;i.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(i.tr._img)this.setItemImage(i.tr._img);else this.clearItemImage();this.setItemText(this.getListOptionText(t))}}else{i.tr._selected=false;i.tr.className="tr_btn"}}i=null}};this.getListOptionSelected=function(){var t=null;for(var e in this._listOptions)if(this._listOptions[e].tr._selected==true)t=e;return t};this._isListButton=function(t,e){if(this._listOptions[t]==null)return false;if(!e&&this._listOptions[t].tr.className=="tr_sep")return false;return true};this.setMaxOpen=function(t){this._ph=null;if(typeof t=="number"){this.maxOpen=t;this._maxOpenTest();return}this.maxOpen=null};if(i.width)this.setWidth(i.width);if(this.mode=="select"&&typeof i.selected!="undefined")this.setListOptionSelected(i.selected);return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(t,e,i){this.id=t.idPrefix+e;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=i.hidden!=null?"none":"";this.obj.idd=String(e);this.obj.w=i.width!=null?i.width:100;this.obj.title=i.title!=null?i.title:"";this.obj.innerHTML="";var n=t;var s=this;this.obj.childNodes[0].onkeydown=function(t){t=t||event;if(t.keyCode==13){n.callEvent("onEnter",[s.obj.idd,this.value])}};t.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return!this.obj.childNodes[0].disabled};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display!="none"};this.setValue=function(t){this.obj.childNodes[0].value=t};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(t){this.obj.w=t;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(t){this.obj.title=t};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof i.enabled!="undefined"&&window.dhx4.s2b(i.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(t,e,i){this.id=t.idPrefix+e;this.state=i.enabled!=null?false:true;this.imgEn=i.img!=null?i.img:"";this.imgDis=i.imgdis!=null?i.imgdis:"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.obj=document.createElement("DIV");this.obj.pressed=i.selected!=null;this.obj.extAction=i.action||null;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):this.state?"def":"dis");this.obj.style.display=i.hidden!=null?"none":"";this.obj.renderAs=this.obj.className;this.obj.idd=String(e);this.obj.title=i.title||"";if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=t._rtlParseBtn(this.img!=""?"":"",i.text!=null?"
"+i.text+"
":"");t.base.appendChild(this.obj);var n=this;this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(n.state==false)return;if(t.anyUsed!="none")return;if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(n.state==false)return;if(t.anyUsed!="none")return;if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(e){if(t.checkEvent("onBeforeStateChange"))if(!t.callEvent("onBeforeStateChange",[this.idd.replace(t.idPrefix,""),this.pressed]))return;if(n.state==false)return;if(t.anyUsed!="none")return;this.pressed=!this.pressed;this.className=this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs;var i=this.idd.replace(t.idPrefix,"");if(this.extAction)try{window[this.extAction](i,this.pressed)}catch(e){}t.callEvent("onStateChange",[i,this.pressed]);return false};this.setItemState=function(e,i){if(this.obj.pressed!=e){if(e==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(i==true){var n=this.obj.idd.replace(t.idPrefix,"");if(this.obj.extAction)try{window[this.obj.extAction](n,this.obj.pressed)}catch(s){}t.callEvent("onStateChange",[n,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){t._enableItem(this)};this.disableItem=function(){t._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(e){t._setItemText(this,e)};this.getItemText=function(){return t._getItemText(this)};this.setItemImage=function(e){t._setItemImage(this,e,true)};this.clearItemImage=function(){t._clearItemImage(this,true)};this.setItemImageDis=function(e){t._setItemImage(this,e,false)};this.clearItemImageDis=function(){t._clearItemImage(this,false)};this.setItemToolTip=function(t){this.obj.title=t};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(t,e,i){this.id=t.idPrefix+e;this.state=i.enabled!=null?i.enabled=="true"?true:false:true;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=i.hidden!=null?"none":"";this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.idd=String(e);this.obj.len=i.length!=null?Number(i.length):50;this.obj.innerHTML="
"+(i.textMin||"")+"
"+"
"+"
"+"
"+"
"+(i.textMax||"")+"
";t.base.appendChild(this.obj);var n=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var s=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+t.conf.skin+(t.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=i.toolTip||"%v";this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var l=this.label;this.pen.valueMin=i.valueMin!=null?Number(i.valueMin):0;this.pen.valueMax=i.valueMax!=null?Number(i.valueMax):100;if(this.pen.valueMin>this.pen.valueMax)this.pen.valueMin=this.pen.valueMax;this.pen.valueNow=i.valueNow!=null?Number(i.valueNow):this.pen.valueMax;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;if(this.pen.valueNowwindow.dhx4.absLeft(s)+Math.round(s.offsetWidth/2)&&s.nowX==s.maxX)return;s.newNowX=s.nowX+i;if(s.newNowXs.maxX)s.newNowX=s.maxX;s.nowX=s.newNowX;s.style.left=s.nowX+"px";s.initXY=e;s.newValueNow=Math.round((s.valueMax-s.valueMin)*(s.newNowX-s.minX)/(s.maxX-s.minX)+s.valueMin);if(l.tip!=""){l.innerHTML=l.tip.replace(/%v/gi,s.newValueNow);l.style.left=Math.round(window.dhx4.absLeft(s)+s.offsetWidth/2-l.offsetWidth/2)+"px";l.style.top=window.dhx4.absTop(s)-l.offsetHeight-3+"px"}t.cancelBubble=true;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.pen._doOnMouseMoveEnd=function(){if(!s.allowMove)return;s.className="dhxtoolbar_sl_pen";s.allowMove=false;s.nowX=s.newNowX;s.valueNow=s.newValueNow;if(l.tip!=""){l.style.display="none";window.dhx4.zim.clear(l._zi)}t.callEvent("onValueChange",[n.obj.idd.replace(t.idPrefix,""),s.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",s._doOnMouseMoveStart,false);document.addEventListener("touchend",s._doOnMouseMoveEnd,false)}else{if(typeof window.addEventListener!="undefined"){window.addEventListener("mousemove",s._doOnMouseMoveStart,false);window.addEventListener("mouseup",s._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",s._doOnMouseMoveStart);document.body.attachEvent("onmouseup",s._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state)return;this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state)return;this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setValue=function(e,i){e=Number(e);if(ethis.pen.valueMax)e=this.pen.valueMax;this.pen.valueNow=e;this.pen._definePos();if(i==true)t.callEvent("onValueChange",[this.obj.idd.replace(t.idPrefix,""),this.pen.valueNow])};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(t,e){t=Number(t);if(t>this.pen.valueMax)return;this.obj.childNodes[0].innerHTML=e;this.obj.childNodes[0].style.display=e.length>0?"":"none";this.pen.valueMin=t;if(this.pen.valueNow0?"":"none";this.pen.valueMax=t;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var t=this.obj.childNodes[0].innerHTML;var e=this.pen.valueMin;return new Array(e,t)};this.getMaxValue=function(){var t=this.obj.childNodes[4].innerHTML;var e=this.pen.valueMax;return new Array(e,t)};this.setItemToolTipTemplate=function(t){this.label.tip=t};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof window.addEventListener=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0)this.base.removeChild(this.base.childNodes[0]);this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0)this.cont.removeChild(this.cont.childNodes[0]);this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var t=window.dhx4.screenDim();this.tX1=t.left;this.tX2=t.right;this.tY1=t.top;this.tY2=t.bottom};dhtmlXToolbarObject.prototype._initObj=function(t){for(var e=0;ee){this._ph=22*e;i=this._ph+"px"}else{s=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!s&&n.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+t._sbw+"px";this.polygon.style.height=i}};this._separatorButtonSelectObject=function(t,e,i){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};if(isNaN(i))i=n.p_tbody.childNodes.length+1;else if(i<1)i=1;if(i>n.p_tbody.childNodes.length)n.p_tbody.appendChild(this.obj.tr);else n.p_tbody.insertBefore(this.obj.tr,n.p_tbody.childNodes[i-1]);this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td.appendChild(this.obj.sep);n._listOptions[t]=this.obj;return this};this._buttonButtonSelectObject=function(e,i,s){var l=true;if(typeof i.enabled!="undefined"){l=window.dhx4.s2b(i.enabled)}else if(typeof i.disabled!="undefined"){l=window.dhx4.s2b(i.disabled)}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=l;this.obj.tr.extAction=i.action||null;this.obj.tr._selected=i.selected!=null;this.obj.tr.className="tr_btn"+(this.obj.tr.en?this.obj.tr._selected&&n.renderSelect?" tr_btn_selected":"":" tr_btn_disabled");this.obj.tr.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.tr.idd=String(e);if(isNaN(s))s=n.p_tbody.childNodes.length+1;else if(s<1)s=1;if(s>n.p_tbody.childNodes.length)n.p_tbody.appendChild(this.obj.tr);else n.p_tbody.insertBefore(this.obj.tr,n.p_tbody.childNodes[s-1]);this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};if(t.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(i.img!=null){this.obj.td_a.innerHTML="";this.obj.tr._img=i.img}else{this.obj.td_a.innerHTML=" "}if(i.icon!=null){this.obj.td_a.innerHTML=''}var o=i.text!=null?i.text:i.itemText||"";this.obj.td_b.innerHTML="
"+o+"
";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||this._selected&&n.renderSelect)return;this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en)return;if(this._selected&&n.renderSelect){if(String(this.className).search("tr_btn_selected")==-1)this.className="tr_btn tr_btn_selected"}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(e){e=e||event;e.cancelBubble=true;if(!this.en)return;n.setListOptionSelected(this.idd.replace(t.idPrefix,""));n.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";n.obj.className=n.obj.renderAs;n.arw.className=String(n.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(n.polygon._idd);n.polygon.style.display="none";if(n.polygon._ie6cover)n.polygon._ie6cover.style.display="none";if(t.conf.skin=="dhx_terrace")t._improveTerraceButtonSelect(n.id,true);t.anyUsed="none";t.callEvent("onButtonSelectHide",[n.obj.idd]);var i=this.idd.replace(t.idPrefix,"");if(this.extAction)try{window[this.extAction](i)}catch(e){}t.callEvent("onClick",[i])};n._listOptions[e]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+t.conf.skin+" dhxtoolbar_icons_"+t.conf.iconSize;this.polygon.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.polygon.onmousedown=function(t){t=t||event;t.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false;t.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(i.options!=null){for(var s=0;s0)e.td_a.removeChild(e.td_a.childNodes[0]);while(e.td_b.childNodes.length>0)e.td_b.removeChild(e.td_b.childNodes[0]);e.tr.onselectstart=null;e.tr.onmouseover=null;e.tr.onmouseout=null;e.tr.onclick=null;while(e.tr.childNodes.length>0)e.tr.removeChild(e.tr.childNodes[0]);e.tr.parentNode.removeChild(e.tr);e.td_a=null;e.td_b=null;e.tr=null}else{e.sep.onselectstart=null;e.td.onselectstart=null;e.tr.onselectstart=null;while(e.td.childNodes.length>0)e.td.removeChild(e.td.childNodes[0]);while(e.tr.childNodes.length>0)e.tr.removeChild(e.tr.childNodes[0]);e.tr.parentNode.removeChild(e.tr);e.sep=null;e.td=null;e.tr=null}e=null;this._listOptions[t]=null;try{delete this._listOptions[t]}catch(i){}};this.showListOption=function(t){if(!this._isListButton(t,true))return;this._listOptions[t].tr.style.display=""};this.hideListOption=function(t){if(!this._isListButton(t,true))return;this._listOptions[t].tr.style.display="none"};this.isListOptionVisible=function(t){if(!this._isListButton(t,true))return;return this._listOptions[t].tr.style.display!="none"};this.enableListOption=function(e){if(!this._isListButton(e))return;this._listOptions[e].tr.en=true;this._listOptions[e].tr.className="tr_btn"+(this._listOptions[e].tr._selected&&t.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(t){if(!this._isListButton(t))return;this._listOptions[t].tr.en=false;this._listOptions[t].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(t){if(!this._isListButton(t))return;return this._listOptions[t].tr.en};this.setListOptionPosition=function(t,e){if(!this._listOptions[t]||this.getListOptionPosition(t)==e||isNaN(e))return;if(e<1)e=1;var i=this._listOptions[t].tr;this.p_tbody.removeChild(i);if(e>this.p_tbody.childNodes.length)this.p_tbody.appendChild(i);else this.p_tbody.insertBefore(i,this.p_tbody.childNodes[e-1]);i=null};this.getListOptionPosition=function(t){var e=-1;if(!this._listOptions[t])return e;for(var i=0;i";n=null};this.getListOptionImage=function(e){if(!this._isListButton(e))return;var i=this._listOptions[e].tr.childNodes[t.rtl?1:0];var n=null;if(i.childNodes.length>0)n=i.childNodes[0].src;i=null;return n};this.clearListOptionImage=function(e){if(!this._isListButton(e))return;var i=this._listOptions[e].tr.childNodes[t.rtl?1:0];while(i.childNodes.length>0)i.removeChild(i.childNodes[0]);i.innerHTML=" ";i=null};this.setListOptionText=function(e,i){if(!this._isListButton(e))return;this._listOptions[e].tr.childNodes[t.rtl?0:1].childNodes[0].innerHTML=i};this.getListOptionText=function(e){if(!this._isListButton(e))return;return this._listOptions[e].tr.childNodes[t.rtl?0:1].childNodes[0].innerHTML};this.setListOptionToolTip=function(t,e){if(!this._isListButton(t))return;this._listOptions[t].tr.title=e};this.getListOptionToolTip=function(t){if(!this._isListButton(t))return;return this._listOptions[t].tr.title};this.forEachListOption=function(t){for(var e in this._listOptions)t(e)};this.getAllListOptions=function(){var t=new Array;for(var e in this._listOptions)t[t.length]=e;return t};this.setListOptionSelected=function(t){for(var e in this._listOptions){var i=this._listOptions[e];if(i.td_a!=null&&i.td_b!=null&&i.tr.en){if(e==t){i.tr._selected=true;i.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(i.tr._img)this.setItemImage(i.tr._img);else this.clearItemImage();this.setItemText(this.getListOptionText(t))}}else{i.tr._selected=false;i.tr.className="tr_btn"}}i=null}};this.getListOptionSelected=function(){var t=null;for(var e in this._listOptions)if(this._listOptions[e].tr._selected==true)t=e;return t};this._isListButton=function(t,e){if(this._listOptions[t]==null)return false;if(!e&&this._listOptions[t].tr.className=="tr_sep")return false;return true};this.setMaxOpen=function(t){this._ph=null;if(typeof t=="number"){this.maxOpen=t;this._maxOpenTest();return}this.maxOpen=null};if(i.width)this.setWidth(i.width);if(this.mode=="select"&&typeof i.selected!="undefined")this.setListOptionSelected(i.selected);return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(t,e,i){this.id=t.idPrefix+e;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=i.hidden!=null?"none":"";this.obj.idd=String(e);this.obj.w=i.width!=null?i.width:100;this.obj.title=i.title!=null?i.title:"";this.obj.innerHTML="";var n=t;var s=this;this.obj.childNodes[0].onkeydown=function(t){t=t||event;if(t.keyCode==13){n.callEvent("onEnter",[s.obj.idd,this.value])}};t.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return!this.obj.childNodes[0].disabled};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display!="none"};this.setValue=function(t){this.obj.childNodes[0].value=t};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(t){this.obj.w=t;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(t){this.obj.title=t};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof i.enabled!="undefined"&&window.dhx4.s2b(i.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(t,e,i){this.id=t.idPrefix+e;this.state=i.enabled!=null?false:true;this.imgEn=i.img!=null?i.img:"";this.imgDis=i.imgdis!=null?i.imgdis:"";this.img=this.state?this.imgEn!=""?this.imgEn:"":this.imgDis!=""?this.imgDis:"";this.obj=document.createElement("DIV");this.obj.pressed=i.selected!=null;this.obj.extAction=i.action||null;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):this.state?"def":"dis");this.obj.style.display=i.hidden!=null?"none":"";this.obj.renderAs=this.obj.className;this.obj.idd=String(e);this.obj.title=i.title||"";if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=t._rtlParseBtn(this.img!=""?"":"",i.text!=null?"
"+(i.icon!=""?" ":"")+i.text+"
":"");t.base.appendChild(this.obj);var n=this;this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(n.state==false)return;if(t.anyUsed!="none")return;if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(n.state==false)return;if(t.anyUsed!="none")return;if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(e){if(t.checkEvent("onBeforeStateChange"))if(!t.callEvent("onBeforeStateChange",[this.idd.replace(t.idPrefix,""),this.pressed]))return;if(n.state==false)return;if(t.anyUsed!="none")return;this.pressed=!this.pressed;this.className=this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs;var i=this.idd.replace(t.idPrefix,"");if(this.extAction)try{window[this.extAction](i,this.pressed)}catch(e){}t.callEvent("onStateChange",[i,this.pressed]);return false};this.setItemState=function(e,i){if(this.obj.pressed!=e){if(e==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(i==true){var n=this.obj.idd.replace(t.idPrefix,"");if(this.obj.extAction)try{window[this.obj.extAction](n,this.obj.pressed)}catch(s){}t.callEvent("onStateChange",[n,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){t._enableItem(this)};this.disableItem=function(){t._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setItemText=function(e){t._setItemText(this,e)};this.getItemText=function(){return t._getItemText(this)};this.setItemImage=function(e){t._setItemImage(this,e,true)};this.clearItemImage=function(){t._clearItemImage(this,true)};this.setItemImageDis=function(e){t._setItemImage(this,e,false)};this.clearItemImageDis=function(){t._clearItemImage(this,false)};this.setItemToolTip=function(t){this.obj.title=t};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(t,e,i){this.id=t.idPrefix+e;this.state=i.enabled!=null?i.enabled=="true"?true:false:true;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=i.hidden!=null?"none":"";this.obj.onselectstart=function(t){t=t||event;if(t.preventDefault)t.preventDefault();else t.returnValue=false};this.obj.idd=String(e);this.obj.len=i.length!=null?Number(i.length):50;this.obj.innerHTML="
"+(i.textMin||"")+"
"+"
"+"
"+"
"+"
"+(i.textMax||"")+"
";t.base.appendChild(this.obj);var n=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var s=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+t.conf.skin+(t.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=i.toolTip||"%v";this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var l=this.label;this.pen.valueMin=i.valueMin!=null?Number(i.valueMin):0;this.pen.valueMax=i.valueMax!=null?Number(i.valueMax):100;if(this.pen.valueMin>this.pen.valueMax)this.pen.valueMin=this.pen.valueMax;this.pen.valueNow=i.valueNow!=null?Number(i.valueNow):this.pen.valueMax;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;if(this.pen.valueNowwindow.dhx4.absLeft(s)+Math.round(s.offsetWidth/2)&&s.nowX==s.maxX)return;s.newNowX=s.nowX+i;if(s.newNowXs.maxX)s.newNowX=s.maxX;s.nowX=s.newNowX;s.style.left=s.nowX+"px";s.initXY=e;s.newValueNow=Math.round((s.valueMax-s.valueMin)*(s.newNowX-s.minX)/(s.maxX-s.minX)+s.valueMin);if(l.tip!=""){l.innerHTML=l.tip.replace(/%v/gi,s.newValueNow);l.style.left=Math.round(window.dhx4.absLeft(s)+s.offsetWidth/2-l.offsetWidth/2)+"px";l.style.top=window.dhx4.absTop(s)-l.offsetHeight-3+"px"}t.cancelBubble=true;if(t.preventDefault)t.preventDefault();else t.returnValue=false;return false};this.pen._doOnMouseMoveEnd=function(){if(!s.allowMove)return;s.className="dhxtoolbar_sl_pen";s.allowMove=false;s.nowX=s.newNowX;s.valueNow=s.newValueNow;if(l.tip!=""){l.style.display="none";window.dhx4.zim.clear(l._zi)}t.callEvent("onValueChange",[n.obj.idd.replace(t.idPrefix,""),s.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",s._doOnMouseMoveStart,false);document.addEventListener("touchend",s._doOnMouseMoveEnd,false)}else{if(typeof window.addEventListener!="undefined"){window.addEventListener("mousemove",s._doOnMouseMoveStart,false);window.addEventListener("mouseup",s._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",s._doOnMouseMoveStart);document.body.attachEvent("onmouseup",s._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state)return;this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state)return;this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return this.obj.style.display==""};this.setValue=function(e,i){e=Number(e);if(ethis.pen.valueMax)e=this.pen.valueMax;this.pen.valueNow=e;this.pen._definePos();if(i==true)t.callEvent("onValueChange",[this.obj.idd.replace(t.idPrefix,""),this.pen.valueNow])};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(t,e){t=Number(t);if(t>this.pen.valueMax)return;this.obj.childNodes[0].innerHTML=e;this.obj.childNodes[0].style.display=e.length>0?"":"none";this.pen.valueMin=t;if(this.pen.valueNow0?"":"none";this.pen.valueMax=t;if(this.pen.valueNow>this.pen.valueMax)this.pen.valueNow=this.pen.valueMax;this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var t=this.obj.childNodes[0].innerHTML;var e=this.pen.valueMin;return new Array(e,t)};this.getMaxValue=function(){var t=this.obj.childNodes[4].innerHTML;var e=this.pen.valueMax;return new Array(e,t)};this.setItemToolTipTemplate=function(t){this.label.tip=t};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof window.addEventListener=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0)this.base.removeChild(this.base.childNodes[0]);this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0)this.cont.removeChild(this.cont.childNodes[0]);this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var t=window.dhx4.screenDim();this.tX1=t.left;this.tX2=t.right;this.tY1=t.top;this.tY2=t.bottom};dhtmlXToolbarObject.prototype._initObj=function(t){for(var e=0;e=0&&t[n][s-1]!=null&&e[t[n][s-1].type])r=true}o.node.style.borderRightWidth=a?"1px":"0px";o.node.style.borderTopRightRadius=o.node.style.borderBottomRightRadius=a?this.conf.terrace_radius:"0px";if(o.type=="buttonSelect"){o.node.previousSibling.style.borderTopLeftRadius=o.node.previousSibling.style.borderBottomLeftRadius=r?this.conf.terrace_radius:"0px";o.node.previousSibling._br=a;o.node.previousSibling._bl=r}else{o.node.style.borderTopLeftRadius=o.node.style.borderBottomLeftRadius=r?this.conf.terrace_radius:"0px"}o.node._br=a;o.node._bl=r}}for(var n=0;n0){this.base.removeChild(this.base.childNodes[0])}var h=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(h=="relative"||h=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);this.cBlock=document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe";this.editor.frameBorder=0;if(window.dhx4.isOpera){this.editor.scrolling="yes"}this.setSizes();var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var l=0;l")}else{if(window.dhx4.isKHTML){l.write("")}else{if(window.dhx4.isIE){l.write("")}else{l.write("")}}}l.close();if(window.dhx4.isIE){l.contentEditable=(q!==true)}else{l.designMode=(q!==true?"On":"Off")}if(window.dhx4.isFF){try{l.execCommand("useCSS",false,true)}catch(o){}}if(n===true&&this.setContent!=null){this.setContent(m)}};this._prepareContent();this._doOnResize=function(){window.clearTimeout(c.conf.resizeTM);c.conf.resizeTM=window.setTimeout(function(){if(c.setSizes){c.setSizes()}},c.conf.resizeTMTime)};this._runCommand=function(n,q){if(this.conf.roMode===true){return}if(arguments.length<2){q=null}if(window.dhx4.isIE){this.edWin.focus()}try{var m=this.editor.contentWindow.document;m.execCommand(n,false,q)}catch(o){}if(window.dhx4.isIE){this.edWin.focus();var l=this;window.setTimeout(function(){l.edWin.focus();l=null},1)}};this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.clearFormatting=function(){this._runCommand("RemoveFormat");var l=this.getContent();l=l.replace(/<\/?h\d>/gi,"");this.setContent(l)};this._doOnClick=function(n){var m=n||window.event;var l=m.target||m.srcElement;c._showInfo(l)};this._doOnMouseDown=function(n){var m=n||window.event;var l=m.target||m.srcElement;c._showInfo(l)};this._doOnKeyUp=function(o){var n=o||window.event;var l=n.keyCode;var m=n.target||n.srcElement;if({37:1,38:1,39:1,40:1,13:1}[l]==1){c._showInfo(m)}};this._getParentByTag=function(l,n){n=n.toLowerCase();var m=l;do{if(n==""||m.nodeName.toLowerCase()==n){return m}}while(m=m.parentNode);return l};this._isStyleProperty=function(m,q,l,o){q=q.toLowerCase();var r=m;do{if((r.nodeName.toLowerCase()==q)&&(r.style[l]==o)){return true}}while(r=r.parentNode);return false};this._setStyleProperty=function(l,o){this.style[o]=false;var m=this._getParentByTag(l,o);if(m&&(m.tagName.toLowerCase()==o)){this.style[o]=true}if(o=="del"&&this._getParentByTag(l,"strike")&&this._getParentByTag(l,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(m){var m=(this._getSelectionBounds().end)?this._getSelectionBounds().end:m;if(!m||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var l=this.edWin.getComputedStyle(m,null);var n=((l.getPropertyValue("font-weight")==401)?700:l.getPropertyValue("font-weight"));this.style={fontStyle:l.getPropertyValue("font-style"),fontSize:l.getPropertyValue("font-size"),textDecoration:l.getPropertyValue("text-decoration"),fontWeight:n,fontFamily:l.getPropertyValue("font-family"),textAlign:l.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=l.getPropertyValue("font-style");this.style.vAlign=l.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(m,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(m,"span","textDecoration","underline")}}else{var l=m.currentStyle;this.style={fontStyle:l.fontStyle,fontSize:l.fontSize,textDecoration:l.textDecoration,fontWeight:l.fontWeight,fontFamily:l.fontFamily,textAlign:l.textAlign}}this._setStyleProperty(m,"h1");this._setStyleProperty(m,"h2");this._setStyleProperty(m,"h3");this._setStyleProperty(m,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(m,"del");this._setStyleProperty(m,"sub");this._setStyleProperty(m,"sup");this._setStyleProperty(m,"u")}this.callEvent("onFocusChanged",[this.style,l])}catch(o){return null}};this._getSelectionBounds=function(){var q,n,s,m;if(this.edWin.getSelection){var r=this.edWin.getSelection();if(window.dhx4.isEdge&&r.rangeCount==0){return{root:null,start:null,end:null}}q=r.getRangeAt(r.rangeCount-1);s=q.startContainer;m=q.endContainer;n=q.commonAncestorContainer;if(s.nodeName=="#text"){n=n.parentNode}if(s.nodeName=="#text"){s=s.parentNode}if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(m.nodeName=="#text"){m=m.parentNode}if(m.nodeName.toLowerCase()=="body"){m=m.lastChild}if(s==m){n=s}return{root:n,start:s,end:m}}else{if(this.edWin.document.selection){q=this.edDoc.selection.createRange();if(!q.duplicate){return null}n=q.parentElement();var o=q.duplicate();var l=q.duplicate();o.collapse(true);l.moveToElementText(o.parentElement());l.setEndPoint("EndToStart",o);s=o.parentElement();o=q.duplicate();l=q.duplicate();l.collapse(false);o.moveToElementText(l.parentElement());o.setEndPoint("StartToEnd",l);m=l.parentElement();if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(m.nodeName.toLowerCase()=="body"){m=m.lastChild}if(s==m){n=s}return{root:n,start:s,end:m}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF){return this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,"")}if(window.dhx4.isIE&&this.edDoc.body.innerText.length==0){return""}return this.edDoc.body.innerHTML}};this.setContent=function(n){n=n||"";if(this.edDoc.body){var m=false;if(window.dhx4.isFF){var l=navigator.userAgent.match(/Firefox\/(\d*)/);m=(l!=null&&l[1]<28)}if(m){if(typeof(this.conf.ffTest)=="undefined"){this.editor.contentWindow.document.body.innerHTML="";this._runCommand("InsertHTML","test");this.conf.ffTest=(this.editor.contentWindow.document.body.innerHTML.length>0)}if(this.conf.ffTest){this.editor.contentWindow.document.body.innerHTML=n}else{this.editor.contentWindow.document.body.innerHTML="";if(n.length==0){n=" "}this._runCommand("InsertHTML",n)}}else{this.editor.contentWindow.document.body.innerHTML=n}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=n;this._onFirstLoad=function(){c.setContent(c.conf.firstLoadData);if(typeof(window.addEventListener)=="function"){c.edWin.removeEventListener("load",c._onFirstLoad,false)}else{c.edWin.detachEvent("onload",c._onFirstLoad)}c.conf.firstLoadData=null;c.conf.firstLoadEv=false;c._onFirstLoad=null};if(typeof(window.addEventListener)=="function"){this.edWin.addEventListener("load",this._onFirstLoad,false)}else{this.edWin.attachEvent("onload",this._onFirstLoad)}}}};this.setContentHTML=function(l){window.dhx4.ajax.get(l,function(m){if(m.xmlDoc.responseText!=null){c.setContent(m.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(l){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(l)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](l)}}});if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResize,false);this.edDoc.addEventListener("click",this._doOnClick,false);this.edDoc.addEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.addEventListener("mousedown",this._doOnMouseDown,false)}}else{window.attachEvent("onresize",this._doOnResize);this.edDoc.attachEvent("onclick",this._doOnClick);this.edDoc.attachEvent("onkeyup",this._doOnKeyUp)}this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResize,false);this.edDoc.removeEventListener("click",this._doOnClick,false);this.edDoc.removeEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.removeEventListener("mousedown",this._doOnMouseDown,false)}for(var l=0;l0){this.base.removeChild(this.base.childNodes[0])}this.base=null;this._doOnClick=null;this._doOnKeyUp=null;this._doOnMouseDown=null;this._ev=null;this._focus=null;this._prepareContent=null;this._doOnResize=null;this.setIconsPath=null;this.init=null;this.setSizes=null;this._runCommand=null;this.applyBold=null;this.applyItalic=null;this.applyUnderscore=null;this.clearFormatting=null;this._showInfo=null;this._getSelectionBounds=null;this.getContent=null;this.setContent=null;this.setContentHTML=null;this.setReadonly=null;this.isReadonly=null;this.unload=null;c=a=null};if(this.conf.toolbar==true&&typeof(this.attachToolbar)=="function"&&typeof(window.dhtmlXToolbarObject)=="function"){this.attachToolbar(this.conf.iconsPath);if(this.conf.iOSfix==true){this._doOnIOSFix=function(){c.editor.contentWindow.focus()};this.tb.cont.addEventListener("touchend",this._doOnIOSFix,false)}}this.setIconsPath=function(l){this.conf.iconsPath=l};if(this.conf.content.length>0){this.setContent(this.conf.content);this.conf.content=""}else{if(this.conf.contentHTML.length>0){this.setContentHTML(this.conf.contentHTML);this.conf.contentHTML=""}}return this}dhtmlXEditor.prototype.setSizes=function(){this.cell._setSize(0,0,this.base.clientWidth,this.base.clientHeight);if(this.editor!=null){this.editor.style.left="5px";this.editor.style.width=this.base.clientWidth-5+"px"}};dhtmlXEditor.prototype.setReadonly=function(a){this.conf.roMode=(a===true);this._prepareContent(true,this.conf.roMode);this.cBlock.style.display=(this.conf.roMode?"":"none")};dhtmlXEditor.prototype.isReadonly=function(a){return(this.conf.roMode||false)};dhtmlXEditor.prototype.setSkin=function(a){this.base.className=String(this.base.className).replace(new RegExp("dhxeditor_"+this.conf.skin),"dhxeditor_"+a);this.conf.skin=this.cell.conf.skin=a;if(this.tb){this.cell.detachToolbar(a);this.tb=null;this.attachToolbar()}this.setSizes()};window.dhtmlXEditorCell=function(e,a){dhtmlXCellObject.apply(this,[e,"_editor"]);var c=this;this.editor=a;this.conf.skin=this.editor.conf.skin;this.attachEvent("_onCellUnload",function(){this._stbUnload();this.editor=null;c=null});this._stbInit();return this};dhtmlXEditorCell.prototype=new dhtmlXCellObject();dhtmlXEditorCell.prototype._stbInit=function(){var l=this;var h=document.createElement("DIV");h.className="dhx_cell_stb";this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.cont]);h.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var g={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var e in g){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;h.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var m=document.createElement("DIV");m.className="dhx_cell_stb_button btn_"+e;m._actv=e.charAt(0);m._cmd=g[e];c.appendChild(m);m.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};m.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}l.editor[this._cmd]();l.editor.callEvent("onToolbarClick",[this._actv])};m=c=null}h=null;this._stbUnload=function(){var a=this.cell.childNodes[this.conf.idx.stb];a.onselectstart=null;while(a.childNodes.length>0){a.lastChild.onmousedown=a.lastChild.onclick=null;a.lastChild.firstChild.onmousedown=a.lastChild.firstChild.onclick=null;a.lastChild.firstChild._actv=a.lastChild.firstChild._cmd=null;a.lastChild.removeChild(a.lastChild.firstChild);a.removeChild(a.lastChild)}a.parentNode.removeChild(a);a=l=null;this.conf.idx_data.stb=this.conf.ofs_nodes.t._getStbHeight=null;delete this.conf.ofs_nodes.t._getStbHeight;delete this.conf.idx_data.stb;this._updateIdx()};this.conf.ofs_nodes.t._getStbHeight="func";this.conf.idx_data.stb="dhx_cell_stb";this._updateIdx()};dhtmlXEditorCell.prototype._stbHide=function(){this.cell.childNodes[this.conf.idx.stb].style.display="none"};dhtmlXEditorCell.prototype._getStbHeight=function(){return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var e=document.createElement("DIV");e.style.width="100%";e.style.height="100%";e.style.position="relative";e.style.overflow="hidden";this._attachObject(e);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=e;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);e=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)!="undefined"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var g=this.portal.attachEvent("onBeforeDrag",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].conf.editor_cont=this.cdata[h].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].dataObj.setContent(this.cdata[h].conf.editor_cont);this.cdata[h].dataObj._prepareContent(true);this.cdata[h].conf.editor_cont=null}});this.portal.conf.editor_ev=[g,c]}this.conf.editor_ev=this.attachEvent("_onBeforeContentDetach",function(){this.detachEvent(this.conf.editor_ev);this.conf.editor_ev=null;if(this instanceof window.dhtmlXPortalCell){var l=false;for(var h in this.portal.cdata){if(this.portal.cdata[h]!=this&&this.portal.cdata[h].dataType=="editor"){l=true}}if(l==false){for(var m=0;m]]>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var e in this._availSizes){this._xmlSizes+=''}this.tbXML='';this.tb.loadStruct(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",false);this.tb.setItemState("alignRight",false);this.tb.setItemState("alignJustify",false);this.tb.setItemState("alignLeft",false);if(a){this.tb.setItemState(a,true)}};this._checkH=function(a){this.tb.setItemState("applyH1",false);this.tb.setItemState("applyH2",false);this.tb.setItemState("applyH3",false);this.tb.setItemState("applyH4",false);if(a){this.tb.setItemState(a,true)}};this._doOnFocusChanged=function(n){if(!n.h1&&!n.h2&&!n.h3&&!n.h4){var a=(String(n.fontWeight).search(/bold/i)!=-1)||(Number(n.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var m="alignLeft";if(String(n.textAlign).search(/center/)!=-1){m="alignCenter"}if(String(n.textAlign).search(/right/)!=-1){m="alignRight"}if(String(n.textAlign).search(/justify/)!=-1){m="alignJustify"}this.tb.setItemState(m,true);this._checkAlign(m);this.tb.setItemState("applyH1",n.h1);this.tb.setItemState("applyH2",n.h2);this.tb.setItemState("applyH3",n.h3);this.tb.setItemState("applyH4",n.h4);if(window._KHTMLrv){n.sub=(n.vAlign=="sub");n.sup=(n.vAlign=="super")}this.tb.setItemState("applyItalic",(n.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",n.del);this.tb.setItemState("applySub",n.sub);this.tb.setItemState("applySuper",n.sup);this.tb.setItemState("applyUnderscore",n.u)};this._doOnToolbarClick=function(m){var a=String(m).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[m])}}};this._doOnStateChange=function(m,a){this[m]();switch(m){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(m);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(m);break}this.callEvent("onToolbarClick",[m])};this._doOnBeforeStateChange=function(m,a){if((m=="alignLeft"||m=="alignCenter"||m=="alignRight"||m=="alignJustify")&&a==true){return false}return true};var h=this;this.tb.attachEvent("onClick",function(a){h._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(m,a){h._doOnStateChange(m,a)});this.tb.attachEvent("onBeforeStateChange",function(m,a){return h._doOnBeforeStateChange(m,a)});this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.applyStrikethrough=function(){this._runCommand("StrikeThrough")};this.alignLeft=function(){this._runCommand("JustifyLeft")};this.alignRight=function(){this._runCommand("JustifyRight")};this.alignCenter=function(){this._runCommand("JustifyCenter")};this.alignJustify=function(){this._runCommand("JustifyFull")};this.applySub=function(){this._runCommand("Subscript")};this.applySuper=function(){this._runCommand("Superscript")};this.applyH1=function(){this._runCommand("FormatBlock","

")};this.applyH2=function(){this._runCommand("FormatBlock","

")};this.applyH3=function(){this._runCommand("FormatBlock","

")};this.applyH4=function(){this._runCommand("FormatBlock","

")};this.createNumList=function(){this._runCommand("InsertOrderedList")};this.createBulList=function(){this._runCommand("InsertUnorderedList")};this.increaseIndent=function(){this._runCommand("Indent")};this.decreaseIndent=function(){this._runCommand("Outdent")};this.clearFormatting=function(){this._runCommand("RemoveFormat");this.tb.setItemState("applyBold",false);this.tb.setItemState("applyItalic",false);this.tb.setItemState("applyStrikethrough",false);this.tb.setItemState("applySub",false);this.tb.setItemState("applySuper",false);this.tb.setItemState("applyUnderscore",false);var a=this.getContent();a=a.replace(/<\/?h\d>/gi,"");this.setContent(a)}};dhtmlx.Group={_init:function(){dhtmlx.assert(this.data,"DataStore required for grouping");this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){if(this._settings.group){this.group(this._settings.group,false)}},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this._settings.sort){a.block();a.sort(this._settings.sort);a.unblock()}},this));this.data.attachEvent("onClearAll",dhtmlx.bind(function(){this.data._not_grouped_order=this.data._not_grouped_pull=null},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(c,a){c.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false);this.block();this.clearAll();this.unblock()},a))},sum:function(c,a){c=dhtmlx.Template.setter(c);a=a||this.data;var e=0;a.each(function(g){e+=c(g)*1});return e},min:function(e,c){e=dhtmlx.Template.setter(e);c=c||this.data;var a=Infinity;c.each(function(g){if(e(g)*1a){a=e(g)*1}});return a},_split_data_by:function(l){var n=function(r,q){r=dhtmlx.Template.setter(r);return r(q[0])};var o=dhtmlx.Template.setter(l.by);if(!l.map[o]){l.map[o]=[o,n]}var e={};var m=[];this.data.each(function(q){var r=o(q);if(!e[r]){m.push({id:r});e[r]=dhtmlx.toArray()}e[r].push(q)});for(var a in l.map){var h=(l.map[a][1]||n);if(typeof h!="function"){h=this[h]}for(var g=0;g11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+dhtmlx.Date.to_fixed(date.getSeconds())+"';case"%W":return'"+dhtmlx.Date.to_fixed(dhtmlx.Date.getISOWeek(date))+"';default:return e}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(h,e){var l="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=h.match(/%[a-zA-Z]/g);for(var c=0;c50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":l+="set[3]=temp["+c+"]||0;";break;case"%i":l+="set[4]=temp["+c+"]||0;";break;case"%Y":l+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":l+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":l+="set[5]=temp["+c+"]||0;";break}}var g="set[0],set[1],set[2],set[3],set[4],set[5]";if(e){g=" Date.UTC("+g+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+l+" return new Date("+g+");")},getISOWeek:function(e){if(!e){return false}var c=e.getDay();if(c===0){c=7}var g=new Date(e.valueOf());g.setDate(e.getDate()+(4-c));var a=g.getFullYear();var l=Math.floor((g.getTime()-new Date(a,0,1).getTime())/86400000);var h=1+Math.floor(l/7);return h},getUTCISOWeek:function(a){return this.getISOWeek(a)}};dhtmlx.math={};dhtmlx.math._toHex=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(c,a){c=parseInt(c,10);str="";while(c>0){str=this._toHex[c%16]+str;c=Math.floor(c/16)}while(str.length255){h=0}if(e<0||e>255){e=0}if(a<0||a>255){a=0}return[h,e,a]};dhtmlx.math.hsvToRgb=function(m,y,w){var l,o,e,c,x,a,n,u;l=Math.floor((m/60))%6;o=m/60-l;e=w*(1-y);c=w*(1-o*y);x=w*(1-(1-o)*y);a=0;n=0;u=0;switch(l){case 0:a=w;n=x;u=e;break;case 1:a=c;n=w;u=e;break;case 2:a=e;n=w;u=x;break;case 3:a=e;n=c;u=w;break;case 4:a=x;n=e;u=w;break;case 5:a=w;n=e;u=c;break}a=Math.floor(a*255);n=Math.floor(n*255);u=Math.floor(u*255);return[a,n,u]};dhtmlx.math.rgbToHsv=function(c,n,o){var l,e,q,a,u,x,m,w;l=c/255;e=n/255;q=o/255;var a=Math.min(l,e,q);var u=Math.max(l,e,q);m=0;x=u==0?0:(1-a/u);w=u;if(u==a){m=0}else{if(u==l&&e>=q){m=60*(e-q)/(u-a)+0}else{if(u==l&&e")},addSector:function(a,q,o,m,h,e,g,l){var n=[];n.push(m);n.push(Math.floor(h*g));for(var c=q;c"+this._map.join("\n")+"";a._htmlmap=e;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(q,l,o,n,m,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var e=this._getLimits();var h=this._getLimits("h","xValue");if(!m){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}this._drawYAxis(this.canvases.y.getCanvas(),l,o,n,e.min,e.max);this._drawHXAxis(this.canvases.x.getCanvas(),l,o,n,h.min,h.max)}e={min:this._settings.yAxis.start,max:this._settings.yAxis.end};h={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(q,l,o,n,h,e);this._mapStart=o;for(var g=0;ga.max){l=n[c.toLowerCase()]}if(q=n;L-=q){if(C.fixNum){L=parseFloat((new Number(L)).toFixed(C.fixNum))}I.push(Math.floor(M*e)+0.5);if(w){L=Math.round(L*w)/w}var o=u-m+I[I.length-1];this.canvases.scale.renderTextAt("middle","left",v,o,a.template(L.toString()),"dhx_axis_item_y dhx_radar");if(A.length<2){this._drawScaleSector(H,"arc",v,u,m-I[I.length-1],-Math.PI/2,3*Math.PI/2,L);return}var h=-Math.PI/2;var F=h;var E;for(K=0;KMath.PI){g=-s}if(n>Math.PI/2){h=-e}if(Math.abs(n+Math.PI/2)0;w--){g-=A.cellWidth;e=F[w].$startY;if(e){n.push([g,e])}}}n.push([n[0][0],n[0][1]]);o.globalAlpha=this._settings.alpha.call(this,F[0]);o.fillStyle=this._settings.color.call(this,F[0]);o.beginPath();this._path(o,n);o.fill();for(w=0;we.y){C=e.y}var A=this._getSplineYPoint(r+1,v,s,m.a,m.b,m.c,m.d);if(Ae.y){A=e.y}this._drawLine(o,r,C,r+1,A,E.line.color(H[s]),E.line.width)}this._drawLine(o,u-1,this._getSplineYPoint(r,v,s,m.a,m.b,m.c,m.d),u,a,E.line.color(H[s]),E.line.width)}this._drawItem(o,v,c,H[n[s].index],E.label(H[n[s].index]),q,F)}}},_getSplineParameters:function(y){var l,C,A,D,x,w,r,q,o=[],g=[],e=y.length;for(l=0;l=1;l--){D[l]=(A[l]-o[l]*D[l+1])/C[l]}x=[];w=[];r=[];q=[];for(l=0;lD){s=D/this._series.length-4}q=Math.floor((D-s*this._series.length)/2);m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5));K=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){K=a;a=false}else{if(a){a=y.createLinearGradient(l.x,l.y,h.x,l.y);this._settings.gradient(a)}}if(!o){this._drawLine(y,l.x-0.5,l.y,l.x-0.5,h.y,"#000000",1)}for(F=0;FJ){x=J}x-=u;x*=c;I=l.x;e=l.y+q+F*D+(s+1)*A;if((x<0&&this._settings.origin=="auto")||(this._settings.xAxis&&x===0&&!(this._settings.origin!="auto"&&this._settings.origin>u))){this.canvases[A].renderTextAt("middle","right",I+10,e+s/2+q,this._settings.label(M[F]));continue}if(x<0&&this._settings.origin!="auto"&&this._settings.origin>u){x=0}if(!o){x+=v/r}C=a||this._settings.color.call(this,M[F]);if(this._settings.border){this._drawBarHBorder(y,I,e,s,u,m,r,x,C)}y.globalAlpha=this._settings.alpha.call(this,M[F]);var E=this._drawBarH(y,h,I,e,s,u,m,r,x,C,a,K);if(K!=false){this._drawBarHGradient(y,I,e,s,u,m,r,x,C,K)}y.globalAlpha=1;if(E[3]==e){this.canvases[A].renderTextAt("middle","left",E[0]-5,E[3]+Math.floor(s/2),this._settings.label(M[F]));L.addRect(M[F].id,[E[0]-l.x,E[3]-l.y,E[2]-l.x,E[3]+s-l.y],A)}else{this.canvases[A].renderTextAt("middle",false,E[2]+5,E[1]+Math.floor(s/2),this._settings.label(M[F]));L.addRect(M[F].id,[E[0]-l.x,e-l.y,E[2]-l.x,E[3]-l.y],A)}}},_setBarHPoints:function(w,g,u,x,m,v,s,l,h){var c=0;if(m>v*s){var r=(m-v*s)/m;c=-Math.asin(r)+Math.PI/2}w.moveTo(g,u+l);var e=g+v*s-m-(m?0:l);if(m0){w.arc(e,q,m-l,-Math.PI/2+c,0,false)}var o=u+x-m-(m?0:l);var a=e+m-(m?l:0);w.lineTo(a,o);if(m&&m>0){w.arc(e,o,m-l,0,Math.PI/2-c,false)}var n=u+x-l;w.lineTo(g,n);if(!h){w.lineTo(g,u+l)}return[a,n]},_drawHScales:function(e,m,l,h,n,c,g){var a=0;if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj)}a=this._drawHXAxis(this.canvases.x.getCanvas(),m,l,h,n,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),m,l,h,g,a)}},_drawHYAxis:function(s,h,o,m,e,a){if(!this._settings.yAxis){return}var l;var c=parseInt((a?a:o.x),10)-0.5;var q=m.y+0.5;var n=o.y;this._drawLine(s,c,q,c,n,this._settings.yAxis.color,1);for(var g=0;gg)){h+=(this._settings.origin-g)*m;c=h;l=l-(this._settings.origin-g);if(l<0){l*=(-1);n.translate(h,e+o);n.rotate(Math.PI);h=0.5;e=0}h+=0.5}return{value:l,x0:h,y0:e,start:c}},_drawBarH:function(u,h,A,g,o,q,l,n,s,v,a,m){u.save();var r=this._correctBarHParams(u,A,g,s,n,o,q);u.fillStyle=v;u.beginPath();var w=this._setBarHPoints(u,r.x0,r.y0,o,l,n,r.value,(this._settings.border?1:0));if(a&&!m){u.lineTo(h.x,r.y0+(this._settings.border?1:0))}u.fill();u.restore();var e=r.y0;var c=(r.y0!=g?g:w[1]);var y=(r.y0!=g?(r.start-w[0]):r.start);var x=(r.y0!=g?r.start:w[0]);return[y,e,x,c]},_drawBarHBorder:function(o,c,m,q,h,g,n,l,e){o.save();var a=this._correctBarHParams(o,c,m,l,n,q,h);o.beginPath();this._setBorderStyles(o,e);o.globalAlpha=0.9;this._setBarHPoints(o,a.x0,a.y0,q,g,n,a.value,o.lineWidth/2,1);o.stroke();o.restore()},_drawBarHGradient:function(r,e,o,s,m,l,q,n,g,a){r.save();var c=this._correctBarHParams(r,e,o,n,q,s,m);var h=this._setBarGradient(r,c.x0,c.y0+s,c.x0+q*c.value,c.y0,a,g,"x");r.fillStyle=h.gradient;r.beginPath();this._setBarHPoints(r,c.x0,c.y0+h.offset,s-h.offset*2,l,q,c.value,h.offset);r.fill();r.globalAlpha=1;r.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(C,P,h,g,D,O){var N,v;var c;var w;var y=g.x-h.x;var n=!!this._settings.yAxis;var m=this._getStackedLimits(P);N=m.max;v=m.min;var F=Math.floor((g.y-h.y)/P.length);if(!D){this._drawHScales(C,P,h,g,v,N,F)}if(n){N=parseFloat(this._settings.xAxis.end);v=parseFloat(this._settings.xAxis.start)}var K=this._getRelativeValue(v,N);w=K[0];c=K[1];var s=(w?y/w:10);if(!n){var x=10;s=(w?(y-x)/w:10)}var u=parseInt(this._settings.width,10);if((u+4)>F){u=F-4}var o=(F-u)/2;var l=0;var q=false;var a=this._settings.gradient;if(a){q=true}if(!n){this._drawLine(C,h.x-0.5,h.y,h.x-0.5,g.y,"#000000",1)}var M=0;var J=0;for(I=0;IN){A=N}A-=v;A*=c;var L=h.x;var e=h.y+o+I*F;if(!J){P[I].$startX=L}else{L=P[I].$startX}if(A<0||(this._settings.yAxis&&A===0)){this.canvases.y.renderTextAt("middle",true,L+10,e+u/2,this._settings.label(P[I]));continue}if(!n){A+=x/s}var E=this._settings.color.call(this,P[I]);C.globalAlpha=this._settings.alpha.call(this,P[I]);C.fillStyle=this._settings.color.call(this,P[I]);C.beginPath();var H=this._setBarHPoints(C,L,e,u,l,s,A,(this._settings.border?1:0));if(a&&!q){C.lineTo(h.x+y,e+(this._settings.border?1:0))}C.fill();if(q!=false){var r=this._setBarGradient(C,L,e+u,L,e,q,E,"x");C.fillStyle=r.gradient;C.beginPath();H=this._setBarHPoints(C,L,e,u,l,s,A,0);C.fill()}if(this._settings.border){this._drawBarHBorder(C,L,e,u,v,l,s,A,E)}C.globalAlpha=1;this.canvases[D].renderTextAt("middle",true,P[I].$startX+(H[0]-P[I].$startX)/2-1,e+(H[1]-e)/2,this._settings.label(P[I]));O.addRect(P[I].id,[P[I].$startX-h.x,e-h.y,H[0]-h.x,H[1]-h.y],D);P[I].$startX=H[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(x,L,g,e,y,K){var I,s;var a;var u;var v=e.y-g.y;var l=!!this._settings.yAxis;var J=!!this._settings.xAxis;var h=this._getStackedLimits(L);I=h.max;s=h.min;var C=Math.floor((e.x-g.x)/L.length);if(!y){this._drawScales(L,g,e,s,I,C)}if(l){I=parseFloat(this._settings.yAxis.end);s=parseFloat(this._settings.yAxis.start)}var F=this._getRelativeValue(s,I);u=F[0];a=F[1];var q=(u?v/u:10);var r=parseInt(this._settings.width,10);if(r+4>C){r=C-4}var m=Math.floor((C-r)/2);var n=(this._settings.gradient?this._settings.gradient:false);if(!J){this._drawLine(x,g.x,e.y+0.5,e.x,e.y+0.5,"#000000",1)}for(var E=0;E=0;l--){u.globalAlpha=a[l];u.strokeStyle="#d0d0d0";u.beginPath();this._strokeChartItem(u,e,s+2*n/3,n+l+1,g.type);u.stroke()}u.beginPath();u.globalAlpha=0.3;u.fillStyle="#bdbdbd";this._strokeChartItem(u,e,s+2*n/3,n+1,g.type);u.fill()}u.restore();u.lineWidth=g.borderWidth;u.fillStyle=g.color.call(this,o);u.strokeStyle=g.borderColor.call(this,o);u.globalAlpha=g.alpha.call(this,o);u.beginPath();this._strokeChartItem(u,e,s,n+1,g.type);u.fill();u.stroke();u.globalAlpha=1}if(r){this.canvases[q].renderTextAt(false,true,e,s-n-this._settings.labelOffset,this._settings.label.call(this,o))}var h=(this._settings.eventRadius||n+1);c.addRect(o.id,[e-h-m.x,s-h-m.y,e+h-m.x,s+h-m.y],q)},_strokeChartItem:function(a,c,h,g,e){var l=[];c=parseInt(c,10);h=parseInt(h,10);if(e&&(e=="square"||e=="s")){g*=Math.sqrt(2)/2;l=[[c-g-a.lineWidth/2,h-g],[c+g,h-g],[c+g,h+g],[c-g,h+g],[c-g,h-g]]}else{if(e&&(e=="diamond"||e=="d")){var m=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);l=[[c,h-g],[c+g,h],[c,h+g],[c-g,h],[c+m,h-g-m]]}else{if(e&&(e=="triangle"||e=="t")){l=[[c,h-g],[c+Math.sqrt(3)*g/2,h+g/2],[c-Math.sqrt(3)*g/2,h+g/2],[c,h-g]]}else{l=[[c,h,g,0,Math.PI*2,true]]}}}this._path(a,l)},_getPointY:function(e,n,l,a){var m=a.minValue;var g=a.maxValue;var q=a.unit;var c=a.valueFactor;var o=this._settings.value(e);var r=(parseFloat(o||0)-m)*c;if(!this._settings.yAxis){r+=a.startValue/q}var h=l.y-q*r;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(o>g){h={y:n.y,y0:h,out:"max"}}else{if(r<0||og){h=n.y}if(r<0||ou){this._drawXAxis(y,P,h,g,D,g.y-r*(this._settings.origin-u))}s=parseInt(this._settings.width,10);var K=0;var F=0;for(H=0;HD){s=parseInt(D/K-4,10)}var o=(D-s*K)/2;var l=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5));var q=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){q=a;a=false}else{if(a){a=y.createLinearGradient(0,g.y,0,h.y);this._settings.gradient(a)}}if(!L){this._drawLine(y,h.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(H=0;HM){x=M}x-=u;x*=c;var J=h.x+o+parseInt(H*D,10)+(s+1)*F;var e=g.y;if(x<0||(this._settings.yAxis&&x===0&&!(this._settings.origin!="auto"&&this._settings.origin>u))){this.canvases[A].renderTextAt(true,true,J+Math.floor(s/2),e,this._settings.label(P[H]));continue}if(!n&&!(this._settings.origin!="auto"&&L)){x+=w/r}var C=a||this._settings.color.call(this,P[H]);y.globalAlpha=this._settings.alpha.call(this,P[H]);var E=this._drawBar(y,h,J,e,s,u,l,r,x,C,a,q);if(q){this._drawBarGradient(y,J,e,s,u,l,r,x,C,q)}if(this._settings.border){this._drawBarBorder(y,J,e,s,u,l,r,x,C)}y.globalAlpha=1;if(E[0]!=J){this.canvases[A].renderTextAt(false,true,J+Math.floor(s/2),E[1],this._settings.label(P[H]))}else{this.canvases[A].renderTextAt(true,true,J+Math.floor(s/2),E[3],this._settings.label(P[H]))}O.addRect(P[H].id,[J-h.x,E[3]-h.y,E[2]-h.x,E[1]-h.y],A)}},_correctBarParams:function(n,h,e,l,m,o,g){var a=this._settings.xAxis;var c=e;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>g)){e-=(this._settings.origin-g)*m;c=e;l=l-(this._settings.origin-g);if(l<0){l*=(-1);n.translate(h+o,e);n.rotate(Math.PI);h=0;e=0}e-=0.5}return{value:l,x0:h,y0:e,start:c}},_drawBar:function(u,h,A,g,o,q,l,n,s,v,a,m){u.save();u.fillStyle=v;var r=this._correctBarParams(u,A,g,s,n,o,q);var w=this._setBarPoints(u,r.x0,r.y0,o,l,n,r.value,(this._settings.border?1:0));if(a&&!m){u.lineTo(r.x0+(this._settings.border?1:0),h.y)}u.fill();u.restore();var y=r.x0;var x=(r.x0!=A?A+w[0]:w[0]);var e=(r.x0!=A?(r.start-w[1]-r.y0):r.y0);var c=(r.x0!=A?r.start-r.y0:w[1]);return[y,e,x,c]},_drawBarBorder:function(o,c,m,q,h,g,n,l,e){var a;o.save();a=this._correctBarParams(o,c,m,l,n,q,h);this._setBorderStyles(o,e);this._setBarPoints(o,a.x0,a.y0,q,g,n,a.value,o.lineWidth/2,1);o.stroke();o.restore()},_drawBarGradient:function(s,g,q,u,n,m,r,o,h,c){s.save();var e=this._correctBarParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,e.x0,e.y0,e.x0+u,e.y0-r*e.value+2,c,h,"y");var a=this._settings.border?1:0;s.fillStyle=l.gradient;this._setBarPoints(s,e.x0+l.offset,e.y0,u-l.offset*2,m,r,e.value,l.offset+a);s.fill();s.restore()},_setBarPoints:function(w,g,s,x,n,u,r,h,m){w.beginPath();var c=0;if(n>u*r){var l=(n-u*r)/n;if(l<=1&&l>=-1){c=-Math.acos(l)+Math.PI/2}}w.moveTo(g+h,s);var q=s-Math.floor(u*r)+n+(n?0:h);if(n0){w.arc(e,q,n-h,-Math.PI+c,-Math.PI/2,false)}var a=g+x-n-h;var o=q-n+(n?h:0);w.lineTo(a,o);if(n&&n>0){w.arc(a,q,n-h,-Math.PI/2,0-c,false)}var v=g+x-h;w.lineTo(v,s);if(!m){w.lineTo(g+h,s)}return[v,o]}};dhtmlx.chart.pie={pvt_render_pie:function(c,g,a,l,e,h){this._renderPie(c,g,a,l,1,h,e)},_renderPie:function(r,E,h,g,C,D,s){if(!E.length){return}var u=this._getPieParameters(h,g);var m=(this._settings.radius?this._settings.radius:u.radius);if(m<0){return}var a=this._getValues(E);var l=this._getTotalValue(a);var n=this._getRatios(a,l);var A=(this._settings.x?this._settings.x:u.x);var e=(this._settings.y?this._settings.y:u.y);if(C==1&&this._settings.shadow){this._addShadow(r,A,e,m)}e=e/C;var q=-Math.PI/2;var w=[];r.scale(1,C);if(this._settings.gradient){var y=(C!=1?A+m/3:A);var c=(C!=1?e+m/3:e);this._showRadialGradient(r,A,e,m,y,c)}for(var x=0;x=0)||(e>=0&&a<=Math.PI)||(Math.abs(e-Math.PI)>0.003&&e<=Math.PI&&a>=Math.PI))){return}if(e<=0&&a>=0){e=0;c=false;this._drawSectorLine(g,h,m,l,e,a)}if(e<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(g,h,m,l,e,a)}var n=(this._settings.height||Math.floor(l/4))/this._settings.cant;g.beginPath();g.arc(h,m,l,e,a,false);g.lineTo(h+l*Math.cos(a),m+l*Math.sin(a)+n);g.arc(h,m+n,l,a,e,true);g.lineTo(h+l*Math.cos(e),m+l*Math.sin(e));g.fill();if(c){g.stroke()}},_drawSectorLine:function(e,g,l,h,c,a){e.beginPath();e.arc(g,l,h,c,a,false);e.stroke()},_addShadow:function(c,a,l,g){c.globalAlpha=0.5;var h=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var e=h.length-1;e>-1;e--){c.beginPath();c.fillStyle=h[e];c.arc(a+1,l+1,g+e,0,Math.PI*2,true);c.fill()}c.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(e,c,m,a,g,h){e.beginPath();var l;if(typeof this._settings.gradient!="function"){l=e.createRadialGradient(g,h,a/4,c,m,a);l=this._getGrayGradient(l)}else{l=this._settings.gradient(l)}e.fillStyle=l;e.arc(c,m,a,0,Math.PI*2,true);e.fill();e.globalAlpha=0.7},_drawSectorLabel:function(D,c,g,w,v,E,u,a){var s=this.canvases[0].renderText(0,0,u,0,1);if(!s){return}var F=s.scrollWidth;s.style.width=F+"px";if(F>D){F=D}var A=(v-w<0.2?4:8);if(a){A=F/1.8}var e=w+(v-w)/2;g=g-(A-8)/2;var n=-A;var m=-8;var C="right";if(e>=Math.PI/2&&e=Math.PI){n=-F-n+1;C="left"}var h=0;if(!a&&E<1&&(e>0&&e=Math.PI/2&&e=Math.PI)){q+=F/3}}}s.style.top=o+"px";s.style.left=q+"px";s.style.width=F+"px";s.style.textAlign=C;s.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,g,a,l,e,h){this._renderPie(c,g,a,l,this._settings.cant,h)}};dhtmlx.chart.donut={pvt_render_donut:function(s,h,q,o,m,c){if(!h.length){return}this._renderPie(s,h,q,o,1,c);var g=this._settings;var l=this._getPieParameters(q,o);var a=(g.radius?g.radius:l.radius);var n=((g.innerRadius&&(g.innerRadius1){if(a){if(l.className.indexOf("hidden")!=-1){this.showSeries(h)}else{this.hideSeries(h)}}}}}},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},resize:function(){for(var a in this.canvases){this.canvases[a]._resizeCanvas()}this.render()},view_setter:function(a){if(!dhtmlx.chart[a]){dhtmlx.error("Chart type extension is not loaded: "+a)}if(typeof this._settings.offset=="undefined"){this._settings.offset=!(a=="area"||a=="stackedArea")}if(a=="radar"&&!this._settings.yAxis){this.define("yAxis",{})}if(a=="scatter"){if(!this._settings.yAxis){this.define("yAxis",{})}if(!this._settings.xAxis){this.define("xAxis",{})}}return a},clearCanvas:function(){if(this.canvases&&typeof this.canvases=="object"){for(var a in this.canvases){this.canvases[a].clearCanvas()}}},render:function(){var e,c,g,h,a;if(!this.callEvent("onBeforeRender",[this.data])){return}if(this.canvases&&typeof this.canvases=="object"){for(c in this.canvases){this.canvases[c].clearCanvas()}}else{this.canvases={}}if(this._settings.legend){if(!this.canvases.legend){this.canvases.legend=new dhtmlx.ui.Canvas(this._obj,"legend")}this._drawLegend(this.data.getRange(),this._obj.offsetWidth)}e=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);h=new dhtmlx.ui.Map(this._id);a=this._settings;g=this._getChartData();for(c=0;c5?10:5);h=parseInt(l,10)*a;if(h>Math.abs(q)){g=(q<0?-h:0)}else{var r=Math.abs(q);var o=Math.floor(this._log10(r));var n=r/Math.pow(10,o);g=Math.ceil(n*10)/10*Math.pow(10,o)-h;if(r>1&&h>0.1){g=Math.ceil(g)}while(q<0?g<=q:g>=q){g-=h}if(q<0){g=-g-2*h}}m=g;while(m1){for(var g=1;gn){n=a}if(e2){l.setAttribute("series_id",c)}a.appendChild(l);return l},_drawLegendMarker:function(A,s,r,h,w,l,n){var c=[];var m=this._settings.legend.marker;var v=this._settings.legend.values;var q=(v&&v[n].markerType?v[n].markerType:m.type);if(h){A.fillStyle=h;A.strokeStyle=this._getDarkenColor(h,0.75)}A.beginPath();if(q=="round"||!m.radius){A.lineWidth=m.height;A.lineCap=q;s+=A.lineWidth/2+5;r+=w/2;A.moveTo(s,r);var a=s+m.width-m.height+1;A.lineTo(a,r)}else{if(q=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){A.beginPath();A.lineWidth=this._series[n].line.width;A.strokeStyle=l?h:this._series[n].line.color.call(this,{});var e=s+5;var u=r+w/2;A.moveTo(e,u);var a=e+m.width;A.lineTo(a,u);A.stroke()}var g=this._series[n].item;var o=parseInt(g.radius.call(this,{}),10)||0;if(o){A.beginPath();if(l){A.lineWidth=g.borderWidth;A.strokeStyle=h;A.fillStyle=h}else{A.lineWidth=g.borderWidth;A.fillStyle=g.color.call(this,{});A.strokeStyle=g.borderColor.call(this,{});A.globalAlpha=g.alpha.call(this,{})}A.beginPath();s+=m.width/2+5;r+=w/2;this._strokeChartItem(A,s,r,o+1,g.type);A.fill();A.stroke()}A.globalAlpha=1}else{A.lineWidth=1;s+=5;r+=parseInt(w/2-m.height/2,10);c=[[s+m.radius,r+m.radius,m.radius,Math.PI,3*Math.PI/2,false],[s+m.width-m.radius,r],[s+m.width-m.radius,r+m.radius,m.radius,-Math.PI/2,0,false],[s+m.width,r+m.height-m.radius],[s+m.width-m.radius,r+m.height-m.radius,m.radius,0,Math.PI/2,false],[s+m.radius,r+m.height],[s+m.radius,r+m.height-m.radius,m.radius,Math.PI/2,Math.PI,false],[s,r+m.radius]];this._path(A,c)}}A.stroke();A.fill()},_getDarkenColor:function(a,g){var e,c;c=dhtmlx.math.toRgb(a);e=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);e[2]=e[2]*g;return"rgb("+dhtmlx.math.hsvToRgb(e[0],e[1],e[2])+")"},_getChartBounds:function(a,m){var o,e,n,c;o=this._settings.padding.left;e=this._settings.padding.top;n=a-this._settings.padding.right;c=m-this._settings.padding.bottom;if(this._settings.legend){var h=this._settings.legend;var l=this._settings.legend.width;var g=this._settings.legend.height;if(h.layout=="x"){if(h.valign=="center"){if(h.align=="right"){n-=l}else{if(h.align=="left"){o+=l}}}else{if(h.valign=="bottom"){c-=g}else{e+=g}}}else{if(h.align=="right"){n-=l}else{if(h.align=="left"){o+=l}}}}return{start:{x:o,y:e},end:{x:n,y:c}}},_getStackedLimits:function(h){var c,a,l,g,e;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){l=parseFloat(this._settings.yAxis.end);g=parseFloat(this._settings.yAxis.start)}else{for(c=0;cl){l=h[c].$sum}if(h[c].$min0){g=0}}return{max:l,min:g}},_setBarGradient:function(v,c,r,a,o,n,g,e){var q,h,m,l,u,s;if(n=="light"){if(e=="x"){q=v.createLinearGradient(c,r,a,r)}else{q=v.createLinearGradient(c,r,c,o)}s=[[0,"#FFFFFF"],[0.9,g],[1,g]];h=2}else{if(n=="falling"||n=="rising"){if(e=="x"){q=v.createLinearGradient(c,r,a,r)}else{q=v.createLinearGradient(c,r,c,o)}m=dhtmlx.math.toRgb(g);l=dhtmlx.math.rgbToHsv(m[0],m[1],m[2]);l[1]*=1/2;u="rgb("+dhtmlx.math.hsvToRgb(l[0],l[1],l[2])+")";if(n=="falling"){s=[[0,u],[0.7,g],[1,g]]}else{if(n=="rising"){s=[[0,g],[0.3,g],[1,u]]}}h=0}else{v.globalAlpha=0.37;h=0;if(e=="x"){q=v.createLinearGradient(c,o,c,r)}else{q=v.createLinearGradient(c,r,a,r)}s=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(q,s);return{gradient:q,offset:h}},_getPositionByAngle:function(e,c,h,g){e*=(-1);c=c+Math.cos(e)*g;h=h-Math.sin(e)*g;return{x:c,y:h}},_gradient:function(e,c){for(var a=0;a2){g="arc"}a[g].apply(a,e[c])}},_circle:function(c,a,g,e){c.arc(a,g,e,Math.PI*2,true)},_addMapRect:function(g,h,a,e,c){g.addRect(h,[a[0].x-e.x,a[0].y-e.y,a[1].x-e.x,a[1].y-e.y],c)}};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachChart=function(a){this.callEvent("_onBeforeContentAttach",["chart"]);var c=document.createElement("DIV");c.id="dhxChartObj_"+window.dhx4.newId();c.style.width="100%";c.style.height="100%";document.body.appendChild(c);this._attachObject(c);a.container=c.id;this.dataType="chart";this.dataObj=new dhtmlXChart(a);if(!this.dataObj.setSizes){this.dataObj.setSizes=function(){if(this.resize){this.resize()}else{this.render()}}}return this.dataObj}}dhtmlx.ui.pager=function(a){this.name="Pager";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,c){this.select(c)}},select:function(a){switch(a){case"next":a=this._settings.page+1;break;case"prev":a=this._settings.page-1;break;case"first":a=0;break;case"last":a=this._settings.limit-1;break;default:break}if(a<0){a=0}if(a>=this.data.limit){a=this.data.limit-1}if(this.callEvent("onBeforePageChange",[this._settings.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),pages:function(e){var c="";if(e.page==-1){return""}e.min=e.page-Math.round((e.group-1)/2);e.max=e.min+e.group-1;if(e.min<0){e.max+=e.min*(-1);e.min=0}if(e.max>=e.limit){e.min-=Math.min(e.min,e.max-e.limit+1);e.max=e.limit-1}for(var a=(e.min||0);a<=e.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==e.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" << ",selected:""})},last:function(){return this.button({id:"last",index:" >> ",selected:""})},prev:function(){return this.button({id:"prev",index:"<",selected:""})},next:function(){return this.button({id:"next",index:">",selected:""})},button:dhtmlx.Template.fromHTML("
{obj.index}
")}},refresh:function(){var a=this._settings;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit){a.page=Math.min(a.limit-1,a.page)}var c=a.page;if(c!=-1&&(c!=a.old_page)||(a.limit!=a.old_limit)){this.render();this.callEvent("onRefresh",[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(e){c.setUpdated(e,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(g,e){if(g.getUserData){g.getUserData(e,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(g){if(c._silent_mode){return true}var e=c.getState(g);if(e=="inserted"){c.setUpdated(g,false);return true}if(e=="deleted"){return false}if(e=="true_deleted"){return true}c.setUpdated(g,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(e){c.setUpdated(e,true,"updated")});this.attachEvent("onBindUpdate",function(e){window.setTimeout(function(){c.setUpdated(e.id,true,"updated")},1)});a="_getRowData";c[a]=function(m,e){var h=this.obj.data.get(m);var l={};for(var g in h){if(g.indexOf("_")===0){continue}l[g]=h[g]}return l};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(e,g){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.remove(g)});dhtmlx.compat("dataProcessor",c)},_dp_callback:function(a,c){this.obj.data.set(c,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(c)},setItemStyle:function(e,a){var c=this._locateHTML(e);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(e,a,c){if(e){this.data.get(e)[a]=c}else{this._userdata[a]=c}},getUserData:function(c,a){return c?this.data.get(c)[a]:this._userdata[a]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var n="_dragged";var g=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(q,r,o){g.apply(this,arguments);if(!o){var s=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!s.from){s.from=this.dragStartObject}dhtmlx.DragControl._checkLand(q,r,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(r,o,q){if(!q){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=m.dragStartNode;dhtmlx.DragControl._stopDrag(r,true)}}c.apply(this,arguments)};var m=new dhtmlDragAndDropObject();var h=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){h.apply(this,arguments);var s=dhtmlx.DragControl._drag_context;if(!s){return}var r=[];var q=[];for(var o=0;o"+c.innerHTML+""}};dhtmlx.DragItem={_init:function(){dhtmlx.assert(this.move,"DragItem :: Component doesn't have DataMove interface");dhtmlx.assert(this.locate,"DragItem :: Component doesn't have RenderStack interface");dhtmlx.assert(dhtmlx.DragControl,"DragItem :: DragControl is not included");if(!this._settings||this._settings.drag){dhtmlx.DragItem._initHandlers(this)}else{if(this._settings){this.drag_setter=function(a){if(a){this._initHandlers(this);delete this.drag_setter}return a}}}if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,true);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(h,g,l){var n=this.locate(l)||null;var c=dhtmlx.DragControl._drag_context;var m=dhtmlx.DragControl.getMaster(h);var a=(this._locateHTML(n)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=n;c.to=m;if(!this.callEvent("onBeforeDragIn",[c,l])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(h,g,o,l){var m=this.locate(l)||null;if(o!=this._dataobj){m=null}var c=(this._locateHTML(m)||(o?dhtmlx.DragControl.getMaster(o)._obj:window.undefined));if(c==dhtmlx.DragControl._landing){return null}var a=dhtmlx.DragControl._drag_context;dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");a.target=a.to=null;this.callEvent("onDragOut",[a,l]);return null},onDrop:function(g,c,l,h){var a=dhtmlx.DragControl._drag_context;a.to=this;a.index=a.target?this.indexById(a.target):this.dataCount();a.new_id=dhtmlx.uid();if(!this.callEvent("onBeforeDrop",[a,h])){return}if(a.from==a.to){this.move(a.source,a.index)}else{if(a.from){a.from.move(a.source,a.index,a.to,a.new_id)}else{dhtmlx.error("Unsopported d-n-d combination")}}this.callEvent("onAfterDrop",[a,h])},onDrag:function(g,l){var m=this.locate(l);var h=[m];if(m){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,m)!=-1){h=c}}var a=dhtmlx.DragControl._drag_context={source:h,start:m};a.from=this;if(this.callEvent("onBeforeDrag",[a,l])){return a.html||this._toHTML(this.get(m))}}return null}};dhtmlx.EditAbility={_init:function(a){this._edit_id=null;this._edit_bind=null;dhtmlx.assert(this.data,"EditAbility :: Component doesn't have DataStore");dhtmlx.assert(this._locateHTML,"EditAbility :: Component doesn't have RenderStack");this.attachEvent("onEditKeyPress",function(e,g,c){if(e==13&&!c){this.stopEdit()}else{if(e==27){this.stopEdit(true)}}});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(c){if(this.stopEdit(false,c)){if(!this.callEvent("onBeforeEditStart",[c])){return}var a=this.data.get(c);if(a.$template){return}a.$template="edit";this.data.refresh(c);this._edit_id=c;this._save_binding(c);this._edit_bind(true,a);this.callEvent("onAfterEditStart",[c])}},stopEdit:function(e,h){if(!this._edit_id){return true}if(this._edit_id==h){return false}var a={};if(!e){this._edit_bind(false,a)}else{a=null}if(!this.callEvent("onBeforeEditStop",[this._edit_id,a])){return false}var c=this.data.get(this._edit_id);c.$template=null;if(!e){this._edit_bind(false,c)}var g=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(g);this.callEvent("onAfterEditStop",[g,a]);return true},_save_binding:function(n){var a=this._locateHTML(n);var e="";var l="";var h=[];if(a){var g=a.getElementsByTagName("*");var m="";for(var c=0;c=0;c--){if(this._selected[c]==e){this._selected[c]=a}}},_data_filtered:function(){for(var a=this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0){var e=this._selected[a]}var c=this.item(e);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[e])}},_data_updated:function(e,c,a){if(a=="delete"){this._selected.remove(e)}else{if(!this.data.dataCount()&&!this.data._filter_order){this._selected=dhtmlx.toArray()}}},_data_loaded:function(){if(this._settings.select){this.data.each(function(a){if(a.$selected){this.select(a.id)}},this)}},_select_mark:function(e,c,a){if(!a&&!this.callEvent("onBeforeSelect",[e,c])){return false}this.data.item(e).$selected=c;if(a){a.push(e)}else{if(c){this._selected.push(e)}else{this._selected.remove(e)}this._refresh_selection(e)}return true},select:function(g,e,a){if(!g){return this.selectAll()}if(g instanceof Array){for(var c=0;c100||a.length>this.data.dataCount/2},_refresh_selection:function(c){if(typeof c!="object"){c=[c]}if(!c.length){return}if(this._is_mass_selection(c)){this.data.refresh()}else{for(var a=0;ac){if(!e){this.order[c]=dhtmlx.uid();e={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(e.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(e)}}return a},render:function(l,g,e,h){if(l){var a=this._locateHTML(l);switch(e){case"update":if(!a){return}var c=this._htmlmap[l]=this._toHTMLObject(g);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;default:this._render_delayed();break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._htmlmap={};this._render_visible_rows(null,true);this._wait_for_render=false;this.callEvent("onAfterRender",[])}}},_render_delayed:function(){if(this._wait_for_render){return}this._wait_for_render=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var c=document.createElement("DIV");c.className="dhxdataview_placeholder";c.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";return c},_render_visible_rows:function(A,E){this.data._unrendered_area=[];var y=this._getVisibleRange();if(!this._dataobj.firstChild||E){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(y._max));this._htmlrows=[this._dataobj.firstChild]}var l=Math.max(y._from,0);var x=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(l<=y._height){while(this._htmlrows[l]&&this._htmlrows[l]._filled&&l<=y._height){l++}if(l>y._height){break}var o=l;while(!this._htmlrows[o]){o--}var a=this._htmlrows[o];var g=l*y._dx+(this.data.min||0);if(g>x){break}var m=Math.min(g+y._dx-1,x);var r=this._create_placeholder(y._y);var n=this.data.getIndexRange(g,m);if(!n.length){break}r.innerHTML=n.map(this._toHTML,this).join("");for(var v=0;v0){a.style.height=u+"px";this._htmlrows[l+1]=a}else{if(D<0){dhtmlx.html.remove(a)}else{a.style.height=D+"px"}if(u>0){var q=this._htmlrows[l+1]=this._create_placeholder(u);dhtmlx.html.insertBefore(q,r.nextSibling,this._dataobj)}}l++}if(this.data._unrendered_area.length){var s=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>s){if(!this.callEvent("onDataRequest",[s,c-s])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,s,c-s)}}if(dhtmlx._isIE){var C=this._getVisibleRange();if(C._from!=y._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var m=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var n=this._dataobj.offsetHeight;var q=this.type;var g=this._getDimension();var r=Math.floor(a/g.x)||1;var e=Math.floor(m/g.y);var o=Math.ceil((n+m)/g.y)-1;var h=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var l=Math.ceil(h/r)*g.y;return{_from:e,_height:o,_top:m,_max:l,_y:g.y,_dx:r}}};dhtmlXDataView=function(a){this.name="DataView";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});if(this._settings.height!="auto"&&!this._settings.renderAll){dhtmlx.extend(this,dhtmlx.VirtualRenderStack)}this.data.provideApi(this,true);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(e,h){var g=this._locateHTML(e.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(g){g.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";g.style.backgroundRepeat="no-repeat";this._drag_marker=g}}if(g&&this._settings.auto_scroll){var a=g.offsetTop;var l=g.offsetHeight;var c=this._obj.scrollTop;var m=this._obj.offsetHeight;if(a-l>=0&&a-l*0.75c+m){c=c+l}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_dataview_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("
{obj.text}
"),template_edit:dhtmlx.Template.fromHTML("
"),template_loading:dhtmlx.Template.fromHTML("
Loading...
"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachDataView=function(a){this.callEvent("_onBeforeContentAttach",["dataview"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="DataViewObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="dataview";this.dataObj=new dhtmlXDataView(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}function xmlPointer(a){this.d=a}xmlPointer.prototype={text:function(){if(!_isFF){return this.d.xml}var a=new XMLSerializer();return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return !!this.d},content:function(){return this.d.firstChild?(this.d.firstChild.wholeText||this.d.firstChild.data):""},each:function(g,m,l,h){var e=this.d.childNodes;var n=new xmlPointer();if(e.length){for(h=h||0;h