add code and design for submit
functionality
This commit is contained in:
parent
baa7686d5a
commit
4d42a6f845
@ -556,7 +556,7 @@
|
||||
var submitBtn = $( '#afchSubmitForm' );
|
||||
|
||||
// Empty the content area except for the button...
|
||||
$( '#afchContent' ).children().not( '#afchSubmitForm' ).remove();
|
||||
$( '#afchContent' ).contents().not( submitBtn ).remove();
|
||||
|
||||
// ...and set up the status log in its place
|
||||
AFCH.status.init( '#afchContent' );
|
||||
@ -712,7 +712,35 @@
|
||||
}
|
||||
|
||||
function handleSubmit ( data ) {
|
||||
return;
|
||||
var text = data.afchText,
|
||||
submitter = $.Deferred(),
|
||||
submitType = data.submitType;
|
||||
|
||||
if ( submitType === 'other' ) {
|
||||
submitter.resolve( data.submitterName );
|
||||
} else if ( submitType === 'self' ) {
|
||||
submitter.resolve( AFCH.consts.user );
|
||||
} else if ( submitType === 'creator' ) {
|
||||
afchPage.getCreator().done( function ( user ) {
|
||||
submitter.resolve( user );
|
||||
} );
|
||||
} else {
|
||||
// Custom selected submitter
|
||||
submitter.resolve( data.submitType );
|
||||
}
|
||||
|
||||
submitter.done( function ( submitter ) {
|
||||
afchSubmission.setStatus( '', { u: submitter } );
|
||||
|
||||
text.updateAfcTemplates( afchSubmission.makeWikicode() );
|
||||
|
||||
afchPage.edit( {
|
||||
contents: text.get(),
|
||||
summary: 'Submitting'
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
function handleG13 ( data ) {
|
||||
|
@ -68,10 +68,20 @@
|
||||
<!-- submit -->
|
||||
<div id="afchReviewPanel" class="submit">
|
||||
<div id="afchHeader" class="header">Submitting...</div>
|
||||
<div id="afchContent" class="content">
|
||||
<div id="afchContent" class="content centered">
|
||||
Submit as
|
||||
<select id="submitType" class="afch-input">
|
||||
{{#customSubmitters}}
|
||||
<option value="{{name}}" {{#selected}}selected{{/selected}}>{{description}}</option>
|
||||
{{/customSubmitters}}
|
||||
<option value="creator">Page creator</option>
|
||||
<option value="self">Yourself</option>
|
||||
<option value="other">Someone else</option>
|
||||
</select>
|
||||
<input id="submitterName" type="text" class="afch-input hidden" placeholder="Username" />
|
||||
|
||||
<div id="afchSubmitForm" data-running="Submitting..." data-done="Submitted"
|
||||
class="gradient-button submit">Submit</div>
|
||||
class="gradient-button submit button-centered">Submit</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user