canvas-lms/public/javascripts
Jon Jensen eec220d66e better behavior for truncateText
tweak truncateText so it is more like the ruby version (though not 100%
parity). changes include:

1. no longer on the $ object
2. never exceed max (previously it would stop adding words just *after*
   max is exceeded)
3. use i18n ellipses and word separator
4. ensure the ellipses fits within max
5. truncate first word if it exceeds max (otherwise truncate on word
   boundaries)
6. remove all extraneous whitespace

test plan:
1. find question banks to add when editing a quiz
2. the titles should be intelligently truncated

Change-Id: I33e05de32bdd6320a3fd10e5295b7d13bd7906c0
Reviewed-on: https://gerrit.instructure.com/13897
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-09-25 09:55:21 -06:00
..
str AMD Conversion 2012-02-06 16:41:40 -07:00
tinymce remove default "1 + 1" in equation editor, fixes #9036 2012-08-27 11:20:22 -06:00
translations fix i18n js issues, fixes #10456 2012-09-10 12:19:05 -06:00
vendor Show 11:59p instead of rounding to 12 in cal2 week view, fixes #8068 2012-09-10 09:37:34 -06:00
Backbone.js extended Backbone.Collection 2012-09-13 11:42:05 -06:00
ENV.js AMD Conversion 2012-02-06 16:41:40 -07:00
INST.js accept quiz answers on touch devices with only one tap. fixes #6966 2012-02-29 10:19:26 -07:00
account_authorization_configs.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
account_settings.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
account_statistics.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
ajax_errors.js restyle flash messages and unauthorized-style pages, fixes #9466 2012-07-18 17:12:52 -06:00
alerts.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
aligned_outcomes.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
assignments.js use a simple dialog for creating new courses 2012-08-27 13:29:42 -06:00
attendance.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
calcCmd.js remove friendlyName i18n in calcCmd 2012-08-31 15:36:04 -06:00
calendar.js On calendar1, open a syllabus event in dialog. Closes #9398 2012-08-28 11:17:30 -06:00
calendar_event.js store calendar event response date in understood format 2012-04-20 13:59:56 -06:00
calendar_move.js AMD Conversion 2012-02-06 16:41:40 -07:00
choose_content.js restyle flash messages and unauthorized-style pages, fixes #9466 2012-07-18 17:12:52 -06:00
choose_course.js organize backbone code and don't make people think about 'use!' 2012-04-21 23:00:05 -06:00
collaborations.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
communication_channels.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
conferences.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
content_exports.js rename id for list of content exports to prevent javascript error 2012-05-18 13:37:27 -06:00
content_imports.js restyle flash messages and unauthorized-style pages, fixes #9466 2012-07-18 17:12:52 -06:00
content_locks.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
content_migration.js save attachments before message creation, fixes #7229 2012-04-02 16:39:27 -06:00
content_tags_index.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
context_inbox.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
context_modules.js upgrade jqueryui to 1.9b1, closes: #9493 refs: #9492 2012-08-13 10:20:06 -06:00
course.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
course_settings.js upgrade jqueryui to 1.9b1, closes: #9493 refs: #9492 2012-08-13 10:20:06 -06:00
dashboard.js removed new dashboard link 2012-06-22 10:22:29 -06:00
datagrid.js masquerading bar; closes #9477 2012-07-26 10:05:22 -06:00
datejs_to_iso_string_patch.js AMD Conversion 2012-02-06 16:41:40 -07:00
edit_rubric.js fix edit rubric button. fixes #10479 2012-09-14 10:42:35 -06:00
eportfolio.js eportfolio direct-to-s3 upload, fixes #10572 2012-09-18 10:02:12 -06:00
es5_shim.js fix ES5 shim 2012-08-30 13:45:50 -06:00
external_tools.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
facebooker.js Initial commit. 2011-01-31 18:57:29 -07:00
file_inline.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
find_outcome.js better behavior for truncateText 2012-09-25 09:55:21 -06:00
full_assignment.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
full_files.js upgrade Uploadify to 3.1.1 2012-08-14 14:49:35 -06:00
grade_summary.js revert several grade calculation changes 2012-09-18 09:20:51 -06:00
gradebook-history.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
gradebook_uploads.js make jslint settings more sane 2012-08-17 11:04:40 -06:00
gradebooks.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
grading_standards.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
groups.js basic groups api; refs #8598 2012-06-05 12:51:42 -06:00
i18n.js AMD Conversion 2012-02-06 16:41:40 -07:00
i18nObj.js load recently logged in users via ajax. fixes #5457 2012-08-03 09:22:33 -06:00
instructure.js remove out-of-order <h1 /> tags, replace w/ <h2 />. 2012-09-19 09:39:47 -06:00
instructure_helper.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
jquery.ajaxJSON.js DRY up jquery.instructure_forms.js 2012-09-11 09:32:43 -06:00
jquery.disableWhileLoading.js propery re-enable disabled elements w/o opacity set. fixes #10225 2012-08-31 15:35:11 -06:00
jquery.doc_previews.js crocodoc integration 2012-09-21 12:57:02 -06:00
jquery.dropdownList.js AMD Conversion 2012-02-06 16:41:40 -07:00
jquery.fancyplaceholder.js AMD Conversion 2012-02-06 16:41:40 -07:00
jquery.google-analytics.js fix rebase issue in google-analytics 2012-02-14 16:40:01 -07:00
jquery.inst_tree.js improve accessibility of files page. fixes #9271 2012-09-19 09:39:10 -06:00
jquery.instructure_date_and_time.js fix jquery ui datepicker styles, refs: #9247 2012-07-16 10:51:50 -06:00
jquery.instructure_forms.js onSubmit callback for formSubmit 2012-09-11 16:24:38 -06:00
jquery.instructure_jquery_patches.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
jquery.instructure_misc_helpers.js better behavior for truncateText 2012-09-25 09:55:21 -06:00
jquery.instructure_misc_plugins.js masquerading bar; closes #9477 2012-07-26 10:05:22 -06:00
jquery.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
jquery.keycodes.js AMD Conversion 2012-02-06 16:41:40 -07:00
jquery.loadingImg.js AMD Conversion 2012-02-06 16:41:40 -07:00
jquery.scrollToVisible.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
jquery.templateData.js AMD Conversion 2012-02-06 16:41:40 -07:00
jquery.toJSON.js new discussion topics/announcement index, edit and create 2012-08-17 09:26:04 -06:00
jquery.ui.menu.inputmenu.js upgrade jqueryui to 1.9b1, closes: #9493 refs: #9492 2012-08-13 10:20:06 -06:00
learning_outcome.js upgrade jquery to 1.7.2 2012-04-24 10:57:38 -06:00
learning_outcomes.js upgrade jqueryui to 1.9b1, closes: #9493 refs: #9492 2012-08-13 10:20:06 -06:00
link_enrollment.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
manage_avatars.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
manage_groups.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
mathquill.js make mathquill pass jslint 2012-05-16 15:12:22 -06:00
media_comments.js make allow/deny flash buttons for media comments clickable. 2012-08-08 09:45:57 -06:00
message_students.js Update styles on quiz pages. fixes #9802 2012-08-23 11:44:16 -06:00
moderate_quiz.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
order.js changes to allow using more things as AMD modules 2011-11-08 14:45:33 -07:00
page_views.js AMD Conversion 2012-02-06 16:41:40 -07:00
plugins.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
prerequisites_lookup.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
profile.js fix wrong password input focus on profile page, fixes #9823 2012-09-21 10:30:56 -06:00
question_bank.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
question_banks.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
quiz_arrows.js make sure not to show any "correct" arrows on surveys; refs #10154 2012-08-30 14:36:14 -06:00
quiz_history.js Update styles on quiz pages. fixes #9802 2012-08-23 11:44:16 -06:00
quiz_index.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
quiz_inputs.js enlarge input boxes to fit answers on quiz show pages. 2012-09-08 15:36:12 -06:00
quiz_rubric.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
quiz_show.js enlarge input boxes to fit answers on quiz show pages. 2012-09-08 15:36:12 -06:00
quiz_timing.js AMD Conversion 2012-02-06 16:41:40 -07:00
quizzes.js better behavior for truncateText 2012-09-25 09:55:21 -06:00
reminders.js include patch when you require 'jqueryui/draggable' 2012-04-24 16:11:51 -06:00
rubric_assessment.js better behavior for truncateText 2012-09-25 09:55:21 -06:00
saml_testing.js simple debugging feature for saml authentication 2012-02-22 10:27:53 -07:00
section.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
select_content_dialog.js new discussion topics/announcement index, edit and create 2012-08-17 09:26:04 -06:00
sis_import.js fix sis import error styles, fixes #9517 2012-07-25 10:16:30 -06:00
site_admin.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
speed_grader.js crocodoc integration 2012-09-21 12:57:02 -06:00
sub_accounts.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
submissions.js remove visible traces of anonymous peer reviews 2012-07-16 09:10:18 -06:00
submit_assignment.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
supercalc.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
syllabus.js removed tiny from common.js 2012-03-08 12:56:03 -07:00
take_quiz.js Update styles on quiz pages. fixes #9802 2012-08-23 11:44:16 -06:00
tinymce.editor_box.js added rce for editing html files closes #9667 2012-08-03 09:44:23 -06:00
tool_inline.js add tool_id and icon url to context_external_tools 2012-05-25 15:49:18 -06:00
tricktiny.js manage tiny resources ourselves 2012-02-17 09:25:47 -07:00
underscore.js organize backbone code and don't make people think about 'use!' 2012-04-21 23:00:05 -06:00
user.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
user_logins.js multi-factor authentication closes #9532 2012-08-16 13:09:07 -06:00
user_name.js don't call jquery UI methods an elements with no widget initialized 2012-08-13 10:16:54 -06:00
user_notes.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
user_sortable_name.js require -> define in public/javascripts 2012-03-05 14:19:50 -07:00
user_utils.js make jslint settings more sane 2012-08-17 11:04:40 -06:00
wiki.js revert several grade calculation changes 2012-09-18 09:20:51 -06:00
wikiSidebar.js upgrade jqueryui to 1.9b1, closes: #9493 refs: #9492 2012-08-13 10:20:06 -06:00