text stringlengths 1 2.83M | id stringlengths 16 152 | metadata dict | __index_level_0__ int64 0 949 |
|---|---|---|---|
// 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"), "cjs");
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); });
else // Plain browser env
mod(CodeMirror, "plain");
})(function(CodeMirror, env) {
if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
var loading = {};
function splitCallback(cont, n) {
var countDown = n;
return function() { if (--countDown == 0) cont(); };
}
function ensureDeps(mode, cont) {
var deps = CodeMirror.modes[mode].dependencies;
if (!deps) return cont();
var missing = [];
for (var i = 0; i < deps.length; ++i) {
if (!CodeMirror.modes.hasOwnProperty(deps[i]))
missing.push(deps[i]);
}
if (!missing.length) return cont();
var split = splitCallback(cont, missing.length);
for (var i = 0; i < missing.length; ++i)
CodeMirror.requireMode(missing[i], split);
}
CodeMirror.requireMode = function(mode, cont) {
if (typeof mode != "string") mode = mode.name;
if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
var file = CodeMirror.modeURL.replace(/%N/g, mode);
if (env == "plain") {
var script = document.createElement("script");
script.src = file;
var others = document.getElementsByTagName("script")[0];
var list = loading[mode] = [cont];
CodeMirror.on(script, "load", function() {
ensureDeps(mode, function() {
for (var i = 0; i < list.length; ++i) list[i]();
});
});
others.parentNode.insertBefore(script, others);
} else if (env == "cjs") {
require(file);
cont();
} else if (env == "amd") {
requirejs([file], cont);
}
};
CodeMirror.autoLoadMode = function(instance, mode) {
if (!CodeMirror.modes.hasOwnProperty(mode))
CodeMirror.requireMode(mode, function() {
instance.setOption("mode", instance.getOption("mode"));
});
};
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/addon/mode/loadmode.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/addon/mode/loadmode.js",
"repo_id": "Humsen",
"token_count": 892
} | 60 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Define search commands. Depends on dialog.js or another
// implementation of the openDialog method.
// Replace works a little oddly -- it will do the replace on the next
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
// replace by making sure the match is no longer selected when hitting
// Ctrl-G.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
function searchOverlay(query, caseInsensitive) {
if (typeof query == "string")
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
else if (!query.global)
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
return {token: function(stream) {
query.lastIndex = stream.pos;
var match = query.exec(stream.string);
if (match && match.index == stream.pos) {
stream.pos += match[0].length;
return "searching";
} else if (match) {
stream.pos = match.index;
} else {
stream.skipToEnd();
}
}};
}
function SearchState() {
this.posFrom = this.posTo = this.query = null;
this.overlay = null;
}
function getSearchState(cm) {
return cm.state.search || (cm.state.search = new SearchState());
}
function queryCaseInsensitive(query) {
return typeof query == "string" && query == query.toLowerCase();
}
function getSearchCursor(cm, query, pos) {
// Heuristic: if the query string is all lowercase, do a case insensitive search.
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
}
function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt});
else f(prompt(shortText, deflt));
}
function confirmDialog(cm, text, shortText, fs) {
if (cm.openConfirm) cm.openConfirm(text, fs);
else if (confirm(shortText)) fs[0]();
}
function parseQuery(query) {
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
if (isRE) {
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
catch(e) {} // Not a regular expression after all, do a string search
}
if (typeof query == "string" ? query == "" : query.test(""))
query = /x^/;
return query;
}
var queryDialog =
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
function doSearch(cm, rev) {
var state = getSearchState(cm);
if (state.query) return findNext(cm, rev);
dialog(cm, queryDialog, "Search for:", cm.getSelection(), function(query) {
cm.operation(function() {
if (!query || state.query) return;
state.query = parseQuery(query);
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
cm.addOverlay(state.overlay);
if (cm.showMatchesOnScrollbar) {
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
}
state.posFrom = state.posTo = cm.getCursor();
findNext(cm, rev);
});
});
}
function findNext(cm, rev) {cm.operation(function() {
var state = getSearchState(cm);
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
if (!cursor.find(rev)) {
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
if (!cursor.find(rev)) return;
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
state.posFrom = cursor.from(); state.posTo = cursor.to();
});}
function clearSearch(cm) {cm.operation(function() {
var state = getSearchState(cm);
if (!state.query) return;
state.query = null;
cm.removeOverlay(state.overlay);
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
});}
var replaceQueryDialog =
'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
function replace(cm, all) {
if (cm.getOption("readOnly")) return;
dialog(cm, replaceQueryDialog, "Replace:", cm.getSelection(), function(query) {
if (!query) return;
query = parseQuery(query);
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
if (all) {
cm.operation(function() {
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
if (typeof query != "string") {
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
} else cursor.replace(text);
}
});
} else {
clearSearch(cm);
var cursor = getSearchCursor(cm, query, cm.getCursor());
var advance = function() {
var start = cursor.from(), match;
if (!(match = cursor.findNext())) {
cursor = getSearchCursor(cm, query);
if (!(match = cursor.findNext()) ||
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
confirmDialog(cm, doReplaceConfirm, "Replace?",
[function() {doReplace(match);}, advance]);
};
var doReplace = function(match) {
cursor.replace(typeof query == "string" ? text :
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
advance();
};
advance();
}
});
});
}
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
CodeMirror.commands.findNext = doSearch;
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
CodeMirror.commands.clearSearch = clearSearch;
CodeMirror.commands.replace = replace;
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/addon/search/search.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/addon/search/search.js",
"repo_id": "Humsen",
"token_count": 2844
} | 61 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/*
* =====================================================================================
*
* Filename: mode/asterisk/asterisk.js
*
* Description: CodeMirror mode for Asterisk dialplan
*
* Created: 05/17/2012 09:20:25 PM
* Revision: none
*
* Author: Stas Kobzar (stas@modulis.ca),
* Company: Modulis.ca Inc.
*
* =====================================================================================
*/
(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("asterisk", function() {
var atoms = ["exten", "same", "include","ignorepat","switch"],
dpcmd = ["#include","#exec"],
apps = [
"addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi",
"alarmreceiver","amd","answer","authenticate","background","backgrounddetect",
"bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent",
"changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge",
"congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge",
"dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility",
"datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa",
"dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy",
"externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif",
"goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete",
"ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus",
"jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme",
"meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete",
"minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode",
"mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish",
"originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce",
"parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones",
"privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten",
"readfile","receivefax","receivefax","receivefax","record","removequeuemember",
"resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun",
"saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax",
"sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags",
"setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel",
"slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground",
"speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound",
"speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor",
"stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec",
"trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate",
"vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring",
"waitforsilence","waitmusiconhold","waituntil","while","zapateller"
];
function basicToken(stream,state){
var cur = '';
var ch = '';
ch = stream.next();
// comment
if(ch == ";") {
stream.skipToEnd();
return "comment";
}
// context
if(ch == '[') {
stream.skipTo(']');
stream.eat(']');
return "header";
}
// string
if(ch == '"') {
stream.skipTo('"');
return "string";
}
if(ch == "'") {
stream.skipTo("'");
return "string-2";
}
// dialplan commands
if(ch == '#') {
stream.eatWhile(/\w/);
cur = stream.current();
if(dpcmd.indexOf(cur) !== -1) {
stream.skipToEnd();
return "strong";
}
}
// application args
if(ch == '$'){
var ch1 = stream.peek();
if(ch1 == '{'){
stream.skipTo('}');
stream.eat('}');
return "variable-3";
}
}
// extension
stream.eatWhile(/\w/);
cur = stream.current();
if(atoms.indexOf(cur) !== -1) {
state.extenStart = true;
switch(cur) {
case 'same': state.extenSame = true; break;
case 'include':
case 'switch':
case 'ignorepat':
state.extenInclude = true;break;
default:break;
}
return "atom";
}
}
return {
startState: function() {
return {
extenStart: false,
extenSame: false,
extenInclude: false,
extenExten: false,
extenPriority: false,
extenApplication: false
};
},
token: function(stream, state) {
var cur = '';
var ch = '';
if(stream.eatSpace()) return null;
// extension started
if(state.extenStart){
stream.eatWhile(/[^\s]/);
cur = stream.current();
if(/^=>?$/.test(cur)){
state.extenExten = true;
state.extenStart = false;
return "strong";
} else {
state.extenStart = false;
stream.skipToEnd();
return "error";
}
} else if(state.extenExten) {
// set exten and priority
state.extenExten = false;
state.extenPriority = true;
stream.eatWhile(/[^,]/);
if(state.extenInclude) {
stream.skipToEnd();
state.extenPriority = false;
state.extenInclude = false;
}
if(state.extenSame) {
state.extenPriority = false;
state.extenSame = false;
state.extenApplication = true;
}
return "tag";
} else if(state.extenPriority) {
state.extenPriority = false;
state.extenApplication = true;
ch = stream.next(); // get comma
if(state.extenSame) return null;
stream.eatWhile(/[^,]/);
return "number";
} else if(state.extenApplication) {
stream.eatWhile(/,/);
cur = stream.current();
if(cur === ',') return null;
stream.eatWhile(/\w/);
cur = stream.current().toLowerCase();
state.extenApplication = false;
if(apps.indexOf(cur) !== -1){
return "def strong";
}
} else{
return basicToken(stream,state);
}
return null;
}
};
});
CodeMirror.defineMIME("text/x-asterisk", "asterisk");
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/asterisk/asterisk.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/asterisk/asterisk.js",
"repo_id": "Humsen",
"token_count": 3365
} | 62 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/*
DTD mode
Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
GitHub: @peterkroon
*/
(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("dtd", function(config) {
var indentUnit = config.indentUnit, type;
function ret(style, tp) {type = tp; return style;}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == "<" && stream.eat("!") ) {
if (stream.eatWhile(/[\-]/)) {
state.tokenize = tokenSGMLComment;
return tokenSGMLComment(stream, state);
} else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent");
} else if (ch == "<" && stream.eat("?")) { //xml declaration
state.tokenize = inBlock("meta", "?>");
return ret("meta", ch);
} else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag");
else if (ch == "|") return ret("keyword", "seperator");
else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else
else if (ch.match(/[\[\]]/)) return ret("rule", ch);
else if (ch == "\"" || ch == "'") {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
} else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) {
var sc = stream.current();
if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1);
return ret("tag", "tag");
} else if (ch == "%" || ch == "*" ) return ret("number", "number");
else {
stream.eatWhile(/[\w\\\-_%.{,]/);
return ret(null, null);
}
}
function tokenSGMLComment(stream, state) {
var dashes = 0, ch;
while ((ch = stream.next()) != null) {
if (dashes >= 2 && ch == ">") {
state.tokenize = tokenBase;
break;
}
dashes = (ch == "-") ? dashes + 1 : 0;
}
return ret("comment", "comment");
}
function tokenString(quote) {
return function(stream, state) {
var escaped = false, ch;
while ((ch = stream.next()) != null) {
if (ch == quote && !escaped) {
state.tokenize = tokenBase;
break;
}
escaped = !escaped && ch == "\\";
}
return ret("string", "tag");
};
}
function inBlock(style, terminator) {
return function(stream, state) {
while (!stream.eol()) {
if (stream.match(terminator)) {
state.tokenize = tokenBase;
break;
}
stream.next();
}
return style;
};
}
return {
startState: function(base) {
return {tokenize: tokenBase,
baseIndent: base || 0,
stack: []};
},
token: function(stream, state) {
if (stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
var context = state.stack[state.stack.length-1];
if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule");
else if (type === "endtag") state.stack[state.stack.length-1] = "endtag";
else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop();
else if (type == "[") state.stack.push("[");
return style;
},
indent: function(state, textAfter) {
var n = state.stack.length;
if( textAfter.match(/\]\s+|\]/) )n=n-1;
else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){
if(textAfter.substr(0,1) === "<")n;
else if( type == "doindent" && textAfter.length > 1 )n;
else if( type == "doindent")n--;
else if( type == ">" && textAfter.length > 1)n;
else if( type == "tag" && textAfter !== ">")n;
else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;
else if( type == "tag")n++;
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;
else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;
else if( textAfter === ">")n;
else n=n-1;
//over rule them all
if(type == null || type == "]")n--;
}
return state.baseIndent + n * indentUnit;
},
electricChars: "]>"
};
});
CodeMirror.defineMIME("application/xml-dtd", "dtd");
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/dtd/dtd.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/dtd/dtd.js",
"repo_id": "Humsen",
"token_count": 2065
} | 63 |
// 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("haskell", function(_config, modeConfig) {
function switchState(source, setState, f) {
setState(f);
return f(source, setState);
}
// These should all be Unicode extended, as per the Haskell 2010 report
var smallRE = /[a-z_]/;
var largeRE = /[A-Z]/;
var digitRE = /\d/;
var hexitRE = /[0-9A-Fa-f]/;
var octitRE = /[0-7]/;
var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/;
var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/;
var specialRE = /[(),;[\]`{}]/;
var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
function normal(source, setState) {
if (source.eatWhile(whiteCharRE)) {
return null;
}
var ch = source.next();
if (specialRE.test(ch)) {
if (ch == '{' && source.eat('-')) {
var t = "comment";
if (source.eat('#')) {
t = "meta";
}
return switchState(source, setState, ncomment(t, 1));
}
return null;
}
if (ch == '\'') {
if (source.eat('\\')) {
source.next(); // should handle other escapes here
}
else {
source.next();
}
if (source.eat('\'')) {
return "string";
}
return "error";
}
if (ch == '"') {
return switchState(source, setState, stringLiteral);
}
if (largeRE.test(ch)) {
source.eatWhile(idRE);
if (source.eat('.')) {
return "qualifier";
}
return "variable-2";
}
if (smallRE.test(ch)) {
source.eatWhile(idRE);
return "variable";
}
if (digitRE.test(ch)) {
if (ch == '0') {
if (source.eat(/[xX]/)) {
source.eatWhile(hexitRE); // should require at least 1
return "integer";
}
if (source.eat(/[oO]/)) {
source.eatWhile(octitRE); // should require at least 1
return "number";
}
}
source.eatWhile(digitRE);
var t = "number";
if (source.match(/^\.\d+/)) {
t = "number";
}
if (source.eat(/[eE]/)) {
t = "number";
source.eat(/[-+]/);
source.eatWhile(digitRE); // should require at least 1
}
return t;
}
if (ch == "." && source.eat("."))
return "keyword";
if (symbolRE.test(ch)) {
if (ch == '-' && source.eat(/-/)) {
source.eatWhile(/-/);
if (!source.eat(symbolRE)) {
source.skipToEnd();
return "comment";
}
}
var t = "variable";
if (ch == ':') {
t = "variable-2";
}
source.eatWhile(symbolRE);
return t;
}
return "error";
}
function ncomment(type, nest) {
if (nest == 0) {
return normal;
}
return function(source, setState) {
var currNest = nest;
while (!source.eol()) {
var ch = source.next();
if (ch == '{' && source.eat('-')) {
++currNest;
}
else if (ch == '-' && source.eat('}')) {
--currNest;
if (currNest == 0) {
setState(normal);
return type;
}
}
}
setState(ncomment(type, currNest));
return type;
};
}
function stringLiteral(source, setState) {
while (!source.eol()) {
var ch = source.next();
if (ch == '"') {
setState(normal);
return "string";
}
if (ch == '\\') {
if (source.eol() || source.eat(whiteCharRE)) {
setState(stringGap);
return "string";
}
if (source.eat('&')) {
}
else {
source.next(); // should handle other escapes here
}
}
}
setState(normal);
return "error";
}
function stringGap(source, setState) {
if (source.eat('\\')) {
return switchState(source, setState, stringLiteral);
}
source.next();
setState(normal);
return "error";
}
var wellKnownWords = (function() {
var wkw = {};
function setType(t) {
return function () {
for (var i = 0; i < arguments.length; i++)
wkw[arguments[i]] = t;
};
}
setType("keyword")(
"case", "class", "data", "default", "deriving", "do", "else", "foreign",
"if", "import", "in", "infix", "infixl", "infixr", "instance", "let",
"module", "newtype", "of", "then", "type", "where", "_");
setType("keyword")(
"\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>");
setType("builtin")(
"!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<",
"==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**");
setType("builtin")(
"Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq",
"False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT",
"IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
"Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read",
"ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS",
"String", "True");
setType("builtin")(
"abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf",
"asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling",
"compare", "concat", "concatMap", "const", "cos", "cosh", "curry",
"cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either",
"elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo",
"enumFromTo", "error", "even", "exp", "exponent", "fail", "filter",
"flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap",
"foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger",
"fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents",
"getLine", "head", "id", "init", "interact", "ioError", "isDenormalized",
"isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last",
"lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map",
"mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound",
"minimum", "mod", "negate", "not", "notElem", "null", "odd", "or",
"otherwise", "pi", "pred", "print", "product", "properFraction",
"putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile",
"readIO", "readList", "readLn", "readParen", "reads", "readsPrec",
"realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse",
"round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq",
"sequence", "sequence_", "show", "showChar", "showList", "showParen",
"showString", "shows", "showsPrec", "significand", "signum", "sin",
"sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum",
"tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger",
"toRational", "truncate", "uncurry", "undefined", "unlines", "until",
"unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip",
"zip3", "zipWith", "zipWith3");
var override = modeConfig.overrideKeywords;
if (override) for (var word in override) if (override.hasOwnProperty(word))
wkw[word] = override[word];
return wkw;
})();
return {
startState: function () { return { f: normal }; },
copyState: function (s) { return { f: s.f }; },
token: function(stream, state) {
var t = state.f(stream, function(s) { state.f = s; });
var w = stream.current();
return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t;
},
blockCommentStart: "{-",
blockCommentEnd: "-}",
lineComment: "--"
};
});
CodeMirror.defineMIME("text/x-haskell", "haskell");
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/haskell/haskell.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/haskell/haskell.js",
"repo_id": "Humsen",
"token_count": 3726
} | 64 |
// 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.modeInfo = [
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
{name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
{name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
{name: "Django", mime: "text/x-django", mode: "django"},
{name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/},
{name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
{name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]},
{name: "HTTP", mime: "message/http", mode: "http"},
{name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
{name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]},
{name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
{name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
{name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
{name: "Jinja2", mime: "null", mode: "jinja2"},
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
{name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]},
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
{name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]},
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]},
{name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
{name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
{name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]},
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
{name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
{name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"},
{name: "Solr", mime: "text/x-solr", mode: "solr"},
{name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
{name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
{name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
{name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"], alias: ["yml"]},
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}
];
// Ensure all modes have a mime property for backwards compatibility
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
var info = CodeMirror.modeInfo[i];
if (info.mimes) info.mime = info.mimes[0];
}
CodeMirror.findModeByMIME = function(mime) {
mime = mime.toLowerCase();
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
var info = CodeMirror.modeInfo[i];
if (info.mime == mime) return info;
if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
if (info.mimes[j] == mime) return info;
}
};
CodeMirror.findModeByExtension = function(ext) {
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
var info = CodeMirror.modeInfo[i];
if (info.ext) for (var j = 0; j < info.ext.length; j++)
if (info.ext[j] == ext) return info;
}
};
CodeMirror.findModeByFileName = function(filename) {
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
var info = CodeMirror.modeInfo[i];
if (info.file && info.file.test(filename)) return info;
}
var dot = filename.lastIndexOf(".");
var ext = dot > -1 && filename.substring(dot + 1, filename.length);
if (ext) return CodeMirror.findModeByExtension(ext);
};
CodeMirror.findModeByName = function(name) {
name = name.toLowerCase();
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
var info = CodeMirror.modeInfo[i];
if (info.name.toLowerCase() == name) return info;
if (info.alias) for (var j = 0; j < info.alias.length; j++)
if (info.alias[j].toLowerCase() == name) return info;
}
};
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/meta.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/meta.js",
"repo_id": "Humsen",
"token_count": 5215
} | 65 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
/**
* @file smartymixed.js
* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML)
* @author Ruslan Osmanov <rrosmanov at gmail dot com>
* @version 3.0
* @date 05.07.2013
*/
// Warning: Don't base other modes on this one. This here is a
// terrible way to write a mixed mode.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("smartymixed", function(config) {
var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed");
var smartyMode = CodeMirror.getMode(config, "smarty");
var settings = {
rightDelimiter: '}',
leftDelimiter: '{'
};
if (config.hasOwnProperty("leftDelimiter")) {
settings.leftDelimiter = config.leftDelimiter;
}
if (config.hasOwnProperty("rightDelimiter")) {
settings.rightDelimiter = config.rightDelimiter;
}
function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); }
var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter);
var regs = {
smartyComment: new RegExp("^" + reRight + "\\*"),
literalOpen: new RegExp(reLeft + "literal" + reRight),
literalClose: new RegExp(reLeft + "\/literal" + reRight),
hasLeftDelimeter: new RegExp(".*" + reLeft),
htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft)
};
var helpers = {
chain: function(stream, state, parser) {
state.tokenize = parser;
return parser(stream, state);
},
cleanChain: function(stream, state, parser) {
state.tokenize = null;
state.localState = null;
state.localMode = null;
return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state);
},
maybeBackup: function(stream, pat, style) {
var cur = stream.current();
var close = cur.search(pat),
m;
if (close > - 1) stream.backUp(cur.length - close);
else if (m = cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur[0]);
}
return style;
}
};
var parsers = {
html: function(stream, state) {
var htmlTagName = state.htmlMixedState.htmlState.context && state.htmlMixedState.htmlState.context.tagName
? state.htmlMixedState.htmlState.context.tagName
: null;
if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && htmlTagName === null) {
state.tokenize = parsers.smarty;
state.localMode = smartyMode;
state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, ""));
return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState));
} else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) {
state.tokenize = parsers.smarty;
state.localMode = smartyMode;
state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, ""));
return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState));
}
return htmlMixedMode.token(stream, state.htmlMixedState);
},
smarty: function(stream, state) {
if (stream.match(settings.leftDelimiter, false)) {
if (stream.match(regs.smartyComment, false)) {
return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter));
}
} else if (stream.match(settings.rightDelimiter, false)) {
stream.eat(settings.rightDelimiter);
state.tokenize = parsers.html;
state.localMode = htmlMixedMode;
state.localState = state.htmlMixedState;
return "tag";
}
return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState));
},
inBlock: function(style, terminator) {
return function(stream, state) {
while (!stream.eol()) {
if (stream.match(terminator)) {
helpers.cleanChain(stream, state, "");
break;
}
stream.next();
}
return style;
};
}
};
return {
startState: function() {
var state = htmlMixedMode.startState();
return {
token: parsers.html,
localMode: null,
localState: null,
htmlMixedState: state,
tokenize: null,
inLiteral: false
};
},
copyState: function(state) {
var local = null, tok = (state.tokenize || state.token);
if (state.localState) {
local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState);
}
return {
token: state.token,
tokenize: state.tokenize,
localMode: state.localMode,
localState: local,
htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState),
inLiteral: state.inLiteral
};
},
token: function(stream, state) {
if (stream.match(settings.leftDelimiter, false)) {
if (!state.inLiteral && stream.match(regs.literalOpen, true)) {
state.inLiteral = true;
return "keyword";
} else if (state.inLiteral && stream.match(regs.literalClose, true)) {
state.inLiteral = false;
return "keyword";
}
}
if (state.inLiteral && state.localState != state.htmlMixedState) {
state.tokenize = parsers.html;
state.localMode = htmlMixedMode;
state.localState = state.htmlMixedState;
}
var style = (state.tokenize || state.token)(stream, state);
return style;
},
indent: function(state, textAfter) {
if (state.localMode == smartyMode
|| (state.inLiteral && !state.localMode)
|| regs.hasLeftDelimeter.test(textAfter)) {
return CodeMirror.Pass;
}
return htmlMixedMode.indent(state.htmlMixedState, textAfter);
},
innerMode: function(state) {
return {
state: state.localState || state.htmlMixedState,
mode: state.localMode || htmlMixedMode
};
}
};
}, "htmlmixed", "smarty");
CodeMirror.defineMIME("text/x-smarty", "smartymixed");
// vim: et ts=2 sts=2 sw=2
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/smartymixed/smartymixed.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/smartymixed/smartymixed.js",
"repo_id": "Humsen",
"token_count": 2722
} | 66 |
// 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("toml", function () {
return {
startState: function () {
return {
inString: false,
stringType: "",
lhs: true,
inArray: 0
};
},
token: function (stream, state) {
//check for state changes
if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) {
state.stringType = stream.peek();
stream.next(); // Skip quote
state.inString = true; // Update state
}
if (stream.sol() && state.inArray === 0) {
state.lhs = true;
}
//return state
if (state.inString) {
while (state.inString && !stream.eol()) {
if (stream.peek() === state.stringType) {
stream.next(); // Skip quote
state.inString = false; // Clear flag
} else if (stream.peek() === '\\') {
stream.next();
stream.next();
} else {
stream.match(/^.[^\\\"\']*/);
}
}
return state.lhs ? "property string" : "string"; // Token style
} else if (state.inArray && stream.peek() === ']') {
stream.next();
state.inArray--;
return 'bracket';
} else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) {
stream.next();//skip closing ]
// array of objects has an extra open & close []
if (stream.peek() === ']') stream.next();
return "atom";
} else if (stream.peek() === "#") {
stream.skipToEnd();
return "comment";
} else if (stream.eatSpace()) {
return null;
} else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) {
return "property";
} else if (state.lhs && stream.peek() === "=") {
stream.next();
state.lhs = false;
return null;
} else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) {
return 'atom'; //date
} else if (!state.lhs && (stream.match('true') || stream.match('false'))) {
return 'atom';
} else if (!state.lhs && stream.peek() === '[') {
state.inArray++;
stream.next();
return 'bracket';
} else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) {
return 'number';
} else if (!stream.eatSpace()) {
stream.next();
}
return null;
}
};
});
CodeMirror.defineMIME('text/x-toml', 'toml');
});
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/toml/toml.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/mode/toml/toml.js",
"repo_id": "Humsen",
"token_count": 1307
} | 67 |
/*
Name: 3024 day
Author: Jan T. Sott (http://github.com/idleberg)
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
*/
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; }
.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; }
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; }
.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; }
.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
.cm-s-3024-day span.cm-comment {color: #cdab53;}
.cm-s-3024-day span.cm-atom {color: #a16a94;}
.cm-s-3024-day span.cm-number {color: #a16a94;}
.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}
.cm-s-3024-day span.cm-keyword {color: #db2d20;}
.cm-s-3024-day span.cm-string {color: #fded02;}
.cm-s-3024-day span.cm-variable {color: #01a252;}
.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}
.cm-s-3024-day span.cm-def {color: #e8bbd0;}
.cm-s-3024-day span.cm-bracket {color: #3a3432;}
.cm-s-3024-day span.cm-tag {color: #db2d20;}
.cm-s-3024-day span.cm-link {color: #a16a94;}
.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;}
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/3024-day.css/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/3024-day.css",
"repo_id": "Humsen",
"token_count": 800
} | 68 |
/* Based on Sublime Text's Monokai theme */
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-guttermarker { color: white; }
.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
.cm-s-monokai span.cm-comment {color: #75715e;}
.cm-s-monokai span.cm-atom {color: #ae81ff;}
.cm-s-monokai span.cm-number {color: #ae81ff;}
.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
.cm-s-monokai span.cm-keyword {color: #f92672;}
.cm-s-monokai span.cm-string {color: #e6db74;}
.cm-s-monokai span.cm-variable {color: #a6e22e;}
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
.cm-s-monokai span.cm-def {color: #fd971f;}
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
.cm-s-monokai span.cm-tag {color: #f92672;}
.cm-s-monokai span.cm-link {color: #ae81ff;}
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;}
.cm-s-monokai .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/monokai.css/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/monokai.css",
"repo_id": "Humsen",
"token_count": 684
} | 69 |
/**
* "
* Using Zenburn color palette from the Emacs Zenburn Theme
* https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el
*
* Also using parts of https://github.com/xavi/coderay-lighttable-theme
* "
* From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css
*/
.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; }
.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; }
.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; }
.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; }
.cm-s-zenburn span.cm-comment { color: #7f9f7f; }
.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; }
.cm-s-zenburn span.cm-atom { color: #bfebbf; }
.cm-s-zenburn span.cm-def { color: #dcdccc; }
.cm-s-zenburn span.cm-variable { color: #dfaf8f; }
.cm-s-zenburn span.cm-variable-2 { color: #dcdccc; }
.cm-s-zenburn span.cm-string { color: #cc9393; }
.cm-s-zenburn span.cm-string-2 { color: #cc9393; }
.cm-s-zenburn span.cm-number { color: #dcdccc; }
.cm-s-zenburn span.cm-tag { color: #93e0e3; }
.cm-s-zenburn span.cm-property { color: #dfaf8f; }
.cm-s-zenburn span.cm-attribute { color: #dfaf8f; }
.cm-s-zenburn span.cm-qualifier { color: #7cb8bb; }
.cm-s-zenburn span.cm-meta { color: #f0dfaf; }
.cm-s-zenburn span.cm-header { color: #f0efd0; }
.cm-s-zenburn span.cm-operator { color: #f0efd0; }
.cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; }
.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; }
.cm-s-zenburn .CodeMirror-activeline { background: #000000; }
.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; }
.cm-s-zenburn .CodeMirror-selected { background: #545454; }
.cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; }
| Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/zenburn.css/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/lib/codemirror/theme/zenburn.css",
"repo_id": "Humsen",
"token_count": 823
} | 70 |
/*!
* Goto line dialog plugin for Editor.md
*
* @file goto-line-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 $ = jQuery;
var pluginName = "goto-line-dialog";
var langs = {
"zh-cn" : {
toolbar : {
"goto-line" : "跳转到行"
},
dialog : {
"goto-line" : {
title : "跳转到行",
label : "请输入行号",
error : "错误:"
}
}
},
"zh-tw" : {
toolbar : {
"goto-line" : "跳轉到行"
},
dialog : {
"goto-line" : {
title : "跳轉到行",
label : "請輸入行號",
error : "錯誤:"
}
}
},
"en" : {
toolbar : {
"goto-line" : "Goto line"
},
dialog : {
"goto-line" : {
title : "Goto line",
label : "Enter a line number, range ",
error : "Error: "
}
}
}
};
exports.fn.gotoLineDialog = function() {
var _this = this;
var cm = this.cm;
var editor = this.editor;
var settings = this.settings;
var path = settings.pluginPath + pluginName +"/";
var classPrefix = this.classPrefix;
var dialogName = classPrefix + pluginName, dialog;
$.extend(true, this.lang, langs[this.lang.name]);
this.setToolbar();
var lang = this.lang;
var dialogLang = lang.dialog["goto-line"];
var lineCount = cm.lineCount();
dialogLang.error += dialogLang.label + " 1-" + lineCount;
if (editor.find("." + dialogName).length < 1)
{
var dialogContent = [
"<div class=\"editormd-form\" style=\"padding: 10px 0;\">",
"<p style=\"margin: 0;\">" + dialogLang.label + " 1-" + lineCount +" <input type=\"number\" class=\"number-input\" style=\"width: 60px;\" value=\"1\" max=\"" + lineCount + "\" min=\"1\" data-line-number /></p>",
"</div>"
].join("\n");
dialog = this.createDialog({
name : dialogName,
title : dialogLang.title,
width : 400,
height : 180,
mask : settings.dialogShowMask,
drag : settings.dialogDraggable,
content : dialogContent,
lockScreen : settings.dialogLockScreen,
maskStyle : {
opacity : settings.dialogMaskOpacity,
backgroundColor : settings.dialogMaskBgColor
},
buttons : {
enter : [lang.buttons.enter, function() {
var line = parseInt(this.find("[data-line-number]").val());
if (line < 1 || line > lineCount) {
alert(dialogLang.error);
return false;
}
_this.gotoLine(line);
this.hide().lockScreen(false).hideMask();
return false;
}],
cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask();
return false;
}]
}
});
}
dialog = editor.find("." + dialogName);
this.dialogShowMask(dialog);
this.dialogLockScreen();
dialog.show();
};
};
// 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-pc/WebContent/plugins/editormd/plugins/goto-line-dialog/goto-line-dialog.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/editormd/plugins/goto-line-dialog/goto-line-dialog.js",
"repo_id": "Humsen",
"token_count": 2048
} | 71 |
(function($) {
/**
* German language package
* Translated by @logemann
*/
$.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, {
base64: {
'default': 'Bitte eine Base64 Kodierung eingeben'
},
between: {
'default': 'Bitte einen Wert zwischen %s und %s eingeben',
notInclusive: 'Bitte einen Wert zwischen %s und %s (strictly) eingeben'
},
callback: {
'default': 'Bitte einen gültigen Wert eingeben'
},
choice: {
'default': 'Bitte einen gültigen Wert eingeben',
less: 'Bitte mindestens %s Werte eingeben',
more: 'Bitte maximal %s Werte eingeben',
between: 'Zwischen %s - %s Werten wählen'
},
color: {
'default': 'Bitte gültige Farbe eingeben'
},
creditCard: {
'default': 'Bitte gültige Kreditkartennr. eingeben'
},
cusip: {
'default': 'Bitte gültige CUSIP Nummer eingeben'
},
cvv: {
'default': 'Bitte gültige CVV Nummer eingeben'
},
date: {
'default': 'Bitte gültiges Datum eingeben',
min: 'Bitte gültiges Datum nach %s',
max: 'Bitte gültiges Datum vor %s',
range: 'Bitte gültiges Datum im zwischen %s - %s'
},
different: {
'default': 'Bitte anderen Wert eingeben'
},
digits: {
'default': 'Bitte Zahlen eingeben'
},
ean: {
'default': 'Bitte gültige EAN Nummer eingeben'
},
emailAddress: {
'default': 'Bitte gültige Emailadresse eingeben'
},
file: {
'default': 'Bitte gültiges File eingeben'
},
greaterThan: {
'default': 'Bitte Wert größer gleich %s eingeben',
notInclusive: 'Bitte Wert größer als %s eingeben'
},
grid: {
'default': 'Bitte gültige GRId Nummer eingeben'
},
hex: {
'default': 'Bitte gültigen Hexadezimalwert eingeben'
},
hexColor: {
'default': 'Bitte gültige Hex-Farbe eingeben'
},
iban: {
'default': 'Bitte eine gültige IBAN Nummer eingeben',
countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
country: 'Bitte eine gültige IBAN Nummer für %s eingeben',
countries: {
AD: 'Andorra',
AE: 'Vereinigte Arabische Emirate',
AL: 'Albanien',
AO: 'Angola',
AT: 'Österreich',
AZ: 'Aserbaidschan',
BA: 'Bosnien und Herzegowina',
BE: 'Belgien',
BF: 'Burkina Faso',
BG: 'Bulgarien',
BH: 'Bahrein',
BI: 'Burundi',
BJ: 'Benin',
BR: 'Brasilien',
CH: 'Schweiz',
CI: 'Elfenbeinküste',
CM: 'Kamerun',
CR: 'Costa Rica',
CV: 'Kap Verde',
CY: 'Zypern',
CZ: 'Tschechische',
DE: 'Deutschland',
DK: 'Dänemark',
DO: 'Dominikanische Republik',
DZ: 'Algerien',
EE: 'Estland',
ES: 'Spanien',
FI: 'Finnland',
FO: 'Färöer-Inseln',
FR: 'Frankreich',
GB: 'Vereinigtes Königreich',
GE: 'Georgien',
GI: 'Gibraltar',
GL: 'Grönland',
GR: 'Griechenland',
GT: 'Guatemala',
HR: 'Croatia',
HU: 'Ungarn',
IE: 'Irland',
IL: 'Israel',
IR: 'Iran',
IS: 'Island',
IT: 'Italien',
JO: 'Jordanien',
KW: 'Kuwait',
KZ: 'Kasachstan',
LB: 'Libanon',
LI: 'Liechtenstein',
LT: 'Litauen',
LU: 'Luxemburg',
LV: 'Lettland',
MC: 'Monaco',
MD: 'Moldawien',
ME: 'Montenegro',
MG: 'Madagaskar',
MK: 'Mazedonien',
ML: 'Mali',
MR: 'Mauretanien',
MT: 'Malta',
MU: 'Mauritius',
MZ: 'Mosambik',
NL: 'Niederlande',
NO: 'Norwegen',
PK: 'Pakistan',
PL: 'Polen',
PS: 'Palästina',
PT: 'Portugal',
QA: 'Katar',
RO: 'Rumänien',
RS: 'Serbien',
SA: 'Saudi-Arabien',
SE: 'Schweden',
SI: 'Slowenien',
SK: 'Slowakei',
SM: 'San Marino',
SN: 'Senegal',
TN: 'Tunesien',
TR: 'Türkei',
VG: 'Jungferninseln'
}
},
id: {
'default': 'Bitte gültige Identifikationsnnummer eingeben',
countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
country: 'Bitte gültige Identifikationsnummer für %s eingeben',
countries: {
BA: 'Bosnien und Herzegowina',
BG: 'Bulgarien',
BR: 'Brasilien',
CH: 'Schweiz',
CL: 'Chile',
CN: 'China',
CZ: 'Tschechische',
DK: 'Dänemark',
EE: 'Estland',
ES: 'Spanien',
FI: 'Finnland',
HR: 'Kroatien',
IE: 'Irland',
IS: 'Island',
LT: 'Litauen',
LV: 'Lettland',
ME: 'Montenegro',
MK: 'Mazedonien',
NL: 'Niederlande',
RO: 'Rumänien',
RS: 'Serbien',
SE: 'Schweden',
SI: 'Slowenien',
SK: 'Slowakei',
SM: 'San Marino',
TH: 'Thailand',
ZA: 'Südafrika'
}
},
identical: {
'default': 'Bitte gleichen Wert eingeben'
},
imei: {
'default': 'Bitte gültige IMEI Nummer eingeben'
},
imo: {
'default': 'Bitte gültige IMO Nummer eingeben'
},
integer: {
'default': 'Bitte Zahl eingeben'
},
ip: {
'default': 'Bitte gültige IP-Adresse eingeben',
ipv4: 'Bitte gültige IPv4 Adresse eingeben',
ipv6: 'Bitte gültige IPv6 Adresse eingeben'
},
isbn: {
'default': 'Bitte gültige ISBN Nummer eingeben'
},
isin: {
'default': 'Bitte gültige ISIN Nummer eingeben'
},
ismn: {
'default': 'Bitte gültige ISMN Nummer eingeben'
},
issn: {
'default': 'Bitte gültige ISSN Nummer eingeben'
},
lessThan: {
'default': 'Bitte Wert kleiner gleich %s eingeben',
notInclusive: 'Bitte Wert kleiner als %s eingeben'
},
mac: {
'default': 'Bitte gültige MAC Adresse eingeben'
},
meid: {
'default': 'Bitte gültige MEID Nummer eingeben'
},
notEmpty: {
'default': 'Bitte Wert eingeben'
},
numeric: {
'default': 'Bitte Nummer eingeben'
},
phone: {
'default': 'Bitte gültige Telefonnummer eingeben',
countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
country: 'Bitte valide Telefonnummer für %s eingeben',
countries: {
BR: 'Brasilien',
CN: 'China',
CZ: 'Tschechische',
DE: 'Deutschland',
DK: 'Dänemark',
ES: 'Spanien',
FR: 'Frankreich',
GB: 'Vereinigtes Königreich',
MA: 'Marokko',
PK: 'Pakistan',
RO: 'Rumänien',
RU: 'Russland',
SK: 'Slowakei',
TH: 'Thailand',
US: 'Vereinigte Staaten von Amerika',
VE: 'Venezuela'
}
},
regexp: {
'default': 'Bitte Wert eingeben, der der Maske entspricht'
},
remote: {
'default': 'Bitte einen gültigen Wert eingeben'
},
rtn: {
'default': 'Bitte gültige RTN Nummer eingeben'
},
sedol: {
'default': 'Bitte gültige SEDOL Nummer eingeben'
},
siren: {
'default': 'Bitte gültige SIREN Nummer eingeben'
},
siret: {
'default': 'Bitte gültige SIRET Nummer eingeben'
},
step: {
'default': 'Bitte einen gültigen Schritt von %s eingeben'
},
stringCase: {
'default': 'Bitte nur Kleinbuchstaben eingeben',
upper: 'Bitte nur Großbuchstaben eingeben'
},
stringLength: {
'default': 'Bitte Wert mit gültiger Länge eingeben',
less: 'Bitte weniger als %s Zeichen eingeben',
more: 'Bitte mehr als %s Zeichen eingeben',
between: 'Bitte Wert zwischen %s und %s Zeichen eingeben'
},
uri: {
'default': 'Bitte gültige URI eingeben'
},
uuid: {
'default': 'Bitte gültige UUID Nummer eingeben',
version: 'Bitte gültige UUID Version %s eingeben'
},
vat: {
'default': 'Bitte gültige VAT Nummer eingeben',
countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
country: 'Bitte gültige VAT Nummer für %s eingeben',
countries: {
AT: 'Österreich',
BE: 'Belgien',
BG: 'Bulgarien',
BR: 'Brasilien',
CH: 'Schweiz',
CY: 'Zypern',
CZ: 'Tschechische',
DE: 'Deutschland',
DK: 'Dänemark',
EE: 'Estland',
ES: 'Spanisch',
FI: 'Finnland',
FR: 'Frankreich',
GB: 'Vereinigtes Königreich',
GR: 'Griechenland',
EL: 'Griechenland',
HU: 'Ungarn',
HR: 'Kroatien',
IE: 'Irland',
IS: 'Island',
IT: 'Italien',
LT: 'Litauen',
LU: 'Luxemburg',
LV: 'Lettland',
MT: 'Malta',
NL: 'Niederlande',
NO: 'Norwegen',
PL: 'Polen',
PT: 'Portugal',
RO: 'Rumänien',
RU: 'Russland',
RS: 'Serbien',
SE: 'Schweden',
SI: 'Slowenien',
SK: 'Slowakei',
VE: 'Venezuela',
ZA: 'Südafrika'
}
},
vin: {
'default': 'Bitte gültige VIN Nummer eingeben'
},
zipCode: {
'default': 'Bitte gültige PLZ eingeben',
countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
country: 'Bitte gültigen Postleitzahl für %s eingeben',
countries: {
AT: 'Österreich',
BR: 'Brasilien',
CA: 'Kanada',
CH: 'Schweiz',
CZ: 'Tschechische',
DE: 'Deutschland',
DK: 'Dänemark',
FR: 'Frankreich',
GB: 'Vereinigtes Königreich',
IE: 'Irland',
IT: 'Italien',
MA: 'Marokko',
NL: 'Niederlande',
PT: 'Portugal',
RO: 'Rumänien',
RU: 'Russland',
SE: 'Schweden',
SG: 'Singapur',
SK: 'Slowakei',
US: 'Vereinigte Staaten von Amerika'
}
}
});
}(window.jQuery));
| Humsen/web/web-pc/WebContent/plugins/validator/js/language/de_DE.js/0 | {
"file_path": "Humsen/web/web-pc/WebContent/plugins/validator/js/language/de_DE.js",
"repo_id": "Humsen",
"token_count": 7847
} | 72 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>文章</title>
<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>
<!-- 自定义脚本 -->
<script src="/js/article/blog-template.js"></script>
<!-- 显示markdown,只有显示文章细节才有 -->
<!-- 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>
<script src="/js/article/article-markdown.js"></script>
<!-- 自定义CSS -->
<link rel="stylesheet" href="/css/article/article.css">
<!-- 自定义脚本 -->
<script src="/js/article/blog-details.js"></script>
</head>
<body>
<input id="menuBarNo" value="1" type="hidden">
<div id="fh5co-page">
<!-- 左侧导航 -->
<!-- 中间内容 -->
<div id="fh5co-main">
<div id="list_blog" class="fh5co-post">
<!-- js脚本动态添加内容 -->
<div class="fh5co-entry markdown-body editormd-html-preview"
id="content"></div>
</div>
</div>
<!-- 右侧固定栏 -->
</div>
</body>
</html> | Humsen/web/web-pc/WebContent/topic/blog/blog_template.html/0 | {
"file_path": "Humsen/web/web-pc/WebContent/topic/blog/blog_template.html",
"repo_id": "Humsen",
"token_count": 877
} | 73 |
[MASTER]
load-plugins=pylint_odoo
score=n
[ODOOLINT]
readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
manifest-required-authors=Odoo Community Association (OCA)
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid-odoo-versions=16.0
[MESSAGES CONTROL]
disable=all
enable=anomalous-backslash-in-string,
api-one-deprecated,
api-one-multi-together,
assignment-from-none,
attribute-deprecated,
class-camelcase,
dangerous-default-value,
dangerous-view-replace-wo-priority,
development-status-allowed,
duplicate-id-csv,
duplicate-key,
duplicate-xml-fields,
duplicate-xml-record-id,
eval-referenced,
eval-used,
incoherent-interpreter-exec-perm,
license-allowed,
manifest-author-string,
manifest-deprecated-key,
manifest-required-author,
manifest-required-key,
manifest-version-format,
method-compute,
method-inverse,
method-required-super,
method-search,
openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
redundant-modulename-xml,
reimported,
relative-import,
return-in-init,
rst-syntax-error,
sql-injection,
too-few-format-args,
translation-field,
translation-required,
unreachable,
use-vim-comment,
wrong-tabs-instead-of-spaces,
xml-syntax-error,
attribute-string-redundant,
character-not-valid-in-resource-link,
consider-merging-classes-inherited,
context-overridden,
create-user-wo-reset-password,
dangerous-filter-wo-user,
dangerous-qweb-replace-wo-priority,
deprecated-data-xml-node,
deprecated-openerp-xml-node,
duplicate-po-message-definition,
except-pass,
file-not-used,
invalid-commit,
manifest-maintainers-list,
missing-newline-extrafiles,
missing-readme,
missing-return,
odoo-addons-relative-import,
old-api7-method-defined,
po-msgstr-variables,
po-syntax-error,
renamed-field-parameter,
resource-not-exist,
str-format-used,
test-folder-imported,
translation-contains-variable,
translation-positional-used,
unnecessary-utf8-coding-comment,
website-manifest-key-not-valid-uri,
xml-attribute-translatable,
xml-deprecated-qweb-directive,
xml-deprecated-tree-attribute,
external-request-timeout
[REPORTS]
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
output-format=colorized
reports=no
| OCA/web/.pylintrc-mandatory/0 | {
"file_path": "OCA/web/.pylintrc-mandatory",
"repo_id": "OCA",
"token_count": 1054
} | 74 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_advanced_search_x2x
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-03 03:49+0000\n"
"PO-Revision-Date: 2023-06-20 11:09+0000\n"
"Last-Translator: Nils Coenen <nils.coenen@nico-solutions.de>\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\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.17\n"
#. module: web_advanced_search
#. odoo-javascript
#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0
#, python-format
msgid " and "
msgstr " und "
#. module: web_advanced_search
#. odoo-javascript
#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0
#, python-format
msgid " is not "
msgstr " ist nicht "
#. module: web_advanced_search
#. odoo-javascript
#: code:addons/web_advanced_search/static/src/js/utils.esm.js:0
#, python-format
msgid " or "
msgstr " oder "
#. 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 "Erweitertes Filter hinzufügen"
#~ msgid "is in selection"
#~ msgstr "Ist in Auswahl"
| OCA/web/web_advanced_search/i18n/de.po/0 | {
"file_path": "OCA/web/web_advanced_search/i18n/de.po",
"repo_id": "OCA",
"token_count": 604
} | 75 |
To use this module, you need to:
* Open *Filters* in a search view
* Select any relational field
* Select operator `is equal to` or `is not equal to`
* The text field changes to a relational selection field where you
can search for the record in question
* Click *Apply*
To search for properties of linked records (ie invoices for customers
with a credit limit higher than X):
* Open *Filters* in a search view
* Select *Add Advanced Filter*
* Edit the advanced filter
* Click *Save*
Note that you can stack searching for properties: Simply add another
advanced search in the selection search window. You can do
this indefinetely, so it is possible to search for moves belonging
to a journal which has a user who is member of a certain group etc.
Note also the domain dialog offers an editable preview in debug mode:
.. image:: ../static/img/debug_mode.png
| OCA/web/web_advanced_search/readme/USAGE.rst/0 | {
"file_path": "OCA/web/web_advanced_search/readme/USAGE.rst",
"repo_id": "OCA",
"token_count": 221
} | 76 |
=================
Apply Field Style
=================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:38a4bb4c2b2b17a0055b08a8a192ba970bcc84eff7632e722687545c75251d72
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_apply_field_style
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_apply_field_style
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
Allow to set an additional css class to fields in form view.
Use case : you may highlight some fields for training purpose
.. figure:: https://raw.githubusercontent.com/OCA/web/16.0/web_apply_field_style/static/description/demo.png
:alt: Colored fields
**Table of contents**
.. contents::
:local:
Configuration
=============
Override _get_field_styles() with a dict of fields list per model
.. code-block:: python
class Base(models.AbstractModel):
_inherit = "base"
def _get_field_styles(self):
res = super()._get_field_styles()
res["product.product"] = {
"my-css-class1": ["field1", "field2"],
"my-css-class2": ["field3"],
}
return res
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_apply_field_style%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Akretion
Contributors
~~~~~~~~~~~~
* `Akretion <https://akretion.com>`_:
* David BEAL <david.beal@akretion.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/16.0/web_apply_field_style>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
| OCA/web/web_apply_field_style/README.rst/0 | {
"file_path": "OCA/web/web_apply_field_style/README.rst",
"repo_id": "OCA",
"token_count": 1279
} | 77 |
from . import test_module
| OCA/web/web_apply_field_style/tests/__init__.py/0 | {
"file_path": "OCA/web/web_apply_field_style/tests/__init__.py",
"repo_id": "OCA",
"token_count": 7
} | 78 |
/** @odoo-module **/
/* Copyright 2023 Tecnativa - Stefan Ungureanu
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
import {CalendarCommonRenderer} from "@web/views/calendar/calendar_common/calendar_common_renderer";
import {patch} from "@web/core/utils/patch";
patch(
CalendarCommonRenderer.prototype,
"WebCalendarSlotDurationCalendarCommonRenderer",
{
get options() {
const options = this._super(...arguments);
if (this.env.searchModel.context.calendar_slot_duration) {
options.slotDuration =
this.env.searchModel.context.calendar_slot_duration;
}
return options;
},
}
);
| OCA/web/web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js/0 | {
"file_path": "OCA/web/web_calendar_slot_duration/static/src/js/calendar_common_renderer.esm.js",
"repo_id": "OCA",
"token_count": 303
} | 79 |
# Copyright 2022 Hynsys Technologies
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import fields, models
class ResUsers(models.Model):
_inherit = "res.users"
chatter_position = fields.Selection(
[
("auto", "Responsive"),
("bottom", "Bottom"),
("sided", "Sided"),
],
default="auto",
)
@property
def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + ["chatter_position"]
@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + ["chatter_position"]
| OCA/web/web_chatter_position/models/res_users.py/0 | {
"file_path": "OCA/web/web_chatter_position/models/res_users.py",
"repo_id": "OCA",
"token_count": 275
} | 80 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_company_color
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-06 17:37+0000\n"
"Last-Translator: Rémi <remi@le-filament.com>\n"
"Language-Team: none\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 4.17\n"
#. module: web_company_color
#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form
msgid ""
"<span class=\"fa fa-info fa-2x me-2\"/>\n"
" In order for the changes to take effect, please refresh\n"
" the page."
msgstr ""
"<span class=\"fa fa-info fa-2x me-2\"/>\n"
" Pour que les modifications soient effectives, merci "
"d'actualiser\n"
" la page."
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg
msgid "Button Background Color"
msgstr "Couleur d'arrière-plan de bouton"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_bg_hover
msgid "Button Background Color Hover"
msgstr "Couleur d'arrière plan de bouton (survol)"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_button_text
msgid "Button Text Color"
msgstr "Couleur du texte de bouton"
#. module: web_company_color
#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form
msgid "Colors"
msgstr "Couleurs"
#. module: web_company_color
#: model:ir.model,name:web_company_color.model_res_company
msgid "Companies"
msgstr "Sociétés"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__company_colors
msgid "Company Colors"
msgstr "Couleurs de la société"
#. module: web_company_color
#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form
msgid "Company Styles"
msgstr "Styles de la société"
#. module: web_company_color
#: model_terms:ir.ui.view,arch_db:web_company_color.view_company_form
msgid "Compute colors from logo"
msgstr "Déterminer les couleurs à partir du logo"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text
msgid "Link Text Color"
msgstr "Couleur du texte des liens"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_link_text_hover
msgid "Link Text Color Hover"
msgstr "Couleur du texte des liens (survol)"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg
msgid "Navbar Background Color"
msgstr "Couleur de fond de la barre de navigation"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_bg_hover
msgid "Navbar Background Color Hover"
msgstr "Couleur de fond de la barre de navigation (survol)"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__color_navbar_text
msgid "Navbar Text Color"
msgstr "Couleur du texte de la barre de navigation"
#. module: web_company_color
#: model:ir.model,name:web_company_color.model_ir_qweb
msgid "Qweb"
msgstr "Qweb"
#. module: web_company_color
#: model:ir.model.fields,field_description:web_company_color.field_res_company__scss_modif_timestamp
msgid "SCSS Modif. Timestamp"
msgstr "Heure de modification du SCSS"
| OCA/web/web_company_color/i18n/fr.po/0 | {
"file_path": "OCA/web/web_company_color/i18n/fr.po",
"repo_id": "OCA",
"token_count": 1429
} | 81 |
# © 2022 Florian Kantelberg - initOS GmbH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResUsers(models.Model):
_inherit = "res.users"
dark_mode = fields.Boolean()
dark_mode_device_dependent = fields.Boolean("Device Dependent Dark Mode")
@property
def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + [
"dark_mode_device_dependent",
"dark_mode",
]
@property
def SELF_WRITEABLE_FIELDS(self):
return super().SELF_WRITEABLE_FIELDS + [
"dark_mode_device_dependent",
"dark_mode",
]
| OCA/web/web_dark_mode/models/res_users.py/0 | {
"file_path": "OCA/web/web_dark_mode/models/res_users.py",
"repo_id": "OCA",
"token_count": 296
} | 82 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_dashboard_tile
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-26 21:53+0000\n"
"PO-Revision-Date: 2022-10-26 21:53+0000\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_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__action_id
msgid "Action"
msgstr ""
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__active
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__active
msgid "Active"
msgstr "Actif"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_category_form
msgid "Archived"
msgstr "Archivée"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__avg
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__avg
msgid "Average"
msgstr "Moyenne"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Average value of '%s'"
msgstr "Valeur moyenne du champ '%s'"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__background_color
msgid "Background Color"
msgstr "Couleur de fond"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__category_id
msgid "Category"
msgstr "Catégorie"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__count
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__count
msgid "Count"
msgstr "Décompte"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__create_uid
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__create_date
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__create_date
msgid "Created on"
msgstr "Créé le"
#. module: web_dashboard_tile
#: model:ir.actions.act_window,name:web_dashboard_tile.action_tile_category
#: model:ir.ui.menu,name:web_dashboard_tile.menu_tile_category
msgid "Dashboard Categories"
msgstr "Catégories de tableau de bord"
#. module: web_dashboard_tile
#: model:ir.actions.act_window,name:web_dashboard_tile.action_category_2_tile
#: model:ir.actions.act_window,name:web_dashboard_tile.action_tile_tile
#: model:ir.ui.menu,name:web_dashboard_tile.menu_tile_tile
msgid "Dashboard Items"
msgstr "Eléments de tableau de bord"
#. module: web_dashboard_tile
#: model:ir.model,name:web_dashboard_tile.model_tile_tile
msgid "Dashboard Tile"
msgstr "Tuile de tableau de bord"
#. module: web_dashboard_tile
#: model:ir.model,name:web_dashboard_tile.model_tile_category
msgid "Dashboard Tile Category"
msgstr "Catégorie de tuile du tableau de bord"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Display"
msgstr "Afficher"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__display_name
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__domain
msgid "Domain"
msgstr "Domaine"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__domain_error
#, python-format
msgid "Domain Error"
msgstr "Erreur sur le domaine"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Error"
msgstr "Erreur"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__font_color
msgid "Font Color"
msgstr "Couleur de la police"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__group_ids
msgid "Groups"
msgstr "Groupes"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__hidden
msgid "Hidden"
msgstr "Caché"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__hide_if_null
msgid "Hide if null"
msgstr "Cacher si non défini"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__id
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__id
msgid "ID"
msgstr ""
#. module: web_dashboard_tile
#: model:ir.model.fields,help:web_dashboard_tile.field_tile_tile__hide_if_null
msgid "If checked, the item will be hidden if the primary value is null."
msgstr ""
"Si la case est cochée, l'élément sera caché si la valeur principale n'est "
"pas définie."
#. module: web_dashboard_tile
#: model:ir.model.fields,help:web_dashboard_tile.field_tile_tile__group_ids
msgid ""
"If this field is set, only users of this group can view this tile. Please "
"note that it will only work for global tiles (that is, when User field is "
"left empty)"
msgstr ""
"Si ce champ est renseigné, seul les utilisateurs de ce groupe pourront voir "
"cette tuile. Cette restriction ne fonctionne que s'il s'agit d'une tuile "
"globale (quand le champ Utilisateur n'est pas renseigné)"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_category_form
msgid "Items"
msgstr "Éléments"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category____last_update
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__write_uid
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__write_date
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__write_date
msgid "Last Updated on"
msgstr "Mis à jour le"
#. module: web_dashboard_tile
#: model:ir.model.fields,help:web_dashboard_tile.field_tile_tile__action_id
msgid "Let empty to use the default action related to the selected model."
msgstr ""
"Laisser libre pour utiliser l'action par défaut liée au modèle sélectionné."
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Main Value"
msgstr "Valeur principale"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__max
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__max
msgid "Maximum"
msgstr ""
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Maximum value of '%s'"
msgstr "Valeur maximale du champ '%s'"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__median
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__median
msgid "Median"
msgstr "Médiane"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Median value of '%s'"
msgstr "Valeur médiane du champ '%s'"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__min
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__min
msgid "Minimum"
msgstr ""
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Minimum value of '%s'"
msgstr "Valeur minimale du champ '%s'"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__model_id
msgid "Model"
msgstr "Modèle"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__model_name
msgid "Model name"
msgstr "Nom du modèle"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__name
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__name
msgid "Name"
msgstr "Nom"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Number of records"
msgstr "Nombre d'enregistrements"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__action_id
msgid "Odoo Action"
msgstr "Action Odoo"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__menu_id
msgid "Odoo Menu"
msgstr "Menu Odoo"
#. module: web_dashboard_tile
#: model:ir.ui.menu,name:web_dashboard_tile.menu_dashboard_tile
msgid "Overview"
msgstr "Vue d'ensemble"
#. module: web_dashboard_tile
#: model:ir.ui.menu,name:web_dashboard_tile.menu_tile_configuration
msgid "Overview Settings"
msgstr "Paramétrage de la vue d'ensemble"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Please select a field from the selected model."
msgstr "Veuillez sélectionner un champ correspondant au modèle sélectionné."
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_error
msgid "Primary Error"
msgstr "Erreur principale"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_field_id
msgid "Primary Field"
msgstr "Champ principal"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_format
msgid "Primary Format"
msgstr "Format principal"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_formated_value
msgid "Primary Formated Value"
msgstr "Valeur principale formatée"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_function
msgid "Primary Function"
msgstr "Fonction principale"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_helper
msgid "Primary Helper"
msgstr "Assistant principal"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__primary_value
msgid "Primary Value"
msgstr "Valeur principale"
#. module: web_dashboard_tile
#: model:ir.model.fields,help:web_dashboard_tile.field_tile_tile__primary_format
#: model:ir.model.fields,help:web_dashboard_tile.field_tile_tile__secondary_format
msgid ""
"Python Format String valid with str.format()\n"
"ie: '{:,} Kgs' will output '1,000 Kgs' if value is 1000."
msgstr ""
"Chaîne de format python valide, avec str.format()\n"
"par exemple: {:,} Kgs' affichera '1000 Kgs' si la valeur est 1000."
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_error
msgid "Secondary Error"
msgstr "Erreur secondaire"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_field_id
msgid "Secondary Field"
msgstr "champ secondaire"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_format
msgid "Secondary Format"
msgstr "Format secondaire"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_formated_value
msgid "Secondary Formated Value"
msgstr "Valeur secondaire formatée"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_function
msgid "Secondary Function"
msgstr "Fonction secondaire"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_helper
msgid "Secondary Helper"
msgstr "Assistant secondaire"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__secondary_value
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Secondary Value"
msgstr "Valeur secondaire"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Security"
msgstr "Sécurité"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__sequence
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__sequence
msgid "Sequence"
msgstr "Séquence"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Settings"
msgstr "Configuration"
#. module: web_dashboard_tile
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__primary_function__sum
#: model:ir.model.fields.selection,name:web_dashboard_tile.selection__tile_tile__secondary_function__sum
msgid "Sum"
msgstr "Somme"
#. module: web_dashboard_tile
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_category_form
#: model_terms:ir.ui.view,arch_db:web_dashboard_tile.view_tile_tile_form
msgid "Technical Informations"
msgstr "Informations techniques"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__tile_ids
msgid "Tiles"
msgstr "Tuiles"
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_category__tile_qty
msgid "Tiles Quantity"
msgstr "Nombre de tuiles"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Total value of '%s'"
msgstr "Somme du champ '%s'"
#. module: web_dashboard_tile
#: code:addons/web_dashboard_tile/models/tile_tile.py:0
#, python-format
msgid "Unimplemented Feature. Search on Active field disabled."
msgstr ""
"Fonctionnalité non implémentée. La recherche sur le champ 'Actif' est "
"désactivé."
#. module: web_dashboard_tile
#: model:ir.model.fields,field_description:web_dashboard_tile.field_tile_tile__user_id
msgid "User"
msgstr "Utilisateur"
| OCA/web/web_dashboard_tile/i18n/fr.po/0 | {
"file_path": "OCA/web/web_dashboard_tile/i18n/fr.po",
"repo_id": "OCA",
"token_count": 5524
} | 83 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_dialog_size
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-27 11:33+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_dialog_size
#: model:ir.model,name:web_dialog_size.model_ir_config_parameter
msgid "System Parameter"
msgstr "Parametro di sistema"
#~ msgid "Display Name"
#~ msgstr "Nome Visualizzato"
#~ msgid "ID"
#~ msgstr "ID"
#~ msgid "Last Modified on"
#~ msgstr "Ultima Modifica il"
| OCA/web/web_dialog_size/i18n/it.po/0 | {
"file_path": "OCA/web/web_dialog_size/i18n/it.po",
"repo_id": "OCA",
"token_count": 345
} | 84 |
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<t t-name="DialogDraggable" owl="1">
<div>
<t t-slot="default" />
</div>
</t>
</templates>
| OCA/web/web_dialog_size/static/src/xml/DialogDraggable.xml/0 | {
"file_path": "OCA/web/web_dialog_size/static/src/xml/DialogDraggable.xml",
"repo_id": "OCA",
"token_count": 96
} | 85 |
# Copyright 2023 Tecnativa - David Vidal
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from odoo import models
class Base(models.AbstractModel):
_inherit = "base"
def export_data(self, fields_to_export):
"""Export fields for selected objects
:param fields_to_export: list of fields
:param raw_data: True to return value in native Python type
:rtype: dictionary with a *datas* matrix
This method is used when exporting data via client menu
"""
if self.env.user.has_group("web_disable_export_group.group_export_xlsx_data"):
fields_to_export = [
models.fix_import_export_id_paths(f) for f in fields_to_export
]
return {"datas": self._export_rows(fields_to_export)}
return super().export_data(fields_to_export)
| OCA/web/web_disable_export_group/models/models.py/0 | {
"file_path": "OCA/web/web_disable_export_group/models/models.py",
"repo_id": "OCA",
"token_count": 345
} | 86 |
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2015 Francesco OpenCode Apruzzese <cescoap@gmail.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<!-- Add ribbon name default configuration parameter -->
<record id="default_ribbon_name" model="ir.config_parameter">
<field name="key">ribbon.name</field>
<field name="value"><![CDATA[TEST<br/>({db_name})]]></field>
</record>
<!-- Add ribbon color configuration parameter -->
<record id="set_ribbon_color" model="ir.config_parameter">
<field name="key">ribbon.color</field>
<field name="value">#f0f0f0</field>
</record>
<!-- Add ribbon background color configuration parameter -->
<record id="set_ribbon_background_color" model="ir.config_parameter">
<field name="key">ribbon.background.color</field>
<field name="value">rgba(255,0,0,.6)</field>
</record>
</odoo>
| OCA/web/web_environment_ribbon/data/ribbon_data.xml/0 | {
"file_path": "OCA/web/web_environment_ribbon/data/ribbon_data.xml",
"repo_id": "OCA",
"token_count": 363
} | 87 |
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class WebEnvironmentRibbonBackend(models.AbstractModel):
_name = "web.environment.ribbon.backend"
_description = "Web Environment Ribbon Backend"
@api.model
def _prepare_ribbon_format_vals(self):
return {"db_name": self.env.cr.dbname}
@api.model
def _prepare_ribbon_name(self):
name_tmpl = self.env["ir.config_parameter"].sudo().get_param("ribbon.name")
vals = self._prepare_ribbon_format_vals()
return name_tmpl and name_tmpl.format(**vals) or name_tmpl
@api.model
def get_environment_ribbon(self):
"""
This method returns the ribbon data from ir config parameters
:return: dictionary
"""
ir_config_model = self.env["ir.config_parameter"]
name = self._prepare_ribbon_name()
return {
"name": name,
"color": ir_config_model.sudo().get_param("ribbon.color"),
"background_color": ir_config_model.sudo().get_param(
"ribbon.background.color"
),
}
| OCA/web/web_environment_ribbon/models/web_environment_ribbon_backend.py/0 | {
"file_path": "OCA/web/web_environment_ribbon/models/web_environment_ribbon_backend.py",
"repo_id": "OCA",
"token_count": 502
} | 88 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"
| OCA/web/web_field_numeric_formatting/i18n/web_field_numeric_formatting.pot/0 | {
"file_path": "OCA/web/web_field_numeric_formatting/i18n/web_field_numeric_formatting.pot",
"repo_id": "OCA",
"token_count": 136
} | 89 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_group_expand
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-20 10:58+0000\n"
"PO-Revision-Date: 2020-04-20 12:59+0200\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_group_expand
#. odoo-javascript
#: code:addons/web_group_expand/static/src/xml/list_controller.xml:0
#, python-format
msgid "Compress"
msgstr ""
#. module: web_group_expand
#. odoo-javascript
#: code:addons/web_group_expand/static/src/xml/list_controller.xml:0
#, python-format
msgid "Expand"
msgstr ""
#, python-format
#~ msgid "Collapse groups"
#~ msgstr "Groepen inklappen"
#, python-format
#~ msgid "Expand groups"
#~ msgstr "Groepen uitvouwen"
| OCA/web/web_group_expand/i18n/nl.po/0 | {
"file_path": "OCA/web/web_group_expand/i18n/nl.po",
"repo_id": "OCA",
"token_count": 390
} | 90 |
* Dennis Sluijk <d.sluijk@onestein.nl>
| OCA/web/web_help/readme/CONTRIBUTORS.rst/0 | {
"file_path": "OCA/web/web_help/readme/CONTRIBUTORS.rst",
"repo_id": "OCA",
"token_count": 19
} | 91 |
/** @odoo-module **/
import {renderToString} from "@web/core/utils/render";
export class Trip {
constructor(env) {
this.steps = [];
this.env = env;
this.index = -1;
this.highlighterService = this.env.services.highlighter;
}
get count() {
return this.steps.length;
}
get isAtLastStep() {
return this.index === this.count - 1;
}
_getStepTemplate() {
const step = this.steps[this.index];
if (step.template) {
return step.template;
}
return this.isAtLastStep ? "web_help.TripStepLast" : "web_help.TripStep";
}
setup() {
return;
}
addStep({
selector,
content,
beforeHighlight = async () => {
return;
},
animate = 250,
padding = 10,
template = null,
renderContext = {},
}) {
this.steps.push({
selector: selector,
content: content,
beforeHighlight: beforeHighlight,
animate: animate,
padding: padding,
template: template,
renderContext: renderContext,
});
}
start() {
this.nextStep();
}
stop() {
this.index = -1;
this.highlighterService.hide();
}
_getStepRenderContext() {
const step = this.steps[this.index];
return Object.assign(
{
content: step.content,
cbBtnText: this.isAtLastStep
? this.env._t("Finish")
: this.env._t("Got it"),
closeBtnText: this.env._t("Close"),
},
step.renderContext
);
}
async nextStep() {
this.index++;
let cb = this.nextStep;
if (this.isAtLastStep) {
cb = this.stop;
}
const step = this.steps[this.index];
const $stepRender = $(
renderToString(this._getStepTemplate(), this._getStepRenderContext())
);
const $cbButton = $stepRender.find(".web_help_cb_button");
$cbButton.click(() => {
$cbButton.attr("disabled", "disabled");
cb.bind(this)();
});
$stepRender.find(".web_help_close").click(this.stop.bind(this));
await step.beforeHighlight();
this.highlighterService.highlight(
step.selector,
$stepRender,
step.animate,
step.padding
);
}
}
| OCA/web/web_help/static/src/trip.esm.js/0 | {
"file_path": "OCA/web/web_help/static/src/trip.esm.js",
"repo_id": "OCA",
"token_count": 1279
} | 92 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-09-20 17:50+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__help
msgid "Action Description"
msgstr "Descripción de la acción"
#. module: web_ir_actions_act_multi
#: model:ir.model,name:web_ir_actions_act_multi.model_ir_actions_act_multi
msgid "Action Mulit"
msgstr "Acción múltiple"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__name
msgid "Action Name"
msgstr "Nombre Acción"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__type
msgid "Action Type"
msgstr "Tipo de Acción"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__binding_model_id
msgid "Binding Model"
msgstr "Modelo de encuadernación"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__binding_type
msgid "Binding Type"
msgstr "Tipo de encuadernación"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__binding_view_types
msgid "Binding View Types"
msgstr "Tipos de vistas vinculantes"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__create_date
msgid "Created on"
msgstr "Creado el"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__xml_id
msgid "External ID"
msgstr "ID Externa"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__id
msgid "ID"
msgstr "ID (identificación)"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,field_description:web_ir_actions_act_multi.field_ir_actions_act_multi__write_date
msgid "Last Updated on"
msgstr "Última Actualización el"
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,help:web_ir_actions_act_multi.field_ir_actions_act_multi__help
msgid ""
"Optional help text for the users with a description of the target view, such "
"as its usage and purpose."
msgstr ""
"Texto de ayuda opcional para los usuarios con una descripción de la vista de "
"destino, como su uso y propósito."
#. module: web_ir_actions_act_multi
#: model:ir.model.fields,help:web_ir_actions_act_multi.field_ir_actions_act_multi__binding_model_id
msgid ""
"Setting a value makes this action available in the sidebar for the given "
"model."
msgstr ""
"Establecer un valor hace que esta acción esté disponible en la barra lateral "
"para el modelo dado."
| OCA/web/web_ir_actions_act_multi/i18n/es.po/0 | {
"file_path": "OCA/web/web_ir_actions_act_multi/i18n/es.po",
"repo_id": "OCA",
"token_count": 1533
} | 93 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_ir_actions_act_window_message
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-02 09:52+0000\n"
"PO-Revision-Date: 2017-06-02 09:52+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#. module: web_ir_actions_act_window_message
#. openerp-web
#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:0
#, python-format
msgid "Close"
msgstr "إغلاق"
| OCA/web/web_ir_actions_act_window_message/i18n/ar.po/0 | {
"file_path": "OCA/web/web_ir_actions_act_window_message/i18n/ar.po",
"repo_id": "OCA",
"token_count": 418
} | 94 |
from . import ir_actions
| OCA/web/web_ir_actions_act_window_message/models/__init__.py/0 | {
"file_path": "OCA/web/web_ir_actions_act_window_message/models/__init__.py",
"repo_id": "OCA",
"token_count": 7
} | 95 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_ir_actions_act_window_page
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-09-02 20:35+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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_ir_actions_act_window_page
#: model:ir.model,name:web_ir_actions_act_window_page.model_ir_actions_act_window_page_next
msgid "Action to page to the next record from a form view button"
msgstr ""
"Acción de pasar al registro siguiente desde un botón de vista de formulario"
#. module: web_ir_actions_act_window_page
#: model:ir.model,name:web_ir_actions_act_window_page.model_ir_actions_act_window_page_prev
msgid "Action to page to the previous record from a form view button"
msgstr ""
"Acción para pasar al registro anterior desde un botón de vista de formulario"
#. module: web_ir_actions_act_window_page
#: model:ir.model,name:web_ir_actions_act_window_page.model_ir_actions_act_window_page_list
msgid "Action to switch to the list view"
msgstr "Acción para cambiar a la vista de lista"
#. module: web_ir_actions_act_window_page
#: model_terms:ir.ui.view,arch_db:web_ir_actions_act_window_page.view_partner_form
msgid "Next Partner"
msgstr "Siguiente socio"
#. module: web_ir_actions_act_window_page
#: model:ir.actions.server,name:web_ir_actions_act_window_page.demo_pager_next
msgid "Next partner"
msgstr "Siguiente socio"
#. module: web_ir_actions_act_window_page
#: model_terms:ir.ui.view,arch_db:web_ir_actions_act_window_page.view_partner_form
msgid "Previous Partner"
msgstr "Socio Anterior"
#. module: web_ir_actions_act_window_page
#: model:ir.actions.server,name:web_ir_actions_act_window_page.demo_pager_previous
msgid "Previous partner"
msgstr "Socio anterior"
| OCA/web/web_ir_actions_act_window_page/i18n/es.po/0 | {
"file_path": "OCA/web/web_ir_actions_act_window_page/i18n/es.po",
"repo_id": "OCA",
"token_count": 784
} | 96 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_m2x_options
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-03 03:50+0000\n"
"PO-Revision-Date: 2023-09-02 20:35+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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_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 ",¿Está seguro de que aún no existe?"
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/base.xml:0
#, python-format
msgid "Create"
msgstr "Crear"
#. 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 "Crear \"%s\""
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/base.xml:0
#, python-format
msgid "Create and Edit"
msgstr "Crear y Editar"
#. 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 "Crear y editar..."
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/base.xml:0
#, python-format
msgid "Discard"
msgstr "Descartar"
#. module: web_m2x_options
#: model:ir.model,name:web_m2x_options.model_ir_http
msgid "HTTP Routing"
msgstr "Enrutamiento HTTP"
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/form.esm.js:0
#, python-format
msgid "New: %s"
msgstr "Nuevo: %s"
#. 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 "Sin registros"
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/form.esm.js:0
#, python-format
msgid "Open: "
msgstr "Abrir "
#. 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 "Buscar más..."
#. 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 "Empieza a escribir..."
#. module: web_m2x_options
#: model:ir.model,name:web_m2x_options.model_ir_config_parameter
msgid "System Parameter"
msgstr "Parámetro del Sistema"
#. 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 "Estás creando un nuevo"
#. module: web_m2x_options
#. odoo-javascript
#: code:addons/web_m2x_options/static/src/components/base.xml:0
#, python-format
msgid "as a new"
msgstr "como un nuevo"
#, python-format
#~ msgid "Cancel"
#~ msgstr "Cancelar"
#, python-format
#~ msgid "Create \"<strong>%s</strong>\""
#~ msgstr "Crear \"<strong>%s</strong>\""
#, python-format
#~ msgid "Create a %s"
#~ msgstr "Crear un %s"
#, python-format
#~ msgid "Create and Edit..."
#~ msgstr "Crear y editar..."
#, python-format
#~ msgid "Create and edit"
#~ msgstr "Crear y editar"
#, python-format
#~ msgid "You are creating a new %s, are you sure it does not exist yet?"
#~ msgstr "Está creando un nuevo %s, ¿está seguro de no existe ya?"
| OCA/web/web_m2x_options/i18n/es.po/0 | {
"file_path": "OCA/web/web_m2x_options/i18n/es.po",
"repo_id": "OCA",
"token_count": 1591
} | 97 |
* David Coninckx <davconinckx@gmail.com>
* Emanuel Cino <ecino@compassion.ch>
* Holger Brunn <hbrunn@therp.nl>
* Nicolas JEUDY <nicolas@sudokeys.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Zakaria Makrelouf <z.makrelouf@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Jairo Llopis <jairo.llopis@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
* Ernesto Tejeda <ernesto.tejeda87@gmail.com>
* Carlos Roca
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Dhara Solanki <dhara.solanki@initos.com> (http://www.initos.com)
* `Trobz <https://trobz.com>`_:
* Hoang Diep <hoang@trobz.com>
| OCA/web/web_m2x_options/readme/CONTRIBUTORS.rst/0 | {
"file_path": "OCA/web/web_m2x_options/readme/CONTRIBUTORS.rst",
"repo_id": "OCA",
"token_count": 289
} | 98 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_notify
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Danger"
msgstr ""
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Default"
msgstr ""
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Information"
msgstr "Informacija"
#. module: web_notify
#: model:ir.model.fields,field_description:web_notify.field_res_users__notify_danger_channel_name
#, fuzzy
msgid "Notify Danger Channel Name"
msgstr "Naziv kanala upozorenja"
#. module: web_notify
#: model:ir.model.fields,field_description:web_notify.field_res_users__notify_default_channel_name
#, fuzzy
msgid "Notify Default Channel Name"
msgstr "Naziv kanala informacija"
#. module: web_notify
#: model:ir.model.fields,field_description:web_notify.field_res_users__notify_info_channel_name
#, fuzzy
msgid "Notify Info Channel Name"
msgstr "Naziv kanala informacija"
#. module: web_notify
#: model:ir.model.fields,field_description:web_notify.field_res_users__notify_success_channel_name
#, fuzzy
msgid "Notify Success Channel Name"
msgstr "Naziv kanala informacija"
#. module: web_notify
#: model:ir.model.fields,field_description:web_notify.field_res_users__notify_warning_channel_name
#, fuzzy
msgid "Notify Warning Channel Name"
msgstr "Naziv kanala upozorenja"
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Sending a notification to another user is forbidden."
msgstr ""
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Success"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test danger notification"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test default notification"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test info notification"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test success notification"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test warning notification"
msgstr ""
#. module: web_notify
#: model_terms:ir.ui.view,arch_db:web_notify.view_users_form_simple_modif_inherit
msgid "Test web notify"
msgstr ""
#. module: web_notify
#: model:ir.model,name:web_notify.model_res_users
msgid "User"
msgstr ""
#. module: web_notify
#. odoo-python
#: code:addons/web_notify/models/res_users.py:0
#, python-format
msgid "Warning"
msgstr "Upozorenje"
#~ msgid "Users"
#~ msgstr "Korisnici"
| OCA/web/web_notify/i18n/hr.po/0 | {
"file_path": "OCA/web/web_notify/i18n/hr.po",
"repo_id": "OCA",
"token_count": 1416
} | 99 |
This module will send an instant notifications to all users of a channel when a new message has been posted.
| OCA/web/web_notify_channel_message/readme/DESCRIPTION.rst/0 | {
"file_path": "OCA/web/web_notify_channel_message/readme/DESCRIPTION.rst",
"repo_id": "OCA",
"token_count": 22
} | 100 |
from . import controllers
from . import models
| OCA/web/web_pwa_oca/__init__.py/0 | {
"file_path": "OCA/web/web_pwa_oca/__init__.py",
"repo_id": "OCA",
"token_count": 10
} | 101 |
* Integrate `Notification API <https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification>`_
* Integrate `Web Share API <https://web.dev/web-share/>`_
* Create ``portal_pwa`` module, intended to be used by front-end users (customers, suppliers...)
* Current *John Resig's inheritance* implementation doesn't support ``async``
functions because ``this._super`` can't be called inside a promise. So we
need to use the following workaround:
- Natural 'async/await' example (This breaks "_super" call):
.. code-block:: javascript
var MyClass = OdooClass.extend({
myFunc: async function() {
const mydata = await ...do await stuff...
return mydata;
}
});
- Same code with the workaround:
.. code-block:: javascript
var MyClass = OdooClass.extend({
myFunc: function() {
return new Promise(async (resolve, reject) => {
const mydata = await ...do await stuff...
return resolve(mydata);
});
}
});
* Fix issue when trying to run in localhost with several databases. The browser
doesn't send the cookie and web manifest returns 404.
* Firefox can't detect 'standalone' mode. See https://bugzilla.mozilla.org/show_bug.cgi?id=1285858
* Firefox disable service worker in private mode. See https://bugzilla.mozilla.org/show_bug.cgi?id=1601916
| OCA/web/web_pwa_oca/readme/ROADMAP.rst/0 | {
"file_path": "OCA/web/web_pwa_oca/readme/ROADMAP.rst",
"repo_id": "OCA",
"token_count": 550
} | 102 |
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="web_layout_pwa"
name="Web layout PWA"
inherit_id="web.webclient_bootstrap"
>
<xpath expr="//t[@t-call-assets='web.assets_common']" position="before">
<!-- Add link rel manifest -->
<link rel="manifest" t-attf-href="/web_pwa_oca/manifest.webmanifest" />
<!-- Add iOS meta tags and icons -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<t
t-set="pwa_name"
t-value="request.env['ir.config_parameter'].sudo().get_param('pwa.manifest.name')"
/>
<meta name="apple-mobile-web-app-title" t-att-content="pwa_name" />
<link
rel="apple-touch-icon"
href="/web_pwa_oca/static/img/icons/icon-152x152.png"
/>
<!-- Add meta theme-color -->
<t
t-set="pwa_theme_color"
t-value="request.env['ir.config_parameter'].sudo().get_param('pwa.manifest.theme_color')"
/>
<meta name="theme-color" t-att-content="pwa_theme_color" />
</xpath>
</template>
</odoo>
| OCA/web/web_pwa_oca/templates/assets.xml/0 | {
"file_path": "OCA/web/web_pwa_oca/templates/assets.xml",
"repo_id": "OCA",
"token_count": 673
} | 103 |
* Vauxoo
The migration of this module from 15.0 to 16.0 was financially supported by:
* Komit (https://komit-consulting.com/)
| OCA/web/web_remember_tree_column_width/readme/CREDITS.rst/0 | {
"file_path": "OCA/web/web_remember_tree_column_width/readme/CREDITS.rst",
"repo_id": "OCA",
"token_count": 43
} | 104 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_responsive
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
"PO-Revision-Date: 2023-04-03 13:22+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\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 "Aktivnosti"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/search_panel/search_panel.xml:0
#, python-format
msgid "All"
msgstr "Sve"
#. 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 "Učitavam brojač priloga..."
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0
#, python-format
msgid "Attachments"
msgstr "Prilozi"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0
#, python-format
msgid "CLEAR"
msgstr "OČISTI"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0
#, python-format
msgid "Discard"
msgstr "Odustani"
#. 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 "TRAŽI"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/apps_menu/apps_menu.xml:0
#, python-format
msgid "Home Menu"
msgstr "Glavni izbornik"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0
#, python-format
msgid "Log note"
msgstr "Zabilježi napomenu"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml:0
#, python-format
msgid "Maximize"
msgstr "Maksimiziraj"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml:0
#, python-format
msgid "Minimize"
msgstr "Minimiziraj"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0
#, python-format
msgid "New"
msgstr "Novi"
#. 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 "VIDI REZULTAT"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/legacy/xml/form_buttons.xml:0
#, python-format
msgid "Save"
msgstr "Spremi"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/apps_menu/apps_menu.xml:0
#, python-format
msgid "Search menus..."
msgstr "Pretraži izbornike..."
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0
#, python-format
msgid "Search..."
msgstr "Pretraži..."
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml:0
#, python-format
msgid "Send message"
msgstr "Pošalji poruku"
#. module: web_responsive
#. odoo-javascript
#: code:addons/web_responsive/static/src/components/control_panel/control_panel.xml:0
#, python-format
msgid "View switcher"
msgstr "Izmjena pogleda"
#~ msgid "<span class=\"sr-only\">Toggle App Drawer</span>"
#~ msgstr "<span class=\"sr-only\">Izmjeni izbornik aplikacije</span>"
#~ msgid "<span class=\"sr-only\">Toggle Navigation</span>"
#~ msgstr "<span class=\"sr-only\">Izmjeni navigaciju</span>"
#~ msgid "Apps"
#~ msgstr "Apikacije"
#~ msgid "More <b class=\"caret\"/>"
#~ msgstr "Više <b class=\"caret\"/>"
| OCA/web/web_responsive/i18n/hr.po/0 | {
"file_path": "OCA/web/web_responsive/i18n/hr.po",
"repo_id": "OCA",
"token_count": 1805
} | 105 |
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2023 Onestein - Anjeel Haria
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
-->
<templates xml:space="preserve">
<!-- Modifying the ChatterTopBar for Mobile View -->
<t
t-name="web.Responsivemail.ChatterTopbar"
t-inherit="mail.ChatterTopbar"
owl="1"
t-inherit-mode="extension"
>
<xpath expr="//div[contains(@class, 'o_ChatterTopbar')]" position="replace">
<t t-if="ui.isSmall">
<div
class="o_ChatterTopbar_rightSection d-flex border-bottom"
style="max-height:45%"
>
<button
t-if="chatterTopbar.chatter.thread.allAttachments.length === 0"
class="o_ChatterTopbar_button o_ChatterTopbar_buttonAddAttachments btn btn-light btn-primary"
type="button"
t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasWriteAccess"
t-on-click="chatterTopbar.chatter.onClickButtonAddAttachments"
style="width:41%"
>
<i
class="fa fa-paperclip fa-lg me-1"
role="img"
aria-label="Attachments"
/>
<t t-if="chatterTopbar.chatter.isShowingAttachmentsLoading">
<i
class="o_ChatterTopbar_buttonAttachmentsCountLoader fa fa-circle-o-notch fa-spin"
aria-label="Attachment counter loading..."
/>
</t>
</button>
<button
t-if="chatterTopbar.chatter.thread.allAttachments.length > 0"
class="o_ChatterTopbar_button o_ChatterTopbar_buttonToggleAttachments btn btn-light btn-primary"
type="button"
t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasReadAccess"
t-att-aria-expanded="chatterTopbar.chatter.attachmentBoxView ? 'true' : 'false'"
t-on-click="chatterTopbar.chatter.onClickButtonToggleAttachments"
style="width:41%"
>
<i
class="fa fa-paperclip fa-lg me-1"
role="img"
aria-label="Attachments"
/>
<t t-if="!chatterTopbar.chatter.isShowingAttachmentsLoading">
<span
class="o_ChatterTopbar_buttonCount o_ChatterTopbar_buttonAttachmentsCount"
t-esc="chatterTopbar.attachmentButtonText"
/>
</t>
<t t-if="chatterTopbar.chatter.isShowingAttachmentsLoading">
<i
class="o_ChatterTopbar_buttonAttachmentsCountLoader fa fa-circle-o-notch fa-spin"
aria-label="Attachment counter loading..."
/>
</t>
</button>
<t
t-if="chatterTopbar.chatter.hasFollowers and chatterTopbar.chatter.thread"
>
<FollowerListMenu
className="'o_ChatterTopbar_followerListMenu w-26'"
record="chatterTopbar.chatter.followerListMenuView"
/>
<t t-if="chatterTopbar.chatter.followButtonView">
<FollowButton
className="'o_ChatterTopbar_followButton'"
record="chatterTopbar.chatter.followButtonView"
/>
</t>
</t>
</div>
</t>
<div
class="o_ChatterTopbar justify-content-between d-flex"
t-attf-class="{{ className }}"
t-ref="root"
>
<div
class="o_ChatterTopbar_actions flex-fill d-flex border-transparent"
>
<div
class="o_ChatterTopbar_controllers d-flex pe-2"
t-if="chatterTopbar.chatter.threadView"
>
<button
class="o_ChatterTopbar_button o_ChatterTopbar_buttonSendMessage btn text-nowrap me-2"
type="button"
t-att-class="{
'o-active btn-odoo': chatterTopbar.chatter.composerView and !chatterTopbar.chatter.composerView.composer.isLog,
'btn-odoo': !chatterTopbar.chatter.composerView,
'btn-light': chatterTopbar.chatter.composerView and chatterTopbar.chatter.composerView.composer.isLog,
}"
t-att-disabled="!chatterTopbar.chatter.canPostMessage"
data-hotkey="m"
t-on-click="chatterTopbar.chatter.onClickSendMessage"
>
Send message
</button>
<button
class="o_ChatterTopbar_button o_ChatterTopbar_buttonLogNote btn text-nowrap"
type="button"
t-att-class="{
'o-active btn-odoo': chatterTopbar.chatter.composerView and chatterTopbar.chatter.composerView.composer.isLog,
'btn-light': chatterTopbar.chatter.composerView and !chatterTopbar.chatter.composerView.composer.isLog or !chatterTopbar.chatter.composerView,
}"
t-att-disabled="!chatterTopbar.chatter.canPostMessage"
t-on-click="chatterTopbar.chatter.onClickLogNote"
data-hotkey="shift+m"
>
Log note
</button>
</div>
<div
class="o_ChatterTopbar_tools position-relative d-flex flex-grow-1 border-bottom"
t-att-class="{
'border-start ps-2': chatterTopbar.chatter.hasActivities,
}"
>
<t t-if="chatterTopbar.chatter.hasActivities">
<button
class="o_ChatterTopbar_button o_ChatterTopbar_buttonScheduleActivity btn btn-light text-nowrap"
type="button"
t-att-disabled="!chatterTopbar.chatter.canPostMessage"
t-on-click="chatterTopbar.chatter.onClickScheduleActivity"
data-hotkey="shift+a"
>
<i class="fa fa-clock-o me-1" />
<span>Activities</span>
</button>
</t>
<div
class="flex-grow-1 border-start pe-2"
t-att-class="{
'ms-2': chatterTopbar.chatter.hasActivities,
}"
/>
<t t-if="!ui.isSmall">
<div
class="o_ChatterTopbar_rightSection flex-grow-1 flex-shrink-0 justify-content-end d-flex"
>
<button
t-if="chatterTopbar.chatter.thread.allAttachments.length === 0"
class="o_ChatterTopbar_button o_ChatterTopbar_buttonAddAttachments btn btn-light btn-primary"
type="button"
t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasWriteAccess"
t-on-click="chatterTopbar.chatter.onClickButtonAddAttachments"
>
<i
class="fa fa-paperclip fa-lg me-1"
role="img"
aria-label="Attachments"
/>
<t
t-if="chatterTopbar.chatter.isShowingAttachmentsLoading"
>
<i
class="o_ChatterTopbar_buttonAttachmentsCountLoader fa fa-circle-o-notch fa-spin"
aria-label="Attachment counter loading..."
/>
</t>
</button>
<button
t-if="chatterTopbar.chatter.thread.allAttachments.length > 0"
class="o_ChatterTopbar_button o_ChatterTopbar_buttonToggleAttachments btn btn-light btn-primary"
type="button"
t-att-disabled="!chatterTopbar.chatter.isTemporary and !chatterTopbar.chatter.hasReadAccess"
t-att-aria-expanded="chatterTopbar.chatter.attachmentBoxView ? 'true' : 'false'"
t-on-click="chatterTopbar.chatter.onClickButtonToggleAttachments"
>
<i
class="fa fa-paperclip fa-lg me-1"
role="img"
aria-label="Attachments"
/>
<t
t-if="!chatterTopbar.chatter.isShowingAttachmentsLoading"
>
<span
class="o_ChatterTopbar_buttonCount o_ChatterTopbar_buttonAttachmentsCount"
t-esc="chatterTopbar.attachmentButtonText"
/>
</t>
<t
t-if="chatterTopbar.chatter.isShowingAttachmentsLoading"
>
<i
class="o_ChatterTopbar_buttonAttachmentsCountLoader fa fa-circle-o-notch fa-spin"
aria-label="Attachment counter loading..."
/>
</t>
</button>
<t
t-if="chatterTopbar.chatter.hasFollowers and chatterTopbar.chatter.thread"
>
<FollowerListMenu
className="'o_ChatterTopbar_followerListMenu'"
record="chatterTopbar.chatter.followerListMenuView"
/>
<t t-if="chatterTopbar.chatter.followButtonView">
<FollowButton
className="'o_ChatterTopbar_followButton'"
record="chatterTopbar.chatter.followButtonView"
/>
</t>
</t>
</div>
</t>
</div>
</div>
</div>
</xpath>
</t>
</templates>
| OCA/web/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml/0 | {
"file_path": "OCA/web/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml",
"repo_id": "OCA",
"token_count": 8343
} | 106 |
/* Copyright 2021 ITerra - Sergey Shebanin
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
odoo.define("web_responsive.test_patch", function (require) {
"use strict";
const utils = require("web_tour.TourStepUtils");
/* Make base odoo JS tests working */
utils.include({
showAppsMenuItem() {
return {
edition: "community",
trigger: ".o_navbar_apps_menu",
auto: true,
position: "bottom",
};
},
});
});
| OCA/web/web_responsive/static/tests/test_patch.js/0 | {
"file_path": "OCA/web/web_responsive/static/tests/test_patch.js",
"repo_id": "OCA",
"token_count": 256
} | 107 |
/** @odoo-module **/
import {patch} from "@web/core/utils/patch";
import {rankInterval} from "@web/search/utils/dates";
import {SearchModel} from "@web/search/search_model";
patch(SearchModel.prototype, "web_search_with_and/static/src/js/search_model.js", {
_getGroups() {
const preGroups = [];
for (const queryElem of this.query) {
const {searchItemId} = queryElem;
let {groupId} = this.searchItems[searchItemId];
if ("autocompleteValue" in queryElem) {
if (queryElem.autocompleteValue.isShiftKey) {
groupId = Math.random();
}
}
let preGroup = preGroups.find((group) => group.id === groupId);
if (!preGroup) {
preGroup = {id: groupId, queryElements: []};
preGroups.push(preGroup);
}
queryElem.groupId = groupId;
preGroup.queryElements.push(queryElem);
}
const groups = [];
for (const preGroup of preGroups) {
const {queryElements, id} = preGroup;
const activeItems = [];
for (const queryElem of queryElements) {
const {searchItemId} = queryElem;
let activeItem = activeItems.find(
({searchItemId: id}) => id === searchItemId
);
if ("generatorId" in queryElem) {
if (!activeItem) {
activeItem = {searchItemId, generatorIds: []};
activeItems.push(activeItem);
}
activeItem.generatorIds.push(queryElem.generatorId);
} else if ("intervalId" in queryElem) {
if (!activeItem) {
activeItem = {searchItemId, intervalIds: []};
activeItems.push(activeItem);
}
activeItem.intervalIds.push(queryElem.intervalId);
} else if ("autocompleteValue" in queryElem) {
if (!activeItem) {
activeItem = {searchItemId, autocompletValues: []};
activeItems.push(activeItem);
}
activeItem.autocompletValues.push(queryElem.autocompleteValue);
} else if (!activeItem) {
activeItem = {searchItemId};
activeItems.push(activeItem);
}
}
for (const activeItem of activeItems) {
if ("intervalIds" in activeItem) {
activeItem.intervalIds.sort(
(g1, g2) => rankInterval(g1) - rankInterval(g2)
);
}
}
groups.push({id, activeItems});
}
return groups;
},
deactivateGroup(groupId) {
this.query = this.query.filter((queryElem) => {
return queryElem.groupId !== groupId;
});
for (const partName in this.domainParts) {
const part = this.domainParts[partName];
if (part.groupId === groupId) {
this.setDomainParts({[partName]: null});
}
}
this._checkComparisonStatus();
this._notify();
},
});
| OCA/web/web_search_with_and/static/src/js/search_model.esm.js/0 | {
"file_path": "OCA/web/web_search_with_and/static/src/js/search_model.esm.js",
"repo_id": "OCA",
"token_count": 1779
} | 108 |
=========================
Web Send Message as Popup
=========================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0083ff4f27d544631c17fd7354b1243d92d296ca3a3a9f61b183e739ec6e8346
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_send_message_popup
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_send_message_popup
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
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.
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_send_message_popup%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Camptocamp
Contributors
~~~~~~~~~~~~
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Nicolas JEUDY <https://github.com/njeudy>
* Artem Kostyuk <a.kostyuk@mobilunity.com>
* Stéphane Mangin <stephane.mangin@camptocamp.com>
* Helly kapatel <helly.kapatel@initos.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/16.0/web_send_message_popup>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
| OCA/web/web_send_message_popup/README.rst/0 | {
"file_path": "OCA/web/web_send_message_popup/README.rst",
"repo_id": "OCA",
"token_count": 1194
} | 109 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-28 16:10+0000\n"
"Last-Translator: Adriano Prado <adrianojprado@gmail.com>\n"
"Language-Team: none\n"
"Language: pt_BR\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_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:0
#, python-format
msgid "<b>UNASSIGNED</b>"
msgstr "<b>NÃO ATRIBUÍDO</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 "Tem certeza de que deseja excluir este registro?"
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:0
#, python-format
msgid "Day"
msgstr "Dia"
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:0
#, python-format
msgid "Month"
msgstr "Mês"
#. 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 ""
"O modelo \"item da linha do tempo\" não está presente na definição da "
"visualização da linha do tempo."
#. 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 "Linha do Tempo"
#. 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 "A visualização da linha do tempo não definiu o atributo 'date_start'."
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:0
#, python-format
msgid "Today"
msgstr "Hoje"
#. module: web_timeline
#: model:ir.model,name:web_timeline.model_ir_ui_view
msgid "View"
msgstr "Visão"
#. module: web_timeline
#: model:ir.model.fields,field_description:web_timeline.field_ir_ui_view__type
msgid "View Type"
msgstr "Tipo Visão"
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/js/timeline_controller.esm.js:0
#, python-format
msgid "Warning"
msgstr "Aviso"
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:0
#, python-format
msgid "Week"
msgstr "Semana"
#. module: web_timeline
#. odoo-javascript
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:0
#, python-format
msgid "Year"
msgstr "Ano"
| OCA/web/web_timeline/i18n/pt_BR.po/0 | {
"file_path": "OCA/web/web_timeline/i18n/pt_BR.po",
"repo_id": "OCA",
"token_count": 1169
} | 110 |
/** @odoo-module alias=web_timeline.TimelineController **/
/* Copyright 2023 Onestein - Anjeel Haria
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
import AbstractController from "web.AbstractController";
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import time from "web.time";
import core from "web.core";
import Dialog from "web.Dialog";
var _t = core._t;
import {Component} from "@odoo/owl";
export default AbstractController.extend({
custom_events: _.extend({}, AbstractController.prototype.custom_events, {
onGroupClick: "_onGroupClick",
onUpdate: "_onUpdate",
onRemove: "_onRemove",
onMove: "_onMove",
onAdd: "_onAdd",
}),
/**
* @override
*/
init: function (parent, model, renderer, params) {
this._super.apply(this, arguments);
this.open_popup_action = params.open_popup_action;
this.date_start = params.date_start;
this.date_stop = params.date_stop;
this.date_delay = params.date_delay;
this.context = params.actionContext;
this.moveQueue = [];
this.debouncedInternalMove = _.debounce(this.internalMove, 0);
},
on_detach_callback() {
if (this.Dialog) {
this.Dialog();
this.Dialog = undefined;
}
return this._super.apply(this, arguments);
},
/**
* @override
*/
update: function (params, options) {
const res = this._super.apply(this, arguments);
if (_.isEmpty(params)) {
return res;
}
const defaults = _.defaults({}, options, {
adjust_window: true,
});
const domains = params.domain || this.renderer.last_domains || [];
const contexts = params.context || [];
const group_bys = params.groupBy || this.renderer.last_group_bys || [];
this.last_domains = domains;
this.last_contexts = contexts;
// Select the group by
let n_group_bys = group_bys;
if (!n_group_bys.length && this.renderer.arch.attrs.default_group_by) {
n_group_bys = this.renderer.arch.attrs.default_group_by.split(",");
}
this.renderer.last_group_bys = n_group_bys;
this.renderer.last_domains = domains;
let fields = this.renderer.fieldNames;
fields = _.uniq(fields.concat(n_group_bys));
$.when(
res,
this._rpc({
model: this.model.modelName,
method: "search_read",
kwargs: {
fields: fields,
domain: domains,
order: [{name: this.renderer.arch.attrs.default_group_by}],
},
context: this.getSession().user_context,
}).then((data) =>
this.renderer.on_data_loaded(data, n_group_bys, defaults.adjust_window)
)
);
return res;
},
/**
* Gets triggered when a group in the timeline is
* clicked (by the TimelineRenderer).
*
* @private
* @param {EventObject} event
* @returns {jQuery.Deferred}
*/
_onGroupClick: function (event) {
const groupField = this.renderer.last_group_bys[0];
return this.do_action({
type: "ir.actions.act_window",
res_model: this.renderer.fields[groupField].relation,
res_id: event.data.item.group,
target: "new",
views: [[false, "form"]],
});
},
/**
* Opens a form view of a clicked timeline
* item (triggered by the TimelineRenderer).
*
* @private
* @param {EventObject} event
*/
_onUpdate: function (event) {
this.renderer = event.data.renderer;
const rights = event.data.rights;
const item = event.data.item;
const id = Number(item.evt.id) || item.evt.id;
const title = item.evt.__name;
if (this.open_popup_action) {
this.Dialog = Component.env.services.dialog.add(
FormViewDialog,
{
resId: id,
context: this.getSession().user_context,
title: title,
onRecordSaved: () => this.write_completed(),
resModel: this.model.modelName,
},
{}
);
} else {
let mode = "readonly";
if (rights.write) {
mode = "edit";
}
this.trigger_up("switch_view", {
view_type: "form",
res_id: id,
mode: mode,
model: this.model.modelName,
});
}
},
/**
* Gets triggered when a timeline item is
* moved (triggered by the TimelineRenderer).
*
* @private
* @param {EventObject} event
*/
_onMove: function (event) {
const item = event.data.item;
const fields = this.renderer.fields;
const event_start = item.start;
const event_end = item.end;
let group = false;
if (item.group !== -1) {
group = item.group;
}
const data = {};
// In case of a move event, the date_delay stay the same,
// only date_start and stop must be updated
data[this.date_start] = time.auto_date_to_str(
event_start,
fields[this.date_start].type
);
if (this.date_stop) {
// In case of instantaneous event, item.end is not defined
if (event_end) {
data[this.date_stop] = time.auto_date_to_str(
event_end,
fields[this.date_stop].type
);
} else {
data[this.date_stop] = data[this.date_start];
}
}
if (this.date_delay && event_end) {
const diff_seconds = Math.round(
(event_end.getTime() - event_start.getTime()) / 1000
);
data[this.date_delay] = diff_seconds / 3600;
}
const grouped_field = this.renderer.last_group_bys[0];
this._rpc({
model: this.modelName,
method: "fields_get",
args: [grouped_field],
context: this.getSession().user_context,
}).then(async (fields_processed) => {
if (
this.renderer.last_group_bys &&
this.renderer.last_group_bys instanceof Array &&
fields_processed[grouped_field].type !== "many2many"
) {
data[this.renderer.last_group_bys[0]] = group;
}
this.moveQueue.push({
id: event.data.item.id,
data: data,
event: event,
});
this.debouncedInternalMove();
});
},
/**
* Write enqueued moves to Odoo. After all writes are finished it updates
* the view once (prevents flickering of the view when multiple timeline items
* are moved at once).
*
* @returns {jQuery.Deferred}
*/
internalMove: function () {
const queues = this.moveQueue.slice();
this.moveQueue = [];
const defers = [];
for (const item of queues) {
defers.push(
this._rpc({
model: this.model.modelName,
method: "write",
args: [[item.event.data.item.id], item.data],
context: this.getSession().user_context,
}).then(() => {
item.event.data.callback(item.event.data.item);
})
);
}
return $.when.apply($, defers).done(() => {
this.write_completed({
adjust_window: false,
});
});
},
/**
* Triggered when a timeline item gets removed from the view.
* Requires user confirmation before it gets actually deleted.
*
* @private
* @param {EventObject} event
* @returns {jQuery.Deferred}
*/
_onRemove: function (event) {
var def = $.Deferred();
Dialog.confirm(this, _t("Are you sure you want to delete this record?"), {
title: _t("Warning"),
confirm_callback: () => {
this.remove_completed(event).then(def.resolve.bind(def));
},
cancel_callback: def.resolve.bind(def),
});
return def;
},
/**
* Triggered when a timeline item gets added and opens a form view.
*
* @private
* @param {EventObject} event
* @returns {dialogs.FormViewDialog}
*/
_onAdd: function (event) {
const item = event.data.item;
// Initialize default values for creation
const default_context = {};
default_context["default_".concat(this.date_start)] = item.start;
if (this.date_delay) {
default_context["default_".concat(this.date_delay)] = 1;
}
if (this.date_start) {
default_context["default_".concat(this.date_start)] = moment(item.start)
.utc()
.format("YYYY-MM-DD HH:mm:ss");
}
if (this.date_stop && item.end) {
default_context["default_".concat(this.date_stop)] = moment(item.end)
.utc()
.format("YYYY-MM-DD HH:mm:ss");
}
if (this.date_delay && this.date_start && this.date_stop && item.end) {
default_context["default_".concat(this.date_delay)] =
(moment(item.end) - moment(item.start)) / 3600000;
}
if (item.group > 0) {
default_context["default_".concat(this.renderer.last_group_bys[0])] =
item.group;
}
// Show popup
this.Dialog = Component.env.services.dialog.add(
FormViewDialog,
{
resId: false,
context: _.extend(default_context, this.context),
onRecordSaved: (record) => this.create_completed([record.res_id]),
resModel: this.model.modelName,
},
{onClose: () => event.data.callback()}
);
return false;
},
/**
* Triggered upon completion of a new record.
* Updates the timeline view with the new record.
*
* @param {RecordId} id
* @returns {jQuery.Deferred}
*/
create_completed: function (id) {
return this._rpc({
model: this.model.modelName,
method: "read",
args: [id, this.model.fieldNames],
context: this.context,
}).then((records) => {
var new_event = this.renderer.event_data_transform(records[0]);
var items = this.renderer.timeline.itemsData;
items.add(new_event);
});
},
/**
* Triggered upon completion of writing a record.
* @param {ControllerOptions} options
*/
write_completed: function (options) {
const params = {
domain: this.renderer.last_domains,
context: this.context,
groupBy: this.renderer.last_group_bys,
};
this.update(params, options);
},
/**
* Triggered upon confirm of removing a record.
* @param {EventObject} event
* @returns {jQuery.Deferred}
*/
remove_completed: function (event) {
return this._rpc({
model: this.modelName,
method: "unlink",
args: [[event.data.item.id]],
context: this.getSession().user_context,
}).then(() => {
let unlink_index = false;
for (var i = 0; i < this.model.data.data.length; i++) {
if (this.model.data.data[i].id === event.data.item.id) {
unlink_index = i;
}
}
if (!isNaN(unlink_index)) {
this.model.data.data.splice(unlink_index, 1);
}
event.data.callback(event.data.item);
});
},
});
| OCA/web/web_timeline/static/src/js/timeline_controller.esm.js/0 | {
"file_path": "OCA/web/web_timeline/static/src/js/timeline_controller.esm.js",
"repo_id": "OCA",
"token_count": 6022
} | 111 |
To use this module, you need to:
1. Use a tablet.
1. Go to any form that contains a sub-view which can be optimized for mobile.
| OCA/web/web_touchscreen/readme/USAGE.md/0 | {
"file_path": "OCA/web/web_touchscreen/readme/USAGE.md",
"repo_id": "OCA",
"token_count": 38
} | 112 |
The duplicate option is enabled by default.
To disable it you have to add attribute `duplicate` to the tree view.
Set `duplicate` to `false` to enable it or `true` to (explicitly) disable it.
Example:
.. code-block:: xml
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_users_tree" model="ir.ui.view">
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="duplicate">false</attribute>
</xpath>
</field>
</record>
</odoo>
| OCA/web/web_tree_duplicate/readme/CONFIGURE.rst/0 | {
"file_path": "OCA/web/web_tree_duplicate/readme/CONFIGURE.rst",
"repo_id": "OCA",
"token_count": 315
} | 113 |
This addon forces Odoo to use many2one widget on a many2one fields in
tree views. This allows users to open linked resources from trees directly,
using a button without accessing the form.
| OCA/web/web_tree_many2one_clickable/readme/DESCRIPTION.rst/0 | {
"file_path": "OCA/web/web_tree_many2one_clickable/readme/DESCRIPTION.rst",
"repo_id": "OCA",
"token_count": 43
} | 114 |
* This module uses the library `Bokeh <https://github.com/bokeh/bokeh>`__
which is under the open-source BSD 3-clause "New" or "Revised" License.
Copyright (c) 2012, Anaconda, Inc.
* Odoo Community Association (OCA)
| OCA/web/web_widget_bokeh_chart/readme/CREDITS.rst/0 | {
"file_path": "OCA/web/web_widget_bokeh_chart/readme/CREDITS.rst",
"repo_id": "OCA",
"token_count": 77
} | 115 |
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<div t-ref="widget" t-name="web_widget_bokeh_chart.BokehChartField" owl="1">
<t t-out="json_value.div" />
</div>
<div t-ref="widget" t-name="web_widget_bokeh_chart.BokehChartlJsonField" owl="1">
<t t-out="markup(props.value.div)" />
</div>
</templates>
| OCA/web/web_widget_bokeh_chart/static/src/xml/bokeh.xml/0 | {
"file_path": "OCA/web/web_widget_bokeh_chart/static/src/xml/bokeh.xml",
"repo_id": "OCA",
"token_count": 171
} | 116 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_domain_editor_dialog
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-22 11:23+0000\n"
"PO-Revision-Date: 2019-02-22 11:23+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_domain_editor_dialog
#. openerp-web
#: code:addons/web_widget_domain_editor_dialog/static/src/js/basic_fields.js:0
#, python-format
msgid "Select records..."
msgstr "Seleccionar registros..."
#. module: web_widget_domain_editor_dialog
#. openerp-web
#: code:addons/web_widget_domain_editor_dialog/static/src/js/widget_domain_editor_dialog.js:0
#, python-format
msgid "Selected domain"
msgstr "Dominio seleccionado"
#~ msgid "Custom Filter"
#~ msgstr "Filtro personalizado"
| OCA/web/web_widget_domain_editor_dialog/i18n/es.po/0 | {
"file_path": "OCA/web/web_widget_domain_editor_dialog/i18n/es.po",
"repo_id": "OCA",
"token_count": 392
} | 117 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_image_webcam
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-12 13: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_widget_image_webcam
#. odoo-javascript
#: code:addons/web_widget_image_webcam/static/src/js/webcam_widget.js:0
#, python-format
msgid "Close"
msgstr "Chiudi"
#. module: web_widget_image_webcam
#. odoo-javascript
#: code:addons/web_widget_image_webcam/static/src/js/webcam_widget.js:0
#, python-format
msgid "Save & Close"
msgstr "Salva e chiudi"
#. module: web_widget_image_webcam
#: model:ir.model,name:web_widget_image_webcam.model_ir_config_parameter
msgid "System Parameter"
msgstr "Parametro di sistema"
#. module: web_widget_image_webcam
#. odoo-javascript
#: code:addons/web_widget_image_webcam/static/src/js/webcam_widget.js:0
#, python-format
msgid "Take Snapshot"
msgstr "Salva istantanea"
#. module: web_widget_image_webcam
#. odoo-javascript
#: code:addons/web_widget_image_webcam/static/src/xml/web_widget_image_webcam.xml:0
#, python-format
msgid "WebCam"
msgstr "Webcam"
#. module: web_widget_image_webcam
#. odoo-javascript
#: code:addons/web_widget_image_webcam/static/src/js/webcam_widget.js:0
#, python-format
msgid "WebCam Booth"
msgstr "Archivio webcam"
| OCA/web/web_widget_image_webcam/i18n/it.po/0 | {
"file_path": "OCA/web/web_widget_image_webcam/i18n/it.po",
"repo_id": "OCA",
"token_count": 659
} | 118 |
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import models
| OCA/web/web_widget_mpld3_chart/__init__.py/0 | {
"file_path": "OCA/web/web_widget_mpld3_chart/__init__.py",
"repo_id": "OCA",
"token_count": 32
} | 119 |
if (!d3) {
var d3 = require("d3");
}
var mpld3 = {
_mpld3IsLoaded: true,
figures: [],
plugin_map: {}
};
mpld3.version = "0.5.9";
mpld3.register_plugin = function(name, obj) {
mpld3.plugin_map[name] = obj;
};
mpld3.remove_figure = function(figid) {
var element = document.getElementById(figid);
if (element !== null) {
element.innerHTML = "";
}
for (var i = 0; i < mpld3.figures.length; i++) {
var fig = mpld3.figures[i];
if (fig.figid === figid) {
mpld3.figures.splice(i, 1);
}
}
return true;
};
mpld3.draw_figure = function(figid, spec, process, clearElem) {
var element = document.getElementById(figid);
clearElem = typeof clearElem !== "undefined" ? clearElem : false;
if (clearElem) {
mpld3.remove_figure(figid);
}
if (element === null) {
throw figid + " is not a valid id";
}
var fig = new mpld3.Figure(figid, spec);
if (process) {
process(fig, element);
}
mpld3.figures.push(fig);
fig.draw();
return fig;
};
mpld3.cloneObj = mpld3_cloneObj;
function mpld3_cloneObj(oldObj) {
var newObj = {};
for (var key in oldObj) {
newObj[key] = oldObj[key];
}
return newObj;
}
mpld3.boundsToTransform = function(fig, bounds) {
var width = fig.width;
var height = fig.height;
var dx = bounds[1][0] - bounds[0][0];
var dy = bounds[1][1] - bounds[0][1];
var x = (bounds[0][0] + bounds[1][0]) / 2;
var y = (bounds[0][1] + bounds[1][1]) / 2;
var scale = Math.max(1, Math.min(8, .9 / Math.max(dx / width, dy / height)));
var translate = [ width / 2 - scale * x, height / 2 - scale * y ];
return {
translate: translate,
scale: scale
};
};
mpld3.getTransformation = function(transform) {
var g = document.createElementNS("http://www.w3.org/2000/svg", "g");
g.setAttributeNS(null, "transform", transform);
var matrix = g.transform.baseVal.consolidate().matrix;
var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, e = matrix.e, f = matrix.f;
var scaleX, scaleY, skewX;
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
var transformObj = {
translateX: e,
translateY: f,
rotate: Math.atan2(b, a) * 180 / Math.PI,
skewX: Math.atan(skewX) * 180 / Math.PI,
scaleX: scaleX,
scaleY: scaleY
};
var transformStr = "" + "translate(" + transformObj.translateX + "," + transformObj.translateY + ")" + "rotate(" + transformObj.rotate + ")" + "skewX(" + transformObj.skewX + ")" + "scale(" + transformObj.scaleX + "," + transformObj.scaleY + ")";
return transformStr;
};
mpld3.merge_objects = function(_) {
var output = {};
var obj;
for (var i = 0; i < arguments.length; i++) {
obj = arguments[i];
for (var attr in obj) {
output[attr] = obj[attr];
}
}
return output;
};
mpld3.generate_id = function(N, chars) {
console.warn("mpld3.generate_id is deprecated. " + "Use mpld3.generateId instead.");
return mpld3_generateId(N, chars);
};
mpld3.generateId = mpld3_generateId;
function mpld3_generateId(N, chars) {
N = typeof N !== "undefined" ? N : 10;
chars = typeof chars !== "undefined" ? chars : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var id = chars.charAt(Math.round(Math.random() * (chars.length - 11)));
for (var i = 1; i < N; i++) id += chars.charAt(Math.round(Math.random() * (chars.length - 1)));
return id;
}
mpld3.get_element = function(id, fig) {
var figs_to_search, ax, el;
if (typeof fig === "undefined") {
figs_to_search = mpld3.figures;
} else if (typeof fig.length === "undefined") {
figs_to_search = [ fig ];
} else {
figs_to_search = fig;
}
for (var i = 0; i < figs_to_search.length; i++) {
fig = figs_to_search[i];
if (fig.props.id === id) {
return fig;
}
for (var j = 0; j < fig.axes.length; j++) {
ax = fig.axes[j];
if (ax.props.id === id) {
return ax;
}
for (var k = 0; k < ax.elements.length; k++) {
el = ax.elements[k];
if (el.props.id === id) {
return el;
}
}
}
}
return null;
};
mpld3.insert_css = function(selector, attributes) {
var head = document.head || document.getElementsByTagName("head")[0];
var style = document.createElement("style");
var css = selector + " {";
for (var prop in attributes) {
css += prop + ":" + attributes[prop] + "; ";
}
css += "}";
style.type = "text/css";
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
};
mpld3.process_props = function(obj, properties, defaults, required) {
console.warn("mpld3.process_props is deprecated. " + "Plot elements should derive from mpld3.PlotElement");
Element.prototype = Object.create(mpld3_PlotElement.prototype);
Element.prototype.constructor = Element;
Element.prototype.requiredProps = required;
Element.prototype.defaultProps = defaults;
function Element(props) {
mpld3_PlotElement.call(this, null, props);
}
var el = new Element(properties);
return el.props;
};
mpld3.interpolateDates = mpld3_interpolateDates;
function mpld3_interpolateDates(a, b) {
var interp = d3.interpolate([ a[0].valueOf(), a[1].valueOf() ], [ b[0].valueOf(), b[1].valueOf() ]);
return function(t) {
var i = interp(t);
return [ new Date(i[0]), new Date(i[1]) ];
};
}
function isUndefined(x) {
return typeof x === "undefined";
}
function isUndefinedOrNull(x) {
return x == null || isUndefined(x);
}
function getMod(L, i) {
return L.length > 0 ? L[i % L.length] : null;
}
mpld3.path = function() {
return mpld3_path();
};
function mpld3_path(_) {
var x = function(d, i) {
return d[0];
};
var y = function(d, i) {
return d[1];
};
var defined = function(d, i) {
return true;
};
var n_vertices = {
M: 1,
m: 1,
L: 1,
l: 1,
Q: 2,
q: 2,
T: 1,
t: 1,
S: 2,
s: 2,
C: 3,
c: 3,
Z: 0,
z: 0
};
function path(vertices, pathcodes) {
var functor = function(x) {
if (typeof x == "function") {
return x;
}
return function() {
return x;
};
};
var fx = functor(x), fy = functor(y);
var points = [], segments = [], i_v = 0, i_c = -1, halt = 0, nullpath = false;
if (!pathcodes) {
pathcodes = [ "M" ];
for (var i = 1; i < vertices.length; i++) pathcodes.push("L");
}
while (++i_c < pathcodes.length) {
halt = i_v + n_vertices[pathcodes[i_c]];
points = [];
while (i_v < halt) {
if (defined.call(this, vertices[i_v], i_v)) {
points.push(fx.call(this, vertices[i_v], i_v), fy.call(this, vertices[i_v], i_v));
i_v++;
} else {
points = null;
i_v = halt;
}
}
if (!points) {
nullpath = true;
} else if (nullpath && points.length > 0) {
segments.push("M", points[0], points[1]);
nullpath = false;
} else {
segments.push(pathcodes[i_c]);
segments = segments.concat(points);
}
}
if (i_v != vertices.length) console.warn("Warning: not all vertices used in Path");
return segments.join(" ");
}
path.x = function(_) {
if (!arguments.length) return x;
x = _;
return path;
};
path.y = function(_) {
if (!arguments.length) return y;
y = _;
return path;
};
path.defined = function(_) {
if (!arguments.length) return defined;
defined = _;
return path;
};
path.call = path;
return path;
}
mpld3.multiscale = mpld3_multiscale;
function mpld3_multiscale(_) {
var args = Array.prototype.slice.call(arguments, 0);
var N = args.length;
function scale(x) {
args.forEach(function(mapping) {
x = mapping(x);
});
return x;
}
scale.domain = function(x) {
if (!arguments.length) return args[0].domain();
args[0].domain(x);
return scale;
};
scale.range = function(x) {
if (!arguments.length) return args[N - 1].range();
args[N - 1].range(x);
return scale;
};
scale.step = function(i) {
return args[i];
};
return scale;
}
mpld3.icons = {
reset: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIcACMoD/OzIwAAAJhJREFUOMtjYKAx4KDUgNsMDAx7\nyNV8i4GB4T8U76VEM8mGYNNMtCH4NBM0hBjNMIwSsMzQ0MamcDkDA8NmQi6xggpUoikwQbIkHk2u\nE0rLI7vCBknBSyxeRDZAE6qHgQkq+ZeBgYERSfFPAoHNDNUDN4BswIRmKgxwEasP2dlsDAwMYlA/\n/mVgYHiBpkkGKscIDaPfVMmuAGnOTaGsXF0MAAAAAElFTkSuQmCC\n",
move: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIcACQMfLHBNQAAANZJREFUOMud07FKA0EQBuAviaKB\nlFr7COJrpAyYRlKn8hECEkFEn8ROCCm0sBMRYgh5EgVFtEhsRjiO27vkBoZd/vn5d3b+XcrjFI9q\nxgXWkc8pUjOB93GMd3zgB9d1unjDSxmhWSHQqOJki+MtOuv/b3ZifUqctIrMxwhHuG1gim4Ma5kR\nWuEkXFgU4B0MW1Ho4TeyjX3s4TDq3zn8ALvZ7q5wX9DqLOHCDA95cFBAnOO1AL/ZdNopgY3fQcqF\nyriMe37hM9w521ZkkvlMo7o/8g7nZYQ/QDctp1nTCf0AAAAASUVORK5CYII=\n",
zoom: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMPDiIRPL/2oQAAANBJREFUOMvF0b9KgzEcheHHVnCT\nKoI4uXbtLXgB3oJDJxevw1VwkoJ/NjepQ2/BrZRCx0ILFURQKV2kyOeSQpAmn7WDB0Lg955zEhLy\n2scdXlBggits+4WOQqjAJ3qYR7NGLrwXGU9+sGbEtlIF18FwmuBngZ+nCt6CIacC3Rx8LSl4xzgF\nn0tusBn4UyVhuA/7ZYIv5g+pE3ail25hN/qdmzCfpsJVjKKCZesDBwtzrAqGOMQj6vhCDRsY4ALH\nmOVObltR/xeG/jph6OD2r+Fv5lZBWEhMx58AAAAASUVORK5CYII=\n",
brush: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAEQkAABEJAFAZ8RUAAAAB3RJTUUH3gMCEiQKB9YaAgAAAWtJREFUOMuN0r1qVVEQhuFn700k\nnfEvBq0iNiIiOKXgH4KCaBeIhWARK/EibLwFCwVLjyAWaQzRGG9grC3URkHUBKKgRuWohWvL5pjj\nyTSLxcz7rZlZHyMiItqzFxGTEVF18/UoODNFxDIO4x12dkXqTcBPsCUzD+AK3ndFqhHwEsYz82gn\nN4dbmMRK9R/4KY7jAvbiWmYeHBT5Z4QCP8J1rGAeN3GvU3Mbl/Gq3qCDcxjLzOV+v78fq/iFIxFx\nPyJ2lNJpfBy2g59YzMyzEbEVLzGBJjOriLiBq5gaJrCIU3hcRCbwAtuwjm/Yg/V6I9NgDA1OR8RC\nZq6Vcd7iUwtn5h8fdMBdETGPE+Xe4ExELDRNs4bX2NfCUHe+7UExyfkCP8MhzOA7PuAkvrbwXyNF\nxF3MDqxiqlhXC7SPdaOKiN14g0u4g3H0MvOiTUSNY3iemb0ywmfMdfYyUmAJ2yPiBx6Wr/oy2Oqw\n+A1SupBzAOuE/AAAAABJRU5ErkJggg==\n"
};
mpld3.Grid = mpld3_Grid;
mpld3_Grid.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Grid.prototype.constructor = mpld3_Grid;
mpld3_Grid.prototype.requiredProps = [ "xy" ];
mpld3_Grid.prototype.defaultProps = {
color: "gray",
dasharray: "2,2",
alpha: "0.5",
nticks: 10,
gridOn: true,
tickvalues: null,
zorder: 0
};
function mpld3_Grid(ax, prop) {
mpld3_PlotElement.call(this, ax, prop);
this.cssclass = "mpld3-" + this.props.xy + "grid";
if (this.props.xy == "x") {
this.transform = "translate(0," + this.ax.height + ")";
this.position = "bottom";
this.scale = this.ax.xdom;
this.tickSize = -this.ax.height;
} else if (this.props.xy == "y") {
this.transform = "translate(0,0)";
this.position = "left";
this.scale = this.ax.ydom;
this.tickSize = -this.ax.width;
} else {
throw "unrecognized grid xy specifier: should be 'x' or 'y'";
}
}
mpld3_Grid.prototype.draw = function() {
var scaleMethod = {
left: "axisLeft",
right: "axisRight",
top: "axisTop",
bottom: "axisBottom"
}[this.position];
this.grid = d3[scaleMethod](this.scale).ticks(this.props.nticks).tickValues(this.props.tickvalues).tickSize(this.tickSize, 0, 0).tickFormat("");
this.elem = this.ax.axes.append("g").attr("class", this.cssclass).attr("transform", this.transform).call(this.grid);
mpld3.insert_css("div#" + this.ax.fig.figid + " ." + this.cssclass + " .tick", {
stroke: this.props.color,
"stroke-dasharray": this.props.dasharray,
"stroke-opacity": this.props.alpha
});
mpld3.insert_css("div#" + this.ax.fig.figid + " ." + this.cssclass + " path", {
"stroke-width": 0
});
mpld3.insert_css("div#" + this.ax.fig.figid + " ." + this.cssclass + " .domain", {
"pointer-events": "none"
});
};
mpld3_Grid.prototype.zoomed = function(transform) {
if (transform) {
if (this.props.xy == "x") {
this.elem.call(this.grid.scale(transform.rescaleX(this.scale)));
} else {
this.elem.call(this.grid.scale(transform.rescaleY(this.scale)));
}
} else {
this.elem.call(this.grid);
}
};
mpld3.Axis = mpld3_Axis;
mpld3_Axis.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Axis.prototype.constructor = mpld3_Axis;
mpld3_Axis.prototype.requiredProps = [ "position" ];
mpld3_Axis.prototype.defaultProps = {
nticks: 10,
tickvalues: null,
tickformat: null,
filtered_tickvalues: null,
filtered_tickformat: null,
tickformat_formatter: null,
fontsize: "11px",
fontcolor: "black",
axiscolor: "black",
scale: "linear",
grid: {},
zorder: 0,
visible: true
};
function mpld3_Axis(ax, props) {
mpld3_PlotElement.call(this, ax, props);
var trans = {
bottom: [ 0, this.ax.height ],
top: [ 0, 0 ],
left: [ 0, 0 ],
right: [ this.ax.width, 0 ]
};
var xy = {
bottom: "x",
top: "x",
left: "y",
right: "y"
};
this.ax = ax;
this.transform = "translate(" + trans[this.props.position] + ")";
this.props.xy = xy[this.props.position];
this.cssclass = "mpld3-" + this.props.xy + "axis";
this.scale = this.ax[this.props.xy + "dom"];
this.tickNr = null;
this.tickFormat = null;
}
mpld3_Axis.prototype.getGrid = function() {
var gridprop = {
nticks: this.props.nticks,
zorder: this.props.zorder,
tickvalues: null,
xy: this.props.xy
};
if (this.props.grid) {
for (var key in this.props.grid) {
gridprop[key] = this.props.grid[key];
}
}
return new mpld3_Grid(this.ax, gridprop);
};
mpld3_Axis.prototype.wrapTicks = function() {
function wrap(text, width, lineHeight) {
lineHeight = lineHeight || 1.2;
text.each(function() {
var text = d3.select(this);
var bbox = text.node().getBBox();
var textHeight = bbox.height;
var words = text.text().split(/\s+/).reverse();
var word;
var line = [];
var lineNumber = 0;
var y = text.attr("y");
var dy = textHeight;
var tspan = text.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy);
while (word = words.pop()) {
line.push(word);
tspan.text(line.join(" "));
if (tspan.node().getComputedTextLength() > width) {
line.pop();
tspan.text(line.join(" "));
line = [ word ];
tspan = text.append("tspan").attr("x", 0).attr("y", y).attr("dy", ++lineNumber * (textHeight * lineHeight) + dy).text(word);
}
}
});
}
var TEXT_WIDTH = 80;
if (this.props.xy == "x") {
this.elem.selectAll("text").call(wrap, TEXT_WIDTH);
}
};
mpld3_Axis.prototype.draw = function() {
var scale = this.props.xy === "x" ? this.parent.props.xscale : this.parent.props.yscale;
if (scale === "date" && this.props.tickvalues) {
var domain = this.props.xy === "x" ? this.parent.x.domain() : this.parent.y.domain();
var range = this.props.xy === "x" ? this.parent.xdom.domain() : this.parent.ydom.domain();
var ordinal_to_js_date = d3.scaleLinear().domain(domain).range(range);
this.props.tickvalues = this.props.tickvalues.map(function(value) {
return new Date(ordinal_to_js_date(value));
});
}
var scaleMethod = {
left: "axisLeft",
right: "axisRight",
top: "axisTop",
bottom: "axisBottom"
}[this.props.position];
this.axis = d3[scaleMethod](this.scale);
var that = this;
this.filter_ticks(this.axis.scale().domain());
if (this.props.tickformat_formatter == "index") {
this.axis = this.axis.tickFormat(function(d, i) {
return that.props.filtered_tickformat[d];
});
} else if (this.props.tickformat_formatter == "percent") {
this.axis = this.axis.tickFormat(function(d, i) {
var value = d / that.props.tickformat.xmax * 100;
var decimals = that.props.tickformat.decimals || 0;
var formatted_string = d3.format("." + decimals + "f")(value);
return formatted_string + that.props.tickformat.symbol;
});
} else if (this.props.tickformat_formatter == "str_method") {
this.axis = this.axis.tickFormat(function(d, i) {
var formatted_string = d3.format(that.props.tickformat.format_string)(d);
return that.props.tickformat.prefix + formatted_string + that.props.tickformat.suffix;
});
} else if (this.props.tickformat_formatter == "fixed") {
this.axis = this.axis.tickFormat(function(d, i) {
return that.props.filtered_tickformat[i];
});
} else if (this.tickFormat) {
this.axis = this.axis.tickFormat(this.tickFormat);
}
if (this.tickNr) {
this.axis = this.axis.ticks(this.tickNr);
}
this.axis = this.axis.tickValues(this.props.filtered_tickvalues);
this.elem = this.ax.baseaxes.append("g").attr("transform", this.transform).attr("class", this.cssclass).call(this.axis);
this.wrapTicks();
mpld3.insert_css("div#" + this.ax.fig.figid + " ." + this.cssclass + " line, " + " ." + this.cssclass + " path", {
"shape-rendering": "crispEdges",
stroke: this.props.axiscolor,
fill: "none"
});
mpld3.insert_css("div#" + this.ax.fig.figid + " ." + this.cssclass + " text", {
"font-family": "sans-serif",
"font-size": this.props.fontsize + "px",
fill: this.props.fontcolor,
stroke: "none"
});
};
mpld3_Axis.prototype.zoomed = function(transform) {
this.filter_ticks(this.axis.scale().domain());
this.axis = this.axis.tickValues(this.props.filtered_tickvalues);
if (transform) {
if (this.props.xy == "x") {
this.elem.call(this.axis.scale(transform.rescaleX(this.scale)));
} else {
this.elem.call(this.axis.scale(transform.rescaleY(this.scale)));
}
this.wrapTicks();
} else {
this.elem.call(this.axis);
}
};
mpld3_Axis.prototype.setTicks = function(nr, format) {
this.tickNr = nr;
this.tickFormat = format;
};
mpld3_Axis.prototype.filter_ticks = function(domain) {
if (this.props.tickvalues) {
const that = this;
const filteredTickIndices = this.props.tickvalues.map(function(d, i) {
return i;
}).filter(function(d, i) {
const v = that.props.tickvalues[d];
return v >= domain[0] && v <= domain[1];
});
this.props.filtered_tickvalues = this.props.tickvalues.filter(function(d, i) {
return filteredTickIndices.includes(i);
});
if (this.props.tickformat) {
this.props.filtered_tickformat = this.props.tickformat.filter(function(d, i) {
return filteredTickIndices.includes(i);
});
} else {
this.props.filtered_tickformat = this.props.tickformat;
}
} else {
this.props.filtered_tickvalues = this.props.tickvalues;
this.props.filtered_tickformat = this.props.tickformat;
}
};
mpld3.Coordinates = mpld3_Coordinates;
function mpld3_Coordinates(trans, ax) {
this.trans = trans;
if (typeof ax === "undefined") {
this.ax = null;
this.fig = null;
if (this.trans !== "display") throw "ax must be defined if transform != 'display'";
} else {
this.ax = ax;
this.fig = ax.fig;
}
this.zoomable = this.trans === "data";
this.x = this["x_" + this.trans];
this.y = this["y_" + this.trans];
if (typeof this.x === "undefined" || typeof this.y === "undefined") throw "unrecognized coordinate code: " + this.trans;
}
mpld3_Coordinates.prototype.xy = function(d, ix, iy) {
ix = typeof ix === "undefined" ? 0 : ix;
iy = typeof iy === "undefined" ? 1 : iy;
return [ this.x(d[ix]), this.y(d[iy]) ];
};
mpld3_Coordinates.prototype.x_data = function(x) {
return this.ax.x(x);
};
mpld3_Coordinates.prototype.y_data = function(y) {
return this.ax.y(y);
};
mpld3_Coordinates.prototype.x_display = function(x) {
return x;
};
mpld3_Coordinates.prototype.y_display = function(y) {
return y;
};
mpld3_Coordinates.prototype.x_axes = function(x) {
return x * this.ax.width;
};
mpld3_Coordinates.prototype.y_axes = function(y) {
return this.ax.height * (1 - y);
};
mpld3_Coordinates.prototype.x_figure = function(x) {
return x * this.fig.width - this.ax.position[0];
};
mpld3_Coordinates.prototype.y_figure = function(y) {
return (1 - y) * this.fig.height - this.ax.position[1];
};
mpld3.Path = mpld3_Path;
mpld3_Path.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Path.prototype.constructor = mpld3_Path;
mpld3_Path.prototype.requiredProps = [ "data" ];
mpld3_Path.prototype.defaultProps = {
xindex: 0,
yindex: 1,
coordinates: "data",
facecolor: "green",
edgecolor: "black",
edgewidth: 1,
dasharray: "none",
pathcodes: null,
offset: null,
offsetcoordinates: "data",
alpha: 1,
drawstyle: "none",
zorder: 1
};
function mpld3_Path(ax, props) {
mpld3_PlotElement.call(this, ax, props);
this.data = ax.fig.get_data(this.props.data);
this.pathcodes = this.props.pathcodes;
this.pathcoords = new mpld3_Coordinates(this.props.coordinates, this.ax);
this.offsetcoords = new mpld3_Coordinates(this.props.offsetcoordinates, this.ax);
this.datafunc = mpld3_path();
}
mpld3_Path.prototype.finiteFilter = function(d, i) {
return isFinite(this.pathcoords.x(d[this.props.xindex])) && isFinite(this.pathcoords.y(d[this.props.yindex]));
};
mpld3_Path.prototype.draw = function() {
this.datafunc.defined(this.finiteFilter.bind(this)).x(function(d) {
return this.pathcoords.x(d[this.props.xindex]);
}.bind(this)).y(function(d) {
return this.pathcoords.y(d[this.props.yindex]);
}.bind(this));
if (this.pathcoords.zoomable) {
this.path = this.ax.paths.append("svg:path");
} else {
this.path = this.ax.staticPaths.append("svg:path");
}
this.path = this.path.attr("d", this.datafunc(this.data, this.pathcodes)).attr("class", "mpld3-path").style("stroke", this.props.edgecolor).style("stroke-width", this.props.edgewidth).style("stroke-dasharray", this.props.dasharray).style("stroke-opacity", this.props.alpha).style("fill", this.props.facecolor).style("fill-opacity", this.props.alpha).attr("vector-effect", "non-scaling-stroke");
if (this.props.offset !== null) {
var offset = this.offsetcoords.xy(this.props.offset);
this.path.attr("transform", "translate(" + offset + ")");
}
};
mpld3_Path.prototype.elements = function(d) {
return this.path;
};
mpld3.PathCollection = mpld3_PathCollection;
mpld3_PathCollection.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_PathCollection.prototype.constructor = mpld3_PathCollection;
mpld3_PathCollection.prototype.requiredProps = [ "paths", "offsets" ];
mpld3_PathCollection.prototype.defaultProps = {
xindex: 0,
yindex: 1,
pathtransforms: [],
pathcoordinates: "display",
offsetcoordinates: "data",
offsetorder: "before",
edgecolors: [ "#000000" ],
drawstyle: "none",
edgewidths: [ 1 ],
facecolors: [ "#0000FF" ],
alphas: [ 1 ],
zorder: 2
};
function mpld3_PathCollection(ax, props) {
mpld3_PlotElement.call(this, ax, props);
if (this.props.facecolors == null || this.props.facecolors.length == 0) {
this.props.facecolors = [ "none" ];
}
if (this.props.edgecolors == null || this.props.edgecolors.length == 0) {
this.props.edgecolors = [ "none" ];
}
var offsets = this.ax.fig.get_data(this.props.offsets);
if (offsets === null || offsets.length === 0) offsets = [ null ];
var N = Math.max(this.props.paths.length, offsets.length);
if (offsets.length === N) {
this.offsets = offsets;
} else {
this.offsets = [];
for (var i = 0; i < N; i++) this.offsets.push(getMod(offsets, i));
}
this.pathcoords = new mpld3_Coordinates(this.props.pathcoordinates, this.ax);
this.offsetcoords = new mpld3_Coordinates(this.props.offsetcoordinates, this.ax);
}
mpld3_PathCollection.prototype.transformFunc = function(d, i) {
var t = this.props.pathtransforms;
var transform = t.length == 0 ? "" : mpld3.getTransformation("matrix(" + getMod(t, i) + ")").toString();
var offset = d === null || typeof d === "undefined" ? "translate(0, 0)" : "translate(" + this.offsetcoords.xy(d, this.props.xindex, this.props.yindex) + ")";
return this.props.offsetorder === "after" ? transform + offset : offset + transform;
};
mpld3_PathCollection.prototype.pathFunc = function(d, i) {
return mpld3_path().x(function(d) {
return this.pathcoords.x(d[0]);
}.bind(this)).y(function(d) {
return this.pathcoords.y(d[1]);
}.bind(this)).apply(this, getMod(this.props.paths, i));
};
mpld3_PathCollection.prototype.styleFunc = function(d, i) {
var styles = {
stroke: getMod(this.props.edgecolors, i),
"stroke-width": getMod(this.props.edgewidths, i),
"stroke-opacity": getMod(this.props.alphas, i),
fill: getMod(this.props.facecolors, i),
"fill-opacity": getMod(this.props.alphas, i)
};
var ret = "";
for (var key in styles) {
ret += key + ":" + styles[key] + ";";
}
return ret;
};
mpld3_PathCollection.prototype.allFinite = function(d) {
if (d instanceof Array) {
return d.length == d.filter(isFinite).length;
} else {
return true;
}
};
mpld3_PathCollection.prototype.draw = function() {
if (this.offsetcoords.zoomable || this.pathcoords.zoomable) {
this.group = this.ax.paths.append("svg:g");
} else {
this.group = this.ax.staticPaths.append("svg:g");
}
this.pathsobj = this.group.selectAll("paths").data(this.offsets.filter(this.allFinite)).enter().append("svg:path").attr("d", this.pathFunc.bind(this)).attr("class", "mpld3-path").attr("transform", this.transformFunc.bind(this)).attr("style", this.styleFunc.bind(this)).attr("vector-effect", "non-scaling-stroke");
};
mpld3_PathCollection.prototype.elements = function(d) {
return this.group.selectAll("path");
};
mpld3.Line = mpld3_Line;
mpld3_Line.prototype = Object.create(mpld3_Path.prototype);
mpld3_Line.prototype.constructor = mpld3_Line;
mpld3_Line.prototype.requiredProps = [ "data" ];
mpld3_Line.prototype.defaultProps = {
xindex: 0,
yindex: 1,
coordinates: "data",
color: "salmon",
linewidth: 2,
dasharray: "none",
alpha: 1,
zorder: 2,
drawstyle: "none"
};
function mpld3_Line(ax, props) {
mpld3_PlotElement.call(this, ax, props);
var pathProps = this.props;
pathProps.facecolor = "none";
pathProps.edgecolor = pathProps.color;
delete pathProps.color;
pathProps.edgewidth = pathProps.linewidth;
delete pathProps.linewidth;
const drawstyle = pathProps.drawstyle;
delete pathProps.drawstyle;
this.defaultProps = mpld3_Path.prototype.defaultProps;
mpld3_Path.call(this, ax, pathProps);
switch (drawstyle) {
case "steps":
case "steps-pre":
this.datafunc = d3.line().curve(d3.curveStepBefore);
break;
case "steps-post":
this.datafunc = d3.line().curve(d3.curveStepAfter);
break;
case "steps-mid":
this.datafunc = d3.line().curve(d3.curveStep);
break;
default:
this.datafunc = d3.line().curve(d3.curveLinear);
}
}
mpld3.Markers = mpld3_Markers;
mpld3_Markers.prototype = Object.create(mpld3_PathCollection.prototype);
mpld3_Markers.prototype.constructor = mpld3_Markers;
mpld3_Markers.prototype.requiredProps = [ "data" ];
mpld3_Markers.prototype.defaultProps = {
xindex: 0,
yindex: 1,
coordinates: "data",
facecolor: "salmon",
edgecolor: "black",
edgewidth: 1,
alpha: 1,
markersize: 6,
markername: "circle",
drawstyle: "none",
markerpath: null,
zorder: 3
};
function mpld3_Markers(ax, props) {
mpld3_PlotElement.call(this, ax, props);
if (this.props.markerpath !== null) {
this.marker = this.props.markerpath[0].length == 0 ? null : mpld3.path().call(this.props.markerpath[0], this.props.markerpath[1]);
} else {
this.marker = this.props.markername === null ? null : d3.symbol(this.props.markername).size(Math.pow(this.props.markersize, 2))();
}
var PCprops = {
paths: [ this.props.markerpath ],
offsets: ax.fig.parse_offsets(ax.fig.get_data(this.props.data, true)),
xindex: this.props.xindex,
yindex: this.props.yindex,
offsetcoordinates: this.props.coordinates,
edgecolors: [ this.props.edgecolor ],
edgewidths: [ this.props.edgewidth ],
facecolors: [ this.props.facecolor ],
alphas: [ this.props.alpha ],
zorder: this.props.zorder,
id: this.props.id
};
this.requiredProps = mpld3_PathCollection.prototype.requiredProps;
this.defaultProps = mpld3_PathCollection.prototype.defaultProps;
mpld3_PathCollection.call(this, ax, PCprops);
}
mpld3_Markers.prototype.pathFunc = function(d, i) {
return this.marker;
};
mpld3.Image = mpld3_Image;
mpld3_Image.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Image.prototype.constructor = mpld3_Image;
mpld3_Image.prototype.requiredProps = [ "data", "extent" ];
mpld3_Image.prototype.defaultProps = {
alpha: 1,
coordinates: "data",
drawstyle: "none",
zorder: 1
};
function mpld3_Image(ax, props) {
mpld3_PlotElement.call(this, ax, props);
this.coords = new mpld3_Coordinates(this.props.coordinates, this.ax);
}
mpld3_Image.prototype.draw = function() {
this.image = this.ax.paths.append("svg:image");
this.image = this.image.attr("class", "mpld3-image").attr("xlink:href", "data:image/png;base64," + this.props.data).style("opacity", this.props.alpha).attr("preserveAspectRatio", "none");
this.updateDimensions();
};
mpld3_Image.prototype.elements = function(d) {
return d3.select(this.image);
};
mpld3_Image.prototype.updateDimensions = function() {
var extent = this.props.extent;
this.image.attr("x", this.coords.x(extent[0])).attr("y", this.coords.y(extent[3])).attr("width", this.coords.x(extent[1]) - this.coords.x(extent[0])).attr("height", this.coords.y(extent[2]) - this.coords.y(extent[3]));
};
mpld3.Text = mpld3_Text;
mpld3_Text.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Text.prototype.constructor = mpld3_Text;
mpld3_Text.prototype.requiredProps = [ "text", "position" ];
mpld3_Text.prototype.defaultProps = {
coordinates: "data",
h_anchor: "start",
v_baseline: "auto",
rotation: 0,
fontsize: 11,
drawstyle: "none",
color: "black",
alpha: 1,
zorder: 3
};
function mpld3_Text(ax, props) {
mpld3_PlotElement.call(this, ax, props);
this.text = this.props.text;
this.position = this.props.position;
this.coords = new mpld3_Coordinates(this.props.coordinates, this.ax);
}
mpld3_Text.prototype.draw = function() {
if (this.props.coordinates == "data") {
if (this.coords.zoomable) {
this.obj = this.ax.paths.append("text");
} else {
this.obj = this.ax.staticPaths.append("text");
}
} else {
this.obj = this.ax.baseaxes.append("text");
}
this.obj.attr("class", "mpld3-text").text(this.text).style("text-anchor", this.props.h_anchor).style("dominant-baseline", this.props.v_baseline).style("font-size", this.props.fontsize).style("fill", this.props.color).style("opacity", this.props.alpha);
this.applyTransform();
};
mpld3_Text.prototype.elements = function(d) {
return d3.select(this.obj);
};
mpld3_Text.prototype.applyTransform = function() {
var pos = this.coords.xy(this.position);
this.obj.attr("x", pos[0]).attr("y", pos[1]);
if (this.props.rotation) this.obj.attr("transform", "rotate(" + this.props.rotation + "," + pos + ")");
};
mpld3.Axes = mpld3_Axes;
mpld3_Axes.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Axes.prototype.constructor = mpld3_Axes;
mpld3_Axes.prototype.requiredProps = [ "xlim", "ylim" ];
mpld3_Axes.prototype.defaultProps = {
bbox: [ .1, .1, .8, .8 ],
axesbg: "#FFFFFF",
axesbgalpha: 1,
gridOn: false,
xdomain: null,
ydomain: null,
xscale: "linear",
yscale: "linear",
zoomable: true,
axes: [ {
position: "left"
}, {
position: "bottom"
} ],
lines: [],
paths: [],
markers: [],
texts: [],
collections: [],
sharex: [],
sharey: [],
images: []
};
function mpld3_Axes(fig, props) {
mpld3_PlotElement.call(this, fig, props);
this.axnum = this.fig.axes.length;
this.axid = this.fig.figid + "_ax" + (this.axnum + 1);
this.clipid = this.axid + "_clip";
this.props.xdomain = this.props.xdomain || this.props.xlim;
this.props.ydomain = this.props.ydomain || this.props.ylim;
this.sharex = [];
this.sharey = [];
this.elements = [];
this.axisList = [];
var bbox = this.props.bbox;
this.position = [ bbox[0] * this.fig.width, (1 - bbox[1] - bbox[3]) * this.fig.height ];
this.width = bbox[2] * this.fig.width;
this.height = bbox[3] * this.fig.height;
this.isZoomEnabled = null;
this.zoom = null;
this.lastTransform = d3.zoomIdentity;
this.isBoxzoomEnabled = null;
this.isLinkedBrushEnabled = null;
this.isCurrentLinkedBrushTarget = false;
this.brushG = null;
function buildDate(d) {
return new Date(d[0], d[1], d[2], d[3], d[4], d[5]);
}
function setDomain(scale, domain) {
return scale !== "date" ? domain : [ buildDate(domain[0]), buildDate(domain[1]) ];
}
this.props.xdomain = setDomain(this.props.xscale, this.props.xdomain);
this.props.ydomain = setDomain(this.props.yscale, this.props.ydomain);
function build_scale(scale, domain, range) {
var dom = scale === "date" ? d3.scaleTime() : scale === "log" ? d3.scaleLog() : d3.scaleLinear();
return dom.domain(domain).range(range);
}
this.x = this.xdom = build_scale(this.props.xscale, this.props.xdomain, [ 0, this.width ]);
this.y = this.ydom = build_scale(this.props.yscale, this.props.ydomain, [ this.height, 0 ]);
if (this.props.xscale === "date") {
this.x = mpld3.multiscale(d3.scaleLinear().domain(this.props.xlim).range(this.props.xdomain.map(Number)), this.xdom);
}
if (this.props.yscale === "date") {
this.y = mpld3.multiscale(d3.scaleLinear().domain(this.props.ylim).range(this.props.ydomain.map(Number)), this.ydom);
}
var axes = this.props.axes;
for (var i = 0; i < axes.length; i++) {
var axis = new mpld3.Axis(this, axes[i]);
this.axisList.push(axis);
this.elements.push(axis);
if (this.props.gridOn || axis.props.grid.gridOn) {
this.elements.push(axis.getGrid());
}
}
var paths = this.props.paths;
for (var i = 0; i < paths.length; i++) {
this.elements.push(new mpld3.Path(this, paths[i]));
}
var lines = this.props.lines;
for (var i = 0; i < lines.length; i++) {
this.elements.push(new mpld3.Line(this, lines[i]));
}
var markers = this.props.markers;
for (var i = 0; i < markers.length; i++) {
this.elements.push(new mpld3.Markers(this, markers[i]));
}
var texts = this.props.texts;
for (var i = 0; i < texts.length; i++) {
this.elements.push(new mpld3.Text(this, texts[i]));
}
var collections = this.props.collections;
for (var i = 0; i < collections.length; i++) {
this.elements.push(new mpld3.PathCollection(this, collections[i]));
}
var images = this.props.images;
for (var i = 0; i < images.length; i++) {
this.elements.push(new mpld3.Image(this, images[i]));
}
this.elements.sort(function(a, b) {
return a.props.zorder - b.props.zorder;
});
}
mpld3_Axes.prototype.draw = function() {
for (var i = 0; i < this.props.sharex.length; i++) {
this.sharex.push(mpld3.get_element(this.props.sharex[i]));
}
for (var i = 0; i < this.props.sharey.length; i++) {
this.sharey.push(mpld3.get_element(this.props.sharey[i]));
}
this.baseaxes = this.fig.canvas.append("g").attr("transform", "translate(" + this.position[0] + "," + this.position[1] + ")").attr("width", this.width).attr("height", this.height).attr("class", "mpld3-baseaxes");
this.axes = this.baseaxes.append("g").attr("class", "mpld3-axes").style("pointer-events", "visiblefill");
this.clip = this.axes.append("svg:clipPath").attr("id", this.clipid).append("svg:rect").attr("x", 0).attr("y", 0).attr("width", this.width).attr("height", this.height);
this.axesbg = this.axes.append("svg:rect").attr("width", this.width).attr("height", this.height).attr("class", "mpld3-axesbg").style("fill", this.props.axesbg).style("fill-opacity", this.props.axesbgalpha);
this.pathsContainer = this.axes.append("g").attr("clip-path", "url(#" + this.clipid + ")").attr("x", 0).attr("y", 0).attr("width", this.width).attr("height", this.height).attr("class", "mpld3-paths-container");
this.paths = this.pathsContainer.append("g").attr("class", "mpld3-paths");
this.staticPaths = this.axes.append("g").attr("class", "mpld3-staticpaths");
this.brush = d3.brush().extent([ [ 0, 0 ], [ this.fig.width, this.fig.height ] ]).on("start", this.brushStart.bind(this)).on("brush", this.brushMove.bind(this)).on("end", this.brushEnd.bind(this)).on("start.nokey", function() {
d3.select(window).on("keydown.brush keyup.brush", null);
});
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].draw();
}
};
mpld3_Axes.prototype.bindZoom = function() {
if (!this.zoom) {
this.zoom = d3.zoom();
this.zoom.on("zoom", this.zoomed.bind(this));
this.axes.call(this.zoom);
}
};
mpld3_Axes.prototype.unbindZoom = function() {
if (this.zoom) {
this.zoom.on("zoom", null);
this.axes.on(".zoom", null);
this.zoom = null;
}
};
mpld3_Axes.prototype.bindBrush = function() {
if (!this.brushG) {
this.brushG = this.axes.append("g").attr("class", "mpld3-brush").call(this.brush);
}
};
mpld3_Axes.prototype.unbindBrush = function() {
if (this.brushG) {
this.brushG.remove();
this.brushG.on(".brush", null);
this.brushG = null;
}
};
mpld3_Axes.prototype.reset = function() {
if (this.zoom) {
this.doZoom(false, d3.zoomIdentity, 750);
} else {
this.bindZoom();
this.doZoom(false, d3.zoomIdentity, 750, function() {
if (this.isSomeTypeOfZoomEnabled) {
return;
}
this.unbindZoom();
}.bind(this));
}
};
mpld3_Axes.prototype.enableOrDisableBrushing = function() {
if (this.isBoxzoomEnabled || this.isLinkedBrushEnabled) {
this.bindBrush();
} else {
this.unbindBrush();
}
};
mpld3_Axes.prototype.isSomeTypeOfZoomEnabled = function() {
return this.isZoomEnabled || this.isBoxzoomEnabled;
};
mpld3_Axes.prototype.enableOrDisableZooming = function() {
if (this.isSomeTypeOfZoomEnabled()) {
this.bindZoom();
} else {
this.unbindZoom();
}
};
mpld3_Axes.prototype.enableLinkedBrush = function() {
this.isLinkedBrushEnabled = true;
this.enableOrDisableBrushing();
};
mpld3_Axes.prototype.disableLinkedBrush = function() {
this.isLinkedBrushEnabled = false;
this.enableOrDisableBrushing();
};
mpld3_Axes.prototype.enableBoxzoom = function() {
this.isBoxzoomEnabled = true;
this.enableOrDisableBrushing();
this.enableOrDisableZooming();
};
mpld3_Axes.prototype.disableBoxzoom = function() {
this.isBoxzoomEnabled = false;
this.enableOrDisableBrushing();
this.enableOrDisableZooming();
};
mpld3_Axes.prototype.enableZoom = function() {
this.isZoomEnabled = true;
this.enableOrDisableZooming();
this.axes.style("cursor", "move");
};
mpld3_Axes.prototype.disableZoom = function() {
this.isZoomEnabled = false;
this.enableOrDisableZooming();
this.axes.style("cursor", null);
};
mpld3_Axes.prototype.doZoom = function(propagate, transform, duration, onTransitionEnd) {
if (!this.props.zoomable || !this.zoom) {
return;
}
if (duration) {
var transition = this.axes.transition().duration(duration).call(this.zoom.transform, transform);
if (onTransitionEnd) {
transition.on("end", onTransitionEnd);
}
} else {
this.axes.call(this.zoom.transform, transform);
}
if (propagate) {
this.lastTransform = transform;
this.sharex.forEach(function(sharedAxes) {
sharedAxes.doZoom(false, transform, duration);
});
this.sharey.forEach(function(sharedAxes) {
sharedAxes.doZoom(false, transform, duration);
});
} else {
this.lastTransform = transform;
}
};
mpld3_Axes.prototype.zoomed = function() {
var isProgrammatic = d3.event.sourceEvent && d3.event.sourceEvent.type != "zoom";
if (isProgrammatic) {
this.doZoom(true, d3.event.transform, false);
} else {
var transform = d3.event.transform;
this.paths.attr("transform", transform);
this.elements.forEach(function(element) {
if (element.zoomed) {
element.zoomed(transform);
}
}.bind(this));
}
};
mpld3_Axes.prototype.resetBrush = function() {
this.brushG.call(this.brush.move, null);
};
mpld3_Axes.prototype.doBoxzoom = function(selection) {
if (!selection || !this.brushG) {
return;
}
var sel = selection.map(this.lastTransform.invert, this.lastTransform);
var dx = sel[1][0] - sel[0][0];
var dy = sel[1][1] - sel[0][1];
var cx = (sel[0][0] + sel[1][0]) / 2;
var cy = (sel[0][1] + sel[1][1]) / 2;
var scale = dx > dy ? this.width / dx : this.height / dy;
var transX = this.width / 2 - scale * cx;
var transY = this.height / 2 - scale * cy;
var transform = d3.zoomIdentity.translate(transX, transY).scale(scale);
this.doZoom(true, transform, 750);
this.resetBrush();
};
mpld3_Axes.prototype.brushStart = function() {
if (this.isLinkedBrushEnabled) {
this.isCurrentLinkedBrushTarget = d3.event.sourceEvent.constructor.name == "MouseEvent";
if (this.isCurrentLinkedBrushTarget) {
this.fig.resetBrushForOtherAxes(this.axid);
}
}
};
mpld3_Axes.prototype.brushMove = function() {
var selection = d3.event.selection;
if (this.isLinkedBrushEnabled) {
this.fig.updateLinkedBrush(selection);
}
};
mpld3_Axes.prototype.brushEnd = function() {
var selection = d3.event.selection;
if (this.isBoxzoomEnabled) {
this.doBoxzoom(selection);
}
if (this.isLinkedBrushEnabled) {
if (!selection) {
this.fig.endLinkedBrush();
}
this.isCurrentLinkedBrushTarget = false;
}
};
mpld3_Axes.prototype.setTicks = function(xy, nr, format) {
this.axisList.forEach(function(axis) {
if (axis.props.xy == xy) {
axis.setTicks(nr, format);
}
});
};
mpld3.Toolbar = mpld3_Toolbar;
mpld3_Toolbar.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Toolbar.prototype.constructor = mpld3_Toolbar;
mpld3_Toolbar.prototype.defaultProps = {
buttons: [ "reset", "move" ]
};
function mpld3_Toolbar(fig, props) {
mpld3_PlotElement.call(this, fig, props);
this.buttons = [];
this.props.buttons.forEach(this.addButton.bind(this));
}
mpld3_Toolbar.prototype.addButton = function(button) {
this.buttons.push(new button(this));
};
mpld3_Toolbar.prototype.draw = function() {
mpld3.insert_css("div#" + this.fig.figid + " .mpld3-toolbar image", {
cursor: "pointer",
opacity: .2,
display: "inline-block",
margin: "0px"
});
mpld3.insert_css("div#" + this.fig.figid + " .mpld3-toolbar image.active", {
opacity: .4
});
mpld3.insert_css("div#" + this.fig.figid + " .mpld3-toolbar image.pressed", {
opacity: .6
});
function showButtons() {
this.buttonsobj.transition(750).attr("y", 0);
}
function hideButtons() {
this.buttonsobj.transition(750).delay(250).attr("y", 16);
}
this.fig.canvas.on("mouseenter", showButtons.bind(this)).on("mouseleave", hideButtons.bind(this)).on("touchenter", showButtons.bind(this)).on("touchstart", showButtons.bind(this));
this.toolbar = this.fig.canvas.append("svg:svg").attr("width", 16 * this.buttons.length).attr("height", 16).attr("x", 2).attr("y", this.fig.height - 16 - 2).attr("class", "mpld3-toolbar");
this.buttonsobj = this.toolbar.append("svg:g").selectAll("buttons").data(this.buttons).enter().append("svg:image").attr("class", function(d) {
return d.cssclass;
}).attr("xlink:href", function(d) {
return d.icon();
}).attr("width", 16).attr("height", 16).attr("x", function(d, i) {
return i * 16;
}).attr("y", 16).on("click", function(d) {
d.click();
}).on("mouseenter", function() {
d3.select(this).classed("active", true);
}).on("mouseleave", function() {
d3.select(this).classed("active", false);
});
for (var i = 0; i < this.buttons.length; i++) this.buttons[i].onDraw();
};
mpld3_Toolbar.prototype.deactivate_all = function() {
this.buttons.forEach(function(b) {
b.deactivate();
});
};
mpld3_Toolbar.prototype.deactivate_by_action = function(actions) {
function filt(e) {
return actions.indexOf(e) !== -1;
}
if (actions.length > 0) {
this.buttons.forEach(function(button) {
if (button.actions.filter(filt).length > 0) button.deactivate();
});
}
};
mpld3.Button = mpld3_Button;
mpld3_Button.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Button.prototype.constructor = mpld3_Button;
function mpld3_Button(toolbar, key) {
mpld3_PlotElement.call(this, toolbar);
this.toolbar = toolbar;
this.fig = this.toolbar.fig;
this.cssclass = "mpld3-" + key + "button";
this.active = false;
}
mpld3_Button.prototype.setState = function(state) {
state ? this.activate() : this.deactivate();
};
mpld3_Button.prototype.click = function() {
this.active ? this.deactivate() : this.activate();
};
mpld3_Button.prototype.activate = function() {
this.toolbar.deactivate_by_action(this.actions);
this.onActivate();
this.active = true;
this.toolbar.toolbar.select("." + this.cssclass).classed("pressed", true);
if (!this.sticky) {
this.deactivate();
}
};
mpld3_Button.prototype.deactivate = function() {
this.onDeactivate();
this.active = false;
this.toolbar.toolbar.select("." + this.cssclass).classed("pressed", false);
};
mpld3_Button.prototype.sticky = false;
mpld3_Button.prototype.actions = [];
mpld3_Button.prototype.icon = function() {
return "";
};
mpld3_Button.prototype.onActivate = function() {};
mpld3_Button.prototype.onDeactivate = function() {};
mpld3_Button.prototype.onDraw = function() {};
mpld3.ButtonFactory = function(members) {
if (typeof members.buttonID !== "string") {
throw "ButtonFactory: buttonID must be present and be a string";
}
function B(toolbar) {
mpld3_Button.call(this, toolbar, this.buttonID);
}
B.prototype = Object.create(mpld3_Button.prototype);
B.prototype.constructor = B;
for (var key in members) {
B.prototype[key] = members[key];
}
return B;
};
mpld3.Plugin = mpld3_Plugin;
mpld3_Plugin.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Plugin.prototype.constructor = mpld3_Plugin;
mpld3_Plugin.prototype.requiredProps = [];
mpld3_Plugin.prototype.defaultProps = {};
function mpld3_Plugin(fig, props) {
mpld3_PlotElement.call(this, fig, props);
}
mpld3_Plugin.prototype.draw = function() {};
mpld3.ResetPlugin = mpld3_ResetPlugin;
mpld3.register_plugin("reset", mpld3_ResetPlugin);
mpld3_ResetPlugin.prototype = Object.create(mpld3_Plugin.prototype);
mpld3_ResetPlugin.prototype.constructor = mpld3_ResetPlugin;
mpld3_ResetPlugin.prototype.requiredProps = [];
mpld3_ResetPlugin.prototype.defaultProps = {};
function mpld3_ResetPlugin(fig, props) {
mpld3_Plugin.call(this, fig, props);
var ResetButton = mpld3.ButtonFactory({
buttonID: "reset",
sticky: false,
onActivate: function() {
this.toolbar.fig.reset();
},
icon: function() {
return mpld3.icons["reset"];
}
});
this.fig.buttons.push(ResetButton);
}
mpld3.ZoomPlugin = mpld3_ZoomPlugin;
mpld3.register_plugin("zoom", mpld3_ZoomPlugin);
mpld3_ZoomPlugin.prototype = Object.create(mpld3_Plugin.prototype);
mpld3_ZoomPlugin.prototype.constructor = mpld3_ZoomPlugin;
mpld3_ZoomPlugin.prototype.requiredProps = [];
mpld3_ZoomPlugin.prototype.defaultProps = {
button: true,
enabled: null
};
function mpld3_ZoomPlugin(fig, props) {
mpld3_Plugin.call(this, fig, props);
if (this.props.enabled === null) {
this.props.enabled = !this.props.button;
}
var enabled = this.props.enabled;
if (this.props.button) {
var ZoomButton = mpld3.ButtonFactory({
buttonID: "zoom",
sticky: true,
actions: [ "scroll", "drag" ],
onActivate: this.activate.bind(this),
onDeactivate: this.deactivate.bind(this),
onDraw: function() {
this.setState(enabled);
},
icon: function() {
return mpld3.icons["move"];
}
});
this.fig.buttons.push(ZoomButton);
}
}
mpld3_ZoomPlugin.prototype.activate = function() {
this.fig.enableZoom();
};
mpld3_ZoomPlugin.prototype.deactivate = function() {
this.fig.disableZoom();
};
mpld3_ZoomPlugin.prototype.draw = function() {
if (this.props.enabled) {
this.activate();
} else {
this.deactivate();
}
};
mpld3.BoxZoomPlugin = mpld3_BoxZoomPlugin;
mpld3.register_plugin("boxzoom", mpld3_BoxZoomPlugin);
mpld3_BoxZoomPlugin.prototype = Object.create(mpld3_Plugin.prototype);
mpld3_BoxZoomPlugin.prototype.constructor = mpld3_BoxZoomPlugin;
mpld3_BoxZoomPlugin.prototype.requiredProps = [];
mpld3_BoxZoomPlugin.prototype.defaultProps = {
button: true,
enabled: null
};
function mpld3_BoxZoomPlugin(fig, props) {
mpld3_Plugin.call(this, fig, props);
if (this.props.enabled === null) {
this.props.enabled = !this.props.button;
}
var enabled = this.props.enabled;
if (this.props.button) {
var BoxZoomButton = mpld3.ButtonFactory({
buttonID: "boxzoom",
sticky: true,
actions: [ "drag" ],
onActivate: this.activate.bind(this),
onDeactivate: this.deactivate.bind(this),
onDraw: function() {
this.setState(enabled);
},
icon: function() {
return mpld3.icons["zoom"];
}
});
this.fig.buttons.push(BoxZoomButton);
}
this.extentClass = "boxzoombrush";
}
mpld3_BoxZoomPlugin.prototype.activate = function() {
this.fig.enableBoxzoom();
};
mpld3_BoxZoomPlugin.prototype.deactivate = function() {
this.fig.disableBoxzoom();
};
mpld3_BoxZoomPlugin.prototype.draw = function() {
if (this.props.enabled) {
this.activate();
} else {
this.deactivate();
}
};
mpld3.TooltipPlugin = mpld3_TooltipPlugin;
mpld3.register_plugin("tooltip", mpld3_TooltipPlugin);
mpld3_TooltipPlugin.prototype = Object.create(mpld3_Plugin.prototype);
mpld3_TooltipPlugin.prototype.constructor = mpld3_TooltipPlugin;
mpld3_TooltipPlugin.prototype.requiredProps = [ "id" ];
mpld3_TooltipPlugin.prototype.defaultProps = {
labels: null,
hoffset: 0,
voffset: 10,
location: "mouse"
};
function mpld3_TooltipPlugin(fig, props) {
mpld3_Plugin.call(this, fig, props);
}
mpld3_TooltipPlugin.prototype.draw = function() {
var obj = mpld3.get_element(this.props.id, this.fig);
var labels = this.props.labels;
var loc = this.props.location;
this.tooltip = this.fig.canvas.append("text").attr("class", "mpld3-tooltip-text").attr("x", 0).attr("y", 0).text("").style("visibility", "hidden");
if (loc == "bottom left" || loc == "top left") {
this.x = obj.ax.position[0] + 5 + this.props.hoffset;
this.tooltip.style("text-anchor", "beginning");
} else if (loc == "bottom right" || loc == "top right") {
this.x = obj.ax.position[0] + obj.ax.width - 5 + this.props.hoffset;
this.tooltip.style("text-anchor", "end");
} else {
this.tooltip.style("text-anchor", "middle");
}
if (loc == "bottom left" || loc == "bottom right") {
this.y = obj.ax.position[1] + obj.ax.height - 5 + this.props.voffset;
} else if (loc == "top left" || loc == "top right") {
this.y = obj.ax.position[1] + 5 + this.props.voffset;
}
function mouseover(d, i) {
this.tooltip.style("visibility", "visible").text(labels === null ? "(" + d + ")" : getMod(labels, i));
}
function mousemove(d, i) {
if (loc === "mouse") {
var pos = d3.mouse(this.fig.canvas.node());
this.x = pos[0] + this.props.hoffset;
this.y = pos[1] - this.props.voffset;
}
this.tooltip.attr("x", this.x).attr("y", this.y);
}
function mouseout(d, i) {
this.tooltip.style("visibility", "hidden");
}
obj.elements().on("mouseover", mouseover.bind(this)).on("mousemove", mousemove.bind(this)).on("mouseout", mouseout.bind(this));
};
mpld3.LinkedBrushPlugin = mpld3_LinkedBrushPlugin;
mpld3.register_plugin("linkedbrush", mpld3_LinkedBrushPlugin);
mpld3_LinkedBrushPlugin.prototype = Object.create(mpld3.Plugin.prototype);
mpld3_LinkedBrushPlugin.prototype.constructor = mpld3_LinkedBrushPlugin;
mpld3_LinkedBrushPlugin.prototype.requiredProps = [ "id" ];
mpld3_LinkedBrushPlugin.prototype.defaultProps = {
button: true,
enabled: null
};
function mpld3_LinkedBrushPlugin(fig, props) {
mpld3.Plugin.call(this, fig, props);
if (this.props.enabled === null) {
this.props.enabled = !this.props.button;
}
var enabled = this.props.enabled;
if (this.props.button) {
var BrushButton = mpld3.ButtonFactory({
buttonID: "linkedbrush",
sticky: true,
actions: [ "drag" ],
onActivate: this.activate.bind(this),
onDeactivate: this.deactivate.bind(this),
onDraw: function() {
this.setState(enabled);
},
icon: function() {
return mpld3.icons["brush"];
}
});
this.fig.buttons.push(BrushButton);
}
this.pathCollectionsByAxes = [];
this.objectsByAxes = [];
this.allObjects = [];
this.extentClass = "linkedbrush";
this.dataKey = "offsets";
this.objectClass = null;
}
mpld3_LinkedBrushPlugin.prototype.activate = function() {
this.fig.enableLinkedBrush();
};
mpld3_LinkedBrushPlugin.prototype.deactivate = function() {
this.fig.disableLinkedBrush();
};
mpld3_LinkedBrushPlugin.prototype.isPathInSelection = function(path, ix, iy, sel) {
var result = sel[0][0] < path[ix] && sel[1][0] > path[ix] && sel[0][1] < path[iy] && sel[1][1] > path[iy];
return result;
};
mpld3_LinkedBrushPlugin.prototype.invertSelection = function(sel, axes) {
var xs = [ axes.x.invert(sel[0][0]), axes.x.invert(sel[1][0]) ];
var ys = [ axes.y.invert(sel[1][1]), axes.y.invert(sel[0][1]) ];
return [ [ Math.min.apply(Math, xs), Math.min.apply(Math, ys) ], [ Math.max.apply(Math, xs), Math.max.apply(Math, ys) ] ];
};
mpld3_LinkedBrushPlugin.prototype.update = function(selection) {
if (!selection) {
return;
}
this.pathCollectionsByAxes.forEach(function(axesColls, axesIndex) {
var pathCollection = axesColls[0];
var objects = this.objectsByAxes[axesIndex];
var invertedSelection = this.invertSelection(selection, this.fig.axes[axesIndex]);
var ix = pathCollection.props.xindex;
var iy = pathCollection.props.yindex;
objects.selectAll("path").classed("mpld3-hidden", function(path, idx) {
return !this.isPathInSelection(path, ix, iy, invertedSelection);
}.bind(this));
}.bind(this));
};
mpld3_LinkedBrushPlugin.prototype.end = function() {
this.allObjects.selectAll("path").classed("mpld3-hidden", false);
};
mpld3_LinkedBrushPlugin.prototype.draw = function() {
mpld3.insert_css("#" + this.fig.figid + " path.mpld3-hidden", {
stroke: "#ccc !important",
fill: "#ccc !important"
});
var pathCollection = mpld3.get_element(this.props.id);
if (!pathCollection) {
throw new Error("[LinkedBrush] Could not find path collection");
}
if (!("offsets" in pathCollection.props)) {
throw new Error("[LinkedBrush] Figure is not a scatter plot.");
}
this.objectClass = "mpld3-brushtarget-" + pathCollection.props[this.dataKey];
this.pathCollectionsByAxes = this.fig.axes.map(function(axes) {
return axes.elements.map(function(el) {
if (el.props[this.dataKey] == pathCollection.props[this.dataKey]) {
el.group.classed(this.objectClass, true);
return el;
}
}.bind(this)).filter(function(d) {
return d;
});
}.bind(this));
this.objectsByAxes = this.fig.axes.map(function(axes) {
return axes.axes.selectAll("." + this.objectClass);
}.bind(this));
this.allObjects = this.fig.canvas.selectAll("." + this.objectClass);
};
mpld3.register_plugin("mouseposition", MousePositionPlugin);
MousePositionPlugin.prototype = Object.create(mpld3.Plugin.prototype);
MousePositionPlugin.prototype.constructor = MousePositionPlugin;
MousePositionPlugin.prototype.requiredProps = [];
MousePositionPlugin.prototype.defaultProps = {
fontsize: 12,
fmt: ".3g"
};
function MousePositionPlugin(fig, props) {
mpld3.Plugin.call(this, fig, props);
}
MousePositionPlugin.prototype.draw = function() {
var fig = this.fig;
var fmt = d3.format(this.props.fmt);
var coords = fig.canvas.append("text").attr("class", "mpld3-coordinates").style("text-anchor", "end").style("font-size", this.props.fontsize).attr("x", this.fig.width - 5).attr("y", this.fig.height - 5);
for (var i = 0; i < this.fig.axes.length; i++) {
var update_coords = function() {
var ax = fig.axes[i];
return function() {
var pos = d3.mouse(this), x = ax.x.invert(pos[0]), y = ax.y.invert(pos[1]);
coords.text("(" + fmt(x) + ", " + fmt(y) + ")");
};
}();
fig.axes[i].baseaxes.on("mousemove", update_coords).on("mouseout", function() {
coords.text("");
});
}
};
mpld3.Figure = mpld3_Figure;
mpld3_Figure.prototype = Object.create(mpld3_PlotElement.prototype);
mpld3_Figure.prototype.constructor = mpld3_Figure;
mpld3_Figure.prototype.requiredProps = [ "width", "height" ];
mpld3_Figure.prototype.defaultProps = {
data: {},
axes: [],
plugins: [ {
type: "reset"
}, {
type: "zoom"
}, {
type: "boxzoom"
} ]
};
function mpld3_Figure(figid, props) {
mpld3_PlotElement.call(this, null, props);
this.figid = figid;
this.width = this.props.width;
this.height = this.props.height;
this.data = this.props.data;
this.buttons = [];
this.root = d3.select("#" + figid).append("div").style("position", "relative");
this.axes = [];
for (var i = 0; i < this.props.axes.length; i++) this.axes.push(new mpld3_Axes(this, this.props.axes[i]));
this.plugins = [];
this.pluginsByType = {};
this.props.plugins.forEach(function(plugin) {
this.addPlugin(plugin);
}.bind(this));
this.toolbar = new mpld3.Toolbar(this, {
buttons: this.buttons
});
}
mpld3_Figure.prototype.addPlugin = function(pluginInfo) {
if (!pluginInfo.type) {
return console.warn("unspecified plugin type. Skipping this");
}
var plugin;
if (pluginInfo.type in mpld3.plugin_map) {
plugin = mpld3.plugin_map[pluginInfo.type];
} else {
return console.warn("Skipping unrecognized plugin: " + plugin);
}
if (pluginInfo.clear_toolbar || pluginInfo.buttons) {
console.warn("DEPRECATION WARNING: " + "You are using pluginInfo.clear_toolbar or pluginInfo, which " + "have been deprecated. Please see the build-in plugins for the new " + "method to add buttons, otherwise contact the mpld3 maintainers.");
}
var pluginInfoNoType = mpld3_cloneObj(pluginInfo);
delete pluginInfoNoType.type;
var pluginInstance = new plugin(this, pluginInfoNoType);
this.plugins.push(pluginInstance);
this.pluginsByType[pluginInfo.type] = pluginInstance;
};
mpld3_Figure.prototype.draw = function() {
mpld3.insert_css("div#" + this.figid, {
"font-family": "Helvetica, sans-serif"
});
this.canvas = this.root.append("svg:svg").attr("class", "mpld3-figure").attr("width", this.width).attr("height", this.height);
for (var i = 0; i < this.axes.length; i++) {
this.axes[i].draw();
}
this.disableZoom();
for (var i = 0; i < this.plugins.length; i++) {
this.plugins[i].draw();
}
this.toolbar.draw();
};
mpld3_Figure.prototype.resetBrushForOtherAxes = function(currentAxid) {
this.axes.forEach(function(axes) {
if (axes.axid != currentAxid) {
axes.resetBrush();
}
});
};
mpld3_Figure.prototype.updateLinkedBrush = function(selection) {
if (!this.pluginsByType.linkedbrush) {
return;
}
this.pluginsByType.linkedbrush.update(selection);
};
mpld3_Figure.prototype.endLinkedBrush = function() {
if (!this.pluginsByType.linkedbrush) {
return;
}
this.pluginsByType.linkedbrush.end();
};
mpld3_Figure.prototype.reset = function(duration) {
this.axes.forEach(function(axes) {
axes.reset();
});
};
mpld3_Figure.prototype.enableLinkedBrush = function() {
this.axes.forEach(function(axes) {
axes.enableLinkedBrush();
});
};
mpld3_Figure.prototype.disableLinkedBrush = function() {
this.axes.forEach(function(axes) {
axes.disableLinkedBrush();
});
};
mpld3_Figure.prototype.enableBoxzoom = function() {
this.axes.forEach(function(axes) {
axes.enableBoxzoom();
});
};
mpld3_Figure.prototype.disableBoxzoom = function() {
this.axes.forEach(function(axes) {
axes.disableBoxzoom();
});
};
mpld3_Figure.prototype.enableZoom = function() {
this.axes.forEach(function(axes) {
axes.enableZoom();
});
};
mpld3_Figure.prototype.disableZoom = function() {
this.axes.forEach(function(axes) {
axes.disableZoom();
});
};
mpld3_Figure.prototype.toggleZoom = function() {
if (this.isZoomEnabled) {
this.disableZoom();
} else {
this.enableZoom();
}
};
mpld3_Figure.prototype.setTicks = function(xy, nr, format) {
this.axes.forEach(function(axes) {
axes.setTicks(xy, nr, format);
});
};
mpld3_Figure.prototype.setXTicks = function(nr, format) {
this.setTicks("x", nr, format);
};
mpld3_Figure.prototype.setYTicks = function(nr, format) {
this.setTicks("y", nr, format);
};
mpld3_Figure.prototype.removeNaN = function(data) {
output = output.map(function(offsets) {
return offsets.map(function(value) {
if (typeof value == "number" && isNaN(value)) {
return 0;
} else {
return value;
}
});
});
};
mpld3_Figure.prototype.parse_offsets = function(data) {
return data.map(function(offsets) {
return offsets.map(function(value) {
if (typeof value == "number" && isNaN(value)) {
return 0;
} else {
return value;
}
});
});
};
mpld3_Figure.prototype.get_data = function(data) {
var output = data;
if (data === null || typeof data === "undefined") {
output = null;
} else if (typeof data === "string") {
output = this.data[data];
}
return output;
};
mpld3.PlotElement = mpld3_PlotElement;
function mpld3_PlotElement(parent, props) {
this.parent = isUndefinedOrNull(parent) ? null : parent;
this.props = isUndefinedOrNull(props) ? {} : this.processProps(props);
this.fig = parent instanceof mpld3_Figure ? parent : parent && "fig" in parent ? parent.fig : null;
this.ax = parent instanceof mpld3_Axes ? parent : parent && "ax" in parent ? parent.ax : null;
}
mpld3_PlotElement.prototype.requiredProps = [];
mpld3_PlotElement.prototype.defaultProps = {};
mpld3_PlotElement.prototype.processProps = function(props) {
props = mpld3_cloneObj(props);
var finalProps = {};
var this_name = this.name();
this.requiredProps.forEach(function(p) {
if (!(p in props)) {
throw "property '" + p + "' " + "must be specified for " + this_name;
}
finalProps[p] = props[p];
delete props[p];
});
for (var p in this.defaultProps) {
if (p in props) {
finalProps[p] = props[p];
delete props[p];
} else {
finalProps[p] = this.defaultProps[p];
}
}
if ("id" in props) {
finalProps.id = props.id;
delete props.id;
} else if (!("id" in finalProps)) {
finalProps.id = mpld3.generateId();
}
for (var p in props) {
console.warn("Unrecognized property '" + p + "' " + "for object " + this.name() + " (value = " + props[p] + ").");
}
return finalProps;
};
mpld3_PlotElement.prototype.name = function() {
var funcNameRegex = /function (.{1,})\(/;
var results = funcNameRegex.exec(this.constructor.toString());
return results && results.length > 1 ? results[1] : "";
};
if (typeof module === "object" && module.exports) {
module.exports = mpld3;
} else {
this.mpld3 = mpld3;
}
console.log("Loaded mpld3 version " + mpld3.version); | OCA/web/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.9.js/0 | {
"file_path": "OCA/web/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.9.js",
"repo_id": "OCA",
"token_count": 26509
} | 120 |
from . import ir_model
from . import ir_ui_view
| OCA/web/web_widget_open_tab/models/__init__.py/0 | {
"file_path": "OCA/web/web_widget_open_tab/models/__init__.py",
"repo_id": "OCA",
"token_count": 16
} | 121 |
===========================
2D matrix for x2many fields
===========================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d7c8ad17385abb55574b0135c2b9bcf91cdccc82964a136b4c14754bd7975d43
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_widget_x2many_2d_matrix
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_x2many_2d_matrix
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to show an x2many field with 3-tuples
($x_value, $y_value, $value) in a table
+-----------+-------------+-------------+
| | $x_value1 | $x_value2 |
+===========+=============+=============+
| $y_value1 | $value(1/1) | $value(2/1) |
+-----------+-------------+-------------+
| $y_value2 | $value(1/2) | $value(2/2) |
+-----------+-------------+-------------+
where `value(n/n)` is editable.
An example use case would be: Select some projects and some employees so that
a manager can easily fill in the planned_hours for one task per employee. The
result could look like this:
.. image:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_x2many_2d_matrix/static/description/screenshot.png
:alt: Screenshot
The beauty of this is that you have an arbitrary amount of columns with this
widget, trying to get this in standard x2many lists involves some quite ugly
hacks.
**Table of contents**
.. contents::
:local:
Usage
=====
Use this widget by saying::
<field name="my_field" widget="x2many_2d_matrix" />
This assumes that my_field refers to a model with the fields `x`, `y` and
`value`. If your fields are named differently, pass the correct names as
attributes:
.. code-block:: xml
<field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3">
<tree>
<field name="my_field"/>
<field name="my_field1"/>
<field name="my_field2"/>
<field name="my_field3"/>
</tree>
</field>
You can pass the following parameters:
field_x_axis
The field that indicates the x value of a point
field_y_axis
The field that indicates the y value of a point
field_value
Show this field as value
show_row_totals
If field_value is a numeric field, it indicates if you want to calculate
row totals. True by default
show_column_totals
If field_value is a numeric field, it indicates if you want to calculate
column totals. True by default
Example
~~~~~~~
You need a data structure already filled with values. Let's assume we want to
use this widget in a wizard that lets the user fill in planned hours for one
task per project per user. In this case, we can use ``project.task`` as our
data model and point to it from our wizard. The crucial part is that we fill
the field in the default function:
.. code-block:: python
from odoo import fields, models
class MyWizard(models.TransientModel):
_name = 'my.wizard'
def _default_task_ids(self):
# your list of project should come from the context, some selection
# in a previous wizard or wherever else
projects = self.env['project.project'].browse([1, 2, 3])
# same with users
users = self.env['res.users'].browse([1, 2, 3])
return [
(0, 0, {
'name': 'Sample task name',
'project_id': p.id,
'user_id': u.id,
'planned_hours': 0,
'message_needaction': False,
'date_deadline': fields.Date.today(),
})
# if the project doesn't have a task for the user,
# create a new one
if not p.task_ids.filtered(lambda x: x.user_id == u) else
# otherwise, return the task
(4, p.task_ids.filtered(lambda x: x.user_id == u)[0].id)
for p in projects
for u in users
]
task_ids = fields.Many2many('project.task', default=_default_task_ids)
Now in our wizard, we can use:
.. code-block:: xml
<field name="task_ids" widget="x2many_2d_matrix" field_x_axis="project_id" field_y_axis="user_id" field_value="planned_hours">
<tree>
<field name="task_ids"/>
<field name="project_id"/>
<field name="user_id"/>
<field name="planned_hours"/>
</tree>
</field>
Known issues / Roadmap
======================
* Support extra attributes on each field cell via `field_extra_attrs` param.
We could set a cell as not editable, required or readonly for instance.
The `readonly` case will also give the ability
to click on m2o to open related records.
* Support limit total records in the matrix. Ref: https://github.com/OCA/web/issues/901
* Support cell traversal through keyboard arrows.
* Entering the widget from behind by pressing ``Shift+TAB`` in your keyboard
will enter into the 1st cell until https://github.com/odoo/odoo/pull/26490
is merged.
* Support extra invisible fields inside each cell.
* Support kanban mode. Current behaviour forces list mode.
Changelog
=========
12.0.1.0.1 (2018-12-07)
~~~~~~~~~~~~~~~~~~~~~~~
* [FIX] Cells are unable to render property.
(`#1126 <https://github.com/OCA/web/issues/1126>`_)
12.0.1.0.0 (2018-11-20)
~~~~~~~~~~~~~~~~~~~~~~~
* [12.0][MIG] web_widget_x2many_2d_matrix
(`#1101 <https://github.com/OCA/web/issues/1101>`_)
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Therp BV
* Tecnativa
* Camptocamp
* CorporateHub
* Onestein
Contributors
~~~~~~~~~~~~
* Holger Brunn <hbrunn@therp.nl>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Artem Kostyuk <a.kostyuk@mobilunity.com>
* Simone Orsi <simone.orsi@camptocamp.com>
* Timon Tschanz <timon.tschanz@camptocamp.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Dennis Sluijk <d.sluijk@onestein.nl>
* `CorporateHub <https://corporatehub.eu/>`__
* Alexey Pelykh <alexey.pelykh@corphub.eu>
* Adrià Gil Sorribes <adria.gil@forgeflow.com>
* Christopher Ormaza <chris.ormaza@forgeflow.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px
:target: https://github.com/ChrisOForgeFlow
:alt: ChrisOForgeFlow
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-ChrisOForgeFlow|
This module is part of the `OCA/web <https://github.com/OCA/web/tree/16.0/web_widget_x2many_2d_matrix>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
| OCA/web/web_widget_x2many_2d_matrix/README.rst/0 | {
"file_path": "OCA/web/web_widget_x2many_2d_matrix/README.rst",
"repo_id": "OCA",
"token_count": 3286
} | 122 |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_x2many_2d_matrix
#
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_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 ""
| OCA/web/web_widget_x2many_2d_matrix/i18n/web_widget_x2many_2d_matrix.pot/0 | {
"file_path": "OCA/web/web_widget_x2many_2d_matrix/i18n/web_widget_x2many_2d_matrix.pot",
"repo_id": "OCA",
"token_count": 255
} | 123 |
-o doc/js
--title "Squash Front-End JavaScript Documentation"
lib/assets/javascripts
app/assets/javascripts
| SquareSquash/web/.codoopts/0 | {
"file_path": "SquareSquash/web/.codoopts",
"repo_id": "SquareSquash",
"token_count": 33
} | 124 |
source 'https://rubygems.org'
# Load all files under the Gemfile.d directory.
Dir.glob(File.join(File.dirname(__FILE__), 'Gemfile.d', '*.rb')).sort.each do |file|
eval File.read(file), binding, file
end
| SquareSquash/web/Gemfile/0 | {
"file_path": "SquareSquash/web/Gemfile",
"repo_id": "SquareSquash",
"token_count": 78
} | 125 |
@import "vars";
@mixin button($color) {
background: $color;
border: none;
border-radius: $radius-size;
display: inline-block;
color: $gray3;
font-size: $control-font-size;
font-weight: bold;
text-transform: uppercase;
text-decoration: none;
padding: 5px 10px;
&:hover { cursor: pointer; }
&:active {
position: relative;
top: 1px;
}
&[disabled], &.disabled {
background: lighten($color, 15%);
color: $gray5;
}
&.small {
font-size: 11px;
padding: 2px 5px;
}
}
input[type=button], input[type=submit], button, .button {
@include button($darkblue);
&.default { @include button($orange); }
&.success { @include button($darkgreen); }
&.warning { @include button($red); }
}
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], textarea {
@include field-options;
width: 100%;
border: none;
border-radius: $radius-size;
}
select {
font-size: $control-font-size;
width: 100%;
padding: 5px 10px;
}
input[type=search] {
-webkit-appearance: textfield;
border-radius: $radius-size*2;
width: 100%; // webkit likes to fix these at 125px
}
input.error, select.error, textarea.error {
background-color: $red !important;
}
input:invalid, textarea:invalid, select:invalid { border: 1px solid $red !important; }
| SquareSquash/web/app/assets/stylesheets/_controls.scss/0 | {
"file_path": "SquareSquash/web/app/assets/stylesheets/_controls.scss",
"repo_id": "SquareSquash",
"token_count": 498
} | 126 |
@import "vars";
// applies to account page too
ul.project-search-results {
li {
padding: 10px 0;
border-bottom: 1px solid $gray5;
&:last-child { border-bottom: none; }
clear: right;
h5 {
font-weight: bold;
margin-top: 0;
margin-bottom: 4px;
a { text-decoration: none; }
}
p { margin-bottom: 0; }
span.project-created { float: right; }
button {
float: right;
margin-right: 20px;
}
}
}
body#projects-index {
div.wide { margin: 0 10px; }
#find {
&>p { margin-bottom: 20px; }
}
a.fa-star, a.fa-star-o { text-decoration: none; }
}
body#projects-show {
.environment {
padding: 10px 20px;
margin: 10px;
background-color: $gray5;
border-radius: $radius-size;
h3 {
margin-bottom: 5px;
a { text-decoration: none; }
}
.info {
color: $gray3;
font-style: italic;
margin-bottom: 10px;
}
}
#install-squash {
font-size: 16px;
text-align: center;
}
}
body#projects-edit {
// make the configure-project modal fixed-width so that the PREs can scroll
// rather than expanding the modal beyond the right edge
#configure-project { width: 75%; }
h3 .step-number {
$step-size-increase: 5px;
padding: $step-size-increase;
// make it a circle
display: inline-block;
border-radius: $h3-size/2 + $step-size-increase;
width: $h3-size;
background-color: $darkblue;
color: white;
text-align: center;
margin-right: 10px;
}
}
body.projects {
#members {
ul.results li {
margin-top: 15px;
h5 { margin-bottom: 0; }
}
}
.modal {
ul.results li {
p { margin: 5px 0 10px 0; }
}
}
}
| SquareSquash/web/app/assets/stylesheets/projects.css.scss/0 | {
"file_path": "SquareSquash/web/app/assets/stylesheets/projects.css.scss",
"repo_id": "SquareSquash",
"token_count": 760
} | 127 |
# 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 for working with a {Bug}'s {Comment Comments}. Only the Comment
# creator or administrators can edit or a remove a Comment.
#
# Common
# ======
#
# Path Parameters
# ---------------
#
# | | |
# |:-----------------|:-------------------------|
# | `project_id` | The {Project}'s slug. |
# | `environment_id` | The {Environment} name. |
# | `bug_id` | The Bug number (not ID). |
class CommentsController < ApplicationController
before_filter :find_project
before_filter :find_environment
before_filter :find_bug
before_filter :find_comment, except: [:index, :create]
before_filter :must_be_creator_or_admin, except: [:index, :create]
respond_to :json
# Returns a infinitely scrollable list of Comments.
#
# Routes
# ------
#
# * `GET /projects/:project_id/environments/:environment_id/bugs/:bug_id/comments.json`
#
# Query Parameters
# ----------------
#
# | | |
# |:-------|:--------------------------------------------------------------------------------------------------------------|
# | `last` | The number of the last Comment of the previous page; used to determine the start of the next page (optional). |
def index
@comments = @bug.comments.order('created_at DESC').limit(50).includes(:user)
last = params[:last].present? ? @bug.comments.find_by_number(params[:last]) : nil
@comments = @comments.where(infinite_scroll_clause('created_at', 'DESC', last, 'comments.number')) if last
respond_with @project, @environment, @bug, (request.format == :json ? decorate(@comments) : @comments)
end
# Posts a Comment on a bug as the current user.
#
# Routes
# ------
#
# * `POST /projects/:project_id/environments/:environment_id/bugs/:bug_id/comments.json`
#
# Body Parameters
# ---------------
#
# Body parameters can be JSON- or form URL-encoded.
#
# | | |
# |:----------|:--------------------------------------|
# | `comment` | Parameterized hash of Comment fields. |
def create
@comment = @bug.comments.build(comment_params)
@comment.user = current_user
@comment.save
respond_with @project, @environment, @bug, @comment
end
# Edits a Comment.
#
# Routes
# ------
#
# * `PATCH /projects/:project_id/environments/:environment_id/bugs/:bug_id/comments/:id.json`
#
# Path Parameters
# ---------------
#
# | | |
# |:-----|:-----------------------------|
# | `id` | The Comment number (not ID). |
#
# Body Parameters
# ---------------
#
# Body parameters can be JSON- or form URL-encoded.
#
# | | |
# |:----------|:--------------------------------------|
# | `comment` | Parameterized hash of Comment fields. |
def update
@comment.update_attributes comment_params
respond_with @project, @environment, @bug, @comment
end
# Deletes a Comment.
#
# Routes
# ------
#
# * `DELETE /projects/:project_id/environments/:environment_id/bugs/:bug_id/comments/:id.json`
#
# Path Parameters
# ---------------
#
# | | |
# |:-----|:-----------------------------|
# | `id` | The Comment number (not ID). |
def destroy
@comment.destroy
head :no_content
end
private
def find_comment
@comment = @bug.comments.find_by_number!(params[:id])
end
def must_be_creator_or_admin
if [:creator, :owner, :admin].include? current_user.role(@comment) then
return true
else
respond_to do |format|
format.json { head :forbidden }
end
return false
end
end
def decorate(comments)
comments.map do |comment|
comment.as_json.merge(
user: comment.user.as_json,
body_html: markdown.(comment.body),
user_url: user_url(comment.user),
url: project_environment_bug_comment_url(@project, @environment, @bug, comment, format: 'json')
)
end
end
def comment_params
params.require(:comment).permit(:body)
end
end
| SquareSquash/web/app/controllers/comments_controller.rb/0 | {
"file_path": "SquareSquash/web/app/controllers/comments_controller.rb",
"repo_id": "SquareSquash",
"token_count": 1854
} | 128 |
# 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.
# Helper methods mixed in to every view.
module ApplicationHelper
# Composition of `pluralize` and `number_with_delimiter`.
#
# @param [Numeric] count The number of things.
# @param [String] singular The name of the thing.
# @param [String] plural The name of two of those things.
# @return [String] Localized string describing the number and identity of the
# things.
def pluralize_with_delimiter(count, singular, plural=nil)
count ||= 0
"#{number_with_delimiter count} " + ((count == 1 || count =~ /^1(\.0+)?$/) ? singular : (plural || singular.pluralize))
end
# Returns a link to a Project's commit (assuming the Project has a commit link
# format specified). The title of the link will be the commit ID (abbreviated
# if appropriate).
#
# If the commit URL cannot be determined, the full SHA1 is wrapped in a `CODE`
# tag.
#
# @param [Project] project The project that the commit is to.
# @param [String] commit The full ID of the commit.
# @return [String] A link to the commit.
def commit_link(project, commit)
if url = project.commit_url(commit)
link_to commit[0, 6], url
else
content_tag :tt, commit[0, 6]
end
end
# Creates a link to open a project file in the user's editor. See the
# editor_link.js.coffee file for more information.
#
# @param [String] editor The editor ("textmate", "sublime", "vim", "emacs",
# or "rubymine").
# @param [Project] project The project containing the file.
# @param [String] file The file path relative to the project root.
# @param [String] line The line number within the file.
def editor_link(editor, project, file, line)
content_tag :a, '', :'data-editor' => editor, :'data-file' => file, :'data-line' => line, :'data-project' => project.to_param
end
# Converts a number in degrees decimal (DD) to degrees-minutes-seconds (DMS).
#
# @param [Float] coord The longitude or latitude, in degrees.
# @param [:lat, :lon] axis The axis of the coordinate value.
# @param [Hash] options Additional options.
# @option options [Fixnum] :precision (2) The precision of the seconds value.
# @return [String] Localized display of the DMS value.
# @raise [ArgumentError] If an axis other than `:lat` or `:lon` is given.
def number_to_dms(coord, axis, options={})
positive = coord >= 0
coord = coord.abs
degrees = coord.floor
remainder = coord - degrees
minutes = (remainder*60).floor
remainder -= minutes/60.0
seconds = (remainder*60).round(options[:precision] || 2)
hemisphere = case axis
when :lat
t("helpers.application.number_to_dms.#{positive ? 'north' : 'south'}")
when :lon
t("helpers.application.number_to_dms.#{positive ? 'east' : 'west'}")
else
raise ArgumentError, "axis must be :lat or :lon"
end
t('helpers.application.number_to_dms.coordinate', degrees: degrees, minutes: minutes, seconds: seconds, hemisphere: hemisphere)
end
# Given the parts of a backtrace element, creates a single string displaying
# them together in a typical backtrace format.
#
# @param [String] file The file path.
# @param [Fixnum] line The line number in the file.
# @param [String] method The method name.
def format_backtrace_element(file, line, method=nil)
str = "#{file}:#{line}"
str << " (in `#{method}`)" if method
str
end
end
| SquareSquash/web/app/helpers/application_helper.rb/0 | {
"file_path": "SquareSquash/web/app/helpers/application_helper.rb",
"repo_id": "SquareSquash",
"token_count": 1401
} | 129 |
# 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.
# Events mark important changes in a {Bug}. They are displayed in a
# newsfeed-style list when viewing a bug. Events consist of a `kind` and a
# freeform, JSON-serialized `data` field. The value of `kind` indicates what
# keys to expect in `data`. `data` can consist of cached values from associated
# objects (such as a {User}'s username), or the IDs of associated records (such
# as a {Comment}).
#
# Associations
# ============
#
# | | |
# |:--------------|:-----------------------------------------------------------------------------|
# | `bug` | The {Bug} this event relates to. |
# | `user` | The {User} that caused this event to occur (where relevant). |
# | `user_events` | The denormalized {UserEvent UserEvents} for Users watching this Event's Bug. |
#
# There may be other pseudo-associations on specific types of events, where the
# foreign key field is stored in `data`.
#
# Properties
# ==========
#
# | | |
# |:-------|:---------------------------------------------|
# | `kind` | The type of event that occurred. |
# | `data` | Freeform, JSON-encoded data about the event. |
class Event < ActiveRecord::Base
belongs_to :bug, inverse_of: :events
belongs_to :user, inverse_of: :events
has_many :user_events, dependent: :delete_all, inverse_of: :event
attr_readonly :bug, :user, :kind, :data
include JsonSerialize
json_serialize data: {}
validates :bug,
presence: true
# @private
def as_json(options=nil)
case kind
when 'open'
{kind: kind.to_s, created_at: created_at}
when 'comment'
{kind: kind.to_s, comment: comment.as_json, user: user.as_json, created_at: created_at}
when 'assign'
{kind: kind.to_s, assigner: user.as_json, assignee: assignee.as_json, created_at: created_at}
when 'close'
{kind: kind.to_s, user: user.as_json, status: data['status'], revision: data['revision'], created_at: created_at, issue: data['issue']}
when 'dupe'
{kind: kind.to_s, user: user.as_json, original: bug.duplicate_of.as_json, created_at: created_at}
when 'reopen'
{kind: kind.to_s, user: user.as_json, occurrence: occurrence.as_json, from: data['from'], created_at: created_at}
when 'deploy'
{kind: kind.to_s, revision: data['revision'], build: data['build'], created_at: created_at}
when 'email'
{kind: kind.to_s, recipients: data['recipients'], created_at: created_at}
else
raise "Unknown event kind #{kind.inspect}"
end
end
# Eager-loads the pseudo-associations of a group of events. The
# pseudo-associations are `comment`, `occurrence`, and `assignee`.
#
# @param [Array<Event>] events The events to preload associations for.
# @return [Array<Event>] The events.
def self.preload(events)
comments = Comment.where(id: events.map { |e| e.data['comment_id'] }.compact )
comments.each do |comment|
events.select { |e| e.data['comment_id'] == comment.id }.each { |e| e.instance_variable_set :@comment, [comment] }
end
events.select { |e| e.data['comment_id'].nil? }.each { |e| e.instance_variable_set :@comment, [nil] }
occurrences = Occurrence.where(id: events.map { |e| e.data['occurrence_id'] }.compact)
occurrences.each do |occurrence|
events.select { |e| e.data['occurrence_id'] == occurrence.id }.each { |e| e.instance_variable_set :@occurrence, [occurrence] }
end
events.select { |e| e.data['occurrence_id'].nil? }.each { |e| e.instance_variable_set :@occurrence, [nil] }
assignees = User.where(id: (events.map { |e| e.data['assignee_id'] } + events.map { |e| e.comment.try!(:user_id)}).uniq.compact).includes(:emails)
assignees.each do |user|
events.select { |e| e.data['assignee_id'] == user.id }.each { |e| e.instance_variable_set :@assignee, [user] }
end
events.select { |e| e.data['assignee_id'].nil? }.each { |e| e.instance_variable_set :@assignee, [nil] }
return events
end
# @return [Comment, nil] The associated comment for `:comment` events, `nil`
# otherwise.
def comment() (@comment ||= [bug.comments.find_by_id(data['comment_id'])]).first end
# @return [Occurrence, nil] The occurrence that reopened a bug for `:reopen`
# events, `nil` otherwise.
def occurrence() (@occurrence ||= [bug.occurrences.find_by_id(data['occurrence_id'])]).first end
# @return [User, nil] The assignee for `:assign` events, `nil` otherwise.
def assignee() (@assignee ||= [User.find_by_id(data['assignee_id'])]).first end
end
| SquareSquash/web/app/models/event.rb/0 | {
"file_path": "SquareSquash/web/app/models/event.rb",
"repo_id": "SquareSquash",
"token_count": 2048
} | 130 |
# 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.
# Denormalized association between a {User} and the {Event Events} from the
# {Bug Bugs} that that User is {Watch watching}.
#
# Associations
# ============
#
# | | |
# |:--------|:----------------------------------------------|
# | `user` | The {User} watching the Bug. |
# | `event` | The {Event} for the Bug the User is watching. |
class UserEvent < ActiveRecord::Base
self.primary_keys = [:user_id, :event_id]
belongs_to :user, inverse_of: :user_events
belongs_to :event, inverse_of: :user_events
validates :user,
presence: true
validates :event,
presence: true
end
| SquareSquash/web/app/models/user_event.rb/0 | {
"file_path": "SquareSquash/web/app/models/user_event.rb",
"repo_id": "SquareSquash",
"token_count": 453
} | 131 |
Bug #<%= @bug.number %> on <%= @bug.environment.project.name %> is occurring
a lot. Perhaps someone should look into it.
<%= project_environment_bug_url @bug.environment.project, @bug.environment, @bug %>
Project: <%= @bug.environment.project.name %>
Environment: <%= @bug.environment.name %>
Revision: <%= @bug.revision %>
<%= @bug.class_name %>
<% if @bug.special_file? %>
in <%= @bug.file %>
<% else %>
in <%= @bug.file %>:<%= @bug.line %>
<% end %>
<%= @bug.message_template %>
Yours truly,
Squash
| SquareSquash/web/app/views/notification_mailer/critical.text.erb/0 | {
"file_path": "SquareSquash/web/app/views/notification_mailer/critical.text.erb",
"repo_id": "SquareSquash",
"token_count": 223
} | 132 |
# encoding: utf-8
# 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.root.join('app', 'views', 'layouts', 'application.html.rb')
module Views
# @private
module Projects
# @private
class Show < Views::Layouts::Application
needs :project
protected
def page_title() @project.name end
def breadcrumbs() [@project] end
def body_content
full_width_section { environments_grid }
full_width_section(true) { project_info }
end
private
def project_info
div(class: 'row') do
div(class: 'four columns') do
project_owner
project_overview
end
div(class: 'twelve columns') do
h5 "Members"
div id: 'members'
if current_user.role(@project) == :owner
delete_project
elsif !current_user.role(@project).nil?
p { button_to "Leave Project", project_my_membership_url(@project), :'data-sqmethod' => 'DELETE', class: 'warning' }
end
end
end
end
def project_owner
h5 "Owner"
div(class: 'profile-widget') do
image_tag @project.owner.gravatar
h5 { link_to @project.owner.name, user_url(@project.owner) }
div { strong @project.owner.username }
div "Created #{l @project.created_at, format: :short_date}", class: 'small'
div style: 'clear: left'
end
end
def project_overview
h5 "Overview"
dl do
dt "Environments"
dd number_with_delimiter(@project.environments.count)
dt "Members"
dd do
text number_with_delimiter(@project.memberships.count)
text " ("
text pluralize_with_delimiter(@project.memberships.where(admin: true).count, 'administrator')
text ")"
end
end
h5 "Settings"
p { link_to "Configure and install Squash", edit_project_url(@project) } if action_name == 'show'
if current_user.role(@project)
p { link_to "Change membership settings", edit_project_my_membership_url(@project) }
else
p { button_to "Join this team", join_project_my_membership_url(@project), :'data-sqmethod' => 'POST' }
end
end
def delete_project
h5 "Delete"
p do
strong "Beware!"
text " Deleting this project will delete all environments, all bugs, all occurrences, all comments, and all other data."
end
p do
button_to "Delete",
project_url(@project),
:'data-sqmethod' => :delete,
:'data-sqconfirm' => "Are you SURE you want to delete the project #{@project.name}?",
class: 'warning'
end
end
def environments_grid
if @project.environments.empty?
p "No bugs have been received yet.", class: 'no-results'
p(id: 'install-squash') do
link_to "Install Squash into your project", edit_project_url(@project)
text " to get started."
end
return
end
@project.environments.order('name ASC').limit(20).in_groups_of(2, nil) do |environments|
div(class: 'row') do
environments.each_with_index do |environment, idx|
div(class: 'six columns') do
div(class: (environment ? 'environment' : nil)) do
if environment
h3 { link_to environment.name, project_environment_bugs_url(@project, environment) }
p(class: 'info') do
text pluralize_with_delimiter(environment.bugs_count, 'bug')
if [:admin, :owner].include?(current_user.role(@project))
text " — "
span do
if @project.default_environment_id == environment.id
strong "Default", id: 'default-indicator', :'data-id' => environment.id
else
a "Make default", href: '#', class: 'make-default', :'data-id' => environment.id
end
end
end
end
form_for([@project, environment], format: 'json', namespace: "env_#{environment.name}") do |f|
p do
f.check_box :sends_emails
text ' '
f.label :sends_emails
unless Squash::Configuration.pagerduty.disabled
text ' '
f.check_box :notifies_pagerduty
text ' '
f.label :notifies_pagerduty
end
end
end if [:admin, :owner].include?(current_user.role(@project))
end
end
end
end
end
end
end
end
end
end
| SquareSquash/web/app/views/projects/show.html.rb/0 | {
"file_path": "SquareSquash/web/app/views/projects/show.html.rb",
"repo_id": "SquareSquash",
"token_count": 2833
} | 133 |
transmit_timeout: 60
ignored_exception_classes:
- ActionController::RoutingError
- ActionController::MethodNotAllowed
- ActionController::ActionNotFound
ignored_exception_messages:
SignalException:
- SIGTERM
"ActiveRecord::StatementInvalid":
- This connection has been closed.
failsafe_log: log/squash.failsafe.log
disabled: true
allowed_origins: [] | SquareSquash/web/config/environments/common/dogfood.yml/0 | {
"file_path": "SquareSquash/web/config/environments/common/dogfood.yml",
"repo_id": "SquareSquash",
"token_count": 107
} | 134 |
---
default_url_options:
host: "test.host"
protocol: http
| SquareSquash/web/config/environments/test/mailer.yml/0 | {
"file_path": "SquareSquash/web/config/environments/test/mailer.yml",
"repo_id": "SquareSquash",
"token_count": 23
} | 135 |
# encoding: utf-8
# 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
module JIRA
# @private
#
# Adds timeout capability to the JIRA HTTP client.
class HttpClient
def http_conn_with_timeout(*args)
http_conn = http_conn_without_timeout(*args)
http_conn.open_timeout = @options[:open_timeout]
http_conn.read_timeout = @options[:read_timeout]
http_conn
end
alias_method_chain :http_conn, :timeout
end
end unless Squash::Configuration.jira.disabled?
| SquareSquash/web/config/initializers/jira.rb/0 | {
"file_path": "SquareSquash/web/config/initializers/jira.rb",
"repo_id": "SquareSquash",
"token_count": 361
} | 136 |
# 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.
class InitialSchema < ActiveRecord::Migration
def up
execute <<-SQL
CREATE FUNCTION bugs_calculate_number() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET number = (SELECT COALESCE(MAX(number), 0)+1 FROM bugs oc WHERE oc.environment_id = NEW.environment_id)
WHERE id = NEW.id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_decrement_comments_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET comments_count = comments_count - 1
WHERE id = OLD.bug_id;
RETURN OLD;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_decrement_events_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET events_count = events_count - 1
WHERE id = OLD.bug_id;
RETURN OLD;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_decrement_occurrences_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET occurrences_count = occurrences_count - 1
WHERE id = OLD.bug_id;
RETURN OLD;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_increment_comments_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET comments_count = comments_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_increment_events_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET events_count = events_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_increment_occurrences_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET occurrences_count = occurrences_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_move_comments_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET comments_count = comments_count - 1
WHERE id = OLD.bug_id;
UPDATE bugs
SET comments_count = comments_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_move_events_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET events_count = events_count - 1
WHERE id = OLD.bug_id;
UPDATE bugs
SET events_count = events_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION bugs_move_occurrences_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE bugs
SET occurrences_count = occurrences_count - 1
WHERE id = OLD.bug_id;
UPDATE bugs
SET occurrences_count = occurrences_count + 1
WHERE id = NEW.bug_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION comments_calculate_number() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE comments
SET number = (SELECT COALESCE(MAX(number), 0)+1 FROM comments cc WHERE cc.bug_id = NEW.bug_id)
WHERE id = NEW.id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION environments_change_bugs_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE environments
SET bugs_count = (
CASE WHEN NEW.fixed IS NOT TRUE AND NEW.irrelevant IS NOT TRUE
THEN bugs_count + 1
ELSE bugs_count - 1
END)
WHERE id = OLD.environment_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION environments_decrement_bugs_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE environments
SET bugs_count = bugs_count - 1
WHERE id = OLD.environment_id;
RETURN OLD;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION environments_increment_bugs_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE environments
SET bugs_count = bugs_count + 1
WHERE id = NEW.environment_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION environments_move_bugs_count() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE environments
SET bugs_count = bugs_count - (
CASE
WHEN (OLD.fixed IS NOT TRUE AND OLD.irrelevant IS NOT TRUE)
THEN 1
ELSE 0
END)
WHERE id = OLD.environment_id;
UPDATE environments
SET bugs_count = bugs_count + (
CASE
WHEN (NEW.fixed IS NOT TRUE AND NEW.irrelevant IS NOT TRUE)
THEN 1
ELSE 0
END)
WHERE id = NEW.environment_id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION notify_bug_update() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
occurrences_changed CHARACTER VARYING(5);
comments_changed CHARACTER VARYING(5);
events_changed CHARACTER VARYING(5);
BEGIN
occurrences_changed := (CASE WHEN OLD.occurrences_count IS DISTINCT FROM NEW.occurrences_count THEN 'TRUE' ELSE 'FALSE' END);
comments_changed := (CASE WHEN OLD.comments_count IS DISTINCT FROM NEW.comments_count THEN 'TRUE' ELSE 'FALSE' END);
events_changed := (CASE WHEN OLD.events_count IS DISTINCT FROM NEW.events_count THEN 'TRUE' ELSE 'FALSE' END);
PERFORM pg_notify('ws_env_' || NEW.environment_id, '{"table":"' || TG_TABLE_NAME || '","id":' || NEW.id || ',"occurrences_count_changed":' || occurrences_changed || ',"comments_count_changed":' || comments_changed || ',"events_count_changed":' || events_changed || '}');
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION notify_env_update() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
bugs_changed CHARACTER VARYING(5);
BEGIN
bugs_changed := (CASE WHEN OLD.bugs_count IS DISTINCT FROM NEW.bugs_count THEN 'TRUE' ELSE 'FALSE' END);
PERFORM pg_notify('ws_proj_' || NEW.project_id, '{"table":"' || TG_TABLE_NAME || '","id":' || NEW.id || ',"bugs_count_changed":' || bugs_changed || '}');
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE FUNCTION occurrences_calculate_number() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE occurrences
SET number = (SELECT COALESCE(MAX(number), 0)+1 FROM occurrences oc WHERE oc.bug_id = NEW.bug_id)
WHERE id = NEW.id;
RETURN NEW;
END;
$$
SQL
execute <<-SQL
CREATE TABLE users (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
metadata TEXT,
updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
username CHARACTER VARYING(50) NOT NULL CHECK (CHAR_LENGTH(username) > 0)
)
SQL
execute <<-SQL
CREATE TABLE projects (
id SERIAL PRIMARY KEY,
api_key CHARACTER(36) NOT NULL UNIQUE,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
default_environment_id INTEGER,
metadata TEXT,
name CHARACTER VARYING(126) NOT NULL CHECK (CHAR_LENGTH(name) > 0),
owner_id INTEGER NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
repository_url CHARACTER VARYING(255) NOT NULL,
updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL
)
SQL
execute <<-SQL
CREATE TABLE environments (
id SERIAL PRIMARY KEY,
bugs_count INTEGER DEFAULT 0 NOT NULL CHECK (bugs_count >= 0),
name CHARACTER VARYING(100) NOT NULL CHECK (CHAR_LENGTH(name) > 0),
project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
metadata TEXT
)
SQL
execute <<-SQL
ALTER TABLE projects ADD CONSTRAINT projects_default_environment_id_fkey FOREIGN KEY (default_environment_id) REFERENCES environments(id) ON DELETE SET NULL
SQL
execute <<-SQL
CREATE TABLE deploys (
id SERIAL PRIMARY KEY,
build CHARACTER VARYING(40),
deployed_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
environment_id INTEGER NOT NULL REFERENCES environments(id) ON DELETE CASCADE,
hostname CHARACTER VARYING(126),
revision CHARACTER(40) NOT NULL,
version CHARACTER VARYING(126)
)
SQL
execute <<-SQL
CREATE TABLE bugs (
id SERIAL PRIMARY KEY,
assigned_user_id INTEGER REFERENCES users(id) ON DELETE SET NULL,
blamed_revision CHARACTER(40),
class_name CHARACTER VARYING(128) NOT NULL CHECK (CHAR_LENGTH(class_name) > 0),
client CHARACTER VARYING(32) NOT NULL,
comments_count INTEGER DEFAULT 0 NOT NULL CHECK (comments_count >= 0),
deploy_id INTEGER REFERENCES deploys(id) ON DELETE SET NULL,
duplicate_of_id INTEGER,
environment_id INTEGER NOT NULL REFERENCES environments(id) ON DELETE CASCADE,
events_count INTEGER DEFAULT 0 NOT NULL CHECK (events_count >= 0),
file CHARACTER VARYING(255) NOT NULL CHECK (CHAR_LENGTH(file) > 0),
first_occurrence TIMESTAMP WITHOUT TIME ZONE,
fixed BOOLEAN DEFAULT FALSE NOT NULL,
fix_deployed BOOLEAN DEFAULT FALSE NOT NULL,
irrelevant BOOLEAN DEFAULT FALSE NOT NULL,
latest_occurrence TIMESTAMP WITHOUT TIME ZONE,
line INTEGER NOT NULL CHECK (line > 0),
metadata TEXT,
number INTEGER CHECK (number > 0),
occurrences_count INTEGER DEFAULT 0 NOT NULL CHECK (occurrences_count >= 0),
resolution_revision CHARACTER(40),
revision CHARACTER(40) NOT NULL,
searchable_text TSVECTOR,
CHECK (fix_deployed IS TRUE AND fixed IS TRUE OR fix_deployed IS FALSE)
)
SQL
execute <<-SQL
ALTER TABLE bugs ADD CONSTRAINT bugs_duplicate_of_id_fkey FOREIGN KEY (duplicate_of_id) REFERENCES bugs(id) ON DELETE CASCADE
SQL
execute <<-SQL
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
bug_id INTEGER NOT NULL REFERENCES bugs(id) ON DELETE CASCADE,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
metadata TEXT,
number INTEGER CHECK (number > 0),
updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE SET NULL
)
SQL
execute <<-SQL
CREATE TABLE emails (
id SERIAL PRIMARY KEY,
"primary" BOOLEAN DEFAULT FALSE NOT NULL,
email CHARACTER VARYING(255) NOT NULL,
project_id INTEGER REFERENCES projects(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE
)
SQL
execute <<-SQL
CREATE TABLE events (
id SERIAL PRIMARY KEY,
bug_id INTEGER NOT NULL REFERENCES bugs(id) ON DELETE CASCADE,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
data TEXT,
kind CHARACTER VARYING(32) NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE SET NULL
)
SQL
execute <<-SQL
CREATE TABLE memberships (
project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
admin BOOLEAN DEFAULT FALSE NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
metadata TEXT,
PRIMARY KEY (project_id, user_id)
)
SQL
execute <<-SQL
CREATE TABLE notification_thresholds (
bug_id INTEGER NOT NULL REFERENCES bugs(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
last_tripped_at TIMESTAMP WITHOUT TIME ZONE,
period INTEGER NOT NULL CHECK (period > 0),
threshold INTEGER NOT NULL CHECK (threshold > 0),
PRIMARY KEY (bug_id, user_id)
)
SQL
execute <<-SQL
CREATE TABLE obfuscation_maps (
id SERIAL PRIMARY KEY,
deploy_id INTEGER NOT NULL REFERENCES deploys(id) ON DELETE CASCADE,
namespace TEXT
)
SQL
execute <<-SQL
CREATE TABLE occurrences (
id SERIAL PRIMARY KEY,
bug_id INTEGER NOT NULL REFERENCES bugs(id) ON DELETE CASCADE,
client CHARACTER VARYING(32) NOT NULL,
metadata TEXT,
number INTEGER CHECK (number > 0),
occurred_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
redirect_target_id INTEGER,
revision CHARACTER(40) NOT NULL,
symbolication_id uuid
)
SQL
execute <<-SQL
ALTER TABLE occurrences ADD CONSTRAINT occurrences_redirect_target_id_fkey FOREIGN KEY (redirect_target_id) REFERENCES occurrences(id) ON DELETE CASCADE
SQL
execute <<-SQL
CREATE TABLE slugs (
id SERIAL PRIMARY KEY,
active BOOLEAN DEFAULT TRUE NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
scope CHARACTER VARYING(126),
slug CHARACTER VARYING(126) NOT NULL CHECK (CHAR_LENGTH(slug) > 0),
sluggable_id INTEGER NOT NULL,
sluggable_type CHARACTER VARYING(32) NOT NULL
)
SQL
execute <<-SQL
CREATE TABLE source_maps (
id SERIAL PRIMARY KEY,
environment_id INTEGER NOT NULL REFERENCES environments(id) ON DELETE CASCADE,
map TEXT,
revision CHARACTER(40) NOT NULL
)
SQL
execute <<-SQL
CREATE TABLE symbolications (
uuid uuid NOT NULL PRIMARY KEY,
lines TEXT,
symbols TEXT
)
SQL
execute <<-SQL
CREATE TABLE user_events (
event_id INTEGER NOT NULL REFERENCES events(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP WITHOUT TIME ZONE,
PRIMARY KEY (event_id, user_id)
)
SQL
execute <<-SQL
CREATE TABLE watches (
bug_id INTEGER NOT NULL REFERENCES bugs(id) ON DELETE CASCADE,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP WITHOUT TIME ZONE,
PRIMARY KEY (bug_id, user_id)
)
SQL
execute <<-SQL
CREATE INDEX bugs_env_fo ON bugs (environment_id, deploy_id, assigned_user_id, fixed, irrelevant, latest_occurrence, number)
SQL
execute <<-SQL
CREATE INDEX bugs_env_lo ON bugs (environment_id, deploy_id, assigned_user_id, fixed, irrelevant, first_occurrence, number)
SQL
execute <<-SQL
CREATE UNIQUE INDEX bugs_env_number ON bugs (environment_id, number)
SQL
execute <<-SQL
CREATE INDEX bugs_env_oc ON bugs (environment_id, deploy_id, assigned_user_id, fixed, irrelevant, occurrences_count, number)
SQL
execute <<-SQL
CREATE INDEX bugs_env_user ON bugs (environment_id, assigned_user_id, fixed, irrelevant)
SQL
execute <<-SQL
CREATE INDEX bugs_environment_textsearch ON bugs USING gin (searchable_text)
SQL
execute <<-SQL
CREATE INDEX bugs_find_for_occ1 ON bugs (environment_id, class_name, file, line, blamed_revision, deploy_id)
SQL
execute <<-SQL
CREATE INDEX bugs_find_for_occ2 ON bugs (environment_id, class_name, file, line, blamed_revision, fixed)
SQL
execute <<-SQL
CREATE INDEX bugs_user ON bugs (assigned_user_id, fixed, irrelevant)
SQL
execute <<-SQL
CREATE INDEX bugs_user_recency ON bugs (assigned_user_id, latest_occurrence, number)
SQL
execute <<-SQL
CREATE INDEX bugs_fixed ON bugs (fixed)
SQL
execute <<-SQL
CREATE INDEX comments_bug ON comments (bug_id, created_at)
SQL
execute <<-SQL
CREATE UNIQUE INDEX comments_number ON comments (bug_id, number)
SQL
execute <<-SQL
CREATE UNIQUE INDEX deploys_env_build ON deploys (environment_id, build)
SQL
execute <<-SQL
CREATE INDEX deploys_env_revision ON deploys (environment_id, revision, deployed_at)
SQL
execute <<-SQL
CREATE INDEX deploys_env_time ON deploys (environment_id, deployed_at)
SQL
execute <<-SQL
CREATE UNIQUE INDEX emails_email_user ON emails (LOWER(email), project_id, user_id)
SQL
execute <<-SQL
CREATE INDEX emails_primary ON emails (user_id, "primary")
SQL
execute <<-SQL
CREATE UNIQUE INDEX environments_name ON environments (project_id, LOWER(name))
SQL
execute <<-SQL
CREATE INDEX events_bug ON events (bug_id, created_at)
SQL
execute <<-SQL
CREATE INDEX occurrences_bug ON occurrences (bug_id, occurred_at)
SQL
execute <<-SQL
CREATE INDEX occurrences_bug_revision ON occurrences (bug_id, revision, occurred_at)
SQL
execute <<-SQL
CREATE UNIQUE INDEX occurrences_number ON occurrences (bug_id, number)
SQL
execute <<-SQL
CREATE INDEX projects_name ON projects (LOWER(name) TEXT_pattern_ops)
SQL
execute <<-SQL
CREATE INDEX projects_owner ON projects (owner_id)
SQL
execute <<-SQL
CREATE INDEX slugs_for_record ON slugs (sluggable_type, sluggable_id, active)
SQL
execute <<-SQL
CREATE UNIQUE INDEX slugs_unique ON slugs (sluggable_type, LOWER(scope), LOWER(slug))
SQL
execute <<-SQL
CREATE INDEX source_maps_env_revision ON source_maps (environment_id, revision)
SQL
execute <<-SQL
CREATE INDEX user_events_time ON user_events (event_id, created_at)
SQL
execute <<-SQL
CREATE INDEX users_username ON users (LOWER(username) TEXT_pattern_ops)
SQL
execute <<-SQL
CREATE RULE occurrences_set_first AS
ON INSERT TO occurrences DO
UPDATE bugs
SET first_occurrence = NEW.occurred_at
WHERE (bugs.id = NEW.bug_id)
AND (bugs.first_occurrence IS NULL)
SQL
execute <<-SQL
CREATE RULE occurrences_set_latest AS
ON INSERT TO occurrences DO
UPDATE bugs
SET latest_occurrence = NEW.occurred_at
WHERE (bugs.id = NEW.bug_id)
AND (bugs.latest_occurrence IS NULL)
OR (bugs.latest_occurrence < NEW.occurred_at)
SQL
execute <<-SQL
CREATE TRIGGER bugs_comments_delete
AFTER DELETE ON comments
FOR EACH ROW
EXECUTE PROCEDURE bugs_decrement_comments_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_comments_insert
AFTER INSERT ON comments
FOR EACH ROW
EXECUTE PROCEDURE bugs_increment_comments_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_comments_move
AFTER UPDATE ON comments
FOR EACH ROW WHEN (OLD.bug_id <> NEW.bug_id)
EXECUTE PROCEDURE bugs_move_comments_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_events_delete
AFTER DELETE ON events
FOR EACH ROW
EXECUTE PROCEDURE bugs_decrement_events_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_events_insert AFTER INSERT ON events
FOR EACH ROW
EXECUTE PROCEDURE bugs_increment_events_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_events_move AFTER UPDATE ON events
FOR EACH ROW WHEN (OLD.bug_id <> NEW.bug_id)
EXECUTE PROCEDURE bugs_move_events_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_notify AFTER UPDATE ON bugs
FOR EACH ROW
WHEN (
(OLD.occurrences_count IS DISTINCT FROM NEW.occurrences_count)
OR (OLD.comments_count IS DISTINCT FROM NEW.comments_count)
OR (OLD.events_count IS DISTINCT FROM NEW.events_count)
)
EXECUTE PROCEDURE notify_bug_update()
SQL
execute <<-SQL
CREATE TRIGGER bugs_occurrences_delete
AFTER DELETE ON occurrences
FOR EACH ROW
EXECUTE PROCEDURE bugs_decrement_occurrences_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_occurrences_insert AFTER INSERT ON occurrences
FOR EACH ROW
EXECUTE PROCEDURE bugs_increment_occurrences_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_occurrences_move AFTER UPDATE ON occurrences
FOR EACH ROW WHEN (OLD.bug_id <> NEW.bug_id)
EXECUTE PROCEDURE bugs_move_occurrences_count()
SQL
execute <<-SQL
CREATE TRIGGER bugs_set_number AFTER INSERT ON bugs
FOR EACH ROW
EXECUTE PROCEDURE bugs_calculate_number()
SQL
execute <<-SQL
CREATE TRIGGER comments_set_number AFTER INSERT ON comments
FOR EACH ROW
EXECUTE PROCEDURE comments_calculate_number()
SQL
execute <<-SQL
CREATE TRIGGER environments_bugs_delete
AFTER DELETE ON bugs
FOR EACH ROW WHEN ((OLD.fixed IS NOT TRUE) AND (OLD.irrelevant IS NOT TRUE))
EXECUTE PROCEDURE environments_decrement_bugs_count()
SQL
execute <<-SQL
CREATE TRIGGER environments_bugs_insert
AFTER INSERT ON bugs
FOR EACH ROW WHEN ((NEW.fixed IS NOT TRUE) AND (NEW.irrelevant IS NOT TRUE))
EXECUTE PROCEDURE environments_increment_bugs_count()
SQL
execute <<-SQL
CREATE TRIGGER environments_bugs_move
AFTER UPDATE ON bugs
FOR EACH ROW WHEN (OLD.environment_id <> NEW.environment_id)
EXECUTE PROCEDURE environments_move_bugs_count()
SQL
execute <<-SQL
CREATE TRIGGER environments_bugs_update
AFTER UPDATE ON bugs
FOR EACH ROW WHEN (
(
(old.environment_id = new.environment_id)
AND (
(
(
(old.fixed IS NOT TRUE)
AND (old.irrelevant IS NOT TRUE)
) AND (
NOT (
(new.fixed IS NOT TRUE)
AND (new.irrelevant IS NOT TRUE)
)
)
) OR (
(
(new.fixed IS NOT TRUE)
AND (new.irrelevant IS NOT TRUE)
) AND (
NOT (
(old.fixed IS NOT TRUE)
AND (old.irrelevant IS NOT TRUE)
)
)
)
)
)
)
EXECUTE PROCEDURE environments_change_bugs_count();
SQL
execute <<-SQL
CREATE TRIGGER environments_notify
AFTER UPDATE ON environments
FOR EACH ROW WHEN (OLD.bugs_count IS DISTINCT FROM NEW.bugs_count)
EXECUTE PROCEDURE notify_env_update()
SQL
execute <<-SQL
CREATE TRIGGER occurrences_set_number
AFTER INSERT ON occurrences
FOR EACH ROW
EXECUTE PROCEDURE occurrences_calculate_number()
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
| SquareSquash/web/db/migrate/1_initial_schema.rb/0 | {
"file_path": "SquareSquash/web/db/migrate/1_initial_schema.rb",
"repo_id": "SquareSquash",
"token_count": 12276
} | 137 |
---
description: |
Uploads a JavaScript source map to Squash. This data is generated by your
JavaScript minifier, and then parsed and serialized using the
`squash_javascript` gem.
responseCodes:
- status: 422
successful: false
description: |
* Missing required parameter.
* Invalid parameter value.
- status: 403
successful: false
description: Unknown API key.
- status: 201
successful: true
requestParameters:
properties:
sourcemap:
description: |
A JSON-serialized source map, gzipped, then base 64-encoded.
required: true
type: string
example: "eJxj4ci3UgguLE0szvBKLEssTi7KLCixsgrOLy1KTvVNLGCz4nPITSwoyMxL\nL45mAABqrw+t\n"
api_key:
description: Your project's API key.
required: true
type: string
example: b305d2a6-dc2a-4c01-a345-82e8ce529c26
environment:
description: The name of the environment to which this source map applies.
required: true
type: string
example: production
revision:
description: |
The SHA1 of the Git revision of the code under which this source map was
generated.
required: true
type: string
example: 2dc20c984283bede1f45863b8f3b4dd9b5b554cc
from:
description: |
The type of generated JavaScript code this source map transforms from.
"hosted" should be used for the final hosted JS; other names are
arbitrary.
required: true
type: string
example: hosted
to:
description: |
The type of generated or human-written JavaScript/CoffeeScript code this
source map transforms to.
required: true
type: string
example: concatenated
| SquareSquash/web/doc/fdoc/sourcemap-POST.fdoc/0 | {
"file_path": "SquareSquash/web/doc/fdoc/sourcemap-POST.fdoc",
"repo_id": "SquareSquash",
"token_count": 655
} | 138 |
# 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.
root = exports ? this
# @private
escape = (str) -> str.replace('&', '&').replace('<', '<').replace('>', '>')
# Generates appropriate options to send to the Bootstrap tooltip function for a
# tooltip containing the error messages associated with a form field.
#
# @param [Array<String>] errors The error messages for a form field.
#
root.errorTooltipOptions = (errors) ->
{
title: (escape(error) for error in errors).join("<br/>")
html: true
placement: 'right'
trigger: 'focus'
template: '<div class="tooltip tooltip-error"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
}
| SquareSquash/web/lib/assets/javascripts/error_tooltip.js.coffee/0 | {
"file_path": "SquareSquash/web/lib/assets/javascripts/error_tooltip.js.coffee",
"repo_id": "SquareSquash",
"token_count": 381
} | 139 |
# 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.
# Parent container for the BackgroundRunner module cluster. This module stores
# the modules that encapsulate different strategies for executing long-running
# background tasks outside of the scope of a request-response handler.
#
# @example Running a DeployFixMarker job
# BackgroundRunner.run DeployFixMarker, deploy.id
#
# All `BackgroundRunner` modules should implement a `run` class method that
# takes, as its first argument, the name of a worker class under `lib/workers`.
# It should take any other number of arguments as long as they are serializable.
module BackgroundRunner
# @return [Module] The active module that should be used to handle
# background jobs.
def self.runner
BackgroundRunner.const_get Squash::Configuration.concurrency.background_runner.to_sym, false
end
# Shortcut for `BackgroundRunner.runner.run`.
def self.run(*args)
runner.run *args
end
end
| SquareSquash/web/lib/background_runner.rb/0 | {
"file_path": "SquareSquash/web/lib/background_runner.rb",
"repo_id": "SquareSquash",
"token_count": 410
} | 140 |
# 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 loads Occurrences affected by the addition of a new
# ObfuscationMap, and attempts to deobfuscate them using the new map.
class ObfuscationMapWorker
include BackgroundRunner::Job
# Creates a new worker instance and performs a deobfuscation.
#
# @param [Integer] map_id The ID of an {ObfuscationMap}.
def self.perform(map_id)
new(ObfuscationMap.find(map_id)).perform
end
# Creates a new worker instance.
#
# @param [ObfuscationMap] map An obfuscation map to process.
def initialize(map)
@map = map
end
# Locates relevant Occurrences and attempts to deobfuscate them.
def perform
@map.deploy.bugs.cursor.each do |bug|
bug.occurrences.cursor.each do |occ|
begin
occ.deobfuscate! @map
occ.recategorize!
rescue => err
# for some reason the cursors gem eats exceptions
Squash::Ruby.notify err, occurrence: occ
end
end
end
end
end
| SquareSquash/web/lib/workers/obfuscation_map_worker.rb/0 | {
"file_path": "SquareSquash/web/lib/workers/obfuscation_map_worker.rb",
"repo_id": "SquareSquash",
"token_count": 538
} | 141 |
# encoding: utf-8
# 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 CommentsController, type: :controller do
describe "#index" do
before :all do
membership = FactoryGirl.create(:membership)
@env = FactoryGirl.create(:environment, project: membership.project)
@bug = FactoryGirl.create(:bug, environment: @env)
@comments = FactoryGirl.create_list(:comment, 100, bug: @bug, user: @bug.environment.project.owner)
@user = membership.user
end
it "should require a logged-in user" do
get :index, polymorphic_params(@bug, true)
expect(response).to redirect_to(login_url(next: request.fullpath))
end
context '[authenticated]' do
before(:each) { login_as @user }
it_should_behave_like "action that 404s at appropriate times", :get, :index, 'polymorphic_params(@bug, true)'
it "should load the 50 most recent comments" do
get :index, polymorphic_params(@bug, true, format: 'json')
expect(response.status).to eql(200)
expect(JSON.parse(response.body).map { |r| r['number'] }).to eql(@comments.sort_by(&:created_at).reverse.map(&:number)[0, 50])
end
it "should return the next 50 comments when given a last parameter" do
@comments.sort_by! &:created_at
@comments.reverse!
get :index, polymorphic_params(@bug, true, last: @comments[49].number, format: 'json')
expect(response.status).to eql(200)
expect(JSON.parse(response.body).map { |r| r['number'] }).to eql(@comments.map(&:number)[50, 50])
end
it "should decorate the response" do
get :index, polymorphic_params(@bug, true, format: 'json')
JSON.parse(response.body).zip(@comments.sort_by(&:created_at).reverse).each do |(hsh, comment)|
expect(hsh['user']['username']).to eql(comment.user.username)
expect(hsh['body_html']).to eql(ApplicationController.new.send(:markdown).(comment.body))
expect(hsh['user_url']).to eql(user_url(comment.user))
expect(hsh['url']).to eql(project_environment_bug_comment_url(@env.project, @env, @bug, comment, format: 'json'))
end
end
end
end
describe "#create" do
before :all do
membership = FactoryGirl.create(:membership)
@env = FactoryGirl.create(:environment, project: membership.project)
@bug = FactoryGirl.create(:bug, environment: @env)
@user = membership.user
end
it "should require a logged-in user" do
post :create, polymorphic_params(@bug, true, comment: {body: 'Hello, world!'})
expect(response).to redirect_to(login_url(next: request.fullpath))
expect(@bug.comments(true)).to be_empty
end
context '[authenticated]' do
before(:each) { login_as @bug.environment.project.owner }
it_should_behave_like "action that 404s at appropriate times", :get, :index, 'polymorphic_params(@bug, true)'
it "should create the comment" do
post :create, polymorphic_params(@bug, true, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(201)
expect(comment = @bug.comments(true).first).not_to be_nil
expect(response.body).to eql(comment.to_json)
end
it "should discard fields not accessible to creators" do
@bug.comments.delete_all
post :create, polymorphic_params(@bug, true, comment: {user_id: FactoryGirl.create(:membership, project: @env.project).user_id, body: 'Hello, world!'}, format: 'json')
expect(@bug.comments(true).first.user_id).to eql(@bug.environment.project.owner_id)
end
it "should render the errors with status 422 if invalid" do
post :create, polymorphic_params(@bug, true, comment: {body: ''}, format: 'json')
expect(response.status).to eql(422)
expect(response.body).to eql("{\"comment\":{\"body\":[\"can’t be blank\"]}}")
end
end
end
describe "#update" do
before(:each) { @comment = FactoryGirl.create(:comment) }
it "should require a logged-in user" do
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(401)
expect(@comment.reload.body).not_to eql('Hello, world!')
end
context '[authenticated]' do
before(:each) { login_as @comment.user }
it_should_behave_like "action that 404s at appropriate times", :get, :index, 'polymorphic_params(@comment, false)'
it_should_behave_like "singleton action that 404s at appropriate times", :patch, :update, 'polymorphic_params(@comment, false, bug: { fixed: true })'
it "should update the comment" do
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(200)
expect(@comment.reload.body).to eql('Hello, world!')
expect(response.body).to eql(@comment.to_json)
end
it "should allow admins to update any comment" do
login_as FactoryGirl.create(:membership, project: @comment.bug.environment.project, admin: true).user
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(200)
expect(@comment.reload.body).to eql('Hello, world!')
end
it "should allow owners to update any comment" do
login_as @comment.bug.environment.project.owner
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(200)
expect(@comment.reload.body).to eql('Hello, world!')
end
it "should not allow other members to update any comment" do
login_as FactoryGirl.create(:membership, project: @comment.bug.environment.project, admin: false).user
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!'}, format: 'json')
expect(response.status).to eql(403)
expect(@comment.reload.body).not_to eql('Hello, world!')
end
it "should not allow inaccessible fields to be updated" do
patch :update, polymorphic_params(@comment, false, comment: {body: 'Hello, world!', number: 123}, format: 'json')
expect(@comment.reload.number).not_to eql(123)
end
end
end
describe "#destroy" do
before(:each) { @comment = FactoryGirl.create(:comment) }
it "should require a logged-in user" do
delete :destroy, polymorphic_params(@comment, false, format: 'json')
expect(response.status).to eql(401)
expect { @comment.reload }.not_to raise_error
end
context '[authenticated]' do
before(:each) { login_as @comment.user }
it_should_behave_like "action that 404s at appropriate times", :delete, :destroy, 'polymorphic_params(@comment, false, format: "json")'
it_should_behave_like "singleton action that 404s at appropriate times", :delete, :destroy, 'polymorphic_params(@comment, false, bug: { fixed: true }, format: "json")'
it "should destroy the comment" do
delete :destroy, polymorphic_params(@comment, false)
expect(response.status).to eql(204)
expect { @comment.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
end
end
end
| SquareSquash/web/spec/controllers/comments_controller_spec.rb/0 | {
"file_path": "SquareSquash/web/spec/controllers/comments_controller_spec.rb",
"repo_id": "SquareSquash",
"token_count": 2979
} | 142 |
# 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 KnownRevisionValidator do
before :all do
env = FactoryGirl.create(:environment)
@model = FactoryGirl.build(:deploy, environment: env)
end
it "should not accept unknown revisions" do
@model.revision = '3dc20c984283bede1f45863b8f3b4dd9b5b554cc'
expect(@model).not_to be_valid
expect(@model.errors[:revision]).to eql(['does not exist in the repository'])
end
it "should accept known revisions" do
@model.revision = '2dc20c984283bede1f45863b8f3b4dd9b5b554cc'
expect(@model).to be_valid
end
it "should normalize known revisions" do
@model.revision = 'HEAD'
expect(@model).to be_valid
expect(@model.revision).to match(/^[0-9a-f]{40}$/)
end
context "[:repo option]" do
before :each do
@model = double('Model', :foo= => nil)
@commit = double('Git::Object::Commit', sha: '2dc20c984283bede1f45863b8f3b4dd9b5b554cc')
end
it "should accept repository objects" do
repo = double('Git::Repository', fetch: nil)
expect(repo).to receive(:object).once.and_return(@commit)
validator = KnownRevisionValidator.new(repo: repo, attributes: [:foo])
validator.validate_each(@model, :foo, 'HEAD')
end
it "should accept method names" do
repo = double('Git::Repository', fetch: nil)
expect(repo).to receive(:object).once.and_return(@commit)
allow(@model).to receive(:repo).and_return(repo)
validator = KnownRevisionValidator.new(repo: :repo, attributes: [:foo])
validator.validate_each(@model, :foo, 'HEAD')
end
it "should accept procs" do
repo = double('Git::Repository', fetch: nil)
expect(repo).to receive(:object).once.and_return(@commit)
allow(@model).to receive(:repo).and_return(repo)
validator = KnownRevisionValidator.new(repo: ->(m) { m.repo }, attributes: [:foo])
validator.validate_each(@model, :foo, 'HEAD')
end
end
end
| SquareSquash/web/spec/lib/known_revision_validator_spec.rb/0 | {
"file_path": "SquareSquash/web/spec/lib/known_revision_validator_spec.rb",
"repo_id": "SquareSquash",
"token_count": 977
} | 143 |
# 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 Event, type: :model do
describe "#as_json" do
before :all do
m = FactoryGirl.create(:membership)
@user = m.user
@bug = FactoryGirl.create(:bug, environment: FactoryGirl.create(:environment, project: m.project))
@occurrence = FactoryGirl.create(:rails_occurrence, bug: @bug)
end
it "should return the correct fields for an open event" do
expect(FactoryGirl.build(:event, bug: @bug, kind: 'open').as_json).to eql(kind: 'open', created_at: nil)
end
it "should return the correct fields for a comment event" do
comment = FactoryGirl.create(:comment, bug: @bug, user: FactoryGirl.create(:membership, project: @bug.environment.project).user)
expect(FactoryGirl.build(:event, bug: @bug, kind: 'comment', data: {'comment_id' => comment.id}, user: @user).as_json).
to eql(kind: 'comment', comment: comment.as_json, user: @user.as_json, created_at: nil)
end
it "should return the correct fields for an assign event" do
assignee = FactoryGirl.create(:user)
expect(FactoryGirl.build(:event, bug: @bug, kind: 'assign', data: {'assignee_id' => assignee.id}, user: @user).as_json).
to eql(kind: 'assign', assigner: @user.as_json, assignee: assignee.as_json, created_at: nil)
end
it "should return the correct fields for a close event" do
expect(FactoryGirl.build(:event, bug: @bug, kind: 'close', user: @user, data: {'status' => 'irrelevant', 'revision' => 'abc123', 'issue' => 'FOO-123'}).as_json).
to eql(kind: 'close', user: @user.as_json, status: 'irrelevant', revision: 'abc123', created_at: nil, issue: 'FOO-123')
end
it "should return the correct fields for a reopen event" do
expect(FactoryGirl.build(:event, bug: @bug, kind: 'reopen', user: @user, data: {'occurrence_id' => @occurrence.id, 'from' => 'irrelevant'}).as_json).
to eql(kind: 'reopen', user: @user.as_json, occurrence: @occurrence.as_json, from: 'irrelevant', created_at: nil)
end
it "should return the correct fields for a deploy event" do
expect(FactoryGirl.build(:event, bug: @bug, kind: 'deploy', data: {'build' => '10010', 'revision' => 'c6293262d8d706bd8b4344b4c6deae3cde6e6434'}).as_json).
to eql(kind: 'deploy', revision: 'c6293262d8d706bd8b4344b4c6deae3cde6e6434', build: '10010', created_at: nil)
end
it "should return the correct fields for an email event" do
expect(FactoryGirl.build(:event, bug: @bug, kind: 'email', data: {'recipients' => %w(foo@bar.com)}).as_json).
to eql(kind: 'email', recipients: %w(foo@bar.com), created_at: nil)
end
it "should return the correct fields for a dupe event" do
original = FactoryGirl.create(:bug)
dupe = FactoryGirl.create(:bug, duplicate_of: original, environment: original.environment)
expect(FactoryGirl.build(:event, bug: dupe, kind: 'dupe', user: @user).as_json).
to eql(kind: 'dupe', user: @user.as_json, original: original.as_json, created_at: nil)
end
end
context "[observer]" do
it "should copy itself into the user_events table for each user watching the event's bug" do
event = FactoryGirl.build(:event)
watch1 = FactoryGirl.create(:watch, bug: event.bug)
watch2 = FactoryGirl.create(:watch, bug: event.bug)
event.save!
ues = event.user_events.pluck(:user_id)
expect(ues.size).to eql(2)
expect(ues).to include(watch1.user_id)
expect(ues).to include(watch2.user_id)
end
end
end
| SquareSquash/web/spec/models/event_spec.rb/0 | {
"file_path": "SquareSquash/web/spec/models/event_spec.rb",
"repo_id": "SquareSquash",
"token_count": 1590
} | 144 |
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (Wed, 12 Feb 2014 03:42:24 GMT)
*
* @copyright
* Copyright (C) 2004-2013 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
function Brush()
{
// Contributed by Jen
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
'XmlValidate Year YesNoFormat';
var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
'cfwindow cfxml cfzip cfzipparam';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['coldfusion','cf'];
SyntaxHighlighter.brushes.ColdFusion = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
| SquareSquash/web/vendor/assets/javascripts/sh/shBrushColdFusion.js/0 | {
"file_path": "SquareSquash/web/vendor/assets/javascripts/sh/shBrushColdFusion.js",
"repo_id": "SquareSquash",
"token_count": 2743
} | 145 |
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (Wed, 12 Feb 2014 03:42:24 GMT)
*
* @copyright
* Copyright (C) 2004-2013 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
function Brush()
{
// Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org
var keywords = 'while validateset validaterange validatepattern validatelength validatecount ' +
'until trap switch return ref process param parameter in if global: '+
'function foreach for finally filter end elseif else dynamicparam do default ' +
'continue cmdletbinding break begin alias \\? % #script #private #local #global '+
'mandatory parametersetname position valuefrompipeline ' +
'valuefrompipelinebypropertyname valuefromremainingarguments helpmessage ';
var operators = ' and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' +
'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' +
'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' +
'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' +
'lt match ne not notcontains notlike notmatch or regex replace wildcard';
var verbs = 'write where wait use update unregister undo trace test tee take suspend ' +
'stop start split sort skip show set send select scroll resume restore ' +
'restart resolve resize reset rename remove register receive read push ' +
'pop ping out new move measure limit join invoke import group get format ' +
'foreach export expand exit enter enable disconnect disable debug cxnew ' +
'copy convertto convertfrom convert connect complete compare clear ' +
'checkpoint aggregate add';
// I can't find a way to match the comment based help in multi-line comments, because SH won't highlight in highlights, and javascript doesn't support lookbehind
var commenthelp = ' component description example externalhelp forwardhelpcategory forwardhelptargetname forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsis';
this.regexList = [
{ regex: new RegExp('^\\s*#[#\\s]*\\.('+this.getKeywords(commenthelp)+').*$', 'gim'), css: 'preprocessor help bold' }, // comment-based help
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: /(<|<)#[\s\S]*?#(>|>)/gm, css: 'comments here' }, // multi-line comments
{ regex: new RegExp('@"\\n[\\s\\S]*?\\n"@', 'gm'), css: 'script string here' }, // double quoted here-strings
{ regex: new RegExp("@'\\n[\\s\\S]*?\\n'@", 'gm'), css: 'script string single here' }, // single quoted here-strings
{ regex: new RegExp('"(?:\\$\\([^\\)]*\\)|[^"]|`"|"")*[^`]"','g'), css: 'string' }, // double quoted strings
{ regex: new RegExp("'(?:[^']|'')*'", 'g'), css: 'string single' }, // single quoted strings
{ regex: new RegExp('[\\$|@|@@](?:(?:global|script|private|env):)?[A-Z0-9_]+', 'gi'), css: 'variable' }, // $variables
{ regex: new RegExp('(?:\\b'+verbs.replace(/ /g, '\\b|\\b')+')-[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'functions' }, // functions and cmdlets
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords
{ regex: new RegExp('-'+this.getKeywords(operators), 'gmi'), css: 'operator value' }, // operators
{ regex: new RegExp('\\[[A-Z_\\[][A-Z0-9_. `,\\[\\]]*\\]', 'gi'), css: 'constants' }, // .Net [Type]s
{ regex: new RegExp('\\s+-(?!'+this.getKeywords(operators)+')[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'color1' }, // parameters
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['powershell', 'ps', 'posh'];
SyntaxHighlighter.brushes.PowerShell = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
| SquareSquash/web/vendor/assets/javascripts/sh/shBrushPowerShell.js/0 | {
"file_path": "SquareSquash/web/vendor/assets/javascripts/sh/shBrushPowerShell.js",
"repo_id": "SquareSquash",
"token_count": 1655
} | 146 |
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (Wed, 12 Feb 2014 03:42:24 GMT)
*
* @copyright
* Copyright (C) 2004-2013 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt1{background-color:#1b2426 !important;}
.syntaxhighlighter .line.alt2{background-color:#1b2426 !important;}
.syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#323e41 !important;}
.syntaxhighlighter .line.highlighted.number{color:#b9bdb6 !important;}
.syntaxhighlighter table caption{color:#b9bdb6 !important;}
.syntaxhighlighter table td.code .container textarea{background:#1b2426;color:#b9bdb6;}
.syntaxhighlighter .gutter{color:#afafaf !important;}
.syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
.syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#1b2426 !important;}
.syntaxhighlighter.printing .line .content{border:none !important;}
.syntaxhighlighter.collapsed{overflow:visible !important;}
.syntaxhighlighter.collapsed .toolbar{color:#5ba1cf !important;background:black !important;border:1px solid #435a5f !important;}
.syntaxhighlighter.collapsed .toolbar a{color:#5ba1cf !important;}
.syntaxhighlighter.collapsed .toolbar a:hover{color:#5ce638 !important;}
.syntaxhighlighter .toolbar{color:white !important;background:#435a5f !important;border:none !important;}
.syntaxhighlighter .toolbar a{color:white !important;}
.syntaxhighlighter .toolbar a:hover{color:#e0e8ff !important;}
.syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#b9bdb6 !important;}
.syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#878a85 !important;}
.syntaxhighlighter .string,.syntaxhighlighter .string a{color:#5ce638 !important;}
.syntaxhighlighter .keyword{color:#5ba1cf !important;}
.syntaxhighlighter .preprocessor{color:#435a5f !important;}
.syntaxhighlighter .variable{color:#ffaa3e !important;}
.syntaxhighlighter .value{color:#009900 !important;}
.syntaxhighlighter .functions{color:#ffaa3e !important;}
.syntaxhighlighter .constants{color:#e0e8ff !important;}
.syntaxhighlighter .script{font-weight:bold !important;color:#5ba1cf !important;background-color:none !important;}
.syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#e0e8ff !important;}
.syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
.syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}
| SquareSquash/web/vendor/assets/stylesheets/sh/shThemeRDark.css/0 | {
"file_path": "SquareSquash/web/vendor/assets/stylesheets/sh/shThemeRDark.css",
"repo_id": "SquareSquash",
"token_count": 937
} | 147 |
import { Directive, Input, OnInit, Self } from "@angular/core";
import { ControlValueAccessor, FormControl, NgControl, Validators } from "@angular/forms";
import { dirtyRequired } from "jslib-angular/validators/dirty.validator";
/** For use in the SSO Config Form only - will be deprecated by the Component Library */
@Directive()
export abstract class BaseCvaComponent implements ControlValueAccessor, OnInit {
get describedById() {
return this.showDescribedBy ? this.controlId + "Desc" : null;
}
get showDescribedBy() {
return this.helperText != null || this.controlDir.control.hasError("required");
}
get isRequired() {
return (
this.controlDir.control.hasValidator(Validators.required) ||
this.controlDir.control.hasValidator(dirtyRequired)
);
}
@Input() label: string;
@Input() controlId: string;
@Input() helperText: string;
internalControl = new FormControl("");
protected onChange: any;
protected onTouched: any;
constructor(@Self() public controlDir: NgControl) {
this.controlDir.valueAccessor = this;
}
ngOnInit() {
this.internalControl.valueChanges.subscribe(this.onValueChangesInternal);
}
onBlurInternal() {
this.onTouched();
}
// CVA interfaces
writeValue(value: string) {
this.internalControl.setValue(value);
}
registerOnChange(fn: any) {
this.onChange = fn;
}
registerOnTouched(fn: any) {
this.onTouched = fn;
}
setDisabledState(isDisabled: boolean) {
if (isDisabled) {
this.internalControl.disable();
} else {
this.internalControl.enable();
}
}
protected onValueChangesInternal: any = (value: string) => this.onChange(value);
// End CVA interfaces
}
| bitwarden/web/bitwarden_license/src/app/organizations/components/base-cva.component.ts/0 | {
"file_path": "bitwarden/web/bitwarden_license/src/app/organizations/components/base-cva.component.ts",
"repo_id": "bitwarden",
"token_count": 566
} | 148 |
import { Component } from "@angular/core";
import { FormBuilder } from "@angular/forms";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { PolicyType } from "jslib-common/enums/policyType";
import { PolicyRequest } from "jslib-common/models/request/policyRequest";
import {
BasePolicy,
BasePolicyComponent,
} from "src/app/organizations/policies/base-policy.component";
export class MaximumVaultTimeoutPolicy extends BasePolicy {
name = "maximumVaultTimeout";
description = "maximumVaultTimeoutDesc";
type = PolicyType.MaximumVaultTimeout;
component = MaximumVaultTimeoutPolicyComponent;
}
@Component({
selector: "policy-maximum-timeout",
templateUrl: "maximum-vault-timeout.component.html",
})
export class MaximumVaultTimeoutPolicyComponent extends BasePolicyComponent {
data = this.formBuilder.group({
hours: [null],
minutes: [null],
});
constructor(private formBuilder: FormBuilder, private i18nService: I18nService) {
super();
}
loadData() {
const minutes = this.policyResponse.data?.minutes;
if (minutes == null) {
return;
}
this.data.patchValue({
hours: Math.floor(minutes / 60),
minutes: minutes % 60,
});
}
buildRequestData() {
if (this.data.value.hours == null && this.data.value.minutes == null) {
return null;
}
return {
minutes: this.data.value.hours * 60 + this.data.value.minutes,
};
}
buildRequest(policiesEnabledMap: Map<PolicyType, boolean>): Promise<PolicyRequest> {
const singleOrgEnabled = policiesEnabledMap.get(PolicyType.SingleOrg) ?? false;
if (this.enabled.value && !singleOrgEnabled) {
throw new Error(this.i18nService.t("requireSsoPolicyReqError"));
}
const data = this.buildRequestData();
if (data?.minutes == null || data?.minutes <= 0) {
throw new Error(this.i18nService.t("invalidMaximumVaultTimeout"));
}
return super.buildRequest(policiesEnabledMap);
}
}
| bitwarden/web/bitwarden_license/src/app/policies/maximum-vault-timeout.component.ts/0 | {
"file_path": "bitwarden/web/bitwarden_license/src/app/policies/maximum-vault-timeout.component.ts",
"repo_id": "bitwarden",
"token_count": 675
} | 149 |
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { ProviderService } from "jslib-common/abstractions/provider.service";
import { Provider } from "jslib-common/models/domain/provider";
@Component({
selector: "provider-manage",
templateUrl: "manage.component.html",
})
export class ManageComponent implements OnInit {
provider: Provider;
accessEvents = false;
constructor(private route: ActivatedRoute, private providerService: ProviderService) {}
ngOnInit() {
this.route.parent.params.subscribe(async (params) => {
this.provider = await this.providerService.get(params.providerId);
this.accessEvents = this.provider.useEvents;
});
}
}
| bitwarden/web/bitwarden_license/src/app/providers/manage/manage.component.ts/0 | {
"file_path": "bitwarden/web/bitwarden_license/src/app/providers/manage/manage.component.ts",
"repo_id": "bitwarden",
"token_count": 229
} | 150 |
<app-navbar></app-navbar>
<div class="container page-content">
<div class="page-header">
<h1>{{ "setupProvider" | i18n }}</h1>
</div>
<p>{{ "setupProviderDesc" | i18n }}</p>
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="loading">
<h2 class="mt-5">{{ "generalInformation" | i18n }}</h2>
<div class="row">
<div class="form-group col-6">
<label for="name">{{ "providerName" | i18n }}</label>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required />
</div>
<div class="form-group col-6">
<label for="billingEmail">{{ "billingEmail" | i18n }}</label>
<input
id="billingEmail"
class="form-control"
type="text"
name="BillingEmail"
[(ngModel)]="billingEmail"
required
/>
</div>
</div>
<div class="mt-4">
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "submit" | i18n }}</span>
</button>
<button type="button" class="btn btn-outline-secondary" (click)="cancel()" *ngIf="showCancel">
{{ "cancel" | i18n }}
</button>
</div>
</form>
</div>
<app-footer></app-footer>
| bitwarden/web/bitwarden_license/src/app/providers/setup/setup.component.html/0 | {
"file_path": "bitwarden/web/bitwarden_license/src/app/providers/setup/setup.component.html",
"repo_id": "bitwarden",
"token_count": 630
} | 151 |
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" class="container" ngNativeValidate>
<div class="row justify-content-md-center mt-5">
<div class="col-5">
<p class="lead text-center mb-4">{{ "deleteAccount" | i18n }}</p>
<div class="card">
<div class="card-body">
<p>{{ "deleteRecoverDesc" | i18n }}</p>
<div class="form-group">
<label for="email">{{ "emailAddress" | i18n }}</label>
<input
id="email"
class="form-control"
type="text"
name="Email"
[(ngModel)]="email"
required
appAutofocus
inputmode="email"
appInputVerbatim="false"
/>
</div>
<hr />
<div class="d-flex">
<button
type="submit"
class="btn btn-primary btn-block btn-submit"
[disabled]="form.loading"
>
<span>{{ "submit" | i18n }}</span>
<i
class="bwi bwi-spinner bwi-spin"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
</button>
<a routerLink="/login" class="btn btn-outline-secondary btn-block ml-2 mt-0">
{{ "cancel" | i18n }}
</a>
</div>
</div>
</div>
</div>
</div>
</form>
| bitwarden/web/src/app/accounts/recover-delete.component.html/0 | {
"file_path": "bitwarden/web/src/app/accounts/recover-delete.component.html",
"repo_id": "bitwarden",
"token_count": 824
} | 152 |
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate autocomplete="off">
<div class="row justify-content-md-center mt-5">
<div class="col-4">
<p class="lead text-center mb-4">{{ "updateMasterPassword" | i18n }}</p>
<div class="card d-block">
<div class="card-body">
<app-callout type="warning">{{ "masterPasswordInvalidWarning" | i18n }} </app-callout>
<app-callout
type="info"
[enforcedPolicyOptions]="enforcedPolicyOptions"
*ngIf="enforcedPolicyOptions"
></app-callout>
<form
#form
(ngSubmit)="submit()"
[appApiAction]="formPromise"
ngNativeValidate
autocomplete="off"
>
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="currentMasterPassword">{{ "currentMasterPass" | i18n }}</label>
<input
id="currentMasterPassword"
type="password"
name="MasterPasswordHash"
class="form-control"
[(ngModel)]="currentMasterPassword"
required
appInputVerbatim
/>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="newMasterPassword">{{ "newMasterPass" | i18n }}</label>
<input
id="newMasterPassword"
type="password"
name="NewMasterPasswordHash"
class="form-control mb-1"
[(ngModel)]="masterPassword"
(input)="updatePasswordStrength()"
required
appInputVerbatim
autocomplete="new-password"
/>
<app-password-strength
[score]="masterPasswordScore"
[showText]="true"
></app-password-strength>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label for="masterPasswordRetype">{{ "confirmNewMasterPass" | i18n }}</label>
<input
id="masterPasswordRetype"
type="password"
name="MasterPasswordRetype"
class="form-control"
[(ngModel)]="masterPasswordRetype"
required
appInputVerbatim
autocomplete="new-password"
/>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
<i
class="fa fa-spinner fa-spin"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
<span>{{ "changeMasterPassword" | i18n }}</span>
</button>
<button (click)="cancel()" type="button" class="btn btn-outline-secondary">
<span>{{ "cancel" | i18n }}</span>
</button>
</form>
</div>
</div>
</div>
</div>
</form>
| bitwarden/web/src/app/accounts/update-password.component.html/0 | {
"file_path": "bitwarden/web/src/app/accounts/update-password.component.html",
"repo_id": "bitwarden",
"token_count": 1983
} | 153 |
<div *ngIf="loaded && activeOrganization != null" class="tw-flex">
<button
class="tw-flex tw-items-center tw-bg-background-alt tw-border-none"
type="button"
id="pickerButton"
[appA11yTitle]="'organizationPicker' | i18n"
[bitMenuTriggerFor]="orgPickerMenu"
>
<app-avatar
[data]="activeOrganization.name"
size="45"
[circle]="true"
[dynamic]="true"
></app-avatar>
<div class="tw-flex">
<div class="org-name tw-ml-3">
<span>{{ activeOrganization.name }}</span>
<small class="tw-text-muted">{{ "organization" | i18n }}</small>
</div>
<div class="tw-ml-3">
<i class="bwi bwi-angle-down tw-text-main" aria-hidden="true"></i>
</div>
</div>
</button>
<div>
<div
class="tw-ml-3 tw-border tw-border-solid tw-rounded tw-border-danger-500 tw-text-danger"
*ngIf="!activeOrganization.enabled"
>
<div class="tw-py-2 tw-px-5">
<i class="bwi bwi-exclamation-triangle" aria-hidden="true"></i>
{{ "organizationIsDisabled" | i18n }}
</div>
</div>
<div
class="tw-ml-3 tw-border tw-border-solid tw-rounded tw-border-info-500 tw-text-info"
*ngIf="activeOrganization.isProviderUser"
>
<div class="tw-py-2 tw-px-5">
<i class="bwi bwi-exclamation-triangle" aria-hidden="true"></i>
{{ "accessingUsingProvider" | i18n: activeOrganization.providerName }}
</div>
</div>
</div>
<bit-menu #orgPickerMenu>
<ul aria-labelledby="pickerButton" class="tw-p-0 tw-m-0">
<li *ngFor="let org of organizations" class="tw-list-none tw-flex tw-flex-col" role="none">
<a bitMenuItem [routerLink]="['/organizations', org.id]">
<i
class="bwi bwi-check mr-2"
[ngClass]="org.id === activeOrganization.id ? 'visible' : 'invisible'"
>
<span class="tw-sr-only">{{ "currentOrganization" | i18n }}</span>
</i>
{{ org.name }}
</a>
</li>
<bit-menu-divider></bit-menu-divider>
<li class="tw-list-none" role="none">
<a bitMenuItem routerLink="/create-organization">
<i class="bwi bwi-plus mr-2"></i>
{{ "newOrganization" | i18n }}</a
>
</li>
</ul>
</bit-menu>
</div>
| bitwarden/web/src/app/components/organization-switcher.component.html/0 | {
"file_path": "bitwarden/web/src/app/components/organization-switcher.component.html",
"repo_id": "bitwarden",
"token_count": 1099
} | 154 |
import { AfterContentInit, Component, Input } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { SsoComponent } from "jslib-angular/components/sso.component";
import { ApiService } from "jslib-common/abstractions/api.service";
import { AuthService } from "jslib-common/abstractions/auth.service";
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { LogService } from "jslib-common/abstractions/log.service";
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service";
import { Organization } from "jslib-common/models/domain/organization";
@Component({
selector: "app-link-sso",
templateUrl: "link-sso.component.html",
})
export class LinkSsoComponent extends SsoComponent implements AfterContentInit {
@Input() organization: Organization;
returnUri = "/settings/organizations";
constructor(
platformUtilsService: PlatformUtilsService,
i18nService: I18nService,
apiService: ApiService,
authService: AuthService,
router: Router,
route: ActivatedRoute,
cryptoFunctionService: CryptoFunctionService,
passwordGenerationService: PasswordGenerationService,
stateService: StateService,
environmentService: EnvironmentService,
logService: LogService
) {
super(
authService,
router,
i18nService,
route,
stateService,
platformUtilsService,
apiService,
cryptoFunctionService,
environmentService,
passwordGenerationService,
logService
);
this.returnUri = "/settings/organizations";
this.redirectUri = window.location.origin + "/sso-connector.html";
this.clientId = "web";
}
async ngAfterContentInit() {
this.identifier = this.organization.identifier;
}
}
| bitwarden/web/src/app/modules/vault-filter/components/link-sso.component.ts/0 | {
"file_path": "bitwarden/web/src/app/modules/vault-filter/components/link-sso.component.ts",
"repo_id": "bitwarden",
"token_count": 694
} | 155 |
import {
ChangeDetectorRef,
Component,
NgZone,
OnDestroy,
OnInit,
ViewChild,
ViewContainerRef,
} from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { first } from "rxjs/operators";
import { VaultFilter } from "jslib-angular/modules/vault-filter/models/vault-filter.model";
import { ModalService } from "jslib-angular/services/modal.service";
import { BroadcasterService } from "jslib-common/abstractions/broadcaster.service";
import { CipherService } from "jslib-common/abstractions/cipher.service";
import { CryptoService } from "jslib-common/abstractions/crypto.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { OrganizationService } from "jslib-common/abstractions/organization.service";
import { PasswordRepromptService } from "jslib-common/abstractions/passwordReprompt.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { StateService } from "jslib-common/abstractions/state.service";
import { SyncService } from "jslib-common/abstractions/sync.service";
import { TokenService } from "jslib-common/abstractions/token.service";
import { CipherType } from "jslib-common/enums/cipherType";
import { CipherView } from "jslib-common/models/view/cipherView";
import { UpdateKeyComponent } from "../../../../settings/update-key.component";
import { AddEditComponent } from "../../../../vault/add-edit.component";
import { AttachmentsComponent } from "../../../../vault/attachments.component";
import { CiphersComponent } from "../../../../vault/ciphers.component";
import { CollectionsComponent } from "../../../../vault/collections.component";
import { FolderAddEditComponent } from "../../../../vault/folder-add-edit.component";
import { ShareComponent } from "../../../../vault/share.component";
import { VaultFilterComponent } from "../../../vault-filter/vault-filter.component";
import { VaultService } from "../../vault.service";
const BroadcasterSubscriptionId = "VaultComponent";
@Component({
selector: "app-vault",
templateUrl: "individual-vault.component.html",
})
export class IndividualVaultComponent implements OnInit, OnDestroy {
@ViewChild("vaultFilter", { static: true }) filterComponent: VaultFilterComponent;
@ViewChild(CiphersComponent, { static: true }) ciphersComponent: CiphersComponent;
@ViewChild("attachments", { read: ViewContainerRef, static: true })
attachmentsModalRef: ViewContainerRef;
@ViewChild("folderAddEdit", { read: ViewContainerRef, static: true })
folderAddEditModalRef: ViewContainerRef;
@ViewChild("cipherAddEdit", { read: ViewContainerRef, static: true })
cipherAddEditModalRef: ViewContainerRef;
@ViewChild("share", { read: ViewContainerRef, static: true }) shareModalRef: ViewContainerRef;
@ViewChild("collections", { read: ViewContainerRef, static: true })
collectionsModalRef: ViewContainerRef;
@ViewChild("updateKeyTemplate", { read: ViewContainerRef, static: true })
updateKeyModalRef: ViewContainerRef;
favorites = false;
folderId: string = null;
collectionId: string = null;
organizationId: string = null;
myVaultOnly = false;
showVerifyEmail = false;
showBrowserOutdated = false;
showUpdateKey = false;
showPremiumCallout = false;
deleted = false;
trashCleanupWarning: string = null;
activeFilter: VaultFilter = new VaultFilter();
constructor(
private syncService: SyncService,
private route: ActivatedRoute,
private router: Router,
private changeDetectorRef: ChangeDetectorRef,
private i18nService: I18nService,
private modalService: ModalService,
private tokenService: TokenService,
private cryptoService: CryptoService,
private messagingService: MessagingService,
private platformUtilsService: PlatformUtilsService,
private broadcasterService: BroadcasterService,
private ngZone: NgZone,
private stateService: StateService,
private organizationService: OrganizationService,
private vaultService: VaultService,
private cipherService: CipherService,
private passwordRepromptService: PasswordRepromptService
) {}
async ngOnInit() {
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
this.showBrowserOutdated = window.navigator.userAgent.indexOf("MSIE") !== -1;
this.trashCleanupWarning = this.i18nService.t(
this.platformUtilsService.isSelfHost()
? "trashCleanupWarningSelfHosted"
: "trashCleanupWarning"
);
this.route.queryParams.pipe(first()).subscribe(async (params) => {
await this.syncService.fullSync(false);
const canAccessPremium = await this.stateService.getCanAccessPremium();
this.showPremiumCallout =
!this.showVerifyEmail && !canAccessPremium && !this.platformUtilsService.isSelfHost();
this.filterComponent.reloadCollectionsAndFolders(this.activeFilter);
this.filterComponent.reloadOrganizations();
this.showUpdateKey = !(await this.cryptoService.hasEncKey());
if (params.cipherId) {
const cipherView = new CipherView();
cipherView.id = params.cipherId;
if (params.action === "clone") {
await this.cloneCipher(cipherView);
} else if (params.action === "edit") {
await this.editCipher(cipherView);
}
}
await this.ciphersComponent.reload();
this.route.queryParams.subscribe(async (params) => {
if (params.cipherId) {
if ((await this.cipherService.get(params.cipherId)) != null) {
this.editCipherId(params.cipherId);
} else {
this.platformUtilsService.showToast(
"error",
this.i18nService.t("errorOccurred"),
this.i18nService.t("unknownCipher")
);
this.router.navigate([], {
queryParams: { cipherId: null },
queryParamsHandling: "merge",
});
}
}
});
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {
this.ngZone.run(async () => {
switch (message.command) {
case "syncCompleted":
if (message.successfully) {
await Promise.all([
this.filterComponent.reloadCollectionsAndFolders(this.activeFilter),
this.filterComponent.reloadOrganizations(),
this.ciphersComponent.load(this.ciphersComponent.filter),
]);
this.changeDetectorRef.detectChanges();
}
break;
}
});
});
});
}
get isShowingCards() {
return (
this.showBrowserOutdated ||
this.showPremiumCallout ||
this.showUpdateKey ||
this.showVerifyEmail
);
}
ngOnDestroy() {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
async applyVaultFilter(vaultFilter: VaultFilter) {
this.ciphersComponent.showAddNew = vaultFilter.status !== "trash";
this.activeFilter = vaultFilter;
await this.ciphersComponent.reload(this.buildFilter(), vaultFilter.status === "trash");
this.filterComponent.searchPlaceholder = this.vaultService.calculateSearchBarLocalizationString(
this.activeFilter
);
this.go();
}
async applyOrganizationFilter(orgId: string) {
if (orgId == null) {
this.activeFilter.resetOrganization();
this.activeFilter.myVaultOnly = true;
} else {
this.activeFilter.selectedOrganizationId = orgId;
}
await this.applyVaultFilter(this.activeFilter);
}
filterSearchText(searchText: string) {
this.ciphersComponent.searchText = searchText;
this.ciphersComponent.search(200);
}
private buildFilter(): (cipher: CipherView) => boolean {
return (cipher) => {
let cipherPassesFilter = true;
if (this.activeFilter.status === "favorites" && cipherPassesFilter) {
cipherPassesFilter = cipher.favorite;
}
if (this.activeFilter.status === "trash" && cipherPassesFilter) {
cipherPassesFilter = cipher.isDeleted;
}
if (this.activeFilter.cipherType != null && cipherPassesFilter) {
cipherPassesFilter = cipher.type === this.activeFilter.cipherType;
}
if (
this.activeFilter.selectedFolder &&
this.activeFilter.selectedFolderId != "none" &&
cipherPassesFilter
) {
cipherPassesFilter = cipher.folderId === this.activeFilter.selectedFolderId;
}
if (this.activeFilter.selectedCollectionId != null && cipherPassesFilter) {
cipherPassesFilter =
cipher.collectionIds != null &&
cipher.collectionIds.indexOf(this.activeFilter.selectedCollectionId) > -1;
}
if (this.activeFilter.selectedOrganizationId != null && cipherPassesFilter) {
cipherPassesFilter = cipher.organizationId === this.activeFilter.selectedOrganizationId;
}
if (this.activeFilter.myVaultOnly && cipherPassesFilter) {
cipherPassesFilter = cipher.organizationId === null;
}
return cipherPassesFilter;
};
}
async editCipherAttachments(cipher: CipherView) {
const canAccessPremium = await this.stateService.getCanAccessPremium();
if (cipher.organizationId == null && !canAccessPremium) {
this.messagingService.send("premiumRequired");
return;
} else if (cipher.organizationId != null) {
const org = await this.organizationService.get(cipher.organizationId);
if (org != null && (org.maxStorageGb == null || org.maxStorageGb === 0)) {
this.messagingService.send("upgradeOrganization", {
organizationId: cipher.organizationId,
});
return;
}
}
let madeAttachmentChanges = false;
const [modal] = await this.modalService.openViewRef(
AttachmentsComponent,
this.attachmentsModalRef,
(comp) => {
comp.cipherId = cipher.id;
comp.onUploadedAttachment.subscribe(() => (madeAttachmentChanges = true));
comp.onDeletedAttachment.subscribe(() => (madeAttachmentChanges = true));
comp.onReuploadedAttachment.subscribe(() => (madeAttachmentChanges = true));
}
);
modal.onClosed.subscribe(async () => {
if (madeAttachmentChanges) {
await this.ciphersComponent.refresh();
}
madeAttachmentChanges = false;
});
}
async shareCipher(cipher: CipherView) {
const [modal] = await this.modalService.openViewRef(
ShareComponent,
this.shareModalRef,
(comp) => {
comp.cipherId = cipher.id;
comp.onSharedCipher.subscribe(async () => {
modal.close();
await this.ciphersComponent.refresh();
});
}
);
}
async editCipherCollections(cipher: CipherView) {
const [modal] = await this.modalService.openViewRef(
CollectionsComponent,
this.collectionsModalRef,
(comp) => {
comp.cipherId = cipher.id;
comp.onSavedCollections.subscribe(async () => {
modal.close();
await this.ciphersComponent.refresh();
});
}
);
}
async addFolder() {
const [modal] = await this.modalService.openViewRef(
FolderAddEditComponent,
this.folderAddEditModalRef,
(comp) => {
comp.folderId = null;
comp.onSavedFolder.subscribe(async () => {
modal.close();
await this.filterComponent.reloadCollectionsAndFolders(this.activeFilter);
});
}
);
}
async editFolder(folderId: string) {
const [modal] = await this.modalService.openViewRef(
FolderAddEditComponent,
this.folderAddEditModalRef,
(comp) => {
comp.folderId = folderId;
comp.onSavedFolder.subscribe(async () => {
modal.close();
await this.filterComponent.reloadCollectionsAndFolders(this.activeFilter);
});
comp.onDeletedFolder.subscribe(async () => {
modal.close();
await this.filterComponent.reloadCollectionsAndFolders(this.activeFilter);
});
}
);
}
async addCipher() {
const component = await this.editCipher(null);
component.type = this.activeFilter.cipherType;
component.folderId = this.folderId === "none" ? null : this.folderId;
if (this.activeFilter.selectedCollectionId != null) {
const collection = this.filterComponent.collections.fullList.filter(
(c) => c.id === this.activeFilter.selectedCollectionId
);
if (collection.length > 0) {
component.organizationId = collection[0].organizationId;
component.collectionIds = [this.activeFilter.selectedCollectionId];
}
}
if (this.activeFilter.selectedFolderId && this.activeFilter.selectedFolder) {
component.folderId = this.activeFilter.selectedFolderId;
}
if (this.activeFilter.selectedOrganizationId) {
component.organizationId = this.activeFilter.selectedOrganizationId;
}
}
async editCipher(cipher: CipherView) {
return this.editCipherId(cipher?.id);
}
async editCipherId(id: string) {
const cipher = await this.cipherService.get(id);
if (cipher != null && cipher.reprompt != 0) {
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null });
return;
}
}
const [modal, childComponent] = await this.modalService.openViewRef(
AddEditComponent,
this.cipherAddEditModalRef,
(comp) => {
comp.cipherId = id;
comp.onSavedCipher.subscribe(async () => {
modal.close();
await this.ciphersComponent.refresh();
});
comp.onDeletedCipher.subscribe(async () => {
modal.close();
await this.ciphersComponent.refresh();
});
comp.onRestoredCipher.subscribe(async () => {
modal.close();
await this.ciphersComponent.refresh();
});
}
);
modal.onClosedPromise().then(() => {
this.go({ cipherId: null });
});
return childComponent;
}
async cloneCipher(cipher: CipherView) {
const component = await this.editCipher(cipher);
component.cloneMode = true;
}
async updateKey() {
await this.modalService.openViewRef(UpdateKeyComponent, this.updateKeyModalRef);
}
private go(queryParams: any = null) {
if (queryParams == null) {
queryParams = {
favorites: this.favorites ? true : null,
type: this.activeFilter.cipherType,
folderId: this.folderId,
collectionId: this.collectionId,
deleted: this.deleted ? true : null,
};
}
this.router.navigate([], {
relativeTo: this.route,
queryParams: queryParams,
queryParamsHandling: "merge",
replaceUrl: true,
});
}
}
| bitwarden/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts/0 | {
"file_path": "bitwarden/web/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts",
"repo_id": "bitwarden",
"token_count": 5683
} | 156 |
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="bulkTitle">
{{ "removeUsers" | i18n }}
</h2>
<button
type="button"
class="close"
data-dismiss="modal"
appA11yTitle="{{ 'close' | i18n }}"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<app-callout type="danger" *ngIf="users.length <= 0">
{{ "noSelectedUsersApplicable" | i18n }}
</app-callout>
<app-callout type="error" *ngIf="error">
{{ error }}
</app-callout>
<ng-container *ngIf="!done">
<app-callout type="warning" *ngIf="users.length > 0 && !error">
{{ "removeUsersWarning" | i18n }}
</app-callout>
<table class="table table-hover table-list">
<thead>
<tr>
<th colspan="2">{{ "user" | i18n }}</th>
</tr>
</thead>
<tr *ngFor="let user of users">
<td width="30">
<app-avatar
[data]="user | userName"
[email]="user.email"
size="25"
[circle]="true"
[fontSize]="14"
>
</app-avatar>
</td>
<td>
{{ user.email }}
<small class="text-muted d-block" *ngIf="user.name">{{ user.name }}</small>
</td>
</tr>
</table>
</ng-container>
<ng-container *ngIf="done">
<table class="table table-hover table-list">
<thead>
<tr>
<th colspan="2">{{ "user" | i18n }}</th>
<th>{{ "status" | i18n }}</th>
</tr>
</thead>
<tr *ngFor="let user of users">
<td width="30">
<app-avatar
[data]="user | userName"
[email]="user.email"
size="25"
[circle]="true"
[fontSize]="14"
>
</app-avatar>
</td>
<td>
{{ user.email }}
<small class="text-muted d-block" *ngIf="user.name">{{ user.name }}</small>
</td>
<td *ngIf="statuses.has(user.id)">
{{ statuses.get(user.id) }}
</td>
<td *ngIf="!statuses.has(user.id)">
{{ "bulkFilteredMessage" | i18n }}
</td>
</tr>
</table>
</ng-container>
</div>
<div class="modal-footer">
<button
type="submit"
class="btn btn-primary btn-submit"
*ngIf="!done && users.length > 0"
[disabled]="loading"
(click)="submit()"
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "removeUsers" | i18n }}</span>
</button>
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">
{{ "close" | i18n }}
</button>
</div>
</div>
</div>
</div>
| bitwarden/web/src/app/organizations/manage/bulk/bulk-remove.component.html/0 | {
"file_path": "bitwarden/web/src/app/organizations/manage/bulk/bulk-remove.component.html",
"repo_id": "bitwarden",
"token_count": 2026
} | 157 |
<div class="container page-content">
<div class="row">
<div class="col-3">
<div class="card" *ngIf="organization">
<div class="card-header">{{ "manage" | i18n }}</div>
<div class="list-group list-group-flush">
<a
routerLink="people"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canManageUsers"
>
{{ "people" | i18n }}
</a>
<a
routerLink="collections"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canViewAllCollections || organization.canViewAssignedCollections"
>
{{ "collections" | i18n }}
</a>
<a
routerLink="groups"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canManageGroups && accessGroups"
>
{{ "groups" | i18n }}
</a>
<a
routerLink="policies"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canManagePolicies && accessPolicies"
>
{{ "policies" | i18n }}
</a>
<a
routerLink="sso"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canManageSso && accessSso"
>
{{ "singleSignOn" | i18n }}
</a>
<a
routerLink="events"
class="list-group-item"
routerLinkActive="active"
*ngIf="organization.canAccessEventLogs && accessEvents"
>
{{ "eventLogs" | i18n }}
</a>
</div>
</div>
</div>
<div class="col-9">
<router-outlet></router-outlet>
</div>
</div>
</div>
| bitwarden/web/src/app/organizations/manage/manage.component.html/0 | {
"file_path": "bitwarden/web/src/app/organizations/manage/manage.component.html",
"repo_id": "bitwarden",
"token_count": 1031
} | 158 |
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { AuthGuard } from "jslib-angular/guards/auth.guard";
import { Permissions } from "jslib-common/enums/permissions";
import { PermissionsGuard } from "./guards/permissions.guard";
import { OrganizationLayoutComponent } from "./layouts/organization-layout.component";
import { CollectionsComponent } from "./manage/collections.component";
import { EventsComponent } from "./manage/events.component";
import { GroupsComponent } from "./manage/groups.component";
import { ManageComponent } from "./manage/manage.component";
import { PeopleComponent } from "./manage/people.component";
import { PoliciesComponent } from "./manage/policies.component";
import { NavigationPermissionsService } from "./services/navigation-permissions.service";
import { AccountComponent } from "./settings/account.component";
import { OrganizationBillingComponent } from "./settings/organization-billing.component";
import { OrganizationSubscriptionComponent } from "./settings/organization-subscription.component";
import { SettingsComponent } from "./settings/settings.component";
import { TwoFactorSetupComponent } from "./settings/two-factor-setup.component";
import { ExportComponent } from "./tools/export.component";
import { ExposedPasswordsReportComponent } from "./tools/exposed-passwords-report.component";
import { ImportComponent } from "./tools/import.component";
import { InactiveTwoFactorReportComponent } from "./tools/inactive-two-factor-report.component";
import { ReusedPasswordsReportComponent } from "./tools/reused-passwords-report.component";
import { ToolsComponent } from "./tools/tools.component";
import { UnsecuredWebsitesReportComponent } from "./tools/unsecured-websites-report.component";
import { WeakPasswordsReportComponent } from "./tools/weak-passwords-report.component";
const routes: Routes = [
{
path: ":organizationId",
component: OrganizationLayoutComponent,
canActivate: [AuthGuard, PermissionsGuard],
data: {
permissions: NavigationPermissionsService.getPermissions("admin"),
},
children: [
{ path: "", pathMatch: "full", redirectTo: "vault" },
{
path: "vault",
loadChildren: async () =>
(await import("../modules/vault/modules/organization-vault/organization-vault.module"))
.OrganizationVaultModule,
},
{
path: "tools",
component: ToolsComponent,
canActivate: [PermissionsGuard],
data: { permissions: NavigationPermissionsService.getPermissions("tools") },
children: [
{
path: "",
pathMatch: "full",
redirectTo: "import",
},
{
path: "import",
component: ImportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "importData",
permissions: [Permissions.AccessImportExport],
},
},
{
path: "export",
component: ExportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "exportVault",
permissions: [Permissions.AccessImportExport],
},
},
{
path: "exposed-passwords-report",
component: ExposedPasswordsReportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "exposedPasswordsReport",
permissions: [Permissions.AccessReports],
},
},
{
path: "inactive-two-factor-report",
component: InactiveTwoFactorReportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "inactive2faReport",
permissions: [Permissions.AccessReports],
},
},
{
path: "reused-passwords-report",
component: ReusedPasswordsReportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "reusedPasswordsReport",
permissions: [Permissions.AccessReports],
},
},
{
path: "unsecured-websites-report",
component: UnsecuredWebsitesReportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "unsecuredWebsitesReport",
permissions: [Permissions.AccessReports],
},
},
{
path: "weak-passwords-report",
component: WeakPasswordsReportComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "weakPasswordsReport",
permissions: [Permissions.AccessReports],
},
},
],
},
{
path: "manage",
component: ManageComponent,
canActivate: [PermissionsGuard],
data: {
permissions: NavigationPermissionsService.getPermissions("manage"),
},
children: [
{
path: "",
pathMatch: "full",
redirectTo: "people",
},
{
path: "collections",
component: CollectionsComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "collections",
permissions: [
Permissions.CreateNewCollections,
Permissions.EditAnyCollection,
Permissions.DeleteAnyCollection,
Permissions.EditAssignedCollections,
Permissions.DeleteAssignedCollections,
],
},
},
{
path: "events",
component: EventsComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "eventLogs",
permissions: [Permissions.AccessEventLogs],
},
},
{
path: "groups",
component: GroupsComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "groups",
permissions: [Permissions.ManageGroups],
},
},
{
path: "people",
component: PeopleComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "people",
permissions: [Permissions.ManageUsers, Permissions.ManageUsersPassword],
},
},
{
path: "policies",
component: PoliciesComponent,
canActivate: [PermissionsGuard],
data: {
titleId: "policies",
permissions: [Permissions.ManagePolicies],
},
},
],
},
{
path: "settings",
component: SettingsComponent,
canActivate: [PermissionsGuard],
data: { permissions: NavigationPermissionsService.getPermissions("settings") },
children: [
{ path: "", pathMatch: "full", redirectTo: "account" },
{ path: "account", component: AccountComponent, data: { titleId: "myOrganization" } },
{
path: "two-factor",
component: TwoFactorSetupComponent,
data: { titleId: "twoStepLogin" },
},
{
path: "billing",
component: OrganizationBillingComponent,
canActivate: [PermissionsGuard],
data: { titleId: "billing", permissions: [Permissions.ManageBilling] },
},
{
path: "subscription",
component: OrganizationSubscriptionComponent,
data: { titleId: "subscription" },
},
],
},
],
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class OrganizationsRoutingModule {}
| bitwarden/web/src/app/organizations/organization-routing.module.ts/0 | {
"file_path": "bitwarden/web/src/app/organizations/organization-routing.module.ts",
"repo_id": "bitwarden",
"token_count": 3584
} | 159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.