Commit 9313ea1e25179b299f9cb6236b02af7c73861aad
Merge branch 'master' into theme-picker-dark
Matt McKegg committed on 9/16/2017, 2:43:05 AMParent: 2dee2554f4144c95c5ddec92074b224296f476ef
Parent: 771e0f5dd80b0edb43f9e4e9a03ea5f30656dae4
Files changed
main-window.js | changed |
modules/feed/html/rollup.js | changed |
modules/message/html/compose.js | changed |
package.json | changed |
styles/light/compose.mcss | changed |
main-window.js | ||
---|---|---|
@@ -72,9 +72,10 @@ | ||
72 | 72 | Array.from(document.head.children) |
73 | 73 | .filter(c => c.tagName == 'STYLE') |
74 | 74 | .forEach(c => c.innerText = '') |
75 | 75 | |
76 | - const theme = require('./styles')[name] | |
76 | + var theme = require('./styles')[name] | |
77 | + if (!theme) theme = require('./styles')['light'] | |
77 | 78 | insertCss(theme) |
78 | 79 | }) |
79 | 80 | |
80 | 81 | var container = h(`MainWindow -${process.platform}`, [ |
modules/feed/html/rollup.js | ||
---|---|---|
@@ -97,9 +97,9 @@ | ||
97 | 97 | |
98 | 98 | if (updates() === 0 && msg.value.author === yourId && container.scrollTop < 20) { |
99 | 99 | refresh() |
100 | 100 | } else { |
101 | - updates.set(updates() + 1) | |
101 | + updates.set(newSinceRefresh.size) | |
102 | 102 | } |
103 | 103 | }) |
104 | 104 | ) |
105 | 105 | }) |
@@ -179,9 +179,13 @@ | ||
179 | 179 | previousId = msg.key |
180 | 180 | return result |
181 | 181 | }) |
182 | 182 | |
183 | - var renderedMessage = api.message.html.render(item, {inContext: true}) | |
183 | + var renderedMessage = api.message.html.render(item, { | |
184 | + inContext: true, | |
185 | + priority: highlightItems.has(item.key) ? 2 : 0 | |
186 | + }) | |
187 | + | |
184 | 188 | if (!renderedMessage) return h('div') |
185 | 189 | if (lastBumpType) { |
186 | 190 | var bumps = lastBumpType === 'vote' |
187 | 191 | ? getLikeAuthors(groupedBumps[lastBumpType]) |
modules/message/html/compose.js | ||
---|---|---|
@@ -52,9 +52,28 @@ | ||
52 | 52 | disabled: publishing, |
53 | 53 | placeholder |
54 | 54 | }) |
55 | 55 | |
56 | + var warningMessage = Value(null) | |
57 | + var warning = h('section.warning', | |
58 | + { className: when(warningMessage, '-open', '-closed') }, | |
59 | + [ | |
60 | + h('div.warning', warningMessage), | |
61 | + h('div.close', { 'ev-click': () => warningMessage.set(null) }, 'x') | |
62 | + ] | |
63 | + ) | |
56 | 64 | var fileInput = api.blob.html.input(file => { |
65 | + const megabytes = file.size / 1024 / 1024 | |
66 | + if (megabytes >= 5) { | |
67 | + const rounded = Math.floor(megabytes*100)/100 | |
68 | + warningMessage.set([ | |
69 | + h('i.fa.fa-exclamation-triangle'), | |
70 | + h('strong', file.name), | |
71 | + ` is ${rounded}MB - the current limit is 5MB` | |
72 | + ]) | |
73 | + return | |
74 | + } | |
75 | + | |
57 | 76 | files.push(file) |
58 | 77 | filesById[file.link] = file |
59 | 78 | |
60 | 79 | var embed = file.type.indexOf('image/') === 0 ? '!' : '' |
@@ -89,8 +108,9 @@ | ||
89 | 108 | when(expanded, '-expanded', '-contracted') |
90 | 109 | ] |
91 | 110 | }, [ |
92 | 111 | textArea, |
112 | + warning, | |
93 | 113 | actions |
94 | 114 | ]) |
95 | 115 | |
96 | 116 | addSuggest(textArea, (inputText, cb) => { |
package.json | ||
---|---|---|
@@ -29,9 +29,9 @@ | ||
29 | 29 | "hashlru": "^2.2.0", |
30 | 30 | "insert-css": "~2.0.0", |
31 | 31 | "level": "~1.7.0", |
32 | 32 | "lrucache": "^1.0.2", |
33 | - "micro-css": "^2.0.0", | |
33 | + "micro-css": "^2.0.1", | |
34 | 34 | "mime-types": "^2.1.15", |
35 | 35 | "moment": "^2.18.1", |
36 | 36 | "mutant": "^3.21.2", |
37 | 37 | "mutant-pull-reduce": "^1.1.0", |
@@ -70,7 +70,7 @@ | ||
70 | 70 | "suggest-box": "^2.2.3", |
71 | 71 | "text-node-searcher": "^1.1.1" |
72 | 72 | }, |
73 | 73 | "devDependencies": { |
74 | - "electron": "~1.6.11" | |
74 | + "electron": "~1.7.6" | |
75 | 75 | } |
76 | 76 | } |
styles/light/compose.mcss | ||
---|---|---|
@@ -20,8 +20,35 @@ | ||
20 | 20 | background: #ebf7ee; |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | + section.warning { | |
25 | + color: #fff | |
26 | + font-size: 1.2rem | |
27 | + background-color: #ff00b6 | |
28 | + | |
29 | + height: 0 | |
30 | + padding: 0 .5rem | |
31 | + transition: all ease-in .1s | |
32 | + | |
33 | + display: flex | |
34 | + justify-content: space-between | |
35 | + | |
36 | + | |
37 | + -open { | |
38 | + padding: .5rem | |
39 | + height: initial | |
40 | + } | |
41 | + | |
42 | + i.fa { margin-right: .5rem } | |
43 | + div.warning { | |
44 | + strong { margin-right: .3rem } | |
45 | + } | |
46 | + div.close { | |
47 | + cursor: pointer | |
48 | + } | |
49 | + } | |
50 | + | |
24 | 51 | section.actions { |
25 | 52 | display: flex |
26 | 53 | flex-direction: row |
27 | 54 | align-items: baseline |
Built with git-ssb-web