text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
/* Navicat Premium Data Transfer Source Server : 阿里云MySQL Source Server Type : MySQL Source Server Version : 50718 Source Host : rm-wz9lp2i9322g0n06zvo.mysql.rds.aliyuncs.com:3306 Source Schema : web Target Server Type : MySQL Target Server Version : 50718 File Encoding : 65001 Date: 07/03/2018 09:59:31 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for file_download -- ---------------------------- DROP TABLE IF EXISTS `file_download`; CREATE TABLE `file_download` ( `file_id` int(32) NOT NULL AUTO_INCREMENT, `file_name` char(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, `file_url` char(200) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL, `file_upload_date` timestamp(0) NULL DEFAULT NULL, `file_download_count` int(32) NULL DEFAULT NULL, PRIMARY KEY (`file_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
Humsen/web/docs/数据库部署/第1步 - 创建数据库/file_download.sql/0
{ "file_path": "Humsen/web/docs/数据库部署/第1步 - 创建数据库/file_download.sql", "repo_id": "Humsen", "token_count": 409 }
24
package pers.husen.web.bean.vo; import java.util.Date; /** * @author 何明胜 * * 2017年9月29日 */ public class FileDownloadVo { @Override public String toString() { return "FileDownloadVo [fileId=" + fileId + ", fileName=" + fileName + ", fileUrl=" + fileUrl + ", fileUploadDate=" + fileUploadDate + ", fileDownloadCount=" + fileDownloadCount + "]"; } private int fileId; private String fileName; private String fileUrl; private Date fileUploadDate; private int fileDownloadCount; /** * @return the fileId */ public int getFileId() { return fileId; } /** * @param fileId the fileId to set */ public void setFileId(int fileId) { this.fileId = fileId; } /** * @return the fileName */ public String getFileName() { return fileName; } /** * @param fileName the fileName to set */ public void setFileName(String fileName) { this.fileName = fileName; } /** * @return the fileUrl */ public String getFileUrl() { return fileUrl; } /** * @param fileUrl the fileUrl to set */ public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } /** * @return the fileUploadDate */ public Date getFileUploadDate() { return fileUploadDate; } /** * @param fileUploadDate the fileUploadDate to set */ public void setFileUploadDate(Date fileUploadDate) { this.fileUploadDate = fileUploadDate; } /** * @return the fileDownloadCount */ public int getFileDownloadCount() { return fileDownloadCount; } /** * @param fileDownloadCount the fileDownloadCount to set */ public void setFileDownloadCount(int fileDownloadCount) { this.fileDownloadCount = fileDownloadCount; } }
Humsen/web/web-core/src/pers/husen/web/bean/vo/FileDownloadVo.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/bean/vo/FileDownloadVo.java", "repo_id": "Humsen", "token_count": 580 }
25
package pers.husen.web.common.helper; import java.text.ParseException; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * 时间格式助手 * * @author 何明胜 * * 2017年9月29日 */ public class DateFormatHelper { public static void main(String[] args) { // VisitTotalDaoImpl vImpl = new VisitTotalDaoImpl(); // vImpl.updateVisitCount(); // System.out.println(formatDateYMD()); // System.out.println(new Date()); System.out.println(DateFormatHelper.secondsTodayTotal()); System.out.println((12 * 60 + 22) * 60); System.out.println(DateFormatHelper.dateNumberFormat()); } public static Date formatNowDateHelper() { SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(); String formatDate = dateFormater.format(date); try { return dateFormater.parse(formatDate); } catch (ParseException e) { e.printStackTrace(); } return new Date(); } public static Date formatDateYMD() { Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String dateString = formatter.format(currentTime); ParsePosition pos = new ParsePosition(0); return formatter.parse(dateString, pos); } /** * 从当日0时0分0秒到当前时间的毫秒数 * * @return */ public static Long secondsTodayTotal() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); long zeroSeconds = calendar.getTime().getTime(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return zeroSeconds - calendar.getTime().getTime(); } /** * 获取当前日期数字格式,如20171020为2017年10月20日 */ public static String dateNumberFormat() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); return sdf.format(new Date()); } }
Humsen/web/web-core/src/pers/husen/web/common/helper/DateFormatHelper.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/common/helper/DateFormatHelper.java", "repo_id": "Humsen", "token_count": 725 }
26
package pers.husen.web.dao; import java.util.ArrayList; import pers.husen.web.bean.vo.ArticleCategoryVo; /** * @desc 文章分类接口 * * @author 何明胜 * * @created 2017年12月12日 上午10:07:03 */ public interface ArticleCategoryDao { /** * 插入新的分类 * @param aVo * @return */ public int insertCategory(ArticleCategoryVo aVo); /** * 查询当前最大id * @return */ public int queryMaxId(); /** * 根据文章类别查询分类和相应的数量 * @param classification * @return */ public ArrayList<ArticleCategoryVo> queryCategory3Num(String classification); /** * 查询所有分类 * @return */ public ArrayList<ArticleCategoryVo> queryAllCategory(); }
Humsen/web/web-core/src/pers/husen/web/dao/ArticleCategoryDao.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/dao/ArticleCategoryDao.java", "repo_id": "Humsen", "token_count": 315 }
27
package pers.husen.web.dao.impl; import java.util.ArrayList; import java.util.Date; import pers.husen.web.bean.vo.UserInfoVo; import pers.husen.web.dao.UserInfoDao; import pers.husen.web.dbutil.DbQueryUtils; import pers.husen.web.dbutil.DbManipulationUtils; import pers.husen.web.dbutil.mappingdb.UserInfoMapping; /** * @author 何明胜 * * 2017年9月17日 */ public class UserInfoDaoImpl implements UserInfoDao{ @Override public String queryPasswordByUserName(String userName) { String sql = "SELECT user_password FROM user_info WHERE user_name = ?"; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(userName); return DbQueryUtils.queryStringByParam(sql, paramList); } @Override public int insertUserInfo(UserInfoVo uVo) { String sql = "INSERT INTO user_info " + "(user_name, user_password, user_email, user_phone, user_age, user_sex , user_address) " + "VALUES (?, ?, ?, ?, ?, ?, ?)"; ArrayList<Object> paramList = new ArrayList<Object>(); Object obj = null; paramList.add((obj = uVo.getUserName()) != null ? obj : new Date()); paramList.add((obj = uVo.getUserPassword()) != null ? obj : ""); paramList.add((obj = uVo.getUserEmail()) != null ? obj : ""); paramList.add((obj = uVo.getUserPhone()) != null ? obj : ""); paramList.add((obj = uVo.getUserAge()) != null ? obj : ""); paramList.add((obj = uVo.getUserSex()) != null ? obj : ""); paramList.add((obj = uVo.getUserAddress()) != null ? obj : 0); return DbManipulationUtils.insertNewRecord(sql, paramList); } @Override public UserInfoVo queryUserInfoByName(String userName) { String sql = "SELECT " + UserInfoMapping.USER_ID + ", " + UserInfoMapping.USER_NAME + ", " + UserInfoMapping.USER_NICK_NAME + ", " + UserInfoMapping.USER_EMAIL + ", " + UserInfoMapping.USER_PHONE + "," + UserInfoMapping.USER_AGE + "," + UserInfoMapping.USER_SEX + ", " + UserInfoMapping.USER_ADDRESS + ", " + UserInfoMapping.USER_HEAD_URL + " FROM " + UserInfoMapping.DB_NAME + " WHERE user_name = ?"; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(userName); return DbQueryUtils.queryBeanByParam(sql, paramList, UserInfoVo.class); } @Override public int updateUserInfoById(UserInfoVo uVo) { String sql = "UPDATE " + UserInfoMapping.DB_NAME + " SET " + UserInfoMapping.USER_NAME + "=?, " + UserInfoMapping.USER_EMAIL + "=?, " + UserInfoMapping.USER_PHONE + "=?, " + UserInfoMapping.USER_AGE + "=?, " + UserInfoMapping.USER_SEX + "=?, " + UserInfoMapping.USER_ADDRESS + "=?, " + UserInfoMapping.USER_HEAD_URL + "=?, " + UserInfoMapping.USER_NICK_NAME + "=? " + "WHERE " + UserInfoMapping.USER_ID + "=?"; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(uVo.getUserName()); paramList.add(uVo.getUserEmail()); paramList.add(uVo.getUserPhone()); paramList.add(uVo.getUserAge()); paramList.add(uVo.getUserSex()); paramList.add(uVo.getUserAddress()); paramList.add(uVo.getUserHeadUrl()); paramList.add(uVo.getUserNickName()); paramList.add(uVo.getUserId()); return DbManipulationUtils.updateRecordByParam(sql, paramList); } @Override public int updateUserPwdByName(UserInfoVo uVo) { String sql = "UPDATE " + UserInfoMapping.DB_NAME + " SET " + UserInfoMapping.USER_PASSWORD + "=? " + "WHERE " + UserInfoMapping.USER_NAME + "=?"; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(uVo.getUserPassword()); paramList.add(uVo.getUserName()); return DbManipulationUtils.updateRecordByParam(sql, paramList); } @Override public int updateUserPwdByNameAndEmail(UserInfoVo uVo) { String sql = "UPDATE " + UserInfoMapping.DB_NAME + " SET " + UserInfoMapping.USER_PASSWORD + "=? " + "WHERE " + UserInfoMapping.USER_NAME + "=? " + "AND " + UserInfoMapping.USER_EMAIL + "=?"; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(uVo.getUserPassword()); paramList.add(uVo.getUserName()); paramList.add(uVo.getUserEmail()); return DbManipulationUtils.updateRecordByParam(sql, paramList); } @Override public int updateUserEmailByName(UserInfoVo uVo) { String sql = "UPDATE " + UserInfoMapping.DB_NAME + " SET " + UserInfoMapping.USER_EMAIL + "=? " + "WHERE " + UserInfoMapping.USER_NAME + "=? "; ArrayList<Object> paramList = new ArrayList<Object>(); paramList.add(uVo.getUserEmail()); paramList.add(uVo.getUserName()); return DbManipulationUtils.updateRecordByParam(sql, paramList); } @Override public int queryUserTotalCount(UserInfoVo uVo) { String sql = "SELECT count(*) as count FROM " + UserInfoMapping.DB_NAME; return DbQueryUtils.queryIntByParam(sql, new ArrayList<Object>()); } @Override public ArrayList<UserInfoVo> queryUserPerPage(UserInfoVo uVo,int pageSize, int pageNo) { String sql = "SELECT " + UserInfoMapping.USER_ID + ", " + UserInfoMapping.USER_NAME + ", " + UserInfoMapping.USER_NICK_NAME + ", " + UserInfoMapping.USER_EMAIL + ", " + UserInfoMapping.USER_PHONE + "," + UserInfoMapping.USER_AGE + "," + UserInfoMapping.USER_SEX + ", " + UserInfoMapping.USER_ADDRESS + ", " + UserInfoMapping.USER_HEAD_URL + ", " + UserInfoMapping.USER_PASSWORD + " FROM " + UserInfoMapping.DB_NAME; sql += " ORDER BY user_id LIMIT " + pageSize + " OFFSET " + pageNo; return DbQueryUtils.queryBeanListByParam(sql, new ArrayList<Object>(), UserInfoVo.class); } }
Humsen/web/web-core/src/pers/husen/web/dao/impl/UserInfoDaoImpl.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/dao/impl/UserInfoDaoImpl.java", "repo_id": "Humsen", "token_count": 2261 }
28
package pers.husen.web.dbutil.mappingdb; /** * 网站访问统计数据库 * * @author 何明胜 * * 2017年10月20日 */ public class VisitTotalMapping { /** * 数据库名称 */ public static String DB_NAME = "visit_total"; }
Humsen/web/web-core/src/pers/husen/web/dbutil/mappingdb/VisitTotalMapping.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/dbutil/mappingdb/VisitTotalMapping.java", "repo_id": "Humsen", "token_count": 119 }
29
package pers.husen.web.servlet.article; import java.io.IOException; import java.io.PrintWriter; import java.net.URLDecoder; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; import pers.husen.web.bean.vo.CodeLibraryVo; import pers.husen.web.common.constants.RequestConstants; import pers.husen.web.service.CodeLibrarySvc; /** * 代码查询sevlet,如代码总数量、某一页的代码等 * * @author 何明胜 * * 2017年11月7日 */ @WebServlet(urlPatterns = "/code/query.hms") public class CodeQuerySvt extends HttpServlet { private static final long serialVersionUID = 1L; public CodeQuerySvt() { super(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); response.setContentType("application/json; charset=UTF-8"); PrintWriter out = response.getWriter(); CodeLibrarySvc cSvc = new CodeLibrarySvc(); String requestType = request.getParameter(RequestConstants.PARAM_TYPE); String requestKeywords = request.getParameter(RequestConstants.PARAM_KEYWORDS); requestKeywords = (requestKeywords == null ? "" : URLDecoder.decode(requestKeywords,"utf-8")); String category = request.getParameter(RequestConstants.PARAM_CATEGORY); CodeLibraryVo cVo = new CodeLibraryVo(); cVo.setCodeTitle(requestKeywords); if(category != null && !category.trim().equals("")) { cVo.setCodeCategory(Integer.parseInt(category)); }else { cVo.setCodeCategory(-1); } /** 如果是请求查询总共数量 */ String queryTotalCount = RequestConstants.REQUEST_TYPE_QUERY + RequestConstants.MODE_TOTAL_NUM; if (queryTotalCount.equals(requestType)) { int count = cSvc.queryCodeTotalCount(cVo); out.println(count); return; } /** 如果是查询某一页的代码 */ String queryOnePage = RequestConstants.REQUEST_TYPE_QUERY + RequestConstants.MODE_ONE_PAGE; if (queryOnePage.equals(requestType)) { int pageSize = Integer.parseInt(request.getParameter("pageSize")); int pageNo = Integer.parseInt(request.getParameter("pageNo")); ArrayList<CodeLibraryVo> cVos = cSvc.queryCodeLibraryPerPage(cVo, pageSize, pageNo); String json = JSONArray.fromObject(cVos).toString(); out.println(json); return; } /** 如果是查询上一篇有效代码 */ String queryPrevious = RequestConstants.REQUEST_TYPE_QUERY + RequestConstants.MODE_PREVIOUS; if (queryPrevious.equals(requestType)) { int codeId = Integer.parseInt(request.getParameter("codeId")); cVo = cSvc.queryPreviousCode(codeId); int previousCode = 0; if (cVo != null && cVo.getCodeId() != 0) { previousCode = cVo.getCodeId(); } out.println(previousCode); return; } /** 如果是查询上一篇有效代码 */ String queryNext = RequestConstants.REQUEST_TYPE_QUERY + RequestConstants.MODE_NEXT; if (queryNext.equals(requestType)) { int codeId = Integer.parseInt(request.getParameter("codeId")); cVo = cSvc.queryNextCode(codeId); int nextCode = 0; if (cVo != null && cVo.getCodeId() != 0) { nextCode = cVo.getCodeId(); } out.println(nextCode); } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
Humsen/web/web-core/src/pers/husen/web/servlet/article/CodeQuerySvt.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/servlet/article/CodeQuerySvt.java", "repo_id": "Humsen", "token_count": 1390 }
30
package pers.husen.web.servlet.module.usercenter; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import pers.husen.web.common.constants.ResponseConstants; import pers.husen.web.common.helper.ReadH5Helper; /** * @desc 编辑文章 * * @author 何明胜 * * @created 2017年12月27日 下午3:56:11 */ @WebServlet(urlPatterns = "/editor/article.hms") public class EditorArticleSvt extends HttpServlet { private static final long serialVersionUID = 1L; public EditorArticleSvt() { super(); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); ReadH5Helper.writeHtmlByName(ResponseConstants.EDITOR_ARTICLE_TEMPLATE_PATH, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
Humsen/web/web-core/src/pers/husen/web/servlet/module/usercenter/EditorArticleSvt.java/0
{ "file_path": "Humsen/web/web-core/src/pers/husen/web/servlet/module/usercenter/EditorArticleSvt.java", "repo_id": "Humsen", "token_count": 431 }
31
@charset "UTF-8"; .version-div { padding-top: 0 !important; padding-bottom: 0 !important; } .version-width { width: 100%; } .version-content { margin-left: 25px; } .version-heading { margin-bottom: 40px; }
Humsen/web/web-mobile/WebContent/css/index/version-feature.css/0
{ "file_path": "Humsen/web/web-mobile/WebContent/css/index/version-feature.css", "repo_id": "Humsen", "token_count": 89 }
32
/** * @desc 判断后台是否是手机 * * @author 何明胜 * * @created 2018年1月15日 下午1:05:01 */ $(function() { var mobile_flag = $.isMobile(); // false为PC端,true为手机端 if (mobile_flag) { // 顶部导航栏 $('.header-nav').css({ 'margin-left': '0 !important' }) $('#accessToday').css({ 'margin-left' : '0' }); $('#onlineCurrent').css({ 'margin-left' : '5px' }); setTimeout(function() { //导航栏加上边距 $('#topBar').children('div').addClass('top-bar-div'); }, 300); } });
Humsen/web/web-mobile/WebContent/js/is-center-mobile.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/js/is-center-mobile.js", "repo_id": "Humsen", "token_count": 280 }
33
<link rel="stylesheet" href="/css/login/login.css"> <!-- 注册窗口 --> <div id="register" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <button class="close" data-dismiss="modal"> <span>&times;</span> </button> </div> <div class="modal-title"> <h1 class="text-center login-title">注册</h1> </div> <div class="modal-body"> <div id="registerForm" class="form-group"> <div class="form-group"> <label for="">用户名</label> <input name="username" id="txt_userNameRegister" class="form-control" type="text" placeholder="5-15位字母或数字"> </div> <div class="form-group"> <label for="">密码</label> <input name="password" id="txt_userPwdRegister" class="form-control" type="password" placeholder="至少6位字母或数字"> </div> <div class="form-group"> <label for="">再次输入密码</label> <input name="confirmPassword" class="form-control" type="password" placeholder="至少6位字母或数字"> </div> <div class="form-group"> <label for="">邮箱</label> <input id="txt_userEmailRegister" name="email" class="form-control" type="text" placeholder="例如:123@123.com"> </div> <div class="text-right"> <button id="btn_submitRegister" class="btn btn-primary">提交</button> <button id="btnCancel" class="btn btn-danger" data-dismiss="modal">取消</button> </div> <a href="" data-toggle="modal" data-dismiss="modal" data-target="#login">已有账号?点我登录</a> </div> </div> </div> </div> </div> <!-- 登录窗口 --> <div id="login" class="modal fade" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <button class="close" data-dismiss="modal"> <span>&times;</span> </button> </div> <div class="modal-title"> <h1 class="text-center login-title">登录</h1> </div> <div class="modal-body"> <div id="loginForm" class="form-group"> <div class="form-group"> <label for="">用户名</label> <input name="username" id="txt_userNameLogin" class="form-control" type="text" placeholder=""> </div> <div class="form-group"> <label for="">密码</label> <input id="txt_userPwdLogin" name="password" class="form-control" type="password" placeholder=""> </div> <div class="text-right"> <input id="btnLogin" type="button" class="btn btn-primary" value="登录"> <input id="btnLoginCancel" type="button" class="btn btn-danger" data-dismiss="modal" value="取消"> </div> <a href="" data-toggle="modal" data-dismiss="modal" data-target="#register">注册账号</a> <a id="btn_forgetPwd" href="" class="forget-pwd" data-dismiss="modal">忘记密码?</a> </div> </div> </div> </div> </div> <!-- QQ群信息 --> <nav class="navbar-fixed-bottom qq-fixed-bottom navbar-bottom"> 欢迎加入开发交流QQ群:805668552 <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=41068b9adb14521cab1ebfea385e3e4aabf466115ba5278ca4d41a605506c096"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="点击加入:Java全栈开发学习交流" title="Java全栈开发学习交流"></a> </nav> <!-- 底部版权信息 --> <nav class="navbar-fixed-bottom navbar-bottom"> <span class="glyphicon glyphicon-copyright-mark"></span>2017-2020&nbsp;何明胜&nbsp;版权所有&nbsp;<a href="http://www.beian.miit.gov.cn" target="_blank">渝ICP备16013250号</a> </nav>
Humsen/web/web-mobile/WebContent/module/login/login.html/0
{ "file_path": "Humsen/web/web-mobile/WebContent/module/login/login.html", "repo_id": "Humsen", "token_count": 1803 }
34
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { var modes = ["clike", "css", "javascript"]; for (var i = 0; i < modes.length; ++i) CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "}); function continueComment(cm) { if (cm.getOption("disableInput")) return CodeMirror.Pass; var ranges = cm.listSelections(), mode, inserts = []; for (var i = 0; i < ranges.length; i++) { var pos = ranges[i].head, token = cm.getTokenAt(pos); if (token.type != "comment") return CodeMirror.Pass; var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode; if (!mode) mode = modeHere; else if (mode != modeHere) return CodeMirror.Pass; var insert = null; if (mode.blockCommentStart && mode.blockCommentContinue) { var end = token.string.indexOf(mode.blockCommentEnd); var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) { // Comment ended, don't continue it } else if (token.string.indexOf(mode.blockCommentStart) == 0) { insert = full.slice(0, token.start); if (!/^\s*$/.test(insert)) { insert = ""; for (var j = 0; j < token.start; ++j) insert += " "; } } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && found + mode.blockCommentContinue.length > token.start && /^\s*$/.test(full.slice(0, found))) { insert = full.slice(0, found); } if (insert != null) insert += mode.blockCommentContinue; } if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) { var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment); if (found > -1) { insert = line.slice(0, found); if (/\S/.test(insert)) insert = null; else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0]; } } if (insert == null) return CodeMirror.Pass; inserts[i] = "\n" + insert; } cm.operation(function() { for (var i = ranges.length - 1; i >= 0; i--) cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert"); }); } function continueLineCommentEnabled(cm) { var opt = cm.getOption("continueComments"); if (opt && typeof opt == "object") return opt.continueLineComment !== false; return true; } CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { if (prev && prev != CodeMirror.Init) cm.removeKeyMap("continueComment"); if (val) { var key = "Enter"; if (typeof val == "string") key = val; else if (typeof val == "object" && val.key) key = val.key; var map = {name: "continueComment"}; map[key] = continueComment; cm.addKeyMap(map); } }); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/comment/continuecomment.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/comment/continuecomment.js", "repo_id": "Humsen", "token_count": 1388 }
35
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; function doFold(cm, pos, options, force) { if (options && options.call) { var finder = options; options = null; } else { var finder = getOption(cm, options, "rangeFinder"); } if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); var minSize = getOption(cm, options, "minFoldSize"); function getRange(allowFolded) { var range = finder(cm, pos); if (!range || range.to.line - range.from.line < minSize) return null; var marks = cm.findMarksAt(range.from); for (var i = 0; i < marks.length; ++i) { if (marks[i].__isFold && force !== "fold") { if (!allowFolded) return null; range.cleared = true; marks[i].clear(); } } return range; } var range = getRange(true); if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { pos = CodeMirror.Pos(pos.line - 1, 0); range = getRange(false); } if (!range || range.cleared || force === "unfold") return; var myWidget = makeWidget(cm, options); CodeMirror.on(myWidget, "mousedown", function(e) { myRange.clear(); CodeMirror.e_preventDefault(e); }); var myRange = cm.markText(range.from, range.to, { replacedWith: myWidget, clearOnEnter: true, __isFold: true }); myRange.on("clear", function(from, to) { CodeMirror.signal(cm, "unfold", cm, from, to); }); CodeMirror.signal(cm, "fold", cm, range.from, range.to); } function makeWidget(cm, options) { var widget = getOption(cm, options, "widget"); if (typeof widget == "string") { var text = document.createTextNode(widget); widget = document.createElement("span"); widget.appendChild(text); widget.className = "CodeMirror-foldmarker"; } return widget; } // Clumsy backwards-compatible interface CodeMirror.newFoldFunction = function(rangeFinder, widget) { return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; }; // New-style interface CodeMirror.defineExtension("foldCode", function(pos, options, force) { doFold(this, pos, options, force); }); CodeMirror.defineExtension("isFolded", function(pos) { var marks = this.findMarksAt(pos); for (var i = 0; i < marks.length; ++i) if (marks[i].__isFold) return true; }); CodeMirror.commands.toggleFold = function(cm) { cm.foldCode(cm.getCursor()); }; CodeMirror.commands.fold = function(cm) { cm.foldCode(cm.getCursor(), null, "fold"); }; CodeMirror.commands.unfold = function(cm) { cm.foldCode(cm.getCursor(), null, "unfold"); }; CodeMirror.commands.foldAll = function(cm) { cm.operation(function() { for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), null, "fold"); }); }; CodeMirror.commands.unfoldAll = function(cm) { cm.operation(function() { for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold"); }); }; CodeMirror.registerHelper("fold", "combine", function() { var funcs = Array.prototype.slice.call(arguments, 0); return function(cm, start) { for (var i = 0; i < funcs.length; ++i) { var found = funcs[i](cm, start); if (found) return found; } }; }); CodeMirror.registerHelper("fold", "auto", function(cm, start) { var helpers = cm.getHelpers(start, "fold"); for (var i = 0; i < helpers.length; i++) { var cur = helpers[i](cm, start); if (cur) return cur; } }); var defaultOptions = { rangeFinder: CodeMirror.fold.auto, widget: "\u2194", minFoldSize: 0, scanUp: false }; CodeMirror.defineOption("foldOptions", null); function getOption(cm, options, name) { if (options && options[name] !== undefined) return options[name]; var editorOptions = cm.options.foldOptions; if (editorOptions && editorOptions[name] !== undefined) return editorOptions[name]; return defaultOptions[name]; } CodeMirror.defineExtension("foldOption", function(options, name) { return getOption(this, options, name); }); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/fold/foldcode.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/fold/foldcode.js", "repo_id": "Humsen", "token_count": 1860 }
36
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; // declare global: JSHINT var bogus = [ "Dangerous comment" ]; var warnings = [ [ "Expected '{'", "Statement body should be inside '{ }' braces." ] ]; var errors = [ "Missing semicolon", "Extra comma", "Missing property name", "Unmatched ", " and instead saw", " is not defined", "Unclosed string", "Stopping, unable to continue" ]; function validator(text, options) { if (!window.JSHINT) return []; JSHINT(text, options); var errors = JSHINT.data().errors, result = []; if (errors) parseErrors(errors, result); return result; } CodeMirror.registerHelper("lint", "javascript", validator); function cleanup(error) { // All problems are warnings by default fixWith(error, warnings, "warning", true); fixWith(error, errors, "error"); return isBogus(error) ? null : error; } function fixWith(error, fixes, severity, force) { var description, fix, find, replace, found; description = error.description; for ( var i = 0; i < fixes.length; i++) { fix = fixes[i]; find = (typeof fix === "string" ? fix : fix[0]); replace = (typeof fix === "string" ? null : fix[1]); found = description.indexOf(find) !== -1; if (force || found) { error.severity = severity; } if (found && replace) { error.description = replace; } } } function isBogus(error) { var description = error.description; for ( var i = 0; i < bogus.length; i++) { if (description.indexOf(bogus[i]) !== -1) { return true; } } return false; } function parseErrors(errors, output) { for ( var i = 0; i < errors.length; i++) { var error = errors[i]; if (error) { var linetabpositions, index; linetabpositions = []; // This next block is to fix a problem in jshint. Jshint // replaces // all tabs with spaces then performs some checks. The error // positions (character/space) are then reported incorrectly, // not taking the replacement step into account. Here we look // at the evidence line and try to adjust the character position // to the correct value. if (error.evidence) { // Tab positions are computed once per line and cached var tabpositions = linetabpositions[error.line]; if (!tabpositions) { var evidence = error.evidence; tabpositions = []; // ugggh phantomjs does not like this // forEachChar(evidence, function(item, index) { Array.prototype.forEach.call(evidence, function(item, index) { if (item === '\t') { // First col is 1 (not 0) to match error // positions tabpositions.push(index + 1); } }); linetabpositions[error.line] = tabpositions; } if (tabpositions.length > 0) { var pos = error.character; tabpositions.forEach(function(tabposition) { if (pos > tabposition) pos -= 1; }); error.character = pos; } } var start = error.character - 1, end = start + 1; if (error.evidence) { index = error.evidence.substring(start).search(/.\b/); if (index > -1) { end += index; } } // Convert to format expected by validation service error.description = error.reason;// + "(jshint)"; error.start = error.character; error.end = end; error = cleanup(error); if (error) output.push({message: error.description, severity: error.severity, from: CodeMirror.Pos(error.line - 1, start), to: CodeMirror.Pos(error.line - 1, end)}); } } } });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/lint/javascript-lint.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/lint/javascript-lint.js", "repo_id": "Humsen", "token_count": 1927 }
37
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineExtension("annotateScrollbar", function(options) { if (typeof options == "string") options = {className: options}; return new Annotation(this, options); }); CodeMirror.defineOption("scrollButtonHeight", 0); function Annotation(cm, options) { this.cm = cm; this.options = options; this.buttonHeight = options.scrollButtonHeight || cm.getOption("scrollButtonHeight"); this.annotations = []; this.doRedraw = this.doUpdate = null; this.div = cm.getWrapperElement().appendChild(document.createElement("div")); this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none"; this.computeScale(); function scheduleRedraw(delay) { clearTimeout(self.doRedraw); self.doRedraw = setTimeout(function() { self.redraw(); }, delay); } var self = this; cm.on("refresh", this.resizeHandler = function() { clearTimeout(self.doUpdate); self.doUpdate = setTimeout(function() { if (self.computeScale()) scheduleRedraw(20); }, 100); }); cm.on("markerAdded", this.resizeHandler); cm.on("markerCleared", this.resizeHandler); if (options.listenForChanges !== false) cm.on("change", this.changeHandler = function() { scheduleRedraw(250); }); } Annotation.prototype.computeScale = function() { var cm = this.cm; var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) / cm.heightAtLine(cm.lastLine() + 1, "local"); if (hScale != this.hScale) { this.hScale = hScale; return true; } }; Annotation.prototype.update = function(annotations) { this.annotations = annotations; this.redraw(); }; Annotation.prototype.redraw = function(compute) { if (compute !== false) this.computeScale(); var cm = this.cm, hScale = this.hScale; var frag = document.createDocumentFragment(), anns = this.annotations; if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { var ann = anns[i]; var top = nextTop || cm.charCoords(ann.from, "local").top * hScale; var bottom = cm.charCoords(ann.to, "local").bottom * hScale; while (i < anns.length - 1) { nextTop = cm.charCoords(anns[i + 1].from, "local").top * hScale; if (nextTop > bottom + .9) break; ann = anns[++i]; bottom = cm.charCoords(ann.to, "local").bottom * hScale; } if (bottom == top) continue; var height = Math.max(bottom - top, 3); var elt = frag.appendChild(document.createElement("div")); elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + (top + this.buttonHeight) + "px; height: " + height + "px"; elt.className = this.options.className; } this.div.textContent = ""; this.div.appendChild(frag); }; Annotation.prototype.clear = function() { this.cm.off("refresh", this.resizeHandler); this.cm.off("markerAdded", this.resizeHandler); this.cm.off("markerCleared", this.resizeHandler); if (this.changeHandler) this.cm.off("change", this.changeHandler); this.div.parentNode.removeChild(this.div); }; });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/scroll/annotatescrollbar.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/addon/scroll/annotatescrollbar.js", "repo_id": "Humsen", "token_count": 1414 }
38
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "css"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } // Error, because "foobarhello" is neither a known type or property, but // property was expected (after "and"), and it should be in parenthese. MT("atMediaUnknownType", "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); // Soft error, because "foobarhello" is not a known property or type. MT("atMediaUnknownProperty", "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); // Make sure nesting works with media queries MT("atMediaMaxWidthNested", "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); MT("tagSelector", "[tag foo] { }"); MT("classSelector", "[qualifier .foo-bar_hello] { }"); MT("idSelector", "[builtin #foo] { [error #foo] }"); MT("tagSelectorUnclosed", "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); MT("tagStringNoQuotes", "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); MT("tagStringDouble", "[tag foo] { [property font-family]: [string \"hello world\"]; }"); MT("tagStringSingle", "[tag foo] { [property font-family]: [string 'hello world']; }"); MT("tagColorKeyword", "[tag foo] {", " [property color]: [keyword black];", " [property color]: [keyword navy];", " [property color]: [keyword yellow];", "}"); MT("tagColorHex3", "[tag foo] { [property background]: [atom #fff]; }"); MT("tagColorHex6", "[tag foo] { [property background]: [atom #ffffff]; }"); MT("tagColorHex4", "[tag foo] { [property background]: [atom&error #ffff]; }"); MT("tagColorHexInvalid", "[tag foo] { [property background]: [atom&error #ffg]; }"); MT("tagNegativeNumber", "[tag foo] { [property margin]: [number -5px]; }"); MT("tagPositiveNumber", "[tag foo] { [property padding]: [number 5px]; }"); MT("tagVendor", "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); MT("tagBogusProperty", "[tag foo] { [property&error barhelloworld]: [number 0]; }"); MT("tagTwoProperties", "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); MT("tagTwoPropertiesURL", "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); MT("commentSGML", "[comment <!--comment-->]"); MT("commentSGML2", "[comment <!--comment]", "[comment -->] [tag div] {}"); MT("indent_tagSelector", "[tag strong], [tag em] {", " [property background]: [atom rgba](", " [number 255], [number 255], [number 0], [number .2]", " );", "}"); MT("indent_atMedia", "[def @media] {", " [tag foo] {", " [property color]:", " [keyword yellow];", " }", "}"); MT("indent_comma", "[tag foo] {", " [property font-family]: [variable verdana],", " [atom sans-serif];", "}"); MT("indent_parentheses", "[tag foo]:[variable-3 before] {", " [property background]: [atom url](", "[string blahblah]", "[string etc]", "[string ]) [keyword !important];", "}"); MT("font_face", "[def @font-face] {", " [property font-family]: [string 'myfont'];", " [error nonsense]: [string 'abc'];", " [property src]: [atom url]([string http://blah]),", " [atom url]([string http://foo]);", "}"); MT("empty_url", "[def @import] [tag url]() [tag screen];"); MT("parens", "[qualifier .foo] {", " [property background-image]: [variable fade]([atom #000], [number 20%]);", " [property border-image]: [atom linear-gradient](", " [atom to] [atom bottom],", " [variable fade]([atom #000], [number 20%]) [number 0%],", " [variable fade]([atom #000], [number 20%]) [number 100%]", " );", "}"); MT("css_variable", ":[variable-3 root] {", " [variable-2 --main-color]: [atom #06c];", "}", "[tag h1][builtin #foo] {", " [property color]: [atom var]([variable-2 --main-color]);", "}"); MT("supports", "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", " [property text-align-last]: [atom justify];", "}"); MT("document", "[def @document] [tag url]([string http://blah]),", " [tag url-prefix]([string https://]),", " [tag domain]([string blah.com]),", " [tag regexp]([string \".*blah.+\"]) {", " [builtin #id] {", " [property background-color]: [keyword white];", " }", " [tag foo] {", " [property font-family]: [variable Verdana], [atom sans-serif];", " }", " }"); MT("document_url", "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); MT("document_urlPrefix", "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); MT("document_domain", "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); MT("document_regexp", "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); MT("counter-style", "[def @counter-style] [variable binary] {", " [property system]: [atom numeric];", " [property symbols]: [number 0] [number 1];", " [property suffix]: [string \".\"];", " [property range]: [atom infinite];", " [property speak-as]: [atom numeric];", "}"); MT("counter-style-additive-symbols", "[def @counter-style] [variable simple-roman] {", " [property system]: [atom additive];", " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", " [property range]: [number 1] [number 49];", "}"); MT("counter-style-use", "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); MT("counter-style-symbols", "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); })();
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/css/test.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/css/test.js", "repo_id": "Humsen", "token_count": 2583 }
39
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("gfm", function(config, modeConfig) { var codeDepth = 0; function blankLine(state) { state.code = false; return null; } var gfmOverlay = { startState: function() { return { code: false, codeBlock: false, ateSpace: false }; }, copyState: function(s) { return { code: s.code, codeBlock: s.codeBlock, ateSpace: s.ateSpace }; }, token: function(stream, state) { state.combineTokens = null; // Hack to prevent formatting override inside code blocks (block and inline) if (state.codeBlock) { if (stream.match(/^```/)) { state.codeBlock = false; return null; } stream.skipToEnd(); return null; } if (stream.sol()) { state.code = false; } if (stream.sol() && stream.match(/^```/)) { stream.skipToEnd(); state.codeBlock = true; return null; } // If this block is changed, it may need to be updated in Markdown mode if (stream.peek() === '`') { stream.next(); var before = stream.pos; stream.eatWhile('`'); var difference = 1 + stream.pos - before; if (!state.code) { codeDepth = difference; state.code = true; } else { if (difference === codeDepth) { // Must be exact state.code = false; } } return null; } else if (state.code) { stream.next(); return null; } // Check if space. If so, links can be formatted later on if (stream.eatSpace()) { state.ateSpace = true; return null; } if (stream.sol() || state.ateSpace) { state.ateSpace = false; if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { // User/Project@SHA // User@SHA // SHA state.combineTokens = true; return "link"; } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { // User/Project#Num // User#Num // #Num state.combineTokens = true; return "link"; } } if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) && stream.string.slice(stream.start - 2, stream.start) != "](") { // URLs // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine state.combineTokens = true; return "link"; } stream.next(); return null; }, blankLine: blankLine }; var markdownConfig = { underscoresBreakWords: false, taskLists: true, fencedCodeBlocks: true, strikethrough: true }; for (var attr in modeConfig) { markdownConfig[attr] = modeConfig[attr]; } markdownConfig.name = "markdown"; CodeMirror.defineMIME("gfmBase", markdownConfig); return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay); }, "markdown"); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/gfm/gfm.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/gfm/gfm.js", "repo_id": "Humsen", "token_count": 1814 }
40
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("jinja2", function() { var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif", "extends", "filter", "endfilter", "firstof", "for", "endfor", "if", "endif", "ifchanged", "endifchanged", "ifequal", "endifequal", "ifnotequal", "endifnotequal", "in", "include", "load", "not", "now", "or", "parsed", "regroup", "reversed", "spaceless", "endspaceless", "ssi", "templatetag", "openblock", "closeblock", "openvariable", "closevariable", "openbrace", "closebrace", "opencomment", "closecomment", "widthratio", "url", "with", "endwith", "get_current_language", "trans", "endtrans", "noop", "blocktrans", "endblocktrans", "get_available_languages", "get_current_language_bidi", "plural"], operator = /^[+\-*&%=<>!?|~^]/, sign = /^[:\[\(\{]/, atom = ["true", "false"], number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); atom = new RegExp("((" + atom.join(")|(") + "))\\b"); function tokenBase (stream, state) { var ch = stream.peek(); //Comment if (state.incomment) { if(!stream.skipTo("#}")) { stream.skipToEnd(); } else { stream.eatWhile(/\#|}/); state.incomment = false; } return "comment"; //Tag } else if (state.intag) { //After operator if(state.operator) { state.operator = false; if(stream.match(atom)) { return "atom"; } if(stream.match(number)) { return "number"; } } //After sign if(state.sign) { state.sign = false; if(stream.match(atom)) { return "atom"; } if(stream.match(number)) { return "number"; } } if(state.instring) { if(ch == state.instring) { state.instring = false; } stream.next(); return "string"; } else if(ch == "'" || ch == '"') { state.instring = ch; stream.next(); return "string"; } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { state.intag = false; return "tag"; } else if(stream.match(operator)) { state.operator = true; return "operator"; } else if(stream.match(sign)) { state.sign = true; } else { if(stream.eat(" ") || stream.sol()) { if(stream.match(keywords)) { return "keyword"; } if(stream.match(atom)) { return "atom"; } if(stream.match(number)) { return "number"; } if(stream.sol()) { stream.next(); } } else { stream.next(); } } return "variable"; } else if (stream.eat("{")) { if (ch = stream.eat("#")) { state.incomment = true; if(!stream.skipTo("#}")) { stream.skipToEnd(); } else { stream.eatWhile(/\#|}/); state.incomment = false; } return "comment"; //Open tag } else if (ch = stream.eat(/\{|%/)) { //Cache close tag state.intag = ch; if(ch == "{") { state.intag = "}"; } stream.eat("-"); return "tag"; } } stream.next(); }; return { startState: function () { return {tokenize: tokenBase}; }, token: function (stream, state) { return state.tokenize(stream, state); } }; }); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/jinja2/jinja2.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/jinja2/jinja2.js", "repo_id": "Humsen", "token_count": 2154 }
41
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE // CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) // This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("perl",function(){ // http://perldoc.perl.org var PERL={ // null - magic touch // 1 - keyword // 2 - def // 3 - atom // 4 - operator // 5 - variable-2 (predefined) // [x,y] - x=1,2,3; y=must be defined if x{...} // PERL operators '->' : 4, '++' : 4, '--' : 4, '**' : 4, // ! ~ \ and unary + and - '=~' : 4, '!~' : 4, '*' : 4, '/' : 4, '%' : 4, 'x' : 4, '+' : 4, '-' : 4, '.' : 4, '<<' : 4, '>>' : 4, // named unary operators '<' : 4, '>' : 4, '<=' : 4, '>=' : 4, 'lt' : 4, 'gt' : 4, 'le' : 4, 'ge' : 4, '==' : 4, '!=' : 4, '<=>' : 4, 'eq' : 4, 'ne' : 4, 'cmp' : 4, '~~' : 4, '&' : 4, '|' : 4, '^' : 4, '&&' : 4, '||' : 4, '//' : 4, '..' : 4, '...' : 4, '?' : 4, ':' : 4, '=' : 4, '+=' : 4, '-=' : 4, '*=' : 4, // etc. ??? ',' : 4, '=>' : 4, '::' : 4, // list operators (rightward) 'not' : 4, 'and' : 4, 'or' : 4, 'xor' : 4, // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) 'BEGIN' : [5,1], 'END' : [5,1], 'PRINT' : [5,1], 'PRINTF' : [5,1], 'GETC' : [5,1], 'READ' : [5,1], 'READLINE' : [5,1], 'DESTROY' : [5,1], 'TIE' : [5,1], 'TIEHANDLE' : [5,1], 'UNTIE' : [5,1], 'STDIN' : 5, 'STDIN_TOP' : 5, 'STDOUT' : 5, 'STDOUT_TOP' : 5, 'STDERR' : 5, 'STDERR_TOP' : 5, '$ARG' : 5, '$_' : 5, '@ARG' : 5, '@_' : 5, '$LIST_SEPARATOR' : 5, '$"' : 5, '$PROCESS_ID' : 5, '$PID' : 5, '$$' : 5, '$REAL_GROUP_ID' : 5, '$GID' : 5, '$(' : 5, '$EFFECTIVE_GROUP_ID' : 5, '$EGID' : 5, '$)' : 5, '$PROGRAM_NAME' : 5, '$0' : 5, '$SUBSCRIPT_SEPARATOR' : 5, '$SUBSEP' : 5, '$;' : 5, '$REAL_USER_ID' : 5, '$UID' : 5, '$<' : 5, '$EFFECTIVE_USER_ID' : 5, '$EUID' : 5, '$>' : 5, '$a' : 5, '$b' : 5, '$COMPILING' : 5, '$^C' : 5, '$DEBUGGING' : 5, '$^D' : 5, '${^ENCODING}' : 5, '$ENV' : 5, '%ENV' : 5, '$SYSTEM_FD_MAX' : 5, '$^F' : 5, '@F' : 5, '${^GLOBAL_PHASE}' : 5, '$^H' : 5, '%^H' : 5, '@INC' : 5, '%INC' : 5, '$INPLACE_EDIT' : 5, '$^I' : 5, '$^M' : 5, '$OSNAME' : 5, '$^O' : 5, '${^OPEN}' : 5, '$PERLDB' : 5, '$^P' : 5, '$SIG' : 5, '%SIG' : 5, '$BASETIME' : 5, '$^T' : 5, '${^TAINT}' : 5, '${^UNICODE}' : 5, '${^UTF8CACHE}' : 5, '${^UTF8LOCALE}' : 5, '$PERL_VERSION' : 5, '$^V' : 5, '${^WIN32_SLOPPY_STAT}' : 5, '$EXECUTABLE_NAME' : 5, '$^X' : 5, '$1' : 5, // - regexp $1, $2... '$MATCH' : 5, '$&' : 5, '${^MATCH}' : 5, '$PREMATCH' : 5, '$`' : 5, '${^PREMATCH}' : 5, '$POSTMATCH' : 5, "$'" : 5, '${^POSTMATCH}' : 5, '$LAST_PAREN_MATCH' : 5, '$+' : 5, '$LAST_SUBMATCH_RESULT' : 5, '$^N' : 5, '@LAST_MATCH_END' : 5, '@+' : 5, '%LAST_PAREN_MATCH' : 5, '%+' : 5, '@LAST_MATCH_START' : 5, '@-' : 5, '%LAST_MATCH_START' : 5, '%-' : 5, '$LAST_REGEXP_CODE_RESULT' : 5, '$^R' : 5, '${^RE_DEBUG_FLAGS}' : 5, '${^RE_TRIE_MAXBUF}' : 5, '$ARGV' : 5, '@ARGV' : 5, 'ARGV' : 5, 'ARGVOUT' : 5, '$OUTPUT_FIELD_SEPARATOR' : 5, '$OFS' : 5, '$,' : 5, '$INPUT_LINE_NUMBER' : 5, '$NR' : 5, '$.' : 5, '$INPUT_RECORD_SEPARATOR' : 5, '$RS' : 5, '$/' : 5, '$OUTPUT_RECORD_SEPARATOR' : 5, '$ORS' : 5, '$\\' : 5, '$OUTPUT_AUTOFLUSH' : 5, '$|' : 5, '$ACCUMULATOR' : 5, '$^A' : 5, '$FORMAT_FORMFEED' : 5, '$^L' : 5, '$FORMAT_PAGE_NUMBER' : 5, '$%' : 5, '$FORMAT_LINES_LEFT' : 5, '$-' : 5, '$FORMAT_LINE_BREAK_CHARACTERS' : 5, '$:' : 5, '$FORMAT_LINES_PER_PAGE' : 5, '$=' : 5, '$FORMAT_TOP_NAME' : 5, '$^' : 5, '$FORMAT_NAME' : 5, '$~' : 5, '${^CHILD_ERROR_NATIVE}' : 5, '$EXTENDED_OS_ERROR' : 5, '$^E' : 5, '$EXCEPTIONS_BEING_CAUGHT' : 5, '$^S' : 5, '$WARNING' : 5, '$^W' : 5, '${^WARNING_BITS}' : 5, '$OS_ERROR' : 5, '$ERRNO' : 5, '$!' : 5, '%OS_ERROR' : 5, '%ERRNO' : 5, '%!' : 5, '$CHILD_ERROR' : 5, '$?' : 5, '$EVAL_ERROR' : 5, '$@' : 5, '$OFMT' : 5, '$#' : 5, '$*' : 5, '$ARRAY_BASE' : 5, '$[' : 5, '$OLD_PERL_VERSION' : 5, '$]' : 5, // PERL blocks 'if' :[1,1], elsif :[1,1], 'else' :[1,1], 'while' :[1,1], unless :[1,1], 'for' :[1,1], foreach :[1,1], // PERL functions 'abs' :1, // - absolute value function accept :1, // - accept an incoming socket connect alarm :1, // - schedule a SIGALRM 'atan2' :1, // - arctangent of Y/X in the range -PI to PI bind :1, // - binds an address to a socket binmode :1, // - prepare binary files for I/O bless :1, // - create an object bootstrap :1, // 'break' :1, // - break out of a "given" block caller :1, // - get context of the current subroutine call chdir :1, // - change your current working directory chmod :1, // - changes the permissions on a list of files chomp :1, // - remove a trailing record separator from a string chop :1, // - remove the last character from a string chown :1, // - change the owership on a list of files chr :1, // - get character this number represents chroot :1, // - make directory new root for path lookups close :1, // - close file (or pipe or socket) handle closedir :1, // - close directory handle connect :1, // - connect to a remote socket 'continue' :[1,1], // - optional trailing block in a while or foreach 'cos' :1, // - cosine function crypt :1, // - one-way passwd-style encryption dbmclose :1, // - breaks binding on a tied dbm file dbmopen :1, // - create binding on a tied dbm file 'default' :1, // defined :1, // - test whether a value, variable, or function is defined 'delete' :1, // - deletes a value from a hash die :1, // - raise an exception or bail out 'do' :1, // - turn a BLOCK into a TERM dump :1, // - create an immediate core dump each :1, // - retrieve the next key/value pair from a hash endgrent :1, // - be done using group file endhostent :1, // - be done using hosts file endnetent :1, // - be done using networks file endprotoent :1, // - be done using protocols file endpwent :1, // - be done using passwd file endservent :1, // - be done using services file eof :1, // - test a filehandle for its end 'eval' :1, // - catch exceptions or compile and run code 'exec' :1, // - abandon this program to run another exists :1, // - test whether a hash key is present exit :1, // - terminate this program 'exp' :1, // - raise I to a power fcntl :1, // - file control system call fileno :1, // - return file descriptor from filehandle flock :1, // - lock an entire file with an advisory lock fork :1, // - create a new process just like this one format :1, // - declare a picture format with use by the write() function formline :1, // - internal function used for formats getc :1, // - get the next character from the filehandle getgrent :1, // - get next group record getgrgid :1, // - get group record given group user ID getgrnam :1, // - get group record given group name gethostbyaddr :1, // - get host record given its address gethostbyname :1, // - get host record given name gethostent :1, // - get next hosts record getlogin :1, // - return who logged in at this tty getnetbyaddr :1, // - get network record given its address getnetbyname :1, // - get networks record given name getnetent :1, // - get next networks record getpeername :1, // - find the other end of a socket connection getpgrp :1, // - get process group getppid :1, // - get parent process ID getpriority :1, // - get current nice value getprotobyname :1, // - get protocol record given name getprotobynumber :1, // - get protocol record numeric protocol getprotoent :1, // - get next protocols record getpwent :1, // - get next passwd record getpwnam :1, // - get passwd record given user login name getpwuid :1, // - get passwd record given user ID getservbyname :1, // - get services record given its name getservbyport :1, // - get services record given numeric port getservent :1, // - get next services record getsockname :1, // - retrieve the sockaddr for a given socket getsockopt :1, // - get socket options on a given socket given :1, // glob :1, // - expand filenames using wildcards gmtime :1, // - convert UNIX time into record or string using Greenwich time 'goto' :1, // - create spaghetti code grep :1, // - locate elements in a list test true against a given criterion hex :1, // - convert a string to a hexadecimal number 'import' :1, // - patch a module's namespace into your own index :1, // - find a substring within a string 'int' :1, // - get the integer portion of a number ioctl :1, // - system-dependent device control system call 'join' :1, // - join a list into a string using a separator keys :1, // - retrieve list of indices from a hash kill :1, // - send a signal to a process or process group last :1, // - exit a block prematurely lc :1, // - return lower-case version of a string lcfirst :1, // - return a string with just the next letter in lower case length :1, // - return the number of bytes in a string 'link' :1, // - create a hard link in the filesytem listen :1, // - register your socket as a server local : 2, // - create a temporary value for a global variable (dynamic scoping) localtime :1, // - convert UNIX time into record or string using local time lock :1, // - get a thread lock on a variable, subroutine, or method 'log' :1, // - retrieve the natural logarithm for a number lstat :1, // - stat a symbolic link m :null, // - match a string with a regular expression pattern map :1, // - apply a change to a list to get back a new list with the changes mkdir :1, // - create a directory msgctl :1, // - SysV IPC message control operations msgget :1, // - get SysV IPC message queue msgrcv :1, // - receive a SysV IPC message from a message queue msgsnd :1, // - send a SysV IPC message to a message queue my : 2, // - declare and assign a local variable (lexical scoping) 'new' :1, // next :1, // - iterate a block prematurely no :1, // - unimport some module symbols or semantics at compile time oct :1, // - convert a string to an octal number open :1, // - open a file, pipe, or descriptor opendir :1, // - open a directory ord :1, // - find a character's numeric representation our : 2, // - declare and assign a package variable (lexical scoping) pack :1, // - convert a list into a binary representation 'package' :1, // - declare a separate global namespace pipe :1, // - open a pair of connected filehandles pop :1, // - remove the last element from an array and return it pos :1, // - find or set the offset for the last/next m//g search print :1, // - output a list to a filehandle printf :1, // - output a formatted list to a filehandle prototype :1, // - get the prototype (if any) of a subroutine push :1, // - append one or more elements to an array q :null, // - singly quote a string qq :null, // - doubly quote a string qr :null, // - Compile pattern quotemeta :null, // - quote regular expression magic characters qw :null, // - quote a list of words qx :null, // - backquote quote a string rand :1, // - retrieve the next pseudorandom number read :1, // - fixed-length buffered input from a filehandle readdir :1, // - get a directory from a directory handle readline :1, // - fetch a record from a file readlink :1, // - determine where a symbolic link is pointing readpipe :1, // - execute a system command and collect standard output recv :1, // - receive a message over a Socket redo :1, // - start this loop iteration over again ref :1, // - find out the type of thing being referenced rename :1, // - change a filename require :1, // - load in external functions from a library at runtime reset :1, // - clear all variables of a given name 'return' :1, // - get out of a function early reverse :1, // - flip a string or a list rewinddir :1, // - reset directory handle rindex :1, // - right-to-left substring search rmdir :1, // - remove a directory s :null, // - replace a pattern with a string say :1, // - print with newline scalar :1, // - force a scalar context seek :1, // - reposition file pointer for random-access I/O seekdir :1, // - reposition directory pointer select :1, // - reset default output or do I/O multiplexing semctl :1, // - SysV semaphore control operations semget :1, // - get set of SysV semaphores semop :1, // - SysV semaphore operations send :1, // - send a message over a socket setgrent :1, // - prepare group file for use sethostent :1, // - prepare hosts file for use setnetent :1, // - prepare networks file for use setpgrp :1, // - set the process group of a process setpriority :1, // - set a process's nice value setprotoent :1, // - prepare protocols file for use setpwent :1, // - prepare passwd file for use setservent :1, // - prepare services file for use setsockopt :1, // - set some socket options shift :1, // - remove the first element of an array, and return it shmctl :1, // - SysV shared memory operations shmget :1, // - get SysV shared memory segment identifier shmread :1, // - read SysV shared memory shmwrite :1, // - write SysV shared memory shutdown :1, // - close down just half of a socket connection 'sin' :1, // - return the sine of a number sleep :1, // - block for some number of seconds socket :1, // - create a socket socketpair :1, // - create a pair of sockets 'sort' :1, // - sort a list of values splice :1, // - add or remove elements anywhere in an array 'split' :1, // - split up a string using a regexp delimiter sprintf :1, // - formatted print into a string 'sqrt' :1, // - square root function srand :1, // - seed the random number generator stat :1, // - get a file's status information state :1, // - declare and assign a state variable (persistent lexical scoping) study :1, // - optimize input data for repeated searches 'sub' :1, // - declare a subroutine, possibly anonymously 'substr' :1, // - get or alter a portion of a stirng symlink :1, // - create a symbolic link to a file syscall :1, // - execute an arbitrary system call sysopen :1, // - open a file, pipe, or descriptor sysread :1, // - fixed-length unbuffered input from a filehandle sysseek :1, // - position I/O pointer on handle used with sysread and syswrite system :1, // - run a separate program syswrite :1, // - fixed-length unbuffered output to a filehandle tell :1, // - get current seekpointer on a filehandle telldir :1, // - get current seekpointer on a directory handle tie :1, // - bind a variable to an object class tied :1, // - get a reference to the object underlying a tied variable time :1, // - return number of seconds since 1970 times :1, // - return elapsed time for self and child processes tr :null, // - transliterate a string truncate :1, // - shorten a file uc :1, // - return upper-case version of a string ucfirst :1, // - return a string with just the next letter in upper case umask :1, // - set file creation mode mask undef :1, // - remove a variable or function definition unlink :1, // - remove one link to a file unpack :1, // - convert binary structure into normal perl variables unshift :1, // - prepend more elements to the beginning of a list untie :1, // - break a tie binding to a variable use :1, // - load in a module at compile time utime :1, // - set a file's last access and modify times values :1, // - return a list of the values in a hash vec :1, // - test or set particular bits in a string wait :1, // - wait for any child process to die waitpid :1, // - wait for a particular child process to die wantarray :1, // - get void vs scalar vs list context of current subroutine call warn :1, // - print debugging info when :1, // write :1, // - print a picture record y :null}; // - transliterate a string var RXstyle="string-2"; var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) state.chain=null; // 12 3tail state.style=null; state.tail=null; state.tokenize=function(stream,state){ var e=false,c,i=0; while(c=stream.next()){ if(c===chain[i]&&!e){ if(chain[++i]!==undefined){ state.chain=chain[i]; state.style=style; state.tail=tail;} else if(tail) stream.eatWhile(tail); state.tokenize=tokenPerl; return style;} e=!e&&c=="\\";} return style;}; return state.tokenize(stream,state);} function tokenSOMETHING(stream,state,string){ state.tokenize=function(stream,state){ if(stream.string==string) state.tokenize=tokenPerl; stream.skipToEnd(); return "string";}; return state.tokenize(stream,state);} function tokenPerl(stream,state){ if(stream.eatSpace()) return null; if(state.chain) return tokenChain(stream,state,state.chain,state.style,state.tail); if(stream.match(/^\-?[\d\.]/,false)) if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) return 'number'; if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n stream.eatWhile(/\w/); return tokenSOMETHING(stream,state,stream.current().substr(2));} if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n return tokenSOMETHING(stream,state,'=cut');} var ch=stream.next(); if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n if(prefix(stream, 3)=="<<"+ch){ var p=stream.pos; stream.eatWhile(/\w/); var n=stream.current().substr(1); if(n&&stream.eat(ch)) return tokenSOMETHING(stream,state,n); stream.pos=p;} return tokenChain(stream,state,[ch],"string");} if(ch=="q"){ var c=look(stream, -2); if(!(c&&/\w/.test(c))){ c=look(stream, 0); if(c=="x"){ c=look(stream, 1); if(c=="("){ eatSuffix(stream, 2); return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} if(c=="["){ eatSuffix(stream, 2); return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} if(c=="{"){ eatSuffix(stream, 2); return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} if(c=="<"){ eatSuffix(stream, 2); return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} if(/[\^'"!~\/]/.test(c)){ eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} else if(c=="q"){ c=look(stream, 1); if(c=="("){ eatSuffix(stream, 2); return tokenChain(stream,state,[")"],"string");} if(c=="["){ eatSuffix(stream, 2); return tokenChain(stream,state,["]"],"string");} if(c=="{"){ eatSuffix(stream, 2); return tokenChain(stream,state,["}"],"string");} if(c=="<"){ eatSuffix(stream, 2); return tokenChain(stream,state,[">"],"string");} if(/[\^'"!~\/]/.test(c)){ eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],"string");}} else if(c=="w"){ c=look(stream, 1); if(c=="("){ eatSuffix(stream, 2); return tokenChain(stream,state,[")"],"bracket");} if(c=="["){ eatSuffix(stream, 2); return tokenChain(stream,state,["]"],"bracket");} if(c=="{"){ eatSuffix(stream, 2); return tokenChain(stream,state,["}"],"bracket");} if(c=="<"){ eatSuffix(stream, 2); return tokenChain(stream,state,[">"],"bracket");} if(/[\^'"!~\/]/.test(c)){ eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],"bracket");}} else if(c=="r"){ c=look(stream, 1); if(c=="("){ eatSuffix(stream, 2); return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} if(c=="["){ eatSuffix(stream, 2); return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} if(c=="{"){ eatSuffix(stream, 2); return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} if(c=="<"){ eatSuffix(stream, 2); return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} if(/[\^'"!~\/]/.test(c)){ eatSuffix(stream, 1); return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} else if(/[\^'"!~\/(\[{<]/.test(c)){ if(c=="("){ eatSuffix(stream, 1); return tokenChain(stream,state,[")"],"string");} if(c=="["){ eatSuffix(stream, 1); return tokenChain(stream,state,["]"],"string");} if(c=="{"){ eatSuffix(stream, 1); return tokenChain(stream,state,["}"],"string");} if(c=="<"){ eatSuffix(stream, 1); return tokenChain(stream,state,[">"],"string");} if(/[\^'"!~\/]/.test(c)){ return tokenChain(stream,state,[stream.eat(c)],"string");}}}} if(ch=="m"){ var c=look(stream, -2); if(!(c&&/\w/.test(c))){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ if(/[\^'"!~\/]/.test(c)){ return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} if(c=="("){ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} if(c=="["){ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} if(c=="{"){ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} if(c=="<"){ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} if(ch=="s"){ var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ if(c=="[") return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); if(c=="{") return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); if(c=="<") return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); if(c=="(") return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} if(ch=="y"){ var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ if(c=="[") return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); if(c=="{") return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); if(c=="<") return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); if(c=="(") return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} if(ch=="t"){ var c=/[\/>\]})\w]/.test(look(stream, -2)); if(!c){ c=stream.eat("r");if(c){ c=stream.eat(/[(\[{<\^'"!~\/]/); if(c){ if(c=="[") return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); if(c=="{") return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); if(c=="<") return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); if(c=="(") return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} if(ch=="`"){ return tokenChain(stream,state,[ch],"variable-2");} if(ch=="/"){ if(!/~\s*$/.test(prefix(stream))) return "operator"; else return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} if(ch=="$"){ var p=stream.pos; if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) return "variable-2"; else stream.pos=p;} if(/[$@%]/.test(ch)){ var p=stream.pos; if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ var c=stream.current(); if(PERL[c]) return "variable-2";} stream.pos=p;} if(/[$@%&]/.test(ch)){ if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ var c=stream.current(); if(PERL[c]) return "variable-2"; else return "variable";}} if(ch=="#"){ if(look(stream, -2)!="$"){ stream.skipToEnd(); return "comment";}} if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ var p=stream.pos; stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); if(PERL[stream.current()]) return "operator"; else stream.pos=p;} if(ch=="_"){ if(stream.pos==1){ if(suffix(stream, 6)=="_END__"){ return tokenChain(stream,state,['\0'],"comment");} else if(suffix(stream, 7)=="_DATA__"){ return tokenChain(stream,state,['\0'],"variable-2");} else if(suffix(stream, 7)=="_C__"){ return tokenChain(stream,state,['\0'],"string");}}} if(/\w/.test(ch)){ var p=stream.pos; if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) return "string"; else stream.pos=p;} if(/[A-Z]/.test(ch)){ var l=look(stream, -2); var p=stream.pos; stream.eatWhile(/[A-Z_]/); if(/[\da-z]/.test(look(stream, 0))){ stream.pos=p;} else{ var c=PERL[stream.current()]; if(!c) return "meta"; if(c[1]) c=c[0]; if(l!=":"){ if(c==1) return "keyword"; else if(c==2) return "def"; else if(c==3) return "atom"; else if(c==4) return "operator"; else if(c==5) return "variable-2"; else return "meta";} else return "meta";}} if(/[a-zA-Z_]/.test(ch)){ var l=look(stream, -2); stream.eatWhile(/\w/); var c=PERL[stream.current()]; if(!c) return "meta"; if(c[1]) c=c[0]; if(l!=":"){ if(c==1) return "keyword"; else if(c==2) return "def"; else if(c==3) return "atom"; else if(c==4) return "operator"; else if(c==5) return "variable-2"; else return "meta";} else return "meta";} return null;} return { startState: function() { return { tokenize: tokenPerl, chain: null, style: null, tail: null }; }, token: function(stream, state) { return (state.tokenize || tokenPerl)(stream, state); }, lineComment: '#' }; }); CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); CodeMirror.defineMIME("text/x-perl", "perl"); // it's like "peek", but need for look-ahead or look-behind if index < 0 function look(stream, c){ return stream.string.charAt(stream.pos+(c||0)); } // return a part of prefix of current stream from current position function prefix(stream, c){ if(c){ var x=stream.pos-c; return stream.string.substr((x>=0?x:0),c);} else{ return stream.string.substr(0,stream.pos-1); } } // return a part of suffix of current stream from current position function suffix(stream, c){ var y=stream.string.length; var x=y-stream.pos+1; return stream.string.substr(stream.pos,(c&&c<y?c:x)); } // eating and vomiting a part of stream from current position function eatSuffix(stream, c){ var x=stream.pos+c; var y; if(x<=0) stream.pos=0; else if(x>=(y=stream.string.length-1)) stream.pos=y; else stream.pos=x; } });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/perl/perl.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/perl/perl.js", "repo_id": "Humsen", "token_count": 39971 }
42
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode('shell', function() { var words = {}; function define(style, string) { var split = string.split(' '); for(var i = 0; i < split.length; i++) { words[split[i]] = style; } }; // Atoms define('atom', 'true false'); // Keywords define('keyword', 'if then do else elif while until for in esac fi fin ' + 'fil done exit set unset export function'); // Commands define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + 'touch vi vim wall wc wget who write yes zsh'); function tokenBase(stream, state) { if (stream.eatSpace()) return null; var sol = stream.sol(); var ch = stream.next(); if (ch === '\\') { stream.next(); return null; } if (ch === '\'' || ch === '"' || ch === '`') { state.tokens.unshift(tokenString(ch)); return tokenize(stream, state); } if (ch === '#') { if (sol && stream.eat('!')) { stream.skipToEnd(); return 'meta'; // 'comment'? } stream.skipToEnd(); return 'comment'; } if (ch === '$') { state.tokens.unshift(tokenDollar); return tokenize(stream, state); } if (ch === '+' || ch === '=') { return 'operator'; } if (ch === '-') { stream.eat('-'); stream.eatWhile(/\w/); return 'attribute'; } if (/\d/.test(ch)) { stream.eatWhile(/\d/); if(stream.eol() || !/\w/.test(stream.peek())) { return 'number'; } } stream.eatWhile(/[\w-]/); var cur = stream.current(); if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; return words.hasOwnProperty(cur) ? words[cur] : null; } function tokenString(quote) { return function(stream, state) { var next, end = false, escaped = false; while ((next = stream.next()) != null) { if (next === quote && !escaped) { end = true; break; } if (next === '$' && !escaped && quote !== '\'') { escaped = true; stream.backUp(1); state.tokens.unshift(tokenDollar); break; } escaped = !escaped && next === '\\'; } if (end || !escaped) { state.tokens.shift(); } return (quote === '`' || quote === ')' ? 'quote' : 'string'); }; }; var tokenDollar = function(stream, state) { if (state.tokens.length > 1) stream.eat('$'); var ch = stream.next(), hungry = /\w/; if (ch === '{') hungry = /[^}]/; if (ch === '(') { state.tokens[0] = tokenString(')'); return tokenize(stream, state); } if (!/\d/.test(ch)) { stream.eatWhile(hungry); stream.eat('}'); } state.tokens.shift(); return 'def'; }; function tokenize(stream, state) { return (state.tokens[0] || tokenBase) (stream, state); }; return { startState: function() {return {tokens:[]};}, token: function(stream, state) { return tokenize(stream, state); }, lineComment: '#', fold: "brace" }; }); CodeMirror.defineMIME('text/x-sh', 'shell'); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/shell/shell.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/shell/shell.js", "repo_id": "Humsen", "token_count": 1608 }
43
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE //tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("tcl", function() { function parseWords(str) { var obj = {}, words = str.split(" "); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " + "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + "binary break catch cd close concat continue dde eof encoding error " + "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + "filename flush for foreach format gets glob global history http if " + "incr info interp join lappend lindex linsert list llength load lrange " + "lreplace lsearch lset lsort memory msgcat namespace open package parray " + "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + "registry regsub rename resource return scan seek set socket source split " + "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + "tclvars tell time trace unknown unset update uplevel upvar variable " + "vwait"); var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; function chain(stream, state, f) { state.tokenize = f; return f(stream, state); } function tokenBase(stream, state) { var beforeParams = state.beforeParams; state.beforeParams = false; var ch = stream.next(); if ((ch == '"' || ch == "'") && state.inParams) return chain(stream, state, tokenString(ch)); else if (/[\[\]{}\(\),;\.]/.test(ch)) { if (ch == "(" && beforeParams) state.inParams = true; else if (ch == ")") state.inParams = false; return null; } else if (/\d/.test(ch)) { stream.eatWhile(/[\w\.]/); return "number"; } else if (ch == "#" && stream.eat("*")) { return chain(stream, state, tokenComment); } else if (ch == "#" && stream.match(/ *\[ *\[/)) { return chain(stream, state, tokenUnparsed); } else if (ch == "#" && stream.eat("#")) { stream.skipToEnd(); return "comment"; } else if (ch == '"') { stream.skipTo(/"/); return "comment"; } else if (ch == "$") { stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); stream.eatWhile(/}/); state.beforeParams = true; return "builtin"; } else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); return "comment"; } else { stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); var word = stream.current().toLowerCase(); if (keywords && keywords.propertyIsEnumerable(word)) return "keyword"; if (functions && functions.propertyIsEnumerable(word)) { state.beforeParams = true; return "keyword"; } return null; } } function tokenString(quote) { return function(stream, state) { var escaped = false, next, end = false; while ((next = stream.next()) != null) { if (next == quote && !escaped) { end = true; break; } escaped = !escaped && next == "\\"; } if (end) state.tokenize = tokenBase; return "string"; }; } function tokenComment(stream, state) { var maybeEnd = false, ch; while (ch = stream.next()) { if (ch == "#" && maybeEnd) { state.tokenize = tokenBase; break; } maybeEnd = (ch == "*"); } return "comment"; } function tokenUnparsed(stream, state) { var maybeEnd = 0, ch; while (ch = stream.next()) { if (ch == "#" && maybeEnd == 2) { state.tokenize = tokenBase; break; } if (ch == "]") maybeEnd++; else if (ch != " ") maybeEnd = 0; } return "meta"; } return { startState: function() { return { tokenize: tokenBase, beforeParams: false, inParams: false }; }, token: function(stream, state) { if (stream.eatSpace()) return null; return state.tokenize(stream, state); } }; }); CodeMirror.defineMIME("text/x-tcl", "tcl"); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/tcl/tcl.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/tcl/tcl.js", "repo_id": "Humsen", "token_count": 2189 }
44
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("xml", function(config, parserConfig) { var indentUnit = config.indentUnit; var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; var Kludges = parserConfig.htmlMode ? { autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, 'track': true, 'wbr': true, 'menuitem': true}, implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, 'th': true, 'tr': true}, contextGrabbers: { 'dd': {'dd': true, 'dt': true}, 'dt': {'dd': true, 'dt': true}, 'li': {'li': true}, 'option': {'option': true, 'optgroup': true}, 'optgroup': {'optgroup': true}, 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, 'rp': {'rp': true, 'rt': true}, 'rt': {'rp': true, 'rt': true}, 'tbody': {'tbody': true, 'tfoot': true}, 'td': {'td': true, 'th': true}, 'tfoot': {'tbody': true}, 'th': {'td': true, 'th': true}, 'thead': {'tbody': true, 'tfoot': true}, 'tr': {'tr': true} }, doNotIndent: {"pre": true}, allowUnquoted: true, allowMissing: true, caseFold: true } : { autoSelfClosers: {}, implicitlyClosed: {}, contextGrabbers: {}, doNotIndent: {}, allowUnquoted: false, allowMissing: false, caseFold: false }; var alignCDATA = parserConfig.alignCDATA; // Return variables for tokenizers var type, setStyle; function inText(stream, state) { function chain(parser) { state.tokenize = parser; return parser(stream, state); } var ch = stream.next(); if (ch == "<") { if (stream.eat("!")) { if (stream.eat("[")) { if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); else return null; } else if (stream.match("--")) { return chain(inBlock("comment", "-->")); } else if (stream.match("DOCTYPE", true, true)) { stream.eatWhile(/[\w\._\-]/); return chain(doctype(1)); } else { return null; } } else if (stream.eat("?")) { stream.eatWhile(/[\w\._\-]/); state.tokenize = inBlock("meta", "?>"); return "meta"; } else { type = stream.eat("/") ? "closeTag" : "openTag"; state.tokenize = inTag; return "tag bracket"; } } else if (ch == "&") { var ok; if (stream.eat("#")) { if (stream.eat("x")) { ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); } else { ok = stream.eatWhile(/[\d]/) && stream.eat(";"); } } else { ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); } return ok ? "atom" : "error"; } else { stream.eatWhile(/[^&<]/); return null; } } function inTag(stream, state) { var ch = stream.next(); if (ch == ">" || (ch == "/" && stream.eat(">"))) { state.tokenize = inText; type = ch == ">" ? "endTag" : "selfcloseTag"; return "tag bracket"; } else if (ch == "=") { type = "equals"; return null; } else if (ch == "<") { state.tokenize = inText; state.state = baseState; state.tagName = state.tagStart = null; var next = state.tokenize(stream, state); return next ? next + " tag error" : "tag error"; } else if (/[\'\"]/.test(ch)) { state.tokenize = inAttribute(ch); state.stringStartCol = stream.column(); return state.tokenize(stream, state); } else { stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); return "word"; } } function inAttribute(quote) { var closure = function(stream, state) { while (!stream.eol()) { if (stream.next() == quote) { state.tokenize = inTag; break; } } return "string"; }; closure.isInAttribute = true; return closure; } function inBlock(style, terminator) { return function(stream, state) { while (!stream.eol()) { if (stream.match(terminator)) { state.tokenize = inText; break; } stream.next(); } return style; }; } function doctype(depth) { return function(stream, state) { var ch; while ((ch = stream.next()) != null) { if (ch == "<") { state.tokenize = doctype(depth + 1); return state.tokenize(stream, state); } else if (ch == ">") { if (depth == 1) { state.tokenize = inText; break; } else { state.tokenize = doctype(depth - 1); return state.tokenize(stream, state); } } } return "meta"; }; } function Context(state, tagName, startOfLine) { this.prev = state.context; this.tagName = tagName; this.indent = state.indented; this.startOfLine = startOfLine; if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) this.noIndent = true; } function popContext(state) { if (state.context) state.context = state.context.prev; } function maybePopContext(state, nextTagName) { var parentTagName; while (true) { if (!state.context) { return; } parentTagName = state.context.tagName; if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { return; } popContext(state); } } function baseState(type, stream, state) { if (type == "openTag") { state.tagStart = stream.column(); return tagNameState; } else if (type == "closeTag") { return closeTagNameState; } else { return baseState; } } function tagNameState(type, stream, state) { if (type == "word") { state.tagName = stream.current(); setStyle = "tag"; return attrState; } else { setStyle = "error"; return tagNameState; } } function closeTagNameState(type, stream, state) { if (type == "word") { var tagName = stream.current(); if (state.context && state.context.tagName != tagName && Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) popContext(state); if (state.context && state.context.tagName == tagName) { setStyle = "tag"; return closeState; } else { setStyle = "tag error"; return closeStateErr; } } else { setStyle = "error"; return closeStateErr; } } function closeState(type, _stream, state) { if (type != "endTag") { setStyle = "error"; return closeState; } popContext(state); return baseState; } function closeStateErr(type, stream, state) { setStyle = "error"; return closeState(type, stream, state); } function attrState(type, _stream, state) { if (type == "word") { setStyle = "attribute"; return attrEqState; } else if (type == "endTag" || type == "selfcloseTag") { var tagName = state.tagName, tagStart = state.tagStart; state.tagName = state.tagStart = null; if (type == "selfcloseTag" || Kludges.autoSelfClosers.hasOwnProperty(tagName)) { maybePopContext(state, tagName); } else { maybePopContext(state, tagName); state.context = new Context(state, tagName, tagStart == state.indented); } return baseState; } setStyle = "error"; return attrState; } function attrEqState(type, stream, state) { if (type == "equals") return attrValueState; if (!Kludges.allowMissing) setStyle = "error"; return attrState(type, stream, state); } function attrValueState(type, stream, state) { if (type == "string") return attrContinuedState; if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} setStyle = "error"; return attrState(type, stream, state); } function attrContinuedState(type, stream, state) { if (type == "string") return attrContinuedState; return attrState(type, stream, state); } return { startState: function() { return {tokenize: inText, state: baseState, indented: 0, tagName: null, tagStart: null, context: null}; }, token: function(stream, state) { if (!state.tagName && stream.sol()) state.indented = stream.indentation(); if (stream.eatSpace()) return null; type = null; var style = state.tokenize(stream, state); if ((style || type) && style != "comment") { setStyle = null; state.state = state.state(type || style, stream, state); if (setStyle) style = setStyle == "error" ? style + " error" : setStyle; } return style; }, indent: function(state, textAfter, fullLine) { var context = state.context; // Indent multi-line strings (e.g. css). if (state.tokenize.isInAttribute) { if (state.tagStart == state.indented) return state.stringStartCol + 1; else return state.indented + indentUnit; } if (context && context.noIndent) return CodeMirror.Pass; if (state.tokenize != inTag && state.tokenize != inText) return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; // Indent the starts of attribute names. if (state.tagName) { if (multilineTagIndentPastTag) return state.tagStart + state.tagName.length + 2; else return state.tagStart + indentUnit * multilineTagIndentFactor; } if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0; var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter); if (tagAfter && tagAfter[1]) { // Closing tag spotted while (context) { if (context.tagName == tagAfter[2]) { context = context.prev; break; } else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) { context = context.prev; } else { break; } } } else if (tagAfter) { // Opening tag spotted while (context) { var grabbers = Kludges.contextGrabbers[context.tagName]; if (grabbers && grabbers.hasOwnProperty(tagAfter[2])) context = context.prev; else break; } } while (context && !context.startOfLine) context = context.prev; if (context) return context.indent + indentUnit; else return 0; }, electricInput: /<\/[\s\w:]+>$/, blockCommentStart: "<!--", blockCommentEnd: "-->", configuration: parserConfig.htmlMode ? "html" : "xml", helperType: parserConfig.htmlMode ? "html" : "xml" }; }); CodeMirror.defineMIME("text/xml", "xml"); CodeMirror.defineMIME("application/xml", "xml"); if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); });
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/xml/xml.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/mode/xml/xml.js", "repo_id": "Humsen", "token_count": 5460 }
45
.cm-s-eclipse span.cm-meta {color: #FF1717;} .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } .cm-s-eclipse span.cm-atom {color: #219;} .cm-s-eclipse span.cm-number {color: #164;} .cm-s-eclipse span.cm-def {color: #00f;} .cm-s-eclipse span.cm-variable {color: black;} .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} .cm-s-eclipse span.cm-property {color: black;} .cm-s-eclipse span.cm-operator {color: black;} .cm-s-eclipse span.cm-comment {color: #3F7F5F;} .cm-s-eclipse span.cm-string {color: #2A00FF;} .cm-s-eclipse span.cm-string-2 {color: #f50;} .cm-s-eclipse span.cm-qualifier {color: #555;} .cm-s-eclipse span.cm-builtin {color: #30a;} .cm-s-eclipse span.cm-bracket {color: #cc7;} .cm-s-eclipse span.cm-tag {color: #170;} .cm-s-eclipse span.cm-attribute {color: #00c;} .cm-s-eclipse span.cm-link {color: #219;} .cm-s-eclipse span.cm-error {color: #f00;} .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/theme/eclipse.css/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/theme/eclipse.css", "repo_id": "Humsen", "token_count": 486 }
46
.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } .cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } .cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } .cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } .cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } .cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} .cm-s-the-matrix span.cm-atom {color: #3FF;} .cm-s-the-matrix span.cm-number {color: #FFB94F;} .cm-s-the-matrix span.cm-def {color: #99C;} .cm-s-the-matrix span.cm-variable {color: #F6C;} .cm-s-the-matrix span.cm-variable-2 {color: #C6F;} .cm-s-the-matrix span.cm-variable-3 {color: #96F;} .cm-s-the-matrix span.cm-property {color: #62FFA0;} .cm-s-the-matrix span.cm-operator {color: #999} .cm-s-the-matrix span.cm-comment {color: #CCCCCC;} .cm-s-the-matrix span.cm-string {color: #39C;} .cm-s-the-matrix span.cm-meta {color: #C9F;} .cm-s-the-matrix span.cm-qualifier {color: #FFF700;} .cm-s-the-matrix span.cm-builtin {color: #30a;} .cm-s-the-matrix span.cm-bracket {color: #cc7;} .cm-s-the-matrix span.cm-tag {color: #FFBD40;} .cm-s-the-matrix span.cm-attribute {color: #FFF700;} .cm-s-the-matrix span.cm-error {color: #FF0000;} .cm-s-the-matrix .CodeMirror-activeline-background {background: #040;}
Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/theme/the-matrix.css/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/lib/codemirror/theme/the-matrix.css", "repo_id": "Humsen", "token_count": 727 }
47
/*! * Emoji dialog plugin for Editor.md * * @file emoji-dialog.js * @author pandao * @version 1.2.0 * @updateTime 2015-03-08 * {@link https://github.com/pandao/editor.md} * @license MIT */ (function() { var factory = function (exports) { var $ = jQuery; var pluginName = "emoji-dialog"; var emojiTabIndex = 0; var emojiData = []; var selecteds = []; var logoPrefix = "editormd-logo"; var logos = [ logoPrefix, logoPrefix + "-1x", logoPrefix + "-2x", logoPrefix + "-3x", logoPrefix + "-4x", logoPrefix + "-5x", logoPrefix + "-6x", logoPrefix + "-7x", logoPrefix + "-8x" ]; var langs = { "zh-cn" : { toolbar : { emoji : "Emoji 表情" }, dialog : { emoji : { title : "Emoji 表情" } } }, "zh-tw" : { toolbar : { emoji : "Emoji 表情" }, dialog : { emoji : { title : "Emoji 表情" } } }, "en" : { toolbar : { emoji : "Emoji" }, dialog : { emoji : { title : "Emoji" } } } }; exports.fn.emojiDialog = function() { var _this = this; var cm = this.cm; var settings = _this.settings; if (!settings.emoji) { alert("settings.emoji == false"); return ; } var path = settings.pluginPath + pluginName + "/"; var editor = this.editor; var cursor = cm.getCursor(); var selection = cm.getSelection(); var classPrefix = this.classPrefix; $.extend(true, this.lang, langs[this.lang.name]); this.setToolbar(); var lang = this.lang; var dialogName = classPrefix + pluginName, dialog; var dialogLang = lang.dialog.emoji; var dialogContent = [ "<div class=\"" + classPrefix + "emoji-dialog-box\" style=\"width: 760px;height: 334px;margin-bottom: 8px;overflow: hidden;\">", "<div class=\"" + classPrefix + "tab\"></div>", "</div>", ].join("\n"); cm.focus(); if (editor.find("." + dialogName).length > 0) { dialog = editor.find("." + dialogName); selecteds = []; dialog.find("a").removeClass("selected"); this.dialogShowMask(dialog); this.dialogLockScreen(); dialog.show(); } else { dialog = this.createDialog({ name : dialogName, title : dialogLang.title, width : 800, height : 475, mask : settings.dialogShowMask, drag : settings.dialogDraggable, content : dialogContent, lockScreen : settings.dialogLockScreen, maskStyle : { opacity : settings.dialogMaskOpacity, backgroundColor : settings.dialogMaskBgColor }, buttons : { enter : [lang.buttons.enter, function() { cm.replaceSelection(selecteds.join(" ")); this.hide().lockScreen(false).hideMask(); return false; }], cancel : [lang.buttons.cancel, function() { this.hide().lockScreen(false).hideMask(); return false; }] } }); } var category = ["Github emoji", "Twemoji", "Font awesome", "Editor.md logo"]; var tab = dialog.find("." + classPrefix + "tab"); if (tab.html() === "") { var head = "<ul class=\"" + classPrefix + "tab-head\">"; for (var i = 0; i<4; i++) { var active = (i === 0) ? " class=\"active\"" : ""; head += "<li" + active + "><a href=\"javascript:;\">" + category[i] + "</a></li>"; } head += "</ul>"; tab.append(head); var container = "<div class=\"" + classPrefix + "tab-container\">"; for (var x = 0; x < 4; x++) { var display = (x === 0) ? "" : "display:none;"; container += "<div class=\"" + classPrefix + "tab-box\" style=\"height: 260px;overflow: hidden;overflow-y: auto;" + display + "\"></div>"; } container += "</div>"; tab.append(container); } var tabBoxs = tab.find("." + classPrefix + "tab-box"); var emojiCategories = ["github-emoji", "twemoji", "font-awesome", logoPrefix]; var drawTable = function() { var cname = emojiCategories[emojiTabIndex]; var $data = emojiData[cname]; var $tab = tabBoxs.eq(emojiTabIndex); if ($tab.html() !== "") { //console.log("break =>", cname); return ; } var pagination = function(data, type) { var rowNumber = (type === "editormd-logo") ? "5" : 20; var pageTotal = Math.ceil(data.length / rowNumber); var table = "<div class=\"" + classPrefix + "grid-table\">"; for (var i = 0; i < pageTotal; i++) { var row = "<div class=\"" + classPrefix + "grid-table-row\">"; for (var x = 0; x < rowNumber; x++) { var emoji = $.trim(data[(i * rowNumber) + x]); if (typeof emoji !== "undefined" && emoji !== "") { var img = "", icon = ""; if (type === "github-emoji") { var src = (emoji === "+1") ? "plus1" : emoji; src = (src === "black_large_square") ? "black_square" : src; src = (src === "moon") ? "waxing_gibbous_moon" : src; src = exports.emoji.path + src + exports.emoji.ext; img = "<img src=\"" + src + "\" width=\"24\" class=\"emoji\" title=\"&#58;" + emoji + "&#58;\" alt=\"&#58;" + emoji + "&#58;\" />"; row += "<a href=\"javascript:;\" value=\":" + emoji + ":\" title=\":" + emoji + ":\" class=\"" + classPrefix + "emoji-btn\">" + img + "</a>"; } else if (type === "twemoji") { var twemojiSrc = exports.twemoji.path + emoji + exports.twemoji.ext; img = "<img src=\"" + twemojiSrc + "\" width=\"24\" title=\"twemoji-" + emoji + "\" alt=\"twemoji-" + emoji + "\" class=\"emoji twemoji\" />"; row += "<a href=\"javascript:;\" value=\":tw-" + emoji + ":\" title=\":tw-" + emoji + ":\" class=\"" + classPrefix + "emoji-btn\">" + img + "</a>"; } else if (type === "font-awesome") { icon = "<i class=\"fa fa-" + emoji + " fa-emoji\" title=\"" + emoji + "\"></i>"; row += "<a href=\"javascript:;\" value=\":fa-" + emoji + ":\" title=\":fa-" + emoji + ":\" class=\"" + classPrefix + "emoji-btn\">" + icon + "</a>"; } else if (type === "editormd-logo") { icon = "<i class=\"" + emoji + "\" title=\"Editor.md logo (" + emoji + ")\"></i>"; row += "<a href=\"javascript:;\" value=\":" + emoji + ":\" title=\":" + emoji + ":\" style=\"width:20%;\" class=\"" + classPrefix + "emoji-btn\">" + icon + "</a>"; } } else { row += "<a href=\"javascript:;\" value=\"\"></a>"; } } row += "</div>"; table += row; } table += "</div>"; return table; }; if (emojiTabIndex === 0) { for (var i = 0, len = $data.length; i < len; i++) { var h4Style = (i === 0) ? " style=\"margin: 0 0 10px;\"" : " style=\"margin: 10px 0;\""; $tab.append("<h4" + h4Style + ">" + $data[i].category + "</h4>"); $tab.append(pagination($data[i].list, cname)); } } else { $tab.append(pagination($data, cname)); } $tab.find("." + classPrefix + "emoji-btn").bind(exports.mouseOrTouch("click", "touchend"), function() { $(this).toggleClass("selected"); if ($(this).hasClass("selected")) { selecteds.push($(this).attr("value")); } }); }; if (emojiData.length < 1) { if (typeof dialog.loading === "function") { dialog.loading(true); } $.getJSON(path + "emoji.json?temp=" + Math.random(), function(json) { if (typeof dialog.loading === "function") { dialog.loading(false); } emojiData = json; emojiData[logoPrefix] = logos; drawTable(); }); } else { drawTable(); } tab.find("li").bind(exports.mouseOrTouch("click", "touchend"), function() { var $this = $(this); emojiTabIndex = $this.index(); $this.addClass("active").siblings().removeClass("active"); tabBoxs.eq(emojiTabIndex).show().siblings().hide(); drawTable(); }); }; }; // CommonJS/Node.js if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { module.exports = factory; } else if (typeof define === "function") // AMD/CMD/Sea.js { if (define.amd) { // for Require.js define(["editormd"], function(editormd) { factory(editormd); }); } else { // for Sea.js define(function(require) { var editormd = require("./../../editormd"); factory(editormd); }); } } else { factory(window.editormd); } })();
Humsen/web/web-mobile/WebContent/plugins/editormd/plugins/emoji-dialog/emoji-dialog.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/plugins/emoji-dialog/emoji-dialog.js", "repo_id": "Humsen", "token_count": 5912 }
48
/*! * Reference link dialog plugin for Editor.md * * @file reference-link-dialog.js * @author pandao * @version 1.2.1 * @updateTime 2015-06-09 * {@link https://github.com/pandao/editor.md} * @license MIT */ (function() { var factory = function (exports) { var pluginName = "reference-link-dialog"; var ReLinkId = 1; exports.fn.referenceLinkDialog = function() { var _this = this; var cm = this.cm; var lang = this.lang; var editor = this.editor; var settings = this.settings; var cursor = cm.getCursor(); var selection = cm.getSelection(); var dialogLang = lang.dialog.referenceLink; var classPrefix = this.classPrefix; var dialogName = classPrefix + pluginName, dialog; cm.focus(); if (editor.find("." + dialogName).length < 1) { var dialogHTML = "<div class=\"" + classPrefix + "form\">" + "<label>" + dialogLang.name + "</label>" + "<input type=\"text\" value=\"[" + ReLinkId + "]\" data-name />" + "<br/>" + "<label>" + dialogLang.urlId + "</label>" + "<input type=\"text\" data-url-id />" + "<br/>" + "<label>" + dialogLang.url + "</label>" + "<input type=\"text\" value=\"http://\" data-url />" + "<br/>" + "<label>" + dialogLang.urlTitle + "</label>" + "<input type=\"text\" value=\"" + selection + "\" data-title />" + "<br/>" + "</div>"; dialog = this.createDialog({ name : dialogName, title : dialogLang.title, width : 380, height : 296, content : dialogHTML, mask : settings.dialogShowMask, drag : settings.dialogDraggable, lockScreen : settings.dialogLockScreen, maskStyle : { opacity : settings.dialogMaskOpacity, backgroundColor : settings.dialogMaskBgColor }, buttons : { enter : [lang.buttons.enter, function() { var name = this.find("[data-name]").val(); var url = this.find("[data-url]").val(); var rid = this.find("[data-url-id]").val(); var title = this.find("[data-title]").val(); if (name === "") { alert(dialogLang.nameEmpty); return false; } if (rid === "") { alert(dialogLang.idEmpty); return false; } if (url === "http://" || url === "") { alert(dialogLang.urlEmpty); return false; } //cm.replaceSelection("[" + title + "][" + name + "]\n[" + name + "]: " + url + ""); cm.replaceSelection("[" + name + "][" + rid + "]"); if (selection === "") { cm.setCursor(cursor.line, cursor.ch + 1); } title = (title === "") ? "" : " \"" + title + "\""; cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + ""); this.hide().lockScreen(false).hideMask(); return false; }], cancel : [lang.buttons.cancel, function() { this.hide().lockScreen(false).hideMask(); return false; }] } }); } dialog = editor.find("." + dialogName); dialog.find("[data-name]").val("[" + ReLinkId + "]"); dialog.find("[data-url-id]").val(""); dialog.find("[data-url]").val("http://"); dialog.find("[data-title]").val(selection); this.dialogShowMask(dialog); this.dialogLockScreen(); dialog.show(); ReLinkId++; }; }; // CommonJS/Node.js if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { module.exports = factory; } else if (typeof define === "function") // AMD/CMD/Sea.js { if (define.amd) { // for Require.js define(["editormd"], function(editormd) { factory(editormd); }); } else { // for Sea.js define(function(require) { var editormd = require("./../../editormd"); factory(editormd); }); } } else { factory(window.editormd); } })();
Humsen/web/web-mobile/WebContent/plugins/editormd/plugins/reference-link-dialog/reference-link-dialog.js/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/editormd/plugins/reference-link-dialog/reference-link-dialog.js", "repo_id": "Humsen", "token_count": 3365 }
49
@font-face { font-family: 'icomoon'; src: url('fonts/icomoon.eot?6py85u'); src: url('fonts/icomoon.eot?6py85u#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?6py85u') format('truetype'), url('fonts/icomoon.woff?6py85u') format('woff'), url('fonts/icomoon.svg?6py85u#icomoon') format('svg'); font-weight: normal; font-style: normal; } [class^="icon-"], [class*=" icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'icomoon' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-times:before { content: "\e930"; } .icon-tick:before { content: "\e931"; } .icon-plus:before { content: "\e932"; } .icon-minus:before { content: "\e933"; } .icon-equals:before { content: "\e934"; } .icon-divide:before { content: "\e935"; } .icon-chevron-right:before { content: "\e936"; } .icon-chevron-left:before { content: "\e937"; } .icon-arrow-right-thick:before { content: "\e938"; } .icon-arrow-left-thick:before { content: "\e939"; } .icon-th-small:before { content: "\e93a"; } .icon-th-menu:before { content: "\e93b"; } .icon-th-list:before { content: "\e93c"; } .icon-th-large:before { content: "\e93d"; } .icon-home:before { content: "\e93e"; } .icon-arrow-forward:before { content: "\e93f"; } .icon-arrow-back:before { content: "\e940"; } .icon-rss:before { content: "\e941"; } .icon-location:before { content: "\e942"; } .icon-link:before { content: "\e943"; } .icon-image:before { content: "\e944"; } .icon-arrow-up-thick:before { content: "\e945"; } .icon-arrow-down-thick:before { content: "\e946"; } .icon-starburst:before { content: "\e947"; } .icon-starburst-outline:before { content: "\e948"; } .icon-star3:before { content: "\e949"; } .icon-flow-children:before { content: "\e94a"; } .icon-export:before { content: "\e94b"; } .icon-delete2:before { content: "\e94c"; } .icon-delete-outline:before { content: "\e94d"; } .icon-cloud-storage:before { content: "\e94e"; } .icon-wi-fi:before { content: "\e94f"; } .icon-heart:before { content: "\e950"; } .icon-flash:before { content: "\e951"; } .icon-cancel:before { content: "\e952"; } .icon-backspace:before { content: "\e953"; } .icon-attachment:before { content: "\e954"; } .icon-arrow-move:before { content: "\e955"; } .icon-warning:before { content: "\e956"; } .icon-user:before { content: "\e957"; } .icon-radar:before { content: "\e958"; } .icon-lock-open:before { content: "\e959"; } .icon-lock-closed:before { content: "\e95a"; } .icon-location-arrow:before { content: "\e95b"; } .icon-info:before { content: "\e95c"; } .icon-user-delete:before { content: "\e95d"; } .icon-user-add:before { content: "\e95e"; } .icon-media-pause:before { content: "\e95f"; } .icon-group:before { content: "\e960"; } .icon-chart-pie:before { content: "\e961"; } .icon-chart-line:before { content: "\e962"; } .icon-chart-bar:before { content: "\e963"; } .icon-chart-area:before { content: "\e964"; } .icon-video:before { content: "\e965"; } .icon-point-of-interest:before { content: "\e966"; } .icon-infinity:before { content: "\e967"; } .icon-globe:before { content: "\e968"; } .icon-eye:before { content: "\e969"; } .icon-cog:before { content: "\e96a"; } .icon-camera:before { content: "\e96b"; } .icon-upload:before { content: "\e96c"; } .icon-scissors:before { content: "\e96d"; } .icon-refresh:before { content: "\e96e"; } .icon-pin:before { content: "\e96f"; } .icon-key:before { content: "\e970"; } .icon-info-large:before { content: "\e971"; } .icon-eject:before { content: "\e972"; } .icon-download:before { content: "\e973"; } .icon-zoom:before { content: "\e974"; } .icon-zoom-out:before { content: "\e975"; } .icon-zoom-in:before { content: "\e976"; } .icon-sort-numerically:before { content: "\e977"; } .icon-sort-alphabetically:before { content: "\e978"; } .icon-input-checked:before { content: "\e979"; } .icon-calender:before { content: "\e97a"; } .icon-world2:before { content: "\e97b"; } .icon-notes:before { content: "\e97c"; } .icon-code:before { content: "\e97d"; } .icon-arrow-sync:before { content: "\e97e"; } .icon-arrow-shuffle:before { content: "\e97f"; } .icon-arrow-repeat:before { content: "\e980"; } .icon-arrow-minimise:before { content: "\e981"; } .icon-arrow-maximise:before { content: "\e982"; } .icon-arrow-loop:before { content: "\e983"; } .icon-anchor:before { content: "\e984"; } .icon-spanner:before { content: "\e985"; } .icon-puzzle:before { content: "\e986"; } .icon-power:before { content: "\e987"; } .icon-plane:before { content: "\e988"; } .icon-pi:before { content: "\e989"; } .icon-phone:before { content: "\e98a"; } .icon-microphone2:before { content: "\e98b"; } .icon-media-rewind:before { content: "\e98c"; } .icon-flag:before { content: "\e98d"; } .icon-adjust-brightness:before { content: "\e98e"; } .icon-waves:before { content: "\e98f"; } .icon-social-twitter:before { content: "\e990"; } .icon-social-facebook:before { content: "\e991"; } .icon-social-dribbble:before { content: "\e992"; } .icon-media-stop:before { content: "\e993"; } .icon-media-record:before { content: "\e994"; } .icon-media-play:before { content: "\e995"; } .icon-media-fast-forward:before { content: "\e996"; } .icon-media-eject:before { content: "\e997"; } .icon-social-vimeo:before { content: "\e998"; } .icon-social-tumbler:before { content: "\e999"; } .icon-social-skype:before { content: "\e99a"; } .icon-social-pinterest:before { content: "\e99b"; } .icon-social-linkedin:before { content: "\e99c"; } .icon-social-last-fm:before { content: "\e99d"; } .icon-social-github:before { content: "\e99e"; } .icon-social-flickr:before { content: "\e99f"; } .icon-at:before { content: "\e9a0"; } .icon-times-outline:before { content: "\e9a1"; } .icon-plus-outline:before { content: "\e9a2"; } .icon-minus-outline:before { content: "\e9a3"; } .icon-tick-outline:before { content: "\e9a4"; } .icon-th-large-outline:before { content: "\e9a5"; } .icon-equals-outline:before { content: "\e9a6"; } .icon-divide-outline:before { content: "\e9a7"; } .icon-chevron-right-outline:before { content: "\e9a8"; } .icon-chevron-left-outline:before { content: "\e9a9"; } .icon-arrow-right-outline:before { content: "\e9aa"; } .icon-arrow-left-outline:before { content: "\e9ab"; } .icon-th-small-outline:before { content: "\e9ac"; } .icon-th-menu-outline:before { content: "\e9ad"; } .icon-th-list-outline:before { content: "\e9ae"; } .icon-news2:before { content: "\e9b1"; } .icon-home-outline:before { content: "\e9b2"; } .icon-arrow-up-outline:before { content: "\e9b3"; } .icon-arrow-forward-outline:before { content: "\e9b4"; } .icon-arrow-down-outline:before { content: "\e9b5"; } .icon-arrow-back-outline:before { content: "\e9b6"; } .icon-trash3:before { content: "\e9b7"; } .icon-rss-outline:before { content: "\e9b8"; } .icon-message:before { content: "\e9b9"; } .icon-location-outline:before { content: "\e9ba"; } .icon-link-outline:before { content: "\e9bb"; } .icon-image-outline:before { content: "\e9bc"; } .icon-export-outline:before { content: "\e9bd"; } .icon-cross:before { content: "\e9be"; } .icon-wi-fi-outline:before { content: "\e9bf"; } .icon-star-outline:before { content: "\e9c0"; } .icon-media-pause-outline:before { content: "\e9c1"; } .icon-mail:before { content: "\e9c2"; } .icon-heart-outline:before { content: "\e9c3"; } .icon-flash-outline:before { content: "\e9c4"; } .icon-cancel-outline:before { content: "\e9c5"; } .icon-beaker:before { content: "\e9c6"; } .icon-arrow-move-outline:before { content: "\e9c7"; } .icon-watch2:before { content: "\e9c8"; } .icon-warning-outline:before { content: "\e9c9"; } .icon-time:before { content: "\e9ca"; } .icon-radar-outline:before { content: "\e9cb"; } .icon-lock-open-outline:before { content: "\e9cc"; } .icon-location-arrow-outline:before { content: "\e9cd"; } .icon-info-outline:before { content: "\e9ce"; } .icon-backspace-outline:before { content: "\e9cf"; } .icon-attachment-outline:before { content: "\e9d0"; } .icon-user-outline:before { content: "\e9d1"; } .icon-user-delete-outline:before { content: "\e9d2"; } .icon-user-add-outline:before { content: "\e9d3"; } .icon-lock-closed-outline:before { content: "\e9d4"; } .icon-group-outline:before { content: "\e9d5"; } .icon-chart-pie-outline:before { content: "\e9d6"; } .icon-chart-line-outline:before { content: "\e9d7"; } .icon-chart-bar-outline:before { content: "\e9d8"; } .icon-chart-area-outline:before { content: "\e9d9"; } .icon-video-outline:before { content: "\e9da"; } .icon-point-of-interest-outline:before { content: "\e9db"; } .icon-map:before { content: "\e9dc"; } .icon-key-outline:before { content: "\e9dd"; } .icon-infinity-outline:before { content: "\e9de"; } .icon-globe-outline:before { content: "\e9df"; } .icon-eye-outline:before { content: "\e9e0"; } .icon-cog-outline:before { content: "\e9e1"; } .icon-camera-outline:before { content: "\e9e2"; } .icon-upload-outline:before { content: "\e9e3"; } .icon-support:before { content: "\e9e4"; } .icon-scissors-outline:before { content: "\e9e5"; } .icon-refresh-outline:before { content: "\e9e6"; } .icon-info-large-outline:before { content: "\e9e7"; } .icon-eject-outline:before { content: "\e9e8"; } .icon-download-outline:before { content: "\e9e9"; } .icon-battery-mid:before { content: "\e9ea"; } .icon-battery-low:before { content: "\e9eb"; } .icon-battery-high:before { content: "\e9ec"; } .icon-zoom-outline:before { content: "\e9ed"; } .icon-zoom-out-outline:before { content: "\e9ee"; } .icon-zoom-in-outline:before { content: "\e9ef"; } .icon-tag3:before { content: "\e9f0"; } .icon-tabs-outline:before { content: "\e9f1"; } .icon-pin-outline:before { content: "\e9f2"; } .icon-message-typing:before { content: "\e9f3"; } .icon-directions:before { content: "\e9f4"; } .icon-battery-full:before { content: "\e9f5"; } .icon-battery-charge:before { content: "\e9f6"; } .icon-pipette:before { content: "\e9f7"; } .icon-pencil:before { content: "\e9f8"; } .icon-folder:before { content: "\e9f9"; } .icon-folder-delete:before { content: "\e9fa"; } .icon-folder-add:before { content: "\e9fb"; } .icon-edit:before { content: "\e9fc"; } .icon-document:before { content: "\e9fd"; } .icon-document-delete:before { content: "\e9fe"; } .icon-document-add:before { content: "\e9ff"; } .icon-brush:before { content: "\ea00"; } .icon-thumbs-up:before { content: "\ea01"; } .icon-thumbs-down:before { content: "\ea02"; } .icon-pen:before { content: "\ea03"; } .icon-sort-numerically-outline:before { content: "\ea04"; } .icon-sort-alphabetically-outline:before { content: "\ea05"; } .icon-social-last-fm-circular:before { content: "\ea06"; } .icon-social-github-circular:before { content: "\ea07"; } .icon-compass:before { content: "\ea08"; } .icon-bookmark:before { content: "\ea09"; } .icon-input-checked-outline:before { content: "\ea0a"; } .icon-code-outline:before { content: "\ea0b"; } .icon-calender-outline:before { content: "\ea0c"; } .icon-business-card:before { content: "\ea0d"; } .icon-arrow-up:before { content: "\ea0e"; } .icon-arrow-sync-outline:before { content: "\ea0f"; } .icon-arrow-right:before { content: "\ea10"; } .icon-arrow-repeat-outline:before { content: "\ea11"; } .icon-arrow-loop-outline:before { content: "\ea12"; } .icon-arrow-left:before { content: "\ea13"; } .icon-flow-switch:before { content: "\ea14"; } .icon-flow-parallel:before { content: "\ea15"; } .icon-flow-merge:before { content: "\ea16"; } .icon-document-text:before { content: "\ea17"; } .icon-clipboard:before { content: "\ea18"; } .icon-calculator:before { content: "\ea19"; } .icon-arrow-minimise-outline:before { content: "\ea1a"; } .icon-arrow-maximise-outline:before { content: "\ea1b"; } .icon-arrow-down:before { content: "\ea1c"; } .icon-gift:before { content: "\ea1d"; } .icon-film:before { content: "\ea1e"; } .icon-database:before { content: "\ea1f"; } .icon-bell:before { content: "\ea20"; } .icon-anchor-outline:before { content: "\ea21"; } .icon-adjust-contrast:before { content: "\ea22"; } .icon-world-outline:before { content: "\ea23"; } .icon-shopping-bag:before { content: "\ea24"; } .icon-power-outline:before { content: "\ea25"; } .icon-notes-outline:before { content: "\ea26"; } .icon-device-tablet:before { content: "\ea27"; } .icon-device-phone:before { content: "\ea28"; } .icon-device-laptop:before { content: "\ea29"; } .icon-device-desktop:before { content: "\ea2a"; } .icon-briefcase:before { content: "\ea2b"; } .icon-stopwatch:before { content: "\ea2c"; } .icon-spanner-outline:before { content: "\ea2d"; } .icon-puzzle-outline:before { content: "\ea2e"; } .icon-printer:before { content: "\ea2f"; } .icon-pi-outline:before { content: "\ea30"; } .icon-lightbulb:before { content: "\ea31"; } .icon-flag-outline:before { content: "\ea32"; } .icon-contacts:before { content: "\ea33"; } .icon-archive2:before { content: "\ea34"; } .icon-weather-stormy:before { content: "\ea35"; } .icon-weather-shower:before { content: "\ea36"; } .icon-weather-partly-sunny:before { content: "\ea37"; } .icon-weather-downpour:before { content: "\ea38"; } .icon-weather-cloudy:before { content: "\ea39"; } .icon-plane-outline:before { content: "\ea3a"; } .icon-phone-outline:before { content: "\ea3b"; } .icon-microphone-outline:before { content: "\ea3c"; } .icon-weather-windy:before { content: "\ea3d"; } .icon-weather-windy-cloudy:before { content: "\ea3e"; } .icon-weather-sunny:before { content: "\ea3f"; } .icon-weather-snow:before { content: "\ea40"; } .icon-weather-night:before { content: "\ea41"; } .icon-media-stop-outline:before { content: "\ea42"; } .icon-media-rewind-outline:before { content: "\ea43"; } .icon-media-record-outline:before { content: "\ea44"; } .icon-media-play-outline:before { content: "\ea45"; } .icon-media-fast-forward-outline:before { content: "\ea46"; } .icon-media-eject-outline:before { content: "\ea47"; } .icon-wine:before { content: "\ea48"; } .icon-waves-outline:before { content: "\ea49"; } .icon-ticket:before { content: "\ea4a"; } .icon-tags:before { content: "\ea4b"; } .icon-plug:before { content: "\ea4c"; } .icon-headphones:before { content: "\ea4d"; } .icon-credit-card:before { content: "\ea4e"; } .icon-coffee:before { content: "\ea4f"; } .icon-book:before { content: "\ea50"; } .icon-beer:before { content: "\ea51"; } .icon-volume2:before { content: "\ea52"; } .icon-volume-up:before { content: "\ea53"; } .icon-volume-mute:before { content: "\ea54"; } .icon-volume-down:before { content: "\ea55"; } .icon-social-vimeo-circular:before { content: "\ea56"; } .icon-social-twitter-circular:before { content: "\ea57"; } .icon-social-pinterest-circular:before { content: "\ea58"; } .icon-social-linkedin-circular:before { content: "\ea59"; } .icon-social-facebook-circular:before { content: "\ea5a"; } .icon-social-dribbble-circular:before { content: "\ea5b"; } .icon-tree:before { content: "\ea5c"; } .icon-thermometer2:before { content: "\ea5d"; } .icon-social-tumbler-circular:before { content: "\ea5e"; } .icon-social-skype-outline:before { content: "\ea5f"; } .icon-social-flickr-circular:before { content: "\ea60"; } .icon-social-at-circular:before { content: "\ea61"; } .icon-shopping-cart:before { content: "\ea62"; } .icon-messages:before { content: "\ea63"; } .icon-leaf:before { content: "\ea64"; } .icon-feather:before { content: "\ea65"; } .icon-eye2:before { content: "\e064"; } .icon-paper-clip:before { content: "\e065"; } .icon-mail5:before { content: "\e066"; } .icon-toggle:before { content: "\e067"; } .icon-layout:before { content: "\e068"; } .icon-link2:before { content: "\e069"; } .icon-bell2:before { content: "\e06a"; } .icon-lock3:before { content: "\e06b"; } .icon-unlock:before { content: "\e06c"; } .icon-ribbon2:before { content: "\e06d"; } .icon-image2:before { content: "\e06e"; } .icon-signal:before { content: "\e06f"; } .icon-target3:before { content: "\e070"; } .icon-clipboard3:before { content: "\e071"; } .icon-clock3:before { content: "\e072"; } .icon-watch:before { content: "\e073"; } .icon-air-play:before { content: "\e074"; } .icon-camera3:before { content: "\e075"; } .icon-video2:before { content: "\e076"; } .icon-disc:before { content: "\e077"; } .icon-printer3:before { content: "\e078"; } .icon-monitor:before { content: "\e079"; } .icon-server:before { content: "\e07a"; } .icon-cog2:before { content: "\e07b"; } .icon-heart3:before { content: "\e07c"; } .icon-paragraph:before { content: "\e07d"; } .icon-align-justify:before { content: "\e07e"; } .icon-align-left:before { content: "\e07f"; } .icon-align-center:before { content: "\e080"; } .icon-align-right:before { content: "\e081"; } .icon-book2:before { content: "\e082"; } .icon-layers2:before { content: "\e083"; } .icon-stack2:before { content: "\e084"; } .icon-stack-2:before { content: "\e085"; } .icon-paper:before { content: "\e086"; } .icon-paper-stack:before { content: "\e087"; } .icon-search3:before { content: "\e088"; } .icon-zoom-in2:before { content: "\e089"; } .icon-zoom-out2:before { content: "\e08a"; } .icon-reply2:before { content: "\e08b"; } .icon-circle-plus:before { content: "\e08c"; } .icon-circle-minus:before { content: "\e08d"; } .icon-circle-check:before { content: "\e08e"; } .icon-circle-cross:before { content: "\e08f"; } .icon-square-plus:before { content: "\e090"; } .icon-square-minus:before { content: "\e091"; } .icon-square-check:before { content: "\e092"; } .icon-square-cross:before { content: "\e093"; } .icon-microphone:before { content: "\e094"; } .icon-record:before { content: "\e095"; } .icon-skip-back:before { content: "\e096"; } .icon-rewind:before { content: "\e097"; } .icon-play4:before { content: "\e098"; } .icon-pause3:before { content: "\e099"; } .icon-stop3:before { content: "\e09a"; } .icon-fast-forward:before { content: "\e09b"; } .icon-skip-forward:before { content: "\e09c"; } .icon-shuffle2:before { content: "\e09d"; } .icon-repeat:before { content: "\e09e"; } .icon-folder2:before { content: "\e09f"; } .icon-umbrella:before { content: "\e0a0"; } .icon-moon:before { content: "\e0a1"; } .icon-thermometer:before { content: "\e0a2"; } .icon-drop:before { content: "\e0a3"; } .icon-sun2:before { content: "\e0a4"; } .icon-cloud3:before { content: "\e0a5"; } .icon-cloud-upload2:before { content: "\e0a6"; } .icon-cloud-download2:before { content: "\e0a7"; } .icon-upload4:before { content: "\e0a8"; } .icon-download4:before { content: "\e0a9"; } .icon-location3:before { content: "\e0aa"; } .icon-location-2:before { content: "\e0ab"; } .icon-map3:before { content: "\e0ac"; } .icon-battery:before { content: "\e0ad"; } .icon-head:before { content: "\e0ae"; } .icon-briefcase3:before { content: "\e0af"; } .icon-speech-bubble:before { content: "\e0b0"; } .icon-anchor2:before { content: "\e0b1"; } .icon-globe2:before { content: "\e0b2"; } .icon-box:before { content: "\e0b3"; } .icon-reload:before { content: "\e0b4"; } .icon-share3:before { content: "\e0b5"; } .icon-marquee:before { content: "\e0b6"; } .icon-marquee-plus:before { content: "\e0b7"; } .icon-marquee-minus:before { content: "\e0b8"; } .icon-tag:before { content: "\e0b9"; } .icon-power2:before { content: "\e0ba"; } .icon-command2:before { content: "\e0bb"; } .icon-alt:before { content: "\e0bc"; } .icon-esc:before { content: "\e0bd"; } .icon-bar-graph:before { content: "\e0be"; } .icon-bar-graph-2:before { content: "\e0bf"; } .icon-pie-graph:before { content: "\e0c0"; } .icon-star:before { content: "\e0c1"; } .icon-arrow-left3:before { content: "\e0c2"; } .icon-arrow-right3:before { content: "\e0c3"; } .icon-arrow-up3:before { content: "\e0c4"; } .icon-arrow-down3:before { content: "\e0c5"; } .icon-volume:before { content: "\e0c6"; } .icon-mute:before { content: "\e0c7"; } .icon-content-right:before { content: "\e100"; } .icon-content-left:before { content: "\e101"; } .icon-grid2:before { content: "\e102"; } .icon-grid-2:before { content: "\e103"; } .icon-columns:before { content: "\e104"; } .icon-loader:before { content: "\e105"; } .icon-bag:before { content: "\e106"; } .icon-ban:before { content: "\e107"; } .icon-flag3:before { content: "\e108"; } .icon-trash:before { content: "\e109"; } .icon-expand2:before { content: "\e110"; } .icon-contract:before { content: "\e111"; } .icon-maximize:before { content: "\e112"; } .icon-minimize:before { content: "\e113"; } .icon-plus2:before { content: "\e114"; } .icon-minus2:before { content: "\e115"; } .icon-check:before { content: "\e116"; } .icon-cross2:before { content: "\e117"; } .icon-move:before { content: "\e118"; } .icon-delete:before { content: "\e119"; } .icon-menu5:before { content: "\e120"; } .icon-archive:before { content: "\e121"; } .icon-inbox:before { content: "\e122"; } .icon-outbox:before { content: "\e123"; } .icon-file:before { content: "\e124"; } .icon-file-add:before { content: "\e125"; } .icon-file-subtract:before { content: "\e126"; } .icon-help:before { content: "\e127"; } .icon-open:before { content: "\e128"; } .icon-ellipsis:before { content: "\e129"; } .icon-heart4:before { content: "\e900"; } .icon-cloud4:before { content: "\e901"; } .icon-star2:before { content: "\e902"; } .icon-tv2:before { content: "\e903"; } .icon-sound:before { content: "\e904"; } .icon-video3:before { content: "\e905"; } .icon-trash2:before { content: "\e906"; } .icon-user2:before { content: "\e907"; } .icon-key3:before { content: "\e908"; } .icon-search4:before { content: "\e909"; } .icon-settings:before { content: "\e90a"; } .icon-camera4:before { content: "\e90b"; } .icon-tag2:before { content: "\e90c"; } .icon-lock4:before { content: "\e90d"; } .icon-bulb:before { content: "\e90e"; } .icon-pen2:before { content: "\e90f"; } .icon-diamond:before { content: "\e910"; } .icon-display2:before { content: "\e911"; } .icon-location4:before { content: "\e912"; } .icon-eye3:before { content: "\e913"; } .icon-bubble3:before { content: "\e914"; } .icon-stack3:before { content: "\e915"; } .icon-cup:before { content: "\e916"; } .icon-phone3:before { content: "\e917"; } .icon-news:before { content: "\e918"; } .icon-mail6:before { content: "\e919"; } .icon-like:before { content: "\e91a"; } .icon-photo:before { content: "\e91b"; } .icon-note:before { content: "\e91c"; } .icon-clock4:before { content: "\e91d"; } .icon-paperplane:before { content: "\e91e"; } .icon-params:before { content: "\e91f"; } .icon-banknote:before { content: "\e920"; } .icon-data:before { content: "\e921"; } .icon-music2:before { content: "\e922"; } .icon-megaphone2:before { content: "\e923"; } .icon-study:before { content: "\e924"; } .icon-lab2:before { content: "\e925"; } .icon-food:before { content: "\e926"; } .icon-t-shirt:before { content: "\e927"; } .icon-fire2:before { content: "\e928"; } .icon-clip:before { content: "\e929"; } .icon-shop:before { content: "\e92a"; } .icon-calendar3:before { content: "\e92b"; } .icon-wallet2:before { content: "\e92c"; } .icon-vynil:before { content: "\e92d"; } .icon-truck2:before { content: "\e92e"; } .icon-world:before { content: "\e92f"; } .icon-spinner6:before { content: "\e9af"; } .icon-spinner7:before { content: "\e9b0"; } .icon-amazon:before { content: "\eab7"; } .icon-google:before { content: "\eab8"; } .icon-google2:before { content: "\eab9"; } .icon-google3:before { content: "\eaba"; } .icon-google-plus:before { content: "\eabb"; } .icon-google-plus2:before { content: "\eabc"; } .icon-google-plus3:before { content: "\eabd"; } .icon-hangouts:before { content: "\eabe"; } .icon-google-drive:before { content: "\eabf"; } .icon-facebook2:before { content: "\eac0"; } .icon-facebook22:before { content: "\eac1"; } .icon-instagram:before { content: "\eac2"; } .icon-whatsapp:before { content: "\eac3"; } .icon-spotify:before { content: "\eac4"; } .icon-telegram:before { content: "\eac5"; } .icon-twitter2:before { content: "\eac6"; } .icon-vine:before { content: "\eac7"; } .icon-vk:before { content: "\eac8"; } .icon-renren:before { content: "\eac9"; } .icon-sina-weibo:before { content: "\eaca"; } .icon-rss2:before { content: "\eacb"; } .icon-rss22:before { content: "\eacc"; } .icon-youtube:before { content: "\eacd"; } .icon-youtube2:before { content: "\eace"; } .icon-twitch:before { content: "\eacf"; } .icon-vimeo:before { content: "\ead0"; } .icon-vimeo2:before { content: "\ead1"; } .icon-lanyrd:before { content: "\ead2"; } .icon-flickr:before { content: "\ead3"; } .icon-flickr2:before { content: "\ead4"; } .icon-flickr3:before { content: "\ead5"; } .icon-flickr4:before { content: "\ead6"; } .icon-dribbble2:before { content: "\ead7"; } .icon-behance:before { content: "\ead8"; } .icon-behance2:before { content: "\ead9"; } .icon-deviantart:before { content: "\eada"; } .icon-500px:before { content: "\eadb"; } .icon-steam:before { content: "\eadc"; } .icon-steam2:before { content: "\eadd"; } .icon-dropbox:before { content: "\eade"; } .icon-onedrive:before { content: "\eadf"; } .icon-github:before { content: "\eae0"; } .icon-npm:before { content: "\eae1"; } .icon-basecamp:before { content: "\eae2"; } .icon-trello:before { content: "\eae3"; } .icon-wordpress:before { content: "\eae4"; } .icon-joomla:before { content: "\eae5"; } .icon-ello:before { content: "\eae6"; } .icon-blogger:before { content: "\eae7"; } .icon-blogger2:before { content: "\eae8"; } .icon-tumblr2:before { content: "\eae9"; } .icon-tumblr22:before { content: "\eaea"; } .icon-yahoo:before { content: "\eaeb"; } .icon-yahoo2:before { content: "\eaec"; } .icon-tux:before { content: "\eaed"; } .icon-appleinc:before { content: "\eaee"; } .icon-finder:before { content: "\eaef"; } .icon-android:before { content: "\eaf0"; } .icon-windows:before { content: "\eaf1"; } .icon-windows8:before { content: "\eaf2"; } .icon-soundcloud:before { content: "\eaf3"; } .icon-soundcloud2:before { content: "\eaf4"; } .icon-skype:before { content: "\eaf5"; } .icon-reddit:before { content: "\eaf6"; } .icon-hackernews:before { content: "\eaf7"; } .icon-wikipedia:before { content: "\eaf8"; } .icon-linkedin2:before { content: "\eaf9"; } .icon-linkedin22:before { content: "\eafa"; } .icon-lastfm:before { content: "\eafb"; } .icon-lastfm2:before { content: "\eafc"; } .icon-delicious:before { content: "\eafd"; } .icon-stumbleupon:before { content: "\eafe"; } .icon-stumbleupon2:before { content: "\eaff"; } .icon-stackoverflow:before { content: "\eb00"; } .icon-pinterest:before { content: "\eb01"; } .icon-pinterest2:before { content: "\eb02"; } .icon-xing:before { content: "\eb03"; } .icon-xing2:before { content: "\eb04"; } .icon-flattr:before { content: "\eb05"; } .icon-foursquare:before { content: "\eb06"; } .icon-yelp:before { content: "\eb07"; } .icon-paypal:before { content: "\eb08"; } .icon-chrome:before { content: "\eb09"; } .icon-firefox:before { content: "\eb0a"; } .icon-IE:before { content: "\eb0b"; } .icon-edge:before { content: "\eb0c"; } .icon-safari:before { content: "\eb0d"; } .icon-opera:before { content: "\eb0e"; } .icon-file-pdf:before { content: "\eb0f"; } .icon-file-openoffice:before { content: "\eb10"; } .icon-file-word:before { content: "\eb11"; } .icon-file-excel:before { content: "\eb12"; } .icon-libreoffice:before { content: "\eb13"; } .icon-html-five:before { content: "\eb14"; } .icon-html-five2:before { content: "\eb15"; } .icon-css3:before { content: "\eb16"; } .icon-git:before { content: "\eb17"; } .icon-codepen:before { content: "\eb18"; } .icon-svg:before { content: "\eb19"; } .icon-IcoMoon:before { content: "\eb1a"; }
Humsen/web/web-mobile/WebContent/plugins/template/css/icomoon.css/0
{ "file_path": "Humsen/web/web-mobile/WebContent/plugins/template/css/icomoon.css", "repo_id": "Humsen", "token_count": 12543 }
50
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>代码库</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="欢迎来到何明胜的个人网站.本站主要用于记录和分享本人的学习心得和编程经验,并分享常见可复用代码、推荐书籍以及软件等资源.本站源码已托管github,欢迎访问:https://github.com/HelloHusen/web" /> <meta name="keywords" content="何明胜,何明胜的个人网站,何明胜的博客,一格的程序人生" /> <meta name="author" content="何明胜,一格"> <!-- 网站图标 --> <link rel="shortcut icon" href="/images/favicon.ico"> <!-- jQuery --> <script src="/plugins/jquery/js/jquery-3.2.1.min.js"></script> <!-- editor.md --> <link rel="stylesheet" href="/plugins/editormd/css/editormd.preview.min.css" /> <link rel="stylesheet" href="/plugins/editormd/css/editormd.min.css" /> <!-- editor.md --> <script src="/plugins/editormd/lib/marked.min.js"></script> <script src="/plugins/editormd/lib/prettify.min.js"></script> <script src="/plugins/editormd/js/editormd.min.js"></script> <!-- 自定义CSS --> <link rel="stylesheet" href="/css/article/article.css"> <!-- 自定义脚本 --> <script src="/js/article/code-library.js"></script> <script src="/js/pagination.js"></script> </head> <body> <input id="menuBarNo" type="hidden" value="2" /> <div id="fh5co-page"> <a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle"><i></i></a> <input id="menuBarNo" type="hidden" value="2" /> <!-- 左侧导航 --> <!-- 中间内容 --> <div id="fh5co-main"> <div id="list_code" class="fh5co-post"> <!-- js脚本动态添加内容 --> </div> </div> <!-- 右侧导航 --> </div> </body> </html>
Humsen/web/web-mobile/WebContent/topic/code/code.html/0
{ "file_path": "Humsen/web/web-mobile/WebContent/topic/code/code.html", "repo_id": "Humsen", "token_count": 867 }
51
@charset "UTF-8"; body { font-weight: 300; line-height: 1.6; /* font-family: "Times New Roman", Times, serif; */ font-family: "Georgia", Tahoma, Sans-Serif; min-width: 1345px; } #fh5co-page { width: 100%; overflow: hidden; position: relative; }
Humsen/web/web-pc/WebContent/css/global.css/0
{ "file_path": "Humsen/web/web-pc/WebContent/css/global.css", "repo_id": "Humsen", "token_count": 109 }
52
@charset "UTF-8"; .secondmenu a { /* text-align: center; */ margin-left: 20px; } .version-input { /* resize: none; */ } .return-index { margin-left: 50%; } .form-show-userinfo { margin-top: 50px; } .img-user-head { width: 80px; height: 80px; } .form-show-p { width: 30%; } .back-left-menu { margin-top: 60px; }
Humsen/web/web-pc/WebContent/css/personal_center/mycenter.css/0
{ "file_path": "Humsen/web/web-pc/WebContent/css/personal_center/mycenter.css", "repo_id": "Humsen", "token_count": 154 }
53
/** * @author 何明胜 * * 2017年9月26日 */ /** 加载插件 * */ $.ajax({ url : '/plugins/plugins.html', // 这里是静态页的地址 async : false, type : 'GET', // 静态页用get方法,否则服务器会抛出405错误 success : function(data) { $($('head')[0]).find('script:first').after(data); } }); $(function() { /** 顶部导航栏 **/ $.ajax({ url : '/module/navigation/topbar.html', // 这里是静态页的地址 async : false, type : 'GET', // 静态页用get方法,否则服务器会抛出405错误 success : function(data) { $('#menuBarNo').before(data); } }); /** 登录控制 **/ $.ajax({ url : '/module/login/login.html', // 这里是静态页的地址 async : false, type : 'GET', // 静态页用get方法,否则服务器会抛出405错误 success : function(data) { $('#menuBarNo').before(data); } }); /** 左侧导航栏 **/ $.ajax({ url : '/module/navigation/leftbar.html', // 这里是静态页的地址 async : false, type : 'GET', // 静态页用get方法,否则服务器会抛出405错误 success : function(data) { $('#fh5co-main').before(data); } }); /** 右侧导航栏 **/ $.ajax({ url : '/module/navigation/rightbar.html', // 这里是静态页的地址 async : false, type : 'GET', // 静态页用get方法,否则服务器会抛出405错误 success : function(data) { $('#fh5co-main').after(data); } }); }); /** * 按钮初始化 * * @returns */ $(function(){ //重置表单 $('#form_contactAdmin')[0].reset(); //添加表单验证 contactFormValidate(); //发送邮件点击事件 sendEmailClick(); }); /** * 联系站长表单添加合法验证 * * @returns */ function contactFormValidate() { $('#form_contactAdmin').bootstrapValidator({ message : '输入无效!', feedbackIcons : { valid : 'glyphicon glyphicon-ok', invalid : 'glyphicon glyphicon-remove', validating : 'glyphicon glyphicon-refresh' }, fields : { contactName : { message : '姓名无效!', validators : { notEmpty : { message : '姓名不能为空!' } } }, contactEmail : { validators : { notEmpty : { message : '邮箱为必填哦!' }, regexp : { regexp : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, message : '邮箱格式不正确' } } }, contactPhone : { regexp : { regexp : /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/, message : '手机号无效' } }, contactContent : { validators : { notEmpty : { message : '内容怎么能为空呢' }, } } } }); } /** * 发送邮件点击事件 * @returns */ function sendEmailClick() { $('#btn_sendEmail').click(function() { // 进行表单验证 var $formContactAdmin = $('#form_contactAdmin').data('bootstrapValidator'); $formContactAdmin.validate(); if ($formContactAdmin.isValid()) { // 发送ajax请求 $.ajax({ url : '/sendEmail.hms', async : false,// 同步,会阻塞操作 type : 'POST',// PUT DELETE POST data : $('#form_contactAdmin').serialize(), success : function(result) { if(result == 1){ $.confirm({ title: '发送成功', content: '您的邮箱已经发送到站长邮箱,感谢您的支持!', autoClose: 'ok|5000', type: 'green', buttons: { ok: { text: '确认', btnClass: 'btn-primary', }, } }); $('#form_contactAdmin')[0].reset(); }else{ $.confirm({ title: '发送失败,建议尝试重新发送', content: textStatus + ' : ' + XMLHttpRequest.status, autoClose: 'ok|1000', type: 'red', buttons: { ok: { text: '确认', btnClass: 'btn-primary', }, } }); } }, error : function(XMLHttpRequest, textStatus){ $.confirm({ title: '发送邮件出错', content: textStatus + ' : ' + XMLHttpRequest.status, autoClose: 'ok|1000', type: 'green', buttons: { ok: { text: '确认', btnClass: 'btn-primary', }, } }); } }); } }); }
Humsen/web/web-pc/WebContent/js/contact/contact.js/0
{ "file_path": "Humsen/web/web-pc/WebContent/js/contact/contact.js", "repo_id": "Humsen", "token_count": 2486 }
54
/*! * BootstrapValidator (http://bootstrapvalidator.com) * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3 * * @version v0.5.3, built on 2014-11-05 9:14:18 PM * @author https://twitter.com/nghuuphuoc * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc * @license Commercial: http://bootstrapvalidator.com/license/ * Non-commercial: http://creativecommons.org/licenses/by-nc-nd/3.0/ */ .bv-form .help-block{margin-bottom:0}.bv-form .tooltip-inner{text-align:left}.nav-tabs li.bv-tab-success>a{color:#3c763d}.nav-tabs li.bv-tab-error>a{color:#a94442}.bv-form .bv-icon-no-label{top:0}.bv-form .bv-icon-input-group{top:0;z-index:100}
Humsen/web/web-pc/WebContent/plugins/validator/css/bootstrapValidator.min.css/0
{ "file_path": "Humsen/web/web-pc/WebContent/plugins/validator/css/bootstrapValidator.min.css", "repo_id": "Humsen", "token_count": 290 }
55
(function($) { /** * Hebrew language package * Translated by @yakidahan */ $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, { base64: { 'default': 'נא להזין ערך המקודד בבסיס 64' }, between: { 'default': 'נא להזין ערך בין %s ל-%s', notInclusive: 'נא להזין ערך בין %s ל-%s בדיוק' }, callback: { 'default': 'נא להזין ערך תקין' }, choice: { 'default': 'נא להזין ערך תקין', less: 'נא לבחור מינימום %s אפשרויות', more: 'נא לבחור מקסימום %s אפשרויות', between: 'נא לבחור %s-%s אפשרויות' }, color: { 'default': 'נא להזין קוד צבע תקין' }, creditCard: { 'default': 'נא להזין מספר כרטיס אשראי תקין' }, cusip: { 'default': 'נא להזין מספר CUSIP תקין' }, cvv: { 'default': 'נא להזין מספר CVV תקין' }, date: { 'default': 'נא להזין תאריך תקין', min: 'נא להזין תאריך אחרי %s', max: 'נא להזין תאריך לפני %s', range: 'נא להזין תאריך בטווח %s - %s' }, different: { 'default': 'נא להזין ערך שונה' }, digits: { 'default': 'נא להזין ספרות בלבד' }, ean: { 'default': 'נא להזין מספר EAN תקין' }, emailAddress: { 'default': 'נא להזין כתובת דוא"ל תקינה' }, file: { 'default': 'נא לבחור קובץ חוקי' }, greaterThan: { 'default': 'נא להזין ערך גדול או שווה ל-%s', notInclusive: 'נא להזין ערך גדול מ-%s' }, grid: { 'default': 'נא להזין מספר GRId תקין' }, hex: { 'default': 'נא להזין מספר הקסדצימלי תקין' }, hexColor: { 'default': 'נא להזין קוד צבע הקסדצימלי תקין' }, iban: { 'default': 'נא להזין מספר IBAN תקין', countryNotSupported: 'קוד המדינה של %s אינו נתמך', country: 'נא להזין מספר IBAN תקני ב%s', countries: { AD: 'אנדורה', AE: 'איחוד האמירויות הערבי', AL: 'אלבניה', AO: 'אנגולה', AT: 'אוסטריה', AZ: 'אזרבייגאן', BA: 'בוסניה והרצגובינה', BE: 'בלגיה', BF: 'בורקינה פאסו', BG: 'בולגריה', BH: 'בחריין', BI: 'בורונדי', BJ: 'בנין', BR: 'ברזיל', CH: 'שווייץ', CI: 'חוף השנהב', CM: 'קמרון', CR: 'קוסטה ריקה', CV: 'קייפ ורדה', CY: 'קפריסין', CZ: 'צכיה', DE: 'גרמניה', DK: 'דנמרק', DO: 'דומיניקה', DZ: 'אלגיריה', EE: 'אסטוניה', ES: 'ספרד', FI: 'פינלנד', FO: 'איי פארו', FR: 'צרפת', GB: 'בריטניה', GE: 'גאורגיה', GI: 'גיברלטר', GL: 'גרינלנד', GR: 'יוון', GT: 'גואטמלה', HR: 'קרואטיה', HU: 'הונגריה', IE: 'אירלנד', IL: 'ישראל', IR: 'איראן', IS: 'איסלנד', IT: 'איטליה', JO: 'ירדן', KW: 'כווית', KZ: 'קזחסטן', LB: 'לבנון', LI: 'ליכטנשטיין', LT: 'ליטא', LU: 'לוקסמבורג', LV: 'לטביה', MC: 'מונקו', MD: 'מולדובה', ME: 'מונטנגרו', MG: 'מדגסקר', MK: 'מקדוניה', ML: 'מאלי', MR: 'מאוריטניה', MT: 'מלטה', MU: 'מאוריציוס', MZ: 'מוזמביק', NL: 'הולנד', NO: 'נורווגיה', PK: 'פקיסטן', PL: 'פולין', PS: 'פלסטין', PT: 'פורטוגל', QA: 'קטאר', RO: 'רומניה', RS: 'סרביה', SA: 'ערב הסעודית', SE: 'שוודיה', SI: 'סלובניה', SK: 'סלובקיה', SM: 'סן מרינו', SN: 'סנגל', TN: 'תוניסיה', TR: 'טורקיה', VG: 'איי הבתולה, בריטניה' } }, id: { 'default': 'נא להזין מספר זהות תקין', countryNotSupported: 'קוד המדינה של %s אינו נתמך', country: 'נא להזין מספר זהות תקני ב%s', countries: { BA: 'בוסניה והרצגובינה', BG: 'בולגריה', BR: 'ברזיל', CH: 'שווייץ', CL: 'צילה', CN: 'סין', CZ: 'צכיה', DK: 'דנמרק', EE: 'אסטוניה', ES: 'ספרד', FI: 'פינלנד', HR: 'קרואטיה', IE: 'אירלנד', IS: 'איסלנד', LT: 'ליטא', LV: 'לטביה', ME: 'מונטנגרו', MK: 'מקדוניה', NL: 'הולנד', RO: 'רומניה', RS: 'סרביה', SE: 'שוודיה', SI: 'סלובניה', SK: 'סלובקיה', SM: 'סן מרינו', TH: 'תאילנד', ZA: 'דרום אפריקה' } }, identical: { 'default': 'נא להזין את הערך שנית' }, imei: { 'default': 'נא להזין מספר IMEI תקין' }, imo: { 'default': 'נא להזין מספר IMO תקין' }, integer: { 'default': 'נא להזין מספר תקין' }, ip: { 'default': 'נא להזין כתובת IP תקינה', ipv4: 'נא להזין כתובת IPv4 תקינה', ipv6: 'נא להזין כתובת IPv6 תקינה' }, isbn: { 'default': 'נא להזין מספר ISBN תקין' }, isin: { 'default': 'נא להזין מספר ISIN תקין' }, ismn: { 'default': 'נא להזין מספר ISMN תקין' }, issn: { 'default': 'נא להזין מספר ISSN תקין' }, lessThan: { 'default': 'נא להזין ערך קטן או שווה ל-%s', notInclusive: 'נא להזין ערך קטן מ-%s' }, mac: { 'default': 'נא להזין מספר MAC תקין' }, meid: { 'default': 'נא להזין מספר MEID תקין' }, notEmpty: { 'default': 'נא להזין ערך' }, numeric: { 'default': 'נא להזין מספר עשרוני חוקי' }, phone: { 'default': 'נא להין מספר טלפון תקין', countryNotSupported: 'קוד המדינה של %s אינו נתמך', country: 'נא להזין מספר טלפון תקין ב%s', countries: { BR: 'ברזיל', CN: 'סין', CZ: 'צכיה', DE: 'גרמניה', DK: 'דנמרק', ES: 'ספרד', FR: 'צרפת', GB: 'בריטניה', MA: 'מרוקו', PK: 'פקיסטן', RO: 'רומניה', RU: 'רוסיה', SK: 'סלובקיה', TH: 'תאילנד', US: 'ארצות הברית', VE: 'ונצואלה' } }, regexp: { 'default': 'נא להזין ערך תואם לתבנית' }, remote: { 'default': 'נא להזין ערך תקין' }, rtn: { 'default': 'נא להזין מספר RTN תקין' }, sedol: { 'default': 'נא להזין מספר SEDOL תקין' }, siren: { 'default': 'נא להזין מספר SIREN תקין' }, siret: { 'default': 'נא להזין מספר SIRET תקין' }, step: { 'default': 'נא להזין שלב תקין מתוך %s' }, stringCase: { 'default': 'נא להזין אותיות קטנות בלבד', upper: 'נא להזין אותיות גדולות בלבד' }, stringLength: { 'default': 'נא להזין ערך באורך חוקי', less: 'נא להזין ערך קטן מ-%s תווים', more: 'נא להזין ערך גדול מ- %s תווים', between: 'נא להזין ערך בין %s עד %s תווים' }, uri: { 'default': 'נא להזין URI תקין' }, uuid: { 'default': 'נא להזין מספר UUID תקין', version: 'נא להזין מספר UUID גרסה %s תקין' }, vat: { 'default': 'נא להזין מספר VAT תקין', countryNotSupported: 'קוד המדינה של %s אינו נתמך', country: 'נא להזין מספר VAT תקין ב%s', countries: { AT: 'אוסטריה', BE: 'בלגיה', BG: 'בולגריה', BR: 'ברזיל', CH: 'שווייץ', CY: 'קפריסין', CZ: 'צכיה', DE: 'גרמניה', DK: 'דנמרק', EE: 'אסטוניה', ES: 'ספרד', FI: 'פינלנד', FR: 'צרפת', GB: 'בריטניה', GR: 'יוון', EL: 'יוון', HU: 'הונגריה', HR: 'קרואטיה', IE: 'אירלנד', IS: 'איסלנד', IT: 'איטליה', LT: 'ליטא', LU: 'לוקסמבורג', LV: 'לטביה', MT: 'מלטה', NL: 'הולנד', NO: 'נורווגיה', PL: 'פולין', PT: 'פורטוגל', RO: 'רומניה', RU: 'רוסיה', RS: 'סרביה', SE: 'שוודיה', SI: 'סלובניה', SK: 'סלובקיה', VE: 'ונצואלה', ZA: 'דרום אפריקה' } }, vin: { 'default': 'נא להזין מספר VIN תקין' }, zipCode: { 'default': 'נא להזין מיקוד תקין', countryNotSupported: 'קוד המדינה של %s אינו נתמך', country: 'נא להזין מיקוד תקין ב%s', countries: { AT: 'אוסטריה', BR: 'ברזיל', CA: 'קנדה', CH: 'שווייץ', CZ: 'צכיה', DE: 'גרמניה', DK: 'דנמרק', FR: 'צרפת', GB: 'בריטניה', IE: 'אירלנד', IT: 'איטליה', MA: 'מרוקו', NL: 'הולנד', PT: 'פורטוגל', RO: 'רומניה', RU: 'רוסיה', SE: 'שוודיה', SG: 'סינגפור', SK: 'סלובקיה', US: 'ארצות הברית' } } }); }(window.jQuery));
Humsen/web/web-pc/WebContent/plugins/validator/js/language/he_IL.js/0
{ "file_path": "Humsen/web/web-pc/WebContent/plugins/validator/js/language/he_IL.js", "repo_id": "Humsen", "token_count": 9629 }
56
(function($) { /** * Turkish language package * Translated By @CeRBeR666 */ $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, { base64: { 'default': 'Lütfen 64 bit tabanına uygun bir giriş yapınız' }, between: { 'default': 'Lütfen %s ile %s arasında bir değer giriniz', notInclusive: 'Lütfen sadece %s ile %s arasında bir değer giriniz' }, callback: { 'default': 'Lütfen geçerli bir değer giriniz' }, choice: { 'default': 'Lütfen geçerli bir değer giriniz', less: 'Lütfen minimum %s kadar değer giriniz', more: 'Lütfen maksimum %s kadar değer giriniz', between: 'Lütfen %s - %s arası seçiniz' }, color: { 'default': 'Lütfen geçerli bir codu giriniz' }, creditCard: { 'default': 'Lütfen geçerli bir kredi kartı numarası giriniz' }, cusip: { 'default': 'Lütfen geçerli bir CUSIP numarası giriniz' }, cvv: { 'default': 'Lütfen geçerli bir CCV numarası giriniz' }, date: { 'default': 'Lütfen geçerli bir tarih giriniz', min: 'Lütfen %s tarihinden sonra bir tarih giriniz', max: 'Lütfen %s tarihinden önce bir tarih giriniz', range: 'Lütfen %s - %s aralığında bir tarih giriniz' }, different: { 'default': 'Lütfen farklı bir değer giriniz' }, digits: { 'default': 'Lütfen sadece sayı giriniz' }, ean: { 'default': 'Lütfen geçerli bir EAN numarası giriniz' }, emailAddress: { 'default': 'Lütfen geçerli bir E-Mail adresi giriniz' }, file: { 'default': 'Lütfen geçerli bir dosya seçiniz' }, greaterThan: { 'default': 'Lütfen %s ye eşit veya daha büyük bir değer giriniz', notInclusive: 'Lütfen %s den büyük bir değer giriniz' }, grid: { 'default': 'Lütfen geçerli bir GRId numarası giriniz' }, hex: { 'default': 'Lütfen geçerli bir Hexadecimal sayı giriniz' }, hexColor: { 'default': 'Lütfen geçerli bir HEX codu giriniz' }, iban: { 'default': 'Lütfen geçerli bir IBAN numarası giriniz', countryNotSupported: '%s ülke kodu desteklenmemektedir', country: 'Lütfen geçerli bir IBAN numarası giriniz içinde %s', countries: { AD: 'Andorra', AE: 'Birleşik Arap Emirlikleri', AL: 'Arnavutluk', AO: 'Angola', AT: 'Avusturya', AZ: 'Azerbaycan', BA: 'Bosna Hersek', BE: 'Belçika', BF: 'Burkina Faso', BG: 'Bulgaristan', BH: 'Bahreyn', BI: 'Burundi', BJ: 'Benin', BR: 'Brezilya', CH: 'İsviçre', CI: 'Fildişi Sahili', CM: 'Kamerun', CR: 'Kosta Rika', CV: 'Cape Verde', CY: 'Kıbrıs', CZ: 'Çek Cumhuriyeti', DE: 'Almanya', DK: 'Danimarka', DO: 'Dominik Cumhuriyeti', DZ: 'Cezayir', EE: 'Estonya', ES: 'İspanya', FI: 'Finlandiya', FO: 'Faroe Adaları', FR: 'Fransa', GB: 'İngiltere', GE: 'Georgia', GI: 'Cebelitarık', GL: 'Grönland', GR: 'Yunansitan', GT: 'Guatemala', HR: 'Hırvatistan', HU: 'Macaristan', IE: 'İrlanda', IL: 'İsrail', IR: 'İran', IS: 'İzlanda', IT: 'İtalya', JO: 'Ürdün', KW: 'Kuveit', KZ: 'Kazakistan', LB: 'Lübnan', LI: 'Lihtenştayn', LT: 'Litvanya', LU: 'Lüksemburg', LV: 'Letonya', MC: 'Monako', MD: 'Moldova', ME: 'Karadağ', MG: 'Madagaskar', MK: 'Makedonya', ML: 'Mali', MR: 'Moritanya', MT: 'Malta', MU: 'Mauritius', MZ: 'Mozambik', NL: 'Hollanda', NO: 'Norveç', PK: 'Pakistan', PL: 'Polanya', PS: 'Filistin', PT: 'Portekiz', QA: 'Katar', RO: 'Romanya', RS: 'Serbistan', SA: 'Suudi Arabistan', SE: 'İsveç', SI: 'Slovenya', SK: 'Slovakya', SM: 'San Marino', SN: 'Senegal', TN: 'Tunus', TR: 'Turkiye', VG: 'Virgin Adaları, İngiliz' } }, id: { 'default': 'Lütfen geçerli bir tanımlama numarası giriniz', countryNotSupported: '%s ülke kodu desteklenmiyor', country: 'Lütfen geçerli bir kimlik numarası giriniz içinde %s', countries: { BA: 'Bosna Hersek', BG: 'Bulgaristan', BR: 'Brezilya', CH: 'İsviçre', CL: 'Şili', CN: 'Çin', CZ: 'Çek Cumhuriyeti', DK: 'Danimarka', EE: 'Estonya', ES: 'İspanya', FI: 'Finlandiya', HR: 'Hırvatistan', IE: 'İrlanda', IS: 'İzlanda', LT: 'Litvanya', LV: 'Letonya', ME: 'Karadağ', MK: 'Makedonya', NL: 'Hollanda', RO: 'Romanya', RS: 'Sırbistan', SE: 'İsveç', SI: 'Slovenya', SK: 'Slovakya', SM: 'San Marino', TH: 'Tayland', ZA: 'Güney Afrika' } }, identical: { 'default': 'Lütfen aynı değeri giriniz' }, imei: { 'default': 'Lütfen geçerli bir IMEI numarası giriniz' }, imo: { 'default': 'Lütfen geçerli bir IMO numarası giriniz' }, integer: { 'default': 'Lütfen geçerli bir numara giriniz' }, ip: { 'default': 'Lütfen geçerli bir IP adresi giriniz', ipv4: 'Lütfen geçerli bir IPv4 adresi giriniz', ipv6: 'Lütfen geçerli bri IPv6 adresi giriniz' }, isbn: { 'default': 'Lütfen geçerli bir ISBN numarası giriniz' }, isin: { 'default': 'Lütfen geçerli bir ISIN numarası giriniz' }, ismn: { 'default': 'Lütfen geçerli bir ISMN numarası giriniz' }, issn: { 'default': 'Lütfen geçerli bir ISSN numarası giriniz' }, lessThan: { 'default': 'Lütfen %s den düşük veya eşit bir değer giriniz', notInclusive: 'Lütfen %s den büyük bir değer giriniz' }, mac: { 'default': 'Lütfen geçerli bir MAC Adresi giriniz' }, meid: { 'default': 'Lütfen geçerli bir MEID numarası giriniz' }, notEmpty: { 'default': 'Bir değer giriniz' }, numeric: { 'default': 'Lütfen geçerli bir float değer giriniz' }, phone: { 'default': 'Lütfen geçerli bir telefon numarası giriniz', countryNotSupported: '%s ülke kodu desteklenmemektedir', country: 'Lütfen geçerli bir telefon numarası giriniz içinde %s', countries: { BR: 'Brezilya', CN: 'Çin', CZ: 'Çek Cumhuriyeti', DE: 'Almanya', DK: 'Danimarka', ES: 'İspanya', FR: 'Fransa', GB: 'İngiltere', MA: 'Fas', PK: 'Pakistan', RO: 'Romanya', RU: 'Rusya', SK: 'Slovakya', TH: 'Tayland', US: 'Amerika', VE: 'Venezüella' } }, regexp: { 'default': 'Lütfen uyumlu bir değer giriniz' }, remote: { 'default': 'Lütfen geçerli bir numara giriniz' }, rtn: { 'default': 'Lütfen geçerli bir RTN numarası giriniz' }, sedol: { 'default': 'Lütfen geçerli bir SEDOL numarası giriniz' }, siren: { 'default': 'Lütfen geçerli bir SIREN numarası giriniz' }, siret: { 'default': 'Lütfen geçerli bir SIRET numarası giriniz' }, step: { 'default': 'Lütfen geçerli bir %s adımı giriniz' }, stringCase: { 'default': 'Lütfen sadece küçük harf giriniz', upper: 'Lütfen sadece büyük harf giriniz' }, stringLength: { 'default': 'Lütfen geçerli uzunluktaki bir değer giriniz', less: 'Lütfen %s karakterden az değer giriniz', more: 'Lütfen %s karakterden fazla değer giriniz', between: 'Lütfen %s ile %s arası uzunlukta bir değer giriniz' }, uri: { 'default': 'Lütfen geçerli bir URL giriniz' }, uuid: { 'default': 'Lütfen geçerli bir UUID numarası giriniz', version: 'Lütfen geçerli bir UUID versiyon %s numarası giriniz' }, vat: { 'default': 'Lütfen geçerli bir VAT kodu giriniz', countryNotSupported: '%s ülke kodu desteklenmiyor', country: 'Lütfen geçerli bir vergi numarası giriniz içinde %s', countries: { AT: 'Avustralya', BE: 'Belçika', BG: 'Bulgaristan', BR: 'Brezilya', CH: 'İsviçre', CY: 'Kıbrıs', CZ: 'Çek Cumhuriyeti', DE: 'Almanya', DK: 'Danimarka', EE: 'Estonya', ES: 'İspanya', FI: 'Finlandiya', FR: 'Fransa', GB: 'İngiltere', GR: 'Yunanistan', EL: 'Yunanistan', HU: 'Macaristan', HR: 'Hırvatistan', IE: 'Irlanda', IS: 'İzlanda', IT: 'Italya', LT: 'Litvanya', LU: 'Lüksemburg', LV: 'Letonya', MT: 'Malta', NL: 'Hollanda', NO: 'Norveç', PL: 'Polonya', PT: 'Portekiz', RO: 'Romanya', RU: 'Rusya', RS: 'Sırbistan', SE: 'İsveç', SI: 'Slovenya', SK: 'Slovakya', VE: 'Venezüella', ZA: 'Güney Afrika' } }, vin: { 'default': 'Lütfen geçerli bir VIN numarası giriniz' }, zipCode: { 'default': 'Lütfen geçerli bir posta kodu giriniz', countryNotSupported: '%s ülke kodu desteklenmemektedir', country: 'Lütfen geçerli bir posta kodu giriniz içinde %s', countries: { AT: 'Avustralya', BR: 'Brezilya', CA: 'Kanada', CH: 'İsviçre', CZ: 'Çek Cumhuriyeti', DE: 'Almanya', DK: 'Danimarka', FR: 'Fransa', GB: 'İngiltere', IE: 'Irlanda', IT: 'İtalya', MA: 'Fas', NL: 'Hollanda', PT: 'Portekiz', RO: 'Romanya', RU: 'Rusya', SE: 'İsveç', SG: 'Singapur', SK: 'Slovakya', US: 'Amerika Birleşik Devletleri' } } }); }(window.jQuery));
Humsen/web/web-pc/WebContent/plugins/validator/js/language/tr_TR.js/0
{ "file_path": "Humsen/web/web-pc/WebContent/plugins/validator/js/language/tr_TR.js", "repo_id": "Humsen", "token_count": 8174 }
57
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- 本配置文件的目标是将不同级别的日志输出到不同文件 --><!-- 最大2MB一个文件, 文件数据达到最大值时,旧数据会被压缩并放进指定文件夹 --><!-- status : 这个用于设置log4j2自身内部的信息输出,可以不设置 --><!-- 当设置成trace时,会看到log4j2内部各种详细输出 monitorInterval --><!-- monitorInterval="60"表示每60秒配置文件会动态加载一次。在程序运行过程中,如果修改配置文件,程序会随之改变。 --><Configuration monitorInterval="60" status="WARN"> <!-- 定义通用的属性 --> <Properties> <!-- 云端部署 这里的logs为项目根目录下的logs文件夹 --> <!-- web:rootDir指向web应用根目录,需使用log4j-web.jar --> <Property name="log_path">F:\Eclipse\workspaces\workspace pers\web\web-pc/logs</Property> <!-- 本地开发使用绝对路径定义日志 --> <!-- <Property name="log_path">${web:rootDir}\logs</Property> --> <Property name="log_pattern">[%-5p] &lt;%d{yyyy-MM-dd HH:mm:ss,sss}&gt; at [%C.%M] |--- %m ---| click goto-&gt; (%F:%L)%n</Property><!-- 定义统一的日志输出格式 --> <!-- 高亮控制台输出 --> <Property name="log_pattern_highlight">%highlight{${log_pattern}}{FATAL=Bright Red, ERROR=Magenta, WARN=Cyan, INFO=Green, DEBUG=Yellow, TRACE=Bright Blue}</Property> </Properties> <appenders> <!-- 控制台输出 --> <Console name="console_out_appender" target="SYSTEM_OUT"> <!-- level定义级别 --> <ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${log_pattern_highlight}"/> </Console> <!--这个输出控制台的配置,这里输出warn和error级别的信息到System.err,在eclipse控制台上看到的是红色文字 --> <!-- <Console name="console_err_appender" target="SYSTEM_ERR"> 控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch) <ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY" /> 输出日志的格式 <PatternLayout pattern="${log_pattern}" /> </Console> --> <!-- TRACE级别日志 --> <!-- 设置日志格式并配置日志压缩格式,压缩文件独立放在一个文件夹内, 日期格式不能为冒号,否则无法生成,因为文件名不允许有冒号,此appender只输出trace级别的数据到trace.log --> <RollingRandomAccessFile fileName="${log_path}/trace.log" filePattern="${log_path}/trace/trace - %d{yyyy-MM-dd HH-mm-ss}.log.gz" immediateFlush="true" name="trace_appender"> <PatternLayout> <pattern>${log_pattern}</pattern> </PatternLayout> <Policies> <!-- 每个日志文件最大2MB --> <SizeBasedTriggeringPolicy size="2MB"/> </Policies> <Filters><!-- 此Filter意思是,只输出debug级别的数据 --> <!-- DENY,日志将立即被抛弃不再经过其他过滤器; NEUTRAL,有序列表里的下个过滤器过接着处理日志; ACCEPT,日志会被立即处理,不再经过剩余过滤器。 --> <ThresholdFilter level="debug" onMatch="DENY" onMismatch="NEUTRAL"/> <ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> </RollingRandomAccessFile> <!-- DEBUG级别日志 --> <!-- 设置日志格式并配置日志压缩格式,压缩文件独立放在一个文件夹内, 日期格式不能为冒号,否则无法生成,因为文件名不允许有冒号,此appender只输出debug级别的数据到debug.log --> <RollingRandomAccessFile fileName="${log_path}/debug.log" filePattern="${log_path}/debug/debug - %d{yyyy-MM-dd HH-mm-ss}.log.gz" immediateFlush="true" name="debug_appender"> <PatternLayout> <pattern>${log_pattern}</pattern> </PatternLayout> <Policies> <!-- 每个日志文件最大2MB --> <SizeBasedTriggeringPolicy size="2MB"/> </Policies> <Filters><!-- 此Filter意思是,只输出debug级别的数据 --> <!-- DENY,日志将立即被抛弃不再经过其他过滤器; NEUTRAL,有序列表里的下个过滤器过接着处理日志; ACCEPT,日志会被立即处理,不再经过剩余过滤器。 --> <ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/> <ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> </RollingRandomAccessFile> <!-- INFO级别日志 --> <RollingRandomAccessFile fileName="${log_path}/info.log" filePattern="${log_path}/info/info - %d{yyyy-MM-dd HH-mm-ss}.log.gz" immediateFlush="true" name="info_appender"> <PatternLayout> <pattern>${log_pattern}</pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="2MB"/> </Policies> <Filters> <ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/> <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> </RollingRandomAccessFile> <!-- WARN级别日志 --> <RollingRandomAccessFile fileName="${log_path}/warn.log" filePattern="${log_path}/warn/warn - %d{yyyy-MM-dd HH-mm-ss}.log.gz" immediateFlush="true" name="warn_appender"> <PatternLayout> <pattern>${log_pattern}</pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="2MB"/> </Policies> <Filters> <ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/> <ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> </RollingRandomAccessFile> <!-- ERROR级别日志 --> <RollingRandomAccessFile fileName="${log_path}/error.log" filePattern="${log_path}/error/error - %d{yyyy-MM-dd HH-mm-ss}.log.gz" immediateFlush="true" name="error_appender"> <PatternLayout> <pattern>${log_pattern}</pattern> </PatternLayout> <Policies> <SizeBasedTriggeringPolicy size="2MB"/> </Policies> <Filters> <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> </RollingRandomAccessFile> </appenders> <Loggers> <!-- 配置日志的根节点 --> <root level="trace"> <appender-ref ref="console_out_appender"/> <!-- <appender-ref ref="console_err_appender" /> --> <appender-ref ref="trace_appender"/> <appender-ref ref="debug_appender"/> <appender-ref ref="info_appender"/> <appender-ref ref="warn_appender"/> <appender-ref ref="error_appender"/> </root> <!-- 过滤第三方日志系统 --> <!-- <logger level="info" name="org.springframework.core"/> <logger level="info" name="org.springframework.beans"/> <logger level="info" name="org.springframework.context"/> <logger level="info" name="org.springframework.web"/> <logger level="warn" name="org.jboss.netty"/> <logger level="warn" name="org.apache.http"/> --> </Loggers> </Configuration>
Humsen/web/web-pc/config/log4j2.xml/0
{ "file_path": "Humsen/web/web-pc/config/log4j2.xml", "repo_id": "Humsen", "token_count": 3385 }
58
import setuptools with open('VERSION.txt', 'r') as f: version = f.read().strip() setuptools.setup( name="odoo-addons-oca-web", description="Meta package for oca-web Odoo addons", version=version, install_requires=[ 'odoo-addon-web_action_conditionable>=16.0dev,<16.1dev', 'odoo-addon-web_advanced_search>=16.0dev,<16.1dev', 'odoo-addon-web_apply_field_style>=16.0dev,<16.1dev', 'odoo-addon-web_calendar_slot_duration>=16.0dev,<16.1dev', 'odoo-addon-web_chatter_position>=16.0dev,<16.1dev', 'odoo-addon-web_company_color>=16.0dev,<16.1dev', 'odoo-addon-web_copy_confirm>=16.0dev,<16.1dev', 'odoo-addon-web_dark_mode>=16.0dev,<16.1dev', 'odoo-addon-web_dashboard_tile>=16.0dev,<16.1dev', 'odoo-addon-web_dialog_size>=16.0dev,<16.1dev', 'odoo-addon-web_disable_export_group>=16.0dev,<16.1dev', 'odoo-addon-web_domain_field>=16.0dev,<16.1dev', 'odoo-addon-web_environment_ribbon>=16.0dev,<16.1dev', 'odoo-addon-web_field_numeric_formatting>=16.0dev,<16.1dev', 'odoo-addon-web_group_expand>=16.0dev,<16.1dev', 'odoo-addon-web_help>=16.0dev,<16.1dev', 'odoo-addon-web_hide_field_with_key>=16.0dev,<16.1dev', 'odoo-addon-web_ir_actions_act_multi>=16.0dev,<16.1dev', 'odoo-addon-web_ir_actions_act_window_message>=16.0dev,<16.1dev', 'odoo-addon-web_ir_actions_act_window_page>=16.0dev,<16.1dev', 'odoo-addon-web_listview_range_select>=16.0dev,<16.1dev', 'odoo-addon-web_m2x_options>=16.0dev,<16.1dev', 'odoo-addon-web_no_bubble>=16.0dev,<16.1dev', 'odoo-addon-web_notify>=16.0dev,<16.1dev', 'odoo-addon-web_notify_channel_message>=16.0dev,<16.1dev', 'odoo-addon-web_pivot_computed_measure>=16.0dev,<16.1dev', 'odoo-addon-web_pwa_oca>=16.0dev,<16.1dev', 'odoo-addon-web_refresher>=16.0dev,<16.1dev', 'odoo-addon-web_remember_tree_column_width>=16.0dev,<16.1dev', 'odoo-addon-web_responsive>=16.0dev,<16.1dev', 'odoo-addon-web_save_discard_button>=16.0dev,<16.1dev', 'odoo-addon-web_search_with_and>=16.0dev,<16.1dev', 'odoo-addon-web_select_all_companies>=16.0dev,<16.1dev', 'odoo-addon-web_send_message_popup>=16.0dev,<16.1dev', 'odoo-addon-web_sheet_full_width>=16.0dev,<16.1dev', 'odoo-addon-web_theme_classic>=16.0dev,<16.1dev', 'odoo-addon-web_timeline>=16.0dev,<16.1dev', 'odoo-addon-web_touchscreen>=16.0dev,<16.1dev', 'odoo-addon-web_tree_duplicate>=16.0dev,<16.1dev', 'odoo-addon-web_tree_many2one_clickable>=16.0dev,<16.1dev', 'odoo-addon-web_widget_bokeh_chart>=16.0dev,<16.1dev', 'odoo-addon-web_widget_datepicker_fulloptions>=16.0dev,<16.1dev', 'odoo-addon-web_widget_domain_editor_dialog>=16.0dev,<16.1dev', 'odoo-addon-web_widget_dropdown_dynamic>=16.0dev,<16.1dev', 'odoo-addon-web_widget_image_webcam>=16.0dev,<16.1dev', 'odoo-addon-web_widget_mpld3_chart>=16.0dev,<16.1dev', 'odoo-addon-web_widget_numeric_step>=16.0dev,<16.1dev', 'odoo-addon-web_widget_open_tab>=16.0dev,<16.1dev', 'odoo-addon-web_widget_plotly_chart>=16.0dev,<16.1dev', 'odoo-addon-web_widget_x2many_2d_matrix>=16.0dev,<16.1dev', ], classifiers=[ 'Programming Language :: Python', 'Framework :: Odoo', 'Framework :: Odoo :: 16.0', ] )
OCA/web/setup/_metapackage/setup.py/0
{ "file_path": "OCA/web/setup/_metapackage/setup.py", "repo_id": "OCA", "token_count": 1869 }
59
Add support for conditions on create and delete actions on One2Many fields.
OCA/web/web_action_conditionable/readme/DESCRIPTION.rst/0
{ "file_path": "OCA/web/web_action_conditionable/readme/DESCRIPTION.rst", "repo_id": "OCA", "token_count": 16 }
60
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_advanced_search # msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2022-08-11 13:07+0000\n" "Last-Translator: Jacek Michalski <michalski.jck@gmail.com>\n" "Language-Team: none\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 4.3.2\n" #. module: web_advanced_search #. odoo-javascript #: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 #, python-format msgid " and " msgstr " oraz " #. module: web_advanced_search #. odoo-javascript #: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 #, python-format msgid " is not " msgstr " nie jest " #. module: web_advanced_search #. odoo-javascript #: code:addons/web_advanced_search/static/src/js/utils.esm.js:0 #, python-format msgid " or " msgstr " lub " #. module: web_advanced_search #. odoo-javascript #: code:addons/web_advanced_search/static/src/search/filter_menu/advanced_filter_item.xml:0 #, python-format msgid "Add Advanced Filter" msgstr "Dodaj Filtr Zaawansowany"
OCA/web/web_advanced_search/i18n/pl.po/0
{ "file_path": "OCA/web/web_advanced_search/i18n/pl.po", "repo_id": "OCA", "token_count": 545 }
61
/** @odoo-module **/ import Domain from "web.Domain"; import DomainSelectorDialog from "web.DomainSelectorDialog"; import config from "web.config"; import {getHumanDomain} from "../../../js/utils.esm"; import {standaloneAdapter} from "web.OwlCompatibility"; import {useModel} from "web.Model"; const {Component, useRef} = owl; class AdvancedFilterItem extends Component { setup() { this.itemRef = useRef("dropdown-item"); this.model = useModel("searchModel"); } /** * Prevent propagation of dropdown-item-selected event, so that it * doesn't reach the FilterMenu onFilterSelected event handler. */ mounted() { $(this.itemRef.el).on("dropdown-item-selected", (event) => event.stopPropagation() ); } /** * Open advanced search dialog * * @returns {DomainSelectorDialog} The opened dialog itself. */ onClick() { const adapterParent = standaloneAdapter({Component}); const dialog = new DomainSelectorDialog( adapterParent, this.model.config.modelName, "[]", { debugMode: config.isDebug(), readonly: false, } ); // Add 1st domain node by default dialog.opened(() => dialog.domainSelector._onAddFirstButtonClick()); // Configure handler dialog.on("domain_selected", this, function (e) { const preFilter = { description: getHumanDomain(dialog.domainSelector), domain: Domain.prototype.arrayToString(e.data.domain), type: "filter", }; this.model.dispatch("createNewFilters", [preFilter]); }); return dialog.open(); } } AdvancedFilterItem.components = {AdvancedFilterItem}; AdvancedFilterItem.template = "web_advanced_search.AdvancedFilterItem"; export default AdvancedFilterItem;
OCA/web/web_advanced_search/static/src/legacy/js/control_panel/advanced_filter_item.esm.js/0
{ "file_path": "OCA/web/web_advanced_search/static/src/legacy/js/control_panel/advanced_filter_item.esm.js", "repo_id": "OCA", "token_count": 786 }
62
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_chatter_position # msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2023-07-20 10:15+0000\n" "Last-Translator: kikopeiro <francisco.peiro@factorlibre.com>\n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.17\n" #. module: web_chatter_position #: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__bottom msgid "Bottom" msgstr "Abajo" #. module: web_chatter_position #: model:ir.model.fields,field_description:web_chatter_position.field_res_users__chatter_position msgid "Chatter Position" msgstr "Posición del historial de comunicación" #. module: web_chatter_position #: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__auto msgid "Responsive" msgstr "Adaptativo" #. module: web_chatter_position #: model:ir.model.fields.selection,name:web_chatter_position.selection__res_users__chatter_position__sided msgid "Sided" msgstr "Lateral" #. module: web_chatter_position #: model:ir.model,name:web_chatter_position.model_res_users msgid "User" msgstr "Usuario"
OCA/web/web_chatter_position/i18n/es.po/0
{ "file_path": "OCA/web/web_chatter_position/i18n/es.po", "repo_id": "OCA", "token_count": 524 }
63
<?xml version="1.0" encoding="utf-8" ?> <odoo> <record id="view_users_form_simple_modif" model="ir.ui.view"> <field name="model">res.users</field> <field name="inherit_id" ref="base.view_users_form_simple_modif" /> <field name="arch" type="xml"> <field name="email" position="after"> <field name="chatter_position" widget="radio" /> </field> </field> </record> </odoo>
OCA/web/web_chatter_position/views/res_users.xml/0
{ "file_path": "OCA/web/web_chatter_position/views/res_users.xml", "repo_id": "OCA", "token_count": 211 }
64
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import assetsbundle from . import res_company from . import ir_qweb
OCA/web/web_company_color/models/__init__.py/0
{ "file_path": "OCA/web/web_company_color/models/__init__.py", "repo_id": "OCA", "token_count": 49 }
65
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_dark_mode # msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2023-01-01 21:45+0000\n" "Last-Translator: Ignacio Buioli <ibuioli@gmail.com>\n" "Language-Team: none\n" "Language: es_AR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.14.1\n" #. module: web_dark_mode #. odoo-javascript #: code:addons/web_dark_mode/static/src/js/switch_item.esm.js:0 #: model:ir.model.fields,field_description:web_dark_mode.field_res_users__dark_mode #, python-format msgid "Dark Mode" msgstr "Modo Oscuro" #. module: web_dark_mode #: model:ir.model.fields,field_description:web_dark_mode.field_res_users__dark_mode_device_dependent msgid "Device Dependent Dark Mode" msgstr "Dispositivo que Depende del Modo Oscuro" #. module: web_dark_mode #: model:ir.model,name:web_dark_mode.model_ir_http msgid "HTTP Routing" msgstr "Ruteo HTTP" #. module: web_dark_mode #: model:ir.model,name:web_dark_mode.model_res_users msgid "User" msgstr "Usuario"
OCA/web/web_dark_mode/i18n/es_AR.po/0
{ "file_path": "OCA/web/web_dark_mode/i18n/es_AR.po", "repo_id": "OCA", "token_count": 492 }
66
$o-webclient-color-scheme: dark; $o-white: #000000; $o-black: #ffffff; $o-gray-100: #191c24; $o-gray-200: #242733; $o-gray-300: #3f4149; $o-gray-400: #5f6167; $o-gray-500: #797a80; $o-gray-600: #94959a; $o-gray-700: #b0b0b4; $o-gray-800: #cccccf; $o-gray-900: #e9e9eb; $o-community-color: $o-gray-400; $o-enterprise-color: $o-gray-400; $o-enterprise-primary-color: $o-gray-500; $o-brand-primary: $o-gray-600; $o-brand-secondary: $o-gray-700; $o-success: #28a745; $o-info: #74dcf3; $o-warning: #ff7b00; $o-danger: #ff0020; $primary: $o-gray-800; $o-main-bg-color: #f0eeee; $o-main-favorite-color: #f3cc00; $o-main-code-color: #d2317b; $o-view-background-color: $o-white; $o-view-background-color: $o-gray-100; $o-shadow-color: #c0c0c0; $o-form-lightsecondary: #ccc; $o-list-footer-bg-color: #eee; $o-tooltip-arrow-color: white; // Layout $o-dropdown-box-shadow: 0 1rem 1.1rem rgba(#fff, 0.1); // == List group $o-list-group-active-bg: lighten(saturate(adjust-hue($o-info, 15), 1.8), 5); $o-list-footer-bg-color: $o-gray-200; // == Badges // Define a minimum width. This value is arbitrary and strictly font-related. $o-datepicker-week-color: #8f8f8f; $component-active-bg: red; $o-webclient-background-color: $o-gray-300; .o-settings-form-view .o_base_settings { --settings__tab-bg: #{$o-gray-100}; --settings__tab-bg--active: #{$o-gray-300}; --settings__tab-color: #{$o-gray-700}; --settings__title-bg: #{$o-gray-100}; }
OCA/web/web_dark_mode/static/src/scss/variables.scss/0
{ "file_path": "OCA/web/web_dark_mode/static/src/scss/variables.scss", "repo_id": "OCA", "token_count": 712 }
67
* Markus Schneider <markus.schneider at initos.com> * Sylvain Le Gal (https://twitter.com/legalsylvain) * Iván Todorovich <ivan.todorovich@gmail.com>
OCA/web/web_dashboard_tile/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_dashboard_tile/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 54 }
68
<?xml version="1.0" encoding="utf-8" ?> <odoo> <menuitem id="menu_tile_configuration" name="Overview Settings" parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_configuration" sequence="160" /> </odoo>
OCA/web/web_dashboard_tile/views/menu.xml/0
{ "file_path": "OCA/web/web_dashboard_tile/views/menu.xml", "repo_id": "OCA", "token_count": 110 }
69
* Anthony Muschang <anthony.muschang@acsone.eu> * Stéphane Bidoul <stephane.bidoul@acsone.eu> * Holger Brunn <hbrunn@therp.nl> * Siddharth Bhalgami <siddharth.bhalgami@gmail.com> * Wolfgang Pichler <wpichler@callino.at> * David Vidal <david.vidal@tecnativa.com> * Quentin Theuret <quentin.theuret@amaris.com> * `Tecnativa <https://www.tecnativa.com>`_: * Pedro M. Baeza * Jairo Llopis * Ernesto Tejeda * Sudhir Arya <sudhir@erpharbor.com> * Pierre Pizzetta <pierre@devreaction.com> * Mantas Šniukas <mantas@vialaurea.lt>
OCA/web/web_dialog_size/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_dialog_size/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 238 }
70
# Copyright 2016 Onestein (<http://www.onestein.eu>) # Copyright 2018 Tecnativa - David Vidal # Copyright 2018 Tecnativa - João Marques # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Web Disable Export Group", "version": "16.0.1.0.0", "license": "AGPL-3", "author": "Onestein, Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "category": "Web", "depends": ["web"], "data": [ "security/groups.xml", "security/ir.model.access.csv", ], "installable": True, "assets": { "web.assets_backend": [ "/web_disable_export_group/static/src/**/*", ], "web.assets_tests": ["/web_disable_export_group/static/tests/*.js"], }, }
OCA/web/web_disable_export_group/__manifest__.py/0
{ "file_path": "OCA/web/web_disable_export_group/__manifest__.py", "repo_id": "OCA", "token_count": 337 }
71
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_environment_ribbon # msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-05-17 20:47+0000\n" "Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" #. module: web_environment_ribbon #: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend msgid "Web Environment Ribbon Backend" msgstr "Web Environment Ribbon Backend" #~ msgid "Display Name" #~ msgstr "Weergavenaam" #~ msgid "ID" #~ msgstr "ID" #~ msgid "Last Modified on" #~ msgstr "Laatst Gewijzigd op"
OCA/web/web_environment_ribbon/i18n/nl.po/0
{ "file_path": "OCA/web/web_environment_ribbon/i18n/nl.po", "repo_id": "OCA", "token_count": 371 }
72
/* @odoo-module */ import {ListRenderer} from "@web/views/list/list_renderer"; import {patch} from "@web/core/utils/patch"; patch(ListRenderer.prototype, "web_field_numeric_formatting.ListRenderer", { getFormattedValue(column, record) { if (column.options.enable_formatting === false) { return record.data[column.name]; } return this._super(...arguments); }, });
OCA/web/web_field_numeric_formatting/static/src/components/list_renderer.esm.js/0
{ "file_path": "OCA/web/web_field_numeric_formatting/static/src/components/list_renderer.esm.js", "repo_id": "OCA", "token_count": 163 }
73
/** @odoo-module */ import {patch} from "@web/core/utils/patch"; import {ListController} from "@web/views/list/list_controller"; patch(ListController.prototype, "web_group_expand.ListController", { async expandAllGroups() { // We expand layer by layer. So first we need to find the highest // layer that's not already fully expanded. let layer = this.model.root.groups; while (layer.length) { const closed = layer.filter(function (group) { return group.isFolded; }); if (closed.length) { // This layer is not completely expanded, expand it await layer.forEach((group) => { group.isFolded = false; }); break; } // This layer is completely expanded, move to the next layer = _.flatten( layer.map(function (group) { return group.list.groups || []; }), true ); } await this.model.root.load(); this.model.notify(); }, async collapseAllGroups() { // We collapse layer by layer. So first we need to find the deepest // layer that's not already fully collapsed. let layer = this.model.root.groups; while (layer.length) { const next = _.flatten( layer.map(function (group) { return group.list.groups || []; }), true ).filter(function (group) { return !group.isFolded; }); if (!next.length) { // Next layer is fully collapsed, so collapse this one await layer.forEach((group) => { group.isFolded = true; }); break; } layer = next; } await this.model.root.load(); this.model.notify(); }, });
OCA/web/web_group_expand/static/src/js/list_controller.esm.js/0
{ "file_path": "OCA/web/web_group_expand/static/src/js/list_controller.esm.js", "repo_id": "OCA", "token_count": 1006 }
74
* Francois Poizat <francois.poizat@gmail.com>
OCA/web/web_hide_field_with_key/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_hide_field_with_key/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 20 }
75
This module provides a way to trigger more than one action on ActionManager
OCA/web/web_ir_actions_act_multi/readme/DESCRIPTION.rst/0
{ "file_path": "OCA/web/web_ir_actions_act_multi/readme/DESCRIPTION.rst", "repo_id": "OCA", "token_count": 15 }
76
See the 'Previous Partner' and 'Next Partner' buttons that this module's demo data adds to the partner form view.
OCA/web/web_ir_actions_act_window_page/readme/USAGE.rst/0
{ "file_path": "OCA/web/web_ir_actions_act_window_page/readme/USAGE.rst", "repo_id": "OCA", "token_count": 27 }
77
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_m2x_options # # Translators: # Peter Hageman <hageman.p@gmail.com>, 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-01 03:35+0000\n" "PO-Revision-Date: 2017-07-01 03:35+0000\n" "Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n" "Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" "teams/23907/nl_NL/)\n" "Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid ", are you sure it does not exist yet?" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid "Create" msgstr "Aanmaken" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/relational_utils.esm.js:0 #, python-format msgid "Create \"%s\"" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid "Create and Edit" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/relational_utils.esm.js:0 #, python-format msgid "Create and edit..." msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid "Discard" msgstr "" #. module: web_m2x_options #: model:ir.model,name:web_m2x_options.model_ir_http msgid "HTTP Routing" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/form.esm.js:0 #, python-format msgid "New: %s" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/relational_utils.esm.js:0 #, python-format msgid "No records" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/form.esm.js:0 #, python-format msgid "Open: " msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/relational_utils.esm.js:0 #, python-format msgid "Search More..." msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/relational_utils.esm.js:0 #, python-format msgid "Start typing..." msgstr "" #. module: web_m2x_options #: model:ir.model,name:web_m2x_options.model_ir_config_parameter msgid "System Parameter" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid "You are creating a new" msgstr "" #. module: web_m2x_options #. odoo-javascript #: code:addons/web_m2x_options/static/src/components/base.xml:0 #, python-format msgid "as a new" msgstr "" #, python-format #~ msgid "Cancel" #~ msgstr "Annuleer"
OCA/web/web_m2x_options/i18n/nl_NL.po/0
{ "file_path": "OCA/web/web_m2x_options/i18n/nl_NL.po", "repo_id": "OCA", "token_count": 1293 }
78
<?xml version="1.0" encoding="UTF-8" ?> <!-- Copyright 2017 Jairo Llopis <jairo.llopis@tecnativa.com> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> <templates xml:space="preserve"> <t t-name="web_m2x_options.AutoComplete" t-inherit="web.AutoComplete" t-inherit-mode="extension" owl="1" > <xpath expr="//t[@t-foreach='source.options']/li/a" position="attributes"> <attribute name="t-attf-style">{{ option.style }}</attribute> </xpath> </t> <t t-name="web_m2x_options.Many2ManyTagsField" t-inherit="web.Many2ManyTagsField" t-inherit-mode="extension" owl="1" > <xpath expr="//Many2XAutocomplete" position="attributes"> <attribute name="nodeOptions">props.nodeOptions</attribute> </xpath> </t> <t t-name="web_m2x_options.Many2OneField.CreateConfirmationDialog" owl="1"> <Dialog title="title" size="'md'"> <div> You are creating a new <strong t-esc="props.value" /> as a new <t t-esc="props.name" />, are you sure it does not exist yet? </div> <t t-set-slot="footer"> <button class="btn btn-primary" t-on-click="onCreate">Create</button> <button class="btn btn-primary" t-on-click="onCreateEdit" >Create and Edit</button> <button class="btn" t-on-click="() => props.close()">Discard</button> </t> </Dialog> </t> </templates>
OCA/web/web_m2x_options/static/src/components/base.xml/0
{ "file_path": "OCA/web/web_m2x_options/static/src/components/base.xml", "repo_id": "OCA", "token_count": 831 }
79
from . import res_users
OCA/web/web_notify/models/__init__.py/0
{ "file_path": "OCA/web/web_notify/models/__init__.py", "repo_id": "OCA", "token_count": 7 }
80
from . import models
OCA/web/web_notify_channel_message/__init__.py/0
{ "file_path": "OCA/web/web_notify_channel_message/__init__.py", "repo_id": "OCA", "token_count": 5 }
81
# Copyright 2020 Tecnativa - Alexandre Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) { "name": "Web Pivot Computed Measure", "category": "web", "version": "16.0.1.0.0", "author": "Tecnativa, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/web", "depends": ["web"], "auto_install": False, "installable": True, "maintainers": ["CarlosRoca13"], "assets": { "web.assets_backend": [ "/web_pivot_computed_measure/static/src/**/*.esm.js", "/web_pivot_computed_measure/static/src/**/*.scss", ("remove", "/web_pivot_computed_measure/static/src/test/*.esm.js"), "/web_pivot_computed_measure/static/src/**/*.xml", ], "web.assets_tests": [ "/web_pivot_computed_measure/static/src/test/test.esm.js", ], }, }
OCA/web/web_pivot_computed_measure/__manifest__.py/0
{ "file_path": "OCA/web/web_pivot_computed_measure/__manifest__.py", "repo_id": "OCA", "token_count": 427 }
82
/** @odoo-module **/ /* Copyright 2020 Tecnativa - Alexandre Díaz * Copyright 2022 Tecnativa - Carlos Roca * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) */ import {PivotModel} from "@web/views/pivot/pivot_model"; import {patch} from "@web/core/utils/patch"; import {computeReportMeasures} from "@web/views/utils"; import {evalOperation} from "../helpers/utils.esm"; patch(PivotModel.prototype, "web_pivot_computed_measure.PivotModel", { /** * Add _computed_measures to avoid recompute them until page is recharged * * @override */ setup() { this._super(...arguments); this._computed_measures = []; }, /** * Create a new computed measure * * @param {String} id * @param {String} field1 * @param {String} field2 * @param {String} operation * @param {String} name * @param {String} format * @returns a promise */ addComputedMeasure(id, field1, field2, operation, name, format) { const measure = _.find(this._computed_measures, (item) => { return ( item.field1 === field1 && item.field2 === field2 && item.operation === operation ); }); if (measure) { return Promise.resolve(); } const fieldM1 = this.metaData.fields[field1]; const fieldM2 = this.metaData.fields[field2]; const cmId = "__computed_" + id; const oper = operation.replace(/m1/g, field1).replace(/m2/g, field2); const oper_human = operation .replace( /m1/g, fieldM1.__computed_id ? "(" + fieldM1.string + ")" : fieldM1.string ) .replace( /m2/g, fieldM2.__computed_id ? "(" + fieldM2.string + ")" : fieldM2.string ); const cmTotal = this._computed_measures.push({ field1: field1, field2: field2, operation: oper, name: name || oper_human, id: cmId, format: format, }); return this._createVirtualMeasure(this._computed_measures[cmTotal - 1]); }, /** * Create and enable a measure based on a 'fake' field * * @private * @param {Object} cmDef * @param {List} fields *Optional* * @returns a promise */ _createVirtualMeasure(cmDef, fields) { this._createVirtualField(cmDef, fields); // Activate computed field return this.toggleMeasure(cmDef.id); }, _createVirtualField(cmDef, fields, config) { const arrFields = fields || this.metaData.fields; // This is a minimal 'fake' field info arrFields[cmDef.id] = { // Used to format the value type: cmDef.format, // Used to print the header name string: cmDef.name, // Referenced on payload prop at DropdownItem, used to interact with // created measures name: cmDef.id, // Used to know if is a computed measure field __computed_id: cmDef.id, // Operator used for group the measure added. group_operator: "sum", }; const metaData = (config && config.metaData) || this.metaData; metaData.measures[cmDef.id] = arrFields[cmDef.id]; }, /** * Active the measures related to the 'fake' field * * @private * @param {List of Strings} fields */ async _activeMeasures(fields) { let needLoad = false; for (const field of fields) { if (await !this._isMeasureEnabled(field)) { this.metaData.activeMeasures.push(field); needLoad = true; } } if (needLoad) { const config = {metaData: this.metaData, data: this.data}; return this._loadData(config).then(() => { // Notify changes to renderer for show it on the pivot view this.notify(); }); } return Promise.resolve(); }, /** * Check if the measure is enabled * * @private * @param {String} field */ _isMeasureEnabled(field, config) { const activeMeasures = (config && config.metaData.activeMeasures) || this.metaData.activeMeasures || []; return _.contains(activeMeasures, field); }, /** * Helper function to add computed measure fields data into a 'subGroupData' * * @private * @param {Object} subGroupData */ _fillComputedMeasuresData(subGroupData, config) { for (const cm of this._computed_measures) { if (!this._isMeasureEnabled(cm.id, config)) continue; if (subGroupData.__count === 0) { subGroupData[cm.id] = false; } else { // eslint-disable-next-line no-undef subGroupData[cm.id] = evalOperation(cm.operation, subGroupData); } } }, /** * Fill the groupSubdivisions with the computed measures and their values * * @override */ _prepareData(group, groupSubdivisions, config) { for (const groupSubdivision of groupSubdivisions) { for (const subGroup of groupSubdivision.subGroups) { this._fillComputedMeasuresData(subGroup, config); } } this._super(...arguments); }, /** * _getGroupSubdivision method invokes the read_group method of the * model via rpc and the passed 'fields' argument is the list of * measure names that is in this.metaData.activeMeasures, so we remove the * computed measures form this.metaData.activeMeasures before calling _super * to prevent any possible exception. * * @override */ _getGroupSubdivision(group, rowGroupBy, colGroupBy, config) { const computed_measures = []; for (let i = 0; i < config.metaData.activeMeasures.length; i++) if (config.metaData.activeMeasures[i].startsWith("__computed_")) { computed_measures.push(config.metaData.activeMeasures[i]); config.metaData.activeMeasures.splice(i, 1); i--; } const res = this._super(...arguments); $.merge(config.metaData.activeMeasures, computed_measures); return res; }, /** * Adds a rule to deny that measures can be disabled if are being used by a computed measure. * In the other hand, when enables a measure analyzes it to active all involved measures. * * @override */ toggleMeasure(fieldName) { if (this._isMeasureEnabled(fieldName)) { // Mesaure is enabled const umeasures = _.filter(this._computed_measures, (item) => { return item.field1 === fieldName || item.field2 === fieldName; }); if (umeasures.length && this._isMeasureEnabled(umeasures[0].id)) { return Promise.reject( this.env._t( "This measure is currently used by a 'computed measure'. Please, disable the computed measure first." ) ); } } else { // Measure is disabled const toEnable = []; const toAnalyze = [fieldName]; while (toAnalyze.length) { // Analyze all items involved on computed measures to enable them const afield = toAnalyze.shift(); const fieldDef = this.metaData.fields[afield]; // Need to check if fieldDef exists to avoid problems with __count if (fieldDef && fieldDef.__computed_id) { const cm = _.find(this._computed_measures, { id: fieldDef.__computed_id, }); toAnalyze.push(cm.field1, cm.field2); const toEnableFields = []; if (!this.metaData.fields[cm.field1].__computed_id) { toEnableFields.push(cm.field1); } if (!this.metaData.fields[cm.field2].__computed_id) { toEnableFields.push(cm.field2); } toEnableFields.push(afield); toEnable.push(toEnableFields); } } if (toEnable.length) { this._activeMeasures( // Transform the array of arrays to a simple array. // [1, [2, 3]] => [1, 2, 3] _.flatten(toEnable.reverse()) ); } } return this._super(...arguments); }, /** * Load the measures added to selected favorite filters * * @override */ async load(searchParams) { var _super = this._super.bind(this); var config = {metaData: this.metaData, data: this.data}; if (!this.metaData.measures) { const metaData = this._buildMetaData(); metaData.measures = computeReportMeasures( metaData.fields, metaData.fieldAttrs, metaData.activeMeasures, metaData.additionalMeasures ); config = {metaData, data: this.data}; } if ("context" in searchParams) { this._computed_measures = searchParams.context.pivot_computed_measures || searchParams.computed_measures || []; } for (const cmDef of this._computed_measures) { if (this._isMeasureEnabled(cmDef.id, config)) { continue; } await this._createVirtualField(cmDef, undefined, config); } const fieldNames = Object.keys(this.metaData.fields); for (const fieldName of fieldNames) { const field = this.metaData.fields[fieldName]; if (field.__computed_id) { const cm = _.find(this._computed_measures, { id: field.__computed_id, }); if (!cm) { delete this.metaData.fields[fieldName]; delete this.metaData.measures[fieldName]; this.metaData.activeMeasures = _.without( this.metaData.activeMeasures, fieldName ); } } } return _super(...arguments); }, });
OCA/web/web_pivot_computed_measure/static/src/pivot/pivot_model.esm.js/0
{ "file_path": "OCA/web/web_pivot_computed_measure/static/src/pivot/pivot_model.esm.js", "repo_id": "OCA", "token_count": 5129 }
83
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_pwa_oca # msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2024-02-27 14:36+0000\n" "Last-Translator: mymage <stefano.consolaro@mymage.it>\n" "Language-Team: none\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.17\n" #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "<span class=\"fa fa-lg fa-globe\" title=\"Icon next to name\"/>" msgstr "<span class=\"fa fa-lg fa-globe\" title=\"Icona vicino al nome\"/>" #. module: web_pwa_oca #: model:ir.model.fields,field_description:web_pwa_oca.field_res_config_settings__pwa_background_color msgid "Background Color" msgstr "Colore sfondo" #. module: web_pwa_oca #: model:ir.model,name:web_pwa_oca.model_res_config_settings msgid "Config Settings" msgstr "Impostazioni configurazione" #. module: web_pwa_oca #: model:ir.model.fields,field_description:web_pwa_oca.field_res_config_settings__pwa_icon msgid "Icon" msgstr "Icona" #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "Name" msgstr "Nome" #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "Name and icon of your PWA" msgstr "Nome è icona per la tua PWA" #. module: web_pwa_oca #: model:ir.model.fields,help:web_pwa_oca.field_res_config_settings__pwa_name msgid "Name of the Progressive Web Application" msgstr "Nome della Progressive Web Application" #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "PWA Title" msgstr "Titolo PWA" #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "Progressive Web App" msgstr "Progressive Web App" #. module: web_pwa_oca #: model:ir.model.fields,field_description:web_pwa_oca.field_res_config_settings__pwa_name msgid "Progressive Web App Name" msgstr "Nome Progressive Web App" #. module: web_pwa_oca #: model:ir.model.fields,field_description:web_pwa_oca.field_res_config_settings__pwa_short_name msgid "Progressive Web App Short Name" msgstr "Nome brave Progressive Web App" #. module: web_pwa_oca #. odoo-javascript #: code:addons/web_pwa_oca/static/src/js/pwa_manager.js:0 #, python-format msgid "" "Service workers are not supported! Maybe you are not using HTTPS or you work" " in private mode." msgstr "" "I servizi worker non sono supportati! Forse non si sta usando HTTPS o si " "lavora in modalità privata." #. module: web_pwa_oca #: model_terms:ir.ui.view,arch_db:web_pwa_oca.res_config_settings_view_form msgid "Short Name" msgstr "Nome corto" #. module: web_pwa_oca #: model:ir.model.fields,help:web_pwa_oca.field_res_config_settings__pwa_short_name msgid "Short Name of the Progressive Web Application" msgstr "Nome breve della Progressive Web Application" #. module: web_pwa_oca #: model:ir.model.fields,field_description:web_pwa_oca.field_res_config_settings__pwa_theme_color msgid "Theme Color" msgstr "Colore tema" #. module: web_pwa_oca #. odoo-python #: code:addons/web_pwa_oca/models/res_config_settings.py:0 #, python-format msgid "You can only upload PNG files bigger than 512x512" msgstr "Si possono caricare solo file PNG maggiori di 512x512" #. module: web_pwa_oca #. odoo-python #: code:addons/web_pwa_oca/models/res_config_settings.py:0 #, python-format msgid "You can only upload SVG or PNG files. Found: %s." msgstr "Si possono caricare solo file SVG o PNG. trovato %s." #. module: web_pwa_oca #. odoo-python #: code:addons/web_pwa_oca/models/res_config_settings.py:0 #, python-format msgid "You can't upload a file with more than 2 MB." msgstr "Non si può caricare un file superiore a 2MB." #. module: web_pwa_oca #. odoo-javascript #: code:addons/web_pwa_oca/static/src/js/pwa_manager.js:0 #, python-format msgid "[ServiceWorker] Registered:" msgstr "[ServiceWorker] registrato:" #. module: web_pwa_oca #. odoo-javascript #: code:addons/web_pwa_oca/static/src/js/pwa_manager.js:0 #, python-format msgid "[ServiceWorker] Registration failed: " msgstr "[ServiceWorker] Registrazione fallita: "
OCA/web/web_pwa_oca/i18n/it.po/0
{ "file_path": "OCA/web/web_pwa_oca/i18n/it.po", "repo_id": "OCA", "token_count": 1703 }
84
#. module: web_refresher #. odoo-javascript #: code:addons/web_refresher/static/src/xml/refresher.xml:0 #, python-format msgid "Pager" msgstr "" #. module: web_refresher #. odoo-javascript #: code:addons/web_refresher/static/src/xml/refresher.xml:0 #, python-format msgid "Refresh" msgstr ""
OCA/web/web_refresher/i18n/ca.po/0
{ "file_path": "OCA/web/web_refresher/i18n/ca.po", "repo_id": "OCA", "token_count": 121 }
85
<?xml version="1.0" encoding="UTF-8" ?> <!-- Copyright 2024 Tecnativa - Carlos Roca License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> <template> <t t-name="web_refresher.ControlPanel.Regular" t-inherit="web.ControlPanel.Regular" t-inherit-mode="extension" owl="1" > <xpath expr="//div[hasclass('o_cp_bottom_right')]" position="after"> <div t-if="!display['bottom-right']" class="o_cp_bottom_right oe_cp_refresher" role="search" t-ref="refresher" > <Refresher /> </div> </xpath> </t> <t t-name="web_refresher.ControlPanel.Small" t-inherit="web.ControlPanel.Small" t-inherit-mode="extension" owl="1" > <xpath expr="//div[hasclass('o_cp_pager')]" position="after"> <div t-if="!display['bottom-right']" class="o_cp_bottom_right oe_cp_refresher" role="search" t-ref="refresher" > <Refresher /> </div> </xpath> </t> </template>
OCA/web/web_refresher/static/src/xml/control_panel.xml/0
{ "file_path": "OCA/web/web_refresher/static/src/xml/control_panel.xml", "repo_id": "OCA", "token_count": 678 }
86
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_responsive # msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2023-03-07 08:01+0000\n" "Last-Translator: Ediz Duman <neps1192@gmail.com>\n" "Language-Team: none\n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.14.1\n" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0 #, python-format msgid "Activities" msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/search_panel/search_panel.xml:0 #, python-format msgid "All" msgstr "Hepsi" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0 #, python-format msgid "Attachment counter loading..." msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0 #, python-format msgid "Attachments" msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0 #, python-format msgid "CLEAR" msgstr "TEMİZLEME" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0 #, python-format msgid "Discard" msgstr "Vazgeç" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0 #: code:addons/web_responsive/static/src/components/search_panel/search_panel.xml:0 #, python-format msgid "FILTER" msgstr "FİLTRE" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/apps_menu/apps_menu.xml:0 #, python-format msgid "Home Menu" msgstr "Ana Menü" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0 #, python-format msgid "Log note" msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml:0 #, python-format msgid "Maximize" msgstr "Büyütme" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml:0 #, python-format msgid "Minimize" msgstr "Küçültme" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0 #, python-format msgid "New" msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0 #: code:addons/web_responsive/static/src/components/search_panel/search_panel.xml:0 #, python-format msgid "SEE RESULT" msgstr "SONUCU GÖR" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0 #, python-format msgid "Save" msgstr "Kaydet" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/apps_menu/apps_menu.xml:0 #, python-format msgid "Search menus..." msgstr "Arama menüleri..." #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0 #, python-format msgid "Search..." msgstr "Arama..." #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0 #, python-format msgid "Send message" msgstr "" #. module: web_responsive #. odoo-javascript #: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0 #, python-format msgid "View switcher" msgstr "Görüntü Değiştiriciyi" #, python-format #~ msgid "Create" #~ msgstr "Oluşturma"
OCA/web/web_responsive/i18n/tr.po/0
{ "file_path": "OCA/web/web_responsive/i18n/tr.po", "repo_id": "OCA", "token_count": 1525 }
87
/* Copyright 2021 ITerra - Sergey Shebanin * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ .o_web_client { .o_mobile_search { position: fixed; top: 0; left: 0; bottom: 0; padding: 0; width: 100%; background-color: white; z-index: $zindex-modal; overflow: auto; .o_mobile_search_header { height: 46px; margin-bottom: 10px; width: 100%; background-color: $o-brand-odoo; color: white; span:active { background-color: darken($o-brand-primary, 10%); } span { cursor: pointer; } } .o_searchview_input_container { display: flex; padding: 15px 20px 0 20px; position: relative; .o_searchview_input { width: 100%; margin-bottom: 15px; border-bottom: 1px solid $o-brand-secondary; } .o_searchview_facet { border-radius: 10px; display: inline-flex; order: 1; .o_searchview_facet_label { border-radius: 2em 0em 0em 2em; } } .o_searchview_autocomplete { top: 100%; > li { margin: 5px 0px; } } } .o_mobile_search_filter { padding-bottom: 15%; .o_dropdown { width: 100%; margin: 15px 5px 0px 5px; border: solid 1px darken($gray-200, 20%); } .o_dropdown_toggler_btn { width: 100%; text-align: left; &:after { display: none; } } // We disable the backdrop in this case because it prevents any // interaction outside of a dropdown while it is open. .dropdown-backdrop { z-index: -1; } .dropdown-menu { // Here we use !important because of popper js adding custom style // to element so to override it use !important position: relative !important; width: 100% !important; transform: translate3d(0, 0, 0) !important; box-shadow: none; border: none; color: $gray-600; .divider { margin: 0px; } > li > a { padding: 10px 26px; } } } .o_mobile_search_show_result { padding: 10px; font-size: 15px; } } } // Search panel @include media-breakpoint-down(sm) { .o_controller_with_searchpanel { display: block; .o_search_panel { height: auto; padding: 8px; border-left: 1px solid $gray-300; section { padding: 0px 16px; } } .o_search_panel_summary { cursor: pointer; } } }
OCA/web/web_responsive/static/src/components/search_panel/search_panel.scss/0
{ "file_path": "OCA/web/web_responsive/static/src/components/search_panel/search_panel.scss", "repo_id": "OCA", "token_count": 1927 }
88
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_save_discard_button # msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-18 10:08+0000\n" "PO-Revision-Date: 2023-08-18 10:08+0000\n" "Last-Translator: \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" #. module: web_save_discard_button #. odoo-javascript #: code:addons/web_save_discard_button/static/src/xml/template.xml:0 #, python-format msgid "Discard" msgstr "Ignorer" #. module: web_save_discard_button #: model:ir.model,name:web_save_discard_button.model_ir_http msgid "HTTP Routing" msgstr "Routage HTTP" #. module: web_save_discard_button #. odoo-javascript #: code:addons/web_save_discard_button/static/src/xml/template.xml:0 #, python-format msgid "Save" msgstr "Sauvegarder"
OCA/web/web_save_discard_button/i18n/fr.po/0
{ "file_path": "OCA/web/web_save_discard_button/i18n/fr.po", "repo_id": "OCA", "token_count": 397 }
89
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_select_all_companies # msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" #. module: web_select_all_companies #. odoo-javascript #: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 #, python-format msgid "All Companies" msgstr "" #. module: web_select_all_companies #. odoo-javascript #: code:addons/web_select_all_companies/static/src/xml/switch_all_company_menu.xml:0 #, python-format msgid "Select All Companies" msgstr ""
OCA/web/web_select_all_companies/i18n/web_select_all_companies.pot/0
{ "file_path": "OCA/web/web_select_all_companies/i18n/web_select_all_companies.pot", "repo_id": "OCA", "token_count": 292 }
90
In the email/notes threads below the form views, the link 'Send a message' unfold a text field. From there, a button allows to open the text field in a full featured email popup with the subject, templates, attachments and followers. This module changes the link 'Send a message' so it opens directly the full featured popup instead of the text field, avoiding an extra click if the popup is always wanted.
OCA/web/web_send_message_popup/readme/DESCRIPTION.rst/0
{ "file_path": "OCA/web/web_send_message_popup/readme/DESCRIPTION.rst", "repo_id": "OCA", "token_count": 94 }
91
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_timeline # msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-10-13 20:46+0000\n" "Last-Translator: Corneliuus <cornelius@clk-it.de>\n" "Language-Team: none\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_renderer.js:0 #, python-format msgid "<b>UNASSIGNED</b>" msgstr "<b>NICHT ZUGEWIESEN</b>" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_controller.esm.js:0 #, python-format msgid "Are you sure you want to delete this record?" msgstr "Sind Sie sicher, dass Sie diesen Datensatz löschen wollen?" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/xml/web_timeline.xml:0 #, python-format msgid "Day" msgstr "Tag" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/xml/web_timeline.xml:0 #, python-format msgid "Month" msgstr "Monat" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_renderer.js:0 #, python-format msgid "Template \"timeline-item\" not present in timeline view definition." msgstr "" "Vorlage \"timeline-item\" nicht in der Definition der Zeitachsenansicht " "vorhanden." #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_view.js:0 #: model:ir.model.fields.selection,name:web_timeline.selection__ir_ui_view__type__timeline #, python-format msgid "Timeline" msgstr "Zeitachse" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_renderer.js:0 #, python-format msgid "Timeline view has not defined 'date_start' attribute." msgstr "Die Zeitachsenansicht hat das Attribut \"date_start\" nicht definiert." #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/xml/web_timeline.xml:0 #, python-format msgid "Today" msgstr "Heute" #. module: web_timeline #: model:ir.model,name:web_timeline.model_ir_ui_view msgid "View" msgstr "Ansicht" #. module: web_timeline #: model:ir.model.fields,field_description:web_timeline.field_ir_ui_view__type msgid "View Type" msgstr "Ansichtstyp" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/js/timeline_controller.esm.js:0 #, python-format msgid "Warning" msgstr "Warnung" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/xml/web_timeline.xml:0 #, python-format msgid "Week" msgstr "Woche" #. module: web_timeline #. odoo-javascript #: code:addons/web_timeline/static/src/xml/web_timeline.xml:0 #, python-format msgid "Year" msgstr "Jahr" #~ msgid "Display Name" #~ msgstr "Anzeigename" #~ msgid "ID" #~ msgstr "ID" #~ msgid "Last Modified on" #~ msgstr "Zuletzt bearbeitet am"
OCA/web/web_timeline/i18n/de.po/0
{ "file_path": "OCA/web/web_timeline/i18n/de.po", "repo_id": "OCA", "token_count": 1227 }
92
* Laurent Mignon <laurent.mignon@acsone.eu> * Adrien Peiffer <adrien.peiffer@acsone.eu> * Leonardo Donelli <donelli@webmonks.it> * Adrien Didenot <adrien.didenot@horanet.com> * Thong Nguyen Van <thongnv@trobz.com> * Murtaza Mithaiwala <mmithaiwala@opensourceintegrators.com> * Ammar Officewala <aofficewala@opensourceintegrators.com> * `Tecnativa <https://www.tecnativa.com>`_: * Pedro M. Baeza * Alexandre Díaz * César A. Sánchez * `Onestein <https://www.onestein.nl>`_: * Dennis Sluijk <d.sluijk@onestein.nl> * Anjeel Haria
OCA/web/web_timeline/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_timeline/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 239 }
93
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_tree_duplicate # msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "PO-Revision-Date: 2021-02-17 10:45+0000\n" "Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n" "Language-Team: none\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" #. module: web_tree_duplicate #. odoo-javascript #: code:addons/web_tree_duplicate/static/src/web_tree_duplicate.esm.js:0 #, python-format msgid "Duplicate" msgstr "Duplicar" #. module: web_tree_duplicate #. odoo-javascript #: code:addons/web_tree_duplicate/static/src/web_tree_duplicate.esm.js:0 #, python-format msgid "Duplicated Records" msgstr "Registres duplicats"
OCA/web/web_tree_duplicate/i18n/ca.po/0
{ "file_path": "OCA/web/web_tree_duplicate/i18n/ca.po", "repo_id": "OCA", "token_count": 381 }
94
/** @odoo-module **/ // (c) 2023 Hunki Enterprises BV (<https://hunki-enterprises.com>) // License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) import {Domain} from "@web/core/domain"; import {ListController} from "@web/views/list/list_controller"; import {patch} from "@web/core/utils/patch"; patch(ListController.prototype, "add duplicate action", { getActionMenuItems() { const result = this._super(); if ( this.archInfo.activeActions.create && this.archInfo.activeActions.duplicate ) { result.other.push({ key: "duplicate", description: this.env._t("Duplicate"), callback: () => this.duplicateRecords(), }); } return result; }, async duplicateRecords() { const ids = await Promise.all( this.model.root.selection.map(async (record) => { return await record.model.orm.call(record.resModel, "copy", [ record.resId, ]); }) ); this.env.searchModel.createNewFilters([ { description: this.env._t("Duplicated Records"), domain: new Domain([["id", "in", ids]]).toString(), type: "filter", }, ]); }, });
OCA/web/web_tree_duplicate/static/src/web_tree_duplicate.esm.js/0
{ "file_path": "OCA/web/web_tree_duplicate/static/src/web_tree_duplicate.esm.js", "repo_id": "OCA", "token_count": 654 }
95
td.o_list_many2one { button.web_tree_many2one_clickable { margin-left: 0.5em; visibility: hidden; } &:hover button.web_tree_many2one_clickable { visibility: visible; } }
OCA/web/web_tree_many2one_clickable/static/src/components/many2one_button/many2one_button.scss/0
{ "file_path": "OCA/web/web_tree_many2one_clickable/static/src/components/many2one_button/many2one_button.scss", "repo_id": "OCA", "token_count": 101 }
96
* `GRAP <http://www.grap.coop>`_: * Quentin DUPONT <quentin.dupont@grap.coop>
OCA/web/web_widget_datepicker_fulloptions/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_widget_datepicker_fulloptions/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 39 }
97
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com> * Christopher Ormaza <chris.ormaza@forgeflow.com>
OCA/web/web_widget_mpld3_chart/readme/CONTRIBUTORS.rst/0
{ "file_path": "OCA/web/web_widget_mpld3_chart/readme/CONTRIBUTORS.rst", "repo_id": "OCA", "token_count": 40 }
98
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_widget_number_ux_choice # msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-08-30 12:07+0000\n" "PO-Revision-Date: 2019-08-30 12:07+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" #. module: web_widget_numeric_step #. odoo-javascript #: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 #, python-format msgid "Minus" msgstr "Moins" #. module: web_widget_numeric_step #. odoo-javascript #: code:addons/web_widget_numeric_step/static/src/numeric_step.esm.js:0 #, python-format msgid "Numeric Step" msgstr "" #. module: web_widget_numeric_step #. odoo-javascript #: code:addons/web_widget_numeric_step/static/src/numeric_step.xml:0 #, python-format msgid "Plus" msgstr "Plus"
OCA/web/web_widget_numeric_step/i18n/fr.po/0
{ "file_path": "OCA/web/web_widget_numeric_step/i18n/fr.po", "repo_id": "OCA", "token_count": 409 }
99
# Copyright 2019-2020 Creu Blanca # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Widget Open on new Tab", "summary": """ Allow to open record from trees on new tab from tree views""", "version": "16.0.2.0.0", "license": "AGPL-3", "author": "Creu Blanca,Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", "depends": ["web"], "demo": ["demo/res_users_view.xml"], "data": [ "views/ir_model_views.xml", ], "assets": { "web.assets_backend": [ "web_widget_open_tab/static/src/xml/open_tab_widget.xml", "web_widget_open_tab/static/src/js/open_tab_widget.esm.js", ], }, }
OCA/web/web_widget_open_tab/__manifest__.py/0
{ "file_path": "OCA/web/web_widget_open_tab/__manifest__.py", "repo_id": "OCA", "token_count": 332 }
100
This module add the possibility to insert Plotly charts into Odoo standard views. .. image:: ../static/description/example.png :alt: Plotly Chart inserted into an Odoo view :width: 600 px `Plotly <https://plot.ly/>`__ is a Python interactive visualization library built on top of d3.js and stack.gl, plotly.js is a high-level, declarative charting library. plotly.js ships with over 40 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more. If you want to see some samples of plotly's capabilities follow this `link <https://github.com/plotly/plotly.py#overview>`_.
OCA/web/web_widget_plotly_chart/readme/DESCRIPTION.rst/0
{ "file_path": "OCA/web/web_widget_plotly_chart/readme/DESCRIPTION.rst", "repo_id": "OCA", "token_count": 180 }
101
# Translation of Odoo Server. # This file contains the translation of the following modules: # * web_widget_x2many_2d_matrix # # Translators: msgid "" msgstr "" "Project-Id-Version: web (8.0)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-06 15:50+0000\n" "PO-Revision-Date: 2019-08-06 12:44+0000\n" "Last-Translator: Nicolas JEUDY <njeudy@panda-chi.io>\n" "Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/" "fr/)\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 3.7.1\n" #. module: web_widget_x2many_2d_matrix #. odoo-javascript #: code:addons/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.xml:0 #, python-format msgid "Nothing to display." msgstr "" #, python-format #~ msgid "Sorry no matrix data to display." #~ msgstr "Désolé il n'y a pas de donnée matrice à afficher." #, python-format #~ msgid "Sum" #~ msgstr "Somme" #, python-format #~ msgid "Sum Total" #~ msgstr "Total"
OCA/web/web_widget_x2many_2d_matrix/i18n/fr.po/0
{ "file_path": "OCA/web/web_widget_x2many_2d_matrix/i18n/fr.po", "repo_id": "OCA", "token_count": 485 }
102
// Copyright 2014 Square Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // This is a manifest file that'll be compiled into application, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. // //= require jquery //= require jquery_ujs // //= require jquery-cookie //= require jquery-leanModal //= require jquery-timers // //= require flot/flot //= require flot/resize //= require flot/stack //= require flot/time // //= require sh/shCore //= require sh/shBrushAppleScript //= require sh/shBrushAS3 //= require sh/shBrushBash //= require sh/shBrushColdFusion //= require sh/shBrushCpp //= require sh/shBrushCSharp //= require sh/shBrushCss //= require sh/shBrushDelphi //= require sh/shBrushDiff //= require sh/shBrushErlang //= require sh/shBrushGit //= require sh/shBrushGroovy //= require sh/shBrushHaxe //= require sh/shBrushJava //= require sh/shBrushJavaFX //= require sh/shBrushJScript //= require sh/shBrushObjC //= require sh/shBrushPerl //= require sh/shBrushPhp //= require sh/shBrushPlain //= require sh/shBrushPowerShell //= require sh/shBrushPython //= require sh/shBrushRuby //= require sh/shBrushSass //= require sh/shBrushScala //= require sh/shBrushSql //= require sh/shBrushTAP //= require sh/shBrushTypeScript //= require sh/shBrushVb //= require sh/shBrushXml //= require sh/shBrushYaml // //= require bootstrap // //= require squash_javascript //= require configure_squash_client // //= require accordion //= require autocomplete //= require bug_file_formatter //= require buttons //= require context //= require disclosure //= require dropdown //= require dynamic_search_field //= require editor_links //= require email_alias_form //= require error_tooltip //= require feed //= require flash //= require form_with_errors //= require live_update //= require member_panel //= require search //= require smart_form //= require sortable_table //= require tabs //= require utilities //= require value_inspector // //= require aggregation //= require histogram // //= require navbar $(document).ready(function() { // run SyntaxHighlighter on PREs SyntaxHighlighter.all(); // enable leanModal on all modal links $("a[rel*=modal]").leanModal({closeButton: '.close'}); $("button[rel*=modal]").leanModal({closeButton: '.close'}); }); $.ajaxSetup({ headers: { 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') } });
SquareSquash/web/app/assets/javascripts/application.js/0
{ "file_path": "SquareSquash/web/app/assets/javascripts/application.js", "repo_id": "SquareSquash", "token_count": 1092 }
103
@import "vars"; h1 { font-size: $h1-size; } h2 { font-size: $h2-size; } h3 { font-size: $h3-size; } h4 { font-size: $h4-size; } h5 { font-size: $h5-size; } h6 { font-size: $h6-size; } @include iphone-landscape-and-smaller { h1 { font-size: $h3-size; } h2 { font-size: $h4-size; } h3 { font-size: $h5-size; } h4 { font-size: $h6-size; } h5 { font-size: 11px; font-weight: bold; text-transform: uppercase; } h6 { font-size: 11px; text-transform: uppercase; } } h1, h2, h3, h4, h5, h6 { margin-top: 20px; margin-bottom: 10px; &:first-child { margin-top: 0; } } p { margin-top: 0.5em; margin-bottom: 0.5em; } a { color: black; cursor: pointer; } strong { font-weight: bold; } em { font-style: italic; } table { width: 100%; } p.small, small { font-size: 80%; } dl { dt { font-weight: bold; } dd { margin: 5px 0 10px 10px; } } tt, kbd, code, samp, pre { font-family: Menlo, monospace; } // tt is used for code atoms such as variable or class names tt { font-weight: bold; } // kbd is used for keyboard input strings kbd { font-style: italic; } // samp is used for output from the computer samp { color: $gray2; } // code is used for inline code snippets code { border-bottom: 1px solid $gray5; } code.short { border-bottom: none; } // pre is used for large code blocks pre { background-color: #f9f9f9; border-radius: $radius-size; padding: 20px; &.scrollable { white-space: nowrap; overflow-x: auto; } } .aux { font-style: italic; color: $gray3; } // apply this to content that might have long words (e.g., file paths) .long-words { word-wrap: break-word; word-break: break-all; }
SquareSquash/web/app/assets/stylesheets/_typography.scss/0
{ "file_path": "SquareSquash/web/app/assets/stylesheets/_typography.scss", "repo_id": "SquareSquash", "token_count": 680 }
104
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Controller that works with the current {User}. class AccountsController < ApplicationController respond_to :html # Displays information about the User and his/her Memberships. # # Routes # ------ # # * `GET /account` def show end # Updates the current user with the attributes in the `:user` parameterized # hash. # # Routes # ------ # # * `PATCH /account` # # Body Parameters # --------------- # # | | | # |:-------|:----------------------------------------------------------| # | `user` | New attributes for the current user (parameterized hash). | def update if params[:user][:password].blank? params[:user].delete 'password' params[:user].delete 'password_confirmation' end current_user.update_attributes user_params respond_with current_user do |format| format.html do if current_user.valid? flash[:success] = t('controllers.accounts.update.success') redirect_to account_url else render 'show' end end end end if Squash::Configuration.authentication.strategy == 'password' private def user_params params.require(:user).permit(:username, :password, :password_confirmation, :email_address, :first_name, :last_name) end end
SquareSquash/web/app/controllers/accounts_controller.rb/0
{ "file_path": "SquareSquash/web/app/controllers/accounts_controller.rb", "repo_id": "SquareSquash", "token_count": 722 }
105
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Adds LDAP-based authentication to the {User} model. Mixed in if this # Squash install is configured to use LDAP-based authentication. module LdapAuthentication extend ActiveSupport::Concern # @return [String] This user's LDAP distinguished name (DN). def distinguished_name "#{Squash::Configuration.authentication.ldap.search_key}=#{username},#{Squash::Configuration.authentication.ldap.tree_base}" end private def create_primary_email emails.create!(email: "#{username}@#{Squash::Configuration.mailer.domain}", primary: true) end end
SquareSquash/web/app/models/additions/ldap_authentication.rb/0
{ "file_path": "SquareSquash/web/app/models/additions/ldap_authentication.rb", "repo_id": "SquareSquash", "token_count": 344 }
106
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This observer # # * copies {Event Events} to the `user_events` table for each User watching a # {Bug}'s events, and # * sends emails notifying of Bug status changes. class EventObserver < ActiveRecord::Observer # @private def after_create(event) copy_events_for_users event send_emails event end private def copy_events_for_users(event) # make user events for all the users watching this bug UserEvent.connection.execute <<-SQL INSERT INTO user_events (user_id, event_id, created_at) SELECT user_id, #{event.id}, #{Event.connection.quote event.created_at} FROM watches WHERE bug_id = #{event.bug_id} SQL end def send_emails(event) if event.kind == 'assign' && !event.bug.fixed? && !event.bug.irrelevant? && event.user && event.assignee && event.user != event.assignee Squash::Ruby.fail_silently do NotificationMailer.assign(event.bug, event.user, event.assignee).deliver_now end end if event.kind == 'close' && ((event.user_id && event.user_id != event.bug.assigned_user_id) || # a user other than the assigned user performed the action (!event.user_id && event.bug.assigned_user_id)) && # or no user performed the action but there is an assigned user !(event.data['status'] == 'fixed' && event.bug.irrelevant?) && # an irrelevant bug was not marked as fixed !(event.data['status'] == 'irrelevant' && event.bug.fixed?) # a fixed bug was not marked as irrelevant Squash::Ruby.fail_silently do NotificationMailer.resolved(event.bug, event.user).deliver_now end end end end
SquareSquash/web/app/models/observers/event_observer.rb/0
{ "file_path": "SquareSquash/web/app/models/observers/event_observer.rb", "repo_id": "SquareSquash", "token_count": 820 }
107
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. atom_feed(root_url: project_environment_bugs_url(@project, @environment)) do |feed| feed.title "Bugs in #{@project.name}" feed.updated @bugs.first.first_occurrence if @bugs.any? @bugs.each do |bug| feed.entry(bug, published: bug.first_occurrence, url: project_environment_bug_url(@project, @environment, bug), id: "project:#{@project.slug},environment:#{@environment.name},bug:#{bug.number}") do |entry| entry.title( if bug.special_file? "#{bug.class_name} in #{bug.file}" else "#{bug.class_name} in #{bug.file}:#{bug.line}" end ) #entry.summary bug.message_template entry.content(type: 'xhtml') do |html| html.p do html.strong "#{bug.class_name}: " html.span bug.message_template end html.p do if bug.special_file? html.span "#{bug.file}" else html.span "#{bug.file}, line #{bug.line}" end html.em "(revision #{bug.revision})" end end entry.author do |author| author.name bug.blamed_commit.author.name author.email bug.blamed_commit.author.email end if bug.blamed_commit end end end
SquareSquash/web/app/views/bugs/index.atom.builder/0
{ "file_path": "SquareSquash/web/app/views/bugs/index.atom.builder", "repo_id": "SquareSquash", "token_count": 808 }
108
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. atom_feed(root_url: project_environment_bug_url(@project, @environment, @bug, anchor: 'occurrences')) do |feed| feed.title "Occurrences of Bug ##{@bug.number} in #{@project.name} #{@environment.name}" feed.updated @occurrences.first.occurred_at if @occurrences.any? feed.author do |author| author.name @bug.blamed_commit.author.name author.email @bug.blamed_commit.author.email end if @bug.blamed_commit @occurrences.each do |occurrence| feed.entry(occurrence, published: occurrence.occurred_at, url: project_environment_bug_occurrence_url(@project, @environment, @bug, occurrence), id: "project:#{@project.slug},environment:#{@environment.name},bug:#{@bug.number},occurrence:#{occurrence.number}") do |entry| entry.title "#{occurrence.hostname}: #{OccurrencesController::INDEX_FIELDS[occurrence.client].map { |f| occurrence.send f }.join('/')}" #entry.summary occurrence.message entry.content(type: 'xhtml') do |html| html.p occurrence.message html.h2 "Backtrace" occurrence.backtraces.each do |bt| html.h3 "#{bt['name']}#{' (raised)' if bt['faulted']}" html.ul do bt['backtrace'].each { |line| html.li format_backtrace_element(*line) } end end end end end end
SquareSquash/web/app/views/occurrences/index.atom.builder/0
{ "file_path": "SquareSquash/web/app/views/occurrences/index.atom.builder", "repo_id": "SquareSquash", "token_count": 743 }
109
#!/usr/bin/env ruby # Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # To remove all Gem dependencies for the setup script, the Colored gem is # included here wholesale. For authorship, etc.: https://github.com/defunkt/colored module Colored extend self COLORS = { 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37 } EXTRAS = { 'clear' => 0, 'bold' => 1, 'underline' => 4, 'reversed' => 7 } COLORS.each do |color, value| define_method(color) do colorize(self, :foreground => color) end define_method("on_#{color}") do colorize(self, :background => color) end COLORS.each do |highlight, value| next if color == highlight define_method("#{color}_on_#{highlight}") do colorize(self, :foreground => color, :background => highlight) end end end EXTRAS.each do |extra, value| next if extra == 'clear' define_method(extra) do colorize(self, :extra => extra) end end define_method(:to_eol) do tmp = sub(/^(\e\[[\[\e0-9;m]+m)/, "\\1\e[2K") if tmp == self return "\e[2K" << self end tmp end def colorize(string, options = {}) colored = [color(options[:foreground]), color("on_#{options[:background]}"), extra(options[:extra])].compact * '' colored << string colored << extra(:clear) end def colors @@colors ||= COLORS.keys.sort end def extra(extra_name) extra_name = extra_name.to_s "\e[#{EXTRAS[extra_name]}m" if EXTRAS[extra_name] end def color(color_name) background = color_name.to_s =~ /on_/ color_name = color_name.to_s.sub('on_', '') return unless color_name && COLORS[color_name] "\e[#{COLORS[color_name] + (background ? 10 : 0)}m" end end unless Object.const_defined? :Colored String.send(:include, Colored) ############################## BEGIN SETUP SCRIPT ############################## def bool(str) 'YyTt1'.include? str[0, 1] end def say(*strs) puts strs.join(' ') end def prompt(message, default_yes=true) y = default_yes ? 'Y' : 'y' n = default_yes ? 'n' : 'N' say message.green.bold, "[#{y}/#{n}]".green answer = gets.strip if answer.empty? answer = default_yes else answer = bool(answer) end return answer end def prompt_or_quit(*args) exit unless prompt(*args) end def run(*command) args = ["Running".cyan] args += command.map { |s| s.cyan.bold } args << "...".cyan say *args stdout, stderr, status = Open3.capture3(*command) unless status.success? say "Command exited unsuccessfully:".red.bold, status.inspect.red puts say "stdout".underline.bold puts stdout puts say "stderr".underline.bold puts stderr exit 1 end stdout end def run_ignore(*command) args = ["Running".cyan] args += command.map { |s| s.cyan.bold } args << "... (failure OK)".cyan say *args system *command end def query(question, default=nil) output = '' begin if default say question.green.bold, "[#{default.empty? ? 'blank' : default}]".green else say question.green.bold end output = gets.strip output = default if default && output.empty? end while output.empty? && default != '' output == '' ? nil : output end def choose(question, choices, default=nil) output = nil until choices.include?(output) if default say question.green.bold, "(#{choices.join('/')})".green, "[#{default}]".green else say question.green.bold, "(#{choices.join('/')})".green end output = gets.strip.downcase output = default if default && output == '' output = choices.detect { |c| c.downcase =~ /^#{Regexp.escape output}/ } end return output end if RUBY_VERSION < '1.9.2' say "You need Ruby 1.9.2 or newer to use Squash.".red.bold say "Please re-run this script under a newer version of Ruby.".magenta exit 1 end if RUBY_PLATFORM == 'java' say "This setup script must be run on MRI 1.9.2 or newer.".red.bold say "You can run Squash itself on JRuby, but this script must be run on MRI." say "See http://jira.codehaus.org/browse/JRUBY-6409 for the reason why." exit 1 end say "Welcome! Let's set up your Squash installation.".bold puts "I'll ask you some questions to help configure Squash for your needs.", "Remember to read the README.md file to familiarize yourself with the Squash", "codebase, as there's a strong likelihood you'll need to make other tweaks", "to fully support your particular environment." puts puts "If something's not right, you can abort this script at any time; it's", "resumable. Simply rerun it when you are ready." say say "Checking the basic environment..." if File.absolute_path(Dir.getwd) != File.absolute_path(File.dirname(__FILE__) + '/..') say "You are not running this script from the Rails project's root directory.".red.bold say "Please cd into the project root and re-run this script.".magenta exit 1 end step = File.read('/tmp/squash_install_progress').to_i rescue 0 if step == 0 && !`git status --porcelain`.empty? say "You have a dirty working directory.".red.bold puts "It's #{"highly".bold} recommended to run this script on a clean working", "directory. In the event you get some answers wrong, or change your mind", "later, it will be easy to see what files the script changed, and update", "them accordingly." prompt_or_quit "Continue?", false end say "Checking for required software..." require 'open3' require 'yaml' require 'fileutils' require 'securerandom' if `which psql`.empty? say "You need PostgreSQL version 9.0 or newer to use Squash.".red.bold say "Please install PostgreSQL and re-run this script.".magenta exit 1 end unless `psql -V` =~ /^psql \(PostgreSQL\) (\d{2,}|9)\./ say "You need PostgreSQL version 9.0 or newer to use Squash.".red.bold say "Please upgrade PostgreSQL and re-run this script.".magenta exit 1 end if `which bundle`.empty? say "You need Bundler to use Squash.".red.bold say "Please run", "gem install bundler".bold, "and re-run this script.".magenta exit 1 end say say "We will now install gems if you are ready (in the correct gemset, etc.)." prompt_or_quit "Are you ready to install required gems?" run 'bundle', 'install' if step < 1 say say "Now let's configure production hostname and URL settings.".bold puts "If you don't know what URL your production instance will have, just make", "something up. You can always change it later." hostname = query("What hostname will your production instance have (e.g., squash.mycompany.com)?") https = prompt("Will your production instance be using HTTPS?", hostname) email_domain = query("What is the domain portion of your organization's email addresses?", hostname) sender = query("What sender should Squash emails use?", "squash@#{email_domain}") mail_strategy = choose("How will Squash send email?", %w(sendmail smtp)) if mail_strategy == 'smtp' smtp_domain = email_domain smtp_host = query("What's the hostname of your SMTP server?") smtp_port = query("What's the port of your SMTP server?", '25') smtp_auth = choose("What's the authentication for your SMTP server?", %w(none plain ntlm)) unless smtp_auth == 'none' smtp_username = query("What's the username for your SMTP server?") smtp_password = query("What's the password for your SMTP server?") end smtp_ssl = prompt("Do you want to skip SSL verification?") end smtp_settings = { 'address' => smtp_host, 'port' => smtp_port, 'domain' => smtp_domain, 'user_name' => smtp_username, 'password' => smtp_password, 'authentication' => smtp_auth, 'enable_starttls_auto' => smtp_ssl } say "Updating config/environments/common/mailer.yml..." File.open('config/environments/common/mailer.yml', 'w') do |f| f.puts({ 'from' => sender, 'domain' => email_domain, 'strategy' => mail_strategy, 'smtp_settings' => smtp_settings }.to_yaml) end say "Updating config/environments/production/mailer.yml..." File.open('config/environments/production/mailer.yml', 'w') do |f| f.puts({ 'default_url_options' => { 'host' => hostname, 'protocol' => https ? 'https' : 'http' } }.to_yaml) end url = query("What URL will production Squash be available at?", "http#{'s' if https}://#{hostname}") say "Updating config/environments/production/javascript_dogfood.yml..." File.open('config/environments/production/javascript_dogfood.yml', 'w') do |f| f.puts({'APIHost' => url}.to_yaml) end say "Updating config/environments/production/dogfood.yml..." dogfood = YAML.load_file('config/environments/production/dogfood.yml') File.open('config/environments/production/dogfood.yml', 'w') do |f| f.puts dogfood.merge('api_host' => url).to_yaml end File.open('/tmp/squash_install_progress', 'w') { |f| f.puts '1' } end if step < 2 say say "Now we'll cover authentication.".bold auth = choose("How will users authenticate to Squash?", %w(password LDAP)) if auth == 'LDAP' ldap_host = query("What's the hostname of your LDAP server?") ldap_ssl = prompt("Is your LDAP service using SSL?") ldap_port = query("What port is your LDAP service running on?", ldap_ssl ? '636' : '389').to_i tree_base = query("Under what tree base can the user records be found in LDAP?") search_key = query("What search key should I use to locate a user by username under that tree?", 'uid') bind_dn = query("Will you be using a different DN to bind to the LDAP server? If so, enter it now.", '') bind_pw = query("What is the password for #{bind_dn}?") if bind_dn say "Updating config/environments/common/authentication.yml..." File.open('config/environments/common/authentication.yml', 'w') do |f| f.puts({ 'strategy' => 'ldap', 'ldap' => { 'host' => ldap_host, 'port' => ldap_port, 'ssl' => ldap_ssl, 'tree_base' => tree_base, 'search_key' => search_key, 'bind_dn' => bind_dn, 'bind_password' => bind_pw } }.to_yaml) end elsif auth == 'password' say "Updating config/environments/common/authentication.yml..." File.open('config/environments/common/authentication.yml', 'w') do |f| f.puts({ 'strategy' => 'password', 'registration_enabled' => true, 'password' => { 'salt' => SecureRandom.base64 } }.to_yaml) end end File.open('/tmp/squash_install_progress', 'w') { |f| f.puts '2' } end if step < 3 say say "Let's set up your database now.".bold say "If you don't know the answer to a question, give a best guess. You can always", "change your database.yml file later." dev_host = query("What is the hostname of the development PostgreSQL server?", 'localhost') dev_user = query("What PostgreSQL user will Squash use in development?", 'squash') dev_pw = query("What is #{dev_user}@#{dev_host}'s password?", '') dev_local = dev_host.nil? || dev_host == 'localhost' || dev_host == '0.0.0.0' || dev_host == '127.0.0.1' dev_db = query("What is the name of your PostgreSQL development database?#{" (It doesn't have to exist yet.)" if dev_local}", 'squash_development') test_host = query("What is the hostname of the test PostgreSQL server?", 'localhost') test_user = query("What PostgreSQL user will Squash use in test?", dev_user) test_pw = query("What is #{test_user}@#{test_host}'s password?", '') test_db = query("What is the name of your PostgreSQL test database?", 'squash_test') prod_host = query("What is the hostname of the production PostgreSQL server?", 'localhost') prod_user = query("What PostgreSQL user will Squash use in production?", dev_user) prod_pw = query("What is #{prod_user}@#{prod_host}'s password?", '') prod_db = query("What is the name of your PostgreSQL production database?", 'squash_production') say "Updating config/database.yml..." File.open('config/database.yml', 'w') do |f| common = { 'adapter' => 'postgresql', # temporarily for the rake db:migrate calls 'encoding' => 'utf8' } f.puts({ 'development' => common.merge( 'host' => dev_host, 'username' => dev_user, 'password' => dev_pw, 'database' => dev_db ), 'test' => common.merge( 'host' => test_host, 'username' => test_user, 'password' => test_pw, 'database' => test_db ), 'production' => common.merge( 'host' => prod_host, 'username' => prod_user, 'password' => prod_pw, 'database' => prod_db, 'pool' => 30 ) }.to_yaml) end File.open('/tmp/squash_install_progress', 'w') { |f| f.puts '3' } end if step < 4 run 'bundle', 'install' db_config = YAML.load_file('config/database.yml') dev_host = db_config['development']['host'] dev_user = db_config['development']['username'] dev_db = db_config['development']['database'] dev_local = (dev_host.nil? || dev_host == 'localhost' || dev_host == '0.0.0.0' || dev_host == '127.0.0.1') test_host = db_config['test']['host'] test_user = db_config['test']['username'] test_db = db_config['test']['database'] test_local = (test_host.nil? || test_host == 'localhost' || test_host == '0.0.0.0' || test_host == '127.0.0.1') run_ignore 'createuser', '-DSR', 'squash' if dev_local dbs = `psql -ltA | awk -F'|' '{ print $1 }'`.split(/\n/) if dev_local unless dbs.include?(dev_db) prompt_or_quit "Ready to create the development database?" run "createdb", '-O', dev_user, dev_db end end prompt_or_quit "Ready to migrate the development database?" run 'rake', 'db:migrate' if test_local unless dbs.include?(test_db) prompt_or_quit "Ready to create the test database?" run "createdb", '-O', test_user, test_db end end prompt_or_quit "Ready to migrate the test database?" run 'env', 'RAILS_ENV=test', 'rake', 'db:migrate' File.open('/tmp/squash_install_progress', 'w') { |f| f.puts '4' } end if step < 5 say "Generating session secret..." secret = SecureRandom.hex contents = File.read('config/initializers/secret_token.rb') File.open('config/initializers/secret_token.rb', 'w') do |f| f.puts contents.sub('_SECRET_', secret) end File.open('/tmp/squash_install_progress', 'w') { |f| f.puts '5' } end say say "All done!".green.bold, "You should now be able to run".green, "rails server.".green.bold, "Some notes:".green puts say "* If you want Squash to monitor itself for errors in production, edit".yellow say " ", "config/environments/production/dogfood.yml".bold.yellow, "and set".yellow, "disabled".bold.yellow, "to".yellow say " ", "false.".bold.yellow, "When you deploy Squash to production, create a project for itself".yellow say " and copy the generated API key to this file.".yellow puts say "* Test that all specs pass by running".yellow, 'rspec spec.'.bold.yellow FileUtils.rm '/tmp/squash_install_progress'
SquareSquash/web/bin/setup/0
{ "file_path": "SquareSquash/web/bin/setup", "repo_id": "SquareSquash", "token_count": 6725 }
110
--- disabled: true
SquareSquash/web/config/environments/development/dogfood.yml/0
{ "file_path": "SquareSquash/web/config/environments/development/dogfood.yml", "repo_id": "SquareSquash", "token_count": 6 }
111
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Spawn and stop the thread pool if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| Multithread.start end PhusionPassenger.on_event(:stopping_worker_process) do Multithread.stop end elsif defined?(Unicorn) Unicorn::HttpServer.class_eval do old = instance_method(:worker_loop) define_method(:worker_loop) do |worker| Multithread.start old.bind(self).call(worker) end end else # Not in Passenger at all Multithread.start at_exit { Multithread.stop } end # Load concurrency setup BackgroundRunner.runner.setup if BackgroundRunner.runner.respond_to?(:setup)
SquareSquash/web/config/initializers/concurrency.rb/0
{ "file_path": "SquareSquash/web/config/initializers/concurrency.rb", "repo_id": "SquareSquash", "token_count": 411 }
112
en: activerecord: errors: models: bug: attributes: assigned_user_id: not_member: is not a project member blamed_revision: invalid: is not a valid commit ID duplicate_of_id: already_duplicate: already marked as duplicate of a bug foreign_bug: can only be the duplicate of a bug in the same environment has_duplicates: cannot be marked as duplicate because other bugs have been marked as duplicates of this bug is_a_duplicate: cannot be the duplicate of a bug that’s marked as a duplicate not_found: unknown bug number fix_deployed: not_fixed: cannot be true when the bug is not marked as fixed resolution_revision: invalid: is not a valid commit ID set_on_unfixed: cannot be set without also marking the bug as fixed revision: invalid: is not a valid commit ID comment: attributes: bug_id: not_allowed: You don’t have permission to comment on this bug. deploy: attributes: revision: invalid: is not a valid commit ID email: attributes: email: taken: is already being handled by someone else is_your_primary: is already your main email address has_global_redirect: is already globally handled by you primary: must_be_set: cannot be unset without setting another email as primary not_allowed: cannot be set for project-specific email redirects project_id: not_a_member: not a member occurrence: attributes: revision: invalid: is not a valid commit ID project: attributes: default_environment_id: wrong_project: is not an environment in this project repository_url: unreachable: is not accessible taken: already has a Squash project user: attributes: password: exclusion: is too common watch: attributes: bug_id: no_permission: is not part of a project you are a member of attributes: bug: assigned_user_id: assigned user blamed_revision: commit at fault class_name: exception class name client: Squash client library duplicate_of_id: bug that this is a duplicate of duplicate_of_number: this bug is a duplicate of file: relevant file fixed: fixed fixed_at: time fixed fix_deployed: fix has been deployed irrelevant: irrelevant jira_issue: JIRA issue jira_status_id: JIRA issue status line: relevant line message_template: exception message number: number page_period: PagerDuty occurrence time period page_threshold: PagerDuty occurrence threshold resolution_revision: fix commit revision: revision of first occurrence comment: number: number body: body deploy: build: internal version identifier revision: repository revision deployed_at: time deployed email: email: email address environment: name: name sends_emails: Sends emails notifies_pagerduty: Notifies PagerDuty membership: admin: administrator notification_threshold: period: period of time threshold: number of exceptions occurrence: action: Web action altitude: geolocated altitude architecture: architecture arguments: process arguments backtraces: stack traces browser_name: Web browser name browser_version: Web browser version browser_engine: Web browser engine browser_os: Web browser OS browser_engine_version: Web browser engine version build: client build client: Squash client library color_depth: color depth cookies: cookies hash connectivity: network connectivity controller: Web controller crashed: crashed device_id: client device ID device_type: client device type env_vars: environment variables flash: flash hash headers: request headers heading: geolocated heading host: host hostname: hostname ivars: instance variables lat: geolocated latitude location_precision: geolocation precision lon: geolocated longitude message: exception message network_operator: network operator network_type: network type number: number occurred_at: time of occurrence operating_system: client OS os_version: OS version os_build: OS build orientation: device orientation params: params hash parent_exceptions: parent exceptions parent_process: parent process name path: path pid: PID physical_memory: device physical memory port: port power_state: device power state process_native: process running natively process_path: launch path query: query string request_method: request method revision: repository revision root: source root rooted: device rooted schema: schema screen_width: screen width screen_height: screen height session: session hash speed: geolocated speed user_data: user data version: client version window_width: window width window_height: window height project: all_mailing_list: all exceptions mailing list always_notify_pagerduty: always notify pagerduty api_key: API key commit_url_format: commit URL format critical_mailing_list: critical exceptions mailing list critical_threshold: critical threshold disable_message_filtering: disable exception message filtering filter_paths: filtered paths filter_paths_string: filtered paths locale: email locale name: name pagerduty_enabled: notify PagerDuty for new occurrences pagerduty_service_key: service key repository_url: repository URL sender: sender sends_emails_outside_team: notify unknown email addresses trusted_email_domain: trusted domain for unknown email addresses uses_releases: is a released and distributed application whitelist_paths_string: whitelisted paths whitelist_paths_string: whitelisted paths user: crypted_password: password email_address: email address first_name: first name last_name: last name password: password password_confirmation: confirm password username: username blamer: recency: Recency-based blamer simple: Git-free blamer date: formats: short: "%b %d, %Y" compact: "%m/%d/%y" errors: messages: accepted: must be accepted blank: can’t be blank confirmation: doesn’t match empty: can’t be empty equal_to: must be equal to %{count} even: must be even exclusion: reserved greater_than: must be greater than %{count} greater_than_or_equal_to: must be greater than or equal to %{count} inclusion: not acceptable incorrect_type: incorrect type invalid: invalid invalid_email: not a valid email address invalid_url: is not a valid URL less_than: must be less than %{count} less_than_or_equal_to: must be less than or equal to %{count} not_a_number: not a number not_an_integer: not an integer odd: must be odd taken: already taken too_long: must be %{count} characters or shorter too_short: must be %{count} characters or longer wrong_length: must be be %{count} characters long invalid_date: not a valid date invalid_time: not a valid time invalid_datetime: not a valid date and time is_at: must be at %{restriction} before: must be before %{restriction} on_or_before: must be on or before %{restriction} after: must be after %{restriction} on_or_after: must be on or after %{restriction} unknown_revision: does not exist in the repository helpers: submit: comment: create: Post update: Update email: create: Add membership: update: Save Changes notification_threshold: create: Set update: Update project: create: Create Project update: Update Configuration user: create: Sign Up update: Save Changes application: number_to_dms: coordinate: "%{degrees}° %{minutes}ʹ %{seconds}ʺ %{hemisphere}" north: N west: W south: S east: E time: formats: full_date: "%B %-d, %Y" full_time: "%-I:%M:%S %P" git: "%a %b %-d %H:%M:%S %Y %z" short_date: "%b %d, %Y" compact: "%Y/%-m/%-d %-H:%M:%S" models: membership: role: owner: owner admin: administrator member: project member user: name: "%{first_name} %{last_name}" bug: name: "Bug #%{number}" occurrence: name: "Occurrence #%{number}" controllers: accounts: update: success: "Your profile has been updated." application: mass_assignment_security: The previous request was malformed. authentication: login_required: You must be logged in to continue. bugs: destroy: deleted: "Bug #%{number} was deleted." show: jira_link: description: | %{class_name} in %{file}:%{line} %{message} First occurred in revision %{revision}. More information: %{url} not_applicable: N/A summary: "%{class_name} on %{file_name}:%{line}" commits: context: commit_not_found: Couldn’t find that commit or file. line_out_of_bounds: Line number is out of range. missing_param: Missing required parameter. repo_nil: Couldn’t load project repository. project: membership: destroy: deleted: You are no longer a member of the %{name} project. must_not_be_owner: You cannot revoke your membership in a project that you own. Transfer ownership to someone else first. projects: destroy: deleted: Project %{name} was deleted. rekey: success: The API key for %{name} is now %{api_key}. sessions: create: logged_in: Welcome to Squash, %{name}! incorrect_login: Username and password didn’t match. ldap_error: There was an error connecting to the LDAP server. missing_field: You must provide a username and a password. destroy: logged_out: You have been logged out. users: create: success: "Welcome to Squash, %{name}!" disabled: New user registration is currently disabled. mailers: notifier: initial: subject: "[Squash] %{class} in %{filename} (%{project} %{environment})" critical: subject: "[!!!] %{class} in %{filename} (%{project} %{environment})" blame: subject: "[Squash] %{class} in %{filename} (%{project} %{environment})" assign: subject: "[Squash] You have been assigned to bug #%{number} of %{project}" resolved: subject: fixed: "[Squash] Bug #%{number} of %{project} was resolved" irrelevant: "[Squash] Bug #%{number} of %{project} was marked irrelevant" comment: subject: "[Squash] A comment has been added to bug #%{number} of %{project}" occurrence: subject: "[Squash] New occurrence of bug #%{number} of %{project}" deploy: subject: "[Squash] The fix for bug #%{number} of %{project} was deployed" threshold: subject: "[Squash] Bug #%{number} of %{project} is occurring a lot" reopened: subject: "[Squash] Reopened: %{class} in %{filename} (%{project} %{environment})" workers: pagerduty: acknowledge: description: assigned: "%{class_name} in %{file_name} was assigned to %{user}." irrelevant: "%{class_name} in %{file_name} was marked as irrelevant on Squash." fixed: "%{class_name} in %{file_name} was marked as resolved on Squash." incident: description: "%{class_name} in %{file_name}:%{line}: %{message}" not_applicable: "(N/A)" resolve: description: "The fix for %{class_name} in %{file_name} on Squash was deployed."
SquareSquash/web/config/locales/en.yml/0
{ "file_path": "SquareSquash/web/config/locales/en.yml", "repo_id": "SquareSquash", "token_count": 5404 }
113
class AddMappingToSourceMap < ActiveRecord::Migration def up execute <<-SQL ALTER TABLE source_maps ADD COLUMN "from" CHARACTER VARYING(24) NOT NULL DEFAULT 'minified' CHECK (CHAR_LENGTH("from") > 0), ADD COLUMN "to" CHARACTER VARYING(24) NOT NULL DEFAULT 'original' CHECK (CHAR_LENGTH("to") > 0) SQL execute 'ALTER TABLE source_maps ALTER "from" DROP NOT NULL' execute 'ALTER TABLE source_maps ALTER "to" DROP NOT NULL' execute "DROP INDEX source_maps_env_revision" execute 'CREATE INDEX source_maps_env_revision ON source_maps(environment_id, revision, "from")' end def down execute 'ALTER TABLE source_maps DROP "from", DROP "to"' end end
SquareSquash/web/db/migrate/20140130012355_add_mapping_to_source_map.rb/0
{ "file_path": "SquareSquash/web/db/migrate/20140130012355_add_mapping_to_source_map.rb", "repo_id": "SquareSquash", "token_count": 262 }
114
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # @private switchToTab = (link, target) -> link.parent().siblings().removeClass 'active' link.parent().addClass 'active' target.siblings().removeClass 'active' target.addClass 'active' defaultTab = null defaultLink = null # Enables tab-switching functionality on all links with their `rel` attribute # set to "tab" and their `href` attribute set to the jQuery specifier of a tab # item. Tab items must be grouped under a parent with the class "tab-content". # # If you add the "tab-primary" class to your "tab-content" div, the selected tab # will also be set in the URL hash and pushed to the browser history. Only one # tab group should be marked as primary. # $(window).ready -> defaultTab = $('.tab-content.tab-primary>.active') defaultLink = $("a[rel=tab][href=\"##{defaultTab.attr('id')}\"]") $('a[rel=tab]').click (e) -> link = $(e.currentTarget) target = $(link.attr('href')) return true unless target.parent().hasClass('tab-content') switchToTab link, target if target.parent().hasClass('tab-primary') history.pushState '', document.title, window.location.pathname + link.attr('href') e.stopPropagation() e.preventDefault() return false # @private preselectTab = -> if document.location.hash.length == 0 switchToTab defaultLink, defaultTab target = $(document.location.hash) return true unless target.parent().hasClass('tab-content') && target.parent().hasClass('tab-primary') link = $("li>a[href=\"#{document.location.hash}\"]") switchToTab link, target return false # When a history state is popped that includes a tab HREF, activate that tab. window.onpopstate = preselectTab # When a page is loaded with a tab HREF, activate that tab. $(window).ready preselectTab
SquareSquash/web/lib/assets/javascripts/tabs.js.coffee/0
{ "file_path": "SquareSquash/web/lib/assets/javascripts/tabs.js.coffee", "repo_id": "SquareSquash", "token_count": 727 }
115
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Container module for the {Blamer::Base} class cluster. module Blamer # @abstract # # Subclasses of this class analyze an Occurrence and determines which Bug is # responsible. A new Bug is created if no existing Bug matches the search # criteria. Different subclasses implement different strategies for # determining fault. # # Usage # ----- # # To re-calculate blame for an existing Occurrence, and potentially re-assign it # to a different Bug, it is sufficient to pass the Occurrence to this class's # initializer. # # To assign blame to a new, unsaved Occurrence, it will be necessary to create # an unsaved Bug and fill it out with the data Blamer needs in order to perform # its search. This data is: # # * the Bug's `environment`, # * the Bug's `class_name`, and # * the Bug's `deploy`, if any. # # This new Bug should be temporarily associated with the Occurrence before the # Occurrence is given to Blamer. The result of the {#find_or_create_bug!} method # will always be a different, saved Bug; you should leave your temporary Bug # unsaved. # # Deployed Projects # ----------------- # # For Occurrences that come from Projects deployed onto client platforms, the # Deploy is also taken into account. For such Projects, the Blamer will try to # find, in order: # # * an open Bug matching the search criteria under any Deploy, # * a fixed Bug matching the criteria under the current Deploy, or # * a newly-created Bug. # # In no case will an open Bug in a different Deploy be chosen. # # Reopening Bugs # -------------- # # After linking and saving the Bug returned from {#find_or_create_bug!}, you # should call {#reopen_bug_if_necessary!} to potentially reopen the Bug. This # should only be done after the Occurrence and Bug are both linked and saved. class Base # The amount of time after a bug is fixed _without_ being deployed after which # it will be reopened if new occurrences appear. STALE_TIMEOUT = 10.days # @private attr_reader :occurrence # @return [String] A human-readable name for this blamer subclass. def self.human_name() I18n.t("blamer.#{to_s.demodulize.underscore}") end # Converts a ref-ish (like "HEAD") into a Git SHA. The default # implementation simply returns the given revision; subclasses can actually # use Git to resolve the SHA. # # @param [Project] project A project whose repository will be used. # @param [String] revision A git ref-ish. # @return [String] The 40-character Git SHA. def self.resolve_revision(project, revision) revision end # Creates a new instance suitable for placing a given Occurrence. # # @param [Occurrence] occurrence The Occurrence to find a Bug for. def initialize(occurrence) @occurrence = occurrence @special = false end # @return [Bug] A Bug the Occurrence should belong to. Does not assign the # Occurrence to the Bug. If no suitable Bug is found, saves and returns a # new one. def find_or_create_bug! criteria = bug_search_criteria bug = if deploy # for distributed projects, we need to find either # * a bug associated with the exact deploy specified in the build attribute # * or, if the exact deploy specified does not have such a bug: # * find any open (not fixed) bug matching the criteria; # * if such a bug exists, use that bug and alter its deploy_id to # the given deploy; # * otherwise, a new bug is created. b = Bug.transaction do environment.bugs.where(criteria.merge(deploy_id: deploy.id)).first || environment.bugs.where(criteria.merge(fixed: false)). find_or_create!(bug_attributes) end b.deploy = deploy b else # for hosted projects, we search for any bug matching the criteria under # our current environment environment.bugs.where(criteria). find_or_create!(bug_attributes) end # If this code works as it should, there should only be one open record of # a Bug at any time. A bug occurs, a new Bug is created. A new release is # out, but it doesn't fix the bug, and that same Bug is reused. A new # release is out that DOES fix the bug, and the bug is closed. The bug # recurs, and a new open Bug is created. # Lastly, we need to resolve the bug if it's a duplicate. bug = bug.duplicate_of(true) if bug.duplicate? return bug end # This method determines if the Bug should be reopened. You should pass in the # Bug returned from {#find_or_create_bug!}, after it has been linked to the # Occurrence and saved. # # This method will reopen the Bug if necessary. The Bug is only reopened if # it recurs after being fixed and after the fix is deployed. A fix is # considered deployed if the fix has been marked `fix_deployed` or if the fix # is over 30 days old. # # Bugs of distributed Projects are never reopened. # # @param [Bug] bug The bug that was returned from {#find_or_create_bug!}. def reopen_bug_if_necessary!(bug) return if bug.deploy # now that things are saved, reopen the bug if we need to # this is so the occurrence has an id we can write into the reopen event occurrence_deploy = bug.environment.deploys.where(revision: occurrence.revision).order('deployed_at DESC').first latest_deploy = bug.environment.deploys.order('deployed_at DESC').first if bug.fix_deployed? && occurrence_deploy.try!(:id) == latest_deploy.try!(:id) # reopen the bug if it was purportedly fixed and deployed, and the occurrence # we're seeing is on the latest deploy -- or if we don't have any deploy # information bug.reopen occurrence bug.save! elsif !bug.fix_deployed? && bug.fixed? && bug.fixed_at < STALE_TIMEOUT.ago # or, if it was fixed but never marked as deployed, and is more than 30 days old, reopen it bug.reopen occurrence bug.save! end end protected # @abstract # # @return [Hash<Symbol, Object>] A hash of search criteria to be used in a # `WHERE` clause to locate a Bug to file an Occurrence under. def bug_search_criteria raise NotImplementedError end private def bug() occurrence.bug end def environment() occurrence.bug.environment end def project() occurrence.bug.environment.project end def deploy() occurrence.bug.deploy end def bug_attributes message = if project.disable_message_filtering? occurrence.message else filter_message(occurrence.bug.class_name, occurrence.message) end.truncate(1000) { message_template: message, revision: occurrence.revision, environment: occurrence.bug.environment, client: occurrence.client, special_file: @special } end def filter_message(class_name, message) template_message = MessageTemplateMatcher.instance.sanitized_message(class_name, message) return template_message if template_message message = message. gsub(/#<([^\s]+) (\w+: .+?(, )?)+>/, "#<\\1 [ATTRIBUTES]>") # #<Project id: 1, foo: bar> message.gsub!(/#<([^\s]+) .+?>/, "#<\\1 [DESCRIPTION]>") # #<Net::HTTP www.apple.com:80 open=true> message.gsub!(/#<(.+?):0x[0-9a-f]+>/, "#<\\1:[ADDRESS]>") # #<Object:0x007fedfa0aa920> message.gsub!(/\b[0-9a-f]{40}\b/, "[SHA1]") # 0e32b153039e46d4165c65eef1fc277d0f8f11d2 message.gsub!(/\b\d+\.\d+\.\d+\.\d+\b/, "[IPv4]") # 144.89.172.115 message.gsub!(/\b-?\d+(\.\d+)?\b/, "[NUMBER]") # 42.24 or 42 or -42 message end end end Dir.glob(Rails.root.join('lib', 'blamer', '*.rb')).each do |file| next if file == __FILE__ require file end
SquareSquash/web/lib/blamer/base.rb/0
{ "file_path": "SquareSquash/web/lib/blamer/base.rb", "repo_id": "SquareSquash", "token_count": 3344 }
116
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Worker that decodes a source map from parameters given to the API controller, # and creates the {SourceMap} object. class SourceMapCreator include BackgroundRunner::Job # Creates a new instance and creates the SourceMap. # # @param [Hash] params Parameters passed to the API controller. def self.perform(params) new(params).perform end # Creates a new instance with the given parameters. # # @param [Hash] params Parameters passed to the API controller. def initialize(params) @params = params end # Decodes parameters and creates the SourceMap. def perform project = Project.find_by_api_key(@params['api_key']) or raise(API::UnknownAPIKeyError) project. environments.with_name(@params['environment']).find_or_create!(name: @params['environment']). source_maps.create(raw_map: @params['sourcemap'], revision: @params['revision'], from: @params['from'], to: @params['to']) end end
SquareSquash/web/lib/workers/source_map_creator.rb/0
{ "file_path": "SquareSquash/web/lib/workers/source_map_creator.rb", "repo_id": "SquareSquash", "token_count": 563 }
117
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'rails_helper' RSpec.describe Account::EventsController, type: :controller do include EventDecoration describe "#index" do before :all do membership = FactoryGirl.create(:membership) @env = FactoryGirl.create(:environment, project: membership.project) @bug = FactoryGirl.create(:bug, environment: @env) kinds = ['open', 'comment', 'assign', 'close', 'reopen'] data = {'status' => 'fixed', 'from' => 'closed', 'revision' => '8f29160c367cc3e73c112e34de0ee48c4c323ff7', 'build' => '10010', 'assignee_id' => FactoryGirl.create(:membership, project: @env.project).user_id, 'occurrence_id' => FactoryGirl.create(:rails_occurrence, bug: @bug).id, 'comment_id' => FactoryGirl.create(:comment, bug: @bug, user: membership.user).id} @events = 10.times.map { |i| FactoryGirl.create :event, bug: @bug, user: (i.even? ? @bug.environment.project.owner : membership.user), kind: kinds.sample, data: data } @user = membership.user @user.user_events.delete_all # creating the comment created a watch which copied events over @events.each { |event| FactoryGirl.create :user_event, event: event, user: @user, created_at: event.created_at } end before(:each) { stub_const 'Account::EventsController::PER_PAGE', 5 } # speed it up it "should require a logged-in user" do get :index, format: 'json' expect(response.status).to eql(401) end context '[authenticated]' do before(:each) { login_as @user } it "should load the 50 most recent events" do get :index, format: 'json' expect(response.status).to eql(200) expect(JSON.parse(response.body).map { |e| e['kind'] }).to eql(@events.sort_by(&:created_at).reverse.map(&:kind)[0, 5]) end it "should return the next 50 events when given a last parameter" do @events.sort_by! &:created_at @events.reverse! get :index, last: @events[4].id, format: 'json' expect(response.status).to eql(200) expect(JSON.parse(response.body).map { |e| e['kind'] }).to eql(@events.map(&:kind)[5, 5]) end it "should decorate the response" do get :index, format: 'json' JSON.parse(response.body).zip(@events.sort_by(&:created_at).reverse).each do |(hsh, event)| expect(hsh['icon']).to include(icon_for_event(event)) expect(hsh['user_url']).to eql(user_url(event.user)) expect(hsh['assignee_url']).to eql(user_url(event.assignee)) expect(hsh['occurrence_url']).to eql(project_environment_bug_occurrence_url(@env.project, @env, @bug, event.occurrence)) expect(hsh['comment_body']).to eql(ApplicationController.new.send(:markdown).(event.comment.body)) expect(hsh['resolution_url']).to eql(@bug.resolution_revision) expect(hsh['assignee_you']).to eql(event.assignee == @user) expect(hsh['user_you']).to eql(@user == event.user) end end it "should add the original bug and URL to the JSON for dupe events" do original = FactoryGirl.create :bug dupe = FactoryGirl.create :bug, environment: original.environment FactoryGirl.create :watch, user: @user, bug: dupe dupe.mark_as_duplicate! original get :index, format: 'json' json = JSON.parse(response.body) expect(json.first['kind']).to eql('dupe') expect(json.first['original_url']).to eql(project_environment_bug_url(original.environment.project, original.environment, original)) expect(json.first['original']['number']).to eql(original.number) end end end end
SquareSquash/web/spec/controllers/account/events_controller_spec.rb/0
{ "file_path": "SquareSquash/web/spec/controllers/account/events_controller_spec.rb", "repo_id": "SquareSquash", "token_count": 1803 }
118
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. FactoryGirl.define do factory :event do association :user bug do |obj| membership = FactoryGirl.create(:membership, user: obj.user) FactoryGirl.create :bug, environment: FactoryGirl.create(:environment, project: membership.project) end kind 'open' data('status' => 'fixed', 'from' => 'closed', 'revision' => '8f29160c367cc3e73c112e34de0ee48c4c323ff7') end factory :complex_event, parent: :event do kind 'comment' data { |obj| {comment_id: FactoryGirl.create(:comment, bug: obj.bug, user: FactoryGirl.create(:user, project: obj.bug.project))} } end end
SquareSquash/web/spec/factories/events.rb/0
{ "file_path": "SquareSquash/web/spec/factories/events.rb", "repo_id": "SquareSquash", "token_count": 397 }
119
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'rails_helper' THIS_FILE = Pathname.new(__FILE__).relative_path_from(Rails.root).to_s RSpec.describe OccurrencesWorker do before :all do Project.where(repository_url: 'https://github.com/RISCfuture/better_caller.git').delete_all @project = FactoryGirl.create(:project, repository_url: 'https://github.com/RISCfuture/better_caller.git') @commit = @project.repo.object('HEAD^') # this will be a valid exception but with a stack trace that doesn't make # sense in the context of the project (the files don't actually exist in the # repo). this will test the scenarios where no blamed commits can be found. @exception = nil begin raise ArgumentError, "Well crap" rescue @exception = $! end @line = @exception.backtrace.first.split(':')[1].to_i # get the line number of the first line of the backtrace # this is a valid stack trace in the context of the repo, and will produce # valid blamed commits. @valid_trace = [ {"file" => "lib/better_caller/extensions.rb", "line" => 11, "symbol" => "set_better_backtrace"}, {"file" => "lib/better_caller/extensions.rb", "line" => 4, "symbol" => "set_better_backtrace"}, {"file" => "lib/better_caller/extensions.rb", "line" => 2, "symbol" => nil} ] end before :each do Bug.delete_all @params = Squash::Ruby.send(:exception_info_hash, @exception, Time.now, {}, nil) @params.merge!('api_key' => @project.api_key, 'environment' => 'production', 'revision' => @commit.sha, 'user_data' => {'foo' => 'bar'}) end describe "#initialize" do OccurrencesWorker::REQUIRED_KEYS.each do |key| it "should require the #{key} key" do expect { OccurrencesWorker.new @params.except(key) }.to raise_error(API::InvalidAttributesError) expect { OccurrencesWorker.new @params.merge(key => ' ') }.to raise_error(API::InvalidAttributesError) end end it "should raise an error if the API key is invalid" do expect { OccurrencesWorker.new @params.merge('api_key' => 'not-found') }.to raise_error(API::UnknownAPIKeyError) end it "should create a new environment if one doesn't exist with that name" do @project.environments.delete_all OccurrencesWorker.new(@params).perform expect(@project.environments.pluck(:name)).to eql(%w( production )) end end describe "#perform" do it "attempt to git-fetch if the revision doesn't exist, then skip it if the revision STILL doesn't exist" do allow(Project).to receive(:find_by_api_key!).and_return(@project) expect(@project.repo).to receive(:fetch).once expect { OccurrencesWorker.new(@params.merge('revision' => '10b04c1ed63bec207db6ebdf14d31d2a86006cb4')).perform }.to raise_error(/Unknown revision/) end context "[finding Deploys and revisions]" do it "should associate a Deploy if given a build" do env = FactoryGirl.create(:environment, name: 'production', project: @project) deploy = FactoryGirl.create(:deploy, environment: env, build: '12345') occ = OccurrencesWorker.new(@params.merge('build' => '12345')).perform expect(occ.bug.deploy).to eql(deploy) end it "should create a new Deploy if one doesn't exist and a revision is given" do Deploy.delete_all occ = OccurrencesWorker.new(@params.merge('build' => 'new')).perform expect(occ.bug.deploy.revision).to eql(@commit.sha) expect(occ.bug.deploy.deployed_at).to be_within(1.minute).of(Time.now) expect(occ.bug.deploy.build).to eql('new') end it "should raise an error if the Deploy doesn't exist and no revision is given" do expect { OccurrencesWorker.new(@params.merge('build' => 'not-found', 'revision' => nil)).perform }. to raise_error(API::InvalidAttributesError) end end context "[attributes]" do it "works for js:hosted types" do js_params = @params.merge({ "client" => "javascript", "class_name" => "ReferenceError", "message" => "foo is not defined", "backtraces" => [ { "name" => "Active Thread", "faulted" => true, "backtrace" => [ { "url" => "http://localhost:3000/assets/vendor.js", "line" => 11671, "symbol" => "?", "context" => nil, "type" => "js:hosted" } ] } ], "capture_method" => "onerror", "occurred_at" => "2014-05-26T22:43:31Z", "schema" => "http", "host" => "localhost", "port" => "3000", "path" => "/admin", "query" => "", "user_agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Firefox/28.0", "screen_width" => 1920, "screen_height" => 1200, "window_width" => 1870, "window_height" => 767, "color_depth" => 24 }) occ = OccurrencesWorker.new(js_params).perform expect(occ).to be_kind_of(Occurrence) expect(occ.client).to eql('javascript') expect(occ.bug.environment.name).to eql('production') expect(occ.bug.client).to eql('javascript') end it "should create an occurrence with the given attributes" do occ = OccurrencesWorker.new(@params).perform expect(occ).to be_kind_of(Occurrence) expect(occ.client).to eql('rails') expect(occ.revision).to eql(@commit.sha) expect(occ.message).to eql("Well crap") occ.faulted_backtrace.zip(@exception.backtrace).each do |(element), bt_line| next if bt_line.include?('.java') # we test the java portions of the backtrace elsewhere expect(bt_line.include?("#{element['file']}:#{element['line']}")).to eql(true) expect(bt_line.end_with?(":in `#{element['method']}'")).to(eql(true)) if element['method'] end expect(occ.bug.environment.name).to eql('production') expect(occ.bug.client).to eql('rails') expect(occ.bug.class_name).to eql("ArgumentError") expect(occ.bug.file).to eql(THIS_FILE) expect(occ.bug.line).to eql(@line) expect(occ.bug.blamed_revision).to be_nil expect(occ.bug.message_template).to eql("Well crap") expect(occ.bug.revision).to eql(@commit.sha) end context "[PII filtering]" do it "should filter emails from the occurrence message" do @params['message'] = "Duplicate entry 'foo.2001@example.com' for key 'index_users_on_email'" occ = OccurrencesWorker.new(@params).perform expect(occ.message).to eql("Duplicate entry '[EMAIL?]' for key 'index_users_on_email'") end it "should filter phone numbers from the occurrence message" do @params['message'] = "My phone number is (206) 356-2754." occ = OccurrencesWorker.new(@params).perform expect(occ.message).to eql("My phone number is (206) [PHONE?].") end it "should filter credit card numbers from the occurrence message" do @params['message'] = "I bought this using my 4426-2480-0548-1000 card." occ = OccurrencesWorker.new(@params).perform expect(occ.message).to eql("I bought this using my [CC/BANK?] card.") end it "should filter bank account numbers from the occurrence message" do @params['message'] = "Please remit to 80054810." occ = OccurrencesWorker.new(@params).perform expect(occ.message).to eql("Please remit to [CC/BANK?].") end it "should not perform filtering if filtering is disabled" do @project.update_attribute :disable_message_filtering, true @params['message'] = "Please remit to 80054810." occ = OccurrencesWorker.new(@params).perform expect(occ.message).to eql("Please remit to 80054810.") @project.update_attribute :disable_message_filtering, false end it "should filter PII from the query" do @params['query'] = 'email=foo@bar.com&name=Tim' occ = OccurrencesWorker.new(@params).perform expect(occ.query).to eql('email=[EMAIL?]&name=Tim') end it "should filter PII from the fragment" do @params['fragment'] = 'email=foo@bar.com&name=Tim' occ = OccurrencesWorker.new(@params).perform expect(occ.fragment).to eql('email=[EMAIL?]&name=Tim') end it "should filter PII from the parent_exceptions' messages and instance variables" do @params['parent_exceptions'] = [{"class_name" => "ActiveRecord::RecordNotUnique", "message" => "Mysql2::Error: Duplicate entry 'test@foobar.com' for key 'index_guest_visitors_on_email': UPDATE `guest_visitors` SET `email` = 'test@foobar.com' WHERE `guest_visitors`.`id` = 77870 /* engines/guest/app/controllers/guest/groups_controller.rb:155:in `update' */", "backtraces" => [{"name" => "Active Thread/Fiber", "faulted" => true, "backtrace" => [{"file" => "/app/go/shared/bundle/ruby/2.2.0/gems/mysql2-0.4.1/lib/mysql2/client.rb", "line" => 85, "symbol" => "_query"}, {"file" => "/app/go/shared/bundle/ruby/2.2.0/gems/mysql2-0.4.1/lib/mysql2/client.rb", "line" => 85, "symbol" => "block in query"}]}], "association" => "original_exception", "ivars" => {"original_exception" => {"language" => "ruby", "class_name" => "Mysql2::Error", "inspect" => "#<Mysql2::Error: Duplicate entry 'test@foobar.com' for key 'index_guest_visitors_on_email'>", "yaml" => "--- !ruby/exception:Mysql2::Error\nmessage: Duplicate entry 'test@foobar.com' for key 'index_guest_visitors_on_email'\nserver_version: 50626\nerror_number: 1062\nsql_state: '23000'\n", "json" => "{\"server_version\":50626,\"error_number\":1062,\"sql_state\":\"test@foobar.com\"}", "to_s" => "Duplicate entry 'test@foobar.com' for key 'index_guest_visitors_on_email'"}, "_squash_controller_notified" => true}}] occ = OccurrencesWorker.new(@params).perform expect(occ.parent_exceptions.first['message']).to eql("Mysql2::Error: Duplicate entry '[EMAIL?]' for key 'index_guest_visitors_on_email': UPDATE `guest_visitors` SET `email` = '[EMAIL?]' WHERE `guest_visitors`.`id` = 77870 /* engines/guest/app/controllers/guest/groups_controller.rb:155:in `update' */") expect(occ.parent_exceptions.first['ivars']['original_exception']['inspect']).to eql("#<Mysql2::Error: Duplicate entry '[EMAIL?]' for key 'index_guest_visitors_on_email'>") expect(occ.parent_exceptions.first['ivars']['original_exception']['yaml']).to eql("--- !ruby/exception:Mysql2::Error\nmessage: Duplicate entry '[EMAIL?]' for key 'index_guest_visitors_on_email'\nserver_version: 50626\nerror_number: 1062\nsql_state: '23000'\n") expect(occ.parent_exceptions.first['ivars']['original_exception']['json']).to eql("{\"server_version\":50626,\"error_number\":1062,\"sql_state\":\"[EMAIL?]\"}") expect(occ.parent_exceptions.first['ivars']['original_exception']['to_s']).to eql("Duplicate entry '[EMAIL?]' for key 'index_guest_visitors_on_email'") end it "should filter PII from the session" do @params['session'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.session['email']).to eql('[EMAIL?]') end it "should filter PII from the headers" do @params['headers'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.headers['email']).to eql('[EMAIL?]') end it "should filter PII from the flash" do @params['flash'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.flash['email']).to eql('[EMAIL?]') end it "should filter PII from the params" do @params['params'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.params['email']).to eql('[EMAIL?]') end it "should filter PII from the cookies" do @params['cookies'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.cookies['email']).to eql('[EMAIL?]') end it "should filter PII from the ivars" do @params['ivars'] = {"email" => "test@foobar.com", "other" => "something"} occ = OccurrencesWorker.new(@params).perform expect(occ.ivars['email']).to eql('[EMAIL?]') end end it "should stick any attributes it doesn't recognize into the metadata attribute" do occ = OccurrencesWorker.new(@params.merge('testfoo' => 'testbar')).perform expect(JSON.parse(occ.metadata)['testfoo']).to eql('testbar') end it "should set user agent variables when a user agent is specified" do occ = OccurrencesWorker.new(@params.merge('headers' => {'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3'})).perform expect(occ.browser_name).to eql("Safari") expect(occ.browser_version).to eql("5.1.5") expect(occ.browser_engine).to eql("webkit") expect(occ.browser_os).to eql("OS X 10.7") expect(occ.browser_engine_version).to eql("534.55.3") end it "should remove the SQL query from a SQL error message" do msg = <<-ERR.strip Duplicate entry 'foo@bar.com' for key 'index_users_on_email': UPDATE `users` SET `name` = 'Sancho Sample', `crypted_password` = 'sughwgiuwgbajgw', `updated_at` = '2013-09-23 21:18:37', `email` = 'foo@bar.com' WHERE `id` = 26819622 -- app/controllers/api/v1/user_controller.rb:35 ERR occ = OccurrencesWorker.new(@params.merge('class_name' => 'Mysql::Error', 'message' => msg)).perform expect(JSON.parse(occ.metadata)['message']).to eql("Duplicate entry '[EMAIL?]' for key 'index_users_on_email'") end end context "[blame]" do it "should set the bug's blamed_revision when there's blame to be had" do occ = OccurrencesWorker.new(@params.merge('backtraces' => [{'name' => "Thread 0", 'faulted' => true, 'backtrace' => @valid_trace}])).perform expect(occ.bug.blamed_revision).to eql('30e7c2ff8758f4f19bfbc0a57e26c19ab69d1d44') end it "should match an existing bug by file, line, and class name if no blame is available" do env = @project.environments.where(name: 'production').find_or_create! bug = FactoryGirl.create(:bug, environment: env, file: THIS_FILE, line: @line, class_name: 'ArgumentError') occ = OccurrencesWorker.new(@params).perform expect(occ.bug).to eql(bug) end it "should match an existing bug by file, line, class name, and commit when there's blame to be had" do env = @project.environments.where(name: 'production').find_or_create! bug = FactoryGirl.create(:bug, environment: env, file: 'lib/better_caller/extensions.rb', line: 11, class_name: 'ArgumentError', blamed_revision: '30e7c2ff8758f4f19bfbc0a57e26c19ab69d1d44') occ = OccurrencesWorker.new(@params.merge('backtraces' => [{'name' => "Thread 0", 'faulted' => true, 'backtrace' => @valid_trace}])).perform expect(occ.bug).to eql(bug) end it "should truncate the error message if it exceeds 1,000 characters" do occ = OccurrencesWorker.new(@params.merge('message' => 'a'*1005)).perform expect(occ.bug.message_template).to eql('a'*997 + '...') expect(occ.message).to eql('a'*997 + '...') end it "should use the full SHA1 of a revision if an abbreviated revision is specified" do occ = OccurrencesWorker.new(@params.merge('revision' => @commit.sha[0, 6])).perform expect(occ.revision).to eql(@commit.sha) end end context "[distributed projects]" do it "should create a new bug if the occurrence is associated with a different deploy" do env = @project.environments.where(name: 'production').find_or_create! r1 = @project.repo.object('HEAD^^^').sha r2 = @project.repo.object('HEAD^^').sha r3 = @project.repo.object('HEAD^').sha r4 = @project.repo.object('HEAD').sha Bug.destroy_all # alright, turn your brains up to maximum people # O = occurrence, R = Git revision, D = deploy # D1 is deployed with a bug d1 = FactoryGirl.create(:deploy, environment: env, revision: r1, build: 'D1') # O1 occurs on R1/D1 o1 = OccurrencesWorker.new(@params.merge('build' => 'D1')).perform # Bug should start out open and be associated with d1 bug = o1.bug expect(bug).not_to be_fixed expect(bug).not_to be_fix_deployed expect(bug.deploy).to eql(d1) # R2 is committed and released with D2 (it does not fix the bug) d2 = FactoryGirl.create(:deploy, environment: env, revision: r2, build: 'D2') # O2 occurs o2 = OccurrencesWorker.new(@params.merge('build' => 'D2')).perform # Occurrence should be associated with the original bug; # Bug should still be open expect(o2.bug_id).to eql(bug.id) expect(bug.reload).not_to be_fixed expect(bug).not_to be_fix_deployed # Bug's deploy should be "upgraded"' to D2 expect(bug.deploy).to eql(d2) # R3 is committed (it fixes the bug), but not deployed. Bug is marked as fixed bug.update_attributes fixed: true, resolution_revision: r3 # O3 occurs on a device running R2/D2 (ok nerds, calm down) o3 = OccurrencesWorker.new(@params.merge('build' => 'D2')).perform # Bug should still be marked as fixed expect(o3.bug_id).to eql(bug.id) expect(bug.reload).to be_fixed expect(bug).not_to be_fix_deployed expect(bug.deploy).to eql(d2) # R4/D3 (including R3) is released, some devices upgrade. d3 = FactoryGirl.create(:deploy, environment: env, revision: r4, build: 'D3') # The bug is marked as fix_deployed DeployFixMarker.perform(d3.id) expect(bug.reload).to be_fix_deployed # O4 occurs on a machine still running R2/D2 o4 = OccurrencesWorker.new(@params.merge('build' => 'D2')).perform # Bug should still be marked as fixed expect(o4.bug_id).to eql(bug.id) expect(bug.reload).to be_fixed expect(bug).to be_fix_deployed # O5 occurs on a device running R4/D3 o5 = OccurrencesWorker.new(@params.merge('build' => 'D3')).perform # The occurrence should have itself a new bug expect(o5.bug_id).not_to eql(bug.id) expect(bug.reload).to be_fixed expect(bug).to be_fix_deployed expect(o5.bug).not_to be_fixed expect(o5.bug).not_to be_fix_deployed end end context "[hosted projects]" do it "should reopen a bug only at the proper times" do env = @project.environments.where(name: 'production').find_or_create! r1 = @project.repo.object('HEAD^^^').sha r2 = @project.repo.object('HEAD^^').sha r3 = @project.repo.object('HEAD^').sha r4 = @project.repo.object('HEAD').sha Bug.destroy_all # here we go again... # O = occurrence, R = Git revision # O1 occurs on R1 o1 = OccurrencesWorker.new(@params.merge('revision' => r1)).perform # Bug should start out open bug = o1.bug expect(bug).not_to be_fixed expect(bug).not_to be_fix_deployed expect(bug.deploy).to be_nil # not a distributed project # R2 is committed and deployed (it does not fix the bug) FactoryGirl.create(:deploy, environment: env, revision: r2) # O2 occurs o2 = OccurrencesWorker.new(@params.merge('revision' => r2)).perform # Bug should still be open expect(o2.bug_id).to eql(bug.id) expect(bug.reload).not_to be_fixed expect(bug).not_to be_fix_deployed # R3 is committed (it fixes the bug), but not deployed. Bug is marked as fixed bug.update_attributes fixed: true, resolution_revision: r3 # O3 occurs on a server running R2 o3 = OccurrencesWorker.new(@params.merge('revision' => r2)).perform # Bug should still be marked as fixed expect(o3.bug_id).to eql(bug.id) expect(bug.reload).to be_fixed expect(bug).not_to be_fix_deployed # R4 (including R3) is deployed to some machines. d = FactoryGirl.create(:deploy, environment: env, revision: r4) # The bug is marked as fix_deployed DeployFixMarker.perform(d.id) expect(bug.reload).to be_fix_deployed # O4 occurs on a machine still running R2 o4 = OccurrencesWorker.new(@params.merge('revision' => r2)).perform # Bug should still be marked as fixed expect(o4.bug_id).to eql(bug.id) expect(bug.reload).to be_fixed expect(bug).to be_fix_deployed # R4 is now deployed to all machines d = FactoryGirl.create(:deploy, environment: env, revision: r4) DeployFixMarker.perform(d.id) expect(bug.reload).to be_fix_deployed # O5 occurs on a machine running R4 o5 = OccurrencesWorker.new(@params.merge('revision' => r4)).perform # The bug should be reopened expect(o5.bug_id).to eql(bug.id) expect(bug.reload).not_to be_fixed expect(bug).not_to be_fix_deployed end it "should reopen an existing bug that is fixed, not deployed, and stale" do env = @project.environments.where(name: 'production').find_or_create! bug = FactoryGirl.create(:bug, environment: env, file: THIS_FILE, line: @line, class_name: 'ArgumentError', fixed: true) bug.update_attribute :fixed_at, Time.now - 15.days OccurrencesWorker.new(@params).perform expect(bug.reload).not_to be_fixed expect(bug.fix_deployed?).to eql(false) end it "should set a cause for a bug being reopened" do Deploy.delete_all env = @project.environments.where(name: 'production').find_or_create! bug = FactoryGirl.create(:bug, environment: env, file: THIS_FILE, line: @line, class_name: 'ArgumentError', fixed: true, fix_deployed: true) bug.events.delete_all occ = OccurrencesWorker.new(@params).perform expect(bug.events(true).count).to eql(1) expect(bug.events.first.kind).to eql('reopen') expect(bug.events.first.data['occurrence_id']).to eql(occ.id) end end end end
SquareSquash/web/spec/lib/workers/occurrences_worker_spec.rb/0
{ "file_path": "SquareSquash/web/spec/lib/workers/occurrences_worker_spec.rb", "repo_id": "SquareSquash", "token_count": 13060 }
120
# Copyright 2014 Square Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'rails_helper' RSpec.describe Symbolication, type: :model do context "[hooks]" do it "should symbolicate pending occurrences when created" do if RSpec.configuration.use_transactional_fixtures pending "This is done in an after_commit hook, and it can't be tested with transactional fixtures (which are always rolled back)" end Project.delete_all project = FactoryGirl.create(:project, repository_url: 'https://github.com/RISCfuture/better_caller.git') env = FactoryGirl.create(:environment, project: project) bug = FactoryGirl.create(:bug, file: 'lib/better_caller/extensions.rb', line: 5, environment: env, blamed_revision: '30e7c2ff8758f4f19bfbc0a57e26c19ab69d1d44') occurrence = FactoryGirl.create(:rails_occurrence, revision: '2dc20c984283bede1f45863b8f3b4dd9b5b554cc', symbolication_id: SecureRandom.uuid, bug: bug, backtraces: [{"name" => "Thread 0", "faulted" => true, "backtrace" => [{"file" => "lib/better_caller/extensions.rb", "line" => 5, "symbol" => "foo"}, {"type" => "address", "address" => 1}]}]) expect(occurrence).not_to be_symbolicated symbols = Squash::Symbolicator::Symbols.new symbols.add 1, 5, 'lib/better_caller/extensions.rb', 2, 'bar' FactoryGirl.create :symbolication, uuid: occurrence.symbolication_id, symbols: symbols expect(occurrence.reload).to be_symbolicated expect(occurrence.redirect_target_id).to be_nil end it "should reassign to another bug if blame changes" do if RSpec.configuration.use_transactional_fixtures pending "This is done in an after_commit hook, and it can't be tested with transactional fixtures (which are always rolled back)" end Project.delete_all project = FactoryGirl.create(:project, repository_url: 'https://github.com/RISCfuture/better_caller.git') env = FactoryGirl.create(:environment, project: project) bug1 = FactoryGirl.create(:bug, file: '0x00000042', line: 3, blamed_revision: '30e7c2ff8758f4f19bfbc0a57e26c19ab69d1d44', environment: env) bug2 = FactoryGirl.create(:bug, file: 'lib/better_caller/extensions.rb', line: 5, blamed_revision: '30e7c2ff8758f4f19bfbc0a57e26c19ab69d1d44', environment: env) occurrence = FactoryGirl.create(:rails_occurrence, bug: bug1, symbolication_id: SecureRandom.uuid, revision: bug1.blamed_revision, backtraces: [{"name" => "Thread 0", "faulted" => true, "backtrace" => [{"type" => "address", "address" => 3}]}]) symbols = Squash::Symbolicator::Symbols.new symbols.add 1, 5, 'lib/better_caller/extensions.rb', 5, 'bar' FactoryGirl.create :symbolication, uuid: occurrence.symbolication_id, symbols: symbols expect(bug2.occurrences.count).to eql(1) o2 = bug2.occurrences.first expect(occurrence.reload.redirect_target_id).to eql(o2.id) end end describe "#symbolicate" do before :each do symbols = Squash::Symbolicator::Symbols.new symbols.add 1, 10, 'foo.rb', 4, 'bar' symbols.add 16, 20, 'foo2.rb', 15, 'baz' lines = Squash::Symbolicator::Lines.new lines.add 1, 'foo.rb', 5, 1 lines.add 5, 'foo.rb', 7, 1 lines.add 12, 'foo.rb', 12, 1 @symbolication = FactoryGirl.build(:symbolication, symbols: symbols, lines: lines) end it "should symbolicate an address using lines" do expect(@symbolication.symbolicate(12)).to eql( 'file' => 'foo.rb', 'line' => 12 ) end it "should symbolicate an address using symbols" do expect(@symbolication.symbolicate(16)).to eql( 'file' => 'foo2.rb', 'line' => 15, 'symbol' => 'baz' ) end it "should symbolicate an address using lines and symbols" do expect(@symbolication.symbolicate(5)).to eql( 'file' => 'foo.rb', 'line' => 7, 'symbol' => 'bar' ) end it "should return nil for unsymbolicatable addresses" do expect(@symbolication.symbolicate(50)).to be_nil end end end
SquareSquash/web/spec/models/symbolication_spec.rb/0
{ "file_path": "SquareSquash/web/spec/models/symbolication_spec.rb", "repo_id": "SquareSquash", "token_count": 3448 }
121
(function(exports){ var cubism = exports.cubism = {version: "1.2.0"}; var cubism_id = 0; function cubism_identity(d) { return d; } cubism.option = function(name, defaultValue) { var values = cubism.options(name); return values.length ? values[0] : defaultValue; }; cubism.options = function(name, defaultValues) { var options = location.search.substring(1).split("&"), values = [], i = -1, n = options.length, o; while (++i < n) { if ((o = options[i].split("="))[0] == name) { values.push(decodeURIComponent(o[1])); } } return values.length || arguments.length < 2 ? values : defaultValues; }; cubism.context = function() { var context = new cubism_context, step = 1e4, // ten seconds, in milliseconds size = 1440, // four hours at ten seconds, in pixels start0, stop0, // the start and stop for the previous change event start1, stop1, // the start and stop for the next prepare event serverDelay = 5e3, clientDelay = 5e3, event = d3.dispatch("prepare", "beforechange", "change", "focus"), scale = context.scale = d3.time.scale().range([0, size]), timeout, focus; function update() { var now = Date.now(); stop0 = new Date(Math.floor((now - serverDelay - clientDelay) / step) * step); start0 = new Date(stop0 - size * step); stop1 = new Date(Math.floor((now - serverDelay) / step) * step); start1 = new Date(stop1 - size * step); scale.domain([start0, stop0]); return context; } context.start = function() { if (timeout) clearTimeout(timeout); var delay = +stop1 + serverDelay - Date.now(); // If we're too late for the first prepare event, skip it. if (delay < clientDelay) delay += step; timeout = setTimeout(function prepare() { stop1 = new Date(Math.floor((Date.now() - serverDelay) / step) * step); start1 = new Date(stop1 - size * step); event.prepare.call(context, start1, stop1); setTimeout(function() { scale.domain([start0 = start1, stop0 = stop1]); event.beforechange.call(context, start1, stop1); event.change.call(context, start1, stop1); event.focus.call(context, focus); }, clientDelay); timeout = setTimeout(prepare, step); }, delay); return context; }; context.stop = function() { timeout = clearTimeout(timeout); return context; }; timeout = setTimeout(context.start, 10); // Set or get the step interval in milliseconds. // Defaults to ten seconds. context.step = function(_) { if (!arguments.length) return step; step = +_; return update(); }; // Set or get the context size (the count of metric values). // Defaults to 1440 (four hours at ten seconds). context.size = function(_) { if (!arguments.length) return size; scale.range([0, size = +_]); return update(); }; // The server delay is the amount of time we wait for the server to compute a // metric. This delay may result from clock skew or from delays collecting // metrics from various hosts. Defaults to 4 seconds. context.serverDelay = function(_) { if (!arguments.length) return serverDelay; serverDelay = +_; return update(); }; // The client delay is the amount of additional time we wait to fetch those // metrics from the server. The client and server delay combined represent the // age of the most recent displayed metric. Defaults to 1 second. context.clientDelay = function(_) { if (!arguments.length) return clientDelay; clientDelay = +_; return update(); }; // Sets the focus to the specified index, and dispatches a "focus" event. context.focus = function(i) { event.focus.call(context, focus = i); return context; }; // Add, remove or get listeners for events. context.on = function(type, listener) { if (arguments.length < 2) return event.on(type); event.on(type, listener); // Notify the listener of the current start and stop time, as appropriate. // This way, metrics can make requests for data immediately, // and likewise the axis can display itself synchronously. if (listener != null) { if (/^prepare(\.|$)/.test(type)) listener.call(context, start1, stop1); if (/^beforechange(\.|$)/.test(type)) listener.call(context, start0, stop0); if (/^change(\.|$)/.test(type)) listener.call(context, start0, stop0); if (/^focus(\.|$)/.test(type)) listener.call(context, focus); } return context; }; d3.select(window).on("keydown.context-" + ++cubism_id, function() { switch (!d3.event.metaKey && d3.event.keyCode) { case 37: // left if (focus == null) focus = size - 1; if (focus > 0) context.focus(--focus); break; case 39: // right if (focus == null) focus = size - 2; if (focus < size - 1) context.focus(++focus); break; default: return; } d3.event.preventDefault(); }); return update(); }; function cubism_context() {} var cubism_contextPrototype = cubism.context.prototype = cubism_context.prototype; cubism_contextPrototype.constant = function(value) { return new cubism_metricConstant(this, +value); }; cubism_contextPrototype.cube = function(host) { if (!arguments.length) host = ""; var source = {}, context = this; source.metric = function(expression) { return context.metric(function(start, stop, step, callback) { d3.json(host + "/1.0/metric" + "?expression=" + encodeURIComponent(expression) + "&start=" + cubism_cubeFormatDate(start) + "&stop=" + cubism_cubeFormatDate(stop) + "&step=" + step, function(data) { if (!data) return callback(new Error("unable to load data")); callback(null, data.map(function(d) { return d.value; })); }); }, expression += ""); }; // Returns the Cube host. source.toString = function() { return host; }; return source; }; var cubism_cubeFormatDate = d3.time.format.iso; cubism_contextPrototype.graphite = function(host) { if (!arguments.length) host = ""; var source = {}, context = this; source.metric = function(expression) { var sum = "sum"; var metric = context.metric(function(start, stop, step, callback) { var target = expression; // Apply the summarize, if necessary. if (step !== 1e4) target = "summarize(" + target + ",'" + (!(step % 36e5) ? step / 36e5 + "hour" : !(step % 6e4) ? step / 6e4 + "min" : step + "sec") + "','" + sum + "')"; d3.text(host + "/render?format=raw" + "&target=" + encodeURIComponent("alias(" + target + ",'')") + "&from=" + cubism_graphiteFormatDate(start - 2 * step) // off-by-two? + "&until=" + cubism_graphiteFormatDate(stop - 1000), function(text) { if (!text) return callback(new Error("unable to load data")); callback(null, cubism_graphiteParse(text)); }); }, expression += ""); metric.summarize = function(_) { sum = _; return metric; }; return metric; }; source.find = function(pattern, callback) { d3.json(host + "/metrics/find?format=completer" + "&query=" + encodeURIComponent(pattern), function(result) { if (!result) return callback(new Error("unable to find metrics")); callback(null, result.metrics.map(function(d) { return d.path; })); }); }; // Returns the graphite host. source.toString = function() { return host; }; return source; }; // Graphite understands seconds since UNIX epoch. function cubism_graphiteFormatDate(time) { return Math.floor(time / 1000); } // Helper method for parsing graphite's raw format. function cubism_graphiteParse(text) { var i = text.indexOf("|"), meta = text.substring(0, i), c = meta.lastIndexOf(","), b = meta.lastIndexOf(",", c - 1), a = meta.lastIndexOf(",", b - 1), start = meta.substring(a + 1, b) * 1000, step = meta.substring(c + 1) * 1000; return text .substring(i + 1) .split(",") .slice(1) // the first value is always None? .map(function(d) { return +d; }); } function cubism_metric(context) { if (!(context instanceof cubism_context)) throw new Error("invalid context"); this.context = context; } var cubism_metricPrototype = cubism_metric.prototype; cubism.metric = cubism_metric; cubism_metricPrototype.valueAt = function() { return NaN; }; cubism_metricPrototype.alias = function(name) { this.toString = function() { return name; }; return this; }; cubism_metricPrototype.extent = function() { var i = 0, n = this.context.size(), value, min = Infinity, max = -Infinity; while (++i < n) { value = this.valueAt(i); if (value < min) min = value; if (value > max) max = value; } return [min, max]; }; cubism_metricPrototype.on = function(type, listener) { return arguments.length < 2 ? null : this; }; cubism_metricPrototype.shift = function() { return this; }; cubism_metricPrototype.on = function() { return arguments.length < 2 ? null : this; }; cubism_contextPrototype.metric = function(request, name) { var context = this, metric = new cubism_metric(context), id = ".metric-" + ++cubism_id, start = -Infinity, stop, step = context.step(), size = context.size(), values = [], event = d3.dispatch("change"), listening = 0, fetching; // Prefetch new data into a temporary array. function prepare(start1, stop) { var steps = Math.min(size, Math.round((start1 - start) / step)); if (!steps || fetching) return; // already fetched, or fetching! fetching = true; steps = Math.min(size, steps + cubism_metricOverlap); var start0 = new Date(stop - steps * step); request(start0, stop, step, function(error, data) { fetching = false; if (error) return console.warn(error); var i = isFinite(start) ? Math.round((start0 - start) / step) : 0; for (var j = 0, m = data.length; j < m; ++j) values[j + i] = data[j]; event.change.call(metric, start, stop); }); } // When the context changes, switch to the new data, ready-or-not! function beforechange(start1, stop1) { if (!isFinite(start)) start = start1; values.splice(0, Math.max(0, Math.min(size, Math.round((start1 - start) / step)))); start = start1; stop = stop1; } // metric.valueAt = function(i) { return values[i]; }; // metric.shift = function(offset) { return context.metric(cubism_metricShift(request, +offset)); }; // metric.on = function(type, listener) { if (!arguments.length) return event.on(type); // If there are no listeners, then stop listening to the context, // and avoid unnecessary fetches. if (listener == null) { if (event.on(type) != null && --listening == 0) { context.on("prepare" + id, null).on("beforechange" + id, null); } } else { if (event.on(type) == null && ++listening == 1) { context.on("prepare" + id, prepare).on("beforechange" + id, beforechange); } } event.on(type, listener); // Notify the listener of the current start and stop time, as appropriate. // This way, charts can display synchronous metrics immediately. if (listener != null) { if (/^change(\.|$)/.test(type)) listener.call(context, start, stop); } return metric; }; // if (arguments.length > 1) metric.toString = function() { return name; }; return metric; }; // Number of metric to refetch each period, in case of lag. var cubism_metricOverlap = 6; // Wraps the specified request implementation, and shifts time by the given offset. function cubism_metricShift(request, offset) { return function(start, stop, step, callback) { request(new Date(+start + offset), new Date(+stop + offset), step, callback); }; } function cubism_metricConstant(context, value) { cubism_metric.call(this, context); value = +value; var name = value + ""; this.valueOf = function() { return value; }; this.toString = function() { return name; }; } var cubism_metricConstantPrototype = cubism_metricConstant.prototype = Object.create(cubism_metric.prototype); cubism_metricConstantPrototype.valueAt = function() { return +this; }; cubism_metricConstantPrototype.extent = function() { return [+this, +this]; }; function cubism_metricOperator(name, operate) { function cubism_metricOperator(left, right) { if (!(right instanceof cubism_metric)) right = new cubism_metricConstant(left.context, right); else if (left.context !== right.context) throw new Error("mismatch context"); cubism_metric.call(this, left.context); this.left = left; this.right = right; this.toString = function() { return left + " " + name + " " + right; }; } var cubism_metricOperatorPrototype = cubism_metricOperator.prototype = Object.create(cubism_metric.prototype); cubism_metricOperatorPrototype.valueAt = function(i) { return operate(this.left.valueAt(i), this.right.valueAt(i)); }; cubism_metricOperatorPrototype.shift = function(offset) { return new cubism_metricOperator(this.left.shift(offset), this.right.shift(offset)); }; cubism_metricOperatorPrototype.on = function(type, listener) { if (arguments.length < 2) return this.left.on(type); this.left.on(type, listener); this.right.on(type, listener); return this; }; return function(right) { return new cubism_metricOperator(this, right); }; } cubism_metricPrototype.add = cubism_metricOperator("+", function(left, right) { return left + right; }); cubism_metricPrototype.subtract = cubism_metricOperator("-", function(left, right) { return left - right; }); cubism_metricPrototype.multiply = cubism_metricOperator("*", function(left, right) { return left * right; }); cubism_metricPrototype.divide = cubism_metricOperator("/", function(left, right) { return left / right; }); cubism_contextPrototype.horizon = function() { var context = this, mode = "offset", buffer = document.createElement("canvas"), width = buffer.width = context.size(), height = buffer.height = 30, scale = d3.scale.linear().interpolate(d3.interpolateRound), metric = cubism_identity, extent = null, title = cubism_identity, format = d3.format(".2s"), colors = ["#08519c","#3182bd","#6baed6","#bdd7e7","#bae4b3","#74c476","#31a354","#006d2c"]; function horizon(selection) { selection .on("mousemove.horizon", function() { context.focus(d3.mouse(this)[0]); }) .on("mouseout.horizon", function() { context.focus(null); }); selection.append("canvas") .attr("width", width) .attr("height", height); selection.append("span") .attr("class", "title") .text(title); selection.append("span") .attr("class", "value"); selection.each(function(d, i) { var that = this, id = ++cubism_id, metric_ = typeof metric === "function" ? metric.call(that, d, i) : metric, colors_ = typeof colors === "function" ? colors.call(that, d, i) : colors, extent_ = typeof extent === "function" ? extent.call(that, d, i) : extent, start = -Infinity, step = context.step(), canvas = d3.select(that).select("canvas"), span = d3.select(that).select(".value"), max_, m = colors_.length >> 1, ready; canvas.datum({id: id, metric: metric_}); canvas = canvas.node().getContext("2d"); function change(start1, stop) { canvas.save(); // compute the new extent and ready flag var extent = metric_.extent(); ready = extent.every(isFinite); if (extent_ != null) extent = extent_; // if this is an update (with no extent change), copy old values! var i0 = 0, max = Math.max(-extent[0], extent[1]); if (this === context) { if (max == max_) { i0 = width - cubism_metricOverlap; var dx = (start1 - start) / step; if (dx < width) { var canvas0 = buffer.getContext("2d"); canvas0.clearRect(0, 0, width, height); canvas0.drawImage(canvas.canvas, dx, 0, width - dx, height, 0, 0, width - dx, height); canvas.clearRect(0, 0, width, height); canvas.drawImage(canvas0.canvas, 0, 0); } } start = start1; } // update the domain scale.domain([0, max_ = max]); // clear for the new data canvas.clearRect(i0, 0, width - i0, height); // record whether there are negative values to display var negative; // positive bands for (var j = 0; j < m; ++j) { canvas.fillStyle = colors_[m + j]; // Adjust the range based on the current band index. var y0 = (j - m + 1) * height; scale.range([m * height + y0, y0]); y0 = scale(0); for (var i = i0, n = width, y1; i < n; ++i) { y1 = metric_.valueAt(i); if (y1 <= 0) { negative = true; continue; } canvas.fillRect(i, y1 = scale(y1), 1, y0 - y1); } } if (negative) { // enable offset mode if (mode === "offset") { canvas.translate(0, height); canvas.scale(1, -1); } // negative bands for (var j = 0; j < m; ++j) { canvas.fillStyle = colors_[m - 1 - j]; // Adjust the range based on the current band index. var y0 = (j - m + 1) * height; scale.range([m * height + y0, y0]); y0 = scale(0); for (var i = i0, n = width, y1; i < n; ++i) { y1 = metric_.valueAt(i); if (y1 >= 0) continue; canvas.fillRect(i, scale(-y1), 1, y0 - scale(-y1)); } } } canvas.restore(); } function focus(i) { if (i == null) i = width - 1; var value = metric_.valueAt(i); span.datum(value).text(isNaN(value) ? null : format); } // Update the chart when the context changes. context.on("change.horizon-" + id, change); context.on("focus.horizon-" + id, focus); // Display the first metric change immediately, // but defer subsequent updates to the canvas change. // Note that someone still needs to listen to the metric, // so that it continues to update automatically. metric_.on("change.horizon-" + id, function(start, stop) { change(start, stop), focus(); if (ready) metric_.on("change.horizon-" + id, cubism_identity); }); }); } horizon.remove = function(selection) { selection .on("mousemove.horizon", null) .on("mouseout.horizon", null); selection.selectAll("canvas") .each(remove) .remove(); selection.selectAll(".title,.value") .remove(); function remove(d) { d.metric.on("change.horizon-" + d.id, null); context.on("change.horizon-" + d.id, null); context.on("focus.horizon-" + d.id, null); } }; horizon.mode = function(_) { if (!arguments.length) return mode; mode = _ + ""; return horizon; }; horizon.height = function(_) { if (!arguments.length) return height; buffer.height = height = +_; return horizon; }; horizon.metric = function(_) { if (!arguments.length) return metric; metric = _; return horizon; }; horizon.scale = function(_) { if (!arguments.length) return scale; scale = _; return horizon; }; horizon.extent = function(_) { if (!arguments.length) return extent; extent = _; return horizon; }; horizon.title = function(_) { if (!arguments.length) return title; title = _; return horizon; }; horizon.format = function(_) { if (!arguments.length) return format; format = _; return horizon; }; horizon.colors = function(_) { if (!arguments.length) return colors; colors = _; return horizon; }; return horizon; }; cubism_contextPrototype.comparison = function() { var context = this, width = context.size(), height = 120, scale = d3.scale.linear().interpolate(d3.interpolateRound), primary = function(d) { return d[0]; }, secondary = function(d) { return d[1]; }, extent = null, title = cubism_identity, formatPrimary = cubism_comparisonPrimaryFormat, formatChange = cubism_comparisonChangeFormat, colors = ["#9ecae1", "#225b84", "#a1d99b", "#22723a"], strokeWidth = 1.5; function comparison(selection) { selection .on("mousemove.comparison", function() { context.focus(d3.mouse(this)[0]); }) .on("mouseout.comparison", function() { context.focus(null); }); selection.append("canvas") .attr("width", width) .attr("height", height); selection.append("span") .attr("class", "title") .text(title); selection.append("span") .attr("class", "value primary"); selection.append("span") .attr("class", "value change"); selection.each(function(d, i) { var that = this, id = ++cubism_id, primary_ = typeof primary === "function" ? primary.call(that, d, i) : primary, secondary_ = typeof secondary === "function" ? secondary.call(that, d, i) : secondary, extent_ = typeof extent === "function" ? extent.call(that, d, i) : extent, div = d3.select(that), canvas = div.select("canvas"), spanPrimary = div.select(".value.primary"), spanChange = div.select(".value.change"), ready; canvas.datum({id: id, primary: primary_, secondary: secondary_}); canvas = canvas.node().getContext("2d"); function change(start, stop) { canvas.save(); canvas.clearRect(0, 0, width, height); // update the scale var primaryExtent = primary_.extent(), secondaryExtent = secondary_.extent(), extent = extent_ == null ? primaryExtent : extent_; scale.domain(extent).range([height, 0]); ready = primaryExtent.concat(secondaryExtent).every(isFinite); // consistent overplotting var round = start / context.step() & 1 ? cubism_comparisonRoundOdd : cubism_comparisonRoundEven; // positive changes canvas.fillStyle = colors[2]; for (var i = 0, n = width; i < n; ++i) { var y0 = scale(primary_.valueAt(i)), y1 = scale(secondary_.valueAt(i)); if (y0 < y1) canvas.fillRect(round(i), y0, 1, y1 - y0); } // negative changes canvas.fillStyle = colors[0]; for (i = 0; i < n; ++i) { var y0 = scale(primary_.valueAt(i)), y1 = scale(secondary_.valueAt(i)); if (y0 > y1) canvas.fillRect(round(i), y1, 1, y0 - y1); } // positive values canvas.fillStyle = colors[3]; for (i = 0; i < n; ++i) { var y0 = scale(primary_.valueAt(i)), y1 = scale(secondary_.valueAt(i)); if (y0 <= y1) canvas.fillRect(round(i), y0, 1, strokeWidth); } // negative values canvas.fillStyle = colors[1]; for (i = 0; i < n; ++i) { var y0 = scale(primary_.valueAt(i)), y1 = scale(secondary_.valueAt(i)); if (y0 > y1) canvas.fillRect(round(i), y0 - strokeWidth, 1, strokeWidth); } canvas.restore(); } function focus(i) { if (i == null) i = width - 1; var valuePrimary = primary_.valueAt(i), valueSecondary = secondary_.valueAt(i), valueChange = (valuePrimary - valueSecondary) / valueSecondary; spanPrimary .datum(valuePrimary) .text(isNaN(valuePrimary) ? null : formatPrimary); spanChange .datum(valueChange) .text(isNaN(valueChange) ? null : formatChange) .attr("class", "value change " + (valueChange > 0 ? "positive" : valueChange < 0 ? "negative" : "")); } // Display the first primary change immediately, // but defer subsequent updates to the context change. // Note that someone still needs to listen to the metric, // so that it continues to update automatically. primary_.on("change.comparison-" + id, firstChange); secondary_.on("change.comparison-" + id, firstChange); function firstChange(start, stop) { change(start, stop), focus(); if (ready) { primary_.on("change.comparison-" + id, cubism_identity); secondary_.on("change.comparison-" + id, cubism_identity); } } // Update the chart when the context changes. context.on("change.comparison-" + id, change); context.on("focus.comparison-" + id, focus); }); } comparison.remove = function(selection) { selection .on("mousemove.comparison", null) .on("mouseout.comparison", null); selection.selectAll("canvas") .each(remove) .remove(); selection.selectAll(".title,.value") .remove(); function remove(d) { d.primary.on("change.comparison-" + d.id, null); d.secondary.on("change.comparison-" + d.id, null); context.on("change.comparison-" + d.id, null); context.on("focus.comparison-" + d.id, null); } }; comparison.height = function(_) { if (!arguments.length) return height; height = +_; return comparison; }; comparison.primary = function(_) { if (!arguments.length) return primary; primary = _; return comparison; }; comparison.secondary = function(_) { if (!arguments.length) return secondary; secondary = _; return comparison; }; comparison.scale = function(_) { if (!arguments.length) return scale; scale = _; return comparison; }; comparison.extent = function(_) { if (!arguments.length) return extent; extent = _; return comparison; }; comparison.title = function(_) { if (!arguments.length) return title; title = _; return comparison; }; comparison.formatPrimary = function(_) { if (!arguments.length) return formatPrimary; formatPrimary = _; return comparison; }; comparison.formatChange = function(_) { if (!arguments.length) return formatChange; formatChange = _; return comparison; }; comparison.colors = function(_) { if (!arguments.length) return colors; colors = _; return comparison; }; comparison.strokeWidth = function(_) { if (!arguments.length) return strokeWidth; strokeWidth = _; return comparison; }; return comparison; }; var cubism_comparisonPrimaryFormat = d3.format(".2s"), cubism_comparisonChangeFormat = d3.format("+.0%"); function cubism_comparisonRoundEven(i) { return i & 0xfffffe; } function cubism_comparisonRoundOdd(i) { return ((i + 1) & 0xfffffe) - 1; } cubism_contextPrototype.axis = function() { var context = this, scale = context.scale, axis_ = d3.svg.axis().scale(scale); var format = context.step() < 6e4 ? cubism_axisFormatSeconds : context.step() < 864e5 ? cubism_axisFormatMinutes : cubism_axisFormatDays; function axis(selection) { var id = ++cubism_id, tick; var g = selection.append("svg") .datum({id: id}) .attr("width", context.size()) .attr("height", Math.max(28, -axis.tickSize())) .append("g") .attr("transform", "translate(0," + (axis_.orient() === "top" ? 27 : 4) + ")") .call(axis_); context.on("change.axis-" + id, function() { g.call(axis_); if (!tick) tick = d3.select(g.node().appendChild(g.selectAll("text").node().cloneNode(true))) .style("display", "none") .text(null); }); context.on("focus.axis-" + id, function(i) { if (tick) { if (i == null) { tick.style("display", "none"); g.selectAll("text").style("fill-opacity", null); } else { tick.style("display", null).attr("x", i).text(format(scale.invert(i))); var dx = tick.node().getComputedTextLength() + 6; g.selectAll("text").style("fill-opacity", function(d) { return Math.abs(scale(d) - i) < dx ? 0 : 1; }); } } }); } axis.remove = function(selection) { selection.selectAll("svg") .each(remove) .remove(); function remove(d) { context.on("change.axis-" + d.id, null); context.on("focus.axis-" + d.id, null); } }; return d3.rebind(axis, axis_, "orient", "ticks", "tickSubdivide", "tickSize", "tickPadding", "tickFormat"); }; var cubism_axisFormatSeconds = d3.time.format("%I:%M:%S %p"), cubism_axisFormatMinutes = d3.time.format("%I:%M %p"), cubism_axisFormatDays = d3.time.format("%B %d"); cubism_contextPrototype.rule = function() { var context = this, metric = cubism_identity; function rule(selection) { var id = ++cubism_id; var line = selection.append("div") .datum({id: id}) .attr("class", "line") .call(cubism_ruleStyle); selection.each(function(d, i) { var that = this, id = ++cubism_id, metric_ = typeof metric === "function" ? metric.call(that, d, i) : metric; if (!metric_) return; function change(start, stop) { var values = []; for (var i = 0, n = context.size(); i < n; ++i) { if (metric_.valueAt(i)) { values.push(i); } } var lines = selection.selectAll(".metric").data(values); lines.exit().remove(); lines.enter().append("div").attr("class", "metric line").call(cubism_ruleStyle); lines.style("left", cubism_ruleLeft); } context.on("change.rule-" + id, change); metric_.on("change.rule-" + id, change); }); context.on("focus.rule-" + id, function(i) { line.datum(i) .style("display", i == null ? "none" : null) .style("left", cubism_ruleLeft); }); } rule.remove = function(selection) { selection.selectAll(".line") .each(remove) .remove(); function remove(d) { context.on("focus.rule-" + d.id, null); } }; rule.metric = function(_) { if (!arguments.length) return metric; metric = _; return rule; }; return rule; }; function cubism_ruleStyle(line) { line .style("position", "absolute") .style("top", 0) .style("bottom", 0) .style("width", "1px") .style("pointer-events", "none"); } function cubism_ruleLeft(i) { return i + "px"; } })(this);
SquareSquash/web/vendor/assets/javascripts/cubism.js/0
{ "file_path": "SquareSquash/web/vendor/assets/javascripts/cubism.js", "repo_id": "SquareSquash", "token_count": 12608 }
122
/* Pretty handling of time axes. Copyright (c) 2007-2012 IOLA and Ole Laursen. Licensed under the MIT license. Set axis.mode to "time" to enable. See the section "Time series data" in API.txt for details. */ (function($) { var options = {}; // round to nearby lower multiple of base function floorInBase(n, base) { return base * Math.floor(n / base); } // Returns a string with the date d formatted according to fmt. // A subset of the Open Group's strftime format is supported. function formatDate(d, fmt, monthNames, dayNames) { if (typeof d.strftime == "function") { return d.strftime(fmt); } var leftPad = function(n, pad) { n = "" + n; pad = "" + (pad == null ? "0" : pad); return n.length == 1 ? pad + n : n; }; var r = []; var escape = false; var hours = d.getHours(); var isAM = hours < 12; if (monthNames == null) { monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; } if (dayNames == null) { dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; } var hours12; if (hours > 12) { hours12 = hours - 12; } else if (hours == 0) { hours12 = 12; } else { hours12 = hours; } for (var i = 0; i < fmt.length; ++i) { var c = fmt.charAt(i); if (escape) { switch (c) { case 'a': c = "" + dayNames[d.getDay()]; break; case 'b': c = "" + monthNames[d.getMonth()]; break; case 'd': c = leftPad(d.getDate()); break; case 'e': c = leftPad(d.getDate(), " "); break; case 'H': c = leftPad(hours); break; case 'I': c = leftPad(hours12); break; case 'l': c = leftPad(hours12, " "); break; case 'm': c = leftPad(d.getMonth() + 1); break; case 'M': c = leftPad(d.getMinutes()); break; // quarters not in Open Group's strftime specification case 'q': c = "" + (Math.floor(d.getMonth() / 3) + 1); break; case 'S': c = leftPad(d.getSeconds()); break; case 'y': c = leftPad(d.getFullYear() % 100); break; case 'Y': c = "" + d.getFullYear(); break; case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break; case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break; case 'w': c = "" + d.getDay(); break; } r.push(c); escape = false; } else { if (c == "%") { escape = true; } else { r.push(c); } } } return r.join(""); } // To have a consistent view of time-based data independent of which time // zone the client happens to be in we need a date-like object independent // of time zones. This is done through a wrapper that only calls the UTC // versions of the accessor methods. function makeUtcWrapper(d) { function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) { sourceObj[sourceMethod] = function() { return targetObj[targetMethod].apply(targetObj, arguments); }; }; var utc = { date: d }; // support strftime, if found if (d.strftime != undefined) { addProxyMethod(utc, "strftime", d, "strftime"); } addProxyMethod(utc, "getTime", d, "getTime"); addProxyMethod(utc, "setTime", d, "setTime"); var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"]; for (var p = 0; p < props.length; p++) { addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]); addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]); } return utc; }; // select time zone strategy. This returns a date-like object tied to the // desired timezone function dateGenerator(ts, opts) { if (opts.timezone == "browser") { return new Date(ts); } else if (!opts.timezone || opts.timezone == "utc") { return makeUtcWrapper(new Date(ts)); } else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") { var d = new timezoneJS.Date(); // timezone-js is fickle, so be sure to set the time zone before // setting the time. d.setTimezone(opts.timezone); d.setTime(ts); return d; } else { return makeUtcWrapper(new Date(ts)); } } // map of app. size of time units in milliseconds var timeUnitSize = { "second": 1000, "minute": 60 * 1000, "hour": 60 * 60 * 1000, "day": 24 * 60 * 60 * 1000, "month": 30 * 24 * 60 * 60 * 1000, "quarter": 3 * 30 * 24 * 60 * 60 * 1000, "year": 365.2425 * 24 * 60 * 60 * 1000 }; // the allowed tick sizes, after 1 year we use // an integer algorithm var baseSpec = [ [1, "second"], [2, "second"], [5, "second"], [10, "second"], [30, "second"], [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"], [30, "minute"], [1, "hour"], [2, "hour"], [4, "hour"], [8, "hour"], [12, "hour"], [1, "day"], [2, "day"], [3, "day"], [0.25, "month"], [0.5, "month"], [1, "month"], [2, "month"] ]; // we don't know which variant(s) we'll need yet, but generating both is // cheap var specMonths = baseSpec.concat([[3, "month"], [6, "month"], [1, "year"]]); var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"], [1, "year"]]); function init(plot) { plot.hooks.processDatapoints.push(function (plot, series, datapoints) { $.each(plot.getAxes(), function(axisName, axis) { var opts = axis.options; if (opts.mode == "time") { axis.tickGenerator = function(axis) { var ticks = []; var d = dateGenerator(axis.min, opts); var minSize = 0; // make quarter use a possibility if quarters are // mentioned in either of these options var spec = (opts.tickSize && opts.tickSize[1] === "quarter") || (opts.minTickSize && opts.minTickSize[1] === "quarter") ? specQuarters : specMonths; if (opts.minTickSize != null) { if (typeof opts.tickSize == "number") { minSize = opts.tickSize; } else { minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]]; } } for (var i = 0; i < spec.length - 1; ++i) { if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]] + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 && spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) { break; } } var size = spec[i][0]; var unit = spec[i][1]; // special-case the possibility of several years if (unit == "year") { // if given a minTickSize in years, just use it, // ensuring that it's an integer if (opts.minTickSize != null && opts.minTickSize[1] == "year") { size = Math.floor(opts.minTickSize[0]); } else { var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10)); var norm = (axis.delta / timeUnitSize.year) / magn; if (norm < 1.5) { size = 1; } else if (norm < 3) { size = 2; } else if (norm < 7.5) { size = 5; } else { size = 10; } size *= magn; } // minimum size for years is 1 if (size < 1) { size = 1; } } axis.tickSize = opts.tickSize || [size, unit]; var tickSize = axis.tickSize[0]; unit = axis.tickSize[1]; var step = tickSize * timeUnitSize[unit]; if (unit == "second") { d.setSeconds(floorInBase(d.getSeconds(), tickSize)); } else if (unit == "minute") { d.setMinutes(floorInBase(d.getMinutes(), tickSize)); } else if (unit == "hour") { d.setHours(floorInBase(d.getHours(), tickSize)); } else if (unit == "month") { d.setMonth(floorInBase(d.getMonth(), tickSize)); } else if (unit == "quarter") { d.setMonth(3 * floorInBase(d.getMonth() / 3, tickSize)); } else if (unit == "year") { d.setFullYear(floorInBase(d.getFullYear(), tickSize)); } // reset smaller components d.setMilliseconds(0); if (step >= timeUnitSize.minute) { d.setSeconds(0); } else if (step >= timeUnitSize.hour) { d.setMinutes(0); } else if (step >= timeUnitSize.day) { d.setHours(0); } else if (step >= timeUnitSize.day * 4) { d.setDate(1); } else if (step >= timeUnitSize.month * 2) { d.setMonth(floorInBase(d.getMonth(), 3)); } else if (step >= timeUnitSize.quarter * 2) { d.setMonth(floorInBase(d.getMonth(), 6)); } else if (step >= timeUnitSize.year) { d.setMonth(0); } var carry = 0; var v = Number.NaN; var prev; do { prev = v; v = d.getTime(); ticks.push(v); if (unit == "month" || unit == "quarter") { if (tickSize < 1) { // a bit complicated - we'll divide the // month/quarter up but we need to take // care of fractions so we don't end up in // the middle of a day d.setDate(1); var start = d.getTime(); d.setMonth(d.getMonth() + (unit == "quarter" ? 3 : 1)); var end = d.getTime(); d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize); carry = d.getHours(); d.setHours(0); } else { d.setMonth(d.getMonth() + tickSize * (unit == "quarter" ? 3 : 1)); } } else if (unit == "year") { d.setFullYear(d.getFullYear() + tickSize); } else { d.setTime(v + step); } } while (v < axis.max && v != prev); return ticks; }; axis.tickFormatter = function (v, axis) { var d = dateGenerator(v, axis.options); // first check global format if (opts.timeformat != null) { return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames); } // possibly use quarters if quarters are mentioned in // any of these places var useQuarters = (axis.options.tickSize && axis.options.tickSize[1] == "quarter") || (axis.options.minTickSize && axis.options.minTickSize[1] == "quarter"); var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]]; var span = axis.max - axis.min; var suffix = (opts.twelveHourClock) ? " %p" : ""; var hourCode = (opts.twelveHourClock) ? "%I" : "%H"; var fmt; if (t < timeUnitSize.minute) { fmt = hourCode + ":%M:%S" + suffix; } else if (t < timeUnitSize.day) { if (span < 2 * timeUnitSize.day) { fmt = hourCode + ":%M" + suffix; } else { fmt = "%b %d " + hourCode + ":%M" + suffix; } } else if (t < timeUnitSize.month) { fmt = "%b %d"; } else if ((useQuarters && t < timeUnitSize.quarter) || (!useQuarters && t < timeUnitSize.year)) { if (span < timeUnitSize.year) { fmt = "%b"; } else { fmt = "%b %Y"; } } else if (useQuarters && t < timeUnitSize.year) { if (span < timeUnitSize.year) { fmt = "Q%q"; } else { fmt = "Q%q %Y"; } } else { fmt = "%Y"; } var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames); return rt; }; } }); }); } $.plot.plugins.push({ init: init, options: options, name: 'time', version: '1.0' }); // Time-axis support used to be in Flot core, which exposed the // formatDate function on the plot object. Various plugins depend // on the function, so we need to re-expose it here. $.plot.formatDate = formatDate; })(jQuery);
SquareSquash/web/vendor/assets/javascripts/flot/time.js/0
{ "file_path": "SquareSquash/web/vendor/assets/javascripts/flot/time.js", "repo_id": "SquareSquash", "token_count": 5247 }
123