vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r19839: =[Commitbacks from 19772, 19778-19779, 1...

Committer: vad
=[Commitbacks from 19772, 19778-19779, 19783-19787, 19790-19791, 19803-19804, 19808, 19811, 19813, 19821, 19826, 19830]
_U  branches/r83.1/
U   branches/r83.1/bin/upgrading/en.dat
U   branches/r83.1/cgi-bin/LJ/User.pm
U   branches/r83.1/cgi-bin/LJ/Widget/EntryForm.pm
U   branches/r83.1/cgi-bin/ljprotocol.pl
U   branches/r83.1/htdocs/gadgets/logcom.bml
U   branches/r83.1/htdocs/js/ck/config.js
U   branches/r83.1/htdocs/js/ck/contents.css
U   branches/r83.1/htdocs/js/ck/plugins/livejournal/plugin.js
U   branches/r83.1/htdocs/js/entry.js
U   branches/r83.1/htdocs/js/esn_inbox.js
U   branches/r83.1/htdocs/js/rte.js
Property changes on: branches/r83.1
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/mobile:18667-19395
/branches/oauth:16278-17088
/branches/r74:17971
/trunk:19673,19675-19676,19682,19686-19687,19689,19691-19696,19698-19702,19704-19712,19714-19717,19721,19728,19731,19734-19736,19738-19739,19741,19744-19745,19747-19748,19751-19754,19763-19764,19766-19770,19780,19807
   + /branches/mobile:18667-19395
/branches/oauth:16278-17088
/branches/r74:17971
/trunk:19673,19675-19676,19682,19686-19687,19689,19691-19696,19698-19702,19704-19712,19714-19717,19721,19728,19731,19734-19736,19738-19739,19741,19744-19745,19747-19748,19751-19754,19763-19764,19766-19770,19772,19778-19780,19783-19787,19790-19791,19803-19804,19807-19808,19811,19813,19821,19826,19830

Modified: branches/r83.1/bin/upgrading/en.dat
===================================================================
--- branches/r83.1/bin/upgrading/en.dat	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/bin/upgrading/en.dat	2011-08-25 08:26:40 UTC (rev 19839)
@@ -2567,6 +2567,8 @@
 
 fcklang.ljcut=LiveJournal Cut
 
+fcklang.ljrepost=Repost
+
 fcklang.ljembed|staleness=1
 fcklang.ljembed=Embed Media
 
@@ -2697,13 +2699,13 @@
 
 fcklang.ljlike.button.give=10 Give
 
-fcklang.ljlike.faq=FAQ
-
 fcklang.ljlike.wizardnotice=Likes must be edited inside the Like Wizard
 
 fcklang.ljlike.wizardnoticelink=Go to like wizard
 
+fcklang.ljlike.faq=FAQ
 
+
 fcklang.ljuser.wizardnotice=User must be edited inside the User Wizard
 
 fcklang.ljuser.wizardnoticelink=Go to user wizard
@@ -2760,8 +2762,6 @@
 
 fotki.album.add.images=Add images
 
-fotki.album.upload.images=Upload images
-
 fotki.album.add.image.name=Add image name
 
 fotki.album.add.five.images=Add 5 images to your LiveJournal entry
@@ -2778,8 +2778,6 @@
 
 fotki.album.btn.upload=Upload
 
-fotki.album.image.loading=Image loading...
-
 fotki.album.upload.unknown.error=Unknown error
 
 fotki.album.stop.upload.confirm=Do you really want to stop upload and close without saving?
@@ -2804,10 +2802,6 @@
 
 fotki.album.remove_image=Remove image
 
-fotki.album.remove_photo=Remove photo
-
-fotki.album.remove_photo_desc=Remove this photo
-
 fotki.album.remove.this.image=Remove this image
 
 fotki.album.remove_album_desc=Images will be deleted and disappear from all related posts in your blog
@@ -2832,8 +2826,6 @@
 
 fotki.album.link.click.to.upload=Click to upload <br> new images
 
-fotki.album.uploading.message=Uploading...
-
 fotki.album.link.edit=Edit
 
 fotki.album.link.edit_album=Edit album
@@ -2876,60 +2868,16 @@
 
 fotki.album.select.images.size=Select images size:
 
-fotki.album.storage.title=Your storage space
+fotki.album.storage.title=Photo album: not enough space
 
 fotki.album.storage.used=Used
 
 fotki.album.your.friends.updates=Your friends updates
 
-fotki.album.user.updates=[[ljuser]]'s updates
-
 fotki.album.your_albums=Your albums
 
 fotki.album.upgrade=Upgrade
 
-fotki.storage.title_more_space=Add more storage space
-
-fotki.storage.full.message_more_space=You can add more storage space to: <br/><li>[[item1]]</li><li>[[item2]]</li><li>[[item3]]</li><br/>You can get <a [[add_link]]>more options</a>.
-
-fotki.storage.2gb.paid_account=up to 2Gb by <a [[link1]]>upgrade to paid account</a>
-
-fotki.storage.10gb.addon_storage=up to 10Gb by pay a <a [[link2]]>storage space</a>
-
-fotki.storage.15gb.permanent_account=up to 15Gb by upgrade to <a [[link3]]>permanent account</a>
-
-fotki.storage.title_prolog_space=Your storage space is near to empty
-
-fotki.storage.full.message_prolong_space=Your storage space ends [[date]]. All your images on additional space will be disabled. You can: <br/><li>[[item1]]</li><li>[[item2]]</li><li>[[item3]]</li><br/>You can:
-
-fotki.storage.10gb.addon_storage_prolong=<a [[link2]]>extend the extra space</a> with the volume of 10Gb
-
-fotki.storage.15gb.permanent_account_2=<a [[link3]]>upgrade to permanent account</a> and get up to 15Gb
-
-fotki.storage.title_free_space_out=Your storage space is near to empty
-
-fotki.storage.full.message_free_space_out=Your storage space ends [[date]]. All your images on additional space will be disabled. You can: <br/><li>[[item1]]</li><li>[[item2]]</li><li>[[item3]]</li><br/>
-
-fotki.storage.2gb.paid_account_3=up to 2Gb by <a [[link1]]>upgrade to paid account</a>
-
-fotki.storage.10gb.addon_storage_3=up to 10Gb by pay a <a [[link2]]>storage space</a>
-
-fotki.storage.15gb.permanent_account_3=up to 15Gb by upgrade to <a [[link3]]>permanent account</a>
-
-fotki.storage.title_payed_time_out=Your rent time is out.
-
-fotki.storage.full.message_payed_time_out=Your rent time is out. All your images on additional space will be deleted at [[date]]. You can: <br/><li>[[item1]]</li><li>[[item2]]</li><li>[[item3]]</li> 
-
-fotki.storage.2gb.paid_account_4=up to 2Gb by <a [[link1]]>upgrade to paid account</a>
-
-fotki.storage.10gb.addon_storage_4=up to 10Gb by pay a <a [[link2]]>storage space</a>
-
-fotki.storage.15gb.permanent_account_4=up to 15Gb by upgrade to <a [[link3]]>permanent account</a>
-
-fotki.storage.used.title=Used [[used]]
-
-fotki.storage.used.numbers=from [[max]]
-
 fotki.promo.slogan=Organise your photos and images with LiveJournal PhotoAlbums...
 
 fotki.promo.description=Discover and share your photos with your friends and community.
@@ -2993,10 +2941,6 @@
 
 fotki.privacy.public=Public
 
-fotki.status.new_photo=[[ljuser]] has load new [[number]] photos in <a [[aopts]]>[[album]]</a> album.
-
-fotki.status.new_album=[[ljuser]] has create a new album <a [[aopts]]>[[album]]</a>.
-
 gender.female|staleness=1
 gender.female=Female
 

Modified: branches/r83.1/cgi-bin/LJ/User.pm
===================================================================
--- branches/r83.1/cgi-bin/LJ/User.pm	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/cgi-bin/LJ/User.pm	2011-08-25 08:26:40 UTC (rev 19839)
@@ -1792,16 +1792,19 @@
     croak "Invalid user object" unless LJ::isu($u);
 
     my $gender = $u->prop('gender') || '';
+    $gender = uc(substr($gender, 0, 1));
     if ($format eq '6a') {
         if ($gender && $gender !~ /^U/i) {
-            return uc(substr($gender, 0, 1)); # M|F
+            return $gender; # M|F
         } else {
             return "unspecified";
         }
     } elsif ($format eq 'dc') {
-        $gender = uc(substr($gender, 0, 1)) || '';
         return  ($gender eq 'M') ? 1 :
                 ($gender eq 'F') ? 2 : 0;
+    } elsif ($format eq 'ga') {
+        return  ($gender eq 'M') ? 'male' :
+                ($gender eq 'F') ? 'female' : 'all';
     } else {
         return;
     }

Modified: branches/r83.1/cgi-bin/LJ/Widget/EntryForm.pm
===================================================================
--- branches/r83.1/cgi-bin/LJ/Widget/EntryForm.pm	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/cgi-bin/LJ/Widget/EntryForm.pm	2011-08-25 08:26:40 UTC (rev 19839)
@@ -1478,6 +1478,7 @@
             'LJImage_WizardNoticeLink' => 'ljimage.wizardnoticelink',
             'LJCut_WizardNotice' => 'ljcut.wizardnotice',
             'LJCut_WizardNoticeLink' => 'ljcut.wizardnoticelink',
+            'LJRepost_Value' => 'ljrepost',
         );
 
         my %langmap_translated = map { $_ => BML::ml("fcklang.$langmap{$_}") }

