Skip to content

Commit

Permalink
Merge pull request #8343 from pvnr0082t/Rantjs
Browse files Browse the repository at this point in the history
add rantjs w/ git autoupdate
  • Loading branch information
PeterDaveHello committed Jul 29, 2016
2 parents fd7dd80 + b8c7201 commit f2fbaa5
Show file tree
Hide file tree
Showing 45 changed files with 6,959 additions and 0 deletions.
636 changes: 636 additions & 0 deletions ajax/libs/rantjs/0.8.0/rant.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ajax/libs/rantjs/0.8.0/rant.min.js

Large diffs are not rendered by default.

636 changes: 636 additions & 0 deletions ajax/libs/rantjs/0.8.1/rant.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ajax/libs/rantjs/0.8.1/rant.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ajax/libs/rantjs/0.8.2/rant.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.8.2/rant.min.js
3 changes: 3 additions & 0 deletions ajax/libs/rantjs/0.8.3/rant.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.8.3/rant.min.js
3 changes: 3 additions & 0 deletions ajax/libs/rantjs/0.8.4/rant.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.8.4/rant.min.js
4 changes: 4 additions & 0 deletions ajax/libs/rantjs/0.8.5/rant.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.8.5/rant.min.js
4 changes: 4 additions & 0 deletions ajax/libs/rantjs/0.8.6/rant.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.8.6/rant.min.js
83 changes: 83 additions & 0 deletions ajax/libs/rantjs/0.9.0/rant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
String.prototype.toTitleCase = function() {
var i, j, str, lowers, uppers;
str = this.replace(/([^\W_]+[^\s-]*) */g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});

// Certain minor words should be left lowercase unless they are the first or last words in the string
lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'];
for (i = 0, j = lowers.length; i < j; i++)
str = str.replace(new RegExp('\\s' + lowers[i] + '\\s', 'g'),
function(txt) {
return txt.toLowerCase();
});

// Certain words should be left uppercase
uppers = ['Id', 'Tv', 'Lsd'];
for (i = 0, j = uppers.length; i < j; i++)
str = str.replace(new RegExp('\\b' + uppers[i] + '\\b', 'g'),
uppers[i].toUpperCase());

return str;
};

String.prototype.toWordCase = function() {
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

String.prototype.toSentenceCase = function() {
var re = /(^\s*\w{1}|\.\s*\w{1})/gi;
return this.replace(re, function(str) {
return str.toUpperCase();
});
};



function rant(inputStream) {
var outputStream = inputStream, re;
var regex = /\<(.*?)\>/g;
var matches, token, indexPos;
var replacement, i = 0, tags = {};
var repetitions = [];
var separator = [];
var stringCase = require("./getCase")(inputStream);
outputStream = inputStream.toLowerCase(), regex = /(\[.*?\])/g;
while (matches = regex.exec(inputStream)) {
// [rep:4][sep:\s]{\8,x}
re = new RegExp("\\w+", "g");
token = matches[1].match(re);
if (token[0] === "sep") {
separator.push(token[1]);
//separator=matches[0].match(/[^[\](sep:)]+(?=])/)[0];
}
if (token[0] === "rep") {
repetitions.push(token[1]);
}
}
repetitions.reverse();
separator.reverse();

// remove the brackets
while (matches = regex.exec(inputStream)) {
inputStream = inputStream.replace(/(\[.*?\])/g, '');
}

// instructions in the brackets will only be applied to tokens matched in curly braces
regex = /(\{.*?\})/;
var res = "";
var curlymatch;

while (curlymatch = regex.exec(inputStream)) {
replacement = require("./braceParser")(inputStream, curlymatch[1], repetitions, separator);
inputStream = inputStream.replace(curlymatch[1], replacement);
}

// lexer matches (anything inside arrow notation)
outputStream = require("./lexer")(inputStream);

return require("./capitalize")(outputStream, stringCase);
}

module.exports = rant;
1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.9.0/rant.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions ajax/libs/rantjs/0.9.1/rant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
String.prototype.toTitleCase = function() {
var i, j, str, lowers, uppers;
str = this.replace(/([^\W_]+[^\s-]*) */g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});

// Certain minor words should be left lowercase unless they are the first or last words in the string
lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'];
for (i = 0, j = lowers.length; i < j; i++)
str = str.replace(new RegExp('\\s' + lowers[i] + '\\s', 'g'),
function(txt) {
return txt.toLowerCase();
});

// Certain words should be left uppercase
uppers = ['Id', 'Tv', 'Lsd'];
for (i = 0, j = uppers.length; i < j; i++)
str = str.replace(new RegExp('\\b' + uppers[i] + '\\b', 'g'),
uppers[i].toUpperCase());

return str;
};

