.plan
=====
Need
-------------------------------------------------------------------------------
### Bugs
* GO THROUGH ALL EXAMPLES FOR JS / CS
* Make sure all ids on headers make sense
* JS and CS buttons do not toggle all editors
* First load of TryEditor looks horrible
* website docs figure out what is missing
* website docs add live examples
* Remove sandbox?
* DOCS need to spacing on links for code anchors
Document jQuery ojAppend oj
### Website
* website learn page
* Top spacing to show header off #anchor-tag
* create js
* advanced css
* media query
* Binding List to model
* Binding table to model
* Creating a Type
* Creating a ModelType
* Creating a CollectionType
* Download page should say stuff=)
Want
-------------------------------------------------------------------------------
### Objects
* Try to shrink the size of oj.js by 50%
* Perf test OJ and then speed up HTML/CSS creation, and DOM manipulation
* Add oj to jsfiddle.net as includable library
* Add oj and plugins to one of the open source CDN (http://cdnjs.com/)
* JSFiddle doesn't work in anything but chrome
(this is jsfiddle.net bug)
* Bug: Literal notation should not require object at start. Use argumentsUnion (improves OJML examples)
* Commandline: Add --html option to build only the html (no js)
* Commandline: Add --js option to build on .js file
* Commandline: Add --css option to build on .css file
* Validation on form elements
validate:(value) ->
if value blasjdf
return 'failure message'
TextBox '2062189935', validate:oj.validPhoneNumber((err)-> if err alert('error happened'))), validate
* Bug: Fix .on handlers in attribute events (multi argument event bindings)
* Bug: Allow tags to take html snippets: oj.div('underlined stuff')
* Allow css to take raw css for plugins
* Feature: Consider adding Events to objects
* Feature: Compile.ojlc files as literate coffee-script
* GoogleChart plugin
* Area (P1)
* Bar (P1)
* Bubble (P1)
* Candlestick (P2)
* Column (P2) -- Fancy Bar Chart
* Combo (P1)
* Guage (P3)
* Geo (P1)
* Line (P2)
* Pie (P1)
* Timeline (P1)
* TreeMap (P1)
* Trendlines (P2)
* Table (P2)
* Scatter (P1)
* Google Analytics plugin
* Google AdWords plugin
* Create enums
* Consider event support on oj.Types
* Bootstrap Plugin
* Add concept of defaultThemes to Types
oj.Bootstrap.Button (P1)
oj.Bootstrap.BulletList (P1)
oj.Bootstrap.NumberList (P1)
oj.Bootstrap.List (P1)
oj.Bootstrap.InlineList (P1)
oj.Bootstrap.Table (P1)
theme:['striped', 'hover']
oj.Bootstrap.HorizontalDivider
...
* oj.Page
* Figure out page navigation and virtual page navigation
- Can I navigate to foo/bar, where bar transitions rather then refreshes?
- Triggering off of URL
- may require manual requiring of pages that can be transitioned to
* Should interface with oj.load
* Should interface with commandline tool to prepackage loadable pages
* oj.Grid (consider how this integrates with Boostrap, if at all)
- CSS Grid framework made easy
* oj.Tabs
* oj.Form
* Support form creation and submition with validation
* Consider moving Form elements into this plugin
* oj.Image
* Consider if
* oj.SpriteImage
* Support positioned sprites in background image
* oj.FontImage
* Support images derived from fonts.
* Consider if needs Bootstrap integration
* oj.NGridImage
* Support n grid
* consider support for sprites either in this object or SpriteImage
* oj.Bootstrap.Grid
* oj.Bootstrap.NavBar
* oj.SearchBox (text box + filter list)
* oj.FilterBox (list box + filter list to choose)
* oj.FacebookLikeButton -- embed a Facebook like button
* oj.GooglePlusButton -- embed a GooglePlusButton
* oj.TwitterTweet -- embed a tweet
* Optimization: Look up if _.filter and _.map are implemented in IE9+. Remove if so.
* Optimization: Look up underscore utilities to see if they exist in IE9+. Remove if so
* Optimization: Factor out the two methods needed from path to reduce file size (omit windows specific stuff)
* Unit tests: for build, watch, compile by string
* Unit test for View.removeAttribute and View.removeAttributes
* Write unit tests to verify properties can inherit get and set separately
* OJ static generator: client side unit tests
Like
-------------------------------------------------------------------------------
* oj.GoogleMap
* oj.BingMap
* oj.ScribdDocument
* oj.Region
liquid:true; n grid region with fixed width that grows with content
liquid:false; n grid region with fixed width and height. Supports layers of images
- consider horizontal region, vertical region
- consider grid related regions
- consider Row, Column as namings. (dynamic grid stuff?)
* Linked plugin doesn't recompile with watch enabled
* Bug: .json file type doesn't get sent to the client correctly in .oj and .ojc files
Questions
-------------------------------------------------------------------------------
Server-side Thinking
===============================================================================
Usage: oj [options] ...
Options:
-h, --help output usage information
-V, --version output the version number
-m, --minify Turn on minification (default: false)
-w, --watch Turn on watch mode (default: off)
-r, --recurse Recurse into directories (default: off)
-o, --output Directory to output all files to (default: .)
-v, --verbose Turn on verbose level 0-3 (default: 1)
-e, --exclude List of modules to exclude (jquery,oj,...)
Output Options:
--unify Output html/css/js into a single .html file
--html Output only the html
--css Output only the css
--js Output only the js
--js-modules Output the modules.js file
Path Options:
--modules-dir Directory to find modules.oj or modules.ojc
--html-dir
--css-dir
--js-dir
oj . foo --output www/ --jsdir foo/scripts --cssdir foo/styles --output-module foo/scripts/modules.js
--js Output .js files only
--js-modules Output modules.js that includes js (modules only)
--js-pages Output js pages
require
oj
jquery
modules
--script
--style
--module
Events
------------------------------------------
thingy = Thingy({
// Will bind on('inserted', fn)
events:{
// This is automatically bound when insertions happen
inserting:function(){
},
'inserted':function(){
}
}
thing.inserted.on(function(){
})
})
thingy.trigger('foobar:bar')
thingy.on('click', function(){})
thingy.off(fn)
thingy.one(function(){})
Questions on Versions
------------------------------------------
Go core or not?
Pros:
Illusion of smaller
Form, List and Table can evolve seperately
Cons:
Breaks compatability
Harder to get started
Almost everyone will need Forms and List for complex things
Work
Separate Form, List, Table
Add placeholder for Form, List, Table that when executed throws warning module is missing
0.2.0
Rewrite in JS
0.2.1
load event on tag functions
0.2.2
oj command - Build unified files
------------------------------------------------------------------------------
--unify
oj command - Build full website
------------------------------------------------------------------------------
Build a static website with enough configuration to make it structured however you want.
Reuse options that express needs
/
index.oj -> index.html and pages/index.js
modules.oj
modules/
modules.oj -> will convert to modules.js
pages/
index.js
login.js
blog/
index.js
scripts/
test.js
test.oj -> will convert to test.js
styles/
test.oj -> will convert to test.css
Pick a directory
--modules
--modules-output-dir
oj express - Build full website
------------------------------------------------------------------------------
app.use(oj.middleware({
modulesInDir:__dirname + "/modules",
modulesOutDir:__dirname +
minify: false
}))
Form Validation
-------------------------------------------------------------------------------
CreditCardTextBox
PhoneNumber
credit card
inList: (list) -> (v, prop) -> if not list?.indexOf? or list.indexOf(v) == -1 then "#{prop}: #{v} is not in list: #{list}"
inEnum: (enumList) -> (v, prop) -> if not enumList?.indexOf? or enumList.indexOf(v) == -1 then "#{prop}: #{v} is not in enum: #{enumList}"
range: (min, max) -> (v, prop) -> if v < min or max < v then "#{prop}: #{v} is not in range: [#{min}, #{max}]"
min: (min) -> (v, prop) -> if v < min then "#{prop}: #{v} is too small for min: #{min}"
max: (max) -> (v, prop) -> if v > max then "#{prop}: #{v} is too large for max: #{max}"
lessThan: (num) -> (v, prop) -> if v >= num then "#{prop}: #{v} is too large for lessThan: #{num}"
moreThan: (num) -> (v, prop) -> if v <= num then "#{prop}: #{v} is too small for moreThan: #{num}"
lengthRange: (min, max) -> (v, prop) -> if not v?.length? or v.length < min or max < v.length then "#{prop}: #{v}.length is not in range: [#{min}, #{max}]"
lengthMin: (min) -> (v, prop) -> if not v?.length? or v.length < min then "#{prop}: #{v}.length is too small for min: #{min}"
lengthMax: (max) -> (v, prop) -> if not v?.length? or v.length > max then "#{prop}: #{v}.length is too large for max: #{max}"
lengthLessThan: (num) -> (v, prop) -> if not v?.length? or v.length >= num then "#{prop}: #{v}.length is too large for lessThan: #{num}"
lengthMoreThan: (num) -> (v, prop) -> if not v?.length? or v.length <= num then "#{prop}: #{v}.length is too small for moreThan: #{num}"
Advanced Control thinking
-------------------------------------------------------------------------------
View
el
Core
Form
values # readwrite, map from element key to value
elements # map from element key to OJ instance (readonly)
submit() # submit the form
reset() # reset all elements
clear() # clear all elements
Form
FormView
clear()
reset()
validate:->
Button
type: 'submit' # Can be submit, reset, or null.
# It will bind submit and reset automatically
CheckBox
value: true/false
TextBox # Edit box
TextArea # Big area text box
ListBox # Pull down list box
FilterBox # Multi select. http://rmm5t.github.com/jquery-flexselect/
PasswordBox # Text box wit1h type:'password' set.
Button # Button
ResetButton # Helper button that automatically resets the form
SubmitButton # Helper button that automatically calls submit
CreditCardBox # (P3)
PhoneNumberBox # (P3)
RichTextBox
SearchBox # Like filter but uses ajax
Need
Form.TextFilterBox # Text + List box. Typing filters
Tabs
Image
ToolTip # Built in to all controls?
Form.FileBox # File upload + drag and drop
Want
Watch should trigger off of changes to required files (partials, templates)
This is pretty hard. Possibly watching triggers watching deeply as require is called
LightBox # Pop with screen darkening
Calendar
Form.DateBox # w/Calendar popup
Form.CreditCardBox
Form.ProgressBar
Form.SliderBar
Google.Maps # Hard but so important
Google.Plus.FollowMe
Facebook.LikeMe
Facebook.FollowMe
Twitter.FollowMe
Twitter.FollowCount
GitHub.FollowCount
GitHub.Repo
Like
CollapsiblePanel
ColorPicker
Rating # Star rating
Docking # Drag targets for elements, so hard
DragAndDrop # So hard... probably just go with jquery
ImageSlider # http://dev7studios.com/nivo-slider/#/support
Grid # Display grid to help designers.
ZoomBox # http://www.mind-projects.it/projects/jqzoom/demos.php#demo1
TreeMenu
Button
Input
TextArea
SubmitInput
Table id
-> inserted in the dom
$el awakens it
Table id dom fragment
Bootstrap thinking
-------------------------------------------------------------------------------
oj.use require(oj-bootstrap), global:true
oj.Bootstrap.Table
theme:['striped', 'hover']
oj.Bootstrap.Button
DropDownButton
size: large,small, mini
SplitButton
Tabs
add ->
Bootstrap.Tab 'Name', href:'#fooaction'
remove
get(3).disabled = true
move
Pills
add ->
Bootstrap.Pill 'Name', href:'#fooaction'
remove
move
disable(3)
enable(3)
NavList // have to think about headers
HorizontalDivider
TabbableNav
direction: 'left', 'below', 'above', 'right'
NavBar
position: 'fixed-top', 'fixed-bottom', 'static-top'
responsive: true
inverse: true
NavBrand
NavLink
NavVerticalDivider
NavForm
NavSearchBox
NavButton
align: 'left', 'right'
NavDropDown alias NavListBox
Breadcrumbs
Pagination
Pager
Label 'default', 'success', 'warning', 'important', 'info', 'inverse'
Badges 'default', 'success', 'warning', 'important', 'info', 'inverse'
Hero
PageHeader
Thumbnail span:4, image: 'foo.bar.js'
Alert
ProgressBar
theme:'default', 'basic', 'striped', 'animated', 'stacked', color:'warning'
MediaObject
MediaList
Well
Icon
Div
align:'left', 'right', 'center'
emphasis: 'warning', 'muted', 'error', 'info', 'success'
Abbreviation
title:'full text', short text
address
blockquote
BulletList
NumberList
List (unstyled)
InlineList
Code
Model thinking
-------------------------------------------------------------------------------
Table
inherits: CollectionView
each: (model) ->
rows: [list of lists of ojml] (readwrite)
row: (r) ->
[list of oj or element] (readwrite)
cell: (r,c) ->
oj or element (readwrite)
cellCount (readonly)
rowCount (readonly)
methods:
addRow(index)
removeRow(index)
make creates
empty
internals:
on change doesn't matter because the row / cell will do it
on add -- uses each to add a thing
on remove -- closes handlers on cells, row, and deletes row
Table.Row
inherits: ModelView
make: ->
tr ...
model: bind a model
each: (model)->
[list of ojml]
row: ->
get/set row all at once
cell: (c) ->
oj or element
cellCount (readonly)
addCell: (c) ->
removeCell: (c) ->
Layout Thinking
-------------------------------------------------------------------------------
Page
scripts
styles
title
body: ->
Layout OneQuarterRight,
small: ->
large: ->
body ->
GG columns:[25,75],
header: ->
first: ->
second: ->
third: ->
fourth: ->
fifth: ->
left: ->
middle: ->
right: ->
footer: ->