GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — init · osdio/noder-react-native@3acdc3c

This repository was archived by the owner on Jan 3, 2023. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .flowconfig
  • .gitignore
  • Podfile
  • README.md
  • app
    • components
      • comment
        • commentListView.js
        • commentRow.js
        • commentUp.js
      • coverImage.js
      • htmlRender
        • commentHtml.js
        • htmlContent.js
        • htmlRender.js
      • likeIcon.js
      • login.js
      • messageListView.js
      • overlay
        • commentOverlay.js
        • markAsReadOverlay.js
        • messageOverlay.js
        • overlayButton.js
        • return.js
        • userOverlay.js
      • pageListView.js
      • pageNavBar.js
      • pageScrollView.js
      • topicRow.js
      • topicsInTab.js
      • userTopicPage.js
    • config.js
    • config
      • onRun.js
      • routes.js
      • sceneConfig.js
    • mock
      • topic.js
      • userInfo.js
    • sass
      • _vars.scss
      • coverImage.scss
      • home.scss
      • pageListView.scss
      • pageNavBar.scss
      • topic.scss
    • scene
      • comments.js
      • home.js
      • message.js
      • qrCode.js
      • topic.js
      • user.js
    • services
      • messageService.js
      • request.js
      • topicService.js
      • userService.js
    • styles
      • coverImage.js
      • home.js
      • pageListView.js
      • pageNavBar.js
      • topic.js
    • util
      • animation.js
      • genColor.js
      • htmlParse.js
      • htmlparser2.js
      • storage.js
      • window.js
  • gulpFile.coffee
  • iOS
    • AppDelegate.h
    • AppDelegate.m
    • Base.lproj
      • LaunchScreen.xib
    • Images.xcassets
      • AppIcon.appiconset
        • Contents.json
      • bg2.imageset
        • Contents.json
        • [email protected]
        • [email protected]
        • [email protected]
    • Info.plist
    • main.jsbundle
    • main.m
  • index.ios.js
  • noder.xcodeproj
    • project.pbxproj
    • xcshareddata/xcschemes
      • noder.xcscheme
  • noderTests
    • Info.plist
    • noderTests.m
  • package.json

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.flowconfig‎

Copy file name to clipboard
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[ignore]
2+
3+
# We fork some components by platform.
4+
.*/*.web.js
5+
.*/*.android.js
6+
7+
# Some modules have their own node_modules with overlap
8+
.*/node_modules/node-haste/.*
9+
10+
# Ignore react-tools where there are overlaps, but don't ignore anything that
11+
# react-native relies on
12+
.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js
13+
.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js
14+
.*/node_modules/react-tools/src/browser/ui/React.js
15+
.*/node_modules/react-tools/src/core/ReactInstanceHandles.js
16+
.*/node_modules/react-tools/src/event/EventPropagators.js
17+
18+
# Ignore commoner tests
19+
.*/node_modules/react-tools/node_modules/commoner/test/.*
20+
21+
# See https://github.com/facebook/flow/issues/442
22+
.*/react-tools/node_modules/commoner/lib/reader.js
23+
24+
# Ignore jest
25+
.*/react-native/node_modules/jest-cli/.*
26+
27+
[include]
28+
29+
[libs]
30+
node_modules/react-native/Libraries/react-native/react-native-interface.js
31+
32+
[options]
33+
module.system=haste
Collapse file

‎.gitignore‎

Copy file name to clipboard
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# node.js
26+
#
27+
node_modules/
28+
npm-debug.log
29+
30+
.idea
31+
32+
app/mock/user.js
33+
34+
react-packager-cache**
35+
Collapse file

‎Podfile‎

Copy file name to clipboard
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#<React-Native>
2+
pod 'React', :path => 'node_modules/react-native'
3+
4+
#</React-Native>
Collapse file

‎README.md‎

