├── LICENSE ├── README.md ├── demo ├── goods.js └── index.html ├── lib ├── inflate.js ├── jquery.js └── zip.js └── src ├── tl.grid.css ├── tl.grid.js ├── tl.import.js ├── tl.win.css └── tl.win.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 lxrmido 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # excel-grid 2 | 3 | 这是一个编写于2013年的项目,用于提供一个基于HTML的、操作接近于excel的工作界面,使用场景大概是比较大量的数据编辑以及需要看上去很专业的演示的时候 4 | 5 | 僵尸项目,经过2013年半年的开发后功能已经趋近稳定,也没有进一步的开发需求了,先放上来github声明一下著作权 6 | 7 | ## 现有功能包括: 8 | 9 | 1. 多行多列多选编辑 10 | 1. 替换显示值与实际值 11 | 1. 下拉选择、日期选择、以及各种各样奇奇怪怪的选择 12 | 1. 列宽自由调整、隐藏、过滤、查找功能 13 | 1. 导入xlsx表格的功能 14 | 1. 可导出为XML等 15 | 1. 可禁止对特定行列进行编辑 16 | 1. 编辑时自动计算单元格的值 17 | 18 | ## 项目本体包括 19 | 20 | 1. tl.win.js (UI) 21 | 1. tl.grid.js (表格本体) 22 | 1. tl.win.css 23 | 1. tl.grid.css 24 | 25 | 此外,需要jquery; 26 | 27 | 当需要使用导入xlsx的功能时, 需要额外引入 28 | 29 | 1. tl.import.js 30 | 1. inflate.js 31 | 1. zip.js 32 | 33 | 34 | ## 运行截图: 35 | 36 | ![excel-grid](http://i.imgur.com/0Bd2244.png) 37 | 38 | demo参见:http://runjs.cn/detail/gcdxdyct -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | excel-grid 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 133 | 134 | -------------------------------------------------------------------------------- /lib/zip.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Gildas Lormeau. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution. 13 | 14 | 3. The names of the authors may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 18 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 19 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, 20 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | (function(obj) { 30 | 31 | var ERR_BAD_FORMAT = "File format is not recognized."; 32 | var ERR_ENCRYPTED = "File contains encrypted entry."; 33 | var ERR_ZIP64 = "File is using Zip64 (4gb+ file size)."; 34 | var ERR_READ = "Error while reading zip file."; 35 | var ERR_WRITE = "Error while writing zip file."; 36 | var ERR_WRITE_DATA = "Error while writing file data."; 37 | var ERR_READ_DATA = "Error while reading file data."; 38 | var ERR_DUPLICATED_NAME = "File already exists."; 39 | var ERR_HTTP_RANGE = "HTTP Range not supported."; 40 | var CHUNK_SIZE = 512 * 1024; 41 | 42 | var INFLATE_JS = "inflate.js"; 43 | var DEFLATE_JS = "deflate.js"; 44 | 45 | var appendABViewSupported; 46 | try { 47 | appendABViewSupported = new Blob([ getDataHelper(0).view ]).size == 0; 48 | } catch (e) { 49 | } 50 | 51 | function Crc32() { 52 | var crc = -1, that = this; 53 | that.append = function(data) { 54 | var offset, table = that.table; 55 | for (offset = 0; offset < data.length; offset++) 56 | crc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF]; 57 | }; 58 | that.get = function() { 59 | return ~crc; 60 | }; 61 | } 62 | Crc32.prototype.table = (function() { 63 | var i, j, t, table = []; 64 | for (i = 0; i < 256; i++) { 65 | t = i; 66 | for (j = 0; j < 8; j++) 67 | if (t & 1) 68 | t = (t >>> 1) ^ 0xEDB88320; 69 | else 70 | t = t >>> 1; 71 | table[i] = t; 72 | } 73 | return table; 74 | })(); 75 | 76 | function blobSlice(blob, index, length) { 77 | if (blob.slice) 78 | return blob.slice(index, index + length); 79 | else if (blob.webkitSlice) 80 | return blob.webkitSlice(index, index + length); 81 | else if (blob.mozSlice) 82 | return blob.mozSlice(index, index + length); 83 | else if (blob.msSlice) 84 | return blob.msSlice(index, index + length); 85 | } 86 | 87 | function getDataHelper(byteLength, bytes) { 88 | var dataBuffer, dataArray; 89 | dataBuffer = new ArrayBuffer(byteLength); 90 | dataArray = new Uint8Array(dataBuffer); 91 | if (bytes) 92 | dataArray.set(bytes, 0); 93 | return { 94 | buffer : dataBuffer, 95 | array : dataArray, 96 | view : new DataView(dataBuffer) 97 | }; 98 | } 99 | 100 | // Readers 101 | function Reader() { 102 | } 103 | 104 | function TextReader(text) { 105 | var that = this, blobReader; 106 | 107 | function init(callback, onerror) { 108 | var blob = new Blob([ text ], { 109 | type : "text/plain" 110 | }); 111 | blobReader = new BlobReader(blob); 112 | blobReader.init(function() { 113 | that.size = blobReader.size; 114 | callback(); 115 | }, onerror); 116 | } 117 | 118 | function readUint8Array(index, length, callback, onerror) { 119 | blobReader.readUint8Array(index, length, callback, onerror); 120 | } 121 | 122 | that.size = 0; 123 | that.init = init; 124 | that.readUint8Array = readUint8Array; 125 | } 126 | TextReader.prototype = new Reader(); 127 | TextReader.prototype.constructor = TextReader; 128 | 129 | function Data64URIReader(dataURI) { 130 | var that = this, dataStart; 131 | 132 | function init(callback) { 133 | var dataEnd = dataURI.length; 134 | while (dataURI.charAt(dataEnd - 1) == "=") 135 | dataEnd--; 136 | dataStart = dataURI.indexOf(",") + 1; 137 | that.size = Math.floor((dataEnd - dataStart) * 0.75); 138 | callback(); 139 | } 140 | 141 | function readUint8Array(index, length, callback) { 142 | var i, data = getDataHelper(length); 143 | var start = Math.floor(index / 3) * 4; 144 | var end = Math.ceil((index + length) / 3) * 4; 145 | var bytes = obj.atob(dataURI.substring(start + dataStart, end + dataStart)); 146 | var delta = index - Math.floor(start / 4) * 3; 147 | for (i = delta; i < delta + length; i++) 148 | data.array[i - delta] = bytes.charCodeAt(i); 149 | callback(data.array); 150 | } 151 | 152 | that.size = 0; 153 | that.init = init; 154 | that.readUint8Array = readUint8Array; 155 | } 156 | Data64URIReader.prototype = new Reader(); 157 | Data64URIReader.prototype.constructor = Data64URIReader; 158 | 159 | function BlobReader(blob) { 160 | var that = this; 161 | 162 | function init(callback) { 163 | this.size = blob.size; 164 | callback(); 165 | } 166 | 167 | function readUint8Array(index, length, callback, onerror) { 168 | var reader = new FileReader(); 169 | reader.onload = function(e) { 170 | callback(new Uint8Array(e.target.result)); 171 | }; 172 | reader.onerror = onerror; 173 | reader.readAsArrayBuffer(blobSlice(blob, index, length)); 174 | } 175 | 176 | that.size = 0; 177 | that.init = init; 178 | that.readUint8Array = readUint8Array; 179 | } 180 | BlobReader.prototype = new Reader(); 181 | BlobReader.prototype.constructor = BlobReader; 182 | 183 | function HttpReader(url) { 184 | var that = this; 185 | 186 | function getData(callback, onerror) { 187 | var request; 188 | if (!that.data) { 189 | request = new XMLHttpRequest(); 190 | request.addEventListener("load", function() { 191 | if (!that.size) 192 | that.size = Number(request.getResponseHeader("Content-Length")); 193 | that.data = new Uint8Array(request.response); 194 | callback(); 195 | }, false); 196 | request.addEventListener("error", onerror, false); 197 | request.open("GET", url); 198 | request.responseType = "arraybuffer"; 199 | request.send(); 200 | } else 201 | callback(); 202 | } 203 | 204 | function init(callback, onerror) { 205 | var request = new XMLHttpRequest(); 206 | request.addEventListener("load", function() { 207 | that.size = Number(request.getResponseHeader("Content-Length")); 208 | callback(); 209 | }, false); 210 | request.addEventListener("error", onerror, false); 211 | request.open("HEAD", url); 212 | request.send(); 213 | } 214 | 215 | function readUint8Array(index, length, callback, onerror) { 216 | getData(function() { 217 | callback(new Uint8Array(that.data.subarray(index, index + length))); 218 | }, onerror); 219 | } 220 | 221 | that.size = 0; 222 | that.init = init; 223 | that.readUint8Array = readUint8Array; 224 | } 225 | HttpReader.prototype = new Reader(); 226 | HttpReader.prototype.constructor = HttpReader; 227 | 228 | function HttpRangeReader(url) { 229 | var that = this; 230 | 231 | function init(callback, onerror) { 232 | var request = new XMLHttpRequest(); 233 | request.addEventListener("load", function() { 234 | that.size = Number(request.getResponseHeader("Content-Length")); 235 | if (request.getResponseHeader("Accept-Ranges") == "bytes") 236 | callback(); 237 | else 238 | onerror(ERR_HTTP_RANGE); 239 | }, false); 240 | request.addEventListener("error", onerror, false); 241 | request.open("HEAD", url); 242 | request.send(); 243 | } 244 | 245 | function readArrayBuffer(index, length, callback, onerror) { 246 | var request = new XMLHttpRequest(); 247 | request.open("GET", url); 248 | request.responseType = "arraybuffer"; 249 | request.setRequestHeader("Range", "bytes=" + index + "-" + (index + length - 1)); 250 | request.addEventListener("load", function() { 251 | callback(request.response); 252 | }, false); 253 | request.addEventListener("error", onerror, false); 254 | request.send(); 255 | } 256 | 257 | function readUint8Array(index, length, callback, onerror) { 258 | readArrayBuffer(index, length, function(arraybuffer) { 259 | callback(new Uint8Array(arraybuffer)); 260 | }, onerror); 261 | } 262 | 263 | that.size = 0; 264 | that.init = init; 265 | that.readUint8Array = readUint8Array; 266 | } 267 | HttpRangeReader.prototype = new Reader(); 268 | HttpRangeReader.prototype.constructor = HttpRangeReader; 269 | 270 | // Writers 271 | 272 | function Writer() { 273 | } 274 | Writer.prototype.getData = function(callback) { 275 | callback(this.data); 276 | }; 277 | 278 | function TextWriter() { 279 | var that = this, blob; 280 | 281 | function init(callback) { 282 | blob = new Blob([], { 283 | type : "text/plain" 284 | }); 285 | callback(); 286 | } 287 | 288 | function writeUint8Array(array, callback) { 289 | blob = new Blob([ blob, appendABViewSupported ? array : array.buffer ], { 290 | type : "text/plain" 291 | }); 292 | callback(); 293 | } 294 | 295 | function getData(callback, onerror) { 296 | var reader = new FileReader(); 297 | reader.onload = function(e) { 298 | callback(e.target.result); 299 | }; 300 | reader.onerror = onerror; 301 | reader.readAsText(blob); 302 | } 303 | 304 | that.init = init; 305 | that.writeUint8Array = writeUint8Array; 306 | that.getData = getData; 307 | } 308 | TextWriter.prototype = new Writer(); 309 | TextWriter.prototype.constructor = TextWriter; 310 | 311 | function Data64URIWriter(contentType) { 312 | var that = this, data = "", pending = ""; 313 | 314 | function init(callback) { 315 | data += "data:" + (contentType || "") + ";base64,"; 316 | callback(); 317 | } 318 | 319 | function writeUint8Array(array, callback) { 320 | var i, delta = pending.length, dataString = pending; 321 | pending = ""; 322 | for (i = 0; i < (Math.floor((delta + array.length) / 3) * 3) - delta; i++) 323 | dataString += String.fromCharCode(array[i]); 324 | for (; i < array.length; i++) 325 | pending += String.fromCharCode(array[i]); 326 | if (dataString.length > 2) 327 | data += obj.btoa(dataString); 328 | else 329 | pending = dataString; 330 | callback(); 331 | } 332 | 333 | function getData(callback) { 334 | callback(data + obj.btoa(pending)); 335 | } 336 | 337 | that.init = init; 338 | that.writeUint8Array = writeUint8Array; 339 | that.getData = getData; 340 | } 341 | Data64URIWriter.prototype = new Writer(); 342 | Data64URIWriter.prototype.constructor = Data64URIWriter; 343 | 344 | function FileWriter(fileEntry, contentType) { 345 | var writer, that = this; 346 | 347 | function init(callback, onerror) { 348 | fileEntry.createWriter(function(fileWriter) { 349 | writer = fileWriter; 350 | callback(); 351 | }, onerror); 352 | } 353 | 354 | function writeUint8Array(array, callback, onerror) { 355 | var blob = new Blob([ appendABViewSupported ? array : array.buffer ], { 356 | type : contentType 357 | }); 358 | writer.onwrite = function() { 359 | writer.onwrite = null; 360 | callback(); 361 | }; 362 | writer.onerror = onerror; 363 | writer.write(blob); 364 | } 365 | 366 | function getData(callback) { 367 | fileEntry.file(callback); 368 | } 369 | 370 | that.init = init; 371 | that.writeUint8Array = writeUint8Array; 372 | that.getData = getData; 373 | } 374 | FileWriter.prototype = new Writer(); 375 | FileWriter.prototype.constructor = FileWriter; 376 | 377 | function BlobWriter(contentType) { 378 | var blob, that = this; 379 | 380 | function init(callback) { 381 | blob = new Blob([], { 382 | type : contentType 383 | }); 384 | callback(); 385 | } 386 | 387 | function writeUint8Array(array, callback) { 388 | blob = new Blob([ blob, appendABViewSupported ? array : array.buffer ], { 389 | type : contentType 390 | }); 391 | callback(); 392 | } 393 | 394 | function getData(callback) { 395 | callback(blob); 396 | } 397 | 398 | that.init = init; 399 | that.writeUint8Array = writeUint8Array; 400 | that.getData = getData; 401 | } 402 | BlobWriter.prototype = new Writer(); 403 | BlobWriter.prototype.constructor = BlobWriter; 404 | 405 | // inflate/deflate core functions 406 | 407 | function launchWorkerProcess(worker, reader, writer, offset, size, onappend, onprogress, onend, onreaderror, onwriteerror) { 408 | var chunkIndex = 0, index, outputSize; 409 | 410 | function onflush() { 411 | worker.removeEventListener("message", onmessage, false); 412 | onend(outputSize); 413 | } 414 | 415 | function onmessage(event) { 416 | var message = event.data, data = message.data; 417 | 418 | if (message.onappend) { 419 | outputSize += data.length; 420 | writer.writeUint8Array(data, function() { 421 | onappend(false, data); 422 | step(); 423 | }, onwriteerror); 424 | } 425 | if (message.onflush) 426 | if (data) { 427 | outputSize += data.length; 428 | writer.writeUint8Array(data, function() { 429 | onappend(false, data); 430 | onflush(); 431 | }, onwriteerror); 432 | } else 433 | onflush(); 434 | if (message.progress && onprogress) 435 | onprogress(index + message.current, size); 436 | } 437 | 438 | function step() { 439 | index = chunkIndex * CHUNK_SIZE; 440 | if (index < size) 441 | reader.readUint8Array(offset + index, Math.min(CHUNK_SIZE, size - index), function(array) { 442 | worker.postMessage({ 443 | append : true, 444 | data : array 445 | }); 446 | chunkIndex++; 447 | if (onprogress) 448 | onprogress(index, size); 449 | onappend(true, array); 450 | }, onreaderror); 451 | else 452 | worker.postMessage({ 453 | flush : true 454 | }); 455 | } 456 | 457 | outputSize = 0; 458 | worker.addEventListener("message", onmessage, false); 459 | step(); 460 | } 461 | 462 | function launchProcess(process, reader, writer, offset, size, onappend, onprogress, onend, onreaderror, onwriteerror) { 463 | var chunkIndex = 0, index, outputSize = 0; 464 | 465 | function step() { 466 | var outputData; 467 | index = chunkIndex * CHUNK_SIZE; 468 | if (index < size) 469 | reader.readUint8Array(offset + index, Math.min(CHUNK_SIZE, size - index), function(inputData) { 470 | var outputData = process.append(inputData, function() { 471 | if (onprogress) 472 | onprogress(offset + index, size); 473 | }); 474 | outputSize += outputData.length; 475 | onappend(true, inputData); 476 | writer.writeUint8Array(outputData, function() { 477 | onappend(false, outputData); 478 | chunkIndex++; 479 | setTimeout(step, 1); 480 | }, onwriteerror); 481 | if (onprogress) 482 | onprogress(index, size); 483 | }, onreaderror); 484 | else { 485 | outputData = process.flush(); 486 | if (outputData) { 487 | outputSize += outputData.length; 488 | writer.writeUint8Array(outputData, function() { 489 | onappend(false, outputData); 490 | onend(outputSize); 491 | }, onwriteerror); 492 | } else 493 | onend(outputSize); 494 | } 495 | } 496 | 497 | step(); 498 | } 499 | 500 | function inflate(reader, writer, offset, size, computeCrc32, onend, onprogress, onreaderror, onwriteerror) { 501 | var worker, crc32 = new Crc32(); 502 | 503 | function oninflateappend(sending, array) { 504 | if (computeCrc32 && !sending) 505 | crc32.append(array); 506 | } 507 | 508 | function oninflateend(outputSize) { 509 | onend(outputSize, crc32.get()); 510 | } 511 | 512 | if (obj.zip.useWebWorkers) { 513 | worker = new Worker(obj.zip.workerScriptsPath + INFLATE_JS); 514 | launchWorkerProcess(worker, reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror); 515 | } else 516 | launchProcess(new obj.zip.Inflater(), reader, writer, offset, size, oninflateappend, onprogress, oninflateend, onreaderror, onwriteerror); 517 | return worker; 518 | } 519 | 520 | function deflate(reader, writer, level, onend, onprogress, onreaderror, onwriteerror) { 521 | var worker, crc32 = new Crc32(); 522 | 523 | function ondeflateappend(sending, array) { 524 | if (sending) 525 | crc32.append(array); 526 | } 527 | 528 | function ondeflateend(outputSize) { 529 | onend(outputSize, crc32.get()); 530 | } 531 | 532 | function onmessage() { 533 | worker.removeEventListener("message", onmessage, false); 534 | launchWorkerProcess(worker, reader, writer, 0, reader.size, ondeflateappend, onprogress, ondeflateend, onreaderror, onwriteerror); 535 | } 536 | 537 | if (obj.zip.useWebWorkers) { 538 | worker = new Worker(obj.zip.workerScriptsPath + DEFLATE_JS); 539 | worker.addEventListener("message", onmessage, false); 540 | worker.postMessage({ 541 | init : true, 542 | level : level 543 | }); 544 | } else 545 | launchProcess(new obj.zip.Deflater(), reader, writer, 0, reader.size, ondeflateappend, onprogress, ondeflateend, onreaderror, onwriteerror); 546 | return worker; 547 | } 548 | 549 | function copy(reader, writer, offset, size, computeCrc32, onend, onprogress, onreaderror, onwriteerror) { 550 | var chunkIndex = 0, crc32 = new Crc32(); 551 | 552 | function step() { 553 | var index = chunkIndex * CHUNK_SIZE; 554 | if (index < size) 555 | reader.readUint8Array(offset + index, Math.min(CHUNK_SIZE, size - index), function(array) { 556 | if (computeCrc32) 557 | crc32.append(array); 558 | if (onprogress) 559 | onprogress(index, size, array); 560 | writer.writeUint8Array(array, function() { 561 | chunkIndex++; 562 | step(); 563 | }, onwriteerror); 564 | }, onreaderror); 565 | else 566 | onend(size, crc32.get()); 567 | } 568 | 569 | step(); 570 | } 571 | 572 | // ZipReader 573 | 574 | function decodeASCII(str) { 575 | var i, out = "", charCode, extendedASCII = [ '\u00C7', '\u00FC', '\u00E9', '\u00E2', '\u00E4', '\u00E0', '\u00E5', '\u00E7', '\u00EA', '\u00EB', 576 | '\u00E8', '\u00EF', '\u00EE', '\u00EC', '\u00C4', '\u00C5', '\u00C9', '\u00E6', '\u00C6', '\u00F4', '\u00F6', '\u00F2', '\u00FB', '\u00F9', 577 | '\u00FF', '\u00D6', '\u00DC', '\u00F8', '\u00A3', '\u00D8', '\u00D7', '\u0192', '\u00E1', '\u00ED', '\u00F3', '\u00FA', '\u00F1', '\u00D1', 578 | '\u00AA', '\u00BA', '\u00BF', '\u00AE', '\u00AC', '\u00BD', '\u00BC', '\u00A1', '\u00AB', '\u00BB', '_', '_', '_', '\u00A6', '\u00A6', 579 | '\u00C1', '\u00C2', '\u00C0', '\u00A9', '\u00A6', '\u00A6', '+', '+', '\u00A2', '\u00A5', '+', '+', '-', '-', '+', '-', '+', '\u00E3', 580 | '\u00C3', '+', '+', '-', '-', '\u00A6', '-', '+', '\u00A4', '\u00F0', '\u00D0', '\u00CA', '\u00CB', '\u00C8', 'i', '\u00CD', '\u00CE', 581 | '\u00CF', '+', '+', '_', '_', '\u00A6', '\u00CC', '_', '\u00D3', '\u00DF', '\u00D4', '\u00D2', '\u00F5', '\u00D5', '\u00B5', '\u00FE', 582 | '\u00DE', '\u00DA', '\u00DB', '\u00D9', '\u00FD', '\u00DD', '\u00AF', '\u00B4', '\u00AD', '\u00B1', '_', '\u00BE', '\u00B6', '\u00A7', 583 | '\u00F7', '\u00B8', '\u00B0', '\u00A8', '\u00B7', '\u00B9', '\u00B3', '\u00B2', '_', ' ' ]; 584 | for (i = 0; i < str.length; i++) { 585 | charCode = str.charCodeAt(i) & 0xFF; 586 | if (charCode > 127) 587 | out += extendedASCII[charCode - 128]; 588 | else 589 | out += String.fromCharCode(charCode); 590 | } 591 | return out; 592 | } 593 | 594 | function decodeUTF8(str_data) { 595 | var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0; 596 | 597 | str_data += ''; 598 | 599 | while (i < str_data.length) { 600 | c1 = str_data.charCodeAt(i); 601 | if (c1 < 128) { 602 | tmp_arr[ac++] = String.fromCharCode(c1); 603 | i++; 604 | } else if (c1 > 191 && c1 < 224) { 605 | c2 = str_data.charCodeAt(i + 1); 606 | tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); 607 | i += 2; 608 | } else { 609 | c2 = str_data.charCodeAt(i + 1); 610 | c3 = str_data.charCodeAt(i + 2); 611 | tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 612 | i += 3; 613 | } 614 | } 615 | 616 | return tmp_arr.join(''); 617 | } 618 | 619 | function getString(bytes) { 620 | var i, str = ""; 621 | for (i = 0; i < bytes.length; i++) 622 | str += String.fromCharCode(bytes[i]); 623 | return str; 624 | } 625 | 626 | function getDate(timeRaw) { 627 | var date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff; 628 | try { 629 | return new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, 630 | (time & 0x001F) * 2, 0); 631 | } catch (e) { 632 | } 633 | } 634 | 635 | function readCommonHeader(entry, data, index, centralDirectory, onerror) { 636 | entry.version = data.view.getUint16(index, true); 637 | entry.bitFlag = data.view.getUint16(index + 2, true); 638 | entry.compressionMethod = data.view.getUint16(index + 4, true); 639 | entry.lastModDateRaw = data.view.getUint32(index + 6, true); 640 | entry.lastModDate = getDate(entry.lastModDateRaw); 641 | if ((entry.bitFlag & 0x01) === 0x01) { 642 | onerror(ERR_ENCRYPTED); 643 | return; 644 | } 645 | if (centralDirectory || (entry.bitFlag & 0x0008) != 0x0008) { 646 | entry.crc32 = data.view.getUint32(index + 10, true); 647 | entry.compressedSize = data.view.getUint32(index + 14, true); 648 | entry.uncompressedSize = data.view.getUint32(index + 18, true); 649 | } 650 | if (entry.compressedSize === 0xFFFFFFFF || entry.uncompressedSize === 0xFFFFFFFF) { 651 | onerror(ERR_ZIP64); 652 | return; 653 | } 654 | entry.filenameLength = data.view.getUint16(index + 22, true); 655 | entry.extraFieldLength = data.view.getUint16(index + 24, true); 656 | } 657 | 658 | function createZipReader(reader, onerror) { 659 | function Entry() { 660 | } 661 | 662 | Entry.prototype.getData = function(writer, onend, onprogress, checkCrc32) { 663 | var that = this, worker; 664 | 665 | function terminate(callback, param) { 666 | if (worker) 667 | worker.terminate(); 668 | worker = null; 669 | if (callback) 670 | callback(param); 671 | } 672 | 673 | function testCrc32(crc32) { 674 | var dataCrc32 = getDataHelper(4); 675 | dataCrc32.view.setUint32(0, crc32); 676 | return that.crc32 == dataCrc32.view.getUint32(0); 677 | } 678 | 679 | function getWriterData(uncompressedSize, crc32) { 680 | if (checkCrc32 && !testCrc32(crc32)) 681 | onreaderror(); 682 | else 683 | writer.getData(function(data) { 684 | terminate(onend, data); 685 | }); 686 | } 687 | 688 | function onreaderror() { 689 | terminate(onerror, ERR_READ_DATA); 690 | } 691 | 692 | function onwriteerror() { 693 | terminate(onerror, ERR_WRITE_DATA); 694 | } 695 | 696 | reader.readUint8Array(that.offset, 30, function(bytes) { 697 | var data = getDataHelper(bytes.length, bytes), dataOffset; 698 | if (data.view.getUint32(0) != 0x504b0304) { 699 | onerror(ERR_BAD_FORMAT); 700 | return; 701 | } 702 | readCommonHeader(that, data, 4, false, function(error) { 703 | onerror(error); 704 | return; 705 | }); 706 | dataOffset = that.offset + 30 + that.filenameLength + that.extraFieldLength; 707 | writer.init(function() { 708 | if (that.compressionMethod === 0) 709 | copy(reader, writer, dataOffset, that.compressedSize, checkCrc32, getWriterData, onprogress, onreaderror, onwriteerror); 710 | else 711 | worker = inflate(reader, writer, dataOffset, that.compressedSize, checkCrc32, getWriterData, onprogress, onreaderror, onwriteerror); 712 | }, onwriteerror); 713 | }, onreaderror); 714 | }; 715 | 716 | function seekEOCDR(offset, entriesCallback) { 717 | reader.readUint8Array(reader.size - offset, offset, function(bytes) { 718 | var dataView = getDataHelper(bytes.length, bytes).view; 719 | if (dataView.getUint32(0) != 0x504b0506) { 720 | seekEOCDR(offset + 1, entriesCallback); 721 | } else { 722 | entriesCallback(dataView); 723 | } 724 | }, function() { 725 | onerror(ERR_READ); 726 | }); 727 | } 728 | 729 | return { 730 | getEntries : function(callback) { 731 | if (reader.size < 22) { 732 | onerror(ERR_BAD_FORMAT); 733 | return; 734 | } 735 | // look for End of central directory record 736 | seekEOCDR(22, function(dataView) { 737 | var datalength, fileslength; 738 | datalength = dataView.getUint32(16, true); 739 | fileslength = dataView.getUint16(8, true); 740 | reader.readUint8Array(datalength, reader.size - datalength, function(bytes) { 741 | var i, index = 0, entries = [], entry, filename, comment, data = getDataHelper(bytes.length, bytes); 742 | for (i = 0; i < fileslength; i++) { 743 | entry = new Entry(); 744 | if (data.view.getUint32(index) != 0x504b0102) { 745 | onerror(ERR_BAD_FORMAT); 746 | return; 747 | } 748 | readCommonHeader(entry, data, index + 6, true, function(error) { 749 | onerror(error); 750 | return; 751 | }); 752 | entry.commentLength = data.view.getUint16(index + 32, true); 753 | entry.directory = ((data.view.getUint8(index + 38) & 0x10) == 0x10); 754 | entry.offset = data.view.getUint32(index + 42, true); 755 | filename = getString(data.array.subarray(index + 46, index + 46 + entry.filenameLength)); 756 | entry.filename = ((entry.bitFlag & 0x0800) === 0x0800) ? decodeUTF8(filename) : decodeASCII(filename); 757 | if (!entry.directory && entry.filename.charAt(entry.filename.length - 1) == "/") 758 | entry.directory = true; 759 | comment = getString(data.array.subarray(index + 46 + entry.filenameLength + entry.extraFieldLength, index + 46 760 | + entry.filenameLength + entry.extraFieldLength + entry.commentLength)); 761 | entry.comment = ((entry.bitFlag & 0x0800) === 0x0800) ? decodeUTF8(comment) : decodeASCII(comment); 762 | entries.push(entry); 763 | index += 46 + entry.filenameLength + entry.extraFieldLength + entry.commentLength; 764 | } 765 | callback(entries); 766 | }, function() { 767 | onerror(ERR_READ); 768 | }); 769 | }); 770 | }, 771 | close : function(callback) { 772 | if (callback) 773 | callback(); 774 | } 775 | }; 776 | } 777 | 778 | // ZipWriter 779 | 780 | function encodeUTF8(string) { 781 | var n, c1, enc, utftext = [], start = 0, end = 0, stringl = string.length; 782 | for (n = 0; n < stringl; n++) { 783 | c1 = string.charCodeAt(n); 784 | enc = null; 785 | if (c1 < 128) 786 | end++; 787 | else if (c1 > 127 && c1 < 2048) 788 | enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128); 789 | else 790 | enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128); 791 | if (enc != null) { 792 | if (end > start) 793 | utftext += string.slice(start, end); 794 | utftext += enc; 795 | start = end = n + 1; 796 | } 797 | } 798 | if (end > start) 799 | utftext += string.slice(start, stringl); 800 | return utftext; 801 | } 802 | 803 | function getBytes(str) { 804 | var i, array = []; 805 | for (i = 0; i < str.length; i++) 806 | array.push(str.charCodeAt(i)); 807 | return array; 808 | } 809 | 810 | function createZipWriter(writer, onerror, dontDeflate) { 811 | var worker, files = [], filenames = [], datalength = 0; 812 | 813 | function terminate(callback, message) { 814 | if (worker) 815 | worker.terminate(); 816 | worker = null; 817 | if (callback) 818 | callback(message); 819 | } 820 | 821 | function onwriteerror() { 822 | terminate(onerror, ERR_WRITE); 823 | } 824 | 825 | function onreaderror() { 826 | terminate(onerror, ERR_READ_DATA); 827 | } 828 | 829 | return { 830 | add : function(name, reader, onend, onprogress, options) { 831 | var header, filename, date; 832 | 833 | function writeHeader(callback) { 834 | var data; 835 | date = options.lastModDate || new Date(); 836 | header = getDataHelper(26); 837 | files[name] = { 838 | headerArray : header.array, 839 | directory : options.directory, 840 | filename : filename, 841 | offset : datalength, 842 | comment : getBytes(encodeUTF8(options.comment || "")) 843 | }; 844 | header.view.setUint32(0, 0x14000808); 845 | if (options.version) 846 | header.view.setUint8(0, options.version); 847 | if (!dontDeflate && options.level != 0 && !options.directory) 848 | header.view.setUint16(4, 0x0800); 849 | header.view.setUint16(6, (((date.getHours() << 6) | date.getMinutes()) << 5) | date.getSeconds() / 2, true); 850 | header.view.setUint16(8, ((((date.getFullYear() - 1980) << 4) | (date.getMonth() + 1)) << 5) | date.getDate(), true); 851 | header.view.setUint16(22, filename.length, true); 852 | data = getDataHelper(30 + filename.length); 853 | data.view.setUint32(0, 0x504b0304); 854 | data.array.set(header.array, 4); 855 | data.array.set(filename, 30); 856 | datalength += data.array.length; 857 | writer.writeUint8Array(data.array, callback, onwriteerror); 858 | } 859 | 860 | function writeFooter(compressedLength, crc32) { 861 | var footer = getDataHelper(16); 862 | datalength += compressedLength || 0; 863 | footer.view.setUint32(0, 0x504b0708); 864 | if (typeof crc32 != "undefined") { 865 | header.view.setUint32(10, crc32, true); 866 | footer.view.setUint32(4, crc32, true); 867 | } 868 | if (reader) { 869 | footer.view.setUint32(8, compressedLength, true); 870 | header.view.setUint32(14, compressedLength, true); 871 | footer.view.setUint32(12, reader.size, true); 872 | header.view.setUint32(18, reader.size, true); 873 | } 874 | writer.writeUint8Array(footer.array, function() { 875 | datalength += 16; 876 | terminate(onend); 877 | }, onwriteerror); 878 | } 879 | 880 | function writeFile() { 881 | options = options || {}; 882 | name = name.trim(); 883 | if (options.directory && name.charAt(name.length - 1) != "/") 884 | name += "/"; 885 | if (files[name]) 886 | throw ERR_DUPLICATED_NAME; 887 | filename = getBytes(encodeUTF8(name)); 888 | filenames.push(name); 889 | writeHeader(function() { 890 | if (reader) 891 | if (dontDeflate || options.level == 0) 892 | copy(reader, writer, 0, reader.size, true, writeFooter, onprogress, onreaderror, onwriteerror); 893 | else 894 | worker = deflate(reader, writer, options.level, writeFooter, onprogress, onreaderror, onwriteerror); 895 | else 896 | writeFooter(); 897 | }, onwriteerror); 898 | } 899 | 900 | if (reader) 901 | reader.init(writeFile, onreaderror); 902 | else 903 | writeFile(); 904 | }, 905 | close : function(callback) { 906 | var data, length = 0, index = 0; 907 | filenames.forEach(function(name) { 908 | var file = files[name]; 909 | length += 46 + file.filename.length + file.comment.length; 910 | }); 911 | data = getDataHelper(length + 22); 912 | filenames.forEach(function(name) { 913 | var file = files[name]; 914 | data.view.setUint32(index, 0x504b0102); 915 | data.view.setUint16(index + 4, 0x1400); 916 | data.array.set(file.headerArray, index + 6); 917 | data.view.setUint16(index + 32, file.comment.length, true); 918 | if (file.directory) 919 | data.view.setUint8(index + 38, 0x10); 920 | data.view.setUint32(index + 42, file.offset, true); 921 | data.array.set(file.filename, index + 46); 922 | data.array.set(file.comment, index + 46 + file.filename.length); 923 | index += 46 + file.filename.length + file.comment.length; 924 | }); 925 | data.view.setUint32(index, 0x504b0506); 926 | data.view.setUint16(index + 8, filenames.length, true); 927 | data.view.setUint16(index + 10, filenames.length, true); 928 | data.view.setUint32(index + 12, length, true); 929 | data.view.setUint32(index + 16, datalength, true); 930 | writer.writeUint8Array(data.array, function() { 931 | terminate(function() { 932 | writer.getData(callback); 933 | }); 934 | }, onwriteerror); 935 | } 936 | }; 937 | } 938 | 939 | obj.zip = { 940 | Reader : Reader, 941 | Writer : Writer, 942 | BlobReader : BlobReader, 943 | HttpReader : HttpReader, 944 | HttpRangeReader : HttpRangeReader, 945 | Data64URIReader : Data64URIReader, 946 | TextReader : TextReader, 947 | BlobWriter : BlobWriter, 948 | FileWriter : FileWriter, 949 | Data64URIWriter : Data64URIWriter, 950 | TextWriter : TextWriter, 951 | createReader : function(reader, callback, onerror) { 952 | reader.init(function() { 953 | callback(createZipReader(reader, onerror)); 954 | }, onerror); 955 | }, 956 | createWriter : function(writer, callback, onerror, dontDeflate) { 957 | writer.init(function() { 958 | callback(createZipWriter(writer, onerror, dontDeflate)); 959 | }, onerror); 960 | }, 961 | workerScriptsPath : "", 962 | useWebWorkers : true 963 | }; 964 | 965 | })(this); -------------------------------------------------------------------------------- /src/tl.grid.css: -------------------------------------------------------------------------------- 1 | .lxg-frame{ 2 | display:block; 3 | position:relative; 4 | float:left; 5 | width:860px; 6 | height:700px; 7 | min-height:1px; 8 | overflow:hidden; 9 | margin:0; 10 | padding:0; 11 | outline:none; 12 | font-family: "Segoe UI","Segoe WPC","Segoe UI","微软雅黑"; 13 | border:rgb(212, 212, 212) 1px solid; 14 | background-color: #fff; 15 | border-radius: 8px 8px 0 0; 16 | } 17 | .lxg-toolbar{ 18 | display:block; 19 | position:absolute; 20 | left:0; 21 | top:0; 22 | width:100%; 23 | min-width:1px; 24 | height:55px; 25 | min-height:1px; 26 | overflow:hidden; 27 | margin:0; 28 | padding:0; 29 | outline:none; 30 | z-index:5004; 31 | cursor:default; 32 | border-bottom:1px rgb(171, 171, 171) solid; 33 | background-color: #fff; 34 | background-image: linear-gradient(rgb(255, 255, 255), rgb(248, 248, 248), rgb(248, 248, 248)); 35 | } 36 | .lxg-tbmenu-bar{ 37 | display:block; 38 | position:absolute; 39 | left:0; 40 | top:0; 41 | width:auto; 42 | min-width:64px; 43 | height:24px; 44 | line-height:24px; 45 | overflow:hidden; 46 | margin:0; 47 | padding:0; 48 | outline:none; 49 | z-index:5006; 50 | cursor:default; 51 | } 52 | .lxg-tbmenu-title{ 53 | float:left; 54 | width:auto; 55 | min-width:1px; 56 | height:24px; 57 | line-height:24px; 58 | text-align:center; 59 | font-size:12px; 60 | margin:0; 61 | padding:0 8px; 62 | color:#777; 63 | overflow:hidden; 64 | text-align:center; 65 | background-color: rgb(236, 236, 236); 66 | } 67 | .lxg-tbmenu-item{ 68 | float:left; 69 | width:auto; 70 | min-width: 1px; 71 | height:24px; 72 | line-height:24px; 73 | text-align:center; 74 | color:#111; 75 | font-size:12px; 76 | margin:0; 77 | padding:0 8px; 78 | -webkit-transition:all 0.3s linear; 79 | -moz-transition:all 0.3s linear; 80 | } 81 | .lxg-tbmenu-item:hover{ 82 | color:rgb(57, 85, 163); 83 | text-shadow: 0 0 1px rgba(57, 85, 163, 0.1); 84 | box-shadow:inset 0 0 1px rgba(57, 85, 163, 0.3); 85 | } 86 | .lxg-tbmenu-item.selected{ 87 | background-color:rgb(57, 85, 163); 88 | color:#eee; 89 | } 90 | .lxg-tbctrl-bar{ 91 | display:block; 92 | position:absolute; 93 | left:0; 94 | top:24px; 95 | width:100%; 96 | height:28px; 97 | line-height:24px; 98 | overflow:hidden; 99 | margin:0; 100 | padding:0; 101 | outline:none; 102 | z-index:5006; 103 | cursor:default; 104 | } 105 | .lxg-tbctrl-input{ 106 | float:left; 107 | width:128px; 108 | height:16px; 109 | line-height:16px; 110 | text-align:left; 111 | color:#111; 112 | font-size:12px; 113 | margin:4px 4px; 114 | padding:2px 8px; 115 | border:1px rgb(212, 212, 212) solid; 116 | background:transparent; 117 | outline: none; 118 | } 119 | .lxg-tbctrl-input.long{ 120 | width:256px; 121 | resize:none; 122 | } 123 | .lxg-tbctrl-input:focus{ 124 | background-color:#fff; 125 | } 126 | .lxg-tbctrl-iconbut{ 127 | float:left; 128 | width:22px; 129 | height:22px; 130 | line-height:16px; 131 | text-align:center; 132 | color:#111; 133 | font-size:12px; 134 | margin:4px 0; 135 | padding:0px; 136 | border:none; 137 | background-color: transparent; 138 | background-position: center; 139 | background-repeat:no-repeat; 140 | outline: none; 141 | cursor:default; 142 | } 143 | .lxg-tbctrl-iconbut.search{ 144 | width:20px; 145 | height:20px; 146 | border-top:1px rgb(198, 198, 198) solid; 147 | border-bottom:1px rgb(198, 198, 198) solid; 148 | } 149 | .lxg-tbctrl-iconbut.search.end{ 150 | border-right:1px rgb(198, 198, 198) solid; 151 | border-radius:0 10px 10px 0; 152 | margin-right:8px; 153 | } 154 | .lxg-tbctrl-iconbut:hover{ 155 | background-color:rgba(57, 85, 163, 0.1); 156 | } 157 | .lxg-tbctrl-iconbut:active{ 158 | background-color:rgba(57, 85, 163, 0.5); 159 | } 160 | .lxg-header{ 161 | display:block; 162 | position:absolute; 163 | left:0; 164 | top:32px; 165 | width:auto; 166 | min-width:100%; 167 | height:24px; 168 | min-height:1px; 169 | overflow:hidden; 170 | margin:0; 171 | padding:0; 172 | outline:none; 173 | z-index:5004; 174 | border-bottom:1px rgb(171, 171, 171) solid; 175 | cursor:pointer; 176 | background-color: #fff; 177 | background-image: linear-gradient(rgb(248, 248, 248), rgb(255, 255, 255)); 178 | /*box-shadow: 0 4px 2px rgba(0, 0, 0, 0.1);*/ 179 | } 180 | .lxg-tab{ 181 | display:block; 182 | position:absolute; 183 | left:0; 184 | top:25px; 185 | width:auto; 186 | min-width:1px; 187 | height:auto; 188 | min-height: 25px; 189 | overflow:hidden; 190 | margin:0 20px 0 0; 191 | padding:0; 192 | outline:none; 193 | z-index:5002; 194 | } 195 | .lxg-footer{ 196 | display:block; 197 | position:absolute; 198 | clear:both; 199 | float:left; 200 | width:auto; 201 | min-width:1px; 202 | height:24px; 203 | bottom:0; 204 | left:0; 205 | right:0; 206 | overflow:hidden; 207 | margin:0; 208 | padding:0; 209 | outline:none; 210 | z-index:5004; 211 | border-top:1px rgb(171, 171, 171) solid; 212 | background-color: rgb(57, 85, 163); 213 | } 214 | .lxg-scroll-h{ 215 | display:block; 216 | position:absolute; 217 | clear:both; 218 | float:left; 219 | width:auto; 220 | height:10px; 221 | bottom:24px; 222 | left:0; 223 | right:0; 224 | overflow:hidden; 225 | margin:1px 0; 226 | padding:0 11px 0 1px; 227 | outline:none; 228 | z-index:5004; 229 | background-color:#fff; 230 | background-image: linear-gradient(rgb(255, 255, 255), rgb(192, 192, 192)); 231 | } 232 | .lxg-scroll-v{ 233 | display:block; 234 | position:absolute; 235 | clear:both; 236 | width:10px; 237 | height:auto; 238 | top:32px; 239 | right:0; 240 | bottom:35px; 241 | overflow:hidden; 242 | margin:0; 243 | padding:1px 0; 244 | outline:none; 245 | z-index:5004; 246 | background-color:#fff; 247 | background-image: linear-gradient(90deg, rgb(255, 255, 255), rgb(224, 224, 224)); 248 | } 249 | .lxg-scroll-bar{ 250 | width:8px; 251 | height:8px; 252 | margin:0; 253 | background-color:#fff; 254 | padding:0; 255 | position:absolute; 256 | left:0; 257 | top:0; 258 | z-index:5006; 259 | cursor:default; 260 | border:1px rgb(171, 171, 171) solid; 261 | border-radius:5px; 262 | } 263 | .lxg-footer-tips{ 264 | display:block; 265 | font-size:12px; 266 | font-weight: normal; 267 | text-align:left; 268 | line-height:24px; 269 | height:24px; 270 | width:auto; 271 | margin:0; 272 | padding:0; 273 | float:left; 274 | overflow:hidden; 275 | min-width:1px; 276 | text-indent:8px; 277 | background-color: rgb(57, 85, 163); 278 | color: #fff; 279 | } 280 | .lxg-footer-button{ 281 | display:block; 282 | color:#fff; 283 | background-color: rgb(57, 85, 163); 284 | font-size:12px; 285 | width:auto; 286 | min-width:24px; 287 | padding:0 4px; 288 | margin:4px; 289 | height:16px; 290 | line-height:15px; 291 | text-align:center; 292 | float:right; 293 | cursor:pointer; 294 | box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.5); 295 | } 296 | .lxg-footer-button:active{ 297 | box-shadow: 298 | inset 1px 1px 1px rgba(0, 0, 0, 0.2), 299 | inset -1px -1px 1px rgba(255, 255, 255, 0.2); 300 | } 301 | .lxg-footer-label{ 302 | display:block; 303 | color:#fff; 304 | background-color: rgb(57, 85, 163); 305 | font-size:12px; 306 | width:auto; 307 | min-width:1px; 308 | padding:0; 309 | margin:4px; 310 | height:16px; 311 | line-height:15px; 312 | text-align:center; 313 | float:right; 314 | } 315 | .lxg-footer-input{ 316 | display:block; 317 | color:#fff; 318 | background-color: rgb(57, 85, 163); 319 | border:1px solid #fff; 320 | font-size:12px; 321 | width:40px; 322 | min-width:24px; 323 | padding:0; 324 | margin:4px; 325 | height:14px; 326 | line-height:15px; 327 | text-align:center; 328 | float:right; 329 | outline:none; 330 | } 331 | .lxg-footer-sep{ 332 | display:block; 333 | width:0; 334 | padding:0; 335 | margin:4px; 336 | height:16px; 337 | float:right; 338 | border-left:1px #fff solid; 339 | } 340 | .lxg-footer-tri-l, .lxg-footer-tri-r{ 341 | display:block; 342 | width:0; 343 | height:0; 344 | padding:0; 345 | margin:6px; 346 | float:right; 347 | cursor:pointer; 348 | border:6px solid; 349 | } 350 | .lxg-footer-tri-l{ 351 | border-color: rgb(57, 85, 163) #fff rgb(57, 85, 163) rgb(57, 85, 163); 352 | } 353 | .lxg-footer-tri-r{ 354 | border-color: rgb(57, 85, 163) rgb(57, 85, 163) rgb(57, 85, 163) #fff; 355 | } 356 | .lxg-line{ 357 | display:block; 358 | clear:both; 359 | height:24px; 360 | width:auto; 361 | min-width:1px; 362 | overflow:hidden; 363 | margin:0; 364 | padding:0; 365 | outline:none; 366 | border-bottom:1px rgb(212, 212, 212) solid; 367 | } 368 | .lxg-tri-u{ 369 | position:absolute; 370 | right:4px; 371 | top:2px; 372 | width:0; 373 | height:0; 374 | border:4px solid; 375 | border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #ccc rgba(0, 0, 0, 0); 376 | } 377 | .lxg-tri-d{ 378 | position:absolute; 379 | right:4px; 380 | bottom:2px; 381 | width:0; 382 | height:0; 383 | border:4px solid; 384 | border-color: #ccc rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0); 385 | } 386 | .lxg-tri-u.active{ 387 | border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgb(57, 85, 163) rgba(0, 0, 0, 0); 388 | } 389 | .lxg-tri-d.active{ 390 | border-color: rgb(57, 85, 163) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0); 391 | } 392 | .lxg-tri-u:hover{ 393 | border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgb(57, 85, 163) rgba(0, 0, 0, 0); 394 | } 395 | .lxg-tri-d:hover{ 396 | border-color: rgb(57, 85, 163) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0); 397 | } 398 | .lxg-grid{ 399 | display:block; 400 | clear:none; 401 | float:left; 402 | width:96px; 403 | height:100%; 404 | line-height:24px; 405 | text-align:right; 406 | overflow:hidden; 407 | margin:0; 408 | padding:0 2px; 409 | outline:none; 410 | font-size:14px; 411 | border-right:1px rgb(212, 212, 212) solid; 412 | } 413 | .lxg-grid:first-child{ 414 | font-weight:bold; 415 | color:#777; 416 | text-align:center; 417 | border-right:1px rgb(171, 171, 171) solid; 418 | } 419 | .lxg-grid.color-0{ 420 | color: #222; 421 | } 422 | .lxg-grid.color-1{ 423 | color: rgb(34, 177, 76); 424 | } 425 | .lxg-grid.color-2{ 426 | color: rgb(0, 162, 232); 427 | } 428 | .lxg-grid.color-3{ 429 | color: rgb(163, 73, 164); 430 | } 431 | .lxg-grid.color-4{ 432 | color: rgb(255, 127, 39); 433 | } 434 | .lxg-grid.color-5{ 435 | color: rgb(232, 182, 0); 436 | } 437 | .lxg-grid.mod{ 438 | background-color:rgba(255, 217, 191, 0.3); 439 | } 440 | .lxg-grid.hd{ 441 | position:relative; 442 | text-align:center; 443 | font-weight:bold; 444 | color:#777; 445 | border-right:none; 446 | } 447 | .lxg-grid.hd:hover{ 448 | background-color:rgb(224, 224, 224); 449 | background-image: linear-gradient(rgb(255, 255, 255), rgb(230, 230, 230)); 450 | } 451 | .lxg-hdsep{ 452 | display:block; 453 | clear:none; 454 | float:left; 455 | width:2px; 456 | height:100%; 457 | overflow:hidden; 458 | margin:0; 459 | padding:0; 460 | background-color: #eee; 461 | border-right: rgb(171, 171, 171) solid 1px; 462 | cursor:e-resize; 463 | } 464 | .lxg-hide{ 465 | display:none; 466 | } 467 | .lxg-cover{ 468 | display:block; 469 | position:absolute; 470 | left:0; 471 | top:0; 472 | right:0; 473 | bottom:0; 474 | width:100%; 475 | height:100%; 476 | z-index:5500; 477 | background-color:rgba(0, 0, 0, 0); 478 | opacity:0.1; 479 | cursor:default; 480 | } 481 | .lxg-select{ 482 | display:block; 483 | position:absolute; 484 | z-index:5050; 485 | background-color:rgba(57, 85, 163, 0.1); 486 | border:2px rgba(57, 85, 163, 0.9) dotted; 487 | -webkit-transition:all 0.1s linear; 488 | -moz-transition:all 0.1s linear; 489 | } 490 | .lxg-selected{ 491 | display:block; 492 | position:absolute; 493 | z-index:5050; 494 | background-color:rgba(57, 85, 163, 0.1); 495 | border:2px rgba(57, 85, 163, 0.9) solid; 496 | -webkit-transition:all 0.1s linear; 497 | -moz-transition:all 0.1s linear; 498 | } 499 | .lxg-selected-line{ 500 | display:block; 501 | position:absolute; 502 | z-index:5048; 503 | -webkit-transition:all 0.1s linear; 504 | -moz-transition:all 0.1s linear; 505 | height: 250px; 506 | width: 375px; 507 | background-color: rgba(57, 85, 163, 0.1); 508 | } 509 | .lxg-select-display{ 510 | display:block; 511 | position:absolute; 512 | z-index:5045; 513 | background-color:#fff; 514 | width:auto; 515 | min-width:1px; 516 | min-height:24px; 517 | line-height:24px; 518 | height:auto; 519 | overflow:hidden; 520 | text-align:right; 521 | padding:0 2px; 522 | box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3); 523 | } 524 | .lxg-auto{ 525 | display:block; 526 | position:absolute; 527 | z-index:5055; 528 | background-color:rgb(57, 85, 163); 529 | border-left:1px #fff solid; 530 | border-top:1px #fff solid; 531 | border-right:1px #111 solid; 532 | border-bottom:1px #111 solid; 533 | width:4px; 534 | height:4px; 535 | cursor:crosshair; 536 | } 537 | .lxg-auto-select{ 538 | display:block; 539 | position:absolute; 540 | z-index:5050; 541 | border:2px rgba(57, 85, 163, 0.9) solid; 542 | -webkit-transition:all 0.1s linear; 543 | -moz-transition:all 0.1s linear; 544 | } 545 | .lxg-edit-text{ 546 | display:block; 547 | position:absolute; 548 | z-index:5550; 549 | background-color:#fff; 550 | border:2px rgba(57, 85, 163, 0.9) solid; 551 | -webkit-transition:all 0.1s linear; 552 | -moz-transition:all 0.1s linear; 553 | margin:0; 554 | padding:0; 555 | outline:none; 556 | line-height:24px; 557 | text-align:left; 558 | overflow:hidden; 559 | width:auto; 560 | height:auto; 561 | } 562 | .lxg-edit-select{ 563 | display:block; 564 | position:absolute; 565 | z-index:5550; 566 | background-color:#fff; 567 | border:2px rgba(57, 85, 163, 0.9) solid; 568 | -webkit-transition:all 0.1s linear; 569 | -moz-transition:all 0.1s linear; 570 | margin:0; 571 | padding:0; 572 | outline:none; 573 | line-height:24px; 574 | text-align:left; 575 | overflow:hidden; 576 | width:auto; 577 | height:auto; 578 | } 579 | .lxg-menu{ 580 | display:block; 581 | position:absolute; 582 | z-index:6000; 583 | background-color:#fff; 584 | border:1px rgb(168, 168, 168) solid; 585 | margin:0; 586 | padding:0; 587 | width:auto; 588 | min-width:1px; 589 | height:auto; 590 | min-height:1px; 591 | overflow:hidden; 592 | cursor:default; 593 | box-shadow:0 0 4px rgba(0, 0, 0, 0.3); 594 | } 595 | .lxg-menu-item{ 596 | display:block; 597 | clear:both; 598 | margin:0; 599 | padding:4px 4px 4px 20px; 600 | width:104px; 601 | height:16px; 602 | line-height:16px; 603 | font-size:12px; 604 | text-align:left; 605 | color:#111; 606 | background-color:#fff; 607 | } 608 | .lxg-menu-item.b{ 609 | font-weight:bold; 610 | } 611 | .lxg-menu-item:hover{ 612 | color:#eee; 613 | background-color:#777; 614 | } 615 | .lxg-menu-item:hover input{ 616 | color:#eee; 617 | background-color:#777; 618 | } 619 | .lxg-menu-item input{ 620 | display:inline; 621 | width:24px; 622 | height:14px; 623 | margin:0 4px; 624 | padding:0; 625 | border:0; 626 | border-bottom:1px rgb(212, 212, 212) solid; 627 | outline:none; 628 | text-align:center; 629 | } 630 | .lxg-menu-sep{ 631 | display:block; 632 | clear:both; 633 | margin:2px auto; 634 | padding:0; 635 | width:104px; 636 | height:0; 637 | border-bottom:1px #ddd solid; 638 | } 639 | .lxg-fullscreen{ 640 | position: fixed; 641 | left:0; 642 | right:0; 643 | top:0; 644 | bottom:0; 645 | border:none; 646 | border-radius:0; 647 | } 648 | .lxg-detail-area{ 649 | display:block; 650 | margin:0; 651 | padding:0; 652 | clear:both; 653 | overflow:auto; 654 | } 655 | .lxg-loading{ 656 | display:block; 657 | position:absolute; 658 | z-index:5005; 659 | width:128px; 660 | height:24px; 661 | line-height:24px; 662 | background-color:rgba(0, 0, 0, 0.6); 663 | color:#eee; 664 | font-size:14px; 665 | font-weight:bold; 666 | text-align:center; 667 | border-radius:3px; 668 | box-shadow:0 0 4px rgba(0, 0, 0, 0.6); 669 | } 670 | .lx-search.slim{ 671 | padding:2px 4px; 672 | margin-right:0; 673 | border-right:none; 674 | border-radius: 10px 0 0 10px; 675 | background-position: 4px 5px; 676 | width:120px; 677 | float:right; 678 | background: transparent; 679 | } 680 | .lxg-slimtable{ 681 | border-collapse: collapse; 682 | } 683 | .lxg-slimtable tr{ 684 | 685 | } 686 | .lxg-slimtable * td{ 687 | border: 1px solid #999; 688 | padding: 0 4px; 689 | min-width:64px; 690 | max-width:128px; 691 | overflow:hidden; 692 | text-overflow:ellipsis; 693 | font-size:12px; 694 | } 695 | .lxg-upload-button{ 696 | width:72px; 697 | } 698 | .lxg-upload-input{ 699 | position:absolute; 700 | right:4px; 701 | top:3px; 702 | width:82px; 703 | height:26px; 704 | opacity:0; 705 | } 706 | .right{ 707 | float:right; 708 | } 709 | .left{ 710 | float:left; 711 | } -------------------------------------------------------------------------------- /src/tl.import.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 导入表格 3 | */ 4 | $(document).ready(function(){ 5 | Grid.Lang.extend({ 6 | PREVIEW : '预览', 7 | IMPORT_EXCEL_FILE : '导入Excel文件', 8 | CHOOSE_SHEET : '从上方列表中选择要导入的表', 9 | IMPORT_TO_SELECTED : '导入到选中区域', 10 | IMPORT_AS_INSERT : '作为新行导入', 11 | IMPORT_FINISHED : '导入完毕', 12 | CHOOSE_FILE : '选择文件' 13 | }); 14 | Grid.Plugins.enableImport = function(tab, obj){ 15 | obj = obj || window; 16 | function onerror(message){ 17 | Win.alert(message); 18 | } 19 | var model = (function(){ 20 | var URL = obj.webkitURL || obj.mozURL || obj.URL; 21 | 22 | return { 23 | getEntries : function(file, onend){ 24 | zip.createReader(new zip.BlobReader(file), function(zipReader){ 25 | zipReader.getEntries(onend); 26 | }, onerror); 27 | }, 28 | getEntryFile : function(entry, creationMethod, onend, onprogress){ 29 | var writer, zipFileEntry; 30 | 31 | function getData(){ 32 | entry.getData(writer, function(blob){ 33 | var blobURL = URL.createObjectURL(blob); 34 | onend(blobURL); 35 | }, onprogress); 36 | } 37 | writer = new zip.BlobWriter(); 38 | getData(); 39 | } 40 | }; 41 | })(); 42 | function importPreview(data){ 43 | var i, j; 44 | var $win = Win.win(Grid.Lang.PREVIEW, Win.scrW * 0.5, Win.scrH * 0.5 + 32); 45 | var $d = $('
').css( 46 | { 47 | width : Win.scrW * 0.5, 48 | height : Win.scrH * 0.5 49 | } 50 | ); 51 | $win.append($d); 52 | var str = ''; 53 | for(i = 0; i < data.length; i ++){ 54 | str += ''; 55 | for(j = 0; j < data[i].length; j ++){ 56 | str += ''; 57 | } 58 | str += ''; 59 | } 60 | str += '
' + data[i][j] + '
'; 61 | $d.append(str); 62 | $win.append( 63 | $('
').append( 64 | $('
' + Grid.Lang.IMPORT_AS_INSERT + '
').click(function(){ 65 | var from = tab.data.row.length + 1; 66 | var n = data.length; 67 | var i, j 68 | tab.append_empty(n); 69 | for(i = 0; i < n; i ++){ 70 | for(j = 0; j < data[i].length; j ++){ 71 | try{ 72 | tab.set_val(from, j + 1, data[i][j]); 73 | }catch(e){ 74 | console.log([e.message, i, j, data[i][j]]) 75 | } 76 | } 77 | from ++; 78 | } 79 | tab.scroll_down(tab.scroll.v); 80 | Win.alert(Grid.Lang.IMPORT_FINISHED); 81 | }), 82 | $('
' + Grid.Lang.IMPORT_TO_SELECTED + '
').click(function(){ 83 | var data_array = [], i, j; 84 | for(i = 0; i < data.length; i ++){ 85 | for(j = 0; j < data[i].length; j ++){ 86 | data_array.push(data[i][j]); 87 | } 88 | } 89 | tab.set_data(data_array, tab.selected); 90 | Win.alert(Grid.Lang.IMPORT_FINISHED); 91 | }) 92 | ) 93 | ); 94 | } 95 | tab.importAction = function(){ 96 | var $win = Win.win(Grid.Lang.IMPORT_EXCEL_FILE, 512, 468); 97 | var $lt = $('
').css({ 98 | width : 502, 99 | height : 430 100 | }); 101 | var id = tab.prefix + 'ip-'; 102 | $win.append($lt); 103 | $win.append('
'+Grid.Lang.CHOOSE_FILE+'
'); 104 | var fileInput = document.getElementById(id+'fi'); 105 | fileInput.addEventListener('change', function(){ 106 | fileInput.disabled = true; 107 | $(fileInput).hide(); 108 | $('#' + id + 'tips').html('
'+Grid.Lang.CHOOSE_SHEET+'
'); 109 | model.getEntries(fileInput.files[0], function(entries){ 110 | var i = 0; 111 | entries.forEach(function(entry){ 112 | if(entry.filename.indexOf('xl/worksheets/') == 0 && entry.filename.indexOf('xl/worksheets/_rel') < 0){ 113 | $lt.append( 114 | $('

