Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 支持:135,96,365,小蚂蚁编辑器
- */
- ;(function () {
- var host = location.host
- var isDomain = function (t) {
- return host.indexOf(t) !== -1
- }
- var showOk = function (t) {
- return alert('平台:' + t + ' 插件加载成功')
- }
- if (isDomain('96weixin')) {
- $('ul').on('click', 'li[data-id]', function () {
- $(this).data('vip', 0).data('free', 0)
- })
- $('#user_vip').data('vip', 3)
- showOk('96weixin !')
- } else if (isDomain('135editor')) {
- $('body').on('click', '.vip-style', function () {
- $(this).removeClass('vip-style')
- })
- showOk('135editor')
- } else if (isDomain('365editor')) {
- if (typeof vm === 'undefined') {
- return alert('365editor FAILED')
- }
- vm.userInfo.IsVip = topnavInfo.userInfo.IsVip = 1
- vm.userInfo.VipType = topnavInfo.userInfo.VipType = 3
- showOk('365editor')
- } else if (isDomain('xiumi')) {
- return alert('暂不支持秀米')
- } else if (isDomain('xmyeditor')) {
- var usertext = localStorage.getItem('userinfo')
- if (!usertext) return
- var user = JSON.parse(usertext)
- user.group_id = 3
- user.expire_time = (Date.now() / 1000) + 30 * 24 * 3600
- localStorage.setItem('userinfo', JSON.stringify(user))
- var ajax = $.ajax
- var findHtml = function (id, callback) {
- $.get('/home/Oftenstyle/searchs?cateid=0&order=default&page=1&keyword=' + id, function (text) {
- var html = $(text).find('.left_RightBottomD1').data('html')
- if (!html) {
- return alert('数据获取错误')
- }
- callback({code: 200, demo_code: html})
- })
- }
- $.ajax = function (a, b, c, d) {
- if (a && a.url) {
- if (a.url === '/home/Oftenstyle/collectOrUse' || a.url === '/home/template/collectOrUse') {
- return findHtml(a.data.id, function (data) {
- return a.success(data)
- })
- } else if (a.url.indexOf('getStyleInfo') !== -1) {
- return findHtml(a.data.id, function (data) {
- return a.success(data)
- })
- }
- }
- return ajax(a, b, c, d)
- }
- return showOk('小蚂蚁')
- } else {
- return alert('暂不支持这个平台')
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement