flymis/WebRoot/dojojs/src/cal/textDirectory.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.cal.textDirectory");
dojo.require("dojo.string");
/*
* This class parses a single line from a text/directory file
* and returns an object with four named values; name, group, params
* and value. name, group and value are strings containing the original
* tokens unaltered and values is an array containing name/value pairs
* or a single name token packed into arrays.
*/
dojo.cal.textDirectory.Property = function (line) {
// split into name/value pair
var left = dojo.string.trim(line.substring(0, line.indexOf(':')));
var right = dojo.string.trim(line.substr(line.indexOf(':') + 1));
// seperate name and paramters
var parameters = dojo.string.splitEscaped(left,';');
this.name = parameters[0]
parameters.splice(0, 1);
// parse paramters
this.params = [];
for (var i = 0; i < parameters.length; i++) {
var arr = parameters[i].split("=");
var key = dojo.string.trim(arr[0].toUpperCase());
if (arr.length == 1) { this.params.push([key]); continue; }
var values = dojo.string.splitEscaped(arr[1],',');
for (var j = 0; j < values.length; j++) {
if (dojo.string.trim(values[j]) != '') {
this.params.push([key, dojo.string.trim(values[j])]);
}
}
}
// seperate group
if (this.name.indexOf('.') > 0) {
var arr = this.name.split('.');
this.group = arr[0];
this.name = arr[1];
}
// don't do any parsing, leave to implementation
this.value = right;
}
// tokeniser, parses into an array of properties.
dojo.cal.textDirectory.tokenise = function (text) {
后面还有 15 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。