SlideShare uma empresa Scribd logo
1 de 14
ChanJS http://chanjs.nodester.com/ https://github.com/wearefractal/chanjs @WeAreFractal
ChanJS Pure-javascript image board using node.js, socket.io, mongoose, jade, stylus and spine.js Real time Not written in Perl Not written in 1995 Similarities to Facebook UI
Templating
- if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Board.tpl -> - if (data.length) 	- each thread in data 		div 			include Thread 	- else 		p Sorry, there are no threads! CommentInput.tpl -> form 	input type="text", placeholder = "Comment" 	input type="button" ... 	span image
- if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Thread.tpl -> - if (data.length) 	- each comment in item 		include Comment 		include CommentInput - else 	p Sorry, there are no Comments. CommentInput.tpl -> form 	input type="text", placeholder = "Comment" 	input type="button" ... 	span image
- if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Comment.tpl -> - if (data.length) 	div 		#{comment.text} CommentInput.tpl -> form 	input type="text", placeholder = "Comment" 	input type="button" ... 	span image
ChanJS – Category.tpl - if (data.length) ul 	- each item in data li= a(href='#/category/' + item._id item.name - else 	p Sorry, there are no categories.
Spine.js http://maccman.github.com/spine/
Spine.js Routing o.app =Spine.Controller.create({ 	init:function () { this.routes({ "/thread/:id":function (id) { o.renderModel('chanjs.Thread', {_id : id});  }, "/board/:id":function (id) { o.renderModel('chanjs.Board', {name : id}); }, "/category/:id":function (id) { o.renderModel('chanjs.Category', {_id: id}); }, "/":function (id) { o.loadTemplate('Category', function(){ o.renderModel('chanjs.Category', {}); 	}); }, }); } }).init(); Spine.Route.setup();

Mais conteúdo relacionado

Destaque

Boston Globe: Responsive Web Design
Boston Globe: Responsive Web DesignBoston Globe: Responsive Web Design
Boston Globe: Responsive Web DesignThe Media Consortium
 
Building A Web App In 100% JavaScript with Carl Bergenhem
 Building A Web App In 100% JavaScript with Carl Bergenhem Building A Web App In 100% JavaScript with Carl Bergenhem
Building A Web App In 100% JavaScript with Carl BergenhemFITC
 
Responsive web design ppt
Responsive web design pptResponsive web design ppt
Responsive web design pptNAWAZ KHAN
 
Responsive Design
Responsive DesignResponsive Design
Responsive DesignSara Cannon
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)admecindia1
 
Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheetschriseppstein
 
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012Matt Raible
 

Destaque (8)

Boston Globe: Responsive Web Design
Boston Globe: Responsive Web DesignBoston Globe: Responsive Web Design
Boston Globe: Responsive Web Design
 
Building A Web App In 100% JavaScript with Carl Bergenhem
 Building A Web App In 100% JavaScript with Carl Bergenhem Building A Web App In 100% JavaScript with Carl Bergenhem
Building A Web App In 100% JavaScript with Carl Bergenhem
 
Responsive web design ppt
Responsive web design pptResponsive web design ppt
Responsive web design ppt
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
 
Responsive web designing ppt(1)
Responsive web designing ppt(1)Responsive web designing ppt(1)
Responsive web designing ppt(1)
 
Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheets
 
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

ChanJS

  • 2. ChanJS Pure-javascript image board using node.js, socket.io, mongoose, jade, stylus and spine.js Real time Not written in Perl Not written in 1995 Similarities to Facebook UI
  • 3.
  • 5.
  • 6.
  • 7. - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Board.tpl -> - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! CommentInput.tpl -> form input type="text", placeholder = "Comment" input type="button" ... span image
  • 8.
  • 9. - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Thread.tpl -> - if (data.length) - each comment in item include Comment include CommentInput - else p Sorry, there are no Comments. CommentInput.tpl -> form input type="text", placeholder = "Comment" input type="button" ... span image
  • 10.
  • 11. - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! - if (data.length) - each thread in data div include Thread - else p Sorry, there are no threads! Comment.tpl -> - if (data.length) div #{comment.text} CommentInput.tpl -> form input type="text", placeholder = "Comment" input type="button" ... span image
  • 12. ChanJS – Category.tpl - if (data.length) ul - each item in data li= a(href='#/category/' + item._id item.name - else p Sorry, there are no categories.
  • 14. Spine.js Routing o.app =Spine.Controller.create({ init:function () { this.routes({ "/thread/:id":function (id) { o.renderModel('chanjs.Thread', {_id : id}); }, "/board/:id":function (id) { o.renderModel('chanjs.Board', {name : id}); }, "/category/:id":function (id) { o.renderModel('chanjs.Category', {_id: id}); }, "/":function (id) { o.loadTemplate('Category', function(){ o.renderModel('chanjs.Category', {}); }); }, }); } }).init(); Spine.Route.setup();