Modified: branches/r83.1/cgi-bin/ljprotocol.pl
===================================================================
--- branches/r83.1/cgi-bin/ljprotocol.pl	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/cgi-bin/ljprotocol.pl	2011-08-25 08:26:40 UTC (rev 19839)
@@ -19,6 +19,7 @@
                       );
 
 use LJ::TimeUtil;
+use POSIX;
 
 LJ::Config->load;
 
@@ -2088,6 +2089,29 @@
         }
     };
 
+    # LJSUP-9616
+    if ($req->{'props'}->{'opt_backdated'}) {
+        my $state_date = POSIX::strftime("%Y-%m-%d", gmtime);
+        my $key = "stat:opt_backdated:$state_date";
+
+        LJ::MemCache::incr($key, 1) ||
+            (LJ::MemCache::add($key, 0),  LJ::MemCache::incr($key, 1));
+
+        my @ltime = gmtime(time());
+        my $current = sprintf("%04d-%02d-%02d %02d:%02d",
+                                 $ltime[5]+1900,
+                                 $ltime[4] + 1,
+                                 $ltime[3],
+                                 $ltime[2],
+                                 $ltime[1]);
+
+        if ($eventtime ge $current) {
+            my $key_future = "stat:opt_backdated:future:$state_date";
+            LJ::MemCache::incr($key_future, 1) ||
+                (LJ::MemCache::add($key_future, 0),  LJ::MemCache::incr($key, 1));
+        }
+    }
+
     my $need_moderated = ( $uowner->{'moderated'} =~ /^[1A]$/ ) ? 1 : 0;
     if ( $uowner->{'moderated'} eq 'F' ) {
         ## Scan post for spam

Modified: branches/r83.1/htdocs/gadgets/logcom.bml
===================================================================
--- branches/r83.1/htdocs/gadgets/logcom.bml	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/gadgets/logcom.bml	2011-08-25 08:26:40 UTC (rev 19839)
@@ -14,6 +14,7 @@
     my $docid   = LJ::Request->get_param('docid');
     my $api_key = LJ::Request->get_param('rsk');
     my $domain  = LJ::Request->get_param('domain');
+    my $type    = LJ::Request->get_param('type');
 
     ## convert remote-site key to lj.com's community
     my $partner = LJ::PartnerSite->find_by_api_key($api_key);
@@ -74,7 +75,7 @@
                 'journalu'          => $journal,
                 'ditemid'           => $entry->ditemid,
                 'replyto'           => int ($replyto / 256),
-                'resources_html'    => $partner->resources_html,
+                'resources_html'    => $partner->resources_html({ type => $type }),
             });
     } else {
         ## display login widget
@@ -89,7 +90,7 @@
             'embedded'          => 1,
             'partner'           => $partner,
             'js_check_domain'   => $js_check_domain,
-            'resources_html'    => $partner->resources_html,
+            'resources_html'    => $partner->resources_html({ type => $type }),
             'forwhat'           => 'external',
             'thispage'          => $thispage,
             'lj_auth'           => 1,

Modified: branches/r83.1/htdocs/js/ck/config.js
===================================================================
--- branches/r83.1/htdocs/js/ck/config.js	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/ck/config.js	2011-08-25 08:26:40 UTC (rev 19839)
@@ -19,7 +19,6 @@
 		'clipboard,' +
 		'colorbutton,' +
 		'colordialog,' +
-		'contextmenu,' +
 		'dialog,' +
 		'enterkey,' +
 		'entities,' +
@@ -38,6 +37,10 @@
 		'undo,' +
 		'wysiwygarea,';
 
+	if(jQuery.browser.msie) { //show context menu only in internet explorer as it was in previous version of editor
+		config.plugins += 'contextmenu,';
+	}
+
 	config.fullPage = false;
 	config.startupOutlineBlocks = false;
 	config.autoGrow_maxHeight = 400;
@@ -147,6 +150,6 @@
 	config.extraPlugins = 'livejournal';
 	config.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi); // created lj polls;
 	config.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi);
