mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Remember last editor chosen. Props mdawaffe. fixes #3978
git-svn-id: https://develop.svn.wordpress.org/trunk@6567 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -523,6 +523,7 @@ function switchEditors(id) {
|
||||
pdr.style.height = 'auto';
|
||||
pdr.style.overflow = 'display';
|
||||
}
|
||||
wpSetDefaultEditor( 'html' );
|
||||
} else {
|
||||
edToggle(P, H);
|
||||
edCloseAllTags(); // :-(
|
||||
@@ -557,6 +558,7 @@ function switchEditors(id) {
|
||||
pdr.style.height = 'auto';
|
||||
pdr.style.overflow = 'display';
|
||||
}
|
||||
wpSetDefaultEditor( 'tinymce' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,6 +570,19 @@ function edToggle(A, B) {
|
||||
A.onclick = null;
|
||||
}
|
||||
|
||||
function wpSetDefaultEditor( editor ) {
|
||||
try {
|
||||
editor = escape( editor.toString() );
|
||||
} catch(err) {
|
||||
editor = 'tinymce';
|
||||
}
|
||||
|
||||
var userID = document.getElementById('user-id');
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(10*365*24*60*60*1000));
|
||||
document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString();
|
||||
}
|
||||
|
||||
function wpautop(pee) {
|
||||
pee = pee + "\n\n";
|
||||
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
|
||||
|
||||
Reference in New Issue
Block a user