/**
*
* showdown: https://github.com/showdownjs/showdown
*
* author: Di (微信小程序开发工程师)
* organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
* 垂直微信小程序开发交流社区
*
* github地址: https://github.com/icindy/wxParse
*
* for: 微信小程序富文本解析
* detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
*/
function getDefaultOpts(simple) {
'use strict';
var defaultOptions = {
omitExtraWLInCodeBlocks: {
defaultValue: false,
describe: 'Omit the default extra whiteline added to code blocks',
type: 'boolean'
},
noHeaderId: {
defaultValue: false,
describe: 'Turn on/off generated header id',
type: 'boolean'
},
prefixHeaderId: {
defaultValue: false,
describe: 'Specify a prefix to generated header ids',
type: 'string'
},
headerLevelStart: {
defaultValue: false,
describe: 'The header blocks level start',
type: 'integer'
},
parseImgDimensions: {
defaultValue: false,
describe: 'Turn on/off image dimension parsing',
type: 'boolean'
},
simplifiedAutoLink: {
defaultValue: false,
describe: 'Turn on/off GFM autolink style',
type: 'boolean'
},
literalMidWordUnderscores: {
defaultValue: false,
describe: 'Parse midword underscores as literal underscores',
type: 'boolean'
},
strikethrough: {
defaultValue: false,
describe: 'Turn on/off strikethrough support',
type: 'boolean'
},
tables: {
defaultValue: false,
describe: 'Turn on/off tables support',
type: 'boolean'
},
tablesHeaderId: {
defaultValue: false,
describe: 'Add an id to table headers',
type: 'boolean'
},
ghCodeBlocks: {
defaultValue: true,
describe: 'Turn on/off GFM fenced code blocks support',
type: 'boolean'
},
tasklists: {
defaultValue: false,
describe: 'Turn on/off GFM tasklist support',
type: 'boolean'
},
smoothLivePreview: {
defaultValue: false,
describe: 'Prevents weird effects in live previews due to incomplete input',
type: 'boolean'
},
smartIndentationFix: {
defaultValue: false,
description: 'Tries to smartly fix identation in es6 strings',
type: 'boolean'
}
};
if (simple === false) {
return JSON.parse(JSON.stringify(defaultOptions));
}
var ret = {};
for (var opt in defaultOptions) {
if (defaultOptions.hasOwnProperty(opt)) {
ret[opt] = defaultOptions[opt].defaultValue;
}
}
return ret;
}
/**
* Created by Tivie on 06-01-2015.
*/
// Private properties
var showdown = {},
parsers = {},
extensions = {},
globalOptions = getDefaultOpts(true),
flavor = {
github: {
omitExtraWLInCodeBlocks: true,
prefixHeaderId: 'user-content-',
simplifiedAutoLink: true,
literalMidWordUnderscores: true,
strikethrough: true,
tables: true,
tablesHeaderId: true,
ghCodeBlocks: true,
tasklists: true
},
vanilla: getDefaultOpts(true)
};
/**
* helper namespace
* @type {{}}
*/
showdown.helper = {};
/**
* TODO LEGACY SUPPORT CODE
* @type {{}}
*/
showdown.extensions = {};
/**
* Set a global option
* @static
* @param {string} key
* @param {*} value
* @returns {showdown}
*/
showdown.setOption = function (key, value) {
'use strict';
globalOptions[key] = value;
return this;
};
/**
* Get a global option
* @static
* @param {string} key
* @returns {*}
*/
showdown.getOption = function (key) {
'use strict';
return globalOptions[key];
};
/**
* Get the global options
* @static
* @returns {{}}
*/
showdown.getOptions = function () {
'use strict';
return globalOptions;
};
/**
* Reset global options to the default values
* @static
*/
showdown.resetOptions = function () {
'use strict';
globalOptions = getDefaultOpts(true);
};
/**
* Set the flavor showdown should use as default
* @param {string} name
*/
showdown.setFlavor = function (name) {
'use strict';
if (flavor.hasOwnProperty(name)) {
var preset = flavor[name];
for (var option in preset) {
if (preset.hasOwnProperty(option)) {
globalOptions[option] = preset[option];
}
}
}
};
/**
* Get the default options
* @static
* @param {boolean} [simple=true]
* @returns {{}}
*/
showdown.getDefaultOptions = function (simple) {
'use strict';
return getDefaultOpts(simple);
};
/**
* Get or set a subParser
*
* subParser(name) - Get a registered subParser
* subParser(name, func) - Register a subParser
* @static
* @param {string} name
* @param {function} [func]
* @returns {*}
*/
showdown.subParser = function (name, func) {
'use strict';
if (showdown.helper.isString(name)) {
if (typeof func !== 'undefined') {
parsers[name] = func;
} else {
if (parsers.hasOwnProperty(name)) {
return parsers[name];
} else {
throw Error('SubParser named ' + name + ' not registered!');
}
}
}
};
/**
* Gets or registers an extension
* @static
* @param {string} name
* @param {object|function=} ext
* @returns {*}
*/
showdown.extension = function (name, ext) {
'use strict';
if (!showdown.helper.isString(name)) {
throw Error('Extension \'name\' must be a string');
}
name = showdown.helper.stdExtName(name);
// Getter
if (showdown.helper.isUndefined(ext)) {
if (!extensions.hasOwnProperty(name)) {
throw Error('Extension named ' + name + ' is not registered!');
}
return extensions[name];
// Setter
} else {
// Expand extension if it's wrapped in a function
if (typeof ext === 'function') {
ext = ext();
}
// Ensure extension is an array
if (!showdown.helper.isArray(ext)) {
ext = [ext];
}
var validExtension = validate(ext, name);
if (validExtension.valid) {
extensions[name] = ext;
} else {
throw Error(validExtension.error);
}
}
};
/**
* Gets all extensions registered
* @returns {{}}
*/
showdown.getAllExtensions = function () {
'use strict';
return extensions;
};
/**
* Remove an extension
* @param {string} name
*/
showdown.removeExtension = function (name) {
'use strict';
delete extensions[name];
};
/**
* Removes all extensions
*/
showdown.resetExtensions = function () {
'use strict';
extensions = {};
};
/**
* Validate extension
* @param {array} extension
* @param {string} name
* @returns {{valid: boolean, error: string}}
*/
function validate(extension, name) {
'use strict';
var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
ret = {
valid: true,
error: ''
};
if (!showdown.helper.isArray(extension)) {
extension = [extension];
}
for (var i = 0; i < extension.length; ++i) {
var baseMsg = errMsg + ' sub-extension ' + i + ': ',
ext = extension[i];
if (typeof ext !== 'object') {
ret.valid = false;
ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
return ret;
}
if (!showdown.helper.isString(ext.type)) {
ret.valid = false;
ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
return ret;
}
var type = ext.type = ext.type.toLowerCase();
// normalize extension type
if (type === 'language') {
type = ext.type = 'lang';
}
if (type === 'html') {
type = ext.type = 'output';
}
if (type !== 'lang' && type !== 'output' && type !== 'listener') {
ret.valid = false;
ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
return ret;
}
没有合适的资源?快使用搜索试试~ 我知道了~
房地产公司展示微信小程序源码.rar
共93个文件
png:29个
js:18个
wxml:13个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 138 浏览量
2022-07-13
22:09:33
上传
评论
收藏 662KB RAR 举报
温馨提示
房地产公司展示微信小程序源码.rar
资源推荐
资源详情
资源评论
收起资源包目录
房地产公司展示微信小程序源码.rar (93个子文件)
房地产公司展示微信小程序源码
源码
images
index-focus-1.png 81KB
notice-3.png 16KB
index-focus-2.png 140KB
userhead.jpg 7KB
vankelogo.png 11KB
notice-2.png 21KB
notice-1.png 24KB
icon
ico_huiyi@2x.png 2KB
ico_zuowei_A.png 1KB
ico_zuowei_B.png 1KB
notice_A.png 1KB
personal_A.png 2KB
nav_fanhui_B.png 1KB
ico_zuowei_.png 1KB
nav_xiala_lan_B.png 1KB
ico_weixin@2x.png 1KB
ico_huiyi_.png 2KB
index_A.png 1023B
ico_gouxuan.png 1KB
ico_huiyi_A.png 2KB
notice_B.png 1KB
ico_huiyi_B.png 2KB
nav_fanhui_A.png 1KB
index_B.png 1005B
orders_B.png 2KB
personal_B.png 2KB
orders_A.png 2KB
unuserhead.jpg 30KB
zuowei.png 2KB
ditu.png 13KB
ico_ditu.png 36KB
app.json 1KB
wxParse
showdown.js 71KB
wxParse.wxml 36KB
htmlparser.js 5KB
wxParse.js 4KB
html2json.js 8KB
wxParse.wxss 4KB
wxDiscode.js 7KB
pages
index
index.js 1KB
index.json 3B
index.wxss 489B
index.wxml 2KB
booking
booking.wxss 4KB
booking.wxml 3KB
booking.json 2B
booking.js 3KB
scanning
scanning.js 339B
scanning.json 2B
scanning.wxss 34B
scanning.wxml 78B
booking-detail
booking-detail.wxss 1KB
booking-detail.json 2B
booking-detail.wxml 2KB
booking-detail.js 2KB
notice
notice.wxml 1KB
notice.js 3KB
sitting
sitting.wxss 1KB
sitting.wxml 1KB
sitting.js 1KB
sitting.json 49B
conference
conference.js 1KB
conference.wxml 1KB
conference.json 49B
conference.wxss 1KB
article
article.json 2B
article.wxml 180B
article.js 3KB
article.wxss 143B
personal
personal.js 2KB
personal.wxss 1KB
personal.wxml 1KB
personal.json 2B
orders
orders.json 2B
orders.wxml 3KB
orders.wxss 2KB
orders.js 2KB
login
login.wxml 645B
login.wxss 678B
login.json 210B
login.js 2KB
app.wxss 3KB
app.js 905B
utils
util.js 613B
template
template.wxml 139B
截图
1(1).jpg 30KB
4(1).jpg 24KB
1(2).jpg 30KB
3.jpg 22KB
3(1).jpg 22KB
2(1).jpg 41KB
4.jpg 24KB
2(2).jpg 41KB
共 93 条
- 1
资源评论
HappyGirl快乐女孩
- 粉丝: 1w+
- 资源: 4160
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- GEC6818:一款高性能嵌入式开发板GEC6818:一款高性能嵌入式开发板
- 红外和可见光图像融合,红外和可见光图像融合目的,Python实现源码(优质项目源码).zip
- Python中的数据可视化工具Matplotlib
- Yolov8算法在自定义数据集上的训练和应用Yolov8算法在自定义数据集上的训练和应用
- 代码迷宫2.sb3
- C#课程设计大作基于WinForm的页面美观功能完整的导师双选系统源码..zip
- 基于C#实现的Crazepony上位机源代码
- 基于Flask+vue的环境管理系统源码(优质项目源码).zip
- 冒泡排序的定义及java代码实现
- 平均电流知识点(包含平均电流的建模和概述)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功