String.prototype.toWordCase = function() {
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

String.prototype.toSentenceCase = function() {
var re = /(^\s*\w{1}|\.\s*\w{1})/gi;
return this.replace(re, function(str) {
return str.toUpperCase();
});
};



function rant(inputStream) {
var outputStream = inputStream, re;
var regex = /\<(.*?)\>/g;
var matches, token, indexPos;
var replacement, i = 0, tags = {};
var repetitions = [];
var separator = [];
var stringCase = require("./getCase")(inputStream);
outputStream = inputStream.toLowerCase(), regex = /(\[.*?\])/g;
while (matches = regex.exec(inputStream)) {
// [rep:4][sep:\s]{\8,x}
re = new RegExp("\\w+", "g");
token = matches[1].match(re);
if (token[0] === "sep") {
separator.push(token[1]);
//separator=matches[0].match(/[^[\](sep:)]+(?=])/)[0];
}
if (token[0] === "rep") {
repetitions.push(token[1]);
}
}
repetitions.reverse();
separator.reverse();

// remove the brackets
while (matches = regex.exec(inputStream)) {
inputStream = inputStream.replace(/(\[.*?\])/g, '');
}

// instructions in the brackets will only be applied to tokens matched in curly braces
regex = /(\{.*?\})/;
var res = "";
var curlymatch;

while (curlymatch = regex.exec(inputStream)) {
replacement = require("./braceParser")(inputStream, curlymatch[1], repetitions, separator);
inputStream = inputStream.replace(curlymatch[1], replacement);
}

// lexer matches (anything inside arrow notation)
outputStream = require("./lexer")(inputStream);

return require("./capitalize")(outputStream, stringCase);
}

module.exports = rant;
1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.9.1/rant.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions ajax/libs/rantjs/0.9.2/rant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
String.prototype.toTitleCase = function() {
var i, j, str, lowers, uppers;
str = this.replace(/([^\W_]+[^\s-]*) */g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});

// Certain minor words should be left lowercase unless they are the first or last words in the string
lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'];
for (i = 0, j = lowers.length; i < j; i++)
str = str.replace(new RegExp('\\s' + lowers[i] + '\\s', 'g'),
function(txt) {
return txt.toLowerCase();
});

// Certain words should be left uppercase
uppers = ['Id', 'Tv', 'Lsd'];
for (i = 0, j = uppers.length; i < j; i++)
str = str.replace(new RegExp('\\b' + uppers[i] + '\\b', 'g'),
uppers[i].toUpperCase());

return str;
};