Copy file name to clipboard
+77Lines changed: 77 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Noder - A React-Native Client for [cnodejs.org](http://cnodejs.org)
2+
3+
4+
> A new [cnodejs.org](http://cnodejs.org) mobile app powered by [React-Native](http://facebook.github.io/react-native/).
5+
6+
7+
## Develop
8+
9+
If you want to run it on you local simulator, you should:
10+
11+
```
12+
git clone https://github.com/soliury/noder-react-native.git
13+
npm install
14+
15+
```
16+
Then click run in Xcode, if failed, you should rebuild all package that this project used in Xcode(Just choose the package and **command+B** to run compile)
17+
18+
If you want to run on you local iPhone app, you should follow the [doc](http://facebook.github.io/react-native/docs/runningondevice.html#content).
19+
20+
21+
22+
## ScreenShots
23+
24+
![noder](http://7lrzfj.com1.z0.glb.clouddn.com/soliurynoder.gif)
25+
26+
27+
28+
## React-Native Modules Used
29+
30+
* [react-native-button](https://github.com/ide/react-native-button)
31+
* [react-native-camera](https://github.com/lwansbrough/react-native-camera)
32+
* [react-native-icons](https://github.com/corymsmith/react-native-icons)
33+
* [react-native-keyboardevents](https://github.com/johanneslumpe/react-native-keyboardevents)
34+
* [react-native-modal](https://github.com/brentvatne/react-native-modal)
35+
* [react-native-overlay](https://github.com/brentvatne/react-native-overlay)
36+
* [react-native-scrollable-tab-view](https://github.com/brentvatne/react-native-scrollable-tab-view)
37+
38+
Thanks All above.
39+
40+
## ToDo List
41+
42+
* Add up reply
43+
* Add setting panel
44+
* Add login out functional
45+
* Add Push Notification
46+
* Add about panel
47+
* Move the HTML render to a single Module
48+
* Refactor code
49+
* Solve the big bug
50+
* ***In ListView, sometime scroll on the bottom it can't refresh***
51+
* ListView **take too much memory**
52+
* HTML to native View render take too much **memory and time**
53+
* Push to App Store
54+
* Add test
55+
56+
## Change log
57+
58+
See [CHANGELOG]()
59+
60+
## Contribute
61+
62+
If you find any bugs, just solve it and submit a PR.
63+
64+
About the code style, Please use the ES6 JSX.
65+
66+
## License
67+
68+
[MIT License](http://en.wikipedia.org/wiki/MIT_License)
69+
70+
71+
72+
73+
74+
75+
76+
77+
Collapse file

‎app/components/comment/commentListView.js‎

Copy file name to clipboard
+214Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
var React = require('react-native');
2+
var window = require('../../util/window');
3+
var { width, height } = window.get();
4+
var precomputeStyle = require('precomputeStyle');
5+
6+
7+
var moment = require('moment');
8+
var Icon = require('FAKIconImage');
9+
var KeyboardEvents = require('react-native-keyboardevents');
10+
var KeyboardEventEmitter = KeyboardEvents.Emitter;
11+
var markdown = require("markdown").markdown;
12+
13+
var HtmlContent = require('../htmlRender/htmlContent');
14+
var Return = require('../overlay/return');
15+
var CommentOverlay = require('../overlay/commentOverlay');
16+
var CommentHtml = require('../htmlRender/commentHtml');
17+
var Storage = require('../../util/storage');
18+
19+
var topicService = require('../../services/topicService');
20+
21+
var genColor = require('../../util/genColor');
22+
var config = require('../../config');
23+
var animations = require('../../util/animation');
24+
var sceneConfig = require('../../config/sceneConfig')
25+
var routes = require('../../config/routes')
26+
27+
28+
var {
29+
View,
30+
StyleSheet,
31+
ScrollView,
32+
Component,
33+
Text,
34+
StatusBarIOS,
35+
Image,
36+
ListView,
37+
ActivityIndicatorIOS,
38+
TouchableOpacity,
39+
TouchableHighlight,
40+
Navigator,
41+
PushNotificationIOS,
42+
TextInput,
43+
LayoutAnimation
44+
} = React
45+
46+
47+
class CommentListView extends Component {
48+
constructor(props) {
49+
super(props)
50+
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
51+
var data = [];
52+
this.state = {
53+
ds: ds.cloneWithRows(data),
54+
commentLoading: false,
55+
user: null,
56+
textInput: null,
57+
replyUploading: false,
58+
isLoaded: false,
59+
didFocus: false
60+
}
61+
this.updateKeyboardSpace = this.updateKeyboardSpace.bind(this)
62+
this.resetKeyboardSpace = this.resetKeyboardSpace.bind(this)
63+
}
64+
65+
_renderRow(comment, sectionID, rowID, highlightRow) {
66+
var authorName = comment.author.loginname
67+
var domain = config.domain
68+
var date = moment(comment.create_at).startOf('minute').fromNow();
69+
var commentNum = this.comments.length - parseInt(rowID)
70+
var focusStyle = {}
71+
if (this.props.reply) {
72+
let replyId = this.props.reply.id
73+
//console.log(replyId == comment.id);
74+
if (replyId == comment.id) {
75+
focusStyle = {
76+
backgroundColor: 'rgba(0,2,125,0.07)'
77+
}
78+
}
79+
}
80+
81+
var footer = (
82+
<View style={styles.commentFooter}>
83+
<View style={styles.up}>
84+
<TouchableOpacity
85+
onPress={this._onUpPress.bind(this,comment.id)}>
86+
<Icon
87+
name={'ion|thumbsup'}
88+
size={20}
89+
color='rgba(0,0,0,0.2)'
90+
style={styles.upIcon}
91+
/>
92+
</TouchableOpacity>
93+
</View>
94+
95+
<View style={styles.reply}>
96+
<TouchableOpacity
97+
onPress={this._onReplyPress.bind(this, comment.id, authorName)}>
98+
<Icon
99+
name={'ion|reply'}
100+
size={20}
101+
color='rgba(0,0,0,0.35)'
102+
style={styles.replyIcon}
103+
/>
104+
</TouchableOpacity>
105+
</View>
106+
</View>
107+
)
108+
109+
110+
return (
111+
<View
112+
ref={view=>this[comment.id]=view}
113+
key={comment.id}
114+
style={[styles.commentWrapper,focusStyle]}>
115+
<View style={[styles.imageWrapper]}>
116+
<TouchableOpacity onPress={this._onAuthorImgPress.bind(this,authorName)}>
117+
<Image
118+
style={styles.authorImg}
119+
source={{uri:domain + comment.author.avatar_url}}
120+
>
121+
</Image>
122+
</TouchableOpacity>
123+
124+
<Text style={styles.commentNumText}>
125+
{commentNum} 楼
126+
</Text>
127+
</View>
128+
129+
<View style={styles.commentContentWrapper}>
130+
<View style={styles.commentHeader}>
131+
<View style={styles.author}>
132+
<TouchableOpacity onPress={this._onAuthorTextPress.bind(this,authorName)}>
133+
<Text style={styles.authorText}>
134+
{{authorName}}
135+
</Text>
136+
</TouchableOpacity>
137+
</View>
138+
139+
<View style={styles.date}>
140+
<Text style={styles.dateText}>
141+
{date}
142+
</Text>
143+
</View>
144+
</View>
145+
146+
<View style={styles.commentContent}>
147+
<CommentHtml
148+
style={commentHtmlStyle}
149+
content={comment.content}/>
150+
</View>
151+
152+
{!this.props.user || footer}
153+
</View>
154+
</View>
155+
)
156+
}
157+
158+
159+
_fetchComment() {
160+
if (this.state.commentLoading) {
161+
return
162+
}
163+
164+
this.setState({
165+
commentLoading: true
166+
})
167+
topicService.req.getTopicById(this.props.topic.id)
168+
.then(topic=> {
169+
this.topic = topic
170+
return topic.replies
171+
})
172+
.then(replies=> {
173+
return replies.reverse()
174+
})
175+
.then(comments=> {
176+
this.comments = comments
177+
this.setState({
178+
ds: this.state.ds.cloneWithRows(this.comments),
179+
commentLoading: false,
180+
isLoaded: true
181+
})
182+
})
183+
.catch((err)=> {
184+
console.warn(err)
185+
this.setState({
186+
commentLoading: false
187+
})
188+
})
189+
.done()
190+
}
191+
192+
193+
render() {
194+
return (
195+
<View
196+
ref={view=>this.commentsView=view}
197+
style={[styles.comments]}>
198+
<ListView
199+
ref={view => this._listView = view}
200+
style={{backgroundColor:'rgba(255,255,255,1)'}}
201+
showsVerticalScrollIndicator={true}
202+
initialListSize={10}
203+
pagingEnabled={false}
204+
removeClippedSubviews={true}
205+
dataSource={this.state.ds}
206+
renderRow={this._renderRow.bind(this)}
207+
/>
208+
</View>
209+
)
210+
}
211+
}
212+
213+
214+
module.exports = CommentListView
Collapse file

‎app/components/comment/commentRow.js‎

Copy file name to clipboardExpand all lines: app/components/comment/commentRow.js
Whitespace-only changes.
Collapse file

‎app/components/comment/commentUp.js‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var React = require('react-native')
2+
3+
var {
4+
Component,
5+
View
6+
} = React
7+
8+
9+
class CommentUp extends Component {
10+
constructor(props) {
11+
super(props)
12+
}
13+
14+
15+
render() {
16+
return (
17+
<View>
18+
19+
</View>
20+
)
21+
}
22+
}
23+
24+
25+
module.exports = CommentUp

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.