0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-27 18:13:08 +00:00

Compare commits

..

8 Commits

Author SHA1 Message Date
G.Ambatte
2bd06250fc Add @import folding 2024-07-20 14:50:39 +12:00
David Bolack
c82b62f953 Add Code folding on CSS style tab 2024-07-19 16:03:44 -05:00
Trevor Buckner
4fe38e3929 Merge pull request #3567 from G-Ambatte/fixUglyDropCap-#3551
Add additional styles to SolberaImitationRemake font declaration
2024-07-11 09:47:26 -04:00
Trevor Buckner
b6d69173cd Merge branch 'master' into fixUglyDropCap-#3551 2024-07-11 09:46:45 -04:00
Trevor Buckner
8b085e1806 Merge pull request #3569 from G-Ambatte/fixBrewItemLinkUnderlining-#3568
Unset text-decoration on Brew Item links
2024-07-11 09:46:36 -04:00
G.Ambatte
cb9d24d5b4 Remove text-decoration from Brew Item links 2024-07-11 20:03:17 +12:00
G.Ambatte
23fd70e3c3 Add additional style to existing SolberaImitation 2024-07-11 18:10:26 +12:00
Trevor Buckner
5b02132e57 Merge pull request #3561 from naturalcrit/v3.13.1
Up Version to 3.13.1
2024-07-06 18:20:34 -04:00
6 changed files with 59 additions and 10 deletions

View File

@@ -367,7 +367,7 @@ const Editor = createClass({
view={this.state.view} view={this.state.view}
value={this.props.brew.style ?? DEFAULT_STYLE_TEXT} value={this.props.brew.style ?? DEFAULT_STYLE_TEXT}
onChange={this.props.onStyleChange} onChange={this.props.onStyleChange}
enableFolding={false} enableFolding={true}
editorTheme={this.state.editorTheme} editorTheme={this.state.editorTheme}
rerenderParent={this.rerenderParent} /> rerenderParent={this.rerenderParent} />
</>; </>;

View File

@@ -124,6 +124,7 @@
opacity : 0.6; opacity : 0.6;
font-size : 1.3em; font-size : 1.3em;
color : white; color : white;
text-decoration : unset;
&:hover{ &:hover{
opacity : 1; opacity : 1;
} }

View File

@@ -39,8 +39,10 @@ if(typeof window !== 'undefined'){
//Autocompletion //Autocompletion
require('codemirror/addon/hint/show-hint.js'); require('codemirror/addon/hint/show-hint.js');
const foldCode = require('./fold-code'); const foldPagesCode = require('./fold-pages');
foldCode.registerHomebreweryHelper(CodeMirror); foldPagesCode.registerHomebreweryHelper(CodeMirror);
const foldCSSCode = require('./fold-css');
foldCSSCode.registerHomebreweryHelper(CodeMirror);
} }
const CodeEditor = createClass({ const CodeEditor = createClass({
@@ -411,7 +413,7 @@ const CodeEditor = createClass({
foldOptions : function(cm){ foldOptions : function(cm){
return { return {
scanUp : true, scanUp : true,
rangeFinder : CodeMirror.fold.homebrewery, rangeFinder : this.props.language === 'css' ? CodeMirror.fold.homebrewerycss : CodeMirror.fold.homebrewery,
widget : (from, to)=>{ widget : (from, to)=>{
let text = ''; let text = '';
let currentLine = from.line; let currentLine = from.line;
@@ -450,3 +452,4 @@ const CodeEditor = createClass({
}); });
module.exports = CodeEditor; module.exports = CodeEditor;

View File

@@ -0,0 +1,44 @@
module.exports = {
registerHomebreweryHelper : function(CodeMirror) {
CodeMirror.registerHelper('fold', 'homebrewerycss', function(cm, start) {
// BRACE FOLDING
const startMatcher = /\{[ \t]*$/;
const endMatcher = /\}[ \t]*$/;
const prevLine = cm.getLine(start.line);
if(prevLine.match(startMatcher)) {
const lastLineNo = cm.lastLine();
let end = start.line + 1;
let braceCount = 1;
while (end < lastLineNo) {
const curLine = cm.getLine(end);
if(curLine.match(startMatcher)) braceCount++;
if(curLine.match(endMatcher)) braceCount--;
if(braceCount == 0) break;
++end;
}
return {
from : CodeMirror.Pos(start.line, 0),
to : CodeMirror.Pos(end, cm.getLine(end).length)
};
}
// IMPORT FOLDING
const importMatcher = /^@import.*?[;]/;
if(prevLine.match(importMatcher)) {
return {
from : CodeMirror.Pos(start.line, 0),
to : CodeMirror.Pos(start.line, cm.getLine(start.line).length)
};
}
return null;
});
}
};

View File

@@ -74,8 +74,9 @@
@font-face { @font-face {
font-family: SolberaImitationRemake; //Tweaked 5e version font-family: SolberaImitationRemake; //Tweaked 5e version
src: url('../../../fonts/5e/Solbera Imitation Tweak.woff2'); src: url('../../../fonts/5e/Solbera Imitation Tweak.woff2');
font-weight: normal; font-weight: 100 1000;
font-style: normal; font-style: normal;
font-style: italic;
} }
/* Cover Page */ /* Cover Page */