Skip to content

Commit

Permalink
Fix IE8 issues with string.trim and such
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hirtle committed Oct 22, 2012
1 parent 0309f05 commit 9e282e1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/js/IssueManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ define([
};

function getFilterInputValue() {
return $("#issueFilter").val().trim();
return $.trim($("#issueFilter").val());
}

IssueManager.prototype.resetFilters = function () {
Expand Down
6 changes: 3 additions & 3 deletions public/js/ProjectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function ($, _, ko, timeago, tooltips, util, Issue, Notifier, UserManager, Messa
};

function isCommand(input) {
return input.trim().charAt(0) === "/";
return $.trim(input).charAt(0) === "/";
}

function ArgError(message) {
Expand Down Expand Up @@ -143,8 +143,8 @@ function ($, _, ko, timeago, tooltips, util, Issue, Notifier, UserManager, Messa

try {
var matches = input.match(/[:\/]([\S]+)(?:\s+(.*))?/);
var cmd = matches[1] && matches[1].trim();
var rest = matches[2] && matches[2].trim();
var cmd = matches[1] && $.trim(matches[1]);
var rest = matches[2] && $.trim(matches[2]);

var id;
switch (cmd.toLowerCase()) {
Expand Down
8 changes: 4 additions & 4 deletions public/js/TagFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ define(['underscore', 'ko'], function (_, ko) {

var TagState = {
off: -1,
default: 0,
'default': 0,
on: 1
};

function TagFilter(label) {
this.label = label;
this.state = ko.observable(TagState.default);
this.state = ko.observable(TagState['default']);
}

TagFilter.prototype.getSymbol = function () {
Expand All @@ -23,7 +23,7 @@ define(['underscore', 'ko'], function (_, ko) {
};

TagFilter.prototype.isActive = function () {
return this.state() !== TagState.default;
return this.state() !== TagState['default'];
};

TagFilter.prototype.toggle = function () {
Expand All @@ -41,7 +41,7 @@ define(['underscore', 'ko'], function (_, ko) {

TagFilter.resetAll = function (tagFilters) {
_.each(tagFilters, function (tagFilter) {
tagFilter.state(TagState.default);
tagFilter.state(TagState['default']);
});
};

Expand Down
2 changes: 1 addition & 1 deletion public/js/UserManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define(['jquery', 'ko', 'underscore', 'util'], function ($, ko, _, util) {
UserManager.prototype.attemptLogin = function () {
this.invalidName(false);
var name = this.$nameInput.val();
if (!name || name.trim().length < 3) { // TODO: disallow other chars?
if (!name || $.trim(name).length < 3) { // TODO: disallow other chars?
this.invalidName(true);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require(['jquery', 'ko'], function ($, ko) {
var viewModel = {
error: ko.observable(),
submitForm: function (form) {
var name = $('#projectNameInput').val().trim();
var name = $.trim($('#projectNameInput').val());
if (!name || name.length < 3) {
this.error('Why so terse? You can do better.');
return false;
Expand Down

0 comments on commit 9e282e1

Please sign in to comment.