-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Articles reactions #539
base: master
Are you sure you want to change the base?
Articles reactions #539
Changes from 3 commits
a163695
474b98d
ed8570d
c8c24db
63eefe3
13a2f09
383deab
5f6d3f3
103483c
a42aed9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,9 @@ | |
<?= View::factory('templates/quizzes/quiz', array('quizData' => $quiz->quiz_data)); ?> | ||
<? endif ?> | ||
|
||
<div class='reactions-page_voting'></div> | ||
|
||
|
||
<?= View::factory('templates/blocks/share', array('share' => array( | ||
'offer' => 'Если вам понравилась статья, поделитесь ссылкой на нее', | ||
'url' => 'https://' . Arr::get($_SERVER, 'HTTP_HOST', Arr::get($_SERVER, 'SERVER_NAME', 'codex.so')) . '/' . $article->uri ?: 'article/' . $article->id, | ||
|
@@ -208,4 +211,11 @@ | |
->set('course', $course) | ||
?> | ||
<? endif; ?> | ||
</div> | ||
</div> | ||
|
||
|
||
<script type="text/javascript" src="/public/build/codex.bundle.js"></script> | ||
<script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Мы решили отказаться от использования инлайновых скриптов. Создай модуль с методом init и вызови его через |
||
const parent = document.querySelector('.reactions-page_voting'); | ||
let reactionsModule = new codex.reaction({parent: parent, title: '', reactions: ['👍', '❤', '👎']}); | ||
</script> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,5 +59,8 @@ | |
"stylelint-webpack-plugin": "^0.10.5", | ||
"webpack": "^4.21.0", | ||
"webpack-cli": "^3.1.2" | ||
}, | ||
"dependencies": { | ||
"@codexteam/reactions": "^1.0.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Почему dependencies, a не devDependencies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Потому что этот модуль нужен не во время разработки, а во время продакшена |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ codex.vkWidget = require('./modules/vkWidget'); | |
codex.codeStyling = require('./modules/codeStyling'); | ||
codex.deeplinker = require('@codexteam/deeplinker'); | ||
codex.pluginsFilter = require('./modules/pluginsFilter'); | ||
codex.reaction = require('@codexteam/reactions'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Может, лучше codex.reactions? |
||
|
||
import EditorLanding from './modules/editorLanding'; | ||
codex.editorLanding = new EditorLanding(); | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Используй класс с префиксом
js_