-	config.protectedSource.push(/<lj-repost\s*\/?>/gi);
+	//config.protectedSource.push(/<lj-repost\s*\/?>/gi);
 
 };

Modified: branches/r83.1/htdocs/js/ck/contents.css
===================================================================
--- branches/r83.1/htdocs/js/ck/contents.css	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/ck/contents.css	2011-08-25 08:26:40 UTC (rev 19839)
@@ -45,12 +45,28 @@
 }
 
 lj\:cut,
-lj-cut {
+.lj-cut {
 	display: block;
 	border: #000 1px dotted;
 	background-color: #d2d2d2;
+	text-align: center;
 }
 
+.lj-map P {
+	position: relative;
+	top: 40%;
+	display: inline-block;
+	padding: 5px 15px;
+	margin: 0;
+	background: #FFF;
+	border: 1px solid #FF0000;
+	text-align: center;
+	text-transform: uppercase;
+	line-height: 12px;
+	font-size: 12px;
+	color: #FF0000;
+	}
+
 /* fix inline behavior, for no IE */
 lj-cut ul,
 lj-cut ol {
@@ -137,3 +153,12 @@
 		height: 24px;
 		background-position: 0 -21px;
 		}
+/* LJ map */
+.lj-map {
+	overflow: hidden;
+	min-height: 13px;
+	padding: 13px 20px;
+	margin-top: 20px;
+	background: #D2D2D2;
+	border: 1px dotted #000;
+	}

Modified: branches/r83.1/htdocs/js/ck/plugins/livejournal/plugin.js
===================================================================
--- branches/r83.1/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-25 08:26:40 UTC (rev 19839)
@@ -133,7 +133,8 @@
 			}
 
 			editor.dataProcessor.toHtml = function(html, fixForBody) {
-				html = html.replace(/<((?!br)[^\s>]+)([^\/>]+)?\/>/gi, '<$1$2></$1>')
+				html = html.replace(/(<lj [^>]+)(?!\/)>/gi, '$1 />')
+					.replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi, '<$1$2></$1>')
 					.replace(/<lj-template name=['"]video['"]>(\S+?)<\/lj-template>/g, '<div class="ljvideo" url="$1"><img src="' + Site
 					.statprefix + '/fck/editor/plugins/livejournal/ljvideo.gif" /></div>')
 					.replace(/<lj-poll .*?>[^\b]*?<\/lj-poll>/gm,
@@ -141,14 +142,13 @@
 						return new Poll(ljtags).outputHTML();
 					}).replace(/<lj-template(.*?)><\/lj-template>/g, "<lj-template$1 />");
 