String.prototype.toWordCase = function() {
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

String.prototype.toSentenceCase = function() {
var re = /(^\s*\w{1}|\.\s*\w{1})/gi;
return this.replace(re, function(str) {
return str.toUpperCase();
});
};



function rant(inputStream) {
var outputStream = inputStream, re;
var regex = /\<(.*?)\>/g;
var matches, token, indexPos;
var replacement, i = 0, tags = {};
var repetitions = [];
var separator = [];
var stringCase = require("./getCase")(inputStream);
outputStream = inputStream.toLowerCase(), regex = /(\[.*?\])/g;
while (matches = regex.exec(inputStream)) {
// [rep:4][sep:\s]{\8,x}
re = new RegExp("\\w+", "g");
token = matches[1].match(re);
if (token[0] === "sep") {
separator.push(token[1]);
//separator=matches[0].match(/[^[\](sep:)]+(?=])/)[0];
}
if (token[0] === "rep") {
repetitions.push(token[1]);
}
}
repetitions.reverse();
separator.reverse();

// remove the brackets
while (matches = regex.exec(inputStream)) {
inputStream = inputStream.replace(/(\[.*?\])/g, '');
}

// instructions in the brackets will only be applied to tokens matched in curly braces
regex = /(\{.*?\})/;
var res = "";
var curlymatch;

while (curlymatch = regex.exec(inputStream)) {
replacement = require("./braceParser")(inputStream, curlymatch[1], repetitions, separator);
inputStream = inputStream.replace(curlymatch[1], replacement);
}

// lexer matches (anything inside arrow notation)
outputStream = require("./lexer")(inputStream);

return require("./capitalize")(outputStream, stringCase);
}

module.exports = rant;
1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.9.2/rant.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions ajax/libs/rantjs/0.9.3/rant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
String.prototype.toTitleCase = function() {
var i, j, str, lowers, uppers;
str = this.replace(/([^\W_]+[^\s-]*) */g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});

// Certain minor words should be left lowercase unless they are the first or last words in the string
lowers = ['A', 'An', 'The', 'And', 'But', 'Or', 'For', 'Nor', 'As', 'At',
'By', 'For', 'From', 'In', 'Into', 'Near', 'Of', 'On', 'Onto', 'To', 'With'];
for (i = 0, j = lowers.length; i < j; i++)
str = str.replace(new RegExp('\\s' + lowers[i] + '\\s', 'g'),
function(txt) {
return txt.toLowerCase();
});

// Certain words should be left uppercase
uppers = ['Id', 'Tv', 'Lsd'];
for (i = 0, j = uppers.length; i < j; i++)
str = str.replace(new RegExp('\\b' + uppers[i] + '\\b', 'g'),
uppers[i].toUpperCase());

return str;
};

String.prototype.toWordCase = function() {
return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
};

String.prototype.toSentenceCase = function() {
var re = /(^\s*\w{1}|\.\s*\w{1})/gi;
return this.replace(re, function(str) {
return str.toUpperCase();
});
};



function rant(inputStream) {
var outputStream = inputStream, re;
var regex = /\<(.*?)\>/g;
var matches, token, indexPos;
var replacement, i = 0, tags = {};
var repetitions = [];
var separator = [];
var stringCase = require("./getCase")(inputStream);
outputStream = inputStream.toLowerCase(), regex = /(\[.*?\])/g;
while (matches = regex.exec(inputStream)) {
// [rep:4][sep:\s]{\8,x}
re = new RegExp("\\w+", "g");
token = matches[1].match(re);
if (token[0] === "sep") {
separator.push(token[1]);
//separator=matches[0].match(/[^[\](sep:)]+(?=])/)[0];
}
if (token[0] === "rep") {
repetitions.push(token[1]);
}
}
repetitions.reverse();
separator.reverse();

// remove the brackets
while (matches = regex.exec(inputStream)) {
inputStream = inputStream.replace(/(\[.*?\])/g, '');
}

// instructions in the brackets will only be applied to tokens matched in curly braces
regex = /(\{.*?\})/;
var res = "";
var curlymatch;

while (curlymatch = regex.exec(inputStream)) {
replacement = require("./braceParser")(inputStream, curlymatch[1], repetitions, separator);
inputStream = inputStream.replace(curlymatch[1], replacement);
}

// lexer matches (anything inside arrow notation)
outputStream = require("./lexer")(inputStream);

return require("./capitalize")(outputStream, stringCase);
}

module.exports = rant;
1 change: 1 addition & 0 deletions ajax/libs/rantjs/0.9.3/rant.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2fbaa5

Please sign in to comment.