-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish support for {{split article}}
- Loading branch information
1 parent
c59da30
commit a33afa2
Showing
20 changed files
with
682 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,48 @@ | ||
import type AttributionNotice from './AttributionNotice'; | ||
import { AttributionNoticePageGenerator } from '../ui/pages/AttributionNoticePageGenerator'; | ||
import { AttributionNoticePageGenerator } from '../ui/AttributionNoticePageGenerator'; | ||
import { AttributionNoticePageLayout } from '../ui/pages/AttributionNoticePageLayout'; | ||
|
||
export interface AttributionNoticeRowParent { | ||
addRow( row: any ): void; | ||
deleteRow( row: any ): void; | ||
} | ||
|
||
/** | ||
* An attribution notice's row or entry. | ||
*/ | ||
export abstract class AttributionNoticeRow<T extends AttributionNotice> | ||
export abstract class AttributionNoticeRow<T extends AttributionNoticeRowParent> | ||
implements AttributionNoticePageGenerator { | ||
|
||
protected _parent: T; | ||
/** | ||
* @return The parent of this attribution notice row. | ||
*/ | ||
abstract get parent(): T; | ||
get parent(): T { | ||
return this._parent; | ||
} | ||
|
||
/** | ||
* Sets the parent. Automatically moves this template from one | ||
* parent's row set to another. | ||
* | ||
* @param newParent The new parent. | ||
*/ | ||
set parent( newParent ) { | ||
this._parent.deleteRow( this ); | ||
newParent.addRow( this ); | ||
this._parent = newParent; | ||
} | ||
|
||
abstract generatePage( dialog: any ): AttributionNoticePageLayout; | ||
|
||
/** | ||
* Clones this row. | ||
* | ||
* @param parent The parent of this new row. | ||
* @return The cloned row | ||
*/ | ||
clone( parent: T ): AttributionNoticeRow<T> { | ||
// noinspection JSCheckFunctionSignatures | ||
return new ( this.constructor as any )( this, parent ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.