+
 				// IE custom tags. http://msdn.microsoft.com/en-us/library/ms531076%28VS.85%29.aspx
 				if (CKEDITOR.env.ie) {
 					html = html.replace(/<([\/])?lj-raw>/g, '<$1lj:raw>').replace(/<([\/])?lj-wishlist>/g, '<$1lj:wishlist>')
 						.replace(/(<lj [^>]*)> /g, '$1> '); // IE merge spaces
-				} else {
-					// close <lj user> tags
-					html = html.replace(/(<lj [^>]*[^\/])>/g, '$1/> ');
 				}
+
 				if (!$('event_format').checked) {
 					html = '<pre>' + html + '</pre>';
 				}
@@ -195,8 +195,7 @@
 
 				// IE custom tags
 				if (CKEDITOR.env.ie) {
-					html = html.replace(/<lj:cut([^>]*)>/g, '<lj-cut$1>').replace(/<\/lj:cut>/g, '</lj-cut>')
-						.replace(/<([\/])?lj:wishlist>/g, '<$1lj-wishlist>').replace(/<([\/])?lj:raw>/g, '<$1lj-raw>');
+					html.replace(/<([\/])?lj:wishlist>/g, '<$1lj-wishlist>').replace(/<([\/])?lj:raw>/g, '<$1lj-raw>');
 				}
 
 				html = html.replace(/><\/lj-template>/g, '/>');// remove null pointer.replace(/\ufeff/g, '');
