Merge branch 'develop' of github.com:ether/etherpad-lite into develop

pull/1238/head
John McLear 2012-11-21 10:00:19 -08:00
commit 067e02e9d0
3 changed files with 28 additions and 14 deletions

View File

@ -259,7 +259,7 @@ linestylefilter.getRegexpFilter = function(regExp, tag)
linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/;
linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')');
linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#!;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')');
linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:|www\.)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g');
linestylefilter.getURLFilter = linestylefilter.getRegexpFilter(
linestylefilter.REGEX_URL, 'url');

View File

@ -21,4 +21,27 @@ describe("urls", function(){
return inner$("div").first().find("a").length === 1;
}, 2000).done(done);
});
it("when you enter a url containing a !, it becomes clickable and contains the whole URL", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
//get the first text element out of the inner iframe
var firstTextElement = inner$("div").first();
var url = "http://etherpad.org/!foo";
// simulate key presses to delete content
firstTextElement.sendkeys('{selectall}'); // select all
firstTextElement.sendkeys('{del}'); // clear the first line
firstTextElement.sendkeys(url); // insert a URL
helper.waitFor(function(){
if(inner$("div").first().find("a").length === 1){ // if it contains an A link
if(inner$("div").first().find("a")[0].href === url){
return true;
}
};
}, 2000).done(done);
});
});

View File

@ -21,12 +21,8 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected');
$language.change();
var localizedEventFired = false;
$(chrome$.window).bind('localized', function() {
localizedEventFired = true;
})
helper.waitFor(function() { return localizedEventFired;})
var current = $language.val();
helper.waitFor(function() { return $language.val() != current}) // GOT IT?
.done(function(){
//get the value of the bold button
var $boldButton = chrome$(".buttonicon-bold").parent();
@ -56,12 +52,8 @@ describe("Language select and change", function(){
$languageoption.attr('selected','selected');
$language.change();
var localizedEventFired = false;
$(chrome$.window).bind('localized', function() {
localizedEventFired = true;
})
helper.waitFor(function() { return localizedEventFired;})
var current = $language.val();
helper.waitFor(function() { return $language.val() != current})
.done(function(){
//get the value of the bold button
@ -78,4 +70,3 @@ describe("Language select and change", function(){
});
});