As I spend more time on Google Plus I am starting to see some very annoying trends. People are not very polite. I love the whole concept of making connections and getting to know people all of the world, and have been doing so online since 1996. Back when I started, people knew how to be polite and they took the time to do so. We had way fewer tools then than we do now, yet we still managed to have lasting friendships.
Since I figure it would be rude of me to hold it all in and not help other people learn, I would like to share the following tips for communicating with an American on Google Plus.
1. First and foremost: Do not start a chat with someone if you have not read their profile.
1a. Don't ask me where I'm from. It is in my profile. I don't mind discussing my location, but please know where I live before you decide to discuss it. In fact, I don't even mind if you show up at my door. I am more than happy to entertain guests and meet new people. I can't promise I'll be wearing clothes when I answer the door though.
1b. Don't ask me if I am a male. It is in my profile. Also, there is no good reason to open up a discussion with a stranger by asking their gender.
1bA. Please make sure you are aware of my gender before you start flirting with me.
2. Use full complete sentences. Do not use txt speak. I don't care if you are chatting me from a mobile, take the time to type it right. This is especially true if you are in any line of professional work. Saying "Hw r u" is the equivalent of asking a pregnant woman if she has enjoyed gaining weight. You just don't do it.
2a. If you don't include vowels in your words, it is likely I will return the favor. t mks t vry hrd t ndrstnd smtms. Ls, t ts annng. N th pls sd t svs wr nd tr n th l' kbrd.
3. If English is not your first language then please be understanding and make sure you are saying what you think you are saying.
3a. I will try to do my absolute best to return the favor. If you are not sure of what I said or meant PLEASE do not hesitate to ask for clarification. I don't mind. In fact, I appreciate it. People who grew up speaking American English don't understand me, so I sure don't expect someone from another country to.
3b. I do my best to act like a stupid American (hey, I live here, might as well get some benefit out of it), but believe it or not I love learning your language. I would love simple sentences in your language so that I have a chance to learn. I am horrible with languages so I probably won't be able to learn, but I still like to try!
4. Related to #1 above, please remember what time zone you are in and compare it to the time zone I am in. The chances are good that I will not be available to chat if you msg me at 09:00 UTC.
4a. I am currently working on developing programs for Android phones. As such I own 8 different devices which no matter how hard I try, love to sign into G+ all hours of the day regardless if I am awake or sleeping. Given that it is also hard to remember to mute all of them, if you chat me when I am asleep you will almost certainly wake me up. I'd really prefer it if you didn't. Especially if you did not follow tip #1.
5. Spam. Why spam. Do you people really need to ruin this wonderful thing called Google Plus? I have received several tags where the messages all say the same thing but in different languages. I am on to you.
5a. If are not a spammer, but feel compelled to ask how I am by tagging me then PLEASE start off in English. "Ahoj, +Jeff Feely, co je nového?" Is not useful. Neither is, "Ehi, +Jeff Feely, come va?" or even "Hi +Jeff Feely, how're you?". Unless I am missing something they all mean the same thing and make me think that someone is probing for something or something. I'm on to you.
6. I really do appreciate all of you who have followed me. I will do my best to circle you back, but it usually takes a while. I even have special circles for people who I have no clue who you are or how we are connected. It works great. Actually, I have three of them now. Crazy.
6a. If you post animated Gifs I am un-circling you. They are really bloody annoying and 99.99999% aren't worth watching unless you are a male 8 year old who thinks bathroom humor is the most amazing thing in the world.
7. Last but not least. Tagging. Please don't tag me if there isn't any direct reason to do so. I really am not interested in your economical report you wrote in college. Please don't tag me in photos if I or someone I know is not in the photo. The chances are extremely good I have already seen it as the main thing I do on here is look at the photo stream (I leave it open on one monitor while I program).
7a. On the off chance you want me to critique a photo, please ask me first. I will be more than happy to do so, or answer any questions. Please understand that I will be brutally honest though. I don't see any point in critiquing artwork if it doesn't help the author learn in someway. Please understand that I generally look at thousands of pictures a day so if I don't share an emotional response such as "I love it" or "I like what you did there" don't be hurt. Conversely, if I do then please take to heart that I meant it. I am not fake.
If you read this far, then thank you. I hope I will have the chance to talk to you some day.
Transcending Experimental Apathy
Or how I learned to love the blog.
Friday, February 24, 2012
Wednesday, January 25, 2012
Encrypting Transmissions between JavaScript and PHP Part 3: Decrypting with PHP
Welcome to Part3 of Encrypting Transmissions between JavaScript and PHP. You can see the previous parts at: Part 1 Part 2
There are just four easy steps to go through in order to decrypt the string from Part 2.
As with JavaScript, let's start off by getting the private key loaded into PHP. Oddly enough, you can do it exactly the same way:
Next we utilize the PHP OpenSSL library to convert the key string into a resource.
There are just four easy steps to go through in order to decrypt the string from Part 2.
As with JavaScript, let's start off by getting the private key loaded into PHP. Oddly enough, you can do it exactly the same way:
$key = "-----BEGIN RSA PRIVATE KEY-----I probably should have used a shorter key length for the demo. Oh well. Oh, a word on security. Embedding your private key actually is a problem if you aren't being extra careful. It might be wiser to read your key in from a file. You can find documentation on how to do this in the PHP OpenSSL Documentation.
MIIEowIBAAKCAQEA3sZto3ZI4vmtMv0Vx+OaliJ/EeVnQ7R+rX8bya+zzoI/S2f7
gD+K/xNK/AD6RZ0Q1dgJ8+Nl1N+DLyDzWvLoFTNbmNJeo+j3VM5I0xXpWeETMtRG
cYysogZILprICezZM5CfC7awAh36xJD35v6mXkwWkAq2QShQDApMJyoFJI2x9DeD
oRIwgMh5pWSaNsfFRJqGaNhWHPZNILkc/PfEeI3JZEjYO7+Bpdgo7VD5jbbPv7R1
xtwko1IClhgPA3jizuQJQnaJL9G6T+MjStXG5mdfnz2oTKBOIFMzblHSlqOYDnhP
7Jbh0x0xE5dPaQQ0fsMxJqWEkDNIcfhWv8BkfQIDAQABAoIBAQCf1AcXDqcOSQlN
GqyEw7PF4Sv/f/GNbrKv8RDTq346O9IDXK/g/DXR+VqD4IOubBiHA79oPg5yIoXw
yxgteTau9zDRPKTvvhWsv28aGo9Xj5aBkjCUCNRWTmF9Jkk8bbQLPcgN1F0Et9OR
MVzaWnqsDrTlVPobVzvO15h5RLl51eOZDHZ1enrIR6gqVksloyVfoWY15Vhdx89k
jbcJ7EMvhQRLZZwIWoP1YIeP/JkREiMju8dMFGazhagZ/ejScCXy+M0LdHMe0Ow2
g5Sx9XYTxCBDj2ReONzVxiih7ZfB0QBT3+ITZIHkEbmXx93azZ98C5v5txTfxBLO
gIN0k1QBAoGBAP8t27t5qMwpEo8dZADo0NC7+qCusENMo4v2YWkyqdYTH2tLNwFK
PpbDuYuqqBClpbKKgUvQOsVaIWRM8Y58r9LiOQTHRfOmYI5W7b9uAj4t2DXP35wj
SdoSV8cBusf/bHd1w8nSAf16e2d5LmFnvIg5zmad8m5vyiWYjE64/8d9AoGBAN99
4pDXrmJ1yMNQVCeT9X2UxG56T18JnxCywE5rSJK5/uPnAGi6d20FV/JDpPe07hOv
lvJzcbYYWvPB0bVw1TkteJsVRmGWo7rwqBpNkofcBNOaEQivOYwv5Yiz97OB5URR
umYauFGI4PUrDH+jn+rlIW/TNtIpkwHqzKgzZ6EBAoGAR4bRKrGlUOTKYPc6Cs83
iOrIC7YrjhGzXg4Hq/cZh/oAOpDwsBnhhV0Da1TAmznzQiJ0r42Ei8EBzx2KMAhf
OFtU5DP/NZaTRhKzvY7WbhtnmV3VLezuTIQLuqqPcnP0MV//K1kEWcq1QIHFMGRl
gkHByx3G0JHhNbyWx5Ivj/kCgYBh5F/zFaXalsDjXDIgS9zBrwIDaiuN80brJ4C4
WKGnMzUEWlCBjvt0k1ycTyjZHzURBl5VwF9UZYKhNopGsS+UJein9T+oyzTYU0Uu
kD/YpnSuwtMnPKk2UFx37mxXAlSMAkhlJNsLS6tNeBe3aNJJLyfgNWHT2EX+Fvyh
yDJiAQKBgFnLzyAWgIECvCmBGmwAl/QK6/6w0P4CEBBt2lBTFB0dFrlkuVC2/DSY
ZLhUMtynmYZEaEreIOJqMXQfHbTUODRVrTfyKVdjvExS5SiwWENYLY/5n+lacZ/b
7iUXpuQdQPttce9IKxqo0DVg7dy7WzmFYGwCfTBTAxvaWvwFc6Pu
-----END RSA PRIVATE KEY-----";
Next we utilize the PHP OpenSSL library to convert the key string into a resource.
$res=openssl_pkey_get_private($key);If you chose to password protect your key, the syntax would instead be:
$res=openssl_pkey_get_private($key,'password');The final two steps are to Base64 decode and decrypt the encrypted text.
$text=base64_decode($_POST['encryptMe']);That is it folks. Your decrypted text is now in $decryptedText. Unless something went wrong. In which case, good luck.
openssl_private_decrypt($text,$decryptedText,$res);
Labels:
Javascript,
OpenSSL,
PHP,
Private Key,
Public Key,
RSA
Encrypting Transmissions between JavaScript and PHP Part 2: Making JavaScript encrypt the right thing using the right thing
So now that we have the keys from Part 1 we can start setting up the JavaScript portion of our party. If you have done a search for "Javascript RSA" you have probably found several different libraries that will implement it for you. Of particular note are:
https://ziyan.info/2008/10/javascript-rsa/ and http://www-cs-students.stanford.edu/~tjw/jsbn/
The former is a modified implementation of the latter. For the sake of this post we are going to use the former. For my own personal use I modified the code a little bit to make it more readable and so I could understand it better, but it doesn't change the way anything works so I'm not going to include it unless anyone wants it.
You will want to download the files rsa.js and jsbn.js and include them on your web page the way you normally do such things (i.e. <script language="JavaScript" type="text/javascript" src="jsbn.js"> and <script language="JavaScript" type="text/javascript" src="rsa.js">).
First and foremost we need to set things up to use the key. How do we read that into JavaScript? Nice and simple, we cut and paste.
Lest anyone worry about having the public key in the actual code, remember that it is the public key. People are supposed to know it. You could theoretically have the server generate a new public key with each request and embed it in the JavaScript for you, but in my opinion there is very little reason to do so unless you are super hyper paranoid or are protecting something more exciting than a user's blog. You can check out the PHP OpenSSL documentation if you would like to pursue something more in depth.
Next, we load the key into the library with:
I hope that this will save someone some trouble! Here is Part 3!
https://ziyan.info/2008/10/javascript-rsa/ and http://www-cs-students.stanford.edu/~tjw/jsbn/
The former is a modified implementation of the latter. For the sake of this post we are going to use the former. For my own personal use I modified the code a little bit to make it more readable and so I could understand it better, but it doesn't change the way anything works so I'm not going to include it unless anyone wants it.
You will want to download the files rsa.js and jsbn.js and include them on your web page the way you normally do such things (i.e. <script language="JavaScript" type="text/javascript" src="jsbn.js"> and <script language="JavaScript" type="text/javascript" src="rsa.js">).
First and foremost we need to set things up to use the key. How do we read that into JavaScript? Nice and simple, we cut and paste.
var pem="-----BEGIN PUBLIC KEY-----\You will note the \ at the end of each line. Since the key is so long you will most likely want to use a line break so you can have it on multiple lines. I recommend not having any white space before or after the \.
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3sZto3ZI4vmtMv0Vx+Oa\
liJ/EeVnQ7R+rX8bya+zzoI/S2f7gD+K/xNK/AD6RZ0Q1dgJ8+Nl1N+DLyDzWvLo\
FTNbmNJeo+j3VM5I0xXpWeETMtRGcYysogZILprICezZM5CfC7awAh36xJD35v6m\
XkwWkAq2QShQDApMJyoFJI2x9DeDoRIwgMh5pWSaNsfFRJqGaNhWHPZNILkc/PfE\
eI3JZEjYO7+Bpdgo7VD5jbbPv7R1xtwko1IClhgPA3jizuQJQnaJL9G6T+MjStXG\
5mdfnz2oTKBOIFMzblHSlqOYDnhP7Jbh0x0xE5dPaQQ0fsMxJqWEkDNIcfhWv8Bk\
fQIDAQAB\
-----END PUBLIC KEY-----";
Lest anyone worry about having the public key in the actual code, remember that it is the public key. People are supposed to know it. You could theoretically have the server generate a new public key with each request and embed it in the JavaScript for you, but in my opinion there is very little reason to do so unless you are super hyper paranoid or are protecting something more exciting than a user's blog. You can check out the PHP OpenSSL documentation if you would like to pursue something more in depth.
Next, we load the key into the library with:
var key = RSA.getPublicKey(pem);Now things are ready to go. The actual code to encrypt something is :
encryptedText=RSA.encrypt(stringToBeEncrypted, key);How you choose to go about implementing that is up to you since there are quite a few usable ways, but here is a simple example:
<SCRIPT>
function encryptData(){
element=document.getElementById('encryptMe');
element.value=RSA.encrypt(element.value, key);
}
</SCRIPT>
<FORM ACTION='decrypt.php' METHOD='POST' id='txtAuth' onsubmit='encryptData()'>";
<INPUT type='text' name='encryptMe' id='encryptMe'></INPUT>
<input name='txtSubmit' type='submit' id='txtSubmit' value='Submit'>"; </FORM>";
I hope that this will save someone some trouble! Here is Part 3!
Labels:
Javascript,
OpenSSL,
PHP,
Private Key,
Public Key,
RSA
Encrypting Transmissions between JavaScript and PHP Part 1: Creating a useful OpenSSL RSA private/public key pair
I am working on configuring my web pages to encrypt a user's password when they log in to a web page. At the moment I do not have the luxury of using HTTPS so I am focusing on using JavaScript to encrypt just the password using a RSA public key and decrypting it on the server side in PHP using the private key.
I had a hard time finding instructions for creating OpenSSL private/public key pairs that covered everything all in one place so I figured I would document what I have learned so I don't have to search for it again in 4 years the next time I need to do it.
Assuming you already have the latest version of OpenSSL installed, run the following commands from the command line. I am using 2048 bit keys, if you wish you may substitute a different number in the instructions below. Also, I am not encrypting the keys. For my purposes it is pointless as the password would be stored with the key.
1. openssl genrsa -out privateKey.pem -f4 2048
4. openssl req -new -x509 -key privateKey.pem -out privateKey.x509 -days 1095
As a quick refresher, you use the private key for the following:
I had a hard time finding instructions for creating OpenSSL private/public key pairs that covered everything all in one place so I figured I would document what I have learned so I don't have to search for it again in 4 years the next time I need to do it.
Assuming you already have the latest version of OpenSSL installed, run the following commands from the command line. I am using 2048 bit keys, if you wish you may substitute a different number in the instructions below. Also, I am not encrypting the keys. For my purposes it is pointless as the password would be stored with the key.
1. openssl genrsa -out privateKey.pem -f4 2048
- This creates the initial private key. the -f4 option signifies that the public exponent should be 10001
- This derives a public key from our private key
- This derives the modulus from the private key
4. openssl req -new -x509 -key privateKey.pem -out privateKey.x509 -days 1095
- x509 self signed certificate
- normal certificate request for if you need to get an official certificate
As a quick refresher, you use the private key for the following:
- decrypt content encrypted with your public key
- sign (encrypt) content to be verified with your public key
- encrypt content to be decrypted by the private key
- verify content signed by the private key
For my purposes, I will be using the public key to encrypt content sent from a user's web browser via javascript, and using the public key to decrypt it on the server side via PHP. Check out Part 2 Next!
Labels:
Javascript,
OpenSSL,
PHP,
Private Key,
Public Key,
RSA
Wednesday, January 18, 2012
window.getSelection()
This post will focus on test cases for the javascript (well, DOM) function window.getSelection().
Test case: <DIV id="edit" contenteditable>One Two Three Four</DIV>
1.
Test case: <DIV id="edit" contenteditable>One Two Three Four</DIV>
1.
- Select "Two".
- window.getSelection().anchorNode.nodeValue="One Two Three Four"
- window.getSelection().baseNode.nodeValue="One Two Three Four"
- window.getSelection().extentNode.nodeValue="One Two Three Four"
- window.getSelection().focusNode.nodeValue="One Two Three Four"
- window.getSelection().anchorOffset=4
- window.getSelection().baseOffset=4
- window.getSelection().extentOffset=7
- window.getSelection().focusOffset=7
- With "Two" Selected, run document.execCommand('bold').
- window.getSelection().anchorNode.nodeValue="Two"
- window.getSelection().baseNode.nodeValue="One "
- window.getSelection().extentNode.nodeValue="Two"
- window.getSelection().focusNode.nodeValue="Two"
- window.getSelection().anchorOffset=0
- window.getSelection().baseOffset=4
- window.getSelection().extentOffset=3
- window.getSelection().focusOffset=3
- Select "Three".
- window.getSelection().anchorNode.nodeValue=" Three Four"
- window.getSelection().baseNode.nodeValue=" Three Four"
- window.getSelection().extentNode.nodeValue=" Three Four"
- window.getSelection().focusNode.nodeValue=" Three Four"
- window.getSelection().anchorOffset=1
- window.getSelection().baseOffset=1
- window.getSelection().extentOffset=6
- window.getSelection().focusOffset=6
- Select "Four" and run document.execCommand('bold').
- window.getSelection().anchorNode.nodeValue="Four"
- window.getSelection().baseNode.nodeValue=" Three "
- window.getSelection().extentNode.nodeValue=" Four "
- window.getSelection().focusNode.nodeValue=" Four "
- window.getSelection().anchorOffset=0
- window.getSelection().baseOffset=7
- window.getSelection().extentOffset=4
- window.getSelection().focusOffset=4
- Position cursor immediately after "Four" and press enter. Then Select "Four"
- window.getSelection().anchorNode.nodeValue="Four"
- window.getSelection().baseNode.nodeValue=" Three "
- window.getSelection().extentNode.nodeValue=" Four "
- window.getSelection().focusNode.nodeValue=" Four "
- window.getSelection().anchorOffset=0
- window.getSelection().baseOffset=7
- window.getSelection().extentOffset=4
- window.getSelection().focusOffset=4
Javascript execCommand()
I am writing a program (don't want to say what yet) that is largely reinventing many wheels in the programming world. I know I am making my life harder than it needs to be, but I am gaining the following:
1. I am learning way more than I would have other wise.
2. I know exactly how every part of my program works, and why it works the way it does.
3. I don't have to pay anyone for anything.
4. I avoid situations like what I encountered tonight.
One of the components of my program is a rich text editor. I did my research, and basically gave up to download a pre-built editor. I started in on implementing it, when I discovered the cost to use it was going to be $300ish a year. Given the budgetary concerns listed in point 3 I went back to the idea of doing it myself. What I discovered is that all the tutorials I could find were making things way harder than they needed to be. I started over from scratch and very quickly made a working prototype. Is it perfect? No. Do I still need to work through a lot of issues I wouldn't have had to otherwise? Yes. Would I still be sitting in a corner crying if I hadn't? Yes.
Of interesting note is the fact that one of the top results for execCommand returned a javascript reference for IE 4.
Anyway, here is some useful reference I've compiled for execCommand() in javascript that doesn't seem to be put in one place in a simple manor anywhere else. Hope it saves someone the hours it would have saved me. These are all valid for Chrome 16. Your mileage will vary with other browsers.
The phrase "current selection" can refer to any length of selection, even 0. In other words it can also mean current cursor (caret) position.
All references below assume the use of a <DIV> tag with contenteditable set such as:
<DIV id="imeditable" contenteditable></DIV>
All references below to using the default UI need to be updated as they don't work in Chrome. Bah.
The method itself:
-returns true on success, false on failure
Commands:
BackColor - Sets the background color of the current selection.
Bold - Toggles the current selection between bold and non-bold OR Toggles bold/non-bold for future typing at cursor position. *note: depending on implementation, the former case will continue in bold for future typing if it is not toggled off, or if the cursor is placed back on a bold section or immediately adjacent.
CreateLink - Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.
Delete - Deletes current selection.
FontName - Sets the font family for the current selection OR future typing
FontSize - Sets the font size for the current selection OR future typing
ForeColor - Sets the foreground (i.e. font) color of the current selection
FormatBlock - Sets the current block format tag. Possible Values: "address", "div", "h1", "h2", "h3", "h4", "h5", "h6", "listing", "p", "pre", "xmp","li", "dt", "dd", "p"
Indent - Increases the indent of the selected text by one indent increment
InsertHorizontalRule - Inserts a Horizontal Rule
InsertImage - Inserts an Image
InsertOrderedList - Toggles the text selection between an ordered list and a normal block
InsertParagraph - Inserts a paragraph break
InsertUnorderedList - Toggles the text selection between an unordered list and a normal block
Italic - Toggles the current selection between italic and non-italic
JustifyCenter - Aligns the current selection to the center
JustifyFull - Aligns the current selection to be fully justified
JustifyNone - Aligns the current selection to the nothing
JustifyLeft - Aligns the current selection to the left
JustifyRight - Aligns the current selection to the center
Outdent - Decreases the indentation of the current selection by one indentation increment (i.e. the opposite of indent)
Print - Opens the print dialog
Redo - Steps forward one step in the undo history
RemoveFormat - Removes the formatting tags from the current selection
SelectAll - Selects All
Strikethrough - Draws a line through the middle of the current selection
Subscript - Lowers the current selection to the subscript position
Superscript - Raises the current selection to the superscript position
Underline - Toggles the current selection between underlined and not underlined
Undo - Undo the previous action
Unlink - Removes any hyperlink from the current selection
Unselect - Clears the current selection
Useful Reference:
Rich-Text Editing in Mozilla
https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla
MSDN Command Identifiers
http://msdn.microsoft.com/en-us/library/ms533049(v=vs.85).aspx
WHATWG Dev guide for execCommand
http://developers.whatwg.org/dnd.html#execCommand
HTML Editing APIs
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
1. I am learning way more than I would have other wise.
2. I know exactly how every part of my program works, and why it works the way it does.
3. I don't have to pay anyone for anything.
4. I avoid situations like what I encountered tonight.
One of the components of my program is a rich text editor. I did my research, and basically gave up to download a pre-built editor. I started in on implementing it, when I discovered the cost to use it was going to be $300ish a year. Given the budgetary concerns listed in point 3 I went back to the idea of doing it myself. What I discovered is that all the tutorials I could find were making things way harder than they needed to be. I started over from scratch and very quickly made a working prototype. Is it perfect? No. Do I still need to work through a lot of issues I wouldn't have had to otherwise? Yes. Would I still be sitting in a corner crying if I hadn't? Yes.
Of interesting note is the fact that one of the top results for execCommand returned a javascript reference for IE 4.
Anyway, here is some useful reference I've compiled for execCommand() in javascript that doesn't seem to be put in one place in a simple manor anywhere else. Hope it saves someone the hours it would have saved me. These are all valid for Chrome 16. Your mileage will vary with other browsers.
The phrase "current selection" can refer to any length of selection, even 0. In other words it can also mean current cursor (caret) position.
All references below assume the use of a <DIV> tag with contenteditable set such as:
<DIV id="imeditable" contenteditable></DIV>
All references below to using the default UI need to be updated as they don't work in Chrome. Bah.
The method itself:
execCommand(String aCommandName, Boolean aShowDefaultUI, String aValueArgument)
-returns true on success, false on failure
Commands:
BackColor - Sets the background color of the current selection.
document.execCommand('BackColor', false, '#333333')
Bold - Toggles the current selection between bold and non-bold OR Toggles bold/non-bold for future typing at cursor position. *note: depending on implementation, the former case will continue in bold for future typing if it is not toggled off, or if the cursor is placed back on a bold section or immediately adjacent.
document.execCommand('Bold')
CreateLink - Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.
document.execCommand('CreateLink', false, 'http://www.example.com')
document.execCommand('CreateLink', true) //displays user dialog
Delete - Deletes current selection.
document.execCommand('Delete')
FontName - Sets the font family for the current selection OR future typing
document.execCommand('FontName',false,'font name')
FontSize - Sets the font size for the current selection OR future typing
document.execCommand('FontSize',false,'font size')
ForeColor - Sets the foreground (i.e. font) color of the current selection
document.execCommand('ForeColor',false,'#333333')
FormatBlock - Sets the current block format tag. Possible Values: "address", "div", "h1", "h2", "h3", "h4", "h5", "h6", "listing", "p", "pre", "xmp","li", "dt", "dd", "p"
document.execCommand('FormatBlock',false,'pre')
Indent - Increases the indent of the selected text by one indent increment
document.execCommand('Indent')
InsertHorizontalRule - Inserts a Horizontal Rule
document.execCommand('insertHorizontalRule','id for new hr')
InsertImage - Inserts an Image
document.execCommand('InsertImage',true)
document.execCommand('InsertImage',false,'path/filename/image')
InsertOrderedList - Toggles the text selection between an ordered list and a normal block
document.execCommand('InsertOrderedList',false,'id for new ol')
InsertParagraph - Inserts a paragraph break
document.execCommand('InsertParagraph',false,'id for new p')
InsertUnorderedList - Toggles the text selection between an unordered list and a normal block
document.execCommand('InsertUnorderedList',false,'id for new ul')
Italic - Toggles the current selection between italic and non-italic
document.execCommand('Italic')
JustifyCenter - Aligns the current selection to the center
document.execCommand('JustifyCenter')
JustifyFull - Aligns the current selection to be fully justified
document.execCommand('JustifyFull')
JustifyNone - Aligns the current selection to the nothing
document.execCommand('JustifyNone')
JustifyLeft - Aligns the current selection to the left
document.execCommand('JustifyLeft')
JustifyRight - Aligns the current selection to the center
document.execCommand('JustifyRight')
Outdent - Decreases the indentation of the current selection by one indentation increment (i.e. the opposite of indent)
document.execCommand('Outdent')
Print - Opens the print dialog
document.execCommand('Print', true)
Redo - Steps forward one step in the undo history
document.execCommand('Redo')
RemoveFormat - Removes the formatting tags from the current selection
document.execCommand('RemoveFormat')
SelectAll - Selects All
document.execCommand('SelectAll')
Strikethrough - Draws a line through the middle of the current selection
document.execCommand('StrikeThrough')
Subscript - Lowers the current selection to the subscript position
document.execCommand('Subscript')
Superscript - Raises the current selection to the superscript position
document.execCommand('Superscript')
Underline - Toggles the current selection between underlined and not underlined
document.execCommand('Underline')
Undo - Undo the previous action
document.execCommand('Undo')
Unlink - Removes any hyperlink from the current selection
document.execCommand('Unlink')
Unselect - Clears the current selection
document.execCommand('Unselect')
Useful Reference:
Rich-Text Editing in Mozilla
https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla
MSDN Command Identifiers
http://msdn.microsoft.com/en-us/library/ms533049(v=vs.85).aspx
WHATWG Dev guide for execCommand
http://developers.whatwg.org/dnd.html#execCommand
HTML Editing APIs
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
Welcome Back
I have been wanting to return to blogging for quite some time but have been putting it off as I am in the middle of writing some software that will include blogging capabilities. However, today it occurred to me that it really is rather silly to not use this blog for at least some of my content given the level of integration with Picasa and G+ that it has. So here I am. Hopefully this won't be the only post on here for the next year!
Thursday, January 04, 2007
Eat Alphabet Soup
Thoughts from vacation:
I love My Chemical Romance and +44. Thanks Deb!
Driving to Phoenix from Visalia isn't that bad if you stop in LA for three days on the way.
Spending 5 hours at Borders and Barnes and Noble the week before your Birthday when everything on your gift list is from those two stores is pure torture.
Claim Jumper makes the best free food.
Uninstalling a domain controller without first removing the computer accounts from it can mess things up.
Carting a 42 inch TV 1600 miles is worth it.
Sam and Melissa have the best cozy apartment.
I miss Swimming.
I had one of the best Birthdays ever.
My plan worked... I ended up with only Border's gift certificates; none to barnes and noble.
I got tons of awesome presents.
Thank you every body who put us up and took the time out of their busy schedules to spend time with us.
Mom and Dad
Rob and Candace
Gma and Gpa
John and Linda
Mary and Tim
Dan and Jennifer
Mike
Kevin White
Jen and Todd
Sharon
Sam and Melissa (special thanks to them for sacraficing their living room to us for 5 days!)
Love you all!
I love My Chemical Romance and +44. Thanks Deb!
I'm just a man,I have to take a break every now and then and remind my self that I am not a failure.
I'm not a hero
Just a boy
Driving to Phoenix from Visalia isn't that bad if you stop in LA for three days on the way.
Spending 5 hours at Borders and Barnes and Noble the week before your Birthday when everything on your gift list is from those two stores is pure torture.
Claim Jumper makes the best free food.
Uninstalling a domain controller without first removing the computer accounts from it can mess things up.
Carting a 42 inch TV 1600 miles is worth it.
Sam and Melissa have the best cozy apartment.
I miss Swimming.
I had one of the best Birthdays ever.
My plan worked... I ended up with only Border's gift certificates; none to barnes and noble.
I got tons of awesome presents.
Thank you every body who put us up and took the time out of their busy schedules to spend time with us.
Mom and Dad
Rob and Candace
Gma and Gpa
John and Linda
Mary and Tim
Dan and Jennifer
Mike
Kevin White
Jen and Todd
Sharon
Sam and Melissa (special thanks to them for sacraficing their living room to us for 5 days!)
Love you all!
Wednesday, December 20, 2006
I did it
Well, I transfered over to the new non-beta version of blogger today (since today is the official non-beta version release day). So far I can't really see any reason to have done so other than I can log in with my gmail account instead of my blogger account. Oh, and there are labels at the end of my posts now.
The one major feature that could be useful I have no use for: the ability to restrict access to select readers. In other news, Jen should be dancing a happy dance about now.
Edit: Because I have a custom blog layout I don't have a place to view all labels. Oh well. Guess it is time to make a new template.
The one major feature that could be useful I have no use for: the ability to restrict access to select readers. In other news, Jen should be dancing a happy dance about now.
Edit: Because I have a custom blog layout I don't have a place to view all labels. Oh well. Guess it is time to make a new template.
Thursday, December 07, 2006
Life and stuff
Life has been crazy. I've been working a ton trying to get a new web server up and going. I spent 3 or 4 weeks trying to get it going. you can see it at www.fresnounified.org.
We are doing Christmas in LA and New years in Phoenix. Should be exciting. I need to decide what I want to do for my birthday.
Oh, and I have finals next week. I'll be studying all weekend (aside from picking up something in bakersfield from Deb's parents).
We are doing Christmas in LA and New years in Phoenix. Should be exciting. I need to decide what I want to do for my birthday.
Oh, and I have finals next week. I'll be studying all weekend (aside from picking up something in bakersfield from Deb's parents).
Subscribe to:
Posts (Atom)