var minder, editor; var t = Request('t'); var content = $('#content').val(); if (t) { $('kityminder-editor').append(''); } else { angular.module('kityminderDemo', ['kityminderEditor']) .config(function (configProvider) { configProvider.set('imageUpload', '../UploadImg'); }) .controller('MainController', function ($scope) { $scope.initEditor = function (editor, minder) { var content = document.getElementById('content').value; if (content.length > 0) { content = JSON.parse(content); minder.importJson(content); } }; }); } //收藏 function Collect(btnCollect, id) { btnCollect = $(btnCollect); var action = btnCollect.text() == '收藏' ? '1' : '0'; var json = 'type=2&contentid=' + id + '&action=' + action; $.post('../../Common/Collect', json, function () { layer.msg(btnCollect.text() == '收藏' ? '已收藏' : '已取消'); btnCollect.text(btnCollect.text() == '收藏' ? '取消收藏' : '收藏'); }); }