@@ -432,7 +431,7 @@
 							ljUsers[userName] = data.ljuser;
 
 							var tmpNode = editor.document.createElement('div');
-							tmpNode.setHtml(data.ljuser);
+							tmpNode.$.innerHTML = data.ljuser;
 							ljNoteData.LJUserLink.node = tmpNode.getFirst();
 							ljNoteData.LJUserLink.node.setAttribute('lj-cmd', 'LJUserLink');
 
@@ -495,7 +494,7 @@
 			});
 
 			editor.ui.addButton('LJLink', {
-				label: editor.lang.link.tollbar,
+				label: editor.lang.link.toolbar,
 				command: 'LJLink'
 			});
 
@@ -727,7 +726,7 @@
 				+ 'background-repeat: no-repeat;'
 				+ 'background-color: #CCCCCC;'
 				+ 'border: 1px dotted #000000;'
-				+ 'height: 80px;'
+				+ 'min-height: 80px;'
 			+ '}');
 
 			function doEmbed(content) {
@@ -761,8 +760,9 @@
 					} else {
 						text = prompt(top.CKLang.CutPrompt, top.CKLang.ReadMore);
 						if (text) {
-							ljNoteData.LJCut.node = editor.document.createElement('lj-cut');
+							ljNoteData.LJCut.node = editor.document.createElement('div');
 							ljNoteData.LJCut.node.setAttribute('lj-cmd', 'LJCut');
+							ljNoteData.LJCut.node.setAttribute('class', 'lj-cut');
 							if (text != top.CKLang.ReadMore) {
 								ljNoteData.LJCut.node.setAttribute('text', text);
 							}
@@ -825,7 +825,7 @@
 							if (pollSource.length > 0) {
 								if (ljNoteData.LJPollLink.node) {
 									var node = editor.document.createElement('div');
-									node.setHtml(pollSource);
+									node.$.innerHTML = pollSource;
 									ljNoteData.LJPollLink.node.insertBeforeMe(node);
 									ljNoteData.LJPollLink.node.remove();
 								} else {
@@ -1059,7 +1059,11 @@
 			dataProcessor.dataFilter.addRules({
 				elements: {
 					'lj-cut': function(element) {
-						element.attributes['lj-cmd'] = 'LJCut';
+						var fakeElement = new CKEDITOR.htmlParser.element('div');
+						fakeElement.attributes['lj-cmd'] = 'LJCut';
+						fakeElement.attributes['class'] = 'lj-cut';
+						fakeElement.children = element.children;
+						return fakeElement;
 					},
 					'lj-embed': function(element){
 						var fakeElement = new CKEDITOR.htmlParser.element('div');
@@ -1131,8 +1135,7 @@
 									var userName = ljTag.getAttribute('user');
 									var userTitle = ljTag.getAttribute('title');
 									if (cacheName == userTitle ? userName + ':' + userTitle : userName) {
-										ljTag.setHtml(ljUsers[cacheName]);
-										var newLjTag = ljTag.getFirst();
+										var newLjTag = CKEDITOR.dom.element.createFromHtml(ljUsers[cacheName], editor.document);
 										newLjTag.setAttribute('lj-cmd', 'LJUserLink');
 										ljTag.insertBeforeMe(newLjTag);
 										ljTag.remove();
@@ -1161,6 +1164,13 @@
 							});
 						}
 					},
+					'lj-repost': function(element){
+						var fakeElement = new CKEDITOR.htmlParser.element('input');
+						fakeElement.attributes.type = 'button';
+						fakeElement.attributes.value = top.CKLang.LJRepost_Value;
+						fakeElement.attributes['class'] = 'lj-repost';
+						return fakeElement;
+					},
 					a: function(element) {
 						element.attributes['lj-cmd'] = 'LJLink';
 					},
@@ -1173,24 +1183,46 @@
 			dataProcessor.htmlFilter.addRules({
 				elements: {
 					div: function(element) {
-						if (element.attributes['class'] == 'lj-like') {
-							var ljLikeNode = new CKEDITOR.htmlParser.element('lj-like');
-							ljLikeNode.attributes.buttons = element.attributes.buttons;
-							if (element.attributes.style) {
-								ljLikeNode.attributes.style = element.attributes.style;
-							}
-							ljLikeNode.isEmpty = true;
-							ljLikeNode.isOptionalClose = true;
-							return ljLikeNode;
-						} else if(element.attributes['class'] == 'lj-embed'){
-							var ljEmbedNode = new CKEDITOR.htmlParser.element('lj-embed');
-							ljEmbedNode.attributes.id = element.attributes.embedid;
-							ljEmbedNode.children = element.children;
+						var newElement = element;
+						switch(element.attributes['class']){
+							case 'lj-like':
+								newElement = new CKEDITOR.htmlParser.element('lj-like');
+								newElement.attributes.buttons = element.attributes.buttons;
+								if (element.attributes.style) {
+									newElement.attributes.style = element.attributes.style;
+								}
+								newElement.isEmpty = true;
+								newElement.isOptionalClose = true;
+							break;
+							case 'lj-embed':
+								newElement = new CKEDITOR.htmlParser.element('lj-embed');
+								newElement.attributes.id = element.attributes.embedid;
+								newElement.children = element.children;
+								newElement.isOptionalClose = true;
+							break;
+							case 'lj-map':
+								newElement = new CKEDITOR.htmlParser.element('lj-map');
+								newElement.attributes.url = decodeURIComponent(element.attributes['lj-url']);
+								element.attributes.style.replace(/([a-z-]+):(.*?);/gi, function(relust, name, value) {
+									newElement.attributes[name] = parseInt(value);
+								});
 
-							return ljEmbedNode;
-						} else if (!element.children.length) {
-							return false;
+								newElement.isOptionalClose = newElement.isEmpty = true;
+							break;
+							case 'lj-cut':
+								newElement = new CKEDITOR.htmlParser.element('lj-cut');
+								if(element.attributes.hasOwnProperty('text')){
+									newElement.attributes.text = element.attributes.text;
+								}
+								newElement.children = element.children;
+							break;
+							default:
+								if (!element.children.length) {
+									newElement = false;
+								}
 						}
+
+						return newElement;
 					},
 					span: function(element) {
 						var userName = element.attributes['lj:user'];
@@ -1206,6 +1238,13 @@
 							ljUserNode.isOptionalClose = ljUserNode.isEmpty = true;
 							return ljUserNode;
 						}
+					},
+					input: function(element){
+						if(element.attributes['class'] == 'lj-repost'){
+							var newElement = new CKEDITOR.htmlParser.element('lj-repost');
+							newElement.isOptionalClose = newElement.isEmpty = true;
+							return newElement;
+						}
 					}
 				},
 				attributes: {
@@ -1222,4 +1261,4 @@
 		requires: ['fakeobjects', 'domiterator']
 	});
 
-})();
\ No newline at end of file
+})();

Modified: branches/r83.1/htdocs/js/entry.js
===================================================================
--- branches/r83.1/htdocs/js/entry.js	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/entry.js	2011-08-25 08:26:40 UTC (rev 19839)
@@ -466,8 +466,8 @@
 	window
 		.open('', 'preview', 'width=760,height=600,resizable=yes,status=yes,toolbar=no,location=no,menubar=no,scrollbars=yes');
 	entryForm.submit();
+	entryForm.target = '_self';
 	entryForm.action = action;
-	entryForm.target = '_self';
 	return false;
 }
 
@@ -919,14 +919,14 @@
 	InOb.onClosePopup();
 
 	//var iframe = document.createElement("iframe");
-	var container = document.createElement("div");
-	container.id = "updateinsobject";
+	var container = document.createElement('div');
+	container.id = 'updateinsobject';
 	container.className = 'updateinsobject';
-	container.style.overflow = "hidden";
-	container.style.position = "absolute";
-	container.style.border = "0";
-	container.style.backgroundColor = "#fff";
+	container.style.overflow = 'hidden';
+	container.style.border = '0';
+	container.style.backgroundColor = '#fff';
 	container.style.zIndex = 1000;
+	container.style.position = 'fixed';
 
 	var iframe = document.createElement('iframe');
 	iframe.id = 'popupsIframe';
@@ -939,6 +939,8 @@
 	container.appendChild(iframe);
 	currentPopup = container;
 	InOb.smallCenter();
+
+
 	InOb.onresize = function(){
 		return InOb.smallCenter();
 	};
@@ -1273,10 +1275,12 @@
 
 	DOM.setHeight(currentPopup, 300);
 	DOM.setWidth(currentPopup, 700);
-	DOM.setTop(currentPopup, (windims.y - 300) / 2);
-	DOM.setLeft(currentPopup, (windims.x - 715) / 2);
 
-	scroll(0, 0);
+	currentPopup.style.top = '50%';
+	currentPopup.style.marginTop = '-150px';
+
+	currentPopup.style.left = '50%';
+	currentPopup.style.marginLeft = '-350px';
 };
 
 InOb.setPreviousCb = function (cb){

Modified: branches/r83.1/htdocs/js/esn_inbox.js
===================================================================
--- branches/r83.1/htdocs/js/esn_inbox.js	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/esn_inbox.js	2011-08-25 08:26:40 UTC (rev 19839)
@@ -158,6 +158,8 @@
 
 // set up inbox buttons
 ESN_Inbox.initInboxBtns = function (folder, cur_folder) {
+
+    var delItem, markSpam;
     // 2 instances of action buttons
     for (var i=1; i<=2; i++) {
         if( $(folder + "_MarkRead_" + i) ) {
@@ -166,14 +168,19 @@
         if( $(folder + "_MarkUnread_" + i) ) {
             DOM.addEventListener($(folder + "_MarkUnread_" + i), "click", function(e) { ESN_Inbox.markUnread(e, folder) });
         }
-        if( $(folder + "_Delete_" + i) ) {
-            DOM.addEventListener($(folder + "_Delete_" + i), "click", function(e) { ESN_Inbox.deleteItems(e, this, folder) });
+
+        //we use bind because DOM.addEventListener doesn't handle differences in the this value in different browsers
+        delItem = $(folder + "_Delete_" + i);
+        if( delItem ) {
+            DOM.addEventListener(delItem, "click", (function(e) { ESN_Inbox.deleteItems(e, this, folder) }).bind(delItem));
         }
         if( $(folder + "_UnSpam_" + i) ) {
             DOM.addEventListener($(folder + "_UnSpam_" + i), "click", function(e) { ESN_Inbox.markRead(e, folder) });
         }
-        if( $(folder + "_Spam_" + i) ) {
-            DOM.addEventListener($(folder + "_Spam_" + i), "click", function(e) { ESN_Inbox.markSpam(e, this, folder) });
+
+        markSpam = $(folder + "_Spam_" + i);
+        if( markSpam ) {
+            DOM.addEventListener(markSpam, "click", (function(e) { ESN_Inbox.markSpam(e, this, folder) }).bind(markSpam));
         }
     }
 

Modified: branches/r83.1/htdocs/js/rte.js
===================================================================
--- branches/r83.1/htdocs/js/rte.js	2011-08-25 08:16:40 UTC (rev 19838)
+++ branches/r83.1/htdocs/js/rte.js	2011-08-25 08:26:40 UTC (rev 19839)
@@ -26,6 +26,7 @@
 		if (draftData.ask && draftData.restoreData) {
 			if (confirm(draftData.confirmMsg)) {
 				draftData.lastValue = draftData.restoreData;
+				draftData.textArea.val(draftData.lastValue);
 				draftData.statusNode.val(draftData.draftStatus);
 			}
 		} else {
@@ -41,8 +42,19 @@
 		}
 
 		if (!window.switchedRteOn) {
+			if(!draftData){
+				draftData = {
+					textArea: $('#draft'),
+					statusNode: $('#draftstatus')
+				};
+
+				draftData.lastValue = draftData.textArea.val();
+
+				draftData.textArea.val(draftData.lastValue.replace(/<br\s?\/>\n?/g, '\n'));
+			}
+
 			window.switchedRteOn = true;
-			$('#switched_rte_on').value = '1';
+			$('#switched_rte_on').val('1');
 
 			if (!CKEditor && CKEDITOR && CKEDITOR.env.isCompatible) {
 				CKEDITOR.basePath = statPrefix + '/ck/';
@@ -59,7 +71,7 @@
 
 					$('#updateForm')[0].onsubmit = function() {
 						if (window.switchedRteOn) {
-							draftData.textArea.val(CKEditor.getData());
+							draftData.textArea.val(CKEditor.getData().replace(/(\r|\n)/g,'')); //we remove all newlines
 						}
 					};
 
@@ -69,7 +81,7 @@
 						CKEditor.container.show();
 						CKEditor.element.hide();
 
-						if (draftData) {
+						if (draftData.hasOwnProperty('draftStatus')) {
 							editor.on('dialogHide', checkDraftTimer);
 							editor.on('afterCommandExec', checkDraftTimer);
 							editor.on('insertElement', checkDraftTimer);
@@ -104,7 +116,7 @@
 
 		if (window.switchedRteOn) {
 			window.switchedRteOn = false;
-			$('#switched_rte_on').value = '0';
+			$('#switched_rte_on').val('0');
 
 			$('#entry-form-wrapper').attr('class', 'hide-richtext');
 			if (CKEditor) {
@@ -114,7 +126,7 @@
 				CKEditor.element.show();
 
 				// IE7 hack fix
-				if ($.browser.msie && $.browser.version == '7.0') {
+				if ($.browser.msie && ($.browser.version == '7.0' || $.browser.version == '8.0')) {
 					setTimeout(function() {
 						CKEditor.element.setValue(data);
 					}, 50);

Tags: bml, commitback, css, dat, js, livejournal, pl, pm, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments