forked from Botanical/BotanJS
		
	Gusets Comment Reply impl
This commit is contained in:
		@@ -555,7 +555,7 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		// Validation
 | 
			
		||||
		, fields = loggedIn ? ["content"] : ["content", "name", "email", "website"]
 | 
			
		||||
		, fields = loggedIn ? ["content"] : [ "content", "name", "email", "website", "email_notify" ]
 | 
			
		||||
		, _getFieldsValidated = function (obj)
 | 
			
		||||
		{
 | 
			
		||||
			var name, field, falsefield, f;
 | 
			
		||||
@@ -567,7 +567,8 @@
 | 
			
		||||
				falsefield = "false_" + name;
 | 
			
		||||
 | 
			
		||||
				f = Dand.id( falsefield );
 | 
			
		||||
				f.style.height = 0;
 | 
			
		||||
				if( f ) f.style.height = 0;
 | 
			
		||||
 | 
			
		||||
				switch(name)
 | 
			
		||||
				{
 | 
			
		||||
					case "name":
 | 
			
		||||
@@ -587,7 +588,7 @@
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							if(obj[name] == true)
 | 
			
		||||
								delete obj[name]
 | 
			
		||||
								delete obj[ name ];
 | 
			
		||||
						}
 | 
			
		||||
						break;
 | 
			
		||||
					case "email":
 | 
			
		||||
@@ -598,14 +599,29 @@
 | 
			
		||||
						}
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							if(obj[name] == true)
 | 
			
		||||
								delete obj[name]
 | 
			
		||||
							if( obj[ name ] == true )
 | 
			
		||||
								delete obj[ name ];
 | 
			
		||||
						}
 | 
			
		||||
						break;
 | 
			
		||||
					case "email_notify":
 | 
			
		||||
						if( obj[ name ] = Dand.id( field ).checked )
 | 
			
		||||
						{
 | 
			
		||||
							if( obj[ "email" ] == undefined )
 | 
			
		||||
							{
 | 
			
		||||
								obj[ name ] = false;
 | 
			
		||||
								Cycle.delay( function() { this.style.height = elmH; }.bind(f), 500 );
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						else
 | 
			
		||||
						{
 | 
			
		||||
							delete obj[ name ];
 | 
			
		||||
						}
 | 
			
		||||
						break;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			for(var i in obj) if(!obj[i]) return false;
 | 
			
		||||
			for( var i in obj )
 | 
			
		||||
				if( !obj[i] ) return false;
 | 
			
		||||
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								botanjs/src/Astro/Blog/Layout/Subs/Manage.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								botanjs/src/Astro/Blog/Layout/Subs/Manage.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
.ban-btn { color: red; }
 | 
			
		||||
.subs-type { margin: 1em; }
 | 
			
		||||
 | 
			
		||||
.subs-item {
 | 
			
		||||
	position: relative;
 | 
			
		||||
	margin: .5em 2.5em .5em .5em;
 | 
			
		||||
	border-left: 0.5em solid royalblue;
 | 
			
		||||
	background-color: white;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.subs-item > p a {
 | 
			
		||||
	color: orangered;
 | 
			
		||||
	margin: 0.5em;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										35
									
								
								botanjs/src/Astro/Blog/Layout/Subs/Manage.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								botanjs/src/Astro/Blog/Layout/Subs/Manage.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
(function(){
 | 
			
		||||
	var ns = __namespace( "Astro.Blog.Layout.Subs.Manage" );
 | 
			
		||||
	/** @type {Components.MessageBox} */
 | 
			
		||||
	var MessageBox                              = __import( "Components.MessageBox" );
 | 
			
		||||
	/** @type {Dandelion} */
 | 
			
		||||
	var Dand                                    = __import( "Dandelion" );
 | 
			
		||||
	/** @type {Astro.Bootstrap} */
 | 
			
		||||
	var Bootstrap                               = __import( "Astro.Bootstrap" );
 | 
			
		||||
	/** @type {Dandelion.IDOMElement} */
 | 
			
		||||
	var IDOMElement                             = __import( "Dandelion.IDOMElement" );
 | 
			
		||||
 | 
			
		||||
	var init = function ()
 | 
			
		||||
	{
 | 
			
		||||
		/** @type {Dandelion.IDOMElement} */
 | 
			
		||||
		var banbtn = Dand.id( "action-ban", true );
 | 
			
		||||
 | 
			
		||||
		if( banbtn )
 | 
			
		||||
		{
 | 
			
		||||
			banbtn.addEventListener( "Click", function( e ) {
 | 
			
		||||
				e.preventDefault();
 | 
			
		||||
 | 
			
		||||
				var msgBox = new MessageBox(
 | 
			
		||||
					"Ban this address"
 | 
			
		||||
					, "This action cannot be undone, confirm?"
 | 
			
		||||
					, "Yes", "No"
 | 
			
		||||
					, function( _confirm ) {
 | 
			
		||||
						if( !_confirm ) return;
 | 
			
		||||
						window.location = banbtn.getDAttribute( "href" );
 | 
			
		||||
					} ).show();
 | 
			
		||||
			} );
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	Bootstrap.regInit( init );
 | 
			
		||||
})();
 | 
			
		||||
							
								
								
									
										3
									
								
								botanjs/src/Astro/Blog/Layout/Subs/_this.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								botanjs/src/Astro/Blog/Layout/Subs/_this.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
(function(){
 | 
			
		||||
	var ns = __namespace( "Astro.Blog.Layout.Subs" );
 | 
			
		||||
})();
 | 
			
		||||
		Reference in New Issue
	
	Block a user