主要功能: - 修改RequirementModal支持12个订单班选择 - 添加OrderClassIconMap图标映射组件 - Store中添加selectedOrderClass状态管理 - WorkflowPage支持传递orderClass参数 - web_result添加URL参数切换功能 - 创建order-class-handler.js动态处理页面主题 技术改进: - 创建软链接关联订单班数据目录 - 生成wenlu.json和food.json数据结构 - 删除重复的web_result目录 - 添加测试页面test-order-class.html 影响范围: - 展会策划系统现支持12个订单班 - 结果展示页面自动适配不同订单班主题 - 用户可选择不同行业生成对应方案 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
1.7 KiB
JavaScript
84 lines
1.7 KiB
JavaScript
(function () {
|
|
|
|
if (typeof Prism === 'undefined') {
|
|
return;
|
|
}
|
|
|
|
|
|
var invisibles = {
|
|
'tab': /\t/,
|
|
'crlf': /\r\n/,
|
|
'lf': /\n/,
|
|
'cr': /\r/,
|
|
'space': / /
|
|
};
|
|
|
|
|
|
/**
|
|
* Handles the recursive calling of `addInvisibles` for one token.
|
|
*
|
|
* @param {Object|Array} tokens The grammar or array which contains the token.
|
|
* @param {string|number} name The name or index of the token in `tokens`.
|
|
*/
|
|
function handleToken(tokens, name) {
|
|
var value = tokens[name];
|
|
|
|
var type = Prism.util.type(value);
|
|
switch (type) {
|
|
case 'RegExp':
|
|
var inside = {};
|
|
tokens[name] = {
|
|
pattern: value,
|
|
inside: inside
|
|
};
|
|
addInvisibles(inside);
|
|
break;
|
|
|
|
case 'Array':
|
|
for (var i = 0, l = value.length; i < l; i++) {
|
|
handleToken(value, i);
|
|
}
|
|
break;
|
|
|
|
default: // 'Object'
|
|
// eslint-disable-next-line no-redeclare
|
|
var inside = value.inside || (value.inside = {});
|
|
addInvisibles(inside);
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Recursively adds patterns to match invisible characters to the given grammar (if not added already).
|
|
*
|
|
* @param {Object} grammar
|
|
*/
|
|
function addInvisibles(grammar) {
|
|
if (!grammar || grammar['tab']) {
|
|
return;
|
|
}
|
|
|
|
// assign invisibles here to "mark" the grammar in case of self references
|
|
for (var name in invisibles) {
|
|
if (invisibles.hasOwnProperty(name)) {
|
|
grammar[name] = invisibles[name];
|
|
}
|
|
}
|
|
|
|
// eslint-disable-next-line no-redeclare
|
|
for (var name in grammar) {
|
|
if (grammar.hasOwnProperty(name) && !invisibles[name]) {
|
|
if (name === 'rest') {
|
|
addInvisibles(grammar['rest']);
|
|
} else {
|
|
handleToken(grammar, name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Prism.hooks.add('before-highlight', function (env) {
|
|
addInvisibles(env.grammar);
|
|
});
|
|
}());
|