Browse Source
Merge branch 'master' of github.com:quirkyinc/semantic
Merge branch 'master' of github.com:quirkyinc/semantic
Conflicts: build/packaged/semantic.min.css Former-commit-id:pull/258/headfdddd1ecd9
Former-commit-id:a97d93fde2
47 changed files with 1196 additions and 289 deletions
Split View
Diff Options
-
2build/minified/collections/grid.min.css
-
2build/minified/collections/menu.min.css
-
2build/minified/collections/message.min.css
-
2build/minified/collections/table.min.css
-
2build/minified/elements/button.min.css
-
2build/minified/elements/header.min.css
-
2build/minified/elements/icons.min.css
-
2build/minified/modules/dropdown.min.css
-
2build/minified/modules/tab.js
-
2build/minified/modules/tab.min.js
-
2build/packaged/modules/tab.js
-
2build/packaged/semantic.min.css.REMOVED.git-id
-
2build/packaged/semantic.min.js.REMOVED.git-id
-
65build/uncompressed/collections/grid.css
-
5build/uncompressed/collections/menu.css
-
3build/uncompressed/collections/message.css
-
8build/uncompressed/collections/table.css
-
48build/uncompressed/elements/button.css
-
30build/uncompressed/elements/header.css
-
7build/uncompressed/elements/icons.css
-
1build/uncompressed/modules/dropdown.css
-
2build/uncompressed/modules/tab.js
-
138node/src/documents/index.html
-
2node/src/documents/specification/cssguide.html
-
138node/src/documents/specification/spec.html
-
65node/src/files/components/semantic/collections/grid.css
-
5node/src/files/components/semantic/collections/menu.css
-
3node/src/files/components/semantic/collections/message.css
-
8node/src/files/components/semantic/collections/table.css
-
48node/src/files/components/semantic/elements/button.css
-
30node/src/files/components/semantic/elements/header.css
-
7node/src/files/components/semantic/elements/icons.css
-
1node/src/files/components/semantic/modules/dropdown.css
-
2node/src/files/components/semantic/modules/tab.js
-
35node/src/files/javascript/home.js
-
598node/src/files/javascript/library/history.js
-
8node/src/files/stylesheets/semantic.css
-
3node/src/layouts/default.html.eco
-
93src/collections/grid.less
-
3src/collections/menu.less
-
3src/collections/message.less
-
9src/collections/table.less
-
48src/elements/button.less
-
31src/elements/header.less
-
8src/elements/icons.less
-
2src/modules/dropdown.less
-
2src/modules/tab.js
2
build/minified/collections/grid.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
build/minified/collections/menu.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1 +1 @@ |
|||
.ui.message{position:relative;min-height:18px;margin:1em 0;height:auto;background-color:rgba(0,0,0,.04);padding:1em;line-height:1.33;color:rgba(0,0,0,.6);-webkit-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-moz-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-o-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-ms-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-webkit-border-radius:.325em;-moz-border-radius:.325em;border-radius:.325em}.ui.message .header{font-size:1.33em;font-weight:700}.ui.message .header+p{margin-top:0}.ui.message p{opacity:.85;margin:1em 0}.ui.message>:first-child{margin-top:0}.ui.message>:last-child{margin-bottom:0}.ui.message ul.list{opacity:.85;list-style-position:inside;margin:.2em 0;padding:0}.ui.message ul.list li{position:relative;list-style-type:none;font-style:italic;margin:0 0 0 1em;padding:0}.ui.message ul.list li:before{position:absolute;content:'\2022';top:-.05em;left:-.8em;height:100%;vertical-align:baseline;opacity:.5}.ui.message ul.list li:first-child{margin-top:0}.ui.message>.icon.close{cursor:pointer;position:absolute;top:1em;right:.5em;opacity:.7;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-o-transition:opacity .1s linear;-ms-transition:opacity .1s linear;transition:opacity .1s linear}.ui.message>.icon.close:hover{opacity:1}.ui.message.visible,.ui.header.visible{display:block!important}.ui.message.hidden,.ui.header.hidden{display:none}.ui.compact.message{display:inline-block}.ui.attached.message{margin-bottom:0;-webkit-border-radius:.325em .325em 0 0;-moz-border-radius:.325em .325em 0 0;border-radius:.325em .325em 0 0;-webkit-box-shadow:0 0 0 1px #DDD;-moz-box-shadow:0 0 0 1px #DDD;box-shadow:0 0 0 1px #DDD}.ui.bottom.attached.message{margin-top:0;-webkit-border-radius:0 0 .325em .325em;-moz-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em;-webkit-box-shadow:0 0 0 1px #DDD;-moz-box-shadow:0 0 0 1px #DDD;box-shadow:0 0 0 1px #DDD}.ui.attached.message .header{font-size:1.1em}.ui.attached.message .icon{float:right}.ui.icon.message>.icon{display:table-cell;vertical-align:middle;font-size:3.8em;padding-right:.4em;opacity:.2}.ui.icon.message>.content{display:table-cell;vertical-align:middle}.ui.inverted.message{background-color:rgba(255,255,255,.05);color:rgba(255,255,255,.95)}.ui.black.message{background-color:#333;color:rgba(255,255,255,.95)}.ui.blue.message,.ui.info.message{border-color:#E4F5FB;background-color:#E9F9FF;color:#4D8796}.ui.green.message,.ui.success.message,.ui.positive.message{background-color:#DEFCD5;color:#52A954;border-color:#4D965B}.ui.yellow.message,.ui.warning.message{background-color:#F6F3D5;border-color:#CBB105;color:#96904D}.ui.red.message,.ui.error.message,.ui.negative.message{background-color:#F1D7D7;color:#A95252;border-color:#964D4D}.ui.small.message{font-size:.875em}.ui.message{font-size:1em}.ui.large.message{font-size:1.125em}.ui.huge.message{font-size:1.5em}.ui.massive.message{font-size:2em} |
|||
.ui.message{position:relative;min-height:18px;margin:1em 0;height:auto;background-color:rgba(0,0,0,.04);padding:1em;line-height:1.33;color:rgba(0,0,0,.6);-webkit-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-moz-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-o-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-ms-transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;transition:opacity .1s ease,color .1s ease,background .1s ease,box-shadow .1s ease;-webkit-border-radius:.325em;-moz-border-radius:.325em;border-radius:.325em}.ui.message .header{font-size:1.33em;font-weight:700}.ui.message .header+p{margin-top:0}.ui.message p{opacity:.85;margin:1em 0}.ui.message>:first-child{margin-top:0}.ui.message>:last-child{margin-bottom:0}.ui.message ul.list{opacity:.85;list-style-position:inside;margin:.2em 0;padding:0}.ui.message ul.list li{position:relative;list-style-type:none;font-style:italic;margin:0 0 0 1em;padding:0}.ui.message ul.list li:before{position:absolute;content:'\2022';top:-.05em;left:-.8em;height:100%;vertical-align:baseline;opacity:.5}.ui.message ul.list li:first-child{margin-top:0}.ui.message>.icon.close{cursor:pointer;position:absolute;top:1em;right:.5em;opacity:.7;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-o-transition:opacity .1s linear;-ms-transition:opacity .1s linear;transition:opacity .1s linear}.ui.message>.icon.close:hover{opacity:1}.ui.message.visible,.ui.header.visible{display:block!important}.ui.message.hidden,.ui.header.hidden{display:none}.ui.compact.message{display:inline-block}.ui.attached.message{margin-bottom:0;-webkit-border-radius:.325em .325em 0 0;-moz-border-radius:.325em .325em 0 0;border-radius:.325em .325em 0 0;-webkit-box-shadow:0 0 0 1px #DDD;-moz-box-shadow:0 0 0 1px #DDD;box-shadow:0 0 0 1px #DDD}.ui.bottom.attached.message{margin-top:0;-webkit-border-radius:0 0 .325em .325em;-moz-border-radius:0 0 .325em .325em;border-radius:0 0 .325em .325em;-webkit-box-shadow:0 0 0 1px #DDD;-moz-box-shadow:0 0 0 1px #DDD;box-shadow:0 0 0 1px #DDD}.ui.attached.message .icon{float:right}.ui.icon.message>.icon{display:table-cell;vertical-align:middle;font-size:3.8em;padding-right:.4em;opacity:.2}.ui.icon.message>.content{display:table-cell;vertical-align:middle}.ui.inverted.message{background-color:rgba(255,255,255,.05);color:rgba(255,255,255,.95)}.ui.black.message{background-color:#333;color:rgba(255,255,255,.95)}.ui.blue.message,.ui.info.message{border-color:#E4F5FB;background-color:#E9F9FF;color:#4D8796}.ui.green.message,.ui.success.message,.ui.positive.message{background-color:#DEFCD5;color:#52A954;border-color:#4D965B}.ui.yellow.message,.ui.warning.message{background-color:#F6F3D5;border-color:#CBB105;color:#96904D}.ui.red.message,.ui.error.message,.ui.negative.message{background-color:#F1D7D7;color:#A95252;border-color:#964D4D}.ui.small.message{font-size:.875em}.ui.message{font-size:1em}.ui.large.message{font-size:1.125em}.ui.huge.message{font-size:1.5em}.ui.massive.message{font-size:2em} |
@ -1 +1 @@ |
|||
.ui.table{width:100%;border-collapse:collapse}.ui.table thead{border-bottom:1px solid rgba(0,0,0,.1)}.ui.table th,.ui.table tr,.ui.table td{border-collapse:collapse;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-o-transition:all .1s ease-out;-ms-transition:all .1s ease-out;transition:all .1s ease-out}.ui.table th{cursor:auto;background-color:rgba(0,0,0,.05);text-align:left;font-weight:700;padding:.5em .7em;vertical-align:middle}.ui.table tfoot th{font-weight:400;font-style:italic}.ui.table td{padding:.4em .7em;vertical-align:middle}.ui.table tfoot{border-top:1px solid rgba(0,0,0,.1)}.ui.table tbody tr:nth-child(2n){background-color:rgba(0,0,50,.02)}.ui.table>.icon{vertical-align:baseline}.ui.table>.icon:only-child{margin:0}.ui.table.segment:after{display:none}.ui.table.segment.stacked:after{display:block}.ui.celled.table tr:hover td{background-color:rgba(0,0,0,.02);color:#000}.ui.sortable.table thead th:hover{background-image:none;background-color:rgba(0,0,0,.04);color:#333}.ui.sortable.table th.disabled:hover{cursor:auto;background-color:rgba(0,0,0,.1);text-align:left;font-weight:700;color:#333;color:rgba(0,0,0,.8)}.ui.table tr.positive td,.ui.table td.positive{background-color:#F2F8F0!important;color:#119000}.ui.celled.table tr.positive:hover td,.ui.celled.table tr:hover td.positive,.ui.table tr.positive:hover td,.ui.table td:hover.positive,.ui.table th:hover.positive{background-color:#ECF5E9!important;color:#119000}.ui.table tr.negative td,.ui.table td.negative{background-color:#F9F4F4;color:#CD2929}.ui.celled.table tr.negative:hover td,.ui.celled.table tr:hover td.negative,.ui.table tr.negative:hover td,.ui.table td:hover.negative,.ui.table th:hover.negative{background-color:#F2E8E8!important;color:#CD2929}.ui.table tr.error td,.ui.table td.error,.ui.table th.error{background-color:#F9F4F4!important;color:#CD2929}.ui.celled.table tr.error:hover td,.ui.celled.table tr:hover td.error,.ui.table tr.error:hover td,.ui.table td:hover.error,.ui.table th:hover.error{background-color:#F2E8E8!important;color:#CD2929}.ui.table tr.warning td,.ui.table td.warning,.ui.table th.warning{background-color:#FBF6E9;color:#7D6C00}.ui.celled.table tr.warning:hover td,.ui.celled.table tr:hover td.warning,.ui.table tr.warning:hover td,.ui.table td:hover.warning,.ui.table th:hover.warning{background-color:#F3EDDC!important;color:#7D6C00}.ui.table tr.active td,.ui.table tr td.active{background-color:#F0F0F0!important;color:rgba(50,50,50,.9)}.ui.table tr.disabled td,.ui.table tr td.disabled,.ui.table tr.disabled:hover td,.ui.table tr:hover td.disabled{color:rgba(150,150,150,.3)}.ui.two.column.table td{width:50%}.ui.three.column.table td{width:33.3333%}.ui.four.column.table td{width:25%}.ui.five.column.table td{width:20%}.ui.six.column.table td{width:16.66667%}.ui.seven.column.table td{width:14.2857%}.ui.eight.column.table td{width:12.5%}.ui.nine.column.table td{width:11.1111%}.ui.ten.column.table td{width:10%}.ui.eleven.column.table td{width:9.0909%}.ui.twelve.column.table td{width:8.3333%}.ui.thirteen.column.table td{width:7.6923%}.ui.fourteen.column.table td{width:7.1428%}.ui.fifteen.column.table td{width:6.6666%}.ui.sixteen.column.table td{width:6.25%}.ui.celled.table{color:rgba(0,0,0,.8)}.ui.celled.table tbody tr,.ui.celled.table tfoot tr{border:0}.ui.celled.table th{border:1px solid #E0E0E0}.ui.celled.table tbody td{border:1px solid #E0E0E0}.ui.sortable.table thead th{cursor:pointer;white-space:nowrap}.ui.sortable.table thead th.sorted,.ui.sortable.table thead th.sorted:hover{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:rgba(0,0,0,.05)}.ui.sortable.table thead th:after{display:inline-block;content:'';width:1em;opacity:.8;margin:0 0 0 .5em;font-family:Icons;font-style:normal;font-weight:400;text-decoration:inherit;vertical-align:text-top}.ui.sortable.table thead th.ascending:after{content:'\25b4'}.ui.sortable.table thead th.descending:after{content:'\25be'}.ui.inverted.table th{background-color:rgba(0,0,0,.15)}.ui.inverted.table tbody tr:nth-child(2n){background-color:rgba(255,255,255,.06)}.ui.collapsing.table{width:auto}.ui.basic.table th{background-color:transparent;padding:.5em;font-weight:400}.ui.basic.table tbody tr{border-bottom:1px solid rgba(0,0,0,.05)}.ui.basic.table td{padding:.8em .5em}.ui.padded.table th,.ui.padded.table td{padding:.8em 1em}.ui.compact.table th{padding:.3em .5em}.ui.compact.table td{padding:.2em .5em}.ui.small.table{font-size:14px}.ui.table{font-size:16px}.ui.large.table{font-size:18px} |
|||
.ui.table{width:100%;border-collapse:collapse}.ui.table thead{border-bottom:1px solid rgba(0,0,0,.1)}.ui.table th,.ui.table tr,.ui.table td{border-collapse:collapse;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-o-transition:all .1s ease-out;-ms-transition:all .1s ease-out;transition:all .1s ease-out}.ui.table th{cursor:auto;background-color:rgba(0,0,0,.05);text-align:left;color:rgba(0,0,0,.5);padding:.5em .7em;vertical-align:middle}.ui.table tfoot th{font-weight:400;font-style:italic}.ui.table td{padding:.4em .7em;vertical-align:middle}.ui.table tfoot{border-top:1px solid rgba(0,0,0,.1)}.ui.table tbody tr:nth-child(2n){background-color:rgba(0,0,50,.02)}.ui.table>.icon{vertical-align:baseline}.ui.table>.icon:only-child{margin:0}.ui.table.segment:after{display:none}.ui.table.segment.stacked:after{display:block}.ui.sortable.table thead th:hover{background-image:none;background-color:rgba(0,0,0,.04);color:#333}.ui.sortable.table th.disabled:hover{cursor:auto;background-color:rgba(0,0,0,.1);text-align:left;font-weight:700;color:#333;color:rgba(0,0,0,.8)}.ui.table tr.positive td,.ui.table td.positive{background-color:#F2F8F0!important;color:#119000}.ui.celled.table tr.positive:hover td,.ui.celled.table tr:hover td.positive,.ui.table tr.positive:hover td,.ui.table td:hover.positive,.ui.table th:hover.positive{background-color:#ECF5E9!important;color:#119000}.ui.table tr.negative td,.ui.table td.negative{background-color:#F9F4F4;color:#CD2929}.ui.celled.table tr.negative:hover td,.ui.celled.table tr:hover td.negative,.ui.table tr.negative:hover td,.ui.table td:hover.negative,.ui.table th:hover.negative{background-color:#F2E8E8!important;color:#CD2929}.ui.table tr.error td,.ui.table td.error,.ui.table th.error{background-color:#F9F4F4!important;color:#CD2929}.ui.celled.table tr.error:hover td,.ui.celled.table tr:hover td.error,.ui.table tr.error:hover td,.ui.table td:hover.error,.ui.table th:hover.error{background-color:#F2E8E8!important;color:#CD2929}.ui.table tr.warning td,.ui.table td.warning,.ui.table th.warning{background-color:#FBF6E9;color:#7D6C00}.ui.celled.table tr.warning:hover td,.ui.celled.table tr:hover td.warning,.ui.table tr.warning:hover td,.ui.table td:hover.warning,.ui.table th:hover.warning{background-color:#F3EDDC!important;color:#7D6C00}.ui.table tr.active td,.ui.table tr td.active{background-color:#F0F0F0!important;color:rgba(50,50,50,.9)}.ui.table tr.disabled td,.ui.table tr td.disabled,.ui.table tr.disabled:hover td,.ui.table tr:hover td.disabled{color:rgba(150,150,150,.3)}.ui.two.column.table td{width:50%}.ui.three.column.table td{width:33.3333%}.ui.four.column.table td{width:25%}.ui.five.column.table td{width:20%}.ui.six.column.table td{width:16.66667%}.ui.seven.column.table td{width:14.2857%}.ui.eight.column.table td{width:12.5%}.ui.nine.column.table td{width:11.1111%}.ui.ten.column.table td{width:10%}.ui.eleven.column.table td{width:9.0909%}.ui.twelve.column.table td{width:8.3333%}.ui.thirteen.column.table td{width:7.6923%}.ui.fourteen.column.table td{width:7.1428%}.ui.fifteen.column.table td{width:6.6666%}.ui.sixteen.column.table td{width:6.25%}.ui.celled.table{color:rgba(0,0,0,.8)}.ui.celled.table tbody tr,.ui.celled.table tfoot tr{border:0}.ui.celled.table th{border:1px solid #E0E0E0}.ui.celled.table tbody td{border:1px solid #E0E0E0}.ui.sortable.table thead th{cursor:pointer;white-space:nowrap}.ui.sortable.table thead th.sorted,.ui.sortable.table thead th.sorted:hover{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:rgba(0,0,0,.05)}.ui.sortable.table thead th:after{display:inline-block;content:'';width:1em;opacity:.8;margin:0 0 0 .5em;font-family:Icons;font-style:normal;font-weight:400;text-decoration:inherit;vertical-align:text-top}.ui.sortable.table thead th.ascending:after{content:'\25b4'}.ui.sortable.table thead th.descending:after{content:'\25be'}.ui.inverted.table th{background-color:rgba(0,0,0,.15);color:rgba(255,255,255,.9)}.ui.inverted.table tbody tr:nth-child(2n){background-color:rgba(255,255,255,.06)}.ui.collapsing.table{width:auto}.ui.basic.table th{background-color:transparent;padding:.5em;font-weight:400}.ui.basic.table tbody tr{border-bottom:1px solid rgba(0,0,0,.05)}.ui.basic.table td{padding:.8em .5em}.ui.padded.table th,.ui.padded.table td{padding:.8em 1em}.ui.compact.table th{padding:.3em .5em}.ui.compact.table td{padding:.2em .5em}.ui.small.table{font-size:14px}.ui.table{font-size:16px}.ui.large.table{font-size:18px} |
2
build/minified/elements/button.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1 +1 @@ |
|||
.ui.header{border:0;margin:1em 0 1rem;padding:0;font-size:1.33em;color:rgba(0,0,0,.8);font-weight:700;line-height:1.33}.ui.header .ui.sub.header,.ui.header .sub.header{font-size:1rem;font-weight:400;margin:0;padding:0;line-height:1.2;color:rgba(0,0,0,.5)}.ui.header .content{display:inline-block;vertical-align:middle}.ui.header .icon{margin-right:.5em}.ui.header:first-child{margin-top:0}.ui.header+p{margin-top:0}h1.ui.header{min-height:1rem;line-height:1.33;font-size:2rem}h2.ui.header{line-height:1.33;font-size:1.75rem}h3.ui.header{line-height:1.33;font-size:1.33rem}h4.ui.header{line-height:1.33;font-size:1.1rem}h5.ui.header{line-height:1.2;font-size:1rem}.ui.huge.header{min-height:1em;font-size:2em}.ui.large.header{font-size:1.75em}.ui.medium.header{font-size:1.33em}.ui.small.header{font-size:1.1em}.ui.tiny.header{font-size:1em}.ui.disabled.header{opacity:.5}.ui.blue.header{color:#6ECFF5!important}.ui.black.header{color:#5C6166!important}.ui.green.header{color:#A1CF64!important}.ui.red.header{color:#EF4D6D!important}.ui.purple.header{color:#564F8A!important}.ui.teal.header{color:#00B5AD!important}.ui.blue.dividing.header{border-bottom:3px solid #6ECFF5}.ui.black.dividing.header{border-bottom:3px solid #5C6166}.ui.green.dividing.header{border-bottom:3px solid #A1CF64}.ui.red.dividing.header{border-bottom:3px solid #EF4D6D}.ui.purple.dividing.header{border-bottom:3px solid #564F8A}.ui.teal.dividing.header{border-bottom:3px solid #00B5AD}.ui.inverted.header{color:#FFF}.ui.inverted.header .sub.header{color:rgba(255,255,255,.85)}.ui.inverted.black.header{background-color:#5C6166!important;color:#FFF!important}.ui.inverted.blue.header{background-color:#6ECFF5!important;color:#FFF!important}.ui.inverted.green.header{background-color:#A1CF64!important;color:#FFF!important}.ui.inverted.red.header{background-color:#EF4D6D!important;color:#FFF!important}.ui.inverted.purple.header{background-color:#564F8A!important;color:#FFF!important}.ui.inverted.teal.header{background-color:#00B5AD!important;color:#FFF!important}.ui.inverted.block.header{border-bottom:0}.ui.left.aligned.header{text-align:left}.ui.right.aligned.header{text-align:right}.ui.center.aligned.header{text-align:center}.ui.floated.header,.ui.left.floated.header{float:left;margin-right:.5em}.ui.right.floated.header{float:right;margin-left:.5em}.ui.fitted.header{padding:0}.ui.dividing.header{padding-bottom:.2rem;border-bottom:1px solid rgba(0,0,0,.1)}.ui.dividing.header .icon{margin-bottom:.2em}.ui.block.header{background-color:#F5F5F5;padding:.5em 1em}.ui.attached.header{padding:.5em 1rem;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1)}.ui.top.attached.header{margin-bottom:0;-webkit-border-radius:.3125em .3125em 0 0;-moz-border-radius:.3125em .3125em 0 0;border-radius:.3125em .3125em 0 0}.ui.bottom.attached.header{margin-top:0;-webkit-border-radius:0 0 .3125em .3125em;-moz-border-radius:0 0 .3125em .3125em;border-radius:0 0 .3125em .3125em}.ui.icon.header{display:block;margin-left:auto;margin-right:auto;text-align:center}.ui.icon.header .icon{display:block;font-size:4em;margin:0 auto .2em}.ui.icon.header .circular.icon,.ui.icon.header .square.icon{font-size:2em}.ui.block.icon.header .icon{margin-bottom:0}.ui.icon.header.aligned{display:block} |
|||
.ui.header{border:0;margin:1em 0 1rem;padding:0;font-size:1.33em;color:rgba(0,0,0,.8);font-weight:700;line-height:1.33}.ui.header:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui.header .ui.sub.header,.ui.header .sub.header{font-size:1rem;font-weight:400;margin:0;padding:0;line-height:1.2;color:rgba(0,0,0,.5)}.ui.header .content{display:inline-block;vertical-align:middle}.ui.header .icon{margin-right:.5em}.ui.header:first-child{margin-top:0}.ui.header:last-child{margin-bottom:0}.ui.header+p{margin-top:0}h1.ui.header{min-height:1rem;line-height:1.33;font-size:2rem}h2.ui.header{line-height:1.33;font-size:1.75rem}h3.ui.header{line-height:1.33;font-size:1.33rem}h4.ui.header{line-height:1.33;font-size:1.1rem}h5.ui.header{line-height:1.2;font-size:1rem}.ui.huge.header{min-height:1em;font-size:2em}.ui.large.header{font-size:1.75em}.ui.medium.header{font-size:1.33em}.ui.small.header{font-size:1.1em}.ui.tiny.header{font-size:1em}.ui.disabled.header{opacity:.5}.ui.blue.header{color:#6ECFF5!important}.ui.black.header{color:#5C6166!important}.ui.green.header{color:#A1CF64!important}.ui.red.header{color:#EF4D6D!important}.ui.purple.header{color:#564F8A!important}.ui.teal.header{color:#00B5AD!important}.ui.blue.dividing.header{border-bottom:3px solid #6ECFF5}.ui.black.dividing.header{border-bottom:3px solid #5C6166}.ui.green.dividing.header{border-bottom:3px solid #A1CF64}.ui.red.dividing.header{border-bottom:3px solid #EF4D6D}.ui.purple.dividing.header{border-bottom:3px solid #564F8A}.ui.teal.dividing.header{border-bottom:3px solid #00B5AD}.ui.inverted.header{color:#FFF}.ui.inverted.header .sub.header{color:rgba(255,255,255,.85)}.ui.inverted.black.header{background-color:#5C6166!important;color:#FFF!important}.ui.inverted.blue.header{background-color:#6ECFF5!important;color:#FFF!important}.ui.inverted.green.header{background-color:#A1CF64!important;color:#FFF!important}.ui.inverted.red.header{background-color:#EF4D6D!important;color:#FFF!important}.ui.inverted.purple.header{background-color:#564F8A!important;color:#FFF!important}.ui.inverted.teal.header{background-color:#00B5AD!important;color:#FFF!important}.ui.inverted.block.header{border-bottom:0}.ui.left.aligned.header{text-align:left}.ui.right.aligned.header{text-align:right}.ui.center.aligned.header{text-align:center}.ui.floated.header,.ui.left.floated.header{float:left;margin-right:.5em}.ui.right.floated.header{float:right;margin-left:.5em}.ui.fitted.header{padding:0}.ui.dividing.header{padding-bottom:.2rem;border-bottom:1px solid rgba(0,0,0,.1)}.ui.dividing.header .icon{margin-bottom:.2em}.ui.block.header{background-color:#F5F5F5;padding:.5em 1em}.ui.attached.header{padding:.5em 1rem;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1)}.ui.top.attached.header{margin-bottom:0;-webkit-border-radius:.3125em .3125em 0 0;-moz-border-radius:.3125em .3125em 0 0;border-radius:.3125em .3125em 0 0}.ui.bottom.attached.header{margin-top:0;-webkit-border-radius:0 0 .3125em .3125em;-moz-border-radius:0 0 .3125em .3125em;border-radius:0 0 .3125em .3125em}.ui.icon.header{display:block;margin-left:auto;margin-right:auto;text-align:center}.ui.icon.header .icon{float:none;display:block;font-size:4em;margin:0 auto .2em}.ui.icon.header .circular.icon,.ui.icon.header .square.icon{font-size:2em}.ui.block.icon.header .icon{margin-bottom:0}.ui.icon.header.aligned{display:block} |
2
build/minified/elements/icons.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
build/minified/modules/dropdown.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
build/minified/modules/tab.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1 +1 @@ |
|||
85c9e9a93541d688e90e6efc123558746af62295 |
|||
ee56553797de7db20d068816c781bed8c186abd7 |
@ -1 +1 @@ |
|||
d32baf742e05293d9320369a687d7a2cb59b3ba0 |
|||
bb2f5a577f6450a45c1b7d7e797d6059011256af |
@ -0,0 +1,138 @@ |
|||
--- |
|||
layout : 'default' |
|||
css : 'guide' |
|||
|
|||
title : 'Spec Files' |
|||
type : 'UI Specification' |
|||
--- |
|||
<div class="segment"> |
|||
<div class="container"> |
|||
<h1 class="ui header">Spec Files</h1> |
|||
</div> |
|||
</div> |
|||
<div class="main container"> |
|||
|
|||
<h2>Introduction</h2> |
|||
|
|||
<p>Semantic defines an exchange format for user interface. Writing your interface components to match the specifications allows others to easily use your interface components in their project.</p> |
|||
|
|||
<h3>Writing a Spec File</h3> |
|||
|
|||
<p>Before authoring an element you should begin by writing a spec file for your element. A specification file defines the structure and names used inside your element. For more information on naming convention visit our css and html guides.</p> |
|||
<p>A spec file also allows you to provide metadata to generate code for your element, this can be used to generate visual documentation of your element.</p> |
|||
|
|||
<h3>Common Specification</h3> |
|||
|
|||
<p>A spec file is a specially formatted json file.</p> |
|||
<div class="code" type="javascript"> |
|||
{ |
|||
// your element name should be a single word and match to the classname of your element |
|||
"Name": "Button", |
|||
|
|||
// you may include metadata |
|||
"Author": "Jack Lukic", |
|||
"Website": "http://www.semantic-ui.com" |
|||
"Version": "2.0", |
|||
|
|||
// All elements must specify whether it is an element, collection, module, or behavior |
|||
"Type": "Element", |
|||
|
|||
// definition of the html structure of each type of an element |
|||
"Types": { |
|||
"Standard" : ".ui.button" |
|||
}, |
|||
|
|||
// States are ways which elements show an innate change in its quality. |
|||
"States": { |
|||
"Active" : "active", |
|||
"Loading" : "loading", |
|||
"Disabled" : "disabled" |
|||
}, |
|||
|
|||
|
|||
// Variations are individual classnames which your element may receive to alter its look. Variations should, for the most part, be able to be used together to create more complex styles of an element. |
|||
"Variations": { |
|||
// If a set of variations are options of a single type (for example sizing may contain, small, medium, etc) then this can be defined as an array. |
|||
"Size": [ |
|||
"mini", |
|||
"tiny", |
|||
"small", |
|||
"medium", |
|||
"large", |
|||
"huge", |
|||
"massive" |
|||
], |
|||
// Types are exclusive forms of your element. For example a button cannot be an icon button and a text button. The definitions of the html structure of each element is written using emmet syntax. These are used to generate html structures for your elements. For more information visit: http://docs.emmet.io/abbreviations/syntax/ |
|||
"Types": { |
|||
"Standard" : ".ui.button", |
|||
"Icon" : ".ui.icon.button > i.icon", |
|||
} |
|||
"Color": [ |
|||
"black", |
|||
"green", |
|||
"red", |
|||
"blue", |
|||
"green", |
|||
"red", |
|||
"teal" |
|||
], |
|||
"Ordinality": [ |
|||
"secondary", |
|||
"tertiary" |
|||
], |
|||
"Attached": [ |
|||
"attached top", |
|||
"attached bottom", |
|||
"attached left", |
|||
"attached right" |
|||
], |
|||
"Circular" : "circular", |
|||
"Fluid" : "fluid" |
|||
}, |
|||
|
|||
// You may define a list of dummy text and selectors which can be filled with them. This is used by generators to export a style guide of your interface element. If you specify an array, each item will be used in order to fill the content of each match. |
|||
"Text": { |
|||
".ui.button": ["Button", "Click Me", "Lorem Ipsum"] |
|||
}, |
|||
|
|||
// Your module may optionally include a text definition of its variations to help clarify their purpose. This may include the definition of types or variations |
|||
"Definition": { |
|||
"Standard" : "A simple button", |
|||
"Icon" : "A button icon is formatted to contain only an icon", |
|||
"Size" : "A button can vary in size", |
|||
"Color" : "A button can have different colors", |
|||
"Ordinality" : "A button can blend into a page", |
|||
"Attached" : "A button can attach to other content", |
|||
"Circular" : "A button can be circular", |
|||
"Fluid" : "A button can be fluid" |
|||
} |
|||
} |
|||
</div> |
|||
|
|||
<h3>UI Elements</h3> |
|||
|
|||
<p>A UI element is a basic building block of a website. It may have a singular or group (plural) definition</p> |
|||
|
|||
<div class="code" type="javascript"> |
|||
{ |
|||
// in addition to the parameters above an element may contain a definition for its singular and plural type |
|||
"Types": { |
|||
// these types can only exist for class="ui button" |
|||
"Singular": { |
|||
"Standard" : ".ui.button", |
|||
"Icon" : ".ui.icon.button > i.add.icon", |
|||
"Labeled Icon" : ".ui.labeled.icon.button > i.add.icon" |
|||
}, |
|||
// these types can exist only for class="ui button" |
|||
"Group": { |
|||
"Standard" : ".ui.buttons > .button+.button+.button", |
|||
"Icon" : ".ui.buttons > ( (.button > i.icon.user) + (.button > i.icon.heart) + (.button > i.icon.lab))", |
|||
"Conditional" : ".ui.buttons > .button+.or+.button", |
|||
"Vertical" : ".vertical.ui.buttons > .button+.button+.button" |
|||
} |
|||
} |
|||
} |
|||
</div> |
|||
|
|||
|
|||
</div> |
@ -0,0 +1,35 @@ |
|||
semantic.home = {}; |
|||
|
|||
// ready event
|
|||
semantic.home.ready = function() { |
|||
|
|||
// selector cache
|
|||
var |
|||
$navigationItem = $('.demo .menu .item'), |
|||
$oddballItem = $navigationItem.filter('.oddball'), |
|||
// alias
|
|||
handler |
|||
; |
|||
|
|||
$navigationItem |
|||
.tabNavigation({ |
|||
history: true, |
|||
path: '/' |
|||
}) |
|||
; |
|||
$oddballItem |
|||
.on('click', function() { |
|||
$(this) |
|||
.tabNavigation('deactivate.all') |
|||
.tabNavigation('activate.tab', 'third') |
|||
.tabNavigation('activate.navigation', 'third') |
|||
; |
|||
}) |
|||
; |
|||
}; |
|||
|
|||
|
|||
// attach ready event
|
|||
$(document) |
|||
.ready(semantic.home.ready) |
|||
; |
@ -0,0 +1,598 @@ |
|||
/*! jQuery Address v${version} | (c) 2009, 2013 Rostislav Hristov | jquery.org/license */ |
|||
(function ($) { |
|||
|
|||
$.address = (function () { |
|||
|
|||
var _trigger = function(name) { |
|||
var e = $.extend($.Event(name), (function() { |
|||
var parameters = {}, |
|||
parameterNames = $.address.parameterNames(); |
|||
for (var i = 0, l = parameterNames.length; i < l; i++) { |
|||
parameters[parameterNames[i]] = $.address.parameter(parameterNames[i]); |
|||
} |
|||
return { |
|||
value: $.address.value(), |
|||
path: $.address.path(), |
|||
pathNames: $.address.pathNames(), |
|||
parameterNames: parameterNames, |
|||
parameters: parameters, |
|||
queryString: $.address.queryString() |
|||
}; |
|||
}).call($.address)); |
|||
$($.address).trigger(e); |
|||
return e; |
|||
}, |
|||
_array = function(obj) { |
|||
return Array.prototype.slice.call(obj); |
|||
}, |
|||
_bind = function(value, data, fn) { |
|||
$().bind.apply($($.address), Array.prototype.slice.call(arguments)); |
|||
return $.address; |
|||
}, |
|||
_unbind = function(value, fn) { |
|||
$().unbind.apply($($.address), Array.prototype.slice.call(arguments)); |
|||
return $.address; |
|||
}, |
|||
_supportsState = function() { |
|||
return (_h.pushState && _opts.state !== UNDEFINED); |
|||
}, |
|||
_hrefState = function() { |
|||
return ('/' + _l.pathname.replace(new RegExp(_opts.state), '') + |
|||
_l.search + (_hrefHash() ? '#' + _hrefHash() : '')).replace(_re, '/'); |
|||
}, |
|||
_hrefHash = function() { |
|||
var index = _l.href.indexOf('#'); |
|||
return index != -1 ? _l.href.substr(index + 1) : ''; |
|||
}, |
|||
_href = function() { |
|||
return _supportsState() ? _hrefState() : _hrefHash(); |
|||
}, |
|||
_window = function() { |
|||
try { |
|||
return top.document !== UNDEFINED && top.document.title !== UNDEFINED ? top : window; |
|||
} catch (e) { |
|||
return window; |
|||
} |
|||
}, |
|||
_js = function() { |
|||
return 'javascript'; |
|||
}, |
|||
_strict = function(value) { |
|||
value = value.toString(); |
|||
return (_opts.strict && value.substr(0, 1) != '/' ? '/' : '') + value; |
|||
}, |
|||
_cssint = function(el, value) { |
|||
return parseInt(el.css(value), 10); |
|||
}, |
|||
_listen = function() { |
|||
if (!_silent) { |
|||
var hash = _href(), |
|||
diff = decodeURI(_value) != decodeURI(hash); |
|||
if (diff) { |
|||
if (_msie && _version < 7) { |
|||
_l.reload(); |
|||
} else { |
|||
if (_msie && !_hashchange && _opts.history) { |
|||
_st(_html, 50); |
|||
} |
|||
_value = hash; |
|||
_update(FALSE); |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
_update = function(internal) { |
|||
_st(_track, 10); |
|||
return _trigger(CHANGE).isDefaultPrevented() || |
|||
_trigger(internal ? INTERNAL_CHANGE : EXTERNAL_CHANGE).isDefaultPrevented(); |
|||
}, |
|||
_track = function() { |
|||
if (_opts.tracker !== 'null' && _opts.tracker !== NULL) { |
|||
var fn = $.isFunction(_opts.tracker) ? _opts.tracker : _t[_opts.tracker], |
|||
value = (_l.pathname + _l.search + |
|||
($.address && !_supportsState() ? $.address.value() : '')) |
|||
.replace(/\/\//, '/').replace(/^\/$/, ''); |
|||
if ($.isFunction(fn)) { |
|||
fn(value); |
|||
} else if ($.isFunction(_t.urchinTracker)) { |
|||
_t.urchinTracker(value); |
|||
} else if (_t.pageTracker !== UNDEFINED && $.isFunction(_t.pageTracker._trackPageview)) { |
|||
_t.pageTracker._trackPageview(value); |
|||
} else if (_t._gaq !== UNDEFINED && $.isFunction(_t._gaq.push)) { |
|||
_t._gaq.push(['_trackPageview', decodeURI(value)]); |
|||
} |
|||
} |
|||
}, |
|||
_html = function() { |
|||
var src = _js() + ':' + FALSE + ';document.open();document.writeln(\'<html><head><title>' + |
|||
_d.title.replace(/\'/g, '\\\'') + '</title><script>var ' + ID + ' = "' + encodeURIComponent(_href()).replace(/\'/g, '\\\'') + |
|||
(_d.domain != _l.hostname ? '";document.domain="' + _d.domain : '') + |
|||
'";</' + 'script></head></html>\');document.close();'; |
|||
if (_version < 7) { |
|||
_frame.src = src; |
|||
} else { |
|||
_frame.contentWindow.location.replace(src); |
|||
} |
|||
}, |
|||
_options = function() { |
|||
if (_url && _qi != -1) { |
|||
var i, param, params = _url.substr(_qi + 1).split('&'); |
|||
for (i = 0; i < params.length; i++) { |
|||
param = params[i].split('='); |
|||
if (/^(autoUpdate|history|strict|wrap)$/.test(param[0])) { |
|||
_opts[param[0]] = (isNaN(param[1]) ? /^(true|yes)$/i.test(param[1]) : (parseInt(param[1], 10) !== 0)); |
|||
} |
|||
if (/^(state|tracker)$/.test(param[0])) { |
|||
_opts[param[0]] = param[1]; |
|||
} |
|||
} |
|||
_url = NULL; |
|||
} |
|||
_value = _href(); |
|||
}, |
|||
_load = function() { |
|||
if (!_loaded) { |
|||
_loaded = TRUE; |
|||
_options(); |
|||
$('a[rel*="address:"]').address(); |
|||
if (_opts.wrap) { |
|||
var body = $('body'), |
|||
wrap = $('body > *') |
|||
.wrapAll('<div style="padding:' + |
|||
(_cssint(body, 'marginTop') + _cssint(body, 'paddingTop')) + 'px ' + |
|||
(_cssint(body, 'marginRight') + _cssint(body, 'paddingRight')) + 'px ' + |
|||
(_cssint(body, 'marginBottom') + _cssint(body, 'paddingBottom')) + 'px ' + |
|||
(_cssint(body, 'marginLeft') + _cssint(body, 'paddingLeft')) + 'px;" />') |
|||
.parent() |
|||
.wrap('<div id="' + ID + '" style="height:100%;overflow:auto;position:relative;' + |
|||
(_webkit && !window.statusbar.visible ? 'resize:both;' : '') + '" />'); |
|||
$('html, body') |
|||
.css({ |
|||
height: '100%', |
|||
margin: 0, |
|||
padding: 0, |
|||
overflow: 'hidden' |
|||
}); |
|||
if (_webkit) { |
|||
$('<style type="text/css" />') |
|||
.appendTo('head') |
|||
.text('#' + ID + '::-webkit-resizer { background-color: #fff; }'); |
|||
} |
|||
} |
|||
if (_msie && !_hashchange) { |
|||
var frameset = _d.getElementsByTagName('frameset')[0]; |
|||
_frame = _d.createElement((frameset ? '' : 'i') + 'frame'); |
|||
_frame.src = _js() + ':' + FALSE; |
|||
if (frameset) { |
|||
frameset.insertAdjacentElement('beforeEnd', _frame); |
|||
frameset[frameset.cols ? 'cols' : 'rows'] += ',0'; |
|||
_frame.noResize = TRUE; |
|||
_frame.frameBorder = _frame.frameSpacing = 0; |
|||
} else { |
|||
_frame.style.display = 'none'; |
|||
_frame.style.width = _frame.style.height = 0; |
|||
_frame.tabIndex = -1; |
|||
_d.body.insertAdjacentElement('afterBegin', _frame); |
|||
} |
|||
_st(function() { |
|||
$(_frame).bind('load', function() { |
|||
var win = _frame.contentWindow; |
|||
_value = win[ID] !== UNDEFINED ? win[ID] : ''; |
|||
if (_value != _href()) { |
|||
_update(FALSE); |
|||
_l.hash = _value; |
|||
} |
|||
}); |
|||
if (_frame.contentWindow[ID] === UNDEFINED) { |
|||
_html(); |
|||
} |
|||
}, 50); |
|||
} |
|||
_st(function() { |
|||
_trigger('init'); |
|||
_update(FALSE); |
|||
}, 1); |
|||
if (!_supportsState()) { |
|||
if ((_msie && _version > 7) || (!_msie && _hashchange)) { |
|||
if (_t.addEventListener) { |
|||
_t.addEventListener(HASH_CHANGE, _listen, FALSE); |
|||
} else if (_t.attachEvent) { |
|||
_t.attachEvent('on' + HASH_CHANGE, _listen); |
|||
} |
|||
} else { |
|||
_si(_listen, 50); |
|||
} |
|||
} |
|||
if ('state' in window.history) { |
|||
$(window).trigger('popstate'); |
|||
} |
|||
} |
|||
}, |
|||
_popstate = function() { |
|||
if (decodeURI(_value) != decodeURI(_href())) { |
|||
_value = _href(); |
|||
_update(FALSE); |
|||
} |
|||
}, |
|||
_unload = function() { |
|||
if (_t.removeEventListener) { |
|||
_t.removeEventListener(HASH_CHANGE, _listen, FALSE); |
|||
} else if (_t.detachEvent) { |
|||
_t.detachEvent('on' + HASH_CHANGE, _listen); |
|||
} |
|||
}, |
|||
_uaMatch = function(ua) { |
|||
ua = ua.toLowerCase(); |
|||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || |
|||
/(webkit)[ \/]([\w.]+)/.exec( ua ) || |
|||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || |
|||
/(msie) ([\w.]+)/.exec( ua ) || |
|||
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || |
|||
[]; |
|||
return { |
|||
browser: match[ 1 ] || '', |
|||
version: match[ 2 ] || '0' |
|||
}; |
|||
}, |
|||
_detectBrowser = function() { |
|||
var browser = {}, |
|||
matched = _uaMatch(navigator.userAgent); |
|||
if (matched.browser) { |
|||
browser[matched.browser] = true; |
|||
browser.version = matched.version; |
|||
} |
|||
if (browser.chrome) { |
|||
browser.webkit = true; |
|||
} else if (browser.webkit) { |
|||
browser.safari = true; |
|||
} |
|||
return browser; |
|||
}, |
|||
UNDEFINED, |
|||
NULL = null, |
|||
ID = 'jQueryAddress', |
|||
STRING = 'string', |
|||
HASH_CHANGE = 'hashchange', |
|||
INIT = 'init', |
|||
CHANGE = 'change', |
|||
INTERNAL_CHANGE = 'internalChange', |
|||
EXTERNAL_CHANGE = 'externalChange', |
|||
TRUE = true, |
|||
FALSE = false, |
|||
_opts = { |
|||
autoUpdate: TRUE, |
|||
history: TRUE, |
|||
strict: TRUE, |
|||
wrap: FALSE |
|||
}, |
|||
_browser = _detectBrowser(), |
|||
_version = parseFloat(_browser.version), |
|||
_webkit = _browser.webkit || _browser.safari, |
|||
_msie = !$.support.opacity, |
|||
_t = _window(), |
|||
_d = _t.document, |
|||
_h = _t.history, |
|||
_l = _t.location, |
|||
_si = setInterval, |
|||
_st = setTimeout, |
|||
_re = /\/{2,9}/g, |
|||
_agent = navigator.userAgent, |
|||
_hashchange = 'on' + HASH_CHANGE in _t, |
|||
_frame, |
|||
_form, |
|||
_url = $('script:last').attr('src'), |
|||
_qi = _url ? _url.indexOf('?') : -1, |
|||
_title = _d.title, |
|||
_silent = FALSE, |
|||
_loaded = FALSE, |
|||
_juststart = TRUE, |
|||
_updating = FALSE, |
|||
_listeners = {}, |
|||
_value = _href(); |
|||
|
|||
if (_msie) { |
|||
_version = parseFloat(_agent.substr(_agent.indexOf('MSIE') + 4)); |
|||
if (_d.documentMode && _d.documentMode != _version) { |
|||
_version = _d.documentMode != 8 ? 7 : 8; |
|||
} |
|||
var pc = _d.onpropertychange; |
|||
_d.onpropertychange = function() { |
|||
if (pc) { |
|||
pc.call(_d); |
|||
} |
|||
if (_d.title != _title && _d.title.indexOf('#' + _href()) != -1) { |
|||
_d.title = _title; |
|||
} |
|||
}; |
|||
} |
|||
|
|||
if (_h.navigationMode) { |
|||
_h.navigationMode = 'compatible'; |
|||
} |
|||
if (document.readyState == 'complete') { |
|||
var interval = setInterval(function() { |
|||
if ($.address) { |
|||
_load(); |
|||
clearInterval(interval); |
|||
} |
|||
}, 50); |
|||
} else { |
|||
_options(); |
|||
$(_load); |
|||
} |
|||
$(window).bind('popstate', _popstate).bind('unload', _unload); |
|||
|
|||
return { |
|||
bind: function(type, data, fn) { |
|||
return _bind.apply(this, _array(arguments)); |
|||
}, |
|||
unbind: function(type, fn) { |
|||
return _unbind.apply(this, _array(arguments)); |
|||
}, |
|||
init: function(data, fn) { |
|||
return _bind.apply(this, [INIT].concat(_array(arguments))); |
|||
}, |
|||
change: function(data, fn) { |
|||
return _bind.apply(this, [CHANGE].concat(_array(arguments))); |
|||
}, |
|||
internalChange: function(data, fn) { |
|||
return _bind.apply(this, [INTERNAL_CHANGE].concat(_array(arguments))); |
|||
}, |
|||
externalChange: function(data, fn) { |
|||
return _bind.apply(this, [EXTERNAL_CHANGE].concat(_array(arguments))); |
|||
}, |
|||
baseURL: function() { |
|||
var url = _l.href; |
|||
if (url.indexOf('#') != -1) { |
|||
url = url.substr(0, url.indexOf('#')); |
|||
} |
|||
if (/\/$/.test(url)) { |
|||
url = url.substr(0, url.length - 1); |
|||
} |
|||
return url; |
|||
}, |
|||
autoUpdate: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.autoUpdate = value; |
|||
return this; |
|||
} |
|||
return _opts.autoUpdate; |
|||
}, |
|||
history: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.history = value; |
|||
return this; |
|||
} |
|||
return _opts.history; |
|||
}, |
|||
state: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.state = value; |
|||
var hrefState = _hrefState(); |
|||
if (_opts.state !== UNDEFINED) { |
|||
if (_h.pushState) { |
|||
if (hrefState.substr(0, 3) == '/#/') { |
|||
_l.replace(_opts.state.replace(/^\/$/, '') + hrefState.substr(2)); |
|||
} |
|||
} else if (hrefState != '/' && hrefState.replace(/^\/#/, '') != _hrefHash()) { |
|||
_st(function() { |
|||
_l.replace(_opts.state.replace(/^\/$/, '') + '/#' + hrefState); |
|||
}, 1); |
|||
} |
|||
} |
|||
return this; |
|||
} |
|||
return _opts.state; |
|||
}, |
|||
strict: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.strict = value; |
|||
return this; |
|||
} |
|||
return _opts.strict; |
|||
}, |
|||
tracker: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.tracker = value; |
|||
return this; |
|||
} |
|||
return _opts.tracker; |
|||
}, |
|||
wrap: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_opts.wrap = value; |
|||
return this; |
|||
} |
|||
return _opts.wrap; |
|||
}, |
|||
update: function() { |
|||
_updating = TRUE; |
|||
this.value(_value); |
|||
_updating = FALSE; |
|||
return this; |
|||
}, |
|||
title: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
_st(function() { |
|||
_title = _d.title = value; |
|||
if (_juststart && _frame && _frame.contentWindow && _frame.contentWindow.document) { |
|||
_frame.contentWindow.document.title = value; |
|||
_juststart = FALSE; |
|||
} |
|||
}, 50); |
|||
return this; |
|||
} |
|||
return _d.title; |
|||
}, |
|||
value: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
value = _strict(value); |
|||
if (value == '/') { |
|||
value = ''; |
|||
} |
|||
if (_value == value && !_updating) { |
|||
return; |
|||
} |
|||
_value = value; |
|||
if (_opts.autoUpdate || _updating) { |
|||
if (_update(TRUE)) { |
|||
return this; |
|||
} |
|||
if (_supportsState()) { |
|||
_h[_opts.history ? 'pushState' : 'replaceState']({}, '', |
|||
_opts.state.replace(/\/$/, '') + (_value === '' ? '/' : _value)); |
|||
} else { |
|||
_silent = TRUE; |
|||
if (_webkit) { |
|||
if (_opts.history) { |
|||
_l.hash = '#' + _value; |
|||
} else { |
|||
_l.replace('#' + _value); |
|||
} |
|||
} else if (_value != _href()) { |
|||
if (_opts.history) { |
|||
_l.hash = '#' + _value; |
|||
} else { |
|||
_l.replace('#' + _value); |
|||
} |
|||
} |
|||
if ((_msie && !_hashchange) && _opts.history) { |
|||
_st(_html, 50); |
|||
} |
|||
if (_webkit) { |
|||
_st(function(){ _silent = FALSE; }, 1); |
|||
} else { |
|||
_silent = FALSE; |
|||
} |
|||
} |
|||
} |
|||
return this; |
|||
} |
|||
return _strict(_value); |
|||
}, |
|||
path: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
var qs = this.queryString(), |
|||
hash = this.hash(); |
|||
this.value(value + (qs ? '?' + qs : '') + (hash ? '#' + hash : '')); |
|||
return this; |
|||
} |
|||
return _strict(_value).split('#')[0].split('?')[0]; |
|||
}, |
|||
pathNames: function() { |
|||
var path = this.path(), |
|||
names = path.replace(_re, '/').split('/'); |
|||
if (path.substr(0, 1) == '/' || path.length === 0) { |
|||
names.splice(0, 1); |
|||
} |
|||
if (path.substr(path.length - 1, 1) == '/') { |
|||
names.splice(names.length - 1, 1); |
|||
} |
|||
return names; |
|||
}, |
|||
queryString: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
var hash = this.hash(); |
|||
this.value(this.path() + (value ? '?' + value : '') + (hash ? '#' + hash : '')); |
|||
return this; |
|||
} |
|||
var arr = _value.split('?'); |
|||
return arr.slice(1, arr.length).join('?').split('#')[0]; |
|||
}, |
|||
parameter: function(name, value, append) { |
|||
var i, params; |
|||
if (value !== UNDEFINED) { |
|||
var names = this.parameterNames(); |
|||
params = []; |
|||
value = value === UNDEFINED || value === NULL ? '' : value.toString(); |
|||
for (i = 0; i < names.length; i++) { |
|||
var n = names[i], |
|||
v = this.parameter(n); |
|||
if (typeof v == STRING) { |
|||
v = [v]; |
|||
} |
|||
if (n == name) { |
|||
v = (value === NULL || value === '') ? [] : |
|||
(append ? v.concat([value]) : [value]); |
|||
} |
|||
for (var j = 0; j < v.length; j++) { |
|||
params.push(n + '=' + v[j]); |
|||
} |
|||
} |
|||
if ($.inArray(name, names) == -1 && value !== NULL && value !== '') { |
|||
params.push(name + '=' + value); |
|||
} |
|||
this.queryString(params.join('&')); |
|||
return this; |
|||
} |
|||
value = this.queryString(); |
|||
if (value) { |
|||
var r = []; |
|||
params = value.split('&'); |
|||
for (i = 0; i < params.length; i++) { |
|||
var p = params[i].split('='); |
|||
if (p[0] == name) { |
|||
r.push(p.slice(1).join('=')); |
|||
} |
|||
} |
|||
if (r.length !== 0) { |
|||
return r.length != 1 ? r : r[0]; |
|||
} |
|||
} |
|||
}, |
|||
parameterNames: function() { |
|||
var qs = this.queryString(), |
|||
names = []; |
|||
if (qs && qs.indexOf('=') != -1) { |
|||
var params = qs.split('&'); |
|||
for (var i = 0; i < params.length; i++) { |
|||
var name = params[i].split('=')[0]; |
|||
if ($.inArray(name, names) == -1) { |
|||
names.push(name); |
|||
} |
|||
} |
|||
} |
|||
return names; |
|||
}, |
|||
hash: function(value) { |
|||
if (value !== UNDEFINED) { |
|||
this.value(_value.split('#')[0] + (value ? '#' + value : '')); |
|||
return this; |
|||
} |
|||
var arr = _value.split('#'); |
|||
return arr.slice(1, arr.length).join('#'); |
|||
} |
|||
}; |
|||
})(); |
|||
|
|||
$.fn.address = function(fn) { |
|||
if (!this.data('address')) { |
|||
this.on('click', function(e) { |
|||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which == 2) { |
|||
return true; |
|||
} |
|||
var target = e.currentTarget; |
|||
if ($(target).is('a')) { |
|||
e.preventDefault(); |
|||
var value = fn ? fn.call(target) : |
|||
/address:/.test($(target).attr('rel')) ? $(target).attr('rel').split('address:')[1].split(' ')[0] : |
|||
$.address.state() !== undefined && !/^\/?$/.test($.address.state()) ? |
|||
$(target).attr('href').replace(new RegExp('^(.*' + $.address.state() + '|\\.)'), '') : |
|||
$(target).attr('href').replace(/^(#\!?|\.)/, ''); |
|||
$.address.value(value); |
|||
} |
|||
}).on('submit', function(e) { |
|||
var target = e.currentTarget; |
|||
if ($(target).is('form')) { |
|||
e.preventDefault(); |
|||
var action = $(target).attr('action'), |
|||
value = fn ? fn.call(target) : (action.indexOf('?') != -1 ? action.replace(/&$/, '') : action + '?') + |
|||
$(target).serialize(); |
|||
$.address.value(value); |
|||
} |
|||
}).data('address', true); |
|||
} |
|||
return this; |
|||
}; |
|||
|
|||
})(jQuery); |
Write
Preview
Loading…
Cancel
Save