Commit Graph

12118 Commits

Author SHA1 Message Date
Robin Ward 34e5f807ec DEV: User UPPER_CASE for constants 2020-05-08 15:50:55 -04:00
Mark VanLandingham da561a430d
DEV: Add data-name to popular-theme-item rows (#9714) 2020-05-08 14:38:41 -05:00
Joffrey JAFFEUX 5bac2828ee
DEV: 25ms was too short and causing test failures (#9712) 2020-05-08 21:10:52 +02:00
Robin Ward 7f373e8b93 DEV: Don't use `js.erb` for constants
Adds a new rake task to auto generate a constants.js file with the
constants present. This makes migrating to Ember CLI easier, but also
slightly speeds up asset compilation by having to do less work.

If the constants change you need to run:
`rake javascripts:update_constants`
2020-05-08 14:14:01 -04:00
Joffrey JAFFEUX 350fe932ca
DEV: removes setTimeout and reduces timer in tests (#9701) 2020-05-08 16:46:24 +02:00
Joffrey JAFFEUX 646bee2efe
DEV: removes a setTimeout and ensure shorcut is not propagated (#9702) 2020-05-08 16:46:13 +02:00
Joffrey JAFFEUX 8d3900c6da
DEV: gear icon is deprecated in favor of cog (#9704) 2020-05-08 10:35:29 +02:00
Joffrey JAFFEUX 00a038d646
REFACTOR: removes various assignments and superfluous params (#9699) 2020-05-08 09:19:48 +02:00
Joffrey JAFFEUX 9d172eeaa5
REFACTOR: removes implicit operand conversion (#9700) 2020-05-08 09:19:36 +02:00
Robin Ward ef94b0f1a7 FIX: Incorrect CSS class 2020-05-07 16:29:09 -04:00
Robin Ward f9608c0af5 DEV: Remove INLINE_ONEBOX_* constants
There were two constants here, `INLINE_ONEBOX_LOADING_CSS_CLASS` and
`INLINE_ONEBOX_CSS_CLASS` that were both longer than the strings they
were DRYing up: `inline-onebox-loading` and `inline-onebox`

I normally appreciate constants, but in this case it meant that we had
a lot of JS imports resulting in many more lines of code (and CPU cycles
spent figuring them out.)

It also meant we had an `.erb` file and had to invoke Ruby to create the
JS file, which meant the app was harder to port to Ember CLI.

I removed the constants. It's less DRY but faster and simpler, and
arguably the loss of DRYness is not significant as you can still search
for the `inline-onebox-loading` and `inline-onebox` strings easily if
you are refactoring.
2020-05-07 16:14:38 -04:00
Robin Ward 3567a90661 DEV: Ember Addon needs a vendor dir 2020-05-07 15:45:35 -04:00
Joffrey JAFFEUX 788e305469
FIX: parenthesis were wrong, resulting in an always true expression (#9690) 2020-05-07 19:56:35 +02:00
Robin Ward 79c64eaeff
DEV: Move pretty-text into an ember-addon format (#9689) 2020-05-07 12:37:47 -04:00
Joffrey JAFFEUX 3cd412ae02
REFACTOR: removes useless variable assignment (#9666) 2020-05-07 16:41:26 +02:00
Joffrey JAFFEUX 1dd9df9cd0
REFACTOR: removes overwritten properties and duplicates fn (#9686) 2020-05-07 16:39:53 +02:00
Joffrey JAFFEUX 265baa40c6
REFACTOR: useless conditional as 'data' always evaluates to true (#9685) 2020-05-07 16:38:38 +02:00
Joffrey JAFFEUX 99c3ce03cb
REFACTOR: removes superfluous argument (#9684)
hideTooltip doesnt accept any argument
2020-05-07 16:38:23 +02:00
Joffrey JAFFEUX 206d45fd96
REFACTOR: removes superfluous argument (#9683) 2020-05-07 16:38:09 +02:00
Joffrey JAFFEUX 9846c43d93
REFACTOR: removes use of undeclared variable (#9682) 2020-05-07 16:37:56 +02:00
Joffrey JAFFEUX af78d188b8
REFACTOR: removes useless self assignment (#9681) 2020-05-07 16:37:20 +02:00
Joffrey JAFFEUX 8be0ba3aa4
REFACTOR: function was incorrectly called as a constructor (#9679) 2020-05-07 16:36:29 +02:00
Joffrey JAFFEUX e74170cd9e
REFACTOR: Superfluous arguments passed to function resolveSize (#9678)
resolveSize accepts only one param
2020-05-07 16:36:15 +02:00
Joffrey JAFFEUX affc79bb68
REFACTOR: removes useless assignment to local variable (#9676) 2020-05-07 16:35:54 +02:00
Joffrey JAFFEUX 08e8ae82cc
REFACTOR: removes useless conditional (#9677) 2020-05-07 16:34:49 +02:00
Joffrey JAFFEUX a078b086ba
REFACToR: removes useless assignment to local variable (#9675) 2020-05-07 16:34:36 +02:00
Joffrey JAFFEUX a04b226c2b
REFACTOR: removes useless conditional (#9674)
We already check if there's a post in the line before.
2020-05-07 16:34:25 +02:00
Joffrey JAFFEUX d5fe1279bd
REFACTOR: value assigned to precision here is unused (#9673) 2020-05-07 16:34:14 +02:00
Joffrey JAFFEUX a2109bd9b2
REFACTOR: value assigned to cp here is unused. (#9672) 2020-05-07 16:30:51 +02:00
Joffrey JAFFEUX 930989d462
REFACTOR: variable '_postSnapshot' always evaluates to true (#9671) 2020-05-07 16:28:28 +02:00
Joffrey JAFFEUX d020e70643
REFACTOR: removes unreachable return statement (#9670) 2020-05-07 16:27:53 +02:00
Joffrey JAFFEUX 48375db848
REFACTOR: removes superfluous argument passed to findWidget (#9669)
findWidget accepts only one argument
2020-05-07 16:27:15 +02:00
Joffrey JAFFEUX 5a201082c7
REFACTOR: removes useless conditional (#9667)
This use of variable 'content' always evaluates to true.
2020-05-07 16:25:44 +02:00
Joffrey JAFFEUX 864f48b2e6
REFACTOR: removes useless conditional (#9668)
Given we will return true on the line before if inlineEmoji, this will always be false.
2020-05-07 16:25:23 +02:00
Joffrey JAFFEUX 01272f2085
REFACTOR: removes unreachable code (#9665)
* REFACTOR: removes unreachable code

* this one too
2020-05-07 16:24:54 +02:00
Joffrey JAFFEUX ac4251fc9d
REFACTOR: publishedPage property was duplicated (#9664) 2020-05-07 16:24:35 +02:00
Joffrey JAFFEUX 87b1d435d2
FIX: improves positioning of sk in mobile when inside a modal (#9657) 2020-05-07 09:10:29 +02:00
Martin Brennan be48e503fd
FIX: Show the Bookmark button for PM topics (#9659)
There is no point in suppressing this now that we have bookmark reminders.
2020-05-07 14:30:10 +10:00
Martin Brennan 6fb0f36ce1
FEATURE: Optionally delete bookmark when reminder sent (#9637)
We now show an options gear icon next to the bookmark name.

When expanded we show the "delete bookmark when reminder sent" option. The value of this checkbox is saved in local storage for the user.

If this is ticked, when a reminder is sent for the bookmark the bookmark itself is deleted. This is so people can use the reminder functionality by itself.

Also remove the blue alert reminder section from the "Edit Bookmark" modal as it just added clutter, because the user can already see they had a reminder set:

Adds a default false boolean column `delete_when_reminder_sent` to bookmarks.
2020-05-07 13:37:39 +10:00
Penar Musaraj f782c3019c FIX: Improve topic timeline calculation logic
Followup to 999e2ff5

Switching between the topic timeline and the progress bar was buggy when
resizing the composer. The root of the problem is that we can't know
the height of the timeline once it's hidden from view.

This uses a magic number for the calucation, which in this case is
necessary. Additionally, the calculation now takes place when
the resizing of the composer ends (previously, it was triggered when
dragging was started, which caused issues when resizing slowly).
2020-05-06 21:48:22 -04:00
Kris 6e2060e973 Remove extra category whitespace on category+latest/top pages 2020-05-06 21:19:46 -04:00
Robin Ward 01929e3505 DEV: Move `preload-store` to `discourse/lib/preload-store`
It's only used inside Discourse so it needn't be its own module
2020-05-06 15:28:06 -04:00
Joffrey JAFFEUX c99ecba68f
DEV: improves sk api (#9653)
- reduces the API to 3 actions for now: appendContent/prependContent/onChange
- well tested
- removes all previous APIS which were only half supported or too dangerous as they could collide with other plugins or core behaviors
- this plugins also puts every sk test helpers in one file
2020-05-06 17:16:20 +02:00
Robin Ward 7c2d3275f4 DEV: Remove `Discourse` constants from focus mixin.
Also removes the mixin which was only used in `app/app`
2020-05-06 10:36:08 -04:00
Robin Ward eda2d184d6 Backwards compatibility for raw-templates lib 2020-05-06 09:14:19 -04:00
Martin Brennan fa572d3a7a
DEV: Remove all code referencing at_desktop bookmark reminders (#9650)
We have found no need for these reminder types, so we are removing the code for them.
2020-05-06 15:22:43 +10:00
Guo Xiang Tan b299f5f491 DEV: Use Ember.Service over manually registering a factory.
Follow up to 9e827eb420
2020-05-06 09:24:49 +08:00
Kris 0a766b594e add class for topic-list dismiss button container 2020-05-05 19:50:00 -04:00
Kane York e7443ab5da
FIX: Preserve code blocks when quoting (#9632)
But, produce a non-block quote if a single code line is quoted.
2020-05-05 12:12:22 -07:00
Robin Ward e1d64cf896 DEV: Have `app/app` export a class not an instance.
The app boot should call `create()`
2020-05-05 14:54:13 -04:00