mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
add npm ignore
This commit is contained in:
parent
5d41421e81
commit
075f96ebdf
21
.npmignore
Normal file
21
.npmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
### Operating systems ###
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
### Regular dev ###
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
### bower ###
|
||||||
|
/bower_components/*
|
||||||
|
|
||||||
|
### tests ###
|
||||||
|
/test
|
||||||
|
|
@ -1,31 +1,16 @@
|
|||||||
<!doctype jsx>
|
<!doctype jsx>
|
||||||
<div className="nav">
|
|
||||||
<div jsx-repeat="category in this.props.model.nav">
|
|
||||||
<div className="category-title">{category.name}</div>
|
|
||||||
|
|
||||||
<div className="category-entries">
|
<div>
|
||||||
<div jsx-if="category.items.length > 0">
|
<div style= "position: relative; textAlign: center;
|
||||||
<div jsx-repeat="entry in category.items">
|
top: {this.props.config.previewTop};
|
||||||
<div jsx-if="entry.type == 'query'"
|
height: {this.props.config.previewHeight}">
|
||||||
className="{this.cs({selected: entry.name == this.props.model.selected.name, navlink: true})}"
|
|
||||||
onClick="=>this.props.controller.onQueryItemClicked(entry)">{entry.name}</div>
|
<div style="margin: auto; height: 100%; width: {this.props.config.previewWidth || '100%'}">
|
||||||
<div jsx-if="entry.type == 'tree'">
|
<iframe id="preview" src="http://localhost/sites/412?ds=true" style="width: 100%; height: 100%; border: 0"/>
|
||||||
<ul>
|
|
||||||
<li jsx-repeat="node in entry.model">
|
|
||||||
<div onClick="=>this.props.controller.onTreeItemClicked(entry, node)"
|
|
||||||
className="{this.cs({selected: this.isNodeSelected(entry, node), treelink1: true})}">{node.title}</div>
|
|
||||||
<ul jsx-if="node.children.length > 0">
|
|
||||||
<li jsx-repeat="child in node.children" onClick="=>this.props.controller.onTreeItemClicked(entry, child)">
|
|
||||||
<div className="{this.cs({selected: this.isNodeSelected(entry, child), treelink2: true})}">{child.title}</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button className="new-item-btn" jsx-repeat="typeInfo in category.newTypes" onClick="=>this.openAddItem(typeInfo.collectionId, typeInfo.typeName)"><span>Add {typeInfo.friendlyName}</span></button>
|
<div>editor
|
||||||
</div>
|
<div rt-if="!this.props.editorState.previewMode">left bar</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
@ -2,52 +2,32 @@ define([
|
|||||||
'react',
|
'react',
|
||||||
'lodash'
|
'lodash'
|
||||||
], function (React, _) {
|
], function (React, _) {
|
||||||
function generated1() {
|
return React.DOM.div.apply(this, _.flatten([{}].concat([
|
||||||
this.props.controller.onQueryItemClicked(entry);
|
|
||||||
}
|
|
||||||
function generated2() {
|
|
||||||
this.props.controller.onTreeItemClicked(entry, node);
|
|
||||||
}
|
|
||||||
function generated3() {
|
|
||||||
this.props.controller.onTreeItemClicked(entry, child);
|
|
||||||
}
|
|
||||||
function generated4() {
|
|
||||||
this.openAddItem(typeInfo.collectionId, typeInfo.typeName);
|
|
||||||
}
|
|
||||||
return React.DOM.div.apply(this, _.flatten([{ 'className': 'nav' }].concat([React.DOM.div.apply(this, _.flatten([{ 'jsx-repeat': 'category in this.props.model.nav' }].concat([
|
|
||||||
React.DOM.div.apply(this, _.flatten([{ 'className': 'category-title' }].concat([category.name]))),
|
|
||||||
React.DOM.div.apply(this, _.flatten([{ 'className': 'category-entries' }].concat([React.DOM.div.apply(this, _.flatten([{ 'jsx-if': 'category.items.length > 0' }].concat([React.DOM.div.apply(this, _.flatten([{ 'jsx-repeat': 'entry in category.items' }].concat([
|
|
||||||
React.DOM.div.apply(this, _.flatten([{
|
React.DOM.div.apply(this, _.flatten([{
|
||||||
'jsx-if': 'entry.type == \'query\'',
|
'style': {
|
||||||
'className': this.cs({
|
position: 'relative',
|
||||||
selected: entry.name == this.props.model.selected.name,
|
textAlign: 'center',
|
||||||
navlink: true
|
top: this.props.config.previewTop,
|
||||||
}),
|
height: this.props.config.previewHeight
|
||||||
'onClick': generated1.bind(this)
|
}
|
||||||
}].concat([entry.name]))),
|
|
||||||
React.DOM.div.apply(this, _.flatten([{ 'jsx-if': 'entry.type == \'tree\'' }].concat([React.DOM.ul.apply(this, _.flatten([{}].concat([React.DOM.li.apply(this, _.flatten([{ 'jsx-repeat': 'node in entry.model' }].concat([
|
|
||||||
React.DOM.div.apply(this, _.flatten([{
|
|
||||||
'onClick': generated2.bind(this),
|
|
||||||
'className': this.cs({
|
|
||||||
selected: this.isNodeSelected(entry, node),
|
|
||||||
treelink1: true
|
|
||||||
})
|
|
||||||
}].concat([node.title]))),
|
|
||||||
React.DOM.ul.apply(this, _.flatten([{ 'jsx-if': 'node.children.length > 0' }].concat([React.DOM.li.apply(this, _.flatten([{
|
|
||||||
'jsx-repeat': 'child in node.children',
|
|
||||||
'onClick': generated3.bind(this)
|
|
||||||
}].concat([React.DOM.div.apply(this, _.flatten([{
|
}].concat([React.DOM.div.apply(this, _.flatten([{
|
||||||
'className': this.cs({
|
'style': {
|
||||||
selected: this.isNodeSelected(entry, child),
|
margin: 'auto',
|
||||||
treelink2: true
|
height: '100%',
|
||||||
})
|
width: this.props.config.previewWidth || '100%'
|
||||||
}].concat([child.title])))])))])))
|
}
|
||||||
])))])))])))
|
}].concat([React.DOM.iframe.apply(this, _.flatten([{
|
||||||
])))])))]))),
|
'id': 'preview',
|
||||||
React.DOM.button.apply(this, _.flatten([{
|
'src': 'http://localhost/sites/412?ds=true',
|
||||||
'className': 'new-item-btn',
|
'style': {
|
||||||
'jsx-repeat': 'typeInfo in category.newTypes',
|
width: '100%',
|
||||||
'onClick': generated4.bind(this)
|
height: '100%',
|
||||||
}].concat([React.DOM.span.apply(this, _.flatten([{}].concat(['Add ' + typeInfo.friendlyName])))])))
|
border: '0'
|
||||||
])))])));
|
}
|
||||||
|
}].concat([])))])))]))),
|
||||||
|
React.DOM.div.apply(this, _.flatten([{}].concat([
|
||||||
|
'editor',
|
||||||
|
!this.props.editorState.previewMode ? React.DOM.div.apply(this, _.flatten([{}].concat(['left bar']))) : null
|
||||||
|
])))
|
||||||
|
])));
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user