Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move JavaScript to separate file #8205

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

Merged
merged 2 commits into from
Jan 10, 2018
Merged

Move JavaScript to separate file #8205

merged 2 commits into from
Jan 10, 2018

Conversation

technetium
Copy link
Contributor

By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.

By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.
@javiereguiluz javiereguiluz changed the title Move JavaScript to seperate file Move JavaScript to separate file Jul 24, 2017
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good idea, thanks!

@@ -158,6 +158,7 @@ things are even easier because the ``data-prototype`` attribute is rendered
automatically for you (with a slight difference - see note below) and all
you need is the JavaScript:


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be reverted.

e.preventDefault();
var list = jQuery(jQuery(this).attr('data-list'));
// Try to find the counter of the list
var counter = list.data('widget-counter');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var counter = list.data('widget-counter') | list.children().length;

@HeahDude HeahDude added this to the 2.7 milestone Jul 29, 2017
@technetium technetium changed the base branch from 2.7 to 2.8 August 11, 2017 08:35
@technetium
Copy link
Contributor Author

Let's see if it's help if I try to merge to 2.8
The link for platform.sh still goes to a 404 page:
No route found for pr-8205-mqerhba-6qmocelev2lwe.eu.platform.sh

@wouterj
Copy link
Member

wouterj commented Sep 3, 2017

I think we shouldn't be using a configuration block here, but instead show the JS file in a seperate code block. I think it's important that the JS code is visible on the screen at first sight.

@javiereguiluz
Copy link
Member

@technetium thanks for improving this code and congrats on your first Symfony Docs contribution!

@javiereguiluz javiereguiluz merged commit 98b1c7b into symfony:2.8 Jan 10, 2018
javiereguiluz added a commit that referenced this pull request Jan 10, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

Move JavaScript to separate file

By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.

Commits
-------

98b1c7b Minor tweaks
5594d7e Move JavaScript to seperate file
xabbuh pushed a commit that referenced this pull request Jan 10, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

Move JavaScript to separate file

By creating a more general JavaScript code and putting it in a separate file, it can be used for all collections. This makes the code more DRY.

Commits
-------

98b1c7b Minor tweaks
5594d7e Move JavaScript to seperate file
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 2.7:
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [error_pages] Removing misleading  checker in code example
  Remove section about forms using validation
  Removed extra class
  Renamed TestedTypeTests to TestedTypeTest
  Add docs about the validator TypeTestCase class
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 2.8:
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [error_pages] Removing misleading  checker in code example
  add default option value for collection type
  minor symfony#8831 Update collection.rst (babaorum)
  Move JavaScript to seperate file
  Remove section about forms using validation
  Removed extra class
  Renamed TestedTypeTests to TestedTypeTest
  Add docs about the validator TypeTestCase class
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 2.8:
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [error_pages] Removing misleading  checker in code example
  add default option value for collection type
  minor symfony#8831 Update collection.rst (babaorum)
  Move JavaScript to seperate file
  Remove section about forms using validation
  Removed extra class
  Renamed TestedTypeTests to TestedTypeTest
  Add docs about the validator TypeTestCase class
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 3.3: (22 commits)
  add note about same-state transitions
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [error_pages] Removing misleading  checker in code example
  Updated LDAP documentation for Symfony 3.1
  Updating example README to match note below it
  Update docs for setting custom response code in exception handler
  add default option value for collection type
  minor symfony#8831 Update collection.rst (babaorum)
  minor symfony#8987 Fix YAML config bug (Holicz, javiereguiluz)
  Move JavaScript to seperate file
  Remove section about forms using validation
  Removed extra class
  Update fomr testing sentence
  Renamed TestedTypeTests to TestedTypeTest
  ...
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 3.4: (30 commits)
  add note about same-state transitions
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [Workflow] Document the new transition completed event
  [error_pages] Removing misleading  checker in code example
  fix syntax errors and add some more crosslinks
  Updated LDAP documentation for Symfony 3.1
  Updating example README to match note below it
  Update docs for setting custom response code in exception handler
  add default option value for collection type
  minor symfony#8831 Update collection.rst (babaorum)
  minor symfony#8987 Fix YAML config bug (Holicz, javiereguiluz)
  ...
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jan 10, 2018
* 4.0: (36 commits)
  add note about same-state transitions
  Corrected recipes
  minor symfony#8205 Move JavaScript to separate file (technetium, javiereguiluz)
  [Workflow] Document the new transition completed event
  [error_pages] Removing misleading  checker in code example
  Added the env vars in the nginx config too
  Commented the env vars and mentioned that they are optional
  fix syntax errors and add some more crosslinks
  Updated LDAP documentation for Symfony 3.1
  Updating example README to match note below it
  Update docs for setting custom response code in exception handler
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants