update dialog box button appearance to conform with styleguide

fixes #10236

test plan:

check each updated form to ensure it looks correct and works

Change-Id: I073c3bff5860bab0b892fecbf61a41a8e9c5ec76
Reviewed-on: https://gerrit.instructure.com/13904
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Chris Hart 2012-09-24 14:51:47 -04:00 committed by Ryan Shaw
parent 1926251974
commit 171b05a4f7
65 changed files with 232 additions and 178 deletions

View File

@ -2,6 +2,7 @@ define [
'jquery'
'jst/AssignmentDetailsDialog'
'jqueryui/dialog'
'compiled/jquery/fixDialogButtons'
], ($, assignmentDetailsDialogTemplate) ->
class AssignmentDetailsDialog
@ -32,5 +33,5 @@ define [
noneRightLeft: (tally += width) - width
$(assignmentDetailsDialogTemplate(locals)).dialog
width: 375
width: 500
close: -> $(this).remove()

View File

@ -29,6 +29,7 @@ define [
buttons = if @apptGroup.workflow_state == 'active'
[
text: I18n.t 'save_changes', 'Save Changes'
class: 'btn-primary'
click: @appointmentGroupsForm.saveClick
]
else
@ -37,7 +38,7 @@ define [
click: @appointmentGroupsForm.saveWithoutPublishingClick
,
text: I18n.t 'save_and_publish', 'Save & Publish'
'class' : 'btn-primary'
class: 'btn-primary'
click: @appointmentGroupsForm.saveClick
]

View File

@ -36,12 +36,13 @@ define [
width: 400
resizable: false
buttons: [
text: I18n.t('buttons.send_message', 'Send')
'data-text-while-loading': I18n.t('buttons.sending_message', 'Sending...')
click: -> $(this).submit()
,
text: I18n.t('buttons.cancel', 'Cancel')
click: -> $(this).dialog('close')
,
text: I18n.t('buttons.send_message', 'Send')
'data-text-while-loading': I18n.t('buttons.sending_message', 'Sending...')
class: 'btn-primary'
click: -> $(this).submit()
]
close: -> $(this).remove()
@loadParticipants()

View File

@ -24,6 +24,7 @@ define [
if $button.prop('type') is 'submit' && $button[0].form
classes += ' button_type_submit'
$dialog.keypress (e) ->
return unless $(e.target).filter('input:text').length
$($button[0].form).submit() if e.keyCode is $.ui.keyCode.ENTER
return {

View File

@ -1,5 +1,3 @@
body, html
height: 100%
body

View File

@ -490,8 +490,17 @@ legend + .control-group {
margin-top: $baseLineHeight / 2;
margin-bottom: 0;
}
// Move over buttons in .form-actions to align with .controls
.form-actions {
padding-left: 160px;
}
}
// moving .form-actions out of .form-horizontal scope, so the right-aligned buttons can be applied across the app
.form-actions {
text-align: right;
padding: 10px 10px 11px;
}
// when .form-actions is in a modal box, make it look different per Kyle mockup
.ui-dialog-content .form-actions {
margin-bottom: 0;
box-shadow: inset 0 1px 0 #fff;
}

View File

@ -8,5 +8,4 @@
.nav-tabs.nav-stacked {
background: $lightBackground;
}
}

View File

@ -36,10 +36,12 @@
</tr>
<tr>
<td colspan="4">
<span class="auth_form">
<button type="submit" class="button"><%= t(:save_button, "Save Authentication Settings") %></button>
<button type="button" class="cancel_button button-secondary"><%= t("#buttons.cancel", "Cancel") %></button>
</span>
<div class="form-actions">
<span class="auth_form">
<button type="button" class="button cancel_button"><%= t("#buttons.cancel", "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t(:save_button, "Save Authentication Settings") %></button>
</span>
</div>
</td>
</tr>
</table>

View File

@ -81,11 +81,13 @@
</table>
<% end %>
<% end %>
<span class="auth_form" style="margin-top: 15px;">
<button type="submit" class="button"><%= t(:save_button, "Save LDAP Settings") %></button>
<button type="button" class="cancel_button button-secondary"><%= t("#buttons.cancel", "Cancel") %></button>
</span>
<div class="form-actions">
<span class="auth_form">
<button type="button" class="button cancel_button"><%= t("#buttons.cancel", "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t(:save_button, "Save LDAP Settings") %></button>
</span>
</div>
<% end %>
</div>

View File

@ -210,11 +210,15 @@
</div>
</div>
<% end %>
<button type="submit" class="button btn-primary">Submit</button>
<% unless config.new_record? %>
<button class="element_toggler button" aria-controls="<%= form_id %>">Cancel</button>
<% end %>
<div class="form-actions">
<span class="auth_form">
<% unless config.new_record? %>
<button type="button" class="button cancel_button element_toggler" aria-controls="<%= form_id %>"><%= t("#buttons.cancel", "Cancel") %></button>
<% end %>
<button type="submit" class="button btn-primary"><%= t(:save_button, "Save Authentication Settings") %></button>
</span>
</div>
<% end %>
<% end %>
</div>

View File

@ -66,8 +66,8 @@
<tr>
<td colspan="2">
<div class="button-container">
<button type="submit" class="button submit_button"><%= t(:add_user_button, "Add User") %></button>
<button type="button" class="button button-secondary cancel_button"><%= t("#buttons.cancel", "Cancel") %></button>
<button type="button" class="button cancel_button"><%= t("#buttons.cancel", "Cancel") %></button>
<button type="submit" class="button btn-primary submit_button"><%= t(:add_user_button, "Add User") %></button>
</div>
</td>
</tr>
@ -93,9 +93,9 @@
<td><%= f.select :enrollment_term_id, @root_account.enrollment_terms.active.map{|t| [t.name, t.id] }, :selected => @term && @term.id %></td>
</tr><tr>
<td colspan="2">
<div class="button-container">
<button type="submit" class="button submit_button"><%= t(:add_course_button, "Add Course") %></button>
<button type="button" class="button button-secondary cancel_button"><%= t("#buttons.cancel", "Cancel") %></button>
<div class="button-container">
<button type="button" class="button dialog_closer"><%= t("#buttons.cancel", "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t(:add_course_button, "Add Course") %></button>
</div>
</td>
</tr>
@ -114,6 +114,7 @@ require([
'str/htmlEscape' /* htmlEscape, /\$\.h/ */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'compiled/jquery.rails_flash_notifications',
'jquery.templateData' /* fillTemplateData */
], function(I18n, $, htmlEscape) {
@ -125,7 +126,7 @@ require([
$("#add_user_dialog").dialog({
title: <%= jt('#accounts.add_user_dialog_title', "Add a New User") %>,
width: 500
});
}).fixDialogButtons();
$("#add_user_form :text:visible:first").focus().select();
});
$("#add_user_form").formSubmit({
@ -162,7 +163,7 @@ require([
$("#add_course_dialog").dialog({
title: <%= jt('#accounts.add_course_dialog_title', "Add a New Course") %>,
width: 500
});
}).fixDialogButtons();
$("#add_course_form :text:visible:first").focus().select();
});
$("#add_course_form").formSubmit({

View File

@ -9,8 +9,8 @@
This will remove the user's data (including grades) from all
courses and groups. This process cannot be undone.", :account => @account.name) %>
<div class="button-container">
<button type="submit" class="button"><%= t(:delete_button, "Delete %{user}", :user => @user.name) %></button>
<a href="<%= account_url(@context) %>" class="button button-secondary"><%= t("#buttons.cancel", "Cancel")%></a>
<div class="form-actions">
<a href="<%= account_url(@context) %>" class="btn"><%= t("#buttons.cancel", "Cancel")%></a>
<button type="submit" class="btn btn-primary"><%= t(:delete_button, "Delete %{user}", :user => @user.name) %></button>
</div>
<% end %>

View File

@ -560,11 +560,12 @@ TEXT
</div>
<%= render :partial => 'shared/user_lists' %>
</div>
<div class="button-container">
<button type="button" class="button verify_syntax_button"><%= t('buttons.continue', %{Continue...}) %></button>
<button type="submit" class="button add_users_button"><%= t('buttons.add_users', %{OK Looks Good, Add These Users}) %></button>
<button type="button" class="go_back_button button-secondary"><%= t('buttons.modify_users', %{Go back and edit the list of users}) %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></button>
<div class="form-actions">
<button type="button" class="btn go_back_button"><%= t('buttons.modify_users', %{Go back and edit the list of users}) %></button>
<button type="button" class="btn cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="button" class="btn btn-primary verify_syntax_button"><%= t('buttons.continue', %{Continue...}) %></button>
<button type="submit" class="btn btn-primary add_users_button"><%= t('buttons.add_users', %{OK Looks Good, Add These Users}) %></button>
</div>
<% end %>
<% end %>
@ -695,7 +696,7 @@ TEXT
</div>
<br />
<input type="hidden" name="report_type" value="<%= report %>" />
<a href="#" id="run_<%= report %>" class="button run_report_link"><%= t 'links.run_report', 'Run Report' %></a><br/>
<a href="#" id="run_<%= report %>" class="button btn-primary run_report_link"><%= t 'links.run_report', 'Run Report' %></a>
</form>
</div>
</div>

View File

@ -33,8 +33,8 @@
</select>
</p>
<div class="button-container">
<button class="button delete_button"><%= t 'buttons.delete_group', "Delete Group" %></button>
<button class="button button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button class="button cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button class="button btn-primary delete_button"><%= t 'buttons.delete_group', "Delete Group" %></button>
</div>
</div>
</div>

View File

@ -25,9 +25,9 @@ DOC
<%= f.blabel :syllabus_body, :en => "Syllabus Description" %>
<div class="clear"></div>
<%= f.text_area :syllabus_body, :style => "width: 100%; height: 300px;", :id => "course_syllabus_body" %>
<div class='button-container'>
<button type="submit" class='button'><%= t 'buttons.update_syllabus', "Update Syllabus" %></button>
<button type="button" class="button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<div class='form-actions'>
<button type="button" class="button cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button type="submit" class='button btn-primary'><%= t 'buttons.update_syllabus', "Update Syllabus" %></button>
</div>
<% end %>
<table id="syllabus">

View File

@ -68,8 +68,10 @@
</tr>
<tr>
<td colspan="4">
<button type="submit" class="button submit_button"><%= calendar_event.new_record? ? t('buttons.create', "Create Event") : t('buttons.update', "Update Event") %></button>
<button type="button" class="button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<div class="form-actions">
<button type="button" class="button cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button type="submit" class="button btn-primary submit_button"><%= calendar_event.new_record? ? t('buttons.create', "Create Event") : t('buttons.update', "Update Event") %></button>
</div>
</td>
</tr>
</table>

View File

@ -194,8 +194,8 @@
<td></td>
<td><a href="#" class="more_options_link"><%= t 'links.more_options', "more options" %></a></td>
</tr><tr>
<td colspan="2" class="button-container">
<button type="submit" class="button"><%= t '#buttons.submit', "Submit" %></button>
<td colspan="2">
<button type="submit" class="button btn-primary"><%= t '#buttons.submit', "Submit" %></button>
</td>
</tr>
</table>
@ -228,7 +228,7 @@
<td><a href="#" class="more_options_link"><%= t 'links.more_options', "more options" %></a></td>
</tr><tr>
<td colspan="2">
<button type="submit" class="button"><%= t '#buttons.submit', "Submit" %></button>
<button type="submit" class="button btn-primary"><%= t '#buttons.submit', "Submit" %></button>
</td>
</tr>
</table>

View File

@ -100,9 +100,9 @@ TEXT
</td>
</tr><tr>
<td colspan="2">
<div class="button-container" style="margin-top: 10px;">
<button type="submit" class="button submit_button"><%= t('buttons.add_module', %{Add Module}) %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></button>
<div class="button-container">
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="submit" class="button btn-primary submit_button"><%= t('buttons.add_module', %{Add Module}) %></button>
</div>
<a href="<%= context_url(@context, :context_context_modules_url) %>" style="display: none;" class="add_context_module_url">&nbsp;</a>
</td>
@ -151,8 +151,10 @@ TEXT
</tr>
<tr>
<td colspan="2">
<button type="submit" class="button"><%= t('#buttons.update', %{Update}) %></button>
<button type="button" class="button button-secondary cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<div class="button-container">
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="submit" class="button btn-primary"><%= t('#buttons.update', %{Update}) %></button>
</div>
</td>
</tr>
</table>

View File

@ -71,17 +71,16 @@
<% end %>
<div <%= hidden(true) %> id="reset_course_content_dialog">
<%= mt('help.reset_course_content', 'Resetting course content will permanently delete all associated assignments, discussions, quizzes, modules, rubrics, pages, files, learning outcomes, question banks, collaborations, conferences, or any other content. This action is irreversible, and the data *cannot* be recovered. Are you sure you wish to continue?') %>
<p><%= mt('help.reset_course_content', 'Resetting course content will permanently delete all associated assignments, discussions, quizzes, modules, rubrics, pages, files, learning outcomes, question banks, collaborations, conferences, or any other content. This action is irreversible, and the data *cannot* be recovered. Are you sure you wish to continue?') %></p>
<% form_for @context, :url => context_url(@context, :course_reset_url), :html => { :method => :post } do %>
<div class="button-container">
<button type="submit" class="submit_button button">
<%= t('buttons.reset', 'Reset Course Content') %>
</button>
<button type="button" class="cancel_button button-secondary">
<button type="button" class="button cancel_button">
<%= t('#buttons.cancel', 'Cancel') %>
</button>
<button type="submit" class="button btn-primary submit_button">
<%= t('buttons.reset', 'Reset Course Content') %>
</button>
</div>
<% end %>
</div>

View File

@ -12,9 +12,9 @@
<% form_tag context_url(@context, :context_url), {:method => :delete} do %>
<input type="hidden" name="event" value="delete"/>
<div class="button-container">
<button class="button big-button" type="submit"><%= t('buttons.delete_course', %{Delete Course}) %></button>
<a href="<%= context_url(@context, :context_url) %>" class="button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></a>
<div class="form-actions">
<a href="<%= context_url(@context, :context_url) %>" class="button"><%= t('#buttons.cancel', %{Cancel}) %></a>
<button class="button btn-danger" type="submit"><%= t('buttons.delete_course', %{Delete Course}) %></button>
</div>
<% end %>
<% else %>
@ -23,9 +23,9 @@
<% form_tag context_url(@context, :context_url), {:method => :delete} do %>
<input type="hidden" name="event" value="conclude"/>
<div class="button-container">
<button class="button big-button" type="submit"><%= t('buttons.conclude_course', %{Conclude Course}) %></button>
<a href="<%= context_url(@context, :context_url) %>" class="button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></a>
<div class="form-actions">
<a href="<%= context_url(@context, :context_url) %>" class="button"><%= t('#buttons.cancel', %{Cancel}) %></a>
<button class="button btn-primary" type="submit"><%= t('buttons.conclude_course', %{Conclude Course}) %></button>
</div>
<% end %>
<% end %>

View File

@ -290,8 +290,10 @@ TEXT
<a href="#" class="move_course_link button"><%= image_tag "ball.png" %><%= t('links.move_course', %{Move To Another Account}) %></a>
<% end %>
<span class="course_form">
<button type="submit" class="button"><%= t('buttons.update_course', %{Update Course Details}) %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></button>
<div class="form-actions">
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.update_course', %{Update Course Details}) %></button>
</div>
</span>
</td>
</tr>
@ -445,11 +447,11 @@ TEXT
</div>
<% end %>
</div>
<div class="button-container">
<button type="button" class="button verify_syntax_button"><%= t('buttons.continue', %{Continue...}) %></button>
<button type="submit" class="button add_users_button"><%= t('buttons.add_users', %{OK Looks Good, Add These Users}) %></button>
<button type="button" class="go_back_button button-secondary"><%= t('buttons.modify_users', %{Go back and edit the list of users}) %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', %{Cancel}) %></button>
<div class="form-actions">
<button type="button" class="btn go_back_button"><%= t('buttons.modify_users', %{Go back and edit the list of users}) %></button>
<button type="button" class=" btn cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="button" class="btn btn-primary verify_syntax_button"><%= t('buttons.continue', %{Continue...}) %></button>
<button type="submit" class="btn btn-primary add_users_button"><%= t('buttons.add_users', %{OK Looks Good, Add These Users}) %></button>
</div>
<% end %>
<%= render :partial => 'link_enrollment' %>
@ -533,8 +535,8 @@ TEXT
<tr>
<td colspan="2">
<div class="button-container">
<button type="submit" class="button"><%= t('buttons.move_course', %{Move Course}) %></button>
<button type="button" class="button button-secondary cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', %{Cancel}) %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.move_course', %{Move Course}) %></button>
</div>
</td>
</tr>

View File

@ -99,6 +99,7 @@ require([
'jquery' /* $ */,
'jquery.ajaxJSON' /* ajaxJSON */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.loadingImg' /* loadingImg, loadingImage */,
'vendor/jquery.scrollTo' /* /\.scrollTo/ */
], function($) {
@ -107,7 +108,7 @@ $(document).ready(function() {
$(".self_unenrollment_link").click(function(event) {
$("#self_unenrollment_dialog").dialog({
title: <%= raw t('titles.drop_course', "Drop this Course").to_json %>
});
}).fixDialogButtons();
});
$("#self_unenrollment_dialog .action").click(function() {
$("#self_unenrollment_dialog a.button").attr('disabled', true);

View File

@ -187,8 +187,8 @@
</tr>
</table>
<div class="button-container">
<button type="submit" class="button"><%= t('buttons.add_page', "Add Page") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.add_page', "Add Page") %></button>
</div>
<div style="display: none;">
<a class="add_eportfolio_entry_url" href="<%= eportfolio_entries_path(@portfolio.id) %>">&nbsp;</a>
@ -331,8 +331,9 @@
</td>
</tr>
<tr>
<td colspan="2" class="button-container-right-aligned">
<button type="submit" class="button"><%= t('buttons.update_eportfolio', "Update ePortfolio") %></button>
<td colspan="2" class="button-container">
<button class="button dialog_closer"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.update_eportfolio', "Update ePortfolio") %></button>
</td>
<td>
</table>

View File

@ -79,8 +79,8 @@
<tr>
<td colspan="2">
<div class="button-container">
<button class="button save_button" type="submit"><%= t "#buttons.save_tool_settings", "Save Tool Settings" %></button>
<button class="button button-secondary cancel_button" type="button"><%= t "#buttons.cancel", "Cancel" %></button>
<button class="btn cancel_button" type="button"><%= t "#buttons.cancel", "Cancel" %></button>
<button class="btn btn-primary save_button" type="submit"><%= t "#buttons.save_tool_settings", "Save Tool Settings" %></button>
</div>
</td>
</tr>

View File

@ -457,8 +457,10 @@ HEREDOC
</td>
</tr><tr>
<td colspan="3">
<button type="submit" class="button"><%= t 'buttons.lock_file', "Lock this File" %></button>
<button type="button" class="button button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<div class="button-container">
<button type="button" class="button cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button type="submit" class="button btn-primary"><%= t 'buttons.lock_file', "Lock this File" %></button>
</div>
</td>
</tr>
</table>
@ -496,8 +498,10 @@ HEREDOC
</td>
</tr><tr>
<td colspan="3">
<button type="submit" class="button"><%= t 'buttons.lock_folder', "Lock this Folder" %></button>
<button type="button" class="button button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<div class="button-container">
<button type="button" class="button cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button type="submit" class="button btn-primary"><%= t 'buttons.lock_folder', "Lock this Folder" %></button>
</div>
</td>
</tr>
</table>

View File

@ -265,9 +265,10 @@
<input type="checkbox" id="hide_student_names" name="hide_student_names"/>
<label for="hide_student_names"><%= t('labels.hide_names', "Hide student names in the SpeedGrader") %></label>
</p>
<p>
<button type="submit" class="button submit_button"><%= t('buttons.save_settings', "Save Settings") %></button>
</p>
<div class="button-container">
<button class="button dialog_closer"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary submit_button"><%= t('buttons.save_settings', "Save Settings") %></button>
</div>
</form>
<%= render :partial => "shared/mute_dialog" %>
<ul id="section-menu" class="ui-selectmenu-menu ui-widget ui-widget-content ui-selectmenu-menu-dropdown ui-selectmenu-open" style="display:none;" role="listbox" aria-activedescendant="section-menu-link">

View File

@ -3,7 +3,8 @@
require([
'i18nObj' /* I18n.t */,
'jquery' /* $ */,
'jqueryui/dialog'
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
], function(I18n, $) {
window.addGroupCategory = function(callback) {
$("#add_category_form").dialog({
@ -14,7 +15,7 @@ require([
backgroundColor: "#000",
opacity: 0.7
}
});
}).fixDialogButtons();
var callbacks = $("#add_category_form").data('callbacks') || [];
callbacks.push(callback);
$("#add_category_form").data('callbacks', callbacks);
@ -79,7 +80,7 @@ TEXT
<% end %>
<tr>
<td colspan="2" class="button-container-right-aligned" style="padding: 0.5em;">
<button type="submit" class="button submit_button"><%= t 'buttons.create_category', "Create Category" %></button>
<button type="submit" class="button btn-primary submit_button"><%= t 'buttons.create_category', "Create Category" %></button>
</td>
</tr>
</table>

View File

@ -7,9 +7,9 @@
:title => t(:self_signup_help_tooltip, "What Are Self Sign-Up Groups?")) %>
</div>
<div style="margin: 0.5em 0;"><%= check_box_tag 'category[restrict_self_signup]', "1", false, :disabled => true, :id => 'category_restrict_self_signup' %><%= label_tag :restrict_self_signup, t(:restricted_self_signup, "Require group members to be in the same section") %></div>
<div class="button-container" style="margin: 0.5em 0;">
<button type="submit" class="button small-button submit_button"><%= t '#buttons.update', 'Update' %></button>
<button type="button" class="button-secondary cancel_button"><%= t '#buttons.cancel', 'Cancel' %></button>
<div class="form-actions">
<button type="button" class="button cancel_button"><%= t '#buttons.cancel', 'Cancel' %></button>
<button type="submit" class="button btn-primary submit_button"><%= t '#buttons.update', 'Update' %></button>
</div>
<div class="clear"></div>
<% end %>

View File

@ -575,8 +575,8 @@
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</fieldset>
</form>
@ -680,8 +680,8 @@
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</fieldset>
</form>
@ -836,8 +836,8 @@
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</fieldset>
</form>

View File

@ -17,5 +17,5 @@
</tr>
</tfoot>
</table>
<button class="button" type="submit">{{#t "buttons.save"}}Save{{/t}}</button>
<button class="btn btn-primary" type="submit">{{#t "buttons.save"}}Save{{/t}}</button>
</div>

View File

@ -25,7 +25,7 @@
<input type="checkbox" name="assign_blanks" id="assign_blanks"/>
<label for="assign_blanks">{{#t "labels.assign_blanks"}}Assign zeroes to unsubmitted students{{/t}}</label>
</p>
<button data-text-while-loading="{{#t "buttons.curving_grades"}}Curving Grades...{{/t}}" type="submit" class="button">
<button data-text-while-loading="{{#t "buttons.curving_grades"}}Curving Grades...{{/t}}" type="submit" class="btn btn-primary">
{{#t "buttons.curve_grades"}}Curve Grades{{/t}}
</button>
</form>

View File

@ -23,8 +23,8 @@
<tr>
<td colspan='2'>
<div class='button-container'>
<button type='submit' class='button submit'>{{#t "save_key"}}Save Key{{/t}}</button>
<button type='button' class='button button-secondary cancel'>{{#t "cancel"}}Cancel{{/t}}</button>
<button type='button' class='button dialog_closer cancel'>{{#t "cancel"}}Cancel{{/t}}</button>
<button type='submit' class='button btn-primary submit'>{{#t "save_key"}}Save Key{{/t}}</button>
</div>
</td>
</tr>

View File

@ -8,8 +8,8 @@
<div class="clearfix">
<div class="discussion-reply-buttons">
<button class="button small-button" type="submit">{{#t "post_response"}}Post Response{{/t}}</button>
<a href="javascript:" class="cancel_button">{{#t "cancel"}}Cancel{{/t}}</a>
<a href="javascript:" class="btn btn-small cancel_button">{{#t "cancel"}}Cancel{{/t}}</a>
<button class="btn btn-primary btn-small" type="submit">{{#t "post_response"}}Post Response{{/t}}</button>
</div>
<div class="discussion-reply-attachments-container">

View File

@ -153,7 +153,7 @@
<% end %>
<tr>
<td colspan="2">
<button type="submit" class="button"><%= t('buttons.register_email', "Register Email") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.register_email', "Register Email") %></button>
</td>
</tr>
</table>
@ -185,7 +185,7 @@
</td>
</tr><tr>
<td colspan="2">
<button type="submit" class="button"><%= t('buttons.register_sms', "Register SMS") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.register_sms', "Register SMS") %></button>
</td>
</table>
<% end %>

View File

@ -137,8 +137,11 @@
<tr class="edit_data_row" style="display: none;">
<td colspan="2">
<p><a style="font-size: 0.9em" href="<%= user_delete_url(@user.id) %>" class="admin"><%= t('links.delete_account', "Delete My Account") %> </a></p>
<button type="submit" class="button"><%= t('buttons.update_settings', "Update Settings") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', "Cancel") %></button>
<div class="form-actions">
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.update_settings', "Update Settings") %></button>
</div>
</td>
</tr>
</table>
@ -269,7 +272,7 @@ TEXT
<td><%= f.text_field :user_name, :style => "width: 150px;" %></td>
</tr><tr>
<td colspan="2">
<button type="submit" class="button"><%= t('buttons.save_skype_name', "Save Skype Name") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.save_skype_name', "Save Skype Name") %></button>
</td>
</tr>
</table>
@ -292,7 +295,7 @@ TEXT
<div class="clear"></div>
</div>
<div style="text-align: center; font-size: 1.2em; margin-top: 10px;">
<a class="button" href="<%= oauth_url(:service => "facebook", :return_to => settings_profile_url) %>"><%= t('buttons.register_facebook_account', "Register Your Facebook Account") %></a>
<a class="button btn-primary" href="<%= oauth_url(:service => "facebook", :return_to => settings_profile_url) %>"><%= t('buttons.register_facebook_account', "Register Your Facebook Account") %></a>
</div>
</div>
</li>
@ -314,7 +317,7 @@ TEXT
<div class="clear"></div>
</div>
<div style="text-align: center; font-size: 1.2em; margin-top: 10px;">
<a class="button" href="<%= oauth_url(:service => "linked_in", :return_to => settings_profile_url) %>"><%= t('buttons.register_linkedin_account', "Register Your LinkedIn Account") %></a>
<a class="button btn-primary" href="<%= oauth_url(:service => "linked_in", :return_to => settings_profile_url) %>"><%= t('buttons.register_linkedin_account', "Register Your LinkedIn Account") %></a>
</div>
</div>
</li>
@ -338,7 +341,7 @@ TEXT
<div class="clear"></div>
</div>
<div style="text-align: center; margin-top: 10px;">
<a class="button" href="<%= oauth_url(:service => "twitter", :return_to => settings_profile_url) %>"><%= t('buttons.authorize_twitter', "Authorize Twitter Access") %></a>
<a class="button btn-primary" href="<%= oauth_url(:service => "twitter", :return_to => settings_profile_url) %>"><%= t('buttons.authorize_twitter', "Authorize Twitter Access") %></a>
</div>
</div>
</li>
@ -368,7 +371,7 @@ TEXT
<td><%= f.password_field :password, :style => "width: 150px;" %></td>
</tr><tr>
<td colspan="2">
<button type="submit" class="button"><%= t('buttons.save_login', "Save Login") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.save_login', "Save Login") %></button>
</td>
</tr>
</table>
@ -403,7 +406,7 @@ TEXT
<td><%= f.password_field :password, :style => "width: 150px;" %></td>
</tr><tr>
<td colspan="2">
<button type="submit" class="button"><%= t('buttons.save_login', "Save Login") %></button>
<button type="submit" class="button btn-primary"><%= t('buttons.save_login', "Save Login") %></button>
</td>
</tr>
</table>
@ -528,8 +531,8 @@ TEXT
</tr>
<td colspan="2">
<div class="button-container">
<button class="button submit_button" type="submit"><%= t('buttons.generate_token', "Generate Token") %></button>
<button class="button button-secondary cancel_button" type="button"><%= t('#buttons.cancel', "Cancel") %></button>
<button class="button cancel_button" type="button"><%= t('#buttons.cancel', "Cancel") %></button>
<button class="button btn-primary submit_button" type="submit"><%= t('buttons.generate_token', "Generate Token") %></button>
</div>
</td>
</tr>

View File

@ -106,8 +106,8 @@
<% }) %>
</div>
<div class="button-container">
<button type="button" class="button save_button"><%= t('buttons.extend_time', "Extend Time") %></button>
<button type="button" class="button button-secondary cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="button" class="button btn-primary save_button"><%= t('buttons.extend_time', "Extend Time") %></button>
</div>
</div>
<div id="moderate_student_dialog" style="display: none;">
@ -144,8 +144,8 @@
<tr>
<td colspan="2">
<div class="button-container">
<button type="submit" class="button save_button"><%= t('buttons.save', "Save") %></button>
<button type="button" class="button button-secondary cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="button" class="button dialog_closer cancel_button"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary save_button"><%= t('buttons.save', "Save") %></button>
</div>
</td>
</tr>

View File

@ -143,8 +143,8 @@
</tbody>
</table>
<div class="button-container">
<button type="submit" class="save_permissions_changes button"><%= t 'buttons.save', "Save Changes" %></button>
<a class="cancel_button button-secondary" href="<%= url_for(:back) %>"><%= t '#buttons.cancel', "Cancel" %></a>
<a class="button cancel_button" href="<%= url_for(:back) %>"><%= t '#buttons.cancel', "Cancel" %></a>
<button type="submit" class="button btn-primary save_permissions_changes"><%= t 'buttons.save', "Save Changes" %></button>
</div>
<% end -%>
</div>

View File

@ -428,8 +428,10 @@
</tr>
<tr>
<td colspan="4">
<button type="submit" class="button"><%= t 'buttons.update', "Update Assignment" %></button>
<button type="button" class="button-secondary cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<div class="form-actions">
<button type="button" class="btn cancel_button"><%= t '#buttons.cancel', "Cancel" %></button>
<button type="submit" class="btn btn-primary"><%= t 'buttons.update', "Update Assignment" %></button>
</div>
</td>
</tr>
</table>

View File

@ -124,9 +124,9 @@
<button type="button" class="done_button button"><%= t('buttons.done', 'Done') %></button>
</div>
<% end %>
<div class="editing_box button-container">
<button type="button" class="save_button button"><%= t('buttons.save', 'Save') %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#buttons.cancel', 'Cancel') %></button>
<div class="editing_box form-actions">
<button type="button" class="btn cancel_button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button type="button" class="button btn-primary save_button"><%= t('buttons.save', 'Save') %></button>
</div>
</div>
<div style="display: none;" class="find_grading_standard">

View File

@ -26,7 +26,8 @@
</tr>
</table>
<div class="button-container">
<button type="submit" class="button send_button"><%= t('buttons.send_message', 'Send Message') %></button>
<button class="button dialog_closer"><%= t('#buttons.cancel', "Cancel") %></button>
<button type="submit" class="button btn-primary send_button"><%= t('buttons.send_message', 'Send Message') %></button>
</div>
<% end %>
</div>

View File

@ -104,8 +104,8 @@
<tr>
<td colspan="2">
<div class="button-container">
<button type="submit" class="button submit_button"><%= t('buttons.update_login', 'Update Login') %></button>
<button type="button" class="button button-secondary cancel_button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button type="button" class="button cancel_button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button type="submit" class="button btn-primary submit_button"><%= t('buttons.update_login', 'Update Login') %></button>
</div>
</td>
</tr>

View File

@ -90,8 +90,8 @@
<tr>
<td colspan="2">
<div class="button-container">
<button class="button submit_button" type="submit"><%= t('buttons.update_details', 'Update Details') %></button>
<button class="button button-secondary cancel_button" type="button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button class="button cancel_button" type="button"><%= t('#buttons.cancel', 'Cancel') %></button>
<button class="button btn-primary submit_button" type="submit"><%= t('buttons.update_details', 'Update Details') %></button>
</div>
</td>
</table>

View File

@ -125,9 +125,9 @@ course will see this page first. You can change that from [the course home page
<%= f.check_box :notify_of_update %>
<%= f.label :notify_of_update, :en => "Notify users that this content has changed" %>
</div>
<div style="text-align: left; padding: 0.4em 0;">
<button type="submit" name="commit" id="wiki_page_submit" class="button"><%= t 'buttons.save_changes', 'Save Changes' %></button>
<button type="button" id="cancel_editing" class="cancel_button button-secondary"><%= t '#buttons.cancel', 'Cancel' %></button>
<div class="form-actions">
<button type="button" id="cancel_editing" class="btn cancel_button"><%= t '#buttons.cancel', 'Cancel' %></button>
<button type="submit" name="commit" id="wiki_page_submit" class="btn btn-primary"><%= t 'buttons.save_changes', 'Save Changes' %></button>
</div>
</div>
<% end -%>

View File

@ -26,6 +26,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO, dateString, datepicker, time_field, datetime_field, /\$\.datetime/ */,
'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formSuggestion */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons',
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.keycodes' /* keycodes */,
'jquery.loadingImg' /* loadingImg, loadingImage */,
@ -664,7 +665,7 @@ define([
$dialog.find("#assignment_group_delete").attr('checked', true);
$dialog.dialog({
width: 500
}).data('group_id', data.assignment_group_id);
}).fixDialogButtons().data('group_id', data.assignment_group_id);
return;
}
$group.confirmDelete({

View File

@ -24,6 +24,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO, time_field, datetime_field */,
'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* /\$\.underscore/ */,
'jquery.instructure_misc_plugins' /* .dim, confirmDelete, fragmentChange, showIf */,
'jquery.keycodes' /* keycodes */,
@ -248,7 +249,7 @@ define([
close: function() {
modules.hideEditModule(true);
}
}).dialog('option', {title: (isNew ? I18n.t('titles.add', "Add Module") : I18n.t('titles.edit', "Edit Module Settings")), width: (isNew ? 'auto' : 600)}).dialog('open'); //show();
}).fixDialogButtons().dialog('option', {title: (isNew ? I18n.t('titles.add', "Add Module") : I18n.t('titles.edit', "Edit Module Settings")), width: (isNew ? 'auto' : 600)}).dialog('open'); //show();
$module.removeClass('dont_remove');
$form.find(":text:visible:first").focus().select();
},
@ -653,7 +654,7 @@ define([
$("#edit_item_form").fillFormData(data, {object_name: 'content_tag'});
$("#edit_item_form").dialog({
title: I18n.t('titles.edit_item', "Edit Item Details")
});
}).fixDialogButtons();
});
$("#edit_item_form .cancel_button").click(function(event) {
$("#edit_item_form").dialog('close');

View File

@ -23,6 +23,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO, date_field */,
'jquery.instructure_forms' /* formSubmit, fillFormData, getFormData, formErrors */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* scrollSidebar */,
'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */,
'jquery.keycodes' /* keycodes */,
@ -280,7 +281,7 @@ define([
$("#move_course_dialog").dialog({
title: I18n.t('titles.move_course', "Move Course"),
width: 500
});
}).fixDialogButtons();
});
$("#move_course_dialog").delegate('.cancel_button', 'click', function() {
$("#move_course_dialog").dialog('close');
@ -449,7 +450,7 @@ define([
});
$(".ui-dialog").focus();
});
}).fixDialogButtons();
$("#reset_course_content_dialog .cancel_button").click(function() {
$("#reset_course_content_dialog").dialog('close');
});

View File

@ -32,6 +32,7 @@ define([
'jquery.inst_tree' /* instTree */,
'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* replaceTags, scrollSidebar */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.loadingImg' /* loadingImage */,
@ -78,7 +79,7 @@ define([
$("#edit_eportfolio_form").dialog({
width: "auto",
title: I18n.t('eportfolio_settings', "ePortfolio Settings")
});
}).fixDialogButtons();
});
$("#edit_eportfolio_form .cancel_button").click(function(event) {
$("#edit_eportfolio_form").dialog('close');
@ -408,7 +409,7 @@ define([
$(this).find(":text:visible:first").val(assignment).focus().select();
$(document).triggerHandler('submission_dialog_opened');
}
});
}).fixDialogButtons();
}
});
$("#add_submission_form .cancel_button").click(function() {

View File

@ -3,6 +3,7 @@ define([
'jquery' /* $ */,
'jquery.instructure_forms' /* formSubmit, fillFormData */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.templateData' /* fillTemplateData, getTemplateData */
], function(I18n, $) {
@ -29,8 +30,7 @@ $(document).ready(function() {
$dialog.dialog({
title: I18n.t('titles.edit_external_tool', "Edit External Tool"),
width: 600
});
}).fixDialogButtons();
$dialog.find(".shared_secret_note").hide();
$dialog.find("form")
.attr('method', 'POST')

View File

@ -31,6 +31,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO */,
'jquery.instructure_forms' /* formSubmit, getFormData, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* replaceTags, /\$\.size/ */,
'jquery.instructure_misc_plugins' /* fragmentChange, showIf */,
'jquery.keycodes' /* keycodes */,

View File

@ -21,6 +21,7 @@ define([
'jquery' /* $ */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* showIf */
], function(I18n, $) {
@ -69,7 +70,7 @@ define([
$message_students_dialog.dialog({
width: 600,
modal: true
}).dialog('open').dialog('option', 'title', I18n.t("message_student", "Message Students for %{course_name}", {course_name: title}));
}).fixDialogButtons().dialog('open').dialog('option', 'title', I18n.t("message_student", "Message Students for %{course_name}", {course_name: title}));
};
$(document).ready(function() {
$message_students_dialog.find(".cutoff_score").bind('change blur keyup', function() {

View File

@ -24,6 +24,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO */,
'jquery.instructure_forms' /* fillFormData, getFormData */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* replaceTags */,
'jquery.instructure_misc_plugins' /* showIf */,
'compiled/jquery.rails_flash_notifications',
@ -195,7 +196,7 @@ define([
$("#moderate_student_dialog").dialog({
title: I18n.t('titles.student_extensions', "Student Extensions"),
width: 400
});
}).fixDialogButtons();
});
$(".moderate_student_link").live('click', function(event) {
@ -214,7 +215,7 @@ define([
$("#moderate_student_dialog").dialog({
title: I18n.t('titles.student_extensions', "Student Extensions"),
width: 400
});
}).fixDialogButtons();
});
$(".reload_link").click(function(event) {
event.preventDefault();
@ -277,7 +278,7 @@ define([
$dialog.dialog({
title: I18n.t('titles.extend_quiz_time', "Extend Quiz Time"),
width: 400
});
}).fixDialogButtons();
});
$("#extend_time_dialog").find(".cancel_button").click(function() {
$("#extend_time_dialog").dialog('close');

View File

@ -24,6 +24,7 @@ define([
'jquery.instructure_date_and_time' /* parseFromISO, time_field, datetime_field */,
'jquery.instructure_forms' /* formSubmit, formErrors, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, fragmentChange, showIf */,
'jquery.loadingImg' /* loadingImage */,
'jquery.templateData' /* fillTemplateData */,
@ -328,7 +329,7 @@ define([
$("#add_access_token_dialog").find(":input").val("").end()
.dialog({
width: 500
});
}).fixDialogButtons();
});
$(document).fragmentChange(function(event, hash) {
var type = hash.substring(1);

View File

@ -112,7 +112,7 @@ $(document).ready(function () {
var dateString = $(this).find('.datetime_suggest').text();
$link.closest('form')
// append this back to the form since it got moved to be a child of body when we called .dialog('open')
// append this back to the form since it got moved to be a child of body when we called .dialog('open')
.append($(this).dialog('destroy'))
.find('#quiz_lock_at')
.val(dateString).end()

View File

@ -23,6 +23,7 @@ define([
'jquery.ajaxJSON' /* ajaxJSONFiles, ajaxJSON */,
'jquery.instructure_forms' /* getFormData, errorBox */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_helpers' /* replaceTags, getUserServices, findLinkForService */,
'jquery.instructure_misc_plugins' /* showIf */,
'jquery.keycodes' /* keycodes */,

View File

@ -21,6 +21,7 @@ define([
'jquery' /* $ */,
'jquery.instructure_forms' /* formSubmit, fillFormData, formErrors */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.instructure_misc_plugins' /* confirmDelete, showIf */,
'jquery.templateData' /* fillTemplateData, getTemplateData */
], function(I18n, $) {
@ -104,7 +105,7 @@ $(document).ready(function() {
$form.data('unique_id_text').parents(".login").remove();
}
}
});
}).fixDialogButtons();
$form.dialog('option', 'title', I18n.t('titles.update_login', 'Update Login'))
.find(".submit_button").text(I18n.t('buttons.update_login', "Update Login"));
var $unique_id = $(this).parents(".login").find(".unique_id");

View File

@ -22,6 +22,7 @@ define([
'jquery.ajaxJSON' /* ajaxJSON */,
'jquery.instructure_forms' /* formSubmit */,
'jqueryui/dialog',
'compiled/jquery/fixDialogButtons' /* fix dialog formatting */,
'jquery.templateData' /* fillTemplateData */
], function(I18n, $) {
$(document).ready(function() {
@ -29,7 +30,7 @@ $(document).ready(function() {
event.preventDefault();
$("#edit_student_dialog").dialog({
width: 450
});
}).fixDialogButtons();
$("#edit_student_form :text:visible:first").focus().select();
});
$("#edit_student_form").formSubmit({

View File

@ -120,7 +120,7 @@ describe "account admin question bank" do
question_bank_2 = create_question_bank("bank 2")
f(".move_question_link").click
f("#move_question_dialog #question_bank_#{question_bank_2.id}").click
submit_dialog("#move_question_dialog")
submit_dialog("#move_question_dialog", '.submit_button')
wait_for_ajaximations
question_bank_2.assessment_questions.find_by_name(@question.name).should be_present
end
@ -183,7 +183,7 @@ describe "account admin question bank" do
questions.count.should == 3
f("#bank_new").click
f("#new_question_bank_name").send_keys(new_bank)
submit_dialog("#move_question_dialog")
submit_dialog("#move_question_dialog", '.submit_button')
wait_for_ajaximations
AssessmentQuestionBank.count.should == 2
move_questions_validation(new_bank, questions)
@ -196,7 +196,7 @@ describe "account admin question bank" do
questions.count.should == 2
f(".bank .bank_name").should include_text bank_name
f("#question_bank_#{question_bank_2.id}").click
submit_dialog("#move_question_dialog")
submit_dialog("#move_question_dialog", '.submit_button')
wait_for_ajaximations
move_questions_validation(bank_name, questions)
end

View File

@ -49,7 +49,7 @@ describe "admin settings tabs" do
new_description = "a different description"
hover_and_click(".edit_tool_link:visible")
replace_content(f("#external_tool_description"), new_description)
f(".save_button").click
fj(".save_button:visible").click
wait_for_ajax_requests
tool = ContextExternalTool.last
tool.description.should == new_description

View File

@ -92,7 +92,7 @@ describe "assignments" do
expect_new_page_load { submit_form('#edit_assignment_form') }
else
f('#external_tool_create_url').send_keys(lti_url)
submit_dialog('.ui-dialog-buttonset', '.add_item_button')
submit_dialog('#select_context_content_dialog', ".add_item_button")
expect_new_page_load { submit_form('#edit_assignment_form') }
end
f('.assignment_list').should include_text(assignment_title)
@ -161,7 +161,7 @@ describe "assignments" do
f('.more_options_link').click
f('#assignment_group_assignment').click
click_option('#assignment_group_category_select', 'new', :value)
submit_dialog('div.ui-dialog')
submit_dialog('#add_category_form')
wait_for_ajaximations
submit_form('#edit_assignment_form')
wait_for_ajaximations

View File

@ -770,15 +770,21 @@ shared_examples_for "all selenium tests" do
submit_button_css = 'button[type="submit"]'
button = form.is_a?(Selenium::WebDriver::Element) ? form.find_element(:css, submit_button_css) : f("#{form} #{submit_button_css}")
# the button may have been hidden via fixDialogButtons
if !button.displayed? && dialog = button.find_element(:xpath, "ancestor::div[contains(@class, 'ui-dialog')]")
submit_dialog(dialog, ".ui-dialog-buttonpane .button_type_submit")
if !button.displayed? && dialog = dialog_for(button)
submit_dialog(dialog)
else
button.click
end
end
def submit_dialog(dialog, submit_button_css = '.submit_button')
dialog.is_a?(Selenium::WebDriver::Element) ? dialog.find_element(:css, submit_button_css).click : f("#{dialog} #{submit_button_css}").click
def submit_dialog(dialog, submit_button_css = ".ui-dialog-buttonpane .button_type_submit")
dialog = f(dialog) unless dialog.is_a?(Selenium::WebDriver::Element)
dialog = dialog_for(dialog)
dialog.find_elements(:css, submit_button_css).last.click
end
def dialog_for(node)
node.find_element(:xpath, "ancestor-or-self::div[contains(@class, 'ui-dialog')]")
end
def check_image(element)

View File

@ -308,7 +308,7 @@ describe "context_modules" do
edit_form = f('#add_context_module_form')
f('.completion_entry .delete_criterion_link', edit_form).click
wait_for_ajaximations
f('.cancel_button', edit_form).click
ff('.cancel_button', dialog_for(edit_form)).last.click
wait_for_ajaximations
# now delete the criterion frd

View File

@ -21,7 +21,7 @@ shared_examples_for "external tools tests" do
else
add_manual opts
end
f("#external_tools_dialog .save_button").click
submit_form("#external_tools_dialog")
wait_for_ajax_requests
ContextExternalTool.count > 0
tool = ContextExternalTool.last

View File

@ -217,7 +217,7 @@ describe "profile" do
get "/profile/settings"
f('.add_access_token_link').click
access_token_form = f('#access_token_form')
access_token_form.find_element(:css, '.cancel_button').click
access_token_form.find_element(:xpath, '../..').find_element(:css, '.ui-dialog-buttonpane .cancel_button').click
access_token_form.should_not be_displayed
end

View File

@ -30,7 +30,7 @@ describe "quizzes question banks" do
find_questions_link.click
f(".select_all_link")
}.click
submit_dialog("div#find_question_dialog")
submit_dialog("div#find_question_dialog", '.submit_button')
keep_trying_until { fj("#quiz_display_points_possible .points_possible").text.should == "17" }
end
@ -50,7 +50,7 @@ describe "quizzes question banks" do
f(".select_all_link").should be_displayed
}
f(".select_all_link").click
submit_dialog("div#find_question_dialog")
submit_dialog("div#find_question_dialog", '.submit_button')
keep_trying_until { fj("#quiz_display_points_possible .points_possible").text.should == "1" }
f(".add_question_group_link").click
@ -58,7 +58,7 @@ describe "quizzes question banks" do
keep_trying_until {
fj("#find_bank_dialog .bank:visible")
}.click
submit_dialog("#find_bank_dialog")
submit_dialog("#find_bank_dialog", '.submit_button')
submit_form(".quiz_group_form")
keep_trying_until { fj("#quiz_display_points_possible .points_possible").text.should == "2" }
end
@ -80,7 +80,7 @@ describe "quizzes question banks" do
f(".select_all_link").should be_displayed
}
f(".select_all_link").click
submit_dialog("#find_question_dialog")
submit_dialog("#find_question_dialog", '.submit_button')
keep_trying_until { fj("#quiz_display_points_possible .points_possible").text.should == "1" }
f(".add_question_group_link").click
@ -88,7 +88,7 @@ describe "quizzes question banks" do
keep_trying_until {
fj("#find_bank_dialog .bank:visible")
}.click
submit_dialog("#find_bank_dialog")
submit_dialog("#find_bank_dialog", '.submit_button')
submit_form(".quiz_group_form")
keep_trying_until { fj("#quiz_display_points_possible .points_possible").text.should == "2" }
end

View File

@ -122,10 +122,8 @@ describe "quizzes" do
dialog.find_element(:css, 'textarea#body').send_keys('This is a test message.')
button = dialog.find_element(:css, "button.send_button")
button.click
keep_trying_until { button.text != "Sending Message..." }
button.text.should == "Message Sent!"
submit_dialog(dialog)
wait_for_ajax_requests
student.conversations.size.should == 1
end