This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| controllers.controller('TabBarController',function TabBarController ($scope,$log,$http) { | |
| var tabBarItem =$('#tabBar > .item'); | |
| var chatPanelOpen = false; | |
| tabBarItem.click(function(){ | |
| var tabClass = $(this).data('tab'); | |
| if(!chatPanelOpen){ | |
| $('#wrapper').addClass(tabClass); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name IKnowIKnow | |
| // @namespace IKnowIKnow | |
| // @include http://*.douban.com/* | |
| // @version 1 | |
| // @grant GM_setValue | |
| // @grant GM_getValue | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--form中的action需要增加你表单的提交地址,这样验证插件才能知道你的ajax往哪儿发: action="/record_email"--> | |
| <form id="recordEmail" class="form-inline" method="post" enctype="multipart/form-data" accept-charset="utf-8" action="/record_email"> | |
| <!--.......--> | |
| </form> | |
| <script> | |
| $('#recordEmail').Validform({ | |
| ajaxPost : true, //这里开启ajax提交 | |
| tiptype : function(msg,o,cssctl){ | |
| var objtip=o.obj.parents('#recordEmail').find(".Validform_checktip"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme", | |
| "draw_indent_guides": true, | |
| "draw_white_space": "all", | |
| "fade_fold_buttons": false, | |
| "font_face": "Source Code Pro", | |
| "font_size": 12.0, | |
| "highlight_modified_tabs": true, | |
| "ignored_packages": | |
| [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #添加评论 | |
| class new_post_comment: | |
| @session.login_required | |
| def POST(self, pid): | |
| data = web.input() | |
| reg_regchar = '@([a-zA-Z0-9][\w\-\.\_]+)' #正则匹配username | |
| comment = data.postComment | |
| comment = htmlquote(comment).strip().replace("\r\n", "<br/>") #内容过滤 | |
| usernames = re.findall(reg_regchar, comment) #得到username数组 | |
| nicknames = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import web | |
| import app.controllers | |
| from config import view | |
| def notfound(): | |
| return web.notfound(view.error()) | |
| urls = ( | |
| '/post/(\+?[1-9][0-9]*)', 'app.controllers.post.post_show', #正则匹配url 验证非零的正整数 | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class post_image_delete: | |
| @session.login_required | |
| def POST(self, arg): | |
| data = web.input() | |
| path = data.path | |
| part_name = data.part_name | |
| homedir = os.getcwd() | |
| imgPath = homedir + path | |
| if os.path.isfile(imgPath + '/.DS_Store'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| homedir = os.getcwd() | |
| part_name = '201211981222_7a214d288112fe8ef99944aa7ce4d228' | |
| path = '/static/upload/post_img/2012/11/9' | |
| imgPath = homedir + path | |
| if os.path.isfile(imgPath + '/.DS_Store'): | |
| os.remove(imgPath + '/.DS_Store') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class post_image_delete: | |
| @session.login_required | |
| def POST(self, arg): | |
| data = web.input() | |
| path = data.path # 类似 '/static/upload/post_img/2012/11/9' | |
| part_name = data.part_name # 类似 '201211981222_7a214d288112fe8ef99944aa7ce4d228' | |
| homedir = os.getcwd() | |
| imgPath = homedir + path | |
| #上面组装的结果类似这样 : "/home/www/rhinocero" + "/static/upload/post_img/2012/11/9" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function capture(option) { | |
| var window = mediator.getMostRecentWindow("navigator:browser") | |
| //为了在v2ex显示方便,这里加了个回车 | |
| .gBrowser.contentWindow; | |
| var document = window.document; | |
| var html = document.documentElement; | |
| var w, h, x, y; | |
| switch(option) { | |
| case 'visible': | |
| x = 0; |