'+entry.filename.substr(14).substr(0, entry.filename.length-18)+'

').click(function(){ 115 | var writer = new zip.BlobWriter(); 116 | entry.getData(writer, function(blob){ 117 | var reader = new FileReader(); 118 | reader.onload = function(){ 119 | var s1 = reader.result.split(''); 120 | var s2 = s1[1].split(''); 121 | var s3 = '' + s2[0] + ''; 122 | var $t = $(s3); 123 | var row = []; 124 | $t.find('row').each(function(){ 125 | var cols = []; 126 | $(this).find('v').each(function(){ 127 | cols[cols.length] = $(this).html(); 128 | }); 129 | row[row.length] = cols; 130 | }); 131 | importPreview(row); 132 | } 133 | reader.readAsText(blob); 134 | }, onprogress); 135 | }) 136 | ); 137 | } 138 | }); 139 | }); 140 | }, false); 141 | } 142 | $(tab.toolbar).find('.lxg-tbmenu-item').each(function(){ 143 | if($(this).html() == Grid.Lang.EXPORT){ 144 | $(this).after( 145 | $('
').click(function(){ 146 | tab.importAction(); 147 | }).append(Grid.Lang.IMPORT) 148 | ); 149 | } 150 | }) 151 | } 152 | }); 153 | -------------------------------------------------------------------------------- /src/tl.win.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Lx.ui 3 | * lxrmido@lxrmido.com 4 | */ 5 | .line, .lx-line{ 6 | display: block; 7 | width: 100%; 8 | height: auto; 9 | min-height: 1px; 10 | clear: both; 11 | overflow: hidden; 12 | } 13 | .line.ctrl, .lx-line.ctrl{ 14 | margin:8px 0; 15 | } 16 | .dragging, .lx-dragging{ 17 | opacity: 0.8; 18 | } 19 | .lxquest, .lx-quest{ 20 | float: left; 21 | display: block; 22 | width: 366px; 23 | height: 72px; 24 | line-height: 18px; 25 | overflow: hidden; 26 | font-size: 12px; 27 | text-align: left; 28 | margin: 4px 0; 29 | outline: none; 30 | padding: 8px; 31 | resize:none; 32 | color: #111; 33 | border-style: solid; 34 | border-color: #ddd; 35 | border-width: 1px; 36 | background-color: #eee; 37 | border-radius: 8px; 38 | -webkit-transition: all 0.2s linear; 39 | -moz-transition: all 0.2s linear; 40 | } 41 | .lxwin *, .lx-taskbar *{ 42 | font-family: "Segoe UI","Segoe WPC","Segoe UI","微软雅黑"; 43 | } 44 | .lxwin{ 45 | display: block; 46 | position: fixed; 47 | left: 128px; 48 | top: 128px; 49 | width: 512px; 50 | height: 512px; 51 | padding: 40px 8px 8px 8px; 52 | overflow: hidden; 53 | background-color: #fff; 54 | border-radius: 3px; 55 | box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); 56 | z-index:60000; 57 | } 58 | .lxwin.min{ 59 | -webkit-transition: all 1s ease-out; 60 | -moz-transition: all 1s ease-out; 61 | -webkit-transform:scale(0.05, 0.05); 62 | -moz-transform:scale(0.05, 0.05); 63 | opacity:0; 64 | } 65 | .lxwin.closing{ 66 | -webkit-transform:scale(0.6); 67 | -moz-transform:scale(0.6); 68 | opacity:0; 69 | } 70 | .lxwintit{ 71 | cursor: move; 72 | display: block; 73 | position: absolute; 74 | left: 0px; 75 | right: 0px; 76 | top: 0px; 77 | height: 32px; 78 | overflow: hidden; 79 | font-size: 16px; 80 | font-weight:bold; 81 | color: #eee; 82 | background-color: rgb(57, 85, 163); 83 | line-height: 32px; 84 | margin: 0; 85 | text-align: left; 86 | text-indent: 8px; 87 | padding: 0; 88 | } 89 | .lxwincbut{ 90 | display:block; 91 | position: relative; 92 | float:right; 93 | width: 32px; 94 | height: 32px; 95 | margin:0; 96 | text-align: center; 97 | background-position: center; 98 | cursor: pointer; 99 | font-size: 24px; 100 | line-height: 32px; 101 | font-weight: bold; 102 | color:#fff; 103 | border:none; 104 | background-color:transparent; 105 | padding:0; 106 | outline:none; 107 | -webkit-transition: all 0.2s linear; 108 | -moz-transition: all 0.2s linear; 109 | } 110 | .lxwincbut:hover{ 111 | background-color: #777; 112 | } 113 | .lxalfield{ 114 | display:block; 115 | overflow: hidden; 116 | width:100%; 117 | height:auto; 118 | min-height: 1px; 119 | color:#111; 120 | padding: 4px 8px; 121 | font-size: 14px; 122 | font-weight: normal; 123 | font-style: normal; 124 | text-decoration: none; 125 | } 126 | .lxlinear{ 127 | -webkit-transition:all linear 0.4s; 128 | -moz-transition:all linear 0.4s; 129 | } 130 | .lxlabel, .lx-label{ 131 | display:block; 132 | float:left; 133 | width:auto; 134 | height:32px; 135 | min-width:72px; 136 | padding:0 4px; 137 | text-align:left; 138 | color:#333; 139 | font-size:14px; 140 | margin:0 4px; 141 | line-height:32px; 142 | overflow: hidden; 143 | } 144 | .lxlabel.slim, .lx-label.slim{ 145 | min-width:1px; 146 | } 147 | .lxinput, .lx-input{ 148 | display: block; 149 | float:left; 150 | width:152px; 151 | height:16px; 152 | line-height:16px; 153 | padding:3px 4px; 154 | text-align:left; 155 | color:#333; 156 | font-size:14px; 157 | margin:4px; 158 | text-decoration:none; 159 | outline: none; 160 | border:rgb(198, 198, 198) solid 1px; 161 | } 162 | .lxbutton, .lx-button{ 163 | display:block; 164 | float:left; 165 | width:auto; 166 | height:24px; 167 | min-width:72px; 168 | padding:0 4px; 169 | text-align:center; 170 | color:#eee; 171 | font-size:14px; 172 | margin:3px 4px; 173 | line-height:24px; 174 | overflow: hidden; 175 | background-color:rgb(57, 85, 163); 176 | border:1px rgb(57, 85, 163) solid; 177 | border-radius:3px; 178 | box-shadow:0 0 2px rgba(0, 0, 0, 0.6); 179 | cursor:default; 180 | outline:none; 181 | -webkit-transition:all linear 0.4s; 182 | -moz-transition:all linear 0.4s; 183 | } 184 | .lxbutton.white, .lx-button.white{ 185 | background-color:#eee; 186 | color:#111; 187 | cursor:pointer; 188 | min-width:48px; 189 | } 190 | .lxbutton:hover, .lx-button:hover{ 191 | box-shadow: 192 | 0 0 2px rgba(0, 0, 0, 0.6), 193 | inset 1px 1px 2px rgba(255, 255, 255, 0.3), 194 | inset -1px -1px 2px rgba(0, 0, 0, 0.2); 195 | } 196 | .lxbutton:active, .lx-button:active{ 197 | box-shadow: 198 | 0 0 2px rgba(0, 0, 0, 0.6), 199 | inset 1px 1px 2px rgba(0, 0, 0, 0.3), 200 | inset -1px -1px 2px rgba(255, 255, 255, 0.2); 201 | -webkit-transition:all linear 0.1s; 202 | -moz-transition:all linear 0.1s; 203 | -webkit-transform:scale(0.95, 0.95); 204 | -moz-transform:scale(0.95, 0.95); 205 | } 206 | .lxselect, .lx-select{ 207 | display: block; 208 | float:left; 209 | width:auto; 210 | height:24px; 211 | line-height:24px; 212 | padding:0; 213 | text-align:left; 214 | color:#333; 215 | font-size:14px; 216 | margin:4px; 217 | text-decoration:none; 218 | outline: none; 219 | border:rgb(198, 198, 198) solid 1px; 220 | } 221 | .lxselect:active, .lx-select:active{ 222 | overflow:visible; 223 | } 224 | .lxinput.half, .lx-input.half{ 225 | width:72px; 226 | } 227 | .lxinput.quad, .lx-input.quad{ 228 | width:32px; 229 | } 230 | .lxinput.tri-half, .lx-input.tri-half{ 231 | width:192px; 232 | } 233 | .lxinput.double, .lx-input.double{ 234 | width:272px; 235 | } 236 | .lx-calendar{ 237 | display:block; 238 | width:248px; 239 | height:286px; 240 | margin:4px; 241 | padding:0; 242 | float:left; 243 | border: 1px rgb(217, 217, 217); 244 | background-color:#fff; 245 | overflow:hidden; 246 | } 247 | .lx-cal-line{ 248 | display:block; 249 | width:248px; 250 | height:auto; 251 | overflow:hidden; 252 | min-height:1px; 253 | margin:0; 254 | padding:0; 255 | clear:both; 256 | } 257 | .lx-cal-tri-l, .lx-cal-tri-r{ 258 | width:0; 259 | height:0; 260 | padding:0; 261 | margin:8px; 262 | float:left; 263 | } 264 | .lx-cal-tri-l{ 265 | border:4px solid; 266 | border-color: rgba(0, 0, 0, 0) #111 rgba(0, 0, 0, 0) rgba(0, 0, 0, 0); 267 | } 268 | .lx-cal-tri-l:hover{ 269 | border:4px solid; 270 | border-color: rgba(0, 0, 0, 0) rgb(57, 85, 163) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0); 271 | } 272 | .lx-cal-tri-r{ 273 | border:4px solid; 274 | border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #111; 275 | } 276 | .lx-cal-tri-r:hover{ 277 | border:4px solid; 278 | border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgb(57, 85, 163); 279 | } 280 | .lx-cal-title{ 281 | display:block; 282 | width:200px; 283 | margin:0; 284 | padding:0; 285 | float:left; 286 | text-align:center; 287 | line-height:24px; 288 | height:24px; 289 | font-size:14px; 290 | color:#111; 291 | } 292 | .lx-cal-day{ 293 | width:34px; 294 | height:24px; 295 | line-height:24px; 296 | padding:0; 297 | margin:0px; 298 | float:left; 299 | text-align:center; 300 | font-size:12px; 301 | background-color:#fff; 302 | cursor:pointer; 303 | color:#000; 304 | } 305 | .lx-cal-day.last{ 306 | color:#777; 307 | } 308 | .lx-cal-day.cur{ 309 | color:#fff; 310 | font-weight:bold; 311 | background-color: rgb(57, 85, 163); 312 | } 313 | .lx-cal-day:first-child{ 314 | margin-left:5px; 315 | } 316 | .lx-cal-day:last-child{ 317 | margin-right:5px; 318 | } 319 | .lx-cal-day:hover{ 320 | background-color:#eee; 321 | color:#000; 322 | } 323 | .lx-list{ 324 | display: block; 325 | clear: both; 326 | margin: 4px; 327 | padding: 0; 328 | width: 268px; 329 | height: 468px; 330 | border: 1px rgb(57, 85, 163) solid; 331 | background-color: #fff; 332 | overflow-x:hidden; 333 | overflow-y:scroll; 334 | } 335 | .lx-list .lx-litem{ 336 | display:block; 337 | clear:both; 338 | padding:2px 0; 339 | margin:0; 340 | width:100%; 341 | overflow: hidden; 342 | border-bottom:1px rgb(212, 212, 212) solid; 343 | height:24px; 344 | color:#111; 345 | -webkit-transition:all linear 0.2s; 346 | -moz-transition: all 0.2s linear; 347 | } 348 | .lx-list .lx-litem:hover{ 349 | background-color: #eee; 350 | } 351 | .lx-list .lx-litem.hd{ 352 | font-weight:bold; 353 | } 354 | .lx-list .lx-litem p{ 355 | display:block; 356 | clear:none; 357 | float:left; 358 | text-align: left; 359 | font-size: 12px; 360 | border-right:1px rgb(212, 212, 212) solid; 361 | margin:0; 362 | padding:0 4px; 363 | overflow: hidden; 364 | min-width:64px; 365 | width:auto; 366 | height:24px; 367 | line-height: 24px; 368 | background:transparent; 369 | } 370 | .lx-list .lx-litem p.hd{ 371 | font-weight:bold; 372 | } 373 | .lxppmenu *{ 374 | font-family: "Segoe UI","Segoe WPC","Segoe UI","微软雅黑"; 375 | } 376 | .lxppmenu { 377 | display:none; 378 | position: fixed; 379 | width: auto; 380 | min-width: 128px; 381 | padding: 4px; 382 | height: auto; 383 | min-height: 1px; 384 | overflow-x: hidden; 385 | overflow-y: hidden; 386 | background-color: #fff; 387 | border: 1px solid rgb(57, 85, 163); 388 | border-radius: 3px; 389 | z-index:70000; 390 | box-shadow:0 0 4px rgba(0, 0, 0, 0.6); 391 | cursor: move; 392 | } 393 | .lxppmenu .it{ 394 | cursor: pointer; 395 | overflow: hidden; 396 | min-width: 1px; 397 | width: auto; 398 | height: 24px; 399 | line-height: 24px; 400 | font-size: 14px; 401 | text-align: center; 402 | clear: both; 403 | padding: 0; 404 | margin: 0; 405 | border-left:4px rgb(212, 212, 212) solid; 406 | border-right:4px rgb(212, 212, 212) solid; 407 | color: #111; 408 | -webkit-transition: all 0.2s linear; 409 | -moz-transition: all 0.2s linear; 410 | } 411 | 412 | .lxppmenu .it:hover{ 413 | border-left:4px rgb(57, 85, 163) solid; 414 | border-right:4px rgb(57, 85, 163) solid; 415 | background-color: rgb(212, 212, 212); 416 | } 417 | 418 | .lxppmenu .it:active{ 419 | background-color: rgba(4, 4, 4, 1); 420 | } 421 | 422 | .lx-search{ 423 | display: block; 424 | float:left; 425 | width:290px; 426 | height:16px; 427 | line-height:16px; 428 | padding:3px 4px 3px 24px; 429 | text-align:left; 430 | color:#333; 431 | font-size:14px; 432 | margin:4px; 433 | text-decoration:none; 434 | outline: none; 435 | border:rgb(198, 198, 198) solid 1px; 436 | background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJmdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpldj0iaHR0cDovL3d3dy53My5vcmcvMjAwMS94bWwtZXZlbnRzIj4KPGc%2BCgk8cG9seWdvbiBmaWxsPSIjNjY2IiBwb2ludHM9IjkuMjA3LDYuMTI2IDcuNzkzLDcuNTQxIDExLjc5MywxMS41NDEgMTMuMjA3LDEwLjEyNiIgLz4KCTxwYXRoIGZpbGw9IiM2NjYiIGQ9Ik01LjkxNywyYzEuNjA4LDAsMi45MTcsMS4zMDgsMi45MTcsMi45MTdTNy41MjUsNy44MzMsNS45MTcsNy44MzNTMyw2LjUyNSwzLDQuOTE3UzQuMzA4LDIsNS45MTcsMgoJCSBNNS45MTcsMEMzLjIwMSwwLDEsMi4yMDEsMSw0LjkxN3MyLjIwMSw0LjkxNyw0LjkxNyw0LjkxN3M0LjkxNy0yLjIwMSw0LjkxNy00LjkxN0MxMC44MzMsMi4yMDEsOC42MzIsMCw1LjkxNywwTDUuOTE3LDB6IiAvPgo8L2c%2BCjwvc3ZnPgo%3D'); 437 | background-position: 4px 6px; 438 | background-repeat: no-repeat; 439 | border-radius: 11px; 440 | } 441 | .lx-select{ 442 | display: block; 443 | float:left; 444 | width:96px; 445 | height:24px; 446 | line-height:16px; 447 | padding:0; 448 | text-align:left; 449 | color:#333; 450 | font-size:14px; 451 | margin:4px; 452 | text-decoration:none; 453 | outline: none; 454 | border:rgb(198, 198, 198) solid 1px; 455 | background-position: 4px 6px; 456 | background-repeat: no-repeat; 457 | } 458 | /* 工具图标 */ 459 | .lx-icon-paste{ 460 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG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ADwdVhrR9KdJDNrJMmQtqXe25X4pSRDB7pMfDuT9kqpZ2yeLobkzftnm3jNPzNwY+OCDZowE5F5H+cS5otlYMHkOxM8DudPZF43tYUyEJrHVcwXB1iAELXMVymjvLeP0fSDdF1FH+AMTNH0EB/sJgFS1SZXnVprZDJRbS5ciapB9BXN6+BMVIMolYFdrlQmIAZWU41sZLP6gwPuO/HcZB/A5zQAAAAAAAAAAAAAAAAAAIBfxUuAAQCFXoSnRUesCAAAAABJRU5ErkJggg==") 489 | } 490 | /* 窗体确认按钮等 */ 491 | .lx-icon-confirm{ 492 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEEyM0RCOTRENjk3MTFFMjk0RjZDQTdCMDY3QUZFREEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEEyM0RCOTVENjk3MTFFMjk0RjZDQTdCMDY3QUZFREEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTIzREI5MkQ2OTcxMUUyOTRGNkNBN0IwNjdBRkVEQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTIzREI5M0Q2OTcxMUUyOTRGNkNBN0IwNjdBRkVEQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmR6/tYAAADzSURBVHja7NjRCcIwEAbgVHzJo47QFbpCHaGO4ApdoR1BV+gKruAIzpDHPMY7SCAUX6S51IP/4BBCKXzen1jbhBCM5joY5QUAAAAAAAAAAAAAAAD71XHrDbz3v1w+UY/UZ2ut0ziBG/VC7TRGqKM+UT+17oEhfi6aAUXjUxPA8WlLx6cUgE+VkHVfKz5czdbXKtkxyhv0Tf2ivqwuS+vXtEDH6N9FiLM9xwn0NeIjsQceETLWiI8E4NsUhvjtOw2A9RRE4yMFyKdwz1CqnkbTFDrJ+EgC0hSMZHyK/A7gDw0AAAAAAAAAAAAAAAAAsFd9BBgAexY2u0WNO0UAAAAASUVORK5CYII=") 493 | } 494 | .lx-taskbar{ 495 | display:block; 496 | position:fixed; 497 | left:0; 498 | bottom:4px; 499 | width:auto; 500 | min-width:1px; 501 | height:32px; 502 | padding:2px; 503 | overflow:hidden; 504 | z-index:69999; 505 | background-color:rgba(255, 255, 255, 0.6); 506 | box-shadow:0 0 4px rgba(0, 0, 0, 0.8); 507 | border-radius:18px; 508 | -webkit-transition:all 0.5s linear; 509 | -moz-transition:all 0.5s linear; 510 | } 511 | .lx-taskbar-item{ 512 | cursor:pointer; 513 | display:block; 514 | float:left; 515 | width:24px; 516 | height:24px; 517 | line-height:24px; 518 | margin:4px; 519 | padding:0; 520 | background-color:rgb(57, 85, 163); 521 | color:#fff; 522 | font-size:14px; 523 | overflow:hidden; 524 | text-align:center; 525 | box-shadow:0 0 4px rgba(57, 85, 163, 0.8); 526 | border-radius:12px; 527 | -webkit-transition:all 0.5s linear; 528 | -moz-transition:all 0.5s linear; 529 | } 530 | .lx-taskbar-item:hover{ 531 | box-shadow:0 0 4px rgba(57, 85, 163, 0.8); 532 | } 533 | .lx-adjust{ 534 | position:fixed; 535 | width:4px; 536 | height:4px; 537 | background-color: rgb(57, 85, 163); 538 | border:1px #fff solid; 539 | box-shadow:0 0 2px rgba(0, 0, 0, 0.6); 540 | border-radius:3px; 541 | } 542 | .lx-adjust.l{ 543 | cursor:w-resize; 544 | } 545 | .lx-adjust.r{ 546 | cursor:e-resize; 547 | } 548 | .lx-adjust.t{ 549 | cursor:n-resize; 550 | } 551 | .lx-adjust.b{ 552 | cursor:s-resize; 553 | } 554 | .lx-adjust.lt{ 555 | cursor:nw-resize; 556 | } 557 | .lx-adjust.rt{ 558 | cursor:ne-resize; 559 | } 560 | .lx-adjust.lb{ 561 | cursor:sw-resize; 562 | } 563 | .lx-adjust.rb{ 564 | cursor:se-resize; 565 | } 566 | .lx-menu{ 567 | display:block; 568 | position:absolute; 569 | z-index:6000; 570 | background-color:#fff; 571 | border:1px rgb(168, 168, 168) solid; 572 | margin:0; 573 | padding:0; 574 | width:auto; 575 | min-width:1px; 576 | height:auto; 577 | min-height:1px; 578 | overflow:hidden; 579 | cursor:default; 580 | box-shadow:0 0 4px rgba(0, 0, 0, 0.3); 581 | z-index:90000; 582 | } 583 | .lx-menu-item{ 584 | display:block; 585 | clear:both; 586 | margin:0; 587 | padding:4px 4px 4px 20px; 588 | width:104px; 589 | height:16px; 590 | line-height:16px; 591 | font-size:12px; 592 | text-align:left; 593 | color:#111; 594 | background-color:#fff; 595 | } 596 | .lx-menu-item:hover{ 597 | color:#eee; 598 | background-color:#777; 599 | } 600 | .right{ 601 | float:right; 602 | } 603 | .left{ 604 | float:left; 605 | } -------------------------------------------------------------------------------- /src/tl.win.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 窗体控件 3 | * Fork from lx.ui 4 | * 兼容: 5 | * Chrome 13+ 6 | * Firefox 4+ 7 | * IE 10+ 8 | * lxrmido@lxrmido.com 9 | * 最后更新: 10 | * 2014-1 11 | * -------------------- 12 | * 常用: 13 | * -------------------- 14 | * #### 常用窗体API 15 | * -------------------- 16 | * Win.alert(文本, 关闭时回调函数, 窗体标题) 17 | * 弹出消息窗体,部分替代alert使用,返回值为窗体的jQuery对象 18 | * ---- 19 | * Win.quest(文本, 确认时回调函数(输入内容), 预设值, 取消时回调函数, 窗体标题) 20 | * 弹出询问窗体,返回值为窗体的jQuery对象 21 | * ---- 22 | * Win.confirm(文本, 确认时回调函数, 关闭时回调函数, 窗体标题) 23 | * 弹出确认窗体,返回值为窗体的jQuery对象 24 | * ---- 25 | * Win.calendar(初始时间戳, 窗体标题, 回调函数(时间), 回调函数的传入值是否时间戳) 26 | * 弹出时间日期选择窗体,当最后一个参数为true时回调函数将接受一个时间戳参数,否则将接受一个Date对象,返回值为窗体的jQuery对象 27 | * ---- 28 | * Win.win(窗体标题, 窗体宽度, 窗体高度, 关闭时的回调函数, 是否可以最小化) 29 | * 弹出一个居中的空白窗体,返回值为窗体的jQuery对象 30 | * -------------------- 31 | * #### 时间日期API 32 | * -------------------- 33 | * Win.time_to_str(时间戳) 34 | * 返回 Y-m-d H:i:s 格式字符串 35 | * ---- 36 | * Win.str_to_time(字符串) 37 | * 传入 Y-m-d H:i:s 格式字符串,返回时间戳 38 | * -------------------- 39 | */ 40 | (function($, window, win_key){ 41 | 42 | function INT(n){return parseInt(n, 0); } 43 | 44 | function mkdiv(div_class, inner){ return $('
' + (inner || '') + '
'); } 45 | function mkipt(type, ipt_class, value){ return $(''); } 46 | function mktxt(txt_class, value){ return $(''); } 47 | 48 | var Win = window[win_key] = { 49 | 50 | // 屏幕宽度 51 | scrW : 0, scrW_before : 0, 52 | // 屏幕高度 53 | scrH : 0, scrH_before : 0, 54 | 55 | // 最近一次鼠标按下的坐标 56 | clickX : 0, 57 | clickY : 0, 58 | // 当前注册为菜单的组件 59 | registerMenuDOM : null, 60 | 61 | // 任务栏 62 | taskbar : null, 63 | 64 | // 65 | hooks_winsize : [], 66 | hooks_resortz : [], 67 | hooks_init : [], 68 | 69 | is_initialed : false, 70 | 71 | // 窗口列表 72 | wins : [], 73 | // 全局ID 74 | gid : 1, 75 | // 窗口从此index-z开始排布 76 | startZ : 60000, 77 | 78 | // 正在拖放的操作组件 79 | dragging : null, 80 | // 接受拖放的组件 81 | draggingParent : null, 82 | 83 | // 拖放点坐标 84 | dragX : 0, 85 | dragY : 0, 86 | 87 | $body : null, 88 | $window : null, 89 | $document : null, 90 | 91 | lowestDelta : undefined, 92 | lowestDeltaXY : undefined, 93 | 94 | 95 | // 语言字典 96 | Lang : { 97 | ALERT_TEXT : '无内容', 98 | ALERT_TITLE : '通知', 99 | CAL_SEC_NUM : '秒数:', 100 | CAL_SEP_DAY : '日', 101 | CAL_SEP_HOUR : '时', 102 | CAL_SEP_MIN : '分', 103 | CAL_SEP_MONTH : '月', 104 | CAL_SEP_SEC : '秒', 105 | CAL_SEP_YEAR : '年', 106 | CAL_TITLE : '日期', 107 | CAL_TODAY : '今天', 108 | CAL_WEEK_0 : '日', 109 | CAL_WEEK_1 : '一', 110 | CAL_WEEK_2 : '二', 111 | CAL_WEEK_3 : '三', 112 | CAL_WEEK_4 : '四', 113 | CAL_WEEK_5 : '五', 114 | CAL_WEEK_6 : '六', 115 | CONFIRM_TEXT : '确定吗?', 116 | CONFIRM_TITLE : '询问', 117 | QUEST_TEXT : '请输入:', 118 | QUEST_TITLE : '询问', 119 | WIN_TITLE : 'TITLE', 120 | 121 | sDateStr : function(year, month){ 122 | return year + '年' + month + '月'; 123 | }, 124 | 125 | // 扩展语言字典 126 | extend : function(e){ 127 | var i; 128 | // 即使是继承来的属性,都添加 129 | for(i in e){ 130 | Win.Lang[i] = e[i]; 131 | } 132 | } 133 | }, 134 | 135 | init : function(){ 136 | var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], 137 | toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], 138 | i; 139 | if($.event.fixHooks){ 140 | for(i in toFix){$.event.fixHooks[toFix[i]] = $.event.mouseHooks;} 141 | } 142 | $.event.special.mousewheel = { 143 | setup : function(){ 144 | if(this.addEventListener){ 145 | for(i in toBind){ 146 | this.addEventListener(toBind[i], Win.mouseScroll, false); 147 | } 148 | }else{ 149 | this.onmousewheel = Win.mouseScroll; 150 | } 151 | }, 152 | teardown : function(){ 153 | if(this.removeEventListener){ 154 | for(i in toBind){ 155 | this.removeEventListener(toBind[i], Win.mouseScroll, false); 156 | } 157 | }else{ 158 | this.onmousewheel = null; 159 | } 160 | } 161 | }; 162 | $.fn.extend({ 163 | mousewheel : function(fn){ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, 164 | unmousewheel: function(fn){ return this.unbind("mousewheel", fn); } 165 | }); 166 | Win.$window = $(window); 167 | Win.$document = $(document); 168 | 169 | Win.$document.mousedown(Win.mouseDown).mousemove(Win.mouseMove).mouseup(Win.mouseUp).ready(Win.ready); 170 | }, 171 | 172 | ready : function(){ 173 | Win.$body = $('body'); 174 | Win.timer(); 175 | Win.is_initialed = true; 176 | Win.hooks_active('init'); 177 | }, 178 | 179 | /** 180 | * 计算某个月的第一天是全年的第几天 181 | * @param {int} year 182 | * @param {int} month 183 | * @return {int} 184 | */ 185 | mon_offset : function(year, month){ 186 | for(var i = 1, offset = 0; i < month; i ++){ 187 | offset += Win.mon_days(year, i); 188 | } 189 | return offset; 190 | }, 191 | /** 192 | * 计算某年某月的天数 193 | * @param {int} year 194 | * @param {int} month 195 | * @return {int} 196 | */ 197 | mon_days : function(year, month){ 198 | return (month == 2 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0)) ? 29 : [31, 28, 31, 30,31, 30, 31, 31, 30, 31, 30, 31][month - 1]; 199 | }, 200 | /** 201 | * 计算某年某月某日是星期几 202 | * @param {int} year 203 | * @param {int} month 204 | * @param {int} day 205 | * @return {int} 206 | */ 207 | week_day : function(year, month, day){ 208 | function i(n){ return INT((year - 1) / n); } 209 | return (i(1) + i(4) - i(100) + i(400) + Win.mon_offset(year, month) + day) % 7; 210 | }, 211 | /** 212 | * 时间戳转换为 "Y-m-d" 形式的字符串 213 | * @param {int} timestamp 214 | * @return {string} 215 | */ 216 | time_to_str : function(timestamp){ 217 | var date = new Date(timestamp * 1000); 218 | function fm(raw){ return raw < 10 ? ("0" + raw) : raw; } 219 | return date.getFullYear() + "-" + fm(date.getMonth() + 1) + "-" + fm(date.getDate()) + " " + fm(date.getHours()) + ":" + fm(date.getMinutes()) + ":" + fm(date.getSeconds()); 220 | }, 221 | /** 222 | * 将 "Y-m-d H:i:s" 形式的字符串转换为时间戳 223 | * @param {string} 字符串 224 | * @return {int} 225 | */ 226 | str_to_time : function(s){ 227 | s = s.split(/[\s-:]/); 228 | return INT((new Date(s[0] || 0, (s[1] - 1) || 0, s[2] || 0, s[3] || 0, s[4] || 0, s[5] || 0)).getTime() / 1000); 229 | }, 230 | 231 | xhr : function(){ 232 | if(typeof XMLHttpRequest != "undefined"){ 233 | return new XMLHttpRequest(); 234 | }else if(typeof ActiveXObject != "undefined"){ 235 | if(typeof arguments.callee.activeXString != "string"){ 236 | var v = ["MSXML2.XMLHttp.6.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp"], 237 | i; 238 | for(i = 0; i < v.length; i ++){ 239 | try{ 240 | new ActiveXObject(v[i]); 241 | arguments.callee.activeXString = v[i]; 242 | break; 243 | }catch(e){ 244 | 245 | } 246 | } 247 | } 248 | return new ActiveXObject(arguments.callee.activeXString); 249 | } 250 | throw new Error("No XHR object available"); 251 | }, 252 | 253 | taskbar_init : function(){ 254 | Win.taskbar || Win.$body.append(Win.taskbar = mkdiv('lx-taskbar')); 255 | }, 256 | 257 | taskbar_resize : function(){ 258 | var w = Win.taskbar.width(); 259 | if(w < 24){ 260 | Win.taskbar.remove(); 261 | Win.taskbar = null; 262 | return; 263 | } 264 | Win.taskbar.css('left', (Win.scrW - w) / 2); 265 | }, 266 | 267 | min_to_taskbar : function($win, title){ 268 | Win.taskbar_init(); 269 | $win.data('x', $win.css('left')).data('y', $win.css('top')).addClass('min').css( 270 | { left : Win.srcW / 2, top : Win.scrH - 24}); 271 | setTimeout(function(){ 272 | Win.taskbar.append( 273 | mkdiv("lx-taskbar-item").attr('title', title).html(title.slice(0, 1)).click(function(){ 274 | var ti = $(this), $win = $(this).data('win'); 275 | $win.addClass('lxlinear').removeClass('min'); 276 | Win.wintofront($win.css({left : $win.data('x'), top : $win.data('y')})); 277 | setTimeout(function(){ $win.removeClass('lxlinear'); }, 400); 278 | setTimeout(function(){ ti.detach(); Win.taskbar_resize(); }, 20); 279 | }).data('win', $win)); 280 | Win.taskbar_resize(); 281 | }, 600); 282 | }, 283 | 284 | /** 285 | * 判断是否在元素的范围内,通常只对fixed的元素使用 286 | * @param {jQuery 选择子} $dom 元素 287 | * @param {int} x 288 | * @param {int} y 289 | * @return {bool} 290 | */ 291 | inDOMScope : function($dom, x, y){ 292 | var x0 = INT($dom.css('left')); 293 | var y0 = INT($dom.css('top' )); 294 | return (x > x0) && 295 | (x < x0 + INT($dom.css('width' ))) && 296 | (y > y0) && 297 | (y < y0 + INT($dom.css('height'))); 298 | }, 299 | // 注销菜单组件 300 | dyMenuDOM : function(scope){ 301 | scope = scope || true; 302 | if(Win.registerMenuDOM === null){ 303 | return; 304 | } 305 | if(scope && Win.inDOMScope(Win.registerMenuDOM, Win.clickX, Win.clickY)){ 306 | return; 307 | } 308 | if(Win.registerMenuDOM.lxtype === null){ 309 | return; 310 | } 311 | if(Win.registerMenuDOM.lxtype == 'menu'){ 312 | Win.registerMenuDOM.fold(); 313 | } 314 | }, 315 | mouseDown : function(e){ 316 | e = window.event || e; 317 | Win.clickX = e.x || e.clientX; 318 | Win.clickY = e.y || e.clientY; 319 | Win.dyMenuDOM(); 320 | }, 321 | mouseMove : function(e){ 322 | e = window.event || e; 323 | if(Win.dragging !== null){ 324 | var cx = e.clientX - Win.dragX; 325 | var cy = e.clientY - Win.dragY; 326 | Win.draggingParent.css({top:cy, left:cx}); 327 | if(Win.dragCallback){ Win.dragCallback(cx, cy); } 328 | return false; 329 | } 330 | }, 331 | mouseUp : function(e){ 332 | if(Win.dragging !== null){ 333 | Win.dragging = null; 334 | Win.draggingParent.removeClass('dragging'); 335 | Win.draggingParent = null; 336 | } 337 | }, 338 | 339 | mouseScroll : function(e){ 340 | var oe = e || window.event, 341 | delta = oe.deltaY ? deltaY : (oe.deltaX ? -deltaX : (oe.detail ? -oe.detail : (oe.wheelDelta ? oe.wheelDelta : 0))), 342 | deltaX = oe.wheelDeltaX !== undefined ? -oe.wheelDeltaX : (oe.deltaX ? oe.deltaX : 0), 343 | deltaY = oe.wheelDeltaY !== undefined ? oe.wheelDeltaY : (oe.deltaY ? -oe.deltaY : 0), 344 | absDelta = 0, 345 | absDeltaXY = 0, 346 | to_int; 347 | e = $.event.fix(oe); 348 | e.type = "mousewheel"; 349 | absDelta = Math.abs(delta); 350 | if(!Win.lowestDelta || absDelta < Win.lowestDelta){ Win.lowestDelta = absDelta; } 351 | absDeltaXY = Math.max(Math.abs(deltaY), Math.abs(deltaX)); 352 | if(!Win.lowestDeltaXY || absDeltaXY < Win.lowestDeltaXY){ Win.lowestDeltaXY = absDeltaXY; } 353 | to_int = delta > 0 ? Math.floor : Math.ceil; 354 | return ($.event.dispatch || $.event.handle).apply( 355 | this, 356 | [e, 357 | to_int(delta / Win.lowestDelta ), 358 | to_int(deltaX / Win.lowestDeltaXY), 359 | to_int(deltaY / Win.lowestDeltaXY) 360 | ].concat(Array.prototype.slice.call(arguments, 1))); 361 | }, 362 | startDrag : function(e, d, p, c){ 363 | Win.dragging = d; 364 | Win.draggingParent = p; 365 | Win.dragX = e.clientX - INT(p.css('left')); 366 | Win.dragY = e.clientY - INT(p.css('top')); 367 | Win.dragCallback = c; 368 | }, 369 | /** 370 | * 激活某fixed的组件为可自由拖放组件 371 | * @param {jQuery 选择子} dragItem 接受拖放动作的组件 372 | * @param {jQuery 选择子} parent 被拖放的实际组件 373 | * @param {function} callback 拖放时的回调函数 374 | */ 375 | dragenable : function(dragItem, parent, callback){ 376 | dragItem.mousedown(function(e){ 377 | Win.startDrag(e, dragItem, (parent || dragItem).addClass('dragging'), callback); 378 | return false; 379 | }); 380 | }, 381 | timer : function(time){ 382 | var w = INT(Win.$window.width()), 383 | h = INT(Win.$window.height()); 384 | if(w !== Win.scrW || h !== Win.scrH){ 385 | Win.scrW_before = Win.scrW; 386 | Win.scrH_before = Win.scrH; 387 | Win.scrW = w; 388 | Win.scrH = h; 389 | Win.hooks_active('winsize'); 390 | } 391 | time = time || 50; 392 | setTimeout(function(){Win.timer(time);}, time); 393 | }, 394 | hooks_active : function(type){ 395 | var hooks = Win['hooks_' + type]; 396 | for(f in hooks){ hooks[f](); } 397 | }, 398 | hooks_register : function(type, func){ 399 | switch(type){ 400 | case 'init': 401 | if(Win.is_initialed){ 402 | func(); 403 | return; 404 | } 405 | break; 406 | default: 407 | break; 408 | } 409 | Win['hooks_' + type].push(func); 410 | }, 411 | // 加入窗体队列 412 | addwin : function($w){ 413 | Win.wins[Win.wins.length] = $w; 414 | Win.resortZ(); 415 | }, 416 | // 移除窗体 417 | rmwin : function($w){ 418 | var ary = [], i; 419 | for(i = 0; i < Win.wins.length; i ++){ 420 | if(Win.wins[i].data('gid') == $w.data('gid')){ 421 | continue; 422 | } 423 | ary[ary.length] = Win.wins[i]; 424 | } 425 | Win.wins = ary; 426 | Win.resortZ(); 427 | $w.addClass('lxlinear').addClass('closing'); 428 | setTimeout(function(){ $w.detach(); }, 250); 429 | }, 430 | // 使窗体移到最前方 431 | wintofront : function($w){ 432 | var ary = [], i; 433 | for(i = 0; i < Win.wins.length; i++){ 434 | if(Win.wins[i].data('gid') == $w.data('gid')){ 435 | continue; 436 | } 437 | ary[ary.length] = Win.wins[i]; 438 | } 439 | ary[ary.length] = $w; 440 | Win.wins = ary; 441 | Win.resortZ(); 442 | }, 443 | resortZ : function(){ 444 | var z = Win.startZ; 445 | for(var i = 0; i < Win.wins.length; i ++, z ++){ 446 | Win.wins[i].css('z-index', z); 447 | } 448 | Win.hooks_active('resortz'); 449 | }, 450 | /** 451 | * 产生窗体 452 | * @param {string} title 453 | * @param {int} width 454 | * @param {int} height 455 | * @param {function} closefunc 关闭窗体时的回调 456 | * @param {boolean} min 窗体可否最小化 457 | * @return {jQuery[]} 458 | */ 459 | win : function(title, width, height, closefunc, min){ 460 | title = title || Win.Lang.WIN_TITLE; 461 | width = width || 512; 462 | height = height || 512; 463 | var x = (Win.$window.width() - width ) / 2, 464 | y = (Win.$window.height() - height) / 2; 465 | var $t, $w, $c; 466 | // closefunc 用作 min 467 | if(closefunc === true){ 468 | min = true; 469 | closefunc = null; 470 | } 471 | closefunc = closefunc || function(){}; 472 | $t = mkdiv("lxwintit", title).mousedown(function(){ 473 | Win.wintofront($(this).parent()); 474 | }).append( 475 | $c = mkipt('button', 'lxwincbut', '').click(function(){ 476 | var cf = $(this).data('closefunc'); 477 | if(cf){ cf(); } 478 | Win.rmwin($(this).parent().parent()); 479 | }).addClass('lx-icon-cancel').data('closefunc', closefunc)); 480 | if(min){ 481 | $t.append( 482 | mkipt('button', 'lxwincbut', '-').click(function(){ 483 | Win.min_to_taskbar($(this).parent().parent(), title); 484 | })); 485 | } 486 | Win.$body.append($w = mkdiv('lxwin').append($t).data('gid', Win.gid).data('cbs', 48)); 487 | Win.dragenable($t, $w); 488 | Win.addwin($w); 489 | Win.gid ++; 490 | $w.$close_button = $c; 491 | $w.$title_bar = $t; 492 | return $w.css({width:width, height:height, left:x, top:y}); 493 | }, 494 | /** 495 | * 消息框窗体 496 | * @param {string} text 内容 497 | * @param {function} func 关闭时的回调 498 | * @param {string} titl 标题 499 | * @return {jQuery[]} 500 | */ 501 | alert : function(text, func, titl){ 502 | text = text || Win.Lang.ALERT_TEXT; 503 | titl = titl || Win.Lang.ALERT_TITLE; 504 | func = func || function(){}; 505 | var $w = Win.win(titl, 384, 128); 506 | $w.$close_button.click(func).addClass('lx-icon-confirm').focus().keyup(function(e){ 507 | if(e.keyCode == 13){ 508 | if(func){ func(); } 509 | Win.rmwin($(this).parent().parent()); 510 | } 511 | }); 512 | return $w.append( 513 | mkdiv('lxalfield', text)).css({'min-height':'128px', 'height':'auto'}); 514 | }, 515 | /** 516 | * 文本询问框 517 | * @param {string} text 询问内容 518 | * @param {function} func1 按下确定后的回调 519 | * @param {string} preval 预设值 520 | * @param {function} func2 按下关闭后的回调 521 | * @param {string} titl 标题 522 | * @return {jQuery[]} 523 | */ 524 | quest : function(text, func1, preval, func2, titl){ 525 | text = text || Win.Lang.QUEST_TEXT; 526 | titl = titl || Win.Lang.QUEST_TITLE; 527 | func1 = func1 || function(d){}; 528 | func2 = func2 || function(){}; 529 | preval = preval || ''; 530 | var $w = Win.win(titl, 384, 128); 531 | $w.$close_button.click(func2); 532 | $w.$title_bar.append( 533 | mkipt('button', 'lxwincbut lx-icon-confirm', '').click(function(){ 534 | func1($(this).parent().parent().find('textarea').val()); 535 | Win.rmwin($(this).parent().parent()); 536 | })); 537 | return $w.append( 538 | mkdiv('lxalfield', text), 539 | mktxt('lxquest', preval)).css({'min-height':'128px', 'height':'auto'}); 540 | }, 541 | /** 542 | * 确认询问窗体 543 | * @param {string} text 询问内容 544 | * @param {function} func1 肯定时的回调 545 | * @param {function} func2 否定时的回调 546 | * @param {string} titl 标题 547 | * @return {jQuery[]} 548 | */ 549 | confirm : function(text, func1, func2, titl){ 550 | text = text || Win.Lang.CONFIRM_TEXT; 551 | titl = titl || Win.Lang.CONFIRM_TITLE; 552 | func1 = func1 || function(){}; 553 | func2 = func2 || function(){}; 554 | var $w = Win.win(titl, 384, 128); 555 | $w.$close_button.click(func2); 556 | $w.$title_bar.append( 557 | mkipt('button', 'lxwincbut lx-icon-confirm', '').click(function(){ 558 | func1(); 559 | Win.rmwin($(this).parent().parent()); 560 | })); 561 | return $w.append( 562 | mkdiv('lxalfield', text)).css({'min-height':'128px', 'height':'auto'}); 563 | }, 564 | /** 565 | * 日期选择窗体 566 | * @param {int} timestamp 预设时间戳 567 | * @param {string} titl 标题 568 | * @param {function} func 回调 569 | * @param {boolean} 回调是否传入时间戳 570 | * @return {jQuery[]} 571 | */ 572 | calendar : function(timestamp, titl, func, callback_as_timestamp){ 573 | var date = timestamp ? new Date(timestamp * 1000) : new Date(), 574 | $w = Win.win((titl || Win.Lang.CAL_TITLE), 256, 286), 575 | $c = mkdiv('lx-calendar'); 576 | func = func || function(){}; 577 | Win.render_cal($c, date); 578 | $w.$title_bar.append( 579 | mkipt('button', 'lxwincbut lx-icon-confirm', '').click(function(){ 580 | var vars = $(this).parent().parent().find('.lxinput'); 581 | var dt = new Date( 582 | vars[0].value, vars[1].value - 1, vars[2].value, 583 | vars[3].value, vars[4].value, vars[5].value); 584 | func(callback_as_timestamp ? INT(dt.getTime() / 1000) : dt); 585 | Win.rmwin($(this).parent().parent()); 586 | })); 587 | return $w.append($c); 588 | }, 589 | _popup : function(){ 590 | var $pp = mkdiv('lxppmenu'); 591 | $pp.lxtype = 'menu'; 592 | $pp.pop = function(time, x, y){ 593 | var wx = Win.scrW - $pp.width() - 8; 594 | var wy = Win.scrH - $pp.height() - 16; 595 | x = x || Win.clickX; 596 | y = y || Win.clickY; 597 | $pp.slideDown(time || 200).css( 598 | { 599 | left : (x > wx ? wx : x), 600 | top : (y > wy ? wy : y) 601 | }); 602 | Win.dyMenuDOM(false); 603 | Win.registerMenuDOM = $pp; 604 | return $pp; 605 | }; 606 | $pp.fold = function(time){ 607 | $pp.fadeOut(time || 200); 608 | Win.registerMenuDOM = null; 609 | return $pp; 610 | }; 611 | Win.dragenable($pp, $pp); 612 | return $pp; 613 | }, 614 | /** 615 | * 弹出菜单,被选择后传入菜单项内容到回调函数 616 | * @param {Array} its 菜单项文本列表 617 | * @param {function} func 回调 618 | * @return {jQuery[]} 菜单 619 | */ 620 | popup_min : function(its, func){ 621 | var $pp = mkdiv('lxppmenu'), 622 | i, $i; 623 | for(i = 0; i < its.length; i++){ 624 | $pp = $pp.append(mkdiv('it', its[i]).click(function(){ 625 | func($(this).html()); 626 | $pp.fold(); 627 | })); 628 | } 629 | Win.$body.append($pp); 630 | return $pp; 631 | }, 632 | /** 633 | * 弹出菜单,传入[{display:显示内容, value:值},...],被点击后将值传入回调函数 634 | * @param {Array} its 菜单项 635 | * @param {function} func 回调函数 636 | * @return {jQuery[]} 菜单 637 | */ 638 | popup_pair : function(its, func){ 639 | var $pp = Win._popup(), 640 | i, $i; 641 | for(i = 0; i < its.length; i++){ 642 | $i = mkdiv('it', its[i].display).click(function(){ 643 | func($(this).data('val')); 644 | $pp.fold(); 645 | }).data('val', its[i].value); 646 | $pp = $pp.append($i); 647 | } 648 | Win.$body.append($pp); 649 | return $pp; 650 | }, 651 | /** 652 | * 弹出菜单 653 | * @param {Array} its 菜单项列表 654 | * @return {jQuery[]} 菜单 655 | */ 656 | popup : function(its){ 657 | var $pp = Win._popup(), 658 | i, $i; 659 | if(its === null || its.length === 0){ its = [{text:'DEMO', click:function(e){alert('Popup Demo!');}}]; } 660 | for(i = 0; i < its.length; i++){ 661 | $i = mkdiv('it', its[i].text || 'UNDEFINED'); 662 | if(its[i].click !== null){ 663 | $i.click(its[i].click).click(function(e){$pp.fold();}); 664 | } 665 | if(its[i].data !== null){ 666 | $i.data('ppdata', its[i].data); 667 | } 668 | $pp.append($i); 669 | } 670 | Win.$body.append($pp); 671 | return $pp; 672 | }, 673 | render_cal : function($cal, date){ 674 | var year = date.getFullYear(), 675 | month = date.getMonth() + 1, 676 | day = date.getDate(), 677 | hour = date.getHours(), 678 | min = date.getMinutes(), 679 | sec = date.getSeconds(), 680 | wd_1 = Win.week_day(year, month, 1), 681 | day_last = (month !== 1 ? (Win.mon_days(year, month - 1)) : (Win.mon_days(year, 12))) - wd_1 + 1, 682 | day_all = Win.mon_days(year, month), 683 | cnt_week = 0, 684 | not_break = true, 685 | $l = mkdiv('lx-cal-line'), 686 | i; 687 | $cal.html('').append( 688 | mkdiv('lx-cal-line').append( 689 | mkdiv('lx-cal-tri-l').click(function(){ 690 | if(month == 1){ 691 | month = 11; 692 | year --; 693 | }else{ 694 | month -= 2; 695 | } 696 | Win.render_cal($cal, new Date(year, month, day, hour, min, sec)); 697 | }), 698 | mkdiv('lx-cal-title').html(Win.Lang.sDateStr(year, month)), 699 | mkdiv('lx-cal-tri-r').click(function(){ 700 | if(month == 12){ 701 | month = 0; 702 | year ++; 703 | } 704 | Win.render_cal($cal, new Date(year, month, day, hour, min, sec)); 705 | })), 706 | mkdiv('lx-cal-line').append( 707 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_0), 708 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_1), 709 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_2), 710 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_3), 711 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_4), 712 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_5), 713 | mkdiv('lx-cal-day', Win.Lang.CAL_WEEK_6))); 714 | for(i = 0; i < wd_1; i ++){ 715 | $l = $l.append( 716 | mkdiv('lx-cal-day last', day_last).click(function(){ 717 | if(month == 1){ 718 | month = 11; 719 | year --; 720 | }else{ 721 | month -= 2; 722 | } 723 | Win.render_cal($cal, new Date(year, month, $(this).data('day'), hour, min, sec)); 724 | }).data('day', day_last)); 725 | day_last ++; 726 | } 727 | day_last = 1; 728 | for(i = wd_1; i < 7; i ++){ 729 | if(day_last == day){ 730 | $l = $l.append(mkdiv('lx-cal-day cur', day_last)); 731 | }else{ 732 | $l = $l.append( 733 | mkdiv('lx-cal-day', day_last).click(function(){ 734 | Win.render_cal($cal, new Date(year, month - 1, $(this).data('day'), hour, min, sec)); 735 | }).data('day', day_last)); 736 | } 737 | day_last ++; 738 | } 739 | $cal.append($l); 740 | while(day_last <= day_all && not_break){ 741 | $l = mkdiv('lx-cal-line'); 742 | for(i = 0; i < 7; i ++){ 743 | if(day_last > day_all){ 744 | day_last = 1; 745 | not_break = false; 746 | } 747 | if(not_break){ 748 | if(day_last == day){ 749 | $l = $l.append(mkdiv('lx-cal-day cur', day_last)); 750 | }else{ 751 | $l = $l.append( 752 | mkdiv('lx-cal-day', day_last).click(function(){ 753 | Win.render_cal($cal, new Date(year, month - 1, $(this).data('day'), hour, min, sec)); 754 | }).data('day', day_last)); 755 | } 756 | }else{ 757 | $l = $l.append( 758 | mkdiv('lx-cal-day last', day_last).click(function(){ 759 | if(month == 12){ 760 | month = 0; 761 | year ++; 762 | } 763 | var new_date = new Date(year, month, $(this).data('day'), hour, min, sec); 764 | Win.render_cal($cal, new_date); 765 | }).data('day', day_last)); 766 | } 767 | day_last ++; 768 | } 769 | $cal.append($l); 770 | } 771 | function ipt_blur(){ 772 | var vars = $(this).parent().parent().find('.lxinput'); 773 | Win.render_cal($cal, new_date = new Date( 774 | vars[0].value, vars[1].value - 1, vars[2].value, 775 | vars[3].value, vars[4].value, vars[5].value)); 776 | } 777 | $cal.append( 778 | mkdiv('lx-cal-line').append( 779 | mkipt('text', 'lxinput quad', year).blur(ipt_blur), 780 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_YEAR), 781 | mkipt('text', 'lxinput quad', month).blur(ipt_blur), 782 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_MONTH), 783 | mkipt('text', 'lxinput quad', day).blur(ipt_blur), 784 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_DAY)), 785 | mkdiv('lx-cal-line').append( 786 | mkipt('text', 'lxinput quad', hour).blur(ipt_blur), 787 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_HOUR), 788 | mkipt('text', 'lxinput quad', min).blur(ipt_blur), 789 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_MIN), 790 | mkipt('text', 'lxinput quad', day).blur(ipt_blur), 791 | mkdiv('lxlabel slim', Win.Lang.CAL_SEP_SEC)), 792 | mkdiv('lx-cal-line').append( 793 | $('
'+Win.Lang.CAL_SEC_NUM+'
'), 794 | mkipt('text', 'lxinput half', Math.round(date.getTime()/1000)).blur(function(){ 795 | Win.render_cal($cal, new Date($(this).val() * 1000)); 796 | }), 797 | mkipt('button', 'lxbutton right', Win.Lang.CAL_TODAY).click(function(){ 798 | Win.render_cal($cal, new Date()); 799 | }))); 800 | } 801 | }; 802 | Win.init(); 803 | })(jQuery, window, 'Win'); --------------------------------------------------------------------------------