https://github.com/csb324/mcneil
Tiny plugin for making sure certain letters are lowercase no matter what
https://github.com/csb324/mcneil
Last synced: over 1 year ago
JSON representation
Tiny plugin for making sure certain letters are lowercase no matter what
- Host: GitHub
- URL: https://github.com/csb324/mcneil
- Owner: csb324
- Created: 2015-05-21T15:55:54.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-01T15:05:29.000Z (about 11 years ago)
- Last Synced: 2025-02-07T22:42:54.126Z (over 1 year ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
McNeil is a jQuery Plugin for Making Some Letters Lowercase
==================================
Ever run into a situation where using "text-transform: uppercase" ruins your whole life?
Maybe your name is "McNeil", and you need the "c" in your name to be lowercase no matter what, under penalty of death, because of a deal your great great grandfather once made with an evil sorcerer?
Maybe your new startup is called "SwIrLy", and the lowercase letters are ~vital~ to your ~branding~?
Ever wish there were a solution to this problem? McNeil has your back.
How To Improve Your Life With McNeil
====================================
### 1\. Include the file in your project.
Download mcneil.js or mcneil.min.js. Include it wherever you like to include things. While you're at it, make sure you have jquery.
### 2\. Initialize McNeil
Here's how to do that:
$('body').mcneil();
That's the simplest way. If you do that, McNeil will look for every sequence of "Mc" on your page and make sure the "c" is lowercase. What if you're dealing with something else? Don't worry!
### 3. Check out the options
Option
Default
What it does
targetString
"Mc"
This is the full string McNeil looks for.
targetIndex
2
This is the position of the letter in the string that you want to force-lowercase. Counting starts at 1, not zero, so the targetIndex of "Mc" is 2. Sorry not sorry.
inlineStyles
true
Should McNeil use inline styles to make this letter lowercase, or should McNeil use a custom class? If true, McNeil uses inline styles. If you want to do other custom styling to your target-letter, set this to false.
spanClass
"mcneil-force-lower"
If inlineStyles is false, this is the class that McNeil adds to the newly-created with your letter. It then appends a style tag to the head of your document, forcing the stuff with this class to be lowercase. Change it if you want to.
For example, suppose I have a friend named Cynthia, and I'm making her a website. She really wants the "i" in her name to be lowercase no matter what, because she's an artist and she thinks it will look creative, but I'm using "text-transform: uppercase" on some header elements where I mention her name.
This would be a big problem if not for the magic of McNeil!
I include McNeil and add this to my javascript:
$(document).ready(function() {
$('body').mcneil({
targetString: "Cynthia",
targetIndex: 6
});
})
Cynthia is happy, and we go out for cupcakes and have a great afternoon.
Problems McNeil Does Not Solve
===============
1. Using caps lock
2. Startups thinking it's even a good idea to call themselves "SwIrLy"
3. Loneliness