Skip to content
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

Replacing legacy functions with UJS #795

Merged
merged 29 commits into from Jul 30, 2012
Merged

Replacing legacy functions with UJS #795

merged 29 commits into from Jul 30, 2012

Conversation

jeffling
Copy link
Member

In this branch, we replaced all deprecated javascript functions like link_to_remote, button_to_remote and remote_function with non-deprecated functions. Remote_function is now replaced using Ajax.Request. Link_to_remote and button_to_remote are now using link_to and button_to, respectively.

Related to #475 and #603

daneshd and others added 25 commits March 24, 2012 22:16
…/daneshd/Markus into ujs

Conflicts:
	app/views/submission_rules/grace_period/_grader_tab.html.erb
…ction to generate it anymore. ujsed up graders/_boot.js.erb
@benjaminvialle
Copy link
Member

Hi,

Very good work :)

All tests pass for me. Good to be merged for me.

Anyone ?

@@ -34,7 +34,7 @@ class AssignmentsController < ApplicationController
# Action called via Rails' remote_function from the test_result_window partial
# Prepares test result and updates content in window.
def render_test_result
@assignment = Assignment.find(params[:aid])
@assignment = Assignment.find(params[:aid])
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid trying to align '='. It's not maintainable long term. The usual convention is one space on each side of a mathematical sign.

Copy link
Member Author

Choose a reason for hiding this comment

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

Understood :)

@@ -3,7 +3,8 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<%= csrf_meta_tag %>
<%= csrf_meta_tag %>
<%= javascript_tag "const AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>
Copy link
Member

Choose a reason for hiding this comment

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

This line seems to repeat many times. I'm not super fond of this code duplication. Could we add this somewhere more prominently? Perhaps in a layout definition?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, is there a header layout file that's featured in all pages? I couldn't figure which file did that, so I just added the meta_tag and related to all files that contained . It would be annoying to maintain in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps put in into the main layout. I forget what the name of it was. It's not "main" the other one :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now i'm making a new partial for things in tags that are called often. Any objections/comments?

@jerboaa
Copy link
Member

jerboaa commented Jul 25, 2012

Nice work!

@@ -385,9 +378,9 @@ $("global_action_form").observe('ajax:success', function(evt, status, data, xhr)
<%= I18n.t("groups.groupe_name") %>
<input type="text" maxlength="30" id="new_group_name"></input>
</fieldset>
<p class="p_modal">
<p class="p_modal">
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Is it possible to remove all blank spaces at end of lines ?

In order to keep the code as clean as possible.

Thx :)

@daneshd
Copy link
Contributor

daneshd commented Jul 28, 2012

The rest of this looks good to me too.

@jerboaa
Copy link
Member

jerboaa commented Jul 29, 2012

Feel free to merge. Ship it!

benjaminvialle added a commit that referenced this pull request Jul 30, 2012
Replacing legacy functions with UJS
@benjaminvialle benjaminvialle merged commit 1f087c7 into MarkUsProject:master Jul 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants