-
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 5 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,14 @@ | |
<?= View::factory('templates/quizzes/quiz', array('quizData' => $quiz->quiz_data)); ?> | ||
<? endif ?> | ||
|
||
<div class='js_reactions-page_voting' data-module="reactionsCreate"> | ||
<textarea name="module-settings" hidden> | ||
{ | ||
"parent" : ".js_reactions-page_voting" | ||
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. Давай в настройки передавать просто класс, без точки. Точку для querySelector можно дописать прямо в js-модуле |
||
} | ||
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. эмоции можно тоже тут задавать, а не в модуле |
||
</textarea> | ||
</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 +216,7 @@ | |
->set('course', $course) | ||
?> | ||
<? endif; ?> | ||
</div> | ||
</div> | ||
|
||
|
||
<script type="text/javascript" src="/public/build/codex.bundle.js"></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. зачем? этот бандл и так подключается в главном шаблоне всех страниц |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,12 +128,16 @@ codex.vkWidget = require('./modules/vkWidget'); | |
codex.codeStyling = require('./modules/codeStyling'); | ||
codex.deeplinker = require('@codexteam/deeplinker'); | ||
codex.pluginsFilter = require('./modules/pluginsFilter'); | ||
codex.reactions = 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. Не нужно реквайрить пакет в общую сборку. Лучше сделай это в модуле |
||
|
||
import EditorLanding from './modules/editorLanding'; | ||
codex.editorLanding = new EditorLanding(); | ||
|
||
import ArticleCreate from './modules/articleCreate'; | ||
codex.articleCreate = new ArticleCreate(); | ||
|
||
import Reactions from './modules/reactions'; | ||
codex.reactionsCreate = new 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 |
||
|
||
module.exports = codex; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
/** | ||
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. Звездочки не выровнены. Поправь, плиз |
||
* Module for reactions init | ||
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. Не очень понятный коммент. Можешь емко описать, что эта за класс и где он используется? |
||
*/ | ||
|
||
export default class Reactions { | ||
|
||
/** | ||
* Initialize reactions on pages | ||
* @param {Object} settings - reactions parameters | ||
* @param {String} settings.parent - container's selector for reactions module | ||
*/ | ||
init(settings) { | ||
|
||
let parentElement = document.querySelector(settings.parent), | ||
reactionsModule = new codex.reactions({parent: parentElement, title: '', reactions: ['👍', '❤', '👎']}); | ||
}; | ||
}; |
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.
Придерусь к неодинаковым (одинарным|двойным) кавычкам